@arcgis/core 4.34.0-next.86 → 4.34.0-next.87

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 (170) hide show
  1. package/Basemap.js +1 -1
  2. package/Ground.js +1 -1
  3. package/Map.js +1 -1
  4. package/analysis/ElevationProfile/ElevationProfileLineGround.d.ts +4 -0
  5. package/analysis/ElevationProfile/{ElevationProfileGroundLine.js → ElevationProfileLineGround.js} +1 -1
  6. package/analysis/ElevationProfile/ElevationProfileLineInput.d.ts +4 -0
  7. package/analysis/ElevationProfile/{ElevationProfileInputLine.js → ElevationProfileLineInput.js} +1 -1
  8. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +4 -0
  9. package/analysis/ElevationProfile/{ElevationProfileQueryLine.js → ElevationProfileLineQuery.js} +1 -1
  10. package/analysis/ElevationProfile/ElevationProfileLineScene.d.ts +4 -0
  11. package/analysis/ElevationProfile/{ElevationProfileSceneLine.js → ElevationProfileLineScene.js} +1 -1
  12. package/analysis/ElevationProfile/elevationProfileLineTypes.js +1 -1
  13. package/analysis/ElevationProfileAnalysis.js +1 -1
  14. package/assets/esri/core/workers/RemoteClient.js +1 -1
  15. package/assets/esri/core/workers/chunks/0074f1836d7ff69ff6ec.js +1 -0
  16. package/assets/esri/core/workers/chunks/03ef19f0753d68770444.js +1 -0
  17. package/assets/esri/core/workers/chunks/{4a06ab00d095f63598b5.js → 09c2004126f4a5242b85.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0f05425954578ac796ec.js +1 -0
  19. package/assets/esri/core/workers/chunks/109149c378aa4c5f8526.js +1 -0
  20. package/assets/esri/core/workers/chunks/{8307f635a5c0c4a95825.js → 143503f6eb270c4683f8.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{6c36cef0b58b87a1f17f.js → 177840d5f0076c0de46b.js} +4 -4
  22. package/assets/esri/core/workers/chunks/1c1b0cc91fe9cb3fec61.js +1 -0
  23. package/assets/esri/core/workers/chunks/1fc6311d4f0d27e88737.js +1 -0
  24. package/assets/esri/core/workers/chunks/257fd65786feb5951b90.js +1 -0
  25. package/assets/esri/core/workers/chunks/2dc88379ee94fabdaf52.js +1 -0
  26. package/assets/esri/core/workers/chunks/366db86914a63e6d0c68.js +1 -0
  27. package/assets/esri/core/workers/chunks/481c2b01e2fe92249698.js +1 -0
  28. package/assets/esri/core/workers/chunks/639d856cd217914dfe1f.js +1 -0
  29. package/assets/esri/core/workers/chunks/7540b34e743a23e67729.js +1 -0
  30. package/assets/esri/core/workers/chunks/7be11a3ef1f49245089f.js +1 -0
  31. package/assets/esri/core/workers/chunks/819a8bc1f0a694017ee6.js +1 -0
  32. package/assets/esri/core/workers/chunks/{1537b02e674f8ef77f4a.js → 8d63b42aea32ce2e5d09.js} +1 -1
  33. package/assets/esri/core/workers/chunks/8de11aab65d91e7f1a4d.js +1 -0
  34. package/assets/esri/core/workers/chunks/9386a0ebff78b6303ed2.js +1 -0
  35. package/assets/esri/core/workers/chunks/{4d47187bc0821413492d.js → 95bae3c275f1483eb7ed.js} +1 -1
  36. package/assets/esri/core/workers/chunks/b09b34f64a6bc2b49e0a.js +1 -0
  37. package/assets/esri/core/workers/chunks/b0a03b6edbcf6e933431.js +1 -0
  38. package/assets/esri/core/workers/chunks/b8997ae5893afa0298d1.js +1 -0
  39. package/assets/esri/core/workers/chunks/c0ae186620b68d43b338.js +1 -0
  40. package/assets/esri/core/workers/chunks/{9d7a22746dae1451deaf.js → c6cae8471c5d4ae40c65.js} +1 -1
  41. package/assets/esri/core/workers/chunks/db5a985ccc6b7d0ad855.js +1 -0
  42. package/assets/esri/core/workers/chunks/f3ee035fa7bf638c8e60.js +1 -0
  43. package/assets/esri/core/workers/chunks/fc5ac54aab66562c8463.js +1 -0
  44. package/assets/esri/themes/dark/main.css +1 -1
  45. package/assets/esri/themes/light/main.css +1 -1
  46. package/assets/esri/themes/light/view.css +1 -1
  47. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis.json +1 -0
  48. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  49. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  50. package/config.js +1 -1
  51. package/identity/IdentityManagerBase.js +1 -1
  52. package/interfaces.d.ts +133 -127
  53. package/kernel.js +1 -1
  54. package/layers/GaussianSplatLayer.js +1 -1
  55. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  56. package/layers/IntegratedMeshLayer.js +1 -1
  57. package/layers/ParquetLayer.js +1 -1
  58. package/layers/VectorTileLayer.js +1 -1
  59. package/layers/graphics/sources/ParquetSource.js +1 -1
  60. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  61. package/layers/support/FieldConfiguration.js +1 -1
  62. package/layers/support/fieldConfigUtils.js +1 -1
  63. package/layers/support/vectorTileLayerLoader.js +1 -1
  64. package/package.json +2 -2
  65. package/portal/schemas/definitions.js +1 -1
  66. package/support/basemapEnsureType.js +1 -1
  67. package/support/revision.js +1 -1
  68. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  69. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  70. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  71. package/views/2d/layers/features/Processor.js +1 -1
  72. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  73. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  74. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  75. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  76. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  77. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  78. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  79. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  80. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  81. package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
  82. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  83. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  84. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  85. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +5 -0
  86. package/views/2d/layers/features/sources/strategies/AFeatureTileLoadStrategy.js +5 -0
  87. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  88. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +5 -0
  89. package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +5 -0
  90. package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +5 -0
  91. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  92. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  93. package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
  94. package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
  95. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  96. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  97. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  98. package/views/3d/GroundView3D.js +5 -0
  99. package/views/3d/analysis/ElevationProfile/{ElevationProfileSceneLineComputation.js → ElevationProfileLineSceneComputation.js} +1 -1
  100. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  101. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +1 -1
  102. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  103. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  104. package/views/3d/glTF/internal/Resource.js +1 -1
  105. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  106. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  107. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  108. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  109. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  110. package/views/3d/layers/DrapedSubView3D.js +1 -1
  111. package/views/3d/layers/FlowSubView3D.js +1 -1
  112. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  113. package/views/3d/layers/I3SMeshView3D.js +1 -1
  114. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  115. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  116. package/views/3d/layers/MediaLayerView3D.js +1 -1
  117. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  118. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  119. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  120. package/views/3d/support/MemoryController.js +1 -1
  121. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  122. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  123. package/views/3d/support/popupHitTest.js +1 -1
  124. package/views/3d/terrain/OverlayManager.js +1 -1
  125. package/views/3d/terrain/OverlayRenderer.js +1 -1
  126. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  127. package/views/SceneView.js +1 -1
  128. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  129. package/views/analysis/ElevationProfile/{ElevationProfileGroundLineComputation.js → ElevationProfileLineGroundComputation.js} +1 -1
  130. package/views/analysis/ElevationProfile/{ElevationProfileInputLineComputation.js → ElevationProfileLineInputComputation.js} +1 -1
  131. package/views/analysis/ElevationProfile/{ElevationProfileQueryLineComputation.js → ElevationProfileLineQueryComputation.js} +1 -1
  132. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  133. package/widgets/Editor/Upload.js +1 -1
  134. package/widgets/Editor/components/Notices.js +1 -1
  135. package/widgets/Editor/modelUploadUtils.js +1 -1
  136. package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +2 -2
  137. package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +2 -2
  138. package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +2 -2
  139. package/analysis/ElevationProfile/ElevationProfileGroundLine.d.ts +0 -4
  140. package/analysis/ElevationProfile/ElevationProfileInputLine.d.ts +0 -4
  141. package/analysis/ElevationProfile/ElevationProfileQueryLine.d.ts +0 -4
  142. package/analysis/ElevationProfile/ElevationProfileSceneLine.d.ts +0 -4
  143. package/assets/esri/core/workers/chunks/03e5d1a00d85e4d16bff.js +0 -1
  144. package/assets/esri/core/workers/chunks/0914a52fb33af5d77fab.js +0 -1
  145. package/assets/esri/core/workers/chunks/1d491447b13f2f2b4399.js +0 -1
  146. package/assets/esri/core/workers/chunks/20850b0fdb55fb17bc90.js +0 -1
  147. package/assets/esri/core/workers/chunks/42bc1e981624ce9844a4.js +0 -1
  148. package/assets/esri/core/workers/chunks/436bbe99bedd7b331edb.js +0 -1
  149. package/assets/esri/core/workers/chunks/486ea51306c619238e41.js +0 -1
  150. package/assets/esri/core/workers/chunks/49cb78c85de0102e5f02.js +0 -1
  151. package/assets/esri/core/workers/chunks/5610dfde4e636e2333a9.js +0 -1
  152. package/assets/esri/core/workers/chunks/655a878ddea4907d830e.js +0 -1
  153. package/assets/esri/core/workers/chunks/72fe4f1f789abb5b4035.js +0 -1
  154. package/assets/esri/core/workers/chunks/7402c2853f6aed8d1bc7.js +0 -1
  155. package/assets/esri/core/workers/chunks/79a9f47dfa9ebabb5dbd.js +0 -1
  156. package/assets/esri/core/workers/chunks/86378d4f4d7f9a370c22.js +0 -1
  157. package/assets/esri/core/workers/chunks/b19d723d09f5bea9ca27.js +0 -1
  158. package/assets/esri/core/workers/chunks/b78ea9cc4d5f2fd3d871.js +0 -1
  159. package/assets/esri/core/workers/chunks/bd4125d163f372a7e978.js +0 -1
  160. package/assets/esri/core/workers/chunks/d0a149050f7f1c1ada09.js +0 -1
  161. package/assets/esri/core/workers/chunks/da42cc4f6142846cb745.js +0 -1
  162. package/assets/esri/core/workers/chunks/dd84f630466a26722d57.js +0 -1
  163. package/assets/esri/core/workers/chunks/e17df11c98dbd869302b.js +0 -1
  164. package/assets/esri/core/workers/chunks/e1b3ae6426886e2fab07.js +0 -1
  165. package/assets/esri/core/workers/chunks/f6513ec888a7d927d948.js +0 -1
  166. package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +0 -5
  167. package/views/2d/layers/features/sources/strategies/ATileLoadStrategy.js +0 -5
  168. package/views/2d/layers/features/sources/strategies/DrillDownTileLoadStrategy.js +0 -5
  169. package/views/2d/layers/features/sources/strategies/PagedTileLoadStrategy.js +0 -5
  170. package/views/2d/layers/features/sources/strategies/SnapshotLoadStrategy.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Basemap.js";import r from"../core/Collection.js";import s from"../core/Logger.js";import{ensureType as o}from"../core/accessorSupport/ensureType.js";import{hasBasemapStylesApiKey as t}from"./apiKeyUtils.js";import{esriBasemapDefinitions as n}from"./basemapDefinitions.js";import{layerDefinitionEquals as i,layerToDefinition as a}from"./basemapUtils.js";const c=()=>s.getLogger("esri.support.basemapUtils");function f(){return{}}function l(e){for(const r in e){const s=e[r];s?.destroyed||s.destroy(),delete e[r]}}function p(r,s){let i;if("string"==typeof r){const o=r in n,a=!o&&r.includes("/");if(!o&&!a){if(t())c().warn(`Unable to find basemap definition for: ${r}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(n).filter(([e,r])=>r.classic||r.is3d).map(([e])=>`"${e}"`).sort().join(", ");c().warn(`Unable to find basemap definition for: ${r}. Try one of these: ${e}`)}return null}s&&(i=s[r]),i||(i=o?e.fromId(r):new e({style:{id:r}}),s&&(s[r]=i))}else i=o(e,r);return i?.destroyed&&(c().warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function m(e,r=null){const s=p(e);if(!s)return null;const o=s.clone();return r&&(o.baseLayers=d(o.baseLayers,r.baseLayers),o.referenceLayers=d(o.referenceLayers,r.referenceLayers)),o}function d(e,s){const o=new r;return e.forEach(e=>{const r=s.find(r=>"scene"!==r.type&&i(a(e),a(r)))||e;o.includes(r)?o.push(e):o.push(r)}),o}export{p as basemapEnsureType,m as clonePreservingTiledLayers,f as createCache,l as destroyCache};
5
+ import e from"../Basemap.js";import r from"../core/Collection.js";import s from"../core/Logger.js";import{ensureType as o}from"../core/accessorSupport/ensureType.js";import{hasBasemapStylesApiKey as t}from"./apiKeyUtils.js";import{esriBasemapDefinitions as n}from"./basemapDefinitions.js";import{layerDefinitionEquals as i,layerToDefinition as a}from"./basemapUtils.js";const c=()=>s.getLogger("esri.support.basemapUtils");function f(){return{}}function l(e){for(const r in e){const s=e[r];s&&!s.destroyed&&s.destroy(),delete e[r]}}function p(r,s){let i;if("string"==typeof r){const o=r in n,a=!o&&r.includes("/");if(!o&&!a){if(t())c().warn(`Unable to find basemap definition for: ${r}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(n).filter(([e,r])=>r.classic||r.is3d).map(([e])=>`"${e}"`).sort().join(", ");c().warn(`Unable to find basemap definition for: ${r}. Try one of these: ${e}`)}return null}s&&(i=s[r]),i||(i=o?e.fromId(r):new e({style:{id:r}}),s&&(s[r]=i))}else i=o(e,r);return i?.destroyed&&(c().warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function m(e,r=null){const s=p(e);if(!s)return null;const o=s.clone();return r&&(o.baseLayers=d(o.baseLayers,r.baseLayers),o.referenceLayers=d(o.referenceLayers,r.referenceLayers)),o}function d(e,s){const o=new r;return e.forEach(e=>{const r=s.find(r=>"scene"!==r.type&&i(a(e),a(r)))||e;o.includes(r)?o.push(e):o.push(r)}),o}export{p as basemapEnsureType,m as clonePreservingTiledLayers,f as createCache,l as destroyCache};
@@ -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
- const c="20250916",d="13c8d40014c08b43e67dfa84b31c39857d2d64c0";export{c as buildDate,d as commitHash};
5
+ const c="20250917",e="d8f74ac3accdef5904b6fee9e57311a8c2d5d73c";export{c as buildDate,e as commitHash};
@@ -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 t}from"tslib";import e from"../../../core/Error.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 r}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView2D as i}from"./AnalysisView2D.js";import{ElevationProfileVisualization2D as s}from"./ElevationProfile/ElevationProfileVisualization2D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileGroundLineComputation as n}from"../../analysis/ElevationProfile/ElevationProfileGroundLineComputation.js";import{ElevationProfileInputLineComputation as a}from"../../analysis/ElevationProfile/ElevationProfileInputLineComputation.js";import{ElevationProfileQueryLineComputation as p}from"../../analysis/ElevationProfile/ElevationProfileQueryLineComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends i{constructor(t){super(t),this.type="elevation-profile-view-2d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:o}=this;this._controller=new l({analysis:t,analysisViewData:this,view:o,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":throw new e("elevation-profile-analysis-view-2d:unsupported","The scene profile line type is not supported in 2D views.")}}}}),this._visualization=new s({view:o,analysisViewData:this}),this._sketchTool=new c({view:o,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualization.destroy(),this._sketchTool?.destroy()}get effectiveUnits(){return this._controller.effectiveUnits}get error(){return this._controller.error}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return!0===this._controller.updating||!0===this._visualization.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([o({readOnly:!0})],u.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([o({readOnly:!0})],u.prototype,"effectiveUnits",null),t([o({readOnly:!0})],u.prototype,"error",null),t([o()],u.prototype,"hoveredPosition",void 0),t([o()],u.prototype,"hoveredPoints",null),t([o({readOnly:!0})],u.prototype,"progress",null),t([o({readOnly:!0})],u.prototype,"results",null),t([o({readOnly:!0})],u.prototype,"statistics",null),t([o({readOnly:!0})],u.prototype,"updating",null),t([o()],u.prototype,"sketchGraphic",null),t([o()],u.prototype,"toolState",null),t([o()],u.prototype,"_controller",void 0),t([o()],u.prototype,"_visualization",void 0),t([o()],u.prototype,"_sketchTool",void 0),u=t([r("esri.views.2d.analysis.ElevationProfileAnalysisView2D")],u);const h=u;export{h as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.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 r}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView2D as i}from"./AnalysisView2D.js";import{ElevationProfileVisualization2D as s}from"./ElevationProfile/ElevationProfileVisualization2D.js";import{ElevationProfileController as l}from"../../analysis/ElevationProfile/ElevationProfileController.js";import{ElevationProfileLineGroundComputation as n}from"../../analysis/ElevationProfile/ElevationProfileLineGroundComputation.js";import{ElevationProfileLineInputComputation as a}from"../../analysis/ElevationProfile/ElevationProfileLineInputComputation.js";import{ElevationProfileLineQueryComputation as p}from"../../analysis/ElevationProfile/ElevationProfileLineQueryComputation.js";import{ElevationProfileTool as c}from"../../analysis/ElevationProfile/ElevationProfileTool.js";let u=class extends i{constructor(t){super(t),this.type="elevation-profile-view-2d",this.analysis=null,this.hoveredPosition=null}initialize(){const{analysis:t,view:o}=this;this._controller=new l({analysis:t,analysisViewData:this,view:o,computationFactory:{create:t=>{switch(t.profileLine.type){case"ground":return new n(t);case"input":return new a(t);case"query":return new p(t);case"scene":throw new e("elevation-profile-analysis-view-2d:unsupported","The scene profile line type is not supported in 2D views.")}}}}),this._visualization=new s({view:o,analysisViewData:this}),this._sketchTool=new c({view:o,analysisViewData:this})}destroy(){this._controller.destroy(),this._visualization.destroy(),this._sketchTool?.destroy()}get effectiveUnits(){return this._controller.effectiveUnits}get error(){return this._controller.error}get hoveredPoints(){return this._controller.hoveredPoints}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get progress(){return this._controller.progress}get results(){return this._controller.results}get statistics(){return this._controller.statistics}get updating(){return!0===this._controller.updating||!0===this._visualization.updating||!0===this._sketchTool?.updating}get visible(){return super.visible}set visible(t){super.visible=t}get sketchGraphic(){return this._sketchTool?.sketchGraphic}get toolState(){return this._sketchTool?.state??"idle"}place(t){return this._sketchTool.place(t)}pickGraphic(t){return this._sketchTool.pickGraphic(t)}};t([o({readOnly:!0})],u.prototype,"type",void 0),t([o({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",void 0),t([o({readOnly:!0})],u.prototype,"effectiveUnits",null),t([o({readOnly:!0})],u.prototype,"error",null),t([o()],u.prototype,"hoveredPosition",void 0),t([o()],u.prototype,"hoveredPoints",null),t([o({readOnly:!0})],u.prototype,"progress",null),t([o({readOnly:!0})],u.prototype,"results",null),t([o({readOnly:!0})],u.prototype,"statistics",null),t([o({readOnly:!0})],u.prototype,"updating",null),t([o()],u.prototype,"sketchGraphic",null),t([o()],u.prototype,"toolState",null),t([o()],u.prototype,"_controller",void 0),t([o()],u.prototype,"_visualization",void 0),t([o()],u.prototype,"_sketchTool",void 0),u=t([r("esri.views.2d.analysis.ElevationProfileAnalysisView2D")],u);const h=u;export{h 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"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import i from"../../../TrackGraphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import c from"../../../core/Logger.js";import{destroyMaybe as h}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as g,throwIfNotAbortError as f,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import S from"../../../geometry/Extent.js";import F from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as k}from"../../../layers/support/featureLayerUtils.js";import{packFields as x}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as I}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as E}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import O from"../../../rest/support/AttributeBinsFeatureSet.js";import V from"../../../rest/support/AttributeBinsQuery.js";import q from"../../../rest/support/FeatureSet.js";import R from"../../../rest/support/Query.js";import{LayerView2DMixin as Q}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as H}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as M}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as W}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as P}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as D}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as G}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as N}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as J}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerView as re}from"../../layers/FeatureLayerView.js";import ie from"../../layers/LayerView.js";import{RefreshableLayerView as se}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ae}from"../../support/highlightOptionsUtils.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(se(Q(ie)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new H,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new F,this._lastUpdate=0}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),g(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===I(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),f(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:i,labelingInfo:s})=>({labelingInfo:s,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new D(this.layer):new W(this.layer);case"geojson":case"csv":case"wfs":return new D(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new N(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new J(this.layer);case"knowledge-graph-sublayer":return new G(this.layer);case"catalog-footprint":return new M(this.layer);default:o(this.layer)}return null}get timeExtent(){return E(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let i;e instanceof r?i=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?i=[e]:a.isCollection(e)&&e.length>0?i=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=i?.filter(s);if(!o?.length)return u();const n=ae(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,s){const a=await this.featureContainer.hitTest(s);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),c=this.featureContainer.getSortKeys(a),h=({displayId:e},{displayId:t})=>c.has(e)&&c.has(t)?c.get(e)-c.get(t):e-t;return n.sort(h).reverse(),u.sort(h).reverse(),[...u.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createTrackGraphicHit(e,i.fromJSON(t))),...n.map(t=>this._createFeatureGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return Y(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=q.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await Y(r,{features:[]}),s=q.fromJSON(i);return s.features.forEach(e=>this._setOriginForFeature(e)),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await Y(r,{features:[]}),s=C.fromJSON(i);return s.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await Y(r,{count:0,extent:null});return{count:i.count,extent:S.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),i=await Y(r,{features:[]});return O.fromJSON(i)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),i=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=i.has(s.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),g(this._updatingHandles.addPromise(this._workerAttached.promise)),g(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),g(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=h(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),g(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const s=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=R.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=V.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=R.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?c.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return c.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,i=ee(this.layer.geometryType),s=P(this.layer),a=[];for(const o of e.added){const e=j(o,i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,i="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...s,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),k(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const i=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(s,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=i);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const c=await this.getWorker();await c.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=i,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const h=o.processor.mesh.strategy,d="cluster"===h.type||"binning"===h.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,x(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[ce(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||c.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function ce(e,t,r,i,s,a){s&&(s=s.clone());const o=null!=s?s.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(s??=new U,s.timeExtent=n),s=t.addFilters?.(s,e)??s,a&&(s??=new U,s.where=v(s.where,a));let u=s?.toJSON()??null;return i.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(i)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import i from"../../../TrackGraphic.js";import{isSome as s}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as g,throwIfNotAbortError as f,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import S from"../../../geometry/Extent.js";import F from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as k}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as E}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import O from"../../../rest/support/AttributeBinsFeatureSet.js";import R from"../../../rest/support/AttributeBinsQuery.js";import V from"../../../rest/support/FeatureSet.js";import q from"../../../rest/support/Query.js";import{LayerView2DMixin as Q}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as M}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as H}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as P}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as W}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as D}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as G}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as N}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as J}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import{FeatureLayerView as re}from"../../layers/FeatureLayerView.js";import ie from"../../layers/LayerView.js";import{RefreshableLayerView as se}from"../../layers/RefreshableLayerView.js";import{getHighlightName as ae}from"../../support/highlightOptionsUtils.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(se(Q(ie)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new M,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new F,this._lastUpdate=0}destroy(){this._editUpdatingHandles.destroy(),this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),g(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===k(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};try{await this._workerProxy.pipeline.onAttach(e),this._workerAttached.resolve()}catch(t){this._workerAttached.reject(d()),f(t)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:i,labelingInfo:s})=>({labelingInfo:s,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:i,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new D(this.layer):new P(this.layer);case"geojson":case"csv":case"wfs":return new D(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new N(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new J(this.layer);case"knowledge-graph-sublayer":return new G(this.layer);case"catalog-footprint":return new H(this.layer);default:o(this.layer)}return null}get timeExtent(){return E(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}get usedMemory(){return this.container.usedMemory+this.eventLog.pipelineStatistics.usedMemory}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let i;e instanceof r?i=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?i=[e]:a.isCollection(e)&&e.length>0?i=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=i?.filter(s);if(!o?.length)return u();const n=ae(t);return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,s){const a=await this.featureContainer.hitTest(s);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createAggregateGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createTrackGraphicHit(e,i.fromJSON(t))),...n.map(t=>this._createFeatureGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const i={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),i,r);return Y(s,{})}async queryUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.features.executeQueryForHistogram(this._cleanUpQuery(e),s,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const i=await this.getWorker(),s={...t,scale:this.view.scale},a=i.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=V.fromJSON(e);return t.features.forEach(e=>this._setOriginForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),i=await Y(r,{features:[]}),s=V.fromJSON(i);return s.features.forEach(e=>this._setOriginForFeature(e)),s}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),i=await Y(r,{features:[]}),s=C.fromJSON(i);return s.features.forEach(e=>this.layerAdapter.setAggregateGraphicOrigin?.(e)),s}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),i=await Y(r,{count:0,extent:null});return{count:i.count,extent:S.fromJSON(i.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),i=await Y(r,{features:[]});return O.fromJSON(i)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){const t=performance.now();if(t-this._lastUpdate<200)return;if(this._lastUpdate=t,!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const r=this.subscriptionManager.update(e.targetState,this._lastTargetState),i=new Set(this.subscriptionManager.coverage?.target.keys());for(const s of this.featureContainer.tiles||[])s.isCoverage=i.has(s.id);this.featureContainer.setVisibleTiles(r)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),g(this._updatingHandles.addPromise(this._workerAttached.promise)),g(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),g(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.view.labelManager.removeContainer(this.featureContainer),this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),g(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,i=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||r)||i||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${i}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return s}_createClientOptions(){const e=this;return{openMemoryPorts:async()=>{if(this.layerAdapter?.openMessagePorts){const e=await this.layerAdapter.openMessagePorts();return{result:e,transferList:e}}throw new Error("InternalError: Layer adapter does not support opening message ports")},get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const i of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(i));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const i={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const s=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:s,path:"renderer",schemaOptions:i})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=R.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const i of t.aggregateIds??[])r.push(i);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const i="globalIdField"in this.layer&&this.layer.globalIdField,s=i&&this.availableFields.includes(i);if(r.length&&!s)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${i} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,i=ee(this.layer.geometryType),s=W(this.layer),a=[];for(const o of e.added){const e=j(o,i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,i,t,r,s);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,i="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(i&&this._canEditByFeature(i)){const{adds:e,deletes:t,updates:s}=i.editedFeatures,a=this.layer.objectIdField,o=s.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[s,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...s,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const i=this.featureEffect,s={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:await this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(s,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.strategy,o.source.strategy)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=i);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=i,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender();const c=o.processor.mesh.strategy,d="cluster"===c.type||"binning"===c.type,y="heatmap"===o.processor.mesh.factory.symbology.type,g=d||y?"target-defer":"eager";this.subscriptionManager.setVisibilityStrategy(g),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[he(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e,spatialReference:this.view.spatialReference,extent:this.view.extent}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setOriginForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin(e)}_createFeatureGraphicHit(e,t){return this._setOriginForFeature(t),this._createGraphicHit(e,t)}_createTrackGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setTrackGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createAggregateGraphicHit(e,t){return t.layer=t.sourceLayer=this.layer,this.layerAdapter.setAggregateGraphicOrigin?.(t),this._createGraphicHit(e,t)}_createGraphicHit(e,t){return null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function he(e,t,r,i,s,a){s&&(s=s.clone());const o=null!=s?s.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(s??=new U,s.timeExtent=n),s=t.addFilters?.(s,e)??s,a&&(s??=new U,s.where=v(s.where,a));let u=s?.toJSON()??null;return i.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(i)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le 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 e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(i),this._source=new g(e.service,this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanup();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{y as default};
5
+ import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(i),this._source=new g(this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanup();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e.source,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}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 has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import n from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as g}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as p}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as y}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as _}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as l}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as m}from"./processor/TrackStrategy.js";import{AttributeStore as f}from"./support/AttributeStore.js";import{ComputedAttributeStorage as b}from"./support/ComputedAttributeStorage.js";class w{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new g,this._proxy=new u({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new f({isLocal:!1,update:e=>o(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(e,s,r,i,o){const c=e.processor,u=t(this._schema?.storage,c.storage),g=t(this._schema?.mesh.properties,c.mesh.properties),y=t(this._schema?.mesh.factory,c.mesh.factory),d=t(this._schema?.mesh.strategy,c.mesh.strategy),_=S(this._schema?.expressionProperties,c.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,w=m||f,I=g||y||d;if(!(u||I||(m||l||f))&&!i)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,c),schema:c}),this._schema=c;const x=n.fromJSON(this._source.service.outSpatialReference),v=new b({fields:this._source.metadata.fieldsIndex,spatialReference:x}),M={currentUser:c.mesh.properties.currentUser};if((u||I||l)&&(await this._attributeStore.update(c.storage,v,this._source.metadata,s),this._strategy?.invalidateAttributeData(j(c))),!i&&!I&&!w)return!1;(d||g||w)&&await this._updateStrategy(c.mesh.strategy,x,o,j(c),M),this._updateSortKey(v,"sortKey"in c.mesh.properties?c.mesh.properties.sortKey:null);const k="dictionary"===c.mesh.factory.symbology.type?c.mesh.factory.symbology.fieldMap:null,U=new p(v,this._proxy,r,this._registry,k);return(y||"dictionary"===c.mesh.factory.symbology.type)&&(this._factory=await h.create(U,c.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e){if(!this._strategy)return;const t=this._strategy.applyOverrideUpdate(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new y({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch(e=>s(e));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r,i){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new l(this._source,this._attributeStore,r,i);break;case"binning":this._strategy=await d.create(e,t,this._source,this._attributeStore,r,i);break;case"cluster":this._strategy=await _.create(this._connection,e,t,this._source,this._attributeStore,r,i);break;case"track":this._strategy=await m.create(e,t,this._source,this._attributeStore,r,i)}for(const a of s)this._strategy.onSubscribe(a)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(e,s),r(t.signal);const i=await this._write(e,t.tile.createArcadeEvaluationOptions(j(this._schema)),s),a=t.tile.tileInfoView.getLODInfoAt(t.tile.key);r(t.signal);const{message:o,transferList:n}=i.serialize(a),c={objectIdMap:null,inner:e.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)c.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(c,{signal:t.signal,transferList:n}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(j(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,s){const a=e.subscription.tile,o=e.reader?.getCursor(),n=o?.getSize()??0,h=a.tileInfoView.tileInfo.isWrappable,u=a.tileInfoView.tileInfo.spatialReference.isWGS84,g=new c(a.key,this._strategy.enablePixelBuffering,h,u,n);if(!o)return g;const p=a.createArcadeEvaluationOptions(j(this._schema));let y=0;for(;o.next();){++y%1e3||(await i(0),r(e.subscription));const n=this._getSortKeyValue(o,t);g.entityStart(o.getDisplayId(),n),this._factory.write(g,this._proxy,o,p,s,a.level),g.entityEnd()}return g}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function S(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function j(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}export{w as default};
5
+ import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import n from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as g}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as p}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as y}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as _}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as l}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as m}from"./processor/TrackStrategy.js";import{AttributeStore as f}from"./support/AttributeStore.js";import{ComputedAttributeStorage as b}from"./support/ComputedAttributeStorage.js";class w{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new g,this._proxy=new u({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new f({isLocal:!1,update:e=>o(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(e,s,r,i,o){const c=e.processor,u=t(this._schema?.storage,c.storage),g=t(this._schema?.mesh.properties,c.mesh.properties),y=t(this._schema?.mesh.factory,c.mesh.factory),d=t(this._schema?.mesh.strategy,c.mesh.strategy),_=S(this._schema?.expressionProperties,c.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,w=m||f,I=g||y||d;if(!(u||I||(m||l||f))&&!i)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,c),schema:c}),this._schema=c;const x=n.fromJSON(this._source.metadata.outSpatialReference),v=new b({fields:this._source.metadata.fieldsIndex,spatialReference:x}),M={currentUser:c.mesh.properties.currentUser};if((u||I||l)&&(await this._attributeStore.update(c.storage,v,this._source.metadata,s),this._strategy?.invalidateAttributeData(j(c))),!i&&!I&&!w)return!1;(d||g||w)&&await this._updateStrategy(c.mesh.strategy,x,o,j(c),M),this._updateSortKey(v,"sortKey"in c.mesh.properties?c.mesh.properties.sortKey:null);const k="dictionary"===c.mesh.factory.symbology.type?c.mesh.factory.symbology.fieldMap:null,U=new p(v,this._proxy,r,this._registry,k);return(y||"dictionary"===c.mesh.factory.symbology.type)&&(this._factory=await h.create(U,c.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e){if(!this._strategy)return;const t=this._strategy.applyOverrideUpdate(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new y({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch(e=>s(e));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r,i){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new l(this._source,this._attributeStore,r,i);break;case"binning":this._strategy=await d.create(e,t,this._source,this._attributeStore,r,i);break;case"cluster":this._strategy=await _.create(this._connection,e,t,this._source,this._attributeStore,r,i);break;case"track":this._strategy=await m.create(e,t,this._source,this._attributeStore,r,i)}for(const a of s)this._strategy.onSubscribe(a)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(e,s),r(t.signal);const i=await this._write(e,t.tile.createArcadeEvaluationOptions(j(this._schema)),s),a=t.tile.tileInfoView.getLODInfoAt(t.tile.key);r(t.signal);const{message:o,transferList:n}=i.serialize(a),c={objectIdMap:null,inner:e.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)c.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(c,{signal:t.signal,transferList:n}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(j(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,s){const a=e.subscription.tile,o=e.reader?.getCursor(),n=o?.getSize()??0,h=a.tileInfoView.tileInfo.isWrappable,u=a.tileInfoView.tileInfo.spatialReference.isWGS84,g=new c(a.key,this._strategy.enablePixelBuffering,h,u,n);if(!o)return g;const p=a.createArcadeEvaluationOptions(j(this._schema));let y=0;for(;o.next();){++y%1e3||(await i(0),r(e.subscription));const n=this._getSortKeyValue(o,t);g.entityStart(o.getDisplayId(),n),this._factory.write(g,this._proxy,o,p,s,a.level),g.entityEnd()}return g}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function S(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function j(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}export{w 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{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as o,createLabelVVEvaluator as i}from"./labelingUtils.js";import{createFeatureSourceSchema as s}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class l{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=o(t);return[{vvEvaluators:{0:i(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(o){const i=this.layer,{capabilities:s,editingInfo:a,objectIdField:n,globalIdField:l,datesInUnknownTimezone:p,dateFieldsTimeZone:d,orderBy:u,parsedUrl:c}=i,y=i.fieldsIndex.toJSON(),m=r(i),f=i.timeInfo?.toJSON(),h=i.spatialReference.toJSON(),g=e(c);let b=n;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(b=e)}const I=t(g.path),S=o.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:I,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:p,dateFieldsTimeZone:d,globalIdField:l,fieldsIndex:y,geometryType:m,featureIdInfo:{type:"object-id",fieldName:n},timeInfo:f,spatialReference:h,outSpatialReference:S,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:r,displayFilterInfo:o,customParameters:i,timeExtent:a,apiKey:n}=this.layer;return s({definitionExpression:r,displayFilterInfo:o,customParameters:i,timeExtent:a},e,t,n)}createProcessorSchema(e,t,r){const{fields:o,geometryType:i,orderBy:s,objectIdField:n,renderer:l,labelingInfo:p,labelsVisible:d}=this.layer,u={featureReduction:null,labelingInfoSource:this.layer.id,fields:o.map(e=>e.toJSON()),geometryType:i,labelingInfo:p,labelsVisible:d,objectIdField:n,orderBy:s??"default",renderer:l?.clone()};return a(e,t,u,r)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}}export{l as CatalogFootprintLayerAdapter};
5
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class n{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return o(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields})}createProcessorSchema(e,r,t){const{fields:i,geometryType:s,orderBy:o,objectIdField:l,renderer:n,labelingInfo:p,labelsVisible:d}=this.layer,u={featureReduction:null,labelingInfoSource:this.layer.id,fields:i.map(e=>e.toJSON()),geometryType:s,labelingInfo:p,labelsVisible:d,objectIdField:l,orderBy:o??"default",renderer:n?.clone()};return a(e,r,u,t)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const s=this.layer,{capabilities:o,editingInfo:a,objectIdField:l,globalIdField:n,datesInUnknownTimezone:p,dateFieldsTimeZone:d,orderBy:u,parsedUrl:c}=s,y=s.fieldsIndex.toJSON(),m=t(s),f=s.timeInfo?.toJSON(),h=s.spatialReference.toJSON(),g=e(c);let b=l;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(b=e)}const F=r(g.path),I=i.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:F,orderByFields:b,outSpatialReference:I,metadata:{timeReferenceUnknownClient:p,dateFieldsTimeZone:d,globalIdField:n,fieldsIndex:y,geometryType:m,featureIdInfo:{type:"object-id",fieldName:l},timeInfo:f,spatialReference:h,outSpatialReference:I,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:o.query.maxRecordCount,supportsCompactGeometry:o.query.supportsCompactGeometry,supportsDefaultSpatialReference:o.query.supportsDefaultSpatialReference,supportsFormatPBF:o.query.supportsFormatPBF,supportsMaxRecordCountFactor:o.query.supportsMaxRecordCountFactor,supportsQuantization:o.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:o.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:o.query.supportsDegeneratedQuantizedGeometry,lastEditDate:a?.lastEditDate?.getTime()}}}}export{n as CatalogFootprintLayerAdapter};
@@ -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{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{createSnapshotInfo as i,createFeatureIdInfo as s}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as a}from"./floorFilterUtils.js";import{getServiceGeometryType as n}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as l,getLayerDeconflictionEnabled as p,createLabelVVEvaluator as d}from"./labelingUtils.js";import{createFeatureSourceSchema as y}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class m{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=l(t,e)??p(t),s=r(t,e),o=[...t.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:d(t.renderer)},deconflictionEnabled:i,labelingInfo:o}]}async createServiceOptions(r){const o=this.layer,{capabilities:a,editingInfo:l,typeIdField:p,globalIdField:d,datesInUnknownTimezone:y,dateFieldsTimeZone:u,orderBy:c,subtypeField:m,refreshInterval:f}=o,h=o.fieldsIndex.toJSON(),g=n(o),b=o.timeInfo?.toJSON(),I=o.spatialReference.toJSON(),S=o.types?.map(e=>e.toJSON()),F=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(F.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let O=this.layer.objectIdField;if(c?.length){const e=!c[0].valueExpression&&c[0].field;e&&(O=e)}const x=t(F.path),R=i(x,!(null!=l?.lastEditDate)&&f>0,a,g,r.extent,o.fullExtent),j=r.spatialReference.toJSON();return{type:"feature-service",source:F,isSourceHosted:x,orderByFields:O,outSpatialReference:j,metadata:{typeIdField:p??void 0,types:S,timeReferenceUnknownClient:y,dateFieldsTimeZone:u,subtypeField:m,globalIdField:d,fieldsIndex:h,geometryType:g,featureIdInfo:s(o),timeInfo:b,spatialReference:I,outSpatialReference:j,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:a.query.maxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime(),snapshotInfo:R}}}createSourceSchema(e,t){const{apiKey:r,definitionExpression:i,displayFilterInfo:s,customParameters:o,gdbVersion:a,historicMoment:n,subtypeCode:l,subtypeField:p,timeExtent:d}=this.layer;return y({definitionExpression:i,displayFilterInfo:s,customParameters:o,gdbVersion:a,historicMoment:n,subtypeCode:l,subtypeField:p,timeExtent:d},e,t,r)}createProcessorSchema(e,t,i){const{fields:s,renderer:o,geometryType:a,labelingInfo:n,labelsVisible:l,orderBy:p,objectIdField:d,trackInfo:y}=this.layer,c={fields:s.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:l,objectIdField:d,orderBy:p??"default",trackInfo:y};return u(e,t,c,i)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,t){return o(this.layer,e,t)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>r(this.layer,e),()=>a(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}}export{m as FeatureLayerAdapter};
5
+ import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{createFeatureIdInfo as s}from"./featureServiceUtils.js";import{addFloorFilter as a,hasFloorFilter as o}from"./floorFilterUtils.js";import{getServiceGeometryType as l}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as y,createLabelVVEvaluator as p}from"./labelingUtils.js";import{createSnapshotInfo as d,createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as c}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as m}from"../support/rendererUtils.js";class h{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=n(r,e)??y(r),s=i(r,e),a=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:p(r.renderer)},deconflictionEnabled:t,labelingInfo:a}]}async createSourceSchema(e,t){const i=this._createServiceInfo(e),s=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,o=!s&&a,l=d(i.isSourceHosted,o,this.layer.capabilities,i.metadata.geometryType,e.extent,this.layer.fullExtent),n=null!=this.layer.subtypeCode?`${this.layer.subtypeField} = ${this.layer.subtypeCode}`:null,y=r(this.layer.definitionExpression,n);return u(i,l,{definitionExpression:y,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields})}createProcessorSchema(e,r,t){const{fields:s,renderer:a,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:y,objectIdField:p,trackInfo:d}=this.layer,u={fields:s.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:y??"default",trackInfo:d};return c(e,r,u,t)}get hasRequiredSupport(){return m(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return a(this.layer,e,r)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>i(this.layer,e),()=>o(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a,editingInfo:o,typeIdField:n,globalIdField:y,datesInUnknownTimezone:p,dateFieldsTimeZone:d,orderBy:u,subtypeField:c}=i,m=i.fieldsIndex.toJSON(),h=l(i),f=i.timeInfo?.toJSON(),g=i.spatialReference.toJSON(),b=i.types?.map(e=>e.toJSON()),I=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(I.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let S=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(S=e)}const F=t(I.path),O=r.spatialReference.toJSON();return{type:"feature-service",source:I,isSourceHosted:F,orderByFields:S,outSpatialReference:O,metadata:{typeIdField:n??void 0,types:b,timeReferenceUnknownClient:p,dateFieldsTimeZone:d,subtypeField:c,globalIdField:y,fieldsIndex:m,geometryType:h,featureIdInfo:s(i),timeInfo:f,spatialReference:g,outSpatialReference:O,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:a.query.maxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime()}}}}export{h as FeatureLayerAdapter};
@@ -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 e from"../../../../../core/Error.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as o,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createFeatureSourceSchema as s}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";function u(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class p{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,s=i(t,e)??o(t),a=r(t,e),l=[...t.labelingInfo||[],...a?.labelingInfo||[]];return[{vvEvaluators:{0:n(t.renderer)},deconflictionEnabled:s,labelingInfo:l}]}async createServiceOptions(e){const r=this.layer,{capabilities:i,objectIdField:o}=r,n=r.fieldsIndex.toJSON(),s=t(r),a=r.timeInfo?.toJSON(),l=r.spatialReference.toJSON();u(r.source);const p=await r.source.openPorts(),d=o,c=e.spatialReference.toJSON();return{type:"memory",source:p,orderByFields:d,outSpatialReference:c,metadata:{fieldsIndex:n,geometryType:s,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:a,spatialReference:l,outSpatialReference:c,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:i.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:i.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r){const{definitionExpression:t,timeExtent:i,displayFilterInfo:o}=this.layer;return s({customParameters:null,definitionExpression:t,displayFilterInfo:o,timeExtent:i},e,r,null)}createProcessorSchema(e,t,i){const{fields:o,renderer:n,geometryType:s,labelingInfo:l,labelsVisible:u,orderBy:p,objectIdField:d}=this.layer,c="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:o.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:d,orderBy:p??"default",trackInfo:c};return a(e,t,y,i)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>r(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}}export{p as InMemoryLayerAdapter};
5
+ import e from"../../../../../core/Error.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as o,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as s}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";function u(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class p{constructor(e){this.layer=e}openMessagePorts(){return u(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const t=this.layer,a=i(t,e)??o(t),s=r(t,e),l=[...t.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:n(t.renderer)},deconflictionEnabled:a,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields})}createProcessorSchema(e,t,i){const{fields:o,renderer:n,geometryType:a,labelingInfo:l,labelsVisible:u,orderBy:p,objectIdField:d}=this.layer,c="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:o.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:a,labelingInfo:l,labelsVisible:u,objectIdField:d,orderBy:p??"default",trackInfo:c};return s(e,t,y,i)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>r(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(e){const r=this.layer,{capabilities:i,objectIdField:o}=r,n=r.fieldsIndex.toJSON(),a=t(r),s=r.timeInfo?.toJSON(),l=r.spatialReference.toJSON();u(r.source);const p=o,d=e.spatialReference.toJSON();return{type:"memory",orderByFields:p,outSpatialReference:d,metadata:{fieldsIndex:n,geometryType:a,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:s,spatialReference:l,outSpatialReference:d,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:i.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:i.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{p as InMemoryLayerAdapter};
@@ -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{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as o}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as s,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as p}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=s(r,e)??a(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,s=r.fieldsIndex.toJSON(),a=o(r),n=r.spatialReference.toJSON(),l=await r.source.openPorts(),p=i,u=e.spatialReference.toJSON();return{type:"memory",source:l,orderByFields:p,outSpatialReference:u,metadata:{fieldsIndex:s,geometryType:a,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:n,outSpatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r){const{definitionExpression:t,displayFilterInfo:i}=this.layer;return l({definitionExpression:t,displayFilterInfo:i,customParameters:null},e,r,null)}createProcessorSchema(e,r,t){const{fields:o,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:l,objectIdField:u}=this.layer,d={fields:o.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:a,labelingInfo:n,labelsVisible:l,objectIdField:u,orderBy:"default"};return p(e,r,d,t)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>c(this.layer)]}hasFilters(e){return c(this.layer)}addFilters(i,o){if(c(this.layer)){const o=e(i?.where,`${r}=1`);if(!o)return i;i??=new t,i.where=o}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}}function c(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{d as KnowledgeGraphSublayerAdapter};
5
+ import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as s,createLabelVVEvaluator as l}from"./labelingUtils.js";import{createFeatureSourceSchema as n}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as p}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??s(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return n(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields})}createProcessorSchema(e,r,t){const{fields:a,renderer:o,geometryType:s,labelingInfo:l,labelsVisible:n,objectIdField:u}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:s,labelingInfo:l,labelsVisible:n,objectIdField:u,orderBy:"default"};return p(e,r,d,t)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>c(this.layer)]}hasFilters(e){return c(this.layer)}addFilters(i,a){if(c(this.layer)){const a=e(i?.where,`${r}=1`);if(!a)return i;i??=new t,i.where=a}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,o=r.fieldsIndex.toJSON(),s=a(r),l=r.spatialReference.toJSON(),n=i,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:n,outSpatialReference:p,metadata:{fieldsIndex:o,geometryType:s,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:l,outSpatialReference:p,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}function c(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{d as KnowledgeGraphSublayerAdapter};
@@ -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{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as a}from"./labelingUtils.js";import{createFeatureSourceSchema as s}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??i(r);return[{vvEvaluators:{0:a(r.renderer)},deconflictionEnabled:t,labelingInfo:r.labelingInfo}]}async createServiceOptions(r){const o=this.layer,{capabilities:i}=o,a=o.fieldsIndex.toJSON(),s=t(o),n=o.timeInfo?.toJSON(),l=o.spatialReference.toJSON(),u=o.source.getSource(),p=this.layer.objectIdField,c=e(i);c.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:p,outSpatialReference:d,metadata:{fieldsIndex:a,geometryType:s,featureIdInfo:{type:"object-id",fieldName:o.objectIdField},timeInfo:n,spatialReference:l,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:c.query.maxRecordCount,supportsCompactGeometry:c.query.supportsCompactGeometry,supportsDefaultSpatialReference:c.query.supportsDefaultSpatialReference,supportsFormatPBF:c.query.supportsFormatPBF,supportsMaxRecordCountFactor:c.query.supportsMaxRecordCountFactor,supportsQuantization:c.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:c.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:c.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,r){const{customParameters:t,timeExtent:o,apiKey:i}=this.layer;return s({customParameters:t,timeExtent:o},e,r,i)}createProcessorSchema(e,t,o){const{fields:i,renderer:a,geometryType:s,labelingInfo:l,labelsVisible:u,orderBy:p,objectIdField:c}=this.layer,d={fields:i.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:c,orderBy:p??"default"};return n(e,t,d,o)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}}export{u as OGCFeatureLayerAdapter};
5
+ import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{createFeatureSourceSchema as s}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t,labelingInfo:r.labelingInfo}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return s(t,null,{definitionExpression:null,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields})}createProcessorSchema(e,t,i){const{fields:a,renderer:o,geometryType:s,labelingInfo:n,labelsVisible:u,orderBy:p,objectIdField:c}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:n,labelsVisible:u,objectIdField:c,orderBy:p??"default"};return l(e,t,d,i)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,o=i.fieldsIndex.toJSON(),s=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),p=this.layer.objectIdField,c=e(a);c.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:p,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:s,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:c.query.maxRecordCount,supportsCompactGeometry:c.query.supportsCompactGeometry,supportsDefaultSpatialReference:c.query.supportsDefaultSpatialReference,supportsFormatPBF:c.query.supportsFormatPBF,supportsMaxRecordCountFactor:c.query.supportsMaxRecordCountFactor,supportsQuantization:c.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:c.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:c.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{u as OGCFeatureLayerAdapter};
@@ -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{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{createSnapshotInfo as i}from"./featureServiceUtils.js";import{addFloorFilter as o,hasFloorFilter as s}from"./floorFilterUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as l,getLayerDeconflictionEnabled as n,createLabelVVEvaluator as p}from"./labelingUtils.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as d}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=l(r,e)??n(r);return[{vvEvaluators:{0:p(r.renderer)},deconflictionEnabled:t}]}async createServiceOptions(t){const o=this.layer,{capabilities:s,globalIdField:l,orderBy:n,refreshInterval:p}=o,u=o.fieldsIndex.toJSON(),d=a(o),c=o.timeInfo?.toJSON(),y=o.spatialReference.toJSON(),m=e(this.layer.parsedUrl);let f=this.layer.objectIdField;if(n?.length){const e=!n[0].valueExpression&&n[0].field;e&&(f=e)}const h=p>0,g=r(m.path),b=t.spatialReference.toJSON(),I=i(g,h,s,d,t.extent,o.fullExtent);return{type:"feature-service",source:m,isSourceHosted:g,orderByFields:f,outSpatialReference:b,metadata:{globalIdField:l,fieldsIndex:u,geometryType:d,featureIdInfo:{type:"object-id",fieldName:o.objectIdField},timeInfo:c,spatialReference:y,outSpatialReference:b,timeReferenceUnknownClient:o.datesInUnknownTimezone,dateFieldsTimeZone:o.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null,snapshotInfo:I}}}createSourceSchema(e,r){const{definitionExpression:t,displayFilterInfo:i,customParameters:o,timeExtent:s}=this.layer;return u({definitionExpression:t,displayFilterInfo:i,customParameters:o,timeExtent:s},e,r,null)}createProcessorSchema(e,r,i){const{fields:o,renderer:s,geometryType:a,labelingInfo:l,labelsVisible:n,orderBy:p,objectIdField:u}=this.layer,c={fields:o.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:a,labelingInfo:l,labelsVisible:n,objectIdField:u,orderBy:p??"default"};return d(e,r,c,i)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return o(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>s(this.layer,e)?e.floors:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}}export{y as OrientedImageryLayerAdapter};
5
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{addFloorFilter as i,hasFloorFilter as s}from"./floorFilterUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createSnapshotInfo as d,createFeatureSourceSchema as p}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??l(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,s=this.layer.refreshInterval>0,a=!i&&s,o=d(t.isSourceHosted,a,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return p(t,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields})}createProcessorSchema(e,r,i){const{fields:s,renderer:a,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:d,objectIdField:p}=this.layer,c={fields:s.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:d??"default"};return u(e,r,c,i)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>s(this.layer,e)?e.floors:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:s,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),d=a(i),p=i.timeInfo?.toJSON(),u=i.spatialReference.toJSON(),c=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const m=r(c.path),h=t.spatialReference.toJSON();return{type:"feature-service",source:c,isSourceHosted:m,orderByFields:y,outSpatialReference:h,metadata:{globalIdField:o,fieldsIndex:n,geometryType:d,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:p,spatialReference:u,outSpatialReference:h,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{y as OrientedImageryLayerAdapter};
@@ -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 e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as l,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,i=l(r,e)??a(r),o=t(r,e),n=[...r.labelingInfo||[],...o?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:i,labelingInfo:n}]}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createServiceOptions(t){const l=i(this.layer),a=t.spatialReference.toJSON(),s=this.layer.encoding;if(null==s)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:a,geometryInfo:{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON(),displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:a,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:l,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}createSourceSchema(e,r){return{type:"parquet",mutable:{sourceRefreshVersion:r,availableFields:e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,r,i){const l={fields:this.layer.fields.map(e=>e.toJSON()),renderer:this.layer.renderer?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return o(e,r,l,i)}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}}export{y as ParquetLayerAdapter};
5
+ import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as l,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as o}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return o(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,i=l(r,e)??a(r),n=t(r,e),o=[...r.labelingInfo||[],...n?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:i,labelingInfo:o}]}getUpdateHashProperties(e){return[()=>this.layer.urls.join(","),()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,l={partial:{urls:[...this.layer.urls.items],availableFields:i},full:{definitionExpression:null,sourceRefreshVersion:r,customParameters:this.layer.customParameters??null}};return{type:"parquet",service:t,strategy:this._createStrategy(t,l)}}_createStrategy(e,r){return e.geometryInfo.displayOptimization?{type:"xz",...r}:{type:"snapshot",...r}}createProcessorSchema(e,r,i){const l={fields:this.layer.fields.map(e=>e.toJSON()),renderer:this.layer.renderer?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return n(e,r,l,i)}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}_createServiceInfo(t){const l=i(this.layer),a=t.spatialReference.toJSON(),s=this.layer.encoding;if(null==s)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",outSpatialReference:a,geometryInfo:{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON(),displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:a,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:l,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}}export{y as ParquetLayerAdapter};
@@ -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{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as t,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as n}from"./labelingUtils.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as a}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}getLabelingDeconflictionInfo(r){const l=this.layer,a=t(l,r)??i(l),s=e(l,r),o=[...l.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:n(l.renderer)},deconflictionEnabled:a,labelingInfo:o}]}async createServiceOptions(e){const t=this.layer,i=r(t),n=t.timeInfo?.toJSON()||null,l=t.spatialReference?t.spatialReference.toJSON():null,a=e.spatialReference.toJSON();return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:a,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:i,featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},timeInfo:n,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,spatialReference:l,outSpatialReference:a,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(e,r){const{definitionExpression:t,geometryDefinition:i,customParameters:n}=this.layer;return{type:"stream",mutable:{sourceRefreshVersion:r,availableFields:e.availableFields,dataFilter:{geometryDefinition:i?.toJSON(),definitionExpression:t,customParameters:n??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(r,t,i){const{fields:n,renderer:a,geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:p,trackInfo:d}=this.layer,y={fields:n.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:e(this.layer,t),geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:p,orderBy:"default",trackInfo:d};return l(r,t,y,i)}get hasRequiredSupport(){return a(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(r){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>e(this.layer,r),()=>this.layer.customParameters,()=>this.layer.geometryDefinition,()=>this.layer.definitionExpression,()=>this.layer.trackInfo]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}}export{s as StreamLayerAdapter};
5
+ import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as t,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as l}from"./labelingUtils.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}getLabelingDeconflictionInfo(r){const a=this.layer,n=t(a,r)??i(a),s=e(a,r),o=[...a.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:l(a.renderer)},deconflictionEnabled:n,labelingInfo:o}]}async createSourceSchema(e,r){return{type:"stream",service:this._createServiceInfo(e),strategy:{type:"stream",partial:{sourceRefreshVersion:r},full:{availableFields:e.availableFields,geometryDefinition:this.layer.geometryDefinition?.toJSON(),definitionExpression:this.layer.definitionExpression,customParameters:this.layer.customParameters,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(r,t,i){const{fields:l,renderer:n,geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:y,trackInfo:p}=this.layer,f={fields:l.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:e(this.layer,t),geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:y,orderBy:"default",trackInfo:p};return a(r,t,f,i)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(r){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>e(this.layer,r),()=>this.layer.customParameters,()=>this.layer.geometryDefinition,()=>this.layer.definitionExpression,()=>this.layer.trackInfo]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(e){const t=r(this.layer),i=this.layer.timeInfo?.toJSON()||null,l=this.layer.spatialReference?this.layer.spatialReference.toJSON():null,a=e.spatialReference.toJSON();return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:a,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:t,featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},timeInfo:i,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,spatialReference:l,outSpatialReference:a,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}}export{s as StreamLayerAdapter};
@@ -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{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as t}from"../../../../../core/mathUtils.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as s}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{createSnapshotInfo as i,createFeatureIdInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as l,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as u}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as p}from"./labelingUtils.js";import{createFeatureSourceSchema as y}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as c}from"../schema/processor/SubtypeProcessorSchema.js";class m{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer;return[{vvEvaluators:{},deconflictionEnabled:t.sublayers.some(e=>p(e)),labelingInfo:t.sublayers.toArray().filter(e=>!!e.labelingInfo).flatMap(e=>e.labelingInfo)}]}async createServiceOptions(t){const r=this.layer,{capabilities:a,datesInUnknownTimezone:l,dateFieldsTimeZone:n,editingInfo:p,globalIdField:y,objectIdField:c,refreshInterval:m,subtypeField:d}=r,f=r.fieldsIndex.toJSON(),b=u(r),h=r.timeInfo?.toJSON(),g=r.spatialReference.toJSON(),S=e(this.layer.parsedUrl),F=c,I=!(null!=p?.lastEditDate)&&m>0,x=s(S.path),R=t.spatialReference.toJSON(),C=i(x,I,a,b,t.extent,r.fullExtent);return{type:"feature-service",source:S,isSourceHosted:x,orderByFields:F,outSpatialReference:R,metadata:{timeReferenceUnknownClient:l,dateFieldsTimeZone:n,subtypeField:d,globalIdField:y,fieldsIndex:f,geometryType:b,featureIdInfo:o(this.layer),timeInfo:h,spatialReference:g,outSpatialReference:R,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:p?.lastEditDate?.getTime(),snapshotInfo:C}}}createSourceSchema(e,t){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:i,subtypeField:o,timeExtent:l,apiKey:n,displayFilterInfo:u}=this.layer,p={queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),definitionExpression:r,displayFilterInfo:u,customParameters:s,gdbVersion:a,historicMoment:i,subtypeField:o,timeExtent:l};return y(p,e,t,n)}createProcessorSchema(e,t,r){const s={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,t)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${t}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return c(e,t,s,r)}addFilters(e,t){e=l(this.layer,e,t);const s=this.layer.sublayers.filter(e=>!d(e,t)).map(e=>e.subtypeCode);if(!s.length)return e;e??=new a;const i=`NOT ${this.layer.subtypeField} IN (${s.join(",")})`;return e.where=r(e.where,i),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>n(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map(({renderer:e,labelsVisible:t,labelingInfo:r,visible:s,minScale:a,maxScale:i})=>({renderer:e,labelsVisible:t,labelingInfo:r,visible:s,minScale:a,maxScale:i}))]}setGraphicOrigin(e){const t=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=t,e.origin=t?.graphicOrigin}}function d(e,r){return e.visible&&(0===e.minScale||t(r.scale,e.minScale)||r.scale<e.minScale)&&(0===e.maxScale||t(r.scale,e.maxScale)||r.scale>e.maxScale)}export{m as SubtypeGroupLayerAdapter};
5
+ import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as a}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../layers/support/FeatureFilter.js";import{createFeatureIdInfo as s}from"./featureServiceUtils.js";import{addFloorFilter as l,hasFloorFilter as o}from"./floorFilterUtils.js";import{getServiceGeometryType as n}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as u}from"./labelingUtils.js";import{createSnapshotInfo as p,createFeatureSourceSchema as y}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as c}from"../schema/processor/SubtypeProcessorSchema.js";class m{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const r=this.layer;return[{vvEvaluators:{},deconflictionEnabled:r.sublayers.some(e=>u(e)),labelingInfo:r.sublayers.toArray().filter(e=>!!e.labelingInfo).flatMap(e=>e.labelingInfo)}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:a,gdbVersion:i,historicMoment:s,timeExtent:l,apiKey:o,displayFilterInfo:n}=this.layer,u=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,m=this.layer.refreshInterval>0,d=!c&&m,f=p(u.isSourceHosted,d,this.layer.capabilities,u.metadata.geometryType,e.extent,this.layer.fullExtent);return y(u,f,{definitionExpression:t,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:n,customParameters:a,gdbVersion:i,historicMoment:s,timeExtent:l,apiKey:o,sourceRefreshVersion:r,availableFields:e.availableFields})}createProcessorSchema(e,r,t){const a={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return c(e,r,a,t)}addFilters(e,r){e=l(this.layer,e,r);const a=this.layer.sublayers.filter(e=>!d(e,r)).map(e=>e.subtypeCode);if(!a.length)return e;e??=new i;const s=`NOT ${this.layer.subtypeField} IN (${a.join(",")})`;return e.where=t(e.where,s),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>o(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:a,minScale:i,maxScale:s})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:a,minScale:i,maxScale:s}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:i,dateFieldsTimeZone:l,editingInfo:o,globalIdField:u,objectIdField:p,subtypeField:y}=this.layer,c=this.layer.fieldsIndex.toJSON(),m=n(this.layer),d=this.layer.timeInfo?.toJSON(),f=this.layer.spatialReference.toJSON(),b=e(this.layer.parsedUrl),h=p,g=a(b.path),S=r.spatialReference.toJSON();return{type:"feature-service",source:b,isSourceHosted:g,orderByFields:h,outSpatialReference:S,metadata:{timeReferenceUnknownClient:i,dateFieldsTimeZone:l,subtypeField:y,globalIdField:u,fieldsIndex:c,geometryType:m,featureIdInfo:s(this.layer),timeInfo:d,spatialReference:f,outSpatialReference:S,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime()}}}}function d(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{m as SubtypeGroupLayerAdapter};
@@ -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 has from"../../../../../core/has.js";function e(e){const{objectIdField:t,uniqueIdFields:r}=e;return r?.length?r.length>=2?{type:"unique-id-composite",fieldNames:r}:{type:"unique-id-simple",fieldName:r[0]}:{type:"object-id",fieldName:t}}function t(e,t,s,a,l,u){const m=o(a);if(!(!!has("featurelayer-snapshot-enabled")&&s?.query.supportsPagination&&!s?.operations.supportsEditing&&!t))return null;const h=i(l,u),{min:p,max:c}=m,y=h?c:p,d=n(a);let f=has("featurelayer-snapshot-initial-tolerance");return"esriGeometryPoint"!==a&&"esriGeometryMultipoint"!==a||(f=null),{supportsExceedsLimit:r(e,s),initialTolerance:f,maxFeatureCount:y,maxVertexCount:d}}function r(e,t){return!(!e&&!has("featurelayer-snapshot-non-hosted-exceedslimit-enabled"))&&t?.operations.supportsExceedsLimitStatistics}function n(e){switch(e){case"esriGeometryPoint":return null;case"esriGeometryPolyline":case"esriGeometryPolygon":case"esriGeometryMultiPatch":case"esriGeometryMultipoint":return has("featurelayer-snapshot-max-vertex-count")}}function i(e,t){const r=t?.clone().intersection(e),n=null!=r?r.width*r.height:0,i=t?t.width*t.height:0,o=0===i?0:n/i,s=has("featurelayer-snapshot-coverage");return!isNaN(o)&&o>=s}function o(e){switch(e){case"esriGeometryMultipoint":return{min:has("featurelayer-snapshot-multipoint-min-threshold"),max:has("featurelayer-snapshot-multipoint-max-threshold")};case"esriGeometryPoint":return{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")};case"esriGeometryMultiPatch":case"esriGeometryPolygon":return{min:has("featurelayer-snapshot-polygon-min-threshold"),max:has("featurelayer-snapshot-polygon-max-threshold")};case"esriGeometryPolyline":return{min:has("featurelayer-snapshot-polyline-min-threshold"),max:has("featurelayer-snapshot-polyline-max-threshold")}}}export{e as createFeatureIdInfo,t as createSnapshotInfo};
5
+ import"../../../../../core/has.js";function e(e){const{objectIdField:i,uniqueIdFields:t}=e;return t?.length?t.length>=2?{type:"unique-id-composite",fieldNames:t}:{type:"unique-id-simple",fieldName:t[0]}:{type:"object-id",fieldName:i}}export{e as createFeatureIdInfo};
@@ -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{sqlAnd as e}from"../../../../../core/sql.js";function t(t,i,s,o){const l=null!=t.subtypeCode?`${t.subtypeField} = ${t.subtypeCode}`:null,n=e(t.definitionExpression,l),r=t.customParameters??{},a=i.displayFilterEnabled&&t.displayFilterInfo?t.displayFilterInfo.toJSON():null;return o&&(r.token=o),{type:"feature",mutable:{sourceRefreshVersion:s,availableFields:i.availableFields,displayFilterInfo:a,dataFilter:{definitionExpression:n,customParameters:r,gdbVersion:t.gdbVersion,historicMoment:t.historicMoment?.getTime(),queryScaleRanges:t.queryScaleRanges??[],timeExtent:t.timeExtent?.toJSON()}}}}export{t as createFeatureSourceSchema};
5
+ import has from"../../../../../core/has.js";import{executeQuery as e,executeQueryForCount as t}from"../../../../../rest/query/operations/query.js";import r from"../../../../../rest/support/StatisticDefinition.js";import{FeatureSourceQueryInfo as i}from"../sources/FeatureSourceQueryInfo.js";import{FeatureMetadata as n}from"../support/FeatureMetadata.js";async function s(e,t,r){return{type:"feature",service:e,strategy:await a(e,r,t)}}async function a(e,t,r){const i=t.customParameters??{};t.apiKey&&(i.apiKey=t.apiKey);const n=t.displayFilterEnabled?t.displayFilterInfo?.toJSON():null,s=t.historicMoment?.getTime(),a=t.timeExtent?.toJSON(),o={...t,displayFilterInfo:n,customParameters:i,historicMoment:s,timeExtent:a};if("feature-service"===e.type&&null!=r&&!await p(e,o,r))return{type:"snapshot",snapshotInfo:r,partial:{availableFields:t.availableFields},full:{displayFilterInfo:null,queryScaleRanges:null,sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,customParameters:t.customParameters,gdbVersion:t.gdbVersion,historicMoment:s,timeExtent:a}};return"feature-service"===e.type&&e.isSourceHosted||"memory"===e.type||"ogc"===e.type?{type:"paged-tile",partial:{availableFields:t.availableFields},full:{sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,customParameters:t.customParameters,gdbVersion:t.gdbVersion,historicMoment:s,queryScaleRanges:t.queryScaleRanges,timeExtent:a,displayFilterInfo:n}}:{type:"drill-down",partial:{availableFields:t.availableFields},full:{sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,customParameters:t.customParameters,gdbVersion:t.gdbVersion,historicMoment:s,queryScaleRanges:t.queryScaleRanges,timeExtent:a,displayFilterInfo:n}}}function o(e,t,r,i,n,s){const a=m(i);if(!(!!has("featurelayer-snapshot-enabled")&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!t))return null;const o=c(n,s),{min:p,max:y}=a,d=o?y:p,f=l(i);let h=has("featurelayer-snapshot-initial-tolerance");return"esriGeometryPoint"!==i&&"esriGeometryMultipoint"!==i||(h=null),{supportsExceedsLimit:u(e,r),initialTolerance:h,maxFeatureCount:d,maxVertexCount:f}}function u(e,t){return!(!e&&!has("featurelayer-snapshot-non-hosted-exceedslimit-enabled"))&&t?.operations.supportsExceedsLimitStatistics}function l(e){switch(e){case"esriGeometryPoint":return null;case"esriGeometryPolyline":case"esriGeometryPolygon":case"esriGeometryMultiPatch":case"esriGeometryMultipoint":return has("featurelayer-snapshot-max-vertex-count")}}function c(e,t){const r=t?.clone().intersection(e),i=null!=r?r.width*r.height:0,n=t?t.width*t.height:0,s=0===n?0:i/n,a=has("featurelayer-snapshot-coverage");return!isNaN(s)&&s>=a}function m(e){switch(e){case"esriGeometryMultipoint":return{min:has("featurelayer-snapshot-multipoint-min-threshold"),max:has("featurelayer-snapshot-multipoint-max-threshold")};case"esriGeometryPoint":return{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")};case"esriGeometryMultiPatch":case"esriGeometryPolygon":return{min:has("featurelayer-snapshot-polygon-min-threshold"),max:has("featurelayer-snapshot-polygon-max-threshold")};case"esriGeometryPolyline":return{min:has("featurelayer-snapshot-polyline-min-threshold"),max:has("featurelayer-snapshot-polyline-max-threshold")}}}async function p(t,s,a){const o=n.createFeature(t.metadata),u=i.create(t,s,o);if(!a.supportsExceedsLimit)return y(t,u,a);try{const i=t.source,n=u.createQuery();n.inner.orderByFields=[],n.inner.returnGeometry=!1;const s=new r;s.statisticType="exceedslimit",s.maxPointCount=a.maxFeatureCount,s.maxRecordCount=a.maxFeatureCount,s.outStatisticFieldName="exceedslimit",a.maxVertexCount&&(s.maxVertexCount=a.maxVertexCount),n.inner.outStatistics=[s],n.inner.cacheHint=!0;const o=await e(i,n.inner,void 0,{query:n.customParameters}),l=o.data.features[0]?.attributes.exceedslimit;return!(0===l)}catch(l){return!0}}async function y(e,r,i){if(i.maxVertexCount)return!0;const n=e.source,s=r.createQuery();s.inner.orderByFields=[],s.inner.returnGeometry=!1,s.inner.cacheHint=!0;try{return(await t(n,s.inner,{query:s.customParameters})).data.count>i.maxFeatureCount}catch(a){return!0}}export{s as createFeatureSourceSchema,o as createSnapshotInfo};