@arcgis/core 6.0.0-next.13 → 6.0.0-next.15

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 (220) hide show
  1. package/arcade/containerUtils.js +1 -1
  2. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  3. package/arcade/functions/feature.js +1 -1
  4. package/arcade/functions/featuresetstring.js +1 -1
  5. package/arcade/functions/geomasync.js +1 -1
  6. package/arcade/functions/portal.js +1 -1
  7. package/arcade/functions/string.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/{5566f14afb63065e438f.js → 0050916e462e3c9e0627.js} +1 -1
  10. package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +1 -0
  11. package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
  12. package/assets/esri/core/workers/chunks/0da6abe3ceabfe78f7a0.js +1 -0
  13. package/assets/esri/core/workers/chunks/0f617980c7dd9ad0444f.js +1 -0
  14. package/assets/esri/core/workers/chunks/{fb444954be74c1962ced.js → 10d80e793019dfb45ca2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{10445313d0d57b34511b.js → 2145a512d269d64036b0.js} +1 -1
  16. package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +1 -0
  17. package/assets/esri/core/workers/chunks/25f19fc929f25ddd628c.js +1 -0
  18. package/assets/esri/core/workers/chunks/28b74bc77f7c13080074.js +1 -0
  19. package/assets/esri/core/workers/chunks/{2ef5237e4c876d6a4ee0.js → 2bd4ee083ca4ad221f8b.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{f4f9d08b2df856e3b694.js → 2eae542fe7f0f6576ac1.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{2aeb5cc32284dd3e4d22.js → 33e4ff228a8c81b99022.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{42323093827adffe56d3.js → 3418877328f4f0830300.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{8dc1c3042267618fd710.js → 34cbaf844730ac2d92c2.js} +2 -2
  24. package/assets/esri/core/workers/chunks/{96c50a0dda0f1503ef92.js → 3c301a689c7853c9fa67.js} +2 -2
  25. package/assets/esri/core/workers/chunks/{02253bdffbd580af22d8.js → 3ff6d1ed3c0f1285f3e7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{67e4b5651fd7ff7d8cf0.js → 4ac1d3e49e242e373a92.js} +1 -1
  27. package/assets/esri/core/workers/chunks/4df6cb1bee5d0720a43e.js +1 -0
  28. package/assets/esri/core/workers/chunks/{a4cab24af69260438ff4.js → 4e6f40cbdb8c508e6df1.js} +1 -1
  29. package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
  30. package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +1 -0
  31. package/assets/esri/core/workers/chunks/{2686fe5b62dd0be699c0.js → 634523cc7757da9020e4.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{a518ae5683367eeda74c.js → 70d3055f15d8b0cf4074.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{1b946714ca4a1a7359d4.js → 76ab353d80d786777161.js} +2 -2
  34. package/assets/esri/core/workers/chunks/7f8e327acad48c9e75ea.js +1 -0
  35. package/assets/esri/core/workers/chunks/8052da8be251c3ff2176.js +1 -0
  36. package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
  37. package/assets/esri/core/workers/chunks/{f6e62d2d279a328cbed7.js → 90bdf86f553e2742d67c.js} +1 -1
  38. package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +1 -0
  39. package/assets/esri/core/workers/chunks/94e427040edb469d58ad.js +1 -0
  40. package/assets/esri/core/workers/chunks/{3d9d7d3a40b51eb7ee3d.js → 953ba13299e7aa92c1a0.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{f46d9a19f79d4a4bd354.js → 9e1a3b6a08c96dcefdde.js} +1 -1
  42. package/assets/esri/core/workers/chunks/9f0a973a0dd28953ce25.js +1 -0
  43. package/assets/esri/core/workers/chunks/a2ad3e620c98e2b2eb06.js +1 -0
  44. package/assets/esri/core/workers/chunks/a34b3d2e11a777e1ff3f.js +1 -0
  45. package/assets/esri/core/workers/chunks/{140f2eeb11e39ab15734.js → aa36c3a9bbaa086e3757.js} +1 -1
  46. package/assets/esri/core/workers/chunks/ae31fd416bbb41a81392.js +1 -0
  47. package/assets/esri/core/workers/chunks/b49df4ebd4be1181b0f9.js +2 -0
  48. package/assets/esri/core/workers/chunks/{68d8ae42ab71d01a70a5.js → b557824bc1fa163d72a3.js} +2 -2
  49. package/assets/esri/core/workers/chunks/bc915fb182d463d804e6.js +1 -0
  50. package/assets/esri/core/workers/chunks/{992f102992c2bed7b34e.js → d5d0fe8e198ff5a902ee.js} +1 -1
  51. package/assets/esri/core/workers/chunks/e2190361247f35b02b32.js +1 -0
  52. package/assets/esri/core/workers/chunks/e2f42aec02bff33b25dd.js +1 -0
  53. package/assets/esri/core/workers/chunks/ebc1a2ef3aed8aa29424.js +1 -0
  54. package/assets/esri/core/workers/chunks/ed6e9d7f71bfd2691717.js +1 -0
  55. package/assets/esri/core/workers/chunks/ed8786fed345718ed684.js +1 -0
  56. package/assets/esri/core/workers/chunks/ee6679ef9efa1504e7eb.js +1 -0
  57. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  58. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  59. package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
  60. package/chunks/BlendWeights.glsl.js +10 -10
  61. package/chunks/Blur.glsl.js +2 -2
  62. package/chunks/EdgeDetect.glsl.js +24 -19
  63. package/chunks/HUDMaterial.glsl.js +11 -1
  64. package/chunks/HighlightApply.glsl.js +4 -5
  65. package/chunks/HighlightBlur.glsl.js +5 -5
  66. package/chunks/HighlightDownsample.glsl.js +2 -2
  67. package/chunks/HighlightSharpApply.glsl.js +61 -0
  68. package/chunks/lyr3DMain.js +1 -1
  69. package/chunks/lyr3DWorker.js +2 -2
  70. package/chunks/portal.js +1 -1
  71. package/config.js +1 -1
  72. package/core/ObjectPool.js +1 -1
  73. package/core/PooledArray.js +1 -1
  74. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  75. package/geometry/support/buffer/BufferPool.js +1 -1
  76. package/geometry/support/coordsUtils.js +1 -1
  77. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  78. package/geometry/support/curves/mathUtils.js +1 -1
  79. package/geometry/support/meshUtils.d.ts +5 -6
  80. package/interfaces.d.ts +18 -9
  81. package/kernel.js +1 -1
  82. package/layers/GeospatialPDFLayer.d.ts +154 -4
  83. package/layers/Layer.d.ts +2 -0
  84. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  85. package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
  86. package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
  87. package/layers/geospatialPDF/projectionToWKTUtils.js +2 -2
  88. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  89. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  90. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  91. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  92. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  93. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  94. package/layers/raster/datasets/TIFFRaster.js +1 -1
  95. package/layers/raster/datasets/pixelReader.js +1 -1
  96. package/layers/raster/functions/clipUtils.js +1 -1
  97. package/layers/support/LabelClass.d.ts +3 -2
  98. package/layers/support/PortalItemData.d.ts +31 -8
  99. package/layers/support/fieldUtils.js +1 -1
  100. package/layers/support/types.d.ts +4 -1
  101. package/package.json +2 -2
  102. package/portal/schemas/definitions.js +1 -1
  103. package/rest/knowledgeGraph/ObjectValue.js +1 -1
  104. package/symbols/cim/cimAnalyzer.js +1 -1
  105. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  106. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  107. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  108. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  109. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  110. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  111. package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
  112. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  113. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  114. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  115. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  116. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  117. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  118. package/views/3d/support/MemoryController.js +1 -1
  119. package/views/3d/terrain/TerrainData.js +1 -1
  120. package/views/3d/terrain/terrainUtils.js +1 -1
  121. package/views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js +20 -6
  122. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  123. package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
  124. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  125. package/views/3d/webgl-engine/effects/highlight/HighlightApply.glsl.js +1 -1
  126. package/views/3d/webgl-engine/effects/highlight/HighlightCellGridScreenSpacePassParameters.js +2 -0
  127. package/views/3d/webgl-engine/effects/highlight/HighlightDownsample.glsl.js +1 -1
  128. package/views/3d/webgl-engine/effects/highlight/HighlightPassParameters.js +1 -1
  129. package/views/3d/webgl-engine/effects/highlight/HighlightSharpApply.glsl.js +2 -0
  130. package/views/3d/webgl-engine/effects/highlight/HighlightSharpApplyTechnique.js +2 -0
  131. package/views/3d/webgl-engine/effects/smaa/BlendWeights.glsl.js +1 -1
  132. package/views/3d/webgl-engine/effects/smaa/Blur.glsl.js +1 -1
  133. package/views/3d/webgl-engine/effects/smaa/EdgeDetect.glsl.js +1 -1
  134. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  135. package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
  136. package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
  137. package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
  138. package/views/3d/webgl-engine/effects/smaa/SMAAPassParameters.js +1 -1
  139. package/views/3d/webgl-engine/effects/smaa/SMAATechniqueConfiguration.js +2 -0
  140. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  141. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  142. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  143. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  144. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  145. package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
  146. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  147. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  148. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  149. package/views/draw/DrawTool.js +1 -1
  150. package/views/draw/plugins/MultipointPlugin.js +1 -1
  151. package/views/draw/support/PluginContext.js +1 -1
  152. package/views/draw/support/managers/TooltipManager.js +1 -1
  153. package/views/draw/support/types.d.ts +5 -2
  154. package/views/support/HighlightDefaults.js +1 -1
  155. package/webdoc/applicationProperties/SearchLayerField.d.ts +7 -1
  156. package/webdoc/applicationProperties/SearchLayerField.js +1 -1
  157. package/webdoc/applicationProperties/SearchTableField.d.ts +7 -1
  158. package/webdoc/applicationProperties/SearchTableField.js +1 -1
  159. package/webdoc/applicationProperties/searchMode.js +2 -0
  160. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  161. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  162. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  163. package/widgets/BatchAttributeForm.js +1 -1
  164. package/widgets/Editor/EditorViewModel.d.ts +10 -1
  165. package/widgets/Editor.d.ts +10 -1
  166. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  167. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  168. package/widgets/HistogramRangeSlider.d.ts +2 -2
  169. package/widgets/HistogramRangeSlider.js +1 -1
  170. package/widgets/Legend.d.ts +1 -0
  171. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  172. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
  173. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  174. package/widgets/ScaleRangeSlider.js +1 -1
  175. package/widgets/Search/LayerSearchSource.d.ts +23 -1
  176. package/widgets/Search/LayerSearchSource.js +1 -1
  177. package/widgets/Search/support/layerSearchUtils.js +1 -1
  178. package/widgets/Search/types.d.ts +7 -0
  179. package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
  180. package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
  181. package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
  182. package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
  183. package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
  184. package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
  185. package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
  186. package/widgets/ValuePicker/types.d.ts +2 -0
  187. package/widgets/support/forms/formUtils.js +1 -1
  188. package/widgets/support/forms/types.d.ts +1 -1
  189. package/assets/esri/core/workers/chunks/037a8cc19debbaaa4e10.js +0 -1
  190. package/assets/esri/core/workers/chunks/0dc66b03ff55d0ea5a09.js +0 -1
  191. package/assets/esri/core/workers/chunks/175c268e64ccd01f8c25.js +0 -1
  192. package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
  193. package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +0 -2
  194. package/assets/esri/core/workers/chunks/3df5500a85345577480a.js +0 -1
  195. package/assets/esri/core/workers/chunks/3f7d583b676b23b3fadb.js +0 -1
  196. package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
  197. package/assets/esri/core/workers/chunks/4503b20ca6a80fb63d72.js +0 -1
  198. package/assets/esri/core/workers/chunks/4a640548032355e57acd.js +0 -1
  199. package/assets/esri/core/workers/chunks/53be85d04cd2da4f391d.js +0 -1
  200. package/assets/esri/core/workers/chunks/566e129f3d3805d7370a.js +0 -1
  201. package/assets/esri/core/workers/chunks/567a65f4203f6e81f4b4.js +0 -1
  202. package/assets/esri/core/workers/chunks/5982c6a8459c1237b298.js +0 -1
  203. package/assets/esri/core/workers/chunks/5eae5c29149f2429fe96.js +0 -1
  204. package/assets/esri/core/workers/chunks/6dc86e7496157c5e4d2c.js +0 -1
  205. package/assets/esri/core/workers/chunks/74b5c00f93cfc0d59029.js +0 -1
  206. package/assets/esri/core/workers/chunks/7c2c8f786a30267a5f05.js +0 -1
  207. package/assets/esri/core/workers/chunks/88e54449261ef94e390d.js +0 -1
  208. package/assets/esri/core/workers/chunks/9e142551163acf752618.js +0 -1
  209. package/assets/esri/core/workers/chunks/af75747b06d79446a855.js +0 -1
  210. package/assets/esri/core/workers/chunks/dba280c370df13196711.js +0 -1
  211. package/assets/esri/core/workers/chunks/dc486a3595b6d57018bb.js +0 -1
  212. package/assets/esri/core/workers/chunks/e3c1c9e6c62ba5cbcdb8.js +0 -1
  213. package/assets/esri/core/workers/chunks/f1f90adae13b04898008.js +0 -1
  214. package/assets/esri/core/workers/chunks/f47c7065da3b5001245f.js +0 -1
  215. /package/assets/esri/core/workers/chunks/{1b946714ca4a1a7359d4.js.LICENSE.txt → 34cbaf844730ac2d92c2.js.LICENSE.txt} +0 -0
  216. /package/assets/esri/core/workers/chunks/{96c50a0dda0f1503ef92.js.LICENSE.txt → 3c301a689c7853c9fa67.js.LICENSE.txt} +0 -0
  217. /package/assets/esri/core/workers/chunks/{8dc1c3042267618fd710.js.LICENSE.txt → 76ab353d80d786777161.js.LICENSE.txt} +0 -0
  218. /package/assets/esri/core/workers/chunks/{2a1ec30f9ad305763f81.js.LICENSE.txt → b49df4ebd4be1181b0f9.js.LICENSE.txt} +0 -0
  219. /package/assets/esri/core/workers/chunks/{68d8ae42ab71d01a70a5.js.LICENSE.txt → b557824bc1fa163d72a3.js.LICENSE.txt} +0 -0
  220. /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7013],{69052(e,t,r){r.d(t,{hr:()=>i});var s=r(34727);class i{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return a(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,s.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+n(this.range,e-t,r)}minimalMonotonic(e,t,r){return a(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);let r=(t=this.normalize(t))-e,s=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(s)?r:s}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function a(e,t,r,s,i=0,a=!1){return(s-=i)<t?s+=n(e,t-s):s>r&&(s-=n(e,s-r)),a&&s===r&&(s=t),s+i}function n(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const o=new i(0,2*Math.PI),u=(new i(-Math.PI,Math.PI),new i(0,360));r.d(t,["ie",0,u,"uC",0,o])},18370(e,t,r){r.d(t,{z:()=>i});class s{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function i(e){return new s(e)}},82534(e,t,r){function s(){return[0,0,0,1]}function i(e){return[e[0],e[1],e[2],e[3]]}r.d(t,{o8:()=>i,vt:()=>s});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:i,create:s,fromValues:function(e,t,r,s){return[e,t,r,s]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["zK",0,a])},67026(e,t,r){r.d(t,{A6:()=>f,Xd:()=>p,Xr:()=>d,lw:()=>c,x8:()=>l});var s=r(29242),i=r(82534),a=r(51850),n=r(34304),o=r(35522),u=r(78955);function l(e,t,r){r*=.5;let s=Math.sin(r);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(r),e}function p(e,t){let r=2*Math.acos(t[3]),s=Math.sin(r/2);return s>(0,n.FD)()?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),r}function c(e,t,r){let s=t[0],i=t[1],a=t[2],n=t[3],o=r[0],u=r[1],l=r[2],p=r[3];return e[0]=s*p+n*o+i*l-a*u,e[1]=i*p+n*u+a*o-s*l,e[2]=a*p+n*l+s*u-i*o,e[3]=n*p-s*o-i*u-a*l,e}function h(e,t,r,s){let i,a,o,u,l,p=t[0],c=t[1],h=t[2],d=t[3],y=r[0],f=r[1],m=r[2],g=r[3];return a=p*y+c*f+h*m+d*g,a<0&&(a=-a,y=-y,f=-f,m=-m,g=-g),1-a>(0,n.FD)()?(i=Math.acos(a),o=Math.sin(i),u=Math.sin((1-s)*i)/o,l=Math.sin(s*i)/o):(u=1-s,l=s),e[0]=u*p+l*y,e[1]=u*c+l*f,e[2]=u*h+l*m,e[3]=u*d+l*g,e}function d(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function y(e,t){let r,s=t[0]+t[4]+t[8];if(s>0)r=Math.sqrt(s+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);let i=(s+1)%3,a=(s+2)%3;r=Math.sqrt(t[3*s+s]-t[3*i+i]-t[3*a+a]+1),e[s]=.5*r,r=.5/r,e[3]=(t[3*i+a]-t[3*a+i])*r,e[i]=(t[3*i+s]+t[3*s+i])*r,e[a]=(t[3*a+s]+t[3*s+a])*r}return e}function f(e,t,r,s){let i=.5*Math.PI/180;t*=i,r*=i,s*=i;let a=Math.sin(t),n=Math.cos(t),o=Math.sin(r),u=Math.cos(r),l=Math.sin(s),p=Math.cos(s);return e[0]=a*u*p-n*o*l,e[1]=n*o*p+a*u*l,e[2]=n*u*l-a*o*p,e[3]=n*u*p+a*o*l,e}const m=u.C,g=u.hZ,S=u.WQ,A=c,v=u.hs,_=u.Om,b=u.Cc,x=u.Bw,w=x,M=u.m3,q=M,I=u.S8,F=u.t2,R=u.aI,O=(0,a.vt)(),C=(0,a.fA)(1,0,0),T=(0,a.fA)(0,1,0),P=(0,i.vt)(),E=(0,i.vt)(),N=(0,s.vt)();Object.freeze(Object.defineProperty({__proto__:null,add:S,calculateW:function(e,t){let r=t[0],s=t[1],i=t[2];return e[0]=r,e[1]=s,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-s*s-i*i)),e},conjugate:d,copy:m,dot:_,equals:R,exactEquals:F,fromEuler:f,fromMat3:y,getAxisAngle:p,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){let r=t[0],s=t[1],i=t[2],a=t[3],n=r*r+s*s+i*i+a*a,o=n?1/n:0;return e[0]=-r*o,e[1]=-s*o,e[2]=-i*o,e[3]=a*o,e},len:w,length:x,lerp:b,mul:A,multiply:c,normalize:I,random:function(e){let t=n.Ov,r=t(),s=t(),i=t(),a=Math.sqrt(1-r),o=Math.sqrt(r);return e[0]=a*Math.sin(2*Math.PI*s),e[1]=a*Math.cos(2*Math.PI*s),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},rotateX:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u+n*o,e[1]=i*u+a*o,e[2]=a*u-i*o,e[3]=n*u-s*o,e},rotateY:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u-a*o,e[1]=i*u+n*o,e[2]=a*u+s*o,e[3]=n*u-i*o,e},rotateZ:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u+i*o,e[1]=i*u-s*o,e[2]=a*u+n*o,e[3]=n*u-a*o,e},rotationTo:function(e,t,r){let s=(0,o.Om)(t,r);return s<-.999999?((0,o.$A)(O,C,t),(0,o.Il)(O)<1e-6&&(0,o.$A)(O,T,t),(0,o.S8)(O,O),l(e,O,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,o.$A)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+s,I(e,e))},scale:v,set:g,setAxes:function(e,t,r,s){let i=N;return i[0]=r[0],i[3]=r[1],i[6]=r[2],i[1]=s[0],i[4]=s[1],i[7]=s[2],i[2]=-t[0],i[5]=-t[1],i[8]=-t[2],I(e,y(e,i))},setAxisAngle:l,slerp:h,sqlerp:function(e,t,r,s,i,a){return h(P,t,i,a),h(E,r,s,a),h(e,P,E,2*a*(1-a)),e},sqrLen:q,squaredLength:M,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"})),r.d(t,["hZ",0,g,"t2",0,F])},95696(e,t,r){r.d(t,{A:()=>l});var s,i=r(32198),a=r(69540),n=r(25482),o=r(91429),u=r(93223);let l=class extends((0,a.OU)(n.o)){static{s=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new s}};(0,i.Cg)([(0,u.e)({georeferenced:"georeferenced"},{readOnly:!0})],l.prototype,"type",void 0),(0,i.Cg)([(0,o.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],l.prototype,"origin",void 0),l=s=(0,i.Cg)([(0,o.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],l)},18251(e,t,r){r.d(t,{A:()=>l});var s=r(32198),i=r(69540),a=r(25482),n=r(91429),o=r(51850),u=r(93223);let l=class extends((0,i.OU)(a.o)){constructor(e){super(e),this.type="local",this.origin=(0,o.vt)()}};(0,s.Cg)([(0,u.e)({local:"local"},{readOnly:!0})],l.prototype,"type",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],l.prototype,"origin",void 0),l=(0,s.Cg)([(0,n.$K)("esri.geometry.support.MeshLocalVertexSpace")],l)},73836(e,t,r){r.d(t,{A:()=>d});var s=r(32198),i=r(69540),a=r(25482),n=r(91429),o=r(58083),u=r(9093),l=r(67026),p=r(82534),c=r(51850),h=r(24770);let d=class extends((0,i.OU)(a.o)){constructor(e){super(e),this.translation=(0,c.vt)(),this.rotationAxis=(0,c.ci)(h.up),this.rotationAngle=0,this.scale=(0,c.fA)(1,1,1)}get rotation(){return(0,h.i4)(this.rotationAxis,this.rotationAngle)}set rotation(e){this.rotationAxis=(0,c.o8)((0,h.yo)(e)),this.rotationAngle=(0,h.g7)(e)}get localMatrix(){let e=(0,u.vt)();return(0,l.x8)(y,(0,h.yo)(this.rotation),(0,h.$I)(this.rotation)),(0,o.o1)(e,y,this.translation,this.scale),e}get localMatrixInverse(){return(0,o.B8)((0,u.vt)(),this.localMatrix)}equals(e){return this===e||null!=e&&(0,o.t2)(this.localMatrix,e.localMatrix)}};(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"translation",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAxis",void 0),(0,s.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAngle",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"scale",void 0),(0,s.Cg)([(0,n.MZ)()],d.prototype,"rotation",null),(0,s.Cg)([(0,n.MZ)()],d.prototype,"localMatrix",null),(0,s.Cg)([(0,n.MZ)()],d.prototype,"localMatrixInverse",null),d=(0,s.Cg)([(0,n.$K)("esri.geometry.support.MeshTransform")],d);const y=(0,p.vt)()},24770(e,t,r){r.d(t,{$I:()=>m,AU:()=>d,g7:()=>f,i4:()=>p,ui:()=>c,vt:()=>l,yo:()=>y});var s=r(34727),i=r(58083),a=r(67026),n=r(82534),o=r(35522),u=r(51850);function l(e=S){return[e[0],e[1],e[2],e[3]]}function p(e,t,r=l()){return(0,o.C)(r,e),r[3]=t,r}function c(e,t=l()){let r=(0,i.l)(A,e);return g(t,(0,s.KJ)((0,a.Xd)(t,r))),t}function h(e,t,r=l()){return(0,a.x8)(A,e,m(e)),(0,a.x8)(v,t,m(t)),(0,a.lw)(A,v,A),g(r,(0,s.KJ)((0,a.Xd)(r,A)))}function d(e,t,r,s=l()){return p(u.Cw,e,_),p(u.JP,t,b),p(u.Cb,r,x),h(_,b,_),h(_,x,s),s}function y(e){return e}function f(e){return e[3]}function m(e){return(0,s.kU)(e[3])}function g(e,t){return e[3]=t,e}const S=[0,0,1,0],A=(0,n.vt)(),v=(0,n.vt)(),_=(l(),l()),b=l(),x=l();r.d(t,["up",0,S])},63579(e,t,r){r.d(t,{Bq:()=>u,Qp:()=>o,WN:()=>m,dK:()=>g,eN:()=>d,fH:()=>f,in:()=>y,yr:()=>l});var s=r(56507),i=r(4576),a=r(17676),n=r(20557);class o{constructor(e,t,r){this.assetName=e,this.assetMimeType=t,this.parts=r}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,i.aI)(this.parts,e.parts,(e,t)=>e.equals(t))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(let t of this.parts)e+=t.partHash;return e}async toBlob(e){let{parts:t}=this;if(1===t.length)return t[0].toBlob(e);let r=await Promise.all(t.map(t=>t.toBlob(e)));return(0,a.Te)(e),new Blob(r)}}class u{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){let{data:t}=await(0,s.A)(this.partUrl,{responseType:"blob"});return(0,a.Te)(e),t}}function l(e){return function(e){switch(e?.type){case"client":return Array.isArray(e.files)?e.files.some(h):h(e.files);case"service":return e.assets.some(h);case"loadable":return!0;default:return!1}}(e?.source)}const p=/^(model\/gltf\+json)|(model\/gltf-binary)$/,c=/\.(gltf|glb)/i;function h(e){if(e instanceof File){let{type:t,name:r}=e;return p.test(t)||c.test(r)}return p.test(e.assetMimeType)||c.test(e.assetName)}function d(e,t){if(!e)return!1;let{source:r}=e;return function(e,t){return"service"===e.type&&e.assets.every(e=>e.isOnService(t))}(r,t)}function y(e,t){if(e===t)return!0;let{source:r}=e,{source:s}=t;if(r===s)return!0;if("service"===r.type&&"service"===s.type){if(r.assets.length!==s.assets.length)return!1;let e=(e,t)=>e.assetName<t.assetName?-1:+(e.assetName>t.assetName),t=[...r.assets].sort(e),i=[...s.assets].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(i[e]))return!1;return!0}return!1}function f(e,t){return e instanceof File?(0,n.rq)(e,t):(0,n.z$)(e.assetMimeType,e.assetName,t)}function m(e){switch(e.type){case"client":return Array.isArray(e.files)?e.files:[e.files];case"service":return e.assets;case"loadable":return}}function g(e){return!!e.original}},27615(e,t,r){r.d(t,{CK:()=>u,Hq:()=>o,MW:()=>l,TE:()=>p,yJ:()=>c});var s=r(35522),i=r(86738),a=r(95696),n=r(18251);function o(e){return null!=e.origin}function u(e){return o(e.vertexSpace)}function l(e,t){if(!o(e))return null;let[r,s,a]=e.origin;return new i.A({x:r,y:s,z:a,spatialReference:t})}function p(e,t){let{x:r,y:s,z:i,spatialReference:o}=e,u=[r,s,i??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(o))?new n.A({origin:u}):new a.A({origin:u})}function c(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,s.t2)(e.origin,t.origin))}},52039(e,t,r){r.d(t,{O7:()=>h,el:()=>l});var s=r(69052),i=(r(49186),r(18370)),a=r(17676),n=(r(5443),r(39829)),o=(r(82799),r(16930)),u=(r(80754),r(21325));async function l(e,t,r){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(r=t);let s=null;for(let t of e)s??=t?.spatialReference;if(!s)return e;let i=(0,u.Vp)(s);if(!i)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(i);return["xmin"in t?t:new n.A(t)]}let[o,l]=i.valid,h=!1;for(let t of e){if(!t)continue;if("point"===t.type){h||=t.x>=l,h||=t.x<=o;continue}let{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=l,h||=e.xmin<=o,h||=e.xmax>=l,h||=e.xmax<=o}if(!h)return e;let[{foldInto360Range:d},y]=await(0,a.qr)(Promise.all([p.getImportPromise(),c.getImportPromise()]),r),f=y.fromSpatialReference(s);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=y.fromGeometry(e),r=y.toGeometry(d(t,f),s);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const p=(0,i.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),c=(0,i.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function h(e,t,r){let s=(0,u.Vp)(r);if(null==s)return e;let[i,a]=s.valid,n=2*a,o=0,l=0;t>a?o=Math.ceil(Math.abs(t-a)/n):t<i&&(o=-Math.ceil(Math.abs(t-i)/n)),e>a?l=Math.ceil(Math.abs(e-a)/n):e<i&&(l=-Math.ceil(Math.abs(e-i)/n));let p=e+(o-l)*n,c=p-t;return c>a?p-=n:c<i&&(p+=n),p}function d(e){let t=(0,u.Vp)(e);if(null==t)return null;let[r,i]=t.valid;return new s.hr(r,i)}const y=d(o.A.WGS84);d(o.A.WebMercator),r.d(t,["Y_",0,y])},80754(e,t,r){r.d(t,{kS:()=>l,kd:()=>u});var s=r(82799),i=r(16930),a=r(60408),n=r(52006);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function u(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){if((0,n.Ed)(e))for(let r of function(e){return(0,a.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of r)if((0,n.aO)(e)){let[r,s]=e.c;r[0]+=t,s[0]+=t}else if((0,n.FG)(e)){let[r,s]=e.a;r[0]+=t,s[0]+=t}else if((0,n.n1)(e)){let[r,s,i]=e.b;r[0]+=t,s[0]+=t,i[0]+=t}else e[0]+=t;for(let r of function(e){return(0,a.Bi)(e)?e.rings:e.paths}(e))for(let e of r)e[0]+=t;return e}r.d(t,["j7",0,o])},99352(e,t,r){r.d(t,["F",0,{supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:{envelope:!0,centroid:!0,convexHull:!0},supportsStatisticsAggregatedIds:!0,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},"P",0,{supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}])},65515(e,t,r){r.r(t),r.d(t,{default:()=>Y});var s=r(32198),i=r(92602),a=r(56507),n=r(4576),o=r(49186),u=r(44208),l=r(66552),p=r(92474),c=r(53966),h=r(93637),d=r(17676),y=r(36708),f=r(84952),m=r(13069),g=r(91429),S=r(5443),A=r(16930),v=r(95696),_=r(27615),b=r(63579),x=r(52106),w=r(86211);function M(e){return"object"==typeof e&&!!e&&"objectId"in e&&!!e.objectId}function q(e){return e.every(M)}function I(e){return"object"==typeof e&&!!e&&"globalId"in e&&!!e.globalId}function F(e){return e.every(I)}var R=r(99917),O=r(65864),C=r(73836),T=r(21325);async function P(e,t,r){let{geometry:s}=t,i={...t.attributes};if(null!=r&&"mesh"===s?.type){let{transformFieldRoles:t}=r,{origin:a,spatialReference:n,vertexSpace:o}=s,u=s.transform??new C.A,l="local"===o.type,p=e.spatialReference,c=p.isGeographic,h=(0,T.aI)(p,n),d=(0,R.isEqualBaseGCS)(n,p)&&(0,R.canProjectWithoutEngine)(n,p);if(!(l&&c&&d||!l&&!c&&h))return null;let y=(0,R.projectWithoutEngine)(a,n,p);if(null==y)return null;if(i[t.originX]=y.x,i[t.originY]=y.y,i[t.originZ]=y.z??0,null!=u){let{translation:e,scale:r,rotation:s}=u,a=l?1:(0,w.KX)(n)/(0,w.KX)(p);i[t.translationX]=e[0]*a,i[t.translationY]=e[2]*a,i[t.translationZ]=-e[1]*a,i[t.scaleX]=r[0],i[t.scaleY]=r[2],i[t.scaleZ]=r[1],i[t.rotationX]=s[0],i[t.rotationY]=s[2],i[t.rotationZ]=-s[1],i[t.rotationDeg]=s[3]}return{attributes:i}}return null==s?{attributes:i}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:i}}async function E(e,t){let r=await Promise.all((t.addAttachments??[]).map(t=>N(e,t))),s=await Promise.all((t.updateAttachments??[]).map(t=>N(e,t))),i=t.deleteAttachments??[];return r.length||s.length||i.length?{adds:r,updates:s,deletes:[...i]}:null}async function N(e,t){let{feature:r,attachment:s}=t,{globalId:i,name:a,contentType:n,data:o,keywords:u,uploadId:l}=s,p={globalId:i};if(r&&("attributes"in r?p.parentGlobalId=r.attributes?.[e.globalIdField]:r.globalId&&(p.parentGlobalId=r.globalId)),l)p.uploadId=l;else if(o){let e=await(0,f._0)(o);e&&(p.contentType=e.mediaType,p.data=e.data),o instanceof File&&(p.name=o.name)}return a&&(p.name=a),n&&(p.contentType=n),u&&(p.keywords=u),p}function D(e){let t=!0===e.success?null:e.error||{code:void 0,description:"Feature edit failed"};return{objectId:e.objectId,globalId:e.globalId,error:t?new o.A("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}function Q(e,t){return new x.A({attributes:e.attributes,geometry:(0,O.rS)({...e.geometry,spatialReference:t})})}function V(e,t){return{adds:e?.adds?.map(e=>Q(e,t))||[],updates:e?.updates?.map(e=>({original:Q(e[0],t),current:Q(e[1],t)}))||[],deletes:e?.deletes?.map(e=>Q(e,t))||[],spatialReference:t}}var J=r(64714),Z=r(64314),j=r(60694),U=r(15426),G=r(20557),k=r(99199),B=r(96520),z=r(97552),X=r(79677),L=r(20816);const $=new l.J({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),W=new l.J({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let Y=class extends p.x_{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer","Annotation Layer","Dimension Layer"]),this.refresh=(0,d.sg)(async()=>{await this.load();let e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}let t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){let t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}async reload(e){let t=this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0;await this._fetchService(null,{...e,cacheBust:t})}initialize(){this.addHandles([(0,y.wB)(()=>{let e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){let{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:i,uniqueIdFields:a}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,l=(0,u.A)("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n,p=l&&e?.query.supportsFormatPBFWithCurves,c=e?.operations?.supportsQueryAttachments??!1,h=e?.query?.relativeTimeBinWindow??0,d=t.path;return new Z.A({dynamicDataSource:o,fieldsIndex:i,gdbVersion:r,infoFor3D:n,pbfSupported:l,pbfSupportedWithCurves:p,queryAttachmentsSupported:c,relativeTimeBinWindow:h,sourceSpatialReference:s,uniqueIdFields:a,url:d})}async addAttachment(e,t,r){await this.load();let{layer:s}=this;await(0,U.VA)(s,"editing");let i=e.attributes[s.objectIdField],n=s.parsedUrl.path+"/"+i+"/addAttachment",o=this._getLayerRequestOptions({query:r}),u=this._getFormDataForAttachment(t,o.query);try{return D((await(0,a.A)(n,{body:u})).data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(i,e)}}async updateAttachment(e,t,r,s){await this.load();let{layer:i}=this;await(0,U.VA)(i,"editing");let n=e.attributes[i.objectIdField],o=i.parsedUrl.path+"/"+n+"/updateAttachment",u=this._getLayerRequestOptions({query:{attachmentId:t,...s}}),l=this._getFormDataForAttachment(r,u.query);try{return D((await(0,a.A)(o,{body:l})).data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(n,e)}}async applyEdits(e,t){await this.load();let{layer:r}=this;await(0,U.VA)(r,"editing");let s="infoFor3D"in r?r.infoFor3D:null,i=null!=s,u=i||(t?.globalIdUsed??!1),l=i?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,p=e.addFeatures?.map(e=>P(this.layer,e,s))??[],c=(await Promise.all(p)).filter(n.Ru),h=e.updateFeatures?.map(e=>P(this.layer,e,s))??[],d=(await Promise.all(h)).filter(n.Ru),y=function(e,t,r){if(!t||0===t.length)return[];if(r&&F(t))return t.map(e=>e.globalId);if(q(t))return t.map(e=>e.objectId);let s=r?e.globalIdField:e.objectIdField;return s?t.map(e=>e.getAttribute(s)):[]}(this.layer,e.deleteFeatures,u);(0,B.u)(c,d,r.spatialReference);let f=await E(this.layer,e),m=r.capabilities.editing.supportsAsyncApplyEdits&&i,g=t?.gdbVersion||r.gdbVersion,S={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:m};await(0,L.ZJ)(this.layer.url,g,!0);let A=(0,L.w5)(this.layer.url,g||null);if(await(0,L.We)(r.url,g,r.historicMoment))throw new o.A("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(S.edits=JSON.stringify([{id:r.layerId,adds:c.length?c:null,updates:d.length?d:null,deletes:y.length?y:null,attachments:f,assetMaps:l}]),S.returnServiceEditsOption=$.toJSON(t?.returnServiceEditsOption),S.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(S.adds=c.length?JSON.stringify(c):null,S.updates=d.length?JSON.stringify(d):null,S.deletes=y.length?u?JSON.stringify(y):y.join(","):null,S.attachments=f&&JSON.stringify(f),S.assetMaps=null==l?void 0:JSON.stringify(l));let v=this._getLayerRequestOptions({method:"post",query:S});A&&(v.authMode="immediate",v.query.returnEditMoment=!0,v.query.sessionId=L.TA);let _,b=t?.returnServiceEditsOption?r.url:r.parsedUrl.path;try{_=m?await this._asyncApplyEdits(b+"/applyEdits",v):await(0,a.A)(b+"/applyEdits",v)}catch(e){if(!function(e){let t=e.details.raw,r=+t.code,s=+t.extendedCode;return 500===r&&(-2147217144===s||-2147467261===s)}(e))throw e;v.authMode="immediate",_=m?await this._asyncApplyEdits(b+"/applyEdits",v):await(0,a.A)(b+"/applyEdits",v)}return this._createEditsResult(_)}async deleteAttachments(e,t,r){await this.load();let{layer:s}=this;await(0,U.VA)(s,"editing");let i=e.attributes[s.objectIdField],n=s.parsedUrl.path+"/"+i+"/deleteAttachments";try{return(await(0,a.A)(n,this._getLayerRequestOptions({query:{attachmentIds:t.join(","),...r},method:"post"}))).data.deleteAttachmentResults.map(D)}catch(e){throw this._createAttachmentErrorResult(i,e)}}fetchRecomputedExtents(e={}){let t=e.signal;return this.load({signal:t}).then(async()=>{let t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await(0,a.A)(`${s}/${r}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,p=o||u;return{id:n,fullExtent:p&&S.A.fromJSON(p),timeExtent:l&&X.A.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();let r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();let r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){let t=new Map;if(r.features.forEach(r=>{let s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){let r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(let e of r.fields){let r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!(0,j.Wo)(this.layer.url))return"unavailable";let e=(0,f.fj)(this.layer.url,"status"),t=await(0,a.A)(e,{query:{f:"json"}});return W.fromJSON(t.data.status)}async uploadAssets(e,t){let{uploadAssets:s}=await r.e(1384).then(()=>r(31384));return s(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){let t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t)||t.capabilities?.operations?.supportsEditing||!t.effectiveCapabilities?.operations?.supportsEditing)return;let r=t.url;null!=r&&("layerId"in t&&(r=(0,f.fj)(r,t.layerId.toString())),this._getOrCreateEditInterceptor(r).before=t=>{let r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){let r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}})}_getOrCreateEditInterceptor(e){return this._editInterceptor??(this._editInterceptor={urls:e},i.A.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&((0,n.TF)(i.A.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){let r=(await(0,a.A)(e,t)).data.statusUrl;for(;;){let e=(await(0,a.A)(r,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return(0,a.A)(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new o.A("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new o.A("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await(0,d.Pl)(H)}}_createRequestQueryOptions(e){let t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){let r={};(0,u.A)("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());let{data:s}=await(0,a.A)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=s}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);let r=e.type;if(!this.supportedSourceTypes.has(r))throw new o.A("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){let t=(0,J.F0)(e.geometryType).renderer;(0,h.sM)("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{let{data:r}=await(0,a.A)(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){(0,d.QP)(e)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){let{addAssetFeatures:t}=e;if(!t?.length||await this._areAllAssetsAlreadyMapped(t))return null;let s=e.addFeatures.filter(e=>e.geometry);if(t.length!==s.length+e.updateFeatures.length)throw new o.A("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");let i=[],a=new Map;for(let e of t){let{geometry:t}=e,{vertexSpace:s}=t;if((0,_.Hq)(s))i.push(t);else{let s=t.origin,{convertMeshVertexSpace:n}=await Promise.all([r.e(2258),r.e(4548)]).then(()=>r(28846)),o=await n(t,new v.A({origin:[s.x,s.y,s.z??0]}));a.set(o,t),e.geometry=o,i.push(o)}}await this.uploadAssets(i);for(let[e,t]of a)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){let t=[],r=this.layer.globalIdField,s=this.layer.parsedUrl;for(let i of e){let{metadata:e}=i.geometry,a=e.getExternalSourcesOnService(s),n=i.getAttribute(r);if(0===a.length){c.A.getLogger(this).error(`Skipping feature ${n}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}let{source:o}=a.find(b.dK)??a[0];for(let e of o.assets)1===e.parts.length?t.push({globalId:(0,m.yS)(),parentGlobalId:n,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:[]}):c.A.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){let t=e.data,{layerId:r}=this.layer,s=[],i=null;if(Array.isArray(t))for(let e of t)null!=e.editedFeatures&&s.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===r&&(i={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else i=t;let a=function(e){let t=e?.assetMaps;if(t){for(let e of t.addResults)e.success||c.A.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`);for(let e of t.updateResults)e.success||c.A.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`)}let r=e?.attachments,s={addFeatureResults:e?.addResults?.map(D)??[],updateFeatureResults:e?.updateResults?.map(D)??[],deleteFeatureResults:e?.deleteResults?.map(D)??[],addAttachmentResults:r?.addResults?r.addResults.map(D):[],updateAttachmentResults:r?.updateResults?r.updateResults.map(D):[],deleteAttachmentResults:r?.deleteResults?r.deleteResults.map(D):[]};return e?.editMoment&&(s.editMoment=e.editMoment),s}(i);if(s.length>0){a.editedFeatureResults=[];for(let e of s){let{editedFeatures:t}=e,r=t?.spatialReference?new A.A(t.spatialReference):null;a.editedFeatureResults.push({layerId:e.id,editedFeatures:V(t,r)})}}return a}_createAttachmentErrorResult(e,t){let r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new o.A("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){let r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(let e in t){let s=t[e];null!=s&&(r.set?r.set(e,s):r.append(e,s))}return r}_getLayerRequestOptions(e={}){let{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){let{layer:t}=this,{globalIdField:r,parsedUrl:s}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;let a=(0,G.JZ)(i);if(null==a)return!1;let o=(0,f.fj)(s.path,`../${a.id}`),u=[];for(let t of e){if(!(t.geometry.metadata.getExternalSourcesOnService(s).length>0))return!1;u.push(t)}let l=u.map(e=>e.getAttribute(r)).filter(n.Ru);if(0===l.length)return!1;let{assetMapFieldRoles:{parentGlobalId:p,assetHash:c}}=i,h=new z.A({where:`${p} IN (${l.map(e=>`'${e}'`)})`,outFields:[c,p],returnGeometry:!1}),{features:d}=await(0,k.s)(o,h);return 0!==d.length&&!u.some(e=>{let t=e.getAttribute(r);if(!t)return!0;let{metadata:i}=e.geometry,a=d.filter(e=>e.getAttribute(p)===t);if(0===a.length)return!0;let n=a.map(e=>e.getAttribute(c));return i.getExternalSourcesOnService(s).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};(0,s.Cg)([(0,g.MZ)()],Y.prototype,"type",void 0),(0,s.Cg)([(0,g.MZ)({constructOnly:!0})],Y.prototype,"layer",void 0),(0,s.Cg)([(0,g.MZ)({constructOnly:!0})],Y.prototype,"supportedSourceTypes",void 0),(0,s.Cg)([(0,g.MZ)({readOnly:!0})],Y.prototype,"queryTask",null),Y=(0,s.Cg)([(0,g.$K)("esri.layers.graphics.sources.FeatureLayerSource")],Y);const H=1e3},64314(e,t,r){r.d(t,{A:()=>w});var s=r(32198),i=r(69622),a=r(49186),n=r(44208),o=r(17676),u=r(84952),l=r(91429),p=r(21325),c=r(20557),h=r(2272),d=r(65615),y=r(20615),f=r(74910),m=r(78286),g=r(99199),S=r(62815),A=r(63746);class v{constructor(e){this._options=e,this.featureSet={features:[]},this.parseOnly=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._finishVertex=v._finishVertexNonPoint,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._vertex=[],this._part=null,this._parts=null,this._i=0}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){"string"==typeof e&&(this.featureSet.objectIdFieldName=e)}finish(){this._options.applyTransform&&(this.featureSet.transform=null);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:r}of t)r&&(r.spatialReference=e)}feature(){this._attributesClass??=(0,A._)(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push({attributes:new this._attributesClass}),this._options.applyTransform&&this._setVertexTransformer()}centroid([e,t]){this.featureSet.features.at(-1).centroid={x:e,y:t}}geometry(e,t,r){this._previousX=this._previousY=0,this._lengths=r;let s,{hasZ:i,hasM:a}=this.featureSet;switch(i??=!1,a??=!1,this._i=0,this._vertex=[0,0],i&&this._vertex.push(0),a&&this._vertex.push(0),this._finishVertex=v._finishVertexNonPoint,t){case"esriGeometryPoint":this._point={x:0,y:0},s=this._point,this._finishVertex=i?a?v._finishVertexPointXYZM:v._finishVertexPointXYZ:a?v._finishVertexPointXYM:v._finishVertexPointXY;break;case"esriGeometryMultipoint":s={points:[],hasZ:i,hasM:a},this._part=s.points,this._parts=[];break;case"esriGeometryPolyline":s={paths:[],hasZ:i,hasM:a},this._parts=s.paths,this._part=[];break;case"esriGeometryPolygon":s={rings:[],hasZ:i,hasM:a},this._parts=s.rings,this._part=[]}1===e?(this.featureSet.queryGeometry=s,this.featureSet.queryGeometryType=t,this._options.applyTransform||this._setVertexTransformer()):this.featureSet.features.at(-1).geometry=s}coord(e){let t=this._vertex;t[this._i++]=e,!(this._i<t.length)&&(this._i=0,this._transformInPlace&&(t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,this._transformInPlace(t)),this._finishVertex(this))}curvedGeometry(e,t,r,s){let i,{hasZ:a,hasM:n}=this.featureSet;switch(a??=!1,n??=!1,e){case"esriGeometryPoint":case"esriGeometryMultipoint":throw Error(`Curved ${e} does not make sense`);case"esriGeometryPolyline":i={paths:[],curvePaths:[],hasZ:a,hasM:n},this._parts=i.curvePaths,this._part=[];break;case"esriGeometryPolygon":i={rings:[],curveRings:[],hasZ:a,hasM:n},this._parts=i.curveRings,this._part=[]}this.featureSet.features.at(-1).geometry=i}startCurvedPart(e){this._part.push(this._transform(e))}finishCurvedPart(e){this._parts.push(this._part),this._part=[]}lineSegment(e,t){this._part.push(this._transform(t))}bezierSegment(e,t,r,s){this._part.push({b:[this._transform(t),this._transformXY(r),this._transformXY(s)]})}circularArcSegment(e,t,r){this._part.push({c:[this._transform(t),this._transformXY(r)]})}ellipticArcSegment(e,t,r,s,i,a,n,o){this._part.push({a:[this._transform(t),this._transformXY(r),s,i,a,n,o]})}static _finishVertexPointXY({_point:e,_vertex:t}){[e.x,e.y]=t}static _finishVertexPointXYZ({_point:e,_vertex:t}){[e.x,e.y,e.z]=t}static _finishVertexPointXYM({_point:e,_vertex:t}){[e.x,e.y,e.m]=t}static _finishVertexPointXYZM({_point:e,_vertex:t}){[e.x,e.y,e.z,e.m]=t}static _finishVertexNonPoint(e){let{_part:t,_parts:r,_lengths:s,_vertex:i}=e;t.push([...i]),!(t.length<s[r.length])&&(e._previousX=e._previousY=0,e._part=[],r.push(t))}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:t,hasZ:r,transform:s}=this.featureSet,i=r?(0,S.d)(e,t):1;this._transformInPlace??=(0,A.M)(this.featureSet,i),this._transformInPlaceXY??=(0,A.M)({transform:s})}_transform(e){let t=[...e];return this._transformInPlace?.(t),t}_transformXY(e){let t=[e[0],e[1]];return this._transformInPlaceXY?.(t),t}}var _=r(80893),b=r(22671),x=r(97552);let w=class extends i.A{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return(0,u.An)(this.url)}async execute(e,t){let r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){let r,s=this._normalizeQuery(e),i=null!=e.outStatistics?.[0],a=(0,n.A)("featurelayer-pbf-statistics");if(this.pbfSupported&&(!i||a)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves))try{r=await async function(e,t,r,s){let i=(0,h.Dl)(e),a={...r},n=x.A.from(t),o=!n.quantizationParameters;return await(0,_.IJ)(i,n,new v({sourceSpatialReference:n.sourceSpatialReference,applyTransform:o}),a,s)}(this.url,s,t,{uniqueIdFields:this.uniqueIdFields})}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return r??=await(0,g.e)(this.url,s,t,{uniqueIdFields:this.uniqueIdFields}),this._normalizeFields(r.fields),r}async featureSetFromJSON(e,t,s){if(!this._queryGet3DObjectFormat(e)||null==this.infoFor3D||!t.features)return b.A.fromJSON(t);let{meshFeatureSetFromJSON:i}=await(0,o.qr)(Promise.all([r.e(2258),r.e(118),r.e(8366)]).then(()=>r(40050)),s);return i(e,this.infoFor3D,t)}executeForCount(e,t){return(0,y.I)(this.url,this._normalizeQuery(e),t,{uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return(0,f.L)(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,m.V)(this.url,this._normalizeQuery(e),t,{uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){let[{default:s},{executeRelationshipQuery:i}]=await(0,o.qr)(Promise.all([Promise.resolve().then(()=>r(26591)),r.e(1763).then(()=>r(71763))]),t),a=s.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:s},{executeRelationshipQueryForCount:i}]=await(0,o.qr)(Promise.all([Promise.resolve().then(()=>r(26591)),r.e(1763).then(()=>r(71763))]),t),a=s.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:s,fetchAttachments:i,processAttachmentQueryResult:a}=await(0,o.qr)(r.e(9239).then(()=>r(9239)),t),n=(0,h.Dl)(this.url);return a(n,await(this.queryAttachmentsSupported?s(n,e,t):i(n,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:s}=await(0,o.qr)(r.e(3103).then(()=>r(33103)),t);return s(this.parsedUrl,e,t)}async executePivotQuery(e,t){let{executePivotQuery:s}=await(0,o.qr)(r.e(566).then(()=>r(80566)),t);return s(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:s}=await(0,o.qr)(r.e(1273).then(()=>r(11273)),t);return s(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){let{executeForTopIds:s}=await(0,o.qr)(r.e(1277).then(()=>r(21277)),t);return s(this.parsedUrl,e,t)}async executeForTopExtents(e,t){let{executeForTopExtents:s}=await(0,o.qr)(r.e(8018).then(()=>r(8018)),t);return s(this.parsedUrl,e,t)}async executeForTopCount(e,t){let{executeForTopCount:s}=await(0,o.qr)(r.e(980).then(()=>r(10980)),t);return s(this.parsedUrl,e,t)}_normalizeQuery(e){let t=x.A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?d.A.from(e.dynamicDataSource):this.dynamicDataSource);let{infoFor3D:r}=this,s=this._queryGet3DObjectFormat(e);if(null!=r&&s){if(t=t===e?t.clone():t,t.formatOf3DObjects=s,t.outSpatialReference&&!(0,p.aI)(t.outSpatialReference,this.sourceSpatialReference))throw new a.A("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:s,originY:i,originZ:a,translationX:n,translationY:o,translationZ:u,scaleX:l,scaleY:p,scaleZ:c,rotationX:h,rotationY:d,rotationZ:y,rotationDeg:f}=r.transformFieldRoles;t.outFields.push(s,i,a,n,o,u,l,p,c,h,d,y,f)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:r}){return!0!==e||"xyFootprint"===t||r?null:(0,c.Hz)(this.infoFor3D)}};(0,s.Cg)([(0,l.MZ)({type:d.A})],w.prototype,"dynamicDataSource",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"fieldsIndex",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"gdbVersion",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"infoFor3D",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,s.Cg)([(0,l.MZ)()],w.prototype,"pbfSupported",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"pbfSupportedWithCurves",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"queryAttachmentsSupported",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"relativeTimeBinWindow",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"sourceSpatialReference",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"uniqueIdFields",void 0),(0,s.Cg)([(0,l.MZ)({type:String})],w.prototype,"url",void 0),w=(0,s.Cg)([(0,l.$K)("esri.layers.graphics.sources.support.QueryTask")],w)},64714(e,t,r){r.d(t,{F0:()=>o,Vx:()=>p,e2:()=>h,f:()=>d});var s=r(44208),i=r(4718),a=r(99352),n=r(93470);function o(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?n.Cb:"esriGeometryPolyline"===e?n.yM:n.WR}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function p(e,t){if((0,s.A)("esri-csp-restrictions"))return()=>t?{[t]:null,...e}:{...e};try{let r="";t&&(r+=`this${c(t)} = null;`);for(let t in e)r+=`this${c(t)} = ${JSON.stringify(e[t])};`;let s=Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new s}catch{return()=>t?{[t]:null,...e}:{...e}}}function c(e){return u.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function h(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.o8)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:a.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:a.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:t,supportsTrueCurveUpdateByTrueCurveClientsOnly:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},20615(e,t,r){r.d(t,{I:()=>n});var s=r(2272),i=r(80893),a=r(97552);function n(e,t,r,n){return(0,i.gW)((0,s.Dl)(e),a.A.from(t),r,n)}},74910(e,t,r){r.d(t,{L:()=>o});var s=r(5443),i=r(2272),a=r(80893),n=r(97552);async function o(e,t,r){let o=(0,i.Dl)(e),u=await(0,a.Jf)(o,n.A.from(t),{...r}),l=u.extent;return!l||isNaN(l.xmin)||isNaN(l.ymin)||isNaN(l.xmax)||isNaN(l.ymax)?{count:u.count,extent:null}:{count:u.count,extent:s.A.fromJSON(l)}}},78286(e,t,r){r.d(t,{V:()=>n});var s=r(2272),i=r(80893),a=r(97552);async function n(e,t,r,n){let o=(0,s.Dl)(e),u=await(0,i.Pk)(o,a.A.from(t),r,n);return u.objectIds??function(e){if(e)return function(e){return!Array.isArray(e[0])}(e)?e:e.map(e=>JSON.stringify(e))}(u.uniqueIds)??[]}},99199(e,t,r){r.d(t,{e:()=>u,s:()=>o});var s=r(2272),i=r(80893),a=r(22671),n=r(97552);async function o(e,t,r,s){let i=await u(e,t,r,s);return a.A.fromJSON(i)}function u(e,t,r,a){let o=(0,s.Dl)(e),u={...r},l=n.A.from(t);return(0,i.eW)(o,l,l.sourceSpatialReference,u,a)}},63746(e,t,r){function s(e){return class{constructor(){for(let t of e)this[t]=null}}}function i(e,t=1){let{transform:r,hasZ:s,hasM:i}=e;if(null==r)return s&&1!==t?e=>{e[2]*=t}:null;let[a,n]=function(e,t,r,s){let{scale:i,translate:a,originPosition:n}=e;return"upperLeft"===n&&(i=i.map((e,t)=>1===t?-e:e)),t&&(i=i.map((e,t)=>2===t?e*s:e),a=a.map((e,t)=>2===t?e*s:e)),!t&&r&&(i=i.filter((e,t)=>2!==t),a=a.filter((e,t)=>2!==t)),[i,a]}(r,s,i,t),o=e.hasZ?3:2;return e=>{for(let t=0;t<e.length&&(t!==o||0!==e[t]);++t)e[t]=e[t]*a[t]+n[t]}}r.d(t,{M:()=>i,_:()=>s})},2272(e,t,r){r.d(t,{Dl:()=>l,gf:()=>c,jV:()=>u,lF:()=>p});var s=r(92602),i=r(70333),a=r(4718),n=r(84952),o=r(926);function u(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function l(e){return"string"==typeof e?(0,n.An)(e):(0,a.o8)(e)}function p(e,t,r){let s={};for(let i in e){if("declaredClass"===i)continue;let a=e[i];if(null!=a&&"function"!=typeof a)if(Array.isArray(a))s[i]=a.map(e=>p(e));else if("object"==typeof a)if(a.toJSON){let e=a.toJSON(r?.[i]);s[i]=t?e:JSON.stringify(e)}else s[i]=t?a:JSON.stringify(a);else s[i]=a}return s}async function c(e,t,a){return function(e,t){return e?t&&(0,o.Qc)(e)?t:(0,o.getApiKey)(e)??i.id?.findCredential(e)?.token:null}(e,t)||(!i.id&&s.A.request.useIdentity&&await Promise.all([r.e(6361),r.e(7644),r.e(7715)]).then(()=>r(50148)),(await i.id.getCredential(e,a))?.token)}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7013],{69052(e,t,r){r.d(t,{hr:()=>i});var s=r(34727);class i{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return a(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,s.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+n(this.range,e-t,r)}minimalMonotonic(e,t,r){return a(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);let r=(t=this.normalize(t))-e,s=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(s)?r:s}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function a(e,t,r,s,i=0,a=!1){return(s-=i)<t?s+=n(e,t-s):s>r&&(s-=n(e,s-r)),a&&s===r&&(s=t),s+i}function n(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const o=new i(0,2*Math.PI),u=(new i(-Math.PI,Math.PI),new i(0,360));r.d(t,["ie",0,u,"uC",0,o])},18370(e,t,r){r.d(t,{z:()=>i});class s{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function i(e){return new s(e)}},82534(e,t,r){function s(){return[0,0,0,1]}function i(e){return[e[0],e[1],e[2],e[3]]}r.d(t,{o8:()=>i,vt:()=>s});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:i,create:s,fromValues:function(e,t,r,s){return[e,t,r,s]}},Symbol.toStringTag,{value:"Module"})),r.d(t,["zK",0,a])},67026(e,t,r){r.d(t,{A6:()=>f,Xd:()=>p,Xr:()=>d,lw:()=>c,x8:()=>l});var s=r(29242),i=r(82534),a=r(51850),n=r(34304),o=r(35522),u=r(78955);function l(e,t,r){r*=.5;let s=Math.sin(r);return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=Math.cos(r),e}function p(e,t){let r=2*Math.acos(t[3]),s=Math.sin(r/2);return s>(0,n.FD)()?(e[0]=t[0]/s,e[1]=t[1]/s,e[2]=t[2]/s):(e[0]=1,e[1]=0,e[2]=0),r}function c(e,t,r){let s=t[0],i=t[1],a=t[2],n=t[3],o=r[0],u=r[1],l=r[2],p=r[3];return e[0]=s*p+n*o+i*l-a*u,e[1]=i*p+n*u+a*o-s*l,e[2]=a*p+n*l+s*u-i*o,e[3]=n*p-s*o-i*u-a*l,e}function h(e,t,r,s){let i,a,o,u,l,p=t[0],c=t[1],h=t[2],d=t[3],y=r[0],f=r[1],m=r[2],g=r[3];return a=p*y+c*f+h*m+d*g,a<0&&(a=-a,y=-y,f=-f,m=-m,g=-g),1-a>(0,n.FD)()?(i=Math.acos(a),o=Math.sin(i),u=Math.sin((1-s)*i)/o,l=Math.sin(s*i)/o):(u=1-s,l=s),e[0]=u*p+l*y,e[1]=u*c+l*f,e[2]=u*h+l*m,e[3]=u*d+l*g,e}function d(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function y(e,t){let r,s=t[0]+t[4]+t[8];if(s>0)r=Math.sqrt(s+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);let i=(s+1)%3,a=(s+2)%3;r=Math.sqrt(t[3*s+s]-t[3*i+i]-t[3*a+a]+1),e[s]=.5*r,r=.5/r,e[3]=(t[3*i+a]-t[3*a+i])*r,e[i]=(t[3*i+s]+t[3*s+i])*r,e[a]=(t[3*a+s]+t[3*s+a])*r}return e}function f(e,t,r,s){let i=.5*Math.PI/180;t*=i,r*=i,s*=i;let a=Math.sin(t),n=Math.cos(t),o=Math.sin(r),u=Math.cos(r),l=Math.sin(s),p=Math.cos(s);return e[0]=a*u*p-n*o*l,e[1]=n*o*p+a*u*l,e[2]=n*u*l-a*o*p,e[3]=n*u*p+a*o*l,e}const m=u.C,g=u.hZ,S=u.WQ,v=c,A=u.hs,_=u.Om,x=u.Cc,b=u.Bw,w=b,M=u.m3,q=M,F=u.S8,I=u.t2,R=u.aI,O=(0,a.vt)(),C=(0,a.fA)(1,0,0),T=(0,a.fA)(0,1,0),P=(0,i.vt)(),E=(0,i.vt)(),N=(0,s.vt)();Object.freeze(Object.defineProperty({__proto__:null,add:S,calculateW:function(e,t){let r=t[0],s=t[1],i=t[2];return e[0]=r,e[1]=s,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-s*s-i*i)),e},conjugate:d,copy:m,dot:_,equals:R,exactEquals:I,fromEuler:f,fromMat3:y,getAxisAngle:p,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){let r=t[0],s=t[1],i=t[2],a=t[3],n=r*r+s*s+i*i+a*a,o=n?1/n:0;return e[0]=-r*o,e[1]=-s*o,e[2]=-i*o,e[3]=a*o,e},len:w,length:b,lerp:x,mul:v,multiply:c,normalize:F,random:function(e){let t=n.Ov,r=t(),s=t(),i=t(),a=Math.sqrt(1-r),o=Math.sqrt(r);return e[0]=a*Math.sin(2*Math.PI*s),e[1]=a*Math.cos(2*Math.PI*s),e[2]=o*Math.sin(2*Math.PI*i),e[3]=o*Math.cos(2*Math.PI*i),e},rotateX:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u+n*o,e[1]=i*u+a*o,e[2]=a*u-i*o,e[3]=n*u-s*o,e},rotateY:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u-a*o,e[1]=i*u+n*o,e[2]=a*u+s*o,e[3]=n*u-i*o,e},rotateZ:function(e,t,r){r*=.5;let s=t[0],i=t[1],a=t[2],n=t[3],o=Math.sin(r),u=Math.cos(r);return e[0]=s*u+i*o,e[1]=i*u-s*o,e[2]=a*u+n*o,e[3]=n*u-a*o,e},rotationTo:function(e,t,r){let s=(0,o.Om)(t,r);return s<-.999999?((0,o.$A)(O,C,t),(0,o.Il)(O)<1e-6&&(0,o.$A)(O,T,t),(0,o.S8)(O,O),l(e,O,Math.PI),e):s>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,o.$A)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+s,F(e,e))},scale:A,set:g,setAxes:function(e,t,r,s){let i=N;return i[0]=r[0],i[3]=r[1],i[6]=r[2],i[1]=s[0],i[4]=s[1],i[7]=s[2],i[2]=-t[0],i[5]=-t[1],i[8]=-t[2],F(e,y(e,i))},setAxisAngle:l,slerp:h,sqlerp:function(e,t,r,s,i,a){return h(P,t,i,a),h(E,r,s,a),h(e,P,E,2*a*(1-a)),e},sqrLen:q,squaredLength:M,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"})),r.d(t,["hZ",0,g,"t2",0,I])},95696(e,t,r){r.d(t,{A:()=>l});var s,i=r(32198),a=r(69540),n=r(25482),o=r(91429),u=r(93223);let l=class extends((0,a.OU)(n.o)){static{s=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new s}};(0,i.Cg)([(0,u.e)({georeferenced:"georeferenced"},{readOnly:!0})],l.prototype,"type",void 0),(0,i.Cg)([(0,o.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],l.prototype,"origin",void 0),l=s=(0,i.Cg)([(0,o.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],l)},18251(e,t,r){r.d(t,{A:()=>l});var s=r(32198),i=r(69540),a=r(25482),n=r(91429),o=r(51850),u=r(93223);let l=class extends((0,i.OU)(a.o)){constructor(e){super(e),this.type="local",this.origin=(0,o.vt)()}};(0,s.Cg)([(0,u.e)({local:"local"},{readOnly:!0})],l.prototype,"type",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],l.prototype,"origin",void 0),l=(0,s.Cg)([(0,n.$K)("esri.geometry.support.MeshLocalVertexSpace")],l)},73836(e,t,r){r.d(t,{A:()=>d});var s=r(32198),i=r(69540),a=r(25482),n=r(91429),o=r(58083),u=r(9093),l=r(67026),p=r(82534),c=r(51850),h=r(24770);let d=class extends((0,i.OU)(a.o)){constructor(e){super(e),this.translation=(0,c.vt)(),this.rotationAxis=(0,c.ci)(h.up),this.rotationAngle=0,this.scale=(0,c.fA)(1,1,1)}get rotation(){return(0,h.i4)(this.rotationAxis,this.rotationAngle)}set rotation(e){this.rotationAxis=(0,c.o8)((0,h.yo)(e)),this.rotationAngle=(0,h.g7)(e)}get localMatrix(){let e=(0,u.vt)();return(0,l.x8)(y,(0,h.yo)(this.rotation),(0,h.$I)(this.rotation)),(0,o.o1)(e,y,this.translation,this.scale),e}get localMatrixInverse(){return(0,o.B8)((0,u.vt)(),this.localMatrix)}equals(e){return this===e||null!=e&&(0,o.t2)(this.localMatrix,e.localMatrix)}};(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"translation",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAxis",void 0),(0,s.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAngle",void 0),(0,s.Cg)([(0,n.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"scale",void 0),(0,s.Cg)([(0,n.MZ)()],d.prototype,"rotation",null),(0,s.Cg)([(0,n.MZ)()],d.prototype,"localMatrix",null),(0,s.Cg)([(0,n.MZ)()],d.prototype,"localMatrixInverse",null),d=(0,s.Cg)([(0,n.$K)("esri.geometry.support.MeshTransform")],d);const y=(0,p.vt)()},24770(e,t,r){r.d(t,{$I:()=>m,AU:()=>d,g7:()=>f,i4:()=>p,ui:()=>c,vt:()=>l,yo:()=>y});var s=r(34727),i=r(58083),a=r(67026),n=r(82534),o=r(35522),u=r(51850);function l(e=S){return[e[0],e[1],e[2],e[3]]}function p(e,t,r=l()){return(0,o.C)(r,e),r[3]=t,r}function c(e,t=l()){let r=(0,i.l)(v,e);return g(t,(0,s.KJ)((0,a.Xd)(t,r))),t}function h(e,t,r=l()){return(0,a.x8)(v,e,m(e)),(0,a.x8)(A,t,m(t)),(0,a.lw)(v,A,v),g(r,(0,s.KJ)((0,a.Xd)(r,v)))}function d(e,t,r,s=l()){return p(u.Cw,e,_),p(u.JP,t,x),p(u.Cb,r,b),h(_,x,_),h(_,b,s),s}function y(e){return e}function f(e){return e[3]}function m(e){return(0,s.kU)(e[3])}function g(e,t){return e[3]=t,e}const S=[0,0,1,0],v=(0,n.vt)(),A=(0,n.vt)(),_=(l(),l()),x=l(),b=l();r.d(t,["up",0,S])},63579(e,t,r){r.d(t,{Bq:()=>u,Qp:()=>o,WN:()=>m,dK:()=>g,eN:()=>d,fH:()=>f,in:()=>y,yr:()=>l});var s=r(56507),i=r(4576),a=r(17676),n=r(20557);class o{constructor(e,t,r){this.assetName=e,this.assetMimeType=t,this.parts=r}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,i.aI)(this.parts,e.parts,(e,t)=>e.equals(t))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(let t of this.parts)e+=t.partHash;return e}async toBlob(e){let{parts:t}=this;if(1===t.length)return t[0].toBlob(e);let r=await Promise.all(t.map(t=>t.toBlob(e)));return(0,a.Te)(e),new Blob(r)}}class u{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){let{data:t}=await(0,s.A)(this.partUrl,{responseType:"blob"});return(0,a.Te)(e),t}}function l(e){return function(e){switch(e?.type){case"client":return Array.isArray(e.files)?e.files.some(h):h(e.files);case"service":return e.assets.some(h);case"loadable":return!0;default:return!1}}(e?.source)}const p=/^(model\/gltf\+json)|(model\/gltf-binary)$/,c=/\.(gltf|glb)/i;function h(e){if(e instanceof File){let{type:t,name:r}=e;return p.test(t)||c.test(r)}return p.test(e.assetMimeType)||c.test(e.assetName)}function d(e,t){if(!e)return!1;let{source:r}=e;return function(e,t){return"service"===e.type&&e.assets.every(e=>e.isOnService(t))}(r,t)}function y(e,t){if(e===t)return!0;let{source:r}=e,{source:s}=t;if(r===s)return!0;if("service"===r.type&&"service"===s.type){if(r.assets.length!==s.assets.length)return!1;let e=(e,t)=>e.assetName<t.assetName?-1:+(e.assetName>t.assetName),t=[...r.assets].sort(e),i=[...s.assets].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(i[e]))return!1;return!0}return!1}function f(e,t){return e instanceof File?(0,n.rq)(e,t):(0,n.z$)(e.assetMimeType,e.assetName,t)}function m(e){switch(e.type){case"client":return Array.isArray(e.files)?e.files:[e.files];case"service":return e.assets;case"loadable":return}}function g(e){return!!e.original}},27615(e,t,r){r.d(t,{CK:()=>u,Hq:()=>o,MW:()=>l,TE:()=>p,yJ:()=>c});var s=r(35522),i=r(86738),a=r(95696),n=r(18251);function o(e){return null!=e.origin}function u(e){return o(e.vertexSpace)}function l(e,t){if(!o(e))return null;let[r,s,a]=e.origin;return new i.A({x:r,y:s,z:a,spatialReference:t})}function p(e,t){let{x:r,y:s,z:i,spatialReference:o}=e,u=[r,s,i??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(o))?new n.A({origin:u}):new a.A({origin:u})}function c(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,s.t2)(e.origin,t.origin))}},52039(e,t,r){r.d(t,{O7:()=>h,el:()=>l});var s=r(69052),i=(r(49186),r(18370)),a=r(17676),n=(r(5443),r(39829)),o=(r(82799),r(16930)),u=(r(80754),r(21325));async function l(e,t,r){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(r=t);let s=null;for(let t of e)s??=t?.spatialReference;if(!s)return e;let i=(0,u.Vp)(s);if(!i)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(i);return["xmin"in t?t:new n.A(t)]}let[o,l]=i.valid,h=!1;for(let t of e){if(!t)continue;if("point"===t.type){h||=t.x>=l,h||=t.x<=o;continue}let{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=l,h||=e.xmin<=o,h||=e.xmax>=l,h||=e.xmax<=o}if(!h)return e;let[{foldInto360Range:d},y]=await(0,a.qr)(Promise.all([p.getImportPromise(),c.getImportPromise()]),r),f=y.fromSpatialReference(s);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=y.fromGeometry(e),r=y.toGeometry(d(t,f),s);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const p=(0,i.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),c=(0,i.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function h(e,t,r){let s=(0,u.Vp)(r);if(null==s)return e;let[i,a]=s.valid,n=2*a,o=0,l=0;t>a?o=Math.ceil(Math.abs(t-a)/n):t<i&&(o=-Math.ceil(Math.abs(t-i)/n)),e>a?l=Math.ceil(Math.abs(e-a)/n):e<i&&(l=-Math.ceil(Math.abs(e-i)/n));let p=e+(o-l)*n,c=p-t;return c>a?p-=n:c<i&&(p+=n),p}function d(e){let t=(0,u.Vp)(e);if(null==t)return null;let[r,i]=t.valid;return new s.hr(r,i)}const y=d(o.A.WGS84);d(o.A.WebMercator),r.d(t,["Y_",0,y])},80754(e,t,r){r.d(t,{kS:()=>l,kd:()=>u});var s=r(82799),i=r(16930),a=r(60408),n=r(52006);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function u(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){if((0,n.Ed)(e))for(let r of function(e){return(0,a.Bi)(e)?e.curveRings:e.curvePaths}(e))for(let e of r)if((0,n.aO)(e)){let[r,s]=e.c;r[0]+=t,s[0]+=t}else if((0,n.FG)(e)){let[r,s]=e.a;r[0]+=t,s[0]+=t}else if((0,n.n1)(e)){let[r,s,i]=e.b;r[0]+=t,s[0]+=t,i[0]+=t}else e[0]+=t;for(let r of function(e){return(0,a.Bi)(e)?e.rings:e.paths}(e))for(let e of r)e[0]+=t;return e}r.d(t,["j7",0,o])},99352(e,t,r){r.d(t,["F",0,{supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:{envelope:!0,centroid:!0,convexHull:!0},supportsStatisticsAggregatedIds:!0,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},"P",0,{supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}])},65515(e,t,r){r.r(t),r.d(t,{default:()=>Y});var s=r(32198),i=r(92602),a=r(56507),n=r(4576),o=r(49186),u=r(44208),l=r(66552),p=r(92474),c=r(53966),h=r(93637),d=r(17676),y=r(36708),f=r(84952),m=r(13069),g=r(91429),S=r(5443),v=r(16930),A=r(95696),_=r(27615),x=r(63579),b=r(52106),w=r(86211);function M(e){return"object"==typeof e&&!!e&&"objectId"in e&&!!e.objectId}function q(e){return e.every(M)}function F(e){return"object"==typeof e&&!!e&&"globalId"in e&&!!e.globalId}function I(e){return e.every(F)}var R=r(99917),O=r(65864),C=r(73836),T=r(21325);async function P(e,t,r){let{geometry:s}=t,i={...t.attributes};if(null!=r&&"mesh"===s?.type){let{transformFieldRoles:t}=r,{origin:a,spatialReference:n,vertexSpace:o}=s,u=s.transform??new C.A,l="local"===o.type,p=e.spatialReference,c=p.isGeographic,h=(0,T.aI)(p,n),d=(0,R.isEqualBaseGCS)(n,p)&&(0,R.canProjectWithoutEngine)(n,p);if(!(l&&c&&d||!l&&!c&&h))return null;let y=(0,R.projectWithoutEngine)(a,n,p);if(null==y)return null;if(i[t.originX]=y.x,i[t.originY]=y.y,i[t.originZ]=y.z??0,null!=u){let{translation:e,scale:r,rotation:s}=u,a=l?1:(0,w.KX)(n)/(0,w.KX)(p);i[t.translationX]=e[0]*a,i[t.translationY]=e[2]*a,i[t.translationZ]=-e[1]*a,i[t.scaleX]=r[0],i[t.scaleY]=r[2],i[t.scaleZ]=r[1],i[t.rotationX]=s[0],i[t.rotationY]=s[2],i[t.rotationZ]=-s[1],i[t.rotationDeg]=s[3]}return{attributes:i}}return null==s?{attributes:i}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:i}}async function E(e,t){let r=await Promise.all((t.addAttachments??[]).map(t=>N(e,t))),s=await Promise.all((t.updateAttachments??[]).map(t=>N(e,t))),i=t.deleteAttachments??[];return r.length||s.length||i.length?{adds:r,updates:s,deletes:[...i]}:null}async function N(e,t){let{feature:r,attachment:s}=t,{globalId:i,name:a,contentType:n,data:o,keywords:u,uploadId:l}=s,p={globalId:i};if(r&&("attributes"in r?p.parentGlobalId=r.attributes?.[e.globalIdField]:r.globalId&&(p.parentGlobalId=r.globalId)),l)p.uploadId=l;else if(o){let e=await(0,f._0)(o);e&&(p.contentType=e.mediaType,p.data=e.data),o instanceof File&&(p.name=o.name)}return a&&(p.name=a),n&&(p.contentType=n),u&&(p.keywords=u),p}function D(e){let t=!0===e.success?null:e.error||{code:void 0,description:"Feature edit failed"};return{objectId:e.objectId,globalId:e.globalId,error:t?new o.A("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}function Q(e,t){return new b.A({attributes:e.attributes,geometry:(0,O.rS)({...e.geometry,spatialReference:t})})}function V(e,t){return{adds:e?.adds?.map(e=>Q(e,t))||[],updates:e?.updates?.map(e=>({original:Q(e[0],t),current:Q(e[1],t)}))||[],deletes:e?.deletes?.map(e=>Q(e,t))||[],spatialReference:t}}var j=r(64714),J=r(64314),Z=r(60694),G=r(15426),U=r(20557),k=r(99199),B=r(96520),z=r(97552),X=r(79677),L=r(20816);const $=new l.J({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),W=new l.J({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let Y=class extends p.x_{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer","Annotation Layer","Dimension Layer"]),this.refresh=(0,d.sg)(async()=>{await this.load();let e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}let t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){let t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}async reload(e){let t=this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0;await this._fetchService(null,{...e,cacheBust:t})}initialize(){this.addHandles([(0,y.wB)(()=>{let e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){let{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:i,uniqueIdFields:a}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,l=(0,u.A)("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n,p=l&&e?.query.supportsFormatPBFWithCurves,c=e?.operations?.supportsQueryAttachments??!1,h=e?.query?.relativeTimeBinWindow??0,d=t.path;return new J.A({dynamicDataSource:o,fieldsIndex:i,gdbVersion:r,infoFor3D:n,pbfSupported:l,pbfSupportedWithCurves:p,queryAttachmentsSupported:c,relativeTimeBinWindow:h,sourceSpatialReference:s,uniqueIdFields:a,url:d})}async addAttachment(e,t,r){await this.load();let{layer:s}=this;await(0,G.VA)(s,"editing");let i=e.attributes[s.objectIdField],n=s.parsedUrl.path+"/"+i+"/addAttachment",o=this._getLayerRequestOptions({query:r}),u=this._getFormDataForAttachment(t,o.query);try{return D((await(0,a.A)(n,{body:u})).data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(i,e)}}async updateAttachment(e,t,r,s){await this.load();let{layer:i}=this;await(0,G.VA)(i,"editing");let n=e.attributes[i.objectIdField],o=i.parsedUrl.path+"/"+n+"/updateAttachment",u=this._getLayerRequestOptions({query:{attachmentId:t,...s}}),l=this._getFormDataForAttachment(r,u.query);try{return D((await(0,a.A)(o,{body:l})).data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(n,e)}}async applyEdits(e,t){await this.load();let{layer:r}=this;await(0,G.VA)(r,"editing");let s="infoFor3D"in r?r.infoFor3D:null,i=null!=s,u=i||(t?.globalIdUsed??!1),l=i?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,p=e.addFeatures?.map(e=>P(this.layer,e,s))??[],c=(await Promise.all(p)).filter(n.Ru),h=e.updateFeatures?.map(e=>P(this.layer,e,s))??[],d=(await Promise.all(h)).filter(n.Ru),y=function(e,t,r){if(!t||0===t.length)return[];if(r&&I(t))return t.map(e=>e.globalId);if(q(t))return t.map(e=>e.objectId);let s=r?e.globalIdField:e.objectIdField;return s?t.map(e=>e.getAttribute(s)):[]}(this.layer,e.deleteFeatures,u);(0,B.u)(c,d,r.spatialReference);let f=await E(this.layer,e),m=r.capabilities.editing.supportsAsyncApplyEdits&&i,g=t?.gdbVersion||r.gdbVersion,S={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:m};await(0,L.ZJ)(this.layer.url,g,!0);let v=(0,L.w5)(this.layer.url,g||null);if(await(0,L.We)(r.url,g,r.historicMoment))throw new o.A("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(S.edits=JSON.stringify([{id:r.layerId,adds:c.length?c:null,updates:d.length?d:null,deletes:y.length?y:null,attachments:f,assetMaps:l}]),S.returnServiceEditsOption=$.toJSON(t?.returnServiceEditsOption),S.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(S.adds=c.length?JSON.stringify(c):null,S.updates=d.length?JSON.stringify(d):null,S.deletes=y.length?u?JSON.stringify(y):y.join(","):null,S.attachments=f&&JSON.stringify(f),S.assetMaps=null==l?void 0:JSON.stringify(l));let A=this._getLayerRequestOptions({method:"post",query:S});v&&(A.authMode="immediate",A.query.returnEditMoment=!0,A.query.sessionId=L.TA);let _,x=t?.returnServiceEditsOption?r.url:r.parsedUrl.path;try{_=m?await this._asyncApplyEdits(x+"/applyEdits",A):await(0,a.A)(x+"/applyEdits",A)}catch(e){if(!function(e){let t=e.details.raw,r=+t.code,s=+t.extendedCode;return 500===r&&(-2147217144===s||-2147467261===s)}(e))throw e;A.authMode="immediate",_=m?await this._asyncApplyEdits(x+"/applyEdits",A):await(0,a.A)(x+"/applyEdits",A)}return this._createEditsResult(_)}async deleteAttachments(e,t,r){await this.load();let{layer:s}=this;await(0,G.VA)(s,"editing");let i=e.attributes[s.objectIdField],n=s.parsedUrl.path+"/"+i+"/deleteAttachments";try{return(await(0,a.A)(n,this._getLayerRequestOptions({query:{attachmentIds:t.join(","),...r},method:"post"}))).data.deleteAttachmentResults.map(D)}catch(e){throw this._createAttachmentErrorResult(i,e)}}fetchRecomputedExtents(e={}){let t=e.signal;return this.load({signal:t}).then(async()=>{let t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await(0,a.A)(`${s}/${r}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,p=o||u;return{id:n,fullExtent:p&&S.A.fromJSON(p),timeExtent:l&&X.A.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();let r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();let r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){let t=new Map;if(r.features.forEach(r=>{let s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){let r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(let e of r.fields){let r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!(0,Z.Wo)(this.layer.url))return"unavailable";let e=(0,f.fj)(this.layer.url,"status"),t=await(0,a.A)(e,{query:{f:"json"}});return W.fromJSON(t.data.status)}async uploadAssets(e,t){let{uploadAssets:s}=await r.e(1384).then(()=>r(31384));return s(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){let t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t)||t.capabilities?.operations?.supportsEditing||!t.effectiveCapabilities?.operations?.supportsEditing)return;let r=t.url;null!=r&&("layerId"in t&&(r=(0,f.fj)(r,t.layerId.toString())),this._getOrCreateEditInterceptor(r).before=t=>{let r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){let r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}})}_getOrCreateEditInterceptor(e){return this._editInterceptor??(this._editInterceptor={urls:e},i.A.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&((0,n.TF)(i.A.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){let r=(await(0,a.A)(e,t)).data.statusUrl;for(;;){let e=(await(0,a.A)(r,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return(0,a.A)(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new o.A("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new o.A("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await(0,d.Pl)(H)}}_createRequestQueryOptions(e){let t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){let r={};(0,u.A)("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());let{data:s}=await(0,a.A)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=s}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);let r=e.type;if(!this.supportedSourceTypes.has(r))throw new o.A("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){let t=(0,j.F0)(e.geometryType).renderer;(0,h.sM)("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{let{data:r}=await(0,a.A)(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){(0,d.QP)(e)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){let{addAssetFeatures:t}=e;if(!t?.length||await this._areAllAssetsAlreadyMapped(t))return null;let s=e.addFeatures.filter(e=>e.geometry);if(t.length!==s.length+e.updateFeatures.length)throw new o.A("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");let i=[],a=new Map;for(let e of t){let{geometry:t}=e,{vertexSpace:s}=t;if((0,_.Hq)(s))i.push(t);else{let s=t.origin,{convertMeshVertexSpace:n}=await Promise.all([r.e(2258),r.e(4548)]).then(()=>r(28846)),o=await n(t,new A.A({origin:[s.x,s.y,s.z??0]}));a.set(o,t),e.geometry=o,i.push(o)}}await this.uploadAssets(i);for(let[e,t]of a)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){let t=[],r=this.layer.globalIdField,s=this.layer.parsedUrl;for(let i of e){let{metadata:e}=i.geometry,a=e.getExternalSourcesOnService(s),n=i.getAttribute(r);if(0===a.length){c.A.getLogger(this).error(`Skipping feature ${n}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}let{source:o}=a.find(x.dK)??a[0];for(let e of o.assets)1===e.parts.length?t.push({globalId:(0,m.yS)(),parentGlobalId:n,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:[]}):c.A.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){let t=e.data,{layerId:r}=this.layer,s=[],i=null;if(Array.isArray(t))for(let e of t)null!=e.editedFeatures&&s.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===r&&(i={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else i=t;let a=function(e){let t=e?.assetMaps;if(t){for(let e of t.addResults)e.success||c.A.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`);for(let e of t.updateResults)e.success||c.A.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`)}let r=e?.attachments,s={addFeatureResults:e?.addResults?.map(D)??[],updateFeatureResults:e?.updateResults?.map(D)??[],deleteFeatureResults:e?.deleteResults?.map(D)??[],addAttachmentResults:r?.addResults?r.addResults.map(D):[],updateAttachmentResults:r?.updateResults?r.updateResults.map(D):[],deleteAttachmentResults:r?.deleteResults?r.deleteResults.map(D):[]};return e?.editMoment&&(s.editMoment=e.editMoment),s}(i);if(s.length>0){a.editedFeatureResults=[];for(let e of s){let{editedFeatures:t}=e,r=t?.spatialReference?new v.A(t.spatialReference):null;a.editedFeatureResults.push({layerId:e.id,editedFeatures:V(t,r)})}}return a}_createAttachmentErrorResult(e,t){let r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new o.A("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){let r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(let e in t){let s=t[e];null!=s&&(r.set?r.set(e,s):r.append(e,s))}return r}_getLayerRequestOptions(e={}){let{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){let{layer:t}=this,{globalIdField:r,parsedUrl:s}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;let a=(0,U.JZ)(i);if(null==a)return!1;let o=(0,f.fj)(s.path,`../${a.id}`),u=[];for(let t of e){if(!(t.geometry.metadata.getExternalSourcesOnService(s).length>0))return!1;u.push(t)}let l=u.map(e=>e.getAttribute(r)).filter(n.Ru);if(0===l.length)return!1;let{assetMapFieldRoles:{parentGlobalId:p,assetHash:c}}=i,h=new z.A({where:`${p} IN (${l.map(e=>`'${e}'`)})`,outFields:[c,p],returnGeometry:!1}),{features:d}=await(0,k.s)(o,h);return 0!==d.length&&!u.some(e=>{let t=e.getAttribute(r);if(!t)return!0;let{metadata:i}=e.geometry,a=d.filter(e=>e.getAttribute(p)===t);if(0===a.length)return!0;let n=a.map(e=>e.getAttribute(c));return i.getExternalSourcesOnService(s).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};(0,s.Cg)([(0,g.MZ)()],Y.prototype,"type",void 0),(0,s.Cg)([(0,g.MZ)({constructOnly:!0})],Y.prototype,"layer",void 0),(0,s.Cg)([(0,g.MZ)({constructOnly:!0})],Y.prototype,"supportedSourceTypes",void 0),(0,s.Cg)([(0,g.MZ)({readOnly:!0})],Y.prototype,"queryTask",null),Y=(0,s.Cg)([(0,g.$K)("esri.layers.graphics.sources.FeatureLayerSource")],Y);const H=1e3},64314(e,t,r){r.d(t,{A:()=>w});var s=r(32198),i=r(69622),a=r(49186),n=r(44208),o=r(17676),u=r(84952),l=r(91429),p=r(21325),c=r(20557),h=r(2272),d=r(65615),y=r(20615),f=r(74910),m=r(78286),g=r(99199),S=r(62815),v=r(63746);class A{constructor(e){this._options=e,this.featureSet={features:[]},this.parseOnly=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._finishVertex=A._finishVertexNonPoint,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._vertex=[],this._part=null,this._parts=null,this._i=0}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){"string"==typeof e&&(this.featureSet.objectIdFieldName=e)}finish(){this._options.applyTransform&&(this.featureSet.transform=null);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:r}of t)r&&(r.spatialReference=e)}feature(){this._attributesClass??=(0,v._)(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push({attributes:new this._attributesClass}),this._options.applyTransform&&this._setVertexTransformer()}centroid([e,t]){this.featureSet.features.at(-1).centroid={x:e,y:t}}geometry(e,t,r){this._previousX=this._previousY=0,this._lengths=r;let s,{hasZ:i,hasM:a}=this.featureSet;switch(i??=!1,a??=!1,this._i=0,this._vertex=[0,0],i&&this._vertex.push(0),a&&this._vertex.push(0),this._finishVertex=A._finishVertexNonPoint,t){case"esriGeometryPoint":this._point={x:0,y:0},s=this._point,this._finishVertex=i?a?A._finishVertexPointXYZM:A._finishVertexPointXYZ:a?A._finishVertexPointXYM:A._finishVertexPointXY;break;case"esriGeometryMultipoint":s={points:[],hasZ:i,hasM:a},this._part=s.points,this._parts=[];break;case"esriGeometryPolyline":s={paths:[],hasZ:i,hasM:a},this._parts=s.paths,this._part=[];break;case"esriGeometryPolygon":s={rings:[],hasZ:i,hasM:a},this._parts=s.rings,this._part=[]}1===e?(this.featureSet.queryGeometry=s,this.featureSet.queryGeometryType=t,this._options.applyTransform||this._setVertexTransformer()):this.featureSet.features.at(-1).geometry=s}coord(e){let t=this._vertex;t[this._i++]=e,!(this._i<t.length)&&(this._i=0,this._transformInPlace&&(t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,this._transformInPlace(t)),this._finishVertex(this))}curvedGeometry(e,t,r,s){let i,{hasZ:a,hasM:n}=this.featureSet;switch(a??=!1,n??=!1,e){case"esriGeometryPoint":case"esriGeometryMultipoint":throw Error(`Curved ${e} does not make sense`);case"esriGeometryPolyline":i={paths:[],curvePaths:[],hasZ:a,hasM:n},this._parts=i.curvePaths,this._part=[];break;case"esriGeometryPolygon":i={rings:[],curveRings:[],hasZ:a,hasM:n},this._parts=i.curveRings,this._part=[]}this.featureSet.features.at(-1).geometry=i}startCurvedPart(e){this._part.push(this._transform(e))}finishCurvedPart(e){this._parts.push(this._part),this._part=[]}lineSegment(e,t){this._part.push(this._transform(t))}bezierSegment(e,t,r,s){this._part.push({b:[this._transform(t),this._transformXY(r),this._transformXY(s)]})}circularArcSegment(e,t,r){this._part.push({c:[this._transform(t),this._transformXY(r)]})}ellipticArcSegment(e,t,r,s,i,a,n,o){this._part.push({a:[this._transform(t),this._transformXY(r),s,i,a,n,o]})}static _finishVertexPointXY({_point:e,_vertex:t}){[e.x,e.y]=t}static _finishVertexPointXYZ({_point:e,_vertex:t}){[e.x,e.y,e.z]=t}static _finishVertexPointXYM({_point:e,_vertex:t}){[e.x,e.y,e.m]=t}static _finishVertexPointXYZM({_point:e,_vertex:t}){[e.x,e.y,e.z,e.m]=t}static _finishVertexNonPoint(e){let{_part:t,_parts:r,_lengths:s,_vertex:i}=e;t.push([...i]),!(t.length<s[r.length])&&(e._previousX=e._previousY=0,e._part=[],r.push(t))}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:t,hasZ:r,transform:s}=this.featureSet,i=r?(0,S.d)(e,t):1;this._transformInPlace??=(0,v.M)(this.featureSet,i),this._transformInPlaceXY??=(0,v.M)({transform:s})}_transform(e){let t=[...e];return this._transformInPlace?.(t),t}_transformXY(e){let t=[e[0],e[1]];return this._transformInPlaceXY?.(t),t}}var _=r(80893),x=r(22671),b=r(97552);let w=class extends i.A{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return(0,u.An)(this.url)}async execute(e,t){let r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){let r,s=this._normalizeQuery(e),i=null!=e.outStatistics?.[0],a=(0,n.A)("featurelayer-pbf-statistics");if(this.pbfSupported&&(!i||a)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves))try{r=await async function(e,t,r,s){let i=(0,h.Dl)(e),a={...r},n=b.A.from(t),o=!n.quantizationParameters;return await(0,_.IJ)(i,n,new A({sourceSpatialReference:n.sourceSpatialReference,applyTransform:o}),a,s)}(this.url,s,t,{uniqueIdFields:this.uniqueIdFields})}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return r??=await(0,g.e)(this.url,s,t,{uniqueIdFields:this.uniqueIdFields}),this._normalizeFields(r.fields),r}async featureSetFromJSON(e,t,s){if(!this._queryGet3DObjectFormat(e)||null==this.infoFor3D||!t.features)return x.A.fromJSON(t);let{meshFeatureSetFromJSON:i}=await(0,o.qr)(Promise.all([r.e(2258),r.e(118),r.e(8366)]).then(()=>r(40050)),s);return i(e,this.infoFor3D,t)}executeForCount(e,t){return(0,y.I)(this.url,this._normalizeQuery(e),t,{uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return(0,f.L)(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,m.V)(this.url,this._normalizeQuery(e),t,{uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){let[{default:s},{executeRelationshipQuery:i}]=await(0,o.qr)(Promise.all([Promise.resolve().then(()=>r(26591)),r.e(1763).then(()=>r(71763))]),t),a=s.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:s},{executeRelationshipQueryForCount:i}]=await(0,o.qr)(Promise.all([Promise.resolve().then(()=>r(26591)),r.e(1763).then(()=>r(71763))]),t),a=s.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:s,fetchAttachments:i,processAttachmentQueryResult:a}=await(0,o.qr)(r.e(9239).then(()=>r(9239)),t),n=(0,h.Dl)(this.url);return a(n,await(this.queryAttachmentsSupported?s(n,e,t):i(n,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:s}=await(0,o.qr)(r.e(3103).then(()=>r(33103)),t);return s(this.parsedUrl,e,t)}async executePivotQuery(e,t){let{executePivotQuery:s}=await(0,o.qr)(r.e(566).then(()=>r(80566)),t);return s(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:s}=await(0,o.qr)(r.e(1273).then(()=>r(11273)),t);return s(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){let{executeForTopIds:s}=await(0,o.qr)(r.e(1277).then(()=>r(21277)),t);return s(this.parsedUrl,e,t)}async executeForTopExtents(e,t){let{executeForTopExtents:s}=await(0,o.qr)(r.e(8018).then(()=>r(8018)),t);return s(this.parsedUrl,e,t)}async executeForTopCount(e,t){let{executeForTopCount:s}=await(0,o.qr)(r.e(980).then(()=>r(10980)),t);return s(this.parsedUrl,e,t)}_normalizeQuery(e){let t=b.A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?d.A.from(e.dynamicDataSource):this.dynamicDataSource);let{infoFor3D:r}=this,s=this._queryGet3DObjectFormat(e);if(null!=r&&s){if(t=t===e?t.clone():t,t.formatOf3DObjects=s,t.outSpatialReference&&!(0,p.aI)(t.outSpatialReference,this.sourceSpatialReference))throw new a.A("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:s,originY:i,originZ:a,translationX:n,translationY:o,translationZ:u,scaleX:l,scaleY:p,scaleZ:c,rotationX:h,rotationY:d,rotationZ:y,rotationDeg:f}=r.transformFieldRoles;t.outFields.push(s,i,a,n,o,u,l,p,c,h,d,y,f)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:r}){return!0!==e||"xyFootprint"===t||r?null:(0,c.Hz)(this.infoFor3D)}};(0,s.Cg)([(0,l.MZ)({type:d.A})],w.prototype,"dynamicDataSource",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"fieldsIndex",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"gdbVersion",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"infoFor3D",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,s.Cg)([(0,l.MZ)()],w.prototype,"pbfSupported",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"pbfSupportedWithCurves",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"queryAttachmentsSupported",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"relativeTimeBinWindow",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"sourceSpatialReference",void 0),(0,s.Cg)([(0,l.MZ)()],w.prototype,"uniqueIdFields",void 0),(0,s.Cg)([(0,l.MZ)({type:String})],w.prototype,"url",void 0),w=(0,s.Cg)([(0,l.$K)("esri.layers.graphics.sources.support.QueryTask")],w)},64714(e,t,r){r.d(t,{F0:()=>o,Vx:()=>p,e2:()=>h,f:()=>f});var s=r(44208),i=r(4718),a=r(99352),n=r(93470);function o(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?n.Cb:"esriGeometryPolyline"===e?n.yM:n.WR}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function p(e,t){if((0,s.A)("esri-csp-restrictions"))return()=>t?{[t]:null,...e}:{...e};try{let r="";t&&(r+=`this${c(t)} = null;`);for(let t in e)r+=`this${c(t)} = ${JSON.stringify(e[t])};`;let s=Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new s}catch{return()=>t?{[t]:null,...e}:{...e}}}function c(e){return u.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function h(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.o8)(e)}}]}const d={...a.F,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!1,supportsDistance:!1,supportsExtent:!1,supportsQuantization:!1,supportsQueryGeometry:!1,supportsDisjointSpatialRelationship:!1},y={...a.P,supportedStatistics:{...a.P.supportedStatistics,envelope:!1,centroid:!1,convexHull:!1}};function f(e,t,r=!1){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r?d:a.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:r?y:a.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:t,supportsTrueCurveUpdateByTrueCurveClientsOnly:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},20615(e,t,r){r.d(t,{I:()=>n});var s=r(2272),i=r(80893),a=r(97552);function n(e,t,r,n){return(0,i.gW)((0,s.Dl)(e),a.A.from(t),r,n)}},74910(e,t,r){r.d(t,{L:()=>o});var s=r(5443),i=r(2272),a=r(80893),n=r(97552);async function o(e,t,r){let o=(0,i.Dl)(e),u=await(0,a.Jf)(o,n.A.from(t),{...r}),l=u.extent;return!l||isNaN(l.xmin)||isNaN(l.ymin)||isNaN(l.xmax)||isNaN(l.ymax)?{count:u.count,extent:null}:{count:u.count,extent:s.A.fromJSON(l)}}},78286(e,t,r){r.d(t,{V:()=>n});var s=r(2272),i=r(80893),a=r(97552);async function n(e,t,r,n){let o=(0,s.Dl)(e),u=await(0,i.Pk)(o,a.A.from(t),r,n);return u.objectIds??function(e){if(e)return function(e){return!Array.isArray(e[0])}(e)?e:e.map(e=>JSON.stringify(e))}(u.uniqueIds)??[]}},99199(e,t,r){r.d(t,{e:()=>u,s:()=>o});var s=r(2272),i=r(80893),a=r(22671),n=r(97552);async function o(e,t,r,s){let i=await u(e,t,r,s);return a.A.fromJSON(i)}function u(e,t,r,a){let o=(0,s.Dl)(e),u={...r},l=n.A.from(t);return(0,i.eW)(o,l,l.sourceSpatialReference,u,a)}},63746(e,t,r){function s(e){return class{constructor(){for(let t of e)this[t]=null}}}function i(e,t=1){let{transform:r,hasZ:s,hasM:i}=e;if(null==r)return s&&1!==t?e=>{e[2]*=t}:null;let[a,n]=function(e,t,r,s){let{scale:i,translate:a,originPosition:n}=e;return"upperLeft"===n&&(i=i.map((e,t)=>1===t?-e:e)),t&&(i=i.map((e,t)=>2===t?e*s:e),a=a.map((e,t)=>2===t?e*s:e)),!t&&r&&(i=i.filter((e,t)=>2!==t),a=a.filter((e,t)=>2!==t)),[i,a]}(r,s,i,t),o=e.hasZ?3:2;return e=>{for(let t=0;t<e.length&&(t!==o||0!==e[t]);++t)e[t]=e[t]*a[t]+n[t]}}r.d(t,{M:()=>i,_:()=>s})},2272(e,t,r){r.d(t,{Dl:()=>l,gf:()=>c,jV:()=>u,lF:()=>p});var s=r(92602),i=r(70333),a=r(4718),n=r(84952),o=r(926);function u(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function l(e){return"string"==typeof e?(0,n.An)(e):(0,a.o8)(e)}function p(e,t,r){let s={};for(let i in e){if("declaredClass"===i)continue;let a=e[i];if(null!=a&&"function"!=typeof a)if(Array.isArray(a))s[i]=a.map(e=>p(e));else if("object"==typeof a)if(a.toJSON){let e=a.toJSON(r?.[i]);s[i]=t?e:JSON.stringify(e)}else s[i]=t?a:JSON.stringify(a);else s[i]=a}return s}async function c(e,t,a){return function(e,t){return e?t&&(0,o.Qc)(e)?t:(0,o.getApiKey)(e)??i.id?.findCredential(e)?.token:null}(e,t)||(!i.id&&s.A.request.useIdentity&&await Promise.all([r.e(6361),r.e(7644),r.e(3713)]).then(()=>r(50148)),(await i.id.getCredential(e,a))?.token)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1003],{1003(e,t,i){i.r(t),i.d(t,{default:()=>me});var a=i(49186),r=i(32198),s=i(91429),n=i(49859),l=i(68197),o=i(5443),f=i(16930),u=i(73444),h=i(94778),c=i(14140);function d(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function p(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function m(e){let{axes:t}=e.domain,i=Object.keys(t),a=[],r=[],s=-1,n=-1,l=[];for(let e=0;e<i.length;e++){let o=i[e];d(o)?s=e:p(o)&&(n=e);let f=t[o],u=[];if("values"in f){f.values.forEach(e=>u.push("string"==typeof e?new Date(e).getTime():e));let e=u[1]-u[0];a.push([u[0]-.5*e,u[u.length-1]+.5*e]),r.push(e)}else{let{start:e,stop:t,num:i}=f,s=(t-e)/(i-1);a.push([e-.5*s,t+.5*s]),r.push(s);for(let t=0;t<i;t++)u.push(e+s*t)}l.push({name:o,values:u,extent:[u[0],u[u.length-1]]})}s>-1&&-1===n?n=+(0===s):n>-1&&-1===s?s=+(0===n):-1===n&&-1===s&&(s=0,n=1),l=l.filter((e,t)=>t!==s&&t!==n);let{referencing:u}=e.domain,h=u.find(e=>e.coordinates.includes(i[s])).system.id,c=h?.slice(h.lastIndexOf("/")+1),m=null==c||"CRS84"===c?4326:Number(c),g=new f.A({wkid:m}),[y,x]=a[s],[w,b]=a[n],I=new o.A({xmin:y,xmax:x,ymin:w,ymax:b,spatialReference:g});return{width:Math.round(I.width/r[s]),height:Math.round(I.height/r[n]),extent:I,dimensions:l}}function g(e){let t=(0,u.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function y(){return Math.round(255*Math.random())}function x(e){let t={},{parameters:i}=e;if(!i)return t;for(let[e,a]of Object.entries(i)){let{type:i,description:r,unit:s,categoryEncoding:n,observedProperty:o}=a;if("Parameter"===i&&(t[e]={},r&&(t[e].description=g(r)),s&&(t[e].unit=s.label?g(s.label):null,t[e].symbol=s.symbol?.value),n)){let i=Object.entries(n).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})),a=!1;o?.categories?.length&&(o.categories.forEach(e=>{if(!e.id)return;let t=e.id.slice(e.id.lastIndexOf("/")+1),r=i.find(e=>e.ClassName===t);if(r&&(r.Label=e.label?g(e.label):null,e.preferredColor)){let t=l.A.fromHex(e.preferredColor);t&&(a=!0,r.Red=t.r,r.Green=t.g,r.Blue=t.b)}}),a&&i.forEach(e=>{e.Red??(e.Red=y(),e.Green=y(),e.Blue=y())}));let r={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};a&&r.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=r}}return t}function w(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let a=0;a<e.length;a++){let r=e[a];null!=r&&(r<t&&(t=r),r>i&&(i=r))}return(0,h.X1)(t,i)}function b(e,t,i){let a=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),r=(e=>t=>e*=t.count)(1),s=[...a.slice(1),{name:"",count:1}].reverse().map(r).reverse(),n=0;for(let r=e.length-1;r>=0;r--){let l=a.findIndex(({name:t})=>t===e[r]);n+=s[l]*(i%t[r]),i=Math.floor(i/t[r])}return n}var I=i(17676),v=i(4366),C=i(47520),S=i(51927),T=i(45617),A=i(87186);let _=class extends n.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.preGenerateTiles=!0,this.source=null}get url(){return""}fetchRawTile(e,t,i,a={}){if(!this._pixelBlockTiles){let{rasterInfo:r}=this,[s,n]=r.storageInfo.tileInfo.size,{sliceId:l}=a,{pixelBlocks:o}=this.source,f={pixelBlock:null==l?o[0]:o[l],useBilinear:"thematic"!==r.dataType,tileSize:{width:s,height:n},level:e,row:t,col:i},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(f,a):(0,C.J$)(f);return Promise.resolve(u)}let r=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(r)}async _open(e){let t=this.source,{pixelBlocks:i,attributeTable:a,statistics:r,histograms:s,name:n,nativeExtent:l,transform:u,colormap:h}=t,c=i[0],{width:d,height:p,pixelType:m}=c,g=t.extent??new o.A({xmin:-.5,ymin:.5,xmax:d-.5,ymax:p-.5,spatialReference:new f.A({wkid:3857})}),y=t.isPseudoSpatialReference??!t.extent,x={x:g.width/d,y:g.height/p},w={...t.keyProperties};t.dataType&&(w.DataType=t.dataType),t.bandInfos&&(w.BandProperties=t.bandInfos.map(e=>e.toJSON())),a&&(w.DataType="Thematic");let b=new A.A({width:d,height:p,pixelType:m,extent:g,nativeExtent:l,attributeTable:a,colormap:h,transform:u,pixelSize:x,spatialReference:g.spatialReference,bandCount:c.pixels.length,keyProperties:w,multidimensionalInfo:t.multidimensionalInfo,statistics:r,isPseudoSpatialReference:y,histograms:s});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(b),this.createRemoteDatasetStorageInfo(b,512,512),this._set("rasterInfo",b),this.updateTileInfo(),b.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,b.multidimensionalInfo):this.preGenerateTiles&&await this._buildInMemoryRaster(c,{width:512,height:512},e),b.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(e,t,i){let{rasterInfo:r}=this,s=r.storageInfo.maximumPyramidLevel??0,n="thematic"!==r.dataType,l=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:s,useBilinear:n},i):Promise.resolve((0,C.lD)(e,t,s,n)),o=null!=r.statistics,f=null!=r.histograms,u=this.ioConfig.skipStatistics||o?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,S.f4)(e)),h=await(0,I.Lx)([l,u]);if(!h[0].value&&h[1].value)throw new a.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,o||(r.statistics=h[1].value?.statistics),f||(r.histograms=h[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let a=0;a<t.variables.length;a++){let r=t.variables[a];if(r.statistics)continue;let s=r.dimensions.map(e=>new T.A({variableName:r.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),n=(0,v.NG)(s,t),l=null==n?null:e[n];if(null==l)continue;let o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},i):(0,S.eH)(l);r.statistics=o.statistics,r.histograms||=o.histograms}}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],_.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)({constructOnly:!0})],_.prototype,"preGenerateTiles",void 0),(0,r.Cg)([(0,s.MZ)()],_.prototype,"source",void 0),(0,r.Cg)([(0,s.MZ)()],_.prototype,"url",null),_=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.InMemoryRaster")],_);const R=_;var M=i(22671);let k=class extends n.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,a={}){return this._inMemoryRaster.fetchRawTile(e,t,i,a)}async _open(e){let{extent:t,pixelBlocks:i,multidimensionalInfo:a,attributeTable:r,bandNames:s}=await this._fetchData(e),{statistics:n,histograms:l}=(0,S.eH)(i[0]),o=s?.map(e=>({BandName:e})),f={DataType:r?"Thematic":a?"Scientific":"Generic",BandProperties:o},u=new R({source:{extent:t,pixelBlocks:i,attributeTable:r?M.A.fromJSON(r):null,multidimensionalInfo:a,statistics:n,histograms:l,keyProperties:f,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;let h=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",h.slice(0,h.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(e){let t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new a.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new a.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new a.A(i,"Missing domain referencing in the grid coverage data");let r=Object.values(t.ranges);for(let e=0;e<r.length;e++){let{axisNames:t,shape:s,type:n,values:l}=r[e];if(!("ndarray"===n.toLowerCase()&&l?.length&&t?.length&&s?.length))throw new a.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!d(t[t.length-1])||!p(t[t.length-2]))throw new a.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){let{width:t,height:i,extent:a,dimensions:r}=m(e),{ranges:s}=e,n=Object.keys(s).sort((e,t)=>e<t?-1:1),l=[];for(let e=0;e<n.length;e++){let t=n[e];r?.length&&l.push({name:t,dimensions:r})}let o=x(e);l.forEach(e=>o[e.name]&&Object.assign(e,o[e.name]));let f=l.length?{variables:l}:void 0,u=[];for(let e=0;e<n.length;e++){let{values:a,dataType:l,axisNames:o,shape:f}=s[n[e]],h=f.length>2?e*f.slice(0,-2).reduce((e,t)=>e*t):0,d=o.slice(0,-2),p=f.slice(0,-2),m="float"===l?"f32":w(a),g=t*i,y=a.length/g;for(let s=0;s<y;s++){let n=c.A.createEmptyBand(m,g),l=new Uint8Array(g).fill(255),o=!1,f=s*g;for(let e=0;e<g;e++){let t=a[f+e];null==t?(l[e]=0,o=!0):n[e]=t}if(0===e||r?.length){let e=new c.A({width:t,height:i,mask:o?l:null,pixels:[n],pixelType:m});e.updateStatistics(),r?.length?u[b(d,p,s)+h]=e:u.push(e)}else{let e=u[s];e.pixels.push(n),o?e.mask&&=c.A.combineBandMasks([e.mask,l]):e.mask=o?l:null}}}return{extent:a,pixelBlocks:u,multidimensionalInfo:f,attributeTable:Object.values(o).find(e=>e.attributeTable)?.attributeTable,bandNames:f?void 0:n}}(t)}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)({constructOnly:!0})],k.prototype,"source",void 0),k=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.CovJSONRaster")],k);const O=k;var F=i(4576),P=i(21325),B=i(330),D=i(43163);function L(e,t){if(!e||!t)return null;let i=[];for(let a=0;a<e.length;a++)i.push(e[a]),i.push(t[a]);return i}function N(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new f.A({wkid:t});if(e=String(e).trim(),(0,P.jp)(e))return new f.A({wkt2:e});let i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;let a=i.indexOf("VERTCS"),r=i.indexOf("PROJCS"),s=r>-1?r:i.indexOf("GEOGCS");if(-1===s)return null;let n=e.slice(s,e.lastIndexOf("]",a)+1).trim(),l=e.slice(a,e.lastIndexOf("]")).trim();t=E(n);let o=t?new f.A({wkid:t}):new f.A({wkt:n}),u=E(l);return u&&(o.vcsWkid=u),o}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=E(e),0===t?new f.A({wkt:e}):new f.A({wkid:t})):null}function E(e){let t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),a=i[0]?.toLowerCase();if(("epsg"===a||"esri"===a)&&e.endsWith('"]]')){let e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function H(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};let t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,B.g7)(e,"SRS")){if(!t.spatialReference){let i=(0,B.mX)(e);t.spatialReference=N(i)}}else if((0,B.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){let{spatialReference:i,transform:a}=function(e){let t=(0,B.V6)(e,"GeodataXform"),i=N((0,B.v7)(t,"SpatialReference/WKID")||(0,B.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};let a=(0,B.v7)(t,"PolynomialOrder")??1,r=(0,B.Ui)(t,"CoeffX/Double"),s=(0,B.Ui)(t,"CoeffY/Double"),n=(0,B.Ui)(t,"InverseCoeffX/Double"),l=(0,B.Ui)(t,"InverseCoeffY/Double"),o=L(r,s),f=L(n,l);return{spatialReference:i,transform:o&&f&&o.length&&f.length?new D.A({spatialReference:i,polynomialOrder:a,forwardCoefficients:o,inverseCoefficients:f}):null}}(e);t.transform=a,t.spatialReference||=i}else(0,B.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,B.mX)(e));else if((0,B.g7)(e,"PAMRasterBand")){let i=function(e){let t,i,a,r,s=(0,B.v7)(e,"NoDataValue"),n=(0,B.V6)(e,"Histograms/HistItem"),l=(0,B.v7)(n,"HistMin"),o=(0,B.v7)(n,"HistMax"),f=(0,B.v7)(n,"BucketCount"),u=(0,B.mX)(n,"HistCounts")?.split("|").map(e=>Number(e));(0,B.IC)(e,"Metadata/MDI").forEach(e=>{let s=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":t=s;break;case"STATISTICS_MAXIMUM":i=s;break;case"STATISTICS_MEAN":a=s;break;case"STATISTICS_STDDEV":r=s}});let h=(0,B.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:s,histogram:u?.length&&null!=l&&null!=o?{min:l,max:o,size:f||u.length,counts:u}:null,sourceBandIndex:h,statistics:null!=t&&null!=i?{min:t,max:i,avg:a,stddev:r}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});let i=t.rasterBands;return i.length&&(t.statistics=i[0].statistics?i.map(e=>e.statistics).filter(F.Ru):null,t.histograms=i[0].histogram?i.map(e=>e.histogram).filter(F.Ru):null),t}var z=i(85951),J=i(96381);let U=class extends n.A{set rasterJobHandler(e){this._set("rasterJobHandler",e),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=e)}fetchRawTile(e,t,i,a={}){if(this._imageBlob){let{blockWidth:a,blockHeight:r}=this.rasterInfo.storageInfo;return this.decodePixelBlock(this._imageBlob,{tileSize:[a,r],tileIndex:[e,t,i],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0})}return this._inMemoryRaster?this._inMemoryRaster.fetchRawTile(e,t,i,a):Promise.resolve(null)}async _open(e){let t=await this._fetchData(e);if(null==t)throw new a.A("image-aux-raster:open","the data cannot be decoded");let{spatialReference:i,statistics:r,histograms:s,transform:n}=await this._fetchAuxiliaryData(e),l=!i;l&&(i=new f.A({wkid:3857})),s?.length&&null==r&&(r=(0,S.Pg)(s));let{width:u,height:h,pixelBlock:c}=t,d=new o.A({xmin:-.5,ymin:.5-h,xmax:u-.5,ymax:.5,spatialReference:i}),p=n?n.forwardTransform(d):d,m=!0;if(n){let e=n.forwardCoefficients;m=e&&0===e[1]&&0===e[2],m&&(n=null,d=p)}if(!c){let e=new A.A({width:u,height:h,bandCount:3,pixelType:"u8",extent:p,nativeExtent:d,transform:n,pixelSize:{x:p.width/u,y:p.height/h},spatialReference:p.spatialReference,keyProperties:{DataType:"Processed"}});return this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(e),this.createRemoteDatasetStorageInfo(e,512,512),this._set("rasterInfo",e),void this.updateTileInfo()}let{rasterJobHandler:g,ioConfig:y}=this,x=new R({preGenerateTiles:!1,rasterJobHandler:g,source:{extent:p,nativeExtent:d,transform:n,pixelBlocks:[c],statistics:r,histograms:s,keyProperties:{DataType:"Processed"},isPseudoSpatialReference:l},ioConfig:{...y,sampling:"closest",skipStatistics:!0}});await x.open(),x.source=null,this._set("rasterInfo",x.rasterInfo),this._inMemoryRaster=x}async _fetchData(e){let{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,J.g)(t);if("jpg"!==i&&"png"!==i&&"gif"!==i&&"bmp"!==i)throw new a.A("image-aux-raster:open","the data is not a supported format");if(this._set("datasetFormat",i.toUpperCase()),"jpg"===i){let e=(0,z.R)(t);if(null==e)throw new a.A("image-aux-raster:open","the data is not a supported format");return this._imageBlob=t,e}try{let e=await this.decodePixelBlock(t,{format:i,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0});return this._imageBlob=t,e?{width:e.width,height:e.height,pixelBlock:e}:null}catch{let e=await this.decodePixelBlock(t,{format:i,canvasUsage:"no-canvas",skipStatistics:!0});return e?{width:e.width,height:e.height,pixelBlock:e}:null}}async _fetchAuxiliaryData(e){let t=e?.signal,{skipExtensions:i=[],skipMapInfo:a}=this.ioConfig,r=a||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,n="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,l=n&&i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),o=await(0,I.Lx)([r,l]);if(t?.aborted)throw(0,I.NK)();let f=H(o[0].value?.data);if(!f.transform){let e=o[1].value?o[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;f.transform=6===e?.length?new D.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return f}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],U.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)()],U.prototype,"rasterJobHandler",null),U=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.ImageAuxRaster")],U);const G=U;var j=i(97768),q=i(84952),W=i(86738),V=i(75414),Z=i(20223),$=i(87045),X=i(25943),K=i(82371);let Y=class extends n.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,a={}){let{storageInfo:r,extent:s}=this.rasterInfo,{transposeInfo:n}=r,l=null!=n&&!!a.transposedVariableName;if(this._slices&&!l&&null==a.sliceId)return null;let o,f,u=l?0:r.maximumPyramidLevel-e+this._levelOffset,h=`${this.url}/tile/${u}/${t}/${i}`,c={...this._slices?l?{variable:a.transposedVariableName}:{sliceId:a.sliceId||0}:null,...a.refreshParameters};if(r.isBsqTile){let e=(a.bandIds?.length?a.bandIds:[0,1,2]).map(e=>this.request(h,{query:{...c,bandId:e},responseType:"array-buffer",signal:a.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),r=new Uint8Array(i);f=[];let s=0;for(let{data:e}of t)f.push(s),r.set(new Uint8Array(e),s),s+=e.byteLength;o=r.buffer}else o=(await this.request(h,{query:c,responseType:"array-buffer",signal:a.signal})).data;if(!o)return null;let{tileInfo:d}=r,p=l?n.tileSize:d.size,m=/^(mixed|jp)/i.test(d.format),g=await this.decodePixelBlock(o,{width:p[0],height:p[1],planes:f?.length,offsets:f,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue,applyJpegMask:m});if(null==g)return null;let y=r.blockBoundary[e];if("jpg"!==r.compression||i>y.minCol&&i<y.maxCol&&t>y.minRow&&t<y.maxRow)return g;let{origin:x,blockWidth:w,blockHeight:b}=r,{x:I,y:v}=this.getPyramidPixelSize(e),S=Math.round((s.xmin-x.x)/I)%w,T=Math.round((s.xmax-x.x)/I)%w||w,A=Math.round((x.y-s.ymax)/v)%b,_=Math.round((x.y-s.ymin)/v)%b||b,R=i===y.minCol?S:0,M=t===y.minRow?A:0,k=i===y.maxCol?T:w,O=t===y.maxRow?_:b;return(0,C.z$)(g,{x:R,y:M},{width:k-R,height:O-M}),g}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;let t=e;for(let e=0;e<this._slices.length;e++){let i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{let i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){let i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),a=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),r=await Promise.all([i,a]);return r[0]&&r[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),r[1]?.[0]?.counts?.length||(r[1]=null),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let a=0,{maximumPyramidLevel:r}=this.rasterInfo.storageInfo,s=r-a+this._levelOffset,n=i.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,i.row,i.col,t))break}catch{}if(s--,a++,i=this.identifyPixelLocation(n,a,t.datumTransformation),null===i)return null}return-1===s||null==i?null:a}async _open(e){let t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=i.data;if(this.sourceJSON=r,!r)throw new a.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!r.tileInfo)throw new a.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();this.tileType=r.cacheType,this.tileType??=["jpg","jpeg","png","png8","png24","png32","mixed"].includes(r.tileInfo.format.toLowerCase())?"Map":"lerc"===r.tileInfo.format.toLowerCase()?"Elevation":"Raster",this.datasetName=r.name?.slice(r.name.indexOf("/")+1)??"";let s=this.rasterInfo??await this._fetchRasterInfo({signal:t});if(null==s)throw new a.A("image-server-raster:open","cannot initialize image service");(0,K.E9)(s,r);let n="Map"===this.tileType?function(e,t){if(!e)return null;let{minScale:i,maxScale:a,minLOD:r,maxLOD:s}=t;if(null!=r&&null!=s)return $.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=r&&e<=s)});if(0!==i&&0!==a){let t=e=>Math.round(1e4*e)/1e4,r=i?t(i):1/0,s=a?t(a):-1/0;return $.A.fromJSON({...e,lods:e.lods.filter(e=>{let i=t(e.scale);return i<=r&&i>=s})})}return $.A.fromJSON(e)}(r.tileInfo,r):$.A.fromJSON(r.tileInfo);(0,j.Lw)(n);let[l,o]=this._computeMinMaxLOD(s,n),{extent:f,pixelSize:u}=s,h=.001*Math.min(u.x,u.y);(u.x!==u.y||Math.abs(l.resolution-u.x)>h)&&(u.x=u.y=l.resolution,s.width=Math.ceil((f.xmax-f.xmin)/u.x-.1),s.height=Math.ceil((f.ymax-f.ymin)/u.y-.1));let c=l.level-o.level,[d,p]=n.size,m=[],g=[],{lods:y}=n;y.forEach((e,t)=>{e.level>=o.level&&e.level<=l.level&&m.push({x:e.resolution,y:e.resolution}),t<y.length-1&&g.push(Math.round(10*e.resolution/y[t+1].resolution)/10)}),m.sort((e,t)=>e.x-t.x);let x,w=this.computeBlockBoundary(f,d,p,n.origin,m,c),b=m.length>1?m.slice(1):null;r.transposeInfo&&(x={tileSize:[r.transposeInfo.rows,r.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0});let I=g.length<=1||g.length>=3&&g.slice(0,-1).every(e=>e===g[0])?g[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/c))/10,v=!!r.bsq&&"Raster"===this.tileType;if(s.storageInfo=new Z.A({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:b,pyramidScalingFactor:I,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:c,tileInfo:n,isBsqTile:v,transposeInfo:x,blockBoundary:w}),function(e){let{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new V.A,e.extent=e.transform.forwardTransform(t))}(s),this._set("rasterInfo",s),r.capabilities.toLowerCase().includes("tilemap")){let e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,q.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new X.d({layer:e})}}async _fetchRasterInfo(e){let t=this.sourceJSON;if("Map"===this.tileType){let e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),a=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=f.A.fromJSON(t.spatialReference||e.spatialReference),s=new W.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new A.A({width:i,height:a,bandCount:3,extent:o.A.fromJSON(e),spatialReference:r,pixelSize:s,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}let i={...e,query:{...this.ioConfig.customFetchParameters,f:"json"}},a=(0,K.Tw)(this.url,this.sourceJSON,i),r=t.hasMultidimensions?this.request(`${this.url}/slices`,i).then(e=>e.data?.slices).catch(()=>null):null,s=await Promise.all([a,r]);return this._slices=s[1],s[0]}_fixScaleInServiceInfo(){let{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){let{pixelSize:i}=e,a=.5/e.width*i.x,{lods:r}=t,s=t.lodAt(Math.max.apply(null,r.map(e=>e.level))),n=t.lodAt(Math.min.apply(null,r.map(e=>e.level))),{tileType:l}=this;if("Map"===l)return this._levelOffset=r[0].level,[s,n];if("Raster"===l)return[r.find(e=>e.resolution===i.x)??s,n];let{minScale:o,maxScale:f}=this.sourceJSON,u=s;f>0&&(u=r.find(e=>Math.abs(e.scale-f)<a),u||=r.filter(e=>e.scale>f).sort((e,t)=>e.scale>t.scale?1:-1)[0]??s);let h=n;return o>0&&(h=r.find(e=>Math.abs(e.scale-o)<a)??n,this._levelOffset=h.level-n.level),[u,h]}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],Y.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)()],Y.prototype,"tileType",void 0),Y=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.ImageServerRaster")],Y);const Q=Y;var ee=i(10713);const te=new Map([["byte","u8"],["signedbyte","s8"],["int8","s8"],["uint8","u8"],["int16","s16"],["uint16","u16"],["int32","s32"],["uint32","u32"],["float32","f32"],["float64","f64"],["double64","f64"]]),ie=new Map;ie.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),ie.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),ie.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),ie.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),ie.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let ae=class extends n.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this._isBsq=!1,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,a={}){let{blockWidth:r,blockHeight:s,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[e];if(!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i)return null;let{bandCount:o,pixelType:f}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:d}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(u.some(e=>e.from>e.to)){let e=new Uint8Array(r*s);return new c.A({width:r,height:s,pixels:void 0,mask:e,validPixelCount:0})}let{bandIds:p}=this.ioConfig,m=this._getBandSegmentCount(),g=[],y=0;for(y=0;y<m;y++)(!p||p.includes(y))&&g.push(this.request(this._files.data,{range:{from:u[y].from,to:u[y].to},responseType:"array-buffer",signal:a.signal}));let x=await Promise.all(g),w=x.map(e=>e.data.byteLength).reduce((e,t)=>e+t),b=new Uint8Array(w),I=[],v=0;for(y=0;y<m;y++)I.push(v),b.set(new Uint8Array(x[y].data),v),v+=x[y].data.byteLength;let C=ie.get(this.rasterInfo.storageInfo.compression).decoderFormat,S="jpg"===C&&4===o&&1===I.length,T=await this.decodePixelBlock(b.buffer,{width:r,height:s,format:C,planes:p?.length||o,offsets:I,pixelType:f,canvasUsage:S?"no-canvas":void 0,decodeJpegAsRgb:!1}).catch(()=>null);if(null==T)return null;let{noDataValue:A}=this.rasterInfo;if(null!=A&&"lerc"!==C&&!T.mask&&(A=A[0],null!=A)){let e=T.width*T.height,t=new Uint8Array(e);if(Math.abs(A)>1e24)for(y=0;y<e;y++)Math.abs((T.pixels[0][y]-A)/A)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)T.pixels[0][y]!==A&&(t[y]=1);T.mask=t}let _=0,R=0;if(h!==r||d!==s){let e=T.mask;if(e)for(y=0;y<s;y++)if(R=y*r,y<d)for(_=h;_<r;_++)e[R+_]=0;else for(_=0;_<r;_++)e[R+_]=0;else for(e=new Uint8Array(r*s),T.mask=e,y=0;y<d;y++)for(R=y*r,_=0;_<h;_++)e[R+_]=1}return T}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);let t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:a,files:r}=this._parseHeader(i.data),{skipMapInfo:s,skipExtensions:n=[]}=this.ioConfig;if(!n.includes("aux.xml")&&!s){let t=await this._fetchAuxiliaryData(e);null!=t&&(a.statistics=t.statistics??a.statistics,a.histograms=t.histograms,t.histograms&&null==a.statistics&&(a.statistics=(0,S.Pg)(t.histograms)))}s&&this.updateImageSpaceRasterInfo(a),this._set("rasterInfo",a),this._files=r;let l=await this.request(r.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw Error("invalid array buffer must be multiples of 16");let t;if(ee.Z){let i=new Uint8Array(e),a=new ArrayBuffer(e.byteLength),r=new Uint8Array(a);for(let t=0;t<e.byteLength/4;t++)for(let e=0;e<4;e++)r[4*t+e]=i[4*t+3-e];t=new Uint32Array(a)}else t=new Uint32Array(e);return t}(l.data);let{blockWidth:o,blockHeight:f}=this.rasterInfo.storageInfo,u=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:c}=this.rasterInfo,d=[],p=this._getBandSegmentCount(),m=0,g=-1;for(;m<this._storageIndex.length;){g++;let e=Math.ceil(h/o/u**g)-1,t=Math.ceil(c/f/u**g)-1;m+=(e+1)*(t+1)*p*4,d.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=d,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return this._isBsq?this.rasterInfo.bandCount:1}_getTileLocation(e,t,i){let a,r,s,{blockWidth:n,blockHeight:l,pyramidScalingFactor:o}=this.rasterInfo.storageInfo,{width:f,height:u}=this.rasterInfo,h=this._getBandSegmentCount(),c=0,d=0;for(s=0;s<e;s++)d=o**s,a=Math.ceil(f/n/d),r=Math.ceil(u/l/d),c+=a*r;d=o**e,a=Math.ceil(f/n/d),r=Math.ceil(u/l/d),c+=t*a+i,c*=4*h;let p=this._storageIndex.subarray(c,c+4*h),m=0,g=0,y=[];for(let e=0;e<h;e++)m=p[4*e]*2**32+p[4*e+1],g=m+p[4*e+2]*2**32+p[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<a-1?n:Math.ceil(f/d)-n*(a-1),actualTileHeight:t<r-1?l:Math.ceil(u/d)-l*(r-1)}}_parseHeader(e){let t=(0,B.V6)(e,"MRF_META/Raster");if(!t)throw new a.A("mrf:open","not a valid MRF format");let i=(0,B.V6)(t,"Size"),r=parseInt(i.getAttribute("x"),10),s=parseInt(i.getAttribute("y"),10),n=parseInt(i.getAttribute("c"),10),l=((0,B.mX)(t,"Compression")||"none").toLowerCase();if(!ie.has(l))throw new a.A("mrf:open","currently does not support compression "+l);let u=(0,B.mX)(t,"DataType")||"UInt8",h=te.get(u.toLowerCase());if(null==h)throw new a.A("mrf:open","currently does not support pixel type "+u);let c=(0,B.V6)(t,"PageSize"),d=parseInt(c.getAttribute("x"),10),p=parseInt(c.getAttribute("y"),10),m=c.getAttribute("c"),g=m?m===String(n):ie.get(l).isOneSegment;this._isBsq=!g;let y,x=(0,B.V6)(t,"DataValues");if(x){let e=x.getAttribute("NoData");null!=e&&(y=e.trim().split(" ").map(e=>parseFloat(e)))}if((0,B.V6)(e,"MRF_META/CachedSource"))throw new a.A("mrf:open","currently does not support MRF referencing other data files");let w,b=(0,B.V6)(e,"MRF_META/GeoTags"),I=(0,B.V6)(b,"BoundingBox"),v=!1;if(null!=I){let e=parseFloat(I.getAttribute("minx")),t=parseFloat(I.getAttribute("miny")),i=parseFloat(I.getAttribute("maxx")),a=parseFloat(I.getAttribute("maxy")),r=(0,B.mX)(b,"Projection")||"",s=f.A.WGS84;if("LOCAL_CS[]"!==r)if(r.toLowerCase().startsWith("epsg:")){let e=Number(r.slice(5));!isNaN(e)&&0!==e&&(s=new f.A({wkid:e}))}else s=N(r)??f.A.WGS84;else v=!0,s=new f.A({wkid:3857});w=new o.A(e,t,i,a),w.spatialReference=s}else v=!0,w=new o.A({xmin:-.5,ymin:.5-s,xmax:r-.5,ymax:.5,spatialReference:new f.A({wkid:3857})});let C=(0,B.V6)(e,"MRF_META/Rsets"),S=parseInt(C?.getAttribute("scale")||"2",10),T=w.spatialReference,_=new Z.A({origin:new W.A({x:w.xmin,y:w.ymax,spatialReference:T}),blockWidth:d,blockHeight:p,pyramidBlockWidth:d,pyramidBlockHeight:p,compression:l,pyramidScalingFactor:S}),R=new W.A({x:w.width/r,y:w.height/s,spatialReference:T}),M=new A.A({width:r,height:s,extent:w,isPseudoSpatialReference:v,spatialReference:T,bandCount:n,pixelType:h,pixelSize:R,noDataValue:y,storageInfo:_}),k=this._getAuxFullPath((0,B.mX)(t,"DataFile")),O=this._getAuxFullPath((0,B.mX)(t,"IndexFile"));return{rasterInfo:M,files:{mrf:this.url,index:O||this.url.replace(".mrf",".idx"),data:k||this.url.replace(".mrf",ie.get(l).blobExtension)}}}_getAuxFullPath(e){return!e||e.includes("\\")?null:e.includes("/")?e.startsWith(new URL(this.url).origin)?e:null:`${this.url.slice(0,this.url.lastIndexOf("/"))}/${e}`}async _fetchAuxiliaryData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return H(t)}catch{return null}}};(0,r.Cg)([(0,s.MZ)()],ae.prototype,"_files",void 0),(0,r.Cg)([(0,s.MZ)()],ae.prototype,"_storageIndex",void 0),(0,r.Cg)([(0,s.MZ)()],ae.prototype,"_isBsq",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],ae.prototype,"datasetFormat",void 0),ae=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.MRFRaster")],ae);const re=ae;i(44208);var se=i(53966),ne=i(9334);function le(e){let t=e.fields,i=e.records,a=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",r=[{name:a,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),s=r.map(e=>e.name),n=[],l=0,o=0;return i.forEach(e=>{let t={};for(t[a]=l++,o=1;o<s.length;o++)t[s[o]]=e[o-1];n.push({attributes:t})}),{displayFieldName:"",fields:r,features:n}}function oe(e){let t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};let a=t.getUint32(4,!0),r=t.getUint16(8,!0),s=t.getUint16(10,!0),n={version:i,recordCount:a,headerByteCount:r,recordByteCount:s},l=32,o=[],f=[];for(;13!==t.getUint8(l);){let i=String.fromCharCode(t.getUint8(l+11)).trim();o.push({name:(0,ne.w)(new Uint8Array(e,l,11)),type:i,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(i)],length:t.getUint8(l+16)}),l+=32}if(l+=1,o.length>0)for(;f.length<a&&e.byteLength-l>s;){let i=[];32===t.getUint8(l)?(l+=1,o.forEach(t=>{if("C"===t.type)i.push((0,ne.w)(new Uint8Array(e,l,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim()));else if("D"===t.type){let a=String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim();i.push(new Date(parseInt(a.slice(0,4),10),parseInt(a.slice(4,6),10)-1,parseInt(a.slice(6,8),10)))}l+=t.length}),f.push(i)):l+=s}return{header:n,fields:o,records:f,recordSet:le({fields:o,records:f})}}var fe=i(44094),ue=i(94213);const he="none-tiled tiff is not optimized for access, convert to COG and retry.";let ce=class extends n.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this._fileSize=-1,this._headerChunks=[],this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,a={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;let r=await this._fetchRawTiffTile(e,t,i,!1,a);if(null!=r&&this._headerInfo.hasMaskBand){let s=await this._fetchRawTiffTile(e,t,i,!0,a);null!=s&&s.pixels[0]instanceof Uint8Array&&(r.mask=s.pixels[0])}return r}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf(".")),await this._readHeader(e?.signal);let{rasterInfo:t}=this,{skipMapInfo:i,skipExtensions:a=[]}=this.ioConfig;if(!a.includes("aux.xml")&&!i){let i=await this._fetchAuxiliaryMetaData(e);null!=i&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,S.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;let i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new W.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(i,t)}!a.includes("vat.dbf")&&1===t.bandCount&&"u8"===t.pixelType&&!i&&(t.attributeTable=await this._fetchAuxiliaryTable(e),null!=t.attributeTable&&(t.keyProperties.DataType="thematic")),i&&this.updateImageSpaceRasterInfo(t),this.updateTileInfo()}async _readHeader(e){try{let t=await this._fetchHeaderData(0,this._bufferSize,e);if(!t)throw new a.A("tiffraster:open","failed to open url "+this.url);let{littleEndian:i,firstIFDPos:r,isBigTiff:s}=(0,fe.uT)(t),n=[],l={fileChunk:t,posIFD:r,fileOffset:0};await this._readIFDs(n,l,i,s?8:4,e);let{imageInfo:u,rasterInfo:h}=function(e){let t=(0,fe.uc)(e),{width:i,height:a,tileWidth:r,tileHeight:s,planes:n,pixelType:l,compression:u,firstPyramidLevel:h,maximumPyramidLevel:c,pyramidBlockWidth:d,pyramidBlockHeight:p,pyramidResolutions:m,tileBoundary:g,affine:y,metadata:x,colormap:w}=t,b=N(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),I=!!t.isPseudoGeographic;b??=(I=!0,new f.A({wkid:3857}));let v=new o.A({...t.extent,spatialReference:b}),C=v?new W.A({x:v.xmin,y:v.ymax,spatialReference:b}):new W.A({x:0,y:0}),S=new Z.A({blockWidth:r,blockHeight:s,pyramidBlockWidth:d,pyramidBlockHeight:p,compression:u,origin:C,firstPyramidLevel:h,maximumPyramidLevel:c,pyramidResolutions:m,blockBoundary:g}),T=new W.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/a,spatialReference:b}),_=x?{BandProperties:x.bandProperties,DataType:x.dataType}:{},R=new A.A({width:i,height:a,bandCount:n,pixelType:l,pixelSize:T,storageInfo:S,spatialReference:b,isPseudoSpatialReference:I,keyProperties:_,extent:v,colormap:w,statistics:x?x.statistics:null});if(y?.length&&(R.nativeExtent=new o.A({xmin:-.5,ymin:.5-a,xmax:i-.5,ymax:.5,spatialReference:b}),R.transform=new D.A({polynomialOrder:1,forwardCoefficients:[y[2]+y[0]/2,y[5]-y[3]/2,y[0],y[3],-y[1],-y[4]]}),R.extent=R.transform.forwardTransform(R.nativeExtent),R.pixelSize=new W.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/a,spatialReference:b}),S.origin.x=-.5,S.origin.y=.5),m){let{x:e,y:t}=R.pixelSize;m.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:R}}(n),c=(0,fe.zS)(n),d=(0,fe.r9)(n);this._headerInfo={littleEndian:i,isBigTiff:s,ifds:n,pyramidIFDs:c,maskIFDs:d,...u},this._set("rasterInfo",h),this._validateHeader()}finally{this._headerChunks.length=0}}_validateHeader(){let e=this._headerInfo;if(!e.isSupported)throw new a.A("tiffraster:open","this tiff is not supported: "+e.message);if(!e.tileWidth||!e.tileHeight)throw new a.A("tiffraster:open",he);this.rasterInfo.isPseudoSpatialReference&&se.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");let t=e.ifds[0],i=t.get("PREDICTOR")?.values?.[0];if(3===t.get("SAMPLEFORMAT")?.values?.[0]&&2===i)throw new a.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data")}async _fetchHeaderData(e,t,i){let r=this._getCachedHeaderData(e,t);if(r)return r;let s=Math.floor(e/this._bufferSize)*this._bufferSize,n=s+Math.max(1,Math.ceil((t-s)/this._bufferSize))*this._bufferSize,l=this._getMissingHeaderRanges(s,n).map(async e=>{let{from:t,to:a}=e,r=await this._fetchOffsets(t,a,i),s=this._fileSize;return{chunk:r,fileOffset:t,isEOF:s>0?t+r.byteLength>=s:r.byteLength<a-t+1}}),o=await Promise.all(l);this._headerChunks.push(...o),this._headerChunks.sort((e,t)=>e.fileOffset-t.fileOffset);let f=this._getCachedHeaderData(e,t);if(!f)throw new a.A("tiffraster:open",`failed to fetch byte range ${e}-${t} from ${this.url}`);return f}_getCachedHeaderData(e,t){let i=[],a=e;for(let{chunk:r,fileOffset:s,isEOF:n}of this._headerChunks){if(s+r.byteLength-1<a)continue;if(s>a)return null;let l=a-s,o=Math.min(t-s+1,r.byteLength);if(i.push({chunk:r,start:l,end:o}),a=s+o,a>t||n&&o===r.byteLength){let t=new Uint8Array(a-e),r=0;for(let e of i){let i=new Uint8Array(e.chunk,e.start,e.end-e.start);t.set(i,r),r+=i.byteLength}return t.buffer}}return null}_getMissingHeaderRanges(e,t){let i=[],a=(e,t)=>{let a=Math.floor(e/this._bufferSize)*this._bufferSize,r=Math.ceil(t/this._bufferSize)*this._bufferSize;i.push({from:a,to:r})},r=e;for(let{chunk:e,fileOffset:s,isEOF:n}of this._headerChunks){let l=s+e.byteLength-1;if(!(l<r)&&(s>r&&a(r,Math.min(s-1,t)),r=Math.max(r,l+1),r>t||n))return i}return r<=t&&a(r,t),i}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:s}=e;if(s+8>=i.byteLength||s<0){if(r=s+r,r<0)throw new a.A("tiffraster:open",`invalid IFD position ${r}. failed to open url ${this.url}`);i=await this._fetchHeaderData(r,r+this._bufferSize/2,t),s=0}return{fileChunk:i,fileOffset:r,posIFD:s}}async _readIFDs(e,t,i,r=4,s){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,s);let n=await this._readIFD(t,i,ue.NB,r,s);if(!n?.ifd)throw new a.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;t.posIFD=n.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,r,s)}async _readIFD(e,t,i=ue.NB,r=4,s){let{fileChunk:n,posIFD:l,fileOffset:o}=e;if(!e.fileChunk)return null;let f=(0,fe.JM)(n,t,l,o,i,r);if(f.success){let{ifd:e}=f;if(!e)throw new a.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(!(this.ioConfig.loadFullMetadata||i!==ue.NB||e.has("TILEWIDTH")&&e.has("TILELENGTH")))throw new a.A("tiffraster:open",he);let r=[];e.forEach(e=>{e.values||r.push(e)}),r.length>0&&await this._fillOffsets(r,t,f.nextIFD,s),(0,fe.fM)(e),(0,fe.h_)(e);for(let[i,a]of ue.RR){let r=e.get(i),f=null!=r?.data&&Array.from(r.data.values()).some(e=>null==e.values&&null!=e.offlineOffsetSize);if(r&&(!r.data||f)){l=r.valueOffset-o;let e=await this._validateOrFetchHeaderBuffer({fileChunk:n,posIFD:l,fileOffset:o},s);r.data=(await this._readIFD(e,t,a,4,s))?.ifd}}return f}return f.requiredBufferSize?(n=await this._fetchHeaderData(o,o+l+f.requiredBufferSize+8,s),n.byteLength<l+f.requiredBufferSize?null:(e.fileChunk=n,e.fileOffset=o,this._readIFD(e,t,i,r,s))):null}async _fillOffsets(e,t,i,a){let r=e.filter(e=>null!=e.offlineOffsetSize);if(0===r.length)return;let s=r.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,s.map(e=>e[0])),l=Math.max.apply(null,s.map(e=>e[0]+e[1])),o=1===s.length||l-n<=this._bufferSize;if(!o&&s.length>1&&(s.sort((e,t)=>e[0]-t[0]),o=s.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,s[0][0])===l),o){let e=Math.max(l,n+this._bufferSize/4),i=await this._fetchHeaderData(n,e,a);return void r.forEach(e=>(0,fe.Cr)(i,t,e,n))}let f=r.map(async e=>{let i=e.offlineOffsetSize,r=await this._fetchHeaderData(i[0],i[1]+i[0],a);(0,fe.Cr)(r,t,e,i[0])});await Promise.all(f)}async _fetchOffsets(e,t,i){let a=[],r=this._chunkSize;this._fileSize>0&&(t=Math.min(t,this._fileSize-1));let s=Math.ceil((t-e+1)/r),n=e;for(let e=0;e<s;e++)a.push(this.request(this.url,{range:{from:n,to:e===s-1?t:n+r-1},responseType:"array-buffer",signal:i})),n+=r;let l=await Promise.all(a);if(-1===this._fileSize&&206===l[0].httpStatus){let e=l[0].getHeader?.("Content-Range"),t=Number(e?.split("/")[1]);Number.isFinite(t)&&(this._fileSize=t)}if(1===l.length)return l[0].data;let o=l.reduce((e,t)=>e+t.data.byteLength,0),f=new Uint8Array(o),u=0;for(let e of l)f.set(new Uint8Array(e.data),u),u+=e.data.byteLength;return f.buffer}async _fetchRawTiffTile(e,t,i,a,r={}){let s=this._getTileLocation(e,t,i,a);if(!s)return null;let{ranges:n,actualTileWidth:l,actualTileHeight:o,ifd:f}=s,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:r.signal})),h=await Promise.all(u),c=h.map(e=>e.data.byteLength).reduce((e,t)=>e+t),d=1===h.length?h[0].data:new ArrayBuffer(c),p=[0],m=[0];if(h.length>1){let e=new Uint8Array(d);for(let t=0,i=0;t<h.length;t++){let a=h[t].data;e.set(new Uint8Array(a),i),p[t]=i,i+=a.byteLength,m[t]=a.byteLength}}let{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(d,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:f,offsets:p,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==x)return null;if(l!==g||o!==y){let e=x.mask;if(e)for(let t=0;t<y;t++){let i=t*g;if(t<o)for(let t=l;t<g;t++)e[i+t]=0;else for(let t=0;t<g;t++)e[i+t]=0}else{e=new Uint8Array(g*y),x.mask=e;for(let t=0;t<o;t++){let i=t*g;for(let t=0;t<l;t++)e[i+t]=1}}}return x}_getTileLocation(e,t,i,a=!1){let{firstPyramidLevel:r,blockBoundary:s}=this.rasterInfo.storageInfo,n=0===e?0:e-(r-1),{_headerInfo:l}=this;if(!l)return null;let o=a?l.maskIFDs[n]:0===n?l.ifds[0]:l.pyramidIFDs[n-1];if(!o)return null;let f=(0,fe.XO)(o,l),u=(0,fe.wc)(o,"TILEOFFSETS"),h=(0,fe.wc)(o,"TILEBYTECOUNTS");if(!u?.length||!h?.length)return null;let{minRow:c,minCol:d,maxRow:p,maxCol:m}=s[n];if(t>p||i>m||t<c||i<d)return null;let g=(0,fe.LZ)(o,"IMAGEWIDTH"),y=(0,fe.LZ)(o,"IMAGELENGTH"),x=(0,fe.LZ)(o,"TILEWIDTH"),w=(0,fe.LZ)(o,"TILELENGTH"),b=[];if(f){let{bandCount:e}=this.rasterInfo;for(let a=0;a<e;a++){let e=a*(p+1)*(m+1)+t*(m+1)+i;b[a]={from:u[e],to:u[e]+h[e]-1}}}else{let e=t*(m+1)+i;b.push({from:u[e],to:u[e]+h[e]-1})}for(let e=0;e<b.length;e++)if(null==b[e].from||!b[e].to||b[e].to<0)return null;return{ranges:b,ifd:o,actualTileWidth:i===m&&g%x||x,actualTileHeight:t===p&&y%w||w}}async _fetchAuxiliaryMetaData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return H(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{let{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=oe(t);return i?.recordSet?M.A.fromJSON(i.recordSet):null}catch{return null}}};(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_files",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_headerInfo",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_bufferSize",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_chunkSize",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_fileSize",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_headerChunks",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],ce.prototype,"datasetFormat",void 0),ce=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.TIFFRaster")],ce);const de=ce,pe=new Map;pe.set("MRF",{desc:"Meta Raster Format",constructor:re}),pe.set("TIFF",{desc:"GeoTIFF",constructor:de}),pe.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Q}),pe.set("JPG",{desc:"JPG Raster Format",constructor:G}),pe.set("PNG",{desc:"PNG Raster Format",constructor:G}),pe.set("GIF",{desc:"GIF Raster Format",constructor:G}),pe.set("BMP",{desc:"BMP Raster Format",constructor:G}),pe.set("CovJSON",{desc:"COVJSON Raster Format",constructor:O}),pe.set("MEMORY",{desc:"In Memory Raster Format",constructor:R});class me{static get supportedFormats(){let e=new Set;return pe.forEach((t,i)=>e.add(i)),e}static async open(e){let{url:t,ioConfig:i,source:r,sourceJSON:s}=e,n=e.datasetFormat??i?.datasetFormat;n??(t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===r?.type?.toLowerCase()?n="CovJSON":r?.extent&&r.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n||"DM"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");let l={url:t,source:r,sourceJSON:s,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(e=>{l[e]??delete l[e]}),n){if(!this.supportedFormats.has(n))throw new a.A("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new a.A("rasterfactory:open",`cannot open raster: ${t}`);let i=new(0,pe.get(n).constructor)(l);return i.rasterJobHandler=e.rasterJobHandler,i.rasterInfo=e.rasterInfo,await i.open({signal:e.signal}),i}let o=Array.from(pe.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e),f=0,u=()=>{if(n=o[f++],!n||"CRF"===n)return null;let t=new(0,pe.get(n).constructor)(l);return t.rasterJobHandler=e.rasterJobHandler,t.open({signal:e.signal}).then(()=>t).catch(()=>u())};return u()}static register(e,t,i){pe.has(e.toUpperCase())||pe.set(e.toUpperCase(),{desc:t,constructor:i})}}},10333(e,t,i){i.d(t,{A:()=>n});var a=i(32198),r=i(25482),s=i(91429);let n=class extends r.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,a.Cg)([(0,s.MZ)()],n.prototype,"affectsPixelSize",null),(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],n.prototype,"spatialReference",void 0),n=(0,a.Cg)([(0,s.$K)("esri.layers.raster.transforms.BaseRasterTransform")],n)},75414(e,t,i){i.d(t,{A:()=>o});var a,r=i(32198),s=i(91429),n=i(10333),l=i(93223);let o=a=class extends n.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new a({tolerance:this.tolerance})}};(0,r.Cg)([(0,l.e)({GCSShiftXform:"gcs-shift"})],o.prototype,"type",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"tolerance",void 0),o=a=(0,r.Cg)([(0,s.$K)("esri.layers.raster.transforms.GCSShiftTransform")],o)},43163(e,t,i){i.d(t,{A:()=>p});var a,r=i(32198),s=i(91429),n=i(5443),l=i(86738),o=i(10333),f=i(36005),u=i(43937),h=i(93223);function c(e,t,i){let{x:a,y:r}=t;if(i<2)return{x:e[0]+a*e[2]+r*e[4],y:e[1]+a*e[3]+r*e[5]};if(2===i){let t=a*a,i=r*r,s=a*r;return{x:e[0]+a*e[2]+r*e[4]+t*e[6]+s*e[8]+i*e[10],y:e[1]+a*e[3]+r*e[5]+t*e[7]+s*e[9]+i*e[11]}}let s=a*a,n=r*r,l=a*r,o=s*a,f=s*r,u=a*n,h=r*n;return{x:e[0]+a*e[2]+r*e[4]+s*e[6]+l*e[8]+n*e[10]+o*e[12]+f*e[14]+u*e[16]+h*e[18],y:e[1]+a*e[3]+r*e[5]+s*e[7]+l*e[9]+n*e[11]+o*e[13]+f*e[15]+u*e[17]+h*e[19]}}function d(e,t,i){let{xmin:a,ymin:r,xmax:s,ymax:l,spatialReference:o}=t,f=[];if(i<2)f.push({x:a,y:l}),f.push({x:s,y:l}),f.push({x:a,y:r}),f.push({x:s,y:r});else{let e=10;for(let t=0;t<e;t++)f.push({x:a,y:r+(l-r)*t/(e-1)}),f.push({x:s,y:r+(l-r)*t/(e-1)});e=8;for(let t=1;t<=e;t++)f.push({x:a+(s-a)*t/e,y:r}),f.push({x:a+(s-a)*t/e,y:l})}f=f.map(t=>c(e,t,i));let u=f.map(e=>e.x),h=f.map(e=>e.y);return new n.A({xmin:Math.min.apply(null,u),xmax:Math.max.apply(null,u),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}let p=a=class extends o.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){let{coeffX:i,coeffY:a}=t;if(!i?.length||!a?.length||i.length!==a.length)return null;let r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(a[e]);return r}writeForwardCoefficients(e,t,i){let a=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?a.push(e[t]):r.push(e[t]);t.coeffX=a,t.coeffY=r}get inverseCoefficients(){let e=this._get("inverseCoefficients"),t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){let[t,i,a,r,s,n]=e,l=a*n-s*r,o=s*r-a*n;return[(s*i-t*n)/l,(a*i-t*r)/o,n/l,r/o,-s/l,-a/o]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){let{inverseCoeffX:i,inverseCoeffY:a}=t;if(!i?.length||!a?.length||i.length!==a.length)return null;let r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(a[e]);return r}writeInverseCoefficients(e,t,i){let a=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?a.push(e[t]):r.push(e[t]);t.inverseCoeffX=a,t.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){let t=c(this.forwardCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){let t=c(this.inverseCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new a({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],p.prototype,"polynomialOrder",void 0),(0,r.Cg)([(0,s.MZ)()],p.prototype,"forwardCoefficients",void 0),(0,r.Cg)([(0,f.w)("forwardCoefficients",["coeffX","coeffY"])],p.prototype,"readForwardCoefficients",null),(0,r.Cg)([(0,u.K)("forwardCoefficients")],p.prototype,"writeForwardCoefficients",null),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],p.prototype,"inverseCoefficients",null),(0,r.Cg)([(0,f.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],p.prototype,"readInverseCoefficients",null),(0,r.Cg)([(0,u.K)("inverseCoefficients")],p.prototype,"writeInverseCoefficients",null),(0,r.Cg)([(0,s.MZ)()],p.prototype,"affectsPixelSize",null),(0,r.Cg)([(0,h.e)({PolynomialXform:"polynomial"})],p.prototype,"type",void 0),p=a=(0,r.Cg)([(0,s.$K)("esri.layers.raster.transforms.PolynomialTransform")],p)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1003],{1003(e,t,i){i.r(t),i.d(t,{default:()=>me});var a=i(49186),r=i(32198),s=i(91429),n=i(49859),l=i(68197),o=i(5443),f=i(16930),u=i(73444),h=i(94778),c=i(14140);function d(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function p(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function m(e){let{axes:t}=e.domain,i=Object.keys(t),a=[],r=[],s=-1,n=-1,l=[];for(let e=0;e<i.length;e++){let o=i[e];d(o)?s=e:p(o)&&(n=e);let f=t[o],u=[];if("values"in f){f.values.forEach(e=>u.push("string"==typeof e?new Date(e).getTime():e));let e=u[1]-u[0];a.push([u[0]-.5*e,u[u.length-1]+.5*e]),r.push(e)}else{let{start:e,stop:t,num:i}=f,s=(t-e)/(i-1);a.push([e-.5*s,t+.5*s]),r.push(s);for(let t=0;t<i;t++)u.push(e+s*t)}l.push({name:o,values:u,extent:[u[0],u[u.length-1]]})}s>-1&&-1===n?n=+(0===s):n>-1&&-1===s?s=+(0===n):-1===n&&-1===s&&(s=0,n=1),l=l.filter((e,t)=>t!==s&&t!==n);let{referencing:u}=e.domain,h=u.find(e=>e.coordinates.includes(i[s])).system.id,c=h?.slice(h.lastIndexOf("/")+1),m=null==c||"CRS84"===c?4326:Number(c),g=new f.A({wkid:m}),[y,x]=a[s],[w,I]=a[n],b=new o.A({xmin:y,xmax:x,ymin:w,ymax:I,spatialReference:g});return{width:Math.round(b.width/r[s]),height:Math.round(b.height/r[n]),extent:b,dimensions:l}}function g(e){let t=(0,u.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function y(){return Math.round(255*Math.random())}function x(e){let t={},{parameters:i}=e;if(!i)return t;for(let[e,a]of Object.entries(i)){let{type:i,description:r,unit:s,categoryEncoding:n,observedProperty:o}=a;if("Parameter"===i&&(t[e]={},r&&(t[e].description=g(r)),s&&(t[e].unit=s.label?g(s.label):null,t[e].symbol=s.symbol?.value),n)){let i=Object.entries(n).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})),a=!1;o?.categories?.length&&(o.categories.forEach(e=>{if(!e.id)return;let t=e.id.slice(e.id.lastIndexOf("/")+1),r=i.find(e=>e.ClassName===t);if(r&&(r.Label=e.label?g(e.label):null,e.preferredColor)){let t=l.A.fromHex(e.preferredColor);t&&(a=!0,r.Red=t.r,r.Green=t.g,r.Blue=t.b)}}),a&&i.forEach(e=>{e.Red??(e.Red=y(),e.Green=y(),e.Blue=y())}));let r={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};a&&r.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=r}}return t}function w(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let a=0;a<e.length;a++){let r=e[a];null!=r&&(r<t&&(t=r),r>i&&(i=r))}return(0,h.X1)(t,i)}function I(e,t,i){let a=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),r=(e=>t=>e*=t.count)(1),s=[...a.slice(1),{name:"",count:1}].reverse().map(r).reverse(),n=0;for(let r=e.length-1;r>=0;r--){let l=a.findIndex(({name:t})=>t===e[r]);n+=s[l]*(i%t[r]),i=Math.floor(i/t[r])}return n}var b=i(17676),v=i(4366),C=i(47520),S=i(51927),A=i(45617),T=i(87186);let _=class extends n.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.preGenerateTiles=!0,this.source=null}get url(){return""}fetchRawTile(e,t,i,a={}){if(!this._pixelBlockTiles){let{rasterInfo:r}=this,[s,n]=r.storageInfo.tileInfo.size,{sliceId:l}=a,{pixelBlocks:o}=this.source,f={pixelBlock:null==l?o[0]:o[l],useBilinear:"thematic"!==r.dataType,tileSize:{width:s,height:n},level:e,row:t,col:i},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(f,a):(0,C.J$)(f);return Promise.resolve(u)}let r=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(r)}async _open(e){let t=this.source,{pixelBlocks:i,attributeTable:a,statistics:r,histograms:s,name:n,nativeExtent:l,transform:u,colormap:h}=t,c=i[0],{width:d,height:p,pixelType:m}=c,g=t.extent??new o.A({xmin:-.5,ymin:.5,xmax:d-.5,ymax:p-.5,spatialReference:new f.A({wkid:3857})}),y=t.isPseudoSpatialReference??!t.extent,x={x:g.width/d,y:g.height/p},w={...t.keyProperties};t.dataType&&(w.DataType=t.dataType),t.bandInfos&&(w.BandProperties=t.bandInfos.map(e=>e.toJSON())),a&&(w.DataType="Thematic");let I=new T.A({width:d,height:p,pixelType:m,extent:g,nativeExtent:l,attributeTable:a,colormap:h,transform:u,pixelSize:x,spatialReference:g.spatialReference,bandCount:c.pixels.length,keyProperties:w,multidimensionalInfo:t.multidimensionalInfo,statistics:r,isPseudoSpatialReference:y,histograms:s});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(I),this.createRemoteDatasetStorageInfo(I,512,512),this._set("rasterInfo",I),this.updateTileInfo(),I.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,I.multidimensionalInfo):this.preGenerateTiles&&await this._buildInMemoryRaster(c,{width:512,height:512},e),I.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(e,t,i){let{rasterInfo:r}=this,s=r.storageInfo.maximumPyramidLevel??0,n="thematic"!==r.dataType,l=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:s,useBilinear:n},i):Promise.resolve((0,C.lD)(e,t,s,n)),o=null!=r.statistics,f=null!=r.histograms,u=this.ioConfig.skipStatistics||o?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,S.f4)(e)),h=await(0,b.Lx)([l,u]);if(!h[0].value&&h[1].value)throw new a.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,o||(r.statistics=h[1].value?.statistics),f||(r.histograms=h[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let a=0;a<t.variables.length;a++){let r=t.variables[a];if(r.statistics)continue;let s=r.dimensions.map(e=>new A.A({variableName:r.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),n=(0,v.NG)(s,t),l=null==n?null:e[n];if(null==l)continue;let o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},i):(0,S.eH)(l);r.statistics=o.statistics,r.histograms||=o.histograms}}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],_.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)({constructOnly:!0})],_.prototype,"preGenerateTiles",void 0),(0,r.Cg)([(0,s.MZ)()],_.prototype,"source",void 0),(0,r.Cg)([(0,s.MZ)()],_.prototype,"url",null),_=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.InMemoryRaster")],_);const R=_;var M=i(22671);let k=class extends n.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,a={}){return this._inMemoryRaster.fetchRawTile(e,t,i,a)}async _open(e){let{extent:t,pixelBlocks:i,multidimensionalInfo:a,attributeTable:r,bandNames:s}=await this._fetchData(e),{statistics:n,histograms:l}=(0,S.eH)(i[0]),o=s?.map(e=>({BandName:e})),f={DataType:r?"Thematic":a?"Scientific":"Generic",BandProperties:o},u=new R({source:{extent:t,pixelBlocks:i,attributeTable:r?M.A.fromJSON(r):null,multidimensionalInfo:a,statistics:n,histograms:l,keyProperties:f,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;let h=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",h.slice(0,h.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(e){let t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new a.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new a.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new a.A(i,"Missing domain referencing in the grid coverage data");let r=Object.values(t.ranges);for(let e=0;e<r.length;e++){let{axisNames:t,shape:s,type:n,values:l}=r[e];if(!("ndarray"===n.toLowerCase()&&l?.length&&t?.length&&s?.length))throw new a.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!d(t[t.length-1])||!p(t[t.length-2]))throw new a.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){let{width:t,height:i,extent:a,dimensions:r}=m(e),{ranges:s}=e,n=Object.keys(s).sort((e,t)=>e<t?-1:1),l=[];for(let e=0;e<n.length;e++){let t=n[e];r?.length&&l.push({name:t,dimensions:r})}let o=x(e);l.forEach(e=>o[e.name]&&Object.assign(e,o[e.name]));let f=l.length?{variables:l}:void 0,u=[];for(let e=0;e<n.length;e++){let{values:a,dataType:l,axisNames:o,shape:f}=s[n[e]],h=f.length>2?e*f.slice(0,-2).reduce((e,t)=>e*t):0,d=o.slice(0,-2),p=f.slice(0,-2),m="float"===l?"f32":w(a),g=t*i,y=a.length/g;for(let s=0;s<y;s++){let n=c.A.createEmptyBand(m,g),l=new Uint8Array(g).fill(255),o=!1,f=s*g;for(let e=0;e<g;e++){let t=a[f+e];null==t?(l[e]=0,o=!0):n[e]=t}if(0===e||r?.length){let e=new c.A({width:t,height:i,mask:o?l:null,pixels:[n],pixelType:m});e.updateStatistics(),r?.length?u[I(d,p,s)+h]=e:u.push(e)}else{let e=u[s];e.pixels.push(n),o?e.mask&&=c.A.combineBandMasks([e.mask,l]):e.mask=o?l:null}}}return{extent:a,pixelBlocks:u,multidimensionalInfo:f,attributeTable:Object.values(o).find(e=>e.attributeTable)?.attributeTable,bandNames:f?void 0:n}}(t)}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)({constructOnly:!0})],k.prototype,"source",void 0),k=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.CovJSONRaster")],k);const O=k;var F=i(4576),P=i(21325),B=i(330),D=i(43163);function L(e,t){if(!e||!t)return null;let i=[];for(let a=0;a<e.length;a++)i.push(e[a]),i.push(t[a]);return i}function N(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new f.A({wkid:t});if(e=String(e).trim(),(0,P.jp)(e))return new f.A({wkt2:e});let i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;let a=i.indexOf("VERTCS"),r=i.indexOf("PROJCS"),s=r>-1?r:i.indexOf("GEOGCS");if(-1===s)return null;let n=e.slice(s,e.lastIndexOf("]",a)+1).trim(),l=e.slice(a,e.lastIndexOf("]")).trim();t=E(n);let o=t?new f.A({wkid:t}):new f.A({wkt:n}),u=E(l);return u&&(o.vcsWkid=u),o}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=E(e),0===t?new f.A({wkt:e}):new f.A({wkid:t})):null}function E(e){let t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),a=i[0]?.toLowerCase();if(("epsg"===a||"esri"===a)&&e.endsWith('"]]')){let e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function H(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};let t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,B.g7)(e,"SRS")){if(!t.spatialReference){let i=(0,B.mX)(e);t.spatialReference=N(i)}}else if((0,B.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){let{spatialReference:i,transform:a}=function(e){let t=(0,B.V6)(e,"GeodataXform"),i=N((0,B.v7)(t,"SpatialReference/WKID")||(0,B.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};let a=(0,B.v7)(t,"PolynomialOrder")??1,r=(0,B.Ui)(t,"CoeffX/Double"),s=(0,B.Ui)(t,"CoeffY/Double"),n=(0,B.Ui)(t,"InverseCoeffX/Double"),l=(0,B.Ui)(t,"InverseCoeffY/Double"),o=L(r,s),f=L(n,l);return{spatialReference:i,transform:o&&f&&o.length&&f.length?new D.A({spatialReference:i,polynomialOrder:a,forwardCoefficients:o,inverseCoefficients:f}):null}}(e);t.transform=a,t.spatialReference||=i}else(0,B.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,B.mX)(e));else if((0,B.g7)(e,"PAMRasterBand")){let i=function(e){let t,i,a,r,s=(0,B.v7)(e,"NoDataValue"),n=(0,B.V6)(e,"Histograms/HistItem"),l=(0,B.v7)(n,"HistMin"),o=(0,B.v7)(n,"HistMax"),f=(0,B.v7)(n,"BucketCount"),u=(0,B.mX)(n,"HistCounts")?.split("|").map(e=>Number(e));(0,B.IC)(e,"Metadata/MDI").forEach(e=>{let s=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":t=s;break;case"STATISTICS_MAXIMUM":i=s;break;case"STATISTICS_MEAN":a=s;break;case"STATISTICS_STDDEV":r=s}});let h=(0,B.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:s,histogram:u?.length&&null!=l&&null!=o?{min:l,max:o,size:f||u.length,counts:u}:null,sourceBandIndex:h,statistics:null!=t&&null!=i?{min:t,max:i,avg:a,stddev:r}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});let i=t.rasterBands;return i.length&&(t.statistics=i[0].statistics?i.map(e=>e.statistics).filter(F.Ru):null,t.histograms=i[0].histogram?i.map(e=>e.histogram).filter(F.Ru):null),t}var z=i(85951),J=i(96381);let U=class extends n.A{set rasterJobHandler(e){this._set("rasterJobHandler",e),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=e)}fetchRawTile(e,t,i,a={}){if(this._imageBlob){let{blockWidth:a,blockHeight:r}=this.rasterInfo.storageInfo;return this.decodePixelBlock(this._imageBlob,{tileSize:[a,r],tileIndex:[e,t,i],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0})}return this._inMemoryRaster?this._inMemoryRaster.fetchRawTile(e,t,i,a):Promise.resolve(null)}async _open(e){let t=await this._fetchData(e);if(null==t)throw new a.A("image-aux-raster:open","the data cannot be decoded");let{spatialReference:i,statistics:r,histograms:s,transform:n}=await this._fetchAuxiliaryData(e),l=!i;l&&(i=new f.A({wkid:3857})),s?.length&&null==r&&(r=(0,S.Pg)(s));let{width:u,height:h,pixelBlock:c}=t,d=new o.A({xmin:-.5,ymin:.5-h,xmax:u-.5,ymax:.5,spatialReference:i}),p=n?n.forwardTransform(d):d,m=!0;if(n){let e=n.forwardCoefficients;m=e&&0===e[1]&&0===e[2],m&&(n=null,d=p)}if(!c){let e=new T.A({width:u,height:h,bandCount:3,pixelType:"u8",extent:p,nativeExtent:d,transform:n,pixelSize:{x:p.width/u,y:p.height/h},spatialReference:p.spatialReference,keyProperties:{DataType:"Processed"}});return this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(e),this.createRemoteDatasetStorageInfo(e,512,512),this._set("rasterInfo",e),void this.updateTileInfo()}let{rasterJobHandler:g,ioConfig:y}=this,x=new R({preGenerateTiles:!1,rasterJobHandler:g,source:{extent:p,nativeExtent:d,transform:n,pixelBlocks:[c],statistics:r,histograms:s,keyProperties:{DataType:"Processed"},isPseudoSpatialReference:l},ioConfig:{...y,sampling:"closest",skipStatistics:!0}});await x.open(),x.source=null,this._set("rasterInfo",x.rasterInfo),this._inMemoryRaster=x}async _fetchData(e){let{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,J.g)(t);if("jpg"!==i&&"png"!==i&&"gif"!==i&&"bmp"!==i)throw new a.A("image-aux-raster:open","the data is not a supported format");if(this._set("datasetFormat",i.toUpperCase()),"jpg"===i){let e=(0,z.R)(t);if(null==e)throw new a.A("image-aux-raster:open","the data is not a supported format");return this._imageBlob=t,e}try{let e=await this.decodePixelBlock(t,{format:i,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0});return this._imageBlob=t,e?{width:e.width,height:e.height,pixelBlock:e}:null}catch{let e=await this.decodePixelBlock(t,{format:i,canvasUsage:"no-canvas",skipStatistics:!0});return e?{width:e.width,height:e.height,pixelBlock:e}:null}}async _fetchAuxiliaryData(e){let t=e?.signal,{skipExtensions:i=[],skipMapInfo:a}=this.ioConfig,r=a||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,n="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,l=n&&i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),o=await(0,b.Lx)([r,l]);if(t?.aborted)throw(0,b.NK)();let f=H(o[0].value?.data);if(!f.transform){let e=o[1].value?o[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;f.transform=6===e?.length?new D.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return f}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],U.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)()],U.prototype,"rasterJobHandler",null),U=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.ImageAuxRaster")],U);const G=U;var j=i(97768),q=i(84952),W=i(86738),V=i(75414),Z=i(20223),$=i(87045),X=i(25943),K=i(82371);let Y=class extends n.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,a={}){let{storageInfo:r,extent:s}=this.rasterInfo,{transposeInfo:n}=r,l=null!=n&&!!a.transposedVariableName;if(this._slices&&!l&&null==a.sliceId)return null;let o,f,u=l?0:r.maximumPyramidLevel-e+this._levelOffset,h=`${this.url}/tile/${u}/${t}/${i}`,c={...this._slices?l?{variable:a.transposedVariableName}:{sliceId:a.sliceId||0}:null,...a.refreshParameters};if(r.isBsqTile){let e=(a.bandIds?.length?a.bandIds:[0,1,2]).map(e=>this.request(h,{query:{...c,bandId:e},responseType:"array-buffer",signal:a.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),r=new Uint8Array(i);f=[];let s=0;for(let{data:e}of t)f.push(s),r.set(new Uint8Array(e),s),s+=e.byteLength;o=r.buffer}else o=(await this.request(h,{query:c,responseType:"array-buffer",signal:a.signal})).data;if(!o)return null;let{tileInfo:d}=r,p=l?n.tileSize:d.size,m=/^(mixed|jp)/i.test(d.format),g=await this.decodePixelBlock(o,{width:p[0],height:p[1],planes:f?.length,offsets:f,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue,applyJpegMask:m});if(null==g)return null;let y=r.blockBoundary[e];if("jpg"!==r.compression||i>y.minCol&&i<y.maxCol&&t>y.minRow&&t<y.maxRow)return g;let{origin:x,blockWidth:w,blockHeight:I}=r,{x:b,y:v}=this.getPyramidPixelSize(e),S=Math.round((s.xmin-x.x)/b)%w,A=Math.round((s.xmax-x.x)/b)%w||w,T=Math.round((x.y-s.ymax)/v)%I,_=Math.round((x.y-s.ymin)/v)%I||I,R=i===y.minCol?S:0,M=t===y.minRow?T:0,k=i===y.maxCol?A:w,O=t===y.maxRow?_:I;return(0,C.z$)(g,{x:R,y:M},{width:k-R,height:O-M}),g}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;let t=e;for(let e=0;e<this._slices.length;e++){let i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{let i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){let i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),a=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),r=await Promise.all([i,a]);return r[0]&&r[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),r[1]?.[0]?.counts?.length||(r[1]=null),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let a=0,{maximumPyramidLevel:r}=this.rasterInfo.storageInfo,s=r-a+this._levelOffset,n=i.srcLocation;for(;s>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(s,i.row,i.col,t))break}catch{}if(s--,a++,i=this.identifyPixelLocation(n,a,t.datumTransformation),null===i)return null}return-1===s||null==i?null:a}async _open(e){let t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=i.data;if(this.sourceJSON=r,!r)throw new a.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!r.tileInfo)throw new a.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();this.tileType=r.cacheType,this.tileType??=["jpg","jpeg","png","png8","png24","png32","mixed"].includes(r.tileInfo.format.toLowerCase())?"Map":"lerc"===r.tileInfo.format.toLowerCase()?"Elevation":"Raster",this.datasetName=r.name?.slice(r.name.indexOf("/")+1)??"";let s=this.rasterInfo??await this._fetchRasterInfo({signal:t});if(null==s)throw new a.A("image-server-raster:open","cannot initialize image service");(0,K.E9)(s,r);let n="Map"===this.tileType?function(e,t){if(!e)return null;let{minScale:i,maxScale:a,minLOD:r,maxLOD:s}=t;if(null!=r&&null!=s)return $.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=r&&e<=s)});if(0!==i&&0!==a){let t=e=>Math.round(1e4*e)/1e4,r=i?t(i):1/0,s=a?t(a):-1/0;return $.A.fromJSON({...e,lods:e.lods.filter(e=>{let i=t(e.scale);return i<=r&&i>=s})})}return $.A.fromJSON(e)}(r.tileInfo,r):$.A.fromJSON(r.tileInfo);(0,j.Lw)(n);let[l,o]=this._computeMinMaxLOD(s,n),{extent:f,pixelSize:u}=s,h=.001*Math.min(u.x,u.y);(u.x!==u.y||Math.abs(l.resolution-u.x)>h)&&(u.x=u.y=l.resolution,s.width=Math.ceil((f.xmax-f.xmin)/u.x-.1),s.height=Math.ceil((f.ymax-f.ymin)/u.y-.1));let c=l.level-o.level,[d,p]=n.size,m=[],g=[],{lods:y}=n;y.forEach((e,t)=>{e.level>=o.level&&e.level<=l.level&&m.push({x:e.resolution,y:e.resolution}),t<y.length-1&&g.push(Math.round(10*e.resolution/y[t+1].resolution)/10)}),m.sort((e,t)=>e.x-t.x);let x,w=this.computeBlockBoundary(f,d,p,n.origin,m,c),I=m.length>1?m.slice(1):null;r.transposeInfo&&(x={tileSize:[r.transposeInfo.rows,r.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0});let b=g.length<=1||g.length>=3&&g.slice(0,-1).every(e=>e===g[0])?g[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/c))/10,v=!!r.bsq&&"Raster"===this.tileType;if(s.storageInfo=new Z.A({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:I,pyramidScalingFactor:b,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:c,tileInfo:n,isBsqTile:v,transposeInfo:x,blockBoundary:w}),function(e){let{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new V.A,e.extent=e.transform.forwardTransform(t))}(s),this._set("rasterInfo",s),r.capabilities.toLowerCase().includes("tilemap")){let e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,q.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new X.d({layer:e})}}async _fetchRasterInfo(e){let t=this.sourceJSON;if("Map"===this.tileType){let e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),a=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=f.A.fromJSON(t.spatialReference||e.spatialReference),s=new W.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new T.A({width:i,height:a,bandCount:3,extent:o.A.fromJSON(e),spatialReference:r,pixelSize:s,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}let i={...e,query:{...this.ioConfig.customFetchParameters,f:"json"}},a=(0,K.Tw)(this.url,this.sourceJSON,i),r=t.hasMultidimensions?this.request(`${this.url}/slices`,i).then(e=>e.data?.slices).catch(()=>null):null,s=await Promise.all([a,r]);return this._slices=s[1],s[0]}_fixScaleInServiceInfo(){let{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){let{pixelSize:i}=e,a=.5/e.width*i.x,{lods:r}=t,s=t.lodAt(Math.max.apply(null,r.map(e=>e.level))),n=t.lodAt(Math.min.apply(null,r.map(e=>e.level))),{tileType:l}=this;if("Map"===l)return this._levelOffset=r[0].level,[s,n];if("Raster"===l)return[r.find(e=>e.resolution===i.x)??s,n];let{minScale:o,maxScale:f}=this.sourceJSON,u=s;f>0&&(u=r.find(e=>Math.abs(e.scale-f)<a),u||=r.filter(e=>e.scale>f).sort((e,t)=>e.scale>t.scale?1:-1)[0]??s);let h=n;return o>0&&(h=r.find(e=>Math.abs(e.scale-o)<a)??n,this._levelOffset=h.level-n.level),[u,h]}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],Y.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)()],Y.prototype,"tileType",void 0),Y=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.ImageServerRaster")],Y);const Q=Y;var ee=i(10713);const te=new Map([["byte","u8"],["signedbyte","s8"],["int8","s8"],["uint8","u8"],["int16","s16"],["uint16","u16"],["int32","s32"],["uint32","u32"],["float32","f32"],["float64","f64"],["double64","f64"]]),ie=new Map;ie.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),ie.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),ie.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),ie.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),ie.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let ae=class extends n.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this._isBsq=!1,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,a={}){let{blockWidth:r,blockHeight:s,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[e];if(!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i)return null;let{bandCount:o,pixelType:f}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:d}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(u.some(e=>e.from>e.to)){let e=new Uint8Array(r*s);return new c.A({width:r,height:s,pixels:void 0,mask:e,validPixelCount:0})}let{bandIds:p}=this.ioConfig,m=this._getBandSegmentCount(),g=[],y=0;for(y=0;y<m;y++)(!p||p.includes(y))&&g.push(this.request(this._files.data,{range:{from:u[y].from,to:u[y].to},responseType:"array-buffer",signal:a.signal}));let x=await Promise.all(g),w=x.map(e=>e.data.byteLength).reduce((e,t)=>e+t),I=new Uint8Array(w),b=[],v=0;for(y=0;y<m;y++)b.push(v),I.set(new Uint8Array(x[y].data),v),v+=x[y].data.byteLength;let C=ie.get(this.rasterInfo.storageInfo.compression).decoderFormat,S="jpg"===C&&4===o&&1===b.length,A=await this.decodePixelBlock(I.buffer,{width:r,height:s,format:C,planes:p?.length||o,offsets:b,pixelType:f,canvasUsage:S?"no-canvas":void 0,decodeJpegAsRgb:!1}).catch(()=>null);if(null==A)return null;let{noDataValue:T}=this.rasterInfo;if(null!=T&&"lerc"!==C&&!A.mask&&(T=T[0],null!=T)){let e=A.width*A.height,t=new Uint8Array(e);if(Math.abs(T)>1e24)for(y=0;y<e;y++)Math.abs((A.pixels[0][y]-T)/T)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)A.pixels[0][y]!==T&&(t[y]=1);A.mask=t}let _=0,R=0;if(h!==r||d!==s){let e=A.mask;if(e)for(y=0;y<s;y++)if(R=y*r,y<d)for(_=h;_<r;_++)e[R+_]=0;else for(_=0;_<r;_++)e[R+_]=0;else for(e=new Uint8Array(r*s),A.mask=e,y=0;y<d;y++)for(R=y*r,_=0;_<h;_++)e[R+_]=1}return A}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);let t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:a,files:r}=this._parseHeader(i.data),{skipMapInfo:s,skipExtensions:n=[]}=this.ioConfig;if(!n.includes("aux.xml")&&!s){let t=await this._fetchAuxiliaryData(e);null!=t&&(a.statistics=t.statistics??a.statistics,a.histograms=t.histograms,t.histograms&&null==a.statistics&&(a.statistics=(0,S.Pg)(t.histograms)))}s&&this.updateImageSpaceRasterInfo(a),this._set("rasterInfo",a),this._files=r;let l=await this.request(r.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw Error("invalid array buffer must be multiples of 16");let t;if(ee.Z){let i=new Uint8Array(e),a=new ArrayBuffer(e.byteLength),r=new Uint8Array(a);for(let t=0;t<e.byteLength/4;t++)for(let e=0;e<4;e++)r[4*t+e]=i[4*t+3-e];t=new Uint32Array(a)}else t=new Uint32Array(e);return t}(l.data);let{blockWidth:o,blockHeight:f}=this.rasterInfo.storageInfo,u=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:c}=this.rasterInfo,d=[],p=this._getBandSegmentCount(),m=0,g=-1;for(;m<this._storageIndex.length;){g++;let e=Math.ceil(h/o/u**g)-1,t=Math.ceil(c/f/u**g)-1;m+=(e+1)*(t+1)*p*4,d.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=d,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return this._isBsq?this.rasterInfo.bandCount:1}_getTileLocation(e,t,i){let a,r,s,{blockWidth:n,blockHeight:l,pyramidScalingFactor:o}=this.rasterInfo.storageInfo,{width:f,height:u}=this.rasterInfo,h=this._getBandSegmentCount(),c=0,d=0;for(s=0;s<e;s++)d=o**s,a=Math.ceil(f/n/d),r=Math.ceil(u/l/d),c+=a*r;d=o**e,a=Math.ceil(f/n/d),r=Math.ceil(u/l/d),c+=t*a+i,c*=4*h;let p=this._storageIndex.subarray(c,c+4*h),m=0,g=0,y=[];for(let e=0;e<h;e++)m=p[4*e]*2**32+p[4*e+1],g=m+p[4*e+2]*2**32+p[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<a-1?n:Math.ceil(f/d)-n*(a-1),actualTileHeight:t<r-1?l:Math.ceil(u/d)-l*(r-1)}}_parseHeader(e){let t=(0,B.V6)(e,"MRF_META/Raster");if(!t)throw new a.A("mrf:open","not a valid MRF format");let i=(0,B.V6)(t,"Size"),r=parseInt(i.getAttribute("x"),10),s=parseInt(i.getAttribute("y"),10),n=parseInt(i.getAttribute("c"),10),l=((0,B.mX)(t,"Compression")||"none").toLowerCase();if(!ie.has(l))throw new a.A("mrf:open","currently does not support compression "+l);let u=(0,B.mX)(t,"DataType")||"UInt8",h=te.get(u.toLowerCase());if(null==h)throw new a.A("mrf:open","currently does not support pixel type "+u);let c=(0,B.V6)(t,"PageSize"),d=parseInt(c.getAttribute("x"),10),p=parseInt(c.getAttribute("y"),10),m=c.getAttribute("c"),g=m?m===String(n):ie.get(l).isOneSegment;this._isBsq=!g;let y,x=(0,B.V6)(t,"DataValues");if(x){let e=x.getAttribute("NoData");null!=e&&(y=e.trim().split(" ").map(e=>parseFloat(e)))}if((0,B.V6)(e,"MRF_META/CachedSource"))throw new a.A("mrf:open","currently does not support MRF referencing other data files");let w,I=(0,B.V6)(e,"MRF_META/GeoTags"),b=(0,B.V6)(I,"BoundingBox"),v=!1;if(null!=b){let e=parseFloat(b.getAttribute("minx")),t=parseFloat(b.getAttribute("miny")),i=parseFloat(b.getAttribute("maxx")),a=parseFloat(b.getAttribute("maxy")),r=(0,B.mX)(I,"Projection")||"",s=f.A.WGS84;if("LOCAL_CS[]"!==r)if(r.toLowerCase().startsWith("epsg:")){let e=Number(r.slice(5));!isNaN(e)&&0!==e&&(s=new f.A({wkid:e}))}else s=N(r)??f.A.WGS84;else v=!0,s=new f.A({wkid:3857});w=new o.A(e,t,i,a),w.spatialReference=s}else v=!0,w=new o.A({xmin:-.5,ymin:.5-s,xmax:r-.5,ymax:.5,spatialReference:new f.A({wkid:3857})});let C=(0,B.V6)(e,"MRF_META/Rsets"),S=parseInt(C?.getAttribute("scale")||"2",10),A=w.spatialReference,_=new Z.A({origin:new W.A({x:w.xmin,y:w.ymax,spatialReference:A}),blockWidth:d,blockHeight:p,pyramidBlockWidth:d,pyramidBlockHeight:p,compression:l,pyramidScalingFactor:S}),R=new W.A({x:w.width/r,y:w.height/s,spatialReference:A}),M=new T.A({width:r,height:s,extent:w,isPseudoSpatialReference:v,spatialReference:A,bandCount:n,pixelType:h,pixelSize:R,noDataValue:y,storageInfo:_}),k=this._getAuxFullPath((0,B.mX)(t,"DataFile")),O=this._getAuxFullPath((0,B.mX)(t,"IndexFile"));return{rasterInfo:M,files:{mrf:this.url,index:O||this.url.replace(".mrf",".idx"),data:k||this.url.replace(".mrf",ie.get(l).blobExtension)}}}_getAuxFullPath(e){return!e||e.includes("\\")?null:e.includes("/")?e.startsWith(new URL(this.url).origin)?e:null:`${this.url.slice(0,this.url.lastIndexOf("/"))}/${e}`}async _fetchAuxiliaryData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return H(t)}catch{return null}}};(0,r.Cg)([(0,s.MZ)()],ae.prototype,"_files",void 0),(0,r.Cg)([(0,s.MZ)()],ae.prototype,"_storageIndex",void 0),(0,r.Cg)([(0,s.MZ)()],ae.prototype,"_isBsq",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],ae.prototype,"datasetFormat",void 0),ae=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.MRFRaster")],ae);const re=ae;i(44208);var se=i(53966),ne=i(9334);function le(e){let t=e.fields,i=e.records,a=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",r=[{name:a,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),s=r.map(e=>e.name),n=[],l=0,o=0;return i.forEach(e=>{let t={};for(t[a]=l++,o=1;o<s.length;o++)t[s[o]]=e[o-1];n.push({attributes:t})}),{displayFieldName:"",fields:r,features:n}}function oe(e){let t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};let a=t.getUint32(4,!0),r=t.getUint16(8,!0),s=t.getUint16(10,!0),n={version:i,recordCount:a,headerByteCount:r,recordByteCount:s},l=32,o=[],f=[];for(;13!==t.getUint8(l);){let i=String.fromCharCode(t.getUint8(l+11)).trim();o.push({name:(0,ne.w)(new Uint8Array(e,l,11)),type:i,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(i)],length:t.getUint8(l+16)}),l+=32}if(l+=1,o.length>0)for(;f.length<a&&e.byteLength-l>s;){let i=[];32===t.getUint8(l)?(l+=1,o.forEach(t=>{if("C"===t.type)i.push((0,ne.w)(new Uint8Array(e,l,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim()));else if("D"===t.type){let a=String.fromCharCode.apply(null,new Uint8Array(e,l,t.length)).trim();i.push(new Date(parseInt(a.slice(0,4),10),parseInt(a.slice(4,6),10)-1,parseInt(a.slice(6,8),10)))}l+=t.length}),f.push(i)):l+=s}return{header:n,fields:o,records:f,recordSet:le({fields:o,records:f})}}var fe=i(44094),ue=i(94213);const he="none-tiled tiff is not optimized for access, convert to COG and retry.";let ce=class extends n.A{constructor(){super(...arguments),this._bufferSize=1048576,this._chunkSize=10485760,this._fileSize=-1,this._headerChunks=[],this.datasetFormat="TIFF",this.headerInfo=null}async fetchRawTile(e,t,i,a={}){if(!this.headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;let r=await this._fetchRawTiffTile(e,t,i,!1,a);if(null!=r&&this.headerInfo.hasMaskBand){let s=await this._fetchRawTiffTile(e,t,i,!0,a);null!=s&&s.pixels[0]instanceof Uint8Array&&(r.mask=s.pixels[0])}return r}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf(".")),await this._readHeader(e?.signal),await this._fetchAllAuxData(),this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(this.rasterInfo),this.updateTileInfo()}async _readHeader(e){try{let t=await this._fetchHeaderData(0,this._bufferSize,e);if(!t)throw new a.A("tiffraster:open","failed to open url "+this.url);let{littleEndian:i,firstIFDPos:r,isBigTiff:s}=(0,fe.uT)(t),n=[],l={fileChunk:t,posIFD:r,fileOffset:0};await this._readIFDs(n,l,i,s?8:4,e);let{imageInfo:u,rasterInfo:h}=function(e){let t=(0,fe.uc)(e),{width:i,height:a,tileWidth:r,tileHeight:s,planes:n,pixelType:l,compression:u,firstPyramidLevel:h,maximumPyramidLevel:c,pyramidBlockWidth:d,pyramidBlockHeight:p,pyramidResolutions:m,tileBoundary:g,affine:y,metadata:x,colormap:w}=t,I=N(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),b=!!t.isPseudoGeographic;I??=(b=!0,new f.A({wkid:3857}));let v=new o.A({...t.extent,spatialReference:I}),C=v?new W.A({x:v.xmin,y:v.ymax,spatialReference:I}):new W.A({x:0,y:0}),S=new Z.A({blockWidth:r,blockHeight:s,pyramidBlockWidth:d,pyramidBlockHeight:p,compression:u,origin:C,firstPyramidLevel:h,maximumPyramidLevel:c,pyramidResolutions:m,blockBoundary:g}),A=new W.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/a,spatialReference:I}),_=x?{BandProperties:x.bandProperties,DataType:x.dataType}:{},R=new T.A({width:i,height:a,bandCount:n,pixelType:l,pixelSize:A,storageInfo:S,spatialReference:I,isPseudoSpatialReference:b,keyProperties:_,extent:v,colormap:w,statistics:x?x.statistics:null});if(y?.length&&(R.nativeExtent=new o.A({xmin:-.5,ymin:.5-a,xmax:i-.5,ymax:.5,spatialReference:I}),R.transform=new D.A({polynomialOrder:1,forwardCoefficients:[y[2]+y[0]/2,y[5]-y[3]/2,y[0],y[3],-y[1],-y[4]]}),R.extent=R.transform.forwardTransform(R.nativeExtent),R.pixelSize=new W.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/a,spatialReference:I}),S.origin.x=-.5,S.origin.y=.5),m){let{x:e,y:t}=R.pixelSize;m.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:R}}(n),c=(0,fe.zS)(n),d=(0,fe.r9)(n);this.headerInfo={littleEndian:i,isBigTiff:s,ifds:n,pyramidIFDs:c,maskIFDs:d,...u},this._set("rasterInfo",h),this._validateHeader()}finally{this._headerChunks.length=0}}_validateHeader(){let e=this.headerInfo;if(!e.isSupported)throw new a.A("tiffraster:open","this tiff is not supported: "+e.message);if(!e.tileWidth||!e.tileHeight)throw new a.A("tiffraster:open",he);this.rasterInfo.isPseudoSpatialReference&&se.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");let t=e.ifds[0],i=t.get("PREDICTOR")?.values?.[0];if(3===t.get("SAMPLEFORMAT")?.values?.[0]&&2===i)throw new a.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data")}async _fetchHeaderData(e,t,i){let r=this._getCachedHeaderData(e,t);if(r)return r;let s=Math.floor(e/this._bufferSize)*this._bufferSize,n=s+Math.max(1,Math.ceil((t-s)/this._bufferSize))*this._bufferSize,l=this._getMissingHeaderRanges(s,n).map(async e=>{let{from:t,to:a}=e,r=await this._fetchOffsets(t,a,i),s=this._fileSize;return{chunk:r,fileOffset:t,isEOF:s>0?t+r.byteLength>=s:r.byteLength<a-t+1}}),o=await Promise.all(l);this._headerChunks.push(...o),this._headerChunks.sort((e,t)=>e.fileOffset-t.fileOffset);let f=this._getCachedHeaderData(e,t);if(!f)throw new a.A("tiffraster:open",`failed to fetch byte range ${e}-${t} from ${this.url}`);return f}_getCachedHeaderData(e,t){let i=[],a=e;for(let{chunk:r,fileOffset:s,isEOF:n}of this._headerChunks){if(s+r.byteLength-1<a)continue;if(s>a)return null;let l=a-s,o=Math.min(t-s+1,r.byteLength);if(i.push({chunk:r,start:l,end:o}),a=s+o,a>t||n&&o===r.byteLength){let t=new Uint8Array(a-e),r=0;for(let e of i){let i=new Uint8Array(e.chunk,e.start,e.end-e.start);t.set(i,r),r+=i.byteLength}return t.buffer}}return null}_getMissingHeaderRanges(e,t){let i=[],a=(e,t)=>{let a=Math.floor(e/this._bufferSize)*this._bufferSize,r=Math.ceil(t/this._bufferSize)*this._bufferSize;i.push({from:a,to:r})},r=e;for(let{chunk:e,fileOffset:s,isEOF:n}of this._headerChunks){let l=s+e.byteLength-1;if(!(l<r)&&(s>r&&a(r,Math.min(s-1,t)),r=Math.max(r,l+1),r>t||n))return i}return r<=t&&a(r,t),i}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:s}=e;if(s+8>=i.byteLength||s<0){if(r=s+r,r<0)throw new a.A("tiffraster:open",`invalid IFD position ${r}. failed to open url ${this.url}`);i=await this._fetchHeaderData(r,r+this._bufferSize/2,t),s=0}return{fileChunk:i,fileOffset:r,posIFD:s}}async _readIFDs(e,t,i,r=4,s){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,s);let n=await this._readIFD(t,i,ue.NB,r,s);if(!n?.ifd)throw new a.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;t.posIFD=n.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,r,s)}async _readIFD(e,t,i=ue.NB,r=4,s){let{fileChunk:n,posIFD:l,fileOffset:o}=e;if(!e.fileChunk)return null;let f=(0,fe.JM)(n,t,l,o,i,r);if(f.success){let{ifd:e}=f;if(!e)throw new a.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(!(this.ioConfig.loadFullMetadata||i!==ue.NB||e.has("TILEWIDTH")&&e.has("TILELENGTH")))throw new a.A("tiffraster:open",he);let r=[];e.forEach(e=>{e.values||r.push(e)}),r.length>0&&await this._fillOffsets(r,t,f.nextIFD,s),(0,fe.fM)(e),(0,fe.h_)(e);for(let[i,a]of ue.RR){let r=e.get(i),f=null!=r?.data&&Array.from(r.data.values()).some(e=>null==e.values&&null!=e.offlineOffsetSize);if(r&&(!r.data||f)){l=r.valueOffset-o;let e=await this._validateOrFetchHeaderBuffer({fileChunk:n,posIFD:l,fileOffset:o},s);r.data=(await this._readIFD(e,t,a,4,s))?.ifd}}return f}return f.requiredBufferSize?(n=await this._fetchHeaderData(o,o+l+f.requiredBufferSize+8,s),n.byteLength<l+f.requiredBufferSize?null:(e.fileChunk=n,e.fileOffset=o,this._readIFD(e,t,i,r,s))):null}async _fillOffsets(e,t,i,a){let r=e.filter(e=>null!=e.offlineOffsetSize);if(0===r.length)return;let s=r.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,s.map(e=>e[0])),l=Math.max.apply(null,s.map(e=>e[0]+e[1])),o=1===s.length||l-n<=this._bufferSize;if(!o&&s.length>1&&(s.sort((e,t)=>e[0]-t[0]),o=s.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,s[0][0])===l),o){let e=Math.max(l,n+this._bufferSize/4),i=await this._fetchHeaderData(n,e,a);return void r.forEach(e=>(0,fe.Cr)(i,t,e,n))}let f=r.map(async e=>{let i=e.offlineOffsetSize,r=await this._fetchHeaderData(i[0],i[1]+i[0],a);(0,fe.Cr)(r,t,e,i[0])});await Promise.all(f)}async _fetchOffsets(e,t,i){let a=[],r=this._chunkSize;this._fileSize>0&&(t=Math.min(t,this._fileSize-1));let s=Math.ceil((t-e+1)/r),n=e;for(let e=0;e<s;e++)a.push(this.request(this.url,{range:{from:n,to:e===s-1?t:n+r-1},responseType:"array-buffer",signal:i})),n+=r;let l=await Promise.all(a);if(-1===this._fileSize&&206===l[0].httpStatus){let e=l[0].getHeader?.("Content-Range"),t=Number(e?.split("/")[1]);Number.isFinite(t)&&(this._fileSize=t)}if(1===l.length)return l[0].data;let o=l.reduce((e,t)=>e+t.data.byteLength,0),f=new Uint8Array(o),u=0;for(let e of l)f.set(new Uint8Array(e.data),u),u+=e.data.byteLength;return f.buffer}async _fetchRawTiffTile(e,t,i,a,r={}){let s=this._getTileLocation(e,t,i,a);if(!s)return null;let{ranges:n,actualTileWidth:l,actualTileHeight:o,ifd:f}=s,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:r.signal})),h=await Promise.all(u),c=h.map(e=>e.data.byteLength).reduce((e,t)=>e+t),d=1===h.length?h[0].data:new ArrayBuffer(c),p=[0],m=[0];if(h.length>1){let e=new Uint8Array(d);for(let t=0,i=0;t<h.length;t++){let a=h[t].data;e.set(new Uint8Array(a),i),p[t]=i,i+=a.byteLength,m[t]=a.byteLength}}let{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(d,{format:"tiff",customOptions:{headerInfo:this.headerInfo,ifd:f,offsets:p,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==x)return null;if(l!==g||o!==y){let e=x.mask;if(e)for(let t=0;t<y;t++){let i=t*g;if(t<o)for(let t=l;t<g;t++)e[i+t]=0;else for(let t=0;t<g;t++)e[i+t]=0}else{e=new Uint8Array(g*y),x.mask=e;for(let t=0;t<o;t++){let i=t*g;for(let t=0;t<l;t++)e[i+t]=1}}}return x}_getTileLocation(e,t,i,a=!1){let{firstPyramidLevel:r,blockBoundary:s}=this.rasterInfo.storageInfo,n=0===e?0:e-(r-1),{headerInfo:l}=this;if(!l)return null;let o=a?l.maskIFDs[n]:0===n?l.ifds[0]:l.pyramidIFDs[n-1];if(!o)return null;let f=(0,fe.XO)(o,l),u=(0,fe.wc)(o,"TILEOFFSETS"),h=(0,fe.wc)(o,"TILEBYTECOUNTS");if(!u?.length||!h?.length)return null;let{minRow:c,minCol:d,maxRow:p,maxCol:m}=s[n];if(t>p||i>m||t<c||i<d)return null;let g=(0,fe.LZ)(o,"IMAGEWIDTH"),y=(0,fe.LZ)(o,"IMAGELENGTH"),x=(0,fe.LZ)(o,"TILEWIDTH"),w=(0,fe.LZ)(o,"TILELENGTH"),I=[];if(f){let{bandCount:e}=this.rasterInfo;for(let a=0;a<e;a++){let e=a*(p+1)*(m+1)+t*(m+1)+i;I[a]={from:u[e],to:u[e]+h[e]-1}}}else{let e=t*(m+1)+i;I.push({from:u[e],to:u[e]+h[e]-1})}for(let e=0;e<I.length;e++)if(null==I[e].from||!I[e].to||I[e].to<0)return null;return{ranges:I,ifd:o,actualTileWidth:i===m&&g%x||x,actualTileHeight:t===p&&y%w||w}}async _fetchAllAuxData(e){if(this.ioConfig.skipMapInfo)return;let{rasterInfo:t}=this,{skipExtensions:i=[]}=this.ioConfig,a=i.includes("aux.xml")?Promise.resolve(null):this._fetchAuxiliaryMetaData(e),r=i.includes("vat.dbf")||1!==t.bandCount||"u8"!==t.pixelType?Promise.resolve(null):this._fetchAuxiliaryTable(e),[s,n]=await Promise.all([a,r]);null!=s&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,S.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;let i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new W.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(s,t),null!=n&&(t.attributeTable=n,t.keyProperties.DataType="thematic")}async _fetchAuxiliaryMetaData(e){try{let{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return H(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{let{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=oe(t);return i?.recordSet?M.A.fromJSON(i.recordSet):null}catch{return null}}};(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_bufferSize",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_chunkSize",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_fileSize",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"_headerChunks",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],ce.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,s.MZ)()],ce.prototype,"headerInfo",void 0),ce=(0,r.Cg)([(0,s.$K)("esri.layers.raster.datasets.TIFFRaster")],ce);const de=ce,pe=new Map;pe.set("MRF",{desc:"Meta Raster Format",constructor:re}),pe.set("TIFF",{desc:"GeoTIFF",constructor:de}),pe.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Q}),pe.set("JPG",{desc:"JPG Raster Format",constructor:G}),pe.set("PNG",{desc:"PNG Raster Format",constructor:G}),pe.set("GIF",{desc:"GIF Raster Format",constructor:G}),pe.set("BMP",{desc:"BMP Raster Format",constructor:G}),pe.set("CovJSON",{desc:"COVJSON Raster Format",constructor:O}),pe.set("MEMORY",{desc:"In Memory Raster Format",constructor:R});class me{static get supportedFormats(){let e=new Set;return pe.forEach((t,i)=>e.add(i)),e}static async open(e){let{url:t,ioConfig:i,source:r,sourceJSON:s}=e,n=e.datasetFormat??i?.datasetFormat;n??(t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===r?.type?.toLowerCase()?n="CovJSON":r?.extent&&r.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n||"DM"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");let l={url:t,source:r,sourceJSON:s,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(e=>{l[e]??delete l[e]}),n){if(!this.supportedFormats.has(n))throw new a.A("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new a.A("rasterfactory:open",`cannot open raster: ${t}`);let i=new(0,pe.get(n).constructor)(l);return i.rasterJobHandler=e.rasterJobHandler,i.rasterInfo=e.rasterInfo,await i.open({signal:e.signal}),i}let o=Array.from(pe.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e),f=0,u=()=>{if(n=o[f++],!n||"CRF"===n)return null;let t=new(0,pe.get(n).constructor)(l);return t.rasterJobHandler=e.rasterJobHandler,t.open({signal:e.signal}).then(()=>t).catch(()=>u())};return u()}static register(e,t,i){pe.has(e.toUpperCase())||pe.set(e.toUpperCase(),{desc:t,constructor:i})}}},10333(e,t,i){i.d(t,{A:()=>n});var a=i(32198),r=i(25482),s=i(91429);let n=class extends r.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,a.Cg)([(0,s.MZ)()],n.prototype,"affectsPixelSize",null),(0,a.Cg)([(0,s.MZ)({json:{write:!0}})],n.prototype,"spatialReference",void 0),n=(0,a.Cg)([(0,s.$K)("esri.layers.raster.transforms.BaseRasterTransform")],n)},75414(e,t,i){i.d(t,{A:()=>o});var a,r=i(32198),s=i(91429),n=i(10333),l=i(93223);let o=a=class extends n.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new a({tolerance:this.tolerance})}};(0,r.Cg)([(0,l.e)({GCSShiftXform:"gcs-shift"})],o.prototype,"type",void 0),(0,r.Cg)([(0,s.MZ)()],o.prototype,"tolerance",void 0),o=a=(0,r.Cg)([(0,s.$K)("esri.layers.raster.transforms.GCSShiftTransform")],o)},43163(e,t,i){i.d(t,{A:()=>p});var a,r=i(32198),s=i(91429),n=i(5443),l=i(86738),o=i(10333),f=i(36005),u=i(43937),h=i(93223);function c(e,t,i){let{x:a,y:r}=t;if(i<2)return{x:e[0]+a*e[2]+r*e[4],y:e[1]+a*e[3]+r*e[5]};if(2===i){let t=a*a,i=r*r,s=a*r;return{x:e[0]+a*e[2]+r*e[4]+t*e[6]+s*e[8]+i*e[10],y:e[1]+a*e[3]+r*e[5]+t*e[7]+s*e[9]+i*e[11]}}let s=a*a,n=r*r,l=a*r,o=s*a,f=s*r,u=a*n,h=r*n;return{x:e[0]+a*e[2]+r*e[4]+s*e[6]+l*e[8]+n*e[10]+o*e[12]+f*e[14]+u*e[16]+h*e[18],y:e[1]+a*e[3]+r*e[5]+s*e[7]+l*e[9]+n*e[11]+o*e[13]+f*e[15]+u*e[17]+h*e[19]}}function d(e,t,i){let{xmin:a,ymin:r,xmax:s,ymax:l,spatialReference:o}=t,f=[];if(i<2)f.push({x:a,y:l}),f.push({x:s,y:l}),f.push({x:a,y:r}),f.push({x:s,y:r});else{let e=10;for(let t=0;t<e;t++)f.push({x:a,y:r+(l-r)*t/(e-1)}),f.push({x:s,y:r+(l-r)*t/(e-1)});e=8;for(let t=1;t<=e;t++)f.push({x:a+(s-a)*t/e,y:r}),f.push({x:a+(s-a)*t/e,y:l})}f=f.map(t=>c(e,t,i));let u=f.map(e=>e.x),h=f.map(e=>e.y);return new n.A({xmin:Math.min.apply(null,u),xmax:Math.max.apply(null,u),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}let p=a=class extends o.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){let{coeffX:i,coeffY:a}=t;if(!i?.length||!a?.length||i.length!==a.length)return null;let r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(a[e]);return r}writeForwardCoefficients(e,t,i){let a=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?a.push(e[t]):r.push(e[t]);t.coeffX=a,t.coeffY=r}get inverseCoefficients(){let e=this._get("inverseCoefficients"),t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){let[t,i,a,r,s,n]=e,l=a*n-s*r,o=s*r-a*n;return[(s*i-t*n)/l,(a*i-t*r)/o,n/l,r/o,-s/l,-a/o]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){let{inverseCoeffX:i,inverseCoeffY:a}=t;if(!i?.length||!a?.length||i.length!==a.length)return null;let r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(a[e]);return r}writeInverseCoefficients(e,t,i){let a=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?a.push(e[t]):r.push(e[t]);t.inverseCoeffX=a,t.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){let t=c(this.forwardCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){let t=c(this.inverseCoefficients,e,this.polynomialOrder);return new l.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new a({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],p.prototype,"polynomialOrder",void 0),(0,r.Cg)([(0,s.MZ)()],p.prototype,"forwardCoefficients",void 0),(0,r.Cg)([(0,f.w)("forwardCoefficients",["coeffX","coeffY"])],p.prototype,"readForwardCoefficients",null),(0,r.Cg)([(0,u.K)("forwardCoefficients")],p.prototype,"writeForwardCoefficients",null),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],p.prototype,"inverseCoefficients",null),(0,r.Cg)([(0,f.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],p.prototype,"readInverseCoefficients",null),(0,r.Cg)([(0,u.K)("inverseCoefficients")],p.prototype,"writeInverseCoefficients",null),(0,r.Cg)([(0,s.MZ)()],p.prototype,"affectsPixelSize",null),(0,r.Cg)([(0,h.e)({PolynomialXform:"polynomial"})],p.prototype,"type",void 0),p=a=(0,r.Cg)([(0,s.$K)("esri.layers.raster.transforms.PolynomialTransform")],p)}}]);