@arcgis/core 4.32.0-next.20241021 → 4.32.0-next.20241023

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 (257) hide show
  1. package/applications/MapViewer/templateUtils.d.ts +4 -0
  2. package/applications/MapViewer/templateUtils.js +5 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0b7ee57bec7ffac312f2.js +1 -0
  5. package/assets/esri/core/workers/chunks/{1ba1d9c867ec6a492af9.js → 0f3912bca9fe25eea75c.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{842ebde78db9bfcaf07b.js → 1678d1d0ecb9b2af69a8.js} +1 -1
  7. package/assets/esri/core/workers/chunks/1d16ca7791f64dd7c7fb.js +1 -0
  8. package/assets/esri/core/workers/chunks/1d4be734ff961e313257.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b292758308dfac4ba8ee.js → 2d8aa31dc96bbd014036.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{53f648321c5fde26bfe4.js → 319e06888467f9f460ab.js} +1 -1
  11. package/assets/esri/core/workers/chunks/33cae7ece52a77394b05.js +1 -0
  12. package/assets/esri/core/workers/chunks/{210a954f5299fe105e0b.js → 539060ffb7f230fb1bd0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/545441dcc8e915e63ff1.js +1 -0
  14. package/assets/esri/core/workers/chunks/{303f39b9b7bd33109df8.js → 587df97288a83721d251.js} +1 -1
  15. package/assets/esri/core/workers/chunks/5caa02a7a85d05e253b4.js +1 -0
  16. package/assets/esri/core/workers/chunks/5cfecb320e1dcd258b2e.js +1 -0
  17. package/assets/esri/core/workers/chunks/67018ef25736f0722f6e.js +1 -0
  18. package/assets/esri/core/workers/chunks/89f74819ac1b5884c149.js +1 -0
  19. package/assets/esri/core/workers/chunks/92b2d81ef16877341f97.js +1 -0
  20. package/assets/esri/core/workers/chunks/{e6e77cbdeb99d90caad1.js → 97f62fad6d416a666319.js} +1 -1
  21. package/assets/esri/core/workers/chunks/98c1956b2e27058c8a51.js +1 -0
  22. package/assets/esri/core/workers/chunks/9c8a910b6261a4d5da77.js +1 -0
  23. package/assets/esri/core/workers/chunks/ab6eaa3ae2e233f91a5e.js +1 -0
  24. package/assets/esri/core/workers/chunks/{63719f892a7d1025c7d3.js → b42c1ab7579a3c464f72.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{03eba36affe6ed1f5a11.js → bc4ef18d0a02354186e3.js} +7 -7
  26. package/assets/esri/core/workers/chunks/{c71304c88fce556340ef.js → c859f73b57a764e99b02.js} +1 -1
  27. package/assets/esri/core/workers/chunks/cb3038ec3ef0d86bf2a0.js +1 -0
  28. package/assets/esri/core/workers/chunks/{ae20ca2008a2ea6a46b2.js → d8f4bd2b4366388f8a28.js} +1 -1
  29. package/assets/esri/core/workers/chunks/e71fa25ed45bae5a1adb.js +320 -0
  30. package/assets/esri/core/workers/chunks/{9c9a8a529494c6d1dfa3.js → ec9d5af8887854e821c8.js} +1 -1
  31. package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
  32. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +14 -0
  33. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +1 -1
  34. package/assets/esri/themes/dark/main.css +1 -1
  35. package/assets/esri/themes/light/main.css +1 -1
  36. package/assets/esri/themes/light/view.css +1 -1
  37. package/chunks/Bufferer-BhkgvSV4.js +5 -0
  38. package/chunks/{Distance2DCalculator-DM4OojiI.js → Distance2DCalculator-BX0Ep7eP.js} +1 -1
  39. package/chunks/{GeodeticDistanceCalculator-DzvUOSaR.js → GeodeticDistanceCalculator-B5uO-Y_z.js} +1 -1
  40. package/chunks/OperatorCrosses.js +5 -0
  41. package/chunks/OperatorCut.js +1 -1
  42. package/chunks/OperatorGeodesicBuffer.js +1 -1
  43. package/chunks/OperatorGeodeticArea.js +1 -1
  44. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  45. package/chunks/OperatorGeodeticDistance.js +1 -1
  46. package/chunks/OperatorGeodeticLength.js +1 -1
  47. package/chunks/OperatorIntersects.js +5 -0
  48. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  49. package/chunks/OperatorOverlaps.js +5 -0
  50. package/chunks/OperatorProximity.js +1 -1
  51. package/chunks/OperatorProximityGeodesic.js +1 -1
  52. package/chunks/OperatorShapePreservingLength.js +1 -1
  53. package/chunks/OperatorTouches.js +5 -0
  54. package/chunks/OperatorWithin.js +5 -0
  55. package/chunks/QuadraticBezier.js +1 -1
  56. package/chunks/SSAOBlur.glsl.js +5 -5
  57. package/chunks/SideCalculator2D-CoWc8Oe3.js +1 -1
  58. package/chunks/Transformation2D.js +1 -1
  59. package/core/MemCache.js +1 -1
  60. package/core/MemCachePool.js +1 -1
  61. package/core/unitUtils.js +1 -1
  62. package/geometry/Mesh.js +1 -1
  63. package/geometry/operators/affineTransformOperator.js +1 -1
  64. package/geometry/operators/alphaShapeOperator.js +1 -1
  65. package/geometry/operators/areaOperator.js +1 -1
  66. package/geometry/operators/autoCompleteOperator.js +1 -1
  67. package/geometry/operators/boundaryOperator.js +1 -1
  68. package/geometry/operators/bufferOperator.js +1 -1
  69. package/geometry/operators/centroidOperator.js +1 -1
  70. package/geometry/operators/clipOperator.js +1 -1
  71. package/geometry/operators/containsOperator.js +1 -1
  72. package/geometry/operators/convexHullOperator.js +1 -1
  73. package/geometry/operators/crossesOperator.js +1 -1
  74. package/geometry/operators/cutOperator.js +1 -1
  75. package/geometry/operators/densifyOperator.js +1 -1
  76. package/geometry/operators/differenceOperator.js +1 -1
  77. package/geometry/operators/disjointOperator.js +1 -1
  78. package/geometry/operators/distanceOperator.js +1 -1
  79. package/geometry/operators/equalsOperator.js +1 -1
  80. package/geometry/operators/extendOperator.js +1 -1
  81. package/geometry/operators/generalizeOperator.js +1 -1
  82. package/geometry/operators/geodesicBufferOperator.js +1 -1
  83. package/geometry/operators/geodesicProximityOperator.js +1 -1
  84. package/geometry/operators/geodeticAreaOperator.js +1 -1
  85. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  86. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  87. package/geometry/operators/geodeticLengthOperator.js +1 -1
  88. package/geometry/operators/graphicBufferOperator.js +1 -1
  89. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  90. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  91. package/geometry/operators/gx/operatorBoundary.js +1 -1
  92. package/geometry/operators/gx/operatorBuffer.js +1 -1
  93. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  94. package/geometry/operators/gx/operatorDifference.js +1 -1
  95. package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
  96. package/geometry/operators/gx/operatorGeodeticArea.js +1 -1
  97. package/geometry/operators/gx/operatorGeodeticDensify.js +1 -1
  98. package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
  99. package/geometry/operators/gx/operatorGeodeticLength.js +1 -1
  100. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  101. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  102. package/geometry/operators/gx/operatorIntersection.js +1 -1
  103. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  104. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  105. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  106. package/geometry/operators/gx/operatorOffset.js +1 -1
  107. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  108. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  109. package/geometry/operators/gx/operatorProject.js +1 -1
  110. package/geometry/operators/gx/operatorProximityGeodesic.js +1 -1
  111. package/geometry/operators/gx/operatorSimplify.js +1 -1
  112. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  113. package/geometry/operators/gx/operatorUnion.js +1 -1
  114. package/geometry/operators/integrateOperator.js +1 -1
  115. package/geometry/operators/intersectionOperator.js +1 -1
  116. package/geometry/operators/intersectsOperator.js +1 -1
  117. package/geometry/operators/isNearOperator.js +1 -1
  118. package/geometry/operators/json/containsOperator.js +5 -0
  119. package/geometry/operators/json/crossesOperator.js +5 -0
  120. package/geometry/operators/json/disjointOperator.js +5 -0
  121. package/geometry/operators/json/intersectsOperator.js +5 -0
  122. package/geometry/operators/json/offsetOperator.js +5 -0
  123. package/geometry/operators/json/overlapsOperator.js +5 -0
  124. package/geometry/operators/json/touchesOperator.js +5 -0
  125. package/geometry/operators/json/withinOperator.js +5 -0
  126. package/geometry/operators/labelPointOperator.js +1 -1
  127. package/geometry/operators/lengthOperator.js +1 -1
  128. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  129. package/geometry/operators/locateBetweenOperator.js +1 -1
  130. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  131. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  132. package/geometry/operators/offsetOperator.js +1 -1
  133. package/geometry/operators/overlapsOperator.js +1 -1
  134. package/geometry/operators/polygonOverlayOperator.js +1 -1
  135. package/geometry/operators/polygonSlicerOperator.js +1 -1
  136. package/geometry/operators/projectOperator.js +1 -1
  137. package/geometry/operators/proximityOperator.js +1 -1
  138. package/geometry/operators/relateOperator.js +1 -1
  139. package/geometry/operators/reshapeOperator.js +1 -1
  140. package/geometry/operators/simplifyOperator.js +1 -1
  141. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  142. package/geometry/operators/support/apiConverter.js +5 -0
  143. package/geometry/operators/support/initNoPeFactory.js +5 -0
  144. package/geometry/operators/support/jsonConverter.js +5 -0
  145. package/geometry/operators/support/proximityResult.js +1 -1
  146. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  147. package/geometry/operators/touchesOperator.js +1 -1
  148. package/geometry/operators/unionOperator.js +1 -1
  149. package/geometry/operators/withinOperator.js +1 -1
  150. package/geometry/support/MeshVertexAttributes.js +1 -1
  151. package/interfaces.d.ts +134 -0
  152. package/layers/LinkChartLayer.js +1 -1
  153. package/layers/SceneLayer.js +1 -1
  154. package/layers/graphics/OptimizedGeometry.js +1 -1
  155. package/layers/graphics/sources/ParquetSource.js +1 -1
  156. package/layers/knowledgeGraph/supportUtils.js +1 -1
  157. package/layers/support/ElevationQueryTileCache.js +1 -1
  158. package/layers/support/ElevationTileData.js +1 -1
  159. package/layers/support/mediaUtils.js +1 -1
  160. package/layers/support/parquetLayerUtils.js +1 -1
  161. package/layers/support/rasterFunctions/ClipFunction.js +1 -1
  162. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  163. package/layers/support/rasterFunctions/localUtils.js +1 -1
  164. package/libs/parquet/parquet.js +1 -1
  165. package/linkChart/LinkChartProperties.js +1 -1
  166. package/package.json +1 -1
  167. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  168. package/smartMapping/raster/renderers/rgb.js +1 -1
  169. package/smartMapping/raster/renderers/stretch.js +1 -1
  170. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  171. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  172. package/smartMapping/renderers/support/rendererUtils.d.ts +4 -0
  173. package/support/revision.js +1 -1
  174. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  175. package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
  176. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  177. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  178. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  180. package/views/2d/grid/GridView2D.js +1 -1
  181. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  182. package/views/2d/layers/MediaLayerView2D.js +1 -1
  183. package/views/2d/layers/TileLayerView2D.js +1 -1
  184. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  185. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  186. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  187. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  188. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  189. package/views/3d/glTF/loader.js +1 -1
  190. package/views/3d/layers/I3SMeshView3D.js +1 -1
  191. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  192. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  193. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  194. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  195. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  196. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  197. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  198. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  199. package/views/3d/layers/i3s/CachedMeshData.js +5 -0
  200. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  201. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  202. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  203. package/views/3d/layers/support/FeatureTile.js +1 -1
  204. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  205. package/views/3d/state/ViewStateManager.js +1 -1
  206. package/views/3d/state/controllers/FovController.js +1 -1
  207. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  208. package/views/3d/terrain/Tile.js +1 -1
  209. package/views/3d/terrain/TileTexture.js +1 -1
  210. package/views/3d/webgl/ManagedFBO.js +1 -1
  211. package/views/3d/webgl/ManagedFBOAttachment.js +1 -1
  212. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  213. package/views/3d/webgl-engine/core/FBOPool.js +1 -1
  214. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
  215. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  216. package/views/3d/webgl-engine/materials/ProceduralTextureRepository.js +1 -1
  217. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  218. package/views/3d/webgl-engine/shaders/SSAOBlur.glsl.js +1 -1
  219. package/views/input/BrowserEventSource.js +1 -1
  220. package/views/webgl/Texture.js +1 -1
  221. package/views/webgl/VertexArrayObject.js +1 -1
  222. package/webdoc/support/webdocSaveUtils.js +1 -1
  223. package/widgets/Attribution/AttributionViewModel.js +1 -1
  224. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  225. package/widgets/BatchAttributeForm/css.js +1 -1
  226. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  227. package/widgets/BatchAttributeForm.js +1 -1
  228. package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
  229. package/widgets/ElevationProfile/support/ProfileLine2D.js +5 -0
  230. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  231. package/widgets/ElevationProfile/support/constants.js +1 -1
  232. package/widgets/ElevationProfile/support/visualizationUtils.js +5 -0
  233. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  234. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  235. package/widgets/FeatureTable/support/columnUtils.js +1 -1
  236. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  237. package/widgets/FeatureTable/support/templateUtils.js +5 -0
  238. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  239. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  240. package/widgets/support/GridControls.js +1 -1
  241. package/assets/esri/core/workers/chunks/03d0394fff1463c224f9.js +0 -1
  242. package/assets/esri/core/workers/chunks/0c40cac18711f79f0a7d.js +0 -1
  243. package/assets/esri/core/workers/chunks/1a97f98facfc62a9fc69.js +0 -1
  244. package/assets/esri/core/workers/chunks/1e3ed3ee48c2977cff6f.js +0 -1
  245. package/assets/esri/core/workers/chunks/1fc064e37d030e449d5e.js +0 -1
  246. package/assets/esri/core/workers/chunks/4daab36de5efa03a8cbb.js +0 -1
  247. package/assets/esri/core/workers/chunks/77d129134c2a66cd86d8.js +0 -1
  248. package/assets/esri/core/workers/chunks/88bd9e023764da377aa7.js +0 -1
  249. package/assets/esri/core/workers/chunks/92ce57cb12d9a7a3699e.js +0 -1
  250. package/assets/esri/core/workers/chunks/a5675c989d00b7400f98.js +0 -1
  251. package/assets/esri/core/workers/chunks/c06c5c815b5e37717fa1.js +0 -1
  252. package/assets/esri/core/workers/chunks/ca1385e165aae8a32ca2.js +0 -1
  253. package/assets/esri/core/workers/chunks/ce8c1208916f54af7e68.js +0 -320
  254. package/assets/esri/core/workers/chunks/df51c93b2dbcc89efc23.js +0 -1
  255. package/assets/esri/core/workers/chunks/efa3c919261672871f2f.js +0 -1
  256. package/chunks/Bufferer-fr1_Nc47.js +0 -5
  257. package/geometry/operators/support/converterAPI.js +0 -5
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1737],{4902:(e,t,r)=>{r.d(t,{PH:()=>a,sA:()=>o});var i=r(90237),s=r(40608);let n=0;const o=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return t=(0,i._)([(0,s.$)("esri.core.Identifiable")],t),t},a=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n++})}};return t=(0,i._)([(0,s.$)("esri.core.Identifiable.NumericIdentifiable")],t),t};let l=class extends(o(class{})){};l=(0,i._)([(0,s.$)("esri.core.Identifiable")],l)},80200:(e,t,r)=>{r.d(t,{T:()=>i,d:()=>f});const i={Base64:0,Hex:1,String:2,Raw:3},s=8,n=(1<<s)-1;function o(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e){const t=[];for(let r=0,i=e.length*s;r<i;r+=s)t[r>>5]|=(e.charCodeAt(r/s)&n)<<r%32;return t}function l(e){const t=[];for(let r=0,i=32*e.length;r<i;r+=s)t.push(String.fromCharCode(e[r>>5]>>>r%32&n));return t.join("")}function d(e,t,r,i,s,n){return o(function(e,t){return e<<t|e>>>32-t}(o(o(t,e),o(i,n)),s),r)}function u(e,t,r,i,s,n,o){return d(t&r|~t&i,e,t,s,n,o)}function p(e,t,r,i,s,n,o){return d(t&i|r&~i,e,t,s,n,o)}function c(e,t,r,i,s,n,o){return d(t^r^i,e,t,s,n,o)}function h(e,t,r,i,s,n,o){return d(r^(t|~i),e,t,s,n,o)}function y(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let r=1732584193,i=-271733879,s=-1732584194,n=271733878;for(let t=0;t<e.length;t+=16){const a=r,l=i,d=s,y=n;r=u(r,i,s,n,e[t],7,-680876936),n=u(n,r,i,s,e[t+1],12,-389564586),s=u(s,n,r,i,e[t+2],17,606105819),i=u(i,s,n,r,e[t+3],22,-1044525330),r=u(r,i,s,n,e[t+4],7,-176418897),n=u(n,r,i,s,e[t+5],12,1200080426),s=u(s,n,r,i,e[t+6],17,-1473231341),i=u(i,s,n,r,e[t+7],22,-45705983),r=u(r,i,s,n,e[t+8],7,1770035416),n=u(n,r,i,s,e[t+9],12,-1958414417),s=u(s,n,r,i,e[t+10],17,-42063),i=u(i,s,n,r,e[t+11],22,-1990404162),r=u(r,i,s,n,e[t+12],7,1804603682),n=u(n,r,i,s,e[t+13],12,-40341101),s=u(s,n,r,i,e[t+14],17,-1502002290),i=u(i,s,n,r,e[t+15],22,1236535329),r=p(r,i,s,n,e[t+1],5,-165796510),n=p(n,r,i,s,e[t+6],9,-1069501632),s=p(s,n,r,i,e[t+11],14,643717713),i=p(i,s,n,r,e[t],20,-373897302),r=p(r,i,s,n,e[t+5],5,-701558691),n=p(n,r,i,s,e[t+10],9,38016083),s=p(s,n,r,i,e[t+15],14,-660478335),i=p(i,s,n,r,e[t+4],20,-405537848),r=p(r,i,s,n,e[t+9],5,568446438),n=p(n,r,i,s,e[t+14],9,-1019803690),s=p(s,n,r,i,e[t+3],14,-187363961),i=p(i,s,n,r,e[t+8],20,1163531501),r=p(r,i,s,n,e[t+13],5,-1444681467),n=p(n,r,i,s,e[t+2],9,-51403784),s=p(s,n,r,i,e[t+7],14,1735328473),i=p(i,s,n,r,e[t+12],20,-1926607734),r=c(r,i,s,n,e[t+5],4,-378558),n=c(n,r,i,s,e[t+8],11,-2022574463),s=c(s,n,r,i,e[t+11],16,1839030562),i=c(i,s,n,r,e[t+14],23,-35309556),r=c(r,i,s,n,e[t+1],4,-1530992060),n=c(n,r,i,s,e[t+4],11,1272893353),s=c(s,n,r,i,e[t+7],16,-155497632),i=c(i,s,n,r,e[t+10],23,-1094730640),r=c(r,i,s,n,e[t+13],4,681279174),n=c(n,r,i,s,e[t],11,-358537222),s=c(s,n,r,i,e[t+3],16,-722521979),i=c(i,s,n,r,e[t+6],23,76029189),r=c(r,i,s,n,e[t+9],4,-640364487),n=c(n,r,i,s,e[t+12],11,-421815835),s=c(s,n,r,i,e[t+15],16,530742520),i=c(i,s,n,r,e[t+2],23,-995338651),r=h(r,i,s,n,e[t],6,-198630844),n=h(n,r,i,s,e[t+7],10,1126891415),s=h(s,n,r,i,e[t+14],15,-1416354905),i=h(i,s,n,r,e[t+5],21,-57434055),r=h(r,i,s,n,e[t+12],6,1700485571),n=h(n,r,i,s,e[t+3],10,-1894986606),s=h(s,n,r,i,e[t+10],15,-1051523),i=h(i,s,n,r,e[t+1],21,-2054922799),r=h(r,i,s,n,e[t+8],6,1873313359),n=h(n,r,i,s,e[t+15],10,-30611744),s=h(s,n,r,i,e[t+6],15,-1560198380),i=h(i,s,n,r,e[t+13],21,1309151649),r=h(r,i,s,n,e[t+4],6,-145523070),n=h(n,r,i,s,e[t+11],10,-1120210379),s=h(s,n,r,i,e[t+2],15,718787259),i=h(i,s,n,r,e[t+9],21,-343485551),r=o(r,a),i=o(i,l),s=o(s,d),n=o(n,y)}return[r,i,s,n]}function f(e,t=i.Hex){const r=t||i.Base64,n=y(a(e),e.length*s);switch(r){case i.Raw:return n;case i.Hex:return function(e){const t="0123456789abcdef",r=[];for(let i=0,s=4*e.length;i<s;i++)r.push(t.charAt(e[i>>2]>>i%4*8+4&15)+t.charAt(e[i>>2]>>i%4*8&15));return r.join("")}(n);case i.String:return l(n);case i.Base64:return function(e){const t=[];for(let r=0,i=4*e.length;r<i;r+=3){const i=(e[r>>2]>>r%4*8&255)<<16|(e[r+1>>2]>>(r+1)%4*8&255)<<8|e[r+2>>2]>>(r+2)%4*8&255;for(let s=0;s<4;s++)8*r+6*s>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>6*(3-s)&63))}return t.join("")}(n)}}},92071:(e,t,r)=>{r.d(t,{P:()=>w,L:()=>b});var i=r(90237),s=r(69622),n=r(76953),o=r(4718),a=r(35666);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new l,r=this._originStores[a.Gr.DEFAULTS];r&&r.forEach(((e,r)=>{t.set(r,(0,o.o8)(e),a.Gr.DEFAULTS)}));for(let r=a.Gr.SERVICE;r<a.AU;r++){const i=this._originStores[r];i&&i.forEach(((i,s)=>{e&&e.has(s)||t.set(s,(0,o.o8)(i),r)}))}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=a.Gr.USER){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const i=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),i!==t}return!1}delete(e,t=a.Gr.USER){const r=this._originStores[t];if(!r)return;const i=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],i=r?.get(e),s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),s!==i}originOf(e){return this._propertyOriginMap.get(e)||a.Gr.DEFAULTS}forEach(e){this._values.forEach(e)}}var d=r(45917),u=r(88620),p=r(40608);const c=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,u.oY)(this),r=t.store,i=new l;t.store=i,(0,n.k)(t,r,i)}read(e,t){(0,d.L)(this,e,t)}getAtOrigin(e,t){const r=h(this),i=(0,a.aB)(t);if("string"==typeof e)return r.get(e,i);const s={};return e.forEach((e=>{s[e]=r.get(e,i)})),s}originOf(e){return(0,a.OL)(this.originIdOf(e))}originIdOf(e){return h(this).originOf(e)}revert(e,t){const r=h(this),i=(0,a.aB)(t),s=(0,u.oY)(this);let n;n="string"==typeof e?"*"===e?r.keys(i):[e]:e,n.forEach((e=>{s.invalidate(e),r.revert(e,i),s.commit(e)}))}};return t=(0,i._)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function h(e){return(0,u.oY)(e).store}let y=class extends(c(s.A)){};y=(0,i._)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],y);var f=r(16649),m=r(49422);const g=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){return v(this).delete(e,(0,a.aB)(t))}write(e,t){return(0,m.M)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,u.oY)(this).setAtOrigin(e,t,(0,a.aB)(r))}removeOrigin(e){const t=v(this),r=(0,a.aB)(e),i=t.keys(r);for(const e of i)t.originOf(e)===r&&t.set(e,t.get(e,r),a.Gr.USER)}updateOrigin(e,t){const r=v(this),i=(0,a.aB)(t),s=(0,f.Jt)(this,e);for(let t=i+1;t<a.AU;++t)r.delete(e,t);r.set(e,s,i)}toJSON(e){return this.write({},e)}};return t=(0,i._)([(0,p.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function v(e){return(0,u.oY)(e).store}const w=e=>{let t=class extends(g(c(e))){constructor(...e){super(...e)}};return t=(0,i._)([(0,p.$)("esri.core.MultiOriginJSONSupport")],t),t};let b=class extends(w(s.A)){};b=(0,i._)([(0,p.$)("esri.core.MultiOriginJSONSupport")],b)},87024:(e,t,r)=>{r.d(t,{P:()=>h});var i=r(49186),s=r(80200),n=r(76553),o=r(84952),a=r(13069),l=r(96156),d=r(35666),u=r(10107),p=r(85648),c=r(97159);function h(e){const t=e?.origins??[void 0];return(r,i)=>{const s=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const i=(0,l.z4)(t,r);return{type:String,read:(e,t,r)=>{const s=(0,c.r)(e,t,r);return i.type===String?s:"function"==typeof i.type?new i.type({url:s}):void 0},write:{writer(t,s,a,l){if(!l?.resources)return"string"==typeof t?void(s[a]=(0,c.t)(t,l)):void(s[a]=t.write({},l));const u=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),h=(0,c.t)(u,{...l,verifyItemRelativeUrls:l?.verifyItemRelativeUrls?{writtenUrls:l.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},c.M.NO),g=i.type!==String&&(!(0,n.H)(this)||l?.origin&&this.originIdOf(r)>(0,d.aB)(l.origin)),v={object:this,propertyName:r,value:t,targetUrl:h,dest:s,targetPropertyName:a,context:l,params:e};l?.portalItem&&h&&!(0,o.oP)(h)?g&&e?.contentAddressed?y(v):g?function(e){const{context:t,targetUrl:r,params:i,value:s,dest:n,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),d=m(s,r,t),u=(0,p.n)(d),c=(0,o.Zo)(l.path),h=i?.compress??!1;u===c?(t.resources&&f({...e,resource:l,content:d,compress:h,updates:t.resources.toUpdate}),n[a]=r):y(e)}(v):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(v):l?.portalItem&&(null==h||null!=(0,c.i)(h)||(0,o.w8)(h)||g)?y(v):s[a]=h}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=c.b;return{read:e,write:t}}}}(e,r,i);for(const e of t){const t=(0,u.rM)(r,e,i);for(const e in s)t[e]=s[e]}}}function y(e){const{targetUrl:t,params:r,value:n,context:l,dest:d,targetPropertyName:u}=e;if(!l.portalItem)return;const h=(0,c.p)(t),y=m(n,t,l);if(r?.contentAddressed&&"json"!==y.type)return void l.messages?.push(new i.A("persistable:contentAddressingUnsupported",`Property "${u}" is trying to serializing a resource with content of type ${y.type} with content addressing. Content addressing is only supported for json resources.`,{content:y}));const g=r?.contentAddressed&&"json"===y.type?(0,s.d)(y.jsonString):h?.filename??(0,a.lk)(),v=(0,o.fj)(r?.prefix??h?.prefix,g),w=`${v}.${(0,p.n)(y)}`;if(r?.contentAddressed&&l.resources&&"json"===y.type){const e=l.resources.toKeep.find((({resource:e})=>e.path===w))??l.resources.toAdd.find((({resource:e})=>e.path===w));if(e)return void(d[u]=e.resource.itemRelativeUrl)}const b=l.portalItem.resourceFromPath(w);(0,o.w8)(t)&&l.resources&&l.resources.pendingOperations.push((0,o.tk)(t).then((e=>{b.path=`${v}.${(0,p.n)({type:"blob",blob:e})}`,d[u]=b.itemRelativeUrl})).catch((()=>{})));const _=r?.compress??!1;l.resources&&f({...e,resource:b,content:y,compress:_,updates:l.resources.toAdd}),d[u]=b.itemRelativeUrl}function f({object:e,propertyName:t,updates:r,resource:i,content:s,compress:n}){r.push({resource:i,content:s,compress:n,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function m(e,t,r){return"string"==typeof e?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(r))}}},54239:(e,t,r)=>{r.d(t,{A:()=>w});var i,s=r(90237),n=r(4576),o=r(66552),a=r(25482),l=r(83047),d=r(67076),u=r(10107),p=(r(44208),r(53966),r(36005)),c=r(40608),h=r(43937);const y=(0,o.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),f=y.jsonValues.slice();(0,n.Xy)(f,"orthometric");const m=(0,o.O)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let g=i=class extends a.oY{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return y.write(e,t,r)}readHeightModel(e,t,r){return y.read(e)||(r?.messages&&r.messages.push(function(e,t){return new d.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return m.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,l.LA)(e)||m.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=(0,l.k1)(t);return new i({heightModel:e.heightModel,heightUnit:r??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new i;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new d.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.MZ)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f,default:"ellipsoidal"}}}})],g.prototype,"heightModel",void 0),(0,s._)([(0,h.K)("web-scene","heightModel")],g.prototype,"writeHeightModel",null),(0,s._)([(0,p.w)(["web-scene","service"],"heightModel")],g.prototype,"readHeightModel",null),(0,s._)([(0,u.MZ)({type:m.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m.jsonValues,write:m.write}}}})],g.prototype,"heightUnit",void 0),(0,s._)([(0,p.w)("web-scene","heightUnit")],g.prototype,"readHeightUnit",null),(0,s._)([(0,p.w)("service","heightUnit")],g.prototype,"readHeightUnitService",null),(0,s._)([(0,u.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],g.prototype,"vertCRS",void 0),(0,s._)([(0,p.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],g.prototype,"readVertCRS",null),g=i=(0,s._)([(0,c.$)("esri.geometry.HeightModelInfo")],g);const w=g},4146:(e,t,r)=>{r.d(t,{A:()=>b});var i=r(90237),s=(r(59456),r(78888)),n=r(49186),o=r(65529),a=r(4902),l=r(92474),d=r(53966),u=r(74887),p=r(84952),c=r(10107),h=(r(44208),r(87811),r(40608)),y=r(92602),f=r(79677),m=r(5443),g=r(16930);let v=0,w=class extends(o.A.EventedMixin((0,a.sA)(l.A))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new m.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(7982).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await r.e(5613).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",s=r?.portal?.url||y.A.portalUrl;throw d.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,u.zf)(e)||d.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get effectiveVisible(){let e=this.visible;const t=this.parent;return e&&t&&"effectiveVisible"in t&&(e&&=t.effectiveVisible),e}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,p.An)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new n.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,c.MZ)({type:String})],w.prototype,"attributionDataUrl",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],w.prototype,"effectiveVisible",null),(0,i._)([(0,c.MZ)({type:m.A})],w.prototype,"fullExtent",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],w.prototype,"hasAttributionData",null),(0,i._)([(0,c.MZ)({type:String,clonable:!1})],w.prototype,"id",void 0),(0,i._)([(0,c.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"legendEnabled",void 0),(0,i._)([(0,c.MZ)({type:["show","hide","hide-children"]})],w.prototype,"listMode",void 0),(0,i._)([(0,c.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],w.prototype,"opacity",void 0),(0,i._)([(0,c.MZ)({clonable:!1})],w.prototype,"parent",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,i._)([(0,c.MZ)({type:Boolean,readOnly:!0})],w.prototype,"persistenceEnabled",void 0),(0,i._)([(0,c.MZ)({type:Boolean})],w.prototype,"popupEnabled",void 0),(0,i._)([(0,c.MZ)({type:Boolean})],w.prototype,"attributionVisible",void 0),(0,i._)([(0,c.MZ)({type:g.A})],w.prototype,"spatialReference",void 0),(0,i._)([(0,c.MZ)({type:String})],w.prototype,"title",void 0),(0,i._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),(0,i._)([(0,c.MZ)()],w.prototype,"url",void 0),(0,i._)([(0,c.MZ)({type:f.A})],w.prototype,"visibilityTimeExtent",void 0),(0,i._)([(0,c.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"visible",void 0),w=(0,i._)([(0,h.$)("esri.layers.Layer")],w);const b=w},13899:(e,t,r)=>{r.r(t),r.d(t,{default:()=>je});var i=r(90237),s=r(52106),n=r(13874),o=(r(86162),r(94409),r(65345),r(42980),r(20917),r(92438),r(96576),r(93618),r(65494),r(15036)),a=r(69540),l=r(5503),d=r(49186),u=r(53966),p=r(97768),c=r(92071),h=r(74887),y=r(36708),f=r(10107),m=(r(44208),r(87811),r(88620)),g=r(36005),v=r(40608),w=r(35666),b=r(40036),_=r(86738),I=r(4146),S=r(55726),A=r(52136),M=r(18768),F=r(69208),x=r(47685),L=r(16131),O=r(8303),E=r(25036),j=r(58947),T=r(82935),Z=r(25482),U=r(30524);function P({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,i=e?.serverGens,s=null!=r,n=null!=t,o=s&&n&&t.lastUpdate!==r.getTime();return s&&(o||!n&&i?.minServerGen!==i?.serverGen)}var R=r(96184),$=r(79677),N=r(10184);const D=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const e=this.associatedLayer?.timeInfo;if(null==e)return null;const t=e.clone();return(0,U.sv)(t,this.fieldsIndex),t}set timeInfo(e){(0,U.sv)(e,this.fieldsIndex),this._override("timeInfo",e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override("timeExtent",e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override("timeOffset",e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override("datesInUnknownTimezone",e)}async loadTimeInfoFromService(e){const{serviceTimeInfo:t}=this;if(null==t)return;const{startTimeField:r,endTimeField:i}=t;if(null==r&&null==i)return;if(P({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const s=async t=>{let i=null;try{const r=await(this.fetchStatistics?.(t,e));i=r?.stats}catch{}if(null==i)return null;const{minTimeStr:s,min:n,maxTimeStr:o,max:a}=i,l=t===r?s??n:o??a;return null!=l?new Date(l):null},[n,o]=await Promise.all([s(r),s(i)]);if(null!=r&&null==n||null!=i&&null==o)return;const a=new $.A({start:n,end:o});this.setAtOrigin("timeInfo",new R.A({endField:i,startField:r,fullTimeExtent:a}),"service")}};return(0,i._)([(0,f.MZ)({type:R.A,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),(0,i._)([(0,f.MZ)({type:$.A,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),(0,i._)([(0,f.MZ)({type:N.A,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),(0,i._)([(0,f.MZ)({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),(0,i._)([(0,f.MZ)({type:C,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=(0,i._)([(0,v.$)("esri.layers.mixins.TemporalSceneLayer")],t),t};let C=class extends Z.oY{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};(0,i._)([(0,f.MZ)({type:String})],C.prototype,"endTimeField",void 0),(0,i._)([(0,f.MZ)({type:String})],C.prototype,"startTimeField",void 0),C=(0,i._)([(0,v.$)("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],C);var k=r(60694),H=r(92009),V=r(4071),q=r(10873),G=r(15426),J=r(40530),B=r(67202),K=r(17036),Q=r(95466),W=r(50805),z=r(20557),Y=r(81457),X=r(39383),ee=r(37352),te=r(4513);let re=class extends Z.oY{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,i._)([(0,f.MZ)({type:String,json:{read:!0,write:!0}})],re.prototype,"name",void 0),(0,i._)([(0,f.MZ)({type:String,json:{read:!0,write:!0}})],re.prototype,"field",void 0),(0,i._)([(0,f.MZ)({type:[Number],json:{read:!0,write:!0}})],re.prototype,"currentRangeExtent",void 0),(0,i._)([(0,f.MZ)({type:[Number],json:{read:!0,write:!0}})],re.prototype,"fullRangeExtent",void 0),(0,i._)([(0,f.MZ)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],re.prototype,"type",void 0),re=(0,i._)([(0,v.$)("esri.layers.support.RangeInfo")],re);var ie,se=r(78888),ne=r(4718),oe=r(87024),ae=r(67076),le=r(39829),de=r(57251);let ue=ie=class extends((0,Z.Te)(l.A.ofType(le.A))){constructor(e){super(e)}clone(){return new ie(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((r=>{if(!t.equals(r.spatialReference)){if(!(0,de.canProjectWithoutEngine)(r.spatialReference,t))return e?.messages?.push(new ae.A("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const i=new le.A;(0,de.projectPolygon)(r,i,t),r=i}const i=r.toJSON(e);return delete i.spatialReference,i})).filter((e=>null!=e)):(e?.messages?.push(new ae.A("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const r=new ie;return e.forEach((e=>r.add(le.A.fromJSON(e,t)))),r}};ue=ie=(0,i._)([(0,v.$)("esri.layers.support.PolygonCollection")],ue);const pe=ue;var ce,he=r(97159);let ye=ce=class extends Z.oY{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new pe,this._geometriesSource=null}initialize(){this.addHandles((0,y.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),y.OH))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=pe.fromJSON(e,r):this._geometriesSource={url:(0,he.f)(e,r),context:r}}async loadGeometries(e,t){if(null==this._geometriesSource)return;const{url:r,context:i}=this._geometriesSource,s=await(0,se.A)(r,{responseType:"json",signal:t?.signal}),n=e.toJSON(),o=s.data.map((e=>({...e,spatialReference:n})));this.geometries=pe.fromJSON(o,i),this._geometriesSource=null}clone(){const e=new ce({geometries:(0,ne.o8)(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};(0,i._)([(0,f.MZ)({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],ye.prototype,"spatialRelationship",void 0),(0,i._)([(0,f.MZ)({type:pe,nonNullable:!0,json:{write:!0}}),(0,oe.P)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],ye.prototype,"geometries",void 0),(0,i._)([(0,g.w)(["web-scene","portal-item"],"geometries")],ye.prototype,"readGeometries",null),ye=ce=(0,i._)([(0,v.$)("esri.layers.support.SceneFilter")],ye);const fe=ye;var me=r(84952),ge=r(8947),ve=r(61956),we=r(24212),be=r(30291);async function _e(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(Ie(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function Ie(e){const{BlobReader:t,ZipReader:i,BlobWriter:s}=await Promise.all([r.e(8392),r.e(9588)]).then(r.bind(r,9588)),n=[],o=new i(new t(e));return(await o.getEntries()).forEach((e=>{if(e.directory||/^__MACOS/i.test(e.filename))return;const t=new s,r=e.getData?.(t).then((t=>new File([t],e.filename)));r&&n.push(r)})),Promise.all(n)}var Se=r(4654),Ae=r(45671),Me=r(78553);const Fe=new Set(["3DObject","Point"]),xe=(0,K.p)();let Le=class extends(D((0,x.w6)((0,j.w6)((0,M.b)((0,L.q)((0,O.A)((0,E.j)((0,c.P)((0,F.d)((0,A.p)((0,a.O)(I.A)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new l.A,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.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=(0,p.pR)(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}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 attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new Q.A(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:W.W4.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&&(0,G.C$)(this.associatedLayer)}get geometryType(){return Ee[this.profile]||"mesh"}set renderer(e){(0,U.yp)(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:V.P;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:n,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:a},data:{supportsZ:l,supportsM:d,isVersioned:u,supportsAttachment:p},operations:{supportsEditing:c,supportsAdd:h,supportsUpdate:y,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,w=e.operations.supportsChangeTracking,b=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:a,supportsRollbackOnFailure:s,supportsGeometryUpdate:b&&o,supportsUploadWithItemId:n},data:{supportsAttachment:p,supportsZ:l,supportsM:d,isVersioned:u},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:c&&w,supportsAdd:b&&h&&w,supportsDelete:b&&f&&w,supportsUpdate:y&&w,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&&Oe[r]?Oe[r]:(u.A.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=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(h.QP),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(0,ge.L)(this,{origin:"service"},t),(0,U.yp)(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){u.A.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 ve.A;return"mesh"===this.geometryType?this.associatedLayer?.infoFor3D&&(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;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d.A("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 d.A("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=(0,U.hL)(this.fieldsIndex,await(0,Ae.TO)(this,(0,Ae.D8)(this)));return(0,Se.s1)(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new d.A("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new s.A;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}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:(u.A.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,be.tn)(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 d.A("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 d.A("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(j.Xh.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(j.Xh.SAVE,e)}async applyEdits(e,t){const{applyEdits:i}=await r.e(6247).then(r.bind(r,78628));let s=t;await this.load();const n=this.associatedLayer;if(!n)throw new d.A(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:o}=n,a=!!n.infoFor3D,l=s?.globalIdUsed??!0;if(a&&null==o)throw new d.A(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!l)throw new d.A(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return(0,k.Wo)(n.url)&&a&&null!=e.deleteFeatures&&null!=o&&(s={...s,globalIdToObjectId:await(0,G.GA)(n,e.deleteFeatures,o)}),i(this,n.source,e,s)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new d.A(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw u.A.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new d.A("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce(((e,t)=>(0,z.oF)(this.infoFor3D,t)?e+1:e),0);0===s&&r(new S.VP),s>1&&r(new S.XQ);const n=this.spatialReference,o=t.location??new _.A({x:0,y:0,z:0,spatialReference:n}),a=o.spatialReference.isGeographic?"local":"georeferenced",l=b.A.createWithExternalSource(o,i,{vertexSpace:a}),[p]=await this.uploadAssets([l],{...t,useAssetOrigin:!t.location});return p}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await _e(e)).filter((e=>(0,z.fu)(t,e))):e}validateLayer(e){if(e.layerType&&!Fe.has(e.layerType))throw new d.A("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 d.A("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 d.A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(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 d.A("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new d.A("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new d.A("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._applyAssociatedLayerPopupOverrides(),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)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=(0,m.oY)(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),n=this.associatedLayer.originIdOf(i);s<n&&(n===w.Gr.SERVICE||n===w.Gr.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],n)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");null!=this.associatedLayer?.infoFor3D&&e&&(0,k.Wo)(this.associatedLayer?.url)&&P(this)&&(0,m.oY)(this).setAtOrigin("fullExtent",e.clone(),w.Gr.SERVICE)}_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(0,H.L)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await te.S.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(e){(0,h.zf)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await(0,y.C_)((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?u.A.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):u.A.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&(0,we.XF)(u.A.getLogger(this),(0,we.$7)("Mesh scene layers","relative-to-scene",e)),(0,we.XF)(u.A.getLogger(this),(0,we.tW)("Scene layers",e))}async fetchStatistics(e,t){return await async function({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:i,path:s,customParameters:n,apiKey:o,signal:a}){if(null==t)throw new d.A(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const l=i.get(e);if(null==l)throw new d.A(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const u=t.find((e=>e.name===l.name));if(null==u)throw new d.A(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const p=(0,me.fj)(s,u.href),{data:c}=await(0,se.A)(p,{query:{f:"json",...n,token:o},responseType:"json",signal:a});return c}({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};(0,i._)([(0,f.MZ)({types:{key:"type",base:J.c,typeMap:{selection:B.A}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Le.prototype,"featureReduction",void 0),(0,i._)([(0,f.MZ)({type:[re],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],Le.prototype,"rangeInfos",void 0),(0,i._)([(0,f.MZ)({json:{read:!1}})],Le.prototype,"associatedLayer",void 0),(0,i._)([(0,f.MZ)({type:["show","hide"]})],Le.prototype,"listMode",void 0),(0,i._)([(0,f.MZ)({type:["ArcGISSceneServiceLayer"]})],Le.prototype,"operationalLayerType",void 0),(0,i._)([(0,f.MZ)({json:{read:!1},readOnly:!0})],Le.prototype,"type",void 0),(0,i._)([(0,f.MZ)({...xe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"fields",void 0),(0,i._)([(0,f.MZ)()],Le.prototype,"types",null),(0,i._)([(0,f.MZ)()],Le.prototype,"typeIdField",null),(0,i._)([(0,f.MZ)()],Le.prototype,"templates",null),(0,i._)([(0,f.MZ)()],Le.prototype,"formTemplate",null),(0,i._)([(0,f.MZ)()],Le.prototype,"attributeTableTemplate",null),(0,i._)([(0,f.MZ)({readOnly:!0,clonable:!1})],Le.prototype,"fieldsIndex",null),(0,i._)([(0,f.MZ)({type:ee.A,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Le.prototype,"floorInfo",void 0),(0,i._)([(0,f.MZ)(xe.outFields)],Le.prototype,"outFields",void 0),(0,i._)([(0,f.MZ)({type:W.W4,readOnly:!0,json:{read:!1}})],Le.prototype,"nodePages",void 0),(0,i._)([(0,g.w)("service","nodePages",["nodePages","pointNodePages"])],Le.prototype,"readNodePages",null),(0,i._)([(0,f.MZ)({type:[W.uV],readOnly:!0})],Le.prototype,"materialDefinitions",void 0),(0,i._)([(0,f.MZ)({type:[W.Ot],readOnly:!0})],Le.prototype,"textureSetDefinitions",void 0),(0,i._)([(0,f.MZ)({type:[W.L0],readOnly:!0})],Le.prototype,"geometryDefinitions",void 0),(0,i._)([(0,f.MZ)({readOnly:!0})],Le.prototype,"serviceUpdateTimeStamp",void 0),(0,i._)([(0,f.MZ)({readOnly:!0})],Le.prototype,"attributeStorageInfo",void 0),(0,i._)([(0,f.MZ)({readOnly:!0})],Le.prototype,"statisticsInfo",void 0),(0,i._)([(0,f.MZ)({type:l.A.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Le.prototype,"excludeObjectIds",void 0),(0,i._)([(0,f.MZ)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Le.prototype,"definitionExpression",void 0),(0,i._)([(0,f.MZ)({type:fe,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Le.prototype,"filter",void 0),(0,i._)([(0,f.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Le.prototype,"path",void 0),(0,i._)([(0,f.MZ)(q.Yj)],Le.prototype,"elevationInfo",null),(0,i._)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Le.prototype,"effectiveCapabilities",null),(0,i._)([(0,f.MZ)({readOnly:!0})],Le.prototype,"effectiveEditingEnabled",null),(0,i._)([(0,f.MZ)({type:String})],Le.prototype,"geometryType",null),(0,i._)([(0,f.MZ)(q.kF)],Le.prototype,"labelsVisible",void 0),(0,i._)([(0,f.MZ)({type:[Y.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:X.w},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:X.w},write:!0}})],Le.prototype,"labelingInfo",void 0),(0,i._)([(0,f.MZ)(q.fV)],Le.prototype,"legendEnabled",void 0),(0,i._)([(0,f.MZ)({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?(0,Me.D)(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Le.prototype,"opacity",void 0),(0,i._)([(0,f.MZ)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"priority",void 0),(0,i._)([(0,f.MZ)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"semantic",void 0),(0,i._)([(0,f.MZ)({types:o.X,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Le.prototype,"renderer",null),(0,i._)([(0,f.MZ)({json:{read:!1}})],Le.prototype,"cachedDrawingInfo",void 0),(0,i._)([(0,g.w)("service","cachedDrawingInfo")],Le.prototype,"readCachedDrawingInfo",null),(0,i._)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Le.prototype,"capabilities",null),(0,i._)([(0,f.MZ)({type:Boolean,json:{read:!1}})],Le.prototype,"editingEnabled",null),(0,i._)([(0,f.MZ)({readOnly:!0,json:{write:!1,read:!1}})],Le.prototype,"infoFor3D",null),(0,i._)([(0,f.MZ)({readOnly:!0,json:{write:!1,read:!1}})],Le.prototype,"relationships",null),(0,i._)([(0,f.MZ)(q.M6)],Le.prototype,"popupEnabled",void 0),(0,i._)([(0,f.MZ)({type:n.A,json:{name:"popupInfo",write:!0}})],Le.prototype,"popupTemplate",void 0),(0,i._)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Le.prototype,"defaultPopupTemplate",null),(0,i._)([(0,f.MZ)({type:String,json:{read:!1}})],Le.prototype,"objectIdField",void 0),(0,i._)([(0,g.w)("service","objectIdField",["objectIdField","fields"])],Le.prototype,"readObjectIdField",null),(0,i._)([(0,f.MZ)({type:String,json:{read:!1}})],Le.prototype,"globalIdField",void 0),(0,i._)([(0,g.w)("service","globalIdField",["globalIdField","fields"])],Le.prototype,"readGlobalIdField",null),(0,i._)([(0,f.MZ)({readOnly:!0,type:String,json:{read:!1}})],Le.prototype,"displayField",null),(0,i._)([(0,f.MZ)({type:String,json:{read:!1}})],Le.prototype,"profile",void 0),(0,i._)([(0,g.w)("service","profile",["store.profile"])],Le.prototype,"readProfile",null),(0,i._)([(0,f.MZ)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Le.prototype,"normalReferenceFrame",void 0),(0,i._)([(0,f.MZ)(q.PY)],Le.prototype,"screenSizePerspectiveEnabled",void 0),(0,i._)([(0,f.MZ)({json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"serviceItemId",void 0),(0,i._)([(0,f.MZ)(T.B)],Le.prototype,"useViewTime",null),Le=(0,i._)([(0,v.$)("esri.layers.SceneLayer")],Le);const Oe={"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"},Ee={"mesh-pyramids":"mesh",points:"point"},je=Le},55726:(e,t,r)=>{r.d(t,{$1:()=>d,H2:()=>h,MT:()=>y,VP:()=>f,WF:()=>u,Wt:()=>o,XQ:()=>m,hK:()=>c,nS:()=>p,uh:()=>a,xY:()=>l});var i=r(49186);const s="upload-assets",n=()=>new Error;class o extends i.A{constructor(){super(`${s}:unsupported`,"Layer does not support asset uploads.",n())}}class a extends i.A{constructor(){super(`${s}:no-glb-support`,"Layer does not support glb.",n())}}class l extends i.A{constructor(){super(`${s}:no-supported-source`,"No supported external source found",n())}}class d extends i.A{constructor(){super(`${s}:not-base-64`,"Expected gltf data in base64 format after conversion.",n())}}class u extends i.A{constructor(){super(`${s}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",n())}}class p extends i.A{constructor(e,t){super(`${s}:bad-response`,`Bad response. Uploaded ${e} items and received ${t} results.`,n())}}class c extends i.A{constructor(e,t){super(`${s}-layer:upload-failed`,`Failed to upload mesh file ${e}. Error code: ${t?.code??"-1"}. Error message: ${t?.messages??"unknown"}`,n())}}class h extends i.A{constructor(e){super(`${s}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${e}, but it does not list it in its supported formats.`,n())}}class y extends i.A{constructor(){super(`${s}:convert3D-failed`,"convert3D failed.")}}class f extends i.A{constructor(){super("invalid-input:no-model","No supported model found")}}class m extends i.A{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}},52136:(e,t,r)=>{r.d(t,{p:()=>o});var i=r(90237),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.MZ)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,n.$)("esri.layers.mixins.APIKeyMixin")],t),t}},18768:(e,t,r)=>{r.d(t,{b:()=>l});var i=r(90237),s=r(53966),n=r(10107),o=(r(44208),r(87811),r(40608)),a=r(60694);const l=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,a.qg)(this.url);if(null!=e&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,a.Jf)(e,s.A.getLogger(this)))}};return(0,i._)([(0,n.MZ)()],t.prototype,"title",null),(0,i._)([(0,n.MZ)({type:String})],t.prototype,"url",null),t=(0,i._)([(0,o.$)("esri.layers.mixins.ArcGISService")],t),t}},69208:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(90237),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,i._)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,i._)([(0,n.$)("esri.layers.mixins.CustomParametersMixin")],t),t}},47685:(e,t,r)=>{r.d(t,{Mk:()=>h,Zk:()=>p,w6:()=>m});var i=r(90237),s=r(65529),n=r(4718),o=r(74887),a=r(10107),l=(r(44208),r(53966),r(40608)),d=r(20816);const u=new s.A.EventEmitter;function p(e,t,r=null,i=!1){const s=(0,o.Tw)();return i=null==t||i,u.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:r,mayReceiveServiceEdits:i,result:s.promise}),s}const c=Symbol();function h(e){return null!=e&&"object"==typeof e&&c in e}function y(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function f(e,t,r){const i=new URL(e).host,s=d.Z3.get(i),n=e=>!e||e===s;return n(t)&&n(r)||t===r}const m=e=>{var t;let r=class extends e{constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:r,gdbVersion:i,mayReceiveServiceEdits:s,result:o}=e,a=t===this.url,l=null!=r&&null!=this.layerId&&r===this.layerId,d=y(this),u=y(this)&&f(t,i,this.gdbVersion);if(!a||d&&!u||!l&&!s)return;const p=o.then((e=>{if(this.lastEditsEventDate=new Date,l&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,n.o8)(e)),e;const r=e.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(r){const{adds:t,updates:i,deletes:s}=r.editedFeatures,o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],deletedFeatures:s?s.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],updatedFeatures:i?i.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],editedFeatures:(0,n.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.o8)(e.historicMoment)};return this.emit("edits",o),o}const s={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,n.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,s.historicMoment)&&this.emit("edits",s),s})).then((e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,i,e.historicMoment)&&(this.historicMoment=e.historicMoment),e)));this.emit("apply-edits",{result:p})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:r,moment:i}=e,s=t===this.url,n=y(this),o=y(this)&&f(t,r,this.gdbVersion),a=y(this)&&!f(t,this.gdbVersion,null);s&&n&&o&&a&&"historicMoment"in this&&this.historicMoment!==i&&(this.historicMoment=i)},this.when().then((()=>{this.addHandles(function(e){return u.on("apply-edits",new WeakRef(e))}(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(function(e){return u.on("update-moment",new WeakRef(e))}(this._updateMomentHandler))}),(()=>{}))}_shouldUpdateHistoricMoment(e,t,r){return"historicMoment"in this&&this.historicMoment!==r&&(0,d.w5)(e,t)}};return t=c,(0,i._)([(0,a.MZ)()],r.prototype,"lastEditsEventDate",void 0),r=(0,i._)([(0,l.$)("esri.layers.mixins.EditBusLayer")],r),r}},8303:(e,t,r)=>{r.d(t,{A:()=>I});var i=r(90237),s=r(92602),n=r(70333),o=r(78888),a=r(60999),l=r(49186),d=r(53966),u=r(97768),p=r(74887),c=r(84952),h=r(10107),y=(r(44208),r(87811),r(36005)),f=r(40608),m=r(43937),g=r(83531),v=r(20655),w=r(80812),b=r(41318),_=r(10407);const I=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new w.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await Promise.all([r.e(5356),r.e(1204)]).then(r.bind(r,41204));return(0,p.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,p.zf)(e)||d.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.QP)(e),!0))))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=e===r.id;if(i&&r.portal.user)return(0,_.It)(r);let s,o;if(i)s=r.portal.url;else try{s=await(0,g.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!s||!(0,c.b8)(s,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(n.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,l=!1,d=!1;if(!o)return{features:{edit:a,fullEdit:l},content:{updateItem:d}};try{if(i?await r.reload():(r=new w.default({id:e,portal:{url:s}}),await r.load(t)),r.portal.user)return(0,_.It)(r)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:l},content:{updateItem:d}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const r=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=n.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=v.A.getDefault();if(s&&s.loaded&&(0,c.S8)(s.restUrl)===(0,c.S8)(i))return s.user;const l=`${i}/community/self`,d=null!=e?e.signal:null,u=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return u.ok?b.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&i&&!(0,c.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i._)([(0,h.MZ)({type:w.default})],t.prototype,"portalItem",null),(0,i._)([(0,y.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,m.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,h.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,h.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,i._)([(0,f.$)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},25036:(e,t,r)=>{r.d(t,{j:()=>o});var i=r(90237),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===e.minScale&&r.maxScale===e.maxScale?r:e}};return(0,i._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),(0,i._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),(0,i._)([(0,s.MZ)({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=(0,i._)([(0,n.$)("esri.layers.mixins.ScaleRangeLayer")],t),t}},82935:(e,t,r)=>{r.d(t,{B:()=>h,e:()=>y});var i=r(90237),s=r(10107),n=(r(44208),r(53966),r(87811),r(36005)),o=r(40608),a=r(89317),l=r(30524),d=r(96184),u=r(73133),p=r(79677),c=r(10184);const h={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:a.K}}},y=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(e,t){const r=t.timeInfo.exportOptions;if(!r)return null;const i=r.timeOffset,s=u.j.fromJSON(r.timeOffsetUnits);return i&&s?new c.A({value:i,unit:s}):null}set timeInfo(e){(0,l.sv)(e,this.fieldsIndex),this._set("timeInfo",e)}};return(0,i._)([(0,s.MZ)({type:p.A,json:{write:!1}})],t.prototype,"timeExtent",void 0),(0,i._)([(0,s.MZ)({type:c.A})],t.prototype,"timeOffset",void 0),(0,i._)([(0,n.w)("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),(0,i._)([(0,s.MZ)({value:null,type:d.A,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),(0,i._)([(0,s.MZ)(h)],t.prototype,"useViewTime",void 0),t=(0,i._)([(0,o.$)("esri.layers.mixins.TemporalLayer")],t),t}},40530:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(90237),s=r(25482),n=r(10107),o=(r(44208),r(53966),r(87811),r(40608));let a=class extends s.oY{constructor(){super(...arguments),this.type=null}};(0,i._)([(0,n.MZ)({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,i._)([(0,o.$)("esri.layers.support.FeatureReduction")],a)},67202:(e,t,r)=>{r.d(t,{A:()=>d});var i,s=r(90237),n=r(10107),o=(r(44208),r(53966),r(87811),r(40608)),a=r(40530);let l=i=class extends a.c{constructor(e){super(e),this.type="selection"}clone(){return new i}};(0,s._)([(0,n.MZ)({type:["selection"]})],l.prototype,"type",void 0),l=i=(0,s._)([(0,o.$)("esri.layers.support.FeatureReductionSelection")],l);const d=l},37352:(e,t,r)=>{r.d(t,{A:()=>u});var i,s=r(90237),n=r(5503),o=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608));let d=i=class extends o.oY{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new n.A}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"floorField",void 0),(0,s._)([(0,a.MZ)({json:{read:!1,write:!1}})],d.prototype,"viewAllMode",void 0),(0,s._)([(0,a.MZ)({json:{read:!1,write:!1}})],d.prototype,"viewAllLevelIds",void 0),d=i=(0,s._)([(0,l.$)("esri.layers.support.LayerFloorInfo")],d);const u=d},96184:(e,t,r)=>{r.d(t,{A:()=>f});var i=r(90237),s=r(69540),n=r(25482),o=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),l=r(40608),d=r(43937),u=r(79677),p=r(10184),c=r(56400);function h(e,t){return p.A.fromJSON({value:e,unit:t})}let y=class extends((0,s.O)(n.oY)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?u.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?h(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?h(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,i._)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],y.prototype,"cumulative",void 0),(0,i._)([(0,o.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],y.prototype,"endField",void 0),(0,i._)([(0,o.MZ)({type:u.A,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"fullTimeExtent",void 0),(0,i._)([(0,a.w)("fullTimeExtent",["timeExtent"])],y.prototype,"readFullTimeExtent",null),(0,i._)([(0,d.K)("fullTimeExtent")],y.prototype,"writeFullTimeExtent",null),(0,i._)([(0,o.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"hasLiveData",void 0),(0,i._)([(0,o.MZ)({type:p.A,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"interval",void 0),(0,i._)([(0,a.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],y.prototype,"readInterval",null),(0,i._)([(0,d.K)("interval")],y.prototype,"writeInterval",null),(0,i._)([(0,o.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],y.prototype,"startField",void 0),(0,i._)([(0,o.MZ)((0,c.P6)("timeReference",!0))],y.prototype,"timeZone",void 0),(0,i._)([(0,o.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],y.prototype,"trackIdField",void 0),(0,i._)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],y.prototype,"useTime",void 0),(0,i._)([(0,o.MZ)({type:[Date],json:{read:!1}})],y.prototype,"stops",void 0),y=(0,i._)([(0,l.$)("esri.layers.support.TimeInfo")],y);const f=y},17036:(e,t,r)=>{r.d(t,{p:()=>l});var i=r(44208),s=r(53966),n=r(20437),o=r(95466),a=r(30524);function l(){return{fields:{type:[n.A],value:null,set:function(e){if(e&&(0,i.A)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");s.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||s.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.DB)(this.fieldsIndex,e)}}}}},20557:(e,t,r)=>{r.d(t,{CW:()=>h,Fm:()=>l,JQ:()=>c,JZ:()=>b,ND:()=>f,R_:()=>o,U9:()=>p,fu:()=>s,nr:()=>y,oF:()=>n,rq:()=>d,z$:()=>u});const i=[["binary","application/octet-stream","bin",""]];function s(e,t){return null!=g(t.name,e?.supportedFormats??[])}function n(e,t){if(!e)return!1;const r=d(t,e.supportedFormats??[]);return null!=r&&e.editFormats.includes(r)}function o(e,t){return v(function(e,t){const r=e.toLowerCase();return m(t).find((e=>w(e)===r))}(e,t))}function a(e,t){return v(g(e,t))}function l(e,t){return w(function(e,t){return m(t).find((t=>v(t)===e))}(e,t))}function d(e,t){return a(e.name,t)??o(e.type,t)}function u(e,t,r){return o(e,r)??a(t,r)}function p({supportedFormats:e}){return u("model/gltf-binary","glb",e)}function c(e){const t=p(e);return null!=t&&e.editFormats.includes(t)}function h({supportedFormats:e}){return u("model/gltf+json","gltf",e)}function y({supportedFormats:e}){return u("application/esri3do-SR_world","wld",e)}function f({supportedFormats:e}){return u("application/esri3do-SR_prj","prj",e)}function m(e){return[...i,...e]}function g(e,t){const r=e.toLowerCase();return m(t).find((e=>function(e){return e?.[2].split(",").map((e=>e.toLowerCase()))??[]}(e).some((e=>r.endsWith(e)))))}function v(e){return e?.[0]}function w(e){return e?.[1].toLowerCase()}function b(e){return e.tables?.find((e=>"assetMaps"===e.role))}},85648:(e,t,r)=>{r.d(t,{n:()=>s});var i=r(84952);function s(e){return n[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Zo)(e);return l[t]||o}(e.url)}(e)]||a}const n={},o="text/plain",a=n[o],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)n[l[e]]=e},73133:(e,t,r)=>{r.d(t,{j:()=>i});const i=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},8947:(e,t,r)=>{r.d(t,{L:()=>o});var i=r(60999),s=r(74887),n=r(67076);async function o(e,t,r){const o=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(o&&"unique-value"===o.type&&o.styleOrigin){const a=await(0,i.Ke)(o.populateFromStyle());if((0,s.Te)(r),!1===a.ok){const r=a.error;t?.messages&&t.messages.push(new n.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:t})),e.clear("renderer",t?.origin)}}}},10184:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(90237),s=r(69540),n=r(25482),o=r(88930),a=r(10107),l=(r(44208),r(53966),r(87811),r(93223)),d=r(40608),u=r(73133);let p=class extends((0,s.O)(n.oY)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,i._)([(0,l.e)(u.j,{nonNullable:!0})],p.prototype,"unit",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],p.prototype,"value",void 0),p=(0,i._)([(0,d.$)("esri.time.TimeInterval")],p);const c=p},20816:(e,t,r)=>{r.d(t,{TA:()=>s,We:()=>a,Z3:()=>n,ZJ:()=>l,w5:()=>d});var i=r(78888);const s=(0,r(13069).vD)(),n=new Map,o=new Map;async function a(e,t,r){if(!e||!r)return!1;if(!t)return!0;const s=new URL(e).host;let o=n.get(s);if(!o){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");o=(await(0,i.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return o===t}async function l(e,t,i=!1){if(!e||!t)return!0;const n=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=o.get(n)?.entries();if(a)for(const[e,o]of a)if(o.name===t){const t=!o.stack?.hasForwardEdits();if(!t&&i){const[{deleteForwardEdits:t},{default:i}]=await Promise.all([r.e(2186).then(r.bind(r,32186)),r.e(2558).then(r.bind(r,32558))]),a=await t(n,e,new i({sessionId:s,moment:o.moment}));return a.success&&o.stack?.clearForwardEdits(),a.success}return t}return!0}function d(e,t){if(!e)return!1;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=o.get(r)?.entries();if(i)for(const[e,r]of i)if(r.name===t)return"edit"===r.lockType;return!1}new Map}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4932],{39357:(t,e,n)=>{n.d(e,{H:()=>l});var s,r=n(90237),o=n(25482),i=n(10107),a=(n(44208),n(53966),n(87811),n(40608));let l=s=class extends o.oY{constructor(t){super(t),this.name=null,this.code=null}clone(){return new s({name:this.name,code:this.code})}};(0,r._)([(0,i.MZ)({type:String,json:{write:!0}})],l.prototype,"name",void 0),(0,r._)([(0,i.MZ)({type:[String,Number],json:{write:!0}})],l.prototype,"code",void 0),l=s=(0,r._)([(0,a.$)("esri.layers.support.CodedValue")],l)},53177:(t,e,n)=>{n.d(e,{A:()=>h});var s,r=n(90237),o=n(4718),i=n(10107),a=(n(44208),n(53966),n(93223)),l=n(40608),u=n(39357),c=n(76357);let p=s=class extends c.A{constructor(t){super(t),this.codedValues=null,this.type="coded-value"}getName(t){let e=null;if(this.codedValues){const n=String(t);this.codedValues.some((t=>(String(t.code)===n&&(e=t.name),!!e)))}return e}clone(){return new s({codedValues:(0,o.o8)(this.codedValues),name:this.name})}};(0,r._)([(0,i.MZ)({type:[u.H],json:{write:!0}})],p.prototype,"codedValues",void 0),(0,r._)([(0,a.e)({codedValue:"coded-value"})],p.prototype,"type",void 0),p=s=(0,r._)([(0,l.$)("esri.layers.support.CodedValueDomain")],p);const h=p},76357:(t,e,n)=>{n.d(e,{A:()=>p});var s=n(90237),r=n(66552),o=n(25482),i=n(10107),a=(n(44208),n(53966),n(87811),n(93223)),l=n(40608);const u=new r.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends o.oY{constructor(t){super(t),this.name=null,this.type=null}};(0,s._)([(0,i.MZ)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,s._)([(0,a.e)(u)],c.prototype,"type",void 0),c=(0,s._)([(0,l.$)("esri.layers.support.Domain")],c);const p=c},20437:(t,e,n)=>{n.d(e,{A:()=>g});var s,r=n(90237),o=n(66552),i=n(25482),a=n(10107),l=n(56507),u=(n(87811),n(44208),n(93223)),c=n(36005),p=n(40608),h=n(80451),m=n(98453);const f=new o.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let d=s=class extends i.oY{constructor(t){super(t),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(t,{description:e}){let n=null;try{n=e?JSON.parse(e):null}catch(t){}return n?.value??null}readValueType(t,{description:e}){let n=null;try{n=e?JSON.parse(e):null}catch(t){}return n?f.fromJSON(n.fieldValueType):null}clone(){return new s({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,r._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"alias",void 0),(0,r._)([(0,a.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],d.prototype,"defaultValue",void 0),(0,r._)([(0,a.MZ)()],d.prototype,"description",void 0),(0,r._)([(0,c.w)("description")],d.prototype,"readDescription",null),(0,r._)([(0,a.MZ)({types:h.gK,json:{read:{reader:h.rS},write:!0}})],d.prototype,"domain",void 0),(0,r._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],d.prototype,"editable",void 0),(0,r._)([(0,a.MZ)({type:l.jz,json:{write:{overridePolicy:t=>({enabled:Number.isFinite(t)})}}})],d.prototype,"length",void 0),(0,r._)([(0,a.MZ)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,r._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],d.prototype,"nullable",void 0),(0,r._)([(0,u.e)(m.m)],d.prototype,"type",void 0),(0,r._)([(0,a.MZ)()],d.prototype,"valueType",void 0),(0,r._)([(0,c.w)("valueType",["description"])],d.prototype,"readValueType",null),(0,r._)([(0,a.MZ)({type:Boolean,json:{read:!1}})],d.prototype,"visible",void 0),d=s=(0,r._)([(0,p.$)("esri.layers.support.Field")],d);const g=d},80451:(t,e,n)=>{n.d(e,{rS:()=>g,gK:()=>d}),n(44208);var s,r=n(53177),o=n(76357),i=n(90237),a=(n(53966),n(87811),n(49186),n(93223)),l=n(40608);let u=s=class extends o.A{constructor(t){super(t),this.type="inherited"}clone(){return new s}};(0,i._)([(0,a.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=s=(0,i._)([(0,l.$)("esri.layers.support.InheritedDomain")],u);const c=u;var p,h=n(10107);let m=p=class extends o.A{constructor(t){super(t),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new p({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,i._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(t,e)=>e.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(t,e,n){e[n]=[this.minValue||0,t]}}}})],m.prototype,"maxValue",void 0),(0,i._)([(0,h.MZ)({json:{type:[Number],read:{source:"range",reader:(t,e)=>e.range?.[0]},write:{target:"range",writer(t,e,n){e[n]=[t,this.maxValue||0]}}}})],m.prototype,"minValue",void 0),(0,i._)([(0,a.e)({range:"range"})],m.prototype,"type",void 0),m=p=(0,i._)([(0,l.$)("esri.layers.support.RangeDomain")],m);const f=m,d={key:"type",base:o.A,typeMap:{range:f,"coded-value":r.A,inherited:c}};function g(t){if(!t?.type)return null;switch(t.type){case"range":return f.fromJSON(t);case"codedValue":return r.A.fromJSON(t);case"inherited":return c.fromJSON(t)}return null}},98453:(t,e,n)=>{n.d(e,{m:()=>s});const s=new(n(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},77359:(t,e,n)=>{n.d(e,{$Q:()=>a,Sd:()=>l,b7:()=>u});var s=n(83047),r=n(5443),o=n(86738),i=n(14140);async function a(t,e,s){if("extent"===s.type)return function(t,e,n){const{width:s,height:r}=t,o=new Uint8Array(s*r),a=e.width/s,l=e.height/r;if(n.width/a<.5||n.height/l<.5)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});const{xmin:u,xmax:c,ymin:p,ymax:h}=e,{xmin:m,xmax:f,ymin:d,ymax:g}=n,y=Math.max(u,m),x=Math.min(c,f),w=Math.max(p,d),v=Math.min(h,g),A=.5*a,_=.5*l;if(x-y<A||v-w<_||x<u+A||y>c-A||w>h-_||v<p+_)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});const b=Math.max(0,(y-u)/a),M=Math.min(s,Math.max(0,(x-u)/a)),T=Math.max(0,(h-v)/l),P=Math.min(r,Math.max(0,(h-w)/l)),N=Math.round(b),R=Math.round(M)-1,F=Math.round(T),C=Math.round(P)-1;if(N===R&&b%1>.5&&M%1<.5||F===C&&T%1>.5&&P%1<.5)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});if(0===N&&0===F&&R===s&&C===r)return t;const k=t.mask;for(let t=F;t<=C;t++)for(let e=N;e<=R;e++){const n=t*s+e;o[n]=k?k[n]:255}return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]})}(t,e,s);const{width:r,height:o}=t,a=new Uint8Array(r*o),{contains:l,intersects:u}=await Promise.all([n.e(9930),n.e(3209)]).then(n.bind(n,33209));return u(e,s)?"polyline"===s.type?function(t,e,n){const{width:s,height:r}=t,o=new Uint8Array(s*r),a=e.width/s,l=e.height/r,{xmin:u,ymax:c}=e,{paths:p}=n,h=t.mask;for(let t=0;t<p.length;t++){const e=p[t];for(let t=0;t<e.length-1;t++){const[n,i]=e[t],[p,m]=e[t+1];let f=Math.floor((c-i)/l),d=Math.floor((c-m)/l);if(d<f){const t=f;f=d,d=t}f=Math.max(0,f),d=Math.min(r-1,d);const g=(p-n)/(m-i);for(let t=f;t<=d;t++){const e=t===f?Math.max(i,m):(r+1-t)*l,c=t===d?Math.min(i,m):e-l;let y=m===i?Math.floor((n-u)/a):Math.floor((g*(e-i)+n-u)/a),x=m===i?Math.floor((p-u)/a):Math.floor((g*(c-i)+n-u)/a);if(x<y){const t=y;y=x,x=t}const w=t*s;y=Math.max(0,y),x=Math.min(s-1,x);for(let t=w+y;t<=w+x;t++)o[t]=h?h[t]:255}}}return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]})}(t,e,s):l(s,e)?t:function(t,e,n){if(!t)return t;const{width:s,height:r}=t,o=e.width/s,a=e.height/r,{xmin:l,ymax:u}=e;let c;if("extent"===n.type){const t=(n.xmin-l)/o,e=(n.xmax-l)/o,s=(u-n.ymax)/a,r=(u-n.ymin)/a;c=[[[t,s],[t,r],[e,r],[e,s],[t,s]]]}else c=n.rings.map((t=>t.map((([t,e])=>[(t-l)/o,(u-e)/a]))));const p=document.createElement("canvas");p.width=s,p.height=r;const h=p.getContext("2d");h.fillStyle="#f00",h.beginPath(),c.forEach((t=>{h.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)h.lineTo(t[e][0],t[e][1]);h.closePath()})),h.fill();const m=h.getImageData(0,0,s,r).data,f=t.mask,d=s*r,g=new Uint8Array(d);for(let t=0;t<d;t++)f&&!f[t]||(g[t]=m[4*t+3]>127?255:0);return new i.A({pixelType:t.pixelType,width:s,height:r,mask:g,maskIsAlpha:!1,pixels:[...t.pixels]})}(t,e,s):new i.A({pixelType:t.pixelType,width:r,height:o,mask:a,maskIsAlpha:!1,pixels:[...t.pixels]})}function l(t,e){const{extent:n}=u(t,e,new o.A({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:s}=t.extent;if(n.xmax=Math.min(n.xmax,s.xmax),n.ymax=Math.min(n.ymax,s.ymax),n.xmin<n.xmax&&n.ymin<n.ymax){const{x:e,y:s}=t.pixelSize,r=Math.round(n.width/e),o=Math.round(n.height/s);t.extent=n,t.width=r,t.height=o}}function u(t,e,n,o=!0){const{spatialReference:i}=t,{x:a,y:l}=function(t,e){if(t.spatialReference.equals(e))return t;const n=(0,s.GA)(t.spatialReference),r=(0,s.GA)(e);if(n===r)return t;const o=n/r;return{x:t.x*o,y:t.y*o}}(n,i);let u,c,p;const h="extent"===e.type?e:e.extent;let{xmin:m,xmax:f,ymax:d,ymin:g}=h;const{xmin:y,ymax:x}=t.extent;return o?(m=y+(m>y?a*Math.round((m-y)/a):0),d=x-(d<x?l*Math.round((x-d)/l):0),f=y+(f>y?a*Math.round((f-y)/a):0),g=x-(g<x?l*Math.round((x-g)/l):0),u=new r.A({xmin:m,ymax:d,xmax:f,ymin:g,spatialReference:i}),c=Math.round(u.width/a),p=Math.round(u.height/l)):(c=Math.floor((f-m)/a+.8),p=Math.floor((d-g)/l+.8),m=y+(m>y?a*Math.floor((m-y)/a+.1):0),d=x-(d<x?l*Math.floor((x-d)/l+.1):0),f=m+c*a,g=d-p*l,u=new r.A({xmin:m,ymax:d,xmax:f,ymin:g,spatialReference:i})),{extent:u,width:c,height:p}}},6049:(t,e,n)=>{n.d(e,{vt:()=>Os,UD:()=>zs});var s=n(85334),r=n(49186),o=n(4718),i=n(90237),a=n(10107),l=(n(44208),n(53966),n(87811),n(40608)),u=n(16019),c=n(25482);let p=class extends c.oY{constructor(){super(...arguments),this.raster=void 0}};(0,i._)([(0,a.MZ)({json:{write:!0}})],p.prototype,"raster",void 0),p=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.BaseFunctionArguments")],p);const h=p;var m;let f=m=class extends h{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new m({raster:this.raster,raster2:this.raster2,operation:this.operation})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],f.prototype,"operation",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],f.prototype,"raster2",void 0),(0,i._)([(0,a.MZ)({readOnly:!0})],f.prototype,"rasters",null),f=m=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],f);const d=f;var g=n(79901),y=n(14140),x=n(87186);const w=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let v=class extends c.oY{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const t=[];for(let e=0;e<s.length;e++){const{parameters:n}=s[e],r=n.rasters||n.raster&&[n.raster];r?.length&&t.push(...r)}s=t}for(let t=e.length-1;t>=0;t--)e[t].isNoopProcess&&e.splice(t,1);let r=!1;for(let t=0;t<e.length;t++){const n=e[t];n.id=e.length-t-1;const{rasters:s}=n.parameters;r=r||null!=s&&s.length>1}const o=e.some((({name:t})=>w.has(t.toLowerCase()))),{rawSourceRasterInfos:i}=this;return{functions:e,hasBranches:r,hasFocalFunction:o,isSourceSingleBand:1===i?.[0]?.bandCount}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let n=0;n<s.length;n++){const o=s[n];if(null!=o&&this._isRasterFunctionValue(o)){const s=o.bind(t,e,this.id+n);if(!s.success)return this._bindingResult=s,s;r=r&&s.supportsGPU}}return!this.rasterInfo||e?(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),this._bindingResult.success&&this._patchRasterInfo(),this._bindingResult.supportsGPU=r&&this._bindingResult.supportsGPU,this.processInputBandIds(),this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},this.processInputBandIds(),this._bindingResult)}process(t){const e=this._getRasterValues(),n=0===e.length?t.pixelBlocks??t.primaryPixelBlocks:e.map((e=>this._readRasterValue(e,t)));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const e=t.map((t=>t.processInputBandIds()[0]));this.rawInputBandIds=e,this.isInputBandIdsSwizzled=this.rawInputBandIds.some(((t,e)=>t!==e));const n=t.filter((t=>"ExtractBand"===t.functionName));return n.length&&n.forEach(((t,e)=>{t.isInputBandIdsSwizzled=!0,t.swizzledBandSelection=[e,e,e]})),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:t}=this.sourceRasterInfos[0];for(let n=0;n<t;n++)e.push(n)}const s=this._getInputBandIds(e);return this.isInputBandIdsSwizzled=s.some(((t,e)=>t!==e)),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map((t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1})),t.rasters.some((t=>null!=t))||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];"Clip"===this.functionName&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach((e=>{if(this._isRasterFunctionValue(e)){const n=e.getClippingGeometries();t.push(...n)}}));else if(this._isRasterFunctionValue(e)){const n=e.getClippingGeometries();t.push(...n)}return t}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach((t=>{t.statistics=void 0,t.histograms=void 0}))}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.flatMap((t=>this.functionArguments[t]))}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(0===e.length)return n;const r=e.map((t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&s.includes(t)?n[s.indexOf(t)]:"number"!=typeof t?n[0]:void 0)),o=r.find((t=>t))??n[0];return r.forEach(((t,e)=>{void 0===t&&(r[e]=o)})),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;s<t.sourceRasters.length;s++){const r=t.sourceRasters[s];if("number"!=typeof r)if("bind"in r)this._getPrimaryRasters(r,e,n);else{const t=r,s=this._getPrimaryRasterId(t);if(null==s)continue;n.includes(s)||(this.mainPrimaryRasterId===s?(e.unshift(t),n.unshift(s)):(e.push(t),n.push(s)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,e){const{primaryPixelBlocks:n}=e;if(null==t||"$$"===t){const t=n[0];return null==t?null:t.clone()}if("string"==typeof t){const s=e.primaryRasterIds.indexOf(t);return-1===s?null:n[s]}if("number"==typeof t){const e=n[0];if(null==e)return null;const{width:s,height:r,pixelType:o}=e,i=new Float32Array(s*r);i.fill(t);const a=this.sourceRasterInfos[0].bandCount,l=new Array(a).fill(i);return new y.A({width:s,height:r,pixelType:o,pixels:l})}return t.process(e)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:e,keyProperties:n,statistics:s,histograms:r}=t,o=n.BandProperties;o&&o.length!==e&&(t.keyProperties={...n,BandProperties:void 0}),s&&s.length!==e&&(t.statistics=s.length>e?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:"string"==typeof n.BAND_COUNT?String(e):e})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],v.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],v.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],v.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}}),(0,g.w)((t=>t?.toLowerCase()))],v.prototype,"outputPixelType",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],v.prototype,"mainPrimaryRasterId",void 0),(0,i._)([(0,a.MZ)()],v.prototype,"sourceRasters",void 0),(0,i._)([(0,a.MZ)({type:[x.A],json:{write:!0}})],v.prototype,"sourceRasterInfos",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],v.prototype,"rasterInfo",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],v.prototype,"readingBufferSize",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],v.prototype,"id",void 0),(0,i._)([(0,a.MZ)()],v.prototype,"isNoopProcess",void 0),(0,i._)([(0,a.MZ)()],v.prototype,"supportsGPU",null),(0,i._)([(0,a.MZ)()],v.prototype,"rawInputBandIds",void 0),(0,i._)([(0,a.MZ)()],v.prototype,"rawSourceRasterInfos",void 0),(0,i._)([(0,a.MZ)()],v.prototype,"isInputBandIdsSwizzled",void 0),(0,i._)([(0,a.MZ)()],v.prototype,"swizzledBandSelection",void 0),(0,i._)([(0,a.MZ)()],v.prototype,"isBranch",void 0),(0,i._)([(0,a.MZ)({readOnly:!0})],v.prototype,"flatWebGLFunctionChain",null),(0,i._)([(0,a.MZ)()],v.prototype,"_bindingResult",void 0),v=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.BaseRasterFunction")],v);const A=v,_={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},b={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},M={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},T={setNull:50,conditional:78},P={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65,...b,...M,majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75,...T},N=new Map([[M.acos,{domain:[0,Math.PI],isInteger:!1}],[M.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[M.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[M.cos,{domain:[-1,1],isInteger:!1}],[M.sin,{domain:[-1,1],isInteger:!1}],[b.booleanAnd,{domain:[0,1],isInteger:!0}],[b.booleanNot,{domain:[0,1],isInteger:!0}],[b.booleanOr,{domain:[0,1],isInteger:!0}],[b.booleanXOr,{domain:[0,1],isInteger:!0}],[b.equalTo,{domain:[0,1],isInteger:!0}],[b.notEqual,{domain:[0,1],isInteger:!0}],[b.greaterThan,{domain:[0,1],isInteger:!0}],[b.greaterThanEqual,{domain:[0,1],isInteger:!0}],[b.lessThan,{domain:[0,1],isInteger:!0}],[b.lessThanEqual,{domain:[0,1],isInteger:!0}],[b.isNull,{domain:[0,1],isInteger:!0}]]);function R(t){return N.get(t)}const F=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function C(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]+r[t]);return i}function k(t,e,n){const[s]=t,r=s.length,o=y.A.createEmptyBand("f32",r);return o.set(s),o}function S(t,e,n){const[s]=t,r=s.length,o=y.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=s[t]*s[t]);return o}function I(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]-r[t]);return i}function j(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]*r[t]);return i}function B(t,e,n){const[s]=t,r=s.length,o=y.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=Math.sign(s[t])*Math.floor(Math.abs(s[t])));return o}function Z(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]/r[t]);return i}function G(t,e,n){return Z(t,e,"f32")}function z(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=Math.floor(s[t]/r[t]));return i}function O(t,e,n,s){const r=t[0],o=r.length,i=y.A.createEmptyBand(n,o);if(s===M.atanh){for(let t=0;t<o;t++)if(e[t]){const n=r[t];Math.abs(n)>=1?e[t]=0:i[t]=Math.atanh(n)}return i}const a=s===M.asin?Math.asin:Math.acos;for(let t=0;t<o;t++)if(e[t]){const n=r[t];Math.abs(n)>1?e[t]=0:i[t]=a(n)}return i}function E(t,e,n,s){const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s(r[t]));return i}function D(t,e,n,s){const[r,o]=t,i=r.length,a=y.A.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s(r[t],o[t]));return a}function V(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&r[t]);return i}function U(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<<r[t]);return i}function L(t,e,n){const[s]=t,r=s.length,o=y.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=~s[t]);return o}function W(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]|r[t]);return i}function $(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>>r[t]);return i}function H(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]^r[t]);return i}function q(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]&&r[t]?1:0);return i}function J(t,e,n){const[s]=t,r=s.length,o=y.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=s[t]?0:1);return o}function K(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]||r[t]?1:0);return i}function X(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=(s[t]?1:0)^(r[t]?1:0));return i}function Y(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?1:0);return i}function Q(t,e,n,s){const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o),a=s===Math.E;for(let t=0;t<o;t++)e&&!e[t]||(i[t]=a?Math.exp(r[t]):s**r[t]);return i}function tt(t,e,n){return Q(t,e,n,10)}function et(t,e,n){return Q(t,e,n,2)}function nt(t,e,n){return Q(t,e,n,Math.E)}function st(t,e,n,s){const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(r[t]<=0?e[t]=0:i[t]=s(r[t]));return i}function rt(t,e,n){return st(t,e,n,Math.log10)}function ot(t,e,n){return st(t,e,n,Math.log2)}function it(t,e,n){return st(t,e,n,Math.log)}function at(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>r[t]?1:0);return i}function lt(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]>=r[t]?1:0);return i}function ut(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<r[t]?1:0);return i}function ct(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<=r[t]?1:0);return i}function pt(t,e,n){const[s]=t,r=s.length,o=y.A.createEmptyBand(n,r);if(!e)return o;for(let t=0;t<r;t++)o[t]=e[t]?0:1;return o}function ht(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]%r[t]);return i}function mt(t,e,n){const[s]=t,r=s.length,o=y.A.createEmptyBand(n,r);for(let t=0;t<r;t++)e&&!e[t]||(o[t]=-s[t]);return o}function ft(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]===r[t]?0:1);return i}function dt(t,e,n){const[s,r]=t,o=s.length,i=y.A.createEmptyBand(n,o),a=new Uint8Array(o);for(let t=0;t<o;t++)null!=e&&!e[t]||0!==s[t]||(i[t]=r[t],a[t]=255);return{band:i,mask:a}}function gt(t,e,n){const[s,r,o]=t,i=s.length,a=y.A.createEmptyBand(n,i);for(let t=0;t<i;t++)e&&!e[t]||(a[t]=s[t]?r[t]:o[t]);return a}function yt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n];for(let r=1;r<s;r++){const s=t[r][n];e<s&&(e=s)}i[n]=e}return i}function xt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n];for(let r=1;r<s;r++){const s=t[r][n];e>s&&(e=s)}i[n]=e}return i}function wt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=r[n],o=e;for(let r=1;r<s;r++){const s=t[r][n];o<s?o=s:e>s&&(e=s)}i[n]=o-e}return i}function vt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){let e=0;for(let r=0;r<s;r++)e+=t[r][n];i[n]=e/s}return i}function At(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n])for(let e=0;e<s;e++){const s=t[e];i[n]+=s[n]}return i}function _t(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o);for(let n=0;n<o;n++)if(!e||e[n]){const e=new Float32Array(s);let r=0;for(let o=0;o<s;o++){const s=t[o];r+=s[n],e[o]=s[n]}r/=s;let o=0;for(let t=0;t<s;t++)o+=(e[t]-r)**2;i[n]=Math.sqrt(o/s)}return i}function bt(t,e,n){const s=t.length;if(s<2)return t[0];const r=Math.floor(s/2),[o]=t,i=o.length,a=y.A.createEmptyBand(n,i),l=new Float32Array(s),u=s%2==1;for(let n=0;n<i;n++)if(!e||e[n]){for(let e=0;e<s;e++)l[e]=t[e][n];l.sort(),a[n]=u?l[r]:(l[r]+l[r-1])/2}return a}function Mt(t,e,n){const[s,r]=t;if(null==r)return s;const o=s.length,i=y.A.createEmptyBand(n,o);for(let t=0;t<o;t++)e&&!e[t]||(i[t]=s[t]<r[t]?s[t]:r[t]);return i}function Tt(t,e,n){const s=t.length;if(s<=2)return Mt(t,e,n);const r=t[0].length,o=y.A.createEmptyBand(n,r),i=new Map;for(let n=0;n<r;n++)if(!e||e[n]){i.clear();for(let e=0;e<s;e++){const s=t[e][n];i.set(s,i.has(s)?i.get(s)+1:1)}let e=0,r=0;const a=[];for(const t of i.keys())e=i.get(t),e>r?(r=e,a.length=0,a.push(t)):e===r&&a.push(t);a.length>1&&a.sort(((t,e)=>t-e)),o[n]=a[0]}return o}function Pt(t,e,n){const s=t.length;if(s<=2)return Mt(t,e,n);const r=t[0].length,o=y.A.createEmptyBand(n,r),i=new Map;for(let n=0;n<r;n++)if(!e||e[n]){i.clear();for(let e=0;e<s;e++){const s=t[e][n];i.set(s,i.has(s)?i.get(s)+1:1)}let e=0,r=t.length;const a=[];for(const t of i.keys())e=i.get(t),e<r?(r=e,a.length=0,a.push(t)):e===r&&a.push(t);a.length>1&&a.sort(((t,e)=>t-e)),o[n]=a[0]}return o}function Nt(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,o=r.length,i=y.A.createEmptyBand(n,o),a=new Set;for(let n=0;n<o;n++)if(!e||e[n]){let e;a.clear();for(let r=0;r<s;r++)e=t[r][n],a.add(e);i[n]=a.size}return i}const Rt=new Map,Ft=new Map,Ct=new Map,kt=new Map;function St(){Rt.size||(Rt.set(4,Math.sqrt),Rt.set(6,Math.acos),Rt.set(7,Math.asin),Rt.set(8,Math.atan),Rt.set(9,Math.atanh),Rt.set(10,Math.abs),Rt.set(21,Math.cos),Rt.set(22,Math.cosh),Rt.set(48,Math.floor),Rt.set(49,Math.ceil),Rt.set(51,Math.sin),Rt.set(52,Math.sinh),Rt.set(56,Math.tan),Rt.set(57,Math.tanh),Rt.set(59,Math.acosh),Rt.set(60,Math.asinh),Rt.set(65,Math.floor),Ft.set(5,Math.pow),Ft.set(61,Math.atan2),Ct.set(1,C),Ct.set(2,I),Ct.set(3,j),Ct.set(11,V),Ct.set(12,U),Ct.set(13,L),Ct.set(14,W),Ct.set(15,$),Ct.set(16,H),Ct.set(17,q),Ct.set(18,J),Ct.set(19,K),Ct.set(20,X),Ct.set(23,Z),Ct.set(24,Y),Ct.set(25,nt),Ct.set(26,tt),Ct.set(27,et),Ct.set(28,at),Ct.set(29,lt),Ct.set(30,B),Ct.set(31,pt),Ct.set(32,k),Ct.set(33,ut),Ct.set(34,ct),Ct.set(35,it),Ct.set(36,rt),Ct.set(37,ot),Ct.set(44,ht),Ct.set(45,mt),Ct.set(46,ft),Ct.set(53,S),Ct.set(64,G),Ct.set(65,z),Ct.set(76,gt),Ct.set(78,gt),kt.set(38,Tt),kt.set(39,yt),kt.set(40,vt),kt.set(41,bt),kt.set(42,xt),kt.set(43,Pt),kt.set(47,wt),kt.set(54,_t),kt.set(55,At),kt.set(58,Nt),kt.set(66,Tt),kt.set(67,yt),kt.set(68,vt),kt.set(69,bt),kt.set(70,xt),kt.set(71,Pt),kt.set(72,wt),kt.set(73,_t),kt.set(74,At),kt.set(75,Nt))}function It(t,e,n={}){St();let s=function(t,e=!1){const n=t.map((t=>t.mask)),s=n.filter((t=>null!=t)),r=t[0].pixels[0].length;if(0===s.length||e&&s.length!==n.length)return new Uint8Array(r).fill(255);const o=s[0],i=new Uint8Array(o);if(1===s.length)return i;if(!e){for(let t=1;t<s.length;t++){const e=s[t];for(let t=0;t<i.length;t++)i[t]&&(i[t]=e[t]?255:0)}return i}for(let t=1;t<s.length;t++){const e=s[t];for(let t=0;t<i.length;t++)0===i[t]&&(i[t]=e[t]?255:0)}return i}(t,e>=66&&e<=75);const{outputPixelType:r="f32"}=n,o=!kt.has(e)||n.processAsMultiband,i=o?t[0].pixels.length:1,a=[];for(let n=0;n<i;n++){const i=kt.has(e)&&!o?t.flatMap((t=>t.pixels)):t.map((t=>t.pixels[n]));let l,c=!0;if(e===T.setNull){const t=dt(i,s,r);l=t.band,s=t.mask,c=!1}else Ct.has(e)?l=Ct.get(e)(i,s,"f64"):Rt.has(e)?l=e===M.asin||e===M.acos||e===M.atanh?O(i,s,"f64",e):E(i,s,"f64",Rt.get(e)):Ft.has(e)?l=D(i,s,"f64",Ft.get(e)):kt.has(e)?l=kt.get(e)(i,s,"f64"):(l=i[0],c=!1);if(c&&e!==b.isNull&&!N.has(e)){const t=y.A.createEmptyBand(r,l.length);s||(s=new Uint8Array(l.length).fill(255)),(0,u.$p)(l,s),(0,u.yM)(l,s,r,t),l=t}a.push(l)}const l=t[0];return new y.A({width:l.width,height:l.height,pixelType:r,mask:e===b.isNull?null:s,pixels:a})}let jt=class extends A{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return null==e?.[0]||null==e?.[1]?null:function(t,e,n){return It(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=(0,u.hP)(n);const o=(0,u.zw)(n);return o&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:o}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],jt.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:d,json:{write:!0,name:"rasterFunctionArguments"}})],jt.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],jt.prototype,"rasterArgumentNames",void 0),jt=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ArithmeticFunction")],jt);const Bt=jt;var Zt;let Gt=Zt=class extends h{clone(){return new Zt({raster:this.raster})}};Gt=Zt=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Gt);const zt=Gt;var Ot=n(39062);let Et=class extends A{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],o=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return(0,Ot.di)(e,{resolution:o})}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Et.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:zt,json:{write:!0,name:"rasterFunctionArguments"}})],Et.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Et.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Et.prototype,"isGCS",void 0),Et=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.AspectFunction")],Et);const Dt=Et;var Vt=n(93223),Ut=n(66552);const Lt=new Set(["+","-","*","/","(",")"]);function Wt(t,e){return t.toLowerCase().startsWith("b")?e[parseInt(t.slice(1),10)-1]:parseFloat(t)}function $t(t,e,n,s){if("number"==typeof n&&"number"==typeof s)return n+s;let r,o,i;"number"==typeof n?(i=s,r=i.length,o=new Float32Array(r),o.fill(n)):(r=n.length,o=n,s.constructor===Number?(i=new Float32Array(r),i.fill(s)):i=s);const a=new Float32Array(r);switch(e){case"+":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]+i[e]);break;case"-":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]-i[e]);break;case"*":for(let e=0;e<r;e++)(null==t||t[e])&&(a[e]=o[e]*i[e]);break;case"/":for(let e=0;e<r;e++)(null==t||t[e])&&i[e]&&(a[e]=o[e]/i[e]);break;case"(":case")":throw new Error("encountered error with custom band index equation")}return a}function Ht(t,e){t.splice(e,1);let n=0,s=0;do{n=0,s=0;for(let e=0;e<t.length;e++)if("("===t[e])n=e;else if(")"===t[e]){s=e;break}s===n+1&&t.splice(n,2)}while(s===n+1);return t}function qt(t){if(1===t.length)return{opIndex:0,numIndex:0};let e=0,n=0;for(let s=0;s<t.length;s++)if("("===t[s])e=s;else if(")"===t[s]){n=s;break}const s=0===n?t:t.slice(e+1,n);let r=-1;for(let t=0;t<s.length;t++)if("*"===s[t]||"/"===s[t]){r=t;break}if(r>-1)n>0&&(r+=e+1);else{for(let t=0;t<s.length;t++)if("+"===s[t]||"-"===s[t]){r=t;break}n>0&&(r+=e+1)}let o=0;for(let e=0;e<r;e++)"("===t[e]&&o++;return{opIndex:r,numIndex:r-o}}var Jt=n(28435);const Kt=new Ut.J({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Xt(t,e){if(!(0,Jt.AB)(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map((t=>t-1)),{pixels:o,mask:i}=t;let a;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=Qt(i,o[r[0]],o[r[1]]);break;case"ndwi":a=Qt(i,o[r[1]],o[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s)}return[r]}(i,o[r[0]],o[r[1]]);break;case"ci-g":case"ci-re":a=function(t,e,n){const s=e.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o];s&&(r[o]=t/s-1)}return[r]}(i,o[r[0]],o[r[1]]);break;case"savi":a=function(t,e,n,s){const r=n.length,o=new Float32Array(r);for(let i=0;i<r;i++)if(null==t||t[i]){const t=n[i],r=e[i],a=r+t+s;a&&(o[i]=(r-t)/a*(1+s))}return[o]}(i,o[r[0]],o[r[1]],r[2]+1);break;case"tsavi":a=function(t,e,n,s,r,o){const i=n.length,a=new Float32Array(i),l=-r*s+o*(1+s*s);for(let o=0;o<i;o++)if(null==t||t[o]){const t=n[o],i=e[o],u=r*i+t+l;u&&(a[o]=s*(i-s*t-r)/u)}return[a]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o],i=2*s+1;r[o]=.5*(i-Math.sqrt(i*i-8*(s-t)))}return[r]}(i,o[r[0]],o[r[1]]);break;case"gemi":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=n[o],s=e[o];if(1!==t&&s+t+.5!==0){const e=(2*(s*s-t*t)+1.5*s+.5*t)/(s+t+.5);r[o]=e*(1-.25*e)-(t-.125)/(1-t)}}return[r]}(i,o[r[0]],o[r[1]]);break;case"pvi":a=function(t,e,n,s,r){const o=n.length,i=new Float32Array(o),a=1/Math.sqrt(1+s*s);for(let l=0;l<o;l++)if(null==t||t[l]){const t=n[l],o=e[l];i[l]=(o-s*t-r)*a}return[i]}(i,o[r[0]],o[r[1]],r[2]+1,r[3]+1);break;case"gvitm":a=function(t,e){const[n,s,r,o,i,a]=e,l=n.length,u=new Float32Array(l);for(let e=0;e<l;e++)(null==t||t[e])&&(u[e]=-.2848*n[e]-.2435*s[e]-.5436*r[e]+.7243*o[e]+.084*i[e]-.18*a[e]);return[u]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]],o[r[5]]]);break;case"sultan":a=function(t,e){const[n,s,r,o,i]=e,a=n.length,l=new Float32Array(a),u=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;e++)(null==t||t[e])&&(l[e]=i[e]?o[e]/i[e]*100:0,u[e]=n[e]?o[e]/n[e]*100:0,c[e]=r[e]?s[e]/r[e]*(o[e]/r[e])*100:0);return[l,u,c]}(i,[o[r[0]],o[r[1]],o[r[2]],o[r[3]],o[r[4]]]);break;case"vari":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=o+t-r[e];a&&(i[e]=(o-t)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"mtvi2":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e],l=Math.sqrt((2*t+1)**2-(6*t-5*Math.sqrt(o))-.5);if(l){const n=1.5*(1.2*(t-a)-2.5*(o-a));i[e]=n/l}}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"rtvi-core":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=r[e];i[e]=100*(t-o)-10*(t-a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"evi":a=function(t,e){const[n,s,r]=e,o=n.length,i=new Float32Array(o);for(let e=0;e<o;e++)if(null==t||t[e])for(e=0;e<o;e++){const t=n[e],o=s[e],a=t+6*o-7.5*r[e]+1;a&&(i[e]=2.5*(t-o)/a)}return[i]}(i,[o[r[0]],o[r[1]],o[r[2]]]);break;case"wndwi":a=function(t,e,n=.5){const[s,r,o]=e,i=r.length,a=new Float32Array(i);for(let e=0;e<i;e++)if(null==t||t[e])for(e=0;e<i;e++){const t=s[e],i=r[e],l=o[e],u=t+n*i+(1-n)*l;u&&(a[e]=(t-n*i-(1-n)*l)/u)}return[a]}(i,[o[r[0]],o[r[1]],o[r[2]]],r[3]?r[3]+1:.5);break;case"bai":a=function(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o])for(o=0;o<s;o++){const t=(.1-e[o])**2+(.06-n[o])**2;t&&(r[o]=1/t)}return[r]}(i,o[r[0]],o[r[1]]);break;case"custom":a=function(t,e,n){let s,{ops:r,nums:o}=function(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const n=t.split(""),s=[],r=[];let o="";for(let t=0;t<n.length;t++){const i=n[t];Lt.has(i)?(o.length&&r.push(Wt(o,e)),s.push(i),o=""):o=o.concat(i)}return o.length&&r.push(Wt(o,e)),{ops:s,nums:r}}(n,e);if(0===r.length){const t=1===o.length?o[0]:e[0];if(t instanceof Float32Array)return[t];const n=new Float32Array(e[0].length);return"number"==typeof t?n.fill(t):n.set(t),[n]}for(;r.length>0;){const{numIndex:e,opIndex:n}=qt(r);if(s=$t(t,r[n],o[e],o[e+1]),1===r.length)break;r=Ht(r,n),o.splice(e,2,s)}return[s]}(i,o,n);break;default:return t}const{outputPixelType:l="f32"}=e,c=null!=l&&(0,u.zw)(l);let p;i?(p=new Uint8Array(t.width*t.height),p.set(i)):c&&(p=new Uint8Array(t.width*t.height).fill(255)),c&&(a=a.map((t=>{const e=y.A.createEmptyBand(l,t.length);return(0,u.yM)(t,p,l,e),e})));const h=new y.A({width:t.width,height:t.height,pixelType:l,pixels:a,mask:p});return h.updateStatistics(),h}function Yt(t){const e=new Float32Array(9);return e[3*t[0]]=1,e[3*t[1]+1]=1,e[3*t[2]+2]=1,e}function Qt(t,e,n){const s=n.length,r=new Float32Array(s);for(let o=0;o<s;o++)if(null==t||t[o]){const t=e[o],s=n[o],i=t+s;i&&(r[o]=(t-s)/i)}return[r]}var te;let ee=te=class extends h{constructor(){super(...arguments),this.method="custom"}clone(){return new te({method:this.method,bandIndexes:this.bandIndexes,raster:(0,o.o8)(this.raster)})}};(0,i._)([(0,a.MZ)({json:{type:String,write:!0}})],ee.prototype,"bandIndexes",void 0),(0,i._)([(0,Vt.e)(Kt)],ee.prototype,"method",void 0),ee=te=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.BandArithmeticFunctionArguments")],ee);const ne=ee,se=new Set(["vari","mtvi2","rtvi-core","evi"]);let re=class extends A{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0];if(t.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};const e=t.clone();return e.pixelType=this.outputPixelType,e.bandCount="sultan"===this.functionArguments.method?3:1,this._removeStatsHistColormapVAT(e),e.keyProperties={...e.keyProperties,BandProperties:void 0},this.rasterInfo=e,{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{method:n,bandIndexes:s}=this.functionArguments,r=s.split(" ").map((t=>parseFloat(t)));return Xt(e,{method:n,bandIndexes:r,equation:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1));2===t.length&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=Yt([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=Yt([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=Yt([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=Yt([e[0],e[1],0]),s="ci";break;case"savi":n=Yt([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=Yt([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=Yt([e[0],e[1],0]),s="msavi";break;case"gemi":n=Yt([e[0],e[1],0]),s="gemi";break;case"pvi":n=Yt([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=Yt([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=Yt([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=Yt([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=Yt([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=Yt([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=Yt([e[1],e[0],0]),s="bai";break;default:n=Yt([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:(0,u.zw)(this.outputPixelType)}}_getInputBandIds(t){if("custom"===this.functionArguments.method)return t;const e=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1)),n=t.length,s=e.map((t=>t>=n?n-1:t)),r=se.has(this.functionArguments.method)?3:2,o=s.slice(0,r).map((e=>t[e]));return 2===o.length&&o.push(0),o}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],re.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:ne,json:{write:!0,name:"rasterFunctionArguments"}})],re.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],re.prototype,"rasterArgumentNames",void 0),re=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.BandArithmeticFunction")],re);const oe=re;var ie,ae=n(59456),le=n(65864);const ue=new Ut.J({1:"outside",2:"inside"},{useNumericKeys:!0});let ce=ie=class extends h{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new ie({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};(0,i._)([(0,a.MZ)({types:ae.yR,json:{read:le.rS,write:!0}})],ce.prototype,"clippingGeometry",void 0),(0,i._)([(0,a.MZ)({json:{read:ue.read,write:ue.write}})],ce.prototype,"clippingType",void 0),ce=ie=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ClipFunctionArguments")],ce);const pe=ce;var he=n(77359),me=n(70834);let fe=class extends A{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{functionArguments:e}=this,{clippingGeometry:n,clippingType:s}=e;if(!n)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===s)try{const{spatialReference:e}=t,s="extent"===n.type?(0,me._l)(n,e):(0,me.uk)(n,e).extent;s&&(0,he.Sd)(t,s)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],fe.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:pe,json:{write:!0,name:"rasterFunctionArguments"}})],fe.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],fe.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],fe.prototype,"isNoopProcess",void 0),fe=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ClipFunction")],fe);const de=fe;var ge,ye=n(36005),xe=n(67369),we=n(95349);let ve=ge=class extends h{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return xe.L7.includes(e)?e:null}readColorRamp(t){return(0,we.r)(t)}readColorRampName(t,e){if(!t)return null;const n=xe.kH.jsonValues.find((e=>e.toLowerCase()===t.toLowerCase()));return n?xe.kH.fromJSON(n):null}clone(){return new ge({colormap:(0,o.o8)(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};(0,i._)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],ve.prototype,"colormap",void 0),(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],ve.prototype,"colormapName",void 0),(0,i._)([(0,g.w)("colormapName")],ve.prototype,"castColormapName",null),(0,i._)([(0,a.MZ)({types:we.g,json:{write:!0}})],ve.prototype,"colorRamp",void 0),(0,i._)([(0,ye.w)("colorRamp")],ve.prototype,"readColorRamp",null),(0,i._)([(0,a.MZ)({type:xe.kH.apiValues,json:{type:xe.kH.jsonValues,write:xe.kH.write}})],ve.prototype,"colorRampName",void 0),(0,i._)([(0,ye.w)("colorRampName")],ve.prototype,"readColorRampName",null),ve=ge=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],ve);const Ae=ve,_e=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],be=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function Me(t,e){const n=[],s=[];for(let e=0;e<t.length-1;e++)n.push({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:t[e].slice(1),toColor:t[e+1].slice(1)}),s.push(t[e+1][0]-t[e][0]);const r=t[t.length-1][0];return(0,xe.iv)({type:"multipart",colorRamps:n},{numColors:r,weights:e=e??s})}let Te=class extends A{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)this.colorRamp=s,e=(0,xe.R8)(s,{interpolateAlpha:!0});else if(r){const t=(0,xe.M5)(r);t&&(e=(0,xe.R8)(t),this.colorRamp=(0,we.r)(t))}else n&&(e=function(t){let e;switch(t){case"elevation":e=Me([[0,0,191,191],[51,0,0,255],[102,255,0,255],[153,255,0,127],[204,191,63,127],[256,20,20,20]]);break;case"gray":e=(0,xe.iv)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":e=Me([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case"ndvi":e=_e;break;case"ndvi2":e=function(){const t=Me([[0,255,255,255],[70,0,255,0],[80,205,173,193],[100,150,150,150],[110,120,51,100],[130,120,100,200],[140,28,3,144],[160,6,0,55],[180,10,25,30],[201,6,7,27]]);for(let e=t.length;e<256;e++)t.push([6,27,7]);return t}();break;case"ndvi3":e=be;break;case"random":e=function(){const t=[];for(let e=0;e<256;e++){const e=[];for(let t=0;t<3;t++)e.push(Math.round(255*Math.random()));t.push(e)}return t}()}return e?(e=e.map(((t,e)=>[e,...t])),e):null}(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const o=this._getOutputPixelType(t.pixelType);this.outputPixelType=o.startsWith("f")?"s32":o;const i=t.clone();return i.pixelType=this.outputPixelType,i.colormap=e,i.bandCount=1,this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||(0,u.zw)(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Te.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Ae,json:{write:!0,name:"rasterFunctionArguments"}})],Te.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Te.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],Te.prototype,"isNoopProcess",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Te.prototype,"indexedColormap",void 0),(0,i._)([(0,a.MZ)()],Te.prototype,"colorRamp",void 0),Te=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ColormapFunction")],Te);const Pe=Te;var Ne,Re=n(4151);let Fe=Ne=class extends h{clone(){return new Ne({raster:this.raster})}};Fe=Ne=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ColormapToRGBFunctionArguments")],Fe);const Ce=Fe;var ke=n(88178);let Se=class extends A{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 e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.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=e;const n=[...t.colormap].sort(((t,e)=>t[0]-e[0])),{indexedColormap:s,offset:r}=(0,Jt.zg)({colormap:n});return s?(this.lookup={indexedColormap:s,offset:r},{success:!0,supportsGPU:(0,ke.WN)(s)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const n=e.pixels[0],s=e.mask??new Uint8Array(n.length).fill(255),r=new Uint8Array(n.length),o=new Uint8Array(n.length),i=new Uint8Array(n.length),{indexedColormap:a,offset:l}=this.lookup,u=a.length;for(let t=0;t<n.length;t++)if(s[t]){let e=4*(n[t]-l);e<0||e>u-4?s[t]=0:(r[t]=a[e++],o[t]=a[e++],i[t]=a[e++])}return e.pixels=[r,o,i],e.statistics=[new Re.z(0,255),new Re.z(0,255),new Re.z(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Se.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Ce,json:{write:!0,name:"rasterFunctionArguments"}})],Se.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Se.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Se.prototype,"lookup",void 0),Se=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ColormapToRGBFunction")],Se);const Ie=Se;var je,Be=n(43937);let Ze=je=class extends h{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map((t=>"number"==typeof t||"string"==typeof t?t:t.toJSON()))}clone(){return new je({rasters:(0,o.o8)(this.rasters)})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Ze.prototype,"rasters",void 0),(0,i._)([(0,Be.K)("rasters")],Ze.prototype,"writeRasters",null),Ze=je=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],Ze);const Ge=Ze;let ze=class extends A{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map((({bandCount:t})=>t)).reduce(((t,e)=>t+e)),t.every((({statistics:t})=>null!=t&&t.length))){const e=[];t.forEach((({statistics:t})=>null!=t&&e.push(...t))),n.statistics=e}if(t.every((({histograms:t})=>null!=t&&t.length))){const e=[];t.forEach((({histograms:t})=>null!=t&&e.push(...t))),n.histograms=e}n.multidimensionalInfo&&n.multidimensionalInfo.variables.forEach((e=>{const n=t.map((t=>t.multidimensionalInfo?.variables.find((({name:t})=>t===e.name)))),s=n.map((t=>t?.statistics?.length?t.statistics:null)),r=n.map((t=>t?.histograms?.length?t.histograms:null));e.statistics=s.every((t=>null!=t))?s.flat():null,e.histograms=r.every((t=>null!=t))?r.flat():null})),n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every((t=>t.keyProperties.BandProperties?.length))?t.flatMap((t=>t.keyProperties.BandProperties)):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;if(!e)return null;const n=e?.[0];return null==n?null:(0,Jt.Wy)(e)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ze.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Ge,json:{write:!0,name:"rasterFunctionArguments"}})],ze.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],ze.prototype,"rasterArgumentNames",void 0),ze=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.CompositeBandFunction")],ze);const Oe=ze;var Ee=n(20437);const De=new Ut.J({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),Ve=new Ut.J({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});var Ue;let Le=Ue=class extends h{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new Ue({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};(0,i._)([(0,Vt.e)(De)],Le.prototype,"method",void 0),(0,i._)([(0,Vt.e)(Ve)],Le.prototype,"keepMethod",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Le.prototype,"raster2",void 0),(0,i._)([(0,a.MZ)({readOnly:!0})],Le.prototype,"rasters",null),Le=Ue=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],Le);const We=Le;let $e=class extends A{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),"categorical"===t){const t=this.sourceRasterInfos.map((t=>t.attributeTable)),n=this._getFieldNames(t,"value"),s=t.map((t=>this._getClassFieldName(t)));if(null==n[0]||null==n[1]||null==s[0]||null==s[1])return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(e,n,s)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:"difference"===t||"relative-difference"===t}}_processPixels(t){const{pixelBlocks:e}=t;if(null==e?.[0]||null==e?.[1])return null;const{method:n}=this.functionArguments;return function(t,e,n,s){const[r,o]=t,i=(0,u.zw)(n)&&!(0,u.zw)(r.pixelType)&&!(0,u.zw)(o.pixelType),a=[r.mask,o.mask].filter((t=>t)),l=y.A.combineBandMasks(a),c=t.map((t=>t.pixels[0])),{width:p,height:h}=r,m=y.A.createEmptyBand(n,p*h);switch(e){case"difference":case"relative-difference":!function(t){const{bands:[e,n],mask:s,isRelative:r,isRoundingNeeded:o,outBand:i}=t,a=e.length;for(let t=0;t<a;t++)if(!s||s[t]){let s=e[t]-n[t];if(r){const r=Math.max(Math.abs(e[t])-Math.abs(n[t]));s=r>0?s/r:0}i[t]=o?Math.round(s):s}}({bands:c,mask:l,outBand:m,isRoundingNeeded:i,isRelative:"relative-difference"===e});break;case"categorical":!function(t){const{bands:[e,n],categoryIndexLookups:[s,r],classNames:[o,i],mask:a,keepMethod:l,outBand:u}=t,c=e.length,p=o.length,h=i.length,m=p*h,f=m+1,d=m+2;for(let t=0;t<c;t++)if(!a||a[t]){const a=e[t],c=n[t],p=s[a],g=r[c],y=o[p],x=i[g];u[t]=null==p||null==g?m:"changed"===l&&y===x?f:"unchanged"===l&&y!==x?d:p*h+g}}({bands:c,mask:l,outBand:m,...s});break;case"euclidean-distance":!function(t){const{pixels:[e,n],mask:s,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!s||s[t]){let s=0;for(let r=0;r<i;r++){const o=e[r][t]-n[r][t];s+=o*o}r[t]=Math.sqrt(s)}}({pixels:t.map((t=>t.pixels)),mask:l,outBand:m});break;case"angle-difference":!function(t){const{pixels:[e,n],mask:s,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!s||s[t]){let s=0,o=0,a=0;for(let r=0;r<i;r++){const i=e[r][t],l=n[r][t];s+=i*l,o+=i*i,a+=l*l}const l=Math.sqrt(o*a);r[t]=l?Math.acos(s/l):1.5707963267948966}}({pixels:t.map((t=>t.pixels)),mask:l,outBand:m});break;case"band-with-most-change":!function(t){const{pixels:[e,n],mask:s,outBand:r}=t,o=e[0].length,i=e.length;for(let t=0;t<o;t++)if(!s||s[t]){let s=0,o=0;for(let r=0;r<i;r++){const i=Math.abs(e[r][t]-n[r][t]);i>s&&(s=i,o=r)}r[t]=o}}({pixels:t.map((t=>t.pixels)),mask:l,outBand:m})}const f=new y.A({width:p,height:h,pixels:[m],pixelType:n,mask:l});return f.updateStatistics(),f}(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=(0,u.hP)(t);const s=(0,u.zw)(t);return s&&(e-=1e-4,n+=1e-4),{method:this.functionArguments.method,domainRange:[e,n],isOutputRounded:s}}_updateAttributeTable(t,e,n){const s=this.sourceRasterInfos.map((t=>t.attributeTable)),r=s.map(((t,n)=>t.features.map((t=>t.attributes[e[n]])))),o=s.map(((t,e)=>t.features.map((t=>t.attributes[n[e]])))),i=r.map((t=>{const e=[];return t.forEach(((t,n)=>e[t]=n)),e})),{keepMethod:a}=this.functionArguments;this._categoryConfig={categoryIndexLookups:i,classNames:o,keepMethod:a};const l=s[0].clone();l.fields=[new Ee.A({name:"OID",type:"oid"}),new Ee.A({name:"Value",type:"integer"}),new Ee.A({name:"ClassName",type:"string"}),new Ee.A({name:"Class_From",type:"string"}),new Ee.A({name:"Class_To",type:"string"})];const u=this._getFieldNames(s,"red"),c=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),h=[],m=2===u.length&&2===c.length&&2===p.length;m&&(h.push(...s.map(((t,e)=>t.features.map((t=>[t.attributes[u[e]],t.attributes[c[e]],t.attributes[p[e]]]))))),l.fields.push(new Ee.A({name:"Red",type:"integer"}),new Ee.A({name:"Green",type:"integer"}),new Ee.A({name:"Blue",type:"integer"})));const f=l.features[0].clone();f.geometry=null;const d=[],[g,y]=r.map((t=>t.length));let x=1;for(let t=0;t<g;t++){const e=o[0][t];for(let n=0;n<y;n++){const s=o[1][n];if("changed"===a&&e===s||"unchanged"===a&&e!==s)continue;const r=f.clone();r.attributes={OID:x++,Value:t*y+n,ClassName:e===s?e:`${e} -> ${s}`,Class_From:e,Class_To:s},m&&(r.attributes.Red=h[0][t][0]+h[1][n][0]>>1,r.attributes.Green=h[0][t][1]+h[1][n][1]>>1,r.attributes.Blue=h[0][t][2]+h[1][n][2]>>1),d.push(r)}}if("changed"===a){const t=f.clone();t.attributes={OID:x++,Value:g*y+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},d.push(t)}else if("unchanged"===a){const t=f.clone();t.attributes={OID:x++,Value:g*y+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},d.push(t)}l.features=d,t.attributeTable=l}_getFieldNames(t,e){return t.map((({fields:t})=>t.find((t=>t.name.toLowerCase()===e))?.name)).filter((t=>t))}_getClassFieldName(t){const e=t.fields.find((t=>"string"===t.type&&t.name.toLowerCase().startsWith("class")))??t.fields.find((t=>"string"===t.type&&t.name.toLowerCase().includes("class")||t.name.toLowerCase().includes("type")||t.name.toLowerCase().includes("name")))??t.fields.find((t=>"string"===t.type));return e?.name}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],$e.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:We,json:{write:!0,name:"rasterFunctionArguments"}})],$e.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],$e.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],$e.prototype,"_categoryConfig",void 0),$e=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ComputeChangeFunction")],$e);const He=$e;var qe;let Je=qe=class extends h{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new qe({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Je.prototype,"contrastOffset",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Je.prototype,"brightnessOffset",void 0),Je=qe=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Je);const Ke=Je;var Xe=n(6952);let Ye=class extends A{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if("u8"!==e.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();this._removeStatsHistColormapVAT(n),this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=(0,Xe.zj)(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:(0,Jt.eH)(e,{lut:e.pixels.map((()=>this.lookup)),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ye.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Ke,json:{write:!0,name:"rasterFunctionArguments"}})],Ye.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Ye.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Ye.prototype,"lookup",void 0),Ye=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],Ye);const Qe=Ye;function tn(t,e,n,s,r){const o=Math.floor(s/2);for(let s=0;s<o;s++)for(let o=0;o<e;o++)t[s*e+o]=t[(r-1-s)*e+o],t[(n-1-s)*e+o]=t[(n-r+s)*e+o];const i=Math.floor(r/2);for(let s=0;s<n;s++){const n=s*e;for(let s=0;s<i;s++)t[n+s]=t[n+r-1-s],t[n+e-s-1]=t[n+e+s-r]}}const en=new Map;function nn(t,e,n,s,r,o,i){const a=new Float32Array(e*n),l=o.length,u=i?0:s,c=i?s:0,p=i?1:e;for(let i=u;i<n-u;i++){const n=i*e;for(let i=c;i<e-c;i++){if(r&&!r[n+i])continue;let e=0;for(let r=0;r<l;r++)e+=t[n+i+(r-s)*p]*o[r];a[n+i]=e}}return a}function sn(t,e,n,s,r,o,i){const a=new Float32Array(e*n),l=Math.floor(s/2),u=Math.floor(r/2);for(let c=l;c<n-l;c++){const n=c*e;for(let c=u;c<e-u;c++){if(o&&!o[n+c])continue;let p=0;for(let o=0;o<s;o++)for(let s=0;s<r;s++)p+=t[n+c+(o-l)*e+s-u]*i[o*r+s];a[n+c]=p}}return a}var rn;en.set(_.none,[0,0,0,0,1,0,0,0,0]),en.set(_.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),en.set(_.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),en.set(_.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),en.set(_.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),en.set(_.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),en.set(_.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),en.set(_.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),en.set(_.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),en.set(_.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),en.set(_.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),en.set(_.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),en.set(_.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),en.set(_.smoothing5x5,[1,1,1,1,1,1,4,4,4,1,1,4,12,4,1,1,4,4,4,1,1,1,1,1,1]),en.set(_.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),en.set(_.sharpening5x5,[-1,-3,-4,-3,-1,-3,0,6,0,-3,-4,6,21,6,-4,-3,0,6,0,-3,-1,-3,-4,-3,-1]),en.set(_.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),en.set(_.laplacian5x5,[0,0,-1,0,0,0,-1,-2,-1,0,-1,-2,17,-2,-1,0,-1,-2,-1,0,0,0,-1,0,0]),en.set(_.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),en.set(_.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),en.set(_.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),en.set(_.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),en.set(_.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let on=rn=class extends h{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(t){this._set("convolutionType",t);const e=en.get(t);if(!e||t===_.userDefined||t===_.none)return;const n=Math.sqrt(e.length);this._set("kernel",e),this._set("cols",n),this._set("rows",n)}clone(){return new rn({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:(0,o.o8)(this.raster)})}};(0,i._)([(0,a.MZ)({json:{type:Number,write:!0}})],on.prototype,"rows",void 0),(0,i._)([(0,a.MZ)({json:{type:Number,write:!0}})],on.prototype,"cols",void 0),(0,i._)([(0,a.MZ)({json:{name:"type",type:Number,write:!0}})],on.prototype,"convolutionType",null),(0,i._)([(0,a.MZ)({json:{type:[Number],write:!0}})],on.prototype,"kernel",void 0),on=rn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ConvolutionFunctionArguments")],on);const an=on;let ln=class extends A{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}get _normalizedKernel(){const{kernel:t,convolutionType:e}=this.functionArguments,n=t.reduce(((t,e)=>t+e));return-1===e||0===n||1===n?t:t.map((t=>t/n))}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(_).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==_.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const o=r.clone();o.pixelType=this.outputPixelType;const i=[_.none,_.sharpen,_.sharpen2,_.sharpening3x3,_.sharpening5x5];return(-1===t||"u8"!==this.outputPixelType&&!i.includes(t))&&(o.statistics=null,o.histograms=null),o.colormap=null,o.attributeTable=null,this.rasterInfo=o,{success:!0,supportsGPU:s.length<=25}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e||this.functionArguments.convolutionType===_.none)return e;const{rows:n,cols:s}=this.functionArguments,{_normalizedKernel:r}=this;return function(t,e){const n=function(t){const e=Math.sqrt(t.length),n=t.slice(0,e),s=[1];for(let n=1;n<e;n++){let r=null;for(let s=0;s<e;s++){const o=t[s+n*e],i=t[s];if(null==r)if(0===i){if(o)return{separable:!1,row:null,col:null}}else r=o/i;else if(o/i!==r)return{separable:!1,row:null,col:null}}if(null==r)return{separable:!1,row:null,col:null};s.push(r)}return{separable:!0,row:n,col:s}}(e.kernel),s=!1!==e.mirrorEdges,r=n.separable?function(t,e,n,s=!0){const{pixels:r,width:o,height:i,pixelType:a,mask:l}=t,u=r.length,c=[],p=e.length,h=n.length,m=Math.floor(p/2),f=Math.floor(h/2);for(let t=0;t<u;t++){let a=nn(r[t],o,i,m,l,e,!0);a=nn(a,o,i,f,l,n,!1),s&&tn(a,o,i,p,h),c.push(a)}return new y.A({width:o,height:i,pixelType:a,pixels:c,mask:l})}(t,n.row,n.col,s):function(t,e,n=!0){const{pixels:s,width:r,height:o,pixelType:i,mask:a}=t,l=s.length,u=[],{kernel:c,rows:p,cols:h}=e;for(let t=0;t<l;t++){const e=sn(s[t],r,o,p,h,a,c);n&&tn(e,r,o,p,h),u.push(e)}return new y.A({width:r,height:o,pixelType:i,pixels:u,mask:a})}(t,e,s),{outputPixelType:o}=e;return o&&r.clamp(o),r}(e,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(25);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:(0,u.hP)(this.outputPixelType)}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ln.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:an,json:{write:!0,name:"rasterFunctionArguments"}})],ln.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],ln.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],ln.prototype,"_normalizedKernel",null),ln=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ConvolutionFunction")],ln);const un=ln;var cn;const pn=new Ut.J({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let hn=cn=class extends h{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return pn.fromJSON(e.type??e.curvatureType??0)}clone(){return new cn({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};(0,i._)([(0,a.MZ)({json:{write:{target:"type"}}}),(0,Vt.e)(pn)],hn.prototype,"curvatureType",void 0),(0,i._)([(0,ye.w)("curvatureType",["type","curvatureType"])],hn.prototype,"readCurvatureType",null),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],hn.prototype,"zFactor",void 0),hn=cn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],hn);const mn=hn;let fn=class extends A{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:o}=t,i=o?.[0],a=i??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),l=this.isGCS&&n>=1?n*Ot.rk:n;return(0,Ot.E0)(e,{zFactor:l,curvatureType:s,resolution:a})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Ot.rk:t}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],fn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:mn,json:{write:!0,name:"rasterFunctionArguments"}})],fn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],fn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],fn.prototype,"isGCS",void 0),fn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.CurvatureFunction")],fn);const dn=fn;var gn;let yn=gn=class extends h{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Jt.Wb.bestMatch}clone(){return new gn({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],yn.prototype,"bandIds",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],yn.prototype,"bandNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],yn.prototype,"bandWavelengths",void 0),(0,i._)([(0,Vt.e)({0:"name",1:"wavelength",2:"id"})],yn.prototype,"method",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],yn.prototype,"missingBandAction",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],yn.prototype,"wavelengthMatchTolerance",void 0),yn=gn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],yn);const xn=yn;let wn=class extends A{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:o,bandIds:i,missingBandAction:a}=t,l=r?.length&&("name"===s||"id"!==s&&!i?.length),u=o?.length&&("wavelength"===s||"id"!==s&&!i?.length),c=a===Jt.Wb.fail,p=l?function(t,e){const n=t.bandInfos.map((({name:t})=>t.toLowerCase())),s=[];for(let t=0;t<e.length;t++){const r=e[t].toLowerCase();let o=n.indexOf(r);if(-1===o&&"nearinfrared"===r&&(o=n.findIndex((t=>t.startsWith("nearinfrared_1"))),-1===o&&(o=n.findIndex((t=>t.startsWith("nearinfrared"))))),-1===o)return null;s.push(o)}return s}(n,r):u?function(t,e,{wavelengthMatchTolerance:n},s){const{bandInfos:r}=t,o=[];for(let t=0;t<r.length;t++){const{minWavelength:e,maxWavelength:n}=r[t];if(!e||!n)return null;o.push({minWavelength:e,maxWavelength:n})}const i=[];for(let t=0;t<e.length;t++){const r=e[t];let a=!1,l=-1,u=Number.MAX_VALUE;for(let t=0;t<o.length;t++){const e=o[t],n=r>=e.minWavelength&&r<=e.maxWavelength,s=Math.abs(r-(e.minWavelength+e.maxWavelength)/2);n?s<u&&(a=!0,l=t,u=s):!a&&s<u&&(l=t,u=s)}if(!a&&n&&u<n&&(a=!0),!a&&s)return null;i.push(l)}return i}(n,o,this.functionArguments,c):function(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some((t=>t<0||t>=s))?null:e}(n,i,c);if(null==p)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${l?"band names":u?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const h=n.clone();h.pixelType=this.outputPixelType,h.bandCount=p.length;const{statistics:m,histograms:f}=h;null!=m&&m.length&&(h.statistics=p.map((t=>m[t]||m[m.length-1]))),null!=f&&f.length&&(h.histograms=p.map((t=>f[t]||f[f.length-1]))),h.multidimensionalInfo&&h.multidimensionalInfo.variables.forEach((t=>{const{statistics:e,histograms:n}=t;null!=e&&e.length&&(t.statistics=p.map((t=>e[t]||e[e.length-1]))),null!=n&&n.length&&(t.histograms=p.map((t=>n[t]||n[n.length-1])))}));let d=h.keyProperties?.BandProperties;return d?.length&&(d=p.map((t=>t>=d.length?d[d.length-1]:d[t])),h.keyProperties={...h.keyProperties,BandProperties:d}),this.rasterInfo=h,{success:!0,supportsGPU:h.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map((t=>t>=n?n-1:t));return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],0===t.length?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:Yt(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map((t=>t>=e?e-1:t)).map((e=>t[e]))}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],wn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:xn,json:{write:!0,name:"rasterFunctionArguments"}})],wn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],wn.prototype,"rasterArgumentNames",void 0),wn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ExtractBandFunction")],wn);const vn=wn;var An;let _n=An=class extends h{clone(){return new An({conversionParameters:[...this.conversionParameters],raster:this.raster})}};(0,i._)([(0,a.MZ)({type:[Number],json:{write:!0}})],_n.prototype,"conversionParameters",void 0),_n=An=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.GrayscaleFunctionArguments")],_n);const bn=_n;let Mn=class extends A{constructor(){super(...arguments),this.functionName="Grayscale",this.functionArguments=null,this.rasterArgumentNames=["raster"]}get _normalizedWeights(){const{conversionParameters:t}=this.functionArguments,e=t.reduce(((t,e)=>t+e));return t.map((t=>t/e))}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const n=3===t.length||3===e.bandCount&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:function(t,e,n){const{pixels:s,width:r,height:o,mask:i,bandMasks:a}=t,l=r*o,c=a?.length?y.A.combineBandMasks(a):i,p=Math.min(e.length,s.length),h=n.startsWith("f"),m=!h&&n!==t.pixelType,[f,d]=(0,u.hP)(n),g=y.A.createEmptyBand(n,l);for(let t=0;t<o;t++){let n=t*r;for(let t=0;t<r;t++,n++)if(!c||c[n]){let t=0;for(let r=0;r<p;r++)t+=e[r]*s[r][n];h||(t=Math.round(t),m&&(t=t>d?d:t<f?f:t)),g[n]=t}}const x=new y.A({width:r,height:o,pixels:[g],pixelType:n,mask:c});return x.updateStatistics(),x}(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Mn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:bn,json:{write:!0,name:"rasterFunctionArguments"}})],Mn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Mn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],Mn.prototype,"_normalizedWeights",null),Mn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.GrayscaleFunction")],Mn);const Tn=Mn;var Pn;const Nn=new Ut.J({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Rn=new Ut.J({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let Fn=Pn=class extends h{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Pn({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Fn.prototype,"altitude",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Fn.prototype,"azimuth",void 0),(0,i._)([(0,a.MZ)(),(0,Vt.e)(Nn)],Fn.prototype,"hillshadeType",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0,name:"psPower"}})],Fn.prototype,"pixelSizePower",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0,name:"psZFactor"}})],Fn.prototype,"pixelSizeFactor",void 0),(0,i._)([(0,a.MZ)(),(0,Vt.e)(Rn)],Fn.prototype,"slopeType",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Fn.prototype,"zFactor",void 0),(0,i._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Fn.prototype,"removeEdgeEffect",void 0),Fn=Pn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.HillshadeFunctionArguments")],Fn);const Cn=Fn;let kn=class extends A{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],o=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}),i=(0,Ot.PP)(this.functionArguments,o,this.isGCS),a=(0,Ot.fw)(e,i);return a.pixelType=this.outputPixelType,a}_getWebGLParameters(){const t=(0,Ot.PP)(this.functionArguments,{x:1,y:1},this.isGCS),e=(0,Ot.ng)(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:o}=this.functionArguments,i="scaled"===n,a=(0,u.zw)(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?Ot.rk:1,pixelSizeFactor:i?r:0,pixelSizePower:i?o:0,isOutputRounded:a}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],kn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Cn,json:{write:!0,name:"rasterFunctionArguments"}})],kn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],kn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],kn.prototype,"isGCS",void 0),kn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.HillshadeFunction")],kn);const Sn=kn;var In;let jn=In=class extends h{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map((t=>"number"==typeof t||"string"==typeof t?t:t.toJSON()))}clone(){return new In({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,o.o8)(this.rasters)})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],jn.prototype,"operation",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],jn.prototype,"rasters",void 0),(0,i._)([(0,Be.K)("rasters")],jn.prototype,"writeRasters",null),(0,i._)([(0,a.MZ)({json:{write:!0}})],jn.prototype,"processAsMultiband",void 0),jn=In=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.LocalFunctionArguments")],jn);const Bn=jn;let Zn=class extends A{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some((t=>t.bandCount!==n)))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:o}=this.functionArguments,i=F[r];if(!(999===i||o.length===i||o.length<=1&&1===i))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${i}`};const a=e.clone();return a.bandCount=999!==i||s?n:1,this._removeStatsHistColormapVAT(a),this._updateStatistics(a),this._updatePixelType(a),this.rasterInfo=a,{success:!0,supportsGPU:1===a.bandCount&&i<=3}}_processPixels(t){const{pixelBlocks:e}=t;return null==e||e.some((t=>null==t))?null:It(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=F[t],n=Object.keys(P).find((e=>P[e]===t))?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,o]=(0,u.hP)(s);const i=(0,u.zw)(s);return i&&(r-=1e-4,o+=1e-4),{imageCount:e,operationName:n,domainRange:[r,o],isOutputRounded:i}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=R(n)?.domain;if(s){t.statistics=[];for(let e=0;e<t.bandCount;e++)t.statistics[e]={min:s[0],max:s[1],avg:(s[0]+s[1])/2,stddev:(s[0]+s[1])/10}}else 45===n&&e.statistics?.length&&(t.statistics=e.statistics.map((t=>({min:-t.max,max:-t.min,avg:null!=t.avg?-t.avg:void 0,stddev:null!=t.stddev?-t.stddev:void 0}))))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:o}=R(s)??{domain:null,isInteger:!1};let i="f32";if(r&&o)i=(0,u.X1)(r[0],r[1]);else if(30===s){const t=e?.[0];i=t?(0,u.X1)(t.min,t.max):(0,u.zw)(n)?n:"s32"}else if(45===s&&(0,u.zw)(n)){const t=e?.map((({max:t})=>-t)),s=e?.map((({min:t})=>-t)),r=t?.length?Math.min(...t):null,o=s?.length?Math.min(...s):null;i=null!=r&&null!=o?(0,u.X1)(r,o):n.startsWith("s")?n.replace("s","u"):"u1"===n||"u2"===n||"u4"===n?"s8":"u8"===n?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(i)}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Zn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Bn,json:{write:!0,name:"rasterFunctionArguments"}})],Zn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Zn.prototype,"rasterArgumentNames",void 0),Zn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.LocalFunction")],Zn);const Gn=Zn;var zn,On=n(34727);let En=zn=class extends h{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Jt.IB.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map((t=>{if("number"==typeof t)return e=!0,[t];if("string"==typeof t){const n=t.trim().split(" ").filter((t=>""!==t.trim())).map((t=>Number(t)));return e=e||n.length>0,0===n.length?null:n}return null}));return e?n:null}clone(){return new zn({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],En.prototype,"includedRanges",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],En.prototype,"noDataValues",void 0),(0,i._)([(0,a.MZ)()],En.prototype,"normalizedNoDataValues",null),(0,i._)([(0,a.MZ)({json:{write:!0}})],En.prototype,"noDataInterpretation",void 0),En=zn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.MaskFunctionArguments")],En);const Dn=En;let Vn=class extends A{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let o=0;o<t.bandCount;o++){const t=(0,Jt.Wt)(e,n?.slice(2*o,2*o+2),s?.[o]);if(null==t){r=null;break}r.push(t)}this.lookups=r;const o=null!=s&&s.every((t=>t?.length===s[0]?.length));return{success:!0,supportsGPU:(!n||n.length<=2*Jt.et)&&(!s||o&&s[0].length<=Jt.et)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:o,normalizedNoDataValues:i}=this.functionArguments,a=o===Jt.IB.matchAll;return(0,Jt.dK)(e,{includedRanges:r,noDataValues:i,outputPixelType:n,matchAll:a,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(Jt.et);n.fill(On.pq),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(Jt.et);for(let e=0;e<s.length;e+=2)s[e]=t?.[e]??-On.pq,s[e+1]=t?.[e+1]??On.pq;return t?.length&&s.set(t),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:n,includedRanges:s}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Vn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Dn,json:{write:!0,name:"rasterFunctionArguments"}})],Vn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Vn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Vn.prototype,"lookups",void 0),Vn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.MaskFunction")],Vn);const Un=Vn;var Ln;let Wn=Ln=class extends h{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this;return new Ln({visibleBandID:t,infraredBandID:e,scientificOutput:n})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Wn.prototype,"visibleBandID",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Wn.prototype,"infraredBandID",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Wn.prototype,"scientificOutput",void 0),Wn=Ln=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.NDVIFunctionArguments")],Wn);const $n=Wn;let Hn=class extends A{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t,visibleBandID:e,infraredBandID:n}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const s=this.sourceRasterInfos[0],r=Math.max(e,n);if(s.bandCount<2||r>=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const o=s.clone();o.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(o),o.bandCount=1,o.keyProperties={...o.keyProperties,BandProperties:void 0};const[i,a,l,u]=t?[-1,1,0,.1]:[0,200,100,10];return o.statistics=[{min:i,max:a,avg:l,stddev:u}],this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return function(t,e,n,s){const{mask:r,pixels:o,width:i,height:a}=t,l=o[n],u=o[e],c=u.length,p=s?new Uint8Array(c):new Float32Array(c),h=s?100:1,m=s?100.5:0;for(let t=0;t<c;t++)if(null==r||r[t]){const e=l[t],n=u[t],s=e+n;s&&(p[t]=(e-n)/s*h+m)}const f=new y.A({width:i,height:a,mask:r,pixelType:s?"u8":"f32",pixels:[p]});return f.updateStatistics(),f}(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments;return{bandIndexMat3:Yt(this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0]),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map((e=>t[e]))}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Hn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:$n,json:{write:!0,name:"rasterFunctionArguments"}})],Hn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Hn.prototype,"rasterArgumentNames",void 0),Hn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.NDVIFunction")],Hn);const qn=Hn;var Jn;let Kn=Jn=class extends h{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new Jn({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Kn.prototype,"inputRanges",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Kn.prototype,"outputValues",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Kn.prototype,"noDataRanges",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Kn.prototype,"allowUnmatched",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Kn.prototype,"isLastInputRangeInclusive",void 0),Kn=Jn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.RemapFunctionArguments")],Kn);const Xn=Kn;let Yn=class extends A{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,outputValues:r,inputRanges:o,noDataRanges:i,isLastInputRangeInclusive:a}=this.functionArguments;if(null!=n&&n.length&&r?.length)if(s){const e=Math.min.apply(null,[...r,n[0].min]),s=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:e,max:s}]}else{let e=r[0],s=e;for(let t=0;t<r.length;t++)e=e>r[t]?r[t]:e,s=s>r[t]?s:r[t];t.statistics=[{...n[0],min:e,max:s}]}return this.rasterInfo=t,this.lookup=s?null:(0,Jt.XU)({srcPixelType:e,inputRanges:o,outputValues:r,noDataRanges:i,allowUnmatched:s,isLastInputRangeInclusive:a,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=Jt.et)&&(!i||i.length<=Jt.et)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:n,outputPixelType:s}=this;if(n){const t=(0,Jt.eH)(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return null!=t&&n.mask&&(t.mask=(0,Jt.UK)(e.pixels[0],e.mask,n.mask,n.offset,"u8")),t}const{inputRanges:r,outputValues:o,noDataRanges:i,allowUnmatched:a,isLastInputRangeInclusive:l}=this.functionArguments;return(0,Jt.Ew)(e,{inputRanges:r,outputValues:o,noDataRanges:i,outputPixelType:s,allowUnmatched:a,isLastInputRangeInclusive:l})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*Jt.et),r=1e-5,o=this.functionArguments.inputRanges??[],i=this.functionArguments.outputValues??[],a=i.length;for(let t=0;t<Jt.et;t++)s[3*t]=o[2*t]??On.pq-1,s[3*t+1]=o[2*t+1]??On.pq,s[3*t+2]=i[t]??0,t<a&&(t>0&&(s[3*t]-=r),(t<a-1||!n)&&(s[3*t+1]-=r));const l=new Float32Array(2*Jt.et);return l.fill(On.pq),e?.length&&l.set(e),{allowUnmatched:t,rangeMaps:s,noDataRanges:l,clampRange:(0,u.hP)(this.outputPixelType)}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Yn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Xn,json:{write:!0,name:"rasterFunctionArguments"}})],Yn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Yn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Yn.prototype,"lookup",void 0),Yn=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.RemapFunction")],Yn);const Qn=Yn;var ts;let es=ts=class extends Cn{readColorRamp(t){if("string"==typeof t){const e=xe.kH.jsonValues.find((e=>e.toLowerCase()===t.toLowerCase()));return e?(0,xe.M5)(xe.kH.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new ts({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],es.prototype,"colorRamp",void 0),(0,i._)([(0,ye.w)("colorRamp")],es.prototype,"readColorRamp",null),(0,i._)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],es.prototype,"colormap",void 0),es=ts=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],es);const ns=es;let ss=class extends A{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:n}=this.functionArguments;if(!e&&!n?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone();this._removeStatsHistColormapVAT(s),s.pixelType=this.outputPixelType,s.bandCount=3,s.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=s,this.isGCS=s.spatialReference?.isGeographic??!1,n?.length||(n=(0,xe.R8)(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:o}=(0,Jt.zg)({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const i=(0,xe.S2)(r);return this.lookup={indexedColormap:r,offset:o,hsvMap:i},{success:!0,supportsGPU:(0,ke.WN)(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let n=t.primaryPixelSizes?.[0];if(null==n){const{extent:s}=t;n=s?{x:s.width/e.width,y:s.height/e.height}:{x:1,y:1}}const s=(0,Ot.PP)(this.functionArguments,n,this.isGCS),r=(0,Ot.fw)(e,s),o=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return(0,Ot.SC)(r,e,this.lookup.hsvMap,o),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=(0,Ot.PP)(this.functionArguments,{x:1,y:1},this.isGCS),e=(0,Ot.ng)(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:o}=this.functionArguments,i="scaled"===n,{indexedColormap:a,offset:l}=this.lookup,c=this.sourceRasterInfos[0].statistics?.[0],p=(0,u.zw)(this.outputPixelType);return{...e,indexedColormap:a,offset:l,zFactor:s,gcsFactor:this.isGCS?Ot.rk:1,pixelSizeFactor:i?r:0,pixelSizePower:i?o:0,minValue:c?.min??0,maxValue:c?.max??8e3,isOutputRounded:p}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ss.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:ns,json:{write:!0,name:"rasterFunctionArguments"}})],ss.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],ss.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],ss.prototype,"isGCS",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],ss.prototype,"lookup",void 0),ss=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.ShadedReliefFunction")],ss);const rs=ss;var os;const is=new Ut.J({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let as=os=class extends h{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new os({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,i._)([(0,Vt.e)(is)],as.prototype,"slopeType",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],as.prototype,"zFactor",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"psPower",write:!0}})],as.prototype,"pixelSizePower",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"psZFactor",write:!0}})],as.prototype,"pixelSizeFactor",void 0),(0,i._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],as.prototype,"removeEdgeEffect",void 0),as=os=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],as);const ls=as;let us=class extends A{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics="percent-rise"!==this.functionArguments.slopeType?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o}=this.functionArguments,{isGCS:i}=this,{extent:a,primaryPixelSizes:l}=t,u=l?.[0],c=u??(a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1});return(0,Ot.yy)(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:o,isGCS:i,resolution:c})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Ot.rk:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:(0,u.zw)(this.outputPixelType)}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],us.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:ls,json:{write:!0,name:"rasterFunctionArguments"}})],us.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],us.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],us.prototype,"isGCS",void 0),us=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.SlopeFunction")],us);const cs=us,ps=new Ut.J({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function hs(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{statisticsType:l,kernelRows:u,kernelCols:c}=e,p="stddev"===l,h=r*o,m=new Float64Array(h),f=new Float64Array(h),d=new Uint32Array(h);for(let t=0;t<o;t++){const e=t*r;let n=0,o=0,a=0;for(let t=0;t<c;t++)i&&!i[e+t]||(n+=s[e+t],p&&(o+=s[e+t]**2),a++);m[e]=n,f[e]=o,d[e]=a;for(let t=1;t<=r-c;t++){const r=e+t-1,l=r+c;i?(i[r]&&(a--,n-=s[r],p&&(o-=s[r]**2)),i[l]&&(a++,n+=s[l],p&&(o+=s[l]**2))):(n-=s[r],n+=s[l],p&&(o-=s[r]**2,o+=s[l]**2)),m[e+t]=n,d[e+t]=a,p&&(f[e+t]=o)}}const g=new Float64Array(h),y=new Float64Array(h),x=new Uint32Array(h),w=u*r;for(let t=0;t<=r-c;t++){let e=0,n=0,s=0;for(let o=0;o<u;o++){const i=o*r+t;e+=m[i],s+=d[i],p&&(n+=f[i])}g[t]=e,y[t]=n,x[t]=s;for(let i=1;i<=o-u;i++){const o=(i-1)*r+t,a=o+w;e-=m[o],e+=m[a],s-=d[o],s+=d[a],p&&(n-=f[o],n+=f[a]),g[i*r+t]=e,y[i*r+t]=n,x[i*r+t]=s}}const v=Math.floor(u/2),A=Math.floor(c/2);for(let t=v;t<o-v;t++){const e=t*r;for(let s=A;s<r-A;s++){const o=(t-v)*r+s-A,l=x[o];if(0===l||n&&(!i||i[e+s]))continue;const u=g[o]/l,c=p?Math.sqrt((y[o]-g[o]*u)/l):u;a[e+s]=c,i&&(i[e+s]=255)}}}function ms(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:l,kernelCols:u,statisticsType:c}=e,p=Math.floor(l/2),h=Math.floor(u/2),m="min"===c,f=a.slice(),d=new Uint32Array(r*o);for(let t=p;t<o-p;t++){const e=t*r;for(let t=h;t<r-h;t++){let n=m?Number.MAX_VALUE:-Number.MAX_VALUE,o=0;for(let a=0;a<l;a++)for(let l=0;l<u;l++){const u=e+t+(a-p)*r+l-h;i&&!i[u]||(n=m?Math.min(n,s[u]):Math.max(n,s[u]),o++)}i?(f[e+t]=0===o?0:n,d[e+t]=o):a[e+t]=0===o?0:n}}if(i)for(let t=p;t<o-p;t++){const e=t*r;for(let t=h;t<r-h;t++)if(d[e+t]){if(n&&i[e+t])continue;a[e+t]=f[e+t],i[e+t]=255}}}function fs(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:l,kernelCols:u}=e,c=Math.floor(l/2),p=Math.floor(u/2),h=a.slice(),m=new Uint32Array(r*o);for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++){if(n&&i?.[e+t])continue;const o=[];for(let n=0;n<l;n++)for(let a=0;a<u;a++){const l=e+t+(n-c)*r+a-p;i&&!i[l]||o.push(s[l])}o.length&&(o.sort(((t,e)=>t-e)),i?(h[e+t]=o[Math.floor((o.length-1)/2)],m[e+t]=o.length):a[e+t]=o[Math.floor((o.length-1)/2)])}}if(i)for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++)if(m[e+t]){if(n&&i[e+t])continue;a[e+t]=h[e+t],i[e+t]=255}}}function ds(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:o,mask:i,outBand:a}=t;if(n&&!i)return void a.set(s);const{kernelRows:l,kernelCols:u}=e,c=Math.floor(l/2),p=Math.floor(u/2),h="majority"===e.statisticsType,m=l*u,f=a.slice(),d=new Uint32Array(r*o);for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++){if(n&&i?.[e+t])continue;const o=new Map;for(let n=0;n<l;n++)for(let a=0;a<u;a++){const l=e+t+(n-c)*r+a-p;if(i&&!i[l])continue;const u=s[l];o.set(u,o.has(u)?o.get(u)+1:1)}if(0===o.size)continue;let g=0,y=0,x=h?0:m+1;for(const t of o.keys())y=o.get(t),h===y>x&&(x=y,g=t);i?(f[e+t]=g,d[e+t]=o.size):a[e+t]=g}}if(i)for(let t=c;t<o-c;t++){const e=t*r;for(let t=p;t<r-p;t++)if(d[e+t]){if(n&&i[e+t])continue;a[e+t]=f[e+t],i[e+t]=255}}}var gs;let ys=gs=class extends h{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new gs({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:(0,o.o8)(this.raster)})}};(0,i._)([(0,a.MZ)({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],ys.prototype,"rows",void 0),(0,i._)([(0,a.MZ)({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],ys.prototype,"cols",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],ys.prototype,"fillNoDataOnly",void 0),(0,i._)([(0,a.MZ)({json:{read:{source:["statisticsType","type"],reader:(t,e)=>ps.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),(0,Vt.e)(ps)],ys.prototype,"statisticsType",void 0),ys=gs=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],ys);const xs=ys;let ws=class extends A{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return"stddev"===s&&this._removeStatsHistColormapVAT(n),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:o}=this.functionArguments;return function(t,e){const{mask:n}=t,{fillNoDataOnly:s}=e;if(s&&!n)return t;const{pixels:r,width:o,height:i,bandMasks:a,pixelType:l}=t,u=r.length,c=o*i,p=[],{kernelRows:h,kernelCols:m,statisticsType:f,mirrorEdges:d}=e;if(s&&!n)return t;const g=e.outputPixelType??l,x=[];for(let t=0;t<u;t++){const l=r[t],u=y.A.createEmptyBand(g,c);s&&u.set(l);const w=a?.[t]??n,v=w?.slice()??null,A={band:l,width:o,height:i,mask:v,outBand:u};switch(f){case"min":case"max":ms(A,e);break;case"mean":case"stddev":hs(A,e);break;case"median":fs(A,e);break;case"majority":case"minority":ds(A,e)}d&&!s&&tn(u,o,i,h,m),p.push(u),v&&x.push(v)}let w=x[0]??n;x.length!==u&&(x.length=0),u>1&&a?.length&&(w=y.A.combineBandMasks(a));const v=new y.A({pixelType:g,width:o,height:i,pixels:p,bandMasks:a&&x.length?x:null,mask:w});return v.updateStatistics(),v}(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:o,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:(0,u.hP)(this.outputPixelType)}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],ws.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:xs,json:{write:!0,name:"rasterFunctionArguments"}})],ws.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],ws.prototype,"rasterArgumentNames",void 0),ws=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.StatisticsFunction")],ws);const vs=ws;var As;let _s=As=class extends h{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach((t=>{const e={min:t.min,max:t.max,avg:t.avg??t.mean,stddev:t.stddev??t.standardDeviation};n.push(e)})),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach((t=>{const e={...t,mean:t.avg,standardDeviation:t.stddev};delete e.avg,delete e.stddev,s.push(e)})),e[n]=s}clone(){return new As({statistics:(0,o.o8)(this.statistics),histograms:(0,o.o8)(this.histograms)})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],_s.prototype,"statistics",void 0),(0,i._)([(0,ye.w)("statistics")],_s.prototype,"readStatistics",null),(0,i._)([(0,Be.K)("statistics")],_s.prototype,"writeStatistics",null),(0,i._)([(0,a.MZ)({json:{write:!0}})],_s.prototype,"histograms",void 0),_s=As=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],_s);const bs=_s;let Ms=class extends A{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ms.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:bs,json:{write:!0,name:"rasterFunctionArguments"}})],Ms.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Ms.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Ms.prototype,"indexedColormap",void 0),(0,i._)([(0,a.MZ)()],Ms.prototype,"isNoopProcess",void 0),Ms=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],Ms);const Ts=Ms;var Ps;const Ns=new Ut.J({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let Rs=Ps=class extends h{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map((t=>[t.min,t.max,t.avg,t.stddev]))),e[n]=t)}clone(){return new Ps({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:(0,o.o8)(this.statistics),gamma:(0,o.o8)(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:(0,o.o8)(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};(0,i._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Rs.prototype,"computeGamma",void 0),(0,i._)([(0,a.MZ)({type:Boolean,json:{name:"dra",write:!0}})],Rs.prototype,"dynamicRangeAdjustment",void 0),(0,i._)([(0,a.MZ)({type:[Number],json:{write:!0}})],Rs.prototype,"gamma",void 0),(0,i._)([(0,a.MZ)()],Rs.prototype,"histograms",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Rs.prototype,"maxPercent",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Rs.prototype,"minPercent",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Rs.prototype,"numberOfStandardDeviations",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"max",write:!0}})],Rs.prototype,"outputMax",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"min",write:!0}})],Rs.prototype,"outputMin",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Rs.prototype,"sigmoidStrengthLevel",void 0),(0,i._)([(0,a.MZ)({json:{type:[[Number]],write:!0}})],Rs.prototype,"statistics",void 0),(0,i._)([(0,Be.K)("statistics")],Rs.prototype,"writeStatistics",null),(0,i._)([(0,Vt.e)(Ns)],Rs.prototype,"stretchType",void 0),(0,i._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Rs.prototype,"useGamma",void 0),Rs=Ps=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.StretchFunctionArguments")],Rs);const Fs=Rs;let Cs=class extends A{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:o}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const s=(0,Xe.DP)(n.toJSON(),{rasterInfo:t}),i=(0,u.zw)(this.outputPixelType)?"round":"float";this.lookup=(0,Xe.RP)({pixelType:e,...s,gamma:o?r:null,rounding:i}),this.cutOffs=s}else s||(this.cutOffs=(0,Xe.DP)(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const i=t.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),"u8"===this.outputPixelType&&(i.keyProperties.DataType="processed");const{outputMin:a=0,outputMax:l=255}=this.functionArguments;i.statistics=[];for(let t=0;t<i.bandCount;t++)i.statistics[t]={min:a,max:l};return this.rasterInfo=i,{success:!0,supportsGPU:!s}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return e;const{lookup:n}=this;if(n)return(0,Jt.eH)(e,{...n,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:s}=this,r=this.cutOffs||(0,Xe.DP)(s.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),o=s.useGamma?s.gamma:null;return(0,Xe._N)(e,{...r,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:n,useGamma:s}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,o=s&&n?.length?(0,Xe.Nh)(r,n):[1,1,1],{minCutOff:i,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===i.length&&(i[1]=i[2]=i[0],a[1]=a[2]=a[0]);const l=new Float32Array(r);let c;for(c=0;c<r;c++)l[c]=(e-t)/(a[c]-i[c]);const p=(0,u.zw)(this.outputPixelType);return{bandCount:r,outMin:t,outMax:e,minCutOff:i,maxCutOff:a,factor:l,useGamma:s,gamma:s&&n?n:[1,1,1],gammaCorrection:s&&o?o:[1,1,1],stretchType:this.functionArguments.stretchType,isOutputRounded:p,type:"stretch"}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Cs.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Fs,json:{write:!0,name:"rasterFunctionArguments"}})],Cs.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Cs.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Cs.prototype,"lookup",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Cs.prototype,"cutOffs",void 0),Cs=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.StretchFunction")],Cs);const ks=Cs;var Ss;let Is=Ss=class extends h{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new Ss({attributeTableAsRecordSet:(0,o.o8)(this.attributeTableAsRecordSet)})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Is.prototype,"attributeTableAsRecordSet",void 0),Is=Ss=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.TableFunctionArguments")],Is);const js=Is;let Bs=class extends A{constructor(){super(...arguments),this.functionName="Table",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,"thematic"!==n.dataType&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Bs.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:js,json:{write:!0,name:"rasterFunctionArguments"}})],Bs.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Bs.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],Bs.prototype,"isNoopProcess",void 0),Bs=(0,i._)([(0,l.$)("esri.layers.support.rasterFunctions.TableFunction")],Bs);const Zs=Bs,Gs=new Map;function zs(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster,n.raster2]).forEach((t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&zs(t,e))}))}function Os(t,e){if(e=e??{},"function"in(t=(0,o.o8)(t))&&"arguments"in t&&t.arguments){const n=$s(t,new Map,e);if(qs(n),!n.renderingRule)throw new r.A("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return Vs(t=Ds(t),e);throw new r.A("raster-function-helper","unsupported raster function json.")}function Es(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function Ds(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const t in n){let e=n[t];const r=t.toLowerCase();if("rasters"===r&&Array.isArray(e))s.rasters=e.map((t=>Es(t)?Ds(t):t));else switch(Es(e)&&(e=Ds(e)),r){case"dra":s.dra=e;break;case"pspower":s.psPower=e;break;case"pszfactor":s.psZFactor=e;break;case"bandids":s.bandIds=e;break;default:s[t[0].toLowerCase()+t.slice(1)]=e}}return"Local"!==e||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Vs(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,o=t.outputPixelType?.toLowerCase();if(null==n||!Gs.has(n))throw new r.A("raster-function-helper",`unsupported raster function: ${n}`);const i=Gs.get(n),a=("function"==typeof i.ctor?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:o}),{rasterArgumentNames:l}=a,u=[],c=function(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map((e=>t[e]))}(s,l),p="rasters"===l[0]||l.length>1,h=[];for(let t=0;t<c.length;t++){const n=c[t];let s;null==n||"string"==typeof n&&n.startsWith("$")?u.push(e?.raster):"string"==typeof n?e[n]&&u.push(e[n]):"number"!=typeof n&&"rasterFunction"in n&&(s=Vs(n,e),p||(a.functionArguments[l[t]]=s),u.push(s)),p&&h.push(s??n)}if(p&&("rasters"===l[0]?a.functionArguments.rasters=h:l.forEach(((t,e)=>{a.functionArguments[t]=h[e]}))),e){a.sourceRasters=u;const t=e.raster?.url;t&&(a.mainPrimaryRasterId=t)}return a}function Us(t,e){if(t&&e)for(const n in t){const s=t[n];s&&"object"==typeof s&&"type"in s&&("RasterFunctionTemplate"===s.type?Us(s.arguments,e):"RasterFunctionVariable"===s.type&&null!=e[s.name]&&(s.value=e[s.name]))}}function Ls(t,e){if(!t||"object"!=typeof t)return t;const{value:n}=t;if(!n||"object"!=typeof n)return t.isDataset?"$$":n;if(Array.isArray(n))return 0===n.length?[]:n.map((t=>"object"==typeof t&&"RasterFunctionVariable"===t.type?Ls(t,e):t));if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&"Scalar"!==n.type)return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=Ws(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(Ws)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let s=0;s<n.elements.length;s++){const o=n.elements[s],{type:i}=o;if(i)if("RasterFunctionTemplate"===i){const{renderingRule:n}=$s(o,e);t.push(n),null!=o._object_id&&e.set(o._object_id,n)}else{if("RasterFunctionVariable"!==i)throw new r.A("raster-function-helper","unsupported raster function json.");{const n=Ls(o,e);t.push(n),null!=o._object_id&&e.set(o._object_id,n)}}else t.push(o)}s=t}else s=n.elements}return null!=n._object_id&&e.set(n._object_id,s),s}function Ws(t){const e=t.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:r}=t;if(!Array.isArray(n)){const{r:t,g:e,b:r}=(0,s.$)({h:n.Hue,s:n.Saturation,v:n.Value});n=[t,e,r,n.AlphaValue]}if(!Array.isArray(r)){const{r:t,g:e,b:n}=(0,s.$)({h:r.Hue,s:r.Saturation,v:r.Value});r=[t,e,n,r.AlphaValue]}return{type:"algorithmic",algorithm:e,fromColor:n,toColor:r}}function $s(t,e,n){n&&Us(t,n);const s={renderingRule:{},templates:e};return Hs(t,s),s}function Hs(t,e){if(!t||!e.renderingRule)return;const{renderingRule:n,templates:s}=e,{function:r,arguments:o,_object_id:i}=t;if(!r||!o)return;null!=i&&s.set(i,n),n.rasterFunction=r.type.replace("Function",""),n.outputPixelType=r.pixelType;const a={};n.rasterFunctionArguments=a;for(const t in o){if("type"===t||"object_id"===t||"_object_ref_id"===t)continue;const e=o[t];e&&"object"==typeof e&&"type"in e&&("RasterFunctionTemplate"===e.type||"RasterFunctionVariable"===e.type)?("RasterFunctionVariable"===e.type?a[t]=Ls(e,s):(n.rasterFunctionArguments[t]={},Hs(e,{renderingRule:n.rasterFunctionArguments[t],templates:s})),null!=e._object_id&&s.set(e._object_id,a[t])):a[t]=e}switch(a.DEM&&!a.Raster&&(a.Raster=a.DEM,delete a.DEM),n.rasterFunction){case"Stretch":!function(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map((t=>[t.min,t.max,t.mean,t.standardDeviation]))),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}(a);break;case"Colormap":!function(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}(a);break;case"Convolution":!function(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}(a);break;case"Mask":!function(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter((t=>""!==t)).map((t=>Number(t))))}(a)}}function qs(t){const{renderingRule:e,templates:n}=t;if("object"!=typeof e||!e?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:s}=e;for(const t in s){const e=s[t],o="_object_ref_id"===t?e:e&&"object"==typeof e&&"_object_ref_id"in e?e._object_ref_id:null;if(null==o)e&&"object"==typeof e&&(e.rasterFunctionArguments&&qs({renderingRule:e,templates:n}),Array.isArray(e)&&e.forEach(((t,s)=>{if("object"==typeof t)if(null!=t._object_ref_id){if(!n.has(t._object_ref_id))throw new r.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${e} does not exist`);const i=n.get(o);i&&"object"==typeof i?Object.assign(t,i):e[s]=i}else qs({renderingRule:t,templates:n})})));else{if(!n.has(o))throw new r.A("raster-function-helper",`unsupported raster function json. _object_ref_id: ${o} does not exist`);const e=n.get(o);"_object_ref_id"!==t?s[t]=e:e&&"object"==typeof e&&Object.assign(s,e)}}}Gs.set("Arithmetic",{desc:"Arithmetic Function",ctor:Bt,rasterArgumentNames:["rasters"]}),Gs.set("Aspect",{desc:"Aspect Function",ctor:Dt,rasterArgumentNames:["raster"]}),Gs.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:oe,rasterArgumentNames:["raster"]}),Gs.set("Colormap",{desc:"Colormap Function",ctor:Pe,rasterArgumentNames:["raster"]}),Gs.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:Ie,rasterArgumentNames:["raster"]}),Gs.set("CompositeBand",{desc:"CompositeBand Function",ctor:Oe,rasterArgumentNames:["rasters"]}),Gs.set("ComputeChange",{desc:"ComputeChange Function",ctor:He,rasterArgumentNames:["rasters"]}),Gs.set("Convolution",{desc:"Convolution Function",ctor:un,rasterArgumentNames:["raster"]}),Gs.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Qe,rasterArgumentNames:["raster"]}),Gs.set("ExtractBand",{desc:"ExtractBand Function",ctor:vn,rasterArgumentNames:["raster"]}),Gs.set("Curvature",{desc:"Curvature Function",ctor:dn,rasterArgumentNames:["raster"]}),Gs.set("Hillshade",{desc:"Hillshade Function",ctor:Sn,rasterArgumentNames:["raster"]}),Gs.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:rs,rasterArgumentNames:["raster"]}),Gs.set("Grayscale",{desc:"Grayscale Function",ctor:Tn,rasterArgumentNames:["raster"]}),Gs.set("Clip",{desc:"Clip Function",ctor:de,rasterArgumentNames:["raster"]}),Gs.set("Local",{desc:"Local Function",ctor:Gn,rasterArgumentNames:["rasters"]}),Gs.set("Mask",{desc:"Mask Function",ctor:Un,rasterArgumentNames:["raster"]}),Gs.set("NDVI",{desc:"NDVI Function",ctor:qn,rasterArgumentNames:["raster"]}),Gs.set("Remap",{desc:"Remap Function",ctor:Qn,rasterArgumentNames:["raster"]}),Gs.set("Slope",{desc:"Slope Function",ctor:cs,rasterArgumentNames:["raster"]}),Gs.set("Statistics",{desc:"Focal Statistics Function",ctor:vs,rasterArgumentNames:["raster"]}),Gs.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:Ts,rasterArgumentNames:["raster"]}),Gs.set("Stretch",{desc:"Stretch Function",ctor:ks,rasterArgumentNames:["raster"]}),Gs.set("Table",{desc:"Attribute Table Function",ctor:Zs,rasterArgumentNames:["raster"]})},70834:(t,e,n)=>{n.d(e,{DO:()=>U,FT:()=>O,Hh:()=>P,OM:()=>V,Ps:()=>H,Wo:()=>N,_I:()=>F,_l:()=>Z,l0:()=>L,t$:()=>q,uk:()=>G,xh:()=>d}),n(59456);var s,r,o=n(4576),i=n(49186),a=n(83047),l=n(83290),u=n(57251),c=n(21325),p=n(5443),h=n(39829),m=n(86738),f=n(16930);function d(t,e,n){return!(0,u.canProjectWithoutEngine)(t,e,n)}function g(t,e,n){const s=d(t,e,n);if(s&&!(0,u.isLoaded)())throw new i.A("rasterprojectionhelper-project","projection engine is not loaded");return s}(r=s||(s={}))[r.None=0]="None",r[r.North=1]="North",r[r.South=2]="South",r[r.Both=3]="Both";const y=(t,e,n,s=0)=>{if(1===n[0])return[0,0];let r=1,o=-1,i=1,a=-1;for(let e=0;e<t.length;e+=2)isNaN(t[e])||(r=r>t[e]?t[e]:r,o=o>t[e]?o:t[e],i=i>t[e+1]?t[e+1]:i,a=a>t[e+1]?a:t[e+1]);const{cols:l,rows:u}=e,c=(o-r)/l/n[0],p=(a-i)/u/n[1],h=2*s;let m=0,f=!1,d=[0,0];for(let e=0;e<l-3;e++){for(let n=0;n<u-3;n++){const s=e*u*2+2*n,r=(t[s]+t[s+4]+t[s+4*u]+t[s+4*u+4])/4,o=(t[s+1]+t[s+5]+t[s+4*u+1]+t[s+4*u+5])/4,i=Math.abs((r-t[s+2*u+2])/c),a=Math.abs((o-t[s+2*u+3])/p);if(i+a>m&&(m=i+a,d=[i,a]),h&&m>h){f=!0;break}}if(f)break}return d},x={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},w=32,v=4,A=v,_=new Map,b=new Map,M=500;let T=null;async function P(){T&&(0,u.isLoaded)()||((0,u.isLoaded)()||await(0,u.load)(),T=await Promise.all([n.e(9930),n.e(3209)]).then(n.bind(n,33209)))}function N(t,e,n,s=null){const r=t.spatialReference;if(!r||!e||r.equals(e))return t;g(r,e,s);const o=n.center,i=new p.A({xmin:o.x-t.x/2,xmax:o.x+t.x/2,ymin:o.y-t.y/2,ymax:o.y+t.y/2,spatialReference:r}),l=(0,u.project)(i,e,s),c=O(e);return null==l||null!=c&&l.width>=c?function(t,e,n){const s=(0,a.GA)(e)/(0,a.GA)(n);return{x:t.x*s,y:t.y*s}}(t,r,e):{x:l.width,y:l.height}}function R(t,e=.01){return(0,a.GA)(t)?e/(0,a.GA)(t):0}function F(t,e,n=null,s=!0){const r=t.spatialReference;if(r.equals(e))return t;g(r,e,n);const o=(0,u.project)(t,e,n);return s&&o?(C([t],[o],r,e),o):o}function C(t,e,n,s){const r=E(n,!0),o=E(s,!0),i=R(n,M),a=R(s,M);if(i&&null!=r&&null!=o)for(let n=0;n<t.length;n++){const s=e[n];if(!s)continue;const{x:l}=t[n],{x:u}=s;u>=o[1]-a&&Math.abs(l-r[0])<i?s.x-=o[1]-o[0]:u<=o[0]+a&&Math.abs(l-r[1])<i&&(s.x+=o[1]-o[0])}}function k(t){const{inSR:e,outSR:n,datumTransformation:s,preferPE:r}=t;if(e.equals(n)){const{points:e}=B(t,null);return e}if(e.isWebMercator&&n.isWGS84||e.isWGS84&&n.isWebMercator)return function(t){const{cols:e,rows:n,xres:s,yres:r,usePixelCenter:o,inSR:i,outSR:a}=t;let{xmin:l,ymax:c}=t;o&&(l+=s/2,c-=r/2);const p=[],h=[],f=Math.max(e,n);for(let t=0;t<f;t++){const o=l+s*Math.min(e,t),f=c-r*Math.min(n,t),d=(0,u.project)(new m.A({x:o,y:f,spatialReference:i}),a);t<=e&&p.push(d.x),t<=n&&h.push(d.y)}const d=[];for(let t=0;t<e;t++)for(let e=0;e<n;e++)d.push([p[t],h[e]]);return d}(t);if(g(e,n,s)&&r){if(e.isGeographic)return S(t);if(null!=I(e))return S(t)}return function(t){const{points:e}=B(t,null),{inSR:n,outSR:s,datumTransformation:r}=t,o=e.map((t=>new m.A(t[0],t[1],n))),i=(0,u.project)(o,s,r);return r&&C(o,i,n,s),i.map((t=>t?[t.x,t.y]:[NaN,NaN]))}(t)}function S(t){const{inSR:e,outSR:n,datumTransformation:s}=t,r=I(e),{points:o,mask:i}=B(t,r);if(!e.isGeographic){const t=e.wkid?l.P.coordsys(e.wkid):l.P.fromString(e.isGeographic?l.a.PE_TYPE_GEOGCS:l.a.PE_TYPE_PROJCS,e.wkt2||e.wkt);l.g.projToGeog(t,o.length,o)}if(null!=s&&s.steps.length){let t;const e=179.9955;if(n.isGeographic&&(t=o.map((([t])=>t>e?1:t<-e?-1:0))),s.steps.forEach((t=>{const e=t.wkid?l.P.geogtran(t.wkid):l.P.fromString(l.a.PE_TYPE_GEOGTRAN,t.wkt);l.h.geogToGeog(e,o.length,o,null,t.isInverse?l.a.PE_TRANSFORM_2_TO_1:l.a.PE_TRANSFORM_1_TO_2)})),t)for(let n=0;n<o.length;n++){const s=t[n],r=o[n][0],i=r>e?1:r<-e?-1:0;s&&i&&s!==i&&(o[n][0]=s>0?r+360:r-360)}}if(!n.isGeographic){const t=I(n,!0),e=null!=t&&t.isEnvelope?[t.bbox[1],t.bbox[3]]:[-90,90];!function(t,e){const[n,s]=e;for(let e=0;e<t.length;e++){const r=t[e][1];(r<n||r>s)&&(t[e]=[NaN,NaN])}}(o,e);const s=n.wkid?l.P.coordsys(n.wkid):l.P.fromString(n.isGeographic?l.a.PE_TYPE_GEOGCS:l.a.PE_TYPE_PROJCS,n.wkt2||n.wkt);l.g.geogToProj(s,o.length,o)}let a=o;if(i&&o.length!==i.length){a=[];for(let t=0,e=0;t<i.length;t++)i[t]?a.push(o[e++]):a.push([NaN,NaN])}return a}function I(t,e=!1){let n=t.wkid||t.wkt2||t.wkt;if(!n||t.isGeographic)return null;if(n=String(n),_.has(n)){const t=_.get(n);return e?t?.gcs:t?.pcs}const s=t.wkid?l.P.coordsys(t.wkid):l.P.fromString(t.isGeographic?l.a.PE_TYPE_GEOGCS:l.a.PE_TYPE_PROJCS,t.wkt2||t.wkt),r=j(s,R(t,1e-4)),o=j(s,0,!0);return _.set(n,{pcs:r,gcs:o}),e?o:r}function j(t,e=0,n=!1){const s=l.j.generate(t),r=n?t.horizonGcsGenerate():t.horizonPcsGenerate();if(!s||!r?.length)return null;let o=!1,i=r.find((t=>1===t.getInclusive()&&1===t.getKind()));if(!i){if(i=r.find((t=>1===t.getInclusive()&&0===t.getKind())),!i)return null;o=!0}const a=n?0:(2===s.getNorthPoleLocation()?1:0)|(2===s.getSouthPoleLocation()?2:0),u=s.isPannableRectangle(),c=i.getCoord();if(o)return{isEnvelope:o,isPannable:u,vertices:c,coef:null,bbox:[c[0][0]-e,c[0][1]-e,c[1][0]+e,c[1][1]+e],poleLocation:a};let p=0;const h=[];let[m,f]=c[0],[d,g]=c[0];for(let t=0,e=c.length;t<e;t++){p++,p===e&&(p=0);const[n,s]=c[t],[r,o]=c[p];if(o===s)h.push([n,r,s,o,2]);else{const t=(r-n)/(o-s||1e-4),e=n-t*s;s<o?h.push([t,e,s,o,0]):h.push([t,e,o,s,1])}m=m<n?m:n,f=f<s?f:s,d=d>n?d:n,g=g>s?g:s}return{isEnvelope:!1,isPannable:u,vertices:c,coef:h,bbox:[m,f,d,g],poleLocation:a}}function B(t,e){const n=[],{cols:s,rows:r,xres:o,yres:i,usePixelCenter:a}=t;let{xmin:l,ymax:u}=t;if(a&&(l+=o/2,u-=i/2),null==e){for(let t=0;t<s;t++)for(let e=0;e<r;e++)n.push([l+o*t,u-i*e]);return{points:n}}const c=new Uint8Array(s*r);if(e.isEnvelope){const{bbox:[t,a,p,h]}=e;for(let m=0,f=0;m<s;m++){const s=l+o*m,d=e.isPannable||s>=t&&s<=p;for(let t=0;t<r;t++,f++){const e=u-i*t;d&&e>=a&&e<=h&&(n.push([s,e]),c[f]=1)}}return{points:n,mask:c}}const p=e.coef,h=[];for(let t=0;t<r;t++){const e=u-i*t,n=[],s=[];for(let t=0;t<p.length;t++){const[r,o,i,a,l]=p[t];if(e===i&&i===a)n.push(r),n.push(o),s.push(2),s.push(2);else if(e>=i&&e<=a){const t=r*e+o;n.push(t),s.push(l)}}let r=n;if(n.length>2){let t=2===s[0]?0:s[0],e=n[0];r=[];for(let o=1;o<s.length;o++)2===s[o]&&o!==s.length-1||(s[o]!==t&&(r.push(0===t?Math.min(e,n[o-1]):Math.max(e,n[o-1])),t=s[o],e=n[o]),o===s.length-1&&r.push(0===s[o]?Math.min(e,n[o]):Math.max(e,n[o])));r.sort(((t,e)=>t-e))}else n[0]>n[1]&&(r=[n[1],n[0]]);h.push(r)}for(let t=0,e=0;t<s;t++){const s=l+o*t;for(let t=0;t<r;t++,e++){const r=u-i*t,o=h[t];if(2===o.length)s>=o[0]&&s<=o[1]&&(n.push([s,r]),c[e]=1);else if(o.length>2){let t=!1;for(let e=0;e<o.length;e+=2)if(s>=o[e]&&s<=o[e+1]){t=!0;break}t&&(n.push([s,r]),c[e]=1)}}}return{points:n,mask:c}}function Z(t,e,n=null,r=!0){const i=t.spatialReference;if(i.equals(e))return t;const a=V(t),l=O(i,!0),c=O(e);if(0===a||null==l||null==c){const o=z(t,e,n,r);if(null==l&&null!=c&&Math.abs(o.width-c)<R(e)&&(0,u.isLoaded)()){const n=I(i);if(null!=n&&n.poleLocation===s.None&&t.width<(n.bbox[2]-n.bbox[0])/2)return function(t,e){const n=O(e);if(null==n)return null;let{xmin:s,ymin:r,xmax:o,ymax:i}=t;const a=t.spatialReference,l=new h.A({spatialReference:a,rings:[[[s,r],[o,r],[o,i],[s,i],[s,r]]]}),c=(0,u.project)(l,e);if(2!==c.rings.length||!c.rings[0].length||!c.rings[1].length)return null;const{rings:m}=c,f=R(a),d=new p.A({spatialReference:e});for(let t=0;t<2;t++){s=o=m[t][0][0],r=i=m[t][0][1];for(let e=0;e<m[t].length;e++)s=s>m[t][e][0]?m[t][e][0]:s,o=o<m[t][e][0]?m[t][e][0]:o,r=r>m[t][e][1]?m[t][e][1]:r,i=i<m[t][e][1]?m[t][e][1]:i;if(0===t)d.ymin=r,d.ymax=i,d.xmin=s,d.xmax=o;else if(d.ymin=Math.min(d.ymin,r),d.ymax=Math.max(d.ymax,i),Math.abs(o-n/2)<f)d.xmin=s,d.xmax=d.xmax+n;else{if(!(Math.abs(s+n/2)<f))return null;d.xmax=o+n}}return d}(t,e)||o}return o}const m=t.clone().normalize();if(1===m.length&&t.xmax<l&&t.xmax-l/2>R(i)){const{xmin:e,xmax:n}=t;for(let s=0;s<=a;s++){const r=0===s?e:-l/2,o=s===a?n-l*s:l/2;m[s]=new p.A({xmin:r,xmax:o,ymin:t.ymin,ymax:t.ymax,spatialReference:i})}}return function(t,e){const n=O(t[0].spatialReference);if(t.length<2||null==n)return t[0];if(e=e??R(t[0].spatialReference),1===(t=t.filter((t=>t.width>e))).length)return t[0];let{xmin:s,xmax:r,ymin:o,ymax:i}=t[0];for(let e=1;e<t.length;e++){const s=t[e];r=s.xmax+n*e,o=Math.min(o,s.ymin),i=Math.max(i,s.ymax)}return new p.A({xmin:s,xmax:r,ymin:o,ymax:i,spatialReference:t[0].spatialReference})}(m.map((t=>z(t,e,n,r))).filter(o.Ru))}function G(t,e,n){if("extent"===t.type){const{xmin:e,ymin:n,xmax:s,ymax:r,spatialReference:o}=t;t=new h.A({rings:[[[e,r],[s,r],[s,n],[e,n],[e,r]]],spatialReference:o})}return t.spatialReference.equals(e)?t:(g(t.spatialReference,e,n),(0,u.project)(t,e,n))}function z(t,e,n=null,s=!0,r=!0){const o=t.spatialReference;if(o.equals(e)||!e)return t;g(o,e,n);const i=(0,u.project)(t,e,n);if(r&&e.isWebMercator&&i&&(i.ymax=Math.min(20037508.342787,i.ymax),i.ymin=Math.max(-20037508.342787,i.ymin),i.ymin>=i.ymax))return null;if(!s||!i)return i;const a=E(o,!0),l=E(e,!0);if(null==a||null==l)return i;const c=R(o,.001),p=R(o,M),h=R(e,.001);if(Math.abs(i.xmin-l[0])<h&&Math.abs(i.xmax-l[1])<h){const s=Math.abs(t.xmin-a[0]),r=Math.abs(a[1]-t.xmax);if(s<c&&r>p){i.xmin=l[0];const s=[];s.push(new m.A(t.xmax,t.ymin,o)),s.push(new m.A(t.xmax,(t.ymin+t.ymax)/2,o)),s.push(new m.A(t.xmax,t.ymax,o));const r=s.map((t=>F(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));i.xmax=Math.max.apply(null,r)}if(r<c&&s>p){i.xmax=l[1];const s=[];s.push(new m.A(t.xmin,t.ymin,o)),s.push(new m.A(t.xmin,(t.ymin+t.ymax)/2,o)),s.push(new m.A(t.xmin,t.ymax,o));const r=s.map((t=>F(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));i.xmin=Math.min.apply(null,r)}}else{const t=R(e,.001);Math.abs(i.xmin-l[0])<t&&(i.xmin=l[0]),Math.abs(i.xmax-l[1])<t&&(i.xmax=l[1])}return i}function O(t,e=!1){if(!t)return null;const n=e?20037508.342787:20037508.342788905;return t.isWebMercator?2*n:t.wkid&&t.isGeographic?360:2*x[t.wkid]||null}function E(t,e=!1){if(t.isGeographic)return[-180,180];const n=O(t,e);return null!=n?[-n/2,n/2]:null}function D(t,e,n,s){let r=(t-e)/n;return r-Math.floor(r)!=0?r=Math.floor(r):s&&(r-=1),r}function V(t,e=!1){const n=O(t.spatialReference);if(null==n)return 0;const s=e?0:-n/2,r=R(t.spatialReference),o=!e&&Math.abs(t.xmax-n/2)<r?n/2:t.xmax,i=!e&&Math.abs(t.xmin+n/2)<r?-n/2:t.xmin;return D(o,s,n,!0)-D(i,s,n,!1)}function U(t){const e=t.storageInfo.origin.x,n=O(t.spatialReference,!0);if(null==n)return{originX:e,halfWorldWidth:null,pyramidsInfo:null};const s=n/2,{nativePixelSize:r,storageInfo:o,extent:i}=t,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:u}=o;let c=r.x;const p=[],h=null!=t.transform&&"gcs-shift"===t.transform.type,m=e+(h?0:s),f=h?n-e:s-e;for(let t=0;t<=a;t++){const t=(i.xmax-e)/c/l,n=t-Math.floor(t)==0?t:Math.ceil(t),s=f/c/l,r=s-Math.floor(s)==0?s:Math.ceil(s),o=Math.floor(m/c/l),a=Math.round(m/c)%l,h=(l-Math.round(f/c)%l)%l;p.push({resolutionX:c,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:r,leftMargin:a,rightPadding:h,originColumnOffset:o}),c*=u}return{originX:e,halfWorldWidth:s,pyramidsInfo:p,hasGCSSShiftTransform:h}}function L(t){const e=t.isAdaptive&&null==t.spacing;let n=t.spacing||[w,w],s=W(t),r={cols:s.size[0]+1,rows:s.size[1]+1};const o=s.outofBoundPointCount>0&&s.outofBoundPointCount<s.offsets.length/2;let i=s.outofBoundPointCount===s.offsets.length/2||e&&o?[0,0]:y(s.offsets,r,n,A);const a=(i[0]+i[1])/2,u=t.projectedExtent.spatialReference,c=t.srcBufferExtent.spatialReference;if(e&&(o||a>A)&&(d(u,c,t.datumTransformation)&&(u.isGeographic||I(u)),n=[v,v],s=W({...t,spacing:n}),r={cols:s.size[0]+1,rows:s.size[1]+1},i=y(s.offsets,r,n,A)),s.error=i,n[0]>1&&(s.coefficients=$(s.offsets,r,o)),t.includeGCSGrid&&!u.isGeographic&&!u.isWebMercator)if(c.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:n};else{const e=I(u);if(null!=e&&!e.isEnvelope){const e=function(t){if(!t||t.isGeographic)return t;const e=String(t.wkid||t.wkt2||t.wkt);let n;return b.has(e)?n=b.get(e):(n=(t.wkid?l.P.coordsys(t.wkid):l.P.fromString(l.a.PE_TYPE_PROJCS,t.wkt2||t.wkt)).getGeogcs().getCode(),b.set(e,n)),new f.A({wkid:n})}(u),i=Z(t.projectedExtent,e),{offsets:a}=W({...t,srcBufferExtent:i,spacing:n}),c=$(a,r,o);s.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return s}function W(t){const{projectedExtent:e,srcBufferExtent:n,pixelSize:s,datumTransformation:r,rasterTransform:o}=t,i=e.spatialReference,a=n.spatialReference,l=g(i,a),{xmin:u,ymin:c,xmax:p,ymax:h}=e,f=O(a),d=null!=f&&(t.hasWrapAround||"gcs-shift"===o?.type),y=t.spacing||[w,w],x=y[0]*s.x,A=y[1]*s.y,_=1===y[0],b=Math.ceil((p-u)/x-.1/y[0])+(_?0:1),T=Math.ceil((h-c)/A-.1/y[1])+(_?0:1),P=k({cols:b,rows:T,xmin:u,ymax:h,xres:x,yres:A,inSR:i,outSR:a,datumTransformation:r,preferPE:y[0]<=v,usePixelCenter:_}),N=[];let F,C=0;const S=_?-1:NaN,{xmin:j,xmax:B,ymax:Z,width:G,height:z}=n,E=R(a,M),D=null!=f&&j>0&&B>f/2;let V=!1;if(l){const t=I(i);V=null!=t&&t.poleLocation>0}for(let t=0;t<b;t++){const e=[];for(let n=0;n<T;n++){let s=P[t*T+n];if(d&&s[0]>B&&s[0]>f/2-E?s[0]-=f:d&&0===t&&s[0]<0&&D&&!o&&(s[0]+=f),!s||isNaN(s[0])||isNaN(s[1]))N.push(S),N.push(S),e.push(null),C++;else{if(o){const t=o.inverseTransform(new m.A({x:s[0],y:s[1],spatialReference:a}));s=[t.x,t.y]}e.push(s),t>0&&d&&F[n]&&s[0]<F[n][0]&&(s[0]+=f,V&&s[0]>B&&s[0]>f&&(s[0]-=f)),N.push((s[0]-j)/G),N.push((Z-s[1])/z)}}F=e}return{offsets:N,error:null,coefficients:null,outofBoundPointCount:C,spacing:y,size:_?[b,T]:[b-1,T-1]}}function $(t,e,n){const{cols:s,rows:r}=e,o=new Float32Array((s-1)*(r-1)*2*6),i=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let e=0;e<s-1;e++){for(let n=0;n<r-1;n++){let l=e*r*2+2*n;const u=t[l],c=t[l+1],p=t[l+2],h=t[l+3];l+=2*r;const m=t[l],f=t[l+1],d=t[l+2],g=t[l+3];let y=0,x=12*(n*(s-1)+e);for(let t=0;t<3;t++)o[x++]=i[y++]*u+i[y++]*p+i[y++]*d;y=0;for(let t=0;t<3;t++)o[x++]=i[y++]*c+i[y++]*h+i[y++]*g;y=0;for(let t=0;t<3;t++)o[x++]=a[y++]*u+a[y++]*m+a[y++]*d;y=0;for(let t=0;t<3;t++)o[x++]=a[y++]*c+a[y++]*f+a[y++]*g}if(n)for(let t=0;t<o.length;t++)isNaN(o[t])&&(o[t]=-1)}return o}function H(t){const{spatialReference:e}=t,n=(0,c.Vp)(e);if(!n)return t;const[s,r]=n.valid,o=r-s;let i=0;if(t.xmin<s){const e=s-t.xmin;i=Math.ceil(e/o)}else if(t.xmin>r){const e=t.xmin-r;i=-Math.ceil(e/o)}return new p.A({spatialReference:t.spatialReference,xmin:t.xmin+i*o,ymin:t.ymin,xmax:t.xmax+i*o,ymax:t.ymax})}function q(t,e,n){const{storageInfo:s,pixelSize:r}=e;let o=0,i=!1;const{pyramidResolutions:l}=s,u="mixed"===s.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,s.tileInfo.dpi/96)):1,c=(t.x+t.y)/2/u;if(null!=l&&l.length){const t=l[l.length-1],s=(t.x+t.y)/2,u=(r.x+r.y)/2;if(c<=u)o=0;else if(c>=s)o=l.length,i=c/s>8;else{let t,e=u;for(let s=1;s<=l.length;s++){if(t=(l[s-1].x+l[s-1].y)/2,c<=t){c===t?o=s:"down"===n?(o=s-1,i=c/e>8):o="up"===n||c-e>t-c||c/e>2?s:s-1;break}e=t}}const p=0===o?r:l[o-1];return i&&Math.min(p.x,p.y)*(0,a.GA)(e.spatialReference)>19567&&(i=!1),{pyramidLevel:o,pyramidResolution:new m.A({x:p.x,y:p.y,spatialReference:e.spatialReference}),excessiveReading:i}}const p=Math.log(t.x/r.x)/Math.LN2,h=Math.log(t.y/r.y)/Math.LN2,f=e.storageInfo.maximumPyramidLevel||0;o="down"===n?Math.floor(Math.min(p,h)):"up"===n?Math.ceil(Math.max(p,h)):Math.round((p+h)/2),o<0?o=0:o>f&&(i=o>f+3,o=f);const d=2**o;return{pyramidLevel:o,pyramidResolution:new m.A({x:d*e.nativePixelSize.x,y:d*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:i}}},82434:(t,e,n)=>{n.d(e,{A:()=>l});var s=n(90237),r=n(25482),o=n(10107),i=(n(44208),n(53966),n(87811),n(40608));let a=class extends r.oY{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};(0,s._)([(0,o.MZ)()],a.prototype,"affectsPixelSize",null),(0,s._)([(0,o.MZ)({json:{write:!0}})],a.prototype,"spatialReference",void 0),a=(0,s._)([(0,i.$)("esri.layers.support.rasterTransforms.BaseRasterTransform")],a);const l=a},73037:(t,e,n)=>{n.d(e,{A:()=>c});var s,r=n(90237),o=n(10107),i=(n(44208),n(53966),n(87811),n(93223)),a=n(40608),l=n(82434);let u=s=class extends l.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return"point"===(t=t.clone()).type?(t.x>180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return"point"===(t=t.clone()).type?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}clone(){return new s({tolerance:this.tolerance})}};(0,r._)([(0,i.e)({GCSShiftXform:"gcs-shift"})],u.prototype,"type",void 0),(0,r._)([(0,o.MZ)()],u.prototype,"tolerance",void 0),u=s=(0,r._)([(0,a.$)("esri.layers.support.rasterTransforms.GCSShiftTransform")],u);const c=u},21312:(t,e,n)=>{n.d(e,{A:()=>g});var s,r=n(90237),o=(n(59456),n(10107)),i=(n(44208),n(53966),n(87811),n(93223)),a=n(36005),l=n(40608),u=n(43937),c=n(82434),p=n(86738),h=n(5443);function m(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(2===n){const e=s*s,n=r*r,o=s*r;return{x:t[0]+s*t[2]+r*t[4]+e*t[6]+o*t[8]+n*t[10],y:t[1]+s*t[3]+r*t[5]+e*t[7]+o*t[9]+n*t[11]}}const o=s*s,i=r*r,a=s*r,l=o*s,u=o*r,c=s*i,p=r*i;return{x:t[0]+s*t[2]+r*t[4]+o*t[6]+a*t[8]+i*t[10]+l*t[12]+u*t[14]+c*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+o*t[7]+a*t[9]+i*t[11]+l*t[13]+u*t[15]+c*t[17]+p*t[19]}}function f(t,e,n){const{xmin:s,ymin:r,xmax:o,ymax:i,spatialReference:a}=e;let l=[];if(n<2)l.push({x:s,y:i}),l.push({x:o,y:i}),l.push({x:s,y:r}),l.push({x:o,y:r});else{let t=10;for(let e=0;e<t;e++)l.push({x:s,y:r+(i-r)*e/(t-1)}),l.push({x:o,y:r+(i-r)*e/(t-1)});t=8;for(let e=1;e<=t;e++)l.push({x:s+(o-s)*e/t,y:r}),l.push({x:s+(o-s)*e/t,y:i})}l=l.map((e=>m(t,e,n)));const u=l.map((t=>t.x)),c=l.map((t=>t.y));return new h.A({xmin:Math.min.apply(null,u),xmax:Math.max.apply(null,u),ymin:Math.min.apply(null,c),ymax:Math.max.apply(null,c),spatialReference:a})}let d=s=class extends c.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let t=0;t<n.length;t++)r.push(n[t]),r.push(s[t]);return r}writeForwardCoefficients(t,e,n){const s=[],r=[];for(let e=0;e<t?.length;e++)e%2==0?s.push(t[e]):r.push(t[e]);e.coeffX=s,e.coeffY=r}get inverseCoefficients(){let t=this._get("inverseCoefficients");const e=this._get("forwardCoefficients");return!t&&e&&this.polynomialOrder<2&&(t=function(t){const[e,n,s,r,o,i]=t,a=s*i-o*r,l=o*r-s*i;return[(o*n-e*i)/a,(s*n-e*r)/l,i/a,r/l,-o/a,-s/l]}(e)),t}set inverseCoefficients(t){this._set("inverseCoefficients",t)}readInverseCoefficients(t,e){const{inverseCoeffX:n,inverseCoeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let t=0;t<n.length;t++)r.push(n[t]),r.push(s[t]);return r}writeInverseCoefficients(t,e,n){const s=[],r=[];for(let e=0;e<t?.length;e++)e%2==0?s.push(t[e]):r.push(t[e]);e.inverseCoeffX=s,e.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(t){if("point"===t.type){const e=m(this.forwardCoefficients,t,this.polynomialOrder);return new p.A({x:e.x,y:e.y,spatialReference:t.spatialReference})}return f(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if("point"===t.type){const e=m(this.inverseCoefficients,t,this.polynomialOrder);return new p.A({x:e.x,y:e.y,spatialReference:t.spatialReference})}return f(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new s({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r._)([(0,o.MZ)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,r._)([(0,o.MZ)()],d.prototype,"forwardCoefficients",void 0),(0,r._)([(0,a.w)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,r._)([(0,u.K)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,r._)([(0,o.MZ)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,r._)([(0,a.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,r._)([(0,u.K)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,r._)([(0,o.MZ)()],d.prototype,"affectsPixelSize",null),(0,r._)([(0,i.e)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=s=(0,r._)([(0,l.$)("esri.layers.support.rasterTransforms.PolynomialTransform")],d);const g=d}}]);