@arcgis/core 5.0.0-next.63 → 5.0.0-next.65

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 (598) hide show
  1. package/Ground.d.ts +2 -1
  2. package/Ground.js +1 -1
  3. package/WebDocument2D.js +1 -1
  4. package/WebLinkChart.js +1 -1
  5. package/WebMap.d.ts +1 -1
  6. package/WebMap.js +1 -1
  7. package/WebScene.d.ts +1 -1
  8. package/WebScene.js +1 -1
  9. package/applications/KnowledgeStudio/dataModelVisualization.d.ts +18 -0
  10. package/applications/KnowledgeStudio/dataModelVisualization.js +5 -0
  11. package/applications/MapViewer/templateUtils.d.ts +2 -2
  12. package/applications/Urban/LineImagePattern3D.d.ts +8 -0
  13. package/applications/Urban/LineImagePattern3D.js +5 -0
  14. package/applications/Urban/imagePatternUtils.d.ts +23 -0
  15. package/applications/Urban/imagePatternUtils.js +5 -0
  16. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  17. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  18. package/assets/esri/core/workers/RemoteClient.js +1 -1
  19. package/assets/esri/core/workers/chunks/{61707c22b029c2a7a397.js → 049c125085028ffdd0dd.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{0bd73a66baea2f52e8a6.js → 07639f406b71bb49ffd6.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{df0e5570174bf0942d7a.js → 0d9e1ccc3ba8b5ed3287.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{4404b6f931f681cca342.js → 0e5cd0cf6ab7cb37d723.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{a624dd283d264dce35a8.js → 0f5693541111fcae0c2f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f56906c443ce8ff68a27.js → 13d61d34e55c80e4ecdf.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{28b235b56a83c498d73f.js → 168ec8fca2702617a543.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{831b8282380844a7c4d5.js → 1967239713b58dccfd81.js} +1 -1
  27. package/assets/esri/core/workers/chunks/1b838638e66e82d76cf3.js +1 -0
  28. package/assets/esri/core/workers/chunks/{2209550b6510e25da375.js → 226acd251ad7d7ee3b57.js} +1 -1
  29. package/assets/esri/core/workers/chunks/22dd5cecc7e2d4d0baf8.js +316 -0
  30. package/assets/esri/core/workers/chunks/2402d305a77fef4694a0.js +1 -0
  31. package/assets/esri/core/workers/chunks/{893a5ab0c2df9262efd8.js → 251eb6e00f99a816d55c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{e47535f795b15608a6cb.js → 27f096c434f049b8df01.js} +1 -1
  33. package/assets/esri/core/workers/chunks/29b09db309ff75fb3e97.js +1 -0
  34. package/assets/esri/core/workers/chunks/{bef2a70d382515b3c84e.js → 310f3268582e61cd86da.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{02cf735176f286a48dd2.js → 3371935a4fd6346d3a17.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{36d15c35fbbd4dedd5cb.js → 3c3d311b88f5400951ef.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{cf3a9ead26629f3508b3.js → 3c4f8597f602779174f1.js} +1 -1
  38. package/assets/esri/core/workers/chunks/43d28c6509c21b8917a8.js +1 -0
  39. package/assets/esri/core/workers/chunks/{951e3c911a3486b1e609.js → 45b898367b6224dda46f.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{57302b92e9899cce4ba3.js → 4785cd108e2dec6e1697.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{153ff2ceefccd946498b.js → 47bfe8dd5d2bac4307ac.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{2abc205f81f26fc4852b.js → 49a1b7f700b8a42de817.js} +4 -4
  43. package/assets/esri/core/workers/chunks/4d6d962d25aa836f53ee.js +1 -0
  44. package/assets/esri/core/workers/chunks/{454c15367cccbf63af7a.js → 4e9a8fce55cad841c731.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{b93f2bd6429879f92143.js → 536c492fdda30f2f1288.js} +1 -1
  46. package/assets/esri/core/workers/chunks/5cee6c3ff23fb93f857a.js +1 -0
  47. package/assets/esri/core/workers/chunks/6035daa65fc3ebf86515.js +1 -0
  48. package/assets/esri/core/workers/chunks/62b28f73f814413c10fc.js +1 -0
  49. package/assets/esri/core/workers/chunks/{0bc01d71ed1ab8c3af3c.js → 6599cc702a46f81a5634.js} +1 -1
  50. package/assets/esri/core/workers/chunks/6925f09d44cc38480d53.js +1 -0
  51. package/assets/esri/core/workers/chunks/{72e3a48aa365542b0689.js → 6a782e8475bff4d56dbc.js} +1 -1
  52. package/assets/esri/core/workers/chunks/6ba3c2b9f699d94d62b8.js +1 -0
  53. package/assets/esri/core/workers/chunks/{f44f358db5c56d5bbc0c.js → 7306b5b66e738a281d83.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{2da13c2269ab90281143.js → 7694abe44d55dae8872d.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{2b34a010f76e5f289868.js → 7bf491b468cd74a4166c.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{05ab54b81c366e98138f.js → 7d8664aeff66e34138bd.js} +1 -1
  57. package/assets/esri/core/workers/chunks/822ef6a043c7e147b4b6.js +1 -0
  58. package/assets/esri/core/workers/chunks/878010ca23da0bca9405.js +1 -0
  59. package/assets/esri/core/workers/chunks/892157696e8f9e38c472.js +1 -0
  60. package/assets/esri/core/workers/chunks/{d2abfcb0c8bf894c7f72.js → 8dca61f8ba6689379f86.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{bce81df760f5e34c01d7.js → 964de713042f52d71e42.js} +1 -1
  62. package/assets/esri/core/workers/chunks/990341f7c47bd656c782.js +1 -0
  63. package/assets/esri/core/workers/chunks/9d6945cda99d14af83ac.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5180b15f1a865756a02e.js → a3836f6a93924ee4816e.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{d13b2ce8a89938b0472b.js → a6dcd13c792b6538ac50.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{522a6787d9e0f520ac79.js → a893f8db2477cf677ac8.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{983356eb4fd0a0dcf3fd.js → abc236e99b52be1c83b9.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{b11c0e80e583f2b7c5de.js → ac83c2999a3d2ffb4356.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{5873c7b65d0fb04998fb.js → acea42d268b53ceb2bfd.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{8628bf45a33af786cd49.js → b65fcfde62d49de1fa54.js} +1 -1
  71. package/assets/esri/core/workers/chunks/ba7f57788847cc0f68df.js +1 -0
  72. package/assets/esri/core/workers/chunks/{12f700b932a241e59071.js → bcf612eabe7577540953.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{75e9759290f0f67b2128.js → bf06250be7a7a36306b1.js} +1 -1
  74. package/assets/esri/core/workers/chunks/c3007b916ba933137709.js +1 -0
  75. package/assets/esri/core/workers/chunks/c9f868f85d740ee32715.js +1 -0
  76. package/assets/esri/core/workers/chunks/cc5c1887e6d7079e5fe3.js +1 -0
  77. package/assets/esri/core/workers/chunks/ce8f075c814a8378c00c.js +1 -0
  78. package/assets/esri/core/workers/chunks/{f91e63d7842c427c7f72.js → d30cfc5fa302cc08d862.js} +1 -1
  79. package/assets/esri/core/workers/chunks/d3325ed8d224e2350db7.js +1 -0
  80. package/assets/esri/core/workers/chunks/{1800994523d7cdfb73af.js → de71db3b0fb947b13c97.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{ff7df6fb78fa2c0e9247.js → df92239eefff04471a0b.js} +1 -1
  82. package/assets/esri/core/workers/chunks/e69255e38ff200dda14b.js +1 -0
  83. package/assets/esri/core/workers/chunks/ee2ca25048a920e43743.js +1 -0
  84. package/assets/esri/core/workers/chunks/{609919428305d8c8c243.js → f9370830051865a3435b.js} +1 -1
  85. package/assets/esri/core/workers/chunks/fc00d7278b43df813c54.js +1 -0
  86. package/assets/esri/themes/base/widgets/_UtilityNetworkAssociations.scss +7 -18
  87. package/assets/esri/themes/dark/main.css +1 -1
  88. package/assets/esri/themes/light/main.css +1 -1
  89. package/assets/esri/themes/light/view.css +1 -1
  90. package/chunks/RibbonLine.glsl.js +99 -61
  91. package/chunks/libtess-f32.js +5 -0
  92. package/chunks/libtess-f64.js +5 -0
  93. package/config.js +1 -1
  94. package/core/Version.d.ts +1 -1
  95. package/core/Version.js +1 -1
  96. package/core/has.js +1 -1
  97. package/core/workers/registry.js +1 -1
  98. package/core/workers/workerFactory.js +1 -1
  99. package/form/elements/inputs/SwitchInput.d.ts +2 -1
  100. package/geometry/Mesh.d.ts +2 -1
  101. package/geometry/Mesh.js +1 -1
  102. package/geometry/libtess.js +1 -1
  103. package/geometry/support/MeshVertexAttributes.d.ts +1 -1
  104. package/geometry/support/MeshVertexAttributes.js +1 -1
  105. package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
  106. package/geometry/support/meshUtils/elevation.js +1 -1
  107. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  108. package/geometry/support/meshUtils/merge.js +1 -1
  109. package/geometry/support/meshUtils/primitives.js +1 -1
  110. package/ground/NavigationConstraint.d.ts +1 -1
  111. package/ground/NavigationConstraint.js +1 -1
  112. package/interfaces.d.ts +163 -158
  113. package/kernel.js +1 -1
  114. package/layers/BaseElevationLayer.d.ts +1 -1
  115. package/layers/ElevationLayer.d.ts +1 -1
  116. package/layers/ElevationLayer.js +1 -1
  117. package/layers/FeatureLayer.d.ts +1 -5
  118. package/layers/Layer.d.ts +1 -2
  119. package/layers/ParquetLayer.js +1 -1
  120. package/layers/SceneLayer.js +1 -1
  121. package/layers/knowledgeGraph/dataModelVisualizationUtils.d.ts +11 -0
  122. package/layers/knowledgeGraph/dataModelVisualizationUtils.js +5 -0
  123. package/layers/mixins/ArcGISMapService.js +1 -1
  124. package/layers/mixins/BlendLayer.d.ts +1 -1
  125. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  126. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  127. package/layers/raster/formats/RasterCodec.js +1 -1
  128. package/layers/raster/functions/ColormapToRGBFunction.js +1 -1
  129. package/layers/raster/functions/surfaceUtils.js +1 -1
  130. package/layers/support/CodedValue.d.ts +1 -1
  131. package/layers/support/CodedValue.js +1 -1
  132. package/layers/support/CodedValueDomain.d.ts +2 -1
  133. package/layers/support/CodedValueDomain.js +1 -1
  134. package/layers/support/ElevationTileData.d.ts +1 -1
  135. package/layers/support/ElevationTileData.js +1 -1
  136. package/layers/support/FeatureReduction.d.ts +1 -1
  137. package/layers/support/FeatureReduction.js +1 -1
  138. package/layers/support/FeatureReductionBinning.d.ts +1 -1
  139. package/layers/support/FeatureReductionBinning.js +1 -1
  140. package/layers/support/FeatureReductionSelection.d.ts +1 -1
  141. package/layers/support/FeatureReductionSelection.js +1 -1
  142. package/layers/support/KMLMapImage.d.ts +1 -1
  143. package/layers/support/KMLMapImage.js +1 -1
  144. package/layers/support/ParquetGeometryEncodingBase.d.ts +1 -1
  145. package/layers/support/ParquetGeometryEncodingBase.js +1 -1
  146. package/layers/support/ParquetGeometryEncodingLocation.d.ts +1 -1
  147. package/layers/support/ParquetGeometryEncodingLocation.js +1 -1
  148. package/layers/support/ParquetGeometryEncodingWkb.d.ts +1 -1
  149. package/layers/support/ParquetGeometryEncodingWkb.js +1 -1
  150. package/layers/support/PixelBlock.d.ts +1 -1
  151. package/layers/support/PixelBlock.js +1 -1
  152. package/layers/support/SimpleBandStatistics.d.ts +1 -1
  153. package/layers/support/SimpleBandStatistics.js +1 -1
  154. package/layers/support/Sublayer.js +1 -1
  155. package/layers/support/featureLayerUtils.js +1 -1
  156. package/layers/support/featureReductionUtils.js +1 -1
  157. package/layers/support/source/DataLayerSource.d.ts +6 -3
  158. package/layers/support/source/DataLayerSource.js +1 -1
  159. package/layers/support/source/MapLayerSource.d.ts +1 -1
  160. package/layers/support/source/MapLayerSource.js +1 -1
  161. package/layers/support/source/QueryTableDataSource.d.ts +1 -1
  162. package/layers/support/source/QueryTableDataSource.js +1 -1
  163. package/layers/support/source/RasterDataSource.d.ts +1 -1
  164. package/layers/support/source/RasterDataSource.js +1 -1
  165. package/layers/support/source/TableDataSource.d.ts +1 -1
  166. package/layers/support/source/TableDataSource.js +1 -1
  167. package/layers/support/source/types.d.ts +1 -1
  168. package/layers/types.d.ts +7 -1
  169. package/package.json +1 -1
  170. package/popup/content/MediaContent.d.ts +2 -2
  171. package/popup/content/types.d.ts +9 -0
  172. package/portal/Portal.d.ts +3 -3
  173. package/portal/PortalGroup.d.ts +1 -1
  174. package/portal/PortalItem.d.ts +2 -2
  175. package/portal/PortalItemResource.d.ts +1 -1
  176. package/portal/PortalQueryParams.d.ts +1 -1
  177. package/portal/PortalUser.d.ts +5 -5
  178. package/portal/schemas/definitions.js +1 -1
  179. package/portal/support/resourceUtils.d.ts +1 -1
  180. package/renderers/HeatmapRenderer.d.ts +2 -1
  181. package/renderers/HeatmapRenderer.js +1 -1
  182. package/renderers/PieChartRenderer.d.ts +2 -1
  183. package/renderers/PieChartRenderer.js +1 -1
  184. package/renderers/support/AuthoringInfo.d.ts +2 -1
  185. package/renderers/support/AuthoringInfo.js +1 -1
  186. package/renderers/support/AuthoringInfoClassBreakInfo.d.ts +1 -1
  187. package/renderers/support/AuthoringInfoClassBreakInfo.js +1 -1
  188. package/renderers/support/AuthoringInfoFieldInfo.d.ts +3 -2
  189. package/renderers/support/AuthoringInfoFieldInfo.js +1 -1
  190. package/renderers/support/DictionaryScriptEvaluator.js +1 -1
  191. package/renderers/support/HeatmapLegendOptions.d.ts +1 -1
  192. package/renderers/support/HeatmapLegendOptions.js +1 -1
  193. package/renderers/support/OthersCategory.d.ts +1 -1
  194. package/renderers/support/OthersCategory.js +1 -1
  195. package/rest/featureService/types.d.ts +1 -1
  196. package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +1 -1
  197. package/rest/support/ArealUnit.d.ts +1 -1
  198. package/rest/support/BaseImageMeasureResultValue.d.ts +1 -1
  199. package/rest/support/BaseImageMeasureResultValue.js +1 -1
  200. package/rest/support/BufferParameters.d.ts +1 -1
  201. package/rest/support/ClosestFacilityParameters.d.ts +1 -1
  202. package/rest/support/DataLayer.d.ts +1 -1
  203. package/rest/support/DensifyParameters.d.ts +1 -1
  204. package/rest/support/DirectionLine.d.ts +1 -1
  205. package/rest/support/DirectionPoint.d.ts +1 -1
  206. package/rest/support/DirectionsString.d.ts +1 -1
  207. package/rest/support/DistanceParameters.d.ts +1 -1
  208. package/rest/support/GPMessage.d.ts +1 -1
  209. package/rest/support/ImageAreaParameters.d.ts +1 -1
  210. package/rest/support/ImageAreaResult.d.ts +4 -2
  211. package/rest/support/ImageAreaResult.js +1 -1
  212. package/rest/support/ImageDistanceResult.d.ts +4 -2
  213. package/rest/support/ImageDistanceResult.js +1 -1
  214. package/rest/support/ImageHeightResult.d.ts +2 -1
  215. package/rest/support/ImageHeightResult.js +1 -1
  216. package/rest/support/ImageMeasureResultAngleValue.d.ts +3 -2
  217. package/rest/support/ImageMeasureResultAngleValue.js +1 -1
  218. package/rest/support/ImageMeasureResultAreaValue.d.ts +3 -2
  219. package/rest/support/ImageMeasureResultAreaValue.js +1 -1
  220. package/rest/support/ImageMeasureResultLengthValue.d.ts +4 -3
  221. package/rest/support/ImageMeasureResultLengthValue.js +1 -1
  222. package/rest/support/JobInfo.d.ts +1 -1
  223. package/rest/support/LinearUnit.d.ts +1 -1
  224. package/rest/support/LocateSetting.d.ts +1 -1
  225. package/rest/support/NAMessage.d.ts +1 -1
  226. package/rest/support/NetworkAttribute.d.ts +1 -1
  227. package/rest/support/OffsetParameters.d.ts +1 -1
  228. package/rest/support/PointBarrier.d.ts +1 -1
  229. package/rest/support/PolygonBarrier.d.ts +1 -1
  230. package/rest/support/PolylineBarrier.d.ts +1 -1
  231. package/rest/support/RouteParameters.d.ts +1 -1
  232. package/rest/support/ServiceAreaParameters.d.ts +1 -1
  233. package/rest/support/Stop.d.ts +1 -1
  234. package/rest/support/TravelMode.d.ts +1 -1
  235. package/smartMapping/renderers/pieChart.js +1 -1
  236. package/smartMapping/renderers/relationship.js +1 -1
  237. package/smartMapping/renderers/univariateColorSize.js +1 -1
  238. package/smartMapping/support/adapters/support/utils.js +1 -1
  239. package/support/revision.js +1 -1
  240. package/support/tests/meshUtils.js +1 -1
  241. package/symbols/ExtrudeSymbol3DLayer.d.ts +2 -1
  242. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  243. package/symbols/FillSymbol3DLayer.d.ts +4 -2
  244. package/symbols/FillSymbol3DLayer.js +1 -1
  245. package/symbols/IconSymbol3DLayer.d.ts +23 -4
  246. package/symbols/IconSymbol3DLayer.js +1 -1
  247. package/symbols/LineSymbol3DLayer.d.ts +2 -1
  248. package/symbols/LineSymbol3DLayer.js +1 -1
  249. package/symbols/ObjectSymbol3DLayer.d.ts +6 -3
  250. package/symbols/ObjectSymbol3DLayer.js +1 -1
  251. package/symbols/PathSymbol3DLayer.d.ts +2 -1
  252. package/symbols/PathSymbol3DLayer.js +1 -1
  253. package/symbols/TextSymbol3DLayer.d.ts +21 -3
  254. package/symbols/TextSymbol3DLayer.js +1 -1
  255. package/symbols/patterns/LinePattern3D.js +1 -1
  256. package/symbols/support/IconSymbol3DLayerResource.d.ts +1 -1
  257. package/symbols/support/IconSymbol3DLayerResource.js +1 -1
  258. package/symbols/support/ObjectSymbol3DLayerResource.d.ts +1 -1
  259. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  260. package/symbols/support/OccludedVisibility.d.ts +27 -0
  261. package/symbols/support/Symbol3DAnchorPosition2D.d.ts +1 -1
  262. package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
  263. package/symbols/support/Symbol3DAnchorPosition3D.d.ts +1 -1
  264. package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
  265. package/symbols/support/Symbol3DFillMaterial.d.ts +3 -2
  266. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  267. package/symbols/support/Symbol3DHalo.d.ts +1 -1
  268. package/symbols/support/Symbol3DHalo.js +1 -1
  269. package/symbols/support/Symbol3DIconOutline.d.ts +1 -1
  270. package/symbols/support/Symbol3DIconOutline.js +1 -1
  271. package/symbols/support/Symbol3DMaterial.d.ts +1 -1
  272. package/symbols/support/Symbol3DMaterial.js +1 -1
  273. package/symbols/support/Symbol3DOutline.d.ts +1 -1
  274. package/symbols/support/Symbol3DOutline.js +1 -1
  275. package/symbols/support/Symbol3DTextBackground.d.ts +1 -1
  276. package/symbols/support/Symbol3DTextBackground.js +1 -1
  277. package/symbols/support/previewSymbol3D.js +1 -1
  278. package/symbols/support/primitives.js +5 -0
  279. package/symbols/support/types.d.ts +2 -0
  280. package/symbols/support/utils.js +1 -1
  281. package/views/2d/analysis/AnalysisView2D.d.ts +2 -2
  282. package/views/2d/analysis/AnalysisView2D.js +1 -1
  283. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -1
  284. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
  285. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +1 -1
  286. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
  287. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +1 -1
  288. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  289. package/views/2d/engine/Bitmap.js +1 -1
  290. package/views/2d/engine/Container.js +1 -1
  291. package/views/2d/engine/DisplayObject.js +1 -1
  292. package/views/2d/engine/brushes.js +1 -1
  293. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  294. package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
  295. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  296. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  297. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  298. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  299. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  300. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  301. package/views/2d/engine/webgl/ClipMesh.js +5 -0
  302. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  303. package/views/2d/engine/webgl/Overlay.js +1 -1
  304. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  305. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  306. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  307. package/views/2d/engine/webgl/WGLContainer.js +1 -1
  308. package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
  309. package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
  310. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  311. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  312. package/views/2d/engine/webgl/meshing/SimpleMesh.js +1 -1
  313. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  314. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  315. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  316. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  317. package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +5 -0
  318. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  319. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  320. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  321. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  322. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  323. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  324. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  325. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  326. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  327. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  328. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  329. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  330. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  331. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  332. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  333. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  334. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  335. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  336. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  337. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  338. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  339. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  340. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  341. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  342. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  343. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  344. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  345. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  346. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ClipShader.js +5 -0
  347. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  348. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  349. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  350. package/views/2d/engine/webgl/textureUtils.js +1 -1
  351. package/views/2d/layers/KMLLayerView2D.js +1 -1
  352. package/views/2d/layers/LayerView2D.js +1 -1
  353. package/views/2d/layers/MediaLayerView2D.js +1 -1
  354. package/views/2d/layers/TileLayerView2D.js +1 -1
  355. package/views/2d/layers/features/FeatureContainer.js +1 -1
  356. package/views/2d/layers/features/RenderState.js +1 -1
  357. package/views/2d/webglDeps.js +1 -1
  358. package/views/3d/analysis/AnalysisView3D.d.ts +2 -2
  359. package/views/3d/analysis/AnalysisView3D.js +1 -1
  360. package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -1
  361. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  362. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +1 -1
  363. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  364. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +1 -1
  365. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  366. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +1 -1
  367. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  368. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +1 -1
  369. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  370. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +1 -1
  371. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  372. package/views/3d/analysis/SliceAnalysisView3D.d.ts +1 -1
  373. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  374. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +1 -1
  375. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  376. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  377. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -1
  378. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  379. package/views/3d/constraints/AltitudeConstraint.d.ts +1 -1
  380. package/views/3d/constraints/AltitudeConstraint.js +1 -1
  381. package/views/3d/constraints/ClipDistanceConstraint.d.ts +1 -1
  382. package/views/3d/constraints/ClipDistanceConstraint.js +1 -1
  383. package/views/3d/constraints/Constraints.d.ts +7 -4
  384. package/views/3d/constraints/Constraints.js +1 -1
  385. package/views/3d/constraints/TiltConstraint.d.ts +1 -1
  386. package/views/3d/constraints/TiltConstraint.js +1 -1
  387. package/views/3d/environment/LocalAtmosphere.js +1 -1
  388. package/views/3d/environment/MarsAtmosphere.js +1 -1
  389. package/views/3d/glTF/internal/Resource.js +1 -1
  390. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  391. package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils3D.js +1 -1
  392. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  393. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  394. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  395. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  396. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  397. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  398. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  399. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  400. package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +1 -1
  401. package/views/3d/layers/graphics/pipeline/symbolization/ObjectSymbolLayerRenderer.js +1 -1
  402. package/views/3d/layers/graphics/pipeline/symbolization/factoryUtils.js +1 -1
  403. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  404. package/views/3d/layers/i3s/meshUtils.js +1 -1
  405. package/views/3d/layers/support/MediaLayerInteractionOptions.d.ts +3 -2
  406. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  407. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.d.ts +1 -1
  408. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +1 -1
  409. package/views/3d/support/engineContent/marker.js +1 -1
  410. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  411. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  412. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  413. package/views/3d/terrain/OverlayRenderer.js +1 -1
  414. package/views/3d/terrain/TileCompositor.js +1 -1
  415. package/views/3d/terrain/TileRenderer.js +1 -1
  416. package/views/3d/webgl/ManagedColorAttachment.d.ts +2 -2
  417. package/views/3d/webgl/ManagedColorAttachment.js +1 -1
  418. package/views/3d/webgl/ManagedDepthAttachment.d.ts +2 -2
  419. package/views/3d/webgl/ManagedDepthAttachment.js +1 -1
  420. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  421. package/views/3d/webgl/ManagedFBO.d.ts +8 -6
  422. package/views/3d/webgl/ManagedFBO.js +1 -1
  423. package/views/3d/webgl/ManagedFBOAttachment.d.ts +2 -2
  424. package/views/3d/webgl/ManagedFBOAttachment.js +1 -1
  425. package/views/3d/webgl/ManagedFBOResource.d.ts +1 -1
  426. package/views/3d/webgl/ManagedFBOResource.js +1 -1
  427. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  428. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  429. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +55 -23
  430. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  431. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  432. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  433. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  434. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  435. package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
  436. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  437. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  438. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  439. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  440. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  441. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  442. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  443. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  444. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  445. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  446. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  447. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  448. package/views/DOMContainer.d.ts +1 -2
  449. package/views/MapView.d.ts +10 -15
  450. package/views/PopupView.d.ts +6 -6
  451. package/views/SceneView.d.ts +3 -4
  452. package/views/SceneView.js +1 -1
  453. package/views/VideoView.js +1 -1
  454. package/views/View.d.ts +11 -13
  455. package/views/View2D.d.ts +37 -37
  456. package/views/analysis/AnalysisView.d.ts +1 -1
  457. package/views/analysis/AnalysisView.js +1 -1
  458. package/views/draw/{input/CursorUpdateEvent.d.ts → CursorUpdateEvent.d.ts} +1 -1
  459. package/views/draw/{input/CursorUpdateEvent.js → CursorUpdateEvent.js} +1 -1
  460. package/views/draw/{input/DrawCompleteEvent.d.ts → DrawCompleteEvent.d.ts} +1 -1
  461. package/views/draw/{input/DrawCompleteEvent.js → DrawCompleteEvent.js} +1 -1
  462. package/views/draw/DrawGraphicTool.js +1 -1
  463. package/views/draw/MultipointDrawAction.d.ts +4 -4
  464. package/views/draw/MultipointDrawAction.js +1 -1
  465. package/views/draw/PointDrawAction.d.ts +2 -2
  466. package/views/draw/PointDrawAction.js +1 -1
  467. package/views/draw/PolygonDrawAction.d.ts +4 -4
  468. package/views/draw/PolygonDrawAction.js +1 -1
  469. package/views/draw/PolylineDrawAction.d.ts +4 -4
  470. package/views/draw/PolylineDrawAction.js +1 -1
  471. package/views/draw/SegmentDrawAction.d.ts +3 -3
  472. package/views/draw/SegmentDrawAction.js +1 -1
  473. package/views/draw/{input/VertexAddEvent.d.ts → VertexAddEvent.d.ts} +1 -1
  474. package/views/draw/{input/VertexAddEvent.js → VertexAddEvent.js} +1 -1
  475. package/views/draw/{input/VertexRemoveEvent.d.ts → VertexRemoveEvent.d.ts} +1 -1
  476. package/views/draw/VertexRemoveEvent.js +5 -0
  477. package/views/draw/support/Reshape.js +1 -1
  478. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  479. package/views/draw/support/tooltipUtils.js +1 -1
  480. package/views/interactive/sketch/Units.d.ts +3 -0
  481. package/views/layers/HighlightLayerViewMixin.d.ts +1 -3
  482. package/views/layers/ImageryLayerViewMixin.d.ts +1 -3
  483. package/views/layers/KMLLayerView.d.ts +1 -1
  484. package/views/layers/MediaLayerViewMixin.d.ts +3 -2
  485. package/views/layers/MediaLayerViewMixin.js +1 -1
  486. package/views/support/GeodesicMeasurementWorker.js +5 -0
  487. package/views/support/GeodesicMeasurementWorkerHandle.js +5 -0
  488. package/views/support/HighlightOptions.d.ts +0 -1
  489. package/views/support/TextureCompressionHelper.js +1 -1
  490. package/views/support/automaticAreaMeasurementUtils.js +1 -1
  491. package/views/support/imageReprojection.js +1 -1
  492. package/views/types.d.ts +1 -1
  493. package/views/webgl/FramebufferObject.js +1 -1
  494. package/views/webgl/RenderingContext.js +1 -1
  495. package/views/webgl/Texture.js +1 -1
  496. package/views/webgl/rasterUtils.js +1 -1
  497. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  498. package/views/webgl/textureTracer.js +5 -0
  499. package/webdoc/support/SlideThumbnail.d.ts +1 -1
  500. package/webdoc/support/SlideThumbnail.js +1 -1
  501. package/webmap/Bookmark.d.ts +2 -1
  502. package/webmap/Bookmark.js +1 -1
  503. package/webmap/Version.d.ts +2 -2
  504. package/webmap/Version.js +1 -1
  505. package/webmap/utils.js +1 -1
  506. package/webscene/Slide.d.ts +6 -3
  507. package/webscene/Slide.js +1 -1
  508. package/webscene/Version.d.ts +2 -2
  509. package/webscene/Version.js +1 -1
  510. package/webscene/spec-certification/api.js +1 -1
  511. package/webscene/support/SlideEnvironment.d.ts +1 -1
  512. package/webscene/support/SlideEnvironment.js +1 -1
  513. package/webscene/support/SlideVisibleLayer.d.ts +1 -1
  514. package/webscene/support/SlideVisibleLayer.js +1 -1
  515. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +1 -1
  516. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  517. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.d.ts +1 -1
  518. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  519. package/widgets/BatchAttributeForm/VisibleElements.d.ts +1 -1
  520. package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
  521. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  522. package/widgets/BatchAttributeForm.d.ts +2 -1
  523. package/widgets/BatchAttributeForm.js +1 -1
  524. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  525. package/widgets/Bookmarks.js +1 -1
  526. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.d.ts +1 -1
  527. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  528. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +1 -1
  529. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  530. package/widgets/Editor.js +1 -1
  531. package/widgets/FeatureTable/ActionColumn.d.ts +1 -1
  532. package/widgets/FeatureTable/AttachmentsColumn.d.ts +1 -1
  533. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +2 -2
  534. package/widgets/FeatureTable/FieldColumn.d.ts +1 -1
  535. package/widgets/FeatureTable/Grid/Column.d.ts +1 -1
  536. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -1
  537. package/widgets/FeatureTable/support/FieldColumnTemplate.d.ts +1 -1
  538. package/widgets/FeatureTable/support/GroupColumnTemplate.d.ts +1 -1
  539. package/widgets/FeatureTable/support/TableTemplate.d.ts +1 -1
  540. package/widgets/FeatureTable/support/{interfaces.d.ts → types.d.ts} +1 -1
  541. package/widgets/FeatureTable.d.ts +2 -2
  542. package/widgets/LineOfSight/LineOfSightViewModel.d.ts +1 -1
  543. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  544. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  545. package/widgets/PanoramicViewer/support/importUtils.js +1 -1
  546. package/widgets/Print/PrintViewModel.d.ts +1 -1
  547. package/widgets/Sketch/CreateToolVisibilityMap.d.ts +1 -1
  548. package/widgets/Sketch/CreateToolVisibilityMap.js +1 -1
  549. package/widgets/Sketch/SelectionToolVisibilityMap.d.ts +1 -1
  550. package/widgets/Sketch/SelectionToolVisibilityMap.js +1 -1
  551. package/widgets/Sketch/VisibleElements.d.ts +5 -3
  552. package/widgets/Sketch/VisibleElements.js +1 -1
  553. package/widgets/Sketch.d.ts +2 -1
  554. package/widgets/Sketch.js +1 -1
  555. package/widgets/Slice/SliceViewModel.d.ts +1 -1
  556. package/widgets/Slice/SliceViewModel.js +1 -1
  557. package/widgets/UtilityNetworkAssociations.js +1 -1
  558. package/widgets/support/AnalysisViewModel.d.ts +1 -1
  559. package/widgets/support/AnalysisViewModel.js +1 -1
  560. package/widgets/support/InteractiveToolViewModel.d.ts +1 -1
  561. package/widgets/support/InteractiveToolViewModel.js +1 -1
  562. package/assets/esri/core/libs/libtess/libtess.wasm +0 -0
  563. package/assets/esri/core/workers/chunks/00e407d262c49890afa8.js +0 -1
  564. package/assets/esri/core/workers/chunks/19db60a3b4b09d445bd1.js +0 -1
  565. package/assets/esri/core/workers/chunks/1e55f152b60145f33b61.js +0 -1
  566. package/assets/esri/core/workers/chunks/294acaaebfedb05fe81e.js +0 -1
  567. package/assets/esri/core/workers/chunks/31eda00e6842005d0ec8.js +0 -1
  568. package/assets/esri/core/workers/chunks/3d49c6427120edc8eac9.js +0 -1
  569. package/assets/esri/core/workers/chunks/404229f10aef5ac23c87.js +0 -1
  570. package/assets/esri/core/workers/chunks/4278b35fb6fd578c403e.js +0 -1
  571. package/assets/esri/core/workers/chunks/46b63a65484b102e9ccb.js +0 -1
  572. package/assets/esri/core/workers/chunks/4f03d19a70dca6c507be.js +0 -316
  573. package/assets/esri/core/workers/chunks/5686220aed9a74dbd2b1.js +0 -1
  574. package/assets/esri/core/workers/chunks/5a2933ae19345b7d5aa7.js +0 -1
  575. package/assets/esri/core/workers/chunks/5e9fdd4eff7189f45932.js +0 -1
  576. package/assets/esri/core/workers/chunks/67a45faa80316f43c51b.js +0 -1
  577. package/assets/esri/core/workers/chunks/68ee11589de0da7fed08.js +0 -1
  578. package/assets/esri/core/workers/chunks/82ced9254b27707522ef.js +0 -1
  579. package/assets/esri/core/workers/chunks/bb5373ff7cdad7270095.js +0 -1
  580. package/assets/esri/core/workers/chunks/bddaa83fcb9fdb1e1856.js +0 -1
  581. package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +0 -1
  582. package/assets/esri/core/workers/chunks/d199deff988eaefe18b4.js +0 -1
  583. package/assets/esri/core/workers/chunks/d77f56576a49a998164a.js +0 -1
  584. package/assets/esri/core/workers/chunks/dae09fb8da0faa6dede4.js +0 -1
  585. package/assets/esri/core/workers/chunks/e16e88de4e93b0f48b2c.js +0 -1
  586. package/chunks/libtess-asm.js +0 -5
  587. package/chunks/libtess.js +0 -5
  588. package/layers/BlendMode.d.ts +0 -2
  589. package/layers/LayerListMode.d.ts +0 -2
  590. package/layers/LayerType.d.ts +0 -2
  591. package/popup/content/support/mediaInfoTypes.d.ts +0 -7
  592. package/support/modeUtils.d.ts +0 -2
  593. package/views/SelectionManager.d.ts +0 -1
  594. package/views/draw/input/VertexRemoveEvent.js +0 -5
  595. package/views/webgl/Texture.d.ts +0 -6
  596. /package/portal/{interfaces.d.ts → types.d.ts} +0 -0
  597. /package/rest/support/{interfaces.d.ts → types.d.ts} +0 -0
  598. /package/views/draw/{input/VertexUpdateEvent.js → VertexUpdateEvent.js} +0 -0
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.63",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.65",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,12 +2,12 @@ import type Extent from "../geometry/Extent.js";
2
2
  import type SpatialReference from "../geometry/SpatialReference.js";
3
3
  import type Layer from "./Layer.js";
4
4
  import type ElevationSampler from "./support/ElevationSampler.js";
5
+ import type ElevationTileData from "./support/ElevationTileData.js";
5
6
  import type TileInfo from "./support/TileInfo.js";
6
7
  import type { EsriPromiseMixin } from "../core/Promise.js";
7
8
  import type { AbortOptions } from "../core/promiseUtils.js";
8
9
  import type { ElevationQueryResult, QueryGeometry } from "./support/ElevationQuery.js";
9
10
  import type { QueryOptions as ElevationQueryOptions, CreateSamplerOptions } from "./support/ElevationQueryContext.js";
10
- import type { ElevationTileData } from "./support/ElevationTileData.js";
11
11
  import type { TileInfoProperties } from "./support/TileInfo.js";
12
12
  import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
13
13
  import type { LayerProperties } from "./Layer.js";
@@ -1,6 +1,7 @@
1
1
  import type Extent from "../geometry/Extent.js";
2
2
  import type Layer from "./Layer.js";
3
3
  import type ElevationSampler from "./support/ElevationSampler.js";
4
+ import type ElevationTileData from "./support/ElevationTileData.js";
4
5
  import type { MultiOriginJSONMixin, MultiOriginJSONMixinProperties } from "../core/MultiOriginJSONSupport.js";
5
6
  import type { AbortOptions } from "../core/promiseUtils.js";
6
7
  import type { ArcGISCachedService, ArcGISCachedServiceProperties } from "./mixins/ArcGISCachedService.js";
@@ -9,7 +10,6 @@ import type { OperationalLayer, OperationalLayerProperties } from "./mixins/Oper
9
10
  import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
10
11
  import type { ElevationQueryResult, QueryGeometry } from "./support/ElevationQuery.js";
11
12
  import type { QueryOptions as ElevationQueryOptions, CreateSamplerOptions } from "./support/ElevationQueryContext.js";
12
- import type { ElevationTileData } from "./support/ElevationTileData.js";
13
13
  import type { LayerProperties } from "./Layer.js";
14
14
 
15
15
  export interface ElevationLayerProperties extends LayerProperties, MultiOriginJSONMixinProperties, PortalLayerProperties, OperationalLayerProperties, ArcGISServiceProperties, ArcGISCachedServiceProperties, Partial<Pick<ElevationLayer, "sourceJSON" | "url">> {
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../request.js";import t from"../core/Error.js";import{releaseMaybe as i}from"../core/maybe.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s,throwIfAborted as a}from"../core/promiseUtils.js";import{objectToQuery as p}from"../core/urlUtils.js";import{property as l,subclass as n}from"../core/accessorSupport/decorators.js";import c from"../geometry/HeightModelInfo.js";import d from"./Layer.js";import{ArcGISCachedService as y}from"./mixins/ArcGISCachedService.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{OperationalLayer as m}from"./mixins/OperationalLayer.js";import{PortalLayer as u}from"./mixins/PortalLayer.js";import{url as v}from"./support/commonProperties.js";import{ElevationTileData as f}from"./support/ElevationTileData.js";import{acquireDecoder as g}from"./support/LercDecoder.js";import{reader as S}from"../core/accessorSupport/decorators/reader.js";let w=class extends(y(h(m(u(o(d)))))){constructor(...e){super(...e),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=g()}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}destroy(){this._lercDecoder=i(this._lercDecoder)}readCapabilities(e,r){const t=r.capabilities&&r.capabilities.split(",").map(e=>e.toLowerCase().trim());if(!t)return{operations:{supportsTileMap:!1}};return{operations:{supportsTileMap:t.includes("tilemap")}}}readVersion(e,r){let t=r.currentVersion;return t||(t=9.3),t}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:e=>{if(e.typeKeywords)for(let r=0;r<e.typeKeywords.length;r++)if("elevation 3d layer"===e.typeKeywords[r].toLowerCase())return!0;throw new t("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}' ",{type:"Image Service",expectedType:"Image Service Elevation 3D Layer"})}},e).catch(s).then(()=>this._fetchImageService(r))),Promise.resolve(this)}fetchTile(e,t,i,o){const s=o?.signal,a={responseType:"array-buffer",signal:s},p={noDataValue:o?.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(e,t,i,o)).then(()=>r(this.getTileUrl(e,t,i),a)).then(e=>this._lercDecoder.decode(e.data,p,s)).then(e=>new f(e))}getTileUrl(e,r,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,o=p({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${e}/${r}/${t}${o?"?"+o:""}`}async queryElevation(e,r){const{query:t}=await import("./support/ElevationQuery.js");return a(r),t(this,e,r)}async createElevationSampler(e,r){const{createSampler:t}=await import("./support/ElevationQuery.js");return a(r),t(this,e,r)}_fetchTileAvailability(e,r,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,r,t,i):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const t={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},i=await r(this.parsedUrl.path,t);i.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=i.data,this.read(i.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[j]}};e([l({readOnly:!0})],w.prototype,"capabilities",void 0),e([S("service","capabilities",["capabilities"])],w.prototype,"readCapabilities",null),e([l({json:{read:{source:"copyrightText"}}})],w.prototype,"copyright",void 0),e([l({readOnly:!0,type:c})],w.prototype,"heightModelInfo",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],w.prototype,"path",void 0),e([l({type:["show","hide"]})],w.prototype,"listMode",void 0),e([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],w.prototype,"minScale",void 0),e([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],w.prototype,"maxScale",void 0),e([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],w.prototype,"opacity",void 0),e([l({type:["ArcGISTiledElevationServiceLayer"]})],w.prototype,"operationalLayerType",void 0),e([l()],w.prototype,"sourceJSON",void 0),e([l({json:{read:!1},value:"elevation",readOnly:!0})],w.prototype,"type",void 0),e([l(v)],w.prototype,"url",void 0),e([l()],w.prototype,"version",void 0),e([S("version",["currentVersion"])],w.prototype,"readVersion",null),w=e([n("esri.layers.ElevationLayer")],w);const j=Symbol("default-fetch-tile");w.prototype.fetchTile[j]=!0;const T=w;export{T as default};
5
+ import{__decorate as e}from"tslib";import r from"../request.js";import t from"../core/Error.js";import{releaseMaybe as i}from"../core/maybe.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s,throwIfAborted as a}from"../core/promiseUtils.js";import{objectToQuery as p}from"../core/urlUtils.js";import{property as l,subclass as n}from"../core/accessorSupport/decorators.js";import c from"../geometry/HeightModelInfo.js";import d from"./Layer.js";import{ArcGISCachedService as y}from"./mixins/ArcGISCachedService.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{OperationalLayer as m}from"./mixins/OperationalLayer.js";import{PortalLayer as u}from"./mixins/PortalLayer.js";import{url as v}from"./support/commonProperties.js";import f from"./support/ElevationTileData.js";import{acquireDecoder as g}from"./support/LercDecoder.js";import{reader as S}from"../core/accessorSupport/decorators/reader.js";let w=class extends(y(h(m(u(o(d)))))){constructor(...e){super(...e),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=g()}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}destroy(){this._lercDecoder=i(this._lercDecoder)}readCapabilities(e,r){const t=r.capabilities&&r.capabilities.split(",").map(e=>e.toLowerCase().trim());if(!t)return{operations:{supportsTileMap:!1}};return{operations:{supportsTileMap:t.includes("tilemap")}}}readVersion(e,r){let t=r.currentVersion;return t||(t=9.3),t}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:e=>{if(e.typeKeywords)for(let r=0;r<e.typeKeywords.length;r++)if("elevation 3d layer"===e.typeKeywords[r].toLowerCase())return!0;throw new t("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}' ",{type:"Image Service",expectedType:"Image Service Elevation 3D Layer"})}},e).catch(s).then(()=>this._fetchImageService(r))),Promise.resolve(this)}fetchTile(e,t,i,o){const s=o?.signal,a={responseType:"array-buffer",signal:s},p={noDataValue:o?.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(e,t,i,o)).then(()=>r(this.getTileUrl(e,t,i),a)).then(e=>this._lercDecoder.decode(e.data,p,s)).then(e=>new f(e))}getTileUrl(e,r,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,o=p({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${e}/${r}/${t}${o?"?"+o:""}`}async queryElevation(e,r){const{query:t}=await import("./support/ElevationQuery.js");return a(r),t(this,e,r)}async createElevationSampler(e,r){const{createSampler:t}=await import("./support/ElevationQuery.js");return a(r),t(this,e,r)}_fetchTileAvailability(e,r,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,r,t,i):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const t={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},i=await r(this.parsedUrl.path,t);i.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=i.data,this.read(i.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[j]}};e([l({readOnly:!0})],w.prototype,"capabilities",void 0),e([S("service","capabilities",["capabilities"])],w.prototype,"readCapabilities",null),e([l({json:{read:{source:"copyrightText"}}})],w.prototype,"copyright",void 0),e([l({readOnly:!0,type:c})],w.prototype,"heightModelInfo",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],w.prototype,"path",void 0),e([l({type:["show","hide"]})],w.prototype,"listMode",void 0),e([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],w.prototype,"minScale",void 0),e([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],w.prototype,"maxScale",void 0),e([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],w.prototype,"opacity",void 0),e([l({type:["ArcGISTiledElevationServiceLayer"]})],w.prototype,"operationalLayerType",void 0),e([l()],w.prototype,"sourceJSON",void 0),e([l({json:{read:!1},value:"elevation",readOnly:!0})],w.prototype,"type",void 0),e([l(v)],w.prototype,"url",void 0),e([l()],w.prototype,"version",void 0),e([S("version",["currentVersion"])],w.prototype,"readVersion",null),w=e([n("esri.layers.ElevationLayer")],w);const j=Symbol("default-fetch-tile");w.prototype.fetchTile[j]=!0;const T=w;export{T as default};
@@ -400,8 +400,6 @@ export interface FeatureLayerProperties extends LayerProperties, ClonableMixinPr
400
400
  * to return updated features.
401
401
  *
402
402
  * @see [Add an array of client-side features](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#client-side)
403
- * @see [Sample - Create a FeatureLayer with client-side graphics](https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection/)
404
- * @see [Sample - Add or remove graphics from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection-edits/)
405
403
  * @see [Sample - Add 100,000 features to feature collection](https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-large-collection/)
406
404
  * @example
407
405
  * let features = [
@@ -594,7 +592,7 @@ export interface FeatureLayerEvents extends EditBusLayerEvents, RefreshableLayer
594
592
  *
595
593
  * **Runtime updates:** FeatureLayer's [source](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source) is not updated after the FeatureLayer is initialized. If features are added, removed or updated at runtime,
596
594
  * then use [applyEdits()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits) to update the features then use [queryFeatures()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#queryFeatures) to return updated features. Check out
597
- * [add or remove graphics from a FeatureLayer sample](https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection-edits/)
595
+ * [Working with large feature collections](https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-large-collection/)
598
596
  * to see this in action.
599
597
  *
600
598
  * Attribute values used in attribute queries executed against client-side feature layer, and layer views are case sensitive.
@@ -1248,8 +1246,6 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
1248
1246
  * to return updated features.
1249
1247
  *
1250
1248
  * @see [Add an array of client-side features](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#client-side)
1251
- * @see [Sample - Create a FeatureLayer with client-side graphics](https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection/)
1252
- * @see [Sample - Add or remove graphics from a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection-edits/)
1253
1249
  * @see [Sample - Add 100,000 features to feature collection](https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-large-collection/)
1254
1250
  * @example
1255
1251
  * let features = [
package/layers/Layer.d.ts CHANGED
@@ -13,8 +13,7 @@ import type { EventedMixin, EventedMixinProperties } from "../core/Evented.js";
13
13
  import type { IdentifiableMixin, IdentifiableMixinProperties } from "../core/Identifiable.js";
14
14
  import type { Loadable, LoadableMixinProperties } from "../core/Loadable.js";
15
15
  import type { AbortOptions } from "../core/promiseUtils.js";
16
- import type { LayerListMode } from "./LayerListMode.js";
17
- import type { LayerType } from "./LayerType.js";
16
+ import type { LayerType, LayerListMode } from "./types.js";
18
17
  import type { ExtentProperties } from "../geometry/Extent.js";
19
18
  import type { TimeExtentProperties } from "../time/TimeExtent.js";
20
19
 
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import i from"../core/Collection.js";import o from"../core/Error.js";import has from"../core/has.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as p}from"../core/object.js";import{watch as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import y from"../geometry/SpatialReference.js";import c from"../graphic/ParquetGraphicOrigin.js";import f from"./Layer.js";import{ParquetSource as h}from"./graphics/sources/ParquetSource.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as v}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as w}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as b}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{OrderedLayer as q}from"./mixins/OrderedLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{labelsVisible as F,legendEnabled as P,popupEnabled as E}from"./support/commonProperties.js";import T from"./support/FeatureTemplate.js";import L from"./support/Field.js";import{defineFieldProperties as R}from"./support/fieldProperties.js";import{fixRendererFields as S,fixTimeInfoFields as U}from"./support/fieldUtils.js";import _ from"./support/LabelClass.js";import{reader as D}from"./support/labelingInfo.js";import{ParquetGeometryEncodingBase as z}from"./support/ParquetGeometryEncodingBase.js";import C from"./support/ParquetGeometryEncodingLocation.js";import Q from"./support/ParquetGeometryEncodingWkb.js";import{parquetGeometryTypeKebabDict as k}from"./support/parquetUtils.js";import{rendererTypes as G}from"../renderers/support/typeUtils.js";import J from"../rest/support/Query.js";import{t as M}from"../chunks/persistableUrlUtils.js";import{createPopupTemplate as B}from"../support/popupUtils.js";const N=R(),V="__OBJECTID",W={types:{key:"type",base:z,typeMap:{wkb:Q,location:C}},json:{name:"layerDefinition.geometryEncoding",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryEncoding"}}}}};let H=class extends(v(b(w(g(q(I(x(O(s(j(t(f)))))))))))){constructor(e){super(e),this.copyright=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new c(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=V,this.operationalLayerType="ParquetLayer",this.outFields=null,this.persistenceEnabled=!!has("parquetlayer-persistence-enabled"),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.title="Parquet",this.type="parquet",this.urls=new i}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this.addHandles([n(()=>this.urls,e=>this.source?.updateFiles(e.items)),n(()=>this.customParameters,e=>this.source?.setCustomParameters(e))]),this}get capabilities(){return this.source?.capabilities}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t,i){const o=e.filter(e=>!(e.name===V&&"oid"===e.type)).map(e=>e.toJSON(i));p(t,o,r)}get isTable(){return null==this.geometryEncoding&&null==this.displayOptimization}set renderer(e){S(e,this.fieldsIndex),this._set("renderer",e)}readUrls(e){return new i("files"===e.type?e.urls:[])}writeUrls(e,r,t,i){const s=[];if(e?.length){i={blockedRelativeUrls:i?.blockedRelativeUrls};for(let r of e)r=M(r,i),r&&s.push(r)}s.length?r.source={type:"files",urls:s}:i.messages?.push(new o("parquet-layer:missing-urls","Missing or empty 'urls'",{layer:this}))}createPopupTemplate(e){return B(this,e)}createQuery(){const e=new J;return e.returnGeometry=!0,e.outFields=["*"],e}async createSource(e){const r=new h({layer:this});return await r.load(e),r}getFieldDomain(e,r){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,r){await this.load();const t=await this.source.queryFeatures(this._normalizeQuery(e),r),i=this.graphicOrigin;if(t?.features)for(const o of t.features)o.layer=o.sourceLayer=this,o.origin=i;return t}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),r)}async queryFeatureCount(e,r){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),r)}async queryExtent(e,r){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),r)}_normalizeQuery(e){return J.from(e)??this.createQuery()}async _load(e){const r=await this.createSource(e);this._set("source",r),this.read(r.sourceJSON,{origin:"service"}),this.revert(["fields","timeInfo"],"service"),S(this.renderer,this.fieldsIndex),U(this.timeInfo,this.fieldsIndex),null==this.spatialReference&&(this.spatialReference=y.WGS84)}};e([a({readOnly:!0,json:{read:!1,write:!1}})],H.prototype,"capabilities",null),e([a({type:String})],H.prototype,"copyright",void 0),e([a({readOnly:!0})],H.prototype,"defaultPopupTemplate",null),e([a()],H.prototype,"displayOptimization",void 0),e([a({type:[L],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],H.prototype,"fields",void 0),e([m("fields")],H.prototype,"writeFields",null),e([a(N.fieldsIndex)],H.prototype,"fieldsIndex",void 0),e([a(W)],H.prototype,"geometryEncoding",void 0),e([a({type:d,json:{name:"extent"}})],H.prototype,"fullExtent",void 0),e([a({type:k.apiValues,json:{name:"layerDefinition.geometryType",read:{reader:k.read},write:{writer:k.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryType",reader:k.read}}}}})],H.prototype,"geometryType",void 0),e([a({readOnly:!0,clonable:!1})],H.prototype,"graphicOrigin",void 0),e([a(F)],H.prototype,"labelsVisible",void 0),e([a({type:[_],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:D},write:!0}})],H.prototype,"labelingInfo",void 0),e([a(P)],H.prototype,"legendEnabled",void 0),e([a()],H.prototype,"file",void 0),e([a({type:String,readOnly:!0})],H.prototype,"objectIdField",void 0),e([a({type:["ParquetLayer"]})],H.prototype,"operationalLayerType",void 0),e([a(N.outFields)],H.prototype,"outFields",void 0),e([a(E)],H.prototype,"popupEnabled",void 0),e([a({type:r,json:{name:"popupInfo",write:!0}})],H.prototype,"popupTemplate",void 0),e([a({types:G,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{read:{source:"drawingInfo.renderer"}}}}})],H.prototype,"renderer",null),e([a({type:h,readOnly:!0,cast:null,json:{read:!1}})],H.prototype,"source",void 0),e([a({type:y,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"extent.spatialReference"}}}}})],H.prototype,"spatialReference",void 0),e([a({type:[T]})],H.prototype,"templates",void 0),e([a()],H.prototype,"title",void 0),e([a({json:{read:!1},readOnly:!0})],H.prototype,"type",void 0),e([a({type:i.ofType(String),json:{name:"source",write:{isRequired:!0,ignoreOrigin:!0}}})],H.prototype,"urls",void 0),e([l("urls")],H.prototype,"readUrls",null),e([m("urls")],H.prototype,"writeUrls",null),H=e([u("esri.layers.ParquetLayer")],H);const A=H;export{A as default};
5
+ import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import i from"../core/Collection.js";import o from"../core/Error.js";import has from"../core/has.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as p}from"../core/object.js";import{watch as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import y from"../geometry/SpatialReference.js";import c from"../graphic/ParquetGraphicOrigin.js";import f from"./Layer.js";import{ParquetSource as h}from"./graphics/sources/ParquetSource.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as v}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as w}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as b}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{OrderedLayer as q}from"./mixins/OrderedLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{labelsVisible as F,legendEnabled as P,popupEnabled as E}from"./support/commonProperties.js";import T from"./support/FeatureTemplate.js";import L from"./support/Field.js";import{defineFieldProperties as R}from"./support/fieldProperties.js";import{fixRendererFields as S,fixTimeInfoFields as U}from"./support/fieldUtils.js";import _ from"./support/LabelClass.js";import{reader as D}from"./support/labelingInfo.js";import z from"./support/ParquetGeometryEncodingBase.js";import C from"./support/ParquetGeometryEncodingLocation.js";import Q from"./support/ParquetGeometryEncodingWkb.js";import{parquetGeometryTypeKebabDict as k}from"./support/parquetUtils.js";import{rendererTypes as G}from"../renderers/support/typeUtils.js";import J from"../rest/support/Query.js";import{t as M}from"../chunks/persistableUrlUtils.js";import{createPopupTemplate as B}from"../support/popupUtils.js";const N=R(),V="__OBJECTID",W={types:{key:"type",base:z,typeMap:{wkb:Q,location:C}},json:{name:"layerDefinition.geometryEncoding",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryEncoding"}}}}};let H=class extends(v(b(w(g(q(I(x(O(s(j(t(f)))))))))))){constructor(e){super(e),this.copyright=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new c(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=V,this.operationalLayerType="ParquetLayer",this.outFields=null,this.persistenceEnabled=!!has("parquetlayer-persistence-enabled"),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.title="Parquet",this.type="parquet",this.urls=new i}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this.addHandles([n(()=>this.urls,e=>this.source?.updateFiles(e.items)),n(()=>this.customParameters,e=>this.source?.setCustomParameters(e))]),this}get capabilities(){return this.source?.capabilities}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t,i){const o=e.filter(e=>!(e.name===V&&"oid"===e.type)).map(e=>e.toJSON(i));p(t,o,r)}get isTable(){return null==this.geometryEncoding&&null==this.displayOptimization}set renderer(e){S(e,this.fieldsIndex),this._set("renderer",e)}readUrls(e){return new i("files"===e.type?e.urls:[])}writeUrls(e,r,t,i){const s=[];if(e?.length){i={blockedRelativeUrls:i?.blockedRelativeUrls};for(let r of e)r=M(r,i),r&&s.push(r)}s.length?r.source={type:"files",urls:s}:i.messages?.push(new o("parquet-layer:missing-urls","Missing or empty 'urls'",{layer:this}))}createPopupTemplate(e){return B(this,e)}createQuery(){const e=new J;return e.returnGeometry=!0,e.outFields=["*"],e}async createSource(e){const r=new h({layer:this});return await r.load(e),r}getFieldDomain(e,r){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,r){await this.load();const t=await this.source.queryFeatures(this._normalizeQuery(e),r),i=this.graphicOrigin;if(t?.features)for(const o of t.features)o.layer=o.sourceLayer=this,o.origin=i;return t}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),r)}async queryFeatureCount(e,r){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),r)}async queryExtent(e,r){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),r)}_normalizeQuery(e){return J.from(e)??this.createQuery()}async _load(e){const r=await this.createSource(e);this._set("source",r),this.read(r.sourceJSON,{origin:"service"}),this.revert(["fields","timeInfo"],"service"),S(this.renderer,this.fieldsIndex),U(this.timeInfo,this.fieldsIndex),null==this.spatialReference&&(this.spatialReference=y.WGS84)}};e([a({readOnly:!0,json:{read:!1,write:!1}})],H.prototype,"capabilities",null),e([a({type:String})],H.prototype,"copyright",void 0),e([a({readOnly:!0})],H.prototype,"defaultPopupTemplate",null),e([a()],H.prototype,"displayOptimization",void 0),e([a({type:[L],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],H.prototype,"fields",void 0),e([m("fields")],H.prototype,"writeFields",null),e([a(N.fieldsIndex)],H.prototype,"fieldsIndex",void 0),e([a(W)],H.prototype,"geometryEncoding",void 0),e([a({type:d,json:{name:"extent"}})],H.prototype,"fullExtent",void 0),e([a({type:k.apiValues,json:{name:"layerDefinition.geometryType",read:{reader:k.read},write:{writer:k.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryType",reader:k.read}}}}})],H.prototype,"geometryType",void 0),e([a({readOnly:!0,clonable:!1})],H.prototype,"graphicOrigin",void 0),e([a(F)],H.prototype,"labelsVisible",void 0),e([a({type:[_],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:D},write:!0}})],H.prototype,"labelingInfo",void 0),e([a(P)],H.prototype,"legendEnabled",void 0),e([a()],H.prototype,"file",void 0),e([a({type:String,readOnly:!0})],H.prototype,"objectIdField",void 0),e([a({type:["ParquetLayer"]})],H.prototype,"operationalLayerType",void 0),e([a(N.outFields)],H.prototype,"outFields",void 0),e([a(E)],H.prototype,"popupEnabled",void 0),e([a({type:r,json:{name:"popupInfo",write:!0}})],H.prototype,"popupTemplate",void 0),e([a({types:G,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{read:{source:"drawingInfo.renderer"}}}}})],H.prototype,"renderer",null),e([a({type:h,readOnly:!0,cast:null,json:{read:!1}})],H.prototype,"source",void 0),e([a({type:y,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"extent.spatialReference"}}}}})],H.prototype,"spatialReference",void 0),e([a({type:[T]})],H.prototype,"templates",void 0),e([a()],H.prototype,"title",void 0),e([a({json:{read:!1},readOnly:!0})],H.prototype,"type",void 0),e([a({type:i.ofType(String),json:{name:"source",write:{isRequired:!0,ignoreOrigin:!0}}})],H.prototype,"urls",void 0),e([l("urls")],H.prototype,"readUrls",null),e([m("urls")],H.prototype,"writeUrls",null),H=e([u("esri.layers.ParquetLayer")],H);const A=H;export{A as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,throwIfAborted as y,isAbortError as u,throwIfNotAbortError as c}from"../core/promiseUtils.js";import{whenOnce as h}from"../core/reactiveUtils.js";import{property as f,subclass as m}from"../core/accessorSupport/decorators.js";import{getProperties as g}from"../core/accessorSupport/utils.js";import v from"../geometry/Point.js";import{projectAsync as b}from"../geometry/projectionUtils.js";import w from"../graphic/SceneGraphicOrigin.js";import I from"./Layer.js";import{NoModelError as L,MultipleModelsError as j}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as _}from"./mixins/EditBusLayer.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{SceneService as x}from"./mixins/SceneService.js";import{useViewTimeProperty as E}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as D}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as U}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as q}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as R}from"./support/capabilities.js";import{elevationInfo as C,labelsVisible as N,legendEnabled as G,popupEnabled as Q,attributeTableTemplate as V,screenSizePerspectiveEnabled as M}from"./support/commonProperties.js";import{getFieldDomain as k,computeEffectiveEditingEnabled as K,getGlobalIdToObjectIdMap as $}from"./support/featureLayerUtils.js";import{FeatureReduction as H}from"./support/FeatureReduction.js";import z from"./support/FeatureReductionSelection.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import Z from"./support/FieldsIndex.js";import{fixRendererFields as B,unpackFieldNames as J}from"./support/fieldUtils.js";import{I3SNodePageDefinition as X,I3SMaterialDefinition as Y,I3STextureSetDefinition as ee,I3SGeometryDefinition as te}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as re,isFileSupported as ie}from"./support/infoFor3D.js";import se from"./support/LabelClass.js";import{reader as oe}from"./support/labelingInfo.js";import ae from"./support/LayerFloorInfo.js";import{layerLookupMap as ne}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as le}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as pe}from"./support/RangeInfo.js";import de from"./support/SceneFilter.js";import{cacheIsOutOfSync as ye}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ue}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ce}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as he}from"../renderers/support/typeUtils.js";import fe from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as me,elevationModeUnsupportedMessage as ge,featureExpressionUnsupportedMessage as ve}from"../support/elevationInfoUtils.js";import{createPopupTemplate as be}from"../support/popupUtils.js";import{extractZipFiles as we}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as Ie}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Le,getFetchPopupTemplate as je}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Fe}from"../webdoc/support/opacityUtils.js";import{reader as Se}from"../core/accessorSupport/decorators/reader.js";const Oe=new Set(["3DObject","Point"]),_e=W();let Pe=class extends(D(_(x(S(P(A(T(p(O(F(i(I)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new w(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?k(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:X.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&K(this.associatedLayer)}get geometryType(){return Te[this.profile]||"mesh"}set renderer(e){B(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:R;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Ae[r]?Ae[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e?.signal;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ce(this,{origin:"service"},t),B(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new fe;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=J(this.fieldsIndex,await Le(this,je(this)));return Ie(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new o("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s.origin=this.graphicOrigin,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return be(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new o("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return U(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await $(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(t),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e);y(t);const s=i.reduce((e,t)=>re(this.infoFor3D,t)?e+1:e,0);0===s&&r(new L),s>1&&r(new j);const a=this.spatialReference,l=t.origin,p=await b(l??t.defaultOrigin??new v({x:0,y:0,z:0,spatialReference:a}),a,t),d=a.isGeographic?"local":"georeferenced",{default:u}=await import("../geometry/Mesh.js");y(t);const c=u.createWithExternalSource(p,{type:"client",files:i},{vertexSpace:d,transform:le(a),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!l});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await we(e)).filter(e=>ie(t,e))}validateLayer(e){if(e.layerType&&!Oe.has(e.layerType))throw new o("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new o("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=g(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!U(this.associatedLayer?.url)||!ye(this))return;g(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await q(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ne.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){u(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(a(e));try{await h(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void c(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&me(n.getLogger(this),ge("Mesh scene layers","relative-to-scene",e)),me(n.getLogger(this),ve("Scene layers",e))}async fetchStatistics(e,t){return await ue({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([f({types:{key:"type",base:H,typeMap:{selection:z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Pe.prototype,"featureReduction",void 0),e([f({type:[pe],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Pe.prototype,"rangeInfos",void 0),e([f({json:{read:!1}})],Pe.prototype,"associatedLayer",void 0),e([f({type:["show","hide"]})],Pe.prototype,"listMode",void 0),e([f({type:["ArcGISSceneServiceLayer"]})],Pe.prototype,"operationalLayerType",void 0),e([f({json:{read:!1},readOnly:!0})],Pe.prototype,"type",void 0),e([f({..._e.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Pe.prototype,"fields",void 0),e([f()],Pe.prototype,"types",null),e([f()],Pe.prototype,"typeIdField",null),e([f()],Pe.prototype,"templates",null),e([f()],Pe.prototype,"formTemplate",null),e([f({readOnly:!0})],Pe.prototype,"graphicOrigin",void 0),e([f({readOnly:!0,clonable:!1})],Pe.prototype,"fieldsIndex",null),e([f({type:ae,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Pe.prototype,"floorInfo",void 0),e([f(_e.outFields)],Pe.prototype,"outFields",void 0),e([f({type:X,readOnly:!0,json:{read:!1},clonable:!1})],Pe.prototype,"nodePages",void 0),e([Se("service","nodePages",["nodePages","pointNodePages"])],Pe.prototype,"readNodePages",null),e([f({type:[Y],readOnly:!0,clonable:!1})],Pe.prototype,"materialDefinitions",void 0),e([f({type:[ee],readOnly:!0,clonable:!1})],Pe.prototype,"textureSetDefinitions",void 0),e([f({type:[te],readOnly:!0,clonable:!1})],Pe.prototype,"geometryDefinitions",void 0),e([f({readOnly:!0})],Pe.prototype,"serviceUpdateTimeStamp",void 0),e([f({readOnly:!0})],Pe.prototype,"attributeStorageInfo",void 0),e([f({readOnly:!0})],Pe.prototype,"statisticsInfo",void 0),e([f({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Pe.prototype,"excludeObjectIds",void 0),e([f({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Pe.prototype,"definitionExpression",void 0),e([f({type:de,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Pe.prototype,"filter",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Pe.prototype,"path",void 0),e([f(C)],Pe.prototype,"elevationInfo",null),e([f({readOnly:!0,json:{read:!1}})],Pe.prototype,"effectiveCapabilities",null),e([f({readOnly:!0})],Pe.prototype,"effectiveEditingEnabled",null),e([f({type:String})],Pe.prototype,"geometryType",null),e([f(N)],Pe.prototype,"labelsVisible",void 0),e([f({type:[se],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:oe},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:oe},write:!0}})],Pe.prototype,"labelingInfo",void 0),e([f(G)],Pe.prototype,"legendEnabled",void 0),e([f({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Fe(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Pe.prototype,"opacity",void 0),e([f({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Pe.prototype,"priority",void 0),e([f({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Pe.prototype,"semantic",void 0),e([f({types:he,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Pe.prototype,"renderer",null),e([f({json:{read:!1}})],Pe.prototype,"cachedDrawingInfo",void 0),e([Se("service","cachedDrawingInfo")],Pe.prototype,"readCachedDrawingInfo",null),e([f({readOnly:!0,json:{read:!1}})],Pe.prototype,"capabilities",null),e([f({type:Boolean,json:{read:!1}})],Pe.prototype,"editingEnabled",null),e([f({readOnly:!0,json:{write:!1,read:!1}})],Pe.prototype,"infoFor3D",null),e([f({readOnly:!0,json:{write:!1,read:!1}})],Pe.prototype,"relationships",null),e([f(Q)],Pe.prototype,"popupEnabled",void 0),e([f({type:r,json:{name:"popupInfo",write:!0}})],Pe.prototype,"popupTemplate",void 0),e([f({readOnly:!0,json:{read:!1}})],Pe.prototype,"defaultPopupTemplate",null),e([f(V)],Pe.prototype,"attributeTableTemplate",void 0),e([f({type:String,json:{read:!1}})],Pe.prototype,"objectIdField",void 0),e([Se("service","objectIdField",["objectIdField","fields"])],Pe.prototype,"readObjectIdField",null),e([f({type:String,json:{read:!1}})],Pe.prototype,"globalIdField",void 0),e([Se("service","globalIdField",["globalIdField","fields"])],Pe.prototype,"readGlobalIdField",null),e([f({readOnly:!0,type:String,json:{read:!1}})],Pe.prototype,"displayField",null),e([f({type:String,json:{read:!1}})],Pe.prototype,"profile",void 0),e([Se("service","profile",["store.profile"])],Pe.prototype,"readProfile",null),e([f({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Pe.prototype,"normalReferenceFrame",void 0),e([f(M)],Pe.prototype,"screenSizePerspectiveEnabled",void 0),e([f({json:{read:!1,origins:{service:{read:!0}}}})],Pe.prototype,"serviceItemId",void 0),e([f(E)],Pe.prototype,"useViewTime",null),Pe=e([m("esri.layers.SceneLayer")],Pe);const Ae={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Te={"mesh-pyramids":"mesh",points:"point"},xe=Pe;export{xe as default};
5
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,throwIfAborted as y,isAbortError as u,throwIfNotAbortError as c}from"../core/promiseUtils.js";import{whenOnce as h}from"../core/reactiveUtils.js";import{property as f,subclass as m}from"../core/accessorSupport/decorators.js";import{getProperties as g}from"../core/accessorSupport/utils.js";import v from"../geometry/Point.js";import{projectAsync as b}from"../geometry/projectionUtils.js";import w from"../graphic/SceneGraphicOrigin.js";import I from"./Layer.js";import{NoModelError as L,MultipleModelsError as j}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as _}from"./mixins/EditBusLayer.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{SceneService as x}from"./mixins/SceneService.js";import{useViewTimeProperty as E}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as D}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as U}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as q}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as R}from"./support/capabilities.js";import{elevationInfo as C,labelsVisible as N,legendEnabled as G,popupEnabled as Q,attributeTableTemplate as V,screenSizePerspectiveEnabled as M}from"./support/commonProperties.js";import{getFieldDomain as k,computeEffectiveEditingEnabled as K,getGlobalIdToObjectIdMap as $}from"./support/featureLayerUtils.js";import H from"./support/FeatureReduction.js";import z from"./support/FeatureReductionSelection.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import Z from"./support/FieldsIndex.js";import{fixRendererFields as B,unpackFieldNames as J}from"./support/fieldUtils.js";import{I3SNodePageDefinition as X,I3SMaterialDefinition as Y,I3STextureSetDefinition as ee,I3SGeometryDefinition as te}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as re,isFileSupported as ie}from"./support/infoFor3D.js";import se from"./support/LabelClass.js";import{reader as oe}from"./support/labelingInfo.js";import ae from"./support/LayerFloorInfo.js";import{layerLookupMap as ne}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as le}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as pe}from"./support/RangeInfo.js";import de from"./support/SceneFilter.js";import{cacheIsOutOfSync as ye}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ue}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ce}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as he}from"../renderers/support/typeUtils.js";import fe from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as me,elevationModeUnsupportedMessage as ge,featureExpressionUnsupportedMessage as ve}from"../support/elevationInfoUtils.js";import{createPopupTemplate as be}from"../support/popupUtils.js";import{extractZipFiles as we}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as Ie}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Le,getFetchPopupTemplate as je}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Fe}from"../webdoc/support/opacityUtils.js";import{reader as Se}from"../core/accessorSupport/decorators/reader.js";const Oe=new Set(["3DObject","Point"]),_e=W();let Pe=class extends(D(_(x(S(P(A(T(p(O(F(i(I)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new w(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?k(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:X.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&K(this.associatedLayer)}get geometryType(){return Te[this.profile]||"mesh"}set renderer(e){B(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:R;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Ae[r]?Ae[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e?.signal;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ce(this,{origin:"service"},t),B(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new fe;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=J(this.fieldsIndex,await Le(this,je(this)));return Ie(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new o("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s.origin=this.graphicOrigin,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return be(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new o("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return U(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await $(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(t),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e);y(t);const s=i.reduce((e,t)=>re(this.infoFor3D,t)?e+1:e,0);0===s&&r(new L),s>1&&r(new j);const a=this.spatialReference,l=t.origin,p=await b(l??t.defaultOrigin??new v({x:0,y:0,z:0,spatialReference:a}),a,t),d=a.isGeographic?"local":"georeferenced",{default:u}=await import("../geometry/Mesh.js");y(t);const c=u.createWithExternalSource(p,{type:"client",files:i},{vertexSpace:d,transform:le(a),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!l});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await we(e)).filter(e=>ie(t,e))}validateLayer(e){if(e.layerType&&!Oe.has(e.layerType))throw new o("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new o("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=g(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!U(this.associatedLayer?.url)||!ye(this))return;g(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await q(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ne.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){u(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(a(e));try{await h(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void c(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&me(n.getLogger(this),ge("Mesh scene layers","relative-to-scene",e)),me(n.getLogger(this),ve("Scene layers",e))}async fetchStatistics(e,t){return await ue({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([f({types:{key:"type",base:H,typeMap:{selection:z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Pe.prototype,"featureReduction",void 0),e([f({type:[pe],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Pe.prototype,"rangeInfos",void 0),e([f({json:{read:!1}})],Pe.prototype,"associatedLayer",void 0),e([f({type:["show","hide"]})],Pe.prototype,"listMode",void 0),e([f({type:["ArcGISSceneServiceLayer"]})],Pe.prototype,"operationalLayerType",void 0),e([f({json:{read:!1},readOnly:!0})],Pe.prototype,"type",void 0),e([f({..._e.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Pe.prototype,"fields",void 0),e([f()],Pe.prototype,"types",null),e([f()],Pe.prototype,"typeIdField",null),e([f()],Pe.prototype,"templates",null),e([f()],Pe.prototype,"formTemplate",null),e([f({readOnly:!0})],Pe.prototype,"graphicOrigin",void 0),e([f({readOnly:!0,clonable:!1})],Pe.prototype,"fieldsIndex",null),e([f({type:ae,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Pe.prototype,"floorInfo",void 0),e([f(_e.outFields)],Pe.prototype,"outFields",void 0),e([f({type:X,readOnly:!0,json:{read:!1},clonable:!1})],Pe.prototype,"nodePages",void 0),e([Se("service","nodePages",["nodePages","pointNodePages"])],Pe.prototype,"readNodePages",null),e([f({type:[Y],readOnly:!0,clonable:!1})],Pe.prototype,"materialDefinitions",void 0),e([f({type:[ee],readOnly:!0,clonable:!1})],Pe.prototype,"textureSetDefinitions",void 0),e([f({type:[te],readOnly:!0,clonable:!1})],Pe.prototype,"geometryDefinitions",void 0),e([f({readOnly:!0})],Pe.prototype,"serviceUpdateTimeStamp",void 0),e([f({readOnly:!0})],Pe.prototype,"attributeStorageInfo",void 0),e([f({readOnly:!0})],Pe.prototype,"statisticsInfo",void 0),e([f({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Pe.prototype,"excludeObjectIds",void 0),e([f({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Pe.prototype,"definitionExpression",void 0),e([f({type:de,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Pe.prototype,"filter",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Pe.prototype,"path",void 0),e([f(C)],Pe.prototype,"elevationInfo",null),e([f({readOnly:!0,json:{read:!1}})],Pe.prototype,"effectiveCapabilities",null),e([f({readOnly:!0})],Pe.prototype,"effectiveEditingEnabled",null),e([f({type:String})],Pe.prototype,"geometryType",null),e([f(N)],Pe.prototype,"labelsVisible",void 0),e([f({type:[se],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:oe},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:oe},write:!0}})],Pe.prototype,"labelingInfo",void 0),e([f(G)],Pe.prototype,"legendEnabled",void 0),e([f({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Fe(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Pe.prototype,"opacity",void 0),e([f({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Pe.prototype,"priority",void 0),e([f({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Pe.prototype,"semantic",void 0),e([f({types:he,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Pe.prototype,"renderer",null),e([f({json:{read:!1}})],Pe.prototype,"cachedDrawingInfo",void 0),e([Se("service","cachedDrawingInfo")],Pe.prototype,"readCachedDrawingInfo",null),e([f({readOnly:!0,json:{read:!1}})],Pe.prototype,"capabilities",null),e([f({type:Boolean,json:{read:!1}})],Pe.prototype,"editingEnabled",null),e([f({readOnly:!0,json:{write:!1,read:!1}})],Pe.prototype,"infoFor3D",null),e([f({readOnly:!0,json:{write:!1,read:!1}})],Pe.prototype,"relationships",null),e([f(Q)],Pe.prototype,"popupEnabled",void 0),e([f({type:r,json:{name:"popupInfo",write:!0}})],Pe.prototype,"popupTemplate",void 0),e([f({readOnly:!0,json:{read:!1}})],Pe.prototype,"defaultPopupTemplate",null),e([f(V)],Pe.prototype,"attributeTableTemplate",void 0),e([f({type:String,json:{read:!1}})],Pe.prototype,"objectIdField",void 0),e([Se("service","objectIdField",["objectIdField","fields"])],Pe.prototype,"readObjectIdField",null),e([f({type:String,json:{read:!1}})],Pe.prototype,"globalIdField",void 0),e([Se("service","globalIdField",["globalIdField","fields"])],Pe.prototype,"readGlobalIdField",null),e([f({readOnly:!0,type:String,json:{read:!1}})],Pe.prototype,"displayField",null),e([f({type:String,json:{read:!1}})],Pe.prototype,"profile",void 0),e([Se("service","profile",["store.profile"])],Pe.prototype,"readProfile",null),e([f({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Pe.prototype,"normalReferenceFrame",void 0),e([f(M)],Pe.prototype,"screenSizePerspectiveEnabled",void 0),e([f({json:{read:!1,origins:{service:{read:!0}}}})],Pe.prototype,"serviceItemId",void 0),e([f(E)],Pe.prototype,"useViewTime",null),Pe=e([m("esri.layers.SceneLayer")],Pe);const Ae={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Te={"mesh-pyramids":"mesh",points:"point"},xe=Pe;export{xe as default};
@@ -0,0 +1,11 @@
1
+ import type KnowledgeGraph from "../../rest/knowledgeGraph/KnowledgeGraph.js";
2
+
3
+ export interface DataModelViewProperties {
4
+ container: HTMLDivElement;
5
+ kg: KnowledgeGraph;
6
+ }
7
+
8
+ export interface DataModelViewReturnType {
9
+ destroy: () => void;
10
+ load: () => Promise<void>;
11
+ }
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../Graphic.js";import o from"../../WebLinkChart.js";import n from"../../core/Collection.js";import i from"../../geometry/Extent.js";import r from"../../geometry/Point.js";import t from"../../geometry/Polyline.js";import a from"../GraphicsLayer.js";import s from"../LinkChartLayer.js";import{loadRecordsIntoLocalCache as l}from"./supportUtils.js";import m from"../support/LabelClass.js";import p from"../../renderers/visualVariables/SizeVariable.js";import y from"../../renderers/visualVariables/support/SizeStop.js";import d from"../../rest/knowledgeGraph/Entity.js";import _ from"../../rest/knowledgeGraph/Relationship.js";import c from"../../symbols/SimpleLineSymbol.js";import f from"../../symbols/SimpleMarkerSymbol.js";import w from"../../symbols/TextSymbol.js";import h from"../../views/LinkChartView.js";const b=e=>{const o=[],n={generateAllSublayers:!0,namedTypeDefinitions:new Map},i=[];return e.dataModel.entityTypes.forEach(e=>{o.push(new d({typeName:e.name,id:`ESRI__DM__ENTITY__${e.name}`,properties:e.properties.reduce((e,o)=>({...e,[o.name]:null}),{})})),n.namedTypeDefinitions.set(e.name,{useAllData:!1,members:new Map([[`ESRI__DM__ENTITY__${e.name}`,{id:`ESRI__DM__ENTITY__${e.name}`}]])})}),e.dataModel.relationshipTypes.forEach(e=>{const r=new Map;n.namedTypeDefinitions.set(e.name,{useAllData:!1,members:r}),e.endPoints.length||i.push(e.name);for(const{originEntityType:n,destinationEntityType:i}of e.endPoints)o.push(new _({typeName:e.name,id:`ESRI__DM__RELATIONSHIP__${e.name}__${n}__${i}`,originId:`ESRI__DM__ENTITY__${n}`,destinationId:`ESRI__DM__ENTITY__${i}`,properties:e.properties.reduce((e,o)=>({...e,[o.name]:null}),{})})),r.set(`ESRI__DM__RELATIONSHIP__${e.name}__${n}__${i}`,{id:`ESRI__DM__RELATIONSHIP__${e.name}__${n}__${i}`})}),{records:o,inclusionDefinition:n,unobservedRelationshipTypes:i}},u=e=>"entity"===e.graphType?[new m({labelExpression:`${e.objectType.name}`,labelPlacement:"above-center",symbol:new w({color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},haloColor:[0,0,0,255],haloSize:.7})})]:[new m({labelExpression:`${e.objectType.name}`,labelPlacement:"above-along",repeatLabel:!1,symbol:new w({color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"},yoffset:"2px"}),deconflictionStrategy:"none"})],g=e=>"entity"===e.graphType?[new p({valueExpression:"$view.scale",stops:[new y({size:30,value:0}),new y({size:6,value:1e3})]})]:[new p({valueExpression:"$view.scale",stops:[new y({size:20,value:0}),new y({size:8,value:1e3})]})],E=(o,n,s)=>{const l=5e-5,m=15e-5,p=8e-6,y=new a,d=new a({minScale:1e3,maxScale:0});let _=s.ymin;const h=s.xmin,b=h+m;for(const i of n){const n=o.layers.find(e=>e.objectType.name===i);_-=l;const a=("simple"===n?.renderer?.type?n.renderer.symbol?.clone():null)||new c({type:"simple-line",color:"gray",width:2}),s=new e({geometry:new t({paths:[[[h,_],[b,_]]]}),symbol:a});y.add(s);for(const o of[h,b]){const n=new e({geometry:new r({x:o,y:_}),symbol:new f({color:"white",outline:{color:"gray",width:1},size:6})});y.add(n)}const m=new e({geometry:new r({x:(h+b)/2,y:_+p}),symbol:new w({text:i,color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"},yoffset:"2px"})});d.add(m)}return{graphicsLayers:[y,d],graphicsExtent:new i({xmin:h,xmax:b,ymin:_,ymax:s.ymin,spatialReference:s.spatialReference})}},T=({container:e,kg:i})=>{const{records:r,inclusionDefinition:t,unobservedRelationshipTypes:a}=b(i);l(r,i.dataModel);const m=new s({title:"Data Model Visualization Layer",url:i.url,initializationInclusionModeDefinition:t,dataPreloadedInLocalCache:!0}),p=new o({layers:new n([m])}),y=new h({map:p,container:e}),d=new Promise((e,o)=>{y.when(()=>m.load().then(()=>{if(m.layers.forEach(e=>{e.labelsVisible=!0,e.visible=!0,e.labelingInfo=u(e),e.renderer&&"heatmap"!==e.renderer.type&&(e.renderer.visualVariables=g(e))}),p.diagramNodesExtent){let o=null;if(a.length>0){const{graphicsExtent:e,graphicsLayers:n}=E(m,a,p.diagramNodesExtent);p.addMany(n),o=e}const n=o?p.diagramNodesExtent.union(o):p.diagramNodesExtent;y.goTo(n.expand(1.4)).finally(()=>e())}},o),o)});return{_view:y,load:()=>d,destroy:()=>y.destroy()}};export{T as generateDataModelView,b as generateRecordsForDataModelView,u as getLabellingInfoForLayer,E as getUnobservedRelationshipGraphics,g as getVisualVariablesForLayer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../request.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import{throwIfAborted as s}from"../../core/promiseUtils.js";import{join as o}from"../../core/urlUtils.js";import{Version as i}from"../../core/Version.js";import{property as a,subclass as p}from"../../core/accessorSupport/decorators.js";import l from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import{parse as u}from"../support/arcgisLayerUrl.js";import{id as c,popupEnabled as y}from"../support/commonProperties.js";import{isHostedLayer as d}from"../../portal/support/portalItemUtils.js";import{reader as m}from"../../core/accessorSupport/decorators/reader.js";const h=h=>{const f=h;let b=class extends f{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(e,r){const t=r.capabilities&&r.capabilities.split(",").map(e=>e.toLowerCase().trim());if(!t)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const s=this.type,o="tile"!==s&&!!r.supportsDynamicLayers,a=t.includes("query"),p=t.includes("map"),l=!!r.exportTilesAllowed,n=t.includes("tilemap"),u=t.includes("data"),c="tile"!==s&&(!r.tileInfo||o),y="tile"!==s&&(!r.tileInfo||o),d="tile"!==s,m="tile"!==s&&o&&r.currentVersion>=11.1,h=r.cimVersion?i.parse(r.cimVersion):null,f=h?.greaterEqual(1,4)??!1,b=h?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:p,supportsExportTiles:l,supportsIdentify:a,supportsQuery:u,supportsTileMap:n},exportMap:p?{supportsArcadeExpressionForLabeling:f,supportsCIMSymbols:b,supportsDynamicLayers:o,supportsSublayerOrderBy:m,supportsSublayerDefinitionExpression:y,supportsSublayerVisibility:c,supportsSublayersChanges:d}:null,exportTiles:l?{maxExportTilesCount:+r.maxExportTilesCount}:null}}readVersion(e,r){let t=r.currentVersion;return t||(t=r.hasOwnProperty("capabilities")||r.hasOwnProperty("tables")?10:r.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),t}async fetchRelatedService(e){const r=this.portalItem;if(!r||!d(r))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=r.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},e).then(e=>e.find(e=>"Feature Service"===e.type)??null,()=>null));const t=await this._relatedFeatureServicePromise;return s(e),t?{itemId:t.id,url:t.url}:null}async fetchSublayerInfo(e,t){const{source:s}=e;if(this?.portalItem&&"tile"===this.type&&"map-layer"===s?.type&&d(this.portalItem)&&e.originIdOf("url")<2){const r=await this.fetchRelatedService(t);r&&(e.url=o(r.url,s.mapLayerId.toString()),e.layerItemId=r.itemId)}const{url:i}=e;let a;if("data-layer"===s.type){a=(await r(i,{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey},...t})).data}else{let r=e.id;"map-layer"===s?.type&&(r=s.mapLayerId);try{a=(await this.fetchAllLayersAndTables(t)).get(r)}catch{}if(i&&e.originIdOf("url")>2)try{const e=await this._fetchAllLayersAndTablesFromService(i),r=u(i)?.sublayer??s.mapLayerId,t=structuredClone(e.get(r));if(null!=t){const e=["drawingInfo","maxScale","minScale","name"];for(const r of e)delete t[r];a={...a,...t}}}catch{}}return a}async fetchAllLayersAndTables(e){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,e)}async _fetchAllLayersAndTablesFromService(e,i){await this.load(i),this._allLayersAndTablesMap||=new Map;const a=u(e),p=t(this._allLayersAndTablesMap,a?.url.path,()=>r(o(a?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(e=>{const r=new Map,{layers:t,tables:s}=e.data,o=[...t??[],...s??[]];for(const i of o)r.set(i.id,i);return{result:r}},e=>({error:e}))),l=await p;if(s(i),"result"in l)return l.result;throw l.error}};return e([a({readOnly:!0})],b.prototype,"capabilities",void 0),e([m("service","capabilities",["capabilities","cimVersion","currentVersion","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],b.prototype,"readCapabilities",null),e([a({json:{read:{source:"copyrightText"}}})],b.prototype,"copyright",void 0),e([a({type:l})],b.prototype,"fullExtent",void 0),e([a(c)],b.prototype,"id",void 0),e([a({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],b.prototype,"legendEnabled",void 0),e([a(y)],b.prototype,"popupEnabled",void 0),e([a({type:n})],b.prototype,"spatialReference",void 0),e([a({readOnly:!0})],b.prototype,"version",void 0),e([m("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],b.prototype,"readVersion",null),b=e([p("esri.layers.mixins.ArcGISMapService")],b),b};export{h as ArcGISMapService};
5
+ import{__decorate as e}from"tslib";import r from"../../request.js";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import{throwIfAborted as s}from"../../core/promiseUtils.js";import{join as o}from"../../core/urlUtils.js";import i from"../../core/Version.js";import{property as a,subclass as p}from"../../core/accessorSupport/decorators.js";import l from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import{parse as u}from"../support/arcgisLayerUrl.js";import{id as c,popupEnabled as y}from"../support/commonProperties.js";import{isHostedLayer as d}from"../../portal/support/portalItemUtils.js";import{reader as m}from"../../core/accessorSupport/decorators/reader.js";const h=h=>{const f=h;let b=class extends f{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(e,r){const t=r.capabilities&&r.capabilities.split(",").map(e=>e.toLowerCase().trim());if(!t)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const s=this.type,o="tile"!==s&&!!r.supportsDynamicLayers,a=t.includes("query"),p=t.includes("map"),l=!!r.exportTilesAllowed,n=t.includes("tilemap"),u=t.includes("data"),c="tile"!==s&&(!r.tileInfo||o),y="tile"!==s&&(!r.tileInfo||o),d="tile"!==s,m="tile"!==s&&o&&r.currentVersion>=11.1,h=r.cimVersion?i.parse(r.cimVersion):null,f=h?.greaterEqual(1,4)??!1,b=h?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:p,supportsExportTiles:l,supportsIdentify:a,supportsQuery:u,supportsTileMap:n},exportMap:p?{supportsArcadeExpressionForLabeling:f,supportsCIMSymbols:b,supportsDynamicLayers:o,supportsSublayerOrderBy:m,supportsSublayerDefinitionExpression:y,supportsSublayerVisibility:c,supportsSublayersChanges:d}:null,exportTiles:l?{maxExportTilesCount:+r.maxExportTilesCount}:null}}readVersion(e,r){let t=r.currentVersion;return t||(t=r.hasOwnProperty("capabilities")||r.hasOwnProperty("tables")?10:r.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),t}async fetchRelatedService(e){const r=this.portalItem;if(!r||!d(r))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=r.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},e).then(e=>e.find(e=>"Feature Service"===e.type)??null,()=>null));const t=await this._relatedFeatureServicePromise;return s(e),t?{itemId:t.id,url:t.url}:null}async fetchSublayerInfo(e,t){const{source:s}=e;if(this?.portalItem&&"tile"===this.type&&"map-layer"===s?.type&&d(this.portalItem)&&e.originIdOf("url")<2){const r=await this.fetchRelatedService(t);r&&(e.url=o(r.url,s.mapLayerId.toString()),e.layerItemId=r.itemId)}const{url:i}=e;let a;if("data-layer"===s.type){a=(await r(i,{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey},...t})).data}else{let r=e.id;"map-layer"===s?.type&&(r=s.mapLayerId);try{a=(await this.fetchAllLayersAndTables(t)).get(r)}catch{}if(i&&e.originIdOf("url")>2)try{const e=await this._fetchAllLayersAndTablesFromService(i),r=u(i)?.sublayer??s.mapLayerId,t=structuredClone(e.get(r));if(null!=t){const e=["drawingInfo","maxScale","minScale","name"];for(const r of e)delete t[r];a={...a,...t}}}catch{}}return a}async fetchAllLayersAndTables(e){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,e)}async _fetchAllLayersAndTablesFromService(e,i){await this.load(i),this._allLayersAndTablesMap||=new Map;const a=u(e),p=t(this._allLayersAndTablesMap,a?.url.path,()=>r(o(a?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(e=>{const r=new Map,{layers:t,tables:s}=e.data,o=[...t??[],...s??[]];for(const i of o)r.set(i.id,i);return{result:r}},e=>({error:e}))),l=await p;if(s(i),"result"in l)return l.result;throw l.error}};return e([a({readOnly:!0})],b.prototype,"capabilities",void 0),e([m("service","capabilities",["capabilities","cimVersion","currentVersion","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],b.prototype,"readCapabilities",null),e([a({json:{read:{source:"copyrightText"}}})],b.prototype,"copyright",void 0),e([a({type:l})],b.prototype,"fullExtent",void 0),e([a(c)],b.prototype,"id",void 0),e([a({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],b.prototype,"legendEnabled",void 0),e([a(y)],b.prototype,"popupEnabled",void 0),e([a({type:n})],b.prototype,"spatialReference",void 0),e([a({readOnly:!0})],b.prototype,"version",void 0),e([m("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],b.prototype,"readVersion",null),b=e([p("esri.layers.mixins.ArcGISMapService")],b),b};export{h as ArcGISMapService};
@@ -1,4 +1,4 @@
1
- import type { BlendMode } from "../BlendMode.js";
1
+ import type { BlendMode } from "../types.js";
2
2
  import type { EffectPropertyAPI } from "../effects/types.js";
3
3
 
4
4
  export interface BlendLayerProperties extends Partial<Pick<BlendLayer, "blendMode" | "effect">> {}
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{throwIfAborted as e}from"../../../core/promiseUtils.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{zeros as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transpose as n}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{a as o,i as a}from"../../../chunks/vec32.js";import i from"../../../geometry/Circle.js";import s from"../../../geometry/Mesh.js";import c from"../../../geometry/Multipoint.js";import f from"../../../geometry/Polygon.js";import{projectAsync as l}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{polygonCentroidPoint as u}from"../../../geometry/support/centroid.js";import{earth as p}from"../../../geometry/support/Ellipsoid.js";import h from"../../../geometry/support/MeshComponent.js";import{MeshVertexAttributes as y}from"../../../geometry/support/MeshVertexAttributes.js";import{create as g,fromArray as x,intersectRay as d}from"../../../geometry/support/plane.js";import{isWebMercator as w}from"../../../geometry/support/spatialReferenceUtils.js";import{convertToSRUnits as M,getWebMercatorScalingFactor as R,createRotationMatrixFromHPR as j,transformMat3 as v,scaleAndAddWithFactor as P,scaleWithFactor as D,computeHFOVAndVFOV as b,projectiveTransform as A}from"../transformations/utils.js";const I=Math.PI/180;function z(e){const t=M(e,e.geometry.spatialReference);return e.isSpherical?S(t):V(t)}function V(e){const{horizontalFieldOfView:t,verticalFieldOfView:r,geometry:n,cameraHeading:o}=e,a=R(n.y,n.spatialReference);let i=e.cameraPitch,s=e.cameraRoll??0,c=150;t>150&&(i=90,s=0,c=5);const l=Math.ceil(t/c),m=F(l,o,t);let u=e.farDistance?e.farDistance*a:e.cameraHeight*a/Math.cos(i*I);e.cameraPitch+r/2>=90&&(u=(e.farDistance||20)*a);const p=new f({spatialReference:n?.spatialReference});p.imageID=e.objectId;let h=null;for(const f of m)h=H(f,i,e.cameraHeight,n,u,a,r,t,l,p,s,e.nearDistance);return h.imageID=e.objectId,{polygon:p,frustum:h}}function F(e,t,r){const n=[];if(e%2==0)for(let o=0;o<e/2;o++)n.push(t-r/e*(o+.5),t+r/e*(o+.5));else{n.push(t);for(let o=1;o<e/2;o++)n.push(t-r/e*o,t+r/e*o)}return n.sort(),n}function H(e,i,s,c,f,l,m,u,p,h,y=0,g=0){const x=n(t(),j([e,i,y??0])),d=U({cameraHeight:s,cameraPitch:i,farDistance:f,location:c,horizontalFieldOfView:u,nearDistance:g,verticalFieldOfView:m},x),w=v([0,0,-1],x),{x:M,y:R}=c,b=P([M,R,s],w,f,l),A=2*Math.tan(m*I/2)*f,z=2*Math.tan(u/p*I/2)*f,V=v([0,1,0],x),F=v([1,0,0],x),H=D(V,A/2,l),S=D(F,z/2,l),q=o(r(),H,S),C=a(r(),H,S),E=O([a(r(),b,q),a(r(),b,C),o(r(),b,q),o(r(),b,C)],s,c,l);return E.push(E[0]),h.addRing(E),d}function O(e,t,r,n){return e.map(e=>E(e,t,r,n))}function S(e){const{geometry:t,farDistance:r,objectId:n,nearDistance:o,cameraHeight:a}=e,c=R(t.y,t.spatialReference),f=new i({center:t.clone(),radius:r*c});if(f.imageID=n,o){const e=new i({center:t.clone(),radius:o*c});f.addRing(e.rings[0])}const l=t.clone();l.z=a-r*c;const m=s.createSphere(l,{size:2*r*c});return m.imageID=n,{polygon:f,frustum:m}}function q(e,t){return e.contains(t)}function C(e,t){return Math.sign(e)!==Math.sign(t)}function U(e,t,n){const{cameraHeight:i,cameraPitch:c,farDistance:f,location:l,horizontalFieldOfView:m,nearDistance:u,verticalFieldOfView:p}=e,h=L(l),g=c+p/2>=90==!1,x=2*Math.tan(p*I/2)*u,d=2*Math.tan(m*I/2)*u,w=2*Math.tan(p*I/2)*f,M=2*Math.tan(m*I/2)*f;let R,j;j=[0,0,-1],j=v(j,t),R=P([l.x,l.y,i],j,f,h),g&&(R[2]=0);const b=P([l.x,l.y,i],j,u,h);let A=[0,1,0];A=v(A,t);let z=[1,0,0];z=v(z,t);let V=[],F=[];u?(F=[{faces:[4,0,3,4,7,3]},{faces:[5,1,2,5,6,2]},{faces:[4,0,1,4,5,1]},{faces:[6,2,3,6,7,3]}],V=V.concat(a(r(),b,o(r(),D(A,x/2,h),D(z,d/2,h)))),V=V.concat(a(r(),b,a(r(),D(A,x/2,h),D(z,d/2,h)))),V=V.concat(o(r(),b,o(r(),D(A,x/2,h),D(z,d/2,h)))),V=V.concat(o(r(),b,a(r(),D(A,x/2,h),D(z,d/2,h))))):(V=[l.x,l.y,i],F=[{faces:[0,1,2,0,2,3,0,3,4,0,4,1]}]),V=V.concat(a(r(),R,o(r(),D(A,w/2,h),D(z,M/2,h)))),V=V.concat(a(r(),R,a(r(),D(A,w/2,h),D(z,M/2,h)))),V=V.concat(o(r(),R,o(r(),D(A,w/2,h),D(z,M/2,h)))),V=V.concat(o(r(),R,a(r(),D(A,w/2,h),D(z,M/2,h))));const H=new y({position:Float64Array.from(V)});return new s({vertexAttributes:H,components:F,spatialReference:l.spatialReference})}function E(e,t,n,a){{const i=Math.sqrt((e[2]-t)**2+(Math.sqrt((e[0]-n.x)**2+(e[1]-n.y)**2)/a)**2)*a,s=D(o(r(),[e[0],e[1],e[2]],[n.x,n.y,t]),1/i,1/a),c=t/(t-e[2]),f={x:(1-c)*n.x+c*e[0],y:(1-c)*n.y+c*e[1],z:(1-c)*t+c*e[2]},l=Math.sqrt((f.z-t)**2+(Math.sqrt((f.x-n.x)**2+(f.y-n.y)**2)/a)**2)*a,m=D(o(r(),[f.x,f.y,f.z],[n.x,n.y,t]),1/l,1/a);return C(s[0],m[0])&&C(s[1],m[1])&&C(s[2],m[2])||e[2]>=0?[e[0],e[1],0]:[f.x,f.y,f.z]}}function k(e){const{spatialReference:t,x:r,y:n}=e.geometry,{cameraHeading:o,cameraPitch:a,farDistance:i,nearDistance:s}=e,c=L(e.geometry),l=new f({spatialReference:t}),m=Math.abs(1.44*i*c);let u=Math.abs(1.44*s*c);(a<20||null==o)&&(u=m);const p=[];return p[0]={x:r+m*Math.sin((o-45)*I),y:n+m*Math.cos((o-45)*I)},p[1]={x:r+m*Math.sin((o+45)*I),y:n+m*Math.cos((o+45)*I)},p[2]={x:r+u*Math.sin((o+135)*I),y:n+u*Math.cos((o+135)*I)},p[3]={x:r+u*Math.sin((o+225)*I),y:n+u*Math.cos((o+225)*I)},l.addRing([[p[0].x,p[0].y,0],[p[1].x,p[1].y,0],[p[2].x,p[2].y,0],[p[3].x,p[3].y,0],[p[0].x,p[0].y,0]]),l}function L(e){return e&&w(e?.spatialReference)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*e.y/p.radius))):1}function W(e,t){const n=1+t/100;if("esri.geometry.Circle"===e.declaredClass){const{radius:t,center:r}=e,o=new i({radius:t*n,center:r});return e.rings.length>1&&o.addRing(e.rings[1]),o}if("esri.geometry.Polygon"===e.declaredClass){const t=new f({spatialReference:e.spatialReference}),a=u(e);if(a){const i=[];for(let t=0;t<e.rings[0].length;t++){const s=Math.sqrt((a.x-e.rings[0][t][0])**2+(a.y-e.rings[0][t][1])**2),c=D(o(r(),[e.rings[0][t][0],e.rings[0][t][1],0],[a.x,a.y,0]),1/s,1),f=P([a.x,a.y,0],c,s*n,1);i.push({x:f[0],y:f[1]})}t.addRing([[i[0].x,i[0].y,0],[i[1].x,i[1].y,0],[i[2].x,i[2].y,0],[i[3].x,i[3].y,0],[i[0].x,i[0].y,0]])}return t}return e}async function B(e,t,r){const{cameraHeight:n,cameraLocation:o,cameraPitch:a,frustumVertices:i,horizontalFieldOfView:s,imageHeight:c,imageWidth:f,inSRS:l,outSRS:u,verticalFieldOfView:p,cameraRoll:h,options:y}=r,g=new m(l),x=new m(u),d=b(s,p,h??0),w=i.length>15;return a+d.vfov/2>=90?await Q(i,e,f,c,g,x,w,y):await G(i,e,t,o,n,w,g,x,y)}async function G(e,t,r,n,o,a,i,c,f){const l=J(e,t,r,n,o);if(!l)return;const{farPlane:m,nearPlane:u}=l,p=await T([...u?.vertexPositions??e.slice(0,3),...m.vertexPositions],i,c,f),h=_(p);return new s({vertexAttributes:new y({position:p}),components:$(a?Y(h,!0):Z(h,!0)),spatialReference:c})}function J(e,t,r,n,o){const a=X(e),i=X(e,"near");if(!a)return;const s=t.length;for(let c=0;c<s;c++){const e=Array.from(r[c]),t=[e[0]-n[0],e[1]-n[1],e[2]-(n[2]??o)];N(n,t,c,i),K(n,t,c,a)}return{farPlane:a,nearPlane:i}}function K(e,t,n,o){const{coefficients:a,vertexPositions:i}=o,s=r();d(a,{origin:e,direction:t},s)&&i.splice(3*n,3,...s)}function N(e,t,n,o){if(!o)return;const a=r();d(o.coefficients,{origin:e,direction:t},a)&&o.vertexPositions.splice(3*n,3,...a)}async function Q(e,t,r,n,o,a,i,c){let f,l=i?new Array:[e[0],e[1],e[2]],m=new Array;for(const s of t)i?(f=A([s[0],s[1],1],[[0,0,1],[r,0,1],[r,n,1],[0,n,1]],[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]],[e[9],e[10],e[11]]]),l=l.concat(...f),f=A([s[0],s[1],1],[[0,0,1],[r,0,1],[r,n,1],[0,n,1]],[[e[12],e[13],e[14]],[e[15],e[16],e[17]],[e[18],e[19],e[20]],[e[21],e[22],e[23]]]),m=m.concat(...f)):(f=A([s[0],s[1],1],[[0,0,1],[r,0,1],[r,n,1],[0,n,1]],[[e[3],e[4],e[5]],[e[6],e[7],e[8]],[e[9],e[10],e[11]],[e[12],e[13],e[14]]]),l=l.concat(...f));l=l.concat(m);const u=await T(l,o,a,c),p=_(u);return new s({vertexAttributes:new y({position:u}),components:$(i?Y(p,!0):Z(p,!0)),spatialReference:a})}async function T(t,r,n,o){if(r.equals(n))return t;const a=t.reduce((e,t,r)=>{const n=Math.floor(r/3);return e[n]||(e[n]=new Array),e[n].push(t),e},new Array),{points:i}=await l(new c({points:a,spatialReference:r}),n,o);return e(o),i.flat()}function X(e,t="far"){const r=g();let n;switch(t){case"far":if(n=Array.from(15===e.length?e.slice(3):e.slice(12)),x(r,n,!1))return{coefficients:r,vertexPositions:n};break;case"near":if(n=Array.from(e.slice(0,12)),15===e.length||!x(r,n,!1))return;return{coefficients:r,vertexPositions:n}}}const Y=(e,t=!1)=>{if(t&&e-2<=4||e<=4||e%2!=0)throw new Error("Invalid number of vertices");const r=[],n=e/2,o=Math.round((t?e-2:e)/2);for(let a=0;a<o;a++){const o=a+n,i=t?o+1:o,s=i%e,c=(t?o:i+1)%e;r.push({faces:new Uint32Array([a,c,s,a,a+1,s])})}return r};function Z(e,t=!1){if(e<3||t&&e-1<3)throw new Error("Invalid number of vertices");const r=[],n=t?e-2:e-1;for(let o=0;o<n;o++)r.push({faces:new Uint32Array([0,o+1,o+2])});return r}const $=e=>e.map(e=>new h(e)),_=e=>e.length/3;export{q as checkIfPolygonContainsSelectedPoint,k as computePolygonForInspection,z as createCoveragePolygon,O as limitZToGround,T as projectVertices,W as resizePolygon,B as updateFrustum};
5
+ import{throwIfAborted as e}from"../../../core/promiseUtils.js";import{create as t}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{zeros as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transpose as n}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{a as o,i as a}from"../../../chunks/vec32.js";import i from"../../../geometry/Circle.js";import s from"../../../geometry/Mesh.js";import c from"../../../geometry/Multipoint.js";import f from"../../../geometry/Polygon.js";import{projectAsync as l}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{polygonCentroidPoint as u}from"../../../geometry/support/centroid.js";import{earth as p}from"../../../geometry/support/Ellipsoid.js";import h from"../../../geometry/support/MeshComponent.js";import y from"../../../geometry/support/MeshVertexAttributes.js";import{create as g,fromArray as x,intersectRay as d}from"../../../geometry/support/plane.js";import{isWebMercator as w}from"../../../geometry/support/spatialReferenceUtils.js";import{convertToSRUnits as M,getWebMercatorScalingFactor as R,createRotationMatrixFromHPR as j,transformMat3 as v,scaleAndAddWithFactor as P,scaleWithFactor as D,computeHFOVAndVFOV as b,projectiveTransform as A}from"../transformations/utils.js";const I=Math.PI/180;function z(e){const t=M(e,e.geometry.spatialReference);return e.isSpherical?S(t):V(t)}function V(e){const{horizontalFieldOfView:t,verticalFieldOfView:r,geometry:n,cameraHeading:o}=e,a=R(n.y,n.spatialReference);let i=e.cameraPitch,s=e.cameraRoll??0,c=150;t>150&&(i=90,s=0,c=5);const l=Math.ceil(t/c),m=F(l,o,t);let u=e.farDistance?e.farDistance*a:e.cameraHeight*a/Math.cos(i*I);e.cameraPitch+r/2>=90&&(u=(e.farDistance||20)*a);const p=new f({spatialReference:n?.spatialReference});p.imageID=e.objectId;let h=null;for(const f of m)h=H(f,i,e.cameraHeight,n,u,a,r,t,l,p,s,e.nearDistance);return h.imageID=e.objectId,{polygon:p,frustum:h}}function F(e,t,r){const n=[];if(e%2==0)for(let o=0;o<e/2;o++)n.push(t-r/e*(o+.5),t+r/e*(o+.5));else{n.push(t);for(let o=1;o<e/2;o++)n.push(t-r/e*o,t+r/e*o)}return n.sort(),n}function H(e,i,s,c,f,l,m,u,p,h,y=0,g=0){const x=n(t(),j([e,i,y??0])),d=U({cameraHeight:s,cameraPitch:i,farDistance:f,location:c,horizontalFieldOfView:u,nearDistance:g,verticalFieldOfView:m},x),w=v([0,0,-1],x),{x:M,y:R}=c,b=P([M,R,s],w,f,l),A=2*Math.tan(m*I/2)*f,z=2*Math.tan(u/p*I/2)*f,V=v([0,1,0],x),F=v([1,0,0],x),H=D(V,A/2,l),S=D(F,z/2,l),q=o(r(),H,S),C=a(r(),H,S),E=O([a(r(),b,q),a(r(),b,C),o(r(),b,q),o(r(),b,C)],s,c,l);return E.push(E[0]),h.addRing(E),d}function O(e,t,r,n){return e.map(e=>E(e,t,r,n))}function S(e){const{geometry:t,farDistance:r,objectId:n,nearDistance:o,cameraHeight:a}=e,c=R(t.y,t.spatialReference),f=new i({center:t.clone(),radius:r*c});if(f.imageID=n,o){const e=new i({center:t.clone(),radius:o*c});f.addRing(e.rings[0])}const l=t.clone();l.z=a-r*c;const m=s.createSphere(l,{size:2*r*c});return m.imageID=n,{polygon:f,frustum:m}}function q(e,t){return e.contains(t)}function C(e,t){return Math.sign(e)!==Math.sign(t)}function U(e,t,n){const{cameraHeight:i,cameraPitch:c,farDistance:f,location:l,horizontalFieldOfView:m,nearDistance:u,verticalFieldOfView:p}=e,h=L(l),g=c+p/2>=90==!1,x=2*Math.tan(p*I/2)*u,d=2*Math.tan(m*I/2)*u,w=2*Math.tan(p*I/2)*f,M=2*Math.tan(m*I/2)*f;let R,j;j=[0,0,-1],j=v(j,t),R=P([l.x,l.y,i],j,f,h),g&&(R[2]=0);const b=P([l.x,l.y,i],j,u,h);let A=[0,1,0];A=v(A,t);let z=[1,0,0];z=v(z,t);let V=[],F=[];u?(F=[{faces:[4,0,3,4,7,3]},{faces:[5,1,2,5,6,2]},{faces:[4,0,1,4,5,1]},{faces:[6,2,3,6,7,3]}],V=V.concat(a(r(),b,o(r(),D(A,x/2,h),D(z,d/2,h)))),V=V.concat(a(r(),b,a(r(),D(A,x/2,h),D(z,d/2,h)))),V=V.concat(o(r(),b,o(r(),D(A,x/2,h),D(z,d/2,h)))),V=V.concat(o(r(),b,a(r(),D(A,x/2,h),D(z,d/2,h))))):(V=[l.x,l.y,i],F=[{faces:[0,1,2,0,2,3,0,3,4,0,4,1]}]),V=V.concat(a(r(),R,o(r(),D(A,w/2,h),D(z,M/2,h)))),V=V.concat(a(r(),R,a(r(),D(A,w/2,h),D(z,M/2,h)))),V=V.concat(o(r(),R,o(r(),D(A,w/2,h),D(z,M/2,h)))),V=V.concat(o(r(),R,a(r(),D(A,w/2,h),D(z,M/2,h))));const H=new y({position:Float64Array.from(V)});return new s({vertexAttributes:H,components:F,spatialReference:l.spatialReference})}function E(e,t,n,a){{const i=Math.sqrt((e[2]-t)**2+(Math.sqrt((e[0]-n.x)**2+(e[1]-n.y)**2)/a)**2)*a,s=D(o(r(),[e[0],e[1],e[2]],[n.x,n.y,t]),1/i,1/a),c=t/(t-e[2]),f={x:(1-c)*n.x+c*e[0],y:(1-c)*n.y+c*e[1],z:(1-c)*t+c*e[2]},l=Math.sqrt((f.z-t)**2+(Math.sqrt((f.x-n.x)**2+(f.y-n.y)**2)/a)**2)*a,m=D(o(r(),[f.x,f.y,f.z],[n.x,n.y,t]),1/l,1/a);return C(s[0],m[0])&&C(s[1],m[1])&&C(s[2],m[2])||e[2]>=0?[e[0],e[1],0]:[f.x,f.y,f.z]}}function k(e){const{spatialReference:t,x:r,y:n}=e.geometry,{cameraHeading:o,cameraPitch:a,farDistance:i,nearDistance:s}=e,c=L(e.geometry),l=new f({spatialReference:t}),m=Math.abs(1.44*i*c);let u=Math.abs(1.44*s*c);(a<20||null==o)&&(u=m);const p=[];return p[0]={x:r+m*Math.sin((o-45)*I),y:n+m*Math.cos((o-45)*I)},p[1]={x:r+m*Math.sin((o+45)*I),y:n+m*Math.cos((o+45)*I)},p[2]={x:r+u*Math.sin((o+135)*I),y:n+u*Math.cos((o+135)*I)},p[3]={x:r+u*Math.sin((o+225)*I),y:n+u*Math.cos((o+225)*I)},l.addRing([[p[0].x,p[0].y,0],[p[1].x,p[1].y,0],[p[2].x,p[2].y,0],[p[3].x,p[3].y,0],[p[0].x,p[0].y,0]]),l}function L(e){return e&&w(e?.spatialReference)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*e.y/p.radius))):1}function W(e,t){const n=1+t/100;if("esri.geometry.Circle"===e.declaredClass){const{radius:t,center:r}=e,o=new i({radius:t*n,center:r});return e.rings.length>1&&o.addRing(e.rings[1]),o}if("esri.geometry.Polygon"===e.declaredClass){const t=new f({spatialReference:e.spatialReference}),a=u(e);if(a){const i=[];for(let t=0;t<e.rings[0].length;t++){const s=Math.sqrt((a.x-e.rings[0][t][0])**2+(a.y-e.rings[0][t][1])**2),c=D(o(r(),[e.rings[0][t][0],e.rings[0][t][1],0],[a.x,a.y,0]),1/s,1),f=P([a.x,a.y,0],c,s*n,1);i.push({x:f[0],y:f[1]})}t.addRing([[i[0].x,i[0].y,0],[i[1].x,i[1].y,0],[i[2].x,i[2].y,0],[i[3].x,i[3].y,0],[i[0].x,i[0].y,0]])}return t}return e}async function B(e,t,r){const{cameraHeight:n,cameraLocation:o,cameraPitch:a,frustumVertices:i,horizontalFieldOfView:s,imageHeight:c,imageWidth:f,inSRS:l,outSRS:u,verticalFieldOfView:p,cameraRoll:h,options:y}=r,g=new m(l),x=new m(u),d=b(s,p,h??0),w=i.length>15;return a+d.vfov/2>=90?await Q(i,e,f,c,g,x,w,y):await G(i,e,t,o,n,w,g,x,y)}async function G(e,t,r,n,o,a,i,c,f){const l=J(e,t,r,n,o);if(!l)return;const{farPlane:m,nearPlane:u}=l,p=await T([...u?.vertexPositions??e.slice(0,3),...m.vertexPositions],i,c,f),h=_(p);return new s({vertexAttributes:new y({position:p}),components:$(a?Y(h,!0):Z(h,!0)),spatialReference:c})}function J(e,t,r,n,o){const a=X(e),i=X(e,"near");if(!a)return;const s=t.length;for(let c=0;c<s;c++){const e=Array.from(r[c]),t=[e[0]-n[0],e[1]-n[1],e[2]-(n[2]??o)];N(n,t,c,i),K(n,t,c,a)}return{farPlane:a,nearPlane:i}}function K(e,t,n,o){const{coefficients:a,vertexPositions:i}=o,s=r();d(a,{origin:e,direction:t},s)&&i.splice(3*n,3,...s)}function N(e,t,n,o){if(!o)return;const a=r();d(o.coefficients,{origin:e,direction:t},a)&&o.vertexPositions.splice(3*n,3,...a)}async function Q(e,t,r,n,o,a,i,c){let f,l=i?new Array:[e[0],e[1],e[2]],m=new Array;for(const s of t)i?(f=A([s[0],s[1],1],[[0,0,1],[r,0,1],[r,n,1],[0,n,1]],[[e[0],e[1],e[2]],[e[3],e[4],e[5]],[e[6],e[7],e[8]],[e[9],e[10],e[11]]]),l=l.concat(...f),f=A([s[0],s[1],1],[[0,0,1],[r,0,1],[r,n,1],[0,n,1]],[[e[12],e[13],e[14]],[e[15],e[16],e[17]],[e[18],e[19],e[20]],[e[21],e[22],e[23]]]),m=m.concat(...f)):(f=A([s[0],s[1],1],[[0,0,1],[r,0,1],[r,n,1],[0,n,1]],[[e[3],e[4],e[5]],[e[6],e[7],e[8]],[e[9],e[10],e[11]],[e[12],e[13],e[14]]]),l=l.concat(...f));l=l.concat(m);const u=await T(l,o,a,c),p=_(u);return new s({vertexAttributes:new y({position:u}),components:$(i?Y(p,!0):Z(p,!0)),spatialReference:a})}async function T(t,r,n,o){if(r.equals(n))return t;const a=t.reduce((e,t,r)=>{const n=Math.floor(r/3);return e[n]||(e[n]=new Array),e[n].push(t),e},new Array),{points:i}=await l(new c({points:a,spatialReference:r}),n,o);return e(o),i.flat()}function X(e,t="far"){const r=g();let n;switch(t){case"far":if(n=Array.from(15===e.length?e.slice(3):e.slice(12)),x(r,n,!1))return{coefficients:r,vertexPositions:n};break;case"near":if(n=Array.from(e.slice(0,12)),15===e.length||!x(r,n,!1))return;return{coefficients:r,vertexPositions:n}}}const Y=(e,t=!1)=>{if(t&&e-2<=4||e<=4||e%2!=0)throw new Error("Invalid number of vertices");const r=[],n=e/2,o=Math.round((t?e-2:e)/2);for(let a=0;a<o;a++){const o=a+n,i=t?o+1:o,s=i%e,c=(t?o:i+1)%e;r.push({faces:new Uint32Array([a,c,s,a,a+1,s])})}return r};function Z(e,t=!1){if(e<3||t&&e-1<3)throw new Error("Invalid number of vertices");const r=[],n=t?e-2:e-1;for(let o=0;o<n;o++)r.push({faces:new Uint32Array([0,o+1,o+2])});return r}const $=e=>e.map(e=>new h(e)),_=e=>e.length/3;export{q as checkIfPolygonContainsSelectedPoint,k as computePolygonForInspection,z as createCoveragePolygon,O as limitZToGround,T as projectVertices,W as resizePolygon,B as updateFrustum};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{isAbortError as r,waitTick as a}from"../../../core/promiseUtils.js";import o from"../../../geometry/Extent.js";import{projectAsync as n}from"../../../geometry/projectionUtils.js";import{load as i,execute as s}from"../../../geometry/operators/projectOperator.js";import{fromExtent as l}from"../../../geometry/support/aaBoundingRect.js";import c from"../../ElevationLayer.js";import p from"../../ImageryLayer.js";import{getMetersPerUnitOfSR as m}from"../core/utils.js";import{defaultOptions as u}from"../../support/ElevationQuery.js";import{ElevationTile as f}from"../../support/ElevationTile.js";import{ElevationTileData as y}from"../../support/ElevationTileData.js";import w from"../../support/RasterFunction.js";import{TileElevationSampler as g}from"../../support/TileElevationSampler.js";import d from"../../support/TileInfo.js";import{TileKey as v}from"../../support/TileKey.js";import{requestServiceJSON as j}from"../../../request/serviceJSON.js";import{logAndThrow as R}from"../../../widgets/OrientedImageryViewer/utils.js";async function h(t,r,a){if(!r.extent||!r.url)throw R("esri.layer.orientedImagery.transformations",new e("update-elevation:missing-property","both extent and url are required to create a sampler",r));const o=await E(r);if(!o)throw R("esri.layers.orientedImagery.transformations",new e("update-elevation:elevation-source","could not create a sampler using provided elevation source",r));return x(t,o,a)}async function x(e,t,r){await a(r);const o=z(t,r),n=Array.isArray(e)?e:[e];return await Promise.all(n.map(o))}async function E(e,a){let o;const{extent:n,rasterFunction:i,url:s,lod:l}=e;try{o=await q(s)}catch(c){if(r(c))return;t.getLogger("esri.layers.orientedImagery.transformations").error("updateElevationUsingElevationSource",c)}switch(o){case 0:return await L(s,n,i,a);case 1:return await I(s,n,l,a);default:return}}async function I(e,a,o,n){const i=new c(e);let s;try{const{tileInfo:e}=await i.load(),t=(o&&e.lodAt(Math.min(e.lods.length-1,o))?.resolution)??"finest-contiguous";s=await i.createElevationSampler(a,{...n,demResolution:t})}catch(l){if(r(l))return;t.getLogger(i).error(l)}finally{i.destroy()}return s}async function L(e,t,r,a){const n=r?new w({functionName:r}):void 0,c=new p({url:e,rasterFunction:n,format:"lerc"});await c.load(a);const m=512,j=t.center,R=Math.max(t.width,t.height);let h=new o({xmin:j.x-R/2,ymin:j.y-R/2,xmax:j.x+R/2,ymax:j.y+R/2,spatialReference:t.spatialReference});c.spatialReference.equals(h.spatialReference)||(await i(),h=s(h,c.spatialReference));const x=await c.fetchPixels(h,m,m,a),E=d.create({scales:[R/m],size:m,spatialReference:h.spatialReference}),I=new v(0,0,0,l(h)),L=new y(x.pixelBlock.pixels[0],m,m,0),q=[new f(I,L)],z=u.noDataValue;return new g({tiles:q,tileInfo:E,noDataValue:z})}async function q(t,r){await a(r);const o=await j(t),{tileInfo:n,cacheType:i}=o;if(!o.hasOwnProperty("bandCount")||!o.hasOwnProperty("pixelSizeX"))throw new e("elevation-source:invalid-service-url",`ElevationSource URL expects an elevation 3D image service but given ${t}`);return n?"LERC"!==n?.format?.toUpperCase()||i&&"elevation"!==i.toLowerCase()?2:1:0}function z(e,t){return async r=>{let a=r.clone();const o=r.spatialReference.equals(e.spatialReference)?a:await n(r,e.spatialReference,t),i=e.queryElevation(o);if(i){a=r.spatialReference.equals(e.spatialReference)?i.clone():await n(i,r.spatialReference,t)}return a.z=a.z??1,a}}async function S(e,t,r){return await a(r),e.map(e=>(e.z=t,e))}function T(e,t){const{averageGroundElevation:r,spatialReference:a}=t,o=m(a);return e.map(e=>{const t=e.clone();return t.z=r*o/e.spatialReference.metersPerUnit,t})}export{E as getElevationSampler,L as getElevationSamplerFromDynamicImageService,T as updateUsingAverageGroundElevation,S as updateUsingConstant,x as updateUsingElevationSampler,h as updateUsingElevationSource,q as validateElevationSourceURL};
5
+ import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{isAbortError as r,waitTick as a}from"../../../core/promiseUtils.js";import o from"../../../geometry/Extent.js";import{projectAsync as n}from"../../../geometry/projectionUtils.js";import{load as i,execute as s}from"../../../geometry/operators/projectOperator.js";import{fromExtent as l}from"../../../geometry/support/aaBoundingRect.js";import c from"../../ElevationLayer.js";import p from"../../ImageryLayer.js";import{getMetersPerUnitOfSR as m}from"../core/utils.js";import{defaultOptions as u}from"../../support/ElevationQuery.js";import{ElevationTile as f}from"../../support/ElevationTile.js";import y from"../../support/ElevationTileData.js";import w from"../../support/RasterFunction.js";import{TileElevationSampler as g}from"../../support/TileElevationSampler.js";import d from"../../support/TileInfo.js";import{TileKey as v}from"../../support/TileKey.js";import{requestServiceJSON as j}from"../../../request/serviceJSON.js";import{logAndThrow as R}from"../../../widgets/OrientedImageryViewer/utils.js";async function h(t,r,a){if(!r.extent||!r.url)throw R("esri.layer.orientedImagery.transformations",new e("update-elevation:missing-property","both extent and url are required to create a sampler",r));const o=await E(r);if(!o)throw R("esri.layers.orientedImagery.transformations",new e("update-elevation:elevation-source","could not create a sampler using provided elevation source",r));return x(t,o,a)}async function x(e,t,r){await a(r);const o=z(t,r),n=Array.isArray(e)?e:[e];return await Promise.all(n.map(o))}async function E(e,a){let o;const{extent:n,rasterFunction:i,url:s,lod:l}=e;try{o=await q(s)}catch(c){if(r(c))return;t.getLogger("esri.layers.orientedImagery.transformations").error("updateElevationUsingElevationSource",c)}switch(o){case 0:return await L(s,n,i,a);case 1:return await I(s,n,l,a);default:return}}async function I(e,a,o,n){const i=new c(e);let s;try{const{tileInfo:e}=await i.load(),t=(o&&e.lodAt(Math.min(e.lods.length-1,o))?.resolution)??"finest-contiguous";s=await i.createElevationSampler(a,{...n,demResolution:t})}catch(l){if(r(l))return;t.getLogger(i).error(l)}finally{i.destroy()}return s}async function L(e,t,r,a){const n=r?new w({functionName:r}):void 0,c=new p({url:e,rasterFunction:n,format:"lerc"});await c.load(a);const m=512,j=t.center,R=Math.max(t.width,t.height);let h=new o({xmin:j.x-R/2,ymin:j.y-R/2,xmax:j.x+R/2,ymax:j.y+R/2,spatialReference:t.spatialReference});c.spatialReference.equals(h.spatialReference)||(await i(),h=s(h,c.spatialReference));const x=await c.fetchPixels(h,m,m,a),E=d.create({scales:[R/m],size:m,spatialReference:h.spatialReference}),I=new v(0,0,0,l(h)),L=new y(x.pixelBlock.pixels[0],m,m,0),q=[new f(I,L)],z=u.noDataValue;return new g({tiles:q,tileInfo:E,noDataValue:z})}async function q(t,r){await a(r);const o=await j(t),{tileInfo:n,cacheType:i}=o;if(!o.hasOwnProperty("bandCount")||!o.hasOwnProperty("pixelSizeX"))throw new e("elevation-source:invalid-service-url",`ElevationSource URL expects an elevation 3D image service but given ${t}`);return n?"LERC"!==n?.format?.toUpperCase()||i&&"elevation"!==i.toLowerCase()?2:1:0}function z(e,t){return async r=>{let a=r.clone();const o=r.spatialReference.equals(e.spatialReference)?a:await n(r,e.spatialReference,t),i=e.queryElevation(o);if(i){a=r.spatialReference.equals(e.spatialReference)?i.clone():await n(i,r.spatialReference,t)}return a.z=a.z??1,a}}async function S(e,t,r){return await a(r),e.map(e=>(e.z=t,e))}function T(e,t){const{averageGroundElevation:r,spatialReference:a}=t,o=m(a);return e.map(e=>{const t=e.clone();return t.z=r*o/e.spatialReference.metersPerUnit,t})}export{E as getElevationSampler,L as getElevationSamplerFromDynamicImageService,T as updateUsingAverageGroundElevation,S as updateUsingConstant,x as updateUsingElevationSampler,h as updateUsingElevationSource,q as validateElevationSourceURL};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/Error.js";import{assertIsSome as e}from"../../../core/maybe.js";import a from"./ImageCanvasDecoder.js";import i from"./JpgPlus.js";import{load as s,decode as r}from"./Lerc.js";import{decode as n}from"./Lzw.js";import{convertNoDataToMask as o}from"./pixelRangeUtils.js";import{Z as h}from"../../../chunks/Zlib.js";import{load as c,decode as l}from"./Qb3.js";import p from"./Raw.js";import{decodeTileOrStrip as d,decode as u}from"./TiffDecoder.js";import{isPlatformLittleEndian as f}from"./utils.js";import m from"../../support/PixelBlock.js";import{SimpleBandStatistics as g}from"../../support/SimpleBandStatistics.js";var w=function(t){var e,a,i,s,r,n;function o(t){var e,a,i,s,r,n,o,h,c,l,p,d,u;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},r=null;;){switch(e=this.readUInt32(),h=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join(""),h){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":r&&this.animation.frames.push(r),this.pos+=4,r={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},s=this.readUInt16(),i=this.readUInt16()||100,r.delay=1e3*s/i,r.disposeOp=this.data[this.pos++],r.blendOp=this.data[this.pos++],r.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,e-=4),t=(null!=r?r.data:void 0)||this.imgData,p=0;0<=e?p<e:p>e;0<=e?++p:--p)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(e),(c=255-this.transparency.indexed.length)>0)for(d=0;0<=c?d<c:d>c;0<=c?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":n=(l=this.read(e)).indexOf(0),o=String.fromCharCode.apply(String,l.slice(0,n)),this.text[o]=String.fromCharCode.apply(String,l.slice(n+1));break;case"IEND":return r&&this.animation.frames.push(r),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(u=this.colorType)||6===u,a=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*a,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return o.load=function(t,e,a){var i;return"function"==typeof e&&(a=e),(i=new XMLHttpRequest).open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){var t;return t=new o(new Uint8Array(i.response||i.mozResponseArrayBuffer)),"function"==typeof(null!=e?e.getContext:void 0)&&t.render(e),"function"==typeof a?a(t):void 0},i.send(null)},a=1,i=2,e=0,o.prototype.read=function(t){var e,a;for(a=[],e=0;0<=t?e<t:e>t;0<=t?++e:--e)a.push(this.data[this.pos++]);return a},o.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.decodePixels=function(t){var e,a,i,s,r,n,o,c,l,p,d,u,f,m,g,w,y,b,x,k,T,C,I;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);for(t=(t=new h(t)).getBytes(),w=(u=this.pixelBitlength/8)*this.width,f=new Uint8Array(w*this.height),n=t.length,g=0,m=0,a=0;m<n;){switch(t[m++]){case 0:for(s=x=0;x<w;s=x+=1)f[a++]=t[m++];break;case 1:for(s=k=0;k<w;s=k+=1)e=t[m++],r=s<u?0:f[a-u],f[a++]=(e+r)%256;break;case 2:for(s=T=0;T<w;s=T+=1)e=t[m++],i=(s-s%u)/u,y=g&&f[(g-1)*w+i*u+s%u],f[a++]=(y+e)%256;break;case 3:for(s=C=0;C<w;s=C+=1)e=t[m++],i=(s-s%u)/u,r=s<u?0:f[a-u],y=g&&f[(g-1)*w+i*u+s%u],f[a++]=(e+Math.floor((r+y)/2))%256;break;case 4:for(s=I=0;I<w;s=I+=1)e=t[m++],i=(s-s%u)/u,r=s<u?0:f[a-u],0===g?y=b=0:(y=f[(g-1)*w+i*u+s%u],b=i&&f[(g-1)*w+(i-1)*u+s%u]),o=r+y-b,c=Math.abs(o-r),p=Math.abs(o-y),d=Math.abs(o-b),l=c<=p&&c<=d?r:p<=d?y:b,f[a++]=(e+l)%256;break;default:throw new Error("Invalid filter algorithm: "+t[m-1])}g++}return f},o.prototype.decodePalette=function(){var t,e,a,i,s,r,n,o,h;for(a=this.palette,r=this.transparency.indexed||[],s=new Uint8Array((r.length||0)+a.length),i=0,a.length,t=0,e=n=0,o=a.length;n<o;e=n+=3)s[i++]=a[e],s[i++]=a[e+1],s[i++]=a[e+2],s[i++]=null!=(h=r[t++])?h:255;return s},o.prototype.copyToImageData=function(t,e){var a,i,s,r,n,o,h,c,l,p,d;if(i=this.colors,l=null,a=this.hasAlphaChannel,this.palette.length&&(l=null!=(d=this._decodedPalette)?d:this._decodedPalette=this.decodePalette(),i=4,a=!0),c=(s=t.data||t).length,n=l||e,r=o=0,1===i)for(;r<c;)h=l?4*e[r/4]:o,p=n[h++],s[r++]=p,s[r++]=p,s[r++]=p,s[r++]=a?n[h++]:this.transparency.grayscale&&this.transparency.grayscale===p?0:255,o=h;else for(;r<c;)h=l?4*e[r/4]:o,s[r++]=n[h++],s[r++]=n[h++],s[r++]=n[h++],s[r++]=a?n[h++]:this.transparency.rgb&&this.transparency.rgb[1]===n[h-3]&&this.transparency.rgb[3]===n[h-2]&&this.transparency.rgb[5]===n[h-1]?0:255,o=h},o.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t},r=t.document&&t.document.createElement("canvas"),n=r&&r.getContext("2d"),s=function(t){var e;return n.width=t.width,n.height=t.height,n.clearRect(0,0,t.width,t.height),n.putImageData(t,0,0),(e=new Image).src=r.toDataURL(),e},o.prototype.decodeFrames=function(t){var e,a,i,r,n,o,h,c;if(this.animation){for(c=[],a=n=0,o=(h=this.animation.frames).length;n<o;a=++n)e=h[a],i=t.createImageData(e.width,e.height),r=this.decodePixels(new Uint8Array(e.data)),this.copyToImageData(i,r),e.imageData=i,c.push(e.image=s(i));return c}},o.prototype.renderFrame=function(t,s){var r,n,o;return r=(n=this.animation.frames)[s],o=n[s-1],0===s&&t.clearRect(0,0,this.width,this.height),(null!=o?o.disposeOp:void 0)===a?t.clearRect(o.xOffset,o.yOffset,o.width,o.height):(null!=o?o.disposeOp:void 0)===i&&t.putImageData(o.imageData,o.xOffset,o.yOffset),r.blendOp===e&&t.clearRect(r.xOffset,r.yOffset,r.width,r.height),t.drawImage(r.image,r.xOffset,r.yOffset)},o.prototype.animate=function(t){var e,a,i,s,r,n,o=this;return a=0,n=this.animation,s=n.numFrames,i=n.frames,r=n.numPlays,(e=function(){var n,h;if(n=a++%s,h=i[n],o.renderFrame(t,n),s>1&&a/s<r)return o.animation._timeout=setTimeout(e,h.delay)})()},o.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},o.prototype.render=function(t){var e,a;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,e=t.getContext("2d"),this.animation?(this.decodeFrames(e),this.animate(e)):(a=e.createImageData(this.width,this.height),this.copyToImageData(a,this.decodePixels()),e.putImageData(a,0,0))},o}(self);const y=new Set(["jpg","png","bmp","gif"]);async function b(e,a){if(!f)throw new t("rasterCoded:decode","lerc decoder is not supported on big endian platform");await s();const{offset:i}=a,{width:n,height:o,pixelType:h,statistics:c,depthCount:l,noDataValues:p,bandMasks:d,pixels:u,mask:w}=r(e,{inputOffset:i,returnInterleaved:a.returnInterleaved}),y=new m({width:n,height:o,pixelType:h.toLowerCase(),pixels:u,mask:w,statistics:c.map(({minValue:t,maxValue:e})=>new g(t,e)),bandMasks:d,depthCount:l,noDataValues:p});return c?.length||y.updateStatistics(),y}async function x(e,a){await c();const i=l(e);if(!i)throw new t("rasterCodec:decode","failed to decode the input data.");const{width:s,height:r,pixels:n}=i,o=new m({width:s,height:r,pixelType:"u16",pixels:n});return o.updateStatistics(),o}async function k(t,a){const i=await u(t,{...a,noDataValue:a.tiffNoDataValue,matchAllNoData:a.matchAllNoData});e(i);const s=new m({width:i.width,height:i.height,pixels:i.pixels,pixelType:i.pixelType.toLowerCase(),mask:i.mask,bandMasks:i.bandMasks,statistics:null});return s.updateStatistics(),s}async function T(t,e){const a=await d(t,e.customOptions),i=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:a.pixelType.toLowerCase(),mask:a.mask,statistics:null});return i.updateStatistics(),i}function C(t,e){const a=e.pixelType||"u8",i=m.getPixelArrayConstructor(a),s="u8"===a?t:new i(t.buffer),r=[],n=e.planes||1;if(1===n)r.push(s);else for(let h=0;h<n;h++){const a=(e.width||1)*(e.height||t.length),o=new i(a);for(let t=0;t<a;t++)o[t]=s[t*n+h];r.push(o)}const o=new m({width:e.width||1,height:e.height||t.length,pixels:r,pixelType:a,statistics:null});return o.updateStatistics(),o}function I(t,e){return C(new h(new Uint8Array(t)).getBytes(),e)}function A(t,e){return C(n(t,e.offset,e.eof,!e.isInputBigEndian),e)}function v(t,e,a){const{pixelTypeCtor:i}=P(e.pixelType),s=(0,p.decode)(t,{width:e.width,height:e.height,pixelType:i,format:a}),r=new m({width:e.width,height:e.height,pixels:s.pixels,pixelType:e.pixelType,mask:s.mask,statistics:null});return r.updateStatistics(),r}function D(t,e){const a=i.decode(t,e.hasNoZlibMask??void 0),s=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:"u8",mask:a.mask,statistics:null});return s.updateStatistics(),s}function U(t,e){const a=new Uint8Array(t),i=new w(a),{width:s,height:r}=e,n=s*r,o=i.decode();let h,c=0,l=0;const p=new Uint8Array(n);for(c=0;c<n;c++)p[c]=o[4*c+3];const d=new m({width:s,height:r,pixels:[],pixelType:"u8",mask:p,statistics:[]});for(c=0;c<3;c++){for(h=new Uint8Array(n),l=0;l<n;l++)h[l]=o[4*l+c];d.addData({pixels:h})}return d.updateStatistics(),d}async function S(t,e,i,s){const r=new a,n={applyJpegMask:!1,format:e,...i},o=await r.decode(t,n,s),h=new m(o);return h.updateStatistics(),h}function j(e){if(null==e)throw new t("rasterCodec:decode","parameter encodeddata is required.");const a=new Uint8Array(e,0,10);let i="";return 255===a[0]&&216===a[1]?i="jpg":137===a[0]&&80===a[1]&&78===a[2]&&71===a[3]?i="png":67===a[0]&&110===a[1]&&116===a[2]&&90===a[3]&&73===a[4]&&109===a[5]&&97===a[6]&&103===a[7]&&101===a[8]&&32===a[9]?i="lerc":76===a[0]&&101===a[1]&&114===a[2]&&99===a[3]&&50===a[4]&&32===a[5]?i="lerc2":73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3]||73===a[0]&&73===a[1]&&43===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&43===a[3]?i="tiff":71===a[0]&&73===a[1]&&70===a[2]?i="gif":66===a[0]&&77===a[1]?i="bmp":81===a[0]&&66===a[1]&&51===a[2]?i="qb3":String.fromCharCode.apply(null,a).toLowerCase().includes("error")&&(i="error"),i}function O(e){let a=null;switch(e){case"lerc":case"lerc2":a=b;break;case"jpg":a=D;break;case"png":a=U;break;case"bsq":case"bip":a=(t,a)=>v(t,a,e);break;case"tiff":a=k;break;case"deflate":a=I;break;case"lzw":a=A;break;case"qb3":a=x;break;case"error":a=()=>{throw new t("rasterCodec:decode","input data contains error")};break;default:a=()=>{throw new t("rasterCodec:decode","unsupported raster format")}}return a}function P(t){let e=null,a=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":a=255,e=Uint8Array;break;case"u16":a=a||65535,e=Uint16Array;break;case"u32":a=a||2**32-1,e=Uint32Array;break;case"s8":a=a||-128,e=Int8Array;break;case"s16":a=a||-32768,e=Int16Array;break;case"s32":a=a||0-2**31,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:a}}function M(t,e=1){if(!t)return;const{pixels:a,width:i,height:s,mask:r}=t;if(!a||0===a.length)return;const n=a.length,o=i-1,h=s-1,c=[];let l,p,d,u,f,g,w=null;const y=m.getPixelArrayConstructor(t.pixelType);if(0===e){for(l=0;l<n;l++){for(f=a[l],g=new y(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)g[p*o+d]=f[u+d];c.push(g)}if(null!=r)for(w=new Uint8Array(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)w[p*o+d]=r[u+d]}else{for(l=0;l<n;l++){for(f=a[l],g=new y(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)g[p*o+d]=(f[u+d]+f[u+d+1]+f[u+i+d]+f[u+i+d+1])/4;c.push(g)}if(r)for(w=new Uint8Array(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)w[p*o+d]=Math.min.apply(null,[r[u+d],r[u+d+1],r[u+i+d],r[u+i+d+1]])}t.width=o,t.height=h,t.mask=w,t.pixels=c}function L(t){let e=j(t);return"lerc2"===e?e="lerc":"error"===e&&(e=""),e}async function R(e,a={},i){if(null==e)throw new t("rasterCodec:decode","missing encodeddata parameter.");let s=a.format?.toLowerCase();if(!("bsq"!==s&&"bip"!==s||null!=a.width&&null!=a.height))throw new t("rasterCodec:decode","requires width and height in options parameter.");if("tiff"===s&&a.customOptions)return T(e,a);if((!s||"bsq"!==s&&"bip"!==s&&"deflate"!==s&&"lzw"!==s)&&(s=j(e)),a.useCanvas&&y.has(s))return S(e,s,a,i);const r=O(s);let n;a.isPoint&&(null!=(a={...a}).width&&a.width++,null!=a.height&&a.height++);const{offsets:h}=a;if(h&&h.length>1){const t=h.map((t,i)=>r(e.slice(t,h[i+1]),a)),i=await Promise.all(t);n=i[0],n.pixels=i.map(t=>t.pixels[0]);const s=i.map(t=>t.mask);i.some(t=>null!=t)&&(s.forEach((t,e)=>{null==t&&(s[e]=new Uint8Array(n.width*n.height).fill(255))}),n.bandMasks=s,n.mask=m.combineBandMasks(s)),n.updateStatistics()}else n=await r(e,{...a,offset:h?.[0]??a.offset});return"jpg"!==s&&null!=a.noDataValue&&1===n.depthCount&&o(n,a.noDataValue,{customFloatTolerance:a.tolerance}),a.isPoint&&M(n),n}export{R as decode,L as getFormat};
5
+ import t from"../../../core/Error.js";import{assertIsSome as e}from"../../../core/maybe.js";import a from"./ImageCanvasDecoder.js";import i from"./JpgPlus.js";import{load as s,decode as r}from"./Lerc.js";import{decode as n}from"./Lzw.js";import{convertNoDataToMask as o}from"./pixelRangeUtils.js";import{Z as h}from"../../../chunks/Zlib.js";import{load as c,decode as l}from"./Qb3.js";import p from"./Raw.js";import{decodeTileOrStrip as d,decode as u}from"./TiffDecoder.js";import{isPlatformLittleEndian as f}from"./utils.js";import m from"../../support/PixelBlock.js";import g from"../../support/SimpleBandStatistics.js";var w=function(t){var e,a,i,s,r,n;function o(t){var e,a,i,s,r,n,o,h,c,l,p,d,u;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},r=null;;){switch(e=this.readUInt32(),h=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join(""),h){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":r&&this.animation.frames.push(r),this.pos+=4,r={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},s=this.readUInt16(),i=this.readUInt16()||100,r.delay=1e3*s/i,r.disposeOp=this.data[this.pos++],r.blendOp=this.data[this.pos++],r.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,e-=4),t=(null!=r?r.data:void 0)||this.imgData,p=0;0<=e?p<e:p>e;0<=e?++p:--p)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(e),(c=255-this.transparency.indexed.length)>0)for(d=0;0<=c?d<c:d>c;0<=c?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":n=(l=this.read(e)).indexOf(0),o=String.fromCharCode.apply(String,l.slice(0,n)),this.text[o]=String.fromCharCode.apply(String,l.slice(n+1));break;case"IEND":return r&&this.animation.frames.push(r),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(u=this.colorType)||6===u,a=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*a,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return o.load=function(t,e,a){var i;return"function"==typeof e&&(a=e),(i=new XMLHttpRequest).open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){var t;return t=new o(new Uint8Array(i.response||i.mozResponseArrayBuffer)),"function"==typeof(null!=e?e.getContext:void 0)&&t.render(e),"function"==typeof a?a(t):void 0},i.send(null)},a=1,i=2,e=0,o.prototype.read=function(t){var e,a;for(a=[],e=0;0<=t?e<t:e>t;0<=t?++e:--e)a.push(this.data[this.pos++]);return a},o.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.decodePixels=function(t){var e,a,i,s,r,n,o,c,l,p,d,u,f,m,g,w,y,b,x,k,T,C,I;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);for(t=(t=new h(t)).getBytes(),w=(u=this.pixelBitlength/8)*this.width,f=new Uint8Array(w*this.height),n=t.length,g=0,m=0,a=0;m<n;){switch(t[m++]){case 0:for(s=x=0;x<w;s=x+=1)f[a++]=t[m++];break;case 1:for(s=k=0;k<w;s=k+=1)e=t[m++],r=s<u?0:f[a-u],f[a++]=(e+r)%256;break;case 2:for(s=T=0;T<w;s=T+=1)e=t[m++],i=(s-s%u)/u,y=g&&f[(g-1)*w+i*u+s%u],f[a++]=(y+e)%256;break;case 3:for(s=C=0;C<w;s=C+=1)e=t[m++],i=(s-s%u)/u,r=s<u?0:f[a-u],y=g&&f[(g-1)*w+i*u+s%u],f[a++]=(e+Math.floor((r+y)/2))%256;break;case 4:for(s=I=0;I<w;s=I+=1)e=t[m++],i=(s-s%u)/u,r=s<u?0:f[a-u],0===g?y=b=0:(y=f[(g-1)*w+i*u+s%u],b=i&&f[(g-1)*w+(i-1)*u+s%u]),o=r+y-b,c=Math.abs(o-r),p=Math.abs(o-y),d=Math.abs(o-b),l=c<=p&&c<=d?r:p<=d?y:b,f[a++]=(e+l)%256;break;default:throw new Error("Invalid filter algorithm: "+t[m-1])}g++}return f},o.prototype.decodePalette=function(){var t,e,a,i,s,r,n,o,h;for(a=this.palette,r=this.transparency.indexed||[],s=new Uint8Array((r.length||0)+a.length),i=0,a.length,t=0,e=n=0,o=a.length;n<o;e=n+=3)s[i++]=a[e],s[i++]=a[e+1],s[i++]=a[e+2],s[i++]=null!=(h=r[t++])?h:255;return s},o.prototype.copyToImageData=function(t,e){var a,i,s,r,n,o,h,c,l,p,d;if(i=this.colors,l=null,a=this.hasAlphaChannel,this.palette.length&&(l=null!=(d=this._decodedPalette)?d:this._decodedPalette=this.decodePalette(),i=4,a=!0),c=(s=t.data||t).length,n=l||e,r=o=0,1===i)for(;r<c;)h=l?4*e[r/4]:o,p=n[h++],s[r++]=p,s[r++]=p,s[r++]=p,s[r++]=a?n[h++]:this.transparency.grayscale&&this.transparency.grayscale===p?0:255,o=h;else for(;r<c;)h=l?4*e[r/4]:o,s[r++]=n[h++],s[r++]=n[h++],s[r++]=n[h++],s[r++]=a?n[h++]:this.transparency.rgb&&this.transparency.rgb[1]===n[h-3]&&this.transparency.rgb[3]===n[h-2]&&this.transparency.rgb[5]===n[h-1]?0:255,o=h},o.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t},r=t.document&&t.document.createElement("canvas"),n=r&&r.getContext("2d"),s=function(t){var e;return n.width=t.width,n.height=t.height,n.clearRect(0,0,t.width,t.height),n.putImageData(t,0,0),(e=new Image).src=r.toDataURL(),e},o.prototype.decodeFrames=function(t){var e,a,i,r,n,o,h,c;if(this.animation){for(c=[],a=n=0,o=(h=this.animation.frames).length;n<o;a=++n)e=h[a],i=t.createImageData(e.width,e.height),r=this.decodePixels(new Uint8Array(e.data)),this.copyToImageData(i,r),e.imageData=i,c.push(e.image=s(i));return c}},o.prototype.renderFrame=function(t,s){var r,n,o;return r=(n=this.animation.frames)[s],o=n[s-1],0===s&&t.clearRect(0,0,this.width,this.height),(null!=o?o.disposeOp:void 0)===a?t.clearRect(o.xOffset,o.yOffset,o.width,o.height):(null!=o?o.disposeOp:void 0)===i&&t.putImageData(o.imageData,o.xOffset,o.yOffset),r.blendOp===e&&t.clearRect(r.xOffset,r.yOffset,r.width,r.height),t.drawImage(r.image,r.xOffset,r.yOffset)},o.prototype.animate=function(t){var e,a,i,s,r,n,o=this;return a=0,n=this.animation,s=n.numFrames,i=n.frames,r=n.numPlays,(e=function(){var n,h;if(n=a++%s,h=i[n],o.renderFrame(t,n),s>1&&a/s<r)return o.animation._timeout=setTimeout(e,h.delay)})()},o.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},o.prototype.render=function(t){var e,a;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,e=t.getContext("2d"),this.animation?(this.decodeFrames(e),this.animate(e)):(a=e.createImageData(this.width,this.height),this.copyToImageData(a,this.decodePixels()),e.putImageData(a,0,0))},o}(self);const y=new Set(["jpg","png","bmp","gif"]);async function b(e,a){if(!f)throw new t("rasterCoded:decode","lerc decoder is not supported on big endian platform");await s();const{offset:i}=a,{width:n,height:o,pixelType:h,statistics:c,depthCount:l,noDataValues:p,bandMasks:d,pixels:u,mask:w}=r(e,{inputOffset:i,returnInterleaved:a.returnInterleaved}),y=new m({width:n,height:o,pixelType:h.toLowerCase(),pixels:u,mask:w,statistics:c.map(({minValue:t,maxValue:e})=>new g(t,e)),bandMasks:d,depthCount:l,noDataValues:p});return c?.length||y.updateStatistics(),y}async function x(e,a){await c();const i=l(e);if(!i)throw new t("rasterCodec:decode","failed to decode the input data.");const{width:s,height:r,pixels:n}=i,o=new m({width:s,height:r,pixelType:"u16",pixels:n});return o.updateStatistics(),o}async function k(t,a){const i=await u(t,{...a,noDataValue:a.tiffNoDataValue,matchAllNoData:a.matchAllNoData});e(i);const s=new m({width:i.width,height:i.height,pixels:i.pixels,pixelType:i.pixelType.toLowerCase(),mask:i.mask,bandMasks:i.bandMasks,statistics:null});return s.updateStatistics(),s}async function T(t,e){const a=await d(t,e.customOptions),i=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:a.pixelType.toLowerCase(),mask:a.mask,statistics:null});return i.updateStatistics(),i}function C(t,e){const a=e.pixelType||"u8",i=m.getPixelArrayConstructor(a),s="u8"===a?t:new i(t.buffer),r=[],n=e.planes||1;if(1===n)r.push(s);else for(let h=0;h<n;h++){const a=(e.width||1)*(e.height||t.length),o=new i(a);for(let t=0;t<a;t++)o[t]=s[t*n+h];r.push(o)}const o=new m({width:e.width||1,height:e.height||t.length,pixels:r,pixelType:a,statistics:null});return o.updateStatistics(),o}function I(t,e){return C(new h(new Uint8Array(t)).getBytes(),e)}function A(t,e){return C(n(t,e.offset,e.eof,!e.isInputBigEndian),e)}function v(t,e,a){const{pixelTypeCtor:i}=P(e.pixelType),s=(0,p.decode)(t,{width:e.width,height:e.height,pixelType:i,format:a}),r=new m({width:e.width,height:e.height,pixels:s.pixels,pixelType:e.pixelType,mask:s.mask,statistics:null});return r.updateStatistics(),r}function D(t,e){const a=i.decode(t,e.hasNoZlibMask??void 0),s=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:"u8",mask:a.mask,statistics:null});return s.updateStatistics(),s}function U(t,e){const a=new Uint8Array(t),i=new w(a),{width:s,height:r}=e,n=s*r,o=i.decode();let h,c=0,l=0;const p=new Uint8Array(n);for(c=0;c<n;c++)p[c]=o[4*c+3];const d=new m({width:s,height:r,pixels:[],pixelType:"u8",mask:p,statistics:[]});for(c=0;c<3;c++){for(h=new Uint8Array(n),l=0;l<n;l++)h[l]=o[4*l+c];d.addData({pixels:h})}return d.updateStatistics(),d}async function S(t,e,i,s){const r=new a,n={applyJpegMask:!1,format:e,...i},o=await r.decode(t,n,s),h=new m(o);return h.updateStatistics(),h}function j(e){if(null==e)throw new t("rasterCodec:decode","parameter encodeddata is required.");const a=new Uint8Array(e,0,10);let i="";return 255===a[0]&&216===a[1]?i="jpg":137===a[0]&&80===a[1]&&78===a[2]&&71===a[3]?i="png":67===a[0]&&110===a[1]&&116===a[2]&&90===a[3]&&73===a[4]&&109===a[5]&&97===a[6]&&103===a[7]&&101===a[8]&&32===a[9]?i="lerc":76===a[0]&&101===a[1]&&114===a[2]&&99===a[3]&&50===a[4]&&32===a[5]?i="lerc2":73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3]||73===a[0]&&73===a[1]&&43===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&43===a[3]?i="tiff":71===a[0]&&73===a[1]&&70===a[2]?i="gif":66===a[0]&&77===a[1]?i="bmp":81===a[0]&&66===a[1]&&51===a[2]?i="qb3":String.fromCharCode.apply(null,a).toLowerCase().includes("error")&&(i="error"),i}function O(e){let a=null;switch(e){case"lerc":case"lerc2":a=b;break;case"jpg":a=D;break;case"png":a=U;break;case"bsq":case"bip":a=(t,a)=>v(t,a,e);break;case"tiff":a=k;break;case"deflate":a=I;break;case"lzw":a=A;break;case"qb3":a=x;break;case"error":a=()=>{throw new t("rasterCodec:decode","input data contains error")};break;default:a=()=>{throw new t("rasterCodec:decode","unsupported raster format")}}return a}function P(t){let e=null,a=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":a=255,e=Uint8Array;break;case"u16":a=a||65535,e=Uint16Array;break;case"u32":a=a||2**32-1,e=Uint32Array;break;case"s8":a=a||-128,e=Int8Array;break;case"s16":a=a||-32768,e=Int16Array;break;case"s32":a=a||0-2**31,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:a}}function M(t,e=1){if(!t)return;const{pixels:a,width:i,height:s,mask:r}=t;if(!a||0===a.length)return;const n=a.length,o=i-1,h=s-1,c=[];let l,p,d,u,f,g,w=null;const y=m.getPixelArrayConstructor(t.pixelType);if(0===e){for(l=0;l<n;l++){for(f=a[l],g=new y(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)g[p*o+d]=f[u+d];c.push(g)}if(null!=r)for(w=new Uint8Array(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)w[p*o+d]=r[u+d]}else{for(l=0;l<n;l++){for(f=a[l],g=new y(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)g[p*o+d]=(f[u+d]+f[u+d+1]+f[u+i+d]+f[u+i+d+1])/4;c.push(g)}if(r)for(w=new Uint8Array(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)w[p*o+d]=Math.min.apply(null,[r[u+d],r[u+d+1],r[u+i+d],r[u+i+d+1]])}t.width=o,t.height=h,t.mask=w,t.pixels=c}function L(t){let e=j(t);return"lerc2"===e?e="lerc":"error"===e&&(e=""),e}async function R(e,a={},i){if(null==e)throw new t("rasterCodec:decode","missing encodeddata parameter.");let s=a.format?.toLowerCase();if(!("bsq"!==s&&"bip"!==s||null!=a.width&&null!=a.height))throw new t("rasterCodec:decode","requires width and height in options parameter.");if("tiff"===s&&a.customOptions)return T(e,a);if((!s||"bsq"!==s&&"bip"!==s&&"deflate"!==s&&"lzw"!==s)&&(s=j(e)),a.useCanvas&&y.has(s))return S(e,s,a,i);const r=O(s);let n;a.isPoint&&(null!=(a={...a}).width&&a.width++,null!=a.height&&a.height++);const{offsets:h}=a;if(h&&h.length>1){const t=h.map((t,i)=>r(e.slice(t,h[i+1]),a)),i=await Promise.all(t);n=i[0],n.pixels=i.map(t=>t.pixels[0]);const s=i.map(t=>t.mask);i.some(t=>null!=t)&&(s.forEach((t,e)=>{null==t&&(s[e]=new Uint8Array(n.width*n.height).fill(255))}),n.bandMasks=s,n.mask=m.combineBandMasks(s)),n.updateStatistics()}else n=await r(e,{...a,offset:h?.[0]??a.offset});return"jpg"!==s&&null!=a.noDataValue&&1===n.depthCount&&o(n,a.noDataValue,{customFloatTolerance:a.tolerance}),a.isPoint&&M(n),n}export{R as decode,L as getFormat};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../core/accessorSupport/decorators.js";import r from"./BaseRasterFunction.js";import s from"./ColormapToRGBFunctionArguments.js";import{createColormapLUT as n}from"./pixelUtils.js";import{SimpleBandStatistics as i}from"../../support/SimpleBandStatistics.js";import{isColormapSupportedByWebGL as p}from"../../../renderers/support/rasterRendererChecks.js";let a=class extends r{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const o=t.clone();o.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(o),o.bandCount=3,o.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=o;const e=[...t.colormap].sort((t,o)=>t[0]-o[0]),{indexedColormap:r,offset:s}=n({colormap:e});return r?(this.lookup={indexedColormap:r,offset:s},{success:!0,supportsGPU:p(r)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let o=t.pixelBlocks?.[0];if(!o||!this.lookup)return o;o=o.clone();const e=o.pixels[0],r=o.mask??new Uint8Array(e.length).fill(255),s=new Uint8Array(e.length),n=new Uint8Array(e.length),p=new Uint8Array(e.length),{indexedColormap:a,offset:u}=this.lookup,l=a.length;for(let i=0;i<e.length;i++)if(r[i]){let t=4*(e[i]-u);t<0||t>l-4?r[i]=0:(s[i]=a[t++],n[i]=a[t++],p[i]=a[t++])}return o.pixels=[s,n,p],o.statistics=[new i(0,255),new i(0,255),new i(0,255)],o.pixelType=this.outputPixelType,o}_getWebGLParameters(){return this.lookup}};t([o({json:{write:!0,name:"rasterFunction"}})],a.prototype,"functionName",void 0),t([o({type:s,json:{write:!0,name:"rasterFunctionArguments"}})],a.prototype,"functionArguments",void 0),t([o()],a.prototype,"rasterArgumentNames",void 0),t([o({json:{write:!0}})],a.prototype,"lookup",void 0),a=t([e("esri.layers.raster.functions.ColormapToRGBFunction")],a);const u=a;export{u as default};
5
+ import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../core/accessorSupport/decorators.js";import r from"./BaseRasterFunction.js";import s from"./ColormapToRGBFunctionArguments.js";import{createColormapLUT as n}from"./pixelUtils.js";import i from"../../support/SimpleBandStatistics.js";import{isColormapSupportedByWebGL as p}from"../../../renderers/support/rasterRendererChecks.js";let a=class extends r{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const o=t.clone();o.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(o),o.bandCount=3,o.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=o;const e=[...t.colormap].sort((t,o)=>t[0]-o[0]),{indexedColormap:r,offset:s}=n({colormap:e});return r?(this.lookup={indexedColormap:r,offset:s},{success:!0,supportsGPU:p(r)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let o=t.pixelBlocks?.[0];if(!o||!this.lookup)return o;o=o.clone();const e=o.pixels[0],r=o.mask??new Uint8Array(e.length).fill(255),s=new Uint8Array(e.length),n=new Uint8Array(e.length),p=new Uint8Array(e.length),{indexedColormap:a,offset:u}=this.lookup,l=a.length;for(let i=0;i<e.length;i++)if(r[i]){let t=4*(e[i]-u);t<0||t>l-4?r[i]=0:(s[i]=a[t++],n[i]=a[t++],p[i]=a[t++])}return o.pixels=[s,n,p],o.statistics=[new i(0,255),new i(0,255),new i(0,255)],o.pixelType=this.outputPixelType,o}_getWebGLParameters(){return this.lookup}};t([o({json:{write:!0,name:"rasterFunction"}})],a.prototype,"functionName",void 0),t([o({type:s,json:{write:!0,name:"rasterFunctionArguments"}})],a.prototype,"functionArguments",void 0),t([o()],a.prototype,"rasterArgumentNames",void 0),t([o({json:{write:!0}})],a.prototype,"lookup",void 0),a=t([e("esri.layers.raster.functions.ColormapToRGBFunction")],a);const u=a;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{isValidPixelBlock as t}from"./pixelUtils.js";import e from"../../support/PixelBlock.js";import{SimpleBandStatistics as i}from"../../support/SimpleBandStatistics.js";const s=1,n=1/111e3;function o(t){let{altitude:e,azimuth:i}=t;const{hillshadeType:s,pixelSizePower:o=1,pixelSizeFactor:a=1,scalingType:l,isGCS:r,resolution:c}=t,h="multi-directional"===s?2*t.zFactor:t.zFactor,{x:u,y:f}=c;let d=h/(8*u),p=h/(8*f);if(r&&h>.001&&(d/=n,p/=n),"adjusted"===l)if(r){const t=u*n,e=f*n;d=(h+t**o*a)/(8*t),p=(h+e**o*a)/(8*e)}else d=(h+u**o*a)/(8*u),p=(h+f**o*a)/(8*f);let x=(90-e)*Math.PI/180,w=Math.cos(x),y=(360-i+90)*Math.PI/180,m=Math.sin(x)*Math.cos(y),M=Math.sin(x)*Math.sin(y);const z=[315,270,225,360,180,0],A=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),F=g.reduce((t,e)=>t+e),k=g.map(t=>t/F),P="multi-directional"===s?z.length:1,S=new Float32Array(6),C=new Float32Array(6),T=new Float32Array(6);if("multi-directional"===s)for(let n=0;n<P;n++)e=A[n],i=z[n],x=(90-e)*Math.PI/180,w=Math.cos(x),y=(360-i+90)*Math.PI/180,m=Math.sin(x)*Math.cos(y),M=Math.sin(x)*Math.sin(y),S[n]=w,C[n]=m,T[n]=M;else S.fill(w),C.fill(m),T.fill(M);return{resolution:c,factor:[d,p],sinZcosA:m,sinZsinA:M,cosZ:w,sinZcosAs:[...C],sinZsinAs:[...T],cosZs:[...S],weights:[...k],hillshadeType:["traditional","multi-directional"].indexOf(s)}}function a(t,e){const{width:i,height:n}=t,o=i*n,a=new Uint8Array(o),l=null!=t.mask;let r;if(l){r=new Uint8Array(t.mask);for(let t=0;t<r.length;t++)r[t]&&(a[t]=1,r[t]=1)}const c=t.pixels[0],h=new Float32Array(o),u=new Float32Array(o);let f,d=0;if(e){const{resolution:t}=e,i=t?(t.x+t.y)/2:1;d=200*e.zFactor/(i*i),f=new Float32Array(o)}const p=e?.curvatureType;let x,w,y,m,M,z,A,g;for(let F=s;F<n-s;F++){const t=F*i;for(let e=s;e<i-s;e++){const s=t+e;if(0!==r?.[s]){if(r){if(r[s-i-1]+r[s-i]+r[s-i+1]+r[s-1]+r[s+1]+r[s+i-1]+r[s+i]+r[s+i+1]<7){a[s]=0;continue}x=r[s-i-1]?c[s-i-1]:c[s],w=r[s-i]?c[s-i]:c[s],y=r[s-i+1]?c[s-i+1]:c[s],m=r[s-1]?c[s-1]:c[s],M=r[s+1]?c[s+1]:c[s],z=r[s+i-1]?c[s+i-1]:c[s],A=r[s+i]?c[s+i]:c[s],g=r[s+i+1]?c[s+i+1]:c[s]}else x=c[s-i-1],w=c[s-i],y=c[s-i+1],m=c[s-1],M=c[s+1],z=c[s+i-1],A=c[s+i],g=c[s+i+1];if(h[s]=y+M+M+g-(x+m+m+z),u[s]=z+A+A+g-(x+w+w+y),null!=f){const t=c[s],e=.5*(m+M)-t,i=.5*(w+A)-t;if("standard"===p)f[s]=-d*(e+i);else{const t=(-x+y+z-g)/4,n=(-m+M)/2,o=(w-A)/2,a=n*n,l=o*o,r=a+l;r&&(f[s]="profile"===p?d*(e*a+i*l+t*n*o)/r:-d*(e*l+i*a-t*n*o)/r)}}}}}return{outMask:l?a:null,dzxs:h,dzys:u,curvatures:f}}function l(t,e,i){for(let s=0;s<i;s++)t[s*e]=t[s*e+1],t[(s+1)*e-1]=t[(s+1)*e-2];for(let s=1;s<e-1;s++)t[s]=t[s+e],t[s+(i-1)*e]=t[s+(i-2)*e]}function r(n,r){if(!t(n))return n;const{factor:c,sinZcosA:h,sinZsinA:u,cosZ:f,sinZcosAs:d,sinZsinAs:p,cosZs:x,weights:w}=o(r),[y,m]=c,M="traditional"===r.hillshadeType,{width:z,height:A}=n,g=new Uint8Array(z*A),{dzxs:F,dzys:k,outMask:P}=a(n);for(let t=s;t<A-s;t++){const e=t*z;for(let t=s;t<z-s;t++){const i=e+t;if(!P||P[i]){const t=F[i]*y,e=k[i]*m,s=Math.sqrt(1+t*t+e*e);let n=0;if(M){let i=255*(f+u*e-h*t)/s;i<0&&(i=0),n=i}else{const i=p.length;for(let o=0;o<i;o++){let i=255*(x[o]+p[o]*e-d[o]*t)/s;i<0&&(i=0),n+=i*w[o]}}g[i]=255&n}}}l(g,z,A);return new e({width:z,height:A,pixels:[g],mask:P,pixelType:"u8",validPixelCount:n.validPixelCount,statistics:[new i(0,255)]})}function c(e,i,s,n){if(!t(e)||!t(i))return;const{min:o,max:a}=n,l=e.pixels[0],{pixels:r,mask:c}=i,h=r[0],u=255.00001/(a-o),f=new Uint8ClampedArray(h.length),d=new Uint8ClampedArray(h.length),p=new Uint8ClampedArray(h.length),x=s.length-1;for(let t=0;t<h.length;t++){if(0===c?.[t])continue;const e=Math.floor((h[t]-o)*u),[i,n]=s[e<0?0:e>x?x:e],a=l[t],r=a*n,w=r*(1-Math.abs(i%2-1)),y=a-r;switch(Math.floor(i)){case 0:f[t]=r+y,d[t]=w+y,p[t]=y;break;case 1:f[t]=w+y,d[t]=r+y,p[t]=y;break;case 2:f[t]=y,d[t]=r+y,p[t]=w+y;break;case 3:f[t]=y,d[t]=w+y,p[t]=r+y;break;case 4:f[t]=w+y,d[t]=y,p[t]=r+y;break;case 5:case 6:f[t]=r+y,d[t]=y,p[t]=w+y}}e.pixels=[f,d,p],e.updateStatistics()}function h(i,o){if(!t(i))return i;const r=o.zFactor,c=o.pixelSizePower??1,h=o.pixelSizeFactor??1,u=o.slopeType,f=o.isGCS,{x:d,y:p}=o.resolution;let x=r/(8*d),w=r/(8*p);f&&Math.abs(r-1)<1e-4&&(x/=n,w/=n),"adjusted"===u&&(x=(r+d**c*h)/(8*d),w=(r+p**c*h)/(8*p));const{dzxs:y,dzys:m,outMask:M}=a(i),{width:z,height:A}=i,g=new Float32Array(z*A);for(let t=s;t<A-s;t++){const e=t*z;for(let t=s;t<z-s;t++){const i=e+t;if(!M||M[i]){const s=y[i]*x,n=m[i]*w,o=Math.sqrt(s*s+n*n);g[e+t]="percent-rise"===u?100*o:57.2957795*Math.atan(o)}}}l(g,z,A);const F=new e({width:z,height:A,pixels:[g],mask:M,pixelType:"f32",validPixelCount:i.validPixelCount});return F.updateStatistics(),F}function u(n,o={}){if(!t(n))return n;const{resolution:r}=o,c=r?1/r.x:1,h=r?1/r.y:1,{dzxs:u,dzys:f,outMask:d}=a(n),{width:p,height:x}=n,w=new Float32Array(p*x);for(let t=s;t<x-s;t++){const e=t*p;for(let t=s;t<p-s;t++){const i=e+t;if(!d||d[i]){const s=u[i]*c,n=f[i]*h;let o=-1;0===s&&0===n||(o=90-57.29578*Math.atan2(n,-s),o<0&&(o+=360),360===o?o=0:o>360&&(o%=360)),w[e+t]=o}}}l(w,p,x);return new e({width:p,height:x,pixels:[w],mask:d,pixelType:"f32",validPixelCount:n.validPixelCount,statistics:[new i(-1,360)]})}function f(i,s){if(!t(i))return i;const{curvatures:n,outMask:o}=a(i,s),{width:r,height:c}=i;l(n,r,c);const h=new e({width:r,height:c,pixels:[n],mask:o,pixelType:"f32",validPixelCount:i.validPixelCount});return h.updateStatistics(),h}function d(t,e,i){const{hillshadeType:s,altitude:n,azimuth:o,zFactor:a,pixelSizeFactor:l,pixelSizePower:r,slopeType:c}=t;return{hillshadeType:s,altitude:n,azimuth:o,zFactor:a,pixelSizePower:r,pixelSizeFactor:l,scalingType:"scaled"===c?"adjusted":"none",resolution:e,isGCS:i}}export{u as aspect,o as calculateHillshadeParams,f as curvature,n as gcsFactor,d as getHillshadeOptions,r as hillshade,h as slope,c as tintHillshade};
5
+ import{isValidPixelBlock as t}from"./pixelUtils.js";import e from"../../support/PixelBlock.js";import i from"../../support/SimpleBandStatistics.js";const s=1,n=1/111e3;function o(t){let{altitude:e,azimuth:i}=t;const{hillshadeType:s,pixelSizePower:o=1,pixelSizeFactor:a=1,scalingType:l,isGCS:r,resolution:c}=t,h="multi-directional"===s?2*t.zFactor:t.zFactor,{x:u,y:f}=c;let d=h/(8*u),p=h/(8*f);if(r&&h>.001&&(d/=n,p/=n),"adjusted"===l)if(r){const t=u*n,e=f*n;d=(h+t**o*a)/(8*t),p=(h+e**o*a)/(8*e)}else d=(h+u**o*a)/(8*u),p=(h+f**o*a)/(8*f);let x=(90-e)*Math.PI/180,w=Math.cos(x),y=(360-i+90)*Math.PI/180,m=Math.sin(x)*Math.cos(y),M=Math.sin(x)*Math.sin(y);const z=[315,270,225,360,180,0],A=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),F=g.reduce((t,e)=>t+e),k=g.map(t=>t/F),P="multi-directional"===s?z.length:1,S=new Float32Array(6),C=new Float32Array(6),T=new Float32Array(6);if("multi-directional"===s)for(let n=0;n<P;n++)e=A[n],i=z[n],x=(90-e)*Math.PI/180,w=Math.cos(x),y=(360-i+90)*Math.PI/180,m=Math.sin(x)*Math.cos(y),M=Math.sin(x)*Math.sin(y),S[n]=w,C[n]=m,T[n]=M;else S.fill(w),C.fill(m),T.fill(M);return{resolution:c,factor:[d,p],sinZcosA:m,sinZsinA:M,cosZ:w,sinZcosAs:[...C],sinZsinAs:[...T],cosZs:[...S],weights:[...k],hillshadeType:["traditional","multi-directional"].indexOf(s)}}function a(t,e){const{width:i,height:n}=t,o=i*n,a=new Uint8Array(o),l=null!=t.mask;let r;if(l){r=new Uint8Array(t.mask);for(let t=0;t<r.length;t++)r[t]&&(a[t]=1,r[t]=1)}const c=t.pixels[0],h=new Float32Array(o),u=new Float32Array(o);let f,d=0;if(e){const{resolution:t}=e,i=t?(t.x+t.y)/2:1;d=200*e.zFactor/(i*i),f=new Float32Array(o)}const p=e?.curvatureType;let x,w,y,m,M,z,A,g;for(let F=s;F<n-s;F++){const t=F*i;for(let e=s;e<i-s;e++){const s=t+e;if(0!==r?.[s]){if(r){if(r[s-i-1]+r[s-i]+r[s-i+1]+r[s-1]+r[s+1]+r[s+i-1]+r[s+i]+r[s+i+1]<7){a[s]=0;continue}x=r[s-i-1]?c[s-i-1]:c[s],w=r[s-i]?c[s-i]:c[s],y=r[s-i+1]?c[s-i+1]:c[s],m=r[s-1]?c[s-1]:c[s],M=r[s+1]?c[s+1]:c[s],z=r[s+i-1]?c[s+i-1]:c[s],A=r[s+i]?c[s+i]:c[s],g=r[s+i+1]?c[s+i+1]:c[s]}else x=c[s-i-1],w=c[s-i],y=c[s-i+1],m=c[s-1],M=c[s+1],z=c[s+i-1],A=c[s+i],g=c[s+i+1];if(h[s]=y+M+M+g-(x+m+m+z),u[s]=z+A+A+g-(x+w+w+y),null!=f){const t=c[s],e=.5*(m+M)-t,i=.5*(w+A)-t;if("standard"===p)f[s]=-d*(e+i);else{const t=(-x+y+z-g)/4,n=(-m+M)/2,o=(w-A)/2,a=n*n,l=o*o,r=a+l;r&&(f[s]="profile"===p?d*(e*a+i*l+t*n*o)/r:-d*(e*l+i*a-t*n*o)/r)}}}}}return{outMask:l?a:null,dzxs:h,dzys:u,curvatures:f}}function l(t,e,i){for(let s=0;s<i;s++)t[s*e]=t[s*e+1],t[(s+1)*e-1]=t[(s+1)*e-2];for(let s=1;s<e-1;s++)t[s]=t[s+e],t[s+(i-1)*e]=t[s+(i-2)*e]}function r(n,r){if(!t(n))return n;const{factor:c,sinZcosA:h,sinZsinA:u,cosZ:f,sinZcosAs:d,sinZsinAs:p,cosZs:x,weights:w}=o(r),[y,m]=c,M="traditional"===r.hillshadeType,{width:z,height:A}=n,g=new Uint8Array(z*A),{dzxs:F,dzys:k,outMask:P}=a(n);for(let t=s;t<A-s;t++){const e=t*z;for(let t=s;t<z-s;t++){const i=e+t;if(!P||P[i]){const t=F[i]*y,e=k[i]*m,s=Math.sqrt(1+t*t+e*e);let n=0;if(M){let i=255*(f+u*e-h*t)/s;i<0&&(i=0),n=i}else{const i=p.length;for(let o=0;o<i;o++){let i=255*(x[o]+p[o]*e-d[o]*t)/s;i<0&&(i=0),n+=i*w[o]}}g[i]=255&n}}}l(g,z,A);return new e({width:z,height:A,pixels:[g],mask:P,pixelType:"u8",validPixelCount:n.validPixelCount,statistics:[new i(0,255)]})}function c(e,i,s,n){if(!t(e)||!t(i))return;const{min:o,max:a}=n,l=e.pixels[0],{pixels:r,mask:c}=i,h=r[0],u=255.00001/(a-o),f=new Uint8ClampedArray(h.length),d=new Uint8ClampedArray(h.length),p=new Uint8ClampedArray(h.length),x=s.length-1;for(let t=0;t<h.length;t++){if(0===c?.[t])continue;const e=Math.floor((h[t]-o)*u),[i,n]=s[e<0?0:e>x?x:e],a=l[t],r=a*n,w=r*(1-Math.abs(i%2-1)),y=a-r;switch(Math.floor(i)){case 0:f[t]=r+y,d[t]=w+y,p[t]=y;break;case 1:f[t]=w+y,d[t]=r+y,p[t]=y;break;case 2:f[t]=y,d[t]=r+y,p[t]=w+y;break;case 3:f[t]=y,d[t]=w+y,p[t]=r+y;break;case 4:f[t]=w+y,d[t]=y,p[t]=r+y;break;case 5:case 6:f[t]=r+y,d[t]=y,p[t]=w+y}}e.pixels=[f,d,p],e.updateStatistics()}function h(i,o){if(!t(i))return i;const r=o.zFactor,c=o.pixelSizePower??1,h=o.pixelSizeFactor??1,u=o.slopeType,f=o.isGCS,{x:d,y:p}=o.resolution;let x=r/(8*d),w=r/(8*p);f&&Math.abs(r-1)<1e-4&&(x/=n,w/=n),"adjusted"===u&&(x=(r+d**c*h)/(8*d),w=(r+p**c*h)/(8*p));const{dzxs:y,dzys:m,outMask:M}=a(i),{width:z,height:A}=i,g=new Float32Array(z*A);for(let t=s;t<A-s;t++){const e=t*z;for(let t=s;t<z-s;t++){const i=e+t;if(!M||M[i]){const s=y[i]*x,n=m[i]*w,o=Math.sqrt(s*s+n*n);g[e+t]="percent-rise"===u?100*o:57.2957795*Math.atan(o)}}}l(g,z,A);const F=new e({width:z,height:A,pixels:[g],mask:M,pixelType:"f32",validPixelCount:i.validPixelCount});return F.updateStatistics(),F}function u(n,o={}){if(!t(n))return n;const{resolution:r}=o,c=r?1/r.x:1,h=r?1/r.y:1,{dzxs:u,dzys:f,outMask:d}=a(n),{width:p,height:x}=n,w=new Float32Array(p*x);for(let t=s;t<x-s;t++){const e=t*p;for(let t=s;t<p-s;t++){const i=e+t;if(!d||d[i]){const s=u[i]*c,n=f[i]*h;let o=-1;0===s&&0===n||(o=90-57.29578*Math.atan2(n,-s),o<0&&(o+=360),360===o?o=0:o>360&&(o%=360)),w[e+t]=o}}}l(w,p,x);return new e({width:p,height:x,pixels:[w],mask:d,pixelType:"f32",validPixelCount:n.validPixelCount,statistics:[new i(-1,360)]})}function f(i,s){if(!t(i))return i;const{curvatures:n,outMask:o}=a(i,s),{width:r,height:c}=i;l(n,r,c);const h=new e({width:r,height:c,pixels:[n],mask:o,pixelType:"f32",validPixelCount:i.validPixelCount});return h.updateStatistics(),h}function d(t,e,i){const{hillshadeType:s,altitude:n,azimuth:o,zFactor:a,pixelSizeFactor:l,pixelSizePower:r,slopeType:c}=t;return{hillshadeType:s,altitude:n,azimuth:o,zFactor:a,pixelSizePower:r,pixelSizeFactor:l,scalingType:"scaled"===c?"adjusted":"none",resolution:e,isGCS:i}}export{u as aspect,o as calculateHillshadeParams,f as curvature,n as gcsFactor,d as getHillshadeOptions,r as hillshade,h as slope,c as tintHillshade};