@arcgis/core 5.0.0-next.41 → 5.0.0-next.42

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 (38) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/d5fd6d0eaf96edfab123.js +1 -0
  3. package/config.js +1 -1
  4. package/kernel.js +1 -1
  5. package/package.json +1 -1
  6. package/support/revision.js +1 -1
  7. package/symbols/LabelSymbol3D.js +1 -1
  8. package/symbols/MeshSymbol3D.js +1 -1
  9. package/views/2d/ViewStateManager.js +1 -1
  10. package/views/2d/layers/CatalogDynamicGroupLayerView2D.js +1 -1
  11. package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
  12. package/views/2d/layers/CatalogLayerView2D.js +1 -1
  13. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  14. package/views/3d/layers/CatalogDynamicGroupLayerView3D.js +1 -1
  15. package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
  16. package/views/3d/layers/CatalogLayerView3D.js +1 -1
  17. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  18. package/views/SceneView.js +1 -1
  19. package/views/View2D.js +1 -1
  20. package/views/layers/BuildingComponentSublayerView.js +1 -1
  21. package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
  22. package/views/layers/CatalogFootprintLayerView.js +1 -1
  23. package/views/layers/CatalogLayerView.js +1 -1
  24. package/views/layers/FeatureLayerView.js +1 -1
  25. package/views/layers/HighlightLayerViewMixin.d.ts +2 -2
  26. package/views/layers/HighlightLayerViewMixin.js +5 -0
  27. package/views/layers/ImageryTileLayerView.js +1 -1
  28. package/views/layers/ImageryTileLayerViewMixin.js +5 -0
  29. package/views/layers/OGCFeatureLayerView.js +1 -1
  30. package/views/layers/SceneLayerView.js +1 -1
  31. package/views/layers/StreamLayerView.js +1 -1
  32. package/webscene/support/SlideEnvironment.js +1 -1
  33. package/widgets/AreaMeasurement2D.js +1 -1
  34. package/widgets/AreaMeasurement3D.js +1 -1
  35. package/widgets/Attachments.js +1 -1
  36. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  37. package/widgets/BasemapGallery.js +1 -1
  38. package/assets/esri/core/workers/chunks/926c2a0e21b7aa1a86e4.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./FeatureLayerView2D.js";import{CatalogFootprintLayerView as t}from"../../layers/CatalogFootprintLayerView.js";let s=class extends(t(e)){};s=r([o("esri.views.2d.layers.CatalogFootprintLayerView2D")],s);const a=s;export{a as default};
