@arcgis/core 4.33.0-next.20250423 → 4.33.0-next.20250424

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 (204) hide show
  1. package/Graphic.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/analysis/Analysis.d.ts +4 -0
  4. package/analysis/Analysis.js +1 -1
  5. package/analysis/SliceAnalysis.js +1 -1
  6. package/analysis/SlicePlane.js +1 -1
  7. package/analysis/support/AnalysisOriginWebScene.d.ts +4 -0
  8. package/analysis/support/AnalysisOriginWebScene.js +5 -0
  9. package/analysis/support/SliceAnalysisExcludedLayer.js +5 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/{d4d011eea16a89a5aad9.js → 0219c3f9408d3fa3c9a0.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{4f8782b3b6ad414409e8.js → 0a48b9734ab4c64a6f4f.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{ccc50f28f217e50cc2c3.js → 1427e7953c3d8c87c5e8.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{184d7c8ea818bec5c462.js → 146b3699a9e8b1f2dcc2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{8ba7d44eff348004f084.js → 1a6d2d090b643a87408a.js} +1 -1
  16. package/assets/esri/core/workers/chunks/1b8cc83aa1179245b2dc.js +1 -0
  17. package/assets/esri/core/workers/chunks/{5e5225623977e61fd0ef.js → 213adc87c843d627c5d6.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{fa8a3c75f9b41d31559b.js → 265f69d153b7b6f07e42.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{769b66cca8347f0f84db.js → 279bbd61b32577693a4a.js} +1 -1
  20. package/assets/esri/core/workers/chunks/290b065b377f9d2ee058.js +1 -0
  21. package/assets/esri/core/workers/chunks/29d3245261a7223124ed.js +1 -0
  22. package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +1 -0
  23. package/assets/esri/core/workers/chunks/5958af341014e13475d2.js +1 -0
  24. package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +1 -0
  25. package/assets/esri/core/workers/chunks/{26e0a0a13060cd3e4291.js → 626ba3a7dee952308566.js} +1 -1
  26. package/assets/esri/core/workers/chunks/7cd32b10ed0e18e44ef2.js +1 -0
  27. package/assets/esri/core/workers/chunks/7ffa68d69c138db1295d.js +1 -0
  28. package/assets/esri/core/workers/chunks/91f8547a13f0461045ef.js +1 -0
  29. package/assets/esri/core/workers/chunks/9661ee8569ee208e6237.js +1 -0
  30. package/assets/esri/core/workers/chunks/974742af7beb000c4b4a.js +1 -0
  31. package/assets/esri/core/workers/chunks/{e27fa1e84f16b7f19a90.js → 9850ff14bd9c7da81c65.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{a276980c06d5d311a37e.js → 9f416cc5673665f8c37c.js} +1 -1
  33. package/assets/esri/core/workers/chunks/a0c51c4c30a5f749dfc6.js +1 -0
  34. package/assets/esri/core/workers/chunks/{fdcbd28f38bc485ac5e3.js → ab6ecd8eeec5ff761b34.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{5bdd5ae2d2f23ef6b331.js → c87e2a63b96e0da77dfe.js} +1 -1
  36. package/assets/esri/core/workers/chunks/cc4dd739c4c7e3ccea3f.js +1 -0
  37. package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +1 -0
  38. package/assets/esri/core/workers/chunks/{26fcbe053194bd78fcc3.js → d8474dca270b25705699.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{7c42281188b874ffcdad.js → db5913824d5e5a2a8365.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{48a1bb1e171dd06a7c6e.js → dd94585508f49863dc15.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{9408a72968cbd985dd24.js → f2cef954b58c6604642c.js} +34 -34
  42. package/chunks/BloomBlur.glsl.js +7 -7
  43. package/chunks/BloomComposition.glsl.js +24 -25
  44. package/chunks/cameraUtilsSpherical.js +1 -1
  45. package/chunks/sphere.js +1 -1
  46. package/core/Collection.js +1 -1
  47. package/core/JSONSupport.js +1 -1
  48. package/core/SetUtils.js +1 -1
  49. package/{views/webgl/GLObjectType.js → core/support/jsonUtils.js} +1 -1
  50. package/core/urlUtils.js +1 -1
  51. package/geometry/Mesh.js +1 -1
  52. package/geometry/support/normalizeUtilsSync.js +1 -1
  53. package/geometry/support/sphere.js +1 -1
  54. package/interfaces.d.ts +344 -111
  55. package/layers/DimensionLayer.js +1 -1
  56. package/layers/RouteLayer.js +1 -1
  57. package/layers/SubtypeGroupLayer.js +1 -1
  58. package/layers/ViewshedLayer.js +1 -1
  59. package/layers/graphics/data/QueryEngine.js +1 -1
  60. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  61. package/layers/orientedImagery/transformations/utils.js +1 -1
  62. package/layers/support/FieldsIndex.js +1 -1
  63. package/layers/support/VideoElement.js +1 -1
  64. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  65. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  66. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  67. package/layers/support/rasterFormats/{TiffTags.js → tiffTag.js} +1 -1
  68. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  69. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  70. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  71. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  72. package/layers/support/rasterFunctions/RemapFunction.js +1 -1
  73. package/layers/support/rasterFunctions/rasterFunctionHelper.js +1 -1
  74. package/layers/support/videoUtils.js +5 -0
  75. package/package.json +1 -1
  76. package/portal/schemas/definitions.js +1 -1
  77. package/renderers/UniqueValueRenderer.js +1 -1
  78. package/renderers/support/colorRampUtils.js +1 -1
  79. package/support/revision.js +1 -1
  80. package/symbols/IconSymbol3DLayer.js +1 -1
  81. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  82. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  83. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  84. package/views/2d/engine/webgl/textureUtils.js +1 -1
  85. package/views/2d/layers/MediaLayerView2D.js +1 -1
  86. package/views/2d/layers/TileLayerView2D.js +1 -1
  87. package/views/2d/layers/support/DebugOverlay.js +1 -1
  88. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  89. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  90. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  91. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  92. package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +1 -1
  93. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  94. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  95. package/views/3d/camera/constraintUtils/distance.js +1 -1
  96. package/views/3d/camera/intersectionUtils.js +1 -1
  97. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  98. package/views/3d/environment/atmosphereUtils.js +1 -1
  99. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  100. package/views/3d/interactive/visualElements/EngineVisualElement.js +1 -1
  101. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  102. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  103. package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
  104. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  105. package/views/3d/interactive/visualElements/MarkerVisualElement.js +1 -1
  106. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  107. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  108. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  109. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  110. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  111. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  112. package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
  113. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  114. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
  115. package/views/3d/interactive/visualElements/VisualElement.js +1 -1
  116. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  117. package/views/3d/layers/I3SMeshView3D.js +1 -1
  118. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  119. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  120. package/views/3d/state/ConstraintsManager.js +1 -1
  121. package/views/3d/state/NearFarHeuristic.js +1 -1
  122. package/views/3d/state/ViewState.js +1 -1
  123. package/views/3d/state/ViewStateManager.js +1 -1
  124. package/views/3d/state/utils/navigationUtils.js +1 -1
  125. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  126. package/views/3d/support/geometryUtils/sphere.js +1 -1
  127. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  128. package/views/3d/webgl/ManagedDepthTexture.js +1 -1
  129. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  130. package/views/3d/webgl-engine/core/FBOCacheFormats.js +5 -0
  131. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +12 -14
  132. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
  133. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  134. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  135. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  136. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  137. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  138. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  139. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  140. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  141. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  142. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  143. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  144. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  145. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  146. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  147. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  148. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  149. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  150. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  151. package/views/SceneView.js +1 -1
  152. package/views/VideoView.js +1 -1
  153. package/views/webgl/FBOAttachmentType.js +5 -0
  154. package/views/webgl/FramebufferObject.js +1 -1
  155. package/views/webgl/Renderbuffer.js +1 -1
  156. package/views/webgl/RenderbufferDescriptor.js +1 -1
  157. package/views/webgl/Texture.js +1 -1
  158. package/views/webgl/TextureDescriptor.js +1 -1
  159. package/views/webgl/textureUtils.js +1 -1
  160. package/webscene/InitialViewProperties.js +1 -1
  161. package/webscene/Presentation.js +1 -1
  162. package/webscene/Slide.js +1 -1
  163. package/webscene/SlideLegendInfo.js +1 -1
  164. package/webscene/background/ColorBackground.js +1 -1
  165. package/webscene/spec-certification/api.js +1 -1
  166. package/webscene/spec-certification/compare.js +1 -1
  167. package/webscene/spec-certification/index.js +1 -1
  168. package/webscene/spec-certification/spec.js +1 -1
  169. package/webscene/spec-certification/utils.js +1 -1
  170. package/webscene/support/Description.js +1 -1
  171. package/webscene/support/SlideElements.js +1 -1
  172. package/webscene/support/SlideEnvironment.js +1 -1
  173. package/webscene/support/SlideGround.js +1 -1
  174. package/webscene/support/SlideVisibleLayer.js +1 -1
  175. package/webscene/support/Title.js +1 -1
  176. package/webscene/support/analysisUtils.js +5 -0
  177. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  178. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  179. package/widgets/Editor/EditorViewModel.js +1 -1
  180. package/widgets/Editor/UpdateWorkflow.js +1 -1
  181. package/widgets/Editor/support/SketchController.js +5 -0
  182. package/widgets/Editor/workflowUtils.js +1 -1
  183. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  184. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  185. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  186. package/widgets/FeatureTable.js +1 -1
  187. package/widgets/LayerList/LayerListItem.js +1 -1
  188. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  189. package/widgets/Widget.js +1 -1
  190. package/widgets/support/SelectionList.js +1 -1
  191. package/widgets/support/SnappingControls.js +1 -1
  192. package/assets/esri/core/workers/chunks/244d2196bac5ef279436.js +0 -1
  193. package/assets/esri/core/workers/chunks/32f2e0c88046b39916cc.js +0 -1
  194. package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +0 -1
  195. package/assets/esri/core/workers/chunks/5ffc3ca6c6a4d32e1282.js +0 -1
  196. package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +0 -1
  197. package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +0 -1
  198. package/assets/esri/core/workers/chunks/95379fdd6917c8a84c71.js +0 -1
  199. package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +0 -1
  200. package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +0 -1
  201. package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +0 -1
  202. package/assets/esri/core/workers/chunks/dd8e72d6784a8ebc115d.js +0 -1
  203. package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +0 -1
  204. package/views/webgl/formats.js +0 -5
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6049],{6049:(t,e,n)=>{n.d(e,{vt:()=>zs,UD:()=>Gs});var s=n(85334),r=n(49186),o=n(4718),i=n(90237),a=n(10107),u=(n(44208),n(53966),n(87811),n(40608)),l=n(16019),c=n(25482);let p=class extends c.A{constructor(){super(...arguments),this.raster=void 0}};(0,i._)([(0,a.MZ)({json:{write:!0}})],p.prototype,"raster",void 0),p=(0,i._)([(0,u.$)("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,u.$)("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 A=class extends c.A{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.isRoot=!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(),r&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),r&&this.isRoot)&&(this.processInputBandIds(),this.swizzleInputBandIds(this.rawInputBandIds)||(r=this.rawInputBandIds.length<=3)),this._bindingResult.supportsGPU=r,this._bindingResult):(this._bindingResult={success:!0,supportsGPU:!0},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);if(t.length>1){const e=t.map((t=>t.processInputBandIds()));return this.rawInputBandIds=[...new Set(e.flat())],this.rawInputBandIds}const e=t[0];if(e)return this.rawInputBandIds=e.processInputBandIds(),this.rawInputBandIds;const{bandCount:n}=this.sourceRasterInfos[0],s=Array.from({length:n},((t,e)=>e));return this.rawInputBandIds=this._getInputBandIds(s),this.rawInputBandIds}swizzleInputBandIds(t){const e=this._getRasterValues().filter(this._isRasterFunctionValue);let n=!0;for(const s of e)n=s.swizzleInputBandIds(t)&&n;return!!n&&this._swizzleBandIds(t)}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}_swizzleBandIds(t){return!0}_isInputRasterPrimaryOrConstant(){return!this._getRasterValues().some((t=>t&&"object"==typeof t&&"rasterFunction"in t&&t.rasterFunction))}_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,u=new Array(a).fill(i);return new y.A({width:s,height:r,pixelType:o,pixels:u})}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}})],A.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],A.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}}),(0,g.w)((t=>t?.toLowerCase()))],A.prototype,"outputPixelType",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],A.prototype,"mainPrimaryRasterId",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"sourceRasters",void 0),(0,i._)([(0,a.MZ)({type:[x.A],json:{write:!0}})],A.prototype,"sourceRasterInfos",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],A.prototype,"rasterInfo",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],A.prototype,"readingBufferSize",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],A.prototype,"id",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"isNoopProcess",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"supportsGPU",null),(0,i._)([(0,a.MZ)()],A.prototype,"rawInputBandIds",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"rawSourceRasterInfos",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"isInputBandIdsSwizzled",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"swizzledBandSelection",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"isBranch",void 0),(0,i._)([(0,a.MZ)()],A.prototype,"isRoot",void 0),(0,i._)([(0,a.MZ)({readOnly:!0})],A.prototype,"flatWebGLFunctionChain",null),(0,i._)([(0,a.MZ)()],A.prototype,"_bindingResult",void 0),A=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.BaseRasterFunction")],A);const v=A,b={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},_={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},P={setNull:50,conditional:78},T={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,..._,...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,...P},R=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}],[_.booleanAnd,{domain:[0,1],isInteger:!0}],[_.booleanNot,{domain:[0,1],isInteger:!0}],[_.booleanOr,{domain:[0,1],isInteger:!0}],[_.booleanXOr,{domain:[0,1],isInteger:!0}],[_.equalTo,{domain:[0,1],isInteger:!0}],[_.notEqual,{domain:[0,1],isInteger:!0}],[_.greaterThan,{domain:[0,1],isInteger:!0}],[_.greaterThanEqual,{domain:[0,1],isInteger:!0}],[_.lessThan,{domain:[0,1],isInteger:!0}],[_.lessThanEqual,{domain:[0,1],isInteger:!0}],[_.isNull,{domain:[0,1],isInteger:!0}]]);function N(t){return R.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 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]);return i}function I(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 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 B(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]=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 E(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 O(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 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 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 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 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]){let e=0;for(let r=0;r<s;r++)e+=t[r][n];i[n]=e/s}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])for(let e=0;e<s;e++){const s=t[e];i[n]+=s[n]}return i}function bt(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 _t(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),u=new Float32Array(s),l=s%2==1;for(let n=0;n<i;n++)if(!e||e[n]){for(let e=0;e<s;e++)u[e]=t[e][n];u.sort(),a[n]=l?u[r]:(u[r]+u[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 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=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 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=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 Rt(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 Nt=new Map,Ft=new Map,kt=new Map,It=new Map;function St(t,e,n={}){Nt.size||(Nt.set(4,Math.sqrt),Nt.set(6,Math.acos),Nt.set(7,Math.asin),Nt.set(8,Math.atan),Nt.set(9,Math.atanh),Nt.set(10,Math.abs),Nt.set(21,Math.cos),Nt.set(22,Math.cosh),Nt.set(48,Math.floor),Nt.set(49,Math.ceil),Nt.set(51,Math.sin),Nt.set(52,Math.sinh),Nt.set(56,Math.tan),Nt.set(57,Math.tanh),Nt.set(59,Math.acosh),Nt.set(60,Math.asinh),Nt.set(65,Math.floor),Ft.set(5,Math.pow),Ft.set(61,Math.atan2),kt.set(1,k),kt.set(2,C),kt.set(3,B),kt.set(11,V),kt.set(12,U),kt.set(13,L),kt.set(14,W),kt.set(15,$),kt.set(16,H),kt.set(17,q),kt.set(18,J),kt.set(19,K),kt.set(20,X),kt.set(23,Z),kt.set(24,Y),kt.set(25,nt),kt.set(26,tt),kt.set(27,et),kt.set(28,at),kt.set(29,ut),kt.set(30,j),kt.set(31,pt),kt.set(32,I),kt.set(33,lt),kt.set(34,ct),kt.set(35,it),kt.set(36,rt),kt.set(37,ot),kt.set(44,ht),kt.set(45,mt),kt.set(46,ft),kt.set(53,S),kt.set(64,G),kt.set(65,z),kt.set(76,gt),kt.set(78,gt),It.set(38,Pt),It.set(39,yt),It.set(40,At),It.set(41,_t),It.set(42,xt),It.set(43,Tt),It.set(47,wt),It.set(54,bt),It.set(55,vt),It.set(58,Rt),It.set(66,Pt),It.set(67,yt),It.set(68,At),It.set(69,_t),It.set(70,xt),It.set(71,Tt),It.set(72,wt),It.set(73,bt),It.set(74,vt),It.set(75,Rt));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=!It.has(e)||n.processAsMultiband,i=o?t[0].pixels.length:1,a=[];for(let n=0;n<i;n++){const i=It.has(e)&&!o?t.flatMap((t=>t.pixels)):t.map((t=>t.pixels[n]));let u,c=!0;if(e===P.setNull){const t=dt(i,s,r);u=t.band,s=t.mask,c=!1}else kt.has(e)?u=kt.get(e)(i,s,"f64"):Nt.has(e)?u=e===M.asin||e===M.acos||e===M.atanh?E(i,s,"f64",e):O(i,s,"f64",Nt.get(e)):Ft.has(e)?u=D(i,s,"f64",Ft.get(e)):It.has(e)?u=It.get(e)(i,s,"f64"):(u=i[0],c=!1);if(c&&e!==_.isNull&&!R.has(e)){const t=y.A.createEmptyBand(r,u.length);s||(s=new Uint8Array(u.length).fill(255)),(0,l.$p)(u,s),(0,l.yM)(u,s,r,t),u=t}a.push(u)}const u=t[0];return new y.A({width:u.width,height:u.height,pixelType:r,mask:e===_.isNull?null:s,pixels:a})}let Ct=class extends v{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 St(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,l.hP)(n);const o=(0,l.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"}})],Ct.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:d,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Ct.prototype,"rasterArgumentNames",void 0),Ct=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ArithmeticFunction")],Ct);const Bt=Ct;var jt;let Zt=jt=class extends h{clone(){return new jt({raster:this.raster})}};Zt=jt=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Zt);const Gt=Zt;var zt=n(39062);let Et=class extends v{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,zt.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:Gt,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,u.$)("esri.layers.support.rasterFunctions.AspectFunction")],Et);const Ot=Et;var Dt=n(93223),Vt=n(66552);const Ut=new Set(["+","-","*","/","(",")"]);function Lt(t,e){return t.toLowerCase().startsWith("b")?e[parseInt(t.slice(1),10)-1]:parseFloat(t)}function Wt(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 $t(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 Ht(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 qt=n(28435);const Jt=new Vt.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 Kt(t,e){if(!(0,qt.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=Yt(i,o[r[0]],o[r[1]]);break;case"ndwi":a=Yt(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),u=-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],l=r*i+t+u;l&&(a[o]=s*(i-s*t-r)/l)}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 u=0;u<o;u++)if(null==t||t[u]){const t=n[u],o=e[u];i[u]=(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,u=n.length,l=new Float32Array(u);for(let e=0;e<u;e++)(null==t||t[e])&&(l[e]=-.2848*n[e]-.2435*s[e]-.5436*r[e]+.7243*o[e]+.084*i[e]-.18*a[e]);return[l]}(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,u=new Float32Array(a),l=new Float32Array(a),c=new Float32Array(a);for(let e=0;e<a;e++)(null==t||t[e])&&(u[e]=i[e]?o[e]/i[e]*100:0,l[e]=n[e]?o[e]/n[e]*100:0,c[e]=r[e]?s[e]/r[e]*(o[e]/r[e])*100:0);return[u,l,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],u=Math.sqrt((2*t+1)**2-(6*t-5*Math.sqrt(o))-.5);if(u){const n=1.5*(1.2*(t-a)-2.5*(o-a));i[e]=n/u}}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],u=o[e],l=t+n*i+(1-n)*u;l&&(a[e]=(t-n*i-(1-n)*u)/l)}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];Ut.has(i)?(o.length&&r.push(Lt(o,e)),s.push(i),o=""):o=o.concat(i)}return o.length&&r.push(Lt(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}=Ht(r);if(s=Wt(t,r[n],o[e],o[e+1]),1===r.length)break;r=$t(r,n),o.splice(e,2,s)}return[s]}(i,o,n);break;default:return t}const{outputPixelType:u="f32"}=e,c=null!=u&&(0,l.zw)(u);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(u,t.length);return(0,l.yM)(t,p,u,e),e})));const h=new y.A({width:t.width,height:t.height,pixelType:u,pixels:a,mask:p});return h.updateStatistics(),h}function Xt(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 Yt(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 Qt;let te=Qt=class extends h{constructor(){super(...arguments),this.method="custom"}clone(){return new Qt({method:this.method,bandIndexes:this.bandIndexes,raster:(0,o.o8)(this.raster)})}};(0,i._)([(0,a.MZ)({json:{type:String,write:!0}})],te.prototype,"bandIndexes",void 0),(0,i._)([(0,Dt.e)(Jt)],te.prototype,"method",void 0),te=Qt=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.BandArithmeticFunctionArguments")],te);const ee=te,ne=new Set(["vari","mtvi2","rtvi-core","evi"]);let se=class extends v{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 Kt(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=Xt([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=Xt([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=Xt([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=Xt([e[0],e[1],0]),s="ci";break;case"savi":n=Xt([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=Xt([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=Xt([e[0],e[1],0]),s="msavi";break;case"gemi":n=Xt([e[0],e[1],0]),s="gemi";break;case"pvi":n=Xt([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=Xt([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=Xt([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=Xt([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=Xt([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=Xt([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=Xt([e[1],e[0],0]),s="bai";break;default:n=Xt([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:(0,l.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=ne.has(this.functionArguments.method)?3:2,o=s.slice(0,r).map((e=>t[e]));return 2===o.length&&o.push(0),o}_swizzleBandIds(t){const e=this.functionArguments.bandIndexes.split(" ").map((t=>parseFloat(t)-1));2===e.length&&e.push(0);const{method:n}=this.functionArguments,s=(["vari","mtvi2","rtvi-core","evi"].includes(n)?e.slice(0,3):"bai"===n||"ndwi"===n?[e[1],e[0]]:e.slice(0,2)).map((e=>t.indexOf(e)));return s[2]??=s[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=s,!1}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],se.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:ee,json:{write:!0,name:"rasterFunctionArguments"}})],se.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],se.prototype,"rasterArgumentNames",void 0),se=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.BandArithmeticFunction")],se);const re=se;var oe,ie=n(65864),ae=n(50498);const ue=new Vt.J({1:"outside",2:"inside"},{useNumericKeys:!0});let le=oe=class extends h{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new oe({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};(0,i._)([(0,a.MZ)({types:ae.yR,json:{read:ie.rS,write:!0}})],le.prototype,"clippingGeometry",void 0),(0,i._)([(0,a.MZ)({json:{read:ue.read,write:ue.write}})],le.prototype,"clippingType",void 0),le=oe=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ClipFunctionArguments")],le);const ce=le;var pe=n(77359),he=n(70834);let me=class extends v{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,he._l)(n,e):(0,he.uk)(n,e).extent;s&&(0,pe.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"}})],me.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:ce,json:{write:!0,name:"rasterFunctionArguments"}})],me.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],me.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],me.prototype,"isNoopProcess",void 0),me=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ClipFunction")],me);const fe=me;var de,ge=n(36005),ye=n(67369),xe=n(95349);let we=de=class extends h{castColormapName(t){if(!t)return null;const e=t.toLowerCase();return ye.L7.includes(e)?e:null}readColorRamp(t){return(0,xe.r)(t)}readColorRampName(t,e){if(!t)return null;const n=ye.kH.jsonValues.find((e=>e.toLowerCase()===t.toLowerCase()));return n?ye.kH.fromJSON(n):null}clone(){return new de({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}})],we.prototype,"colormap",void 0),(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],we.prototype,"colormapName",void 0),(0,i._)([(0,g.w)("colormapName")],we.prototype,"castColormapName",null),(0,i._)([(0,a.MZ)({types:xe.g,json:{write:!0}})],we.prototype,"colorRamp",void 0),(0,i._)([(0,ge.w)("colorRamp")],we.prototype,"readColorRamp",null),(0,i._)([(0,a.MZ)({type:ye.kH.apiValues,json:{type:ye.kH.jsonValues,write:ye.kH.write}})],we.prototype,"colorRampName",void 0),(0,i._)([(0,ge.w)("colorRampName")],we.prototype,"readColorRampName",null),we=de=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],we);const Ae=we,ve=[[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 _e(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,ye.iv)({type:"multipart",colorRamps:n},{numColors:r,weights:e=e??s})}let Me=class extends v{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,ye.R8)(s,{interpolateAlpha:!0});else if(r){const t=(0,ye.M5)(r);t&&(e=(0,ye.R8)(t),this.colorRamp=(0,xe.r)(t))}else n&&(e=function(t){let e;switch(t){case"elevation":e=_e([[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,ye.iv)({type:"algorithmic",algorithm:"esriHSVAlgorithm",fromColor:[0,0,0],toColor:[255,255,255]});break;case"hillshade":e=_e([[0,38,41,54],[69,79,82,90],[131,156,156,156],[256,253,253,241]],[.268,.238,.495]);break;case"ndvi":e=ve;break;case"ndvi2":e=function(){const t=_e([[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,l.zw)(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Me.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Ae,json:{write:!0,name:"rasterFunctionArguments"}})],Me.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Me.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],Me.prototype,"isNoopProcess",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Me.prototype,"indexedColormap",void 0),(0,i._)([(0,a.MZ)()],Me.prototype,"colorRamp",void 0),Me=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ColormapFunction")],Me);const Pe=Me;var Te,Re=n(4151);let Ne=Te=class extends h{clone(){return new Te({raster:this.raster})}};Ne=Te=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ColormapToRGBFunctionArguments")],Ne);const Fe=Ne;var ke=n(88178);let Ie=class extends v{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,qt.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:u}=this.lookup,l=a.length;for(let t=0;t<n.length;t++)if(s[t]){let e=4*(n[t]-u);e<0||e>l-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"}})],Ie.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Fe,json:{write:!0,name:"rasterFunctionArguments"}})],Ie.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Ie.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Ie.prototype,"lookup",void 0),Ie=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ColormapToRGBFunction")],Ie);const Se=Ie;var Ce,Be=n(43937);let je=Ce=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 Ce({rasters:(0,o.o8)(this.rasters)})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],je.prototype,"rasters",void 0),(0,i._)([(0,Be.K)("rasters")],je.prototype,"writeRasters",null),je=Ce=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],je);const Ze=je;let Ge=class extends v{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,qt.Wy)(e)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Ge.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Ze,json:{write:!0,name:"rasterFunctionArguments"}})],Ge.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Ge.prototype,"rasterArgumentNames",void 0),Ge=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.CompositeBandFunction")],Ge);const ze=Ge;var Ee=n(20437);const Oe=new Vt.J({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),De=new Vt.J({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});var Ve;let Ue=Ve=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 Ve({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};(0,i._)([(0,Dt.e)(Oe)],Ue.prototype,"method",void 0),(0,i._)([(0,Dt.e)(De)],Ue.prototype,"keepMethod",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Ue.prototype,"raster2",void 0),(0,i._)([(0,a.MZ)({readOnly:!0})],Ue.prototype,"rasters",null),Ue=Ve=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],Ue);const Le=Ue;let We=class extends v{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,l.zw)(n)&&!(0,l.zw)(r.pixelType)&&!(0,l.zw)(o.pixelType),a=[r.mask,o.mask].filter((t=>t)),u=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:u,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:u,outBand:l}=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];l[t]=null==p||null==g?m:"changed"===u&&y===x?f:"unchanged"===u&&y!==x?d:p*h+g}}({bands:c,mask:u,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:u,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],u=n[r][t];s+=i*u,o+=i*i,a+=u*u}const u=Math.sqrt(o*a);r[t]=u?Math.acos(s/u):1.5707963267948966}}({pixels:t.map((t=>t.pixels)),mask:u,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:u,outBand:m})}const f=new y.A({width:p,height:h,pixels:[m],pixelType:n,mask:u});return f.updateStatistics(),f}(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=(0,l.hP)(t);const s=(0,l.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 u=s[0].clone();u.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 l=this._getFieldNames(s,"red"),c=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),h=[],m=2===l.length&&2===c.length&&2===p.length;m&&(h.push(...s.map(((t,e)=>t.features.map((t=>[t.attributes[l[e]],t.attributes[c[e]],t.attributes[p[e]]]))))),u.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=u.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)}u.features=d,t.attributeTable=u}_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"}})],We.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Le,json:{write:!0,name:"rasterFunctionArguments"}})],We.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],We.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],We.prototype,"_categoryConfig",void 0),We=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ComputeChangeFunction")],We);const $e=We;var He;let qe=He=class extends h{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new He({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],qe.prototype,"contrastOffset",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],qe.prototype,"brightnessOffset",void 0),qe=He=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],qe);const Je=qe;var Ke=n(6952);let Xe=class extends v{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,Ke.zj)(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:(0,qt.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"}})],Xe.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Je,json:{write:!0,name:"rasterFunctionArguments"}})],Xe.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Xe.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Xe.prototype,"lookup",void 0),Xe=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],Xe);const Ye=Xe;function Qe(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 tn=new Map;function en(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=o.length,l=i?0:s,c=i?s:0,p=i?1:e;for(let i=l;i<n-l;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<u;r++)e+=t[n+i+(r-s)*p]*o[r];a[n+i]=e}}return a}function nn(t,e,n,s,r,o,i){const a=new Float32Array(e*n),u=Math.floor(s/2),l=Math.floor(r/2);for(let c=u;c<n-u;c++){const n=c*e;for(let c=l;c<e-l;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-u)*e+s-l]*i[o*r+s];a[n+c]=p}}return a}var sn;tn.set(b.none,[0,0,0,0,1,0,0,0,0]),tn.set(b.lineDetectionHorizontal,[-1,-1,-1,2,2,2,-1,-1,-1]),tn.set(b.lineDetectionVertical,[-1,2,-1,-1,2,-1,-1,2,-1]),tn.set(b.lineDetectionLeftDiagonal,[2,-1,-1,-1,2,-1,-1,-1,2]),tn.set(b.lineDetectionRightDiagonal,[-1,-1,2,-1,2,-1,2,-1,-1]),tn.set(b.gradientNorth,[-1,-2,-1,0,0,0,1,2,1]),tn.set(b.gradientWest,[-1,0,1,-2,0,2,-1,0,1]),tn.set(b.gradientEast,[1,0,-1,2,0,-2,1,0,-1]),tn.set(b.gradientSouth,[1,2,1,0,0,0,-1,-2,-1]),tn.set(b.gradientNorthEast,[0,-1,-2,1,0,-1,2,1,0]),tn.set(b.gradientNorthWest,[-2,-1,0,-1,0,1,0,1,2]),tn.set(b.smoothArithmeticMean,[.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111,.111111111111]),tn.set(b.smoothing3x3,[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625]),tn.set(b.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]),tn.set(b.sharpening3x3,[-1,-1,-1,-1,9,-1,-1,-1,-1]),tn.set(b.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]),tn.set(b.laplacian3x3,[0,-1,0,-1,4,-1,0,-1,0]),tn.set(b.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]),tn.set(b.sobelHorizontal,[-1,-2,-1,0,0,0,1,2,1]),tn.set(b.sobelVertical,[-1,0,1,-2,0,2,-1,0,1]),tn.set(b.sharpen,[0,-.25,0,-.25,2,-.25,0,-.25,0]),tn.set(b.sharpen2,[-.25,-.25,-.25,-.25,3,-.25,-.25,-.25,-.25]),tn.set(b.pointSpread,[-.627,.352,-.627,.352,2.923,.352,-.627,.352,-.627]);let rn=sn=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=tn.get(t);if(!e||t===b.userDefined||t===b.none)return;const n=Math.sqrt(e.length);this._set("kernel",e),this._set("cols",n),this._set("rows",n)}clone(){return new sn({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}})],rn.prototype,"rows",void 0),(0,i._)([(0,a.MZ)({json:{type:Number,write:!0}})],rn.prototype,"cols",void 0),(0,i._)([(0,a.MZ)({json:{name:"type",type:Number,write:!0}})],rn.prototype,"convolutionType",null),(0,i._)([(0,a.MZ)({json:{type:[Number],write:!0}})],rn.prototype,"kernel",void 0),rn=sn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ConvolutionFunctionArguments")],rn);const on=rn;let an=class extends v{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(b).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==b.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=[b.none,b.sharpen,b.sharpen2,b.sharpening3x3,b.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===b.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:u}=t,l=r.length,c=[],p=e.length,h=n.length,m=Math.floor(p/2),f=Math.floor(h/2);for(let t=0;t<l;t++){let a=en(r[t],o,i,m,u,e,!0);a=en(a,o,i,f,u,n,!1),s&&Qe(a,o,i,p,h),c.push(a)}return new y.A({width:o,height:i,pixelType:a,pixels:c,mask:u})}(t,n.row,n.col,s):function(t,e,n=!0){const{pixels:s,width:r,height:o,pixelType:i,mask:a}=t,u=s.length,l=[],{kernel:c,rows:p,cols:h}=e;for(let t=0;t<u;t++){const e=nn(s[t],r,o,p,h,a,c);n&&Qe(e,r,o,p,h),l.push(e)}return new y.A({width:r,height:o,pixelType:i,pixels:l,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),{rows:e,cols:n}=this.functionArguments,{_normalizedKernel:s}=this;for(let r=0;r<e;r++)for(let e=0;e<n;e++)t[5*r+e]=s[r*n+e];return{kernelRows:e,kernelCols:n,kernel:t,clampRange:(0,l.hP)(this.outputPixelType)}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],an.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:on,json:{write:!0,name:"rasterFunctionArguments"}})],an.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],an.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],an.prototype,"_normalizedKernel",null),an=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ConvolutionFunction")],an);const un=an;var ln;const cn=new Vt.J({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let pn=ln=class extends h{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return cn.fromJSON(e.type??e.curvatureType??0)}clone(){return new ln({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};(0,i._)([(0,a.MZ)({json:{write:{target:"type"}}}),(0,Dt.e)(cn)],pn.prototype,"curvatureType",void 0),(0,i._)([(0,ge.w)("curvatureType",["type","curvatureType"])],pn.prototype,"readCurvatureType",null),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],pn.prototype,"zFactor",void 0),pn=ln=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],pn);const hn=pn;let mn=class extends v{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}),u=this.isGCS&&n>=1?n*zt.rk:n;return(0,zt.E0)(e,{zFactor:u,curvatureType:s,resolution:a})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*zt.rk:t}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],mn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:hn,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)({json:{write:!0}})],mn.prototype,"isGCS",void 0),mn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.CurvatureFunction")],mn);const fn=mn;var dn;let gn=dn=class extends h{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=qt.Wb.bestMatch}clone(){return new dn({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}})],gn.prototype,"bandIds",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"bandNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"bandWavelengths",void 0),(0,i._)([(0,Dt.e)({0:"name",1:"wavelength",2:"id"})],gn.prototype,"method",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"missingBandAction",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],gn.prototype,"wavelengthMatchTolerance",void 0),gn=dn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],gn);const yn=gn;let xn=class extends v{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,u=r?.length&&("name"===s||"id"!==s&&!i?.length),l=o?.length&&("wavelength"===s||"id"!==s&&!i?.length),c=a===qt.Wb.fail,p=u?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):l?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,u=-1,l=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<l&&(a=!0,u=t,l=s):!a&&s<l&&(u=t,l=s)}if(!a&&n&&l<n&&(a=!0),!a&&s)return null;i.push(u)}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 ${u?"band names":l?"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:Xt(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map((t=>t>=e?e-1:t)).map((e=>t[e]))}_swizzleBandIds(t){const e=this.functionArguments.bandIds.map((e=>t.indexOf(e)));return this.isInputBandIdsSwizzled=!0,e[1]??=e[0],e[2]??=e[1],this.swizzledBandSelection=e,!1}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],xn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:yn,json:{write:!0,name:"rasterFunctionArguments"}})],xn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],xn.prototype,"rasterArgumentNames",void 0),xn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ExtractBandFunction")],xn);const wn=xn;var An;let vn=An=class extends h{clone(){return new An({conversionParameters:[...this.conversionParameters],raster:this.raster})}};(0,i._)([(0,a.MZ)({type:[Number],json:{write:!0}})],vn.prototype,"conversionParameters",void 0),vn=An=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.GrayscaleFunctionArguments")],vn);const bn=vn;let _n=class extends v{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,u=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,l.hP)(n),g=y.A.createEmptyBand(n,u);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"}})],_n.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:bn,json:{write:!0,name:"rasterFunctionArguments"}})],_n.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],_n.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)()],_n.prototype,"_normalizedWeights",null),_n=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.GrayscaleFunction")],_n);const Mn=_n;var Pn;const Tn=new Vt.J({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Rn=new Vt.J({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let Nn=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}})],Nn.prototype,"altitude",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Nn.prototype,"azimuth",void 0),(0,i._)([(0,a.MZ)(),(0,Dt.e)(Tn)],Nn.prototype,"hillshadeType",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0,name:"psPower"}})],Nn.prototype,"pixelSizePower",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0,name:"psZFactor"}})],Nn.prototype,"pixelSizeFactor",void 0),(0,i._)([(0,a.MZ)(),(0,Dt.e)(Rn)],Nn.prototype,"slopeType",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],Nn.prototype,"zFactor",void 0),(0,i._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],Nn.prototype,"removeEdgeEffect",void 0),Nn=Pn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.HillshadeFunctionArguments")],Nn);const Fn=Nn;let kn=class extends v{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,zt.PP)(this.functionArguments,o,this.isGCS),a=(0,zt.fw)(e,i);return a.pixelType=this.outputPixelType,a}_getWebGLParameters(){const t=(0,zt.PP)(this.functionArguments,{x:1,y:1},this.isGCS),e=(0,zt.ng)(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:o}=this.functionArguments,i="scaled"===n,a=(0,l.zw)(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?zt.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:Fn,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,u.$)("esri.layers.support.rasterFunctions.HillshadeFunction")],kn);const In=kn;var Sn;let Cn=Sn=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 Sn({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:(0,o.o8)(this.rasters)})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Cn.prototype,"operation",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Cn.prototype,"rasters",void 0),(0,i._)([(0,Be.K)("rasters")],Cn.prototype,"writeRasters",null),(0,i._)([(0,a.MZ)({json:{write:!0}})],Cn.prototype,"processAsMultiband",void 0),Cn=Sn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.LocalFunctionArguments")],Cn);const Bn=Cn;let jn=class extends v{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:St(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(T).find((e=>T[e]===t))?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,o]=(0,l.hP)(s);const i=(0,l.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=N(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}=N(s)??{domain:null,isInteger:!1};let i="f32";if(r&&o)i=(0,l.X1)(r[0],r[1]);else if(30===s){const t=e?.[0];i=t?(0,l.X1)(t.min,t.max):(0,l.zw)(n)?n:"s32"}else if(45===s&&(0,l.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,l.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"}})],jn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Bn,json:{write:!0,name:"rasterFunctionArguments"}})],jn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],jn.prototype,"rasterArgumentNames",void 0),jn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.LocalFunction")],jn);const Zn=jn;var Gn,zn=n(34727);let En=Gn=class extends h{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=qt.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 Gn({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=Gn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.MaskFunctionArguments")],En);const On=En;let Dn=class extends v{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,qt.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*qt.et)&&(!s||o&&s[0].length<=qt.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===qt.IB.matchAll;return(0,qt.dK)(e,{includedRanges:r,noDataValues:i,outputPixelType:n,matchAll:a,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(qt.et);n.fill(zn.pq),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(6);for(let e=0;e<s.length;e+=2)s[e]=t?.[e]??-zn.pq,s[e+1]=t?.[e+1]??zn.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"}})],Dn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:On,json:{write:!0,name:"rasterFunctionArguments"}})],Dn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Dn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Dn.prototype,"lookups",void 0),Dn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.MaskFunction")],Dn);const Vn=Dn;var Un;let Ln=Un=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 Un({visibleBandID:t,infraredBandID:e,scientificOutput:n})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Ln.prototype,"visibleBandID",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Ln.prototype,"infraredBandID",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Ln.prototype,"scientificOutput",void 0),Ln=Un=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.NDVIFunctionArguments")],Ln);const Wn=Ln;let $n=class extends v{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"};if(e<0||n<0)return{success:!1,supportsGPU:!1,error:"ndvi-function: invalid visible or infrared band id"};const o=s.clone();o.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(o),o.bandCount=1,o.keyProperties={...o.keyProperties,BandProperties:void 0};const[i,a,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return o.statistics=[{min:i,max:a,avg:u,stddev:l}],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,u=o[n],l=o[e],c=l.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=u[t],n=l[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:Xt(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]))}_swizzleBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments,s=[e,n].map((e=>t.indexOf(e)));return s[2]=s[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=s,!1}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],$n.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Wn,json:{write:!0,name:"rasterFunctionArguments"}})],$n.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],$n.prototype,"rasterArgumentNames",void 0),$n=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.NDVIFunction")],$n);const Hn=$n;var qn;let Jn=qn=class extends h{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new qn({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Jn.prototype,"inputRanges",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Jn.prototype,"outputValues",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Jn.prototype,"noDataRanges",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Jn.prototype,"allowUnmatched",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Jn.prototype,"replacementValue",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Jn.prototype,"isLastInputRangeInclusive",void 0),Jn=qn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.RemapFunctionArguments")],Jn);const Kn=Jn;let Xn=class extends v{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;t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,replacementValue:r,outputValues:o,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:u}=this.functionArguments,c="unknown"===this.outputPixelType||null==this.outputPixelType;if(this.outputPixelType=this._getOutputPixelType(e),o?.length){const i=n?.[0];if(s&&null==r){let e=i?.min??o[0],n=i?.max??o[0];e=Math.min.apply(null,[...o,e]),n=Math.max.apply(null,[...o,n]),t.statistics=[{min:e,max:n,avg:i?.avg??0,stddev:i?.stddev??-1}]}else{let e=o[0],n=e;for(let t=0;t<o.length;t++)e=e>o[t]?o[t]:e,n=n>o[t]?n:o[t];s&&null!=r&&(e=Math.min(e,r),n=Math.max(n,r)),t.statistics=[{min:e,max:n,avg:i?.avg??0,stddev:i?.stddev??-1}]}if(c){const{min:n,max:i}=t.statistics[0],a=["u8","s8","u16","s16","u32","s32","f32"],u=a.find((t=>{const[e,s]=(0,l.hP)(t);return n>=e&&i<=s}))??"f64";o.some((t=>Math.floor(t)!==t))?this.outputPixelType="f64"===u?"f64":"f32":this.outputPixelType=s&&null==r&&a.indexOf(e)>a.indexOf(u)?e:u}}return t.pixelType=this.outputPixelType,this.rasterInfo=t,this.lookup=s?null:(0,qt.XU)({srcPixelType:e,inputRanges:i,outputValues:o,noDataRanges:a,allowUnmatched:s,isLastInputRangeInclusive:u,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!o||o.length<=qt.et)&&(!a||a.length<=qt.et)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:n,outputPixelType:s}=this;if(n){const t=(0,qt.eH)(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return null!=t&&n.mask&&(t.mask=(0,qt.UK)(e.pixels[0],e.mask,n.mask,n.offset,"u8")),t}const{inputRanges:r,outputValues:o,noDataRanges:i,allowUnmatched:a,isLastInputRangeInclusive:u,replacementValue:l}=this.functionArguments;return(0,qt.Ew)(e,{inputRanges:r,outputValues:o,noDataRanges:i,outputPixelType:s,allowUnmatched:a,isLastInputRangeInclusive:u,replacementValue:l})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=this.functionArguments.inputRanges??[],r=this.functionArguments.outputValues??[],o=(0,qt.bL)(s,r,n),i=new Float32Array(2*qt.et);return i.fill(zn.pq),e?.length&&i.set(e),{allowUnmatched:t,rangeMaps:o,noDataRanges:i,clampRange:(0,l.hP)(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Xn.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Kn,json:{write:!0,name:"rasterFunctionArguments"}})],Xn.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Xn.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Xn.prototype,"lookup",void 0),Xn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.RemapFunction")],Xn);const Yn=Xn;var Qn;let ts=Qn=class extends Fn{readColorRamp(t){if("string"==typeof t){const e=ye.kH.jsonValues.find((e=>e.toLowerCase()===t.toLowerCase()));return e?(0,ye.M5)(ye.kH.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new Qn({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}})],ts.prototype,"colorRamp",void 0),(0,i._)([(0,ge.w)("colorRamp")],ts.prototype,"readColorRamp",null),(0,i._)([(0,a.MZ)({type:[[Number]],json:{write:!0}})],ts.prototype,"colormap",void 0),ts=Qn=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],ts);const es=ts;let ns=class extends v{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,ye.R8)(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:o}=(0,qt.zg)({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const i=(0,ye.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,zt.PP)(this.functionArguments,n,this.isGCS),r=(0,zt.fw)(e,s),o=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return(0,zt.SC)(r,e,this.lookup.hsvMap,o),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=(0,zt.PP)(this.functionArguments,{x:1,y:1},this.isGCS),e=(0,zt.ng)(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:o}=this.functionArguments,i="scaled"===n,{indexedColormap:a,offset:u}=this.lookup,c=this.sourceRasterInfos[0].statistics?.[0],p=(0,l.zw)(this.outputPixelType);return{...e,indexedColormap:a,offset:u,zFactor:s,gcsFactor:this.isGCS?zt.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"}})],ns.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:es,json:{write:!0,name:"rasterFunctionArguments"}})],ns.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],ns.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],ns.prototype,"isGCS",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],ns.prototype,"lookup",void 0),ns=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.ShadedReliefFunction")],ns);const ss=ns;var rs;const os=new Vt.J({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let is=rs=class extends h{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new rs({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};(0,i._)([(0,Dt.e)(os)],is.prototype,"slopeType",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{write:!0}})],is.prototype,"zFactor",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"psPower",write:!0}})],is.prototype,"pixelSizePower",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"psZFactor",write:!0}})],is.prototype,"pixelSizeFactor",void 0),(0,i._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],is.prototype,"removeEdgeEffect",void 0),is=rs=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],is);const as=is;let us=class extends v{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:u}=t,l=u?.[0],c=l??(a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1});return(0,zt.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*zt.rk:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:(0,l.zw)(this.outputPixelType)}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],us.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:as,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,u.$)("esri.layers.support.rasterFunctions.SlopeFunction")],us);const ls=us,cs=new Vt.J({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function ps(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:u,kernelRows:l,kernelCols:c}=e,p="stddev"===u,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,u=r+c;i?(i[r]&&(a--,n-=s[r],p&&(o-=s[r]**2)),i[u]&&(a++,n+=s[u],p&&(o+=s[u]**2))):(n-=s[r],n+=s[u],p&&(o-=s[r]**2,o+=s[u]**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=l*r;for(let t=0;t<=r-c;t++){let e=0,n=0,s=0;for(let o=0;o<l;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-l;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 A=Math.floor(l/2),v=Math.floor(c/2);for(let t=A;t<o-A;t++){const e=t*r;for(let s=v;s<r-v;s++){const o=(t-A)*r+s-v,u=x[o];if(0===u||n&&(!i||i[e+s]))continue;const l=g[o]/u,c=p?Math.sqrt((y[o]-g[o]*l)/u):l;a[e+s]=c,i&&(i[e+s]=255)}}}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{kernelRows:u,kernelCols:l,statisticsType:c}=e,p=Math.floor(u/2),h=Math.floor(l/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<u;a++)for(let u=0;u<l;u++){const l=e+t+(a-p)*r+u-h;i&&!i[l]||(n=m?Math.min(n,s[l]):Math.max(n,s[l]),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 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:u,kernelCols:l}=e,c=Math.floor(u/2),p=Math.floor(l/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<u;n++)for(let a=0;a<l;a++){const u=e+t+(n-c)*r+a-p;i&&!i[u]||o.push(s[u])}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 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:u,kernelCols:l}=e,c=Math.floor(u/2),p=Math.floor(l/2),h="majority"===e.statisticsType,m=u*l,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<u;n++)for(let a=0;a<l;a++){const u=e+t+(n-c)*r+a-p;if(i&&!i[u])continue;const l=s[u];o.set(l,o.has(l)?o.get(l)+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 ds;let gs=ds=class extends h{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new ds({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)}}})],gs.prototype,"rows",void 0),(0,i._)([(0,a.MZ)({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],gs.prototype,"cols",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],gs.prototype,"fillNoDataOnly",void 0),(0,i._)([(0,a.MZ)({json:{read:{source:["statisticsType","type"],reader:(t,e)=>cs.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),(0,Dt.e)(cs)],gs.prototype,"statisticsType",void 0),gs=ds=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],gs);const ys=gs;let xs=class extends v{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:u}=t,l=r.length,c=o*i,p=[],{kernelRows:h,kernelCols:m,statisticsType:f,mirrorEdges:d}=e;if(s&&!n)return t;const g=e.outputPixelType??u,x=[];for(let t=0;t<l;t++){const u=r[t],l=y.A.createEmptyBand(g,c);s&&l.set(u);const w=a?.[t]??n,A=w?.slice()??null,v={band:u,width:o,height:i,mask:A,outBand:l};switch(f){case"min":case"max":hs(v,e);break;case"mean":case"stddev":ps(v,e);break;case"median":ms(v,e);break;case"majority":case"minority":fs(v,e)}d&&!s&&Qe(l,o,i,h,m),p.push(l),A&&x.push(A)}let w=x[0]??n;x.length!==l&&(x.length=0),l>1&&a?.length&&(w=y.A.combineBandMasks(a));const A=new y.A({pixelType:g,width:o,height:i,pixels:p,bandMasks:a&&x.length?x:null,mask:w});return A.updateStatistics(),A}(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,l.hP)(this.outputPixelType)}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],xs.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:ys,json:{write:!0,name:"rasterFunctionArguments"}})],xs.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],xs.prototype,"rasterArgumentNames",void 0),xs=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.StatisticsFunction")],xs);const ws=xs;var As;let vs=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}})],vs.prototype,"statistics",void 0),(0,i._)([(0,ge.w)("statistics")],vs.prototype,"readStatistics",null),(0,i._)([(0,Be.K)("statistics")],vs.prototype,"writeStatistics",null),(0,i._)([(0,a.MZ)({json:{write:!0}})],vs.prototype,"histograms",void 0),vs=As=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],vs);const bs=vs;let _s=class extends v{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"}})],_s.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:bs,json:{write:!0,name:"rasterFunctionArguments"}})],_s.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],_s.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],_s.prototype,"indexedColormap",void 0),(0,i._)([(0,a.MZ)()],_s.prototype,"isNoopProcess",void 0),_s=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],_s);const Ms=_s;var Ps;const Ts=new Vt.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,Dt.e)(Ts)],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,u.$)("esri.layers.support.rasterFunctions.StretchFunctionArguments")],Rs);const Ns=Rs;let Fs=class extends v{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,Ke.DP)(n.toJSON(),{rasterInfo:t}),i=(0,l.zw)(this.outputPixelType)?"round":"float";this.lookup=(0,Ke.RP)({pixelType:e,...s,gamma:o?r:null,rounding:i}),this.cutOffs=s}else s||(this.cutOffs=(0,Ke.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:u=255}=this.functionArguments;i.statistics=[];for(let t=0;t<i.bandCount;t++)i.statistics[t]={min:a,max:u};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,qt.eH)(e,{...n,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:s}=this,r=this.cutOffs||(0,Ke.DP)(s.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),o=s.useGamma?s.gamma:null;return(0,Ke._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,Ke.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 u=a.map(((n,s)=>(e-t)/(a[s]-i[s]))),c=(0,l.zw)(this.outputPixelType),p=s&&n?[n[0],n[1]??n[0],n[2]??n[0]]:[1,1,1],h=s?[o[0],o[1]??o[0],o[2]??o[0]]:[1,1,1];return{bandCount:r,minOutput:t,maxOutput:e,minCutOff:i,maxCutOff:a,factor:u,useGamma:s,gamma:p,gammaCorrection:h,stretchType:this.functionArguments.stretchType,isOutputRounded:c,type:"stretch"}}};(0,i._)([(0,a.MZ)({json:{write:!0,name:"rasterFunction"}})],Fs.prototype,"functionName",void 0),(0,i._)([(0,a.MZ)({type:Ns,json:{write:!0,name:"rasterFunctionArguments"}})],Fs.prototype,"functionArguments",void 0),(0,i._)([(0,a.MZ)()],Fs.prototype,"rasterArgumentNames",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Fs.prototype,"lookup",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],Fs.prototype,"cutOffs",void 0),Fs=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.StretchFunction")],Fs);const ks=Fs;var Is;let Ss=Is=class extends h{constructor(){super(...arguments),this.attributeTableAsRecordSet=null}clone(){return new Is({attributeTableAsRecordSet:(0,o.o8)(this.attributeTableAsRecordSet)})}};(0,i._)([(0,a.MZ)({json:{write:!0}})],Ss.prototype,"attributeTableAsRecordSet",void 0),Ss=Is=(0,i._)([(0,u.$)("esri.layers.support.rasterFunctions.TableFunctionArguments")],Ss);const Cs=Ss;let Bs=class extends v{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:Cs,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,u.$)("esri.layers.support.rasterFunctions.TableFunction")],Bs);const js=Bs,Zs=new Map;function Gs(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&&Gs(t,e))}))}function zs(t,e){e=e??{};try{if("function"in(t=(0,o.o8)(t))&&"arguments"in t&&t.arguments){const n=Ws(t,new Map,e);if(Hs(n),!n.renderingRule)throw new r.A("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t){const n=Ds(t=Os(t),e);return n.isRoot=!0,n}}catch{}throw new r.A("raster-function-helper","unsupported raster function json.")}function Es(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function Os(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)?Os(t):t));else switch(Es(e)&&(e=Os(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 Ds(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,o=t.outputPixelType?.toLowerCase();if(null==n||!Zs.has(n))throw new r.A("raster-function-helper",`unsupported raster function: ${n}`);const i=Zs.get(n),a=("function"==typeof i.ctor?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:o}),{rasterArgumentNames:u}=a,l=[],c=function(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map((e=>t[e]))}(s,u),p="rasters"===u[0]||u.length>1,h=[];for(let t=0;t<c.length;t++){const n=c[t];let s;null==n||"string"==typeof n&&n.startsWith("$")?l.push(e?.raster):"string"==typeof n?e[n]&&l.push(e[n]):"number"!=typeof n&&"rasterFunction"in n&&(s=Ds(n,e),p||(a.functionArguments[u[t]]=s),l.push(s)),p&&h.push(s??n)}if(p&&("rasters"===u[0]?a.functionArguments.rasters=h:u.forEach(((t,e)=>{a.functionArguments[t]=h[e]}))),e){a.sourceRasters=l;const t=e.raster?.url;t&&(a.mainPrimaryRasterId=t)}return a}function Vs(t,e){if(t&&e)for(const n in t){const s=t[n];s&&"object"==typeof s&&"type"in s&&("RasterFunctionTemplate"===s.type?Vs(s.arguments,e):"RasterFunctionVariable"===s.type&&null!=e[s.name]&&(s.value=e[s.name]))}}function Us(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=>t&&"object"==typeof t&&"RasterFunctionVariable"===t.type?Us(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=Ls(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(Ls)};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}=Ws(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=Us(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 Ls(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 Ws(t,e,n){n&&Vs(t,n);const s={renderingRule:{},templates:e};return $s(t,s),s}function $s(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]=Us(e,s):(n.rasterFunctionArguments[t]={},$s(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 Hs(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&&Hs({renderingRule:e,templates:n}),Array.isArray(e)&&e.forEach(((t,s)=>{if(t&&"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 Hs({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)}}}Zs.set("Arithmetic",{desc:"Arithmetic Function",ctor:Bt,rasterArgumentNames:["rasters"]}),Zs.set("Aspect",{desc:"Aspect Function",ctor:Ot,rasterArgumentNames:["raster"]}),Zs.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:re,rasterArgumentNames:["raster"]}),Zs.set("Colormap",{desc:"Colormap Function",ctor:Pe,rasterArgumentNames:["raster"]}),Zs.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:Se,rasterArgumentNames:["raster"]}),Zs.set("CompositeBand",{desc:"CompositeBand Function",ctor:ze,rasterArgumentNames:["rasters"]}),Zs.set("ComputeChange",{desc:"ComputeChange Function",ctor:$e,rasterArgumentNames:["rasters"]}),Zs.set("Convolution",{desc:"Convolution Function",ctor:un,rasterArgumentNames:["raster"]}),Zs.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Ye,rasterArgumentNames:["raster"]}),Zs.set("ExtractBand",{desc:"ExtractBand Function",ctor:wn,rasterArgumentNames:["raster"]}),Zs.set("Curvature",{desc:"Curvature Function",ctor:fn,rasterArgumentNames:["raster"]}),Zs.set("Hillshade",{desc:"Hillshade Function",ctor:In,rasterArgumentNames:["raster"]}),Zs.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:ss,rasterArgumentNames:["raster"]}),Zs.set("Grayscale",{desc:"Grayscale Function",ctor:Mn,rasterArgumentNames:["raster"]}),Zs.set("Clip",{desc:"Clip Function",ctor:fe,rasterArgumentNames:["raster"]}),Zs.set("Local",{desc:"Local Function",ctor:Zn,rasterArgumentNames:["rasters"]}),Zs.set("Mask",{desc:"Mask Function",ctor:Vn,rasterArgumentNames:["raster"]}),Zs.set("NDVI",{desc:"NDVI Function",ctor:Hn,rasterArgumentNames:["raster"]}),Zs.set("Remap",{desc:"Remap Function",ctor:Yn,rasterArgumentNames:["raster"]}),Zs.set("Slope",{desc:"Slope Function",ctor:ls,rasterArgumentNames:["raster"]}),Zs.set("Statistics",{desc:"Focal Statistics Function",ctor:ws,rasterArgumentNames:["raster"]}),Zs.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:Ms,rasterArgumentNames:["raster"]}),Zs.set("Stretch",{desc:"Stretch Function",ctor:ks,rasterArgumentNames:["raster"]}),Zs.set("Table",{desc:"Attribute Table Function",ctor:js,rasterArgumentNames:["raster"]})},70834:(t,e,n)=>{n.d(e,{DO:()=>$,FT:()=>V,Hh:()=>F,OM:()=>W,Ps:()=>K,Wo:()=>k,_I:()=>S,_l:()=>E,l0:()=>H,t$:()=>X,uk:()=>O});var s,r,o=n(4576),i=n(49186),a=n(74887),u=n(83047),l=n(5443),c=n(83290),p=n(86738),h=n(39829),m=n(80586),f=n(16930),d=n(21325);function g(){if(!N)throw new i.A("rasterprojectionhelper-project","projection operator is not loaded")}(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:u,rows:l}=e,c=(o-r)/u/n[0],p=(a-i)/l/n[1],h=2*s;let m=0,f=!1,d=[0,0];for(let e=0;e<u-3;e++){for(let n=0;n<l-3;n++){const s=e*l*2+2*n,r=(t[s]+t[s+4]+t[s+4*l]+t[s+4*l+4])/4,o=(t[s+1]+t[s+5]+t[s+4*l+1]+t[s+4*l+5])/4,i=Math.abs((r-t[s+2*l+2])/c),a=Math.abs((o-t[s+2*l+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,A=4,v=A,b=new Map,_=new Map,M=500;let P,T,R,N=!1;async function F(){return P||(P=(0,a.Tw)(),T=await n.e(3331).then(n.bind(n,3331)),R=await n.e(2158).then(n.bind(n,12158)),T.isLoaded()||await T.load(),R.isLoaded()||await R.load(),N=!0,P.resolve()),P.promise}function k(t,e,n,s){const r=t.spatialReference;if(!r||!e||r.equals(e))return t;g();const o=n.center,i=new l.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}),a=T.execute(i,e,{geographicTransformation:s}),c=V(e);return null==a||null!=c&&a.width>=c?function(t,e,n){const s=(0,u.GA)(e)/(0,u.GA)(n);return{x:t.x*s,y:t.y*s}}(t,r,e):{x:a.width,y:a.height}}function I(t,e=.01){return(0,u.GA)(t)?e/(0,u.GA)(t):0}function S(t,e,n,s=!0){const r=t.spatialReference;if(r.equals(e))return t;g();const o=T.execute(t,e,{geographicTransformation:n});return s&&o?(C([t],[o],r,e),o):o}function C(t,e,n,s){const r=U(n,!0),o=U(s,!0),i=I(n,M),a=I(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:u}=t[n],{x:l}=s;l>=o[1]-a&&Math.abs(u-r[0])<i?s.x-=o[1]-o[0]:l<=o[0]+a&&Math.abs(u-r[1])<i&&(s.x+=o[1]-o[0])}}function B(t){const{inSR:e,outSR:n,preferPE:s}=t;if(e.equals(n)){const{points:e}=z(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:u,ymax:l}=t;o&&(u+=s/2,l-=r/2);const c=[],h=[],f=Math.max(e,n);for(let t=0;t<f;t++){const o=u+s*Math.min(e,t),f=l-r*Math.min(n,t),d=(0,m.projectWithoutEngine)(new p.A({x:o,y:f,spatialReference:i}),i,a);t<=e&&c.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([c[t],h[e]]);return d}(t);if(s){if(e.isGeographic)return j(t);if(null!=Z(e))return j(t)}return function(t){const{points:e}=z(t,null),{inSR:n,outSR:s,datumTransformation:r}=t,o=e.map((t=>new p.A(t[0],t[1],n))),i=T.executeMany(o,s,{geographicTransformation:r});return r&&C(o,i,n,s),i.map((t=>t?[t.x,t.y]:[NaN,NaN]))}(t)}function j(t){const{inSR:e,outSR:n,datumTransformation:s}=t,r=Z(e),{points:o,mask:i}=z(t,r);if(!e.isGeographic){const t=e.wkid?c.P.coordsys(e.wkid):c.P.fromString(e.isGeographic?c.a.PE_TYPE_GEOGCS:c.a.PE_TYPE_PROJCS,e.wkt2||e.wkt);c.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<-179.9955?-1:0))),s.steps.forEach((t=>{const e=t.wkid?c.P.geogtran(t.wkid):c.P.fromString(c.a.PE_TYPE_GEOGTRAN,t.wkt);c.h.geogToGeog(e,o.length,o,null,t.isInverse?c.a.PE_TRANSFORM_2_TO_1:c.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<-179.9955?-1:0;s&&i&&s!==i&&(o[n][0]=s>0?r+360:r-360)}}if(!n.isGeographic){const t=Z(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?c.P.coordsys(n.wkid):c.P.fromString(n.isGeographic?c.a.PE_TYPE_GEOGCS:c.a.PE_TYPE_PROJCS,n.wkt2||n.wkt);c.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 Z(t,e=!1){let n=t.wkid||t.wkt2||t.wkt;if(!n||t.isGeographic)return null;if(n=String(n),b.has(n)){const t=b.get(n);return e?t?.gcs:t?.pcs}const s=t.wkid?c.P.coordsys(t.wkid):c.P.fromString(t.isGeographic?c.a.PE_TYPE_GEOGCS:c.a.PE_TYPE_PROJCS,t.wkt2||t.wkt),r=G(s,I(t,1e-4)),o=G(s,0,!0);return b.set(n,{pcs:r,gcs:o}),e?o:r}function G(t,e=0,n=!1){const s=c.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(),l=i.getCoord();if(o)return{isEnvelope:o,isPannable:u,vertices:l,coef:null,bbox:[l[0][0]-e,l[0][1]-e,l[1][0]+e,l[1][1]+e],poleLocation:a};let p=0;const h=[];let[m,f]=l[0],[d,g]=l[0];for(let t=0,e=l.length;t<e;t++){p++,p===e&&(p=0);const[n,s]=l[t],[r,o]=l[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:l,coef:h,bbox:[m,f,d,g],poleLocation:a}}function z(t,e){const n=[],{cols:s,rows:r,xres:o,yres:i,usePixelCenter:a}=t;let{xmin:u,ymax:l}=t;if(a&&(u+=o/2,l-=i/2),null==e){for(let t=0;t<s;t++)for(let e=0;e<r;e++)n.push([u+o*t,l-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=u+o*m,d=e.isPannable||s>=t&&s<=p;for(let t=0;t<r;t++,f++){const e=l-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=l-i*t,n=[],s=[];for(let t=0;t<p.length;t++){const[r,o,i,a,u]=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(u)}}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=u+o*t;for(let t=0;t<r;t++,e++){const r=l-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 E(t,e,n=null,r=!0){const i=t.spatialReference;if(i.equals(e)||!e)return t;const a=W(t),u=V(i,!0),c=V(e);if(0===a||null==u||null==c){const o=D(t,e,n,r);if(o&&null==u&&null!=c&&Math.abs(o.width-c)<I(e)&&T.isLoaded()){const n=Z(i);if(null!=n&&n.poleLocation===s.None&&t.width<(n.bbox[2]-n.bbox[0])/2)return function(t,e){const n=V(e);if(null==n)return null;let{xmin:s,ymin:r,xmax:o,ymax:i}=t;const a=t.spatialReference,u=new h.A({spatialReference:a,rings:[[[s,r],[o,r],[o,i],[s,i],[s,r]]]}),c=T.execute(u,e);if(2!==c.rings.length||!c.rings[0].length||!c.rings[1].length)return null;const{rings:p}=c,m=I(a),f=new l.A({spatialReference:e});for(let t=0;t<2;t++){s=o=p[t][0][0],r=i=p[t][0][1];for(let e=0;e<p[t].length;e++)s=s>p[t][e][0]?p[t][e][0]:s,o=o<p[t][e][0]?p[t][e][0]:o,r=r>p[t][e][1]?p[t][e][1]:r,i=i<p[t][e][1]?p[t][e][1]:i;if(0===t)f.ymin=r,f.ymax=i,f.xmin=s,f.xmax=o;else if(f.ymin=Math.min(f.ymin,r),f.ymax=Math.max(f.ymax,i),Math.abs(o-n/2)<m)f.xmin=s,f.xmax=f.xmax+n;else{if(!(Math.abs(s+n/2)<m))return null;f.xmax=o+n}}return f}(t,e)||o}return o}const p=t.clone().normalize();if(1===p.length&&t.xmax<u&&t.xmax-u/2>I(i)){const{xmin:e,xmax:n}=t;for(let s=0;s<=a;s++){const r=0===s?e:-u/2,o=s===a?n-u*s:u/2;p[s]=new l.A({xmin:r,xmax:o,ymin:t.ymin,ymax:t.ymax,spatialReference:i})}}const m=p.map((t=>D(t,e,n,r))).filter(o.Ru);return 0===m.length?null:function(t,e){const n=V(t[0].spatialReference);if(t.length<2||null==n)return t[0];if(e=e??I(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 l.A({xmin:s,xmax:r,ymin:o,ymax:i,spatialReference:t[0].spatialReference})}(m)}function O(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.execute(t,e,{geographicTransformation:n}))}function D(t,e,n,s=!0,r=!0){const o=t.spatialReference;if(o.equals(e)||!e)return t;g();const i=T.execute(t,e,{geographicTransformation: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=U(o,!0),u=U(e,!0);if(null==a||null==u)return i;const l=I(o,.001),c=I(o,M),h=I(e,.001);if(Math.abs(i.xmin-u[0])<h&&Math.abs(i.xmax-u[1])<h){const s=Math.abs(t.xmin-a[0]),r=Math.abs(a[1]-t.xmax);if(s<l&&r>c){i.xmin=u[0];const s=[];s.push(new p.A(t.xmax,t.ymin,o)),s.push(new p.A(t.xmax,(t.ymin+t.ymax)/2,o)),s.push(new p.A(t.xmax,t.ymax,o));const r=s.map((t=>S(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));i.xmax=Math.max.apply(null,r)}if(r<l&&s>c){i.xmax=u[1];const s=[];s.push(new p.A(t.xmin,t.ymin,o)),s.push(new p.A(t.xmin,(t.ymin+t.ymax)/2,o)),s.push(new p.A(t.xmin,t.ymax,o));const r=s.map((t=>S(t,e,n))).filter((t=>!isNaN(t?.x))).map((t=>t.x));i.xmin=Math.min.apply(null,r)}}else{const t=I(e,.001);Math.abs(i.xmin-u[0])<t&&(i.xmin=u[0]),Math.abs(i.xmax-u[1])<t&&(i.xmax=u[1])}return i}function V(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 U(t,e=!1){if(t.isGeographic)return[-180,180];const n=V(t,e);return null!=n?[-n/2,n/2]:null}function L(t,e,n,s){let r=(t-e)/n;return r-Math.floor(r)!=0?r=Math.floor(r):s&&(r-=1),r}function W(t,e=!1){const n=V(t.spatialReference);if(null==n)return 0;const s=e?0:-n/2,r=I(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 L(o,s,n,!0)-L(i,s,n,!1)}function $(t){const e=t.storageInfo.origin.x,n=V(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:u,pyramidScalingFactor:l}=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/u,n=t-Math.floor(t)==0?t:Math.ceil(t),s=f/c/u,r=s-Math.floor(s)==0?s:Math.ceil(s),o=Math.floor(m/c/u),a=Math.round(m/c)%u,h=(u-Math.round(f/c)%u)%u;p.push({resolutionX:c,blockWidth:u,datasetColumnCount:n,worldColumnCountFromOrigin:r,leftMargin:a,rightPadding:h,originColumnOffset:o}),c*=l}return{originX:e,halfWorldWidth:s,pyramidsInfo:p,hasGCSSShiftTransform:h}}function H(t){const e=t.isAdaptive&&null==t.spacing;let n=t.spacing||[w,w],s=q(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,v);const a=(i[0]+i[1])/2,u=t.projectedExtent.spatialReference,l=t.srcBufferExtent.spatialReference;if(e&&(o||a>v)&&(u.isGeographic||Z(u),n=[A,A],s=q({...t,spacing:n}),r={cols:s.size[0]+1,rows:s.size[1]+1},i=y(s.offsets,r,n,v)),s.error=i,n[0]>1&&(s.coefficients=J(s.offsets,r,o)),t.includeGCSGrid&&!u.isGeographic&&!u.isWebMercator)if(l.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:n};else{const e=Z(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 _.has(e)?n=_.get(e):(n=(t.wkid?c.P.coordsys(t.wkid):c.P.fromString(c.a.PE_TYPE_PROJCS,t.wkt2||t.wkt)).getGeogcs().getCode(),_.set(e,n)),new f.A({wkid:n})}(u),i=E(t.projectedExtent,e),{offsets:a}=q({...t,srcBufferExtent:i,spacing:n}),l=J(a,r,o);s.gcsGrid={offsets:a,coefficients:l,spacing:n}}}return s}function q(t){const{projectedExtent:e,srcBufferExtent:n,pixelSize:s,datumTransformation:r,rasterTransform:o}=t,i=e.spatialReference,a=n.spatialReference;g();const{xmin:u,ymin:l,xmax:c,ymax:h}=e,m=V(a),f=null!=m&&(t.hasWrapAround||"gcs-shift"===o?.type),d=t.spacing||[w,w],y=d[0]*s.x,x=d[1]*s.y,v=1===d[0],b=Math.ceil((c-u)/y-.1/d[0])+(v?0:1),_=Math.ceil((h-l)/x-.1/d[1])+(v?0:1),P=B({cols:b,rows:_,xmin:u,ymax:h,xres:y,yres:x,inSR:i,outSR:a,datumTransformation:r,preferPE:d[0]<=A,usePixelCenter:v}),T=[];let R,N=0;const F=v?-1:NaN,{xmin:k,xmax:S,ymax:C,width:j,height:G}=n,z=I(a,M),E=null!=m&&k>0&&S>m/2,O=Z(i),D=null!=O&&O.poleLocation>0;for(let t=0;t<b;t++){const e=[];for(let n=0;n<_;n++){let s=P[t*_+n];if(f&&s[0]>S&&s[0]>m/2-z?s[0]-=m:f&&0===t&&s[0]<0&&E&&!o&&(s[0]+=m),!s||isNaN(s[0])||isNaN(s[1]))T.push(F),T.push(F),e.push(null),N++;else{if(o){const t=o.inverseTransform(new p.A({x:s[0],y:s[1],spatialReference:a}));s=[t.x,t.y]}e.push(s),t>0&&f&&R[n]&&s[0]<R[n][0]&&(s[0]+=m,D&&s[0]>S&&s[0]>m&&(s[0]-=m)),T.push((s[0]-k)/j),T.push((C-s[1])/G)}}R=e}return{offsets:T,error:null,coefficients:null,outofBoundPointCount:N,spacing:d,size:v?[b,_]:[b-1,_-1]}}function J(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 u=e*r*2+2*n;const l=t[u],c=t[u+1],p=t[u+2],h=t[u+3];u+=2*r;const m=t[u],f=t[u+1],d=t[u+2],g=t[u+3];let y=0,x=12*(n*(s-1)+e);for(let t=0;t<3;t++)o[x++]=i[y++]*l+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++]*l+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 K(t){const{spatialReference:e}=t,n=(0,d.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 l.A({spatialReference:t.spatialReference,xmin:t.xmin+i*o,ymin:t.ymin,xmax:t.xmax+i*o,ymax:t.ymax})}function X(t,e,n){const{storageInfo:s,pixelSize:r}=e;let o=0,i=!1;const{pyramidResolutions:a}=s,l="mixed"===s.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,s.tileInfo.dpi/96)):1,c=(t.x+t.y)/2/l;if(null!=a&&a.length){const t=a[a.length-1],s=(t.x+t.y)/2,l=(r.x+r.y)/2;if(c<=l)o=0;else if(c>=s)o=a.length,i=c/s>8;else{let t,e=l;for(let s=1;s<=a.length;s++){if(t=(a[s-1].x+a[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 h=0===o?r:a[o-1];return i&&Math.min(h.x,h.y)*(0,u.GA)(e.spatialReference)>19567&&(i=!1),{pyramidLevel:o,pyramidResolution:new p.A({x:h.x,y:h.y,spatialReference:e.spatialReference}),excessiveReading:i}}const h=Math.log(t.x/r.x)/Math.LN2,m=Math.log(t.y/r.y)/Math.LN2,f=e.storageInfo.maximumPyramidLevel||0;o="down"===n?Math.floor(Math.min(h,m)):"up"===n?Math.ceil(Math.max(h,m)):Math.round((h+m)/2),o<0?o=0:o>f&&(i=o>f+3,o=f);const d=2**o;return{pyramidLevel:o,pyramidResolution:new p.A({x:d*e.nativePixelSize.x,y:d*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:i}}},77359:(t,e,n)=>{n.d(e,{$Q:()=>a,Sd:()=>u,b7:()=>l});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,u=e.height/r;if(n.width/a<.5||n.height/u<.5)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});const{xmin:l,xmax:c,ymin:p,ymax:h}=e,{xmin:m,xmax:f,ymin:d,ymax:g}=n,y=Math.max(l,m),x=Math.min(c,f),w=Math.max(p,d),A=Math.min(h,g),v=.5*a,b=.5*u;if(x-y<v||A-w<b||x<l+v||y>c-v||w>h-b||A<p+b)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});const _=Math.max(0,(y-l)/a),M=Math.min(s,Math.max(0,(x-l)/a)),P=Math.max(0,(h-A)/u),T=Math.min(r,Math.max(0,(h-w)/u)),R=Math.round(_),N=Math.round(M)-1,F=Math.round(P),k=Math.round(T)-1;if(R===N&&_%1>.5&&M%1<.5||F===k&&P%1>.5&&T%1<.5)return new i.A({pixelType:t.pixelType,width:s,height:r,mask:o,pixels:[...t.pixels]});if(0===R&&0===F&&N===s&&k===r)return t;const I=t.mask;for(let t=F;t<=k;t++)for(let e=R;e<=N;e++){const n=t*s+e;o[n]=I?I[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);return(await Promise.all([n.e(3661),n.e(1878),n.e(2189),n.e(3299),n.e(807)]).then(n.bind(n,25275))).execute(e,s)?"polyline"===s.type?function(t,e,n){const{width:s,height:r}=t,o=new Uint8Array(s*r),a=e.width/s,u=e.height/r,{xmin:l,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)/u),d=Math.floor((c-m)/u);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)*u,c=t===d?Math.min(i,m):e-u;let y=m===i?Math.floor((n-l)/a):Math.floor((g*(e-i)+n-l)/a),x=m===i?Math.floor((p-l)/a):Math.floor((g*(c-i)+n-l)/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):(await Promise.all([n.e(3661),n.e(1878),n.e(2189),n.e(3299),n.e(5924)]).then(n.bind(n,30912))).execute(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:u,ymax:l}=e;let c;if("extent"===n.type){const t=(n.xmin-u)/o,e=(n.xmax-u)/o,s=(l-n.ymax)/a,r=(l-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-u)/o,(l-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 u(t,e){const{extent:n}=l(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 l(t,e,n,o=!0){const{spatialReference:i}=t,{x:a,y:u}=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 l,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?u*Math.round((x-d)/u):0),f=y+(f>y?a*Math.round((f-y)/a):0),g=x-(g<x?u*Math.round((x-g)/u):0),l=new r.A({xmin:m,ymax:d,xmax:f,ymin:g,spatialReference:i}),c=Math.round(l.width/a),p=Math.round(l.height/u)):(c=Math.floor((f-m)/a+.8),p=Math.floor((d-g)/u+.8),m=y+(m>y?a*Math.floor((m-y)/a+.1):0),d=x-(d<x?u*Math.floor((x-d)/u+.1):0),f=m+c*a,g=d-p*u,l=new r.A({xmin:m,ymax:d,xmax:f,ymin:g,spatialReference:i})),{extent:l,width:c,height:p}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[36],{1193:(e,t,n)=>{n.d(t,{H:()=>p});var r,o=n(90237),i=n(25482),s=n(4718),a=n(53966),l=n(10107),u=n(79901),c=n(40608),f=n(31199);let p=r=class extends i.A{constructor(e){super(e),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(e){return(0,f.b)(e,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},a.A.getLogger(this))}castPosition(e){return e&&e instanceof Float32Array&&a.A.getLogger(this).warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"),(0,f.b)(e,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},a.A.getLogger(this))}castUv(e){return(0,f.b)(e,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},a.A.getLogger(this))}castNormal(e){return(0,f.b)(e,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},a.A.getLogger(this))}castTangent(e){return(0,f.b)(e,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},a.A.getLogger(this))}clone(){const e={position:(0,s.o8)(this.position),uv:(0,s.o8)(this.uv),normal:(0,s.o8)(this.normal),tangent:(0,s.o8)(this.tangent),color:(0,s.o8)(this.color)};return new r(e)}clonePositional(){const e={position:(0,s.o8)(this.position),normal:(0,s.o8)(this.normal),tangent:(0,s.o8)(this.tangent),uv:this.uv,color:this.color};return new r(e)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};(0,o._)([(0,l.MZ)({json:{write:f.B}})],p.prototype,"color",void 0),(0,o._)([(0,u.w)("color")],p.prototype,"castColor",null),(0,o._)([(0,l.MZ)({nonNullable:!0,json:{write:f.B}})],p.prototype,"position",void 0),(0,o._)([(0,u.w)("position")],p.prototype,"castPosition",null),(0,o._)([(0,l.MZ)({json:{write:f.B}})],p.prototype,"uv",void 0),(0,o._)([(0,u.w)("uv")],p.prototype,"castUv",null),(0,o._)([(0,l.MZ)({json:{write:f.B}})],p.prototype,"normal",void 0),(0,o._)([(0,u.w)("normal")],p.prototype,"castNormal",null),(0,o._)([(0,l.MZ)({json:{write:f.B}})],p.prototype,"tangent",void 0),(0,o._)([(0,u.w)("tangent")],p.prototype,"castTangent",null),p=r=(0,o._)([(0,c.$)("esri.geometry.support.MeshVertexAttributes")],p)},9318:(e,t,n)=>{n.d(t,{b:()=>i});var r=n(34727),o=n(97146);function i(e,t,n){const i=Array.isArray(e),c=i?e.length/t:e.byteLength/(4*t),f=i?e:new Uint32Array(e,0,c*t),p=n?.minReduction??0,h=n?.originalIndices||null,g=h?h.length:0,y=n?.componentOffsets||null;let d=0;if(y)for(let e=0;e<y.length-1;e++){const t=y[e+1]-y[e];t>d&&(d=t)}else d=c;const m=Math.floor(1.1*d)+1;(null==u||u.length<2*m)&&(u=new Uint32Array((0,r.cU)(2*m)));for(let e=0;e<2*m;e++)u[e]=0;let x=0;const v=!!y&&!!h,A=v?g:c;let w=(0,o.my)(c);const M=new Uint32Array(g),T=1.96;let b=0!==p?Math.ceil(4*T*T/(p*p)*p*(1-p)):A,_=1,S=y?y[1]:A;for(let e=0;e<A;e++){if(e===b){const t=1-x/e;if(t+T*Math.sqrt(t*(1-t)/e)<p)return null;b*=2}if(e===S){for(let e=0;e<2*m;e++)u[e]=0;if(h)for(let e=y[_-1];e<y[_];e++)M[e]=w[h[e]];S=y[++_]}const n=v?h[e]:e,r=n*t,o=l(f,r,t);let i=o%m,a=x;for(;0!==u[2*i+1];){if(u[2*i]===o){const e=u[2*i+1]-1;if(s(f,r,e*t,t)){a=w[e];break}}i++,i>=m&&(i-=m)}a===x&&(u[2*i]=o,u[2*i+1]=n+1,x++),w[n]=a}if(0!==p&&1-x/c<p)return null;if(v){for(let e=y[_-1];e<M.length;e++)M[e]=w[h[e]];w=(0,o.uW)(M)}const R=i?new Array(x):new Uint32Array(x*t);x=0;for(let e=0;e<A;e++)w[e]===x&&(a(f,(v?h[e]:e)*t,R,x*t,t),x++);if(h&&!v){const e=new Uint32Array(g);for(let t=0;t<e.length;t++)e[t]=w[h[t]];w=(0,o.uW)(e)}return{buffer:Array.isArray(R)?R:R.buffer,indices:w,uniqueCount:x}}function s(e,t,n,r){for(let o=0;o<r;o++)if(e[t+o]!==e[n+o])return!1;return!0}function a(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}function l(e,t,n){let r=0;for(let o=0;o<n;o++)r=e[t+o]+r|0,r=r+(r<<11)+(r>>>2)|0;return r>>>0}let u=null},16939:(e,t,n)=>{n.d(t,{A:()=>d});var r,o=n(90237),i=n(25482),s=n(4718),a=n(53966),l=n(10107),u=n(79901),c=n(40608),f=n(56507),p=n(19211),h=n(80882),g=n(31199);let y=r=class extends i.A{static from(e){return(0,f.PZ)(r,e)}constructor(e){super(e),this.faces=null,this.material=null,this.name=void 0,this.shading="source",this.trustSourceNormals=!1}castFaces(e){return(0,g.b)(e,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},a.A.getLogger(this))}castMaterial(e){return(0,f.PZ)(e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?h.A:p.A,e)}clone(){return new r({faces:(0,s.o8)(this.faces),shading:this.shading,material:(0,s.o8)(this.material),trustSourceNormals:this.trustSourceNormals,name:this.name})}cloneWithDeduplication(e,t){const n={faces:(0,s.o8)(this.faces),shading:this.shading,material:this.material?this.material.cloneWithDeduplication(e,t):null,trustSourceNormals:this.trustSourceNormals,name:this.name};return new r(n)}get memoryUsage(){let e=0;return null!=this.faces&&(e+=this.faces.byteLength),null!=this.material&&(e+=this.material.memoryUsage),e}};(0,o._)([(0,l.MZ)({json:{write:g.B}})],y.prototype,"faces",void 0),(0,o._)([(0,u.w)("faces")],y.prototype,"castFaces",null),(0,o._)([(0,l.MZ)({type:p.A,json:{write:!0}})],y.prototype,"material",void 0),(0,o._)([(0,u.w)("material")],y.prototype,"castMaterial",null),(0,o._)([(0,l.MZ)({json:{write:!0}})],y.prototype,"name",void 0),(0,o._)([(0,l.MZ)({type:String,json:{write:!0}})],y.prototype,"shading",void 0),(0,o._)([(0,l.MZ)({type:Boolean})],y.prototype,"trustSourceNormals",void 0),y=r=(0,o._)([(0,c.$)("esri.geometry.support.MeshComponent")],y);const d=y},18251:(e,t,n)=>{n.d(t,{A:()=>f});var r=n(90237),o=n(69540),i=n(25482),s=n(10107),a=(n(44208),n(53966),n(87811),n(93223)),l=n(40608),u=n(51850);let c=class extends(o.A.ClonableMixin(i.A)){constructor(e){super(e),this.type="local",this.origin=(0,u.vt)()}};(0,r._)([(0,a.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,r._)([(0,s.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,r._)([(0,l.$)("esri.geometry.support.MeshLocalVertexSpace")],c);const f=c},19211:(e,t,n)=>{n.d(t,{A:()=>p});var r,o=n(90237),i=n(68197),s=n(25482),a=n(10107),l=(n(44208),n(53966),n(87811),n(40608)),u=n(35063),c=n(51147);let f=r=class extends s.A{constructor(e){super(e),this.color=null,this.colorTexture=null,this.colorTextureTransform=null,this.normalTexture=void 0,this.normalTextureTransform=void 0,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(e,t){const n=null!=e?e.get(this):null;if(n)return n;const o=new r(this.clonePropertiesWithDeduplication(t));return null!=e&&e.set(this,o),o}clonePropertiesWithDeduplication(e){return{color:null!=this.color?this.color.clone():null,colorTexture:this.colorTexture?.cloneWithDeduplication(e),normalTexture:this.normalTexture?.cloneWithDeduplication(e),alphaMode:this.alphaMode,alphaCutoff:this.alphaCutoff,doubleSided:this.doubleSided,colorTextureTransform:this.colorTextureTransform?.clone(),normalTextureTransform:this.normalTextureTransform?.clone()}}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let e=0;return e+=null!=this.color?16:0,null!=this.colorTexture&&(e+=this.colorTexture.memoryUsage),e+=null!=this.colorTextureTransform?20:0,null!=this.normalTexture&&(e+=this.normalTexture.memoryUsage),e+=null!=this.normalTextureTransform?20:0,e}};(0,o._)([(0,a.MZ)({type:i.A,json:{write:!0}})],f.prototype,"color",void 0),(0,o._)([(0,a.MZ)({type:u.A,json:{write:!0}})],f.prototype,"colorTexture",void 0),(0,o._)([(0,a.MZ)({type:c.A,json:{write:!0}})],f.prototype,"colorTextureTransform",void 0),(0,o._)([(0,a.MZ)({type:u.A,json:{write:!0}})],f.prototype,"normalTexture",void 0),(0,o._)([(0,a.MZ)({type:c.A,json:{write:!0}})],f.prototype,"normalTextureTransform",void 0),(0,o._)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],f.prototype,"alphaMode",void 0),(0,o._)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],f.prototype,"alphaCutoff",void 0),(0,o._)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],f.prototype,"doubleSided",void 0),f=r=(0,o._)([(0,l.$)("esri.geometry.support.MeshMaterial")],f);const p=f},21287:(e,t,n)=>{n.d(t,{M5:()=>f,eV:()=>c});var r=n(78888),o=n(49186),i=n(74887),s=n(84952),a=n(26306);let l=null,u=!0;function c(e,t,n,r){if(!t||!n)throw new Error("Cannot construct image data without dimensions");if(u)try{return new ImageData(e,t,n)}catch(e){u=!1}const o=function(e,t,n){return n||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),n=l),n.getContext("2d").createImageData(e,t)}(t,n,r);return o.data.set(e,0),o}async function f(e,t){const{arrayBuffer:l,mediaType:u}=await async function(e,t){const n=(0,s.r$)(e);if(n?.isBase64)return{arrayBuffer:(0,a.M)(n.data),mediaType:n.mediaType};const o=await(0,r.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:o.data,mediaType:o.getHeader?.("Content-Type")??""}}(e,t),c="image/png"===u;if("image/gif"===u){const{isAnimatedGIF:e,parseGif:r}=await n.e(820).then(n.bind(n,10820));if(e(l))return r(l,t)}if(c){const{isAnimatedPNG:e,parseApng:r}=await n.e(2390).then(n.bind(n,22390));if(e(l))return r(l,t)}return async function(e,t){const n=window.URL.createObjectURL(e);try{const{data:e}=await(0,r.A)(n,{...t,responseType:"image"});return e}catch(e){if(!(0,i.zf)(e))throw new o.A("invalid-image",`Could not fetch requested image at ${n}`);throw e}finally{window.URL.revokeObjectURL(n)}}(new Blob([l],{type:u}),t)}},22141:(e,t,n)=>{n.d(t,{$5:()=>M,CN:()=>x,JP:()=>m,KM:()=>b,Mv:()=>S,X4:()=>v,gr:()=>w,qs:()=>T,si:()=>A,xA:()=>_});var r=n(34727),o=n(77690),i=n(29242),s=n(58083),a=n(9093),l=n(38954),u=n(51850),c=n(48353),f=n(9762),p=(n(79258),n(21325)),h=n(28735),g=n(13030),y=n(73354),d=n(65686);const m="Projection may be possible after calling projection.load().";function x(e,t,n,r){e.error(`Failed to project from (wkid:${t.wkid}) to (wkid:${n.wkid}).${r?" ":""}${r}`)}function v(e,t,n,r,o,i){return E(C.TO_PCPF,g.xs.fromTypedArray(e),R.NORMAL,g.Xm.fromTypedArray(t),n,g.Xm.fromTypedArray(r),o,g.xs.fromTypedArray(i))?i:null}function A(e,t,n,r,o,i){return E(C.FROM_PCPF,g.xs.fromTypedArray(e),R.NORMAL,g.Xm.fromTypedArray(t),n,g.Xm.fromTypedArray(r),o,g.xs.fromTypedArray(i))?i:null}function w(e,t,n,r){return(0,f.projectBuffer)(e,t,0,n,r,0)?n:null}function M(e,t,n,r){return(0,f.projectBuffer)(e,t,0,n,r,0)?n:null}function T(e,t,n){return(0,o.Ge)(U,n),(0,y.b)(t,e,U),(0,r.or)(U)&&(0,y.n)(t,t),t}function b(e,t,n){return(0,o.z0)(U,n),(0,d.t)(t,e,U),(0,r.or)(U)&&(0,y.n)(t,t,4),t}function _(e,t,n,r,o,i){if(!E(C.TO_PCPF,g.xs.fromTypedArray(e,4*Float32Array.BYTES_PER_ELEMENT),R.TANGENT,g.Xm.fromTypedArray(t),n,g.Xm.fromTypedArray(r),o,g.xs.fromTypedArray(i,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let t=3;t<e.length;t+=4)i[t]=e[t];return i}function S(e,t,n,r,o,i){if(!E(C.FROM_PCPF,g.xs.fromTypedArray(e,16),R.TANGENT,g.Xm.fromTypedArray(t),n,g.Xm.fromTypedArray(r),o,g.xs.fromTypedArray(i,16)))return null;for(let t=3;t<e.length;t+=4)i[t]=e[t];return i}var R,C,N;function B(e,t,n,r,i){switch((0,c.l)(r,n,F,r),e===C.FROM_PCPF&&(0,s.B8)(F,F),t){case R.NORMAL:return(0,o.Ge)(i,F);case R.TANGENT:return(0,o.z0)(i,F)}}function E(e,t,n,r,o,i,s,a){if(!t)return;const u=r.count;if(function(e){return e.isWGS84||(0,p.x1)(e)||(0,p.q8)(e)||(0,p.KQ)(e)}(o))for(let r=0;r<u;r++)i.getVec(r,Z),t.getVec(r,O),(0,l.q)(O,O,B(e,n,Z,s,U)),a.setVec(r,O);else for(let o=0;o<u;o++){i.getVec(o,Z),t.getVec(o,O);const u=(0,h.jg)(r.get(o,1));let c=Math.cos(u);n===R.TANGENT!=(e===C.TO_PCPF)&&(c=1/c),B(e,n,Z,s,U),e===C.TO_PCPF?(U[0]*=c,U[1]*=c,U[2]*=c,U[3]*=c,U[4]*=c,U[5]*=c):(U[0]*=c,U[3]*=c,U[6]*=c,U[1]*=c,U[4]*=c,U[7]*=c),(0,l.q)(O,O,U),(0,l.n)(O,O),a.setVec(o,O)}return a}(N=R||(R={}))[N.NORMAL=0]="NORMAL",N[N.TANGENT=1]="TANGENT",function(e){e[e.TO_PCPF=0]="TO_PCPF",e[e.FROM_PCPF=1]="FROM_PCPF"}(C||(C={}));const Z=(0,u.vt)(),O=(0,u.vt)(),F=(0,a.vt)(),U=(0,i.vt)()},27615:(e,t,n)=>{n.d(t,{CK:()=>l,Hq:()=>a,MW:()=>u,TE:()=>c,yJ:()=>f});var r=n(38954),o=n(86738),i=n(95696),s=n(18251);function a(e){return null!=e.origin}function l(e){return a(e.vertexSpace)}function u(e,t){if(!a(e))return null;const[n,r,i]=e.origin;return new o.A({x:n,y:r,z:i,spatialReference:t})}function c(e,t){const{x:n,y:r,z:o,spatialReference:a}=e,l=[n,r,o??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(a))?new s.A({origin:l}):new i.A({origin:l})}function f(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,r.p)(e.origin,t.origin))}},31199:(e,t,n)=>{function r(e,t,n,r){const{loggerTag:o,stride:i}=t;return e.length%i!=0?(r.error(o,`Invalid array length, expected a multiple of ${i}`),new n([])):e}function o(e,t,n,o,i){if(!e)return e;if(e instanceof t)return r(e,o,t,i);for(const s of n)if(e instanceof s)return r(new t(e),o,t,i);if(Array.isArray(e))return r(new t(e),o,t,i);{const r=n.map((e=>`'${e.name}'`));return i.error(`Failed to set property, expected one of ${r}, but got ${e.constructor.name}`),new t([])}}function i(e,t,n){t[n]=function(e){const t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=e[n];return t}(e)}n.d(t,{B:()=>i,b:()=>o})},35063:(e,t,n)=>{n.d(t,{A:()=>v});var r,o=n(90237),i=(n(44208),n(21287)),s=n(25482),a=n(10107),l=n(56507),u=(n(87811),n(36005)),c=n(40608),f=n(43937),p=n(97159);const h=new WeakMap;let g=0,y=class extends s.A{static{r=this}constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:(0,p.t)(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const r={type:"canvas-element",imageData:d(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[n]=r}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:(0,p.t)(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const r={type:"image-data",imageData:d(e)};t[n]=r}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=m(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return m(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this,n=e=>e?.toLowerCase().endsWith(".png")||e?.toLocaleLowerCase().startsWith("data:image/png;");return e instanceof HTMLCanvasElement?x(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?x(e):!(!t||!n(t))||!!(e instanceof HTMLImageElement&&n(e.src))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e="string"==typeof this.wrap?this.wrap:"object"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(t="")=>`d:${t},t:${this.transparent},w:${e}`;return null!=this.url?t(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(h.has(this.data)||h.set(this.data,++g),t(h.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=null!=this.url?this.url.length:0,null!=this.data){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new r(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return"string"==typeof this.wrap?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}static from(e){return"string"==typeof e?new r({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new r({data:e}):(0,l.PZ)(r,e)}};function d(e){let t="";for(let n=0;n<e.data.length;n++)t+=String.fromCharCode(e.data[n]);return{data:btoa(t),width:e.width,height:e.height}}function m(e){const t=atob(e.data),n=new Uint8ClampedArray(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return(0,i.eV)(n,e.width,e.height)}function x(e){for(let t=3;t<e.data.length;t+=4)if(255!==e.data[t])return!0;return!1}(0,o._)([(0,a.MZ)({type:String,json:{write:p.w}})],y.prototype,"url",null),(0,o._)([(0,a.MZ)({json:{write:{overridePolicy(){return{enabled:!this.url}}}}}),(0,a.MZ)()],y.prototype,"data",null),(0,o._)([(0,f.K)("data")],y.prototype,"writeData",null),(0,o._)([(0,u.w)("data")],y.prototype,"readData",null),(0,o._)([(0,a.MZ)({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],y.prototype,"transparent",null),(0,o._)([(0,a.MZ)({json:{write:!0}})],y.prototype,"wrap",void 0),(0,o._)([(0,a.MZ)({readOnly:!0})],y.prototype,"contentHash",null),y=r=(0,o._)([(0,c.$)("esri.geometry.support.MeshTexture")],y);const v=y},40036:(e,t,n)=>{n.d(t,{default:()=>Je});var r=n(90237),o=n(49186),i=n(92474),s=n(53966),a=n(61893),l=n(74887),u=n(36708),c=n(10107),f=(n(44208),n(87811),n(40608)),p=n(51850),h=n(91075),g=n(86738),y=n(39829),d=n(70328),m=n(24770),x=n(16939);const v="Expected location to be a Point instance";class A extends o.A{constructor(){super("invalid-input:location",v)}}var w=n(95696),M=n(18251),T=n(73836),b=n(1193),_=n(27615),S=n(83349),R=n(88582),C=n(95108),N=n(4197),B=n(97146),E=n(34727),Z=n(83047),O=n(38954),F=n(240);const U=(0,F.vt)();var L,P,j=n(9318);function D(e,t,n,r){const o=e.length,i=new Array(o),s=new Array(o),a=new Array(o);let l=0;for(let t=0;t<o;++t)l+=e[t].length;let u=0,c=0,f=0;const p=(0,N.jh)(3*l);let h=0;for(let l=o-1;l>=0;l--){const g=e[l],y=n===L.CCW_IS_HOLE&&$(g,t,r);if(y&&1!==o)i[u++]=g;else{let e=g.length;for(let t=0;t<u;++t)e+=i[t].length;const n={index:h,pathLengths:new Array(u+1),count:e,holeIndices:new Array(u)};n.pathLengths[0]=g.length,g.length>0&&(a[f++]={index:h,count:g.length}),h=y?I(g,g.length-1,-1,p,h,g.length,t):I(g,0,1,p,h,g.length,t);for(let e=0;e<u;++e){const r=i[e];n.holeIndices[e]=h,n.pathLengths[e+1]=r.length,r.length>0&&(a[f++]={index:h,count:r.length}),h=I(r,0,1,p,h,r.length,t)}u=0,n.count>0&&(s[c++]=n)}}for(let e=0;e<u;++e){const n=i[e];n.length>0&&(a[f++]={index:h,count:n.length}),h=I(n,0,1,p,h,n.length,t)}return s.length=c,a.length=f,{position:p,polygons:s,outlines:a}}function I(e,t,n,r,o,i,s){o*=3;for(let a=0;a<i;++a){const i=e[t];r[o++]=i[0],r[o++]=i[1],r[o++]=s&&i[2]?i[2]:0,t+=n}return o/3}function $(e,t,n){if(!t)return!(0,C.$3)(e);switch(function(e,t,n){const r=function(e,t,n,r){const o=(e=>!Array.isArray(e[0]))(t)?(e,n)=>t[3*e+n]:(e,n)=>t[e][n],i=r?(0,Z.GA)(r)/(0,Z.G9)(r):1;return(0,F.lU)(e,((e,t)=>(0,O.i)(e,o(t,0)*i,o(t,1)*i,o(t,2))),n)}(U,e,t,n)?(0,F.Qj)(U):[0,0,1];return Math.abs(r[2])>Math.cos((0,E.kU)(80))?R._.Z:Math.abs(r[1])>Math.abs(r[0])?R._.Y:R._.X}(e,e.length-1,n)){case R._.X:return!(0,C.$3)(e,R._.Y,R._.Z);case R._.Y:return!(0,C.$3)(e,R._.X,R._.Z);case R._.Z:return!(0,C.$3)(e,R._.X,R._.Y)}}(P=L||(L={}))[P.NONE=0]="NONE",P[P.CCW_IS_HOLE=1]="CCW_IS_HOLE";var z=n(65806),W=n(51447);function G(e,t,n,r){if(void 0!==r){(0,W.io)(e(),"option: geographic",{replacement:"Use mesh `vertexSpace` and spatial reference to control how operations are performed instead.",version:"4.30",warnOnce:!0});const o="local"===t.type;if(!(0,_.Hq)(t)||r===o)return n.isGeographic||n.isWebMercator&&r;e().warnOnce(`Specifying the 'geographic' parameter (${r}) for a Mesh vertex space of type "${t.type}" is not supported. This parameter will be ignored.`)}switch(t.type){case"georeferenced":return n.isGeographic;case"local":return n.isGeographic||n.isWebMercator}}var H=n(22141),q=n(72258);const V=()=>s.A.getLogger("esri.geometry.support.meshUtils.centerAt");const k=(0,p.vt)(),K=(0,p.vt)(),X=(0,p.vt)();var Y=n(9093),J=n(5443),Q=n(80586),ee=n(98764),te=n(48353),ne=n(9762),re=n(73354);const oe=(0,Y.vt)(),ie=(0,N.jh)(24);var se=n(84952);async function ae(e,t,r){const{source:i}=t,{loadGLTFMesh:s}=await(0,l.qr)(Promise.all([n.e(4399),n.e(2282)]).then(n.bind(n,97375)),r),a=await async function(e,t){if(Array.isArray(e)){if(!e.length)throw new o.A("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?function(e){return ye(e.map((e=>({name:e.name,mimeType:e.type,source:ue(e)}))))}(e):async function(e,t){const n=await(0,l.nA)(e.map((async e=>{const n=await async function(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(1===n.length)return new de(n[0].partUrl);const i=await e.toBlob(t);return(0,l.Te)(t),de.fromBlob(i,me(o,r))}(e);return(0,l.Te)(t),{name:e.assetName,mimeType:e.assetMimeType,source:n}})));if((0,l.G4)(t))throw n.forEach((e=>e.source.dispose())),(0,l.NK)();return ye(n)}(e,t)}return ue(e)}(i,r);(0,l.Te)(r);const u=s(new g.A({x:0,y:0,z:0,spatialReference:e.spatialReference}),a.url,{resolveFile:le(a),signal:r?.signal,expectedType:a.type,unitConversionDisabled:t.unitConversionDisabled});u.then((()=>a.dispose()),(()=>a.dispose()));const{vertexAttributes:c,components:f}=await u;e.vertexAttributes=c,e.components=f}function le(e){const t=(0,se.nM)(e.url);return n=>{const r=(0,se.V1)(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}function ue(e){return de.fromBlob(e,me(e.name,e.type))}const ce=/^model\/gltf\+json$/,fe=/^model\/gltf-binary$/,pe=/\.gltf$/i,he=/\.glb$/i;function ge({mimeType:e,source:t,name:n}){return ce.test(e)||pe.test(n)?{url:t.url,type:"gltf"}:fe.test(e)||he.test(n)?{url:t.url,type:"glb"}:null}function ye(e){const t=new Map;let n=null,r=null;for(const o of e){const{source:e,name:i}=o;n??=ge(o),"ESRI3DO_NORM.glb"===i&&(r=ge(o)),t.set(i,e.url),e.files.forEach(((e,n)=>t.set(n,e)))}const i=r??n;if(null==i)throw new o.A("mesh-load-external:missing-files","Missing files to load external mesh source");return new de(i.url,(()=>e.forEach((({source:e})=>e.dispose()))),t,i.type)}class de{constructor(e,t=()=>{},n=new Map,r){this.url=e,this.dispose=t,this.files=n,this.type=r}static fromBlob(e,t){const n=URL.createObjectURL(e);return new de(n,(()=>URL.revokeObjectURL(n)),void 0,t)}}function me(e,t){return ce.test(t)||pe.test(e)?"gltf":fe.test(t)||pe.test(e)?"glb":void 0}var xe=n(69540),ve=n(5503),Ae=n(63579);let we=class extends xe.A{constructor(e){super(e),this.externalSources=new ve.A,this._explicitDisplaySource=null,this.georeferenced=!1,this.addHandles((0,u.on)((()=>this.externalSources),"after-remove",(({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)}),{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(null!=e&&!(0,Ae.yr)(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every((t=>!(0,Ae.in)(t,e)))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter((t=>(0,Ae.eN)(t,e)))}get _implicitDisplaySource(){return this.externalSources.find(Ae.yr)}};(0,r._)([(0,c.MZ)()],we.prototype,"externalSources",void 0),(0,r._)([(0,c.MZ)()],we.prototype,"displaySource",null),(0,r._)([(0,c.MZ)()],we.prototype,"_implicitDisplaySource",null),(0,r._)([(0,c.MZ)()],we.prototype,"_explicitDisplaySource",void 0),(0,r._)([(0,c.MZ)()],we.prototype,"georeferenced",void 0),we=(0,r._)([(0,f.$)("esri.geometry.support.meshUtils.Metadata")],we);var Me=n(29242);const Te={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]}};function be(e,t,n){e.isPlane||function(e){for(let t=0;t<e.position.length;t+=3)e.position[t+2]+=.5}(e),function(e,t){if(null!=t){Ce[0]=t[0],Ce[4]=t[1],Ce[8]=t[2];for(let t=0;t<e.position.length;t+=3){for(let n=0;n<3;n++)Re[n]=e.position[t+n];(0,O.q)(Re,Re,Ce);for(let n=0;n<3;n++)e.position[t+n]=Re[n]}if(t[0]!==t[1]||t[1]!==t[2]){Ce[0]=1/t[0],Ce[4]=1/t[1],Ce[8]=1/t[2];for(let t=0;t<e.normal.length;t+=3){for(let n=0;n<3;n++)Re[n]=e.normal[t+n];(0,O.q)(Re,Re,Ce),(0,O.n)(Re,Re);for(let n=0;n<3;n++)e.normal[t+n]=Re[n]}}}}(e,function(e,t,n){const r=(0,q.xK)(t,n);if(null==e&&1===r)return null;if(null==e)return[r,r,r];if("number"==typeof e){const t=e*r;return[t,t,t]}return[null!=e.width?e.width*r:r,null!=e.depth?e.depth*r:r,null!=e.height?e.height*r:r]}(n?.size,n?.unit,t.spatialReference));const r=(0,_.TE)(t,n),o=t.spatialReference.isGeographic?(0,_.TE)(t):r,i=(0,q.UR)({vertexAttributes:e,vertexSpace:o,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new b.H({...i,uv:e.uv}),vertexSpace:r,components:[new x.A({faces:e.faces,material:n?.material||null})],spatialReference:t.spatialReference}}const _e={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},Se={south:0,east:1,north:2,west:3,up:4,down:5},Re=(0,p.vt)(),Ce=(0,Me.vt)();var Ne=n(77690),Be=n(58083),Ee=n(67026),Ze=n(82534);const Oe=()=>s.A.getLogger("esri.geometry.support.meshUtils.rotate");function Fe(e,t,n,r=p.uY){if(null!=e){(0,Be.$0)(je,(0,m.$I)(t),(0,m.yo)(t));for(let t=0;t<e.length;t+=n){for(let n=0;n<3;n++)Ue[n]=e[t+n]-r[n];(0,O.t)(Ue,Ue,je);for(let n=0;n<3;n++)e[t+n]=Ue[n]+r[n]}}}const Ue=(0,p.vt)(),Le=(0,Y.vt)(),Pe=(0,m.vt)(),je=(0,Y.vt)(),De=(0,Me.vt)(),Ie=(0,p.vt)(),$e=(0,Ze.vt)(),ze=()=>s.A.getLogger("esri.geometry.support.meshUtils.scale");function We(e,t,n=p.uY){if(e)for(let r=0;r<e.length;r+=3){for(let t=0;t<3;t++)Ge[t]=e[r+t]-n[t];(0,O.h)(Ge,Ge,t);for(let t=0;t<3;t++)e[r+t]=Ge[t]+n[t]}}const Ge=(0,p.vt)(),He=(0,p.vt)(),qe=(0,Y.vt)(),Ve=(0,p.vt)();var ke;const Ke={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:w.A,local:M.A}};let Xe=ke=class extends(i.A.LoadableMixin(a.A.EsriPromiseMixin(h.A))){constructor(e){super(e),this.components=null,this.vertexSpace=new w.A,this.transform=null,this.metadata=new we,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new b.H,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.addHandles((0,u.wB)((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone()))})),(()=>this._clearSources()),{once:!0,sync:!0}))}))}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,n=this;return function(e){const{spatialReference:t,vertexSpace:n,untransformedBounds:r}=e,o=(0,d.gE)(r,ie);if((0,_.Hq)(n)&&e.transform&&(0,re.t)(o,o,e.transform.localMatrix),"georeferenced"===n.type){const e=n.origin;return e&&(0,re.a)(o,o,e),(0,d.w1)((0,d.vY)(o),t)}const i=(0,ee.lO)(t),s=n.origin;if(!(0,Q.canProjectWithoutEngine)(i,t)){const[e,n,r]=s;return new J.A({xmin:e,ymin:n,zmin:r,xmax:e,ymax:n,zmax:r,spatialReference:t})}return(0,te.l)(t,s,oe,i),(0,re.t)(o,o,oe),(0,ne.projectBuffer)(o,i,0,o,t,0),(0,d.w1)((0,d.vY)(o),t)}({get transform(){return n.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?(0,d.vt)(d.v_):(0,d.vY)(e)}get origin(){const e=(0,_.MW)(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:n}=this._transformedExtent;return new g.A({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(x.A.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}s.A.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}}rotate(e,t,n,r){return(0,m.AU)(e,t,n,Ye),function(e,t,n){if(!e.vertexAttributes?.position||0===t[3])return;const{spatialReference:r,vertexSpace:o}=e,i=n?.origin??e.origin,s=n?.geographic,a=G(Oe,o,r,s);(0,_.CK)(e)?function(e,t,n){e.transform??=new T.A;const{vertexSpace:r,transform:o,spatialReference:i}=e,[s,a,l]=r.origin,u=new g.A({x:s,y:a,z:l,spatialReference:i}),c=Ue;if(u.equals(n))(0,O.i)(c,0,0,0);else if(!(0,q.p5)(c,n,e))return void(0,H.CN)(Oe(),n.spatialReference,i,H.JP);(0,Ee.x8)($e,(0,m.yo)(t),(0,m.$I)(t));const f=(0,Be.O7)(Le,$e,p.uY,p.Un,c),{localMatrix:h}=o,y=(0,Be.lw)(Le,f,h);o.scale=(0,Be.IL)((0,p.vt)(),y),(0,Be.hs)(y,y,(0,O.u)(Ue,o.scale));const d=o.rotationAxis;o.rotation=(0,m.ui)(y),0===o.rotationAngle&&(o.rotationAxis=d),o.translation=(0,Be.sC)((0,p.vt)(),y)}(e,t,i):a?function(e,t,n){const r=e.spatialReference,o=(0,ee.lO)(r),i=Ie;if(!(0,z.g)(n,i,o)&&((0,H.CN)(Oe(),n.spatialReference,o,"Falling back to mesh origin"),!(0,z.g)(e.origin,i,o)))return void(0,H.CN)(Oe(),e.origin.spatialReference,o);const s=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,u=new Float64Array(s.length),c=null!=a?new Float32Array(a.length):null,f=null!=l?new Float32Array(l.length):null;(0,te.l)(o,i,je,o),(0,Ne.z0)(De,je);const p=Pe;(0,O.q)((0,m.yo)(Pe),(0,m.yo)(t),De),p[3]=t[3],!(0,H.gr)(s,r,u,o)||null!=a&&null!=c&&!(0,H.X4)(a,s,r,u,o,c)||null!=l&&null!=f&&!(0,H.xA)(l,s,r,u,o,f)?(0,H.CN)(Oe(),r,o):(Fe(u,p,3,i),!(0,H.$5)(u,o,s,r)||null!=a&&null!=c&&(Fe(c,p,3),!(0,H.si)(c,s,r,u,o,a))||null!=l&&null!=f&&(Fe(f,p,4),!(0,H.Mv)(f,s,r,u,o,l))?(0,H.CN)(Oe(),o,r):e.vertexAttributesChanged())}(e,t,i):function(e,t,n){const r=Ie;if(!(0,z.g)(n,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,H.CN)(Oe(),n.spatialReference,e.spatialReference,H.JP)}Fe(e.vertexAttributes.position,t,3,r),Fe(e.vertexAttributes.normal,t,3),Fe(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}(e,t,i)}(this,Ye,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,i=o?.position;if(!i)return this;if((0,_.Hq)(r)){const[o,i,s]=r.origin;r.origin=(0,p.fA)(o+e,i+t,s+n)}else{for(let r=0;r<i.length;r+=3)i[r]+=e,i[r+1]+=t,i[r+2]+=n;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(function(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:o}=e,i=n?.origin??e.origin,s=n?.geographic,a=G(ze,r,o,s);(0,_.CK)(e)?function(e,t,n){e.transform??=new T.A;const{vertexSpace:r,transform:o,spatialReference:i}=e,[s,a,l]=r.origin,u=new g.A({x:s,y:a,z:l,spatialReference:i}),c=Ge;if(u.equals(n))(0,O.i)(c,0,0,0);else if(!(0,q.p5)(c,n,e))return void(0,H.CN)(ze(),n.spatialReference,i,H.JP);const f=(0,O.i)(He,t,t,t),h=(0,Be.O7)(qe,Ze.zK,p.uY,f,c),{localMatrix:y}=o,d=(0,Be.lw)(qe,h,y);o.scale=(0,Be.IL)((0,p.vt)(),d),(0,Be.hs)(d,d,(0,O.u)(Ge,o.scale));const x=o.rotationAxis;o.rotation=(0,m.ui)(d),0===o.rotationAngle&&(o.rotationAxis=x),o.translation=(0,Be.sC)((0,p.vt)(),d)}(e,t,i):a?function(e,t,n){const r=e.spatialReference,o=(0,ee.lO)(r),i=Ve;if(!(0,z.g)(n,i,o)&&((0,H.CN)(ze(),n.spatialReference,o,"Falling back to mesh origin"),!(0,z.g)(e.origin,i,o)))return void(0,H.CN)(ze(),e.origin.spatialReference,o);const s=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,u=new Float64Array(s.length),c=null!=a?new Float32Array(a.length):null,f=null!=l?new Float32Array(l.length):null;!(0,H.gr)(s,r,u,o)||null!=a&&null!=c&&!(0,H.X4)(a,s,r,u,o,c)||null!=l&&null!=f&&!(0,H.xA)(l,s,r,u,o,f)?(0,H.CN)(ze(),r,o):(We(u,t,i),!(0,H.$5)(u,o,s,r)||null!=a&&null!=c&&!(0,H.si)(c,s,r,u,o,a)||null!=l&&null!=f&&!(0,H.Mv)(f,s,r,u,o,l)?(0,H.CN)(ze(),o,r):e.vertexAttributesChanged())}(e,t,i):function(e,t,n){const r=Ve;if(!(0,z.g)(n,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,H.CN)(ze(),n.spatialReference,e.spatialReference,H.JP)}We(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}(e,t,i)}(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(function(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,o=n?.origin??e.origin,i=G(V,r,o.spatialReference,n?.geographic);(0,_.Hq)(r)?function(e,t,n){const{vertexSpace:r}=e;if(!(0,_.Hq)(r))return;const o=K,i=k;if(!(0,z.g)(t,i,e.spatialReference))return void(0,H.CN)(V(),t.spatialReference,e.spatialReference,H.JP);if(!(0,z.g)(n,o,e.spatialReference)){const t=e.origin;return o[0]=t.x,o[1]=t.y,o[2]=t.z,void(0,H.CN)(V(),n.spatialReference,e.spatialReference,H.JP)}const s=(0,O.d)(X,i,o);r.origin=(0,O.g)((0,p.vt)(),r.origin,s)}(e,t,o):i?function(e,t,n){const r=(0,p.fA)(n.x,n.y,n.z??0),o=(0,q.UR)(e,new M.A({origin:r}));if(!o)return;const i=(0,p.fA)(t.x,t.y,t.z??0),s=(0,q.UR)({vertexAttributes:o,spatialReference:e.spatialReference,vertexSpace:new M.A({origin:i})},w.A.absolute);if(!s)return;const{position:a,normal:l,tangent:u}=s;e.vertexAttributes.position=a,e.vertexAttributes.normal=l,e.vertexAttributes.tangent=u,e.vertexAttributesChanged()}(e,t,o):function(e,t,n){const r=K,o=k;if((0,z.g)(t,o,e.spatialReference)){if(!(0,z.g)(n,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,H.CN)(V(),n.spatialReference,e.spatialReference,H.JP)}(function(e,t,n){if(e)for(let r=0;r<e.length;r+=3)for(let o=0;o<3;o++)e[r+o]+=t[o]-n[o]})(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else(0,H.CN)(V(),t.spatialReference,e.spatialReference,H.JP)}(e,t,o)}(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(ae(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneAndModifyVertexAttributes(this.vertexAttributes.clone(),this.vertexSpace.clone(),{preserveMetadata:!0})}cloneAndModifyVertexAttributes(e,t,n){let r=null;if(this.components){const e=new Map,t=new Map;r=this.components.map((n=>n.cloneWithDeduplication(e,t)))}const o={components:r,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:n?.preserveMetadata?this.metadata.clone():new we};return new ke(o)}cloneShallow(){return new ke({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([n.e(8096).then(n.bind(n,8096)),this.load(e)]);return(0,l.Te)(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce(((e,t)=>e+t.memoryUsage),this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(s.A.getLogger(this).error(e,"Mesh must be loaded before applying operations"),!1)}static createBox(e,t){if(!(e instanceof g.A))return s.A.getLogger(this.prototype).error(".createBox()",v),null;const n=new ke(be(function(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=_e,r=4*e.length,o=new Float64Array(3*r),i=new Float32Array(3*r),s=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let l=0,u=0,c=0,f=0;for(let r=0;r<e.length;r++){const p=e[r],h=l/3;for(const e of t)a[f++]=h+e;const g=p.corners;for(let e=0;e<4;e++){const t=g[e];let r=0;s[c++]=.25*n[e][0]+p.uvOrigin[0],s[c++]=p.uvOrigin[1]-.25*n[e][1];for(let e=0;e<3;e++)0!==p.axis[e]?(o[l++]=.5*p.axis[e],i[u++]=p.axis[e]):(o[l++]=.5*t[r++],i[u++]=0)}}return{position:o,normal:i,uv:s,faces:a}}(),e,t));return t?.imageFace&&"all"!==t.imageFace?function(e,t){const n=e.components[0],r=n.faces,o=Se[t],i=6*o,s=new Array(6),a=new Array(r.length-6);let l=0,u=0;for(let e=0;e<r.length;e++)e>=i&&e<i+6?s[l++]=r[e]:a[u++]=r[e];if(null!=e.vertexAttributes.uv){const t=new Float32Array(e.vertexAttributes.uv),n=4*o*2,r=[0,1,1,1,1,0,0,0];for(let e=0;e<r.length;e++)t[n+e]=r[e];e.vertexAttributes.uv=t}return e.components=[new x.A({faces:s,material:n.material}),new x.A({faces:a})],e}(n,t.imageFace):n}static createSphere(e,t){return e instanceof g.A?new ke(be(function(e=0){const t=Math.round(8*2**e),n=2*t,r=(t-1)*(n+1)+2*n,o=new Float64Array(3*r),i=new Float32Array(3*r),s=new Float32Array(2*r),a=new Uint32Array((t-1)*n*2*3);let l=0,u=0,c=0,f=0;for(let e=0;e<=t;e++){const r=e/t*Math.PI+.5*Math.PI,p=Math.cos(r),h=Math.sin(r);Re[2]=h;const g=0===e||e===t,y=g?n-1:n;for(let r=0;r<=y;r++){const h=r/y*2*Math.PI;Re[0]=-Math.sin(h)*p,Re[1]=Math.cos(h)*p;for(let e=0;e<3;e++)o[l]=.5*Re[e],i[l]=Re[e],++l;s[u++]=(r+(g?.5:0))/n,s[u++]=e/t,0!==e&&r!==n&&(e!==t&&(a[c++]=f,a[c++]=f+1,a[c++]=f-n),1!==e&&(a[c++]=f,a[c++]=f-n,a[c++]=f-n-1)),f++}}return{position:o,normal:i,uv:s,faces:a}}(t?.densificationFactor||0),e,t)):(s.A.getLogger(this.prototype).error(".createSphere()",v),null)}static createCylinder(e,t){return e instanceof g.A?new ke(be(function(e=0){const t=Math.round(16*2**e),n=4*(t+1)+2*t,r=new Float64Array(3*n),o=new Float32Array(3*n),i=new Float32Array(2*n),s=new Uint32Array(4*t*3);let a=0,l=0,u=0,c=0,f=0;for(let e=0;e<=5;e++){const n=0===e||5===e,p=e<=1||e>=4,h=2===e||4===e,g=n?t-1:t;for(let y=0;y<=g;y++){const d=y/g*2*Math.PI,m=n?0:.5;Re[0]=m*Math.sin(d),Re[1]=m*-Math.cos(d),Re[2]=e<=2?.5:-.5;for(let t=0;t<3;t++)r[a++]=Re[t],o[l++]=p?2===t?e<=1?1:-1:0:2===t?0:Re[t]/m;i[u++]=(y+(n?.5:0))/t,i[u++]=e<=1?1*e/3:e<=3?1*(e-2)/3+1/3:1*(e-4)/3+2/3,h||0===e||y===t||(5!==e&&(s[c++]=f,s[c++]=f+1,s[c++]=f-t),1!==e&&(s[c++]=f,s[c++]=f-t,s[c++]=f-t-1)),f++}}return{position:r,normal:o,uv:i,faces:s}}(t?.densificationFactor||0),e,t)):(s.A.getLogger(this.prototype).error(".createCylinder()",v),null)}static createPlane(e,t){if(!(e instanceof g.A))return s.A.getLogger(this.prototype).error(".createPlane()",v),null;const n=t?.facing??"up",r=function(e,t){const n="number"==typeof t?t:null!=t?t.width:1,r="number"==typeof t?t:null!=t?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}(n,t?.size);return new ke(be(function(e){const t=Te.facingAxisOrderSwap[e],n=Te.position,r=Te.normal,o=new Float64Array(n.length),i=new Float32Array(r.length);let s=0;for(let e=0;e<4;e++){const e=s;for(let a=0;a<3;a++){const l=t[a],u=Math.abs(l)-1,c=l>=0?1:-1;o[s]=n[e+u]*c,i[s]=r[e+u]*c,s++}}return{position:o,normal:i,uv:new Float32Array(Te.uv),faces:new Uint32Array(Te.faces),isPlane:!0}}(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof y.A))return s.A.getLogger(this.prototype).error(".createFromPolygon()","Expected polygon to be a Polygon instance"),null;const n=function(e){const t=D(e.rings,e.hasZ,L.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const e of t.polygons){const i=e.count,s=e.index,a=(0,N.l5)(t.position,3*s,3*i),l=e.holeIndices.map((e=>e-s)),u=(0,B.uW)((0,S.e)(a,l,3));n.push({position:a,faces:u}),r+=a.length,o+=u.length}const i=function(e,t,n){if(1===e.length)return e[0];const r=(0,N.jh)(t),o=new Array(n);let i=0,s=0,a=0;for(const t of e){for(let e=0;e<t.position.length;e++)r[i++]=t.position[e];for(const e of t.faces)o[s++]=e+a;a=i/3}return{position:r,faces:(0,B.uW)(o)}}(n,r,o),s=Array.isArray(i.position)?(0,j.b)(i.position,3,{originalIndices:i.faces}):(0,j.b)(i.position.buffer,6,{originalIndices:i.faces});return i.position=(0,N.xm)(new Float64Array(s.buffer)),i.faces=s.indices,i}(e);return new ke({vertexAttributes:new b.H({position:n.position}),components:[new x.A({faces:n.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new w.A})}static async createFromGLTF(e,t,r){if(!(e instanceof g.A)){const e=new A;throw s.A.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:o}=await(0,l.qr)(Promise.all([n.e(4399),n.e(2282)]).then(n.bind(n,97375)),r);return new ke(await o(e,t,r))}static createWithExternalSource(e,t,n){const r=n?.extent??null,{spatialReference:o}=e,i=n?.transform?.clone()??new T.A,s=(0,_.TE)(e,n),a=n?.unitConversionDisabled,l={source:t,extent:r,unitConversionDisabled:a},u=new we;return u.externalSources.push(l),new ke({metadata:u,transform:i,vertexSpace:s,spatialReference:o})}static createIncomplete(e,t){const{spatialReference:n}=e,r=t?.transform?.clone()??new T.A,i=(0,_.TE)(e,t),s=new ke({transform:r,vertexSpace:i,spatialReference:n});return s.addResolvingPromise(Promise.reject(new o.A("mesh-incomplete","Mesh resources are not complete"))),s}};(0,r._)([(0,c.MZ)({type:[x.A],json:{write:!0}})],Xe.prototype,"components",void 0),(0,r._)([(0,c.MZ)({nonNullable:!0,types:Ke,constructOnly:!0,json:{write:!0}})],Xe.prototype,"vertexSpace",void 0),(0,r._)([(0,c.MZ)({type:T.A,json:{write:!0}})],Xe.prototype,"transform",void 0),(0,r._)([(0,c.MZ)({constructOnly:!0})],Xe.prototype,"metadata",void 0),(0,r._)([(0,c.MZ)()],Xe.prototype,"hasExtent",null),(0,r._)([(0,c.MZ)()],Xe.prototype,"_transformedExtent",null),(0,r._)([(0,c.MZ)()],Xe.prototype,"_untransformedBounds",null),(0,r._)([(0,c.MZ)()],Xe.prototype,"origin",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],Xe.prototype,"extent",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Xe.prototype,"hasZ",void 0),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Xe.prototype,"hasM",void 0),(0,r._)([(0,c.MZ)({type:b.H,nonNullable:!0,json:{write:!0}})],Xe.prototype,"vertexAttributes",void 0),Xe=ke=(0,r._)([(0,f.$)("esri.geometry.Mesh")],Xe);const Ye=(0,m.vt)(),Je=Xe},51147:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(90237),o=n(69540),i=n(25482),s=n(10107),a=(n(44208),n(53966),n(87811),n(40608));let l=class extends(o.A.ClonableMixin(i.A)){constructor(e){super(e),this.offset=[0,0],this.rotation=0,this.scale=[1,1]}};(0,r._)([(0,s.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],l.prototype,"offset",void 0),(0,r._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],l.prototype,"rotation",void 0),(0,r._)([(0,s.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],l.prototype,"scale",void 0),l=(0,r._)([(0,a.$)("esri.geometry.support.MeshTextureTransform")],l);const u=l},63579:(e,t,n)=>{n.d(t,{Bq:()=>l,Qp:()=>a,WN:()=>x,dK:()=>v,eN:()=>g,fH:()=>m,in:()=>y,yr:()=>u});var r=n(78888),o=n(4576),i=n(74887),s=n(20557);class a{constructor(e,t,n){this.assetName=e,this.assetMimeType=t,this.parts=n}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,o.aI)(this.parts,e.parts,((e,t)=>e.equals(t)))}isOnService(e){return this.parts.every((t=>t.isOnService(e)))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const n=await Promise.all(t.map((t=>t.toBlob(e))));return(0,i.Te)(e),new Blob(n)}}class l{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,r.A)(this.partUrl,{responseType:"blob"});return(0,i.Te)(e),t}}function u(e){return function(e){return!!e&&(Array.isArray(e)?e.some(h):h(e))}(e?.source)}function c(e){return!!Array.isArray(e)&&e.every((e=>e instanceof a))}const f=/^(model\/gltf\+json)|(model\/gltf-binary)$/,p=/\.(gltf|glb)/i;function h(e){if(e instanceof File){const{type:t,name:n}=e;return f.test(t)||p.test(n)}return f.test(e.assetMimeType)||p.test(e.assetName)}function g(e,t){if(!e)return!1;const{source:n}=e;return function(e,t){if(Array.isArray(e)){const n=e;return n.length>0&&n.every((e=>d(e,t)))}return d(e,t)}(n,t)}function y(e,t){if(e===t)return!0;const{source:n}=e,{source:r}=t;if(n===r)return!0;if(c(n)&&c(r)){if(n.length!==r.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...n].sort(e),o=[...r].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(o[e]))return!1;return!0}return!1}function d(e,t){return e instanceof a&&e.isOnService(t)}function m(e,t){return e instanceof File?(0,s.rq)(e,t):(0,s.z$)(e.assetMimeType,e.assetName,t)}function x(e){return Array.isArray(e)?e:[e]}function v(e){return!!e.original}},65686:(e,t,n)=>{n.d(t,{a:()=>i,b:()=>c,l:()=>u,n:()=>a,t:()=>s});var r=n(40876),o=(n(44208),n(53966));function i(e,t,n){s(e.typedBuffer,t.typedBuffer,n,e.typedBufferStride,t.typedBufferStride)}function s(e,t,n,r=4,o=r){if(e.length/r!=t.length/o)return;const i=e.length/r,s=n[0],a=n[1],l=n[2],u=n[3],c=n[4],f=n[5],p=n[6],h=n[7],g=n[8];let y=0,d=0;for(let n=0;n<i;n++){const n=t[y],i=t[y+1],m=t[y+2],x=t[y+3];e[d]=s*n+u*i+p*m,e[d+1]=a*n+c*i+h*m,e[d+2]=l*n+f*i+g*m,e[d+3]=x,y+=o,d+=r}}function a(e,t){const n=Math.min(e.count,t.count),r=e.typedBuffer,o=e.typedBufferStride,i=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<n;e++){const t=e*o,n=e*s,a=i[n],l=i[n+1],u=i[n+2],c=a*a+l*l+u*u;if(c>0){const e=1/Math.sqrt(c);r[t]=e*a,r[t+1]=e*l,r[t+2]=e*u}}}function l(e,t,n,r=4){const o=Math.min(e.length/r,t.count),i=t.typedBuffer,s=t.typedBufferStride;let a=0,l=0;for(let t=0;t<o;t++)e[l]=n*i[a],e[l+1]=n*i[a+1],e[l+2]=n*i[a+2],e[l+3]=n*i[a+3],a+=s,l+=r}function u(e,t,n,r){c(e.typedBuffer,t,n,r,e.typedBufferStride)}function c(e,t,n,o,i=4){const s=Math.min(e.length/i,t.count),a=t.typedBuffer,l=t.typedBufferStride;let u=0,c=0;const f=1/r.Tf;for(let t=0;t<s;t++)e[c]=o*(n*a[u])**f,e[c+1]=o*(n*a[u+1])**f,e[c+2]=o*(n*a[u+2])**f,e[c+3]=o*n*a[u+3],u+=l,c+=i}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:u,normalize:a,scale:l,scaleView:function(e,t,n){l(e.typedBuffer,t,n,e.typedBufferStride)},transformMat3:s,transformMat3View:i,transformMat4:function(e,t,n,r=4,i=r){if(e.length/r!=t.length/i)return void o.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const s=e.length/r,a=n[0],l=n[1],u=n[2],c=n[3],f=n[4],p=n[5],h=n[6],g=n[7],y=n[8],d=n[9],m=n[10],x=n[11],v=n[12],A=n[13],w=n[14],M=n[15];let T=0,b=0;for(let n=0;n<s;n++){const n=t[T],o=t[T+1],s=t[T+2],_=t[T+3];e[b]=a*n+f*o+y*s+v*_,e[b+1]=l*n+p*o+d*s+A*_,e[b+2]=u*n+h*o+m*s+w*_,e[b+3]=c*n+g*o+x*s+M*_,T+=i,b+=r}},transformMat4View:function(e,t,n){if(e.count!==t.count)return;const r=e.count,o=n[0],i=n[1],s=n[2],a=n[3],l=n[4],u=n[5],c=n[6],f=n[7],p=n[8],h=n[9],g=n[10],y=n[11],d=n[12],m=n[13],x=n[14],v=n[15],A=e.typedBuffer,w=e.typedBufferStride,M=t.typedBuffer,T=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*w,n=e*T,r=M[n],b=M[n+1],_=M[n+2],S=M[n+3];A[t]=o*r+l*b+p*_+d*S,A[t+1]=i*r+u*b+h*_+m*S,A[t+2]=s*r+c*b+g*_+x*S,A[t+3]=a*r+f*b+y*_+v*S}}},Symbol.toStringTag,{value:"Module"}))},72258:(e,t,n)=>{n.d(t,{UR:()=>w,p5:()=>A,xK:()=>R});var r=n(53966),o=n(34727),i=n(83047),s=n(77690),a=n(29242),l=n(58083),u=n(9093),c=n(38954),f=n(51850),p=n(98764),h=n(48353),g=n(65806),y=n(27615),d=n(21325),m=n(73354),x=n(22141);const v=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function A(e,t,{vertexSpace:n,spatialReference:r}){if("georeferenced"===n.type){const o=e;if(!(0,g.g)(t,o,r))return!1;const{origin:i}=n;return(0,c.d)(e,o,i),!0}const o=(0,p.lO)(r),i=e;if(!(0,g.g)(t,i,o))return!1;const{origin:s}=n,a=Z;if(!(0,h.l)(r,s,a,o))return!1;const u=(0,l.B8)(Z,a);return null!=u&&((0,c.t)(e,i,u),!0)}function w(e,t,n){const{vertexSpace:r,transform:o,vertexAttributes:i}=e,a=(0,y.Hq)(r)?o:null,f=_(e.spatialReference,n,O.SOURCE_AND_TARGET);if((0,y.yJ)(r,t)&&(!a||(0,l.t2)(a.localMatrix,u.zK))&&S(f)){const{position:e,normal:t,tangent:r}=i,o=n?.allowBufferReuse;return{position:o?e:e.slice(),normal:o?t:t?.slice(),tangent:o?r:r?.slice()}}switch(e.vertexSpace.type){case"local":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:n},{origin:r},o,i){const s=M(t,i);if(!(0,h.l)(t,r,C,s))return(0,x.CN)(v(),t,s),null;if(n&&(0,l.lw)(C,C,n.localMatrix),!(0,h.l)(t,o,N,s))return(0,x.CN)(v(),s,t),null;(0,l.B8)(N,N);const a=(0,l.lw)(C,N,C);return b(a,t,i,O.SOURCE_AND_TARGET),T(e,a)}(e,e.vertexSpace,t.origin,n):function({spatialReference:e,vertexAttributes:t,transform:n},{origin:r},o,i){const s=M(e,i);if(!(0,h.l)(e,r,C,s))return(0,x.CN)(v(),e,s),null;n&&(0,l.lw)(C,C,n.localMatrix),b(C,e,i,O.SOURCE);const a=new Float64Array(t.position.length),u=function(e,t,n,r,o){(0,m.t)(r,e,t);const i=new Float64Array(e.length);return(0,x.$5)(r,o,i,n)?i:((0,x.CN)(v(),o,n),null)}(t.position,C,e,a,s);if(!u)return null;const f=function(e,t,n,r,o,i){if(null==o)return null;const s=new Float32Array(o.length);return(0,x.qs)(o,s,i),(0,x.si)(s,e,t,n,r,s)?s:((0,x.CN)(v(),r,t),null)}(u,e,a,s,t.normal,C);if(t.normal&&!f)return null;const p=function(e,t,n,r,o,i){if(null==o)return null;const s=new Float32Array(o.length);return(0,x.KM)(o,s,i),(0,x.Mv)(s,e,t,n,r,s)?s:((0,x.CN)(v(),r,t),null)}(u,e,a,s,t.tangent,C);if(t.tangent&&!p)return null;if(o){const e=(0,c.v)(E,o);(0,m.a)(u,u,e)}return{position:u,normal:f,tangent:p}}(e,e.vertexSpace,t.origin,n);case"georeferenced":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:n},{origin:r},o,i){const a=M(t,i);if(!(0,h.l)(t,o,C,a))return(0,x.CN)(v(),t,a),null;const u=1/_(t,i,O.TARGET);(0,l.hs)(C,C,[u,u,u]);const c=(0,l.B8)(N,C),{position:f,normal:p,tangent:g}=function(e,t,n){if(!t)return e;if(!n){const{position:n,normal:r,tangent:o}=e;return{position:(0,m.a)(new Float64Array(n.length),n,t),tangent:o,normal:r}}const r=T(e,n.localMatrix);return(0,m.a)(r.position,r.position,t),r}(e,r,n),y=new Float64Array(f.length),d=function(e,t,n,r,o){const i=(0,x.gr)(e,t,r,o);if(!i)return(0,x.CN)(v(),t,o),null;const s=new Float64Array(i.length);return(0,m.t)(s,i,n),s}(f,t,c,y,a);if(!d)return null;const A=(0,s.Ge)(B,c),w=function(e,t,n,r,o,i,s){if(null==e)return null;const a=s??new Float32Array(e.length);return(0,x.X4)(e,t,n,r,o,a)?((0,m.b)(a,a,i),a):((0,x.CN)(v(),n,o),null)}(p,f,t,y,a,A,p!==e.normal?p:void 0);if(!w&&p)return null;const b=function(e,t,n,r,o,i,s){if(null==e)return null;const a=s??new Float32Array(e.length);return(0,x.xA)(e,t,n,r,o,a)?((0,m.b)(a,a,i,4),a):((0,x.CN)(v(),n,o),null)}(g,f,t,y,a,A,g!==e.tangent?g:void 0);return!b&&g?null:{position:d,normal:w,tangent:b}}(e,e.vertexSpace,t.origin,n):function({vertexAttributes:e,transform:t,spatialReference:n},{origin:r},o,i){const s=_(n,i,O.SOURCE_AND_TARGET),a=r||!S(s)?(0,l.C)(C,t?.localMatrix??u.zK):null;a&&b(a,n,i,O.SOURCE_AND_TARGET);const{position:f,normal:p,tangent:h}=a?T(e,a):e,g=i?.allowBufferReuse,y=g?f:new Float64Array(f.length);let d=f;if(r&&(d=(0,m.a)(y,d,r)),o){const e=(0,c.v)(E,o);d=(0,m.a)(y,d,e)}return{position:d!==e.position||g?d:d.slice(),normal:p!==e.normal||g?p:p?.slice(),tangent:h!==e.tangent||g?h:h?.slice()}}(e,e.vertexSpace,t.origin,n)}}function M(e,t){return t?.useEllipsoid&&(0,d.B3)(e)?p.Y0:(0,p.lO)(e)}function T(e,t){const n=new Float64Array(e.position.length);(0,m.t)(n,e.position,t);const r=e.normal?new Float32Array(e.normal.length):null,o=e.tangent?new Float32Array(e.tangent.length):null;return r&&e.normal&&(0,x.qs)(e.normal,r,t),o&&e.tangent&&(0,x.KM)(e.tangent,o,t),{position:n,normal:r,tangent:o}}function b(e,t,n,r){const o=_(t,n,r);S(o)||(0,l.hs)(e,e,[o,o,o])}function _(e,t,n){const r=!!(n&O.SOURCE),o=!!(n&O.TARGET),i=t?.sourceUnit,s=t?.targetUnit;if(!i&&!s)return 1;let a=R(i,e);r||!i||S(a)||(v().warn("source unit conversion not supported"),a=1);let l=1/R(s,e);return o||!s||S(l)||(v().warn("target unit conversion not supported"),l=1),a*l}function S(e){return(0,o.Io)(e,1)}function R(e,t){if(null==e)return 1;const n=(0,i.KX)(t);return 1/(0,i.oU)(n,"meters",e)}const C=(0,u.vt)(),N=(0,u.vt)(),B=(0,a.vt)(),E=(0,f.vt)(),Z=(0,u.vt)();var O,F;(F=O||(O={}))[F.NONE=0]="NONE",F[F.SOURCE=1]="SOURCE",F[F.TARGET=2]="TARGET",F[F.SOURCE_AND_TARGET=3]="SOURCE_AND_TARGET"},73354:(e,t,n)=>{n.d(t,{a:()=>f,b:()=>a,c:()=>s,d:()=>o,e:()=>p,f:()=>c,l:()=>u,n:()=>h,t:()=>i});var r=n(40876);function o(e,t,n){i(e.typedBuffer,t.typedBuffer,n,e.typedBufferStride,t.typedBufferStride)}function i(e,t,n,r=3,o=r){if(e.length/r!==Math.ceil(t.length/o))return e;const i=e.length/r,s=n[0],a=n[1],l=n[2],u=n[4],c=n[5],f=n[6],p=n[8],h=n[9],g=n[10],y=n[12],d=n[13],m=n[14];let x=0,v=0;for(let n=0;n<i;n++){const n=t[x],i=t[x+1],A=t[x+2];e[v]=s*n+u*i+p*A+y,e[v+1]=a*n+c*i+h*A+d,e[v+2]=l*n+f*i+g*A+m,x+=o,v+=r}return e}function s(e,t,n){a(e.typedBuffer,t.typedBuffer,n,e.typedBufferStride,t.typedBufferStride)}function a(e,t,n,r=3,o=r){if(e.length/r!==Math.ceil(t.length/o))return;const i=e.length/r,s=n[0],a=n[1],l=n[2],u=n[3],c=n[4],f=n[5],p=n[6],h=n[7],g=n[8];let y=0,d=0;for(let n=0;n<i;n++){const n=t[y],i=t[y+1],m=t[y+2];e[d]=s*n+u*i+p*m,e[d+1]=a*n+c*i+h*m,e[d+2]=l*n+f*i+g*m,y+=o,d+=r}}function l(e,t,n,r=3,o=r){const i=Math.min(e.length/r,t.length/o);let s=0,a=0;for(let l=0;l<i;l++)e[a]=n*t[s],e[a+1]=n*t[s+1],e[a+2]=n*t[s+2],s+=o,a+=r;return e}function u(e,t,n,r){c(e.typedBuffer,t.typedBuffer,n,r,e.typedBufferStride,t.typedBufferStride)}function c(e,t,n,o,i=3,s=i){const a=Math.min(e.length/i,t.length/s);let l=0,u=0;const c=1/r.Tf;for(let r=0;r<a;r++)e[u]=o*(n*t[l])**c,e[u+1]=o*(n*t[l+1])**c,e[u+2]=o*(n*t[l+2])**c,l+=s,u+=i}function f(e,t,n,r=3,o=r){const i=e.length/r;if(i!==Math.ceil(t.length/o))return e;let s=0,a=0;for(let l=0;l<i;l++)e[a]=t[s]+n[0],e[a+1]=t[s+1]+n[1],e[a+2]=t[s+2]+n[2],s+=o,a+=r;return e}function p(e,t){h(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function h(e,t,n=3,r=n){const o=Math.min(e.length/n,t.length/r);let i=0,s=0;for(let a=0;a<o;a++){const o=t[i],a=t[i+1],l=t[i+2],u=o*o+a*a+l*l;if(u>0){const t=1/Math.sqrt(u);e[s]=t*o,e[s+1]=t*a,e[s+2]=t*l}i+=r,s+=n}}n(44208),n(53966),Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:u,normalize:h,normalizeView:p,scale:l,scaleView:function(e,t,n){l(e.typedBuffer,t.typedBuffer,n,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,n){const r=Math.min(e.count,t.count),o=e.typedBuffer,i=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride;let l=0,u=0;for(let e=0;e<r;e++)o[u]=s[l]>>n,o[u+1]=s[l+1]>>n,o[u+2]=s[l+2]>>n,l+=a,u+=i},transformMat3:a,transformMat3View:s,transformMat4:i,transformMat4View:o,translate:f},Symbol.toStringTag,{value:"Module"}))},80882:(e,t,n)=>{n.d(t,{A:()=>p});var r,o=n(90237),i=n(68197),s=n(10107),a=(n(44208),n(53966),n(87811),n(40608)),l=n(19211),u=n(35063),c=n(51147);let f=r=class extends l.A{constructor(e){super(e),this.emissiveColor=null,this.emissiveTexture=null,this.emissiveTextureTransform=void 0,this.occlusionTexture=null,this.occlusionTextureTransform=void 0,this.metallic=1,this.roughness=1,this.metallicRoughnessTexture=null,this.metallicRoughnessTextureTransform=void 0}clone(){return this.cloneWithDeduplication(null,new Map)}cloneWithDeduplication(e,t){const n=null!=e?e.get(this):null;if(n)return n;const o=new r(this.clonePropertiesWithDeduplication(t));return null!=e&&e.set(this,o),o}getMemoryUsage(){let e=super.getMemoryUsage();return e+=null!=this.emissiveColor?16:0,null!=this.emissiveTexture&&(e+=this.emissiveTexture.memoryUsage),e+=null!=this.emissiveTextureTransform?20:0,null!=this.occlusionTexture&&(e+=this.occlusionTexture.memoryUsage),e+=null!=this.occlusionTextureTransform?20:0,null!=this.metallicRoughnessTexture&&(e+=this.metallicRoughnessTexture.memoryUsage),e+=null!=this.metallicRoughnessTextureTransform?20:0,e}clonePropertiesWithDeduplication(e){return{...super.clonePropertiesWithDeduplication(e),emissiveColor:this.emissiveColor?.clone(),emissiveTexture:this.emissiveTexture?.cloneWithDeduplication(e),emissiveTextureTransform:this.emissiveTextureTransform?.clone(),occlusionTexture:this.occlusionTexture?.cloneWithDeduplication(e),occlusionTextureTransform:this.occlusionTextureTransform?.clone(),metallic:this.metallic,roughness:this.roughness,metallicRoughnessTexture:this.metallicRoughnessTexture?.cloneWithDeduplication(e),metallicRoughnessTextureTransform:this.metallicRoughnessTextureTransform?.clone()}}};(0,o._)([(0,s.MZ)({type:i.A,json:{write:!0}})],f.prototype,"emissiveColor",void 0),(0,o._)([(0,s.MZ)({type:u.A,json:{write:!0}})],f.prototype,"emissiveTexture",void 0),(0,o._)([(0,s.MZ)({type:c.A,json:{write:!0}})],f.prototype,"emissiveTextureTransform",void 0),(0,o._)([(0,s.MZ)({type:u.A,json:{write:!0}})],f.prototype,"occlusionTexture",void 0),(0,o._)([(0,s.MZ)({type:c.A,json:{write:!0}})],f.prototype,"occlusionTextureTransform",void 0),(0,o._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],f.prototype,"metallic",void 0),(0,o._)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],f.prototype,"roughness",void 0),(0,o._)([(0,s.MZ)({type:u.A,json:{write:!0}})],f.prototype,"metallicRoughnessTexture",void 0),(0,o._)([(0,s.MZ)({type:c.A,json:{write:!0}})],f.prototype,"metallicRoughnessTextureTransform",void 0),f=r=(0,o._)([(0,a.$)("esri.geometry.support.MeshMaterialMetallicRoughness")],f);const p=f},83349:(e,t,n)=>{function r(e,t,n){n=n||2;var r,i,a,l,u,c,p,h=t&&t.length,g=h?t[0]*n:e.length,y=o(e,0,g,n,!0),d=[];if(!y||y.next===y.prev)return d;if(h&&(y=f(e,t,y,n)),e.length>80*n){r=a=e[0],i=l=e[1];for(var m=n;m<g;m+=n)(u=e[m])<r&&(r=u),(c=e[m+1])<i&&(i=c),u>a&&(a=u),c>l&&(l=c);p=0!==(p=Math.max(a-r,l-i))?1/p:0}return s(y,d,n,r,i,p),d}function o(e,t,n,r,o){var i,s;if(o===E(e,t,n,r)>0)for(i=t;i<n;i+=r)s=C(i,e[i],e[i+1],s);else for(i=n-r;i>=t;i-=r)s=C(i,e[i],e[i+1],s);if(s&&M(s,s.next)){var a=s.next;N(s),s=a}return s}function i(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!M(r,r.next)&&0!==w(r.prev,r,r.next))r=r.next;else{var o=r.prev;if(N(r),(r=t=o)===r.next)break;n=!0}}while(n||r!==t);return t}function s(e,t,n,r,o,f,p){if(e){!p&&f&&d(e,r,o,f);for(var h,g,y=e;e.prev!==e.next;)if(h=e.prev,g=e.next,f?l(e,r,o,f):a(e))t.push(h.i/n),t.push(e.i/n),t.push(g.i/n),N(e),e=g.next,y=g.next;else if((e=g)===y){p?1===p?s(e=u(i(e),t,n),t,n,r,o,f,2):2===p&&c(e,t,n,r,o,f):s(i(e),t,n,r,o,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(w(t,n,r)>=0)return!1;for(var o=e.next.next;o!==e.prev;){if(v(t.x,t.y,n.x,n.y,r.x,r.y,o.x,o.y)&&w(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function l(e,t,n,r){var o=e.prev,i=e,s=e.next;if(w(o,i,s)>=0)return!1;for(var a=o.x<i.x?o.x<s.x?o.x:s.x:i.x<s.x?i.x:s.x,l=o.y<i.y?o.y<s.y?o.y:s.y:i.y<s.y?i.y:s.y,u=o.x>i.x?o.x>s.x?o.x:s.x:i.x>s.x?i.x:s.x,c=o.y>i.y?o.y>s.y?o.y:s.y:i.y>s.y?i.y:s.y,f=m(a,l,t,n,r),p=m(u,c,t,n,r),h=e.prevZ,g=e.nextZ;h&&h.z>=f&&g&&g.z<=p;){if(h!==e.prev&&h!==e.next&&v(o.x,o.y,i.x,i.y,s.x,s.y,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,g!==e.prev&&g!==e.next&&v(o.x,o.y,i.x,i.y,s.x,s.y,g.x,g.y)&&w(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&v(o.x,o.y,i.x,i.y,s.x,s.y,h.x,h.y)&&w(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;g&&g.z<=p;){if(g!==e.prev&&g!==e.next&&v(o.x,o.y,i.x,i.y,s.x,s.y,g.x,g.y)&&w(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function u(e,t,n){var r=e;do{var o=r.prev,s=r.next.next;!M(o,s)&&T(o,r,r.next,s)&&S(o,s)&&S(s,o)&&(t.push(o.i/n),t.push(r.i/n),t.push(s.i/n),N(r),N(r.next),r=e=s),r=r.next}while(r!==e);return i(r)}function c(e,t,n,r,o,a){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&A(l,u)){var c=R(l,u);return l=i(l,l.next),c=i(c,c.next),s(l,t,n,r,o,a),void s(c,t,n,r,o,a)}u=u.next}l=l.next}while(l!==e)}function f(e,t,n,r){var s,a,l,u=[];for(s=0,a=t.length;s<a;s++)(l=o(e,t[s]*r,s<a-1?t[s+1]*r:e.length,r,!1))===l.next&&(l.steiner=!0),u.push(x(l));for(u.sort(p),s=0;s<u.length;s++)n=i(n=g(u[s],n),n.next);return n}function p(e,t){return e.x-t.x}function h(e){if(e.next.prev===e)return e;let t=e;for(;;){const n=t.next;if(n.prev===t||n===t||n===e)break;t=n}return t}function g(e,t){var n=function(e,t){var n,r=t,o=e.x,i=e.y,s=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var a=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=o&&a>s){if(s=a,a===o){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(o===s)return n;var l,u=n,c=n.x,f=n.y,p=1/0;r=n;do{o>=r.x&&r.x>=c&&o!==r.x&&v(i<f?o:s,i,c,f,i<f?s:o,i,r.x,r.y)&&(l=Math.abs(i-r.y)/(o-r.x),S(r,e)&&(l<p||l===p&&(r.x>n.x||r.x===n.x&&y(n,r)))&&(n=r,p=l)),r=r.next}while(r!==u);return n}(e,t);if(!n)return t;var r=R(n,e),o=i(n,n.next);let s=h(r);return i(s,s.next),o=h(o),h(t===n?o:t)}function y(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}function d(e,t,n,r){var o=e;do{null===o.z&&(o.z=m(o.x,o.y,t,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,n,r,o,i,s,a,l,u=1;do{for(n=e,e=null,i=null,s=0;n;){for(s++,r=n,a=0,t=0;t<u&&(a++,r=r.nextZ);t++);for(l=u;a>0||l>0&&r;)0!==a&&(0===l||!r||n.z<=r.z)?(o=n,n=n.nextZ,a--):(o=r,r=r.nextZ,l--),i?i.nextZ=o:e=o,o.prevZ=i,i=o;n=r}i.nextZ=null,u*=2}while(s>1)}(o)}function m(e,t,n,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*o)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*o)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function x(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function v(e,t,n,r,o,i,s,a){return(o-s)*(t-a)-(e-s)*(i-a)>=0&&(e-s)*(r-a)-(n-s)*(t-a)>=0&&(n-s)*(i-a)-(o-s)*(r-a)>=0}function A(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&T(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(S(e,t)&&S(t,e)&&function(e,t){var n=e,r=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||M(e,t)&&w(e.prev,e,e.next)>0&&w(t.prev,t,t.next)>0)}function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function M(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,n,r){var o=_(w(e,t,n)),i=_(w(e,t,r)),s=_(w(n,r,e)),a=_(w(n,r,t));return o!==i&&s!==a||!(0!==o||!b(e,n,t))||!(0!==i||!b(e,r,t))||!(0!==s||!b(n,e,r))||!(0!==a||!b(n,t,r))}function b(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function _(e){return e>0?1:e<0?-1:0}function S(e,t){return w(e.prev,e,e.next)<0?w(e,t,e.next)>=0&&w(e,e.prev,t)>=0:w(e,t,e.prev)<0||w(e,e.next,t)<0}function R(e,t){var n=new B(e.i,e.x,e.y),r=new B(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function C(e,t,n,r){var o=new B(e,t,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function N(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function B(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(e,t,n,r){for(var o=0,i=t,s=n-r;i<n;i+=r)o+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return o}n.d(t,{e:()=>r}),r.deviation=function(e,t,n,r){var o=t&&t.length,i=o?t[0]*n:e.length,s=Math.abs(E(e,0,i,n));if(o)for(var a=0,l=t.length;a<l;a++){var u=t[a]*n,c=a<l-1?t[a+1]*n:e.length;s-=Math.abs(E(e,u,c,n))}var f=0;for(a=0;a<r.length;a+=3){var p=r[a]*n,h=r[a+1]*n,g=r[a+2]*n;f+=Math.abs((e[p]-e[g])*(e[h+1]-e[p+1])-(e[p]-e[h])*(e[g+1]-e[p+1]))}return 0===s&&0===f?0:Math.abs((f-s)/s)},r.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,o=0;o<e.length;o++){for(var i=0;i<e[o].length;i++)for(var s=0;s<t;s++)n.vertices.push(e[o][i][s]);o>0&&(r+=e[o-1].length,n.holes.push(r))}return n}},95696:(e,t,n)=>{n.d(t,{A:()=>f});var r,o=n(90237),i=n(69540),s=n(25482),a=n(10107),l=(n(44208),n(53966),n(87811),n(93223)),u=n(40608);let c=class extends(i.A.ClonableMixin(s.A)){static{r=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new r}};(0,o._)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,o._)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=r=(0,o._)([(0,u.$)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c);const f=c},97146:(e,t,n)=>{n.d(t,{Dg:()=>i,my:()=>s,tM:()=>c,uW:()=>o});var r=n(34275);function o(e){return i(e,!0)}function i(e,t){if(Array.isArray(e)){if(e.length<r.y9)return e}else if(e.length<r.y9)return Array.from(e);let n=!0,o=!0;return e.some(((e,t)=>(n=n&&0===e,o=o&&e===t,!n&&!o))),n?function(e){if(1===e)return l;if(e<r.y9)return new Array(e).fill(0);if(e>p.length){const t=Math.max(2*p.length,e);p=new Uint8Array(t)}return new Uint8Array(p.buffer,0,e)}(e.length):o?c(e.length):(0,r.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const n of e){if(n>=65536)return(0,r.iu)(e)?e:new Uint32Array(e);n>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function s(e){return e<=r.y9?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let a=f(131072);const l=[0],u=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function c(e){return 1===e?l:e<r.y9?Array.from(new Uint16Array(u.buffer,0,e)):e<u.length?new Uint16Array(u.buffer,0,e):(e>a.length&&(a=f(Math.max(2*a.length,e))),new Uint32Array(a.buffer,0,e))}function f(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let p=new Uint8Array(65536)}}]);