@arcgis/core 5.2.0-next.120 → 5.2.0-next.122

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 (534) hide show
  1. package/Ground.js +1 -1
  2. package/arcade/containerUtils.js +1 -1
  3. package/arcade/functions/feature.js +1 -1
  4. package/arcade/functions/featuresetstring.js +1 -1
  5. package/arcade/languageUtils.js +1 -1
  6. package/arcgisGlobal.d.ts +9 -0
  7. package/assets/components/assets/icon/addCellAbove16.json +1 -0
  8. package/assets/components/assets/icon/addCellAbove24.json +1 -0
  9. package/assets/components/assets/icon/addCellAbove32.json +1 -0
  10. package/assets/components/assets/icon/addCellBelow16.json +1 -0
  11. package/assets/components/assets/icon/addCellBelow24.json +1 -0
  12. package/assets/components/assets/icon/addCellBelow32.json +1 -0
  13. package/assets/components/assets/icon/linkedChart16.json +1 -0
  14. package/assets/components/assets/icon/linkedChart24.json +1 -0
  15. package/assets/components/assets/icon/linkedChart32.json +1 -0
  16. package/assets/components/assets/icon/polygonFromFeature16.json +1 -0
  17. package/assets/components/assets/icon/polygonFromFeature24.json +1 -0
  18. package/assets/components/assets/icon/polygonFromFeature32.json +1 -0
  19. package/assets/esri/core/workers/RemoteClient.js +1 -1
  20. package/assets/esri/core/workers/chunks/0148cb611bf7c8c5fe8a.js +1 -0
  21. package/assets/esri/core/workers/chunks/025da54eef112d7e8f66.js +1 -0
  22. package/assets/esri/core/workers/chunks/033debcbf6b3683dc4fe.js +2 -0
  23. package/assets/esri/core/workers/chunks/064445e6f9512817ac87.js +2 -0
  24. package/assets/esri/core/workers/chunks/{304462b049116f59accc.js → 09676cfa99b90fe0cc63.js} +1 -1
  25. package/assets/esri/core/workers/chunks/0aadee0437fa061e4ff5.js +1 -0
  26. package/assets/esri/core/workers/chunks/{deb5b1d772ca407654d4.js → 0acc754907395e83bbc6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/1302bf9718747cd9fdd9.js +1 -0
  28. package/assets/esri/core/workers/chunks/{956432c9d45940983bc2.js → 1b42d163ef22e3565bb7.js} +1 -1
  29. package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +1 -0
  30. package/assets/esri/core/workers/chunks/1c38ce72160d5a4e4b3d.js +1 -0
  31. package/assets/esri/core/workers/chunks/1c3b087fbf2d102376fc.js +1 -0
  32. package/assets/esri/core/workers/chunks/{e18b8646c7378213b618.js → 1e46703cb566c25458ad.js} +1 -1
  33. package/assets/esri/core/workers/chunks/1f135269aea3931e11b2.js +1 -0
  34. package/assets/esri/core/workers/chunks/{ea9e770efc85594e4dd2.js → 216d8cb86548e92a8196.js} +1 -1
  35. package/assets/esri/core/workers/chunks/23279303cd7698314c56.js +1 -0
  36. package/assets/esri/core/workers/chunks/{4bf2cc4d092601ff2b86.js → 24673aac70d6c949b6fa.js} +1 -1
  37. package/assets/esri/core/workers/chunks/24cf91aeab53a897e951.js +1 -0
  38. package/assets/esri/core/workers/chunks/26bc509a031788bfa678.js +1 -0
  39. package/assets/esri/core/workers/chunks/{d629708bf23da24ee523.js → 298f234f11a10c5120a2.js} +1 -1
  40. package/assets/esri/core/workers/chunks/29ae19206bbeb480be0f.js +1 -0
  41. package/assets/esri/core/workers/chunks/2ae6deade655fdbc28de.js +1 -0
  42. package/assets/esri/core/workers/chunks/{37cf4ca2083cd3b6002e.js → 2c7bb5c9751524687002.js} +1 -1
  43. package/assets/esri/core/workers/chunks/2c8957f9c7610805208c.js +1 -0
  44. package/assets/esri/core/workers/chunks/{dc1944a7601b518a9c48.js → 2ca49fb4590cc34a02bd.js} +1 -1
  45. package/assets/esri/core/workers/chunks/2d592c935571de80a2e2.js +1 -0
  46. package/assets/esri/core/workers/chunks/{a917a1df8270860dc514.js → 2f52ad525744b8793d49.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{f890359d972cce54459e.js → 2f829321bfbd3bacd64f.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{6efc5873747b9cd44fb9.js → 323451ef52d0c2805f1d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{7232fc11b23777b6be94.js → 369012c032ea6882607c.js} +1 -1
  50. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
  51. package/assets/esri/core/workers/chunks/38890ac5917942374ab8.js +1 -0
  52. package/assets/esri/core/workers/chunks/3e33d953e41b281a120b.js +1 -0
  53. package/assets/esri/core/workers/chunks/3e52351e06d85bf9bedd.js +1 -0
  54. package/assets/esri/core/workers/chunks/{9f760dc4492a03e0504c.js → 45d87af48a21644590c2.js} +1 -1
  55. package/assets/esri/core/workers/chunks/462fd57af8ed7921d6ba.js +1 -0
  56. package/assets/esri/core/workers/chunks/463d69f596d1d34ef275.js +2 -0
  57. package/assets/esri/core/workers/chunks/475906b079f4f1ddacf2.js +1 -0
  58. package/assets/esri/core/workers/chunks/48a2f68e06a2e90b77d0.js +1 -0
  59. package/assets/esri/core/workers/chunks/49affbed22e201f7c32b.js +1 -0
  60. package/assets/esri/core/workers/chunks/{b6ca73c1384f07b30b74.js → 4bb8432d99a39733368f.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{cb983f65995e57fff7a1.js → 4f58e0322707f63f5bf2.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{8f0ecf4d06ec7b67d4ed.js → 52744dfd430cd0c0edfb.js} +1 -1
  63. package/assets/esri/core/workers/chunks/58a17fb3c0dd07c63d57.js +2 -0
  64. package/assets/esri/core/workers/chunks/5993db944b9e7825e0bc.js +1 -0
  65. package/assets/esri/core/workers/chunks/{b0058619e0363002ad86.js → 59cd139712d919e6a738.js} +1 -1
  66. package/assets/esri/core/workers/chunks/59d5247ac4075b024244.js +1 -0
  67. package/assets/esri/core/workers/chunks/5b9f3c4f65412c66316f.js +1 -0
  68. package/assets/esri/core/workers/chunks/{be3421ffb5b391bca02e.js → 5d35e0c2665f5e625ee9.js} +1 -1
  69. package/assets/esri/core/workers/chunks/5e70bfb9d6235a87b87a.js +1 -0
  70. package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +1 -0
  71. package/assets/esri/core/workers/chunks/618927cfcb93dd1d92fd.js +1 -0
  72. package/assets/esri/core/workers/chunks/6709d24867d275b33d24.js +1 -0
  73. package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +1 -0
  74. package/assets/esri/core/workers/chunks/{6ab7bb3834841834f839.js → 724ea2e2843e6dac0a90.js} +1 -1
  75. package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +1 -0
  76. package/assets/esri/core/workers/chunks/{090c9c2dbf92f2cac0b8.js → 770ca70d363184e39d60.js} +1 -1
  77. package/assets/esri/core/workers/chunks/781fa83e8063b8f685dc.js +1 -0
  78. package/assets/esri/core/workers/chunks/78c1b75b1a8937eaa3cd.js +1 -0
  79. package/assets/esri/core/workers/chunks/793b072519ded0dc6f34.js +1 -0
  80. package/assets/esri/core/workers/chunks/7994fce5f36963aadc51.js +1 -0
  81. package/assets/esri/core/workers/chunks/7adee504107cb9ad8563.js +1 -0
  82. package/assets/esri/core/workers/chunks/7efc45858ebd3fd3302e.js +1 -0
  83. package/assets/esri/core/workers/chunks/7ff536284942c5284a16.js +1 -0
  84. package/assets/esri/core/workers/chunks/813dd84933b407c8fe86.js +1 -0
  85. package/assets/esri/core/workers/chunks/83c7c4218bc6ba2f16ee.js +1 -0
  86. package/assets/esri/core/workers/chunks/8daeac785af725c3ebdf.js +1 -0
  87. package/assets/esri/core/workers/chunks/{3ab25279aaa30f035038.js → 8daed13400d9e63e65ae.js} +1 -1
  88. package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +1 -0
  89. package/assets/esri/core/workers/chunks/92f35b2c3c5f13778308.js +1 -0
  90. package/assets/esri/core/workers/chunks/97cd4145c016cf379120.js +1 -0
  91. package/assets/esri/core/workers/chunks/{cf7c06702babd6fa88b4.js → 9af36ee6a0df224859bc.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{452d069ba7ad6759b558.js → 9c46c7f00d42f5c02b26.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{32fc7d1db4b311f6b880.js → 9e5b30b907102bc0c201.js} +1 -1
  94. package/assets/esri/core/workers/chunks/a3ab53b534e2872131be.js +1 -0
  95. package/assets/esri/core/workers/chunks/{f18ee2eaa96d103627a6.js → aa6b2cc8f6f5627891c1.js} +1 -1
  96. package/assets/esri/core/workers/chunks/ac7af417ebf7721d7400.js +1 -0
  97. package/assets/esri/core/workers/chunks/aed479c14d93955f4798.js +1 -0
  98. package/assets/esri/core/workers/chunks/{60c61f34733063730386.js → b013b70e40dfb6ce013e.js} +1 -1
  99. package/assets/esri/core/workers/chunks/b22de8bf4a4a739bc36d.js +1 -0
  100. package/assets/esri/core/workers/chunks/b39cd78d2d97bef9909e.js +1 -0
  101. package/assets/esri/core/workers/chunks/b5f50955c1eee55b67d1.js +1 -0
  102. package/assets/esri/core/workers/chunks/b688e6463a651779a016.js +1 -0
  103. package/assets/esri/core/workers/chunks/bb5ed2a796a45c41b0b4.js +1 -0
  104. package/assets/esri/core/workers/chunks/bdf012e591a8476db467.js +1 -0
  105. package/assets/esri/core/workers/chunks/{daf7b647bd960d8bad56.js → be52c319a0a81ce1ba36.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{066b7f6866d602f963e0.js → c3008b20cb5fd38bd900.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{22e85819e23202a8ba90.js → c39ebd8d469f1e8bb61e.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{7f2ac03efaa4a4898ba2.js → c3b96d1d43afccd23e45.js} +2 -2
  109. package/assets/esri/core/workers/chunks/{89edaa1ffa566908ebca.js → ca5a4f62b09cc8579dc0.js} +1 -1
  110. package/assets/esri/core/workers/chunks/ce08e3369641da0d7a27.js +2 -0
  111. package/assets/esri/core/workers/chunks/ce1ccf9ec90b786591e5.js +1 -0
  112. package/assets/esri/core/workers/chunks/cf0bed7ae27021fd7b05.js +1 -0
  113. package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +1 -0
  114. package/assets/esri/core/workers/chunks/d25210574168ead2f813.js +1 -0
  115. package/assets/esri/core/workers/chunks/d3378c479052d566317c.js +1 -0
  116. package/assets/esri/core/workers/chunks/{1742dbc6a827cfda471b.js → d3d48401462ef3bf0ad9.js} +1 -1
  117. package/assets/esri/core/workers/chunks/d3ef23923424ad8c5048.js +1 -0
  118. package/assets/esri/core/workers/chunks/{46388b86d1b10e6121bd.js → d507d7d7a7282fc38e8d.js} +1 -1
  119. package/assets/esri/core/workers/chunks/dc0816f064be576a2fa6.js +1 -0
  120. package/assets/esri/core/workers/chunks/{862e1acd80c4e43831dc.js → dc923e50958b68a50014.js} +1 -1
  121. package/assets/esri/core/workers/chunks/dd4ecf81250cc001d040.js +1 -0
  122. package/assets/esri/core/workers/chunks/e10fe4c77b8dc4492092.js +1 -0
  123. package/assets/esri/core/workers/chunks/e4e1db4e9e5f13167401.js +1 -0
  124. package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +1 -0
  125. package/assets/esri/core/workers/chunks/{e755075ac2e02e881fad.js → e6637f9176566382ed3e.js} +1 -1
  126. package/assets/esri/core/workers/chunks/e6dc68c4bd8eddb168d1.js +1 -0
  127. package/assets/esri/core/workers/chunks/eb780f2dafa14f776166.js +1 -0
  128. package/assets/esri/core/workers/chunks/{723478607badcde5706b.js → eb7f45736c852725b0bb.js} +150 -118
  129. package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +1 -0
  130. package/assets/esri/core/workers/chunks/f38d11be766043413659.js +1 -0
  131. package/assets/esri/core/workers/chunks/{98a5327fd96d9542b39f.js → f90cad9f007a11154c0d.js} +1 -1
  132. package/assets/esri/libs/pdfjs/pdf.worker.mjs +63075 -0
  133. package/assets/esri/libs/pdfjs/wasm/jbig2.wasm +0 -0
  134. package/assets/esri/libs/pdfjs/wasm/openjpeg.wasm +0 -0
  135. package/assets/esri/libs/pdfjs/wasm/qcms_bg.wasm +0 -0
  136. package/assets/esri/libs/pdfjs/wasm/quickjs-eval.wasm +0 -0
  137. package/assets/esri/themes/dark/main.css +1 -1
  138. package/assets/esri/themes/light/main.css +1 -1
  139. package/assets/esri/themes/light/view.css +1 -1
  140. package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.en.json +1 -1
  141. package/basemaps/BasemapCollection.d.ts +148 -0
  142. package/basemaps/BasemapCollection.js +2 -0
  143. package/basemaps/BasemapsSource.d.ts +39 -0
  144. package/basemaps/BasemapsSource.js +2 -0
  145. package/basemaps/LocalBasemapsSource.d.ts +55 -0
  146. package/basemaps/LocalBasemapsSource.js +2 -0
  147. package/basemaps/PortalBasemapsSource.d.ts +98 -0
  148. package/basemaps/PortalBasemapsSource.js +2 -0
  149. package/basemaps/support/BasemapItem.d.ts +74 -0
  150. package/basemaps/support/BasemapItem.js +2 -0
  151. package/basemaps/support/basemapCompatibilityUtils.js +2 -0
  152. package/basemaps/types.d.ts +42 -0
  153. package/chunks/CheckerBoard.glsl.js +1 -1
  154. package/chunks/CloudsComposition.glsl.js +2 -2
  155. package/chunks/ColorMaterial.glsl.js +1 -1
  156. package/chunks/Component.glsl.js +11 -11
  157. package/chunks/DeepSky.glsl.js +1 -1
  158. package/chunks/DefaultMaterial.glsl.js +4 -4
  159. package/chunks/EdgeShader.glsl.js +1 -1
  160. package/chunks/FocusArea.glsl.js +1 -1
  161. package/chunks/GaussianSplat.glsl.js +9 -9
  162. package/chunks/GlobalIllumination.glsl.js +42 -13
  163. package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
  164. package/chunks/HUDMaterial.glsl.js +1 -1
  165. package/chunks/ImageMaterial.glsl.js +1 -1
  166. package/chunks/LineCallout.glsl.js +1 -1
  167. package/chunks/LineMarker.glsl.js +97 -89
  168. package/chunks/NativeLine.glsl.js +1 -1
  169. package/chunks/Path.glsl.js +8 -7
  170. package/chunks/Pattern.glsl.js +1 -1
  171. package/chunks/PointRenderer.glsl.js +1 -1
  172. package/chunks/RealisticTree.glsl.js +4 -4
  173. package/chunks/RibbonLine.glsl.js +58 -56
  174. package/chunks/ShadowCastAccumulate.glsl.js +3 -3
  175. package/chunks/ShadowHighlight.glsl.js +4 -4
  176. package/chunks/ShadowHighlightBuffer.glsl.js +3 -3
  177. package/chunks/Terrain.glsl.js +12 -14
  178. package/chunks/Viewshed.glsl.js +1 -1
  179. package/chunks/Water.glsl.js +3 -3
  180. package/chunks/languageUtils.js +1 -1
  181. package/config.js +1 -1
  182. package/core/Accessor.d.ts +10 -0
  183. package/core/arrayUtils.js +1 -1
  184. package/core/workers/registry.js +1 -1
  185. package/geometry/support/geometryUtils.js +1 -1
  186. package/geometry/support/heightModelInfoUtils.js +1 -1
  187. package/geometry/support/meshUtils/elevation.js +1 -1
  188. package/kernel.js +1 -1
  189. package/layers/CSVLayer.js +1 -1
  190. package/layers/GeoJSONLayer.d.ts +1 -1
  191. package/layers/GeoJSONLayer.js +1 -1
  192. package/layers/GeospatialPDFLayer.d.ts +40 -0
  193. package/layers/GeospatialPDFLayer.js +2 -0
  194. package/layers/IntegratedMeshLayer.js +1 -1
  195. package/layers/OGCFeatureLayer.js +1 -1
  196. package/layers/StreamLayer.js +1 -1
  197. package/layers/geospatialPDF/GeospatialPDFFrame.js +2 -0
  198. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +5 -0
  199. package/layers/geospatialPDF/GeospatialPDFParserUtils.js +2 -0
  200. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +2 -0
  201. package/layers/geospatialPDF/LGIDictMapFrame.js +2 -0
  202. package/layers/geospatialPDF/Projection.js +2 -0
  203. package/layers/geospatialPDF/ViewportMeasureFrame.js +2 -0
  204. package/layers/geospatialPDF/renderExtentUtils.js +2 -0
  205. package/layers/geospatialPDF/sharedUtils.js +2 -0
  206. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  207. package/layers/mixins/ArcGISImageService.js +1 -1
  208. package/layers/mixins/FeatureLayerBase.js +1 -1
  209. package/layers/raster/datasets/GeospatialPDFRaster.js +2 -0
  210. package/layers/support/ElevationQuery.js +1 -1
  211. package/layers/support/LabelClass.d.ts +13 -4
  212. package/layers/support/LabelClass.js +1 -1
  213. package/layers/support/commonProperties.js +1 -1
  214. package/layers/support/layersLoader.js +1 -1
  215. package/layers/types.d.ts +1 -1
  216. package/legend/ActiveLayerInfo.d.ts +130 -0
  217. package/legend/ActiveLayerInfo.js +2 -0
  218. package/legend/LegendContent.d.ts +118 -0
  219. package/legend/LegendContent.js +2 -0
  220. package/legend/support/clusterUtils.js +2 -0
  221. package/legend/support/colorRampUtils.js +2 -0
  222. package/legend/support/heatmapRampUtils.js +2 -0
  223. package/legend/support/relationshipRampUtils.js +2 -0
  224. package/legend/support/sizeRampUtils.js +2 -0
  225. package/legend/support/utils.js +2 -0
  226. package/legend/types.d.ts +403 -0
  227. package/libs/i3s/I3SModule.js +1 -1
  228. package/package.json +7 -7
  229. package/portal/PortalItem.js +1 -1
  230. package/portal/support/portalLayers.js +1 -1
  231. package/support/revision.js +1 -1
  232. package/support/userTypeGuards/isBasemapsSource.js +2 -0
  233. package/symbols/cim/CIMOperators.js +1 -1
  234. package/symbols/cim/callouts/effects/BackgroundCallout.js +2 -0
  235. package/symbols/cim/callouts/effects/BalloonCallout.js +2 -0
  236. package/symbols/cim/callouts/effects/PointSymbolCallout.js +2 -0
  237. package/symbols/cim/callouts/effects/SimpleLineCallout.js +2 -0
  238. package/symbols/cim/callouts/effects/calloutUtils.js +2 -0
  239. package/symbols/cim/cimAnalyzer.js +1 -1
  240. package/symbols/cim/utils.js +1 -1
  241. package/symbols/support/typeUtils.js +1 -1
  242. package/views/2d/LabelManager.js +1 -1
  243. package/views/2d/engine/AFeatureContainer.js +1 -1
  244. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  245. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  246. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  247. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  248. package/views/2d/engine/webgl/TileCpuState.js +1 -1
  249. package/views/2d/engine/webgl/TileGpuState.js +1 -1
  250. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  251. package/views/2d/engine/webgl/collisions/LabelStore.js +2 -0
  252. package/views/2d/engine/webgl/cpuMapped/CpuBuffer.js +1 -1
  253. package/views/2d/engine/webgl/cpuMapped/CpuMeshData.js +1 -1
  254. package/views/2d/engine/webgl/cpuMapped/GpuMeshState.js +1 -1
  255. package/views/2d/engine/webgl/definitions.js +1 -1
  256. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  257. package/views/2d/engine/webgl/mesh/MultiTileMeshData.js +1 -1
  258. package/views/2d/engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js +2 -0
  259. package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
  260. package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +2 -0
  261. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  262. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  263. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  264. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  265. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  266. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueInstance.js +1 -1
  267. package/views/2d/engine/webgl/shaderGraph/techniques/TestDisplayObject.js +1 -1
  268. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +1 -1
  269. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  270. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
  271. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  272. package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
  273. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  274. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  281. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  282. package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
  283. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  284. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +2 -0
  286. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  287. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js +2 -0
  288. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
  289. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/dataViewUtils.js +1 -1
  290. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  291. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  292. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  293. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  294. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  295. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  296. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  297. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  298. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  299. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  300. package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
  301. package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
  302. package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
  303. package/views/2d/engine/webgl/util/LabelMatcher.js +1 -1
  304. package/views/2d/engine/webgl/util/MapMatcher.js +1 -1
  305. package/views/2d/engine/webgl/util/Matcher.js +1 -1
  306. package/views/2d/engine/webgl/util/MatcherContext.js +1 -1
  307. package/views/2d/input/MapViewInputManager.js +1 -1
  308. package/views/2d/input/handlers/KeyPan.js +1 -1
  309. package/views/2d/input/handlers/KeyRotate.js +1 -1
  310. package/views/2d/layerViewModuleImportUtils.js +1 -1
  311. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  312. package/views/2d/layers/GeospatialPDFLayerView2D.js +2 -0
  313. package/views/2d/layers/MediaLayerView2D.js +1 -1
  314. package/views/2d/layers/TileLayerView2D.js +1 -1
  315. package/views/2d/layers/features/FeatureContainer.js +1 -1
  316. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  317. package/views/2d/layers/features/RenderState.js +1 -1
  318. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  319. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  320. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  321. package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
  322. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  323. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  324. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  325. package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
  326. package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +1 -1
  327. package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
  328. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  329. package/views/2d/layers/support/annodime/debugUtils.js +1 -1
  330. package/views/2d/layers/support/annodime/virtualFields.js +1 -1
  331. package/views/2d/types.d.ts +2 -0
  332. package/views/3d/GroundView3D.js +1 -1
  333. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  334. package/views/3d/input/SceneInputManager.js +1 -1
  335. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  336. package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +2 -0
  337. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  338. package/views/3d/layerViewModuleImportUtils.js +1 -1
  339. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  340. package/views/3d/layers/GeospatialPDFLayerView3D.js +2 -0
  341. package/views/3d/layers/I3SMeshView3D.js +1 -1
  342. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  343. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  344. package/views/3d/layers/LayerView3D.js +1 -1
  345. package/views/3d/layers/SceneLayerWorker.js +1 -1
  346. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  347. package/views/3d/layers/i3s/Intersector.js +1 -1
  348. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  349. package/views/3d/support/GroundAndIMSurface.js +1 -1
  350. package/views/3d/support/MemoryController.js +1 -1
  351. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  352. package/views/3d/support/hitTest.js +1 -1
  353. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  354. package/views/3d/types.d.ts +2 -0
  355. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  356. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  357. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +1 -3
  358. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  359. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +1 -1
  360. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +8 -8
  361. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +6 -6
  362. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
  363. package/views/3d/webgl-engine/core/shaderLibrary/forwardLinearDepthToReadShadow.glsl.js +4 -0
  364. package/views/3d/webgl-engine/core/shaderLibrary/{ForwardLinearDepthToWriteShadowMap.glsl.js → forwardLinearDepthToWriteShadow.glsl.js} +5 -5
  365. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +8 -6
  366. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +2 -2
  367. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
  368. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
  369. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +3 -4
  370. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +2 -2
  371. package/views/3d/webgl-engine/core/shaderLibrary/shading/readFragmentShadow.glsl.js +5 -0
  372. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +24 -0
  373. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
  374. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +6 -6
  375. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  376. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  377. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  378. package/views/3d/webgl-engine/effects/focusArea/FocusArea.js +1 -1
  379. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  380. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  381. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +1 -1
  382. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.glsl.js +1 -1
  383. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  384. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
  385. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulate.glsl.js +1 -1
  386. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  387. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  388. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  389. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  390. package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
  391. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  392. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  393. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  394. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  395. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  396. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  397. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  398. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +1 -1
  399. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  400. package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +1 -1
  401. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  402. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  403. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  404. package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
  405. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  406. package/views/3d/webgl-engine/shaders/{AnimatedLine.glsl.js → animatedAlpha.glsl.js} +11 -17
  407. package/views/SceneView.d.ts +31 -0
  408. package/views/SceneView.js +1 -1
  409. package/views/ToolViewManager.js +1 -1
  410. package/views/VideoView.js +1 -1
  411. package/views/View.d.ts +35 -0
  412. package/views/View.js +1 -1
  413. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  414. package/views/analysis/ElevationProfile/elevationProfileQuerySourceUtils.js +1 -1
  415. package/views/interactive/options/ViewOptions.d.ts +98 -0
  416. package/views/interactive/options/ViewOptions.js +2 -0
  417. package/views/interactive/support/Units.d.ts +10 -2
  418. package/views/interactive/support/Units.js +1 -1
  419. package/views/layers/FeatureLikeLayerView.d.ts +27 -5
  420. package/views/layers/GraphicsLayerView.d.ts +25 -2
  421. package/views/layers/ImageryTileLayerView.js +1 -1
  422. package/views/selection/types.d.ts +1 -1
  423. package/views/support/DefaultsFromMap.js +1 -1
  424. package/views/types.d.ts +9 -3
  425. package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +3 -0
  426. package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -0
  427. package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -0
  428. package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -0
  429. package/widgets/BasemapGallery/types.d.ts +6 -1
  430. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +2 -0
  431. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  432. package/widgets/Editor/EditorViewModel.d.ts +2 -1
  433. package/widgets/Editor/EditorViewModel.js +1 -1
  434. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
  435. package/widgets/Editor.d.ts +2 -1
  436. package/widgets/Editor.js +1 -1
  437. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  438. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.d.ts +1 -0
  439. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
  440. package/widgets/HistogramRangeSlider.js +1 -1
  441. package/widgets/Legend/LegendViewModel.d.ts +1 -0
  442. package/widgets/Legend/LegendViewModel.js +1 -1
  443. package/widgets/Legend/styles/card/CardView.d.ts +1 -0
  444. package/widgets/Legend/styles/card/CardView.js +1 -1
  445. package/widgets/Legend/styles/classic/ClassicView.d.ts +1 -0
  446. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  447. package/widgets/Legend/support/ActiveLayerInfo.d.ts +2 -0
  448. package/widgets/Legend.js +1 -1
  449. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +8 -2
  450. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  451. package/widgets/support/SelectionToolbar/VisibleElements.d.ts +8 -1
  452. package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
  453. package/widgets/support/SelectionToolbar.d.ts +7 -1
  454. package/widgets/support/SelectionToolbar.js +1 -1
  455. package/assets/esri/core/workers/chunks/01ca17092545d72be7b6.js +0 -1
  456. package/assets/esri/core/workers/chunks/03918a862455191a8910.js +0 -1
  457. package/assets/esri/core/workers/chunks/0b727d7bf3e36e146725.js +0 -1
  458. package/assets/esri/core/workers/chunks/0bd067a5c0bac96caeb5.js +0 -1
  459. package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +0 -1
  460. package/assets/esri/core/workers/chunks/114bc14c49176f64a2c5.js +0 -1
  461. package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +0 -1
  462. package/assets/esri/core/workers/chunks/173417fe995e9bfc49d8.js +0 -1
  463. package/assets/esri/core/workers/chunks/1a39335aa2dce6d564d9.js +0 -1
  464. package/assets/esri/core/workers/chunks/25bb07d3c32b16a08813.js +0 -1
  465. package/assets/esri/core/workers/chunks/25cc6d7178a52f2f46b7.js +0 -1
  466. package/assets/esri/core/workers/chunks/2cf571d968118b6bdde0.js +0 -1
  467. package/assets/esri/core/workers/chunks/2e999b05ce179dd9fa08.js +0 -1
  468. package/assets/esri/core/workers/chunks/354912041363502c6a89.js +0 -1
  469. package/assets/esri/core/workers/chunks/36792b8a85e88044cb49.js +0 -1
  470. package/assets/esri/core/workers/chunks/3acc1299c1382c3b034d.js +0 -1
  471. package/assets/esri/core/workers/chunks/430802108b63194b7ddd.js +0 -2
  472. package/assets/esri/core/workers/chunks/43436c7ccc6baefc885d.js +0 -1
  473. package/assets/esri/core/workers/chunks/4396ef5ab3eb9e9a7df2.js +0 -1
  474. package/assets/esri/core/workers/chunks/445b0ca1b70730c9a2e6.js +0 -1
  475. package/assets/esri/core/workers/chunks/48d3da636be15581fd7d.js +0 -1
  476. package/assets/esri/core/workers/chunks/49e8ff5ed079a9e3be4b.js +0 -1
  477. package/assets/esri/core/workers/chunks/4efe5827a5c61db3b19d.js +0 -2
  478. package/assets/esri/core/workers/chunks/501df20cdd09384f6ee2.js +0 -1
  479. package/assets/esri/core/workers/chunks/50ae209237f104735a30.js +0 -1
  480. package/assets/esri/core/workers/chunks/54f9062526c2002b7fd7.js +0 -1
  481. package/assets/esri/core/workers/chunks/56b7ac280bf0be938c14.js +0 -1
  482. package/assets/esri/core/workers/chunks/5938d5f6e37f49867d5a.js +0 -1
  483. package/assets/esri/core/workers/chunks/61bcbafd676804ce3e1d.js +0 -1
  484. package/assets/esri/core/workers/chunks/63f7141c71f29dbe8270.js +0 -1
  485. package/assets/esri/core/workers/chunks/70347d25968975126fa7.js +0 -1
  486. package/assets/esri/core/workers/chunks/726ca458b98bb4334431.js +0 -1
  487. package/assets/esri/core/workers/chunks/75410a4de76e67ed5da4.js +0 -1
  488. package/assets/esri/core/workers/chunks/85780f4fa4b5509f864e.js +0 -1
  489. package/assets/esri/core/workers/chunks/862754d2d659528fe884.js +0 -1
  490. package/assets/esri/core/workers/chunks/8628c027198982baed7c.js +0 -1
  491. package/assets/esri/core/workers/chunks/8675ab3c4dec2f13b9c6.js +0 -1
  492. package/assets/esri/core/workers/chunks/8c521caf050a486b6548.js +0 -1
  493. package/assets/esri/core/workers/chunks/8ce14dd209462f88b163.js +0 -1
  494. package/assets/esri/core/workers/chunks/917dec9c004218c58950.js +0 -1
  495. package/assets/esri/core/workers/chunks/91f451b98e0f696043df.js +0 -1
  496. package/assets/esri/core/workers/chunks/9d92e6f0beed9a8580fa.js +0 -1
  497. package/assets/esri/core/workers/chunks/a42505b978d54d36d3b6.js +0 -1
  498. package/assets/esri/core/workers/chunks/a6d4132a16c51323a38a.js +0 -1
  499. package/assets/esri/core/workers/chunks/a86a4e550a92f770d6d5.js +0 -1
  500. package/assets/esri/core/workers/chunks/add834f867900a7091d2.js +0 -1
  501. package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +0 -1
  502. package/assets/esri/core/workers/chunks/b56c5883a5468b18b122.js +0 -1
  503. package/assets/esri/core/workers/chunks/b5a102cf9f4377fb9842.js +0 -1
  504. package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +0 -1
  505. package/assets/esri/core/workers/chunks/baa8bce361a2677533ec.js +0 -1
  506. package/assets/esri/core/workers/chunks/c118b88a7c4359e68d9b.js +0 -1
  507. package/assets/esri/core/workers/chunks/c5e288d57bacb8451e2d.js +0 -2
  508. package/assets/esri/core/workers/chunks/ce3fb992f6c6ae7378a3.js +0 -1
  509. package/assets/esri/core/workers/chunks/ceda1e08c9ff26248db0.js +0 -1
  510. package/assets/esri/core/workers/chunks/cf1106eda10f3cccb1bd.js +0 -1
  511. package/assets/esri/core/workers/chunks/cfd8317ecd2e63af7c40.js +0 -1
  512. package/assets/esri/core/workers/chunks/d5e3f8e5b8d2576d3cb3.js +0 -2
  513. package/assets/esri/core/workers/chunks/d6130cd8a20d24dd9d3c.js +0 -1
  514. package/assets/esri/core/workers/chunks/da5b3421a984cb94fd58.js +0 -1
  515. package/assets/esri/core/workers/chunks/da6583e8d88441a1c02a.js +0 -1
  516. package/assets/esri/core/workers/chunks/ddb5d29a8998d0a76fd4.js +0 -1
  517. package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +0 -1
  518. package/assets/esri/core/workers/chunks/e52f30dfb7c82491a7f2.js +0 -1
  519. package/assets/esri/core/workers/chunks/e707534a700a2de687ca.js +0 -1
  520. package/assets/esri/core/workers/chunks/e88eee4c2fc4229c2a8b.js +0 -1
  521. package/assets/esri/core/workers/chunks/f465fb26541372fdc908.js +0 -2
  522. package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +0 -1
  523. package/assets/esri/core/workers/chunks/f75e57d3e02f9828b049.js +0 -1
  524. package/assets/esri/core/workers/chunks/f774e5b94710ccee1af0.js +0 -1
  525. package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +0 -1
  526. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToReadShadowMap.glsl.js +0 -4
  527. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +0 -18
  528. package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +0 -4
  529. /package/assets/esri/core/workers/chunks/{430802108b63194b7ddd.js.LICENSE.txt → 033debcbf6b3683dc4fe.js.LICENSE.txt} +0 -0
  530. /package/assets/esri/core/workers/chunks/{4efe5827a5c61db3b19d.js.LICENSE.txt → 064445e6f9512817ac87.js.LICENSE.txt} +0 -0
  531. /package/assets/esri/core/workers/chunks/{c5e288d57bacb8451e2d.js.LICENSE.txt → 463d69f596d1d34ef275.js.LICENSE.txt} +0 -0
  532. /package/assets/esri/core/workers/chunks/{d5e3f8e5b8d2576d3cb3.js.LICENSE.txt → 58a17fb3c0dd07c63d57.js.LICENSE.txt} +0 -0
  533. /package/assets/esri/core/workers/chunks/{7f2ac03efaa4a4898ba2.js.LICENSE.txt → c3b96d1d43afccd23e45.js.LICENSE.txt} +0 -0
  534. /package/assets/esri/core/workers/chunks/{f465fb26541372fdc908.js.LICENSE.txt → ce08e3369641da0d7a27.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../../../../core/Logger.js";import{pt2px as a}from"../../../../../../../core/screenUtils.js";import{CIMSymbolHelper as i}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as n}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as t}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{getMaxSizeVVSize as l,noVisualVariables as o}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as r,hasSizeVVUniform as s}from"./utils.js";function c(a,i){if(a&&i){const n=a.toLowerCase(),t=i.get(n);if(void 0!==t)return{name:n,index:t};e.getLogger("esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema").warn(`Invalid symbol layer name: "${a}"`)}return null}function u(e,a){if(a?.enabled&&a.drawOrder){const i=a.drawOrder.map(e=>e.toLowerCase()).slice().reverse(),n=new Map;for(const a of e)if(a.groupName&&a.name){const e=a.name.toLowerCase(),t=a.groupName.toLowerCase(),l=i.indexOf(t);-1!==l&&(n.has(l)||n.set(l,[]),n.get(l).push(e))}const t=[];i.forEach((e,a)=>{n.has(a)?t.push(...n.get(a)):t.push(e)});const l=new Map;return t.forEach((e,a)=>{l.set(e,a)}),l}return null}function f(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function m(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,n,t]=e;return[a,i,n,255*t]}return"string"==typeof e?e:{...e,defaultValue:m(e?.defaultValue)}}async function p(e,a){const{cimResourceManager:n,cimAnalyzer:t,scaleExpression:l,symbolLayerDrawing:o}=a.schemaOptions,r=e.symbol;if(null==r)return[];await i.normalizeSymbolAndFetchResources(r,n);const s=t.analyzeSymbolReference(e,!1),c=f(e),m=u(s,o),p="CIMPointSymbol"===r.type&&"Map"!==r.angleAlignment?a.schemaOptions.viewRotation:null,b={scaleInfo:c,scaleExpression:l,rotationVariable:a.rotationVariable??null,viewRotation:p,layerOrderMap:m},V=[];for(const i of s)switch(i.type){case"marker":V.push(...S(i,a,b));break;case"fill":V.push(...g(i,a,b));break;case"outlineFill":V.push(...z(i,a,b));break;case"gradientFill":V.push(...M(i,a,b));break;case"line":V.push(...O(i,a,b));break;case"gradientStroke":V.push(...k(i,a,b));break;case"text":V.push(...A(i,a,b))}return V}function S(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:r}=l,{layerOrderMap:s}=i,u=e.isOutline?{...o,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue,visualVariableRotation:n.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=a?t.animatedMarkerShift:t.animatedMarker;return b(r.ensureInstance(n,{uniforms:u,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}},c(e.name,s)),e,o,i)}return h(r.ensureInstance(t.marker,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,s)),e,n,i)}function b(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:r(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:1===a.alignment,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function V(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:r(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2,angle:"angle"in a?a.angle:0})]}function h(e,a,i,{scaleInfo:t,scaleExpression:o}){const r=s(i);return[e.createMeshInfo({size:a.size,scaleX:a.scaleX,anchorX:a.anchorPoint.x,anchorY:a.anchorPoint.y,angle:a.rotation,color:m(a.color)??[0,0,0,0],colorLocked:a.colorLocked,frameHeight:a.frameHeight,widthRatio:a.widthRatio,scaleInfo:t,offsetX:a.offsetX,offsetY:a.offsetY,outlineColor:m(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineWidth,referenceSize:a.referenceSize||n.CIMVectorMarker.size,rotateClockwise:a.rotateClockwise,scaleFactor:o??1,sizeRatio:a.sizeRatio,alignment:a.alignment,isAbsoluteAnchorPoint:a.isAbsoluteAnchorPoint,scaleSymbolsProportionally:a.scaleSymbolsProportionally,sprite:a.spriteRasterizationParam,hasSizeVV:r,placement:a.markerPlacement,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,transforms:a.transform,minPixelBuffer:l(i)})]}function d(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:r}=l,{layerOrderMap:s}=i,u={visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity};if(e.animationParams){const a=t.animatedFill;return V(r.ensureInstance(a,{uniforms:{...u,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},c(e.name,s)),e,o,i)}return y(r.ensureInstance(t.fill,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,s)),e,i)}function z(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return v(o.ensureInstance(t.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,r)),e,i)}function v(e,i,n){const t=m(i.color)??[0,0,0,0],l=m(i.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:t,outlineColor:l,width:i.outlineWidth,referenceWidth:i.referenceWidth,minPixelBuffer:null!=i.pixelBufferSize?a(i.pixelBufferSize)+1:0,capType:i.cap,joinType:i.join,miterLimit:i.miterLimit,outlineUsesColorVV:!i.outlineColorLocked,hasSizeVV:!1,scaleInfo:n.scaleInfo,...C(i,n),effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,outlineEffects:i.outlineEffects?{type:"cim-effect-infos",effectInfos:i.outlineEffects}:null})]}function y(e,a,i){const{scaleInfo:n}=i;return[e.createMeshInfo({color:m(a.color)??[0,0,0,0],scaleInfo:n,...C(a,i),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function g(e,a,i){const{layerOrderMap:n}=i;if(!e.spriteRasterizationParam)return d(e,a,i);const{uniforms:l,schemaOptions:r}=a,{store:s}=r,u={visualVariableColor:e.colorLocked?null:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity};if(e.animationParams){const a=t.animatedFill;return V(s.ensureInstance(a,{uniforms:{...u,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},c(e.name,n)),e,o,i)}return I(s.ensureInstance(t.complexFill,{uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,n)),e,null!=l.visualVariableColor,i)}function I(e,a,i,n){const{scaleInfo:t}=n;if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),o=a.sampleAlphaOnly&&!l,r=a.spriteRasterizationParam;return[e.createMeshInfo({color:m(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:"CIMHatchFill"===r.resource.type,sprite:r,scaleInfo:t,...C(a,n),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function M(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return R(o.ensureInstance(t.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,r)),e,i)}function R(e,a,i){const{scaleInfo:n}=i;if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const t=a.spriteRasterizationParam;return[e.createMeshInfo({color:m(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:t,scaleInfo:n,...C(a,i),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function O(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:r}=l,{layerOrderMap:s}=i,u=e.isOutline?{...o,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=t.animatedLine;return V(r.ensureInstance(n,{uniforms:{...u,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a,angle:!1}},c(e.name,s)),e,o,i)}const f={uniforms:u,optionalAttributes:{zoomRange:!!i.scaleInfo}},m=!!(u.visualVariableSizeMinMaxValue||u.visualVariableSizeScaleStops||u.visualVariableSizeStops||u.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return x(r.ensureInstance(t.line,f,c(e.name,s)),e,m,i)}return L(r.ensureInstance(t.texturedLine,f,c(e.name,s)),e,m,i)}function P(e,a,i){const{scaleInfo:n}=i;return{color:m(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:n,hasSizeVV:a,...C(e,i),effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function C(e,{rotationVariable:a,viewRotation:i}){if(!e.effects?.length&&!e.outlineEffects?.length)return{};const n={};if(e.effectsChangeGeometryType&&(n.useEffectOrigin=!0),null!=i&&(n.viewRotation=i),!a)return n;const t=a.valueExpression??(a.field?`$feature[${JSON.stringify(a.field)}]`:null);return t?(n.effectRotation={valueExpressionInfo:{type:"CIMExpressionInfo",expression:t},defaultValue:0},n.effectRotationType=a.rotationType,n):n}function x(e,a,i,n){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=P(a,i,n);return[e.createMeshInfo(t)]}function L(e,a,i,n){const{spriteRasterizationParam:t,scaleDash:l,sampleAlphaOnly:o}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...P(a,i,n),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:l??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function k(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:r}=l,{layerOrderMap:s}=i;return w(r.ensureInstance(t.gradientStroke,{uniforms:e.isOutline?{...o,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo}},c(e.name,s)),e,i)}function w(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=a.spriteRasterizationParam;return[e.createMeshInfo({...P(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function A(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return E(o.ensureInstance(t.text,{uniforms:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableRotation:n.visualVariableRotation,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1,visibility:!1}},c(e.name,r)),e,n,i)}function E(e,a,i,{scaleInfo:n,scaleExpression:t}){return[e.createMeshInfo({alignment:a.alignment,boxBackgroundColor:m(a.backgroundColor),boxBorderLineColor:m(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:m(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:m(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:m(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:t??1,minPixelBuffer:l(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{b as createAnimatedMarkerMeshInfos,V as createAnimatedPolyMeshInfos,I as createComplexFillMeshInfos,h as createComplexMarkerMeshInfos,y as createComplexSimpleFillMeshInfos,x as createComplexSimpleLineMeshInfos,v as createComplexSimpleOutlineFillMeshInfos,p as createComplexSymbolInstances,E as createComplexTextMeshInfos,L as createComplexTexturedLineMeshInfos,R as createGradientFillMeshInfos,w as createGradientStrokeMeshInfos,f as getScaleInfo};
2
+ import e from"../../../../../../../core/Logger.js";import{pt2px as a}from"../../../../../../../core/screenUtils.js";import{CIMSymbolHelper as i}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as n}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Techniques as t}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{defineMeshWriterReferences as l}from"../../../../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js";import{getMaxSizeVVSize as o,noVisualVariables as r}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as s,hasSizeVVUniform as c}from"./utils.js";function u(a,i){if(a&&i){const n=a.toLowerCase(),t=i.get(n);if(void 0!==t)return{name:n,index:t};e.getLogger("esri.views.2d.layers.features.schema.processor.symbols/ComplexSymbolSchema").warn(`Invalid symbol layer name: "${a}"`)}return null}function f(e,a){if(a?.enabled&&a.drawOrder){const i=a.drawOrder.map(e=>e.toLowerCase()).slice().reverse(),n=new Map;for(const a of e)if(a.groupName&&a.name){const e=a.name.toLowerCase(),t=a.groupName.toLowerCase(),l=i.indexOf(t);-1!==l&&(n.has(l)||n.set(l,[]),n.get(l).push(e))}const t=[];i.forEach((e,a)=>{n.has(a)?t.push(...n.get(a)):t.push(e)});const l=new Map;return t.forEach((e,a)=>{l.set(e,a)}),l}return null}function m(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function p(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,n,t]=e;return[a,i,n,255*t]}return"string"==typeof e?e:{...e,defaultValue:p(e?.defaultValue)}}async function S(e,a,i=!1){return V(e,a,i,!0)}async function b(e,a,i=!1){return V(e,a,i,!1)}async function V(e,a,n,t){const{cimResourceManager:o,cimAnalyzer:r,scaleExpression:s,symbolLayerDrawing:c}=a.schemaOptions,u=e.symbol;if(null==u)return[];await i.normalizeSymbolAndFetchResources(u,o);const p=r.analyzeSymbolReference(e,!1),S=m(e),b=f(p,c),V=h(u,p,n),d="CIMPointSymbol"===u.type&&"Map"!==u.angleAlignment,y=d||V?a.schemaOptions.viewRotation:null,v={scaleInfo:S,scaleExpression:s,rotationVariable:a.rotationVariable??null,viewRotation:y,viewRotationForCalloutsOnly:V&&!d,layerOrderMap:b},g=[];for(const i of p)switch(i.type){case"marker":g.push(...z(i,a,v));break;case"fill":g.push(...O(i,a,v));break;case"outlineFill":g.push(...M(i,a,v));break;case"gradientFill":g.push(...k(i,a,v));break;case"line":g.push(...x(i,a,v));break;case"gradientStroke":g.push(...T(i,a,v));break;case"text":g.push(...F(i,a,v))}if(n)for(const i of g)i.inputParams.collisionVisibility=!0;return t?l(g):g}function h(e,a,i){return!i&&"CIMLineSymbol"===e.type&&a.some(e=>("marker"===e.type||"text"===e.type)&&0===e.alignment)&&a.some(d)}function d(e){return[...e.effects??[],..."outlineEffects"in e?e.outlineEffects??[]:[]].some(({effect:e})=>"CIMSimpleLineCallout"===e.type||"CIMBackgroundCallout"===e.type||"CIMBalloonCallout"===e.type||"CIMPointSymbolCallout"===e.type)}function z(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:s}=i,c=e.isOutline?{...r,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue,visualVariableRotation:n.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=a?t.animatedMarkerShift:t.animatedMarker;return y(o.ensureInstance(n,{uniforms:c,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}},u(e.name,s)),e,r,i)}return g(o.ensureInstance(t.marker,{uniforms:c,optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,s)),e,n,i)}function y(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:s(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:1===a.alignment,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function v(e,a,i,n){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:s(a),animations:a.animationParams,scaleInfo:n.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2,angle:"angle"in a?a.angle:0})]}function g(e,a,i,{scaleInfo:t,scaleExpression:l}){const r=c(i);return[e.createMeshInfo({size:a.size,scaleX:a.scaleX,anchorX:a.anchorPoint.x,anchorY:a.anchorPoint.y,angle:a.rotation,color:p(a.color)??[0,0,0,0],colorLocked:a.colorLocked,frameHeight:a.frameHeight,widthRatio:a.widthRatio,scaleInfo:t,offsetX:a.offsetX,offsetY:a.offsetY,outlineColor:p(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineWidth,referenceSize:a.referenceSize||n.CIMVectorMarker.size,rotateClockwise:a.rotateClockwise,scaleFactor:l??1,sizeRatio:a.sizeRatio,alignment:a.alignment,isAbsoluteAnchorPoint:a.isAbsoluteAnchorPoint,scaleSymbolsProportionally:a.scaleSymbolsProportionally,sprite:a.spriteRasterizationParam,hasSizeVV:r,placement:a.markerPlacement,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,transforms:a.transform,minPixelBuffer:o(i)})]}function I(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:s}=i,c={visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity};if(e.animationParams){const a=t.animatedFill;return v(o.ensureInstance(a,{uniforms:{...c,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}},u(e.name,s)),e,r,i)}return R(o.ensureInstance(t.fill,{uniforms:c,optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,s)),e,i)}function M(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return C(o.ensureInstance(t.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,r)),e,i)}function C(e,i,n){const t=p(i.color)??[0,0,0,0],l=p(i.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:t,outlineColor:l,width:i.outlineWidth,referenceWidth:i.referenceWidth,minPixelBuffer:null!=i.pixelBufferSize?a(i.pixelBufferSize)+1:0,capType:i.cap,joinType:i.join,miterLimit:i.miterLimit,outlineUsesColorVV:!i.outlineColorLocked,hasSizeVV:!1,scaleInfo:n.scaleInfo,...A(i,n),effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,outlineEffects:i.outlineEffects?{type:"cim-effect-infos",effectInfos:i.outlineEffects}:null})]}function R(e,a,i){const{scaleInfo:n}=i;return[e.createMeshInfo({color:p(a.color)??[0,0,0,0],scaleInfo:n,...A(a,i),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function O(e,a,i){const{layerOrderMap:n}=i;if(!e.spriteRasterizationParam)return I(e,a,i);const{uniforms:l,schemaOptions:o}=a,{store:s}=o,c={visualVariableColor:e.colorLocked?null:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity};if(e.animationParams){const a=t.animatedFill;return v(s.ensureInstance(a,{uniforms:{...c,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1,angle:!!e.angle}},u(e.name,n)),e,r,i)}return P(s.ensureInstance(t.complexFill,{uniforms:c,optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,n)),e,null!=l.visualVariableColor,i)}function P(e,a,i,n){const{scaleInfo:t}=n;if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),o=a.sampleAlphaOnly&&!l,r=a.spriteRasterizationParam;return[e.createMeshInfo({color:p(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:"CIMHatchFill"===r.resource.type,sprite:r,scaleInfo:t,...A(a,n),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function k(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return L(o.ensureInstance(t.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,r)),e,i)}function L(e,a,i){const{scaleInfo:n}=i;if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const t=a.spriteRasterizationParam;return[e.createMeshInfo({color:p(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:t,scaleInfo:n,...A(a,i),effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function x(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:s}=i,c=e.isOutline?{...r,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,n=t.animatedLine;return v(o.ensureInstance(n,{uniforms:{...c,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a,angle:!1}},u(e.name,s)),e,r,i)}const f={uniforms:c,optionalAttributes:{zoomRange:!!i.scaleInfo}},m=!!(c.visualVariableSizeMinMaxValue||c.visualVariableSizeScaleStops||c.visualVariableSizeStops||c.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return E(o.ensureInstance(t.line,f,u(e.name,s)),e,m,i)}return U(o.ensureInstance(t.texturedLine,f,u(e.name,s)),e,m,i)}function w(e,a,i){const{scaleInfo:n}=i;return{color:p(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:n,hasSizeVV:a,...A(e,i),effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function A(e,{rotationVariable:a,viewRotation:i,viewRotationForCalloutsOnly:n}){if(!e.effects?.length&&!e.outlineEffects?.length)return{};const t={};if(e.effectsChangeGeometryType&&(t.useEffectOrigin=!0),null!=i&&(!n||"text"!==e.type&&d(e))&&(t.viewRotation=i),!a)return t;const l=a.valueExpression??(a.field?`$feature[${JSON.stringify(a.field)}]`:null);return l?(t.effectRotation={valueExpressionInfo:{type:"CIMExpressionInfo",expression:l},defaultValue:0},t.effectRotationType=a.rotationType,t):t}function E(e,a,i,n){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=w(a,i,n);return[e.createMeshInfo(t)]}function U(e,a,i,n){const{spriteRasterizationParam:t,scaleDash:l,sampleAlphaOnly:o}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...w(a,i,n),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:l??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function T(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:s}=i;return j(o.ensureInstance(t.gradientStroke,{uniforms:e.isOutline?{...r,visualVariableSizeScaleStops:n.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo}},u(e.name,s)),e,i)}function j(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=a.spriteRasterizationParam;return[e.createMeshInfo({...w(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function F(e,a,i){const{uniforms:n,schemaOptions:l}=a,{store:o}=l,{layerOrderMap:r}=i;return W(o.ensureInstance(t.text,{uniforms:{visualVariableColor:e.colorLocked?null:n.visualVariableColor,visualVariableOpacity:n.visualVariableOpacity,visualVariableRotation:n.visualVariableRotation,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1}},u(e.name,r)),e,n,i)}function W(e,a,i,{scaleInfo:n,scaleExpression:t}){return[e.createMeshInfo({alignment:a.alignment,boxBackgroundColor:null,boxBorderLineColor:null,boxBorderLineSize:0,backgroundColor:p(a.backgroundColor),borderLineColor:p(a.borderLineColor),borderLineWidth:a.borderLineWidth??0,useBackgroundCallout:a.useBackgroundCallout,color:p(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:p(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:p(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:n,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:t??1,minPixelBuffer:o(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}export{y as createAnimatedMarkerMeshInfos,v as createAnimatedPolyMeshInfos,P as createComplexFillMeshInfos,g as createComplexMarkerMeshInfos,R as createComplexSimpleFillMeshInfos,E as createComplexSimpleLineMeshInfos,C as createComplexSimpleOutlineFillMeshInfos,S as createComplexSymbolInstances,b as createComplexSymbolPartSchemas,W as createComplexTextMeshInfos,U as createComplexTexturedLineMeshInfos,L as createGradientFillMeshInfos,j as createGradientStrokeMeshInfos,m as getScaleInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../../../../core/Logger.js";import{pt2px as i}from"../../../../../../../core/screenUtils.js";import{generateGradient as a}from"../../../../../../../renderers/support/heatmapUtils.js";import l from"../../../../../../../symbols/SimpleFillSymbol.js";import r from"../../../../../../../symbols/SimpleLineSymbol.js";import t from"../../../../../../../symbols/SimpleMarkerSymbol.js";import{CIMSymbolHelper as o,slsDashToTemplateArray as s}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{hasRichTextFormattingTags as n}from"../../../../../../../symbols/cim/richTextUtils.js";import{getSDFInfo as u}from"../../../../../../../symbols/cim/SDFHelper.js";import{getAlignmentFromPlacement as c}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as p}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as f}from"../../../../../engine/webgl/definitions.js";import{Techniques as b}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{maxPieChartFields as m}from"../../../../../engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js";import{premultiplyColor as S}from"../schemaUtils.js";import{createVisualVariableUniforms as y,getMaxSizeVVSize as V,noVisualVariables as v}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as h}from"./ComplexSymbolSchema.js";import{hasSizeVVUniform as z,hasRotationVVUniform as d}from"./utils.js";async function g(i,a){if(!i)return[];switch(i.type){case"simple-fill":return F(i,a);case"picture-fill":return P(i,a);case"simple-marker":return w(i,a);case"picture-marker":return O(i,a);case"simple-line":return B(i,a,!1);case"text":return L(i,a);case"label":return R(i,a);case"cim":return h(i.data,a);case"web-style":return g(await i.fetchSymbol({acceptedFormats:["cim","web"]}),a);case"line-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-line`),B(new r,a,!1);case"point-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-marker`),w(new t,a);case"polygon-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Defaulting to simple-fill`),F(new l,a);case"mesh-3d":case"label-3d":return e.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${i.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function x(e,i){const{schemaOptions:a}=i,{store:r}=a,t=new Array(f),o=new Array(f/4);for(let l=0;l<f;l++){const i=l<e.attributes.length?e.attributes[l].color:null;t[l]=[0,0,0,0],p(t[l],i)}for(let l=0;l<f/4;l++)o[l]=[0,0,0,0],o[l][0]=4*l<e.attributes.length?1:0,o[l][1]=4*l+1<e.attributes.length?1:0,o[l][2]=4*l+2<e.attributes.length?1:0,o[l][3]=4*l+3<e.attributes.length?1:0;const s={uniforms:{isActive:o,colors:t,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},optionalAttributes:{}},n=r.ensureInstance(b.dotDensity,s).createMeshInfo({effects:null}),u=[],c=new l({color:e.backgroundColor??[0,0,0,0],outline:null}),m=await g(c,i);if(u.push(...m),u.push(n),e.outline){const a=B(e.outline,i,!0);u.push(...a)}return u}async function M(e,l){const{store:r}=l,{radius:t,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:c,colorStops:p}=e,f=a(p);return[r.ensureInstance(b.heatmap,{uniforms:{radius:i(t),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!c),gradient:f,gradientHash:f.join(",")},optionalAttributes:{}}).createMeshInfo({effects:null})]}async function C(e,a){const{store:l}=a,r=e.outline?.width||0,t=y(e),o=Math.min(e.attributes.length,m),s=e.attributes.slice(0,o).map(e=>S(e.color));for(;s.length<m;)s.push([0,0,0,0]);const n=l.ensureInstance(b.pieChart,{uniforms:{shader:{chart:{outlineWidth:Math.round(i(r)),defaultColor:S(e.defaultColor),outlineColor:S(e.outline?.color),othersColor:S(e.othersCategory?.color),donutRatio:e.holePercentage,sectorThreshold:e.othersCategory?.threshold||0,colors:s,fieldCount:o},visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},optionalAttributes:{zoomRange:!0}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:V(t)});return[...e.backgroundFillSymbol?await F(e.backgroundFillSymbol,{schemaOptions:a,uniforms:v}):[],n]}function I(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const i=o.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:i.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:u(i),overrides:[]}}async function w(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const l=o.fromSimpleMarker(e);if(!l||!l.symbolLayers)throw new Error("Error handling marker! ");if(a.visualVariableRotation&&(l.angleAlignment="Map"),"path"!==e.style){const e=l.symbolLayers[0];if(z(i.uniforms)){const a=V(i.uniforms,0,1);if(a>e.size){const i=a/e.size;e.size=a;const l=e.markerGraphics?.[0].symbol;(l.symbolLayers&&l.symbolLayers[0]).width*=i}}}return h({type:"CIMSymbolReference",symbol:l},i)}const t=r.ensureInstance(b.marker,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue,visualVariableRotation:a.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=I(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===s.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,c=e.size,p=c*u,f=null!=a.visualVariableColor&&("cross"===e.style||"x"===e.style);return[t.createMeshInfo({type:"simple",color:n,height:c,width:p,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:d(a)?1:0,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:c,sprite:s,overrideOutlineColor:f,hasSizeVV:z(a),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:V(a)})]}function O(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=r.ensureInstance(b.marker,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue,visualVariableRotation:a.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=o.createPictureMarkerRasterizationParam(e);if(!s)return[];return[t.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:d(a)?1:0,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:s,overrideOutlineColor:!1,hasSizeVV:z(a),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:V(a)})]}function A(e,i,a){const{uniforms:l,schemaOptions:r}=a,{store:t}=r,o=t.ensureInstance(b.marker,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=I(e),n=6,u=n*i.width,c=u,p=e.color?.toArray()??i.color?.toArray()??[0,0,0,0],f="cross"===e.style||"x"===e.style;let m;switch(e.placement){case"begin-end":m="Both";break;case"begin":m="JustBegin";break;case"end":m="JustEnd";break;default:m="None"}const S={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:m,offsetAlongLine:0},overrides:[]};return[o.createMeshInfo({type:"simple",color:p,height:c,width:u,offsetX:0,offsetY:0,angle:0,alignment:d(l)?1:0,outlineColor:p,outlineSize:f?i.width:0,referenceSize:c/n,sprite:s,overrideOutlineColor:f&&null!=l.visualVariableColor,hasSizeVV:z(l),placement:S,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:V(l)})]}function L(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l;return[r.ensureInstance(b.text,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableRotation:a.visualVariableRotation,visualVariableSizeMinMaxValue:a.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:a.visualVariableSizeScaleStops,visualVariableSizeStops:a.visualVariableSizeStops,visualVariableSizeUnitValue:a.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1,visibility:!1}}).createMeshInfo({alignment:0,boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:o.createCIMTextSymbolfromTextSymbol(e),supportsRichText:n(e.text)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:V(a),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}function R(e,a){const{schemaOptions:l,uniforms:r}=a,{store:t}=l,s=e.symbol,{allowOverrun:n,repeatLabel:u,repeatLabelDistance:p}=e,f={maxScale:e.maxScale??0,minScale:e.minScale??0},m=t.ensureInstance(b.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0,visibility:!0}}),S=e.labelPlacement,[y,v]=c(S);return[m.createMeshInfo({alignment:0,boxBackgroundColor:s.backgroundColor?.toArray(),boxBorderLineColor:s.borderLineColor?.toArray(),boxBorderLineSize:s.borderLineSize??0,color:s.color?.toArray()??[0,0,0,0],offsetX:s.xoffset,offsetY:s.yoffset,postAngle:s.angle,fontSize:s.font.size,decoration:s.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:s.haloColor?.toArray()??[0,0,0,0],haloSize:s.haloSize??0,lineWidth:s.lineWidth,lineHeightRatio:s.lineHeight,horizontalAlignment:y,verticalAlignment:v,repeatLabel:u,repeatLabelDistance:i(p),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:f,minPixelBuffer:V(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:s.font.toJSON(),textString:s.text,symbol:o.createCIMTextSymbolfromTextSymbol(s),primitiveName:"label-override",supportsRichText:!0},useLegacyLabelEvaluationRules:null==e.labelExpressionInfo?.expression,overrides:[{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,layerId:a.layerId,labelClassId:a.labelClassId})]}function k(e,i){const a=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:a,referenceWidth:a,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:i,outlineUsesColorVV:!1}}function j(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[r.ensureInstance(b.patternOutlineFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeScaleStops:a.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,...k(e.outline,!!a.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null})]}const s=[],n=r.ensureInstance(b.patternFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null});return s.push(n),e.outline&&s.push(...B(e.outline,i,!0)),s}function U(e,i){const{uniforms:a,schemaOptions:l}=i,{store:r}=l,t=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[r.ensureInstance(b.outlineFill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity,visualVariableSizeScaleStops:a.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,...k(e.outline,!!a.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})]}const o=[];if("none"!==e.style){const e=r.ensureInstance(b.fill,{uniforms:{visualVariableColor:a.visualVariableColor,visualVariableOpacity:a.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:t,scaleInfo:null,effects:null});o.push(e)}return e.outline&&o.push(...B(e.outline,i,!0)),o}async function F(e,i){if("cim"===e.type)return h(e.data,i);const{style:a}=e;return a&&"none"!==a&&"solid"!==a?j(e,i):U(e,i)}function P(e,i){const{outline:a}=e,{uniforms:l,schemaOptions:r}=i,{store:t}=r,s=[],n=o.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:c,xoffset:p,yoffset:f,xscale:m,yscale:S}=e,y={color:[255,255,255,255],sprite:n,height:c,aspectRatio:u/c,offsetX:p,offsetY:f,scaleX:m,scaleY:S,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===a?.style){return[t.ensureInstance(b.complexOutlineFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...y,...k(a,!!l.visualVariableSizeOutlineScaleStops)})]}const V=t.ensureInstance(b.complexFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return s.push(V.createMeshInfo(y)),a&&s.push(...B(a,i,!0)),s}function B(e,i,a){const{color:l,style:r,width:t,cap:o,join:n}=e,{schemaOptions:u}=i,{store:c}=u,p=[],f=a?{...v,visualVariableSizeScaleStops:i.uniforms.visualVariableSizeOutlineScaleStops}:i.uniforms,m={uniforms:{visualVariableColor:f.visualVariableColor,visualVariableOpacity:f.visualVariableOpacity,visualVariableSizeMinMaxValue:f.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:f.visualVariableSizeScaleStops,visualVariableSizeStops:f.visualVariableSizeStops,visualVariableSizeUnitValue:f.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},S={color:l?.toArray()??[0,0,0,0],width:t,referenceWidth:t,capType:o,joinType:n,miterLimit:e.miterLimit,hasSizeVV:z(f),effects:null,scaleInfo:null};if(null==r||"solid"===r){const e=c.ensureInstance(b.line,m).createMeshInfo(S);p.push(e)}else if("none"!==r){const e=c.ensureInstance(b.texturedLine,m).createMeshInfo({...S,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:s(r,o)},overrides:[]}});p.push(e)}return null!=e.marker&&p.push(...A(e.marker,e,i)),p}export{x as createDotDensityMeshSchemas,M as createHeatmapMeshSchemas,B as createLineInstance,C as createPieChartMeshSchemas,g as createSymbolMeshSchemas};
2
+ import{getFontFamily as e}from"../../../../../../../core/fontUtils.js";import a from"../../../../../../../core/Logger.js";import{pt2px as l}from"../../../../../../../core/screenUtils.js";import{generateGradient as i}from"../../../../../../../renderers/support/heatmapUtils.js";import t from"../../../../../../../symbols/SimpleFillSymbol.js";import r from"../../../../../../../symbols/SimpleLineSymbol.js";import o from"../../../../../../../symbols/SimpleMarkerSymbol.js";import{CIMSymbolHelper as s,slsDashToTemplateArray as n}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{fromCIMFontStyle as u}from"../../../../../../../symbols/cim/fromCIMFontStyle.js";import{hasRichTextFormattingTags as c}from"../../../../../../../symbols/cim/richTextUtils.js";import{getSDFInfo as p}from"../../../../../../../symbols/cim/SDFHelper.js";import{getFillColor as f,getStrokeColor as m,getStrokeWidth as b,fromCIMFontDecoration as S}from"../../../../../../../symbols/cim/utils.js";import{getAlignmentFromPlacement as y}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as V}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as h}from"../../../../../engine/webgl/definitions.js";import{Techniques as v}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{defineMeshWriterReferences as d}from"../../../../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js";import{maxPieChartFields as z}from"../../../../../engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js";import{premultiplyColor as g}from"../schemaUtils.js";import{createVisualVariableUniforms as C,getMaxSizeVVSize as M,noVisualVariables as x}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as I,createComplexSymbolPartSchemas as w}from"./ComplexSymbolSchema.js";import{hasSizeVVUniform as O,hasRotationVVUniform as A}from"./utils.js";async function L(e,l){if(!e)return[];switch(e.type){case"simple-fill":return d(await q(e,l));case"picture-fill":return d(await G(e,l));case"simple-marker":return d(await F(e,l));case"picture-marker":return d(await P(e,l));case"simple-line":return d(J(e,l,!1));case"text":return d(E(e,l));case"label":return T(e,l);case"cim":return I(e.data,l);case"web-style":return L(await e.fetchSymbol({acceptedFormats:["cim","web"]}),l);case"line-3d":return a.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-line`),d(await J(new r,l,!1));case"point-3d":return a.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-marker`),d(await F(new o,l));case"polygon-3d":return a.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-fill`),d(await q(new t,l));case"mesh-3d":case"label-3d":return a.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function R(e,a){const{schemaOptions:l}=a,{store:i}=l,r=new Array(h),o=new Array(h/4);for(let t=0;t<h;t++){const a=t<e.attributes.length?e.attributes[t].color:null;r[t]=[0,0,0,0],V(r[t],a)}for(let t=0;t<h/4;t++)o[t]=[0,0,0,0],o[t][0]=4*t<e.attributes.length?1:0,o[t][1]=4*t+1<e.attributes.length?1:0,o[t][2]=4*t+2<e.attributes.length?1:0,o[t][3]=4*t+3<e.attributes.length?1:0;const s={uniforms:{isActive:o,colors:r,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},optionalAttributes:{}},n=i.ensureInstance(v.dotDensity,s).createMeshInfo({effects:null}),u=[],c=new t({color:e.backgroundColor??[0,0,0,0],outline:null}),p=await L(c,a);if(u.push(...p),u.push(n),e.outline){const l=J(e.outline,a,!0);u.push(...l)}return u}async function k(e,a){const{store:t}=a,{radius:r,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:c,colorStops:p}=e,f=i(p);return[t.ensureInstance(v.heatmap,{uniforms:{radius:l(r),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!c),gradient:f,gradientHash:f.join(",")},optionalAttributes:{}}).createMeshInfo({effects:null})]}async function j(e,a){const{store:i}=a,t=e.outline?.width||0,r=C(e),o=Math.min(e.attributes.length,z),s=e.attributes.slice(0,o).map(e=>g(e.color));for(;s.length<z;)s.push([0,0,0,0]);const n=i.ensureInstance(v.pieChart,{uniforms:{shader:{chart:{outlineWidth:Math.round(l(t)),defaultColor:g(e.defaultColor),outlineColor:g(e.outline?.color),othersColor:g(e.othersCategory?.color),donutRatio:e.holePercentage,sectorThreshold:e.othersCategory?.threshold||0,colors:s,fieldCount:o},visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue}},optionalAttributes:{zoomRange:!0}}).createMeshInfo({size:e.size,outlineWidth:t,effects:null,scaleInfo:null,minPixelBuffer:M(r)});return[...e.backgroundFillSymbol?await q(e.backgroundFillSymbol,{schemaOptions:a,uniforms:x}):[],n]}function U(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const a=s.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!a||!a.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:a.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:p(a),overrides:[]}}async function F(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const i=s.fromSimpleMarker(e);if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");if(l.visualVariableRotation&&(i.angleAlignment="Map"),"path"!==e.style){const e=i.symbolLayers[0];if(O(a.uniforms)){const l=M(a.uniforms,0,1);if(l>e.size){const a=l/e.size;e.size=l;const i=e.markerGraphics?.[0].symbol;(i.symbolLayers&&i.symbolLayers[0]).width*=a}}}return I({type:"CIMSymbolReference",symbol:i},a)}const r=t.ensureInstance(v.marker,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=U(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===o.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,c=e.size,p=c*u,f=null!=l.visualVariableColor&&("cross"===e.style||"x"===e.style);return[r.createMeshInfo({type:"simple",color:n,height:c,width:p,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:A(l)?1:0,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:c,sprite:o,overrideOutlineColor:f,hasSizeVV:O(l),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:M(l)})]}function P(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i,r=t.ensureInstance(v.marker,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue,visualVariableRotation:l.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=s.createPictureMarkerRasterizationParam(e);if(!o)return[];return[r.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:A(l)?1:0,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:o,overrideOutlineColor:!1,hasSizeVV:O(l),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:M(l)})]}function B(e,a,l){const{uniforms:i,schemaOptions:t}=l,{store:r}=t,o=r.ensureInstance(v.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),s=U(e),n=6,u=n*a.width,c=u,p=e.color?.toArray()??a.color?.toArray()??[0,0,0,0],f="cross"===e.style||"x"===e.style;let m;switch(e.placement){case"begin-end":m="Both";break;case"begin":m="JustBegin";break;case"end":m="JustEnd";break;default:m="None"}const b={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:m,offsetAlongLine:0},overrides:[]};return[o.createMeshInfo({type:"simple",color:p,height:c,width:u,offsetX:0,offsetY:0,angle:0,alignment:A(i)?1:0,outlineColor:p,outlineSize:f?a.width:0,referenceSize:c/n,sprite:s,overrideOutlineColor:f&&null!=i.visualVariableColor,hasSizeVV:O(i),placement:b,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:M(i)})]}function E(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i;return[t.ensureInstance(v.text,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableRotation:l.visualVariableRotation,visualVariableSizeMinMaxValue:l.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:l.visualVariableSizeScaleStops,visualVariableSizeStops:l.visualVariableSizeStops,visualVariableSizeUnitValue:l.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}}).createMeshInfo({alignment:0,boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:s.createCIMTextSymbolfromTextSymbol(e),supportsRichText:c(e.text)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:M(l),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,layerId:null,labelClassId:null})]}async function T(e,a){const{schemaOptions:i,uniforms:t}=a,{store:r}=i,o=e.symbol,n="cim"===o.type?o:null,u="CIMTextSymbol"===n?.data.symbol?.type?n.data.symbol:null;if(n&&!u)throw new Error("InternalError: CIM label symbols must contain a CIMTextSymbol");const c=u?null:o,{allowOverrun:p,repeatLabel:S,repeatLabelDistance:V}=e,h={maxScale:e.maxScale??0,minScale:e.minScale??0},d=u?D(u):null,z=u??s.createCIMTextSymbolfromTextSymbol(c),g=W(u?.callout)?u.callout:null,C=g?await w({type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[],callout:g},primitiveOverrides:n.data.primitiveOverrides},a,!0):[],x=r.ensureInstance(v.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}}),I=e.labelPlacement,[O,A]=y(I),L={...x.createMeshInfo({alignment:0,boxBackgroundColor:c?.backgroundColor?.toArray(),boxBorderLineColor:c?.borderLineColor?.toArray(),boxBorderLineSize:c?.borderLineSize??0,color:u?N(f(u),[0,0,0,255]):c?.color?.toArray()??[0,0,0,0],offsetX:u?u.offsetX??0:c.xoffset,offsetY:u?u.offsetY??0:c.yoffset,labelOffsetDistance:g?e.offsetDistance:0,postAngle:u?u.angle??0:c.angle,fontSize:u?u.height??10:c.font.size,decoration:d?.decoration??c.font.decoration,outlineColor:u?N(m(u),[0,0,0,0]):[0,0,0,0],outlineSize:u?b(u)??0:0,haloColor:u?N(f(u.haloSymbol)??m(u.haloSymbol),[0,0,0,0]):c?.haloColor?.toArray()??[0,0,0,0],haloSize:u?u.haloSize??0:c.haloSize??0,lineWidth:u?u.lineWidth??512:c.lineWidth,lineHeightRatio:c?.lineHeight??1,horizontalAlignment:O,verticalAlignment:A,repeatLabel:S,repeatLabelDistance:l(V),allowOverrun:p,labelPosition:e.labelPosition,scaleInfo:h,minPixelBuffer:M(t),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:d??c.font.toJSON(),textString:c?.text??"",symbol:z,primitiveName:"label-override",supportsRichText:!0},useLegacyLabelEvaluationRules:null==e.labelExpressionInfo?.expression,overrides:[{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,layerId:a.layerId,labelClassId:a.labelClassId,collisionVisibility:!0}),references:{externalDependencies:["label-reference-symbol"],...g?{exports:["callout-body"]}:null}};return[...g?C.map(e=>({...e,id:r.ensureLabelPhaseInstanceId(e.id),references:{...e.references,dependencies:["callout-body"]}})):C,L]}function D(a){return{family:e(a.fontFamilyName),decoration:S(a),...u(a.fontStyleName)}}function W(e){return"CIMSimpleLineCallout"===e?.type||"CIMBackgroundCallout"===e?.type||"CIMBalloonCallout"===e?.type||"CIMPointSymbolCallout"===e?.type}function N(e,a){return 4===e?.length?[e[0],e[1],e[2],e[3]]:a}function X(e,a){const l=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:l,referenceWidth:l,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:a,outlineUsesColorVV:!1}}function Y(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i,r=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[t.ensureInstance(v.patternOutlineFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:r,...X(e.outline,!!l.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null})]}const s=[],n=t.ensureInstance(v.patternFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null});return s.push(n),e.outline&&s.push(...J(e.outline,a,!0)),s}function H(e,a){const{uniforms:l,schemaOptions:i}=a,{store:t}=i,r=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[t.ensureInstance(v.outlineFill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:r,...X(e.outline,!!l.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})]}const o=[];if("none"!==e.style){const e=t.ensureInstance(v.fill,{uniforms:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:r,scaleInfo:null,effects:null});o.push(e)}return e.outline&&o.push(...J(e.outline,a,!0)),o}async function q(e,a){if("cim"===e.type)return I(e.data,a);const{style:l}=e;return l&&"none"!==l&&"solid"!==l?Y(e,a):H(e,a)}function G(e,a){const{outline:l}=e,{uniforms:i,schemaOptions:t}=a,{store:r}=t,o=[],n=s.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:c,xoffset:p,yoffset:f,xscale:m,yscale:b}=e,S={color:[255,255,255,255],sprite:n,height:c,aspectRatio:u/c,offsetX:p,offsetY:f,scaleX:m,scaleY:b,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===l?.style){return[r.ensureInstance(v.complexOutlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...S,...X(l,!!i.visualVariableSizeOutlineScaleStops)})]}const y=r.ensureInstance(v.complexFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return o.push(y.createMeshInfo(S)),l&&o.push(...J(l,a,!0)),o}function J(e,a,l){const{color:i,style:t,width:r,cap:o,join:s}=e,{schemaOptions:u}=a,{store:c}=u,p=[],f=l?{...x,visualVariableSizeScaleStops:a.uniforms.visualVariableSizeOutlineScaleStops}:a.uniforms,m={uniforms:{visualVariableColor:f.visualVariableColor,visualVariableOpacity:f.visualVariableOpacity,visualVariableSizeMinMaxValue:f.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:f.visualVariableSizeScaleStops,visualVariableSizeStops:f.visualVariableSizeStops,visualVariableSizeUnitValue:f.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},b={color:i?.toArray()??[0,0,0,0],width:r,referenceWidth:r,capType:o,joinType:s,miterLimit:e.miterLimit,hasSizeVV:O(f),effects:null,scaleInfo:null};if(null==t||"solid"===t){const e=c.ensureInstance(v.line,m).createMeshInfo(b);p.push(e)}else if("none"!==t){const e=c.ensureInstance(v.texturedLine,m).createMeshInfo({...b,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:n(t,o)},overrides:[]}});p.push(e)}return null!=e.marker&&p.push(...B(e.marker,e,a)),p}export{R as createDotDensityMeshSchemas,k as createHeatmapMeshSchemas,J as createLineInstance,j as createPieChartMeshSchemas,L as createSymbolMeshSchemas};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as r,isGeometryWithZ as s,isGeometryWithM as i}from"../../../../../geometry/support/jsonTypeUtils.js";import{convertFromGeometry as o,generalizeOptimizedGeometry as n,quantizeOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import u from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as c}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as d}from"./FeatureSetReader.js";class a extends d{static from(e,t,r){return new a(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const s=t.lod;s.wrap&&(this._wrappingInfo={worldSizeX:s.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return null!=this._current.attributes[e]}field(e){return this.readAttribute(e)}get geometryType(){const e=r(this._current.geometry);return"esriGeometryPoint"===e?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new a(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw new Error("InternalError: exceededTransferLimit not implemented for graphics.")}get hasZ(){return s(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw new Error("InternalError: Setting displayId not supported for graphics.")}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw new Error("InternalError: readGeometryArea not supported for graphics.")}_readGeometry(){if(!this._cachedGeometry){let e=o(this._current.projectedGeometry);if("esriGeometryPolyline"===this.geometryType&&(e=n(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=h(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;const{worldSizeX:t}=this._wrappingInfo;if(e.isPoint)return 1===t?(e.coords.push(c,0),e.coords.push(2*-c,0),void e.lengths.push(3)):2===t?(e.coords.push(2*c,0),e.coords.push(4*-c,0),void e.lengths.push(3)):void this._wrapVertex(e.coords,0,2,t);if("esriGeometryMultipoint"!==this.geometryType);else{if(1===t){const t=e.coords.slice();t[0]-=512;const r=e.coords.slice();r[0]+=512,e.coords.push(...t,...r);const s=e.lengths[0];return void e.lengths.push(s,s)}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,r,s){const i=t*r,o=e[i];o<-c*(s-2)?e[i]=o+c*s:o>c*(s-1)&&(e[i]=o-c*s)}_readX(){const e=this._readGeometry();return null!=e?e.coords[0]:0}_readY(){const e=this._readGeometry();return null!=e?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=t(this._current.projectedGeometry),r=new u([],e,this.hasZ,!1);return h(r,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const t=this._current.projectedGeometry,r=e(t.paths,this.hasZ),s=new u([],r,this.hasZ,!1);return h(s,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(void 0!==r)return r;const s=e.toLowerCase();for(const i in this._current.attributes)if(i.toLowerCase()===s)return this._current.attributes[i]}_readAttributes(){return this._current.attributes}}export{a as GraphicsReader};
2
+ import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as r,isGeometryWithZ as s,isGeometryWithM as i}from"../../../../../geometry/support/jsonTypeUtils.js";import{convertFromGeometry as o,generalizeOptimizedGeometry as n,quantizeOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import u from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as c}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as d}from"./FeatureSetReader.js";class a extends d{static from(e,t,r){return new a(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const s=t.lod;s.wrap&&(this._wrappingInfo={worldSizeX:s.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??{writers:[],dependencies:new Map,exports:new Map,requiresCoordination:!1}}hasField(e){return null!=this._current.attributes[e]}field(e){return this.readAttribute(e)}get geometryType(){const e=r(this._current.geometry);return"esriGeometryPoint"===e?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new a(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw new Error("InternalError: exceededTransferLimit not implemented for graphics.")}get hasZ(){return s(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw new Error("InternalError: Setting displayId not supported for graphics.")}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw new Error("InternalError: readGeometryArea not supported for graphics.")}_readGeometry(){if(!this._cachedGeometry){let e=o(this._current.projectedGeometry);if("esriGeometryPolyline"===this.geometryType&&(e=n(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=h(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;const{worldSizeX:t}=this._wrappingInfo;if(e.isPoint)return 1===t?(e.coords.push(c,0),e.coords.push(2*-c,0),void e.lengths.push(3)):2===t?(e.coords.push(2*c,0),e.coords.push(4*-c,0),void e.lengths.push(3)):void this._wrapVertex(e.coords,0,2,t);if("esriGeometryMultipoint"!==this.geometryType);else{if(1===t){const t=e.coords.slice();t[0]-=512;const r=e.coords.slice();r[0]+=512,e.coords.push(...t,...r);const s=e.lengths[0];return void e.lengths.push(s,s)}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,r,s){const i=t*r,o=e[i];o<-c*(s-2)?e[i]=o+c*s:o>c*(s-1)&&(e[i]=o-c*s)}_readX(){const e=this._readGeometry();return null!=e?e.coords[0]:0}_readY(){const e=this._readGeometry();return null!=e?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=t(this._current.projectedGeometry),r=new u([],e,this.hasZ,!1);return h(r,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const t=this._current.projectedGeometry,r=e(t.paths,this.hasZ),s=new u([],r,this.hasZ,!1);return h(s,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(void 0!==r)return r;const s=e.toLowerCase();for(const i in this._current.attributes)if(i.toLowerCase()===s)return this._current.attributes[i]}_readAttributes(){return this._current.attributes}}export{a as GraphicsReader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{destroyMaybe as e}from"../../../../core/maybe.js";import{AFeatureContainer as t}from"../../engine/AFeatureContainer.js";import{GraphicInstanceStore as r}from"../../engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js";import s from"./GraphicBoundsRenderer.js";class i extends t{constructor(e,t=!1){super(e),this.drawOnTop=t,this._hasHighlight=!1,this._instanceStore=new r}destroy(){super.destroy(),this._boundsRenderer=e(this._boundsRenderer)}get instanceStore(){return this._instanceStore}get hasHighlight(){return this._hasHighlight}enableRenderingBounds(e){this._boundsRenderer=new s(e),this.requestRender()}setHighlightActive(e){this._hasHighlight=e}onTileData(e,t){e.update(t),this.contains(e)||this.addChild(e),this.requestRender()}_renderChildren(e,t){e.selection=t;for(const r of this.children)r.visible&&(r.upload(this._instanceStore,1),r.getDisplayList()?.render(e))}}export{i as AGraphicContainer};
2
+ import{destroyMaybe as e}from"../../../../core/maybe.js";import{AFeatureContainer as t}from"../../engine/AFeatureContainer.js";import{GraphicInstanceStore as i}from"../../engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js";import s from"./GraphicBoundsRenderer.js";class r extends t{constructor(e,t=!1){super(e),this.drawOnTop=t,this._hasHighlight=!1,this._instanceStore=new i}destroy(){super.destroy(),this._boundsRenderer=e(this._boundsRenderer)}get instanceStore(){return this._instanceStore}get hasHighlight(){return this._hasHighlight}enableRenderingBounds(e){this._boundsRenderer=new s(e),this.requestRender()}setHighlightActive(e){this._hasHighlight=e}onTileData(e,t){e.update(t),this.contains(e)||this.addChild(e),this.requestRender()}_renderChildren(e,t){e.selection=t;for(const i of this.children)i.visible&&i.upload(this._instanceStore,1);this.labelStore.upload(e.context);for(const i of this.children)i.visible&&i.getDisplayList()?.render(e)}}export{r as AGraphicContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as 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,subclass as d}from"../../../../core/accessorSupport/decorators.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/jsonTypeUtils.js";import f from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as g,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as b,errorPolylineSymbol2D as w,errorPolygonSymbol2D 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 F from"./GraphicStore.js";import{FeatureCommandQueue as G}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as O}from"../support/UpdateTracking2D.js";class P{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new P(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new P(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 k=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._highlightFlagsByObjectId=new Map,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new O({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new G({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 f}),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)}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")},fetchMesh:e=>{throw new Error("InternalError: Graphics do not support Mesh 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 F(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(){return!this._attached||this._updateTracking.updating}hitTest(e,t){if(!this.view||this.view.suspended)return[];const{resolution:r,rotation:i}=this.view.state,o=this._graphicStore.hitTest(e,t,r,i),a=new Set(o),n=this.graphics.items.reduce((e,t)=>(a.has(t.uid)&&e.set(t.uid,t),e),new Map);return o.map(e=>n.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()}setHighlightFilters(e){this._highlightFlagsByObjectId.clear();for(const{order:t,filters:s}of e){const e=1<<t;for(const t of s)for(const s of t.objectIds??[]){const t=this._highlightFlagsByObjectId.get(s)??0;this._highlightFlagsByObjectId.set(s,t|e)}}if(this.container.setHighlightActive(this._highlightFlagsByObjectId.size>0),this._attached)for(const t of this._graphicStore.items())this._setFilterState(t);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{if(has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;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){P.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){P.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){P.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){P.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,requiresRefresh:!1}}_setFilterState(e){const t=e.displayId,s=this._highlightFlagsByObjectId.get(e.objectId)??0;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);return void(e.symbolResource={symbolInfo:t,textInfo:r})}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=g(e);return"web-style"===t.type?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:["cim","web"]})):t}async _createLinearCIM(e){return await y.normalizeSymbolAndFetchResources(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.consumePromise(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 r.presenting=!0,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=P.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.update({type:"append",append:i,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 t?l(t)?w:p(t)||u(t)?S:this.defaultPointSymbolEnabled?b:null:this.defaultPointSymbolEnabled?b: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()],k.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],k.prototype,"layerId",void 0),e([h({constructOnly:!0})],k.prototype,"requestUpdateCallback",void 0),e([h()],k.prototype,"container",void 0),e([h({constructOnly:!0})],k.prototype,"graphics",void 0),e([h()],k.prototype,"renderer",void 0),e([h()],k.prototype,"_updateTracking",void 0),e([h()],k.prototype,"updating",null),e([h()],k.prototype,"view",void 0),e([h()],k.prototype,"updateRequested",void 0),e([h()],k.prototype,"defaultPointSymbolEnabled",void 0),k=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],k);const A=k;export{A as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as 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,subclass as d}from"../../../../core/accessorSupport/decorators.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/jsonTypeUtils.js";import f from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as g,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as b,errorPolylineSymbol2D as w,errorPolygonSymbol2D 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 M}from"../../engine/webgl/mesh/MeshData.js";import{createCalloutMeshWriterCoordinator as T}from"../../engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js";import{MeshWriterGroupCoordinator as R}from"../../engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js";import{ResourceProxy as j}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as x}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createMeshWriterGroup as C}from"../../engine/webgl/util/Matcher.js";import{createStorageSchema as U}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as F}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as q}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as G}from"../features/support/FeatureMetadata.js";import{GraphicsReader as O}from"../features/support/GraphicsReader.js";import P from"./GraphicStore.js";import{FeatureCommandQueue as k}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as A}from"../support/UpdateTracking2D.js";class E{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new E(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new E(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=O.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 D=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._highlightFlagsByObjectId=new Map,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new A({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 q({spatialReference:this.view.spatialReference,fields:new f}),this._attributeStore=new F({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=U(null,[]);this._attributeStore.update(e,this._storage,null)}initialize(){this._initAttributeStore(),this._metadata=G.createGraphics(this.view.spatialReference),this._resourceProxy=new j({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")},fetchMesh:e=>{throw new Error("InternalError: Graphics do not support Mesh 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 P(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(){return!this._attached||this._updateTracking.updating}hitTest(e,t){if(!this.view||this.view.suspended)return[];const{resolution:r,rotation:i}=this.view.state,o=this._graphicStore.hitTest(e,t,r,i),a=new Set(o),n=this.graphics.items.reduce((e,t)=>(a.has(t.uid)&&e.set(t.uid,t),e),new Map);return o.map(e=>n.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()}setHighlightFilters(e){this._highlightFlagsByObjectId.clear();for(const{order:t,filters:s}of e){const e=1<<t;for(const t of s)for(const s of t.objectIds??[]){const t=this._highlightFlagsByObjectId.get(s)??0;this._highlightFlagsByObjectId.set(s,t|e)}}if(this.container.setHighlightActive(this._highlightFlagsByObjectId.size>0),this._attached)for(const t of this._graphicStore.items())this._setFilterState(t);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{if(has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;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){E.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){E.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){E.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){E.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().writers)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 M(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());new R({out:s,proxy:this._resourceProxy,feature:r,options:e.tile.createArcadeEvaluationOptions(t),level:e.tile.level,coordinatorFactories:[T]}).coordinateAndWrite(r.getMeshWriters()),s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id,requiresRefresh:!1}}_setFilterState(e){const t=e.displayId,s=this._highlightFlagsByObjectId.get(e.objectId)??0;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);return void(e.symbolResource={symbolInfo:t,textInfo:r})}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,"text"===t.type)}}async _convertToCIMSymbol(e){const t=g(e);return"web-style"===t.type?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:["cim","web"]})):t}async _createLinearCIM(e){return await y.normalizeSymbolAndFetchResources(e.symbol,this._cimResourceManager),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t,s){a(this._controller.signal);const r=this.container.instanceStore,i=this.view.stage.meshWriterRegistry,o=await x(e,t,r,s),n=await Promise.all(o.map(e=>i.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)));return C(n,o)}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.consumePromise(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],this.container.labelStore);return r.presenting=!0,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=E.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.update({type:"append",append:i,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 t?l(t)?w:p(t)||u(t)?S:this.defaultPointSymbolEnabled?b:null:this.defaultPointSymbolEnabled?b: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()],D.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],D.prototype,"layerId",void 0),e([h({constructOnly:!0})],D.prototype,"requestUpdateCallback",void 0),e([h()],D.prototype,"container",void 0),e([h({constructOnly:!0})],D.prototype,"graphics",void 0),e([h()],D.prototype,"renderer",void 0),e([h()],D.prototype,"_updateTracking",void 0),e([h()],D.prototype,"updating",null),e([h()],D.prototype,"view",void 0),e([h()],D.prototype,"updateRequested",void 0),e([h()],D.prototype,"defaultPointSymbolEnabled",void 0),D=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],D);const V=D;export{V as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{assertIsSome as s}from"../../../../core/maybe.js";import{debounce as r,isAbortError as a}from"../../../../core/promiseUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import h from"../../../../geometry/Extent.js";import c from"../../../../geometry/Point.js";import{isFunctionRaster as u}from"../../../../layers/raster/datasets/datasetUtils.js";import{update as d,unregister as p,getRasterId as y,register as m}from"../../../../layers/raster/datasets/RawBlockCache.js";import{getWorldWidth as g,computeProjectedScales as f}from"../../../../layers/raster/functions/rasterProjectionHelper.js";import{getStretchCutoff as _}from"../../../../layers/raster/functions/stretchUtils.js";import b from"../../../../layers/support/PixelBlock.js";import w from"../../../../layers/support/TileInfo.js";import R from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import P from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{tileSize as U}from"../../engine/webgl/definitions.js";import{readFromTiledRasterData as C}from"../../../support/rasterHitTestUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{getWebGLCapabilities as x}from"../../../webgl/capabilities.js";const v=[0,0];let F=class extends t{constructor(){super(...arguments),this._updatingHandles=new l,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.refreshDRAFunctionOnce=r(async()=>{const{fullExtent:e,view:t}=this.layerView;if(e?.intersects(t.extent))try{await this._updateDRAStatistics(this._abortController?.signal)&&await this.doRefresh()}catch{}}),this.redrawOrRefetch=r(async(e={})=>{const t=this._rasterFunctionState,i=e.reprocess||"gpu"===t&&!this.canUseWebGLForProcessing||"cpu"===t&&this.canUseWebGLForProcessing;if(i&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const s=this._rasterFunctionState,{type:r}=this;return e.refetch||"raster"!==r&&!!i||"cpu"===s||"cpu"===t?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))})}destroy(){this._updatingHandles.destroy()}get canUseWebGLForProcessing(){return!1}get canUseLocalSymbolizerParams(){return(this.canUseWebGLForProcessing||"rasterVF"===this.type)&&!this.layerView.hasTilingEffects}get hasDRAInRasterFunction(){const{rasterFunction:e}=this.layer;return!!e&&JSON.stringify(e,null,0).includes('"dra":true')}get isCPUBasedDRA(){const{renderer:e}=this.layer;return"raster-stretch"===e?.type&&e.dynamicRangeAdjustment&&(!this.canUseWebGLForProcessing||!("min-max"===e.stretchType||"standard-deviation"===e.stretchType))}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s="toJSON"in t?t:h.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null!=this._symbolizerParams&&this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){(this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate)&&(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&(this.hasDRAInRasterFunction?(this._globalUpdateRequested=!1,this.refreshDRAFunctionOnce()):this.isCPUBasedDRA&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const e=x();this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new R(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new P({tileInfoView:this._tileInfoView,concurrency:t,process:(e,t)=>this._fetchTile(e,t),priority:S.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,p(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}async hitTest(e){const t=this._locateSourceData(e);if(!t)return null;const{layer:i}=this,s="vector-field"===i.renderer?.type,r=this.canUseWebGLForProcessing&&u(this.layer.raster);return C({mapPoint:e,layer:i,sourceData:t,processRasterFunction:r,sourceIsUV:s})}acquireTile(e){const t=this.container.createTile(e);return this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.size.join(",");if(t&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;e=e||this._tileInfoView.size;const[i,s]=e,r=new b({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_getBandIds(){if(this.container&&(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain))return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,i="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):"rasterFunction"in t?i:e}updateRasterFunctionParameters(){}_fetchTile(e,t){const i=this._getFetchOptions(e.level,t.signal);return this.fetchTile(e,i)}_getFetchOptions(e,t){const{canUseWebGLForProcessing:i}=this,{layerView:s}=this,{tileInfo:r}=s,a=!r.isWrappable&&null!=g(s.view.spatialReference),o=i&&this.layer.raster.hasUniqueSourceStorageInfo,{layer:n}=this.layerView,l=n.serviceRasterInfo?.storageInfo.isBsqTile?n.getRawDisplayBandIds():void 0;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:i?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:o,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:t,srcResolution:this._srcResolutions[e],timeExtent:s.timeExtent,tileInfo:r,bandIds:l,disableWrapAround:a}}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:i,lods:s}=this.layer.tileInfo,r=s.map(({scale:e})=>e),a=w.create({spatialReference:t,size:U,scales:r,origin:i});return e.set("tileInfo",a),void(this._srcResolutions=s.map(({resolution:e})=>({x:e,y:e})))}const{scales:i,srcResolutions:r,isCustomTilingScheme:a}=f(this.layer.serviceRasterInfo,t,{tileSize:U,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),o=w.create({spatialReference:t,size:U,scales:i}),n=0===o.origin.x;s(e.fullExtent);const{xmin:l,ymax:h}=e.fullExtent;(n||a&&o.origin.x>l)&&(o.origin=new c({x:l,y:h,spatialReference:t})),this._isCustomTilingScheme=a,e.set("tileInfo",o),this._srcResolutions=r??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if("Map"!==e.raster.tileType)return!1;const{lods:i}=e.tileInfo,s=t.view.constraints?.effectiveLODs;return s?.length===i.length&&s.every(({scale:e},t)=>Math.abs(e-i[t].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.serviceRasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{let t=e.once("detach",()=>t=void 0);const r=await this._fetchQueue.push(e.key),o=this._getBandIds(),n=this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.stretchCutoff;let l=!this.useProgressiveUpdate||n||this.isCPUBasedDRA&&!this._globalSymbolizerParams;const h=this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length;if(h){if(l=!1,!this.hasDRAInRasterFunction)try{await this._redrawImage(this._abortController?.signal)}catch(s){a(s)&&i.getLogger(this).error(s)}this._globalUpdateRequested=!1}if(!t)return;this.canUseLocalSymbolizerParams&&null==this._symbolizerParams&&this._updateSymbolizerParams();const c=this._tileInfoView.getTileCoords(v,e.key),d=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:l,bandIds:o,coords:c,resolution:d}),t&&(e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e),t.remove()),h&&this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.extent?.equals(this.layerView.view.extent)&&this.refreshDRAFunctionOnce()}catch(s){a(s)||i.getLogger(this).error(s)}this.layerView.requestUpdate()}}async _updateDRAStatistics(e){if(!u(this.layer.raster))return!1;const t=await this.layer.getDynamicRangeInputRaster();if(!t)return!1;const{raster:i,functionArguments:s}=t,r=this._getFetchOptions(this.previousLOD.level,e),{extent:a,width:o,height:n}=this.layerView.view,{pixelBlock:l}=await i.fetchPixels(a,o,n,{...r,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1}),h=_(s,{rasterInfo:i.rasterInfo,pixelBlock:l});return this.layer.raster.processParameters={stretchCutoff:h,extent:a},!0}_locateSourceData(e){if(!this.layer.loaded||!this.attached)return null;const t=new Map,i=this.container.children.find(i=>{if(!i.visible)return!1;const s="bitmap"in i?i.bitmap?.rawPixelData:i.tileData?.rawPixelData;if(!s?.pixelBlock)return!1;const{key:r}=i,{level:a}=r;if(!t.has(a)){const i=this._tileInfoView.getLODInfoAt(a);if(!i)return!1;const s=Math.floor(i.getColumnForX(e.x)),r=Math.floor(i.getRowForY(e.y));t.set(a,[r,s])}const[o,n]=t.get(a);return o===r.row&&n===r.col});if(null==i)return null;if("tileData"in i){const{rawPixelData:e}=i.tileData;return e?.pixelBlock?{rawPixelData:e,tileSize:{width:i.width,height:i.height}}:null}const{rawPixelData:s,transformGrid:r,width:a,height:o}=i.bitmap;return s?.pixelBlock?{rawPixelData:s,transformGrid:r,tileSize:{width:a,height:o}}:null}async _redrawImage(e){if(!this.attached||0===this.container.children.length)return;if(await this.layer.updateRenderer(),this.isCPUBasedDRA?await this._updateGlobalSymbolizerParams(e):(this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._globalSymbolizerParams=null),!this.attached||e?.aborted)return;const t=this.container.children.map(async t=>this.updateTileSymbolizerParameters(t,{local:this._symbolizerParams,global:this._globalSymbolizerParams},e));await Promise.allSettled(t),this.attached&&!e?.aborted&&this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const{fullExtent:t,view:i}=this.layerView;if(!t?.intersects(i.extent))return;const s=this._getFetchOptions(this.previousLOD.level,e),r=await this.layer.fetchPixels(i.extent,i.width,i.height,{...s,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:a}=this.previousLOD,{isBsqTile:o}=this.layer.raster.rasterInfo.storageInfo,n=o?null:this._getBandIds(),l=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(n),isGCS:i.spatialReference.isGeographic,resolution:{x:a,y:a},bandIds:n});!this.canUseWebGLForProcessing&&l&&"stretch"===l.type&&"raster-stretch"===this.layer.renderer?.type&&(l.factor=l.factor.map(e=>255*e),l.minOutput=Math.round(255*l.minOutput),l.maxOutput=Math.round(255*l.maxOutput)),this._globalSymbolizerParams=l}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:i}=this,{raster:s}=t,{multidimensionalDefinition:r}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:i.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(r):null,o=s.rasterInfo.storageInfo.isBsqTile?t.getRawDisplayBandIds():null,n=u(s)?s.primaryRasters.rasters[0]??s:s,l=y(n.rasterId,a,o);if(l!==this._blockCacheRegistryUrl){null!=this._blockCacheRegistryUrl&&p(this._blockCacheRegistryUrl,this._blockCacheRegistryId);const t=n.rawBlockRegistryIds.indexOf(this._blockCacheRegistryId);if(t>-1&&n.rawBlockRegistryIds.splice(t,1),this._blockCacheRegistryId=m(l,n.rasterInfo),n.rawBlockRegistryIds.push(this._blockCacheRegistryId),e){const{view:e}=i,t=this._tileInfoView.getClosestInfoForScale(e.scale),r=this._srcResolutions[t.level];d(l,this._blockCacheRegistryId,e.extent,e.resolution,r,s.ioConfig.sampling)}this._blockCacheRegistryUrl=l}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this._updatingHandles.addPromise(this.layer.updateRenderer()),this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,this._tileStrategy.refresh(t=>e.push(this._enqueueTileFetch(t))),await this._updatingHandles.addPromise(Promise.allSettled(e))}};e([o()],F.prototype,"_globalUpdateRequested",void 0),e([o()],F.prototype,"attached",void 0),e([o()],F.prototype,"canUseWebGLForProcessing",null),e([o()],F.prototype,"canUseLocalSymbolizerParams",null),e([o()],F.prototype,"hasDRAInRasterFunction",null),e([o()],F.prototype,"isCPUBasedDRA",null),e([o()],F.prototype,"container",void 0),e([o()],F.prototype,"layer",void 0),e([o()],F.prototype,"layerView",void 0),e([o()],F.prototype,"scheduler",void 0),e([o()],F.prototype,"type",void 0),e([o()],F.prototype,"useWebGLForProcessing",null),e([o()],F.prototype,"useProgressiveUpdate",null),e([o()],F.prototype,"timeExtent",void 0),e([o()],F.prototype,"updating",null),F=e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],F);export{F as BaseImageryTileSubView2D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{assertIsSome as s}from"../../../../core/maybe.js";import{debounce as r,isAbortError as a}from"../../../../core/promiseUtils.js";import{property as o,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import h from"../../../../geometry/Extent.js";import c from"../../../../geometry/Point.js";import{isFunctionRaster as u}from"../../../../layers/raster/datasets/datasetUtils.js";import{update as d,unregister as p,getRasterId as y,register as m}from"../../../../layers/raster/datasets/RawBlockCache.js";import{getWorldWidth as g,computeProjectedScales as f}from"../../../../layers/raster/functions/rasterProjectionHelper.js";import{getStretchCutoff as _}from"../../../../layers/raster/functions/stretchUtils.js";import b from"../../../../layers/support/PixelBlock.js";import R from"../../../../layers/support/TileInfo.js";import w from"../../tiling/TileInfoView.js";import"../../tiling/TileKey.js";import P from"../../tiling/TileQueue.js";import I from"../../tiling/TileStrategy.js";import{tileSize as U}from"../../engine/webgl/definitions.js";import{readFromTiledRasterData as C}from"../../../support/rasterHitTestUtils.js";import{TaskPriority as S}from"../../../support/Scheduler.js";import{getWebGLCapabilities as x}from"../../../webgl/capabilities.js";const v=[0,0];function F(e){return"geospatial-pdf"!==e.type}let D=class extends t{constructor(){super(...arguments),this._updatingHandles=new l,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.refreshDRAFunctionOnce=r(async()=>{const{fullExtent:e,view:t}=this.layerView;if(e?.intersects(t.extent))try{await this._updateDRAStatistics(this._abortController?.signal)&&await this.doRefresh()}catch{}}),this.redrawOrRefetch=r(async(e={})=>{if(!("rasterFunction"in this.layer))return this._updatingHandles.addPromise(e.refetch?this.doRefresh():this._redrawImage(e.signal));const t=this._rasterFunctionState,i=e.reprocess||"gpu"===t&&!this.canUseWebGLForProcessing||"cpu"===t&&this.canUseWebGLForProcessing;if(i&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const s=this._rasterFunctionState,{type:r}=this;return e.refetch||"raster"!==r&&!!i||"cpu"===s||"cpu"===t?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))})}destroy(){this._updatingHandles.destroy()}get canUseWebGLForProcessing(){return!1}get canUseLocalSymbolizerParams(){return(this.canUseWebGLForProcessing||"rasterVF"===this.type)&&!this.layerView.hasTilingEffects}get hasDRAInRasterFunction(){if(!("rasterFunction"in this.layer))return!1;const{rasterFunction:e}=this.layer;return!!e&&JSON.stringify(e,null,0).includes('"dra":true')}get isCPUBasedDRA(){const{renderer:e}=this.layer;return"raster-stretch"===e?.type&&e.dynamicRangeAdjustment&&(!this.canUseWebGLForProcessing||!("min-max"===e.stretchType||"standard-deviation"===e.stretchType))}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const e=this._srcResolutions[r.level],s="toJSON"in t?t:h.fromJSON(t);d(this._blockCacheRegistryUrl,this._blockCacheRegistryId,s,i,e,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==r.level&&(this.previousLOD=r,null!=this._symbolizerParams&&this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){(this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate)&&(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,0===this._fetchQueue.length&&(this.hasDRAInRasterFunction?(this._globalUpdateRequested=!1,this.refreshDRAFunctionOnce()):this.isCPUBasedDRA&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()})));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const e=x();this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new w(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new P({tileInfoView:this._tileInfoView,concurrency:t,process:(e,t)=>this._fetchTile(e,t),priority:S.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const i=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new I({cachePolicy:"purge",acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),cacheSize:i,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,p(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}async hitTest(e){if(!F(this.layer))return null;const t=this._locateSourceData(e);if(!t)return null;const{layer:i}=this,s="vector-field"===i.renderer?.type,r=this.canUseWebGLForProcessing&&u(this.layer.raster);return C({mapPoint:e,layer:i,sourceData:t,processRasterFunction:r,sourceIsUV:s})}acquireTile(e){const t=this.container.createTile(e);return this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=null==e||e.join(",")===this._tileInfoView.size.join(",");if(t&&null!=this._emptyTilePixelBlock)return this._emptyTilePixelBlock;e=e||this._tileInfoView.size;const[i,s]=e,r=new b({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_getBandIds(){if(!("bandIds"in this.layer))return this.layer.getRawDisplayBandIds();if(this.container&&(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain))return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,i="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):"rasterFunction"in t?i:e}updateRasterFunctionParameters(){}_fetchTile(e,t){const i=this._getFetchOptions(e.level,t.signal);return this.fetchTile(e,i)}_getFetchOptions(e,t){const{canUseWebGLForProcessing:i}=this,{layerView:s}=this,{tileInfo:r}=s,a=!r.isWrappable&&null!=g(s.view.spatialReference),o=i&&this.layer.raster.hasUniqueSourceStorageInfo,{layer:n}=this.layerView,l=n.serviceRasterInfo?.storageInfo.isBsqTile?n.getRawDisplayBandIds():void 0;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:i?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:o,skipRasterFunction:"raster"===this.type&&null!=this.container.rasterFunctionChain,signal:t,srcResolution:this._srcResolutions[e],timeExtent:s.timeExtent,tileInfo:r,bandIds:l,disableWrapAround:a}}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:i,lods:s}=this.layer.tileInfo,r=s.map(({scale:e})=>e),a=R.create({spatialReference:t,size:U,scales:r,origin:i});return e.set("tileInfo",a),void(this._srcResolutions=s.map(({resolution:e})=>({x:e,y:e})))}const{scales:i,srcResolutions:r,isCustomTilingScheme:a}=f(this.layer.serviceRasterInfo,t,{tileSize:U,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),o=R.create({spatialReference:t,size:U,scales:i}),n=0===o.origin.x;s(e.fullExtent);const{xmin:l,ymax:h}=e.fullExtent;(n||a&&o.origin.x>l)&&(o.origin=new c({x:l,y:h,spatialReference:t})),this._isCustomTilingScheme=a,e.set("tileInfo",o),this._srcResolutions=r??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if("Map"!==e.raster.tileType)return!1;const{lods:i}=e.tileInfo,s=t.view.constraints?.effectiveLODs;return s?.length===i.length&&s.every(({scale:e},t)=>Math.abs(e-i[t].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.serviceRasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{let t=e.once("detach",()=>t=void 0);const r=await this._fetchQueue.push(e.key),o=this._getBandIds(),n=this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.stretchCutoff;let l=!this.useProgressiveUpdate||n||this.isCPUBasedDRA&&!this._globalSymbolizerParams;const h=this._globalUpdateRequested&&!this.layerView.moving&&0===this._fetchQueue.length;if(h){if(l=!1,!this.hasDRAInRasterFunction)try{await this._redrawImage(this._abortController?.signal)}catch(s){a(s)&&i.getLogger(this).error(s)}this._globalUpdateRequested=!1}if(!t)return;this.canUseLocalSymbolizerParams&&null==this._symbolizerParams&&this._updateSymbolizerParams();const c=this._tileInfoView.getTileCoords(v,e.key),d=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:l,bandIds:o,coords:c,resolution:d}),t&&(e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e),t.remove()),h&&this.hasDRAInRasterFunction&&u(this.layer.raster)&&!this.layer.raster.processParameters?.extent?.equals(this.layerView.view.extent)&&this.refreshDRAFunctionOnce()}catch(s){a(s)||i.getLogger(this).error(s)}this.layerView.requestUpdate()}}async _updateDRAStatistics(e){if(!F(this.layer))return!1;if(!u(this.layer.raster))return!1;const t=await this.layer.getDynamicRangeInputRaster();if(!t)return!1;const{raster:i,functionArguments:s}=t,r=this._getFetchOptions(this.previousLOD.level,e),{extent:a,width:o,height:n}=this.layerView.view,{pixelBlock:l}=await i.fetchPixels(a,o,n,{...r,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1}),h=_(s,{rasterInfo:i.rasterInfo,pixelBlock:l});return this.layer.raster.processParameters={stretchCutoff:h,extent:a},!0}_locateSourceData(e){if(!this.layer.loaded||!this.attached)return null;const t=new Map,i=this.container.children.find(i=>{if(!i.visible)return!1;const s="bitmap"in i?i.bitmap?.rawPixelData:i.tileData?.rawPixelData;if(!s?.pixelBlock)return!1;const{key:r}=i,{level:a}=r;if(!t.has(a)){const i=this._tileInfoView.getLODInfoAt(a);if(!i)return!1;const s=Math.floor(i.getColumnForX(e.x)),r=Math.floor(i.getRowForY(e.y));t.set(a,[r,s])}const[o,n]=t.get(a);return o===r.row&&n===r.col});if(null==i)return null;if("tileData"in i){const{rawPixelData:e}=i.tileData;return e?.pixelBlock?{rawPixelData:e,tileSize:{width:i.width,height:i.height}}:null}const{rawPixelData:s,transformGrid:r,width:a,height:o}=i.bitmap;return s?.pixelBlock?{rawPixelData:s,transformGrid:r,tileSize:{width:a,height:o}}:null}async _redrawImage(e){if(!this.attached||0===this.container.children.length)return;if("updateRenderer"in this.layer&&await this.layer.updateRenderer(),this.isCPUBasedDRA?await this._updateGlobalSymbolizerParams(e):(this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._globalSymbolizerParams=null),!this.attached||e?.aborted)return;const t=this.container.children.map(async t=>this.updateTileSymbolizerParameters(t,{local:this._symbolizerParams,global:this._globalSymbolizerParams},e));await Promise.allSettled(t),this.attached&&!e?.aborted&&this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const{fullExtent:t,view:i}=this.layerView;if(!t?.intersects(i.extent))return;const s=this._getFetchOptions(this.previousLOD.level,e),r=await this.layer.fetchPixels(i.extent,i.width,i.height,{...s,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:a}=this.previousLOD,{isBsqTile:o}=this.layer.raster.rasterInfo.storageInfo,n=o?null:this._getBandIds(),l=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(n),isGCS:i.spatialReference.isGeographic,resolution:{x:a,y:a},bandIds:n});!this.canUseWebGLForProcessing&&l&&"stretch"===l.type&&"raster-stretch"===this.layer.renderer?.type&&(l.factor=l.factor.map(e=>255*e),l.minOutput=Math.round(255*l.minOutput),l.maxOutput=Math.round(255*l.maxOutput)),this._globalSymbolizerParams=l}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:i}=this,{raster:s}=t;let r=null,a=null,o=s;if("multidimensionalDefinition"in t){const{multidimensionalDefinition:e}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:i.timeExtent});r=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(e)??null:null,a=s.rasterInfo.storageInfo.isBsqTile?t.getRawDisplayBandIds():null,o=u(s)?s.primaryRasters.rasters[0]??s:s}const n=y(o.rasterId,r,a);if(n!==this._blockCacheRegistryUrl){null!=this._blockCacheRegistryUrl&&p(this._blockCacheRegistryUrl,this._blockCacheRegistryId);const t=o.rawBlockRegistryIds.indexOf(this._blockCacheRegistryId);if(t>-1&&o.rawBlockRegistryIds.splice(t,1),this._blockCacheRegistryId=m(n,o.rasterInfo),o.rawBlockRegistryIds.push(this._blockCacheRegistryId),e){const{view:e}=i,t=this._tileInfoView.getClosestInfoForScale(e.scale),r=this._srcResolutions[t.level];d(n,this._blockCacheRegistryId,e.extent,e.resolution,r,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;"updateRenderer"in this.layer&&await this._updatingHandles.addPromise(this.layer.updateRenderer()),this.canUseLocalSymbolizerParams&&this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.isCPUBasedDRA||this.hasDRAInRasterFunction||!this.useProgressiveUpdate,this._tileStrategy.refresh(t=>e.push(this._enqueueTileFetch(t))),await this._updatingHandles.addPromise(Promise.allSettled(e))}};e([o()],D.prototype,"_globalUpdateRequested",void 0),e([o()],D.prototype,"attached",void 0),e([o()],D.prototype,"canUseWebGLForProcessing",null),e([o()],D.prototype,"canUseLocalSymbolizerParams",null),e([o()],D.prototype,"hasDRAInRasterFunction",null),e([o()],D.prototype,"isCPUBasedDRA",null),e([o()],D.prototype,"container",void 0),e([o()],D.prototype,"layer",void 0),e([o()],D.prototype,"layerView",void 0),e([o()],D.prototype,"scheduler",void 0),e([o()],D.prototype,"type",void 0),e([o()],D.prototype,"useWebGLForProcessing",null),e([o()],D.prototype,"useProgressiveUpdate",null),e([o()],D.prototype,"timeExtent",void 0),e([o()],D.prototype,"updating",null),D=e([n("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],D);export{D as BaseImageryTileSubView2D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import has from"../../../../core/has.js";import{numberMaxFloat32 as t}from"../../../../core/mathUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{isFunctionRaster as s}from"../../../../layers/raster/datasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/raster/formats/pixelRangeUtils.js";import{convertGeometryToMask as o}from"../../../../layers/raster/functions/clipUtils.js";import{maxMapSizeGpu as a}from"../../../../layers/raster/functions/pixelUtils.js";import{RasterTileContainer as l}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as c}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as h}from"../support/util.js";import{defaultColor as d}from"../../../support/HighlightDefaults.js";import{getHighlightName as p}from"../../../support/highlightOptionsUtils.js";const u=[1024,1024];let m=class extends c{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t||this.hasDRAInRasterFunction)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo);return!(has("ios")&&s>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!("majority"===this.layer.interpolation&&h(this.layer))}attach(){super.attach(),this.container=new l(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:n}=e,o=s.supportsGPU&&(!n||n.rasters.length<=1),a=o?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!o||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const h=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",d=i===h||"na"===i&&"cpu"===h&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!d,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=h}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{source:a,globalSymbolizerParams:l,suspended:c,coords:h,resolution:d}=t,p=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:u}=e;if([u.x,u.y]=h,u.resolution=d,null!=a?.pixelBlock){const e={extent:a.extent,pixelBlock:a.pixelBlock,srcExtent:a.srcExtent,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=e,n)u.source=a.pixelBlock,u.isRenderedSource=!1;else{const t=await this._renderTileData(e,l);u.source=t,u.isRenderedSource=!0}u.symbolizerParameters=n?p:null,u.transformGrid=n?a.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();u.source=e,u.symbolizerParameters=n?p:null,u.transformGrid=null}const{isBsqTile:m}=this.layer.raster.rasterInfo.storageInfo;u.bandIds=n&&!m?r:null,u.width=this._tileInfoView.size[0],u.height=this._tileInfoView.size[1],u.interpolation=i,u.suspended=c;const{raster:g}=this.layer;if(s(g)){const t=g.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=g.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(u.mask=o({srcExtent:r,geometry:t,size:[u.width,u.height]}))}}u.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:i,global:s}=t,n=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;if(a||null==c)l.isRenderedSource&&null!=c&&(l.source=c.pixelBlock),l.isRenderedSource=!1;else{const e=await this._renderTileData(c,s,r);l.source=e,l.isRenderedSource=!0}l.symbolizerParameters=a?this.layerView.hasTilingEffects?s:i:null;const{isBsqTile:h}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!h?n:null,l.interpolation=o,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const r=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===p(t.options))-i.findIndex(({name:t})=>t===p(e.options)));for(const{target:s,options:n}of e){const{pixelRanges:e}=s,l=p(n),c=(i.find(e=>e.name===l)?.color??d).toUnitRGBA();if(0===c[3]&&(c[3]=.01),Array.isArray(e)){const i=Array.from({length:2*a},()=>0);for(let t=0;t<e.length;t++)i[2*t]=e[t][0],i[2*t+1]=e[t][1];for(let r=e.length;r<a;r++)i[2*r]=t,i[2*r+1]=-t;const n=s.bandId??0;r.push({ranges:i,bandId:n,color:c,type:"single-band"})}else{const t="extent"===e.type?e:e.extent;if(!t)continue;const i=[t.xmin,t.xmax],n=[t.ymin,t.ymax],{xBandId:a,yBandId:l}=s,h={xRange:i,yRange:n,bandIds:[a,l],color:c,type:"xy-band"};"polygon"===e.type&&(h.maskSize=u,h.mask=o({srcExtent:t,geometry:e,size:u})),r.push(h)}}this.container.pixelHighlights=r,this.canUseWebGLForProcessing||this.doRefresh()}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}_convertPixelHighlights(){return this.container?.pixelHighlights?.map(e=>{const r=e.color.map(e=>Math.round(255*e));if("single-band"===e.type){const i=e.ranges.indexOf(t),s=[],n=-1===i?e.ranges.length/2:i/2;for(let t=0;t<n;t++)s.push([e.ranges[2*t],e.ranges[2*t+1]]);return{bandId:e.bandId,color:r,ranges:s}}return{color:r,xBandId:e.bandIds[0],yBandId:e.bandIds[1],xBandRange:e.xRange,yBandRange:e.yRange,width:e.maskSize?.[0],height:e.maskSize?.[1],xyMask:e.mask}})}async _renderTileData(e,t,r){if(!e.pixelBlock)return null;const i=await this.layer.applyRenderer(e,"stretch"===t?.type?t:void 0,{signal:r}),s=this._convertPixelHighlights();return i&&s&&await this.layer.highlightPixels({pixelBlock:e.pixelBlock.extractBands(this.layer.bandIds),renderedPixelBlock:i,highlightOptions:s},{signal:r}),i}};e([r()],m.prototype,"canUseWebGLForProcessing",null),e([r()],m.prototype,"container",void 0),e([r()],m.prototype,"layer",void 0),e([r()],m.prototype,"type",void 0),m=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m as default};
2
+ import{__decorate as e}from"tslib";import has from"../../../../core/has.js";import{numberMaxFloat32 as t}from"../../../../core/mathUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{isFunctionRaster as s}from"../../../../layers/raster/datasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/raster/formats/pixelRangeUtils.js";import{convertGeometryToMask as o}from"../../../../layers/raster/functions/clipUtils.js";import{maxMapSizeGpu as a}from"../../../../layers/raster/functions/pixelUtils.js";import{RasterTileContainer as l}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as c}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as h}from"../support/util.js";import{defaultColor as d}from"../../../support/HighlightDefaults.js";import{getHighlightName as p}from"../../../support/highlightOptionsUtils.js";const u=[1024,1024];let g=class extends c{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t||this.hasDRAInRasterFunction)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo),o=has("ios")&&s>4,a="geospatial-pdf"!==this.layer.type&&"majority"===this.layer.interpolation&&h(this.layer);return!o&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!a}attach(){super.attach(),this.container=new l(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t||"geospatial-pdf"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:n}=e,o=s.supportsGPU&&(!n||n.rasters.length<=1),a=o?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!o||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const h=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",d=i===h||"na"===i&&"cpu"===h&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!d,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=h}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{source:a,globalSymbolizerParams:l,suspended:c,coords:h,resolution:d}=t,p=this.isCPUBasedDRA?l:t.symbolizerParams,{bitmap:u}=e;if([u.x,u.y]=h,u.resolution=d,null!=a?.pixelBlock){const e={extent:a.extent,pixelBlock:a.pixelBlock,srcExtent:a.srcExtent,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=e,n)u.source=a.pixelBlock,u.isRenderedSource=!1;else{const t=await this._renderTileData(e,l);u.source=t,u.isRenderedSource=!0}u.symbolizerParameters=n?p:null,u.transformGrid=n?a.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();u.source=e,u.symbolizerParameters=n?p:null,u.transformGrid=null}const{isBsqTile:g}=this.layer.raster.rasterInfo.storageInfo;u.bandIds=n&&!g?r:null,u.width=this._tileInfoView.size[0],u.height=this._tileInfoView.size[1],u.interpolation=i,u.suspended=c;const{raster:m}=this.layer;if(s(m)){const t=m.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=m.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);r&&(u.mask=o({srcExtent:r,geometry:t,size:[u.width,u.height]}))}}u.invalidateTexture()}async updateTileSymbolizerParameters(e,t,r){const{local:i,global:s}=t,n=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:a}=this,{bitmap:l}=e,{rawPixelData:c}=l;if(a||null==c)l.isRenderedSource&&null!=c&&(l.source=c.pixelBlock),l.isRenderedSource=!1;else{const e=await this._renderTileData(c,s,r);l.source=e,l.isRenderedSource=!0}l.symbolizerParameters=a?this.layerView.hasTilingEffects?s:i:null;const{isBsqTile:h}=this.layer.raster.rasterInfo.storageInfo;l.bandIds=a&&!h?n:null,l.interpolation=o,l.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const r=[],{highlights:i}=this.layerView.view;e.sort((e,t)=>i.findIndex(({name:e})=>e===p(t.options))-i.findIndex(({name:t})=>t===p(e.options)));for(const{target:s,options:n}of e){const{pixelRanges:e}=s,l=p(n),c=(i.find(e=>e.name===l)?.color??d).toUnitRGBA();if(0===c[3]&&(c[3]=.01),Array.isArray(e)){const i=Array.from({length:2*a},()=>0);for(let t=0;t<e.length;t++)i[2*t]=e[t][0],i[2*t+1]=e[t][1];for(let r=e.length;r<a;r++)i[2*r]=t,i[2*r+1]=-t;const n=s.bandId??0;r.push({ranges:i,bandId:n,color:c,type:"single-band"})}else{const t="extent"===e.type?e:e.extent;if(!t)continue;const i=[t.xmin,t.xmax],n=[t.ymin,t.ymax],{xBandId:a,yBandId:l}=s,h={xRange:i,yRange:n,bandIds:[a,l],color:c,type:"xy-band"};"polygon"===e.type&&(h.maskSize=u,h.mask=o({srcExtent:t,geometry:e,size:u})),r.push(h)}}this.container.pixelHighlights=r,this.canUseWebGLForProcessing||this.doRefresh()}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}_convertPixelHighlights(){return this.container?.pixelHighlights?.map(e=>{const r=e.color.map(e=>Math.round(255*e));if("single-band"===e.type){const i=e.ranges.indexOf(t),s=[],n=-1===i?e.ranges.length/2:i/2;for(let t=0;t<n;t++)s.push([e.ranges[2*t],e.ranges[2*t+1]]);return{bandId:e.bandId,color:r,ranges:s}}return{color:r,xBandId:e.bandIds[0],yBandId:e.bandIds[1],xBandRange:e.xRange,yBandRange:e.yRange,width:e.maskSize?.[0],height:e.maskSize?.[1],xyMask:e.mask}})}async _renderTileData(e,t,r){if(!e.pixelBlock)return null;if("geospatial-pdf"===this.layer.type)return e.pixelBlock;const i=await this.layer.applyRenderer(e,"stretch"===t?.type?t:void 0,{signal:r}),s=this._convertPixelHighlights();return i&&s&&await this.layer.highlightPixels({pixelBlock:e.pixelBlock.extractBands(this.layer.bandIds),renderedPixelBlock:i,highlightOptions:s},{signal:r}),i}};e([r()],g.prototype,"canUseWebGLForProcessing",null),e([r()],g.prototype,"container",void 0),e([r()],g.prototype,"layer",void 0),e([r()],g.prototype,"type",void 0),g=e([i("esri.views.2d.layers.imagery.ImageryTileView2D")],g);export{g as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{rad2deg as e}from"../../../../../core/mathUtils.js";import t from"../../../../../geometry/Point.js";import{normalizeTransform as r,quantizeY as n,quantizeX as o}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as i}from"../../../../../layers/graphics/featureConversionUtils.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{DimensionRealFieldName as s,projectLinearDimensionPoints as u,normalizeExtensionAngle as y,angleFromXAxis as p}from"./dimensionUtils.js";import{getAttributeValue as l,parseElement as f,reprojectAndQuantize as c}from"./utils.js";import{featureFields as g}from"./virtualFields.js";function d(e){const t=e.readAttribute("element");if(!t)return null;const n=e.getInTransform()??e.getDisplayTransform();if(!n)throw new Error("Quantization transform is required to read annotation features.");const o=e.geometryType;if(!o)return null;const i=e.metadata.outSpatialReference,a=e.metadata.attributeSpatialReference??e.metadata.spatialReference??i,m=r(n),s=f(t),{geometry:u}=s;if(!u)return null;const y=c(u,a,i,m);if(!y)return null;const p={},l={annotationGeometryType:h(s),annotationGraphic:s,attributes:p,geometryOverride:{geometry:y,geometryType:o}};for(const r of g)r.setOnFeature(l,s);return l}function b(i){const f=i.getInTransform()??i.getDisplayTransform();if(!f)throw new Error("Quantization transform is required to read dimension features.");const c=i.geometryType;if(!c)return null;const g={...i.readAttributes()},d=i.metadata.outSpatialReference,b=i.metadata.attributeSpatialReference??i.metadata.spatialReference??d,N=r(f),h={x:Number(l(s.beginX,g)),y:Number(l(s.beginY,g)),spatialReference:b},x={x:Number(l(s.endX,g)),y:Number(l(s.endY,g)),spatialReference:b},w={x:Number(l(s.dimX,g)),y:Number(l(s.dimY,g)),spatialReference:b};if(isNaN(h.x)||isNaN(h.y)||isNaN(x.x)||isNaN(x.y))return console.error(`Feature with ${s.objectId}=${l(s.objectId,g)} is missing valid begin, end, or dimension points and will be skipped.`),null;(isNaN(w.x)||isNaN(w.y))&&(w.x=h.x,w.y=h.y);const T=m(new t(h),b,d),j=m(new t(x),b,d),R=m(new t(w),b,d),_=[T,j,R],E=j.x-T.x,I=j.y-T.y;let M=Math.PI/2;0!==E?M=Math.atan2(I,E):I<0&&(M=-Math.PI/2);let S=Math.sqrt(E*E+I*I);if(1===Number(l(s.dimType,g))){const e=u([T.x,T.y],[j.x,j.y],[R.x,R.y],y(l(s.extAngle,g)));if(e){const t=e.endDimensionPoint[0]-e.beginDimensionPoint[0],r=e.endDimensionPoint[1]-e.beginDimensionPoint[1];S=Math.sqrt(t*t+r*r),M=p([t,r])}}const D=l(s.textX,g),P=l(s.textY,g);if(null!=D&&null!=P){const e=new t({x:Number(D),y:Number(P),spatialReference:b}),r=m(e,b,d);_.push(r)}const U=_.map(e=>({x:o(N,e.x),y:n(N,e.y)})).flatMap(e=>[e.x,e.y]);return g.__SYSTEM_LENGTH__=S,g.__DIMENSION_ANGLE__=360-e(M),{attributes:g,geometryOverride:{geometry:new a([U.length],U),geometryType:c}}}function N(e,t){const{geometry:r,geometryType:n}=t.geometryOverride,o=i(r,n,!1,!1);return o?{attributes:{...e.readAttributes(),...t.attributes},centroid:null,geometry:o}:null}function h(e){if(e.geometry){if("custom-two-point"===e.geometry.type)return"line";if("custom-multipoint"===e.geometry.type)return"multipoint";if("geometry-bag"===e.geometry.type){if("custom-multipoint"===e.geometry.geometries[0].type)return"multipoint";throw new Error("Unable to determine geometry type from annotation graphic")}if("custom-point"===e.geometry.type)return"point";if("polyline"===e.geometry.type)return"line";if("point"===e.geometry.type)return"point";throw new Error("Unable to determine geometry type from annotation graphic")}throw new Error("Unable to determine geometry type from annotation graphic")}export{d as createAnnotationMatcherFeatureInfo,b as createDimensionMatcherFeatureInfo,h as getAnnotationGeometryType,N as mixFeature};
2
+ import{rad2deg as e}from"../../../../../core/mathUtils.js";import t from"../../../../../geometry/Point.js";import{normalizeTransform as r,quantizeY as n,quantizeX as i}from"../../../../../geometry/support/quantizationUtils.js";import{convertToGeometry as o}from"../../../../../layers/graphics/featureConversionUtils.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{project as m}from"../../../../../layers/graphics/data/projectionSupport.js";import{DimensionRealFieldName as s,projectLinearDimensionPoints as u,normalizeExtensionAngle as y,angleFromXAxis as l}from"./dimensionUtils.js";import{getAttributeValue as p,parseElement as f,reprojectAndQuantize as c,quantizeYf as g,quantizeXf as d}from"./utils.js";import{featureFields as b}from"./virtualFields.js";function N(e){const t=e.readAttribute("element");if(!t)return null;const n=e.getInTransform()??e.getDisplayTransform();if(!n)throw new Error("Quantization transform is required to read annotation features.");if(!e.geometryType)return null;const i=e.metadata.outSpatialReference,o=e.metadata.attributeSpatialReference??e.metadata.spatialReference??i,a=r(n),m=f(t),{geometry:s}=m;if(!s)return null;const u=c(s,o,i,a);if(!u)return null;const y=h(m,o,i,a),l=T(m),p={annotationGeometryType:l,annotationGraphic:m,attributes:{},geometryOverride:{geometry:u,geometryType:g(l),absoluteCalloutAnchor:y}};for(const r of b)r.setOnFeature(p,m);function g(e){switch(e){case"line":return"esriGeometryPolyline";case"multipoint":return"esriGeometryMultipoint";case"point":return"esriGeometryPoint"}}return p}function h(e,r,n,i){const[o,a]=e.anchorPoint;if(!o?.trim()||!a?.trim())return;const s=Number(o),u=Number(a);if(!Number.isFinite(s)||!Number.isFinite(u))return;const y=m(new t({x:s,y:u,spatialReference:r}),r,n);return{x:d(i,y.x),y:g(i,y.y)}}function x(o){const f=o.getInTransform()??o.getDisplayTransform();if(!f)throw new Error("Quantization transform is required to read dimension features.");const c=o.geometryType;if(!c)return null;const g={...o.readAttributes()},d=o.metadata.outSpatialReference,b=o.metadata.attributeSpatialReference??o.metadata.spatialReference??d,N=r(f),h={x:Number(p(s.beginX,g)),y:Number(p(s.beginY,g)),spatialReference:b},x={x:Number(p(s.endX,g)),y:Number(p(s.endY,g)),spatialReference:b},w={x:Number(p(s.dimX,g)),y:Number(p(s.dimY,g)),spatialReference:b};if(isNaN(h.x)||isNaN(h.y)||isNaN(x.x)||isNaN(x.y))return console.error(`Feature with ${s.objectId}=${p(s.objectId,g)} is missing valid begin, end, or dimension points and will be skipped.`),null;(isNaN(w.x)||isNaN(w.y))&&(w.x=h.x,w.y=h.y);const T=m(new t(h),b,d),j=m(new t(x),b,d),R=m(new t(w),b,d),P=[T,j,R],_=j.x-T.x,E=j.y-T.y;let M=Math.PI/2;0!==_?M=Math.atan2(E,_):E<0&&(M=-Math.PI/2);let G=Math.sqrt(_*_+E*E);if(1===Number(p(s.dimType,g))){const e=u([T.x,T.y],[j.x,j.y],[R.x,R.y],y(p(s.extAngle,g)));if(e){const t=e.endDimensionPoint[0]-e.beginDimensionPoint[0],r=e.endDimensionPoint[1]-e.beginDimensionPoint[1];G=Math.sqrt(t*t+r*r),M=l([t,r])}}const I=p(s.textX,g),S=p(s.textY,g);if(null!=I&&null!=S){const e=new t({x:Number(I),y:Number(S),spatialReference:b}),r=m(e,b,d);P.push(r)}const D=P.map(e=>({x:i(N,e.x),y:n(N,e.y)})).flatMap(e=>[e.x,e.y]);return g.__SYSTEM_LENGTH__=G,g.__DIMENSION_ANGLE__=360-e(M),{attributes:g,geometryOverride:{geometry:new a([D.length],D),geometryType:c}}}function w(e,t){const{geometry:r,geometryType:n}=t.geometryOverride,i=o(r,n,!1,!1);return i?{attributes:{...e.readAttributes(),...t.attributes},centroid:null,geometry:i}:null}function T(e){if(e.geometry){if("custom-two-point"===e.geometry.type)return"line";if("custom-multipoint"===e.geometry.type)return"multipoint";if("geometry-bag"===e.geometry.type){if("custom-multipoint"===e.geometry.geometries[0].type)return"multipoint";throw new Error("Unable to determine geometry type from annotation graphic")}if("custom-point"===e.geometry.type)return"point";if("polyline"===e.geometry.type)return"line";if("point"===e.geometry.type)return"point";throw new Error("Unable to determine geometry type from annotation graphic")}throw new Error("Unable to determine geometry type from annotation graphic")}export{N as createAnnotationMatcherFeatureInfo,x as createDimensionMatcherFeatureInfo,T as getAnnotationGeometryType,w as mixFeature};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as t}from"../../../../../geometry/GeometryCursor.js";import{createTileObjectId as e}from"./TileObjectId.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,r){return new n(t,r)}}class n{constructor(t,e){this._cursor=t,this._context=e}next(){const r=this._cursor.next();if(!r||0===r.totalSize)return null;const{matcher:n,target:c,tileKey:o}=this._context,s=n&&c&&null!=o?n.getMatcherGeometryOverride(e(o,c.getObjectId())):null;if(!s)return r;const i=t.fromOptimizedCIM(s.geometry.clone(),s.geometryType);return i.invertY(),i}}export{r as PrivateMatcherGeometryOverrideEffect};
2
+ import{GeometryCursor as t}from"../../../../../geometry/GeometryCursor.js";import{createTileObjectId as e}from"./TileObjectId.js";class r{static{this.instance=null}static local(){return null===r.instance&&(r.instance=new r),r.instance}execute(t,e,r){return new n(t,r)}}class n{constructor(t,e){this._cursor=t,this._context=e}next(){const r=this._cursor.next();if(!r||0===r.totalSize)return null;if(this._context.calloutBodyBounds)return r;const{matcher:n,target:o,tileKey:c}=this._context,s=n&&o&&null!=c?n.getMatcherGeometryOverride(e(c,o.getObjectId())):null;if(!s)return r;const i=t.fromOptimizedCIM(s.geometry.clone(),s.geometryType);return i.invertY(),i}}export{r as PrivateMatcherGeometryOverrideEffect};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../../core/Logger.js";import t from"../../../../../core/pbf.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{base64ToArrayBuffer as o}from"../../../../../support/base64Utils.js";function r(e){const a={leader:[],anchorPoint:[],fontVariations:[]},r=o(e.toString()),s=new t(new Uint8Array(r),new DataView(r));for(;s.next();)switch(s.tag()){case 1:a.version=n(s);break;case 2:a.bloated=s.getBool();break;case 3:if(a.bloated){const e=i(n(s));e&&l(a,e)}else s.skip();break;case 4:a.geometryStorageType=s.getEnum();break;case 5:a.bloated?s.skip():a.geometry=u(n(s),a.geometryStorageType);break;case 6:a.bloated?s.skip():a.text=n(s);break;case 7:a.bloated?s.skip():a.symbolID=s.getUInt32();break;case 8:a.textAngle=s.getDouble();break;case 9:a.xOffset=s.getDouble();break;case 10:a.yOffset=s.getDouble();break;case 11:a.horizontalAlignment=s.getEnum();break;case 12:a.verticalAlignment=s.getEnum();break;case 13:a.flipAngle=s.getDouble();break;case 14:s.skip(),a.leader=[];break;case 15:s.skip(),a.anchorPoint=[];break;case 16:a.size=s.getDouble();break;case 17:a.color=n(s);break;case 18:a.characterSpacing=s.getDouble();break;case 19:a.characterWidth=s.getDouble();break;case 20:a.wordSpacing=s.getDouble();break;case 21:a.leading=s.getDouble();break;case 22:a.fontFamilyName=n(s);break;case 23:a.fontStyleName=n(s);break;case 24:a.underline=s.getBool();break;case 25:a.callout=n(s);break;case 26:s.skip(),a.fontVariations=[];break;default:s.skip()}return a}function n(e){return s(e.getString()||"")}function s(e){return e.replaceAll(/\p{Cc}/gu,"")}function i(e){return e?JSON.parse(e):null}function p(e){if(e?.ga){const t=e?.ga?.map(e=>p(e)).filter(e=>e);return{type:"geometry-bag",geometries:t}}const t=e?.g?.points;if(t)return{type:"custom-multipoint",points:t};const o=a(e);return o&&("point"===o.type||"polyline"===o.type)?o:void 0}function c(t){return"x"in t&&"y"in t?{type:"custom-point",x:t.x,y:t.y}:"paths"in t?{type:"custom-two-point",from:t.paths[0][0],to:t.paths[0][1]}:(e.getLogger("esri.layers.AnnotationFeatureLayer").warnOnce("CIMTextGraphic.shape must be a point or a polyline."),{type:"custom-point",x:0,y:0})}function l(e,t){e.symbol=t.symbol,e.text=t.text,e.geometry=c(t.shape)}function u(e,t){if(!e||null==t)return;if(1===t){const t=e.split(",").map(e=>parseFloat(e));return{type:"custom-point",x:t[0],y:t[1]}}if(2===t){const t=e.split(";").map(e=>e.split(",").map(e=>parseFloat(e)));return{type:"custom-two-point",from:[t[0][0],t[0][1]],to:[t[1][0],t[1][1]]}}if(3===t){return{type:"custom-multipoint",points:e.split(";").map(e=>e.split(",").map(e=>parseFloat(e)))}}return p(JSON.parse(e))}export{u as parseAnnotationGeometry,p as parseAnnotationGeometryJson,r as parseAnnotationGraphic,i as parseTextGraphic};
2
+ import e from"../../../../../core/Logger.js";import t from"../../../../../core/pbf.js";import{fromJSON as a}from"../../../../../geometry/support/jsonUtils.js";import{base64ToArrayBuffer as r}from"../../../../../support/base64Utils.js";function o(e){const a={leader:[],anchorPoint:[],fontVariations:[]},o=r(e.toString()),s=new t(new Uint8Array(o),new DataView(o));for(;s.next();)switch(s.tag()){case 1:a.version=n(s);break;case 2:a.bloated=s.getBool();break;case 3:if(a.bloated){const e=i(n(s));e&&l(a,e)}else s.skip();break;case 4:a.geometryStorageType=s.getEnum();break;case 5:a.bloated?s.skip():a.geometry=u(n(s),a.geometryStorageType);break;case 6:a.bloated?s.skip():a.text=n(s);break;case 7:a.bloated?s.skip():a.symbolID=s.getUInt32();break;case 8:a.textAngle=s.getDouble();break;case 9:a.xOffset=s.getDouble();break;case 10:a.yOffset=s.getDouble();break;case 11:a.horizontalAlignment=s.getEnum();break;case 12:a.verticalAlignment=s.getEnum();break;case 13:a.flipAngle=s.getDouble();break;case 14:s.skip(),a.leader=[];break;case 15:a.anchorPoint.push(n(s));break;case 16:a.size=s.getDouble();break;case 17:a.color=n(s);break;case 18:a.characterSpacing=s.getDouble();break;case 19:a.characterWidth=s.getDouble();break;case 20:a.wordSpacing=s.getDouble();break;case 21:a.leading=s.getDouble();break;case 22:a.fontFamilyName=n(s);break;case 23:a.fontStyleName=n(s);break;case 24:a.underline=s.getBool();break;case 25:a.callout=n(s);break;case 26:s.skip(),a.fontVariations=[];break;default:s.skip()}return a}function n(e){return s(e.getString()||"")}function s(e){return e.replaceAll(/\r\n?/g,"\n").replaceAll(/\p{Cc}/gu,e=>"\n"===e?e:"")}function i(e){return e?JSON.parse(e):null}function p(e){if(e?.ga){const t=e?.ga?.map(e=>p(e)).filter(e=>e);return{type:"geometry-bag",geometries:t}}const t=e?.g?.points;if(t)return{type:"custom-multipoint",points:t};const r=a(e);return r&&("point"===r.type||"polyline"===r.type)?r:void 0}function c(t){return"x"in t&&"y"in t?{type:"custom-point",x:t.x,y:t.y}:"paths"in t?{type:"custom-two-point",from:t.paths[0][0],to:t.paths[0][1]}:(e.getLogger("esri.layers.AnnotationFeatureLayer").warnOnce("CIMTextGraphic.shape must be a point or a polyline."),{type:"custom-point",x:0,y:0})}function l(e,t){e.symbol=t.symbol,e.text=t.text,e.geometry=c(t.shape)}function u(e,t){if(!e||null==t)return;if(1===t||4===t){const t=e.split(",").map(e=>parseFloat(e));return{type:"custom-point",x:t[0],y:t[1]}}if(2===t||5===t){const t=e.split(";").map(e=>e.split(",").map(e=>parseFloat(e)));return{type:"custom-two-point",from:[t[0][0],t[0][1]],to:[t[1][0],t[1][1]]}}if(3===t||6===t){return{type:"custom-multipoint",points:e.split(";").map(e=>e.split(",").map(e=>parseFloat(e)))}}return p(JSON.parse(e))}export{u as parseAnnotationGeometry,p as parseAnnotationGeometryJson,o as parseAnnotationGraphic,i as parseTextGraphic};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{featureFields as e}from"./virtualFields.js";function t(t,i){let r,o,n=[];if("line"===i){let i;switch(r="CIMLineSymbol",(t={...t,angle:0}).horizontalAlignment){case"Center":case"Justify":default:i=.5;break;case"Left":i=0;break;case"Right":i=1}o={type:"CIMMarkerPlacementAtRatioPositions",angleToLine:!0,placePerPart:!1,keepUpright:!1,positionArray:[i],flipFirst:!1},n=e.filter(e=>"Rotation"!==e.cimPropertyName)}else"multipoint"===i?(r="CIMLineSymbol",o={type:"PrivatePlacementMultipoint"},n=e):(r="CIMPointSymbol",o=void 0,n=e);const a={type:"CIMSymbolReference",primitiveOverrides:[],symbol:{type:r,symbolLayers:[{type:"CIMVectorMarker",markerPlacement:o,enable:!0,size:40,colorLocked:!1,anchorPointUnits:"Relative",frame:{xmin:-20,ymin:-20,xmax:20,ymax:20},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:t}],scaleSymbolsProportionally:!0,respectFrame:!0}]}};for(const e of n)e.addPrimitiveOverride(a);return{data:a}}function i(e){return{point:t(e,"point"),line:t(e,"line"),multipoint:t(e,"multipoint")}}function r(e){const t={};for(const r of e){const e=r.iD??0,{symbol:o}=r,n=i(o);t[e]=n}return t}export{t as getCIMSymbol,r as getCIMSymbols,i as getTrio};
2
+ import{nonPointFeatureFields as e,featureFields as t}from"./virtualFields.js";function i(i,r){let o,n,a=[];if("line"===r){let t;switch(o="CIMLineSymbol",(i={...i,angle:0}).horizontalAlignment){case"Center":case"Justify":default:t=.5;break;case"Left":t=0;break;case"Right":t=1}n={type:"CIMMarkerPlacementAtRatioPositions",angleToLine:!0,placePerPart:!1,keepUpright:!1,positionArray:[t],flipFirst:!1},a=e}else"multipoint"===r?(o="CIMLineSymbol",n={type:"PrivatePlacementMultipoint"},a=e):(o="CIMPointSymbol",n=void 0,a=t);const l={type:"CIMSymbolReference",primitiveOverrides:[],symbol:{type:o,symbolLayers:[{type:"CIMVectorMarker",markerPlacement:n,enable:!0,size:40,colorLocked:!1,anchorPointUnits:"Relative",frame:{xmin:-20,ymin:-20,xmax:20,ymax:20},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:i}],scaleSymbolsProportionally:!0,respectFrame:!0}]}};for(const e of a)e.addPrimitiveOverride(l);return{data:l}}function r(e){return{point:i(e,"point"),line:i(e,"line"),multipoint:i(e,"multipoint")}}function o(e){const t={};for(const i of e){const e=i.iD??0,{symbol:o}=i,n=r(o);t[e]=n}return t}export{i as getCIMSymbol,o as getCIMSymbols,r as getTrio};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e={type:"CIMSolidStroke",enable:!0,color:[255,0,0,255],width:1.5};async function o(e,o,n){const r=t(n);if(!r)return[];const s=await o.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:r});return e.createMeshWriters(s?.meshes||[])}function t(e){return"esriGeometryPolygon"!==e?(e&&console.error(`Annotation/dimension debug overlay expects polygon footprint geometry, but received ${e}.`),null):{type:"CIMSymbolReference",symbol:n()}}function n(){return{type:"CIMPolygonSymbol",symbolLayers:[{...e}]}}export{o as createDebugWriters};
2
+ import{createMeshWriterGroup as e}from"../../../engine/webgl/util/Matcher.js";const o={type:"CIMSolidStroke",enable:!0,color:[255,0,0,255],width:1.5};async function t(o,t,n){const s=r(n);if(!s)return e([],[]);const i=await t.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:s});return o.createMeshWriters(i?.meshes||[])}function r(e){return"esriGeometryPolygon"!==e?(e&&console.error(`Annotation/dimension debug overlay expects polygon footprint geometry, but received ${e}.`),null):{type:"CIMSymbolReference",symbol:n()}}function n(){return{type:"CIMPolygonSymbol",symbolLayers:[{...o}]}}export{t as createDebugWriters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fixUnsupportedCIM as e}from"../../../../../symbols/cim/supportUtils.js";let t=0;class i{constructor(e,t,i,r){this.cimPropertyName=e,this.findTargetNode=i,this.getValue=r,this.realFieldName=`__virtual_fi_${t}`}setOnFeature(e,t){const i=this.getValue(t);e.attributes[this.realFieldName]=i}addPrimitiveOverride(e){const i=this.findTargetNode(e.symbol);let{primitiveName:r}=i;r||(t++,r=`primitive_${t}`,i.primitiveName=r);const s={type:"CIMPrimitiveOverride",primitiveName:r,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realFieldName};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(s)}}const r=new i("TextString","text",e=>e.symbolLayers[0].markerGraphics[0],e=>e.text),s=new i("Color","color",e=>e.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type),t=>{const i=t.color||"#000000";if(i.startsWith("#"))return i;if(i.startsWith("rgb"))return i;const r=JSON.parse(i),s=e(r);return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/255})`}),n=new i("Rotation","rotation",e=>e.symbolLayers[0],e=>null!=e.textAngle?-e.textAngle:void 0),o=new i("OffsetX","offsetX",e=>e.symbolLayers[0],e=>e.xOffset),l=new i("OffsetY","offsetY",e=>e.symbolLayers[0],e=>e.yOffset);class a{constructor(e,t,i){this.cimPropertyName=e,this.findTargetNode=t,this.getValue=i}setOnSymbol(e,t){const i=this.getValue(t);if(null==i)return;this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=i}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}const m=new a("VerticalAlignment",e=>e,e=>null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]),f=[r,s,n,o,l],y=[new a("HorizontalAlignment",e=>e,e=>null==e.horizontalAlignment?null:["Left","Right","Center","Justify"][e.horizontalAlignment]),m,new a("FontFamilyName",e=>e,e=>e.fontFamilyName),new a("FontStyleName",e=>e,e=>e.fontStyleName),new a("Height",e=>e,e=>e.size),new a("Underline",e=>e,e=>e.underline)];function c(e){let t=!1;for(const i of y)t=t||null!=i.getValue(e);return t}export{f as featureFields,c as hasSymbolFields,y as symbolFields};
2
+ import{fixUnsupportedCIM as e}from"../../../../../symbols/cim/supportUtils.js";let t=0;class i{constructor(e,t,i,r){this.cimPropertyName=e,this.findTargetNode=i,this.getValue=r,this.realFieldName=`__virtual_fi_${t}`}setOnFeature(e,t){const i=this.getValue(t);e.attributes[this.realFieldName]=i}addPrimitiveOverride(e){const i=this.findTargetNode(e.symbol);let{primitiveName:r}=i;r||(t++,r=`primitive_${t}`,i.primitiveName=r);const s={type:"CIMPrimitiveOverride",primitiveName:r,propertyName:this.cimPropertyName,valueExpressionInfo:{type:"CIMExpressionInfo",expression:`return $feature.${this.realFieldName};`}};e.primitiveOverrides=e.primitiveOverrides||[],e.primitiveOverrides.push(s)}}const r=new i("TextString","text",e=>e.symbolLayers[0].markerGraphics[0],e=>e.text),s=new i("Color","color",e=>e.symbolLayers[0].markerGraphics[0].symbol.symbol.symbolLayers.find(e=>"CIMSolidFill"===e.type),t=>{const i=t.color||"#000000";if(i.startsWith("#"))return i;if(i.startsWith("rgb"))return i;const r=JSON.parse(i),s=e(r);return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/255})`}),n=new i("Rotation","rotation",e=>e.symbolLayers[0],e=>null!=e.textAngle?-e.textAngle:void 0),o=new i("OffsetX","offsetX",e=>e.symbolLayers[0],e=>e.xOffset),l=new i("OffsetY","offsetY",e=>e.symbolLayers[0],e=>e.yOffset);class a{constructor(e,t,i){this.cimPropertyName=e,this.findTargetNode=t,this.getValue=i}setOnSymbol(e,t){const i=this.getValue(t);if(null==i)return;this.findTargetNode(e)[this._fixCase(this.cimPropertyName)]=i}_fixCase(e){return this.cimPropertyName[0].toLocaleLowerCase()+e.slice(1)}}const m=new a("VerticalAlignment",e=>e,e=>null==e.verticalAlignment?null:["Top","Center","Baseline","Bottom"][e.verticalAlignment]),f=new a("HorizontalAlignment",e=>e,e=>null==e.horizontalAlignment?null:["Left","Right","Center","Justify"][e.horizontalAlignment]),y=new a("FontFamilyName",e=>e,e=>e.fontFamilyName),c=new a("FontStyleName",e=>e,e=>e.fontStyleName),u=new a("Height",e=>e,e=>e.size),p=new a("Underline",e=>e,e=>e.underline),h=[r,s,o,l],d=[...h,n],g=[f,m,y,c,u,p];function N(e){let t=!1;for(const i of g)t=t||null!=i.getValue(e);return t}export{d as featureFields,N as hasSymbolFields,h as nonPointFeatureFields,g as symbolFields};
@@ -42,6 +42,8 @@ export interface LayerView2DMap {
42
42
  "geo-rss": GeoRSSLayerView;
43
43
  /** @since 5.0 */
44
44
  geojson: GeoJSONLayerView;
45
+ /** @since 5.2 */
46
+ "geospatial-pdf": never;
45
47
  /** @since 5.0 */
46
48
  graphics: GraphicsLayerView;
47
49
  /** @since 5.0 */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{EventedMixin as r}from"../../core/Evented.js";import{when as n,on as i,watch as a}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as l,equals as u,intersection as d}from"../../geometry/support/aaBoundingRect.js";import p from"../GroundView.js";import{ElevationRange as g}from"./support/ElevationRange.js";import{toBoundingRect as h}from"./support/extentUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as c}from"./terrain/TerrainConst.js";let v=class extends(r(p)){initialize(){super.initialize();const e=()=>{this.emit("elevation-query-change")};this.addHandles(n(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e)))),this.addHandles(i(()=>this._integratedMeshGroundLayerView?.elevationProvider,"elevation-change",e=>this._elevationChange(e))),this.addHandles([a(()=>this.memoizedElevationQueryDependencies,e)])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>"elevation"===e.type||"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerView(){const e=this.ground?.integratedMeshGround;if(e)return this.view.basemapView?.groundLayerViews.find(t=>t.layer===e)}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this._usingIntegratedMesh&&(this._terrainSurface?.enabled??!1)}get _usingIntegratedMesh(){return this.hasTerrainReplacement&&(this._integratedMeshGroundLayerView?.visible??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(null==t||null==e)return null;const r=l(),n=h(t,r,e)?r:null,i=this._get("userClippingExtent");return u(n,i)?i:n}get updating(){return!this.suspended&&((this._source?.updating??!1)||this.layerViews.some(({updating:e})=>e))}getElevation(e,t,r,n){return this._elevationProvider?.getElevation(e,t,r,n)}getElevations(e,t,r){const{_elevationProvider:n}=this;if(n?.getElevations)return n.getElevations(e,t,r);for(let i=0;i<t;++i)r(i,null)}intersect(e,t,r,n){if(this._usingTerrain)return void this._terrainSurface.intersect(e,t,r,n);const i=this._integratedMeshGroundLayerView;this._usingIntegratedMesh&&i&&i.intersect(e,t,r,n)}getSphereElevationRange(e,t,r){return this._elevationProvider?.getSphereElevationRange?.(e,t)}getRootElevationRange(){return this._elevationProvider?.getRootElevationRange?.()}get _elevationProvider(){return this._usingIntegratedMesh?this._integratedMeshGroundLayerView?.elevationProvider:this._terrainSurface}get elevationQueryCache(){const e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(const e of this.ground?.allLayers??[])if("integrated-mesh-3dtiles"===e.type&&e.replacesTerrain&&"failed"!==e.loadStatus&&null==e.queryElevationCallback)return!1;return!0}get groundExtent(){const{fullGroundExtent:e}=this;return e?this.userClippingExtent?d(e,this.userClippingExtent,l()):this.fullGroundExtent:null}get fullGroundExtent(){if(this._usingTerrain)return this._terrainSurface.fullGroundExtent;if(this._usingIntegratedMesh){const e=this.view.spatialReference;if(e.isWebMercator||e.isWGS84)return _(e);throw new t("GroundView:unsupportedSpatialReference","View spatial reference incompatible with groundLayer")}return null}get visibleElevationRange(){return this._source?.visibleElevationRange??f}get opaque(){return this._source?.opaque??!1}get invisible(){return this._source?.invisible??!1}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return!!this._usingTerrain&&(this._terrainSurface?.wireframe??!1)}get freeze(){return(this._usingTerrain?this._terrainSurface?.freeze:this._integratedMeshGroundLayerView?.freeze)??!1}set freeze(e){this._usingTerrain?this._terrainSurface.freeze=e:this._usingIntegratedMesh&&(this._integratedMeshGroundLayerView.freeze=e)}get suspended(){return this._usingIntegratedMesh?this._integratedMeshGroundLayerView?.suspended??!1:super.suspended}get ready(){return this._source?.ready??!1}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}get _source(){return this._usingTerrain?this._terrainSurface:this._usingIntegratedMesh?this._integratedMeshGroundLayerView:null}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([s()],v.prototype,"memoizedElevationQueryDependencies",null),e([s({readOnly:!0})],v.prototype,"_integratedMeshGroundLayerView",null),e([s({readOnly:!0})],v.prototype,"_terrainSurface",null),e([s({readOnly:!0})],v.prototype,"_usingTerrain",null),e([s({readOnly:!0})],v.prototype,"_usingIntegratedMesh",null),e([s({readOnly:!0})],v.prototype,"spatialReference",null),e([s({readOnly:!0})],v.prototype,"userClippingExtent",null),e([s({type:Boolean,readOnly:!0})],v.prototype,"updating",null),e([s({readOnly:!0})],v.prototype,"elevationQueryCache",null),e([s()],v.prototype,"elevationQueryReady",null),e([s({readOnly:!0})],v.prototype,"groundExtent",null),e([s({readOnly:!0})],v.prototype,"fullGroundExtent",null),e([s({readOnly:!0})],v.prototype,"visibleElevationRange",null),e([s({readOnly:!0})],v.prototype,"opaque",null),e([s({readOnly:!0})],v.prototype,"invisible",null),e([s({readOnly:!0})],v.prototype,"baseOpacity",null),e([s({readOnly:!0})],v.prototype,"wireframe",null),e([s()],v.prototype,"freeze",null),e([s({readOnly:!0})],v.prototype,"suspended",null),e([s({readOnly:!0})],v.prototype,"ready",null),e([s({readOnly:!0})],v.prototype,"_source",null),v=e([o("esri.views.3d.GroundView3D")],v);const f=new g(0,0);function _(e){return e.isWebMercator?y:c}export{v as GroundView3D};
2
+ import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import has from"../../core/has.js";import{when as r,watch as n,syncAndInitial as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{create as l,equals as o,intersection as u,union as d}from"../../geometry/support/aaBoundingRect.js";import p from"../GroundView.js";import{ElevationRange as h}from"./support/ElevationRange.js";import{toBoundingRect as g}from"./support/extentUtils.js";import{webMercatorWorldExtent as y,geographicWorldExtent as c}from"./terrain/TerrainConst.js";import{isIntegratedMeshLayerView as v}from"../support/layerViewUtils.js";const f=Symbol("integrated-mesh-elevation-providers");let m=class extends(t(p)){initialize(){super.initialize();const e=()=>{this.emit("elevation-query-change")},t=()=>{this.removeHandles(f),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on("elevation-change",e=>this._elevationChange(e))),f)};this.addHandles(r(()=>this._terrainSurface,e=>e.on("elevation-change",e=>this._elevationChange(e)))),n(()=>[this.view?.basemapView?.groundLayerViews.toArray(),this.layerViews.toArray()],t,i),this.addHandles([n(()=>this.memoizedElevationQueryDependencies,e)])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>"elevation"===e.type||"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit("elevation-change",e)}get _integratedMeshGroundLayerViews(){return has("enable-feature:im-as-ground")?[...this.view?.basemapView?.groundLayerViews.filter(v)??[],...this.layerViews.filter(v)]:[...this.view?.basemapView?.groundLayerViews.filter(v).filter(e=>e.replacesTerrain)??[]]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){const{spatialReference:e}=this,{clippingArea:t}=this.view;if(null==t||null==e)return null;const r=l(),n=g(t,r,e)?r:null,i=this._get("userClippingExtent");return o(n,i)?i:n}get updating(){return!this.suspended&&(this._usingTerrain&&this._terrainSurface.updating||this.layerViews.some(({updating:e})=>e))}getElevation(e,t,r,n){const i=this._usingTerrain?this._terrainSurface?.getElevation(e,t,r,n):null;return this._integratedMeshGroundLayerViews.reduce((i,a)=>{const s=a.elevationProvider.getElevation(e,t,r,n);return null==s?i:Math.max(s,i??s)},i)}getElevations(e,t,r){const n=this.view.groundSpatialReference;if(null!=n)for(let i=0;i<t;++i){const t=3*i;r(i,this.getElevation(e[t],e[t+1],e[t+2],n))}else for(let i=0;i<t;++i)r(i,null)}intersect(e,t,r,n){this._usingTerrain&&this._terrainSurface.intersect(e,t,r,n),this._integratedMeshGroundLayerViews.forEach(i=>i.intersect(e,t,r,n))}getSphereElevationRange(e,t,r){const n=this._usingTerrain?this._terrainSurface?.getSphereElevationRange?.(e,t):null;return this._integratedMeshGroundLayerViews.reduce((r,n)=>{const i=n.elevationProvider.getSphereElevationRange?.(e,t);return null==i||(r??=new h,r.expandElevationRange(i)),r},n?new h(n.minElevation,n.maxElevation):null)}getRootElevationRange(){const e=this._usingTerrain?this._terrainSurface?.getRootElevationRange?.():null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>{const r=t.elevationProvider.getRootElevationRange?.();return null==r||(e??=new h,e.expandElevationRange(r)),e},e?new h(e.minElevation,e.maxElevation):null)}get elevationQueryCache(){const e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(const e of this.ground?.allLayers??[])if("integrated-mesh-3dtiles"===e.type&&e.replacesTerrain&&"failed"!==e.loadStatus&&null==e.queryElevationCallback)return!1;return!0}get groundExtent(){const{fullGroundExtent:e}=this;return e?this.userClippingExtent?u(e,this.userClippingExtent,l()):this.fullGroundExtent:null}get fullGroundExtent(){const e=this._usingTerrain?this._terrainSurface.fullGroundExtent:null;if(0===this._integratedMeshGroundLayerViews.length)return e;const t=this.view.spatialReference;if(!t.isWebMercator&&!t.isWGS84)return e;const r=w(t);return e?d(e,r,l()):r}get visibleElevationRange(){const e=this._usingTerrain?this._terrainSurface.visibleElevationRange:null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>null==e?new h(t.visibleElevationRange.minElevation,t.visibleElevationRange.maxElevation):(e.expandElevationRange(t.visibleElevationRange),e),e?new h(e.minElevation,e.maxElevation):null)??_}get opaque(){return this._usingTerrain&&this._terrainSurface.opaque||this._integratedMeshGroundLayerViews.some(({opaque:e})=>e)}get invisible(){return(!this._usingTerrain||this._terrainSurface.invisible)&&this._integratedMeshGroundLayerViews.every(({invisible:e})=>e)}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return!!this._usingTerrain&&(this._terrainSurface?.wireframe??!1)}get freeze(){return this._usingTerrain&&(this._terrainSurface?.freeze??!1)||this._integratedMeshGroundLayerViews.some(e=>"integrated-mesh-3dtiles"===e.type&&e.freeze)}set freeze(e){this._usingTerrain&&(this._terrainSurface.freeze=e),this._integratedMeshGroundLayerViews.forEach(t=>{"integrated-mesh-3dtiles"===t.type&&(t.freeze=e)})}get suspended(){return(!this._usingTerrain||super.suspended)&&this._integratedMeshGroundLayerViews.length>0&&this._integratedMeshGroundLayerViews.every(({suspended:e})=>e)}get ready(){return!(!this._usingTerrain&&0===this._integratedMeshGroundLayerViews.length)&&((!this._usingTerrain||this._terrainSurface.ready)&&this._integratedMeshGroundLayerViews.every(({ready:e})=>e))}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([a()],m.prototype,"memoizedElevationQueryDependencies",null),e([a({readOnly:!0})],m.prototype,"_integratedMeshGroundLayerViews",null),e([a({readOnly:!0})],m.prototype,"_terrainSurface",null),e([a({readOnly:!0})],m.prototype,"_usingTerrain",null),e([a({readOnly:!0})],m.prototype,"spatialReference",null),e([a({readOnly:!0})],m.prototype,"userClippingExtent",null),e([a({type:Boolean,readOnly:!0})],m.prototype,"updating",null),e([a({readOnly:!0})],m.prototype,"elevationQueryCache",null),e([a()],m.prototype,"elevationQueryReady",null),e([a({readOnly:!0})],m.prototype,"groundExtent",null),e([a({readOnly:!0})],m.prototype,"fullGroundExtent",null),e([a({readOnly:!0})],m.prototype,"visibleElevationRange",null),e([a({readOnly:!0})],m.prototype,"opaque",null),e([a({readOnly:!0})],m.prototype,"invisible",null),e([a({readOnly:!0})],m.prototype,"baseOpacity",null),e([a({readOnly:!0})],m.prototype,"wireframe",null),e([a()],m.prototype,"freeze",null),e([a({readOnly:!0})],m.prototype,"suspended",null),e([a({readOnly:!0})],m.prototype,"ready",null),m=e([s("esri.views.3d.GroundView3D")],m);const _=new h(0,0);function w(e){return e.isWebMercator?y:c}export{m as GroundView3D};