@arcgis/core 4.34.0-next.38 → 4.34.0-next.39

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 (130) hide show
  1. package/Color.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{00f3fe4a09bbdbc8f8b4.js → 00ae094cc21bc42faa54.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{7e04b4592128e884b58c.js → 0f51e51db83f303ce5a6.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{6e82c1d1e02e320ec5e7.js → 14d3039f92b0d96944f0.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{54658c87396223d85abd.js → 1cbd59918c60a1a21494.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{7c97c4c8c2cf73835517.js → 1cd15aa69f85ecfa32b0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/21a9f9c0cc1cde2fee90.js +1 -0
  9. package/assets/esri/core/workers/chunks/{21aaf2dede61f28727a9.js → 2ae0bda04fd5386b462f.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{49eac96a01931b8c4ace.js → 364fb103cb139f26b455.js} +1 -1
  11. package/assets/esri/core/workers/chunks/3af4a410ff0bca7ba2e3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8ad95fe91ba0a9f284a2.js → 3f7d7dc05e63fc50325e.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4970d439d9648e97fd5a.js +1 -0
  14. package/assets/esri/core/workers/chunks/{48369e4c340413c531ff.js → 4e6e5677b90b00622146.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{257428fff4bef42716e0.js → 4f3c187a7cb2b1444281.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{31c6716d9ca188d3b870.js → 554c789f4e875d7e6fd5.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{a939d2af7e4a359c7b4d.js → 560bb06cf1bf30df4af3.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{80a930881a99ceda240a.js → 5f11fff5bc16fdec42db.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{9155dbfce5ef2c25bbbf.js → 791b3130b34b52160c1f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{5b2d40a2ce2594ce8eef.js → 95f0c15d83d1f38e01d0.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{3488e88882f40199ab33.js → a85acb948cc7d22be592.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{7159e7a3274e64b337ce.js → b481807b31e59cce9931.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{d29f894491618931d92a.js → bc27cdd7c415ab166536.js} +1 -1
  24. package/assets/esri/core/workers/chunks/c474800508e3ad5ce9d7.js +1 -0
  25. package/assets/esri/core/workers/chunks/{23a85252e4164354553e.js → c52314b987c63cd630f7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{022091e5240b9d872dd2.js → d1635a7ab0c204852237.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{c8c85ba6451b5dfc2fc0.js → da228aed337f492456cc.js} +1 -1
  28. package/assets/esri/core/workers/chunks/ddeaf688d72b2873c4ac.js +1 -0
  29. package/assets/esri/core/workers/chunks/e08b2e9213d35f85916f.js +1 -0
  30. package/assets/esri/core/workers/chunks/e6d08230adb90b9a2a17.js +1 -0
  31. package/colorUtils.js +1 -1
  32. package/config.js +1 -1
  33. package/core/AsyncUpdate.js +1 -1
  34. package/core/Collection.js +1 -1
  35. package/core/Evented.js +1 -1
  36. package/core/MultiOriginJSONSupport.js +1 -1
  37. package/core/ReadOnlyMultiOriginJSONSupport.js +1 -1
  38. package/identity/IdentityManagerBase.js +1 -1
  39. package/kernel.js +1 -1
  40. package/package.json +1 -1
  41. package/support/revision.js +1 -1
  42. package/symbols/WaterSymbol3DLayer.js +1 -1
  43. package/views/2d/engine/AFeatureContainer.js +1 -1
  44. package/views/2d/engine/Bitmap.js +1 -1
  45. package/views/2d/engine/Stage.js +1 -1
  46. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  47. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  48. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  49. package/views/2d/engine/webgl/ClippingInfo.js +1 -1
  50. package/views/2d/engine/webgl/Overlay.js +1 -1
  51. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  52. package/views/2d/engine/webgl/TiledDisplayObject.js +1 -1
  53. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  54. package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
  55. package/views/2d/grid/GridView2D.js +1 -1
  56. package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
  57. package/views/2d/layers/BaseLayerView2D.js +1 -1
  58. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  59. package/views/2d/layers/CatalogDynamicGroupLayerView2D.js +1 -1
  60. package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
  61. package/views/2d/layers/CatalogLayerView2D.js +1 -1
  62. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  63. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  64. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  65. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  66. package/views/2d/layers/MediaLayerView2D.js +1 -1
  67. package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
  68. package/views/2d/layers/StreamLayerView2D.js +1 -1
  69. package/views/2d/layers/TileLayerView2D.js +1 -1
  70. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  71. package/views/2d/layers/WMSLayerView2D.js +1 -1
  72. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  73. package/views/2d/layers/features/support/TileStore.js +1 -1
  74. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  75. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  76. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  77. package/views/3d/layers/CatalogDynamicGroupLayerView3D.js +1 -1
  78. package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
  79. package/views/3d/layers/CatalogLayerView3D.js +1 -1
  80. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  81. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  82. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  83. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  84. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  85. package/views/3d/layers/StreamLayerView3D.js +1 -1
  86. package/views/3d/layers/TileLayerView3D.js +1 -1
  87. package/views/3d/layers/WMSLayerView3D.js +1 -1
  88. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  89. package/views/3d/layers/graphics/GraphicStateTracking.js +1 -1
  90. package/views/3d/support/LimitGraphicsMap.js +1 -1
  91. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  92. package/views/View.js +1 -1
  93. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  94. package/views/layers/CatalogDynamicGroupLayerView.d.ts +1 -1
  95. package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
  96. package/views/layers/CatalogFootprintLayerView.d.ts +1 -1
  97. package/views/layers/CatalogFootprintLayerView.js +1 -1
  98. package/views/layers/CatalogLayerView.d.ts +1 -1
  99. package/views/layers/CatalogLayerView.js +1 -1
  100. package/views/layers/FeatureLayerView.d.ts +1 -1
  101. package/views/layers/FeatureLayerView.js +1 -1
  102. package/views/layers/LayerView.js +1 -1
  103. package/views/layers/OGCFeatureLayerView.d.ts +1 -1
  104. package/views/layers/OGCFeatureLayerView.js +1 -1
  105. package/views/layers/PointCloudLayerView.d.ts +1 -1
  106. package/views/layers/PointCloudLayerView.js +1 -1
  107. package/views/layers/RefreshableLayerView.js +1 -1
  108. package/views/layers/StreamLayerView.d.ts +1 -1
  109. package/views/layers/StreamLayerView.js +1 -1
  110. package/views/layers/WMSLayerView.js +1 -1
  111. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  112. package/widgets/Compass/CompassViewModel.js +1 -1
  113. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  114. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  115. package/widgets/Directions/DirectionsViewModel.js +1 -1
  116. package/widgets/Features/FeaturesViewModel.js +1 -1
  117. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  118. package/widgets/Home/HomeViewModel.js +1 -1
  119. package/widgets/Search/SearchViewModel.js +1 -1
  120. package/widgets/Widget.js +1 -1
  121. package/widgets/support/GeolocationPositioning.js +1 -1
  122. package/widgets/support/GoTo.d.ts +1 -1
  123. package/widgets/support/GoTo.js +1 -1
  124. package/assets/esri/core/workers/chunks/508c302fed242956d3b7.js +0 -1
  125. package/assets/esri/core/workers/chunks/60d889c58a542e59b07b.js +0 -1
  126. package/assets/esri/core/workers/chunks/7617fe2fbf223c108f1e.js +0 -1
  127. package/assets/esri/core/workers/chunks/9595b39e882f9a9ac839.js +0 -1
  128. package/assets/esri/core/workers/chunks/9ffbd5216aa0a45a4199.js +0 -1
  129. package/assets/esri/core/workers/chunks/a5c0b365b9f55e63ab52.js +0 -1
  130. package/assets/esri/core/workers/chunks/d5262c95116d3bdfd117.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/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import{result as r,forEach as s}from"../../../core/asyncUtils.js";import"../../../core/has.js";import o from"../../../core/Logger.js";import{destroyMaybe as n,abortMaybe as a}from"../../../core/maybe.js";import{estimateNumberArrayMemory as d,baseObjectMemory as l,estimateNumberMemory as u,estimateFixedArrayMemory as h,baseArrayMemory as p}from"../../../core/memoryEstimations.js";import{isAbortError as c,allSettledValues as _,throwIfAborted as m}from"../../../core/promiseUtils.js";import{initial as g,watch as f,sync as y}from"../../../core/reactiveUtils.js";import{pt2px as b}from"../../../core/screenUtils.js";import{isArrayBuffer as w}from"../../../core/typedArrayUtil.js";import{property as P}from"../../../core/accessorSupport/decorators/property.js";import{subclass as N}from"../../../core/accessorSupport/decorators/subclass.js";import{l as x,f as v,e as C,c as S}from"../../../chunks/vec32.js";import{clone as I}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{fromValues as A}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import R from"../../../geometry/Extent.js";import j from"../../../geometry/Point.js";import{projectBoundingSphere as k}from"../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as V}from"../../../geometry/projection/projectVectorToVector.js";import{create as Q,fromMinMax as F}from"../../../geometry/support/aaBoundingBox.js";import{fromNormalAndOffset as L,create as E}from"../../../geometry/support/plane.js";import{f as D}from"../../../chunks/sphere.js";import O from"../../../graphic/PointCloudGraphicOrigin.js";import U from"../../../layers/graphics/OptimizedGeometry.js";import{QueryEngine as q}from"../../../layers/graphics/data/QueryEngine.js";import{CodedValue as G}from"../../../layers/support/CodedValue.js";import M from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as W}from"../../../layers/support/fieldUtils.js";import{PromiseQueue as z}from"../../../layers/support/PromiseQueue.js";import H from"../../../rest/support/FeatureSet.js";import B from"../../../rest/support/Query.js";import{getElevationOffset as T}from"../../../support/elevationInfoUtils.js";import{LayerView3D as $}from"./LayerView3D.js";import{PointCloudLayerViewPerformanceInfo as J,QueuePerformanceInfo as K}from"./PointCloudLayerViewPerformanceInfo.js";import{PointCloudWorkerHandle as Z}from"./PointCloudWorkerHandle.js";import{I3SQueryFeatureStore as Y}from"./i3s/I3SQueryFeatureStore.js";import{checkPointCloudLayerValid as X,checkPointCloudLayerCompatibleWithView as ee}from"./i3s/I3SUtil.js";import{nodeDiff as te,sortFrontToBack as ie,splitWorkEntries as re}from"./i3s/LoDUtil.js";import{PagedNodeIndex as se}from"./i3s/PagedNodeIndex.js";import{PointCloudGraphic as oe}from"./i3s/PointCloudGraphic.js";import{PointCloudRenderer as ne}from"./i3s/PointCloudRenderer.js";import{isPointRendererNode as ae,PointCloudRendererNode as de}from"./i3s/PointCloudRendererNode.js";import{getSplatSizeAlgorithm as le,getFixedSizeAlgorithm as ue,getRendererInfo as he,getFilterInfo as pe,rendererUsesFixedSizes as ce,getAttributeInfo as _e}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as me,readGeometry as ge,elevationFromPositions as fe}from"./i3s/PointCloudWorkerUtil.js";import{normalizeHighlightTarget as ye,emptyHighlightHandle as be}from"./support/highlightUtils.js";import{PopupSceneLayerView as we}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as Pe}from"../support/extentUtils.js";import{computeMapPointFromVec3d as Ne}from"../support/hitTest.js";import{Obb as xe}from"../support/orientedBoundingBox.js";import{updatingProgress as ve}from"../support/updatingProperties.js";import Ce from"../../layers/LayerView.js";import Se from"../../layers/PointCloudLayerView.js";import{getHighlightName as Ie}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as Ae}from"../../support/layerViewUtils.js";import{TaskPriority as Re}from"../../support/Scheduler.js";const je=8,ke=E();let Ve=class extends(Se(we($(Ce)))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new z,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[],this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl?.path??""}get pointScale(){const e=le(this.layer?.renderer),t=1;return null!=e?.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=ue(this.layer?.renderer),t=!1;return null!=e?.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=ue(this.layer?.renderer),t=0;return null!=e?.size?e.size:t}get inverseDensity(){const e=96;return this.layer?.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=he(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.modulationAttribute.name);const i=pe(this.layer);if(i)for(const r of i)r.attributeInfo&&t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of W(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=Q(),t=this.view.renderSpatialReference;return Pe(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;return e&&"absolute-height"===e.mode?T(e,this.layer.spatialReference):0}get _graphicOrigin(){return new O(this.layer)}initialize(){const e=this.view.resourceController,t=De(e);this._worker=new Z(t),this.addResolvingPromise(this._worker.promise),X(this.layer),ee(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(2),this._dataRequester=e.createStreamDataRequester(3),this._initRenderer();const i=this._initNodePages(),r=this.view.resourceController.memoryController;this._memCache=r.newCache(`pcl-${this.layer.uid}`),this._queryFeaturesCache=r.newCache(`pcl-query-features-${this.layer.uid};`),this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),g),this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),g),this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),g),this._updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),g),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.addHandles([f(()=>this.view.quality,()=>this._setUpdateViewNeeded(),y)]),this.addResolvingPromise(i),this.when(()=>{this.addHandles([e.scheduler.registerTask(Re.POINT_CLOUD_LAYER,this),e.scheduler.registerIdleStateCallbacks(()=>this._idleBegin(),()=>this._idleEnd()),this._updatingHandles.add(()=>this.suspended,e=>{e?this._clearNodeState():this._setUpdateViewNeeded()},g)])},()=>{this._updatingHandles.removeAll(),this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker=n(this._worker),this._destroyRenderer(),this._memCache=n(this._memCache),this._queryFeaturesCache=n(this._queryFeaturesCache),this._queryEngine=n(this._queryEngine),this._codedDomainPopulationAbortController=a(this._codedDomainPopulationAbortController),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new ne({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerViewUid=this.uid,this._updatingHandles.add(()=>this._clippingBox,e=>this._renderer.clippingBox=e,g),this._updatingHandles.add(()=>this.suspended,e=>this._setPointsVisible(!e),g),this._updatingHandles.add(()=>this.pointScale,e=>this._renderer.scaleFactor=e,g),this._renderer.minSizePx=Math.sqrt(2),this._updatingHandles.add(()=>this.useRealWorldSymbolSizes,e=>this._renderer.useRealWorldSymbolSizes=e,g),this._updatingHandles.add(()=>this.pointSize,e=>{const t=b(e);this._renderer.size=e,this._renderer.sizePx=t},g),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._renderer.slicePlaneEnabled=e,g),this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,e=>{this._lodFactor=e,this._setUpdateViewNeeded()},g)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i,r){const s=null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t,o=i?"declaredClass"in i?i:Ne(this.view,i):null;return r??=this._createGraphicAttributes(e,s),new oe({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:s,epoch:this._nodeLoadEpoch},geometry:o,attributes:r,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_getGraphicAttribute(e,t,i){const r=e.storageInfo?.attributeValues,s=r?.valuesPerElement??1;if(1===s)return t[i];if("UInt8"===r?.valueType&&s<=4){let e=0;const r=i*s;for(let i=r;i<r+s;i++)e=(e<<8)+t[i];return e}}_encodeGraphicAttribute(e,t,i,r){r[e.name]=this._getGraphicAttribute(e,t,i)}_setPointsVisible(e){e&&!this._rendererAdded?(this.view.stage.addRenderPlugin(this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view.stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=ce(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_displayNodes(e){this._workQueue=te([...this._renderedNodes],e,this._index),ie(this._workQueue,this.view.state.contentCamera.viewForward,this._index),re(this._workQueue,je,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach(({abortController:t})=>e.push(t)),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach(t=>t.load.forEach(t=>e.add(t)));const t=new Array,i=new Map;this._loadingNodes.forEach((r,s)=>{e.has(s)?i.set(s,r):t.push(r)}),this._loadingNodes=i;for(const{abortController:r}of t)r.abort();this._workQueue=this._workQueue.filter(e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach(({abortController:e})=>e.abort()),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(e=>this._removeFromRenderer(e)),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get readyToRun(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.readyToRun}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&e.run(()=>this._processIndexQueue()););this._processWorkQueue(e),this._idleQueue.runTask(e)}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then(t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(e)},()=>{this._indexPagesLoading.delete(e)}),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(null==t)return void e.madeProgress();this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find(e=>!this._renderedNodes.has(e)))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map(e=>{const t=new AbortController,i=this._memCache.pop(e.toString());return null!=i?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this._loadNode(e,t.signal)}),this._loadingNodes.get(e).promise})).then(t=>{for(let i=0;i<e.load.length;i++)if(t[i]){const r=this._setupRendererData(e.load[i],t[i]);this._addToRenderer(r)}for(const i of e.remove)this._removeFromRenderer(i)}).catch(()=>{}).then(()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&!this._idleQueue.updating&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async _populateClassCodeCodedDomain(e,t){const i="CLASS_CODE",s=this.layer.fieldsIndex.get(i);if(!s||s.domain)return;if(!e.includes(s.name))return;const o=await r(this.layer.queryCachedStatistics(i,{signal:t}));if(!1===o.ok)return;const n=o.value?.stats?.labels?.labels;n&&Array.isArray(n)&&(s.domain=new M({name:"CLASS_CODE",codedValues:n.map(e=>new G({code:e.value,name:e.label}))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const r=this._splitGraphicsPerNode(e),o=this.layer.attributeStorageInfo,n=t.map(e=>_e(o,e)).filter(i),a=async(e,t)=>{const i=this._index.getNode(t);await s(n,async t=>{const r=t.useElevation?await this._loadElevationAttributeFromGeometry(i.resourceId):await this._loadAndParseAttribute(i,t);if(r)for(const i of e)if(this._isValidPointGraphic(i)){const e=i.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,r,e,i.attributes)}})},d=[];return r.forEach((e,t)=>{d.push(a(e,t))}),await Promise.allSettled(d),e}_isValidPointGraphic(e){return e instanceof oe&&e.pointCloudMetadata?.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return i?me({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=ge(t,await this._loadGeometry(e,null));return fe(i,i.length/3)}highlight(e,i){const r=ye(e);if(0===r.length)return be;if(!(r[0]instanceof t))return be;const s=r;return this._renderer.highlight(s.map(e=>this._graphicToPointDefinition(e)),Ie(i))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}get visibleAtCurrentScale(){return Ae(this.layer.effectiveScaleRange,this.view.scale)}async queryFeatures(e,i){const r=await this._ensureQueryEngine().executeQuery(this._ensureQueryJSON(e),i?.signal),s=r.features;r.features=[];const o=H.fromJSON(r),n=this.view.spatialReference;return o.features=s.map(e=>{const{attributes:i,metadata:r}=e;if(!r){const i=t.fromJSON(e);return i.geometry&&(i.geometry.spatialReference=o.spatialReference??n),i}const s=j.fromJSON(e.geometry);return s.spatialReference=o.spatialReference??n,this._createGraphic(r.node,r.pointId,s,i)}),o}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference,returnZ:!0};return new B(e)}async queryFeatureCount(e,t){return await this._ensureQueryEngine().executeQueryForCount(this._ensureQueryJSON(e),t?.signal)}async queryExtent(e,t){const{count:i,extent:r}=await this._ensureQueryEngine().executeQueryForExtent(this._ensureQueryJSON(e),t?.signal);return{count:i,extent:R.fromJSON(r)}}_ensureQueryJSON(e){return null==e?new B({outSpatialReference:this.view.spatialReference}).toJSON():B.from(e).toJSON()}_ensureQueryEngine(){if(this._queryEngine)return this._queryEngine;const{spatialReference:e}=this.view;return this._queryEngine=new q({fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:"esriGeometryPoint",spatialReference:e,featureIdInfo:{type:"object-id",fieldName:"objectId"},hasZ:!0,featureStore:new Y({sourceSpatialReference:e,viewSpatialReference:e,forAllFeatures:(e,t)=>{let i=!1;this._renderer.forEachNode(r=>{if(i)return;if(t){const e=r.obb,s=D(e.center[0],e.center[1],e.center[2],x(e.halfSize));k(s,this.view.renderSpatialReference,s,this.view.spatialReference);const o=t(s);if(2===o)return;if(i=0===o,i)return}let s=this._queryFeaturesCache.get(`${r.id}`);s||(s=this._createQueryPointFeatures(r),this._queryFeaturesCache.put(`${r.id}`,s)),s.features.forEach(e)})},getFeatureExtent:({point:e},t)=>F(e,e,t),featureAdapter:{cloneWithGeometry:(e,t)=>new Fe(e.node,e.pointId,t.coords),getAttribute:({node:e,attributePointId:t},i)=>{for(const r of e.attributes)if(r.attributeInfo.name===i)return this._getGraphicAttribute(r.attributeInfo,r.values,t)},getAttributes:({node:e,attributePointId:t})=>this._createGraphicAttributes(e,t),getCentroid:e=>e.getGeometry(),getGeometry:e=>e.getGeometry(),getObjectId:()=>{},getMetadata:e=>e}})}),this._queryEngine}_createQueryPointFeatures(e){const t=e.coordinates,i=new Array;for(let r=0;r<t.length/3;r++){const s=3*r,o=A(t[s+0],t[s+1],t[s+2]);v(o,o,e.origin),V(o,this.view.renderSpatialReference,o,this.view.spatialReference);const n=new Fe(e,r,o);i.push(n)}return new Le(i)}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new se(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then(e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()})}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then(t=>t.nodes.map((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:xe.fromJSON(t.obb),obbInRenderSR:new xe,firstChild:t.firstChild,childCount:t.childCount,vertexCount:t.vertexCount??t.pointCount,lodThreshold:t.lodThreshold??t.effectiveArea}))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;const e=this.view.quality;let t=this.inverseDensity/this._lodFactor*e;const i=this.maximumPointCount*this._lodFactor*e;let r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(s/(.75*i));for(;s>i;)t*=o,r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(2);return this._displayNodes(r),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=C(s,t.eye),n=L(s,-o,ke),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const u=e=>l.push(e);return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return u(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(u(e),!1)},pageMiss:(e,t)=>{u(e),this._indexQueue.includes(t)||this._indexQueue.push(t)}}),l}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,e.minimumDistancePlane(r));return t/(n*n)/(4*s*s)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw c(i)||o.getLogger(this).error(i),i}}async _loadAdditionalUserAttributes(e,t,r){const s=this.layer.outFields;if(!s)return[];const o=W(this.layer.fieldsIndex,s),n=new Set(e.map(e=>null!=e?e.name:null)),a=this.layer.attributeStorageInfo,d=[];for(const i of o){if(n.has(i))continue;const e=_e(a,i);e&&d.push(t(e))}const l=await _(d);return m(r),l.filter(i)}async _loadNodeAsync(e,t){const i=this._index.getNode(e),r=he(this.layer),s=pe(this.layer),o=i.resourceId,n=async e=>{if(!e)return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return null!=i?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push(async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:a,modulationAttribute:d}=r,l=n(a),u=n(d),h=s.map(e=>e.attributeInfo),p=h.map(e=>n(e)),c=this._loadAdditionalUserAttributes([a,d,...h],n,t),[_,g,f,y,b]=await Promise.all([i,l,u,Promise.all(p),c]);m(t);const w={geometryBuffer:_,primaryAttributeData:g,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obbData:this._index.getRenderObb(e).data,elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)},t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(!t?.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}_requestNodePage(e,t){const i={f:"json",...this.layer.customParameters,token:this.layer.apiKey};return this._indexRequester.request(e,0,{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,1,{query:{...this.layer.customParameters,token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._memCache.put(t.id.toString(),t)}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),s=this._index.getRenderObb(e);if(ae(t))return t.splatSize=r,t.obb=s,S(t.origin,t.obb.center),t;const n=xe.fromData(t.obbData),a=n.halfSize,d=s.halfSize,l=.01*Math.max(d[0],d[1],d[2]);if(a[0]>d[0]+l||a[1]>d[1]+l||a[2]>d[2]+l){if(this._maxLoggedBoxWarnings>0){const t=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;o.getLogger(this).warn(`Node ${e} reported bounding box too small. got ${t(s)} but points cover ${t(n)}`),0===--this._maxLoggedBoxWarnings&&o.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,n)}return new de(e,r,I(s.center),s,0===i.childCount,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}get usedMemory(){let e=0;return this._renderer.forEachNode(t=>{e+=Ee,e+=d(t.coordinates);for(const i of t.attributes){const t=i.values;w(t.buffer)&&(e+=d(t))}}),e}get unloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount);let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.usedMemory-e*Ee)/t)+i*Ee}get performanceInfo(){return new J(this.usedMemory,this._renderedNodes.size,[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount,0),this.maximumPointCount,new K(this._loadingNodes.size,this._indexQueue.length,this._workQueue.length,this._idleQueue.length))}get test(){}};e([P()],Ve.prototype,"layer",void 0),e([P()],Ve.prototype,"baseUrl",null),e([P()],Ve.prototype,"pointScale",null),e([P()],Ve.prototype,"useRealWorldSymbolSizes",null),e([P()],Ve.prototype,"pointSize",null),e([P()],Ve.prototype,"inverseDensity",null),e([P()],Ve.prototype,"maximumPointCount",void 0),e([P({readOnly:!0})],Ve.prototype,"availableFields",null),e([P({readOnly:!0})],Ve.prototype,"_clippingBox",null),e([P({readOnly:!0})],Ve.prototype,"_elevationOffset",null),e([P({type:Boolean})],Ve.prototype,"slicePlaneEnabled",void 0),e([P()],Ve.prototype,"_graphicOrigin",null),e([P()],Ve.prototype,"updating",void 0),e([P(ve)],Ve.prototype,"updatingProgress",void 0),e([P({readOnly:!0})],Ve.prototype,"updatingProgressValue",null),e([P({readOnly:!0})],Ve.prototype,"visibleAtCurrentScale",null),Ve=e([N("esri.views.3d.layers.PointCloudLayerView3D")],Ve);const Qe=Ve;class Fe{constructor(e,t,i){this.node=e,this.pointId=t,this.point=i}getGeometry(){return new U([1],Array.from(this.point))}get attributePointId(){const{node:e,pointId:t}=this;return null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t}get usedMemory(){return l+l+u+h(this.point,u)}}class Le{constructor(e){this.features=e}get cachedMemory(){return this.features.reduce((e,t)=>e+t.usedMemory,l+p)}}const Ee=160;function De(e){return t=>e.immediate.schedule(t)}export{Qe as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import{result as r,forEach as s}from"../../../core/asyncUtils.js";import"../../../core/has.js";import o from"../../../core/Logger.js";import{destroyMaybe as n,abortMaybe as a}from"../../../core/maybe.js";import{estimateNumberArrayMemory as d,baseObjectMemory as l,estimateNumberMemory as u,estimateFixedArrayMemory as h,baseArrayMemory as p}from"../../../core/memoryEstimations.js";import{isAbortError as c,allSettledValues as _,throwIfAborted as m}from"../../../core/promiseUtils.js";import{initial as g,watch as f,sync as y}from"../../../core/reactiveUtils.js";import{pt2px as b}from"../../../core/screenUtils.js";import{isArrayBuffer as w}from"../../../core/typedArrayUtil.js";import{property as P}from"../../../core/accessorSupport/decorators/property.js";import{subclass as N}from"../../../core/accessorSupport/decorators/subclass.js";import{l as x,f as v,e as C,c as S}from"../../../chunks/vec32.js";import{clone as I}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{fromValues as A}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import R from"../../../geometry/Extent.js";import j from"../../../geometry/Point.js";import{projectBoundingSphere as k}from"../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as V}from"../../../geometry/projection/projectVectorToVector.js";import{create as Q,fromMinMax as F}from"../../../geometry/support/aaBoundingBox.js";import{fromNormalAndOffset as L,create as E}from"../../../geometry/support/plane.js";import{f as D}from"../../../chunks/sphere.js";import O from"../../../graphic/PointCloudGraphicOrigin.js";import U from"../../../layers/graphics/OptimizedGeometry.js";import{QueryEngine as q}from"../../../layers/graphics/data/QueryEngine.js";import{CodedValue as G}from"../../../layers/support/CodedValue.js";import M from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as W}from"../../../layers/support/fieldUtils.js";import{PromiseQueue as z}from"../../../layers/support/PromiseQueue.js";import H from"../../../rest/support/FeatureSet.js";import B from"../../../rest/support/Query.js";import{getElevationOffset as T}from"../../../support/elevationInfoUtils.js";import{LayerView3D as $}from"./LayerView3D.js";import{PointCloudLayerViewPerformanceInfo as J,QueuePerformanceInfo as K}from"./PointCloudLayerViewPerformanceInfo.js";import{PointCloudWorkerHandle as Z}from"./PointCloudWorkerHandle.js";import{I3SQueryFeatureStore as Y}from"./i3s/I3SQueryFeatureStore.js";import{checkPointCloudLayerValid as X,checkPointCloudLayerCompatibleWithView as ee}from"./i3s/I3SUtil.js";import{nodeDiff as te,sortFrontToBack as ie,splitWorkEntries as re}from"./i3s/LoDUtil.js";import{PagedNodeIndex as se}from"./i3s/PagedNodeIndex.js";import{PointCloudGraphic as oe}from"./i3s/PointCloudGraphic.js";import{PointCloudRenderer as ne}from"./i3s/PointCloudRenderer.js";import{isPointRendererNode as ae,PointCloudRendererNode as de}from"./i3s/PointCloudRendererNode.js";import{getSplatSizeAlgorithm as le,getFixedSizeAlgorithm as ue,getRendererInfo as he,getFilterInfo as pe,rendererUsesFixedSizes as ce,getAttributeInfo as _e}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as me,readGeometry as ge,elevationFromPositions as fe}from"./i3s/PointCloudWorkerUtil.js";import{normalizeHighlightTarget as ye,emptyHighlightHandle as be}from"./support/highlightUtils.js";import{PopupSceneLayerView as we}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as Pe}from"../support/extentUtils.js";import{computeMapPointFromVec3d as Ne}from"../support/hitTest.js";import{Obb as xe}from"../support/orientedBoundingBox.js";import{updatingProgress as ve}from"../support/updatingProperties.js";import Ce from"../../layers/LayerView.js";import{PointCloudLayerView as Se}from"../../layers/PointCloudLayerView.js";import{getHighlightName as Ie}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as Ae}from"../../support/layerViewUtils.js";import{TaskPriority as Re}from"../../support/Scheduler.js";const je=8,ke=E();let Ve=class extends(Se(we($(Ce)))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new z,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[],this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl?.path??""}get pointScale(){const e=le(this.layer?.renderer),t=1;return null!=e?.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=ue(this.layer?.renderer),t=!1;return null!=e?.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=ue(this.layer?.renderer),t=0;return null!=e?.size?e.size:t}get inverseDensity(){const e=96;return this.layer?.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=he(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.modulationAttribute.name);const i=pe(this.layer);if(i)for(const r of i)r.attributeInfo&&t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of W(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=Q(),t=this.view.renderSpatialReference;return Pe(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;return e&&"absolute-height"===e.mode?T(e,this.layer.spatialReference):0}get _graphicOrigin(){return new O(this.layer)}initialize(){const e=this.view.resourceController,t=De(e);this._worker=new Z(t),this.addResolvingPromise(this._worker.promise),X(this.layer),ee(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(2),this._dataRequester=e.createStreamDataRequester(3),this._initRenderer();const i=this._initNodePages(),r=this.view.resourceController.memoryController;this._memCache=r.newCache(`pcl-${this.layer.uid}`),this._queryFeaturesCache=r.newCache(`pcl-query-features-${this.layer.uid};`),this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),g),this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),g),this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),g),this._updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),g),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.addHandles([f(()=>this.view.quality,()=>this._setUpdateViewNeeded(),y)]),this.addResolvingPromise(i),this.when(()=>{this.addHandles([e.scheduler.registerTask(Re.POINT_CLOUD_LAYER,this),e.scheduler.registerIdleStateCallbacks(()=>this._idleBegin(),()=>this._idleEnd()),this._updatingHandles.add(()=>this.suspended,e=>{e?this._clearNodeState():this._setUpdateViewNeeded()},g)])},()=>{this._updatingHandles.removeAll(),this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker=n(this._worker),this._destroyRenderer(),this._memCache=n(this._memCache),this._queryFeaturesCache=n(this._queryFeaturesCache),this._queryEngine=n(this._queryEngine),this._codedDomainPopulationAbortController=a(this._codedDomainPopulationAbortController),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new ne({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerViewUid=this.uid,this._updatingHandles.add(()=>this._clippingBox,e=>this._renderer.clippingBox=e,g),this._updatingHandles.add(()=>this.suspended,e=>this._setPointsVisible(!e),g),this._updatingHandles.add(()=>this.pointScale,e=>this._renderer.scaleFactor=e,g),this._renderer.minSizePx=Math.sqrt(2),this._updatingHandles.add(()=>this.useRealWorldSymbolSizes,e=>this._renderer.useRealWorldSymbolSizes=e,g),this._updatingHandles.add(()=>this.pointSize,e=>{const t=b(e);this._renderer.size=e,this._renderer.sizePx=t},g),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._renderer.slicePlaneEnabled=e,g),this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),g),this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,e=>{this._lodFactor=e,this._setUpdateViewNeeded()},g)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i,r){const s=null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t,o=i?"declaredClass"in i?i:Ne(this.view,i):null;return r??=this._createGraphicAttributes(e,s),new oe({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:s,epoch:this._nodeLoadEpoch},geometry:o,attributes:r,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_getGraphicAttribute(e,t,i){const r=e.storageInfo?.attributeValues,s=r?.valuesPerElement??1;if(1===s)return t[i];if("UInt8"===r?.valueType&&s<=4){let e=0;const r=i*s;for(let i=r;i<r+s;i++)e=(e<<8)+t[i];return e}}_encodeGraphicAttribute(e,t,i,r){r[e.name]=this._getGraphicAttribute(e,t,i)}_setPointsVisible(e){e&&!this._rendererAdded?(this.view.stage.addRenderPlugin(this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view.stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=ce(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_displayNodes(e){this._workQueue=te([...this._renderedNodes],e,this._index),ie(this._workQueue,this.view.state.contentCamera.viewForward,this._index),re(this._workQueue,je,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach(({abortController:t})=>e.push(t)),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach(t=>t.load.forEach(t=>e.add(t)));const t=new Array,i=new Map;this._loadingNodes.forEach((r,s)=>{e.has(s)?i.set(s,r):t.push(r)}),this._loadingNodes=i;for(const{abortController:r}of t)r.abort();this._workQueue=this._workQueue.filter(e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach(({abortController:e})=>e.abort()),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(e=>this._removeFromRenderer(e)),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get readyToRun(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.readyToRun}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&e.run(()=>this._processIndexQueue()););this._processWorkQueue(e),this._idleQueue.runTask(e)}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then(t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(e)},()=>{this._indexPagesLoading.delete(e)}),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(null==t)return void e.madeProgress();this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find(e=>!this._renderedNodes.has(e)))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map(e=>{const t=new AbortController,i=this._memCache.pop(e.toString());return null!=i?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this._loadNode(e,t.signal)}),this._loadingNodes.get(e).promise})).then(t=>{for(let i=0;i<e.load.length;i++)if(t[i]){const r=this._setupRendererData(e.load[i],t[i]);this._addToRenderer(r)}for(const i of e.remove)this._removeFromRenderer(i)}).catch(()=>{}).then(()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&!this._idleQueue.updating&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async _populateClassCodeCodedDomain(e,t){const i="CLASS_CODE",s=this.layer.fieldsIndex.get(i);if(!s||s.domain)return;if(!e.includes(s.name))return;const o=await r(this.layer.queryCachedStatistics(i,{signal:t}));if(!1===o.ok)return;const n=o.value?.stats?.labels?.labels;n&&Array.isArray(n)&&(s.domain=new M({name:"CLASS_CODE",codedValues:n.map(e=>new G({code:e.value,name:e.label}))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const r=this._splitGraphicsPerNode(e),o=this.layer.attributeStorageInfo,n=t.map(e=>_e(o,e)).filter(i),a=async(e,t)=>{const i=this._index.getNode(t);await s(n,async t=>{const r=t.useElevation?await this._loadElevationAttributeFromGeometry(i.resourceId):await this._loadAndParseAttribute(i,t);if(r)for(const i of e)if(this._isValidPointGraphic(i)){const e=i.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,r,e,i.attributes)}})},d=[];return r.forEach((e,t)=>{d.push(a(e,t))}),await Promise.allSettled(d),e}_isValidPointGraphic(e){return e instanceof oe&&e.pointCloudMetadata?.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return i?me({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=ge(t,await this._loadGeometry(e,null));return fe(i,i.length/3)}highlight(e,i){const r=ye(e);if(0===r.length)return be;if(!(r[0]instanceof t))return be;const s=r;return this._renderer.highlight(s.map(e=>this._graphicToPointDefinition(e)),Ie(i))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}get visibleAtCurrentScale(){return Ae(this.layer.effectiveScaleRange,this.view.scale)}async queryFeatures(e,i){const r=await this._ensureQueryEngine().executeQuery(this._ensureQueryJSON(e),i?.signal),s=r.features;r.features=[];const o=H.fromJSON(r),n=this.view.spatialReference;return o.features=s.map(e=>{const{attributes:i,metadata:r}=e;if(!r){const i=t.fromJSON(e);return i.geometry&&(i.geometry.spatialReference=o.spatialReference??n),i}const s=j.fromJSON(e.geometry);return s.spatialReference=o.spatialReference??n,this._createGraphic(r.node,r.pointId,s,i)}),o}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference,returnZ:!0};return new B(e)}async queryFeatureCount(e,t){return await this._ensureQueryEngine().executeQueryForCount(this._ensureQueryJSON(e),t?.signal)}async queryExtent(e,t){const{count:i,extent:r}=await this._ensureQueryEngine().executeQueryForExtent(this._ensureQueryJSON(e),t?.signal);return{count:i,extent:R.fromJSON(r)}}_ensureQueryJSON(e){return null==e?new B({outSpatialReference:this.view.spatialReference}).toJSON():B.from(e).toJSON()}_ensureQueryEngine(){if(this._queryEngine)return this._queryEngine;const{spatialReference:e}=this.view;return this._queryEngine=new q({fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:"esriGeometryPoint",spatialReference:e,featureIdInfo:{type:"object-id",fieldName:"objectId"},hasZ:!0,featureStore:new Y({sourceSpatialReference:e,viewSpatialReference:e,forAllFeatures:(e,t)=>{let i=!1;this._renderer.forEachNode(r=>{if(i)return;if(t){const e=r.obb,s=D(e.center[0],e.center[1],e.center[2],x(e.halfSize));k(s,this.view.renderSpatialReference,s,this.view.spatialReference);const o=t(s);if(2===o)return;if(i=0===o,i)return}let s=this._queryFeaturesCache.get(`${r.id}`);s||(s=this._createQueryPointFeatures(r),this._queryFeaturesCache.put(`${r.id}`,s)),s.features.forEach(e)})},getFeatureExtent:({point:e},t)=>F(e,e,t),featureAdapter:{cloneWithGeometry:(e,t)=>new Fe(e.node,e.pointId,t.coords),getAttribute:({node:e,attributePointId:t},i)=>{for(const r of e.attributes)if(r.attributeInfo.name===i)return this._getGraphicAttribute(r.attributeInfo,r.values,t)},getAttributes:({node:e,attributePointId:t})=>this._createGraphicAttributes(e,t),getCentroid:e=>e.getGeometry(),getGeometry:e=>e.getGeometry(),getObjectId:()=>{},getMetadata:e=>e}})}),this._queryEngine}_createQueryPointFeatures(e){const t=e.coordinates,i=new Array;for(let r=0;r<t.length/3;r++){const s=3*r,o=A(t[s+0],t[s+1],t[s+2]);v(o,o,e.origin),V(o,this.view.renderSpatialReference,o,this.view.spatialReference);const n=new Fe(e,r,o);i.push(n)}return new Le(i)}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new se(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then(e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()})}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then(t=>t.nodes.map((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:xe.fromJSON(t.obb),obbInRenderSR:new xe,firstChild:t.firstChild,childCount:t.childCount,vertexCount:t.vertexCount??t.pointCount,lodThreshold:t.lodThreshold??t.effectiveArea}))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;const e=this.view.quality;let t=this.inverseDensity/this._lodFactor*e;const i=this.maximumPointCount*this._lodFactor*e;let r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(s/(.75*i));for(;s>i;)t*=o,r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(2);return this._displayNodes(r),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=C(s,t.eye),n=L(s,-o,ke),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const u=e=>l.push(e);return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return u(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(u(e),!1)},pageMiss:(e,t)=>{u(e),this._indexQueue.includes(t)||this._indexQueue.push(t)}}),l}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,e.minimumDistancePlane(r));return t/(n*n)/(4*s*s)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw c(i)||o.getLogger(this).error(i),i}}async _loadAdditionalUserAttributes(e,t,r){const s=this.layer.outFields;if(!s)return[];const o=W(this.layer.fieldsIndex,s),n=new Set(e.map(e=>null!=e?e.name:null)),a=this.layer.attributeStorageInfo,d=[];for(const i of o){if(n.has(i))continue;const e=_e(a,i);e&&d.push(t(e))}const l=await _(d);return m(r),l.filter(i)}async _loadNodeAsync(e,t){const i=this._index.getNode(e),r=he(this.layer),s=pe(this.layer),o=i.resourceId,n=async e=>{if(!e)return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return null!=i?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push(async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:a,modulationAttribute:d}=r,l=n(a),u=n(d),h=s.map(e=>e.attributeInfo),p=h.map(e=>n(e)),c=this._loadAdditionalUserAttributes([a,d,...h],n,t),[_,g,f,y,b]=await Promise.all([i,l,u,Promise.all(p),c]);m(t);const w={geometryBuffer:_,primaryAttributeData:g,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obbData:this._index.getRenderObb(e).data,elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)},t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(!t?.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}_requestNodePage(e,t){const i={f:"json",...this.layer.customParameters,token:this.layer.apiKey};return this._indexRequester.request(e,0,{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,1,{query:{...this.layer.customParameters,token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._memCache.put(t.id.toString(),t)}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),s=this._index.getRenderObb(e);if(ae(t))return t.splatSize=r,t.obb=s,S(t.origin,t.obb.center),t;const n=xe.fromData(t.obbData),a=n.halfSize,d=s.halfSize,l=.01*Math.max(d[0],d[1],d[2]);if(a[0]>d[0]+l||a[1]>d[1]+l||a[2]>d[2]+l){if(this._maxLoggedBoxWarnings>0){const t=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;o.getLogger(this).warn(`Node ${e} reported bounding box too small. got ${t(s)} but points cover ${t(n)}`),0===--this._maxLoggedBoxWarnings&&o.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,n)}return new de(e,r,I(s.center),s,0===i.childCount,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}get usedMemory(){let e=0;return this._renderer.forEachNode(t=>{e+=Ee,e+=d(t.coordinates);for(const i of t.attributes){const t=i.values;w(t.buffer)&&(e+=d(t))}}),e}get unloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount);let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.usedMemory-e*Ee)/t)+i*Ee}get performanceInfo(){return new J(this.usedMemory,this._renderedNodes.size,[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount,0),this.maximumPointCount,new K(this._loadingNodes.size,this._indexQueue.length,this._workQueue.length,this._idleQueue.length))}get test(){}};e([P()],Ve.prototype,"layer",void 0),e([P()],Ve.prototype,"baseUrl",null),e([P()],Ve.prototype,"pointScale",null),e([P()],Ve.prototype,"useRealWorldSymbolSizes",null),e([P()],Ve.prototype,"pointSize",null),e([P()],Ve.prototype,"inverseDensity",null),e([P()],Ve.prototype,"maximumPointCount",void 0),e([P({readOnly:!0})],Ve.prototype,"availableFields",null),e([P({readOnly:!0})],Ve.prototype,"_clippingBox",null),e([P({readOnly:!0})],Ve.prototype,"_elevationOffset",null),e([P({type:Boolean})],Ve.prototype,"slicePlaneEnabled",void 0),e([P()],Ve.prototype,"_graphicOrigin",null),e([P()],Ve.prototype,"updating",void 0),e([P(ve)],Ve.prototype,"updatingProgress",void 0),e([P({readOnly:!0})],Ve.prototype,"updatingProgressValue",null),e([P({readOnly:!0})],Ve.prototype,"visibleAtCurrentScale",null),Ve=e([N("esri.views.3d.layers.PointCloudLayerView3D")],Ve);const Qe=Ve;class Fe{constructor(e,t,i){this.node=e,this.pointId=t,this.point=i}getGeometry(){return new U([1],Array.from(this.point))}get attributePointId(){const{node:e,pointId:t}=this;return null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t}get usedMemory(){return l+l+u+h(this.point,u)}}class Le{constructor(e){this.features=e}get cachedMemory(){return this.features.reduce((e,t)=>e+t.usedMemory,l+p)}}const Ee=160;function De(e){return t=>e.immediate.schedule(t)}export{Qe as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{watch as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../graphic/StreamGraphicOrigin.js";import a from"../../../rest/support/Query.js";import{isNumber as n}from"../../../support/guards.js";import{FeatureLikeLayerView3D as p}from"./FeatureLikeLayerView3D.js";import{LayerView3D as c}from"./LayerView3D.js";import{StreamController as l}from"./graphics/StreamController.js";import{StreamGraphics3DGraphicsPipeline as u}from"./graphics/StreamGraphics3DGraphicsPipeline.js";import h from"../../layers/LayerView.js";import m from"../../layers/StreamLayerView.js";let y=class extends(m(p(c(h)))){constructor(){super(...arguments),this.type="stream-3d",this.updatePolicy=0,this.hasZ=!0,this.hasM=!1,this.featureEffect=null}initialize(){this.addHandles(t(()=>this.suspended,e=>{this.graphicsPipeline&&this._onSuspendedChange(e)}))}get connectionError(){const e=this.graphicsPipeline?.connection?.errorString;return e?new r("stream-controller",e):null}get graphicOrigin(){return new o(this.layer)}createQuery(){return new a({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryLatestObservations(e,r){return this.graphicsPipeline.graphicsQuery.executeQueryForLatestObservations(this._ensureQuery(e),r?.signal)}async queryObjectIds(e,r){return(await super.queryObjectIds(e,r)).filter(n)}get _streamConnectionStatus(){return this.graphicsPipeline?.connection?.connectionStatus??"disconnected"}async createGraphicsPipeline(){return new u({layerView:this})}createController(){return new l({layer:this.layer,layerView:this})}beforeSetController(){}_doPause(){this.graphicsPipeline?.pause()}_doResume(){this.graphicsPipeline?.resume()}_doDisconnect(){this.graphicsPipeline?.disconnect(),this._doPause()}_doConnect(){this.graphicsPipeline?.connect(),this.resume()}_doClear(){this.graphicsPipeline?.clear()}};e([i({readOnly:!0})],y.prototype,"updatePolicy",void 0),e([i({readOnly:!0})],y.prototype,"connectionError",null),e([i()],y.prototype,"graphicsPipeline",void 0),e([i({readOnly:!0})],y.prototype,"hasZ",void 0),e([i({readOnly:!0})],y.prototype,"hasM",void 0),e([i()],y.prototype,"featureEffect",void 0),e([i()],y.prototype,"graphicOrigin",null),e([i({readOnly:!0})],y.prototype,"_streamConnectionStatus",null),y=e([s("esri.views.3d.layers.StreamLayerView3D")],y);const d=y;export{d as default};
5
+ import{__decorate as e}from"tslib";import r from"../../../core/Error.js";import{watch as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../graphic/StreamGraphicOrigin.js";import a from"../../../rest/support/Query.js";import{isNumber as n}from"../../../support/guards.js";import{FeatureLikeLayerView3D as p}from"./FeatureLikeLayerView3D.js";import{LayerView3D as c}from"./LayerView3D.js";import{StreamController as l}from"./graphics/StreamController.js";import{StreamGraphics3DGraphicsPipeline as u}from"./graphics/StreamGraphics3DGraphicsPipeline.js";import h from"../../layers/LayerView.js";import{StreamLayerView as m}from"../../layers/StreamLayerView.js";let y=class extends(m(p(c(h)))){constructor(){super(...arguments),this.type="stream-3d",this.updatePolicy=0,this.hasZ=!0,this.hasM=!1,this.featureEffect=null}initialize(){this.addHandles(t(()=>this.suspended,e=>{this.graphicsPipeline&&this._onSuspendedChange(e)}))}get connectionError(){const e=this.graphicsPipeline?.connection?.errorString;return e?new r("stream-controller",e):null}get graphicOrigin(){return new o(this.layer)}createQuery(){return new a({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryLatestObservations(e,r){return this.graphicsPipeline.graphicsQuery.executeQueryForLatestObservations(this._ensureQuery(e),r?.signal)}async queryObjectIds(e,r){return(await super.queryObjectIds(e,r)).filter(n)}get _streamConnectionStatus(){return this.graphicsPipeline?.connection?.connectionStatus??"disconnected"}async createGraphicsPipeline(){return new u({layerView:this})}createController(){return new l({layer:this.layer,layerView:this})}beforeSetController(){}_doPause(){this.graphicsPipeline?.pause()}_doResume(){this.graphicsPipeline?.resume()}_doDisconnect(){this.graphicsPipeline?.disconnect(),this._doPause()}_doConnect(){this.graphicsPipeline?.connect(),this.resume()}_doClear(){this.graphicsPipeline?.clear()}};e([i({readOnly:!0})],y.prototype,"updatePolicy",void 0),e([i({readOnly:!0})],y.prototype,"connectionError",null),e([i()],y.prototype,"graphicsPipeline",void 0),e([i({readOnly:!0})],y.prototype,"hasZ",void 0),e([i({readOnly:!0})],y.prototype,"hasM",void 0),e([i()],y.prototype,"featureEffect",void 0),e([i()],y.prototype,"graphicOrigin",null),e([i({readOnly:!0})],y.prototype,"_streamConnectionStatus",null),y=e([s("esri.views.3d.layers.StreamLayerView3D")],y);const d=y;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{destroyHandle as r,makeHandle as i}from"../../../core/handleUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{canProjectWithoutEngine as l}from"../../../geometry/projectionUtils.js";import{LayerView3D as a}from"./LayerView3D.js";import{TiledLayerView3D as p}from"./TiledLayerView3D.js";import{fetchTile as n}from"./support/fetchTile.js";import{SublayerPopupHighlightHelper3D as h}from"./support/SublayerPopupHighlightHelper3D.js";import m from"../../layers/LayerView.js";import f from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as u}from"../../layers/support/MapServiceLayerViewHelper.js";let c=class extends(f(p(a(m)))){constructor(){super(...arguments),this.type="tile-3d"}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get tileInfo(){return this.layer.tileInfo}initialize(){if("web-tile"===this.layer.type){const e=this.layer.fullExtent?.spatialReference,r=this.layer.tileInfo?.spatialReference;if(null==e||null==r||!l(e,r)){const e="defaults"===this.layer.originOf("fullExtent")||null==this.layer.fullExtent?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new t("layerview:incompatible-fullextent",e)))}}if(u(this,this.layer)){const e=new h({view:this.view,layerView:this,updatingHandles:this._updatingHandles});this._popupHighlightHelper=e,this.addHandles(r(e))}this._addTilingSchemeMatchPromise()}async fetchTile(e,t){return n(this,e,t)}async fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper?.fetchPopupFeaturesAtLocation(e,t)??[]}highlight(e,t){return this._popupHighlightHelper?.highlight(e,t)??i()}async doRefresh(){this.suspended||this.emit("data-changed")}};e([o()],c.prototype,"imageFormatIsOpaque",null),e([o()],c.prototype,"hasMixedImageFormats",null),e([o()],c.prototype,"layer",void 0),e([o()],c.prototype,"tileInfo",null),c=e([s("esri.views.3d.layers.TileLayerView3D")],c);const y=c;export{y as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{destroyHandle as r,makeHandle as i}from"../../../core/handleUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{canProjectWithoutEngine as l}from"../../../geometry/projectionUtils.js";import{LayerView3D as a}from"./LayerView3D.js";import{TiledLayerView3D as p}from"./TiledLayerView3D.js";import{fetchTile as n}from"./support/fetchTile.js";import{SublayerPopupHighlightHelper3D as h}from"./support/SublayerPopupHighlightHelper3D.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as u}from"../../layers/support/MapServiceLayerViewHelper.js";let c=class extends(f(p(a(m)))){constructor(){super(...arguments),this.type="tile-3d"}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get tileInfo(){return this.layer.tileInfo}initialize(){if("web-tile"===this.layer.type){const e=this.layer.fullExtent?.spatialReference,r=this.layer.tileInfo?.spatialReference;if(null==e||null==r||!l(e,r)){const e="defaults"===this.layer.originOf("fullExtent")||null==this.layer.fullExtent?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new t("layerview:incompatible-fullextent",e)))}}if(u(this,this.layer)){const e=new h({view:this.view,layerView:this,updatingHandles:this._updatingHandles});this._popupHighlightHelper=e,this.addHandles(r(e))}this._addTilingSchemeMatchPromise()}async fetchTile(e,t){return n(this,e,t)}async fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper?.fetchPopupFeaturesAtLocation(e,t)??[]}highlight(e,t){return this._popupHighlightHelper?.highlight(e,t)??i()}async doRefresh(){this.suspended||this.emit("data-changed")}};e([o()],c.prototype,"imageFormatIsOpaque",null),e([o()],c.prototype,"hasMixedImageFormats",null),e([o()],c.prototype,"layer",void 0),e([o()],c.prototype,"tileInfo",null),c=e([s("esri.views.3d.layers.TileLayerView3D")],c);const y=c;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/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Extent.js";import s from"./DynamicLayerView3D.js";import o from"../../layers/WMSLayerView.js";let a=class extends(o(s)){constructor(){super(...arguments),this.type="wms-3d"}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The spatial references supported by this WMS layer are incompatible with the spatial reference of the view"))),this._updatingHandles.add(()=>this.exportImageParameters?.version,()=>{this._updatingHandles.addPromise(this.refreshDebounced())})}createFetchPopupFeaturesQuery(e){const{subView:t}=this;if("draped"!==t.type)return null;const r=t.findExtentInfoAt(e),s=r.extent,o=new i(s[0],s[1],s[2],s[3],t.spatialReference),a=r.imageSize,n=a.width,p=a.height,m=o.width/n;return{extent:o,width:n,height:p,x:Math.round((e.x-o.xmin)/m),y:Math.round((o.ymax-e.y)/m)}}getFetchOptions(){return{timeExtent:this.timeExtent}}};a=e([r("esri.views.3d.layers.WMSLayerView3D")],a);const n=a;export{n as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/Logger.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Extent.js";import s from"./DynamicLayerView3D.js";import{WMSLayerView as o}from"../../layers/WMSLayerView.js";let a=class extends(o(s)){constructor(){super(...arguments),this.type="wms-3d"}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The spatial references supported by this WMS layer are incompatible with the spatial reference of the view"))),this._updatingHandles.add(()=>this.exportImageParameters?.version,()=>{this._updatingHandles.addPromise(this.refreshDebounced())})}createFetchPopupFeaturesQuery(e){const{subView:t}=this;if("draped"!==t.type)return null;const r=t.findExtentInfoAt(e),s=r.extent,o=new i(s[0],s[1],s[2],s[3],t.spatialReference),a=r.imageSize,n=a.width,p=a.height,m=o.width/n;return{extent:o,width:n,height:p,x:Math.round((e.x-o.xmin)/m),y:Math.round((o.ymax-e.y)/m)}}getFetchOptions(){return{timeExtent:this.timeExtent}}};a=e([r("esri.views.3d.layers.WMSLayerView3D")],a);const n=a;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/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{whenOnce as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getTileMaxtrixSetFromActiveLayer as l}from"../../../layers/support/layerUtils.js";import{LayerView3D as a}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{fetchTile as h}from"./support/fetchTile.js";import p from"../../layers/LayerView.js";import c from"../../layers/RefreshableLayerView.js";let d=class extends(c(n(a(p)))){constructor(){super(...arguments),this.type="wmts-3d"}initialize(){this._getCompatibleTileInfoMatrixSet(e=>this._getTileInfoSupportError(e.tileInfo,e.fullExtent));const e=r(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this._getCompatibleTileInfoMatrixSet(e=>this._getTileInfoError(e.tileInfo,e.fullExtent));null!=e&&(null!==e.id&&this.layer.activeLayer.tileMatrixSetId!==e.id&&(this.layer.activeLayer.tileMatrixSetId=e.id),e.tileInfo&&(this.tileInfo=e.tileInfo),this.layer.fullExtent=e.fullExtent)});this.addResolvingPromise(e),this.when(()=>this._postInitialize())}refresh(){this.emit("data-changed")}canResume(){if(!super.canResume())return!1;const e=this.layer.activeLayer.tileMatrixSet;return null!=e&&!this._getTileInfoError(e.tileInfo,e.fullExtent)}async fetchTile(e,t){return h(this,e,t)}async doRefresh(){this.suspended||this.emit("data-changed")}_postInitialize(){this._updatingHandles.add(()=>this.layer?.activeLayer?.styleId,()=>this.refresh()),this._updatingHandles.add(()=>this.layer?.activeLayer,e=>{const t=this._getCompatibleTileInfoMatrixSet(e=>this._getTileInfoError(e.tileInfo,e.fullExtent),!0);t&&null!=t.id&&e.tileMatrixSetId!==t.id&&(this.layer.activeLayer.tileMatrixSetId=t.id),this.notifyChange("suspended"),this.canResume()&&this.refresh()})}_getCompatibleTileInfoMatrixSet(e,r=!1){const s=l(this.layer);if(null!=s){if(t.isCollection(s)){const t=s.find(t=>{const s=e(t);return null!=s&&(r?i.getLogger(this).error("The selected tile matrix set is not compatible with the view",s):this.addResolvingPromise(Promise.reject(s))),null==s});return t}const o=e(s);return null!=o&&(r?i.getLogger(this).error("The selected tile matrix set is not compatible with the view",o):this.addResolvingPromise(Promise.reject(o))),s}return null}_getTileInfoError(e,t){return this._getTileInfoSupportError(e,t)||this._getTileInfoCompatibilityError(e,this.view.basemapTerrain.tilingScheme)}};e([s()],d.prototype,"layer",void 0),e([s()],d.prototype,"suspended",void 0),e([s()],d.prototype,"tileInfo",void 0),d=e([o("esri.views.3d.layers.WMTSLayerView3D")],d);const m=d;export{m as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{whenOnce as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getTileMaxtrixSetFromActiveLayer as l}from"../../../layers/support/layerUtils.js";import{LayerView3D as a}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{fetchTile as h}from"./support/fetchTile.js";import p from"../../layers/LayerView.js";import{RefreshableLayerView as c}from"../../layers/RefreshableLayerView.js";let d=class extends(c(n(a(p)))){constructor(){super(...arguments),this.type="wmts-3d"}initialize(){this._getCompatibleTileInfoMatrixSet(e=>this._getTileInfoSupportError(e.tileInfo,e.fullExtent));const e=r(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{const e=this._getCompatibleTileInfoMatrixSet(e=>this._getTileInfoError(e.tileInfo,e.fullExtent));null!=e&&(null!==e.id&&this.layer.activeLayer.tileMatrixSetId!==e.id&&(this.layer.activeLayer.tileMatrixSetId=e.id),e.tileInfo&&(this.tileInfo=e.tileInfo),this.layer.fullExtent=e.fullExtent)});this.addResolvingPromise(e),this.when(()=>this._postInitialize())}refresh(){this.emit("data-changed")}canResume(){if(!super.canResume())return!1;const e=this.layer.activeLayer.tileMatrixSet;return null!=e&&!this._getTileInfoError(e.tileInfo,e.fullExtent)}async fetchTile(e,t){return h(this,e,t)}async doRefresh(){this.suspended||this.emit("data-changed")}_postInitialize(){this._updatingHandles.add(()=>this.layer?.activeLayer?.styleId,()=>this.refresh()),this._updatingHandles.add(()=>this.layer?.activeLayer,e=>{const t=this._getCompatibleTileInfoMatrixSet(e=>this._getTileInfoError(e.tileInfo,e.fullExtent),!0);t&&null!=t.id&&e.tileMatrixSetId!==t.id&&(this.layer.activeLayer.tileMatrixSetId=t.id),this.notifyChange("suspended"),this.canResume()&&this.refresh()})}_getCompatibleTileInfoMatrixSet(e,r=!1){const s=l(this.layer);if(null!=s){if(t.isCollection(s)){const t=s.find(t=>{const s=e(t);return null!=s&&(r?i.getLogger(this).error("The selected tile matrix set is not compatible with the view",s):this.addResolvingPromise(Promise.reject(s))),null==s});return t}const o=e(s);return null!=o&&(r?i.getLogger(this).error("The selected tile matrix set is not compatible with the view",o):this.addResolvingPromise(Promise.reject(o))),s}return null}_getTileInfoError(e,t){return this._getTileInfoSupportError(e,t)||this._getTileInfoCompatibilityError(e,this.view.basemapTerrain.tilingScheme)}};e([s()],d.prototype,"layer",void 0),e([s()],d.prototype,"suspended",void 0),e([s()],d.prototype,"tileInfo",void 0),d=e([o("esri.views.3d.layers.WMTSLayerView3D")],d);const m=d;export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{remove as t}from"../../../../core/arrayUtils.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import{getObjectId as e}from"../../../../layers/graphics/dehydratedFeatures.js";class s{constructor(t){this._graphicsCore=t,this._idToState=new Map,this._states=new Set;const i=t.owner.layer?.objectIdField;i?(this._getGraphicId=t=>e(t,i),this._getGraphics3DGraphicById=t=>this._graphicsCore.getGraphics3DGraphicByObjectId(t)):(this._getGraphicId=t=>t.uid,this._getGraphics3DGraphicById=t=>this._graphicsCore.getGraphics3DGraphicById(t))}destroy(){this._idToState.clear(),this._states.forEach((t,i)=>this.remove(i))}add(t){const e=i(()=>this.remove(t));if(this._states.has(t))return e;const s=this._getGraphicId(t.graphic),a=this._getGraphics3DGraphicById(s);this._states.has(t)||this._states.add(t);return this._ensureStateList(s).push(t),t.displaying=null!=a&&a.isVisible(),t.isDraped=null!=a&&a.isDraped,t.tracking=!0,null!=a&&t.emit("changed"),e}remove(i){if(this._states.has(i)){if(this._idToState.size){const e=this._getGraphicId(i.graphic),s=this._idToState.get(e);s&&(t(s,i),0===s.length&&this._idToState.delete(e))}this._states.delete(i),i.tracking=!1,i.displaying=!1}}addGraphic(t){this._forEachState(t.graphic,i=>{i.displaying=t.isVisible(),i.isDraped=t.isDraped,i.emit("changed")})}removeGraphic(t){this._forEachState(t.graphic,t=>{t.displaying=!1,t.isDraped=!1})}updateGraphicGeometry(t){this._forEachState(t.graphic,t=>t.emit("changed"))}updateGraphicVisibility(t){this._forEachState(t.graphic,i=>i.displaying=t.isVisible())}updateGraphicError(t,i){this._forEachState(t,t=>t.error=i)}allGraphicsDeleted(){this._states.forEach(t=>t.displaying=!1)}_ensureStateList(t){const i=this._idToState.get(t);if(i)return i;const e=new Array;return this._idToState.set(t,e),e}_forEachState(t,i){if(0===this._states.size||0===this._idToState.size)return;const e=this._getGraphicId(t),s=this._idToState.get(e);null!=s&&s.forEach(i)}}export{s as GraphicStateTracking};
5
+ import{remove as t}from"../../../../core/arrayUtils.js";import{makeHandle as i}from"../../../../core/handleUtils.js";import{getObjectId as e}from"../../../../layers/graphics/dehydratedFeatures.js";class s{constructor(t){this._graphicsCore=t,this._idToState=new Map,this._states=new Set;const i=t.owner.layer?.objectIdField;i?(this._getGraphicId=t=>e(t,i),this._getGraphics3DGraphicById=t=>this._graphicsCore.getGraphics3DGraphicByObjectId(t)):(this._getGraphicId=t=>t.uid,this._getGraphics3DGraphicById=t=>this._graphicsCore.getGraphics3DGraphicById(t))}destroy(){this._idToState.clear(),this._states.forEach((t,i)=>this.remove(i))}add(t){const e=i(()=>this.remove(t));if(this._states.has(t))return e;const s=this._getGraphicId(t.graphic),a=this._getGraphics3DGraphicById(s);this._states.has(t)||this._states.add(t);return this._ensureStateList(s).push(t),t.displaying=a?.isVisible()??!1,t.isDraped=a?.isDraped??!1,t.tracking=!0,null!=a&&t.emit("changed"),e}remove(i){if(this._states.has(i)){if(this._idToState.size){const e=this._getGraphicId(i.graphic),s=this._idToState.get(e);s&&(t(s,i),0===s.length&&this._idToState.delete(e))}this._states.delete(i),i.tracking=!1,i.displaying=!1}}addGraphic(t){this._forEachState(t.graphic,i=>{i.displaying=t.isVisible(),i.isDraped=t.isDraped,i.emit("changed")})}removeGraphic(t){this._forEachState(t.graphic,t=>{t.displaying=!1,t.isDraped=!1})}updateGraphicGeometry(t){this._forEachState(t.graphic,t=>t.emit("changed"))}updateGraphicVisibility(t){this._forEachState(t.graphic,i=>i.displaying=t.isVisible())}updateGraphicError(t,i){this._forEachState(t,t=>t.error=i)}allGraphicsDeleted(){this._states.forEach(t=>t.displaying=!1)}_ensureStateList(t){const i=this._idToState.get(t);if(i)return i;const e=new Array;return this._idToState.set(t,e),e}_forEachState(t,i){if(0===this._states.size||0===this._idToState.size)return;const e=this._getGraphicId(t),s=this._idToState.get(e);null!=s&&s.forEach(i)}}export{s as GraphicStateTracking};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{Evented as e}from"../../../core/Evented.js";import{findInMap as t,someMap as s}from"../../../core/MapUtils.js";import{GraphicsMap as i}from"./GraphicsMap.js";class n extends e{constructor(e){super(),this._limit=e,this._all=new i,this._active=new r(this),this._pending=new Map,this._handle=this._all.on("change",e=>this._handleChanges(e))}destroy(){this._handle.remove()}get length(){return this._active.length}toArray(){return this._active.toArray()}find(e){return this._active.find(e)}some(e){return this._active.some(e)}forEach(e){this._active.forEach(e)}addMany(e){this._all.addMany(e)}removeManyByObjectId(e){this._all.removeManyByObjectId(e)}_handleChanges(e){let t=e.removed;if(this._pending.size>0){t=new Array;for(const s of e.removed)this._pending.delete(s.objectId)||t.push(s)}let s=this._limit-this._active.length+t.length;s<e.added.length&&(this._active.removeMany(t),t=[],a.reset(1-this._limit/(this._active.length+e.added.length)),this._active.forEach(e=>{a.sample()&&(t.push(e),this._pending.set(e.objectId,e))}),s=this._limit-this._active.length+t.length);let i=e.added;if(s<e.added.length){i=new Array,a.reset(s/e.added.length);for(const t of e.added)a.sample()?i.push(t):this._pending.set(t.objectId,t)}const n=s-i.length;n>0&&this._pending.size>0&&(a.reset(n/this._pending.size),this._pending.forEach(e=>{a.sample()&&(i.push(e),this._pending.delete(e.objectId))})),this._active.addAndRemove(i,t)}}class h{constructor(){this._percentage=1,this._last=-1,this._index=0}reset(e){this._percentage=e,this._last=-1}sample(){const e=Math.floor(this._index*this._percentage);return++this._index,e!==this._last&&(this._last=e,!0)}}const a=new h;class r{constructor(e){this._parent=e,this._map=new Map}get length(){return this._map.size}forEach(e){this._map.forEach(t=>e(t))}find(e){return t(this._map,e)}some(e){return s(this._map,e)}toArray(){return Array.from(this._map.values())}addAndRemove(e,t){for(const s of e)this._map.set(s.objectId,s);for(const s of t)this._map.delete(s.objectId);(e.length>0||t.length>0)&&this._parent.emit("change",{added:e,removed:t})}removeMany(e){for(const t of e)this._map.delete(t.objectId);e.length>0&&this._parent.emit("change",{added:[],removed:e})}}export{n as LimitGraphicsMap};
5
+ import{Evented as e}from"../../../core/Evented.js";import{findInMap as t,someMap as s}from"../../../core/MapUtils.js";import{GraphicsMap as i}from"./GraphicsMap.js";class n extends e{constructor(e){super(),this._limit=e,this._all=new i,this._active=new r(this),this._pending=new Map,this._handle=this._all.on("change",e=>this._handleChanges(e))}destroy(){super.destroy(),this._handle.remove()}get length(){return this._active.length}toArray(){return this._active.toArray()}find(e){return this._active.find(e)}some(e){return this._active.some(e)}forEach(e){this._active.forEach(e)}addMany(e){this._all.addMany(e)}removeManyByObjectId(e){this._all.removeManyByObjectId(e)}_handleChanges(e){let t=e.removed;if(this._pending.size>0){t=new Array;for(const s of e.removed)this._pending.delete(s.objectId)||t.push(s)}let s=this._limit-this._active.length+t.length;s<e.added.length&&(this._active.removeMany(t),t=[],a.reset(1-this._limit/(this._active.length+e.added.length)),this._active.forEach(e=>{a.sample()&&(t.push(e),this._pending.set(e.objectId,e))}),s=this._limit-this._active.length+t.length);let i=e.added;if(s<e.added.length){i=new Array,a.reset(s/e.added.length);for(const t of e.added)a.sample()?i.push(t):this._pending.set(t.objectId,t)}const n=s-i.length;n>0&&this._pending.size>0&&(a.reset(n/this._pending.size),this._pending.forEach(e=>{a.sample()&&(i.push(e),this._pending.delete(e.objectId))})),this._active.addAndRemove(i,t)}}class h{constructor(){this._percentage=1,this._last=-1,this._index=0}reset(e){this._percentage=e,this._last=-1}sample(){const e=Math.floor(this._index*this._percentage);return++this._index,e!==this._last&&(this._last=e,!0)}}const a=new h;class r{constructor(e){this._parent=e,this._map=new Map}get length(){return this._map.size}forEach(e){this._map.forEach(t=>e(t))}find(e){return t(this._map,e)}some(e){return s(this._map,e)}toArray(){return Array.from(this._map.values())}addAndRemove(e,t){for(const s of e)this._map.set(s.objectId,s);for(const s of t)this._map.delete(s.objectId);(e.length>0||t.length>0)&&this._parent.emit("change",{added:e,removed:t})}removeMany(e){for(const t of e)this._map.delete(t.objectId);e.length>0&&this._parent.emit("change",{added:[],removed:e})}}export{n as LimitGraphicsMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as h}from"../../../../chunks/sphere.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as p}from"./ChangeSet.js";import{IntersectorResult as u}from"./IntersectorResult.js";import{RendererBase as m}from"./RendererBase.js";import{noBudget as g}from"../../../support/Scheduler.js";let y=class extends m{constructor(e){super(e),this._pending=new _,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,g,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(17);return!!r&&r(8)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(3)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);s&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new p;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],R[0]=t[0]-s,R[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,R,(t,s,o)=>{f(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(h(e.boundingSphere))),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([d("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class _{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function f(e,r,t,s,i,n,o){const d=new c(n,o,r),a=r=>{r.set(3,d,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&a(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&a(i.results.max),2===i.options.store){const e=new u(i.ray);a(e),i.results.all.push(e)}}const R=a();export{y as SortedRenderGeometryRenderer};
5
+ import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as h}from"../../../../chunks/sphere.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as p}from"./ChangeSet.js";import{IntersectorResult as u}from"./IntersectorResult.js";import{RendererBase as g}from"./RendererBase.js";import{noBudget as m}from"../../../support/Scheduler.js";let y=class extends g{constructor(e){super(e),this._pending=new _,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,m,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(17);return!!r&&r(8)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(3)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);switch(s&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new p;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],G[0]=t[0]-s,G[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,G,(t,s,o)=>{f(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(h(e.boundingSphere))),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([d("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class _{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function f(e,r,t,s,i,n,o){const d=new c(n,o,r),a=r=>{r.set(3,d,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&a(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&a(i.results.max),2===i.options.store){const e=new u(i.ray);a(e),i.results.all.push(e)}}const G=a();export{y as SortedRenderGeometryRenderer};
package/views/View.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/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Map.js";import i from"../core/Accessor.js";import{createTask as r}from"../core/asyncUtils.js";import s from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{referenceSetter as o}from"../core/collectionUtils.js";import n from"../core/Error.js";import{EventedMixin as l}from"../core/Evented.js";import p from"../core/Handles.js";import{makeHandle as h}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import y from"../core/Logger.js";import{destroyMaybe as u,abortMaybe as m}from"../core/maybe.js";import{EsriPromiseMixin as c}from"../core/Promise.js";import{after as g}from"../core/promiseUtils.js";import{watch as f,sync as w,whenOnce as v,when as _,syncAndInitial as V}from"../core/reactiveUtils.js";import{property as M}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as S}from"../core/support/OwningCollection.js";import{UpdatingHandles as j}from"../core/support/UpdatingHandles.js";import T from"../geometry/Extent.js";import F from"../geometry/HeightModelInfo.js";import E from"../geometry/SpatialReference.js";import{equals as k}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as x}from"../support/AnalysesCollection.js";import{GraphicsCollection as b}from"../support/GraphicsCollection.js";import{system as O}from"../time/constants.js";import{T as C}from"../chunks/TimeExtent.js";import{isTimeZoneValid as L}from"../time/timeZoneUtils.js";import H from"./BasemapView.js";import P from"./Magnifier.js";import Z from"./SelectionManager.js";import I from"./Theme.js";import{ToolViewManager as W}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as q}from"./3d/support/DefaultHighlights.js";import D from"./input/Input.js";import{ViewEvents as U}from"./input/ViewEvents.js";import A from"./navigation/Navigation.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import G from"./support/HighlightOptions.js";import N from"./support/LayerViewManager.js";import $ from"./support/RequiredFieldsOptions.js";var B;let J=class extends(l(c(i))){static{B=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new p,this.updatingHandles=new j,this.allLayerViews=new a({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:X}),this.analyses=new x,this.basemapView=null,this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new b,this.groundView=null,this.typeSpecificPreconditionsReady=!0,this.layerViews=new s,this.magnifier=new P,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new s,this._highPriorityCursorHandles=new s,this.input=new D,this.navigation=new A,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new U(this),this.persistableViewModels=new s,this.requiredFieldsOptions=new $,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(f(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,B.views.add(this)):(this._lockedSpatialReference=null,B.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new n("view:startup-error","View._startup failed",i)})}null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},w))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,v(()=>this.ready)))),this.basemapView=new H({view:this}),this.layerViewManager=new N({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new W({view:this}),this.selectionManager=new Z({view:this}),this.addHandles([_(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{y.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),f(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},V),f(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},w),f(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},V)])}destroy(){this.destroyed||(B.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=u(this.graphics),this.analyses=u(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),u(this.analysisViewManager),this.toolViewManager=u(this.toolViewManager),this.layerViewManager=u(this.layerViewManager),this.selectionManager=u(this.selectionManager),this.basemapView=u(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=u(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return y.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get highlights(){return this._get("highlights")??q()}set highlights(e){this._set("highlights",o(e,this._get("highlights"),s.ofType(G)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||d(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(y.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,i=this.map.basemap?.loaded??!0;return e&&i&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=r(e=>g(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=m(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!k(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??O}set timeZone(e){this._userTimeZone=e,L(e)||y.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},s=h(()=>i.remove(r));return i.add(r),this.addHandles(s),s}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new I}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(e){throw new n("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&y.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(_(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new s}};e([M()],J.prototype,"_userSpatialReference",void 0),e([M()],J.prototype,"activeTool",null),e([M({readOnly:!0})],J.prototype,"allLayerViews",void 0),e([M(S(x,"analyses"))],J.prototype,"analyses",void 0),e([M()],J.prototype,"animation",null),e([M()],J.prototype,"basemapView",void 0),e([M()],J.prototype,"center",null),e([M()],J.prototype,"defaultsFromMapSettings",null),e([M()],J.prototype,"defaultsFromMap",null),e([M()],J.prototype,"displayFilterEnabled",void 0),e([M({type:T})],J.prototype,"extent",null),e([M()],J.prototype,"fatalError",void 0),e([M(S(b,"graphics"))],J.prototype,"graphics",void 0),e([M()],J.prototype,"groundView",void 0),e([M({readOnly:!0,type:F})],J.prototype,"heightModelInfo",null),e([M({type:s.ofType(G)})],J.prototype,"highlights",null),e([M({readOnly:!0})],J.prototype,"interacting",null),e([M({constructOnly:!0})],J.prototype,"layerViewFilter",void 0),e([M({readOnly:!0})],J.prototype,"navigating",null),e([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],J.prototype,"preconditionsReady",null),e([M({readOnly:!0})],J.prototype,"typeSpecificPreconditionsReady",void 0),e([M({type:s,readOnly:!0})],J.prototype,"layerViews",void 0),e([M()],J.prototype,"resolution",null),e([M({type:P})],J.prototype,"magnifier",void 0),e([M({value:null,type:t})],J.prototype,"map",null),e([M()],J.prototype,"padding",void 0),e([M({readOnly:!0})],J.prototype,"ready",void 0),e([M()],J.prototype,"_readyStateWaitingTask",void 0),e([M({readOnly:!0})],J.prototype,"readyState",null),e([M({type:E})],J.prototype,"spatialReference",null),e([M()],J.prototype,"stationary",null),e([M({readOnly:!0})],J.prototype,"supportsGround",void 0),e([M({type:C})],J.prototype,"timeExtent",null),e([M({type:String,nonNullable:!0})],J.prototype,"timeZone",null),e([M()],J.prototype,"tools",null),e([M()],J.prototype,"toolViewManager",void 0),e([M({readOnly:!0})],J.prototype,"type",void 0),e([M({type:Number})],J.prototype,"scale",void 0),e([M({readOnly:!0})],J.prototype,"updating",void 0),e([M({readOnly:!0})],J.prototype,"initialExtentRequired",void 0),e([M({readOnly:!0})],J.prototype,"initialExtent",null),e([M()],J.prototype,"cursor",null),e([M({readOnly:!0})],J.prototype,"input",void 0),e([M({type:A,nonNullable:!0})],J.prototype,"navigation",void 0),e([M()],J.prototype,"layerViewManager",void 0),e([M()],J.prototype,"analysisViewManager",void 0),e([M()],J.prototype,"selectionManager",void 0),e([M()],J.prototype,"width",void 0),e([M()],J.prototype,"height",void 0),e([M({readOnly:!0})],J.prototype,"resizing",void 0),e([M({value:null,readOnly:!0})],J.prototype,"size",null),e([M({readOnly:!0})],J.prototype,"suspended",void 0),e([M({readOnly:!0})],J.prototype,"viewEvents",void 0),e([M({readOnly:!0})],J.prototype,"persistableViewModels",void 0),e([M()],J.prototype,"_isValid",void 0),e([M()],J.prototype,"_readyCycleForced",void 0),e([M()],J.prototype,"_lockedSpatialReference",void 0),e([M()],J.prototype,"_userTimeZone",void 0),e([M()],J.prototype,"_lockedTimeZone",void 0),e([M()],J.prototype,"_userTimeExtent",void 0),e([M()],J.prototype,"_lockedTimeExtent",void 0),e([M({type:I})],J.prototype,"theme",void 0),e([M({readOnly:!0,type:I})],J.prototype,"effectiveTheme",null),J=B=e([R("esri.views.View")],J);const K=globalThis.$arcgis;K&&!K.views&&Object.defineProperty(K,"views",{configurable:!1,enumerable:!0,writable:!1,value:J.views});const Q=J;function X(e){return e.layerViews}export{Q as default};
5
+ import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import{referenceSetter as a}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as h}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as M}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as R}from"../core/support/OwningCollection.js";import{UpdatingHandles as S}from"../core/support/UpdatingHandles.js";import T from"../geometry/Extent.js";import j from"../geometry/HeightModelInfo.js";import F from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as k}from"../support/AnalysesCollection.js";import{GraphicsCollection as x}from"../support/GraphicsCollection.js";import{system as b}from"../time/constants.js";import{T as O}from"../chunks/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import L from"./BasemapView.js";import H from"./Magnifier.js";import P from"./SelectionManager.js";import Z from"./Theme.js";import{ToolViewManager as I}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import q from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import U from"./navigation/Navigation.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import A from"./support/HighlightOptions.js";import G from"./support/LayerViewManager.js";import N from"./support/RequiredFieldsOptions.js";var $;let B=class extends(n(m)){static{$=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new S,this.allLayerViews=new s({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:Q}),this.analyses=new k,this.basemapView=null,this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new x,this.groundView=null,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new q,this.navigation=new U,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new N,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,$.views.add(this)):(this._lockedSpatialReference=null,$.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),null!=this.analysisViewManager&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}null!=this.analysisViewManager&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new L({view:this}),this.layerViewManager=new G({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new I({view:this}),this.selectionManager=new P({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}destroy(){this.destroyed||($.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",a(e,this._get("highlights"),r.ofType(A)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||h(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get readyState(){if(this.destroyed)return this._get("readyState");if(!this.map)return"missing-map";if("container"in this&&!this.container)return"missing-container";if(this.fatalError)return"rendering-error";if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){const e=!("loaded"in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?"empty-map":(this._readyStateWaitingTask||(this._readyStateWaitingTask=i(e=>c(has("view-readyState-waiting-delay"),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,"ready-state-task")),this._readyStateWaitingTask?.finished?"map-content-error":"loading")}return this._readyStateWaitingTask=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!E(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??b}set timeZone(e){this._userTimeZone=e,C(e)||d.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??"default"}acquireCursor(e,t="low"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},s=p(()=>i.remove(r));return i.add(r),this.addHandles(s),s}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Z}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||!1===this.preconditionsReady,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}};e([V()],B.prototype,"_userSpatialReference",void 0),e([V()],B.prototype,"activeTool",null),e([V({readOnly:!0})],B.prototype,"allLayerViews",void 0),e([V(R(k,"analyses"))],B.prototype,"analyses",void 0),e([V()],B.prototype,"animation",null),e([V()],B.prototype,"basemapView",void 0),e([V()],B.prototype,"center",null),e([V()],B.prototype,"defaultsFromMapSettings",null),e([V()],B.prototype,"defaultsFromMap",null),e([V()],B.prototype,"displayFilterEnabled",void 0),e([V({type:T})],B.prototype,"extent",null),e([V()],B.prototype,"fatalError",void 0),e([V(R(x,"graphics"))],B.prototype,"graphics",void 0),e([V()],B.prototype,"groundView",void 0),e([V({readOnly:!0,type:j})],B.prototype,"heightModelInfo",null),e([V({type:r.ofType(A)})],B.prototype,"highlights",null),e([V({readOnly:!0})],B.prototype,"interacting",null),e([V({constructOnly:!0})],B.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],B.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],B.prototype,"preconditionsReady",null),e([V({readOnly:!0})],B.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],B.prototype,"layerViews",void 0),e([V()],B.prototype,"resolution",null),e([V({type:H})],B.prototype,"magnifier",void 0),e([V({value:null,type:t})],B.prototype,"map",null),e([V()],B.prototype,"padding",void 0),e([V({readOnly:!0})],B.prototype,"ready",void 0),e([V()],B.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],B.prototype,"readyState",null),e([V({type:F})],B.prototype,"spatialReference",null),e([V()],B.prototype,"stationary",null),e([V({readOnly:!0})],B.prototype,"supportsGround",void 0),e([V({type:O})],B.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],B.prototype,"timeZone",null),e([V()],B.prototype,"tools",null),e([V()],B.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],B.prototype,"type",void 0),e([V({type:Number})],B.prototype,"scale",void 0),e([V({readOnly:!0})],B.prototype,"updating",void 0),e([V({readOnly:!0})],B.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],B.prototype,"initialExtent",null),e([V()],B.prototype,"cursor",null),e([V({readOnly:!0})],B.prototype,"input",void 0),e([V({type:U,nonNullable:!0})],B.prototype,"navigation",void 0),e([V()],B.prototype,"layerViewManager",void 0),e([V()],B.prototype,"analysisViewManager",void 0),e([V()],B.prototype,"selectionManager",void 0),e([V()],B.prototype,"width",void 0),e([V()],B.prototype,"height",void 0),e([V({readOnly:!0})],B.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],B.prototype,"size",null),e([V({readOnly:!0})],B.prototype,"suspended",void 0),e([V({readOnly:!0})],B.prototype,"viewEvents",void 0),e([V({readOnly:!0})],B.prototype,"persistableViewModels",void 0),e([V()],B.prototype,"_isValid",void 0),e([V()],B.prototype,"_readyCycleForced",void 0),e([V()],B.prototype,"_lockedSpatialReference",void 0),e([V()],B.prototype,"_userTimeZone",void 0),e([V()],B.prototype,"_lockedTimeZone",void 0),e([V()],B.prototype,"_userTimeExtent",void 0),e([V()],B.prototype,"_lockedTimeExtent",void 0),e([V({type:Z})],B.prototype,"theme",void 0),e([V({readOnly:!0,type:Z})],B.prototype,"effectiveTheme",null),B=$=e([M("esri.views.View")],B);const J=globalThis.$arcgis;J&&!J.views&&Object.defineProperty(J,"views",{configurable:!1,enumerable:!0,writable:!1,value:B.views});const K=B;function Q(e){return e.layerViews}export{K as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{Evented as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{clone as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasCompatibleTopology as s}from"../../../geometry/support/coordsUtils.js";import{isMeshEditGeometry as i,EditGeometry as o}from"./EditGeometry.js";import{AppendVertex as a}from"./operations/AppendVertex.js";import{UpdateVertices as n}from"./operations/UpdateVertices.js";import{RemoveVertices as p}from"./operations/RemoveVertices.js";import{SplitEdge as d}from"./operations/SplitEdge.js";import{SetVertexPosition as c}from"./operations/SetVertexPosition.js";import{CloseComponent as h}from"./operations/CloseComponent.js";import{MoveMesh as u}from"./operations/MoveMesh.js";import{MoveVertex as l}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as m}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as V}from"./operations/RotateVertex.js";import{ScaleVertex as f}from"./operations/ScaleVertex.js";import{SetAllVertexPositions as y}from"./operations/SetAllVertexPositions.js";import{UndoGroup as _}from"./operations/UndoGroup.js";class v extends e{constructor(e,t){super(),this.data=e,this.viewingMode=t,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",e=>{e.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:e.updatedVertices,operation:e.operation})})}destroy(){this._listener.remove()}splitEdge(e,t){return this._apply(new d(this.data,e,t))}updateVertices(e,t,r=1){return this._apply(new n(this.data,e,t),r)}move(e,t,r,s=1){return i(this.data)?this._apply(new u(this.data,e,t,r),s):this.moveVertices(this.data.allVerticesUnordered,e,t,r,s)}moveVertices(e,t,r,s,o=1){return i(this.data)?this._apply(new u(this.data,t,r,s),o):this.updateVertices(e,new l(this.data.coordinateHelper,t,r,s),o)}scale(e,t,r,s,i=1,o=0){return this.scaleVertices(this.data.allVerticesUnordered,e,t,r,s,i,o)}scaleVertices(e,t,r,s,i,o=1,a=0){return this.updateVertices(e,new f(t,r,s,i,a),o)}rotate(e,t,r=1,s=0){return this.rotateVertices(this.data.allVerticesUnordered,e,t,r,s)}rotateVertices(e,t,r,s=1,i=0){return this.updateVertices(e,new V(t,r,i),s)}removeVertices(e){return this._apply(new p(this.data,e,this._minNumVerticesPerType))}appendVertex(e){return 0===this.data.components.length?null:this._apply(new a(this.data,this.data.components[0],e))}setVertexPosition(e,t){return this._apply(new c(this.data,e,t))}offsetEdge(e,t,r,s=1){return this.updateVertices([t.leftVertex,t.rightVertex],new m(this.data.coordinateHelper,e,t,r),s)}trySetGeometry(e,t=1){const{data:r}=this,{coordinateHelper:a}=r;if(r.type!==e.type||!r.spatialReference.equals(e.spatialReference)||a.hasZ()!==e.hasZ||a.hasM()!==e.hasM||!s(r.geometry,e)||i(r))return;const n=Array.from(o.fromGeometry(e,this.viewingMode).iterateVerticesUnordered(),e=>e.pos);return this.setVertexPositions(n,t)}setVertexPositions(e,t=1){return this._apply(new y(this.data,e),t)}createResetState(){if(i(this.data))return this._createResetStateMesh();const e=this.data.geometry.clone();return t(()=>this.trySetGeometry(e))}closeComponent(e){return this.data.components.includes(e)?this._apply(new h(this.data,e)):null}canRemoveVertex(e){return e.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new _;return this._apply(e),t(()=>e.close())}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=1){return 0!==t&&null!=this.lastOperation&&this.lastOperation.accumulate(e)||(e.apply(),this._undoStack.push(e),this._redoStack=[]),e}_createResetStateMesh(){if(!i(this.data))return t();const e=this.data.geometry,{vertexSpace:s}=e;if(s.origin){const i=r(s.origin);return t(()=>{e.vertexSpace.origin=i})}const o=e.vertexAttributes.clonePositional();return t(()=>{e.vertexAttributes=o,e.vertexAttributesChanged()})}static fromGeometry(e,t){return new v(o.fromGeometry(e,t),t)}}export{v as EditGeometryOperations};
5
+ import{Evented as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{clone as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasCompatibleTopology as s}from"../../../geometry/support/coordsUtils.js";import{isMeshEditGeometry as o,EditGeometry as i}from"./EditGeometry.js";import{AppendVertex as a}from"./operations/AppendVertex.js";import{UpdateVertices as n}from"./operations/UpdateVertices.js";import{RemoveVertices as p}from"./operations/RemoveVertices.js";import{SplitEdge as d}from"./operations/SplitEdge.js";import{SetVertexPosition as c}from"./operations/SetVertexPosition.js";import{CloseComponent as h}from"./operations/CloseComponent.js";import{MoveMesh as u}from"./operations/MoveMesh.js";import{MoveVertex as l}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as m}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as V}from"./operations/RotateVertex.js";import{ScaleVertex as y}from"./operations/ScaleVertex.js";import{SetAllVertexPositions as f}from"./operations/SetAllVertexPositions.js";import{UndoGroup as _}from"./operations/UndoGroup.js";class v extends e{constructor(e,t){super(),this.data=e,this.viewingMode=t,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",e=>{e.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:e.updatedVertices,operation:e.operation})})}destroy(){super.destroy(),this._listener.remove()}splitEdge(e,t){return this._apply(new d(this.data,e,t))}updateVertices(e,t,r=1){return this._apply(new n(this.data,e,t),r)}move(e,t,r,s=1){return o(this.data)?this._apply(new u(this.data,e,t,r),s):this.moveVertices(this.data.allVerticesUnordered,e,t,r,s)}moveVertices(e,t,r,s,i=1){return o(this.data)?this._apply(new u(this.data,t,r,s),i):this.updateVertices(e,new l(this.data.coordinateHelper,t,r,s),i)}scale(e,t,r,s,o=1,i=0){return this.scaleVertices(this.data.allVerticesUnordered,e,t,r,s,o,i)}scaleVertices(e,t,r,s,o,i=1,a=0){return this.updateVertices(e,new y(t,r,s,o,a),i)}rotate(e,t,r=1,s=0){return this.rotateVertices(this.data.allVerticesUnordered,e,t,r,s)}rotateVertices(e,t,r,s=1,o=0){return this.updateVertices(e,new V(t,r,o),s)}removeVertices(e){return this._apply(new p(this.data,e,this._minNumVerticesPerType))}appendVertex(e){return 0===this.data.components.length?null:this._apply(new a(this.data,this.data.components[0],e))}setVertexPosition(e,t){return this._apply(new c(this.data,e,t))}offsetEdge(e,t,r,s=1){return this.updateVertices([t.leftVertex,t.rightVertex],new m(this.data.coordinateHelper,e,t,r),s)}trySetGeometry(e,t=1){const{data:r}=this,{coordinateHelper:a}=r;if(r.type!==e.type||!r.spatialReference.equals(e.spatialReference)||a.hasZ()!==e.hasZ||a.hasM()!==e.hasM||!s(r.geometry,e)||o(r))return;const n=Array.from(i.fromGeometry(e,this.viewingMode).iterateVerticesUnordered(),e=>e.pos);return this.setVertexPositions(n,t)}setVertexPositions(e,t=1){return this._apply(new f(this.data,e),t)}createResetState(){if(o(this.data))return this._createResetStateMesh();const e=this.data.geometry.clone();return t(()=>this.trySetGeometry(e))}closeComponent(e){return this.data.components.includes(e)?this._apply(new h(this.data,e)):null}canRemoveVertex(e){return e.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new _;return this._apply(e),t(()=>e.close())}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=1){return 0!==t&&null!=this.lastOperation&&this.lastOperation.accumulate(e)||(e.apply(),this._undoStack.push(e),this._redoStack=[]),e}_createResetStateMesh(){if(!o(this.data))return t();const e=this.data.geometry,{vertexSpace:s}=e;if(s.origin){const o=r(s.origin);return t(()=>{e.vertexSpace.origin=o})}const i=e.vertexAttributes.clonePositional();return t(()=>{e.vertexAttributes=i,e.vertexAttributesChanged()})}static fromGeometry(e,t){return new v(i.fromGeometry(e,t),t)}}export{v as EditGeometryOperations};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
3
  import CatalogDynamicGroupLayerView = __esri.CatalogDynamicGroupLayerView;
4
- export default CatalogDynamicGroupLayerView;
4
+ export { CatalogDynamicGroupLayerView };
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import 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}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";const l=Symbol(),y=y=>{const u=y;let c=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(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 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(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,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}`),c=y?.find(e=>e.field&&!e.valueExpression),m=e.createQuery();if(m.returnGeometry=!1,m.num=t,m.outFields=[l,a,o],m.where=n(m.where,u),null!=this.unsupportedItemTypes){const e=`${s} NOT IN (${this.unsupportedItemTypes.map(e=>`'${e}'`)})`;m.where=n(m.where,e)}return c?.field&&(m.orderByFields=[`${c.field} ${"descending"===c.order?"DESC":"ASC"}`],m.outFields.push(c.field)),m}};return e([d({readOnly:!0})],c.prototype,"creatingLayerViews",null),e([d()],c.prototype,"layer",void 0),e([d()],c.prototype,"layerViews",void 0),e([d({readOnly:!0})],c.prototype,"unsupportedItemTypes",void 0),e([d()],c.prototype,"parent",void 0),e([d({readOnly:!0})],c.prototype,"isUpdating",null),c=e([p("esri.views.layers.CatalogDynamicGroupLayerView")],c),c};export{y as default};
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}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";const l=Symbol(),y=y=>{const u=y;let c=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(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 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(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,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}`),c=y?.find(e=>e.field&&!e.valueExpression),m=e.createQuery();if(m.returnGeometry=!1,m.num=t,m.outFields=[l,a,o],m.where=n(m.where,u),null!=this.unsupportedItemTypes){const e=`${s} NOT IN (${this.unsupportedItemTypes.map(e=>`'${e}'`)})`;m.where=n(m.where,e)}return c?.field&&(m.orderByFields=[`${c.field} ${"descending"===c.order?"DESC":"ASC"}`],m.outFields.push(c.field)),m}};return e([d({readOnly:!0})],c.prototype,"creatingLayerViews",null),e([d()],c.prototype,"layer",void 0),e([d()],c.prototype,"layerViews",void 0),e([d({readOnly:!0})],c.prototype,"unsupportedItemTypes",void 0),e([d()],c.prototype,"parent",void 0),e([d({readOnly:!0})],c.prototype,"isUpdating",null),c=e([p("esri.views.layers.CatalogDynamicGroupLayerView")],c),c};export{y as CatalogDynamicGroupLayerView};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
3
  import CatalogFootprintLayerView = __esri.CatalogFootprintLayerView;
4
- export default CatalogFootprintLayerView;
4
+ export { CatalogFootprintLayerView };
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{const s=t;let p=class extends s{constructor(...r){super(...r)}get updateSuspended(){const r=this.parent?.dynamicGroupLayerView;return this.suspended&&(!r||!0===r.suspended)}queryAggregates(){throw new Error("Not implemented")}};return r([e()],p.prototype,"layer",void 0),r([e()],p.prototype,"parent",void 0),r([e()],p.prototype,"highlightOptions",void 0),r([e()],p.prototype,"updateSuspended",null),p=r([o("esri.views.layers.CatalogFootprintLayerView")],p),p};export{t as default};
5
+ import{__decorate as r}from"tslib";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{const s=t;let p=class extends s{constructor(...r){super(...r)}get updateSuspended(){const r=this.parent?.dynamicGroupLayerView;return this.suspended&&(!r||!0===r.suspended)}queryAggregates(){throw new Error("Not implemented")}};return r([e()],p.prototype,"layer",void 0),r([e()],p.prototype,"parent",void 0),r([e()],p.prototype,"highlightOptions",void 0),r([e()],p.prototype,"updateSuspended",null),p=r([o("esri.views.layers.CatalogFootprintLayerView")],p),p};export{t as CatalogFootprintLayerView};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
3
  import CatalogLayerView = __esri.CatalogLayerView;
4
- export default CatalogLayerView;
4
+ export { CatalogLayerView };
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import e from"../../core/Collection.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";const i=i=>{const a=i;let s=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([o()],s.prototype,"layer",void 0),r([o()],s.prototype,"layerViews",void 0),r([o({readOnly:!0})],s.prototype,"dynamicGroupLayerView",null),r([o({readOnly:!0})],s.prototype,"footprintLayerView",null),s=r([t("esri.views.layers.CatalogLayerView")],s),s};export{i as default};
5
+ import{__decorate as r}from"tslib";import e from"../../core/Collection.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";const i=i=>{const a=i;let s=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([o()],s.prototype,"layer",void 0),r([o()],s.prototype,"layerViews",void 0),r([o({readOnly:!0})],s.prototype,"dynamicGroupLayerView",null),r([o({readOnly:!0})],s.prototype,"footprintLayerView",null),s=r([t("esri.views.layers.CatalogLayerView")],s),s};export{i as CatalogLayerView};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
3
  import FeatureLayerView = __esri.FeatureLayerView;
4
- export default FeatureLayerView;
4
+ export { FeatureLayerView };
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as n,sqlAnd as a}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getGraphicOriginLayer as p}from"../../graphic/graphicOriginUtils.js";import{getFeatureIdInfoFieldNames as f}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as b,unpackFieldNames as w,collectLabelingFields as v,collectElevationFields as E,collectFilterFields as x,collectFeatureReductionFields as q,collectOrderByInfos as R,collectFields as j,collectTrackInfoFields as C,collectDisplayFilterFields as _,collectField as O,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as U}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as P}from"../../networks/support/networkFieldUtils.js";import T from"../../rest/support/Query.js";import{createFeatureIdInfo as L}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getRequiredFields as S,getFetchPopupTemplate as D}from"./support/popupUtils.js";import{WhereClauseVisitor as N}from"./support/WhereClauseVisitor.js";const Q=Q=>{const G=Q;let A=class extends G{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&P(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?b(t,[...w(t,e.outFields),...i]):b(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,n(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new T(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,U(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new T(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const i=await this._createPopupQuery(e.map(e=>p(e.origin)??e.layer),t);return await g(this.layer,e,i,{getPopupTemplate:e=>D(e,{...t,checkPopupEnabled:!0}),hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new N(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,l="renderer"in i&&i.renderer,s="orderBy"in i&&i.orderBy,o="featureReduction"in i?i.featureReduction:null,n=new Set,a=[l?l.collectRequiredFields(n,r):null,v(n,i),e&&"elevationInfo"in i?E(n,i):null,null!=this.filter?x(n,i,this.filter):null,e||null==this.featureEffect?null:x(n,i,this.featureEffect.filter),!e&&o?q(n,i,o):null,!e&&s?R(n,i,s):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&j(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;j(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||j(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&j(n,i.fieldsIndex,[i.timeInfo.endField]),await C(n,i)}if("floorInfo"in i&&i.floorInfo&&j(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&j(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(n,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(_(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){O(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),v(n,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;j(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&O(n,r,y),"parquet"===i.type&&a.push(S(i,i.popupTemplate).then(e=>{for(const t of e)n.add(t)}));const u=await Promise.allSettled(a);if(e)O(n,r,i.objectIdField);else for(const t of f(L(i)))O(n,r,t);e&&"displayField"in i&&i.displayField&&O(n,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(n).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,t){return k(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),l=new Set;let s=!1;const o=e??[this.layer];for(const n of o){const e=D(n,t);if(null==e)continue;const r=await I(e);i(t);const o=r&&r.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!o);const a=await S(this.layer,e);i(t);for(const t of a)l.add(t)}return r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,U(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([u()],A.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],A.prototype,"availableFields",null),e([u({readOnly:!0})],A.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],A.prototype,"featureEffect",null),e([u({type:c})],A.prototype,"filter",void 0),e([u()],A.prototype,"layer",void 0),e([u({type:Number})],A.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],A.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],A.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],A.prototype,"requiredFields",void 0),e([u({readOnly:!0})],A.prototype,"signedInUser",null),e([u()],A.prototype,"suspended",void 0),e([u()],A.prototype,"view",void 0),A=e([d("esri.views.layers.FeatureLayerView")],A),A};export{Q as default};
5
+ import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as n,sqlAnd as a}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{getGraphicOriginLayer as p}from"../../graphic/graphicOriginUtils.js";import{getFeatureIdInfoFieldNames as f}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as b,unpackFieldNames as w,collectLabelingFields as v,collectElevationFields as E,collectFilterFields as x,collectFeatureReductionFields as q,collectOrderByInfos as R,collectFields as j,collectTrackInfoFields as C,collectDisplayFilterFields as _,collectField as O,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as U}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as P}from"../../networks/support/networkFieldUtils.js";import T from"../../rest/support/Query.js";import{createFeatureIdInfo as L}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getRequiredFields as S,getFetchPopupTemplate as D}from"./support/popupUtils.js";import{WhereClauseVisitor as N}from"./support/WhereClauseVisitor.js";const Q=Q=>{const G=Q;let A=class extends G{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&P(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?b(t,[...w(t,e.outFields),...i]):b(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,n(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new T(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,U(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new T(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const i=await this._createPopupQuery(e.map(e=>p(e.origin)??e.layer),t);return await g(this.layer,e,i,{getPopupTemplate:e=>D(e,{...t,checkPopupEnabled:!0}),hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new N(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,l="renderer"in i&&i.renderer,s="orderBy"in i&&i.orderBy,o="featureReduction"in i?i.featureReduction:null,n=new Set,a=[l?l.collectRequiredFields(n,r):null,v(n,i),e&&"elevationInfo"in i?E(n,i):null,null!=this.filter?x(n,i,this.filter):null,e||null==this.featureEffect?null:x(n,i,this.featureEffect.filter),!e&&o?q(n,i,o):null,!e&&s?R(n,i,s):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&j(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;j(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||j(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&j(n,i.fieldsIndex,[i.timeInfo.endField]),await C(n,i)}if("floorInfo"in i&&i.floorInfo&&j(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&j(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(n,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(_(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){O(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),v(n,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;j(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&O(n,r,y),"parquet"===i.type&&a.push(S(i,i.popupTemplate).then(e=>{for(const t of e)n.add(t)}));const u=await Promise.allSettled(a);if(e)O(n,r,i.objectIdField);else for(const t of f(L(i)))O(n,r,t);e&&"displayField"in i&&i.displayField&&O(n,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(n).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,t){return k(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),l=new Set;let s=!1;const o=e??[this.layer];for(const n of o){const e=D(n,t);if(null==e)continue;const r=await I(e);i(t);const o=r&&r.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!o);const a=await S(this.layer,e);i(t);for(const t of a)l.add(t)}return r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,U(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([u()],A.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],A.prototype,"availableFields",null),e([u({readOnly:!0})],A.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],A.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],A.prototype,"featureEffect",null),e([u({type:c})],A.prototype,"filter",void 0),e([u()],A.prototype,"layer",void 0),e([u({type:Number})],A.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],A.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],A.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],A.prototype,"requiredFields",void 0),e([u({readOnly:!0})],A.prototype,"signedInUser",null),e([u()],A.prototype,"suspended",void 0),e([u()],A.prototype,"view",void 0),A=e([d("esri.views.layers.FeatureLayerView")],A),A};export{Q as FeatureLayerView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{EventedMixin as r}from"../../core/Evented.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import s from"../../core/Logger.js";import{destroyMaybe as n}from"../../core/maybe.js";import{EsriPromiseMixin as l}from"../../core/Promise.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../core/support/UpdatingHandles.js";import{validateScaleRange as d}from"../support/layerViewUtils.js";let u=class extends(i(l(r(t)))){get spatialReferenceSupported(){return!0}constructor(e){super(e),this._updatingHandles=new p,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if("layerview:create-error"!==e.name){const t=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";s.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=n(this._updatingHandles),this._set("parent",null)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&!0===this.layer?.legendEnabled}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return!0===this.layer?.visible}set visible(e){this._overrideIfSome("visible",e)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const e=this.view.timeExtent,t=this.layer?.visibilityTimeExtent;return!e||!t||!e.intersection(t).isEmpty}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&d(e)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const e=this.parent?.suspended?this.parent.suspendInfo:{},t=this;t.view?.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0);const r=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return d(r)&&this.visibleAtCurrentScale||(e.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(e.outsideVisibilityTimeExtent=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};e([o({readOnly:!0})],u.prototype,"spatialReferenceSupported",null),e([o()],u.prototype,"view",void 0),e([o()],u.prototype,"fullOpacity",null),e([o()],u.prototype,"layer",void 0),e([o()],u.prototype,"parent",void 0),e([o({readOnly:!0})],u.prototype,"suspended",null),e([o({readOnly:!0})],u.prototype,"suspendInfo",null),e([o({readOnly:!0})],u.prototype,"legendEnabled",null),e([o({type:Boolean,readOnly:!0})],u.prototype,"updating",null),e([o({readOnly:!0})],u.prototype,"updatingProgress",null),e([o()],u.prototype,"updateSuspended",null),e([o()],u.prototype,"visible",null),e([o({readOnly:!0})],u.prototype,"visibleAtCurrentScale",null),e([o({readOnly:!0})],u.prototype,"visibleAtCurrentTimeExtent",null),u=e([a("esri.views.layers.LayerView")],u);export{u as default};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../core/Evented.js";import{IdentifiableMixin as r}from"../../core/Identifiable.js";import i from"../../core/Logger.js";import{destroyMaybe as s}from"../../core/maybe.js";import{EsriPromiseMixin as n}from"../../core/Promise.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as a}from"../../core/support/UpdatingHandles.js";import{validateScaleRange as p}from"../support/layerViewUtils.js";let d=class extends(r(n(t))){get spatialReferenceSupported(){return!0}constructor(e){super(e),this._updatingHandles=new a,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if("layerview:create-error"!==e.name){const t=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";i.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=s(this._updatingHandles),this._set("parent",null)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&!0===this.layer?.legendEnabled}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return!0===this.layer?.visible}set visible(e){this._overrideIfSome("visible",e)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const e=this.view.timeExtent,t=this.layer?.visibilityTimeExtent;return!e||!t||!e.intersection(t).isEmpty}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&p(e)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const e=this.parent?.suspended?this.parent.suspendInfo:{},t=this;t.view?.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0);const r=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return p(r)&&this.visibleAtCurrentScale||(e.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(e.outsideVisibilityTimeExtent=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};e([l({readOnly:!0})],d.prototype,"spatialReferenceSupported",null),e([l()],d.prototype,"view",void 0),e([l()],d.prototype,"fullOpacity",null),e([l()],d.prototype,"layer",void 0),e([l()],d.prototype,"parent",void 0),e([l({readOnly:!0})],d.prototype,"suspended",null),e([l({readOnly:!0})],d.prototype,"suspendInfo",null),e([l({readOnly:!0})],d.prototype,"legendEnabled",null),e([l({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([l({readOnly:!0})],d.prototype,"updatingProgress",null),e([l()],d.prototype,"updateSuspended",null),e([l()],d.prototype,"visible",null),e([l({readOnly:!0})],d.prototype,"visibleAtCurrentScale",null),e([l({readOnly:!0})],d.prototype,"visibleAtCurrentTimeExtent",null),d=e([o("esri.views.layers.LayerView")],d);export{d as default};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
3
  import OGCFeatureLayerView = __esri.OGCFeatureLayerView;
4
- export default OGCFeatureLayerView;
4
+ export { OGCFeatureLayerView };