@arcgis/core 4.33.0-next.20250305 → 4.33.0-next.20250307

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 (236) hide show
  1. package/arcade/arcadeAsyncRuntime.js +1 -1
  2. package/arcade/arcadeCompiler.js +1 -1
  3. package/arcade/featureSetUtils.js +1 -1
  4. package/arcade/featureset/actions/GroupBy.js +1 -1
  5. package/arcade/featureset/actions/OrderBy.js +1 -1
  6. package/arcade/functions/aiServices.js +5 -0
  7. package/arcade/functions/date.js +1 -1
  8. package/arcade/functions/feature.js +1 -1
  9. package/arcade/functions/featuresetbase.js +1 -1
  10. package/arcade/functions/featuresetstring.js +1 -1
  11. package/arcade/functions/fieldStats.js +1 -1
  12. package/arcade/functions/geometry.js +1 -1
  13. package/arcade/functions/maths.js +1 -1
  14. package/arcade/functions/string.js +1 -1
  15. package/arcade/languageUtils.js +1 -1
  16. package/arcade/treeAnalysis.js +1 -1
  17. package/arcade.js +1 -1
  18. package/assets/esri/core/workers/RemoteClient.js +1 -1
  19. package/assets/esri/core/workers/chunks/028e2e0fa6971aaaaae8.js +1 -0
  20. package/assets/esri/core/workers/chunks/0576b035c1654a43ad5c.js +1 -0
  21. package/assets/esri/core/workers/chunks/081699532b183db1e7c2.js +1 -0
  22. package/assets/esri/core/workers/chunks/087a09b4c41abef6b516.js +1 -0
  23. package/assets/esri/core/workers/chunks/{7ec2f531217718e76469.js → 0b4e63e705db09dbe171.js} +1 -1
  24. package/assets/esri/core/workers/chunks/0c9e933b392616460e62.js +1 -0
  25. package/assets/esri/core/workers/chunks/{c3d23c45db427a29d596.js → 0f4a2bdf5bb2f4303b7f.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{f995a74bd9b58c069c07.js → 10631680abe7607616ca.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{567aa24d7e99e0b5a6cb.js → 1263391920fbb8926ced.js} +1 -1
  28. package/assets/esri/core/workers/chunks/186387a561364a11e574.js +1 -0
  29. package/assets/esri/core/workers/chunks/1cc7bbd0f4a8cf06050a.js +1 -0
  30. package/assets/esri/core/workers/chunks/1d0473dd43c88ab5776d.js +1 -0
  31. package/assets/esri/core/workers/chunks/{ef46613c3aa363dc1cfc.js → 285e573aa6f3acf70b32.js} +1 -1
  32. package/assets/esri/core/workers/chunks/2bb508701ad8ccc3d6ab.js +1 -0
  33. package/assets/esri/core/workers/chunks/36fe6b8228e622407ec2.js +1 -0
  34. package/assets/esri/core/workers/chunks/37a3533f004bf2e888da.js +1 -0
  35. package/assets/esri/core/workers/chunks/3be465c653236d6d8c1f.js +1 -0
  36. package/assets/esri/core/workers/chunks/3e4204502f6e09483c60.js +1 -0
  37. package/assets/esri/core/workers/chunks/3e9cd82325c473ddbf1f.js +1 -0
  38. package/assets/esri/core/workers/chunks/{370ab4b33fb7292bb3b8.js → 424e2058228e5f6a183d.js} +1 -1
  39. package/assets/esri/core/workers/chunks/4496ef270c700078df0c.js +1 -0
  40. package/assets/esri/core/workers/chunks/458f4c6c8820c1f62f69.js +1 -0
  41. package/assets/esri/core/workers/chunks/49c346d2fb8538990f45.js +1 -0
  42. package/assets/esri/core/workers/chunks/4bb65ef7b3a02ebe416e.js +1 -0
  43. package/assets/esri/core/workers/chunks/4c765464288b6d096d08.js +1 -0
  44. package/assets/esri/core/workers/chunks/4eb1a2433f675bde12ad.js +1 -0
  45. package/assets/esri/core/workers/chunks/4ffdff269aae8c293cb4.js +1 -0
  46. package/assets/esri/core/workers/chunks/55f7b1de8882569861c0.js +1 -0
  47. package/assets/esri/core/workers/chunks/564cc81c232c97646833.js +1 -0
  48. package/assets/esri/core/workers/chunks/5a6f7360183693f8490d.js +1 -0
  49. package/assets/esri/core/workers/chunks/5f8028928ae8e5d27dda.js +1 -0
  50. package/assets/esri/core/workers/chunks/{c03e6e35082beaec02a6.js → 5fa5bfc70512994f5ec1.js} +1 -1
  51. package/assets/esri/core/workers/chunks/605eddec7aac891ed141.js +1 -0
  52. package/assets/esri/core/workers/chunks/66cba22c09f595bba3bf.js +1 -0
  53. package/assets/esri/core/workers/chunks/6cb5ce0a6bb85c624a21.js +1 -0
  54. package/assets/esri/core/workers/chunks/{bf9b45604249520b596a.js → 74c01de62ccaed0666e0.js} +1 -1
  55. package/assets/esri/core/workers/chunks/7a4413a188a8f1affb2f.js +1 -0
  56. package/assets/esri/core/workers/chunks/{b66e8a48ce7098ca43d5.js → 7c3cd6aefd16fcc1a7fd.js} +1 -1
  57. package/assets/esri/core/workers/chunks/7e0e9ca84490a0c67197.js +1 -0
  58. package/assets/esri/core/workers/chunks/{3315de71eb8791189c05.js → 835fa4484c58d9b31c78.js} +1 -1
  59. package/assets/esri/core/workers/chunks/88a7780b1c689afff8bd.js +1 -0
  60. package/assets/esri/core/workers/chunks/8d636075e5aa053940fc.js +1 -0
  61. package/assets/esri/core/workers/chunks/{7ca33e03a2fd217b9443.js → 9dfdd8e91897d166d888.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{790f86ddf57be50e0dd5.js → 9ef509e0853ad41f7690.js} +1 -1
  63. package/assets/esri/core/workers/chunks/a2377969f76640f1d6fe.js +1 -0
  64. package/assets/esri/core/workers/chunks/aa3a45e8228216c1739b.js +1 -0
  65. package/assets/esri/core/workers/chunks/b2289c18c02c868a2939.js +1 -0
  66. package/assets/esri/core/workers/chunks/b5f44cf03c4e5cc07bc4.js +1 -0
  67. package/assets/esri/core/workers/chunks/b948fe33b4d650eea796.js +1 -0
  68. package/assets/esri/core/workers/chunks/bdeac9196f28aff93e68.js +1 -0
  69. package/assets/esri/core/workers/chunks/c591527543fd75a917d4.js +1 -0
  70. package/assets/esri/core/workers/chunks/{ca4af35af02e3804042e.js → c6580fdcdc33153008b0.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{fe8ee1938d196a70d809.js → ca0572fe5614005acceb.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{67c1e2c17ea3ca27248c.js → cbbbaccc0d3683e1c0fe.js} +1 -1
  73. package/assets/esri/core/workers/chunks/ccc6f6f7052985bebdab.js +1 -0
  74. package/assets/esri/core/workers/chunks/d72d993b36daf6ec2a10.js +1 -0
  75. package/assets/esri/core/workers/chunks/eb9d2bb8b44a93347274.js +1 -0
  76. package/assets/esri/core/workers/chunks/f809cbfb744adb4fad29.js +1 -0
  77. package/assets/esri/core/workers/chunks/fa011ad649c05201e92a.js +1 -0
  78. package/assets/esri/core/workers/chunks/fa7ddf3c89cdb8052b26.js +1 -0
  79. package/assets/esri/core/workers/chunks/fdc9bd8f309af610fa62.js +1 -0
  80. package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
  81. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +2 -2
  82. package/assets/esri/themes/dark/main.css +1 -1
  83. package/assets/esri/themes/light/main.css +1 -1
  84. package/assets/esri/themes/light/view.css +1 -1
  85. package/chunks/LineMarker.glsl.js +2 -2
  86. package/chunks/aiServices.js +5 -0
  87. package/chunks/array.js +1 -1
  88. package/chunks/languageUtils.js +1 -1
  89. package/copyright.txt +38 -0
  90. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  91. package/interfaces.d.ts +11 -3
  92. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  93. package/layers/graphics/data/AttributesBuilder.js +1 -1
  94. package/layers/graphics/data/QueryEngineResult.js +1 -1
  95. package/layers/graphics/data/queryValidationUtils.js +1 -1
  96. package/layers/graphics/editingSupport.js +1 -1
  97. package/layers/support/TitleCreator.js +1 -1
  98. package/layers/support/fieldUtils.js +1 -1
  99. package/layers/support/labelFormatUtils.js +1 -1
  100. package/libs/parquet/parquet.js +1 -1
  101. package/package.json +1 -1
  102. package/renderers/ClassBreaksRenderer.js +1 -1
  103. package/renderers/DictionaryRenderer.js +1 -1
  104. package/renderers/UniqueValueRenderer.js +1 -1
  105. package/renderers/support/DictionaryControlString.js +5 -0
  106. package/renderers/support/DictionaryLoader.js +1 -1
  107. package/renderers/support/DictionaryScriptEvaluator.js +5 -0
  108. package/rest/featureService/FeatureService.js +1 -1
  109. package/rest/print.js +1 -1
  110. package/rest/support/TranslateContent.js +5 -0
  111. package/rest/support/TranslateParameters.js +5 -0
  112. package/rest/support/TranslateResult.js +5 -0
  113. package/rest/translate.js +5 -0
  114. package/rest/utils.js +1 -1
  115. package/smartMapping/statistics/support/attributeDensity.js +1 -1
  116. package/smartMapping/statistics/support/utils.js +1 -1
  117. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  118. package/smartMapping/support/utils.js +1 -1
  119. package/support/ArcadeExpression.js +5 -0
  120. package/support/loadArcade.js +5 -0
  121. package/support/revision.js +1 -1
  122. package/symbols/cim/OverrideHelper.js +1 -1
  123. package/symbols/cim/cimAnalyzer.js +1 -1
  124. package/symbols/cim/utils.js +1 -1
  125. package/symbols/support/symbolUtils.js +1 -1
  126. package/views/2d/arcade/callExpressionWithCursor.js +1 -1
  127. package/views/2d/arcade/callExpressionWithFeature.js +1 -1
  128. package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
  129. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterInputEvaluator.js +1 -1
  130. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  131. package/views/2d/engine/webgl/util/DictionaryMatcher.js +1 -1
  132. package/views/2d/engine/webgl/util/MatcherContext.js +1 -1
  133. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  134. package/views/2d/layers/MediaLayerView2D.js +1 -1
  135. package/views/2d/layers/TileLayerView2D.js +1 -1
  136. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  137. package/views/2d/layers/features/Processor.js +1 -1
  138. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  139. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  140. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  141. package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
  142. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  143. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  144. package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
  145. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  146. package/views/2d/layers/features/support/ComputedAttributeStorage.js +1 -1
  147. package/views/2d/layers/features/support/ComputedExpression.js +1 -1
  148. package/views/2d/layers/features/support/DictionaryTemplate.js +5 -0
  149. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  150. package/views/3d/environment/EnvironmentManager.js +1 -1
  151. package/views/3d/environment/Precipitation.js +1 -1
  152. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  153. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  154. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  155. package/views/3d/layers/I3SMeshView3D.js +1 -1
  156. package/views/3d/layers/RouteLayerView3D.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  160. package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
  161. package/views/3d/layers/graphics/queryForSymbologySnapping.js +1 -1
  162. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  163. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  164. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  165. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  166. package/views/VideoView.js +1 -1
  167. package/views/layers/FeatureLayerView.js +1 -1
  168. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  169. package/views/overlay/CrosshairOverlayItem.js +1 -1
  170. package/views/support/projectionUtils.js +1 -1
  171. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  172. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  173. package/widgets/Editor/EditorViewModel.js +1 -1
  174. package/widgets/Editor/Edits.js +1 -1
  175. package/widgets/Editor/UpdateWorkflow.js +1 -1
  176. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  177. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  178. package/widgets/Editor/support/dependencySort.js +5 -0
  179. package/widgets/Editor/workflowUtils.js +1 -1
  180. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  181. package/widgets/Feature/FeatureRelationship.js +1 -1
  182. package/widgets/Feature/support/featureUtils.js +1 -1
  183. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  184. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  185. package/widgets/FeatureForm.js +1 -1
  186. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  187. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  188. package/widgets/Popup.js +1 -1
  189. package/widgets/Print.js +1 -1
  190. package/widgets/Sketch.js +1 -1
  191. package/assets/esri/core/workers/chunks/0121702bc9a1f3a85f1f.js +0 -1
  192. package/assets/esri/core/workers/chunks/05b7c739115be0490583.js +0 -1
  193. package/assets/esri/core/workers/chunks/0ce1bfcdcccb679569f8.js +0 -1
  194. package/assets/esri/core/workers/chunks/1007c1a908b6e503e0db.js +0 -1
  195. package/assets/esri/core/workers/chunks/1439f1d84e21e6295e3f.js +0 -1
  196. package/assets/esri/core/workers/chunks/1912d25f8007685c7aee.js +0 -1
  197. package/assets/esri/core/workers/chunks/1bd58eaac6f4906bbdae.js +0 -1
  198. package/assets/esri/core/workers/chunks/2c091edee3601f345f5f.js +0 -1
  199. package/assets/esri/core/workers/chunks/2e40f2527345ad85d800.js +0 -1
  200. package/assets/esri/core/workers/chunks/30f271bbc34f66cbfc23.js +0 -1
  201. package/assets/esri/core/workers/chunks/36b406131cd864567033.js +0 -1
  202. package/assets/esri/core/workers/chunks/4395b7263a299a8020d4.js +0 -1
  203. package/assets/esri/core/workers/chunks/4c15de6b2b8eefd76b61.js +0 -1
  204. package/assets/esri/core/workers/chunks/4c596cb20baaae5166de.js +0 -1
  205. package/assets/esri/core/workers/chunks/4d16b1e50caad0da7838.js +0 -1
  206. package/assets/esri/core/workers/chunks/5802406d0a239a27a9a3.js +0 -1
  207. package/assets/esri/core/workers/chunks/5c86df2a5e16877ba614.js +0 -1
  208. package/assets/esri/core/workers/chunks/62c9171a58160ea099f8.js +0 -1
  209. package/assets/esri/core/workers/chunks/6a4731b47629604a9ca0.js +0 -1
  210. package/assets/esri/core/workers/chunks/81c507c0d901448835f4.js +0 -1
  211. package/assets/esri/core/workers/chunks/8278d9263e9b7e3bf2d1.js +0 -1
  212. package/assets/esri/core/workers/chunks/8926f672397620591740.js +0 -1
  213. package/assets/esri/core/workers/chunks/8b057b5a606ac3669a78.js +0 -1
  214. package/assets/esri/core/workers/chunks/8bf623f560b1ed440004.js +0 -1
  215. package/assets/esri/core/workers/chunks/924176d9ab2e070248a8.js +0 -1
  216. package/assets/esri/core/workers/chunks/988efc508c33ca341e49.js +0 -1
  217. package/assets/esri/core/workers/chunks/98cbfc72430a378a9451.js +0 -1
  218. package/assets/esri/core/workers/chunks/9fde9309cb64f1a9301c.js +0 -1
  219. package/assets/esri/core/workers/chunks/a901c445d36f1a9e7df8.js +0 -1
  220. package/assets/esri/core/workers/chunks/ab525991f71240d68471.js +0 -1
  221. package/assets/esri/core/workers/chunks/af27a3f646a4404d3b8d.js +0 -1
  222. package/assets/esri/core/workers/chunks/b464b7800a2ddd92b9a7.js +0 -1
  223. package/assets/esri/core/workers/chunks/c15c3fec95f365580902.js +0 -1
  224. package/assets/esri/core/workers/chunks/c1e343cdf85da40ac10e.js +0 -1
  225. package/assets/esri/core/workers/chunks/c3806be4a760735e6082.js +0 -1
  226. package/assets/esri/core/workers/chunks/c3dc8d1958ddc71e1129.js +0 -1
  227. package/assets/esri/core/workers/chunks/c7b0f58550e63ce6ad5b.js +0 -1
  228. package/assets/esri/core/workers/chunks/ccf8a423eee7ef4ffe4c.js +0 -1
  229. package/assets/esri/core/workers/chunks/d24321b1eeabe9ec553c.js +0 -1
  230. package/assets/esri/core/workers/chunks/dd913cb7cf3bb172b34c.js +0 -1
  231. package/assets/esri/core/workers/chunks/e3e049311bced533c853.js +0 -1
  232. package/assets/esri/core/workers/chunks/e3e5a215dcd531b1196f.js +0 -1
  233. package/assets/esri/core/workers/chunks/f31986ea5cadfade8344.js +0 -1
  234. package/assets/esri/core/workers/chunks/f350aefc5e348ebad1da.js +0 -1
  235. package/support/arcadeOnDemand.js +0 -5
  236. package/views/3d/layers/support/projectExtentUtils.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.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/arcadeOnDemand.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a,AttributeDataType as n}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as o}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as l}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as h}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as d,DEBUG_ATTR_UPDATES as c}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as u}from"./DisplayIdGenerator.js";import p from"./FeatureFilterEvaluator.js";import{PixelType as g}from"../../../../webgl/enums.js";function _(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const y=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),m=d(c,y()),f={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};class b{constructor(t,e,i){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:r,textureOnly:a}=e;this.textureOnly=a||!1,this.pixelType=s,this.layout=r,this._resetRange(),this.size=t,this.isLocal=i,a||(this.data=this._initData(s,t))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=o(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=o(t),r=1<<e;this.layout&r?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):y().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!this.isLocal,r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e){const i=ArrayBuffer,s=l(t),r=new s(new i(e*e*4*s.BYTES_PER_ELEMENT));for(let a=0;a<r.length;a+=4)r[a+1]=255;return r}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class x{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=r,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new u,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=g.FLOAT;m(`Creating AttributeStore ${f.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:g.UNSIGNED_BYTE,layout:1},{pixelType:g.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:g.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:g.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,r=0){const a=i(this._schema,t);if(this.version=r,a&&(has("esri-2d-update-debug")&&console.debug(`Version[${r}] AttributeStore.update`,{changed:a}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map((t=>t?p.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null)))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map((async t=>{const i=await this._bind(e,t);this._updateReferences(i)})));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const i in t.bindings){const s=t.bindings[i];await Promise.all(s.map((async t=>{const s=await this._bind(e,t,parseInt(i,10));this._updateReferences(s)})))}}}setHighlight(t,e){const i=this._getBlock(0);i.unsetComponentAllTexels(0,(1<<a)-1);for(const{displayId:s,highlightFlags:r}of t){if(null==s)continue;const t=o(s);i.setComponent(0,r,[t])}this._idsToHighlight.clear();for(const{objectId:s,highlightFlags:r}of t)this._idsToHighlight.set(s,r);for(const{objectId:s,highlightFlags:r}of e)this._idsToHighlight.set(s,r)}setData(t,e,i,s){const r=o(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=o(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e,i,s){const r=o(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,s));const a=this._attributeComputeInfo,l=1,d=4;let c=null;a&&(c="multi"===a.type?a.map.get(e.readAttribute(a.keyField)):a.map,c?.size&&c.forEach(((t,s)=>{const a=s*l%d,o=Math.floor(s*l/d),c=this._getBlock(o+n.VV);let u=t.field?.read(e,i);t.valueRepresentation&&(u=_(u,t.valueRepresentation));(null===u||isNaN(u)||u===1/0||u===-1/0)&&(u=h),c.setData(r,a,u)})))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map((t=>null!=t?t.toMessage():null)),e=this._getInitArgs();has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,i){const s=await t.createComputedField(e),{valueRepresentation:r}=e,a=this._attributeComputeInfo;if("multi"===a.type){const t=a.map.get(i)??new Map;t.set(e.binding,{field:s,valueRepresentation:r}),a.map.set(i,t)}else a.map.set(e.binding,{field:s,valueRepresentation:r});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(n.Animation),this._getBlock(n.GPGPU),this._getBlock(n.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map((t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null))})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;m(`Initializing AttributeBlock at index ${t}`);const i=new b(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=i,this._initialized=!1,i}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;m("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return y().error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){s(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<a)}getFilterFlags(t,e){let i=0;for(let r=0;r<this._filters.length;r++){const s=!!(1<<r),a=this._filters[r];i|=(!s||null==a||a.check(t,e)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlags(e)}return i<<a|s}}export{x as AttributeStore,_ as getVisualVariableSizeValueRepresentationRatio};
5
+ import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a,AttributeDataType as n}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as o}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as l}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as h}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as d,DEBUG_ATTR_UPDATES as c}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as u}from"./DisplayIdGenerator.js";import p from"./FeatureFilterEvaluator.js";import{PixelType as g}from"../../../../webgl/enums.js";function _(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const y=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),m=d(c,y()),f={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};class b{constructor(t,e,i){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:r,textureOnly:a}=e;this.textureOnly=a||!1,this.pixelType=s,this.layout=r,this._resetRange(),this.size=t,this.isLocal=i,a||(this.data=this._initData(s,t))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=o(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=o(t),r=1<<e;this.layout&r?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):y().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!this.isLocal,r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e){const i=ArrayBuffer,s=l(t),r=new s(new i(e*e*4*s.BYTES_PER_ELEMENT));for(let a=0;a<r.length;a+=4)r[a+1]=255;return r}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class x{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=r,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new u,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=g.FLOAT;m(`Creating AttributeStore ${f.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:g.UNSIGNED_BYTE,layout:1},{pixelType:g.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:g.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:g.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,r=0){const a=i(this._schema,t);if(this.version=r,a&&(has("esri-2d-update-debug")&&console.debug(`Version[${r}] AttributeStore.update`,{changed:a}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map((t=>t?p.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null)))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map((async t=>{const i=await this._bind(e,t);this._updateReferences(i)})));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const i in t.bindings){const s=t.bindings[i];await Promise.all(s.map((async t=>{const s=await this._bind(e,t,parseInt(i,10));this._updateReferences(s)})))}}}setHighlight(t,e){const i=this._getBlock(0);i.unsetComponentAllTexels(0,(1<<a)-1);for(const{displayId:s,highlightFlags:r}of t){if(null==s)continue;const t=o(s);i.setComponent(0,r,[t])}this._idsToHighlight.clear();for(const{objectId:s,highlightFlags:r}of t)this._idsToHighlight.set(s,r);for(const{objectId:s,highlightFlags:r}of e)this._idsToHighlight.set(s,r)}setData(t,e,i,s){const r=o(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=o(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e,i,s){const r=o(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,s));const a=this._attributeComputeInfo,l=1,d=4;let c=null;a&&(c="multi"===a.type?a.map.get(e.readAttribute(a.keyField)):a.map,c?.size&&c.forEach(((t,s)=>{const a=s*l%d,o=Math.floor(s*l/d),c=this._getBlock(o+n.VV);let u=t.field?.read(e,i);t.valueRepresentation&&(u=_(u,t.valueRepresentation));(null===u||isNaN(u)||u===1/0||u===-1/0)&&(u=h),c.setData(r,a,u)})))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map((t=>null!=t?t.toMessage():null)),e=this._getInitArgs();has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,i){const s=await t.createComputedField(e),{valueRepresentation:r}=e,a=this._attributeComputeInfo;if("multi"===a.type){const t=a.map.get(i)??new Map;t.set(e.binding,{field:s,valueRepresentation:r}),a.map.set(i,t)}else a.map.set(e.binding,{field:s,valueRepresentation:r});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(n.Animation),this._getBlock(n.GPGPU),this._getBlock(n.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map((t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null))})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;m(`Initializing AttributeBlock at index ${t}`);const i=new b(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=i,this._initialized=!1,i}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;m("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return y().error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){s(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<a)}getFilterFlags(t,e){let i=0;for(let r=0;r<this._filters.length;r++){const s=!!(1<<r),a=this._filters[r];i|=(!s||null==a||a.check(t,e)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlags(e)}return i<<a|s}}export{x as AttributeStore,_ as getVisualVariableSizeValueRepresentationRatio};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Error.js";import e from"../../../../../core/Logger.js";import{fromRectValues as s}from"../../../../../geometry/support/aaBoundingBox.js";import{displayIdTexelMask as i}from"../../../engine/webgl/DisplayId.js";import{CachedField as r}from"./CachedField.js";import{ComputedExpression as n}from"./ComputedExpression.js";import{ComputedLegacyLabelExpression as o}from"./ComputedLegacyLabelExpression.js";import{NormalizedField as u}from"./NormalizedField.js";import{StaticBitSet as d}from"./StaticBitSet.js";import{createWhereClause as h}from"./whereUtils.js";const a=()=>e.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),c=4294967295;function m(t,e,s){if(!(t.length>e))for(;t.length<=e;)t.push(s)}class p{constructor(t){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=t}createBitset(){const t=this._bitsets.length;return this._bitsets.push(d.create(this._allocatedSize,i)),t+1}async createComputedField(e,s=!1){if(e.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");if(s)return await o.create(e.expression,this.compilationOptions);return await n.create(e.expression,this.compilationOptions)}catch(d){const s=new t("featurelayer","Failed to compile arcade expression",{error:d,expression:e.expression});return a().error(s),null}if(e.normalizationType||e.normalizationField)return new u(e.field,e);if(e.field)return new r(e.field);const i=new t("featurelayer","Unable to create computed field. No expression or field found",{info:e});return a().error(i),null}async createWhereClause(t){return t?h(t,this.compilationOptions.fields):null}getBitset(t){return this._bitsets[t-1]}getComputedNumeric(t,e){return this.getComputedNumericAtIndex(t&i,0)}setComputedNumeric(t,e,s){return this.setComputedNumericAtIndex(t&i,s,0)}getComputedString(t,e){return this.getComputedStringAtIndex(t&i,0)}setComputedString(t,e,s){return this.setComputedStringAtIndex(t&i,0,s)}getComputedNumericAtIndex(t,e){const s=t&i;return this._ensureNumeric(e,s),this._numerics[e][s]}setComputedNumericAtIndex(t,e,s){const r=t&i;this._ensureNumeric(e,r),this._numerics[e][r]=s}getPackedChunkId(t){const e=t&i;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(t,e){const s=t&i;this._ensureInstanceId(s),this._instanceIds[s]=e}getComputedStringAtIndex(t,e){const s=t&i;return this._ensureString(e,s),this._strings[e][s]}setComputedStringAtIndex(t,e,s){const r=t&i;this._ensureString(e,r),this._strings[e][r]=s}getXMin(t){return this._bounds[4*(t&i)]}getYMin(t){return this._bounds[4*(t&i)+1]}getXMax(t){return this._bounds[4*(t&i)+2]}getYMax(t){return this._bounds[4*(t&i)+3]}setBounds(t,e,s=!1){const r=t&i;if(!s&&!this._dirtyBitset.has(t))return this._bounds[4*r]!==c;this._dirtyBitset.unset(t);const n=e.readGeometryWorldSpace();if(m(this._bounds,4*r+4,0),!n||!n.coords.length)return this._bounds[4*r]=c,this._bounds[4*r+1]=c,this._bounds[4*r+2]=c,this._bounds[4*r+3]=c,!1;let o=1/0,u=1/0,d=-1/0,h=-1/0;return n.forEachVertex(((t,e)=>{o=Math.min(o,t),u=Math.min(u,e),d=Math.max(d,t),h=Math.max(h,e)})),this._bounds[4*r]=o,this._bounds[4*r+1]=u,this._bounds[4*r+2]=d,this._bounds[4*r+3]=h,!0}getBounds(t,e){const i=this.getXMin(e),r=this.getYMin(e),n=this.getXMax(e),o=this.getYMax(e);return s(t,i,r,n,o),i!==c}_ensureNumeric(t,e){this._numerics[t]||(this._numerics[t]=[]);m(this._numerics[t],e,0)}_ensureInstanceId(t){m(this._instanceIds,t,0)}_ensureString(t,e){this._strings[t]||(this._strings[t]=[]);m(this._strings[t],e,null)}}export{p as ComputedAttributeStorage};
5
+ import t from"../../../../../core/Error.js";import e from"../../../../../core/Logger.js";import{fromRectValues as s}from"../../../../../geometry/support/aaBoundingBox.js";import{displayIdTexelMask as i}from"../../../engine/webgl/DisplayId.js";import{CachedField as r}from"./CachedField.js";import{ComputedExpression as n}from"./ComputedExpression.js";import{ComputedLegacyLabelExpression as o}from"./ComputedLegacyLabelExpression.js";import{ComputedDictionaryTemplate as u}from"./DictionaryTemplate.js";import{NormalizedField as d}from"./NormalizedField.js";import{StaticBitSet as h}from"./StaticBitSet.js";import{createWhereClause as a}from"./whereUtils.js";const c=()=>e.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),m=4294967295;function p(t,e,s){if(!(t.length>e))for(;t.length<=e;)t.push(s)}class l{constructor(t){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=t}createBitset(){const t=this._bitsets.length;return this._bitsets.push(h.create(this._allocatedSize,i)),t+1}createDictionaryTemplateField(t,e){return new u(t,e)}async createComputedField(e,s=!1){if(e.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");if(s)return await o.create(e.expression,this.compilationOptions);return await n.create(e.expression,this.compilationOptions)}catch(u){const s=new t("featurelayer","Failed to compile arcade expression",{error:u,expression:e.expression});return c().error(s),null}if(e.normalizationType||e.normalizationField)return new d(e.field,e);if(e.field)return new r(e.field);const i=new t("featurelayer","Unable to create computed field. No expression or field found",{info:e});return c().error(i),null}async createWhereClause(t){return t?a(t,this.compilationOptions.fields):null}getBitset(t){return this._bitsets[t-1]}getComputedNumeric(t,e){return this.getComputedNumericAtIndex(t&i,0)}setComputedNumeric(t,e,s){return this.setComputedNumericAtIndex(t&i,s,0)}getComputedString(t,e){return this.getComputedStringAtIndex(t&i,0)}setComputedString(t,e,s){return this.setComputedStringAtIndex(t&i,0,s)}getComputedNumericAtIndex(t,e){const s=t&i;return this._ensureNumeric(e,s),this._numerics[e][s]}setComputedNumericAtIndex(t,e,s){const r=t&i;this._ensureNumeric(e,r),this._numerics[e][r]=s}getPackedChunkId(t){const e=t&i;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(t,e){const s=t&i;this._ensureInstanceId(s),this._instanceIds[s]=e}getComputedStringAtIndex(t,e){const s=t&i;return this._ensureString(e,s),this._strings[e][s]}setComputedStringAtIndex(t,e,s){const r=t&i;this._ensureString(e,r),this._strings[e][r]=s}getXMin(t){return this._bounds[4*(t&i)]}getYMin(t){return this._bounds[4*(t&i)+1]}getXMax(t){return this._bounds[4*(t&i)+2]}getYMax(t){return this._bounds[4*(t&i)+3]}setBounds(t,e,s=!1){const r=t&i;if(!s&&!this._dirtyBitset.has(t))return this._bounds[4*r]!==m;this._dirtyBitset.unset(t);const n=e.readGeometryWorldSpace();if(p(this._bounds,4*r+4,0),!n||!n.coords.length)return this._bounds[4*r]=m,this._bounds[4*r+1]=m,this._bounds[4*r+2]=m,this._bounds[4*r+3]=m,!1;let o=1/0,u=1/0,d=-1/0,h=-1/0;return n.forEachVertex(((t,e)=>{o=Math.min(o,t),u=Math.min(u,e),d=Math.max(d,t),h=Math.max(h,e)})),this._bounds[4*r]=o,this._bounds[4*r+1]=u,this._bounds[4*r+2]=d,this._bounds[4*r+3]=h,!0}getBounds(t,e){const i=this.getXMin(e),r=this.getYMin(e),n=this.getXMax(e),o=this.getYMax(e);return s(t,i,r,n,o),i!==m}_ensureNumeric(t,e){this._numerics[t]||(this._numerics[t]=[]);p(this._numerics[t],e,0)}_ensureInstanceId(t){p(this._instanceIds,t,0)}_ensureString(t,e){this._strings[t]||(this._strings[t]=[]);p(this._strings[t],e,null)}}export{l as ComputedAttributeStorage};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{numericHash as e}from"../../../../../core/string.js";import{createRendererExpression as t}from"../../../../../support/arcadeOnDemand.js";import{callExpressionWithCursor as r,callExpressionWithCursorWithDefault as a}from"../../../arcade/callExpressionWithCursor.js";import{AComputedField as s}from"./AComputedField.js";function c(e,t){const r=43758.5453*Math.sin(12.9898*e+78.233*t);return r-Math.floor(r)}class i extends s{static async create(r,a){const s=await t(r,a.spatialReference,a.fields),c=e(r);return new i(s,c)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.hasArcadeDependency("scale")||"system"!==t.$view.timeZone?r(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.hasArcadeDependency("scale")||"system"!==t.$view.timeZone?a(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}hasArcadeDependency(e){return this._compiled?.references(e)??!1}_getCacheKey(e){if(!this._compiled?.references("timeProperties"))return this._cacheKey;const{currentStart:t,currentEnd:r}=e.$view.timeProperties;return this._cacheKey+c(t??1,r??1)}_readCached(e,t){if(e.setCache(this._getCacheKey(t)),e.hasCachedValue())return e.getCachedValue();const a=r(this._compiled,e,t);return e.setCachedValue(a),a}_readWithDefaultCached(e,t,r){if(e.setCache(this._getCacheKey(t)),e.hasCachedValue())return e.getCachedValue();const s=a(this._compiled,e,t,r);return e.setCachedValue(s),s}}export{i as ComputedExpression};
5
+ import{numericHash as e}from"../../../../../core/string.js";import{createRendererExpression as t}from"../../../../../support/ArcadeExpression.js";import{callExpressionWithCursor as r,callExpressionWithCursorWithDefault as s}from"../../../arcade/callExpressionWithCursor.js";import{AComputedField as a}from"./AComputedField.js";function c(e,t){const r=43758.5453*Math.sin(12.9898*e+78.233*t);return r-Math.floor(r)}class i extends a{static async create(r,s){const a=await t(r,s.spatialReference),c=e(r);return new i(a,c)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.hasArcadeDependency("scale")||"system"!==t.$view.timeZone?r(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.hasArcadeDependency("scale")||"system"!==t.$view.timeZone?s(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}hasArcadeDependency(e){return this._compiled?.references(e)??!1}_getCacheKey(e){if(!this._compiled?.references("timeProperties"))return this._cacheKey;const{currentStart:t,currentEnd:r}=e.$view.timeProperties;return this._cacheKey+c(t??1,r??1)}_readCached(e,t){if(e.setCache(this._getCacheKey(t)),e.hasCachedValue())return e.getCachedValue();const s=r(this._compiled,e,t);return e.setCachedValue(s),s}_readWithDefaultCached(e,t,r){if(e.setCache(this._getCacheKey(t)),e.hasCachedValue())return e.getCachedValue();const a=s(this._compiled,e,t,r);return e.setCachedValue(a),a}}export{i as ComputedExpression};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{analyzeTextParts as t,getTextValuesFromFeatureHandle as e}from"../../../../../symbols/cim/utils.js";import{AComputedField as s}from"./AComputedField.js";class r extends s{constructor(e,s){super(),this._template=e,this._parts=t(e.template,s)}resize(t){}read(t,s){return e(t,this._parts,this._template.textCase)}readWithDefault(t,s,r){return e(t,this._parts,this._template.textCase)}hasArcadeDependency(t){return!1}}export{r as ComputedDictionaryTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import r from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonUtils.js";import g from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as f,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPolylineSymbol2D as b,errorPolygonSymbol2D as w,errorPointSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as M}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as R}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createStorageSchema as j}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as x}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as U}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as C}from"../features/support/FeatureMetadata.js";import{GraphicsReader as q}from"../features/support/GraphicsReader.js";import G from"./GraphicStore.js";import{FeatureCommandQueue as k}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as P}from"../support/UpdateTracking2D.js";class F{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new F(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new F(e,s);for(const i of t)r.append(i);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||(this._reader=q.from(this.addedOrModified,this.tile,this.metadata)),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let O=class extends(r.IdentifiableMixin(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new P({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new k({process:e=>{if("update"===e.type)return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new U({spatialReference:this.view.spatialReference,fields:new g}),this._attributeStore=new x({isLocal:!0,update:e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=j(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=C.createGraphics(this.view.spatialReference),this._resourceProxy=new M({fetch:e=>Promise.all(e.map((e=>this.view.stage.textureManager.rasterizeItem(e)))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([n((()=>this._effectiveRenderer),(()=>this._pushUpdate())),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",(()=>{this.addHandles([this.graphics.on("change",(()=>this._pushUpdate()))]),this._graphicStore?.destroy(),this._graphicStore=new G(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()}))]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return has("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:r}=this.view.state,i=this._graphicStore.hitTest(e.x,e.y,2,t,r),o=new Set(i),a=this.graphics.items.reduce(((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e)),new Map);return i.map((e=>a.get(e))).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:s,highlightFlags:r}of e){const e=this._graphicStore.getItem(s)?.displayId;t.push({objectId:s,highlightFlags:r,displayId:e})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const e=await this._graphicStore.update(this.graphics,(e=>this._getSymbolForGraphic(e)),(e=>this._ensureSymbolResource(e)));for(const s of e.updated)this.container.restartAnimation(s.objectId);if(!e.hasAnyUpdate())return void this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){F.getOrCreate(r,t,this._metadata).append(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const i of e){F.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){F.getOrCreate(i,t,this._metadata).append(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){F.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _densifyItemsForDisplay(e){const t=new Map;for(const s of e)for(const e of s.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){const t={timeZone:null,timeExtent:null};for(const{tile:s,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${s.id}] GraphicsView fetchResources`,e);const i=r.getCursor();for(;i.next();)for(const e of i.getMeshWriters())e.enqueueRequest(this._resourceProxy,i,s.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){const t={timeZone:null,timeExtent:null},s=new T(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());for(const i of r.getMeshWriters())i.write(s,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(t),e.tile.level);s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id}}_setFilterState(e){const t=e.displayId,s=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,s|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter((e=>"text"===e.type));if(s.length>0){const r=await this._getTextResources(e,s);e.symbolResource={symbolInfo:t,textInfo:r}}else e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch((e=>null))),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r)}}async _convertToCIMSymbol(e){const t=f(e);if("web-style"===t.type){return(await t.fetchCIMSymbol()).data}return t}async _createLinearCIM(e){return await Promise.all(y.fetchResources(e.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const s=this.container.instanceStore,r=this.view.stage.meshWriterRegistry,i=await R(e,t,s);return Promise.all(i.map((e=>r.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e))))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.addPromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new v(e,s,t[0],t[3]);return this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=F.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return l(t)?b:p(t)||u(t)?w:this.defaultPointSymbolEnabled?S:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then((e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""})),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map((e=>this.view.stage.textureManager.rasterizeItem(e))),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],O.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],O.prototype,"layerId",void 0),e([h({constructOnly:!0})],O.prototype,"requestUpdateCallback",void 0),e([h()],O.prototype,"container",void 0),e([h({constructOnly:!0})],O.prototype,"graphics",void 0),e([h()],O.prototype,"renderer",void 0),e([h()],O.prototype,"_updateTracking",void 0),e([h()],O.prototype,"updating",null),e([h()],O.prototype,"view",void 0),e([h()],O.prototype,"updateRequested",void 0),e([h()],O.prototype,"defaultPointSymbolEnabled",void 0),O=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],O);const A=O;export{A as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import r from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonUtils.js";import g from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as f,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPolylineSymbol2D as b,errorPolygonSymbol2D as w,errorPointSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as M}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as R}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createStorageSchema as j}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as x}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as U}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as C}from"../features/support/FeatureMetadata.js";import{GraphicsReader as q}from"../features/support/GraphicsReader.js";import G from"./GraphicStore.js";import{FeatureCommandQueue as k}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as P}from"../support/UpdateTracking2D.js";class F{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new F(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new F(e,s);for(const i of t)r.append(i);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||(this._reader=q.from(this.addedOrModified,this.tile,this.metadata)),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let O=class extends(r.IdentifiableMixin(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new P({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new k({process:e=>{if("update"===e.type)return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new U({spatialReference:this.view.spatialReference,fields:new g}),this._attributeStore=new x({isLocal:!0,update:e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=j(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=C.createGraphics(this.view.spatialReference),this._resourceProxy=new M({fetch:e=>Promise.all(e.map((e=>this.view.stage.textureManager.rasterizeItem(e)))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([n((()=>this._effectiveRenderer),(()=>this._pushUpdate())),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",(()=>{this.addHandles([this.graphics.on("change",(()=>this._pushUpdate()))]),this._graphicStore?.destroy(),this._graphicStore=new G(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()}))]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return has("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:r}=this.view.state,i=this._graphicStore.hitTest(e.x,e.y,2,t,r),o=new Set(i),a=this.graphics.items.reduce(((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e)),new Map);return i.map((e=>a.get(e))).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:s,highlightFlags:r}of e){const e=this._graphicStore.getItem(s)?.displayId;t.push({objectId:s,highlightFlags:r,displayId:e})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const e=await this._graphicStore.update(this.graphics,(e=>this._getSymbolForGraphic(e)),(e=>this._ensureSymbolResource(e)));for(const s of e.updated)this.container.restartAnimation(s.objectId);if(!e.hasAnyUpdate())return void this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){F.getOrCreate(r,t,this._metadata).append(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const i of e){F.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){F.getOrCreate(i,t,this._metadata).append(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){F.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _densifyItemsForDisplay(e){const t=new Map;for(const s of e)for(const e of s.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){const t={timeZone:null,timeExtent:null};for(const{tile:s,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${s.id}] GraphicsView fetchResources`,e);const i=r.getCursor();for(;i.next();)for(const e of i.getMeshWriters())e.enqueueRequest(this._resourceProxy,i,s.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){const t={timeZone:null,timeExtent:null},s=new T(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());for(const i of r.getMeshWriters())i.write(s,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(t),e.tile.level);s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id}}_setFilterState(e){const t=e.displayId,s=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,s|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter((e=>"text"===e.type));if(s.length>0){const r=await this._getTextResources(e,s);e.symbolResource={symbolInfo:t,textInfo:r}}else e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch((e=>null))),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r)}}async _convertToCIMSymbol(e){const t=f(e);if("web-style"===t.type){return(await t.fetchCIMSymbol()).data}return t}async _createLinearCIM(e){return await Promise.all(y.fetchResources(e.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const s=this.container.instanceStore,r=this.view.stage.meshWriterRegistry,i=await R(e,t,s);return Promise.all(i.map((e=>r.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null))))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.addPromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new v(e,s,t[0],t[3]);return this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=F.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return l(t)?b:p(t)||u(t)?w:this.defaultPointSymbolEnabled?S:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then((e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""})),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map((e=>this.view.stage.textureManager.rasterizeItem(e))),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],O.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],O.prototype,"layerId",void 0),e([h({constructOnly:!0})],O.prototype,"requestUpdateCallback",void 0),e([h()],O.prototype,"container",void 0),e([h({constructOnly:!0})],O.prototype,"graphics",void 0),e([h()],O.prototype,"renderer",void 0),e([h()],O.prototype,"_updateTracking",void 0),e([h()],O.prototype,"updating",null),e([h()],O.prototype,"view",void 0),e([h()],O.prototype,"updateRequested",void 0),e([h()],O.prototype,"defaultPointSymbolEnabled",void 0),O=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],O);const A=O;export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as n,when as r,sync as o,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{h as l,c,m as g}from"../../../chunks/vec32.js";import{create as d,fromValues as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoadedOrLoadFor as m}from"../../../geometry/projection.js";import u from"../../../geometry/SpatialReference.js";import{projectPointToVector as _}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as v}from"../../../geometry/support/planetGCSUtils.js";import{isEarth as f}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as w}from"../../ViewingMode.js";import{EnvironmentRenderer as b}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as y}from"../support/earthUtils.js";import{ColorAndIntensity as P,computeColorAndIntensity as j,computeVirtualLightDirection as T,computeShadowsEnabled as L}from"../support/sunUtils.js";import{Update as E}from"../webgl-engine/lib/Update.js";import{MainLight as S,AmbientLight as G,FillLight as U}from"../webgl-engine/lighting/Lightsources.js";let H=class extends t.EventedAccessor{constructor(){super(),this._tmpLightParameters=new P,this._defaultLightParameters=new P,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey="viewHandles",this._trackingEnabled=!1,this._mainLight=new S,this._ambientLight=new G,this._moonLight=new U,this._disableProjectionEngineAutoLoad=!1,this._disableWeather=!1,this._renderer=null,this._referencePositionGeographic=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!!this._renderer?.updating||!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&this._view?.state?.viewingMode===w.Global&&f(this._view.spatialReference)}get _weatherAvailable(){return this.weatherEnabled&&this._renderer?.weatherAvailable}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){const e=this._view?.stateManager?.camera?.position?.spatialReference??u.WGS84,t=v(e);return this._disableProjectionEngineAutoLoad||m(e,t)}connectView(e){if(this._renderer)return;this._renderer=new b({view:e});const t=()=>this._updateRenderParameters(),i=()=>this._cameraHandler();this.addHandles([n((()=>e.environment.lighting),(e=>this._updateLightingHandler(e)),o),n((()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null),(e=>this._lightingDateHandler(e)),o),n((()=>e.environment.lighting.directShadowsEnabled),t,o),n((()=>e.qualitySettings.ambientOcclusion),t,o),n((()=>e.qualitySettings.reflections),t,o),n((()=>e.spatialReference),(()=>this._resetReferencePosition(!0)),o),n((()=>[e.environment.weather.type,this.weatherEnabled]),(()=>this._updateLighting(null,E.FadeWithWeather)),o),n((()=>e.environment),(e=>e.setComputeWeatherAvailable((()=>this._weatherAvailable))),s),n((()=>e.viewingMode),(()=>this._resetReferencePosition(!0)),s),n((()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled),(e=>this._updateCameraTracking(e)),s),n((()=>e.state.camera),i,s),r((()=>this._canProjectCameraPosition),i,o)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=i(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),null!=this._referencePositionGeographic)){const e=y(this._referencePositionGeographic,this._tmpTz);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const i=t.stateManager.camera;if(!i)return;const{position:n}=i,r=n.spatialReference??u.WGS84,o=v(r),s=this._referencePositionGeographic??d();if(!_(n,s,o))return this._referencePositionGeographic=null,void this._updateLighting();this._referencePositionGeographic=s,this.notifyChange("referencePositionGeographic"),this._autoUpdateTimezone(s,e)||this._updateLighting(e)}_updateLighting(e,t=E.Immediate){const i=this._view,{lighting:n}=i.environment,r="virtual"===n.type,o=this._referencePositionGeographic,s=null!=o?this._tmpLightParameters:this._defaultLightParameters;if(o){e??=r?null:n.date;const t=this._weatherAvailable?i.environment.weather.type:"disabled";j(e,o,i.state.viewingMode,t,i.state.camera,s)}else r&&T(i.state.camera,i.state.viewingMode,s.direct.directionToLightSource);const a=this._mainLight,h=s.direct;l(a.intensity,h.color,h.intensity*Math.PI),c(a.direction,h.directionToLightSource),a.specularStrength=s.specularStrength,a.environmentStrength=s.environmentStrength;const d=this._ambientLight;l(d.intensity,s.ambient.color,s.ambient.intensity);const p=this._moonLight;g(p.intensity,C,R,s.globalFactor);const m=(1-.5*s.globalFactor)*(1-.4*s.noonFactor*(1-s.globalFactor));l(p.intensity,p.intensity,m),c(p.direction,h.directionToLightSource),this._view._stage?.renderer.updateLighting([a,d,p],s.noonFactor,s.globalFactor,t),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const i=this._tmpDate;i.setTime((t||this._view.environment.lighting.date).getTime());const n=y(e,this._tmpTz);if(null==n)return!1;let r=this._view.environment.lighting.positionTimezoneInfo;if(r.autoUpdated){if(r.hours===n.hours&&r.minutes===n.minutes&&r.seconds===n.seconds)return!1}else r=n;const o=i.getUTCHours()-(n.hours-r.hours),s=i.getUTCMinutes()-(n.minutes-r.minutes),a=i.getUTCSeconds()-(n.seconds-r.seconds);return i.setUTCHours(o),i.setUTCMinutes(s),i.setUTCSeconds(a),!t&&this._view.environment.lighting.autoUpdate(i,n)}_updateRenderParameters(){const e=this._view._stage;if(!e)return;const t=null==this._referencePositionGeographic||L(this._referencePositionGeographic[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._weatherAvailable,qualitySettings:this._view.qualitySettings})}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}get test(){}};e([a({type:Boolean,readOnly:!0})],H.prototype,"updating",null),e([a()],H.prototype,"_disableProjectionEngineAutoLoad",void 0),e([a()],H.prototype,"_disableWeather",void 0),e([a()],H.prototype,"weatherEnabled",null),e([a()],H.prototype,"_weatherAvailable",null),e([a()],H.prototype,"referencePositionGeographic",null),e([a()],H.prototype,"_renderer",void 0),e([a()],H.prototype,"_referencePositionGeographic",void 0),e([a()],H.prototype,"_canProjectCameraPosition",null),H=e([h("esri.views.3d.environment.EnvironmentManager")],H);const C=p(.22,.22,.33),R=p(.22,.22,.22);export{H as EnvironmentManager};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Evented.js";import"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{watch as n,when as r,sync as o,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{h as l,c,m as g}from"../../../chunks/vec32.js";import{create as d,fromValues as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoadedOrLoadFor as p}from"../../../geometry/projection.js";import u from"../../../geometry/SpatialReference.js";import{projectPointToVector as _}from"../../../geometry/projection/projectPointToVector.js";import{getGCSForPlanet as v}from"../../../geometry/support/planetGCSUtils.js";import{isEarth as f}from"../../../geometry/support/spatialReferenceUtils.js";import{ViewingMode as w}from"../../ViewingMode.js";import{EnvironmentRenderer as b}from"./EnvironmentRenderer.js";import{positionToTimezoneInfo as y}from"../support/earthUtils.js";import{ColorAndIntensity as P,computeColorAndIntensity as j,computeVirtualLightDirection as T,computeShadowsEnabled as L}from"../support/sunUtils.js";import{Update as E}from"../webgl-engine/lib/Update.js";import{MainLight as S,AmbientLight as G,FillLight as U}from"../webgl-engine/lighting/Lightsources.js";let H=class extends t.EventedAccessor{constructor(){super(),this._tmpLightParameters=new P,this._defaultLightParameters=new P,this._tmpDate=new Date,this._tmpTz={hours:0,minutes:0,seconds:0},this._viewHandlesKey="viewHandles",this._trackingEnabled=!1,this._mainLight=new S,this._ambientLight=new G,this._moonLight=new U,this._disableProjectionEngineAutoLoad=!1,this._disableWeather=!1,this._renderer=null,this._referencePositionGeographic=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){return this._renderer?.view}get updating(){return!!this._renderer?.updating||!this._canProjectCameraPosition}get weatherEnabled(){return this._view?.environment.atmosphereEnabled&&!this._disableWeather&&this._view?.state?.viewingMode===w.Global&&f(this._view.spatialReference)}get _weatherAvailable(){return this.weatherEnabled&&this._renderer?.weatherAvailable}get referencePositionGeographic(){return this._referencePositionGeographic}get _canProjectCameraPosition(){const e=this._view?.stateManager?.camera?.position?.spatialReference??u.WGS84,t=v(e);return this._disableProjectionEngineAutoLoad||p(e,t)}connectView(e){if(this._renderer)return;this._renderer=new b({view:e});const t=()=>this._updateRenderParameters(),i=()=>this._cameraHandler();this.addHandles([n((()=>e.environment.lighting),(e=>this._updateLightingHandler(e)),o),n((()=>"virtual"!==e.environment.lighting.type?e.environment.lighting.date:null),(e=>this._lightingDateHandler(e)),o),n((()=>e.environment.lighting.directShadowsEnabled),t,o),n((()=>e.qualitySettings.ambientOcclusion),t,o),n((()=>e.qualitySettings.reflections),t,o),n((()=>e.spatialReference),(()=>this._resetReferencePosition(!0)),o),n((()=>[e.environment.weather.type,this.weatherEnabled]),(()=>this._updateLighting(null,E.FadeWithWeather)),o),n((()=>e.environment),(e=>e.setComputeWeatherAvailable((()=>this._weatherAvailable))),s),n((()=>e.viewingMode),(()=>this._resetReferencePosition(!0)),s),n((()=>"virtual"!==e.environment.lighting.type&&e.environment.lighting.cameraTrackingEnabled),(e=>this._updateCameraTracking(e)),s),n((()=>e.state.camera),i,s),r((()=>this._canProjectCameraPosition),i,o)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=i(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking("virtual"!==e.type&&e.cameraTrackingEnabled),this._lightingDateHandler("virtual"!==e.type?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const e=this._view.environment.lighting;"virtual"!==e?.type&&(e.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const t=this._view.environment.lighting;if("virtual"!==t?.type){if(e){if(!t.positionTimezoneInfo.autoUpdated&&(this._preupdateTracking(e),null!=this._referencePositionGeographic)){const e=y(this._referencePositionGeographic,this._tmpTz);null!=e&&(t.autoUpdate(null,e),this._trackingEnabled&&(t.positionTimezoneInfo.autoUpdated=!0))}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&"virtual"!==this._view.environment.lighting.type&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const t=this._view;if(!t.ready)return;const i=t.stateManager.camera;if(!i)return;const{position:n}=i,r=n.spatialReference??u.WGS84,o=v(r),s=this._referencePositionGeographic??d();if(!_(n,s,o))return this._referencePositionGeographic=null,void this._updateLighting();this._referencePositionGeographic=s,this.notifyChange("referencePositionGeographic"),this._autoUpdateTimezone(s,e)||this._updateLighting(e)}_updateLighting(e,t=E.Immediate){const i=this._view,{lighting:n}=i.environment,r="virtual"===n.type,o=this._referencePositionGeographic,s=null!=o?this._tmpLightParameters:this._defaultLightParameters;if(o){e??=r?null:n.date;const t=this._weatherAvailable?i.environment.weather.type:"disabled";j(e,o,i.state.viewingMode,t,i.state.camera,s)}else r&&T(i.state.camera,i.state.viewingMode,s.direct.directionToLightSource);const a=this._mainLight,h=s.direct;l(a.intensity,h.color,h.intensity*Math.PI),c(a.direction,h.directionToLightSource),a.specularStrength=s.specularStrength,a.environmentStrength=s.environmentStrength;const d=this._ambientLight;l(d.intensity,s.ambient.color,s.ambient.intensity);const m=this._moonLight;g(m.intensity,C,R,s.globalFactor);const p=(1-.5*s.globalFactor)*(1-.4*s.noonFactor*(1-s.globalFactor));l(m.intensity,m.intensity,p),c(m.direction,h.directionToLightSource),this._view._stage?.renderer.updateLighting([a,d,m],s.noonFactor,s.globalFactor,this._weatherAvailable?t:E.Immediate),this._updateRenderParameters()}_autoUpdateTimezone(e,t=null){if("virtual"===this._view.environment.lighting.type||!this._view.environment.lighting.cameraTrackingEnabled||null==e)return!1;const i=this._tmpDate;i.setTime((t||this._view.environment.lighting.date).getTime());const n=y(e,this._tmpTz);if(null==n)return!1;let r=this._view.environment.lighting.positionTimezoneInfo;if(r.autoUpdated){if(r.hours===n.hours&&r.minutes===n.minutes&&r.seconds===n.seconds)return!1}else r=n;const o=i.getUTCHours()-(n.hours-r.hours),s=i.getUTCMinutes()-(n.minutes-r.minutes),a=i.getUTCSeconds()-(n.seconds-r.seconds);return i.setUTCHours(o),i.setUTCMinutes(s),i.setUTCSeconds(a),!t&&this._view.environment.lighting.autoUpdate(i,n)}_updateRenderParameters(){const e=this._view._stage;if(!e)return;const t=null==this._referencePositionGeographic||L(this._referencePositionGeographic[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&t,environment:this._view.environment,weatherVisible:this._weatherAvailable,qualitySettings:this._view.qualitySettings})}_resetReferencePosition(e=!1){this._referencePositionGeographic=null,e&&this._cameraHandler()}get test(){}};e([a({type:Boolean,readOnly:!0})],H.prototype,"updating",null),e([a()],H.prototype,"_disableProjectionEngineAutoLoad",void 0),e([a()],H.prototype,"_disableWeather",void 0),e([a()],H.prototype,"weatherEnabled",null),e([a()],H.prototype,"_weatherAvailable",null),e([a()],H.prototype,"referencePositionGeographic",null),e([a()],H.prototype,"_renderer",void 0),e([a()],H.prototype,"_referencePositionGeographic",void 0),e([a()],H.prototype,"_canProjectCameraPosition",null),H=e([h("esri.views.3d.environment.EnvironmentManager")],H);const C=m(.22,.22,.33),R=m(.22,.22,.22);export{H as EnvironmentManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as s,syncAndInitial as i,sync as o}from"../../../core/reactiveUtils.js";import{secondsFromMilliseconds as a}from"../../../core/time.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../webgl.js";import{PrecipitationPassParameters as d,PrecipitationTechnique as h}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as u,PrecipitationType as l}from"./PrecipitationTechniqueConfiguration.js";import{glLayout as f}from"../support/buffer/glUtil.js";import{newLayout as _}from"../support/buffer/InterleavedLayout.js";import y from"../webgl/RenderNode.js";import{RenderRequestType as b}from"../webgl-engine/lib/basicInterfaces.js";import{VertexArrayObject as g}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as j}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as A}from"../../webgl/BufferObject.js";import{PrimitiveType as P,Usage as T}from"../../webgl/enums.js";import{bindVertexBufferLayout as w,unbindVertexBufferLayout as I}from"../../webgl/Util.js";let N=class extends y{constructor(e){super(e),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new d,this._configuration=new u;const{view:t,type:r}=e;this._configuration.type="rainy"===r?l.Rain:l.Snow,t._stage.renderView.techniques.precompile(h,this._configuration),this._passParameters.time=0,this._passParameters.radius=p(t.spatialReference).radius,this.addHandles(s((()=>t.environment.weather),(e=>{e.type===r&&this.addHandles(s((()=>e.precipitation),(e=>this._adjustParticles(e)),i))}),i)),this.addHandles(s((()=>t._stage?.renderer.renderContext.bind.clouds.fadeFactor??1),(e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(s((()=>t._stage?.renderer.renderContext.bind.clouds.opacity??1),(e=>this._passParameters.opacity=e),i),"opacity"))}),o),"opacity")}_adjustParticles(e){const r=.35,s=e<.5?t(0,r,2*e):t(r,1,2*(e-.5));this._numParticles=v*s}destroy(){this._numParticles=0,this._vao=r(this._vao),this._instanceIdBuffer=r(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(s((()=>this.renderContext?.bind.clouds.fadeFactor??1),(t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())})),"opacity")}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*a(e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}render(e){const t=this.renderingContext;this._instanceIdBuffer??=this._createInstanceIndices(t);const r=Math.round(this._numParticles*this._passParameters.opacity),s=e.find((({name:e})=>e===m.TRANSPARENT_ENVIRONMENT));if(r<1)return s;const i=this.techniques.get(h,this._configuration);if(!i.compiled)return this.requestRender(b.UPDATE),s;const o=t.bindTechnique(i,this.bindParameters,this._passParameters);return this._vao??=R(t,i.locations),t.bindVAO(this._vao),o.assertCompatibleVertexAttributeLocations(this._vao),w(t,i.locations,this._instanceIdBuffer,S,0),t.drawArraysInstanced(P.TRIANGLES,0,3,r),I(t,i.locations,this._instanceIdBuffer,S),s}_createInstanceIndices(e){const t=[];for(let r=0;r<v;r++)t.push(r);return A.createVertex(e,T.STATIC_DRAW,new Float32Array(t))}};function R(e,t){const r=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new g(e,t,new Map([["geometry",f(E)]]),new Map([["geometry",A.createVertex(e,T.STATIC_DRAW,r)]]))}e([n()],N.prototype,"consumes",void 0),e([n()],N.prototype,"produces",void 0),e([n({constructOnly:!0})],N.prototype,"type",void 0),N=e([c("esri.views.3d.environment.Precipitation")],N);const v=25e4,E=_().vec3f(j.POSITION),S=f(_().f32(j.INSTANCEFEATUREATTRIBUTE),1);export{N as Precipitation};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as s,syncAndInitial as i,sync as o}from"../../../core/reactiveUtils.js";import{secondsFromMilliseconds as a}from"../../../core/time.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../webgl.js";import{PrecipitationPassParameters as d,PrecipitationTechnique as h}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as u,PrecipitationType as l}from"./PrecipitationTechniqueConfiguration.js";import{glLayout as f}from"../support/buffer/glUtil.js";import{newLayout as _}from"../support/buffer/InterleavedLayout.js";import y from"../webgl/RenderNode.js";import{RenderRequestType as b}from"../webgl-engine/lib/basicInterfaces.js";import{VertexArrayObject as g}from"../webgl-engine/lib/VertexArrayObject.js";import{VertexAttribute as A}from"../webgl-engine/lib/VertexAttribute.js";import{BufferObject as T}from"../../webgl/BufferObject.js";import{PrimitiveType as j,Usage as P}from"../../webgl/enums.js";import{bindVertexBufferLayout as N,unbindVertexBufferLayout as w}from"../../webgl/Util.js";let I=class extends y{constructor(e){super(e),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new d,this._configuration=new u;const{view:t,type:r}=e;this._configuration.type="rainy"===r?l.Rain:l.Snow,t._stage.renderView.techniques.precompile(h,this._configuration),this._passParameters.time=0,this._passParameters.radius=p(t.spatialReference).radius,this.addHandles([s((()=>t.environment.weather),(e=>{e.type===r&&this.addHandles(s((()=>e.precipitation),(e=>this._adjustParticles(e)),i))}),i),s((()=>t.environment.atmosphereEnabled),(e=>{this.produces=e?m.TRANSPARENT_ENVIRONMENT:"disabled",t._stage?.renderView.requestRender(b.UPDATE)}),i)]),this.addHandles(s((()=>t._stage?.renderer.renderContext.bind.clouds.fadeFactor??1),(e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(s((()=>t._stage?.renderer.renderContext.bind.clouds.opacity??1),(e=>this._passParameters.opacity=e),i),"opacity"))}),o),"opacity")}_adjustParticles(e){const r=.35,s=e<.5?t(0,r,2*e):t(r,1,2*(e-.5));this._numParticles=E*s}destroy(){this._numParticles=0,this._vao=r(this._vao),this._instanceIdBuffer=r(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(s((()=>this.renderContext?.bind.clouds.fadeFactor??1),(t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())})),"opacity")}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*a(e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}render(e){const t=this.renderingContext;this._instanceIdBuffer??=this._createInstanceIndices(t);const r=Math.round(this._numParticles*this._passParameters.opacity),s=e.find((({name:e})=>e===m.TRANSPARENT_ENVIRONMENT));if(r<1)return s;const i=this.techniques.get(h,this._configuration);if(!i.compiled)return this.requestRender(b.UPDATE),s;const o=t.bindTechnique(i,this.bindParameters,this._passParameters);return this._vao??=R(t,i.locations),t.bindVAO(this._vao),o.assertCompatibleVertexAttributeLocations(this._vao),N(t,i.locations,this._instanceIdBuffer,S,0),t.drawArraysInstanced(j.TRIANGLES,0,3,r),w(t,i.locations,this._instanceIdBuffer,S),s}_createInstanceIndices(e){const t=[];for(let r=0;r<E;r++)t.push(r);return T.createVertex(e,P.STATIC_DRAW,new Float32Array(t))}};function R(e,t){const r=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new g(e,t,new Map([["geometry",f(v)]]),new Map([["geometry",T.createVertex(e,P.STATIC_DRAW,r)]]))}e([n()],I.prototype,"consumes",void 0),e([n()],I.prototype,"produces",void 0),e([n({constructOnly:!0})],I.prototype,"type",void 0),I=e([c("esri.views.3d.environment.Precipitation")],I);const E=25e4,v=_().vec3f(A.POSITION),S=f(_().f32(A.INSTANCEFEATUREATTRIBUTE),1);export{I as Precipitation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{forEach as t,result as r}from"../../../core/asyncUtils.js";import{makeHandle as i}from"../../../core/handleUtils.js";import s from"../../../core/Logger.js";import{abortMaybe as a}from"../../../core/maybe.js";import{debounce as o,isAbortError as n,onAbort as l,isAborted as h,createAbortError as m,throwIfAborted as d}from"../../../core/promiseUtils.js";import{whenOnce as c}from"../../../core/reactiveUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Extent.js";import{equals as f,create as y,width as w,height as _,copy as x,intersection as v}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as R}from"./interfaces.js";import{LayerView3D as b}from"./LayerView3D.js";import{computeImageExportSize as E,createGeometryForExtent as j,createOuterImageGeometry as S}from"./support/overlayImageUtils.js";import{toViewIfLocal as I}from"./support/projectExtentUtils.js";import{debugFlags as A}from"../support/debugFlags.js";import{OverlayIndex as D}from"../terrain/interfaces.js";import{DirtyOperation as M}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as L}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as C}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as G}from"../webgl-engine/lib/UpdatePolicy.js";import{ImageMaterial as P}from"../webgl-engine/materials/ImageMaterial.js";import T from"../../layers/LayerView.js";import O from"../../layers/RefreshableLayerView.js";import{isInEffectiveScaleRange as U}from"../../support/layerViewUtils.js";import{TextureWrapMode as H}from"../../webgl/enums.js";let V=class extends(O(b(T))){constructor(){super(...arguments),this.drapeSourceType=R.RasterImage,this.updatePolicy=G.SYNC,this.fullExtentInLocalViewSpatialReference=null,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this.updateWhenStationary=!0,this._drapeSourceRenderer=null,this.refreshDebounced=o((async e=>{this.destroyed||await this._doRefresh(e).catch((e=>{n(e)||s.getLogger(this).error(e)}))}),2e3)}get visibleAtCurrentScale(){const e=this.layer,t="effectiveScaleRange"in e?e.effectiveScaleRange:null;return U(t,this.view.scale)}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(i((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this)))),this.addResolvingPromise(I(this).then((e=>this._set("fullExtentInLocalViewSpatialReference",e)))),this._updatingHandles.add((()=>this.suspended),(()=>this._suspendedChangeHandler()))}destroy(){this.clear()}setDrapingExtent(e,t){this._spatialReference=t,e.forEach(((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)}))}_updateImageExtent(e,t){const r=this._clippedExtent(e.extent,z);if(null==r)return;const i=E(e.extent,r,e.resolution);let a=e.pixelRatio*this.view.state.pixelRatio;const{layer:o}=this;if("imageMaxWidth"in o&&null!=o.imageMaxWidth||"imageMaxHeight"in o&&null!=o.imageMaxHeight){const e=o.imageMaxWidth,t=o.imageMaxHeight;if(i.width>e){const t=e/i.width;i.height=Math.floor(i.height*t),i.width=e,a*=t}if(i.height>t){const e=t/i.height;i.width=Math.floor(i.width*e),i.height=t,a*=e}}const l=this._extents[t];l&&f(l.extent,r)&&this._imageSizeEquals(r,l.imageSize,i)||(this._extents[t]={extent:y(r),imageSize:i,pixelRatio:a},this.suspended||this._fetch(t).catch((e=>{n(e)||s.getLogger(this).error(e)})))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(){return this._doRefresh()}async _doRefresh(e){if(this.suspended)return;const t=[];for(let r=0;r<this._extents.length;r++)this._extents[r]&&t.push(this._fetch(r,e));await Promise.allSettled(t)}async processResult(e,t,r){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(const t of this._extents){const r=t.extent;if(new p(r[0],r[1],r[2],r[3],this._spatialReference).contains(e))return t}return null}getFetchOptions(){}async redraw(e,r){await t(this._images,(async(t,i)=>{t&&(await e(t,r),await this._createStageObjects(i,t.image,r))}))}_imageSizeEquals(e,t,r){if(!this.maximumDataResolution)return!1;const i=w(e)/this.maximumDataResolution.x,s=_(e)/this.maximumDataResolution.y,a=i/t.width,o=s/t.height,n=i/r.width,l=s/r.height,h=Math.abs(a-n),m=Math.abs(o-l),d=A.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return h<=d&&m<=d}async _fetch(e,t){if(this.suspended)return;const r=this._extents[e],i=r.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:y(i)});const o=this._images[e];o.loadingAbortController=a(o.loadingAbortController);const c=new p(i[0],i[1],i[2],i[3],this._spatialReference);if(0===c.width||0===c.height)return void this._clearImage(e);const g=new AbortController;o.loadingAbortController=g,l(t,(()=>g.abort()));const u=g.signal,f=this._waitFetchReady(u).then((async()=>{const t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.getFetchOptions(),signal:u},{height:i,width:s}=r.imageSize;return"imagery"===this.layer.type?this.layer.internalFetchImage(c,s,i,t):this.layer.fetchImage(c,s,i,t)})).then((e=>{if(h(u))throw s.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),m();return this.processResult(o,e)})).then((()=>{x(o.renderExtent,i)}));o.loadingPromise=f,await this._updatingHandles.addPromise(f.then((async()=>{d(u),await this._createStageObjects(e,o.image,u)})).catch((e=>{throw e&&!n(e)&&s.getLogger(this).error(e),e})).finally((()=>{f===o.loadingPromise&&(o.loadingPromise=null,o.loadingAbortController=null)})))}_clearImage(e){const t=this._images[e];if(t){null!=t.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],M.UPDATE),t.renderGeometry=null);const e=this.view._stage,r=t.texture;r?.unload(),e.remove(r),t.texture=null,e.remove(t.material),t.material=null,t.loadingAbortController=a(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,i){const s=this.view._stage,a=this._images[e],o=()=>{a.texture?.unload(),s.remove(a.texture),a.texture=null,a.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([a.renderGeometry],M.UPDATE),a.renderGeometry=null)};if(t){const n=new C(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:H.CLAMP_TO_EDGE,t:H.CLAMP_TO_EDGE}});if(await r(this._images[e===D.INNER?D.OUTER:D.INNER].loadingPromise),d(i),o(),await s.schedule((()=>n.load(s.renderView.renderingContext)),i),!n.loaded)return void o();let l;if(s.add(n),a.texture=n,a.material??=new P({texture:n}),a.material.setParameters({texture:n}),e===D.INNER)l=j(a.material,a.renderExtent);else{const e=this._images[0].renderExtent;if(!e)return void o();l=S(a.material,e,a.renderExtent)}a.renderGeometry=new L(l),a.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([a.renderGeometry],M.UPDATE)}else o(),s.remove(a.material),a.material=null}_clippedExtent(e,t){if("local"!==this.view.viewingMode)return x(t,e);const r=this.view.basemapTerrain;return r.ready?v(e,r.extent,t):x(t,e)}_suspendedChangeHandler(){this.suspended?this.clear():this.refreshDebounced()}async _waitFetchReady(e){await c((()=>this.view.stationary),e),d(e)}};e([g()],V.prototype,"layer",void 0),e([g()],V.prototype,"suspended",void 0),e([g({readOnly:!0})],V.prototype,"fullExtentInLocalViewSpatialReference",void 0),e([g({readOnly:!0})],V.prototype,"visibleAtCurrentScale",null),e([g()],V.prototype,"updating",void 0),V=e([u("esri.views.3d.layers.DynamicLayerView3D")],V);const N=V,z=y();export{N as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{forEach as t,result as r}from"../../../core/asyncUtils.js";import{makeHandle as i}from"../../../core/handleUtils.js";import s from"../../../core/Logger.js";import{abortMaybe as a}from"../../../core/maybe.js";import{debounce as o,isAbortError as n,onAbort as l,isAborted as h,createAbortError as m,throwIfAborted as d}from"../../../core/promiseUtils.js";import{whenOnce as c}from"../../../core/reactiveUtils.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Extent.js";import{equals as f,create as y,width as w,height as _,copy as x,intersection as v}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as R}from"./interfaces.js";import{LayerView3D as b}from"./LayerView3D.js";import{computeImageExportSize as E,createGeometryForExtent as j,createOuterImageGeometry as S}from"./support/overlayImageUtils.js";import{debugFlags as I}from"../support/debugFlags.js";import{OverlayIndex as A}from"../terrain/interfaces.js";import{DirtyOperation as M}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as D}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as L}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as C}from"../webgl-engine/lib/UpdatePolicy.js";import{ImageMaterial as G}from"../webgl-engine/materials/ImageMaterial.js";import P from"../../layers/LayerView.js";import T from"../../layers/RefreshableLayerView.js";import{isInEffectiveScaleRange as O}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as U}from"../../support/projectionUtils.js";import{TextureWrapMode as H}from"../../webgl/enums.js";let V=class extends(T(b(P))){constructor(){super(...arguments),this.drapeSourceType=R.RasterImage,this.updatePolicy=C.SYNC,this.fullExtentInLocalViewSpatialReference=null,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this.updateWhenStationary=!0,this._drapeSourceRenderer=null,this.refreshDebounced=o((async e=>{this.destroyed||await this._doRefresh(e).catch((e=>{n(e)||s.getLogger(this).error(e)}))}),2e3)}get visibleAtCurrentScale(){const e=this.layer,t="effectiveScaleRange"in e?e.effectiveScaleRange:null;return O(t,this.view.scale)}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(i((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this)))),"local"===this.view.viewingMode&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await U(this.layer.fullExtent,this.view.spatialReference))()),this._updatingHandles.add((()=>this.suspended),(()=>this._suspendedChangeHandler()))}destroy(){this.clear()}setDrapingExtent(e,t){this._spatialReference=t,e.forEach(((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)}))}_updateImageExtent(e,t){const r=this._clippedExtent(e.extent,z);if(null==r)return;const i=E(e.extent,r,e.resolution);let a=e.pixelRatio*this.view.state.pixelRatio;const{layer:o}=this;if("imageMaxWidth"in o&&null!=o.imageMaxWidth||"imageMaxHeight"in o&&null!=o.imageMaxHeight){const e=o.imageMaxWidth,t=o.imageMaxHeight;if(i.width>e){const t=e/i.width;i.height=Math.floor(i.height*t),i.width=e,a*=t}if(i.height>t){const e=t/i.height;i.width=Math.floor(i.width*e),i.height=t,a*=e}}const l=this._extents[t];l&&f(l.extent,r)&&this._imageSizeEquals(r,l.imageSize,i)||(this._extents[t]={extent:y(r),imageSize:i,pixelRatio:a},this.suspended||this._fetch(t).catch((e=>{n(e)||s.getLogger(this).error(e)})))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(){return this._doRefresh()}async _doRefresh(e){if(this.suspended)return;const t=[];for(let r=0;r<this._extents.length;r++)this._extents[r]&&t.push(this._fetch(r,e));await Promise.allSettled(t)}async processResult(e,t,r){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(const t of this._extents){const r=t.extent;if(new p(r[0],r[1],r[2],r[3],this._spatialReference).contains(e))return t}return null}getFetchOptions(){}async redraw(e,r){await t(this._images,(async(t,i)=>{t&&(await e(t,r),await this._createStageObjects(i,t.image,r))}))}_imageSizeEquals(e,t,r){if(!this.maximumDataResolution)return!1;const i=w(e)/this.maximumDataResolution.x,s=_(e)/this.maximumDataResolution.y,a=i/t.width,o=s/t.height,n=i/r.width,l=s/r.height,h=Math.abs(a-n),m=Math.abs(o-l),d=I.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return h<=d&&m<=d}async _fetch(e,t){if(this.suspended)return;const r=this._extents[e],i=r.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:y(i)});const o=this._images[e];o.loadingAbortController=a(o.loadingAbortController);const c=new p(i[0],i[1],i[2],i[3],this._spatialReference);if(0===c.width||0===c.height)return void this._clearImage(e);const g=new AbortController;o.loadingAbortController=g,l(t,(()=>g.abort()));const u=g.signal,f=this._waitFetchReady(u).then((async()=>{const t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.getFetchOptions(),signal:u},{height:i,width:s}=r.imageSize;return this.layer?"imagery"===this.layer.type?this.layer.internalFetchImage(c,s,i,t):this.layer.fetchImage(c,s,i,t):null})).then((e=>{if(h(u))throw s.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),m();return this.processResult(o,e)})).then((()=>{x(o.renderExtent,i)}));o.loadingPromise=f,await this._updatingHandles.addPromise(f.then((async()=>{d(u),await this._createStageObjects(e,o.image,u)})).catch((e=>{throw e&&!n(e)&&s.getLogger(this).error(e),e})).finally((()=>{f===o.loadingPromise&&(o.loadingPromise=null,o.loadingAbortController=null)})))}_clearImage(e){const t=this._images[e];if(t){null!=t.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],M.UPDATE),t.renderGeometry=null);const e=this.view._stage,r=t.texture;r?.unload(),e.remove(r),t.texture=null,e.remove(t.material),t.material=null,t.loadingAbortController=a(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,i){const s=this.view._stage,a=this._images[e],o=()=>{a.texture?.unload(),s.remove(a.texture),a.texture=null,a.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([a.renderGeometry],M.UPDATE),a.renderGeometry=null)};if(t){const n=new L(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:H.CLAMP_TO_EDGE,t:H.CLAMP_TO_EDGE}});if(await r(this._images[e===A.INNER?A.OUTER:A.INNER].loadingPromise),d(i),o(),await s.schedule((()=>n.load(s.renderView.renderingContext)),i),!n.loaded)return void o();let l;if(s.add(n),a.texture=n,a.material??=new G({texture:n}),a.material.setParameters({texture:n}),e===A.INNER)l=j(a.material,a.renderExtent);else{const e=this._images[0].renderExtent;if(!e)return void o();l=S(a.material,e,a.renderExtent)}a.renderGeometry=new D(l),a.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([a.renderGeometry],M.UPDATE)}else o(),s.remove(a.material),a.material=null}_clippedExtent(e,t){if("local"!==this.view.viewingMode)return x(t,e);const r=this.view.basemapTerrain;return r.ready?v(e,r.extent,t):x(t,e)}_suspendedChangeHandler(){this.suspended?this.clear():this.refreshDebounced()}async _waitFetchReady(e){await c((()=>this.view.stationary),e),d(e)}};e([g()],V.prototype,"layer",void 0),e([g()],V.prototype,"suspended",void 0),e([g()],V.prototype,"fullExtentInLocalViewSpatialReference",void 0),e([g({readOnly:!0})],V.prototype,"visibleAtCurrentScale",null),e([g()],V.prototype,"updating",void 0),V=e([u("esri.views.3d.layers.DynamicLayerView3D")],V);const N=V,z=y();export{N as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Error.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as p}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as a}from"../../../layers/support/timeSupport.js";import o from"../../../rest/support/Query.js";import{toViewIfLocal as l}from"./support/projectExtentUtils.js";import{UpdatePolicy as u}from"../webgl-engine/lib/UpdatePolicy.js";import{defaultHighlightName as h}from"../../support/HighlightDefaults.js";const y=y=>{let c=class extends y{constructor(){super(...arguments),this.highlightOptions=null,this.updatePolicy=u.SYNC,this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new r("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{const e=await l(this);if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference=e;const t=await this.createGraphicsPipeline();this.destroyed?t.destroy():(this.graphicsPipeline=t,await t.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=i(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}getHit(e){const t=this.graphicsPipeline.findGraphic((t=>t.uid===e));if(null==t)return null;const r=p(t,this.layer);return{type:"graphic",graphic:r,layer:r.layer}}async getHitAsync(e){const r=this.layer,i={};i[this.layer.objectIdField]=e;const s=new t({layer:r,sourceLayer:r,visible:!0,symbol:null,attributes:i,geometry:null});return{type:"graphic",graphic:s,layer:s.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():o.from(e)}highlight(e,t){return this.graphicsPipeline.highlight(e,t?.name??h)}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new r("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}queryAttributeBins(){throw new Error("Not implemented")}queryAggregates(){throw new Error("Not implemented")}};return e([s()],c.prototype,"graphicsPipeline",void 0),e([s({readOnly:!0})],c.prototype,"dataUpdating",null),e([s()],c.prototype,"highlightOptions",void 0),e([s()],c.prototype,"suspended",void 0),e([s({readOnly:!0})],c.prototype,"legendEnabled",null),e([s({readOnly:!0})],c.prototype,"visibleAtCurrentScale",null),e([s()],c.prototype,"updating",void 0),e([s({readOnly:!0})],c.prototype,"updatePolicy",void 0),e([s({type:Boolean})],c.prototype,"slicePlaneEnabled",void 0),e([s({readOnly:!0})],c.prototype,"suspendInfo",void 0),e([s()],c.prototype,"symbologySnappingSupported",null),e([s({readOnly:!0})],c.prototype,"hasAllFeatures",null),e([s({readOnly:!0})],c.prototype,"hasAllFeaturesInView",null),e([s({readOnly:!0})],c.prototype,"hasFullGeometries",null),e([s({readOnly:!0})],c.prototype,"timeExtent",null),c=e([n("esri.views.3d.layers.FeatureLikeLayerView3D")],c),c};export{y as FeatureLikeLayerView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Error.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as p}from"../../../layers/support/timeSupport.js";import o from"../../../rest/support/Query.js";import{UpdatePolicy as l}from"../webgl-engine/lib/UpdatePolicy.js";import{defaultHighlightName as u}from"../../support/HighlightDefaults.js";import{projectWithZConversionSilent as h}from"../../support/projectionUtils.js";const y=y=>{let c=class extends y{constructor(){super(...arguments),this.highlightOptions=null,this.updatePolicy=l.SYNC,this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new r("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference="local"===this.view.viewingMode?await h(this.layer.fullExtent,this.view.spatialReference):null;const e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=i(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return p(this.layer,this.view?.timeExtent,this._get("timeExtent"))}getHit(e){const t=this.graphicsPipeline.findGraphic((t=>t.uid===e));if(null==t)return null;const r=a(t,this.layer);return{type:"graphic",graphic:r,layer:r.layer}}async getHitAsync(e){const r=this.layer,i={};i[this.layer.objectIdField]=e;const s=new t({layer:r,sourceLayer:r,visible:!0,symbol:null,attributes:i,geometry:null});return{type:"graphic",graphic:s,layer:s.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():o.from(e)}highlight(e,t){return this.graphicsPipeline.highlight(e,t?.name??u)}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new r("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}queryAttributeBins(){throw new Error("Not implemented")}queryAggregates(){throw new Error("Not implemented")}};return e([s()],c.prototype,"graphicsPipeline",void 0),e([s({readOnly:!0})],c.prototype,"dataUpdating",null),e([s()],c.prototype,"highlightOptions",void 0),e([s()],c.prototype,"suspended",void 0),e([s({readOnly:!0})],c.prototype,"legendEnabled",null),e([s({readOnly:!0})],c.prototype,"visibleAtCurrentScale",null),e([s()],c.prototype,"updating",void 0),e([s({readOnly:!0})],c.prototype,"updatePolicy",void 0),e([s({type:Boolean})],c.prototype,"slicePlaneEnabled",void 0),e([s({readOnly:!0})],c.prototype,"suspendInfo",void 0),e([s()],c.prototype,"symbologySnappingSupported",null),e([s({readOnly:!0})],c.prototype,"hasAllFeatures",null),e([s({readOnly:!0})],c.prototype,"hasAllFeaturesInView",null),e([s({readOnly:!0})],c.prototype,"hasFullGeometries",null),e([s({readOnly:!0})],c.prototype,"timeExtent",null),c=e([n("esri.views.3d.layers.FeatureLikeLayerView3D")],c),c};export{y as FeatureLikeLayerView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{when as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as n}from"./LayerView3D.js";import{elevationAlignPointsInFeatures as a}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as p}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as l}from"./graphics/queryForSymbologySnapping.js";import{LayerViewPerformanceInfo as c}from"./support/LayerViewPerformanceInfo.js";import{projectExtentIfLocal as h}from"./support/projectExtentUtils.js";import{UpdatePolicy as d}from"../webgl-engine/lib/UpdatePolicy.js";import u from"../../layers/LayerView.js";import{defaultHighlightName as g}from"../../support/HighlightDefaults.js";let m=class extends(n(u)){constructor(){super(...arguments),this.type="graphics-3d",this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.ignoresMemoryFactor=!0}get highlightOptions(){return null}initialize(){this._set("processor",new p({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on("graphic-update",(e=>this.processor.graphicsCore.graphicUpdateHandler(e)))),this.layer.internal?this.notifyChange("updating"):(this.addResolvingPromise(h(this).then((e=>this.fullExtentInLocalViewSpatialReference=e||null))),this.addHandles(t((()=>this.view?.basemapTerrain?.ready),(()=>()=>this.notifyChange("updating")),{once:!0})))}destroy(){this._updatingHandles.removeAll(),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}get visibleAtCurrentScale(){return!this.processor?.scaleVisibilitySuspended}get slicePlaneEnabled(){const e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){const e=super.getSuspendInfo();return e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}getHit(e){return this.processor.getHit(e)}async getHitAsync(e){return this.processor.getHitAsync(e)}whenGraphicBounds(e,r){return this.processor.whenGraphicBounds(e,r)}computeAttachmentOrigin(e,r){return this.processor?.computeAttachmentOrigin(e,r)}getSymbolLayerSize(e,r){return this.processor.getSymbolLayerSize(e,r)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e,r){return this.processor.highlight(e,r?.name??g)}async elevationAlignPointsInFeatures(e,s){const{processor:t}=this;if(null==t?.graphics3DGraphics)throw new r("graphicslayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");const{graphics3DGraphics:i}=t,o=e=>"number"==typeof e?i.get(e):void 0;return a(this.view,this.layer,o,e,s)}async queryForSymbologySnapping(e,r){return l(this.processor,e,r)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||d.SYNC}isUpdating(){return this.view&&this.layer&&!(!this.processor?.updating&&(this.layer.internal||this.view.basemapTerrain?.ready))}get performanceInfo(){return new c(this.usedMemory,this.loadedGraphics.length,-1,-1)}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return this.processor?.graphicsCore?.unprocessedMemoryEstimate}get test(){return{graphics3DProcessor:this.processor,loadedGraphics:this.loadedGraphics}}};e([i()],m.prototype,"highlightOptions",null),e([i()],m.prototype,"loadedGraphics",null),e([i({readOnly:!0})],m.prototype,"legendEnabled",null),e([i()],m.prototype,"layer",void 0),e([i({readOnly:!0})],m.prototype,"processor",void 0),e([i({readOnly:!0})],m.prototype,"visibleAtCurrentScale",null),e([i()],m.prototype,"_slicePlaneEnabled",void 0),e([i({type:Boolean})],m.prototype,"slicePlaneEnabled",null),m=e([o("esri.views.3d.layers.GraphicsLayerView3D")],m);const y=m;export{y as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{when as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as a}from"./LayerView3D.js";import{elevationAlignPointsInFeatures as n}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as p}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as l}from"./graphics/queryForSymbologySnapping.js";import{LayerViewPerformanceInfo as c}from"./support/LayerViewPerformanceInfo.js";import{UpdatePolicy as h}from"../webgl-engine/lib/UpdatePolicy.js";import d from"../../layers/LayerView.js";import{defaultHighlightName as u}from"../../support/HighlightDefaults.js";import{projectWithZConversionSilent as g}from"../../support/projectionUtils.js";let y=class extends(a(d)){constructor(){super(...arguments),this.type="graphics-3d",this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.ignoresMemoryFactor=!0}get highlightOptions(){return null}initialize(){this._set("processor",new p({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on("graphic-update",(e=>this.processor.graphicsCore.graphicUpdateHandler(e)))),this.layer.internal?this.notifyChange("updating"):("local"===this.view.viewingMode&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await g(this.layer.fullExtent,this.view.spatialReference))()),this.addHandles(t((()=>this.view?.basemapTerrain?.ready),(()=>()=>this.notifyChange("updating")),{once:!0})))}destroy(){this._updatingHandles.removeAll(),this._set("processor",s(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}get visibleAtCurrentScale(){return!this.processor?.scaleVisibilitySuspended}get slicePlaneEnabled(){const e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){const e=super.getSuspendInfo();return e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}getHit(e){return this.processor.getHit(e)}async getHitAsync(e){return this.processor.getHitAsync(e)}whenGraphicBounds(e,r){return this.processor.whenGraphicBounds(e,r)}computeAttachmentOrigin(e,r){return this.processor?.computeAttachmentOrigin(e,r)}getSymbolLayerSize(e,r){return this.processor.getSymbolLayerSize(e,r)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e,r){return this.processor.highlight(e,r?.name??u)}async elevationAlignPointsInFeatures(e,s){const{processor:t}=this;if(null==t?.graphics3DGraphics)throw new r("graphicslayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");const{graphics3DGraphics:i}=t,o=e=>"number"==typeof e?i.get(e):void 0;return n(this.view,this.layer,o,e,s)}async queryForSymbologySnapping(e,r){return l(this.processor,e,r)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||h.SYNC}isUpdating(){return this.view&&this.layer&&!(!this.processor?.updating&&(this.layer.internal||this.view.basemapTerrain?.ready))}get performanceInfo(){return new c(this.usedMemory,this.loadedGraphics.length,-1,-1)}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return this.processor?.graphicsCore?.unprocessedMemoryEstimate}get test(){return{graphics3DProcessor:this.processor,loadedGraphics:this.loadedGraphics}}};e([i()],y.prototype,"highlightOptions",null),e([i()],y.prototype,"loadedGraphics",null),e([i({readOnly:!0})],y.prototype,"legendEnabled",null),e([i()],y.prototype,"layer",void 0),e([i({readOnly:!0})],y.prototype,"processor",void 0),e([i({readOnly:!0})],y.prototype,"visibleAtCurrentScale",null),e([i()],y.prototype,"_slicePlaneEnabled",void 0),e([i({type:Boolean})],y.prototype,"slicePlaneEnabled",null),y=e([o("esri.views.3d.layers.GraphicsLayerView3D")],y);const m=y;export{m as default};