5
+ import{__decorate as r}from"tslib";import{subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./FeatureLayerView2D.js";import{CatalogFootprintLayerViewMixin as t}from"../../layers/CatalogFootprintLayerView.js";let s=class extends(t(e)){};s=r([o("esri.views.2d.layers.CatalogFootprintLayerView2D")],s);const a=s;export{a as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{property as r,subclass as a}from"../../../core/accessorSupport/decorators.js";import{LayerView2DMixin as i}from"./LayerView2D.js";import{CatalogLayerView as o}from"../../layers/CatalogLayerView.js";import s from"../../layers/LayerView.js";let l=class extends(o(i(s))){constructor(){super(...arguments),this.layerViews=new t}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};e([r()],l.prototype,"layerViews",void 0),l=e([a("esri.views.2d.layers.CatalogLayerView2D")],l);const n=l;export{n as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{property as r,subclass as a}from"../../../core/accessorSupport/decorators.js";import{LayerView2DMixin as i}from"./LayerView2D.js";import{CatalogLayerViewMixin as o}from"../../layers/CatalogLayerView.js";import s from"../../layers/LayerView.js";let l=class extends(o(i(s))){constructor(){super(...arguments),this.layerViews=new t}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};e([r()],l.prototype,"layerViews",void 0),l=e([a("esri.views.2d.layers.CatalogLayerView2D")],l);const n=l;export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as h}from"../../../core/accessorSupport/decorators.js";import{hasExcludedVariableOrDimension as u}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import l from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import d from"./imagery/ImageryTileView2D.js";import g from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as c}from"./support/util.js";import v from"../../layers/ImageryTileLayerView.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";let m=class extends(v(b(p(w)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlights=[],this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&c(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),a=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);a&&this._updateSubview();const n=e.multidimensionalDefinition!==i?.multidimensionalDefinition,h=e.rasterFunction!==i?.rasterFunction,u=h&&!this._useWebGLForProcessing,l=n||r||a||u||o;this.subview.redrawOrRefetch({refetch:l,reprocess:h}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&u(r,e)!==u(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)})},a),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>this._updateHighlightOptions(this.subview),a)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,t){if(!e.pixelRanges||Array.isArray(e.pixelRanges)&&0===e.pixelRanges.length)return i();const s={target:{...e},options:{...t}};return this._pixelHighlights.push(s),this._updateHighlightOptions(this.subview),i(()=>{const e=this._pixelHighlights.indexOf(s);-1!==e&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:t}=this;let s;if(s="rasterVF"===i?new g({layer:t,layerView:this,scheduler:this.scheduler}):"flow"===i?new l({layer:t,layerView:this,scheduler:this.scheduler}):new d({layer:t,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:e}=this;s.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}this._attachSubview(s),this._updateHighlightOptions(s),this.subview=s,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}_updateHighlightOptions(e){"raster"===e?.type&&e.updateHighlightOptions(this._pixelHighlights)}};e([n()],m.prototype,"subview",void 0),e([n()],m.prototype,"useWebGLForProcessing",null),e([n()],m.prototype,"useProgressiveUpdate",null),e([n({readOnly:!0})],m.prototype,"displayParameters",null),m=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],m);const y=m;export{y as default};
5
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as h}from"../../../core/accessorSupport/decorators.js";import{hasExcludedVariableOrDimension as u}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import l from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import d from"./imagery/ImageryTileView2D.js";import g from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as c}from"./support/util.js";import{ImageryTileLayerViewMixin as v}from"../../layers/ImageryTileLayerViewMixin.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";let m=class extends(v(b(p(w)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlights=[],this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&c(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),a=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);a&&this._updateSubview();const n=e.multidimensionalDefinition!==i?.multidimensionalDefinition,h=e.rasterFunction!==i?.rasterFunction,u=h&&!this._useWebGLForProcessing,l=n||r||a||u||o;this.subview.redrawOrRefetch({refetch:l,reprocess:h}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&u(r,e)!==u(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{s(e)||t.getLogger(this).error(e)})},a),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>this._updateHighlightOptions(this.subview),a)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,t){if(!e.pixelRanges||Array.isArray(e.pixelRanges)&&0===e.pixelRanges.length)return i();const s={target:{...e},options:{...t}};return this._pixelHighlights.push(s),this._updateHighlightOptions(this.subview),i(()=>{const e=this._pixelHighlights.indexOf(s);-1!==e&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:t}=this;let s;if(s="rasterVF"===i?new g({layer:t,layerView:this,scheduler:this.scheduler}):"flow"===i?new l({layer:t,layerView:this,scheduler:this.scheduler}):new d({layer:t,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:e}=this;s.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}this._attachSubview(s),this._updateHighlightOptions(s),this.subview=s,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}_updateHighlightOptions(e){"raster"===e?.type&&e.updateHighlightOptions(this._pixelHighlights)}};e([n()],m.prototype,"subview",void 0),e([n()],m.prototype,"useWebGLForProcessing",null),e([n()],m.prototype,"useProgressiveUpdate",null),e([n({readOnly:!0})],m.prototype,"displayParameters",null),m=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],m);const y=m;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../core/Collection.js";import{property as o,subclass as t}from"../../../core/accessorSupport/decorators.js";import{LayerView3D as i}from"./LayerView3D.js";import{CatalogDynamicGroupLayerView as a}from"../../layers/CatalogDynamicGroupLayerView.js";import s from"../../layers/LayerView.js";let p=class extends(a(i(s))){constructor(){super(...arguments),this.type="catalog-dynamic-group-3d",this.layerViews=new r}initialize(){this.addHandles([this.enableLayerUpdates()])}};e([o()],p.prototype,"layerViews",void 0),e([o()],p.prototype,"parent",void 0),e([o()],p.prototype,"view",void 0),p=e([t("esri.views.3d.layers.CatalogDynamicGroupLayerView3D")],p);const l=p;export{l as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Collection.js";import{property as o,subclass as t}from"../../../core/accessorSupport/decorators.js";import{LayerView3D as i}from"./LayerView3D.js";import{CatalogDynamicGroupLayerViewMixin as a}from"../../layers/CatalogDynamicGroupLayerView.js";import s from"../../layers/LayerView.js";let p=class extends(a(i(s))){constructor(){super(...arguments),this.type="catalog-dynamic-group-3d",this.layerViews=new r}initialize(){this.addHandles([this.enableLayerUpdates()])}};e([o()],p.prototype,"layerViews",void 0),e([o()],p.prototype,"parent",void 0),e([o()],p.prototype,"view",void 0),p=e([t("esri.views.3d.layers.CatalogDynamicGroupLayerView3D")],p);const l=p;export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./FeatureLayerViewBase3D.js";import{CatalogFootprintLayerView as i}from"../../layers/CatalogFootprintLayerView.js";let a=class extends(i(e)){constructor(){super(...arguments),this.type="catalog-footprint-3d"}get graphicOrigin(){return this.layer.graphicOrigin}};r([t()],a.prototype,"parent",void 0),r([t()],a.prototype,"graphicOrigin",null),a=r([o("esri.views.3d.layers.CatalogFootprintLayerView3D")],a);const s=a;export{s as default};
5
+ import{__decorate as r}from"tslib";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./FeatureLayerViewBase3D.js";import{CatalogFootprintLayerViewMixin as i}from"../../layers/CatalogFootprintLayerView.js";let a=class extends(i(e)){constructor(){super(...arguments),this.type="catalog-footprint-3d"}get graphicOrigin(){return this.layer.graphicOrigin}};r([t()],a.prototype,"parent",void 0),r([t()],a.prototype,"graphicOrigin",null),a=r([o("esri.views.3d.layers.CatalogFootprintLayerView3D")],a);const s=a;export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import e from"../../../core/Collection.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{LayerView3D as t}from"./LayerView3D.js";import{CatalogLayerView as a}from"../../layers/CatalogLayerView.js";import i from"../../layers/LayerView.js";let l=class extends(a(t(i))){constructor(){super(...arguments),this.type="catalog-3d",this.layerViews=new e}};r([o()],l.prototype,"layerViews",void 0),l=r([s("esri.views.3d.layers.CatalogLayerView3D")],l);const p=l;export{p as default};
5
+ import{__decorate as r}from"tslib";import e from"../../../core/Collection.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{LayerView3D as t}from"./LayerView3D.js";import{CatalogLayerViewMixin as a}from"../../layers/CatalogLayerView.js";import i from"../../layers/LayerView.js";let l=class extends(a(t(i))){constructor(){super(...arguments),this.type="catalog-3d",this.layerViews=new e}};r([o()],l.prototype,"layerViews",void 0),l=r([s("esri.views.3d.layers.CatalogLayerView3D")],l);const p=l;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as i,watch as r,sync as s}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{projectDatasetExtent as o}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as n}from"./LayerView3D.js";import{TiledLayerView3D as h}from"./TiledLayerView3D.js";import m from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as d}from"../terrain/RasterTile.js";import p from"../../layers/ImageryTileLayerView.js";import u from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as c}from"../../support/drapedUtils.js";import{getWebGLCapabilities as f}from"../../webgl/capabilities.js";let b=class extends(p(y(h(n(u))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this.addHandles([r(()=>this.layer.renderer,e=>{this._setSubView(e),this._updatingHandles.addPromise(this.doRefresh())},s),r(()=>[this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),s)])});this._setSubView(this.layer.renderer),this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,i=this._flowSubView;t&&null!=i||(i?.destroy(),this._flowSubView=t?new m({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[i,r]=this.tileInfo.size;return e.width=i,e.height=r,t.clearRect(0,0,i,r),t.getImageData(0,0,i,r)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,i=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,i)}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return o(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const i=this.tileInfo,r=this._canSymbolizeInWebGL(),s={tileInfo:i,requestRawData:r&&!this._hasFlow,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,noClip:!1},{layer:a}=this,[l,o,n]=e,h=await a.fetchTile(l,o,n,s);if(h instanceof HTMLImageElement)return h;let m=h?.pixelBlock;if(null==m)return this._blankTile;if(!r&&!this._hasFlow&&(m=await a.applyRenderer(h),null==m))return this._blankTile;const p=new d([l,o,n],m,i.size[0],i.size[1]);return r?(p.symbolizerRenderer=a.symbolizer.rendererJSON,p.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),p.transformGrid=h.transformGrid,p.bandIds=a.bandIds):(p.isRendereredSource=!0,p.bandIds=null),p.interpolation=a.interpolation,p}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return c(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=f(),{symbolizer:t}=this.layer,i=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,s=i&&i.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!r}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([a({readOnly:!0})],b.prototype,"_blankTile",null),e([a()],b.prototype,"_hasFlow",null),e([a({readOnly:!0})],b.prototype,"imageFormatIsOpaque",null),e([a({readOnly:!0})],b.prototype,"hasMixedImageFormats",null),e([a()],b.prototype,"_flowSubView",void 0),e([a({readOnly:!0})],b.prototype,"dataLevelRange",null),e([a({readOnly:!0})],b.prototype,"visibleAtCurrentScale",null),b=e([l("esri.views.3d.layers.ImageryTileLayerView3D")],b);const g=b;export{g as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as i,watch as r,sync as s}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{projectDatasetExtent as n}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as o}from"./LayerView3D.js";import{TiledLayerView3D as h}from"./TiledLayerView3D.js";import m from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as d}from"../terrain/RasterTile.js";import{ImageryTileLayerViewMixin as p}from"../../layers/ImageryTileLayerViewMixin.js";import u from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as c}from"../../support/drapedUtils.js";import{getWebGLCapabilities as f}from"../../webgl/capabilities.js";let b=class extends(p(y(h(o(u))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this.addHandles([r(()=>this.layer.renderer,e=>{this._setSubView(e),this._updatingHandles.addPromise(this.doRefresh())},s),r(()=>[this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),s)])});this._setSubView(this.layer.renderer),this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}_setSubView(e){if("wcs"===this.layer.type)return;const t="flow"===e?.type,i=this._flowSubView;t&&null!=i||(i?.destroy(),this._flowSubView=t?new m({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[i,r]=this.tileInfo.size;return e.width=i,e.height=r,t.clearRect(0,0,i,r),t.getImageData(0,0,i,r)}get _hasFlow(){return null!=this._flowSubView}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,i=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,i)}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return n(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const i=this.tileInfo,r=this._canSymbolizeInWebGL(),s={tileInfo:i,requestRawData:r&&!this._hasFlow,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,requestProjectedLocalDirections:this._hasFlow,noClip:!1},{layer:a}=this,[l,n,o]=e,h=await a.fetchTile(l,n,o,s);if(h instanceof HTMLImageElement)return h;let m=h?.pixelBlock;if(null==m)return this._blankTile;if(!r&&!this._hasFlow&&(m=await a.applyRenderer(h),null==m))return this._blankTile;const p=new d([l,n,o],m,i.size[0],i.size[1]);return r?(p.symbolizerRenderer=a.symbolizer.rendererJSON,p.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),p.transformGrid=h.transformGrid,p.bandIds=a.bandIds):(p.isRendereredSource=!0,p.bandIds=null),p.interpolation=a.interpolation,p}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return c(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=f(),{symbolizer:t}=this.layer,i=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,s=i&&i.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!r}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([a({readOnly:!0})],b.prototype,"_blankTile",null),e([a()],b.prototype,"_hasFlow",null),e([a({readOnly:!0})],b.prototype,"imageFormatIsOpaque",null),e([a({readOnly:!0})],b.prototype,"hasMixedImageFormats",null),e([a()],b.prototype,"_flowSubView",void 0),e([a({readOnly:!0})],b.prototype,"dataLevelRange",null),e([a({readOnly:!0})],b.prototype,"visibleAtCurrentScale",null),b=e([l("esri.views.3d.layers.ImageryTileLayerView3D")],b);const g=b;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/units.js";import{property as R,cast as T,subclass as x}from"../core/accessorSupport/decorators.js";import{ensureType as O,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as E}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as H}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as I}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as P}from"../core/support/OwningCollection.js";import{initialize as F}from"../core/workers/workers.js";import D from"../geometry/Extent.js";import G from"../geometry/HeightModelInfo.js";import U from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as J}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as K,isTiledLayer as X,isVoxelLayer as ee,isIntegratedMeshLayer as te}from"../layers/support/layerUtils.js";import{TilemapCache as ie}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as re}from"../portal/portalDefault.js";import{AnalysesCollection as se}from"../support/AnalysesCollection.js";import{WebSceneTag as ne}from"../support/tagSymbols.js";import{BreakpointsOwner as ae}from"./BreakpointsOwner.js";import{DOMContainer as oe}from"./DOMContainer.js";import{PopupView as le}from"./PopupView.js";import pe from"./View.js";import he from"./ViewAnimation.js";import{stringFromViewingMode as de,viewingModeFromString as ue}from"./ViewingMode.js";import{GroundView3D as ce}from"./3d/GroundView3D.js";import{layerView3DImporter as ge}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as me}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ye}from"./3d/camera/intersectionUtils.js";import{Constraints as fe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as we}from"./3d/environment/EnvironmentManager.js";import ve from"./3d/environment/SceneViewEnvironment.js";import _e from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as be}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Me}from"./3d/layers/graphics/Labeler.js";import Se from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Ve}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as je}from"./3d/state/ScreenSizePerspective.js";import Ce from"./3d/state/ViewState.js";import{ViewStateManager as Re,cleanupViewStateManager as Te}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as xe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Oe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ae}from"./3d/state/utils/navigationUtils.js";import Ee from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Le}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as He}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Ie}from"./3d/support/ElevationProvider.js";import{toMap as Pe,hitTest as Fe}from"./3d/support/hitTest.js";import{popupHitTest as De}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as Ge,getDefaultQualityProfileName as Ue}from"./3d/support/QualityProfile.js";import We from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as qe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ze}from"./3d/support/ResourceController.js";import ke from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Be}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ne}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Qe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ye from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ze,getTiledLayerInfo as $e,checkIfTileInfoSupportedForView as Je}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ke}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Xe}from"./3d/terrain/TileRenderer.js";import{Stage as et}from"./3d/webgl-engine/Stage.js";import{olidEnabled as tt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as it}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as rt}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as st}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as nt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as at}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import ot from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as lt}from"./support/drapedUtils.js";import{defaultHighlightName as pt}from"./support/HighlightDefaults.js";import ht from"./support/HighlightOptions.js";import{occludeesSupported as dt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ut,createScreenPointFromSupportedEvent as ct}from"./support/screenUtils.js";import{isSpatialReferenceSupported as gt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as mt,destroyTextureCompressionWorker as yt}from"./support/TextureCompressionHelper.js";import{check as ft}from"./support/WebGLRequirements.js";import wt from"./ui/DefaultUI.js";import vt from"./ui/3d/DefaultUI3D.js";import _t from"../webscene/Environment.js";import{clearVNodeCache as bt}from"../widgets/support/vnodeCache.js";var Mt;const St=Symbol(),Vt=Symbol();let jt=class extends(ae(le(oe(pe)))){static{Mt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ze(this),this.deconflictor=new be({view:this}),this.attribution3D=new Ee({view:this}),this.labeler=new Me({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new se,this.basemapTerrain=null,this.elevationProvider=new Le({view:this}),this._canvas=null,this.constraints=new fe,this._environment=new ve,this.environmentManager=new we,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ot({importAnalysisViewModule:e=>me(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Ce({view:this}),this.slice=new Ne,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new vt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,F();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new _e({view:this}),this.stateManager=new Re({view:this}),this.screenSizePerspective=new je({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=mt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ce({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(yt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}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=O(U,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=Ct(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:Ct(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=Ct(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=Ct(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new D({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(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 o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof ve?e:e instanceof _t?this.environment?.cloneWithWebsceneEnvironment(e)??ve.fromWebsceneEnvironment(e):O(ve,e):new ve}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 layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return Mt._layerToLayerview}static{this._layerToLayerview=pe._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}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&&ne in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=Ge(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new We(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Ue()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?G.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||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 de(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?de(this.defaultsFromMap.viewingMode):gt(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===pt)??new ht}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===pt)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 ke(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=ut(e)?ct(this,e):e;return Pe(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;let t=e;return null==e.z&&(t=Ot,t.x=e.x,t.y=e.y,t.z=Ie(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),N(t,Rt,this.renderSpatialReference),this.state.camera.projectToScreen(Rt,Tt),V(Tt[0],Tt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,Rt,i);const r=this.state.camera.computeScreenPixelSizeAt(Rt);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.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=ut(e)?ct(this,e):e;return Fe(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return De(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!tt())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return ge.importLayerView(e)}hasLayerViewModule(e){return ge.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}async validate(){let e=ft(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ue(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!gt(e,i)&&(null==t||(!!K(t)||(!X(t)||null!=$e(t,e,i))&&(!ee(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(K(t)&&(r||s)){return!s||2===i||null===Je(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return X(t)||ee(t)||!r&&!s?X(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${de(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&dt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await At[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ye({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Qe({view:this})),this.addHandles([this.updatingHandles.add(()=>He.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&He.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],St),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Vt),this.removeHandles(St),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",qe.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.groundView.spatialReference,xt,t)||(this.renderCoordsHelper.extent=xt)},w),Vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(rt/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(Vt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Oe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new et({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([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(rt/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Be({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.groundView?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ue(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?E(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(nt);for(const t of this.allLayerViews)te(t.layer)&&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(nt);for(const t of this.allLayerViews)te(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){bt(),L(),j(),at(),Te(),ye(),Ve(),k(),lt(),re(),Xe(),st(),xe(),Ae(),I(),M(),it(),Ke(),Se.cleanupI3SLodHandling(),ie.cleanupTilemapCache(),Ce.cleanupViewstate(),Ye.cleanupTerrainSurface()}};function Ct(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([R()],jt.prototype,"_userClippingArea",void 0),e([R()],jt.prototype,"_resourceController",void 0),e([R()],jt.prototype,"stage",null),e([R({readOnly:!0})],jt.prototype,"deconflictor",void 0),e([R({readOnly:!0})],jt.prototype,"labeler",void 0),e([R(P(se,"analyses"))],jt.prototype,"analyses",void 0),e([R({type:he,readOnly:!0})],jt.prototype,"animation",null),e([R({readOnly:!0})],jt.prototype,"basemapTerrain",void 0),e([R({readOnly:!0})],jt.prototype,"overlayManager",null),e([R({readOnly:!0})],jt.prototype,"elevationProvider",void 0),e([R()],jt.prototype,"camera",null),e([R({type:t})],jt.prototype,"contentCamera",null),e([R({readOnly:!0})],jt.prototype,"canvas",null),e([R({type:U,useTypeForAutocast:!1})],jt.prototype,"center",null),e([R({type:D})],jt.prototype,"clippingArea",null),e([R({type:fe,nonNullable:!0})],jt.prototype,"constraints",void 0),e([R({type:D,readOnly:!0})],jt.prototype,"renderDataExtent",null),e([R({readOnly:!0})],jt.prototype,"tileInfo",null),e([R({type:D,readOnly:!0})],jt.prototype,"dataExtent",null),e([R({type:D,readOnly:!0})],jt.prototype,"_groundAndLayersExtent",null),e([R({type:ve})],jt.prototype,"environment",null),e([T("environment")],jt.prototype,"castEnvironment",null),e([R({readOnly:!0})],jt.prototype,"environmentManager",void 0),e([R({type:D})],jt.prototype,"extent",null),e([R({type:r})],jt.prototype,"floors",void 0),e([R()],jt.prototype,"screenCenter",null),e([R()],jt.prototype,"frustum",null),e([R({type:Number,readOnly:!0})],jt.prototype,"fullOpacity",void 0),e([R({readOnly:!0})],jt.prototype,"graphicsView",void 0),e([R()],jt.prototype,"analysisViewManager",void 0),e([R()],jt.prototype,"groundView",void 0),e([R({readOnly:!0})],jt.prototype,"layerviewCollections",null),e([R({type:Boolean})],jt.prototype,"initialExtentRequired",null),e([R()],jt.prototype,"defaultsFromMapSettings",null),e([R()],jt.prototype,"interacting",null),e([R()],jt.prototype,"stationary",null),e([R()],jt.prototype,"navigating",null),e([R()],jt.prototype,"map",void 0),e([R()],jt.prototype,"padding",null),e([R({type:Qe,readOnly:!0})],jt.prototype,"pointsOfInterest",void 0),e([R()],jt.prototype,"_featureTiles",void 0),e([R()],jt.prototype,"featureTiles",null),e([R()],jt.prototype,"_featureTreeDebugger",void 0),e([R({constructOnly:!0})],jt.prototype,"deactivatedWebGLExtensions",void 0),e([R({constructOnly:!0})],jt.prototype,"debugWebGLExtensions",void 0),e([R({constructOnly:!0})],jt.prototype,"renderCanvas",void 0),e([R({constructOnly:!0})],jt.prototype,"state",void 0),e([R()],jt.prototype,"screenSizePerspective",void 0),e([R({readOnly:!0})],jt.prototype,"inputManager",void 0),e([R({readOnly:!0})],jt.prototype,"stateManager",void 0),e([R({type:["low","medium","high"]})],jt.prototype,"qualityProfile",null),e([R({type:We,get(){let e=this._get("qualitySettings");if(!e){const t=Ge(this.qualityProfile);e=new We(t)}return e}})],jt.prototype,"qualitySettings",void 0),e([R()],jt.prototype,"slice",void 0),e([R({readOnly:!0})],jt.prototype,"typeSpecificPreconditionsReady",null),e([R({readOnly:!0})],jt.prototype,"renderCoordsHelper",void 0),e([R({readOnly:!0})],jt.prototype,"sceneIntersectionHelper",void 0),e([R({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],jt.prototype,"resolution",null),e([R({type:Number})],jt.prototype,"scale",null),e([R({readOnly:!0,type:Number})],jt.prototype,"terrainLevel",null),e([R()],jt.prototype,"heightModelInfo",null),e([R()],jt.prototype,"spatialReference",void 0),e([R({type:Boolean,value:!1})],jt.prototype,"alphaCompositingEnabled",null),e([R({constructOnly:!0})],jt.prototype,"preserveDrawingBufferEnabled",void 0),e([R({type:Boolean})],jt.prototype,"supersampleScreenshotsEnabled",void 0),e([R({readOnly:!0})],jt.prototype,"type",void 0),e([R(),T(e=>e instanceof wt?e:A(vt,e))],jt.prototype,"ui",void 0),e([R({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],jt.prototype,"updating",null),e([R()],jt.prototype,"_updatingObjects",null),e([R()],jt.prototype,"_updatingObjectsWithProgress",null),e([R({type:Number,readOnly:!0,dependsOn:["updating"]})],jt.prototype,"updatingProgress",void 0),e([R({type:["global","local"]})],jt.prototype,"viewingMode",null),e([R({type:i})],jt.prototype,"viewpoint",null),e([R({readOnly:!0})],jt.prototype,"visibleArea",null),e([R({type:Number})],jt.prototype,"zoom",null),e([R({type:ht})],jt.prototype,"highlightOptions",null),e([R({readOnly:!0})],jt.prototype,"quality",null),e([R({readOnly:!0})],jt.prototype,"resolutionScale",null),e([R()],jt.prototype,"focusAreasView",void 0),e([R()],jt.prototype,"_defaultToMapOptions",null),e([R()],jt.prototype,"_defaultHitTestOptions",null),jt=Mt=e([x("esri.views.SceneView")],jt);const Rt=H(),Tt=S(),xt=Y(),Ot=J(0,0,0,z.WebMercator),At={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Et=jt;export{Et as default};
5
+ import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/units.js";import{property as R,cast as T,subclass as x}from"../core/accessorSupport/decorators.js";import{ensureType as O,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as E}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as H}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as I}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as P}from"../core/support/OwningCollection.js";import{initialize as F}from"../core/workers/workers.js";import D from"../geometry/Extent.js";import G from"../geometry/HeightModelInfo.js";import U from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as J}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as K,isTiledLayer as X,isVoxelLayer as ee,isIntegratedMeshLayer as te}from"../layers/support/layerUtils.js";import{TilemapCache as ie}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as re}from"../portal/portalDefault.js";import{AnalysesCollection as se}from"../support/AnalysesCollection.js";import{WebSceneTag as ne}from"../support/tagSymbols.js";import{BreakpointsOwner as ae}from"./BreakpointsOwner.js";import{DOMContainer as oe}from"./DOMContainer.js";import{PopupView as le}from"./PopupView.js";import pe from"./View.js";import he from"./ViewAnimation.js";import{stringFromViewingMode as de,viewingModeFromString as ue}from"./ViewingMode.js";import{GroundView3D as ce}from"./3d/GroundView3D.js";import{layerView3DImporter as ge}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as me}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ye}from"./3d/camera/intersectionUtils.js";import{Constraints as fe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as we}from"./3d/environment/EnvironmentManager.js";import ve from"./3d/environment/SceneViewEnvironment.js";import _e from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as be}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Me}from"./3d/layers/graphics/Labeler.js";import Se from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Ve}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as je}from"./3d/state/ScreenSizePerspective.js";import Ce from"./3d/state/ViewState.js";import{ViewStateManager as Re,cleanupViewStateManager as Te}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as xe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Oe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ae}from"./3d/state/utils/navigationUtils.js";import Ee from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Le}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as He}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Ie}from"./3d/support/ElevationProvider.js";import{toMap as Pe,hitTest as Fe}from"./3d/support/hitTest.js";import{popupHitTest as De}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as Ge,getDefaultQualityProfileName as Ue}from"./3d/support/QualityProfile.js";import We from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as qe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ze}from"./3d/support/ResourceController.js";import ke from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Be}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ne}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Qe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ye from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ze,getTiledLayerInfo as $e,checkIfTileInfoSupportedForView as Je}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ke}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Xe}from"./3d/terrain/TileRenderer.js";import{Stage as et}from"./3d/webgl-engine/Stage.js";import{olidEnabled as tt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as it}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as rt}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as st}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as nt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as at}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import ot from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as lt}from"./support/drapedUtils.js";import{defaultHighlightName as pt}from"./support/HighlightDefaults.js";import ht from"./support/HighlightOptions.js";import{occludeesSupported as dt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ut,createScreenPointFromSupportedEvent as ct}from"./support/screenUtils.js";import{isSpatialReferenceSupported as gt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as mt,destroyTextureCompressionWorker as yt}from"./support/TextureCompressionHelper.js";import{check as ft}from"./support/WebGLRequirements.js";import wt from"./ui/DefaultUI.js";import vt from"./ui/3d/DefaultUI3D.js";import _t from"../webscene/Environment.js";import{clearVNodeCache as bt}from"../widgets/support/vnodeCache.js";var Mt;const St=Symbol(),Vt=Symbol();let jt=class extends(ae(le(oe(pe)))){static{Mt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ze(this),this.deconflictor=new be({view:this}),this.attribution3D=new Ee({view:this}),this.labeler=new Me({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new se,this.basemapTerrain=null,this.elevationProvider=new Le({view:this}),this._canvas=null,this.constraints=new fe,this._environment=new ve,this.environmentManager=new we,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ot({importAnalysisViewModule:e=>me(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Ce({view:this}),this.slice=new Ne,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new vt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,F();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new _e({view:this}),this.stateManager=new Re({view:this}),this.screenSizePerspective=new je({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=mt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ce({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(yt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}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=O(U,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=Ct(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:Ct(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=Ct(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=Ct(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new D({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(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 o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof ve?e:e instanceof _t?this.environment?.cloneWithWebsceneEnvironment(e)??ve.fromWebsceneEnvironment(e):O(ve,e):new ve}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 layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return Mt._layerToLayerview}static{this._layerToLayerview=pe._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}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&&ne in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=Ge(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new We(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Ue()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?G.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||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 de(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?de(this.defaultsFromMap.viewingMode):gt(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===pt)??new ht}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===pt)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 ke(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=ut(e)?ct(this,e):e;return Pe(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;let t=e;return null==e.z&&(t=Ot,t.x=e.x,t.y=e.y,t.z=Ie(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),N(t,Rt,this.renderSpatialReference),this.state.camera.projectToScreen(Rt,Tt),V(Tt[0],Tt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,Rt,i);const r=this.state.camera.computeScreenPixelSizeAt(Rt);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.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=ut(e)?ct(this,e):e;return Fe(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return De(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!tt())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return ge.importLayerView(e)}hasLayerViewModule(e){return ge.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}async validate(){let e=ft(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ue(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!gt(e,i)&&(null==t||(!!K(t)||(!X(t)||null!=$e(t,e,i))&&(!ee(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(K(t)&&(r||s)){return!s||2===i||null===Je(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return X(t)||ee(t)||!r&&!s?X(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${de(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&dt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await At[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ye({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Qe({view:this})),this.addHandles([this.updatingHandles.add(()=>He.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&He.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],St),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Vt),this.removeHandles(St),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",qe.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.groundView.spatialReference,xt,t)||(this.renderCoordsHelper.extent=xt)},w),Vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(rt/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(Vt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Oe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new et({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([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(rt/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Be({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.groundView?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ue(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?E(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(nt);for(const t of this.allLayerViews)te(t.layer)&&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(nt);for(const t of this.allLayerViews)te(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){bt(),L(),j(),at(),Te(),ye(),Ve(),k(),lt(),re(),Xe(),st(),xe(),Ae(),I(),M(),it(),Ke(),Se.cleanupI3SLodHandling(),ie.cleanupTilemapCache(),Ce.cleanupViewstate(),Ye.cleanupTerrainSurface()}};function Ct(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([R()],jt.prototype,"_userClippingArea",void 0),e([R()],jt.prototype,"_resourceController",void 0),e([R()],jt.prototype,"stage",null),e([R({readOnly:!0})],jt.prototype,"deconflictor",void 0),e([R({readOnly:!0})],jt.prototype,"labeler",void 0),e([R(P(se,"analyses"))],jt.prototype,"analyses",void 0),e([R({type:he,readOnly:!0})],jt.prototype,"animation",null),e([R({readOnly:!0})],jt.prototype,"basemapTerrain",void 0),e([R({readOnly:!0})],jt.prototype,"overlayManager",null),e([R({readOnly:!0})],jt.prototype,"elevationProvider",void 0),e([R()],jt.prototype,"camera",null),e([R({type:t})],jt.prototype,"contentCamera",null),e([R({readOnly:!0})],jt.prototype,"canvas",null),e([R({type:U,useTypeForAutocast:!1})],jt.prototype,"center",null),e([R({type:D})],jt.prototype,"clippingArea",null),e([R({type:fe,nonNullable:!0})],jt.prototype,"constraints",void 0),e([R({type:D,readOnly:!0})],jt.prototype,"renderDataExtent",null),e([R({readOnly:!0})],jt.prototype,"tileInfo",null),e([R({type:D,readOnly:!0})],jt.prototype,"dataExtent",null),e([R({type:D,readOnly:!0})],jt.prototype,"_groundAndLayersExtent",null),e([R({type:ve})],jt.prototype,"environment",null),e([T("environment")],jt.prototype,"castEnvironment",null),e([R({readOnly:!0})],jt.prototype,"environmentManager",void 0),e([R({type:D})],jt.prototype,"extent",null),e([R({type:r})],jt.prototype,"floors",void 0),e([R()],jt.prototype,"screenCenter",null),e([R()],jt.prototype,"frustum",null),e([R({type:Number,readOnly:!0})],jt.prototype,"fullOpacity",void 0),e([R({readOnly:!0})],jt.prototype,"graphicsView",void 0),e([R()],jt.prototype,"analysisViewManager",void 0),e([R()],jt.prototype,"groundView",void 0),e([R({readOnly:!0})],jt.prototype,"layerviewCollections",null),e([R({type:Boolean})],jt.prototype,"initialExtentRequired",null),e([R()],jt.prototype,"defaultsFromMapSettings",null),e([R()],jt.prototype,"interacting",null),e([R()],jt.prototype,"stationary",null),e([R()],jt.prototype,"navigating",null),e([R()],jt.prototype,"map",void 0),e([R()],jt.prototype,"padding",null),e([R({type:Qe,readOnly:!0})],jt.prototype,"pointsOfInterest",void 0),e([R()],jt.prototype,"_featureTiles",void 0),e([R()],jt.prototype,"featureTiles",null),e([R()],jt.prototype,"_featureTreeDebugger",void 0),e([R({constructOnly:!0})],jt.prototype,"deactivatedWebGLExtensions",void 0),e([R({constructOnly:!0})],jt.prototype,"debugWebGLExtensions",void 0),e([R({constructOnly:!0})],jt.prototype,"renderCanvas",void 0),e([R({constructOnly:!0})],jt.prototype,"state",void 0),e([R()],jt.prototype,"screenSizePerspective",void 0),e([R({readOnly:!0})],jt.prototype,"inputManager",void 0),e([R({readOnly:!0})],jt.prototype,"stateManager",void 0),e([R({type:["low","medium","high"]})],jt.prototype,"qualityProfile",null),e([R({type:We,get(){let e=this._get("qualitySettings");if(!e){const t=Ge(this.qualityProfile);e=new We(t)}return e}})],jt.prototype,"qualitySettings",void 0),e([R()],jt.prototype,"slice",void 0),e([R({readOnly:!0})],jt.prototype,"typeSpecificPreconditionsReady",null),e([R({readOnly:!0})],jt.prototype,"renderCoordsHelper",void 0),e([R({readOnly:!0})],jt.prototype,"sceneIntersectionHelper",void 0),e([R({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],jt.prototype,"resolution",null),e([R({type:Number})],jt.prototype,"scale",null),e([R({readOnly:!0,type:Number})],jt.prototype,"terrainLevel",null),e([R()],jt.prototype,"heightModelInfo",null),e([R({type:z})],jt.prototype,"spatialReference",void 0),e([R({type:Boolean,value:!1})],jt.prototype,"alphaCompositingEnabled",null),e([R({constructOnly:!0})],jt.prototype,"preserveDrawingBufferEnabled",void 0),e([R({type:Boolean})],jt.prototype,"supersampleScreenshotsEnabled",void 0),e([R({readOnly:!0})],jt.prototype,"type",void 0),e([R(),T(e=>e instanceof wt?e:A(vt,e))],jt.prototype,"ui",void 0),e([R({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],jt.prototype,"updating",null),e([R()],jt.prototype,"_updatingObjects",null),e([R()],jt.prototype,"_updatingObjectsWithProgress",null),e([R({type:Number,readOnly:!0,dependsOn:["updating"]})],jt.prototype,"updatingProgress",void 0),e([R({type:["global","local"]})],jt.prototype,"viewingMode",null),e([R({type:i})],jt.prototype,"viewpoint",null),e([R({readOnly:!0})],jt.prototype,"visibleArea",null),e([R({type:Number})],jt.prototype,"zoom",null),e([R({type:ht})],jt.prototype,"highlightOptions",null),e([R({readOnly:!0})],jt.prototype,"quality",null),e([R({readOnly:!0})],jt.prototype,"resolutionScale",null),e([R()],jt.prototype,"focusAreasView",void 0),e([R()],jt.prototype,"_defaultToMapOptions",null),e([R()],jt.prototype,"_defaultHitTestOptions",null),jt=Mt=e([x("esri.views.SceneView")],jt);const Rt=H(),Tt=S(),xt=Y(),Ot=J(0,0,0,z.WebMercator),At={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Et=jt;export{Et as default};
package/views/View2D.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as p,cast as h,subclass as g}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import{owningCollectionProperty as u}from"../core/support/OwningCollection.js";import{initialize as c}from"../core/workers/workers.js";import m from"../geometry/Polygon.js";import{isLoadedOrLoadFor as y}from"../geometry/projectionUtils.js";import w from"../layers/support/TileInfo.js";import{AnalysesCollection as f}from"../support/AnalysesCollection.js";import{BreakpointsOwner as V}from"./BreakpointsOwner.js";import{DOMContainer as v}from"./DOMContainer.js";import{PopupView as M}from"./PopupView.js";import b from"./View.js";import{Viewport2DBaseMixin as _}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as j}from"./Viewport2DMixin.js";import R from"./2d/AnimationManager.js";import{layerView2DImporter as S}from"./2d/layerViewModuleImportUtils.js";import L from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as O}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as T}from"./2d/analysis/analysisViewModuleImportUtils.js";import{ManagedCanvas as k}from"./2d/engine/ManagedCanvas.js";import C from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as D}from"./2d/layers/support/util.js";import{clipContainsPoint as x}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as P,setDefaultHighlightOptions as A}from"./2d/support/highlightOptionsUtils.js";import{hitTest as E}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as z,takeScreenshot as U}from"./2d/support/screenshotUtils.js";import{Timeline as G}from"./2d/support/Timeline.js";import I from"./navigation/Navigation.js";import q from"./navigation/NavigationActionMap.js";import N from"./support/AnalysisViewManager.js";import W from"./support/HighlightOptions.js";import{check as $}from"./support/WebGLRequirements.js";import F from"./ui/DefaultUI.js";import B from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as H}from"./webgl/RenderingContextOptions.js";import{isWebMap as Z}from"../webmap/utils.js";import J from"../webmap/background/ColorBackground.js";let K,Q,X,Y,ee,te,ie;async function re(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);Q=e,X=t,Y=i,ee=r,te=s,ie=a,K=n}let se=class extends(j(_(V(M(v(b)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new I({actionMap:new q({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analyses=new f,this.analysisViewManager=new N({importAnalysisViewModule:e=>T(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.timeline=new G,this.type="2d",this.view2dType=null,this.ui=new B,this.test={takeScreenshot:async e=>z(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},c()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new C(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return y(t.spatialReference,i)}get background(){return Z(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get highlightOptions(){return P(this)}set highlightOptions(e){A(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get("spatialReferenceLocked")}set spatialReferenceLocked(e){this.stage&&a.getLogger(this).warn("spatialReferenceLocked cannot be changed after the view has become ready"),this._set("spatialReferenceLocked",e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.analysisViewManager.updating||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new m({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return E(this,e,t)}async takeScreenshot(e){return U(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return Z(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return Z(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return S.hasLayerViewModule(e)}importLayerView(e){return S.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>x(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=$(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e)throw a.getLogger(this).warn("#validate()",e.message),e}loadAsyncDependencies(){return re()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&O(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new k(this.surface),i=new K(this.surface,{canvas:this.renderCanvas,contextOptions:new H(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),renderingOptions:this.renderingOptions,timeline:this.timeline},t);this.stage=i,this._magnifierView=new te,this._magnifierView.magnifier=this.magnifier,this._gridView=new ie;const r=new Y({view:this});this._set("labelManager",r);const s=new R({view:this});this._set("animationManager",s);const a=new ee({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=D(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l),o(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new L(w.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new Q({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new X(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([p({constructOnly:!0})],se.prototype,"deactivatedWebGLExtensions",void 0),e([p({constructOnly:!0})],se.prototype,"debugWebGLExtensions",void 0),e([p({readOnly:!0})],se.prototype,"featuresTilingScheme",void 0),e([p({readOnly:!0})],se.prototype,"graphicsTileStore",null),e([p()],se.prototype,"graphicsView",void 0),e([p()],se.prototype,"constraintsInfo",null),e([p()],se.prototype,"initialExtentRequired",null),e([p()],se.prototype,"labelManager",void 0),e([p({type:I,nonNullable:!0})],se.prototype,"navigation",void 0),e([p({constructOnly:!0})],se.prototype,"renderCanvas",void 0),e([p()],se.prototype,"renderingOptions",void 0),e([p({constructOnly:!0})],se.prototype,"supersampleScreenshotsEnabled",void 0),e([p()],se.prototype,"defaultsFromMapSettings",null),e([p({readOnly:!0})],se.prototype,"typeSpecificPreconditionsReady",null),e([p(u(f,"analyses"))],se.prototype,"analyses",void 0),e([p()],se.prototype,"analysisViewManager",void 0),e([p({type:J})],se.prototype,"background",null),e([p()],se.prototype,"center",null),e([p({type:i})],se.prototype,"floors",void 0),e([p()],se.prototype,"grid",void 0),e([p({type:W})],se.prototype,"highlightOptions",null),e([p()],se.prototype,"map",void 0),e([p()],se.prototype,"padding",null),e([p({readOnly:!0})],se.prototype,"rendering",null),e([p({readOnly:!0})],se.prototype,"resolution",null),e([p()],se.prototype,"scale",null),e([p({type:Boolean,value:!1})],se.prototype,"spatialReferenceLocked",null),e([p({readOnly:!0})],se.prototype,"tileInfo",null),e([p({type:G,readOnly:!0})],se.prototype,"timeline",void 0),e([p({readOnly:!0})],se.prototype,"type",void 0),e([p({readOnly:!0})],se.prototype,"updating",null),e([p({readOnly:!0})],se.prototype,"view2dType",void 0),e([p({readOnly:!0})],se.prototype,"visibleArea",null),e([p()],se.prototype,"zoom",null),e([p({readOnly:!0})],se.prototype,"navigating",null),e([p(),h(e=>e instanceof F?e:d(B,e))],se.prototype,"ui",void 0),se=e([g("esri.views.View2D")],se);const ae=se;export{ae as default};
5
+ import{__decorate as e}from"tslib";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as p,cast as h,subclass as g}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import{owningCollectionProperty as u}from"../core/support/OwningCollection.js";import{initialize as c}from"../core/workers/workers.js";import m from"../geometry/Point.js";import y from"../geometry/Polygon.js";import{isLoadedOrLoadFor as w}from"../geometry/projectionUtils.js";import f from"../layers/support/TileInfo.js";import{AnalysesCollection as V}from"../support/AnalysesCollection.js";import{BreakpointsOwner as v}from"./BreakpointsOwner.js";import{DOMContainer as M}from"./DOMContainer.js";import{PopupView as b}from"./PopupView.js";import _ from"./View.js";import{Viewport2DBaseMixin as j}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as R}from"./Viewport2DMixin.js";import S from"./2d/AnimationManager.js";import{layerView2DImporter as L}from"./2d/layerViewModuleImportUtils.js";import O from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as T}from"./2d/viewpointUtils.js";import{importAnalysisViewModule as k}from"./2d/analysis/analysisViewModuleImportUtils.js";import{ManagedCanvas as C}from"./2d/engine/ManagedCanvas.js";import x from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as D}from"./2d/layers/support/util.js";import{clipContainsPoint as P}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as A,setDefaultHighlightOptions as E}from"./2d/support/highlightOptionsUtils.js";import{hitTest as z}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as U,takeScreenshot as G}from"./2d/support/screenshotUtils.js";import{Timeline as I}from"./2d/support/Timeline.js";import q from"./navigation/Navigation.js";import N from"./navigation/NavigationActionMap.js";import W from"./support/AnalysisViewManager.js";import $ from"./support/HighlightOptions.js";import{check as F}from"./support/WebGLRequirements.js";import B from"./ui/DefaultUI.js";import H from"./ui/2d/DefaultUI2D.js";import{RenderingContextOptions as Z}from"./webgl/RenderingContextOptions.js";import{isWebMap as J}from"../webmap/utils.js";import K from"../webmap/background/ColorBackground.js";let Q,X,Y,ee,te,ie,re;async function se(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);X=e,Y=t,ee=i,te=r,ie=s,re=a,Q=n}let ae=class extends(R(j(v(b(M(_)))))){get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new q({actionMap:new N({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.analyses=new V,this.analysisViewManager=new W({importAnalysisViewModule:e=>k(e),view:this}),this.floors=new i,this.grid=null,this.map=null,this.timeline=new I,this.type="2d",this.view2dType=null,this.ui=new H,this.test={takeScreenshot:async e=>U(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},c()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new x(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return w(t.spatialReference,i)}get background(){return J(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return super.constraints}set constraints(e){super.constraints=e}get extent(){return super.extent}set extent(e){super.extent=e}get highlightOptions(){return A(this)}set highlightOptions(e){E(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return super.resizeAlign}set resizeAlign(e){super.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return super.rotation}set rotation(e){super.rotation=e}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get spatialReference(){return super.spatialReference}set spatialReference(e){super.spatialReference=e}get spatialReferenceLocked(){return this._get("spatialReferenceLocked")}set spatialReferenceLocked(e){this.stage&&a.getLogger(this).warn("spatialReferenceLocked cannot be changed after the view has become ready"),this._set("spatialReferenceLocked",e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.analysisViewManager.updating||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get viewpoint(){return super.viewpoint}set viewpoint(e){super.viewpoint=e}get visibleArea(){const e=this.stateManager.visibleArea;return e?new y({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return z(this,e,t)}async takeScreenshot(e){return G(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}async whenAnalysisView(e){if(null==e.parent)throw new s("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});return this.analysisViewManager.whenAnalysisView(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return J(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return J(this.map)?this.map.initialViewProperties.timeExtent:null}getSurface(){return this.surface}hasLayerViewModule(e){return L.hasLayerViewModule(e)}importLayerView(e){return L.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>P(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=F(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e)throw a.getLogger(this).warn("#validate()",e.message),e}loadAsyncDependencies(){return se()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,g=l?.rotation??0,d=l?.scale||p&&T(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),u=o.center??h,c=o.rotation??g,m=o.scale??d;return u&&m?new t({targetGeometry:u,scale:m,rotation:c}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new C(this.surface),i=new Q(this.surface,{canvas:this.renderCanvas,contextOptions:new Z(this.deactivatedWebGLExtensions,this.debugWebGLExtensions),renderingOptions:this.renderingOptions,timeline:this.timeline},t);this.stage=i,this._magnifierView=new ie,this._magnifierView.magnifier=this.magnifier,this._gridView=new re;const r=new ee({view:this});this._set("labelManager",r);const s=new S({view:this});this._set("animationManager",s);const a=new te({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=D(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l),o(()=>this.animationsEnabled,e=>this.stage.animationsEnabled=e,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new O(f.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new X({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Y(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([p({constructOnly:!0})],ae.prototype,"deactivatedWebGLExtensions",void 0),e([p({constructOnly:!0})],ae.prototype,"debugWebGLExtensions",void 0),e([p({readOnly:!0})],ae.prototype,"featuresTilingScheme",void 0),e([p({readOnly:!0})],ae.prototype,"graphicsTileStore",null),e([p()],ae.prototype,"graphicsView",void 0),e([p()],ae.prototype,"constraintsInfo",null),e([p()],ae.prototype,"initialExtentRequired",null),e([p()],ae.prototype,"labelManager",void 0),e([p({type:q,nonNullable:!0})],ae.prototype,"navigation",void 0),e([p({constructOnly:!0})],ae.prototype,"renderCanvas",void 0),e([p()],ae.prototype,"renderingOptions",void 0),e([p({constructOnly:!0})],ae.prototype,"supersampleScreenshotsEnabled",void 0),e([p()],ae.prototype,"defaultsFromMapSettings",null),e([p({readOnly:!0})],ae.prototype,"typeSpecificPreconditionsReady",null),e([p(u(V,"analyses"))],ae.prototype,"analyses",void 0),e([p()],ae.prototype,"analysisViewManager",void 0),e([p({type:K})],ae.prototype,"background",null),e([p({type:m})],ae.prototype,"center",null),e([p({type:i})],ae.prototype,"floors",void 0),e([p()],ae.prototype,"grid",void 0),e([p({type:$})],ae.prototype,"highlightOptions",null),e([p()],ae.prototype,"map",void 0),e([p()],ae.prototype,"padding",null),e([p({readOnly:!0})],ae.prototype,"rendering",null),e([p({readOnly:!0})],ae.prototype,"resolution",null),e([p()],ae.prototype,"scale",null),e([p({type:Boolean,value:!1})],ae.prototype,"spatialReferenceLocked",null),e([p({readOnly:!0})],ae.prototype,"tileInfo",null),e([p({type:I,readOnly:!0})],ae.prototype,"timeline",void 0),e([p({readOnly:!0})],ae.prototype,"type",void 0),e([p({readOnly:!0})],ae.prototype,"updating",null),e([p({readOnly:!0})],ae.prototype,"view2dType",void 0),e([p({readOnly:!0})],ae.prototype,"visibleArea",null),e([p()],ae.prototype,"zoom",null),e([p({readOnly:!0})],ae.prototype,"navigating",null),e([p(),h(e=>e instanceof B?e:d(H,e))],ae.prototype,"ui",void 0),ae=e([g("esri.views.View2D")],ae);const ne=ae;export{ne as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import{property as t}from"../../core/accessorSupport/decorators.js";class o extends r{constructor(e){super(e),this.sublayer=null}get updating(){return!1}get suspended(){return!1}get availableFields(){return[]}get filter(){return null}set filter(e){throw new Error("Not implemented")}queryFeatures(e,r){throw new Error("Not implemented")}queryObjectIds(e,r){throw new Error("Not implemented")}queryFeatureCount(e,r){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,r){throw new Error("Not implemented")}highlight(e){throw new Error("Not implemented")}}e([t()],o.prototype,"sublayer",void 0),e([t()],o.prototype,"availableFields",null),e([t()],o.prototype,"filter",null);export{o as default};
5
+ import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import{property as t}from"../../core/accessorSupport/decorators.js";import o from"../../layers/support/FeatureFilter.js";class l extends r{constructor(e){super(e),this.sublayer=null}get updating(){return!1}get suspended(){return!1}get availableFields(){return[]}get filter(){return null}set filter(e){throw new Error("Not implemented")}queryFeatures(e,r){throw new Error("Not implemented")}queryObjectIds(e,r){throw new Error("Not implemented")}queryFeatureCount(e,r){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,r){throw new Error("Not implemented")}highlight(e){throw new Error("Not implemented")}}e([t()],l.prototype,"sublayer",void 0),e([t()],l.prototype,"availableFields",null),e([t({type:o})],l.prototype,"filter",null);export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{handlesGroup as r,makeHandle as i}from"../../core/handleUtils.js";import s from"../../core/Logger.js";import{debounce as a,ignoreAbortErrors as o}from"../../core/promiseUtils.js";import{sqlAnd as n}from"../../core/sql.js";import{property as d,subclass as p}from"../../core/accessorSupport/decorators.js";const l=Symbol(),y=y=>{const u=y;let m=class extends u{constructor(...e){super(...e),this.layerViews=new t,this._debouncedUpdate=a(async()=>{const{layer:e,parent:t}=this,r=t?.footprintLayerView;let i=[];const s=this._createQuery();if(s&&r){const{features:t}=await r.queryFeatures(s);this.suspended||(i=t.map(t=>e.acquireLayer(t)))}this.removeHandles(l),this.addHandles(i,l)})}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some(e=>e.updating)}enableLayerUpdates(){return r([this._updatingHandles.addWhen(()=>!1===this.parent?.footprintLayerView?.dataUpdating,()=>this.updateLayers()),this._updatingHandles.add(()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended],()=>this.updateLayers()),i(()=>this.removeHandles(l))])}updateLayers(){this.suspended?this.removeHandles(l):this._updatingHandles.addPromise(o(this._debouncedUpdate()).catch(e=>{s.getLogger(this).error(e)}))}_createQuery(){const e=this.parent?.footprintLayerView,t=this.layer?.parent;if(!e||!t||t.destroyed)return null;const{layer:{maximumVisibleSublayers:r},view:{scale:i}}=this;if(!r)return null;const{itemTypeField:s,itemSourceField:a,itemNameField:o,minScaleField:d,maxScaleField:p,objectIdField:l,orderBy:y}=t,u=n(`${d} IS NULL OR ${i} <= ${d} OR ${d} = 0`,`${p} IS NULL OR ${i} >= ${p}`),m=y?.find(e=>e.field&&!e.valueExpression),c=e.createQuery();if(c.returnGeometry=!1,c.num=r,c.outFields=[l,a,o],c.where=n(c.where,u),null!=this.unsupportedItemTypes){const e=`${s} NOT IN (${this.unsupportedItemTypes.map(e=>`'${e}'`)})`;c.where=n(c.where,e)}return m?.field&&(c.orderByFields=[`${m.field} ${"descending"===m.order?"DESC":"ASC"}`],c.outFields.push(m.field)),c}};return e([d({readOnly:!0})],m.prototype,"creatingLayerViews",null),e([d()],m.prototype,"layer",void 0),e([d()],m.prototype,"layerViews",void 0),e([d({readOnly:!0})],m.prototype,"unsupportedItemTypes",void 0),e([d()],m.prototype,"parent",void 0),e([d({readOnly:!0})],m.prototype,"isUpdating",null),m=e([p("esri.views.layers.CatalogDynamicGroupLayerView")],m),m};export{y as CatalogDynamicGroupLayerView};
5
+ import{__decorate as e}from"tslib";import r from"../../core/Collection.js";import{handlesGroup as t,makeHandle as i}from"../../core/handleUtils.js";import s from"../../core/Logger.js";import{debounce as a,ignoreAbortErrors as o}from"../../core/promiseUtils.js";import{sqlAnd as n}from"../../core/sql.js";import{property as d,subclass as p}from"../../core/accessorSupport/decorators.js";import l from"./LayerView.js";const y=Symbol(),u=l=>{const u=l;let m=class extends u{constructor(...e){super(...e),this.layerViews=new r,this._debouncedUpdate=a(async()=>{const{layer:e,parent:r}=this,t=r?.footprintLayerView;let i=[];const s=this._createQuery();if(s&&t){const{features:r}=await t.queryFeatures(s);this.suspended||(i=r.map(r=>e.acquireLayer(r)))}this.removeHandles(y),this.addHandles(i,y)})}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some(e=>e.updating)}enableLayerUpdates(){return t([this._updatingHandles.addWhen(()=>!1===this.parent?.footprintLayerView?.dataUpdating,()=>this.updateLayers()),this._updatingHandles.add(()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended],()=>this.updateLayers()),i(()=>this.removeHandles(y))])}updateLayers(){this.suspended?this.removeHandles(y):this._updatingHandles.addPromise(o(this._debouncedUpdate()).catch(e=>{s.getLogger(this).error(e)}))}_createQuery(){const e=this.parent?.footprintLayerView,r=this.layer?.parent;if(!e||!r||r.destroyed)return null;const{layer:{maximumVisibleSublayers:t},view:{scale:i}}=this;if(!t)return null;const{itemTypeField:s,itemSourceField:a,itemNameField:o,minScaleField:d,maxScaleField:p,objectIdField:l,orderBy:y}=r,u=n(`${d} IS NULL OR ${i} <= ${d} OR ${d} = 0`,`${p} IS NULL OR ${i} >= ${p}`),m=y?.find(e=>e.field&&!e.valueExpression),c=e.createQuery();if(c.returnGeometry=!1,c.num=t,c.outFields=[l,a,o],c.where=n(c.where,u),null!=this.unsupportedItemTypes){const e=`${s} NOT IN (${this.unsupportedItemTypes.map(e=>`'${e}'`)})`;c.where=n(c.where,e)}return m?.field&&(c.orderByFields=[`${m.field} ${"descending"===m.order?"DESC":"ASC"}`],c.outFields.push(m.field)),c}};return e([d({readOnly:!0})],m.prototype,"creatingLayerViews",null),e([d()],m.prototype,"layer",void 0),e([d()],m.prototype,"layerViews",void 0),e([d({readOnly:!0})],m.prototype,"unsupportedItemTypes",void 0),e([d()],m.prototype,"parent",void 0),e([d({readOnly:!0})],m.prototype,"isUpdating",null),m=e([p("esri.views.layers.CatalogDynamicGroupLayerView")],m),m},m=u(l);export{m as CatalogDynamicGroupLayerView,u as CatalogDynamicGroupLayerViewMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as t,subclass as r}from"../../core/accessorSupport/decorators.js";const o=o=>{const p=o;let s=class extends p{constructor(...e){super(...e)}get updateSuspended(){const e=this.parent?.dynamicGroupLayerView;return this.suspended&&(!e||!0===e.suspended)}queryAggregates(){throw new Error("Not implemented")}};return e([t()],s.prototype,"layer",void 0),e([t()],s.prototype,"parent",void 0),e([t()],s.prototype,"highlightOptions",void 0),e([t()],s.prototype,"updateSuspended",null),s=e([r("esri.views.layers.CatalogFootprintLayerView")],s),s};export{o as CatalogFootprintLayerView};
5
+ import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../core/accessorSupport/decorators.js";import{FeatureLayerViewMixin as o}from"./FeatureLayerViewMixin.js";import{HighlightLayerViewMixin as i}from"./HighlightLayerViewMixin.js";import p from"./LayerView.js";const s=o=>{const p=i(o);let s=class extends p{constructor(...e){super(...e)}get updateSuspended(){const e=this.parent?.dynamicGroupLayerView;return this.suspended&&(!e||!0===e.suspended)}queryAggregates(){throw new Error("Not implemented")}};return e([r()],s.prototype,"layer",void 0),e([r()],s.prototype,"parent",void 0),e([r()],s.prototype,"highlightOptions",void 0),e([r()],s.prototype,"updateSuspended",null),s=e([t("esri.views.layers.CatalogFootprintLayerView")],s),s},n=s(o(p));export{n as CatalogFootprintLayerView,s as CatalogFootprintLayerViewMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import e from"../../core/Collection.js";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";const o=o=>{const a=o;let y=class extends a{constructor(...r){super(...r),this.layerViews=new e}get dynamicGroupLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.footprintLayer)}isUpdating(){return!this.dynamicGroupLayerView||!this.footprintLayerView||this.dynamicGroupLayerView.updating||this.footprintLayerView.updating}};return r([t()],y.prototype,"layer",void 0),r([t()],y.prototype,"layerViews",void 0),r([t({readOnly:!0})],y.prototype,"dynamicGroupLayerView",null),r([t({readOnly:!0})],y.prototype,"footprintLayerView",null),y=r([i("esri.views.layers.CatalogLayerView")],y),y};export{o as CatalogLayerView};
5
+ import{__decorate as r}from"tslib";import e from"../../core/Collection.js";import{property as t,subclass as i}from"../../core/accessorSupport/decorators.js";import o from"./LayerView.js";const a=o=>{const a=o;let y=class extends a{constructor(...r){super(...r),this.layerViews=new e}get dynamicGroupLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.footprintLayer)}isUpdating(){return!this.dynamicGroupLayerView||!this.footprintLayerView||this.dynamicGroupLayerView.updating||this.footprintLayerView.updating}};return r([t()],y.prototype,"layer",void 0),r([t()],y.prototype,"layerViews",void 0),r([t({readOnly:!0})],y.prototype,"dynamicGroupLayerView",null),r([t({readOnly:!0})],y.prototype,"footprintLayerView",null),y=r([i("esri.views.layers.CatalogLayerView")],y),y},y=a(o);export{y as CatalogLayerView,a as CatalogLayerViewMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureLayerViewMixin as e}from"./FeatureLayerViewMixin.js";import r from"./LayerView.js";class a extends(e(r)){}export{a as default};
5
+ import{FeatureLayerViewMixin as r}from"./FeatureLayerViewMixin.js";import{HighlightLayerViewMixin as e}from"./HighlightLayerViewMixin.js";import i from"./LayerView.js";class t extends(r(e(i))){constructor(){super(...arguments),this.layer=null}}export{t as default};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
- type HighlightLayerViewMixin = __esri.HighlightLayerViewMixin;
4
- export default HighlightLayerViewMixin;
3
+ import HighlightLayerViewMixin = __esri.HighlightLayerViewMixin;
4
+ export { HighlightLayerViewMixin };
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{subclass as i}from"../../core/accessorSupport/decorators.js";const s=s=>{const e=s;let r=class extends e{get highlightOptions(){}set highlightOptions(t){}};return r=t([i("esri.views.layers.HighlightLayerViewMixin")],r),r};export{s as HighlightLayerViewMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../Graphic.js";import r from"../../core/Error.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{addMultidimensionalFieldValues as s,commonRasterFieldNames as n,rasterFieldPrefix as l}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as o}from"../../layers/support/timeSupport.js";import{isFunctionRaster as u}from"../../layers/support/rasterDatasets/datasetUtils.js";import{getDefaultDatumTransformationForDataset as p,projectDatasetExtent as c,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as y}from"./support/popupUtils.js";const f=f=>{const h=f;let d=class extends h{constructor(...t){super(...t),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return o(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){const{renderer:t}=this.layer;return!!("raster-stretch"===t?.type&&t.dynamicRangeAdjustment&&!("min-max"===t.stretchType||"standard-deviation"===t.stretchType))}get datumTransformation(){try{return this.layer.loaded?p(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(t){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,t)}catch{return!1}}async fetchPopupFeaturesAtLocation(t,i){const{layer:a}=this;if(!t)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:o}=a,p=y(a,i);if(!o||null==p)return[];const c=[],{value:m,magdirValue:f,processedValue:h}=await a.identify(t,{timeExtent:this.timeExtent,signal:i?.signal});let d="";if(m?.length){d="imagery-tile"===a.type&&a.hasStandardTime()&&null!=m[0]?m.map(t=>a.getStandardTimeValue(t)).join(", "):m.join(", ");const t={ObjectId:0};t[n.servicePixelValue]="imagery-tile"===a.type&&u(a.raster)?h?.join(", "):d,t[n.rawServicePixelValue]=d;const r=a.raster?.rasterInfo??a.serviceRasterInfo,i=r?.attributeTable;if(null!=i){const{fields:e,features:r}=i,a=e.find(({name:t})=>"value"===t.toLowerCase()),s=t[n.servicePixelValue],o=a?r.find(t=>String(t.attributes[a.name])===s):null;if(o)for(const i in o.attributes)if(o.attributes.hasOwnProperty(i)){t[l+i]=o.attributes[i]}}const o=r?.dataType;"vector-magdir"!==o&&"vector-uv"!==o||(t[n.magnitude]=f?.[0],t[n.direction]=f?.[1]);const{multidimensionalDefinition:p}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});s(a.rasterFields,t,p);const{graphicOrigin:y}=a,g=new e({geometry:this.fullExtent?.clone(),attributes:t,layer:a,origin:y,sourceLayer:a});c.push(g)}return c}async getSourceScale(){return await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return t([i()],d.prototype,"fullExtent",null),t([i()],d.prototype,"layer",void 0),t([i({readOnly:!0})],d.prototype,"timeExtent",null),t([i()],d.prototype,"tileInfo",void 0),t([i({readOnly:!0})],d.prototype,"hasTilingEffects",null),t([i()],d.prototype,"datumTransformation",null),d=t([a("esri.views.layers.ImageryTileLayerView")],d),d};export{f as default};
5
+ import{ImageryTileLayerViewMixin as e}from"./ImageryTileLayerViewMixin.js";import r from"./LayerView.js";class i extends(e(r)){}export{i as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import e from"../../Graphic.js";import r from"../../core/Error.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{addMultidimensionalFieldValues as s,commonRasterFieldNames as n,rasterFieldPrefix as l}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as o}from"../../layers/support/timeSupport.js";import{isFunctionRaster as u}from"../../layers/support/rasterDatasets/datasetUtils.js";import{getDefaultDatumTransformationForDataset as p,projectDatasetExtent as c,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as y}from"./support/popupUtils.js";const f=f=>{const h=f;let d=class extends h{constructor(...t){super(...t),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return o(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){const{renderer:t}=this.layer;return!!("raster-stretch"===t?.type&&t.dynamicRangeAdjustment&&!("min-max"===t.stretchType||"standard-deviation"===t.stretchType))}get datumTransformation(){try{return this.layer.loaded?p(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(t){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,t)}catch{return!1}}async fetchPopupFeaturesAtLocation(t,i){const{layer:a}=this;if(!t)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:o}=a,p=y(a,i);if(!o||null==p)return[];const c=[],{value:m,magdirValue:f,processedValue:h}=await a.identify(t,{timeExtent:this.timeExtent,signal:i?.signal});let d="";if(m?.length){d="imagery-tile"===a.type&&a.hasStandardTime()&&null!=m[0]?m.map(t=>a.getStandardTimeValue(t)).join(", "):m.join(", ");const t={ObjectId:0};t[n.servicePixelValue]="imagery-tile"===a.type&&u(a.raster)?h?.join(", "):d,t[n.rawServicePixelValue]=d;const r=a.raster?.rasterInfo??a.serviceRasterInfo,i=r?.attributeTable;if(null!=i){const{fields:e,features:r}=i,a=e.find(({name:t})=>"value"===t.toLowerCase()),s=t[n.servicePixelValue],o=a?r.find(t=>String(t.attributes[a.name])===s):null;if(o)for(const i in o.attributes)if(o.attributes.hasOwnProperty(i)){t[l+i]=o.attributes[i]}}const o=r?.dataType;"vector-magdir"!==o&&"vector-uv"!==o||(t[n.magnitude]=f?.[0],t[n.direction]=f?.[1]);const{multidimensionalDefinition:p}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});s(a.rasterFields,t,p);const{graphicOrigin:y}=a,g=new e({geometry:this.fullExtent?.clone(),attributes:t,layer:a,origin:y,sourceLayer:a});c.push(g)}return c}async getSourceScale(){return await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return t([i()],d.prototype,"fullExtent",null),t([i()],d.prototype,"layer",void 0),t([i({readOnly:!0})],d.prototype,"timeExtent",null),t([i()],d.prototype,"tileInfo",void 0),t([i({readOnly:!0})],d.prototype,"hasTilingEffects",null),t([i()],d.prototype,"datumTransformation",null),d=t([a("esri.views.layers.ImageryTileLayerViewMixin")],d),d};export{f as ImageryTileLayerViewMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../core/accessorSupport/decorators.js";import o from"./LayerView.js";const s=o=>{const s=o;let a=class extends s{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return e([r()],a.prototype,"layer",void 0),e([r({readOnly:!0})],a.prototype,"availableFields",null),a=e([t("esri.views.layers.OGCFeatureLayerView")],a),a},a=s(o);export{a as OGCFeatureLayerView,s as OGCFeatureLayerViewMixin};
5
+ import{__decorate as e}from"tslib";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{FeatureLayerViewMixin as t}from"./FeatureLayerViewMixin.js";import{HighlightLayerViewMixin as o}from"./HighlightLayerViewMixin.js";import a from"./LayerView.js";const s=t=>{const a=o(t);let s=class extends a{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return e([r()],s.prototype,"layer",void 0),e([r({readOnly:!0})],s.prototype,"availableFields",null),s=e([i("esri.views.layers.OGCFeatureLayerView")],s),s},l=s(t(a));export{l as OGCFeatureLayerView,s as OGCFeatureLayerViewMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import r from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{unwrapUpdating as i,updating as n,isUpdating as l}from"../../core/maybeUpdating.js";import{throwIfAbortError as s,throwIfNotAbortError as a}from"../../core/promiseUtils.js";import{whenOnce as m}from"../../core/reactiveUtils.js";import{property as p,subclass as y}from"../../core/accessorSupport/decorators.js";import{project as u,canProjectWithoutEngine as c,isLoaded as g,load as h}from"../../geometry/projectionUtils.js";import d from"./LayerView.js";let f=class extends d{constructor(e){super(e),this.layer=null,this.filter=null,this._geometryOperators=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return i(this._layerFilter)}get _layerFilter(){const e=this.layer?.filter;if(null==e||e.geometries.length<1)return null;if(!this._geometryOperators||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return n;const[o,i,l]=this._geometryOperators,s=e.geometries.at(0).spatialReference,a=e.geometries.toArray().map(e=>{let t;try{t=i.execute(e)}catch(o){return r.getLogger(this).warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(!t)return null;if(t.spatialReference.equals(s))return t;try{return u(t,s)}catch(o){return r.getLogger(this).warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}}).filter(t).sort((e,t)=>e.extent.xmin-t.extent.xmin),m=new Set,p=new Array,y=new Array;for(let t of a){const e=t.extent.xmin;if(p.length=0,m.forEach(r=>{if(e>=r.extent.xmax)return y.push(r),void m.delete(r);t.extent.ymin<=r.extent.ymax&&t.extent.ymax>=r.extent.ymin&&o.execute(t,r)&&p.push(r)}),p.length>0){let e;p.push(t);try{e=l.executeMany(p)}catch(c){r.getLogger(this).warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}p.pop(),e&&(p.forEach(e=>m.delete(e)),t=e)}m.add(t)}return m.forEach(e=>y.push(e)),y.length>0?{spatialRelationship:e.spatialRelationship,geometries:y}:null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(null==e||e.geometries.length<=1)return!1;const t=e.geometries.at(0).spatialReference;return e.geometries.some(({spatialReference:e})=>!e.equals(t)&&!c(e,t))}get layerFilterUpdating(){return l(this._layerFilter)}initialize(){const{signal:e}=this._abortController;m(()=>this.destroyed||!this._geometryOperators&&this.layer?.filter?.geometries?.length,e).then(async()=>{s(e),this._geometryOperators=await Promise.all([import("../../geometry/operators/intersectsOperator.js"),import("../../geometry/operators/simplifyOperator.js"),import("../../geometry/operators/unionOperator.js")])}).catch(a),this._projectionEngineLoaded=g(),m(()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine,e).then(async()=>{s(e),await h(),this._projectionEngineLoaded=!0}).catch(a)}destroy(){this._abortController=o(this._abortController)}highlight(e,t){throw new Error("Not implemented")}queryFeatures(e,t){throw new Error("Not implemented")}queryObjectIds(e,t){throw new Error("Not implemented")}queryFeatureCount(e,t){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,t){throw new Error("Not implemented")}};e([p()],f.prototype,"layer",void 0),e([p()],f.prototype,"availableFields",null),e([p()],f.prototype,"maximumNumberOfFeatures",null),e([p({readOnly:!0})],f.prototype,"maximumNumberOfFeaturesExceeded",null),e([p()],f.prototype,"filter",void 0),e([p({readOnly:!0})],f.prototype,"layerFilter",null),e([p({readOnly:!0})],f.prototype,"_layerFilter",null),e([p()],f.prototype,"_geometryOperators",void 0),e([p()],f.prototype,"_projectionEngineLoaded",void 0),e([p()],f.prototype,"_filterNeedsProjectionEngine",null),e([p()],f.prototype,"layerFilterUpdating",null),f=e([y("esri.views.layers.SceneLayerView")],f);export{f as default};
5
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import r from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{unwrapUpdating as i,updating as n,isUpdating as l}from"../../core/maybeUpdating.js";import{throwIfAbortError as s,throwIfNotAbortError as a}from"../../core/promiseUtils.js";import{whenOnce as m}from"../../core/reactiveUtils.js";import{property as p,subclass as y}from"../../core/accessorSupport/decorators.js";import{project as u,canProjectWithoutEngine as c,isLoaded as g,load as h}from"../../geometry/projectionUtils.js";import d from"../../layers/support/FeatureFilter.js";import f from"./LayerView.js";let w=class extends f{constructor(e){super(e),this.layer=null,this.filter=null,this._geometryOperators=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return i(this._layerFilter)}get _layerFilter(){const e=this.layer?.filter;if(null==e||e.geometries.length<1)return null;if(!this._geometryOperators||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return n;const[o,i,l]=this._geometryOperators,s=e.geometries.at(0).spatialReference,a=e.geometries.toArray().map(e=>{let t;try{t=i.execute(e)}catch(o){return r.getLogger(this).warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(!t)return null;if(t.spatialReference.equals(s))return t;try{return u(t,s)}catch(o){return r.getLogger(this).warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}}).filter(t).sort((e,t)=>e.extent.xmin-t.extent.xmin),m=new Set,p=new Array,y=new Array;for(let t of a){const e=t.extent.xmin;if(p.length=0,m.forEach(r=>{if(e>=r.extent.xmax)return y.push(r),void m.delete(r);t.extent.ymin<=r.extent.ymax&&t.extent.ymax>=r.extent.ymin&&o.execute(t,r)&&p.push(r)}),p.length>0){let e;p.push(t);try{e=l.executeMany(p)}catch(c){r.getLogger(this).warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}p.pop(),e&&(p.forEach(e=>m.delete(e)),t=e)}m.add(t)}return m.forEach(e=>y.push(e)),y.length>0?{spatialRelationship:e.spatialRelationship,geometries:y}:null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(null==e||e.geometries.length<=1)return!1;const t=e.geometries.at(0).spatialReference;return e.geometries.some(({spatialReference:e})=>!e.equals(t)&&!c(e,t))}get layerFilterUpdating(){return l(this._layerFilter)}initialize(){const{signal:e}=this._abortController;m(()=>this.destroyed||!this._geometryOperators&&this.layer?.filter?.geometries?.length,e).then(async()=>{s(e),this._geometryOperators=await Promise.all([import("../../geometry/operators/intersectsOperator.js"),import("../../geometry/operators/simplifyOperator.js"),import("../../geometry/operators/unionOperator.js")])}).catch(a),this._projectionEngineLoaded=g(),m(()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine,e).then(async()=>{s(e),await h(),this._projectionEngineLoaded=!0}).catch(a)}destroy(){this._abortController=o(this._abortController)}highlight(e,t){throw new Error("Not implemented")}queryFeatures(e,t){throw new Error("Not implemented")}queryObjectIds(e,t){throw new Error("Not implemented")}queryFeatureCount(e,t){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,t){throw new Error("Not implemented")}};e([p()],w.prototype,"layer",void 0),e([p()],w.prototype,"availableFields",null),e([p()],w.prototype,"maximumNumberOfFeatures",null),e([p({readOnly:!0})],w.prototype,"maximumNumberOfFeaturesExceeded",null),e([p({type:d})],w.prototype,"filter",void 0),e([p({readOnly:!0})],w.prototype,"layerFilter",null),e([p({readOnly:!0})],w.prototype,"_layerFilter",null),e([p()],w.prototype,"_geometryOperators",void 0),e([p()],w.prototype,"_projectionEngineLoaded",void 0),e([p()],w.prototype,"_filterNeedsProjectionEngine",null),e([p()],w.prototype,"layerFilterUpdating",null),w=e([y("esri.views.layers.SceneLayerView")],w);export{w as default};