@arcgis/core 4.24.0-next.20220510 → 4.24.0-next.20220511

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 (173) hide show
  1. package/analysis/Analysis.js +1 -1
  2. package/analysis/LengthDimension.js +1 -1
  3. package/analysis/dimensionUtils.js +5 -0
  4. package/arcade/Dictionary.js +1 -1
  5. package/arcade/Feature.js +1 -1
  6. package/arcade/arcade.js +1 -1
  7. package/arcade/arcadeAsyncRuntime.js +1 -1
  8. package/arcade/arcadeCompiler.js +1 -1
  9. package/arcade/credentials.js +1 -1
  10. package/arcade/featureSetCollection.js +1 -1
  11. package/arcade/featureSetUtils.js +1 -1
  12. package/arcade/featureset/actions/Adapted.js +1 -1
  13. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  14. package/arcade/featureset/actions/GroupBy.js +1 -1
  15. package/arcade/featureset/actions/OrderBy.js +1 -1
  16. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  17. package/arcade/featureset/actions/Top.js +1 -1
  18. package/arcade/featureset/sources/Empty.js +1 -1
  19. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  20. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  21. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  22. package/arcade/featureset/support/FeatureSet.js +1 -1
  23. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  24. package/arcade/featureset/support/shared.js +1 -1
  25. package/arcade/featureset/support/stats.js +1 -1
  26. package/arcade/functions/featuresetbase.js +1 -1
  27. package/arcade/functions/featuresetgeom.js +1 -1
  28. package/arcade/functions/featuresetstats.js +1 -1
  29. package/arcade/functions/featuresetstring.js +1 -1
  30. package/arcade/functions/geomasync.js +1 -1
  31. package/arcade/languageUtils.js +1 -1
  32. package/arcade/request.js +1 -1
  33. package/assets/esri/core/workers/RemoteClient.js +1 -1
  34. package/assets/esri/core/workers/chunks/0564f1cfa3d17ff1aad3.js +1 -0
  35. package/assets/esri/core/workers/chunks/{f168a33f2acc5eaf4fd8.js → 13387f56acbc3291561a.js} +1 -1
  36. package/assets/esri/core/workers/chunks/16c4e0a32d50d4db984d.js +1 -0
  37. package/assets/esri/core/workers/chunks/{076d1b1101b59af0d389.js → 1c010202b4c7e1d15f23.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{e0dac970b61cf357b0bc.js → 26827ec144676e6385f8.js} +1 -1
  39. package/assets/esri/core/workers/chunks/287c484fd40eee643f3a.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b85218d44c6094b7e5e6.js → 6d7e2a23a0a5dd9ded1d.js} +1 -1
  41. package/assets/esri/core/workers/chunks/70b6356357e7640c4e8b.js +1 -0
  42. package/assets/esri/core/workers/chunks/7e5c22b5a32ac74b1b6e.js +1 -0
  43. package/assets/esri/core/workers/chunks/8102bb78fe96e6197e4e.js +1 -0
  44. package/assets/esri/core/workers/chunks/{91a1b5d5bbecb86c96ac.js → 9d7533aaeac3b8d145c4.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{cc72586486eedc8a22f7.js → 9f4d892abf55e8625bc9.js} +3 -3
  46. package/assets/esri/core/workers/chunks/{5121be9d6ee259bb0145.js → a054a52712a118c6d505.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{59fa5ee098b6ab2975b6.js → a3bb600bfcb0282622f1.js} +1 -1
  48. package/assets/esri/core/workers/chunks/b28539c5a6bedb71b038.js +1 -0
  49. package/assets/esri/core/workers/chunks/c3e7290fb128d4fefd44.js +1 -0
  50. package/assets/esri/core/workers/chunks/c66ac36da6392b6bf331.js +1 -0
  51. package/assets/esri/core/workers/chunks/d16b328d32a6ddc2fdb9.js +1 -0
  52. package/assets/esri/core/workers/chunks/{c19864379c0934b53940.js → db937849b2c1af87b481.js} +1 -1
  53. package/assets/esri/core/workers/chunks/eb3855d3753d6b8334bd.js +1 -0
  54. package/assets/esri/core/workers/chunks/f435dc615fdc8917f6ca.js +1 -0
  55. package/assets/esri/core/workers/chunks/{af5132f1230b6424dafe.js → fc6beaf9466ea3898549.js} +1 -1
  56. package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -0
  57. package/assets/esri/themes/base/widgets/_Weather.scss +1 -2
  58. package/assets/esri/themes/dark/main.css +1 -1
  59. package/assets/esri/themes/light/main.css +1 -1
  60. package/assets/esri/themes/light/view.css +1 -1
  61. package/chunks/BlendLayers.glsl.js +6 -6
  62. package/chunks/arcade.js +1 -1
  63. package/chunks/array.js +1 -1
  64. package/chunks/languageUtils.js +1 -1
  65. package/core/sql/StandardizedFunctions.js +1 -1
  66. package/interfaces.d.ts +303 -24
  67. package/layers/VoxelLayer.js +1 -1
  68. package/layers/VoxelWasmPerSceneView.js +5 -0
  69. package/layers/support/VoxelFormat.d.ts +4 -0
  70. package/layers/support/VoxelStyle.d.ts +4 -0
  71. package/layers/support/VoxelVariable.d.ts +4 -0
  72. package/layers/support/VoxelVolume.d.ts +4 -0
  73. package/layers/support/VoxelVolumeStyle.d.ts +4 -0
  74. package/layers/support/arcgisLayerUrl.js +1 -1
  75. package/package.json +1 -1
  76. package/support/revision.js +1 -1
  77. package/symbols/Font.js +1 -1
  78. package/symbols/support/textUtils.js +1 -1
  79. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  80. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  81. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  82. package/views/2d/layers/StreamLayerView2D.js +1 -1
  83. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  84. package/views/2d/layers/features/Pipeline.js +1 -1
  85. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  86. package/views/2d/layers/features/sources/GeoEventSource.js +1 -1
  87. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  88. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  89. package/views/2d/navigation/actions/Pinch.js +1 -1
  90. package/views/3d/analysis/AnalysisView3D.js +1 -1
  91. package/views/3d/analysis/Dimensioning/DimensioningTool.js +1 -1
  92. package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
  93. package/views/3d/analysis/Dimensioning/settings.js +5 -0
  94. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  95. package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
  96. package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
  97. package/views/3d/layerViewModuleImportUtils.js +1 -1
  98. package/views/3d/layers/MediaLayerView3D.js +5 -0
  99. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  100. package/views/3d/layers/i3s/IDBCache.js +1 -1
  101. package/views/3d/state/controllers/RotateController.js +1 -1
  102. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  103. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  104. package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
  105. package/views/3d/terrain/TerrainRenderer.js +1 -1
  106. package/views/3d/terrain/TileCompositor.js +1 -1
  107. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  108. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  109. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  110. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  111. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  112. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  113. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  114. package/views/DOMContainer.js +1 -1
  115. package/views/GroundView.js +1 -1
  116. package/views/SceneView.js +1 -1
  117. package/views/ToolViewManager.js +1 -1
  118. package/views/View.js +1 -1
  119. package/views/draw/DrawOperation.js +1 -1
  120. package/views/draw/support/Reshape.js +1 -1
  121. package/views/interactive/GraphicManipulator.js +1 -1
  122. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  123. package/views/interactive/tooltip/DrawPointTooltipInfo.js +5 -0
  124. package/views/interactive/tooltip/DrawPolygonTooltipInfo.js +5 -0
  125. package/views/interactive/tooltip/DrawPolylineTooltipInfo.js +5 -0
  126. package/views/interactive/tooltip/Tooltip.js +1 -1
  127. package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
  128. package/views/interactive/tooltip/support/measurements.js +5 -0
  129. package/views/layers/GroupLayerView.js +1 -1
  130. package/views/support/Scheduler.js +1 -1
  131. package/webscene/Slide.js +1 -1
  132. package/widgets/Attribution/AttributionViewModel.js +1 -1
  133. package/widgets/Editor/EditorViewModel.js +1 -1
  134. package/widgets/Editor/UpdateWorkflow.js +1 -1
  135. package/widgets/Editor/workflowUtils.js +1 -1
  136. package/widgets/Editor.js +1 -1
  137. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  138. package/widgets/ElevationProfile.js +1 -1
  139. package/widgets/FeatureForm/InputFieldGroup.js +1 -1
  140. package/widgets/FeatureForm.js +1 -1
  141. package/widgets/FeatureTable/FieldColumn.js +1 -1
  142. package/widgets/FeatureTable/Grid/Column.js +1 -1
  143. package/widgets/FeatureTable/Grid/Grid.js +11 -11
  144. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  145. package/widgets/Legend/styles/Card.js +1 -1
  146. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  147. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  148. package/widgets/Measurement.js +1 -1
  149. package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
  150. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  151. package/widgets/Sketch/SketchViewModel.js +1 -1
  152. package/widgets/Sketch.js +1 -1
  153. package/widgets/Weather/LabeledSlider.js +1 -1
  154. package/widgets/Weather/VisibleElements.js +5 -0
  155. package/widgets/Weather/css.js +1 -1
  156. package/widgets/Weather.js +1 -1
  157. package/widgets/support/AnalysisViewModel.js +1 -1
  158. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  159. package/assets/esri/core/workers/chunks/0018053ac16a09feba70.js +0 -1
  160. package/assets/esri/core/workers/chunks/042938ca73f0b9e5a7e2.js +0 -1
  161. package/assets/esri/core/workers/chunks/13b04d5bf348ab5054c2.js +0 -1
  162. package/assets/esri/core/workers/chunks/39b439cee9acabc5b749.js +0 -1
  163. package/assets/esri/core/workers/chunks/5464f6f2b9eb08b4214c.js +0 -1
  164. package/assets/esri/core/workers/chunks/6f25f3334ccbfce841f3.js +0 -1
  165. package/assets/esri/core/workers/chunks/84e8cb6f694ac7d4a476.js +0 -1
  166. package/assets/esri/core/workers/chunks/88193e61072d7bf957f5.js +0 -1
  167. package/assets/esri/core/workers/chunks/9c6be39f1f21ab8b1c2d.js +0 -1
  168. package/assets/esri/core/workers/chunks/d076cfbfbb8cc2e23a92.js +0 -1
  169. package/assets/esri/core/workers/chunks/d85b5b73a151c6fbb658.js +0 -1
  170. package/assets/esri/core/workers/chunks/e2ca546b42239a13bc9b.js +0 -1
  171. package/assets/esri/core/workers/chunks/ec6d138e8183e193f977.js +0 -1
  172. package/layers/VoxelWasmManager.js +0 -5
  173. package/layers/VoxelWasmPerScene.js +0 -5
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6748,3172],{66748:(e,t,n)=>{n.r(t),n.d(t,{registerFunctions:()=>k});var r=n(40330),o=n(77286),s=n(61363),i=n(71201),a=n(95330),l=n(6570),u=n(9361),c=n(8667),f=n(65091),h=n(13473),d=n(38913),m=n(58901),g=n(33955),p=n(67900);function w(e){return 0===r.i8.indexOf("4.")?d.Z.fromExtent(e):new d.Z({spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]})}function y(e){if((0,s.p)(e,2,2),e[0]instanceof u.Z&&e[1]instanceof u.Z);else if(e[0]instanceof u.Z&&null===e[1]);else if(e[1]instanceof u.Z&&null===e[0]);else if(null!==e[0]||null!==e[1])throw new Error("Illegal Argument")}function b(e,t){if("polygon"!==e.type&&"polyline"!==e.type&&"extent"!==e.type)return(0,a.DB)(0);let n=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(n=(0,i._R)(e.spatialReference)/(0,p.c9)(e.spatialReference));let r=0;if("polyline"===e.type)for(const t of e.paths)for(let e=1;e<t.length;e++)r+=(0,i.AW)(t[e],t[e-1],n);else if("polygon"===e.type)for(const t of e.rings){for(let e=1;e<t.length;e++)r+=(0,i.AW)(t[e],t[e-1],n);(t[0][0]!==t[t.length-1][0]||t[0][1]!==t[t.length-1][1]||void 0!==t[0][2]&&t[0][2]!==t[t.length-1][2])&&(r+=(0,i.AW)(t[0],t[t.length-1],n))}else"extent"===e.type&&(r+=2*(0,i.AW)([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],n),r+=2*(0,i.AW)([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],n),r*=2,r+=4*Math.abs((0,s.C)(e.zmax,0)*n-(0,s.C)(e.zmin,0)*n));const o=new m.Z({hasZ:!1,hasM:!1,spatialReference:e.spatialReference,paths:[[0,0],[0,r]]});return(0,c.sz)(o,t)}function k(e){"async"===e.mode&&(e.functions.disjoint=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null===n[0]||null===n[1]||(0,c.ED)(n[0],n[1])}))},e.functions.intersects=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null!==n[0]&&null!==n[1]&&(0,c.kK)(n[0],n[1])}))},e.functions.touches=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null!==n[0]&&null!==n[1]&&(0,c.W4)(n[0],n[1])}))},e.functions.crosses=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null!==n[0]&&null!==n[1]&&(0,c.jU)(n[0],n[1])}))},e.functions.within=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null!==n[0]&&null!==n[1]&&(0,c.uh)(n[0],n[1])}))},e.functions.contains=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null!==n[0]&&null!==n[1]&&(0,c.r3)(n[0],n[1])}))},e.functions.overlaps=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null!==n[0]&&null!==n[1]&&(0,c.Nm)(n[0],n[1])}))},e.functions.equals=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return(0,s.p)(n,2,2),n[0]===n[1]||(n[0]instanceof u.Z&&n[1]instanceof u.Z?(0,c.fS)(n[0],n[1]):!(!(0,s.o)(n[0])||!(0,s.o)(n[1]))&&n[0].getTime()===n[1].getTime())}))},e.functions.relate=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,3,3),n[0]instanceof u.Z&&n[1]instanceof u.Z)return(0,c.LV)(n[0],n[1],(0,s.d)(n[2]));if(n[0]instanceof u.Z&&null===n[1])return!1;if(n[1]instanceof u.Z&&null===n[0])return!1;if(null===n[0]&&null===n[1])return!1;throw new Error("Illegal Argument")}))},e.functions.intersection=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null===n[0]||null===n[1]?null:(0,c.wf)(n[0],n[1])}))},e.functions.union=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){const i=[];if(0===(r=(0,s.H)(r)).length)throw new Error("Function called with wrong number of Parameters");if(1===r.length)if((0,s.a)(r[0])){const e=(0,s.H)(r[0]);for(let t=0;t<e.length;t++)if(null!==e[t]){if(!(e[t]instanceof u.Z))throw new Error("Illegal Argument");i.push(e[t])}}else{if(!(0,s.b)(r[0])){if(r[0]instanceof u.Z)return(0,s.s)((0,o.r1)(r[0]),t.spatialReference);if(null===r[0])return null;throw new Error("Illegal Argument")}{const e=(0,s.H)(r[0].toArray());for(let t=0;t<e.length;t++)if(null!==e[t]){if(!(e[t]instanceof u.Z))throw new Error("Illegal Argument");i.push(e[t])}}}else for(let e=0;e<r.length;e++)if(null!==r[e]){if(!(r[e]instanceof u.Z))throw new Error("Illegal Argument");i.push(r[e])}return 0===i.length?null:(0,c.G0)(i)}))},e.functions.difference=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null!==n[0]&&null===n[1]?(0,o.r1)(n[0]):null===n[0]?null:(0,c.e5)(n[0],n[1])}))},e.functions.symmetricdifference=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){return y(n=(0,s.H)(n)),null===n[0]&&null===n[1]?null:null===n[0]?(0,o.r1)(n[1]):null===n[1]?(0,o.r1)(n[0]):(0,c.Sp)(n[0],n[1])}))},e.functions.clip=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,2,2),!(n[1]instanceof l.Z)&&null!==n[1])throw new Error("Illegal Argument");if(null===n[0])return null;if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");return null===n[1]?null:(0,c.oq)(n[0],n[1])}))},e.functions.cut=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,2,2),!(n[1]instanceof m.Z)&&null!==n[1])throw new Error("Illegal Argument");if(null===n[0])return[];if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");return null===n[1]?[(0,o.r1)(n[0])]:(0,c.z7)(n[0],n[1])}))},e.functions.area=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){if((0,s.p)(r,1,2),null===(r=(0,s.H)(r))[0])return 0;if((0,s.q)(r[0]))return r[0].sumArea((0,o.EI)((0,s.C)(r[1],-1)),!1,t.abortSignal).then((e=>{if(t.abortSignal.aborted)throw new Error("Operation has been cancelled.");return e}));if((0,s.a)(r[0])||(0,s.b)(r[0])){const e=(0,s.K)(r[0],t.spatialReference);return null===e?0:(0,c.CJ)(e,(0,o.EI)((0,s.C)(r[1],-1)))}if(!(r[0]instanceof u.Z))throw new Error("Illegal Argument");return(0,c.CJ)(r[0],(0,o.EI)((0,s.C)(r[1],-1)))}))},e.functions.areageodetic=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){if((0,s.p)(r,1,2),null===(r=(0,s.H)(r))[0])return 0;if((0,s.q)(r[0]))return r[0].sumArea((0,o.EI)((0,s.C)(r[1],-1)),!0,t.abortSignal).then((e=>{if(t.abortSignal.aborted)throw new Error("Operation has been cancelled.");return e}));if((0,s.a)(r[0])||(0,s.b)(r[0])){const e=(0,s.K)(r[0],t.spatialReference);return null===e?0:(0,c.Y4)(e,(0,o.EI)((0,s.C)(r[1],-1)))}if(!(r[0]instanceof u.Z))throw new Error("Illegal Argument");return(0,c.Y4)(r[0],(0,o.EI)((0,s.C)(r[1],-1)))}))},e.functions.length=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){if((0,s.p)(r,1,2),null===(r=(0,s.H)(r))[0])return 0;if((0,s.q)(r[0]))return r[0].sumLength((0,o.Lz)((0,s.C)(r[1],-1)),!1,t.abortSignal).then((e=>{if(t.abortSignal.aborted)throw new Error("Operation has been cancelled.");return e}));if((0,s.a)(r[0])||(0,s.b)(r[0])){const e=(0,s.J)(r[0],t.spatialReference);return null===e?0:(0,c.sz)(e,(0,o.Lz)((0,s.C)(r[1],-1)))}if(!(r[0]instanceof u.Z))throw new Error("Illegal Argument");return(0,c.sz)(r[0],(0,o.Lz)((0,s.C)(r[1],-1)))}))},e.functions.length3d=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){if((0,s.p)(r,1,2),null===(r=(0,s.H)(r))[0])return 0;if((0,s.a)(r[0])||(0,s.b)(r[0])){const e=(0,s.J)(r[0],t.spatialReference);return null===e?0:!0===e.hasZ?b(e,(0,o.Lz)((0,s.C)(r[1],-1))):(0,c.sz)(e,(0,o.Lz)((0,s.C)(r[1],-1)))}if(!(r[0]instanceof u.Z))throw new Error("Illegal Argument");return!0===r[0].hasZ?b(r[0],(0,o.Lz)((0,s.C)(r[1],-1))):(0,c.sz)(r[0],(0,o.Lz)((0,s.C)(r[1],-1)))}))},e.functions.lengthgeodetic=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){if((0,s.p)(r,1,2),null===(r=(0,s.H)(r))[0])return 0;if((0,s.q)(r[0]))return r[0].sumLength((0,o.Lz)((0,s.C)(r[1],-1)),!0,t.abortSignal).then((e=>{if(t.abortSignal.aborted)throw new Error("Operation has been cancelled.");return e}));if((0,s.a)(r[0])||(0,s.b)(r[0])){const e=(0,s.J)(r[0],t.spatialReference);return null===e?0:(0,c.kQ)(e,(0,o.Lz)((0,s.C)(r[1],-1)))}if(!(r[0]instanceof u.Z))throw new Error("Illegal Argument");return(0,c.kQ)(r[0],(0,o.Lz)((0,s.C)(r[1],-1)))}))},e.functions.distance=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){r=(0,s.H)(r),(0,s.p)(r,2,3);let i=r[0];((0,s.a)(r[0])||(0,s.b)(r[0]))&&(i=(0,s.L)(r[0],t.spatialReference));let a=r[1];if(((0,s.a)(r[1])||(0,s.b)(r[1]))&&(a=(0,s.L)(r[1],t.spatialReference)),!(i instanceof u.Z))throw new Error("Illegal Argument");if(!(a instanceof u.Z))throw new Error("Illegal Argument");return(0,c.TE)(i,a,(0,o.Lz)((0,s.C)(r[2],-1)))}))},e.functions.distancegeodetic=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){n=(0,s.H)(n),(0,s.p)(n,2,3);const r=n[0],i=n[1];if(!(r instanceof h.Z))throw new Error("Illegal Argument");if(!(i instanceof h.Z))throw new Error("Illegal Argument");const a=new m.Z({paths:[],spatialReference:r.spatialReference});return a.addPath([r,i]),(0,c.kQ)(a,(0,o.Lz)((0,s.C)(n[2],-1)))}))},e.functions.densify=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,2,3),null===n[0])return null;if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");const r=(0,s.t)(n[1]);if(isNaN(r))throw new Error("Illegal Argument");if(r<=0)throw new Error("Illegal Argument");return n[0]instanceof d.Z||n[0]instanceof m.Z?(0,c.Cz)(n[0],r,(0,o.Lz)((0,s.C)(n[2],-1))):n[0]instanceof l.Z?(0,c.Cz)(w(n[0]),r,(0,o.Lz)((0,s.C)(n[2],-1))):n[0]}))},e.functions.densifygeodetic=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,2,3),null===n[0])return null;if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");const r=(0,s.t)(n[1]);if(isNaN(r))throw new Error("Illegal Argument");if(r<=0)throw new Error("Illegal Argument");return n[0]instanceof d.Z||n[0]instanceof m.Z?(0,c.j2)(n[0],r,(0,o.Lz)((0,s.C)(n[2],-1))):n[0]instanceof l.Z?(0,c.j2)(w(n[0]),r,(0,o.Lz)((0,s.C)(n[2],-1))):n[0]}))},e.functions.generalize=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,2,4),null===n[0])return null;if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");const r=(0,s.t)(n[1]);if(isNaN(r))throw new Error("Illegal Argument");return(0,c.D$)(n[0],r,(0,s.z)((0,s.C)(n[2],!0)),(0,o.Lz)((0,s.C)(n[3],-1)))}))},e.functions.buffer=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,2,3),null===n[0])return null;if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");const r=(0,s.t)(n[1]);if(isNaN(r))throw new Error("Illegal Argument");return 0===r?(0,o.r1)(n[0]):(0,c.f3)(n[0],r,(0,o.Lz)((0,s.C)(n[2],-1)))}))},e.functions.buffergeodetic=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,2,3),null===n[0])return null;if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");const r=(0,s.t)(n[1]);if(isNaN(r))throw new Error("Illegal Argument");return 0===r?(0,o.r1)(n[0]):(0,c.rd)(n[0],r,(0,o.Lz)((0,s.C)(n[2],-1)))}))},e.functions.offset=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,2,6),null===n[0])return null;if(!(n[0]instanceof d.Z||n[0]instanceof m.Z))throw new Error("Illegal Argument");const r=(0,s.t)(n[1]);if(isNaN(r))throw new Error("Illegal Argument");const i=(0,s.t)((0,s.C)(n[4],10));if(isNaN(i))throw new Error("Illegal Argument");const a=(0,s.t)((0,s.C)(n[5],0));if(isNaN(a))throw new Error("Illegal Argument");return(0,c.cv)(n[0],r,(0,o.Lz)((0,s.C)(n[2],-1)),(0,s.d)((0,s.C)(n[3],"round")).toLowerCase(),i,a)}))},e.functions.rotate=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){n=(0,s.H)(n),(0,s.p)(n,2,3);let r=n[0];if(null===r)return null;if(!(r instanceof u.Z))throw new Error("Illegal Argument");r instanceof l.Z&&(r=d.Z.fromExtent(r));const o=(0,s.t)(n[1]);if(isNaN(o))throw new Error("Illegal Argument");const i=(0,s.C)(n[2],null);if(null===i)return(0,c.U1)(r,o);if(i instanceof h.Z)return(0,c.U1)(r,o,i);throw new Error("Illegal Argument")}))},e.functions.centroid=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){if(r=(0,s.H)(r),(0,s.p)(r,1,1),null===r[0])return null;let a=r[0];if(((0,s.a)(r[0])||(0,s.b)(r[0]))&&(a=(0,s.L)(r[0],t.spatialReference)),null===a)return null;if(!(a instanceof u.Z))throw new Error("Illegal Argument");return a instanceof h.Z?(0,s.s)((0,o.r1)(r[0]),t.spatialReference):a instanceof d.Z?a.centroid:a instanceof m.Z?(0,i.s9)(a):a instanceof f.Z?(0,i.Ay)(a):a instanceof l.Z?a.center:null}))},e.functions.multiparttosinglepart=function(t,n){return e.standardFunctionAsync(t,n,(function(e,n,r){r=(0,s.H)(r),(0,s.p)(r,1,1);const i=[];if(null===r[0])return null;if(!(r[0]instanceof u.Z))throw new Error("Illegal Argument");return r[0]instanceof h.Z||r[0]instanceof l.Z?[(0,s.s)((0,o.r1)(r[0]),t.spatialReference)]:(0,c.og)(r[0]).then((e=>{if(e instanceof d.Z){const t=[],n=[];for(let r=0;r<e.rings.length;r++)if(e.isClockwise(e.rings[r])){const n=(0,g.im)({rings:[e.rings[r]],hasZ:!0===e.hasZ,hazM:!0===e.hasM,spatialReference:e.spatialReference.toJSON()});t.push(n)}else n.push({ring:e.rings[r],pt:e.getPoint(r,0)});for(let e=0;e<n.length;e++)for(let r=0;r<t.length;r++)if(t[r].contains(n[e].pt)){t[r].addRing(n[e].ring);break}return t}if(e instanceof m.Z){const t=[];for(let n=0;n<e.paths.length;n++){const r=(0,g.im)({paths:[e.paths[n]],hasZ:!0===e.hasZ,hazM:!0===e.hasM,spatialReference:e.spatialReference.toJSON()});t.push(r)}return t}if(r[0]instanceof f.Z){const e=(0,s.s)((0,o.r1)(r[0]),t.spatialReference);for(let t=0;t<e.points.length;t++)i.push(e.getPoint(t));return i}return null}))}))},e.functions.issimple=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,1,1),null===n[0])return!0;if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");return(0,c.Gg)(n[0])}))},e.functions.simplify=function(t,n){return e.standardFunctionAsync(t,n,(function(e,t,n){if(n=(0,s.H)(n),(0,s.p)(n,1,1),null===n[0])return null;if(!(n[0]instanceof u.Z))throw new Error("Illegal Argument");return(0,c.og)(n[0])}))})}},99880:(e,t,n)=>{n.d(t,{V:()=>l});var r=n(68773),o=(n(3172),n(20102)),s=n(92604),i=n(17452);const a=s.Z.getLogger("esri.assets");function l(e){if(!r.Z.assetsPath)throw a.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new o.Z("assets:path-not-set","config.assetsPath is not set");return(0,i.v_)(r.Z.assetsPath,e)}},64830:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(70586);class o{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(0===this._items.size)return;let e;for(e of this._items);return e}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,r.j0)(e)),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete((0,r.j0)(e)),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}},80903:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(50758),o=n(92604),s=n(95330),i=n(64830),a=n(25045);const l=o.Z.getLogger("esri.core.workers.Connection");class u{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new i.Z}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((n,r)=>{let o=!0;const i=e=>{(0,s.k_)(t.signal),o&&(o=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let o=0;o<e.length;++o){const l=e[o];(0,s.y8)(l)?this._clientPromises[o]=l.then((e=>(this._clients[o]=new a.default(e,t,(()=>this._ongoingJobsQueue.pop())),i(n),this._clients[o])),(()=>(i(r),null))):(this._clients[o]=new a.default(l,t,(()=>this._ongoingJobsQueue.pop())),this._clientPromises[o]=Promise.resolve(this._clients[o]),i(n))}}))}broadcast(e,t,n){const r=new Array(this._clientPromises.length);for(let o=0;o<this._clientPromises.length;++o){const s=this._clientPromises[o];r[o]=s.then((r=>r.invoke(e,t,n)))}return r}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.deferred.reject((0,s.zE)(`Worker closing, aborting job calling '${e.methodName}'`));for(const e of this._clientPromises)e.then((e=>e.close()));this._clients.length=0,this._clientPromises.length=0}invoke(e,t,n){let r=null;Array.isArray(n)?(l.warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:n}):r=n;const o=(0,s.dD)();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:r,deferred:o});for(let e=0;e<this._clientPromises.length;e++){const t=this._clients[e];t?t.jobAdded():this._clientPromises[e].then((e=>e.jobAdded()))}return o.promise}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,r.AL)(this._clients.map((n=>n.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let n=t.length;for(let r=0;r<this._clientPromises.length;++r)this._clientPromises[r].then((o=>{t[r]=o.openPort(),0==--n&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},78346:(e,t,n)=>{n.d(t,{bA:()=>F});var r=n(20102),o=n(80442),s=n(95330),i=n(80903),a=n(25045),l=n(40330),u=n(92604),c=n(70586),f=n(94362),h=n(99880),d=n(68773),m=(n(2587),n(17452));const g={};function p(e){const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=g.baseUrl),g.packages?.forEach((e=>{!function(e,t){for(const n of e)if(n.name===t.name)return;e.push(t)}(t.packages,e)})),t}var w=n(41213);class y{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...n)=>e[t](...n)}))}}class b{constructor(){this._dispatcher=new y,this._workerPostMessage({type:f.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,w.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,n){this._dispatcher.addEventListener(e,t,n)}removeEventListener(e,t,n){this._dispatcher.removeEventListener(e,t,n)}_workerPostMessage(e){(0,w.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,f.QM)(e);if(t&&t.type===f.Cs.OPEN){const{modulePath:e,jobId:n}=t;let r=await a.default.loadWorker(e);r||(r=await import(e));const o=a.default.connect(r);this._workerPostMessage({type:f.Cs.OPENED,jobId:n,data:o})}}}var k=n(70171),E=n(17202);const v=u.Z.getLogger("esri.core.workers"),{HANDSHAKE:A}=f.Cs;let _,Z;const L="Failed to create Worker. Fallback to execute module in main thread";async function C(e){return new Promise((t=>{function n(o){const s=(0,f.QM)(o);s&&s.type===A&&(e.removeEventListener("message",n),e.removeEventListener("error",r),t(e))}function r(t){t.preventDefault(),e.removeEventListener("message",n),e.removeEventListener("error",r),v.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new b).addEventListener("message",n),e.addEventListener("error",r)}e.addEventListener("message",n),e.addEventListener("error",r)}))}let S=0;const I=u.Z.getLogger("esri.core.workers"),{ABORT:P,INVOKE:O,OPEN:T,OPENED:D,RESPONSE:N}=f.Cs;class R{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),I.error(e)}))}static async create(e){const t=await async function(){if(!(0,o.Z)("esri-workers")||((0,o.Z)("mozilla"),0))return C(new b);if(!_&&!Z)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=d.Z.default){const t={...d.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(d.Z));e.assetsPath=(0,m.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,k.Kd)(),e.has={"esri-csp-restrictions":(0,o.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,o.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,o.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,o.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,o.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,o.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,o.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,o.Z)("esri-atomics"),"esri-shared-array-buffer":(0,o.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,o.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,o.Z)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,o.Z)("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,m.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,m.hF)(e.workers.workerPath):e.workers.workerPath=(0,m.hF)((0,h.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=d.Z.workers.loaderConfig,n=p({baseUrl:t?.baseUrl,locale:(0,k.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t?.has},map:{...t?.map},paths:{...t?.paths},packages:t?.packages||[]}),r={version:l.i8,buildDate:E.r,revision:E.$};return JSON.stringify({esriConfig:e,loaderConfig:n,kernelInfo:r})}()}'`);_=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){Z=e||{}}let e;if(_)try{e=new Worker(_,{name:"esri-worker-"+S++})}catch(t){v.warn(L,Z),e=new b}else v.warn(L,Z),e=new b;return C(e)}();return new R(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:n}=t,r=(0,f.jt)();return new Promise(((t,o)=>{const i={resolve:t,reject:o,abortHandle:(0,s.$F)(n,(()=>{this._outJobs.delete(r),this._post({type:P,jobId:r})}))};this._outJobs.set(r,i),this._post({type:T,jobId:r,modulePath:e})}))}_onMessage(e){const t=(0,f.QM)(e);if(t)switch(t.type){case D:this._onOpenedMessage(t);break;case N:this._onResponseMessage(t);break;case P:this._onAbortMessage(t);break;case O:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,n=e.jobId,r=t.get(n);r&&(r.controller&&r.controller.abort(),t.delete(n))}_onInvokeMessage(e){const{methodName:t,jobId:n,data:r,abortable:o}=e,i=o?new AbortController:null,a=this._inJobs,u=l.Nv[t];let c;try{if("function"!=typeof u)throw new TypeError(`${t} is not a function`);c=u.call(null,r,{signal:i?i.signal:null})}catch(e){return void this._post({type:N,jobId:n,error:(0,f.AB)(e)})}(0,s.y8)(c)?(a.set(n,{controller:i,promise:c}),c.then((e=>{a.has(n)&&(a.delete(n),this._post({type:N,jobId:n},e))}),(e=>{a.has(n)&&(a.delete(n),e||(e={message:"Error encountered at method"+t}),(0,s.D_)(e)||this._post({type:N,jobId:n,error:(0,f.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:N,jobId:n},c)}_onOpenedMessage(e){const{jobId:t,data:n}=e,r=this._outJobs.get(t);r&&(this._outJobs.delete(t),(0,c.hw)(r.abortHandle),r.resolve(n))}_onResponseMessage(e){const{jobId:t,error:n,data:o}=e,s=this._outJobs.get(t);s&&(this._outJobs.delete(t),(0,c.hw)(s.abortHandle),n?s.reject(r.Z.fromJSON(JSON.parse(n))):s.resolve(o))}_post(e,t,n){return(0,f.oi)(this.worker,e,t,n)}}let H=(0,o.Z)("esri-workers-debug")?1:(0,o.Z)("host-browser")?navigator.hardwareConcurrency-1:0;H||(H=(0,o.Z)("safari")&&(0,o.Z)("mac")||(0,o.Z)("trident")?7:2);let q=0;const x=[];async function M(e,t){const n=new i.Z;return await n.open(e,t),n}async function F(e,t={}){if("string"!=typeof e)throw new r.Z("workers:undefined-module","modulePath is missing");let n=t.strategy||"distributed";if((0,o.Z)("host-webworker")&&!(0,o.Z)("esri-workers")&&(n="local"),"local"===n){let n=await a.default.loadWorker(e);n||(n=await import(e)),(0,s.k_)(t.signal);const r=t.client||n;return M([a.default.connect(n)],{...t,client:r})}if(await async function(){if(z)return z;j=new AbortController;const e=[];for(let t=0;t<H;t++){const n=R.create(t).then((e=>(x[t]=e,e)));e.push(n)}return z=Promise.all(e),z}(),(0,s.k_)(t.signal),"dedicated"===n){const n=q++%H;return M([await x[n].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const n=Math.min(t.maxNumWorkers,H);if(n<H){const r=new Array(n);for(let o=0;o<n;++o){const n=q++%H;r[o]=x[n].open(e,t)}return M(r,t)}}return M(x.map((n=>n.open(e,t))),t)}let j,z=null},8667:(e,t,n)=>{n.d(t,{CJ:()=>R,Cz:()=>D,D$:()=>T,ED:()=>b,G0:()=>C,Gg:()=>v,LV:()=>E,Nm:()=>k,Sp:()=>Z,TE:()=>m,U1:()=>O,W4:()=>w,Y4:()=>q,cv:()=>S,e5:()=>_,f3:()=>I,fS:()=>g,j2:()=>N,jU:()=>d,kK:()=>p,kQ:()=>x,og:()=>A,oq:()=>c,r3:()=>h,rd:()=>P,sz:()=>H,uh:()=>y,wf:()=>L,z7:()=>f}),n(66577);var r=n(78346),o=(n(13473),n(33955));function s(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function i(e){return e?Array.isArray(e)?e.map(i):e.toJSON?e.toJSON():e:e}function a(e){return Array.isArray(e)?e.map((e=>(0,o.im)(e))):(0,o.im)(e)}let l;async function u(e,t){return(await async function(){return l||(l=(0,r.bA)("geometryEngineWorker",{strategy:"distributed"})),l}()).invoke("executeGEOperation",{operation:e,parameters:i(t)})}async function c(e,t){return a(await u("clip",[s(e),e,t]))}async function f(e,t){return a(await u("cut",[s(e),e,t]))}function h(e,t){return u("contains",[s(e),e,t])}function d(e,t){return u("crosses",[s(e),e,t])}function m(e,t,n){return u("distance",[s(e),e,t,n])}function g(e,t){return u("equals",[s(e),e,t])}function p(e,t){return u("intersects",[s(e),e,t])}function w(e,t){return u("touches",[s(e),e,t])}function y(e,t){return u("within",[s(e),e,t])}function b(e,t){return u("disjoint",[s(e),e,t])}function k(e,t){return u("overlaps",[s(e),e,t])}function E(e,t,n){return u("relate",[s(e),e,t,n])}function v(e){return u("isSimple",[s(e),e])}async function A(e){return a(await u("simplify",[s(e),e]))}async function _(e,t){return a(await u("difference",[s(e),e,t]))}async function Z(e,t){return a(await u("symmetricDifference",[s(e),e,t]))}async function L(e,t){return a(await u("intersect",[s(e),e,t]))}async function C(e,t=null){const n=function(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),null!=t&&n.push(t)),n}(e,t);return a(await u("union",[s(n),n]))}async function S(e,t,n,r,o,i){return a(await u("offset",[s(e),e,t,n,r,o,i]))}async function I(e,t,n,r=!1){const o=[s(e),e,t,n,r];return a(await u("buffer",o))}async function P(e,t,n,r,o,i){const l=[s(e),e,t,n,r,o,i];return a(await u("geodesicBuffer",l))}async function O(e,t,n){if(null==e)throw new Error("Illegal Argument Exception");const r=e.spatialReference;n=n??function(e){return"xmin"in e?e.center:"x"in e?e:e.extent.center}(e);const o=e.constructor.fromJSON(await u("rotate",[r,e,t,n]));return o.spatialReference=r,o}async function T(e,t,n,r){return a(await u("generalize",[s(e),e,t,n,r]))}async function D(e,t,n){return a(await u("densify",[s(e),e,t,n]))}async function N(e,t,n,r=0){return a(await u("geodesicDensify",[s(e),e,t,n,r]))}function R(e,t){return u("planarArea",[s(e),e,t])}function H(e,t){return u("planarLength",[s(e),e,t])}function q(e,t,n){return u("geodesicArea",[s(e),e,t,n])}function x(e,t,n){return u("geodesicLength",[s(e),e,t,n])}},2587:(e,t,n)=>{n(90344),n(18848),n(940),n(70171);var r=n(94443),o=n(3172),s=n(20102),i=n(70586);async function a(e){if((0,i.pC)(l.fetchBundleAsset))return l.fetchBundleAsset(e);const t=await(0,o.default)(e,{responseType:"text"});return JSON.parse(t.data)}const l={};var u,c=n(99880);(0,r.tz)((u={pattern:"esri/",location:c.V},new class{constructor({base:e="",pattern:t,location:n=new URL(window.location.href)}){let r;r="string"==typeof n?e=>new URL(e,new URL(n,window.location.href)).href:n instanceof URL?e=>new URL(e,n).href:n,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=r,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,n,o){const i=t.exec(n);if(!i)throw new s.Z("esri-intl:invalid-bundle",`Bundle id "${n}" is not compatible with the pattern "${t}"`);const l=i[1]?`${i[1]}/`:"",u=i[2],c=(0,r.Su)(o),f=`${l}${u}.json`,h=c?`${l}${u}_${c}.json`:f;let d;try{d=await a(e(h))}catch(t){if(h===f)throw new s.Z("intl:unknown-bundle",`Bundle "${n}" cannot be loaded`,{error:t});try{d=await a(e(f))}catch(e){throw new s.Z("intl:unknown-bundle",`Bundle "${n}" cannot be loaded`,{error:e})}}return d}(this.getAssetUrl,this.matcher,e,t)}}(u)))},90344:(e,t,n)=>{n.d(t,{Ze:()=>p,p6:()=>w});var r=n(35454),o=n(70171);const s={year:"numeric",month:"numeric",day:"numeric"},i={year:"numeric",month:"long",day:"numeric"},a={year:"numeric",month:"short",day:"numeric"},l={year:"numeric",month:"long",weekday:"long",day:"numeric"},u={hour:"numeric",minute:"numeric"},c={...u,second:"numeric"},f={"short-date":s,"short-date-short-time":{...s,...u},"short-date-short-time-24":{...s,...u,hour12:!1},"short-date-long-time":{...s,...c},"short-date-long-time-24":{...s,...c,hour12:!1},"short-date-le":s,"short-date-le-short-time":{...s,...u},"short-date-le-short-time-24":{...s,...u,hour12:!1},"short-date-le-long-time":{...s,...c},"short-date-le-long-time-24":{...s,...c,hour12:!1},"long-month-day-year":i,"long-month-day-year-short-time":{...i,...u},"long-month-day-year-short-time-24":{...i,...u,hour12:!1},"long-month-day-year-long-time":{...i,...c},"long-month-day-year-long-time-24":{...i,...c,hour12:!1},"day-short-month-year":a,"day-short-month-year-short-time":{...a,...u},"day-short-month-year-short-time-24":{...a,...u,hour12:!1},"day-short-month-year-long-time":{...a,...c},"day-short-month-year-long-time-24":{...a,...c,hour12:!1},"long-date":l,"long-date-short-time":{...l,...u},"long-date-short-time-24":{...l,...u,hour12:!1},"long-date-long-time":{...l,...c},"long-date-long-time-24":{...l,...c,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":u,"long-time":c},h=(0,r.w)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),d=(h.apiValues,h.toJSON.bind(h),h.fromJSON.bind(h),{ar:"ar-u-nu-latn-ca-gregory"});let m=new WeakMap,g=f["short-date-short-time"];function p(e){return f[e]||null}function w(e,t){return function(e){const t=e||g;if(!m.has(t)){const e=(0,o.Kd)(),n=d[(0,o.Kd)()]||e;m.set(t,new Intl.DateTimeFormat(n,t))}return m.get(t)}(t).format(e)}(0,o.Ze)((()=>{m=new WeakMap,g=f["short-date-short-time"]}))},94443:(e,t,n)=>{n.d(t,{ME:()=>d,Su:()=>m,tz:()=>h});var r=n(20102),o=n(95330),s=n(70171);const i=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,a={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function l(e){return a[e]??!1}const u=[],c=new Map;function f(e){for(const t of c.keys())g(e.pattern,t)&&c.delete(t)}function h(e){return u.includes(e)||(f(e),u.unshift(e)),{remove(){const t=u.indexOf(e);t>-1&&(u.splice(t,1),f(e))}}}async function d(e){const t=(0,s.Kd)();c.has(e)||c.set(e,async function(e,t){const n=[];for(const r of u)if(g(r.pattern,e))try{return await r.fetchMessageBundle(e,t)}catch(e){n.push(e)}if(n.length)throw new r.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:n});throw new r.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const n=c.get(e);return await p.add(n),n}function m(e){if(!i.test(e))return null;const[,t,n]=i.exec(e),r=t+(n?"-"+n.toUpperCase():"");return l(r)?r:l(t)?t:null}function g(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,s.Ze)((()=>{c.clear()}));const p=new class{constructor(){this._numLoading=0}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,o.dD)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},18848:(e,t,n)=>{n.d(t,{sh:()=>l,uf:()=>u});var r=n(70586),o=n(70171);const s={ar:"ar-u-nu-latn"};let i=new WeakMap,a={};function l(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function u(e,t){return function(e){const t=e||a;if(!i.has(t)){const n=(0,o.Kd)(),r=s[(0,o.Kd)()]||n;i.set(t,new Intl.NumberFormat(r,e))}return(0,r.j0)(i.get(t))}(t).format(e)}(0,o.Ze)((()=>{i=new WeakMap,a={}}))},940:(e,t,n)=>{n.d(t,{n:()=>u});var r=n(92604),o=n(78286),s=n(19153),i=n(90344),a=n(18848);const l=r.Z.getLogger("esri.intl");function u(e,t,n={}){const{format:r={}}=n;return(0,s.gx)(e,(e=>function(e,t,n){let r,s;const i=e.indexOf(":");if(-1===i?r=e.trim():(r=e.slice(0,i).trim(),s=e.slice(i+1).trim()),!r)return"";const a=(0,o.hS)(r,t);if(null==a)return"";const l=n[s]||n[r];return l?c(a,l):s?f(a,s):h(a)}(e,t,r)))}function c(e,t){switch(t.type){case"date":return(0,i.p6)(e,t.intlOptions);case"number":return(0,a.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),h(e)}}function f(e,t){switch(t.toLowerCase()){case"dateformat":return(0,i.p6)(e);case"numberformat":return(0,a.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,i.p6)(e):/^numberformat/i.test(t)?(0,a.uf)(e):h(e)}}function h(e){switch(typeof e){case"string":return e;case"number":return(0,a.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,i.p6)(e):""}}},3172:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});var r=n(68773),o=n(40330),s=n(20102),i=n(80442),a=n(22974),l=n(70586),u=n(95330),c=n(17452),f=n(71058),h=n(85958);async function d(e,t){const a=(0,c.HK)(e),w=(0,c.jc)(e);w||a||(e=(0,c.Fv)(e));const y={url:e,requestOptions:{...(0,l.Wg)(t)}};let b=(0,c.oh)(e);if(b){const e=await async function(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let n,r;try{r=await e.before(t)}catch(e){n=A("request:interceptor",e,t)}if((r instanceof Error||r instanceof s.Z)&&(n=A("request:interceptor",r,t)),n)throw e.error&&e.error(n),n;return r}}(b,y);if(null!=e)return{data:e,getHeader:k,requestOptions:y.requestOptions,url:y.url};b.after||b.error||(b=null)}if(e=y.url,"image"===(t=y.requestOptions).responseType){if((0,i.Z)("host-webworker")||(0,i.Z)("host-node"))throw A("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),y)}else if(a)throw A("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+t.responseType),y);if("head"===t.method){if(t.body)throw A("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),y);if(a||w)throw A("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),y)}if(await async function(){(0,i.Z)("host-webworker")?m||(m=await n.e(9884).then(n.bind(n,29884))):d._abortableFetch||(d._abortableFetch=globalThis.fetch.bind(globalThis))}(),m)return m.execute(e,t);const E=new AbortController;(0,u.fu)(t,(()=>E.abort()));const v={controller:E,credential:null,credentialToken:null,fetchOptions:null,hasToken:!1,interceptor:b,params:y,redoRequest:!1,useIdentity:g.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},C=await async function(e){let t,n;await async function(e){const t=e.params.url,n=e.params.requestOptions,s=e.controller.signal,i=n.body;let a=null,l=null,c=null;if(p&&"HTMLFormElement"in globalThis&&(i instanceof FormData?a=i:i instanceof HTMLFormElement&&(l=i,a=new FormData(l))),"string"==typeof i&&(c=i),e.fetchOptions={cache:n.cacheBust&&!d._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:n.headers||{},method:"head"===n.method?"HEAD":"GET",mode:"cors",priority:g.priority,redirect:"follow",signal:s},(a||c)&&(e.fetchOptions.body=a||c),"anonymous"===n.authMode&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||n.query&&n.query.token||a&&a.get&&a.get("token")||l&&l.elements.token),!e.hasToken&&r.Z.apiKey&&(0,f.r)(t)&&(n.query||(n.query={}),n.query.token=r.Z.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!Z(t)&&!(0,u.Hc)(s)){let r;"immediate"===n.authMode?(await _(),r=await o.id.getCredential(t,{signal:s}),e.credential=r):"no-prompt"===n.authMode?(await _(),r=await o.id.getCredential(t,{prompt:!1,signal:s}).catch((()=>{})),e.credential=r):o.id&&(r=o.id.findCredential(t)),r&&(e.credentialToken=r.token,e.useSSL=!!r.ssl)}}(e);try{do{[t,n]=await L(e)}while(!await S(e,t,n))}catch(n){const r=A("request:server",n,e.params,t);throw r.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(r),r}const s=e.params.url;if(n&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(s)){if(!e.hasToken&&!e.credentialToken&&n.user?.username&&!(0,c.kl)(s)){const e=(0,c.P$)(s,!0);e&&g.trustedServers.push(e)}Array.isArray(n.authorizedCrossOriginNoCorsDomains)&&(0,h.Hu)(n.authorizedCrossOriginNoCorsDomains)}const i=e.credential;if(i&&o.id){const e=o.id.findServerInfo(i.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=o.id.findCredential(t,i.userId);e&&-1===o.id._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:n,getHeader:t?e=>t.headers.get(e):k,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}(v);return b?.after?.(C),C}let m;const g=r.Z.request,p="FormData"in globalThis,w=[499,498,403,401],y=["COM_0056","COM_0057","SB_0008"],b=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],k=()=>null,E=Symbol();function v(e){const t=(0,c.P$)(e);return!t||t.endsWith(".arcgis.com")||d._corsServers.includes(t)||(0,c.kl)(t)}function A(e,t,n,r){let o="Error";const i={url:n.url,requestOptions:n.requestOptions,getHeader:k,ssl:!1};if(t instanceof s.Z)return t.details?(t.details=(0,a.d9)(t.details),t.details.url=n.url,t.details.requestOptions=n.requestOptions):t.details=i,t;if(t){const e=r&&(e=>r.headers.get(e)),n=r&&r.status,s=t.message;s&&(o=s),e&&(i.getHeader=e),i.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||n||0,i.subCode=t.subcode,i.messageCode=t.messageCode,"string"==typeof t.details?i.messages=[t.details]:i.messages=t.details,i.raw=E in t?t[E]:t}return(0,u.D_)(t)?(0,u.zE)():new s.Z(e,o,i)}async function _(){o.id||await Promise.all([n.e(280),n.e(1400),n.e(3879)]).then(n.bind(n,28153))}function Z(e){return b.some((t=>t.test(e)))}async function L(e){let t=e.params.url;const n=e.params.requestOptions,r=e.fetchOptions,s=(0,c.jc)(t)||(0,c.HK)(t),a=n.responseType||"json",l=s?0:null!=n.timeout?n.timeout:g.timeout;let f=!1;if(!s){e.useSSL&&(t=(0,c.hO)(t)),n.cacheBust&&"default"===r.cache&&(t=(0,c.ZN)(t,"request.preventCache",Date.now()));let s={...n.query};e.credentialToken&&(s.token=e.credentialToken);let a=(0,c.B7)(s);(0,i.Z)("esri-url-encodes-apostrophe")&&(a=a.replace(/'/g,"%27"));const l=t.length+1+a.length;let u;f="delete"===n.method||"post"===n.method||"put"===n.method||!!n.body||l>g.maxUrlLength;const d=n.useProxy||!!(0,c.ed)(t);if(d){const e=(0,c.b7)(t);u=e.path,!f&&u.length+1+l>g.maxUrlLength&&(f=!0),e.query&&(s={...e.query,...s})}if("HEAD"===r.method&&(f||d)){if(f){if(l>g.maxUrlLength)throw A("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw A("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(d)throw A("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(f?(r.method="delete"===n.method?"DELETE":"put"===n.method?"PUT":"POST",n.body?t=(0,c.fl)(t,s):(r.body=(0,c.B7)(s),r.headers["Content-Type"]="application/x-www-form-urlencoded")):t=(0,c.fl)(t,s),d&&(e.useProxy=!0,t=`${u}?${t}`),s.token&&p&&r.body instanceof FormData){const e=r.body;e.set?e.set("token",s.token):e.append("token",s.token)}if(n.hasOwnProperty("withCredentials"))e.withCredentials=n.withCredentials;else if(!(0,c.D6)(t,(0,c.TI)()))if((0,c.kl)(t))e.withCredentials=!0;else if(o.id){const n=o.id.findServerInfo(t);n&&n.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(r.credentials="include",(0,h.jH)(t)&&await(0,h.jz)(f?(0,c.fl)(t,s):t))}let m,w,y=0,b=!1;l>0&&(y=setTimeout((()=>{b=!0,e.controller.abort()}),l));try{if("native-request-init"===n.responseType)w=r,w.url=t;else if("image"!==n.responseType||"default"!==r.cache||"GET"!==r.method||f||function(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}(n.headers)||!s&&!e.useProxy&&g.proxyUrl&&!v(t)){if(m=await d._abortableFetch(t,r),e.useProxy||function(e){const t=(0,c.P$)(e);t&&!d._corsServers.includes(t)&&d._corsServers.push(t)}(t),"native"===n.responseType)w=m;else if("HEAD"!==r.method)if(m.ok){switch(a){case"array-buffer":w=await m.arrayBuffer();break;case"blob":case"image":w=await m.blob();break;default:w=await m.text()}if(y&&(clearTimeout(y),y=0),"json"===a||"xml"===a||"document"===a)if(w)switch(a){case"json":w=JSON.parse(w);break;case"xml":w=C(w,"application/xml");break;case"document":w=C(w,"text/html")}else w=null;if(w){if("array-buffer"===a||"blob"===a){const e=m.headers.get("Content-Type");if(/application\/json|text\/plain/i.test(e)&&w["blob"===a?"size":"byteLength"]<=750)try{const e=await new Response(w).json();e.error&&(w=e)}catch{}}"image"===a&&w instanceof Blob&&(w=await I(URL.createObjectURL(w),e,!0))}}else w=await m.text()}else w=await I(t,e)}catch(r){if("AbortError"===r.name){if(b)throw new Error("Timeout exceeded");throw(0,u.zE)("Request canceled")}if(!(!m&&r instanceof TypeError&&g.proxyUrl)||n.body||"delete"===n.method||"head"===n.method||"post"===n.method||"put"===n.method||e.useProxy||v(t))throw r;e.redoRequest=!0,(0,c.tD)({proxyUrl:g.proxyUrl,urlPrefix:(0,c.P$)(t)})}finally{y&&clearTimeout(y)}return[m,w]}function C(e,t){let n;try{n=(new DOMParser).parseFromString(e,t)}catch{}if(!n||n.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return n}async function S(e,t,n){if(e.redoRequest)return e.redoRequest=!1,!1;const r=e.params.requestOptions;if(!t||"native"===r.responseType||"native-request-init"===r.responseType)return!0;let s,i,a,l;if(!t.ok)throw s=new Error(`Unable to load ${t.url} status: ${t.status}`),s[E]=n,s;n?.error&&(s=n.error),s&&(i=Number(s.code),a=s.hasOwnProperty("subcode")?Number(s.subcode):null,l=s.messageCode,l=l&&l.toUpperCase());const u=r.authMode;if(403===i&&(4===a||s.message&&s.message.toLowerCase().includes("ssl")&&!s.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===i)&&w.includes(i)&&!Z(e.params.url)&&(403!==i||!y.includes(l)&&(null==a||2===a&&e.credentialToken))){await _();try{const t=await o.id.getCredential(e.params.url,{error:A("request:server",s,e.params),prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(t){if("no-prompt"===u)return e.credential=null,e.credentialToken=null,!1;s=t}}if(s)throw s;return!0}function I(e,t,n=!1){const r=t.controller.signal,o=new Image;return t.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.fetchpriority=g.priority,o.src=e,(0,h.fY)(o,e,n,r)}d._abortableFetch=null,d._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"]},71058:(e,t,n)=>{n.d(t,{r:()=>s});var r=n(17452);const o=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function s(e){const t=(0,r.P$)(e,!0);return t&&t.endsWith(".arcgis.com")&&!o.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}},85958:(e,t,n)=>{n.d(t,{Hu:()=>c,fY:()=>l,jH:()=>f,jz:()=>h});var r=n(68773),o=n(80442),s=n(70586),i=n(95330),a=n(17452);function l(e,t,n=!1,r){return new Promise(((a,l)=>{if((0,i.Hc)(r))return void l(u());let c=()=>{d(),l(new Error(`Unable to load ${t}`))},f=()=>{const t=e;d(),a(t)},h=()=>{if(!e)return;const t=e;d(),t.src="",l(u())};const d=()=>{(0,o.Z)("esri-image-decode")||(e.removeEventListener("error",c),e.removeEventListener("load",f)),c=null,f=null,e=null,(0,s.pC)(r)&&r.removeEventListener("abort",h),h=null,n&&URL.revokeObjectURL(t)};(0,s.pC)(r)&&r.addEventListener("abort",h),(0,o.Z)("esri-image-decode")?e.decode().then(f,c):(e.addEventListener("error",c),e.addEventListener("load",f))}))}function u(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}function c(e){r.Z.request.crossOriginNoCorsDomains||(r.Z.request.crossOriginNoCorsDomains={});const t=r.Z.request.crossOriginNoCorsDomains;for(let n of e)n=n.toLowerCase(),/^https?:\/\//.test(n)?t[(0,a.P$)(n)]=0:(t[(0,a.P$)("http://"+n)]=0,t[(0,a.P$)("https://"+n)]=0)}function f(e){const t=r.Z.request.crossOriginNoCorsDomains;if(t){let n=(0,a.P$)(e);if(n)return n=n.toLowerCase(),!(0,a.D6)(n,(0,a.TI)())&&t[n]<Date.now()-36e5}return!1}async function h(e){const t=r.Z.request.crossOriginNoCorsDomains;t&&(t[(0,a.P$)(e).toLowerCase()]=Date.now());const n=(0,a.mN)(e);e=n.path,"json"===n.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8875,5235],{28924:(e,t,i)=>{i.d(t,{Z:()=>s});var r=i(95330);class s{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,i){this._layerById[t]=i,this._layerByName[e]=i}featureSetByName(e,t=!0,i=["*"]){return void 0===this._layerByName[e]?this.resolvePromise(null):this.resolvePromise(this._layerByName[e])}featureSetById(e,t=!0,i=["*"]){return void 0===this._layerById[e]?this.resolvePromise(null):this.resolvePromise(this._layerById[e])}castToText(){return"object, FeatureSetCollection"}resolvePromise(e){return(0,r.DB)(e)}}},42666:(e,t,i)=>{i.r(t),i.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>ae,constructFeatureSet:()=>se,constructFeatureSetFromPortalItem:()=>_e,constructFeatureSetFromRelationship:()=>le,constructFeatureSetFromUrl:()=>re,convertToFeatureSet:()=>fe,createFeatureSetCollectionFromMap:()=>he,createFeatureSetCollectionFromService:()=>ce,getPortal:()=>de,initialiseMetaDataCache:()=>te,lookupUser:()=>pe});var r=i(40330),s=i(3172),n=i(28924),a=i(84328),l=i(38171),o=i(61363),u=i(70409),h=i(85065),c=i(91136),d=i(90961),p=i(3823),f=i(90658),_=i(36515),y=i(95002),g=i(41534);class m{clone(){const e=new m;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i){const r=new m;r.field=e;const s=g.WhereClause.create(t,i),n=function(e){if("function"===e.parseTree.type){if(0===e.parseTree.args.value.length)return{name:e.parseTree.name,expr:null};if(e.parseTree.args.value.length>1)throw new Error("Statistic does not have 1 or 0 Parameters");const t=g.WhereClause.create((0,_.XF)(e.parseTree.args.value[0],f.Bj.Standardised,e.parameters),e.fieldsIndex);return{name:e.parseTree.name,expr:t}}return null}(s);if(null===n)throw new Error("Invalid Statistic Function");const a=n.name.toUpperCase().trim();if("MIN"===a){if(r.typeofstat="MIN",r.workingexpr=n.expr,null===s)throw new Error("Invalid Statistic Function Parameters")}else if("MAX"===a){if(r.typeofstat="MAX",r.workingexpr=n.expr,null===s)throw new Error("Invalid Statistic Function Parameters")}else if("COUNT"===a)r.typeofstat="COUNT",r.workingexpr=n.expr;else if("STDEV"===a){if(r.typeofstat="STDDEV",r.workingexpr=n.expr,null===s)throw new Error("Invalid Statistic Function Parameters")}else if("SUM"===a){if(r.typeofstat="SUM",r.workingexpr=n.expr,null===s)throw new Error("Invalid Statistic Function Parameters")}else if("MEAN"===a){if(r.typeofstat="AVG",r.workingexpr=n.expr,null===s)throw new Error("Invalid Statistic Function Parameters")}else if("AVG"===a){if(r.typeofstat="AVG",r.workingexpr=n.expr,null===s)throw new Error("Invalid Statistic Function Parameters")}else{if("VAR"!==a)throw new Error("Invalid Statistic Function");if(r.typeofstat="VAR",r.workingexpr=n.expr,null===s)throw new Error("Invalid Statistic Function Parameters")}return r}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}function b(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function w(e,t,i,r,s,n){return b(function(e,t){return e<<t|e>>>32-t}(b(b(t,e),b(r,n)),s),i)}function v(e,t,i,r,s,n,a){return w(t&i|~t&r,e,t,s,n,a)}function S(e,t,i,r,s,n,a){return w(t&r|i&~r,e,t,s,n,a)}function F(e,t,i,r,s,n,a){return w(t^i^r,e,t,s,n,a)}function I(e,t,i,r,s,n,a){return w(i^(t|~r),e,t,s,n,a)}function C(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let i=1732584193,r=-271733879,s=-1732584194,n=271733878;for(let t=0;t<e.length;t+=16){const a=i,l=r,o=s,u=n;i=v(i,r,s,n,e[t+0],7,-680876936),n=v(n,i,r,s,e[t+1],12,-389564586),s=v(s,n,i,r,e[t+2],17,606105819),r=v(r,s,n,i,e[t+3],22,-1044525330),i=v(i,r,s,n,e[t+4],7,-176418897),n=v(n,i,r,s,e[t+5],12,1200080426),s=v(s,n,i,r,e[t+6],17,-1473231341),r=v(r,s,n,i,e[t+7],22,-45705983),i=v(i,r,s,n,e[t+8],7,1770035416),n=v(n,i,r,s,e[t+9],12,-1958414417),s=v(s,n,i,r,e[t+10],17,-42063),r=v(r,s,n,i,e[t+11],22,-1990404162),i=v(i,r,s,n,e[t+12],7,1804603682),n=v(n,i,r,s,e[t+13],12,-40341101),s=v(s,n,i,r,e[t+14],17,-1502002290),r=v(r,s,n,i,e[t+15],22,1236535329),i=S(i,r,s,n,e[t+1],5,-165796510),n=S(n,i,r,s,e[t+6],9,-1069501632),s=S(s,n,i,r,e[t+11],14,643717713),r=S(r,s,n,i,e[t+0],20,-373897302),i=S(i,r,s,n,e[t+5],5,-701558691),n=S(n,i,r,s,e[t+10],9,38016083),s=S(s,n,i,r,e[t+15],14,-660478335),r=S(r,s,n,i,e[t+4],20,-405537848),i=S(i,r,s,n,e[t+9],5,568446438),n=S(n,i,r,s,e[t+14],9,-1019803690),s=S(s,n,i,r,e[t+3],14,-187363961),r=S(r,s,n,i,e[t+8],20,1163531501),i=S(i,r,s,n,e[t+13],5,-1444681467),n=S(n,i,r,s,e[t+2],9,-51403784),s=S(s,n,i,r,e[t+7],14,1735328473),r=S(r,s,n,i,e[t+12],20,-1926607734),i=F(i,r,s,n,e[t+5],4,-378558),n=F(n,i,r,s,e[t+8],11,-2022574463),s=F(s,n,i,r,e[t+11],16,1839030562),r=F(r,s,n,i,e[t+14],23,-35309556),i=F(i,r,s,n,e[t+1],4,-1530992060),n=F(n,i,r,s,e[t+4],11,1272893353),s=F(s,n,i,r,e[t+7],16,-155497632),r=F(r,s,n,i,e[t+10],23,-1094730640),i=F(i,r,s,n,e[t+13],4,681279174),n=F(n,i,r,s,e[t+0],11,-358537222),s=F(s,n,i,r,e[t+3],16,-722521979),r=F(r,s,n,i,e[t+6],23,76029189),i=F(i,r,s,n,e[t+9],4,-640364487),n=F(n,i,r,s,e[t+12],11,-421815835),s=F(s,n,i,r,e[t+15],16,530742520),r=F(r,s,n,i,e[t+2],23,-995338651),i=I(i,r,s,n,e[t+0],6,-198630844),n=I(n,i,r,s,e[t+7],10,1126891415),s=I(s,n,i,r,e[t+14],15,-1416354905),r=I(r,s,n,i,e[t+5],21,-57434055),i=I(i,r,s,n,e[t+12],6,1700485571),n=I(n,i,r,s,e[t+3],10,-1894986606),s=I(s,n,i,r,e[t+10],15,-1051523),r=I(r,s,n,i,e[t+1],21,-2054922799),i=I(i,r,s,n,e[t+8],6,1873313359),n=I(n,i,r,s,e[t+15],10,-30611744),s=I(s,n,i,r,e[t+6],15,-1560198380),r=I(r,s,n,i,e[t+13],21,1309151649),i=I(i,r,s,n,e[t+4],6,-145523070),n=I(n,i,r,s,e[t+11],10,-1120210379),s=I(s,n,i,r,e[t+2],15,718787259),r=I(r,s,n,i,e[t+9],21,-343485551),i=b(i,a),r=b(r,l),s=b(s,o),n=b(n,u)}return[i,r,s,n]}function x(e,t=1){const i=t||0,r=C(function(e){const t=[];for(let i=0,r=8*e.length;i<r;i+=8)t[i>>5]|=(255&e.charCodeAt(i/8))<<i%32;return t}(e),8*e.length);switch(i){case 3:return r;case 1:return function(e){const t="0123456789abcdef",i=[];for(let r=0,s=4*e.length;r<s;r++)i.push(t.charAt(e[r>>2]>>r%4*8+4&15)+t.charAt(e[r>>2]>>r%4*8&15));return i.join("")}(r);case 2:return function(e){const t=[];for(let i=0,r=32*e.length;i<r;i+=8)t.push(String.fromCharCode(e[i>>5]>>>i%32&255));return t.join("")}(r);case 0:return function(e){const t=[];for(let i=0,r=4*e.length;i<r;i+=3){const r=(e[i>>2]>>i%4*8&255)<<16|(e[i+1>>2]>>(i+1)%4*8&255)<<8|e[i+2>>2]>>(i+2)%4*8&255;for(let s=0;s<4;s++)8*i+6*s>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>6*(3-s)&63))}return t.join("")}(r)}}var D=i(95330),R=i(82971),k=i(1231),E=i(99514);function T(e){if(!e)return"COUNT";switch(e.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}class A extends c.Z{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}_getSet(e){return null===this._wset?this._getFilteredSet("",null,null,null,e).then((e=>(this._wset=e,this._wset))):(0,D.DB)(this._wset)}_isInFeatureSet(){return f.dj.InFeatureSet}_nextUniqueName(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const r=this._parent?this._parent.getFieldsIndex():new E.Z([]);for(this.objectIdField="ROW__ID",this.globalIdField="";!1===t;){let e=!1;for(let t=0;t<this._config.groupbyfields.length;t++)if(this._config.groupbyfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}if(!1===e)for(let t=0;t<this._config.statsfields.length;t++)if(this._config.statsfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}!1===e?t=!0:(this.objectIdField="ROW__ID"+i.toString(),i++)}for(const e of this._config.statsfields){const t=new m;t.field=e.name,t.tofieldname=e.name,t.workingexpr=e.expression instanceof g.WhereClause?e.expression:g.WhereClause.create(e.expression,r),t.typeofstat=T(e.statistic),this._decodedStatsfield.push(t)}this._decodedGroupbyfield=[];for(const e of this._config.groupbyfields){const t={name:e.name,singlefield:null,tofieldname:e.name,expression:e.expression instanceof g.WhereClause?e.expression:g.WhereClause.create(e.expression,r)};this._decodedGroupbyfield.push(t)}if(null!==this._parent){this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(const t of this._parent.fields)e[t.name.toUpperCase()]=1;this.types=null}else this.geometryType=f.Qk.point,this.typeIdField="",this.types=null,this.spatialReference=new R.Z({wkid:4326});this.fields=[];const s=new m;s.field=this._nextUniqueName(e),s.tofieldname=this.objectIdField,s.workingexpr=g.WhereClause.create(this._parent.objectIdField,this._parent.getFieldsIndex()),s.typeofstat="MIN",this._decodedStatsfield.push(s);for(const t of this._decodedGroupbyfield){const i=new k.Z;if(t.name=this._nextUniqueName(e),i.name=t.tofieldname,i.alias=i.name,(0,_.y5)(t.expression)){const e=this._parent.getField((0,_.zR)(t.expression,f.Bj.Standardised));if(!e)throw new Error("Field is not present for Aggregation");t.name=e.name,t.singlefield=e.name,this.phsyicalgroupbyfields.push(e.name),i.type=e.type}else{i.type=this._convertToEsriFieldType((0,_.DT)(t.expression,this._parent.fields));const e=new k.Z;e.name=t.name,e.alias=e.name,this.phsyicalgroupbyfields.push(t.name),this._adaptedFields.push(new u.yN(e,t.expression)),this._candosimplegroupby=!1}this.fields.push(i)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new u.$X(e));for(let t=0;t<this._decodedStatsfield.length;t++){const i=new k.Z;let r=null;const s=this._decodedStatsfield[t];s.field=this._nextUniqueName(e),s.tofieldname===this.objectIdField&&(this._internalObjectIdField=s.field),i.name=s.tofieldname,i.alias=i.name;const n=null!==s.workingexpr&&(0,_.y5)(s.workingexpr)?(0,_.zR)(s.workingexpr,f.Bj.Standardised):"";switch(this._decodedStatsfield[t].typeofstat){case"SUM":if(""!==n){if(r=this._parent.getField(n),!r)throw new Error("Field is not present for Aggregation");i.type=r.type}else i.type="double";break;case"MIN":case"MAX":if(""!==n){if(r=this._parent.getField(n),!r)throw new Error("Field is not present for Aggregation");i.type=r.type}else i.type="double";break;case"COUNT":i.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==n&&(r=this._parent.getField(n),!r))throw new Error("Field is not present for Aggregation");i.type="double"}this.fields.push(i)}}_canDoAggregates(){return(0,D.DB)(!1)}_getFeatures(e,t,i,r){-1!==t&&this._featureCache[t];const s=this._maxQuery;return!0===this._checkIfNeedToExpandKnownPage(e,s)?this._expandPagedSet(e,s,0,0,r).then((()=>this._getFeatures(e,t,i,r))):(0,D.DB)("success")}_getFilteredSet(e,t,i,r,s){if(""!==e)return(0,D.DB)(new d.Z([],[],!0,null));let n=null;const l={ordered:!1,nowhereclause:!1};return this._ensureLoaded().then((()=>{if(null!==i)for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===(0,_.hq)(i,this._decodedStatsfield[e].tofieldname)){l.nowhereclause=!0,i=null;break}if(null!==r){l.ordered=!0;for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===r.scanForField(this._decodedStatsfield[e].tofieldname)){r=null,l.ordered=!1;break}if(null!==r)for(const e of this._decodedGroupbyfield)if(null===e.singlefield&&!0===r.scanForField(e.tofieldname)){r=null,l.ordered=!1;break}}return!1===this._candosimplegroupby?(0,D.DB)(!1):this._parent._canDoAggregates(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,null)})).then((e=>{if(e){let e=null;i&&(e=this._reformulateWhereClauseWithoutGroupByFields(i));let t=null;return r&&(t=this._reformulateOrderClauseWithoutGroupByFields(r)),this._parent._getAggregatePagesDataSourceDefinition(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,e,t,this._internalObjectIdField).then((e=>(this._checkCancelled(s),n=!0===l.nowhereclause?new d.Z(e._candidates.slice(0).concat(e._known.slice(0)),[],!0===l.ordered&&e._ordered,this._clonePageDefinition(e.pagesDefinition)):new d.Z(e._candidates.slice(0),e._known.slice(0),!0===l.ordered&&e._ordered,this._clonePageDefinition(e.pagesDefinition)),n)))}let t=this._parent;if(this._adaptedFields.length>0&&(t=new u.Xx({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===l.nowhereclause)n=new d.Z(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new h.Z({parentfeatureset:t,orderbyclause:new p.Z(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let e=t;if(null!==i){let t=null;i&&(t=this._reformulateWhereClauseWithoutGroupByFields(i)),e=new a.Z({parentfeatureset:e,whereclause:t})}n=new d.Z(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new h.Z({parentfeatureset:e,orderbyclause:new p.Z(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return n}))}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=(0,_.bB)(e,t.tofieldname,(0,_.zR)(t.workingexpr,f.Bj.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=(0,_.bB)(e,t.tofieldname,(0,_.zR)(t.expression,f.Bj.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const e of this._decodedGroupbyfield)e.tofieldname!==e.name&&t.push({field:e.tofieldname,newfield:e.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return null===e?null:!0===e.aggregatefeaturesetpagedefinition?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}_refineSetBlock(e,t,i){try{return!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)?this._expandPagedSet(e,this._maxQuery,0,0,i).then((()=>this._refineSetBlock(e,t,i))):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,(0,D.DB)(e))}catch(e){return(0,D.d1)(e)}}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_getPhysicalPage(e,t,i){return!0===e.pagesDefinition.aggregatefeaturesetpagedefinition?(0,D.Ue)(((t,r)=>{this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]).then((e=>{t(e)}),r)})):this._getAgregagtePhysicalPage(e,t,i).then((e=>{for(const t of e){const e={geometry:t.geometry,attributes:{}};for(const i of this._decodedGroupbyfield)e.attributes[i.tofieldname]=t.attributes[i.name];for(const i of this._decodedStatsfield)e.attributes[i.tofieldname]=t.attributes[i.field];this._featureCache[e.attributes[this.objectIdField]]=new l.Z(e)}return e.length}))}_sequentialGetPhysicalItem(e,t,i,r){return(0,D.Ue)(((s,n)=>{null===e.pagesDefinition.internal.iterator&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),!0===e.pagesDefinition.internal.fullyResolved||0===t?s(r.length):this._nextAggregateItem(e,t,i,r,(n=>{null===n?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))}),n)}))}_nextAggregateItem(e,t,i,r,s,n){try{(0,o.X)(e.pagesDefinition.internal.iterator.next()).then((a=>{if(null===a)if(null!==e.pagesDefinition.internal.workingItem){const t=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(t),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(t.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(null);else{const l=this._generateAggregateHash(a);if(null===e.pagesDefinition.internal.workingItem)e.pagesDefinition.internal.workingItem={features:[a],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const i=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(i),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(i.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[a],id:l},void s(i)}e.pagesDefinition.internal.workingItem.features.push(a)}this._nextAggregateItem(e,t,i,r,s,n)}}),n)}catch(e){n(e)}}_calculateFieldStat(e,t,i){const r=[];for(let i=0;i<e.features.length;i++)if(null!==t.workingexpr){const s=t.workingexpr.calculateValue(e.features[i]);null!==s&&r.push(s)}else r.push(null);switch(t.typeofstat){case"MIN":i.attributes[t.tofieldname]=(0,y.tj)("min",r,-1);break;case"MAX":i.attributes[t.tofieldname]=(0,y.tj)("max",r,-1);break;case"SUM":i.attributes[t.tofieldname]=(0,y.tj)("sum",r,-1);break;case"COUNT":i.attributes[t.tofieldname]=r.length;break;case"VAR":i.attributes[t.tofieldname]=(0,y.tj)("var",r,-1);break;case"STDDEV":i.attributes[t.tofieldname]=(0,y.tj)("stddev",r,-1);break;case"AVG":i.attributes[t.tofieldname]=(0,y.tj)("avg",r,-1)}return!0}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.features[0].attributes[i.singlefield]:i.expression.calculateValue(e.features[0]);t.attributes[i.tofieldname]=r}for(const i of this._decodedStatsfield)this._calculateFieldStat(e,i,t);const i=[];for(let r=0;r<this._decodedStatsfield.length;r++)i.push(this._calculateFieldStat(e,this._decodedStatsfield[r],t));return this._featureCache[t.attributes[this.objectIdField]]=new l.Z({attributes:t.attributes,geometry:t.geometry}),t}_generateAggregateHash(e){let t="";for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.attributes[i.singlefield]:i.expression.calculateValue(e);t+=null==r?":":":"+r.toString()}return x(t,2)}_stat(){return(0,D.DB)({calculated:!1})}getFeatureByObjectId(){return(0,D.DB)(null)}static registerAction(){c.Z._featuresetFunctions.groupby=function(e,t){return new A({parentfeatureset:this,groupbyfields:e,statsfields:t})}}}var P=i(53073),N=i(63991),L=i(80692),O=i(33955),j=i(3121),B=i(98732),Z=(i(20102),i(80442),i(10158),i(4967)),q=(i(67676),i(17452),i(67900),i(8744),i(34599)),M=i(74889),U=i(57444),G=(i(98326),i(56545),i(41818)),z=(i(66577),i(5396)),W=i(75935),V=(i(82526),i(28141),i(78760)),J=i(58539),Q=i(33586);class K extends c.Z{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return f.tI}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}convertQueryToLruCacheKey(e){return x((0,f.hd)(e.toJSON()),2)}load(){return null===this._loadPromise&&(this._loadPromise=(0,D.Ue)(((e,t)=>{try{if(!0===this._layer.loaded)return this._initialiseFeatureSet(),void e(this);this._layer.when().then((()=>{try{this._initialiseFeatureSet(),e(this)}catch(e){t(e)}}),t),this._layer.load()}catch(e){t(e)}}))),this._loadPromise}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._layer.outFields)if(1===this._layer.outFields.length&&"*"===this._layer.outFields[0]);else{const e=[];for(const t of this.fields)if("oid"===t.type)e.push(t);else for(const i of this._layer.outFields)if(i.toLowerCase()===t.name.toLowerCase()){e.push(t);break}this.fields=e}if(null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=f.Bj.StandardisedNoInterval,null!=e&&e>=10.61&&(this._databaseType=f.Bj.Standardised)):null!=e&&(e>=10.5&&(this._databaseType=f.Bj.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=f.Bj.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.hasM=this._layer.supportsM,this.hasZ=this._layer.supportsZ,this.typeIdField=this._layer.typeIdField,this.types=this._layer.types}_isInFeatureSet(){return f.dj.InFeatureSet}_refineSetBlock(e){return(0,D.DB)(e)}_candidateIdTransform(e){return e}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._getFilteredSet("",null,null,null,e))).then((e=>(this._wset=e,e))):(0,D.DB)(this._wset)}_runDatabaseProbe(e){return(0,D.Ue)(((t,i)=>{try{this._ensureLoaded().then((()=>{try{const r=new U.Z;r.where=e.replace("OBJECTID",this._layer.objectIdField),this._layer.queryObjectIds(r).then((()=>{t(!0)}),(()=>{try{t(!1)}catch(e){i(e)}}))}catch(e){i(e)}}))}catch(e){i(e)}}))}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){return!e.outStatistics&&this._layer&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsFormatPBF&&!0===this._layer.capabilities.query.supportsQuantizationEditMode}queryPBF(e){return e.quantizationParameters={mode:"edit"},(0,q.executeQueryPBF)(this._layer.parsedUrl,e,new V.J({})).then((e=>M.default.fromJSON((0,B.cn)(e.data)).unquantize()))}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion?this._layer.gdbVersion:"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title,source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){const i="execute"===t?Z.e:"executeForCount"===t?G.P:z.G,r="execute"===t&&this.pbfSupportedForQuery(e);let s=null;if(this.recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);s=this.recentlyUsedQueries.getFromCache(t),null===s&&(s=!0!==r?i(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(t,s),s=s.catch((e=>{throw this.recentlyUsedQueries.removeFromCache(t),e})))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===s&&(s=!0!==r?i(this._layer.parsedUrl.path,e):this.queryPBF(e)),s}_getFilteredSet(e,t,i,r,s){return this.databaseType().then((n=>{if(this.isTable()&&t&&null!==e&&""!==e)return new d.Z([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,s);let a="",l=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(a=r.constructClause(),l=!0);const o=new U.Z;return o.where=null===i?null===t?"1=1":"":(0,_.zR)(i,n),this._requestStandardised&&(o.sqlFormat="standard"),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==a?a.split(","):null,o.geometry=null===t?null:t,o.relationParameter=this._makeRelationshipParam(e),this.executeQuery(o,"executeForIds").then((e=>(null===e&&(e=[]),this._checkCancelled(s),new d.Z([],e,l,null))))}))}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_getFilteredSetUsingPaging(e,t,i,r,s){try{let n="",a=!1;return null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(n=r.constructClause(),a=!0),this.databaseType().then((r=>{let l=null===i?null===t?"1=1":"":(0,_.zR)(i,r);this._layer.definitionExpression&&this._useDefinitionExpression&&(l=""!==l?"(("+this._layer.definitionExpression+") AND ("+l+"))":this._layer.definitionExpression);let o=this._maxQueryRate();const u=this._layer.capabilities.query.maxRecordCount;void 0!==u&&u<o&&(o=u);let h=null;if(!0===this._pageJustIds)h=new d.Z([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:this._layer.objectIdField,resultRecordCount:o,resultOffset:0,geometry:null===t?null:t,where:l,orderByFields:n,returnGeometry:!1,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}});else{let i=!0;!0===this._removeGeometry&&(i=!1);const r=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._layer.outFields?this._layer.outFields:["*"]);h=new d.Z([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:r.join(","),resultRecordCount:o,resultOffset:0,geometry:null===t?null:t,where:l,orderByFields:n,returnGeometry:i,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}})}return this._expandPagedSet(h,o,0,1,s).then((()=>h))}))}catch(e){return(0,D.d1)(e)}}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}_getPhysicalPage(e,t,i){try{const t=e.pagesDefinition.internal.lastRetrieved,r=t,s=e.pagesDefinition.internal.lastPage,n=new U.Z;return this._requestStandardised&&(n.sqlFormat="standard"),n.spatialRelationship=e.pagesDefinition.spatialRel,n.relationParameter=e.pagesDefinition.relationParam,n.outFields=e.pagesDefinition.outFields.split(","),n.num=e.pagesDefinition.resultRecordCount,n.start=e.pagesDefinition.internal.lastPage,n.geometry=e.pagesDefinition.geometry,n.where=e.pagesDefinition.where,n.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,n.returnGeometry=e.pagesDefinition.returnGeometry,n.outSpatialReference=this.spatialReference,this.executeQuery(n,"execute").then((n=>{if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==s)return"done";for(let t=0;t<n.features.length;t++)e.pagesDefinition.internal.set[r+t]=n.features[t].attributes[this._layer.objectIdField];if(!1===this._pageJustIds)for(let e=0;e<n.features.length;e++)this._featureCache[n.features[e].attributes[this._layer.objectIdField]]=n.features[e];return(void 0===n.exceededTransferLimit&&n.features.length!==e.pagesDefinition.resultRecordCount||!1===n.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=t+n.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,"done"}))}catch(e){return(0,D.d1)(e)}}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice(0);if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}_getFeatures(e,t,i,r){const s=[];try{if(-1!==t&&void 0===this._featureCache[t]&&s.push(t),!0===this._checkIfNeedToExpandKnownPage(e,this._maxProcessingRate()))return this._expandPagedSet(e,this._maxProcessingRate(),0,0,r).then((()=>this._getFeatures(e,t,i,r)));let n=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if(e._lastFetchedIndex+=1,n++,void 0===this._featureCache[e._known[r]]){let i=!1;if(null!==this._layer._mode&&void 0!==this._layer._mode){const t=this._layer._mode;if(void 0!==t._featureMap[e._known[r]]){const s=t._featureMap[e._known[r]];null!==s&&(i=!0,this._featureCache[e._known[r]]=s)}}if(!1===i&&(e._known[r]!==t&&s.push(e._known[r]),s.length>=this._maxProcessingRate()-1))break}if(n>=i&&0===s.length)break}if(0===s.length)return(0,D.DB)("success");try{const e=new U.Z;return this._requestStandardised&&(e.sqlFormat="standard"),e.objectIds=s,e.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._layer.outFields?this._layer.outFields:["*"]),e.returnGeometry=!0,!0===this._removeGeometry&&(e.returnGeometry=!1),e.outSpatialReference=this.spatialReference,this.executeQuery(e,"execute").then((e=>{if(this._checkCancelled(r),void 0!==e.error)return(0,D.d1)(new Error(e.error));for(let t=0;t<e.features.length;t++)this._featureCache[e.features[t].attributes[this._layer.objectIdField]]=e.features[t];return"success"}))}catch(e){return(0,D.d1)(e)}}catch(e){return(0,D.d1)(e)}}_getDistinctPages(e,t,i,r,s,n,a,l,o){return this._ensureLoaded().then((()=>this.databaseType())).then((u=>{let h=i.parseTree.column;for(let e=0;e<this._layer.fields.length;e++)if(this._layer.fields[e].name.toLowerCase()===h.toLowerCase()){h=this._layer.fields[e].name;break}const c=new U.Z;this._requestStandardised&&(c.sqlFormat="standard");let d=null===n?null===s?"1=1":"":(0,_.zR)(n,u);return this._layer.definitionExpression&&this._useDefinitionExpression&&(d=""!==d?"(("+this._layer.definitionExpression+") AND ("+d+"))":this._layer.definitionExpression),c.where=d,c.spatialRelationship=this._makeRelationshipEnum(r),c.relationParameter=this._makeRelationshipParam(r),c.geometry=null===s?null:s,c.returnDistinctValues=!0,c.returnGeometry=!1,c.outFields=[h],this.executeQuery(c,"execute").then((u=>{if(this._checkCancelled(o),!u.hasOwnProperty("features"))return(0,D.d1)(new Error("Unnexected Result querying statistics from layer"));let c=!1;for(let e=0;e<this._layer.fields.length;e++)if(this._layer.fields[e].name===h){"date"===this._layer.fields[e].type&&(c=!0);break}for(let e=0;e<u.features.length;e++){if(c){const t=u.features[e].attributes[h];null!==t?l.push(new Date(t)):l.push(t)}else l.push(u.features[e].attributes[h]);if(l.length>=a)break}return 0===u.features.length?l:u.features.length===this._layer.capabilities.query.maxRecordCount&&l.length<a?this._getDistinctPages(e+u.features.length,t,i,r,s,n,a,l,o).then((e=>({calculated:!0,result:e}))):l}))}))}_distinctStat(e,t,i,r,s,n,a){return this._getDistinctPages(0,e,t,i,r,s,n,[],a).then((e=>({calculated:!0,result:e})))}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType}_countstat(e,t,i,r){return this.databaseType().then((e=>{const s=new U.Z;if(this._requestStandardised&&(s.sqlFormat="standard"),this.isTable()&&i&&null!==t&&""!==t)return{calculated:!0,result:0};let n=null===r?null===i?"1=1":"":(0,_.zR)(r,e);return this._layer.definitionExpression&&this._useDefinitionExpression&&(n=""!==n?"(("+this._layer.definitionExpression+") AND ("+n+"))":this._layer.definitionExpression),s.where=n,s.where=n,s.spatialRelationship=this._makeRelationshipEnum(t),s.relationParameter=this._makeRelationshipParam(t),s.geometry=null===i?null:i,s.returnGeometry=!1,this.executeQuery(s,"executeForCount").then((e=>({calculated:!0,result:e})))}))}_stats(e,t,i,r,s,n,a){return this._ensureLoaded().then((()=>{const l=this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsSqlExpression,o=this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsStatistics,u=this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsDistinct;return"count"===e?u?this._countstat(e,i,r,s):{calculated:!1}:!1===o||!1===(0,_.y5)(t)&&!1===l||!1===t.isStandardized?""!==i||null!==s?{calculated:!1}:this._manualStat(e,t,n,a):"distinct"===e?!1===u?""!==i||null!==s?{calculated:!1}:this._manualStat(e,t,n,a):this._distinctStat(e,t,i,r,s,n,a):this.databaseType().then((n=>{if(this.isTable()&&r&&null!==i&&""!==i)return{calculated:!0,result:null};const a=new U.Z;this._requestStandardised&&(a.sqlFormat="standard");let l=null===s?null===r?"1=1":"":(0,_.zR)(s,n);this._layer.definitionExpression&&this._useDefinitionExpression&&(l=""!==l?"(("+this._layer.definitionExpression+") AND ("+l+"))":this._layer.definitionExpression),a.where=l,a.spatialRelationship=this._makeRelationshipEnum(i),a.relationParameter=this._makeRelationshipParam(i),a.geometry=null===r?null:r;const o=new J.Z;o.statisticType=(0,y.g3)(e),o.onStatisticField=(0,_.zR)(t,n),o.outStatisticFieldName="ARCADE_STAT_RESULT",a.returnGeometry=!1;let u="ARCADE_STAT_RESULT";return a.outStatistics=[o],this.executeQuery(a,"execute").then((e=>{if(!e.hasOwnProperty("features")||0===e.features.length)return(0,D.d1)(new Error("Unnexected Result querying statistics from layer"));let t=!1;for(let i=0;i<e.fields.length;i++)if("ARCADE_STAT_RESULT"===e.fields[i].name.toUpperCase()){u=e.fields[i].name,"date"===e.fields[i].type&&(t=!0);break}if(t){let t=e.features[0].attributes[u];return null!==t&&(t=new Date(e.features[0].attributes[u])),{calculated:!0,result:t}}return{calculated:!0,result:e.features[0].attributes[u]}}))}))}))}_stat(e,t,i,r,s,n,a){return this._stats(e,t,i,r,s,n,a)}_canDoAggregates(e,t){return this._ensureLoaded().then((()=>{let e=!1;const i=this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsSqlExpression;if(void 0!==this._layer.capabilities&&null!==this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsStatistics&&!0===this._layer.capabilities.query.supportsOrderBy&&(e=!0),e)for(let r=0;r<t.length-1;r++)null!==t[r].workingexpr&&(!1===t[r].workingexpr.isStandardized||!1===(0,_.y5)(t[r].workingexpr)&&!1===i)&&(e=!1);return!1!==e}))}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}_getAggregatePagesDataSourceDefinition(e,t,i,r,s,n,a){return this._ensureLoaded().then((()=>this.databaseType())).then((l=>{let o="",u=!1,h=!1;null!==n&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(o=n.constructClause(),h=!0),this._layer.capabilities&&this._layer.capabilities.query&&!1===this._layer.capabilities.query.supportsPagination&&(h=!1,u=!0,o=this._layer.objectIdField);const c=[];for(let e=0;e<t.length;e++){const i=new J.Z;i.onStatisticField=null!==t[e].workingexpr?(0,_.zR)(t[e].workingexpr,l):"",i.outStatisticFieldName=t[e].field,i.statisticType=t[e].toStatisticsName(),c.push(i)}""===o&&(o=e.join(","));let p=this._maxQueryRate();const f=this._layer.capabilities.query.maxRecordCount;void 0!==f&&f<p&&(p=f);let y=null===s?null===r?"1=1":"":(0,_.zR)(s,l);return this._layer.definitionExpression&&this._useDefinitionExpression&&(y=""!==y?"(("+this._layer.definitionExpression+") AND ("+y+"))":this._layer.definitionExpression),new d.Z([],["GETPAGES"],h,{groupbypage:!0,spatialRel:this._makeRelationshipEnum(i),relationParam:this._makeRelationshipParam(i),outFields:["*"],useOIDpagination:u,generatedOid:a,resultRecordCount:p,resultOffset:0,groupByFieldsForStatistics:e,outStatistics:c,geometry:null===r?null:r,where:y,orderByFields:o,returnGeometry:!1,returnIdsOnly:!1,internal:{lastMaxId:-1,set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}})}))}_getAgregagtePhysicalPage(e,t,i){try{let t=e.pagesDefinition.where;!0===e.pagesDefinition.useOIDpagination&&(t=""!==t?"("+t+") AND ("+e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());const r=e.pagesDefinition.internal.lastRetrieved,s=r,n=e.pagesDefinition.internal.lastPage,a=new U.Z;return this._requestStandardised&&(a.sqlFormat="standard"),a.where=t,a.spatialRelationship=e.pagesDefinition.spatialRel,a.relationParameter=e.pagesDefinition.relationParam,a.outFields=e.pagesDefinition.outFields,a.outStatistics=e.pagesDefinition.outStatistics,a.geometry=e.pagesDefinition.geometry,a.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,a.num=e.pagesDefinition.resultRecordCount,a.start=e.pagesDefinition.internal.lastPage,a.returnGeometry=e.pagesDefinition.returnGeometry,a.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&a.geometry&&a.spatialRelationship?(0,D.DB)([]):this.executeQuery(a,"execute").then((t=>{if(this._checkCancelled(i),!t.hasOwnProperty("features"))return(0,D.d1)(new Error("Unnexected Result querying aggregates from layer"));const a=[];if(e.pagesDefinition.internal.lastPage!==n)return[];for(let i=0;i<t.features.length;i++)e.pagesDefinition.internal.set[s+i]=t.features[i].attributes[e.pagesDefinition.generatedOid];for(let e=0;e<t.features.length;e++)a.push(new l.Z({attributes:t.features[e].attributes,geometry:null}));return!0===e.pagesDefinition.useOIDpagination?0===t.features.length?e.pagesDefinition.internal.fullyResolved=!0:e.pagesDefinition.internal.lastMaxId=t.features[t.features.length-1].attributes[e.pagesDefinition.generatedOid]:(void 0===t.exceededTransferLimit&&t.features.length!==e.pagesDefinition.resultRecordCount||!1===t.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=r+t.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,a}))}catch(e){return(0,D.d1)(e)}}static create(e,t,i,r,s){const n=new j.default({url:e,outFields:null===t?["*"]:t});return new K({layer:n,spatialReference:i,lrucache:r,interceptor:s})}relationshipMetaData(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON&&this._layer.source.sourceJSON.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,f.US)(this._layer.parsedUrl.path)}queryAttachments(e,t,i,r,s){if(this._layer.capabilities.data.supportsAttachment&&this._layer.capabilities.operations.supportsQueryAttachments){const n={objectIds:[e],returnMetadata:s};return(t&&t>0||i&&i>0)&&(n.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(n.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:n,method:"attachments"}),this._layer.queryAttachments(n).then((t=>{const i=[];return t&&t[e]&&t[e].forEach((t=>{const r=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+t.id.toString();let n=null;s&&t.exifInfo&&(n=Q.Z.convertJsonToArcade(t.exifInfo,!0)),i.push(new L.Z(t.id,t.name,t.contentType,t.size,r,n))})),i}))}return(0,D.DB)([])}queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields.join(","),returnGeometry:e.returnGeometry.toString()};return void 0!==e.resultOffset&&null!==e.resultOffset&&(t.resultOffset=e.resultOffset.toString()),void 0!==e.resultRecordCount&&null!==e.resultRecordCount&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=JSON.stringify(e.outSpatialReference.toJSON())),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"}),(0,s.default)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t}).then((e=>{if(e.data){const t={},i=e.data;if(i&&i.relatedRecordGroups){const e=i.spatialReference;for(const r of i.relatedRecordGroups){const s=r.objectId,n=[];for(const t of r.relatedRecords){t.geometry&&(t.geometry.spatialReference=e);const i=new l.Z({geometry:t.geometry?(0,O.im)(t.geometry):null,attributes:t.attributes});n.push(i)}t[s]={features:n,exceededTransferLimit:!0===i.exceededTransferLimit}}}return t}return(0,D.d1)("Invalid Request")}))}getFeatureByObjectId(e,t){const i=new U.Z;return i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=this.objectIdField+"="+e.toString(),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"}),(0,Z.e)(this._layer.parsedUrl.path,i).then((e=>1===e.features.length?e.features[0]:null))}getIdentityUser(){return this.load().then((()=>{const e=r.id?.findCredential(this._layer.url);return e?e.userId:null}))}getOwningSystemUrl(){return this.load().then((()=>{const e=r.id?.findServerInfo(this._layer.url);if(e)return(0,D.DB)(e.owningSystemUrl);let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");return t=i>-1?t.substring(0,i):t,t?(t+="/rest/info",(0,D.Ue)(((e,i)=>{(0,s.default)(t,{query:{f:"json"}}).then((t=>{let i="";t.data&&t.data.owningSystemUrl&&(i=t.data.owningSystemUrl),e(i)}),(t=>{e("")}))}))):(0,D.DB)("")}))}getDataSourceFeatureSet(){const e=new K({layer:this._layer,spatialReference:this.spatialReference,outFields:this._overrideFields,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries,interceptor:this.featureSetQueryInterceptor});return e._useDefinitionExpression=!1,e}}var $=i(17805);class H extends c.Z{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._findObjectId=-1,this._requestStandardised=!1,this._removeGeometry=!1,this._overrideFields=null,this.featureObjectId=null,this.relatedLayer=null,this.relationship=null,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,this._findObjectId=e.objectId,this.featureObjectId=e.objectId,this.relationship=e.relationship,this.relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return f.tI}end(){return this._layer}optimisePagingFeatureQueries(){}load(){return null===this._loadPromise&&(this._loadPromise=(0,D.Ue)(((e,t)=>{(0,D.$6)([this._layer.load(),this.relatedLayer.load()]).then((()=>{this._initialiseFeatureSet(),e(this)}),t)}))),this._loadPromise}nativeCapabilities(){return this.relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this.relatedLayer.geometryType,this.fields=this.relatedLayer.fields.slice(0),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType,this._requestStandardised=e.requestStandardised),this.objectIdField=this.relatedLayer.objectIdField,this.globalIdField=this.relatedLayer.globalIdField,this.hasM=this.relatedLayer.supportsM,this.hasZ=this.relatedLayer.supportsZ,this.typeIdField=this.relatedLayer.typeIdField,this.types=this.relatedLayer.types}databaseType(){return this.relatedLayer.databaseType().then((()=>(this._databaseType=this.relatedLayer._databaseType,this._databaseType)))}isTable(){return this.relatedLayer.isTable()}_isInFeatureSet(){return f.dj.InFeatureSet}_candidateIdTransform(e){return e}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._getFilteredSet("",null,null,null,e))).then((e=>(this._wset=e,e))):(0,D.DB)(this._wset)}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new l.Z({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}_getFilteredSet(e,t,i,r,s){return this.databaseType().then((()=>{if(this.isTable()&&t&&null!==e&&""!==e)return new d.Z([],[],!0,null);const n=this._layer.nativeCapabilities();if(!1===n.canQueryRelated)return new d.Z([],[],!0,null);if(n.capabilities.queryRelated&&n.capabilities.queryRelated.supportsPagination)return this._getFilteredSetUsingPaging(e,t,i,r,s);let a="",l=!1;null!==r&&n.capabilities&&n.capabilities.queryRelated&&!0===n.capabilities.queryRelated.supportsOrderBy&&(a=r.constructClause(),l=!0);const o=new W.Z;o.objectIds=[this._findObjectId];const u=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this.relatedLayer.fields?this.relatedLayer.fields.map((e=>e.name)):["*"]);o.outFields=u,o.relationshipId=this.relationship.id,o.where="1=1";let h=!0;return!0===this._removeGeometry&&(h=!1),o.returnGeometry=h,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==a?a.split(","):null,n.source.queryRelatedFeatures(o).then((r=>{this._checkCancelled(s);const n=r[this._findObjectId]?r[this._findObjectId].features:[],a=[];for(let e=0;e<n.length;e++)this._featureCache[n[e].attributes[this.relatedLayer.objectIdField]]=n[e],a.push(n[e].attributes[this.relatedLayer.objectIdField]);const o=t&&null!==e&&""!==e,u=null!=i;return new d.Z(o||u?a:[],o||u?[]:a,l,null)}))}))}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice(0);if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}_getFilteredSetUsingPaging(e,t,i,r,s){try{let n="",a=!1;const l=this._layer.nativeCapabilities();return null!==r&&l&&l.capabilities.queryRelated&&!0===l.capabilities.queryRelated.supportsOrderBy&&(n=r.constructClause(),a=!0),this.databaseType().then((()=>{let r=this._maxQueryRate();const o=l.capabilities.query.maxRecordCount;void 0!==o&&o<r&&(r=o);const u=t&&null!==e&&""!==e,h=null!=i;let c=null,p=!0;!0===this._removeGeometry&&(p=!1);const f=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this.relatedLayer.fields?this.relatedLayer.fields.map((e=>e.name)):["*"]);return c=new d.Z(u||h?["GETPAGES"]:[],u||h?[]:["GETPAGES"],a,{outFields:f.join(","),resultRecordCount:r,resultOffset:0,objectIds:[this._findObjectId],where:"1=1",orderByFields:n,returnGeometry:p,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),this._expandPagedSet(c,r,0,0,s).then((()=>c))}))}catch(e){return(0,D.d1)(e)}}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}_getPhysicalPage(e,t,i){try{const t=e.pagesDefinition.internal.lastRetrieved,r=t,s=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),a=new W.Z;return!0===this._requestStandardised&&(a.sqlFormat="standard"),a.relationshipId=this.relationship.id,a.objectIds=e.pagesDefinition.objectIds,a.resultOffset=e.pagesDefinition.internal.lastPage,a.resultRecordCount=e.pagesDefinition.resultRecordCount,a.outFields=e.pagesDefinition.outFields.split(","),a.where=e.pagesDefinition.where,a.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,a.returnGeometry=e.pagesDefinition.returnGeometry,a.outSpatialReference=this.spatialReference,n.source.queryRelatedFeatures(a).then((n=>{if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==s)return 0;const a=n[this._findObjectId]?n[this._findObjectId].features:[];for(let t=0;t<a.length;t++)e.pagesDefinition.internal.set[r+t]=a[t].attributes[this.relatedLayer.objectIdField];for(let e=0;e<a.length;e++)this._featureCache[a[e].attributes[this.relatedLayer.objectIdField]]=a[e];const l=!n[this._findObjectId]||!1===n[this._findObjectId].exceededTransferLimit;return a.length!==e.pagesDefinition.resultRecordCount&&l&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=t+a.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,a.length}))}catch(e){return(0,D.d1)(e)}}_getFeatures(e,t,i,r){const s=[];-1!==t&&void 0===this._featureCache[t]&&s.push(t);const n=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,n))return this._expandPagedSet(e,n,0,0,r).then((()=>this._getFeatures(e,t,i,r)));let a=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(a++,a<=i&&(e._lastFetchedIndex+=1),!("GETPAGES"!==e._known[r]&&void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&s.push(e._known[r]),s.length>i)))&&!(a>=i&&0===s.length);r++);return 0===s.length?(0,D.DB)("success"):(0,D.d1)(new Error("Unaccounted for Features. Not in Feature Collection"))}_refineSetBlock(e,t,i){return(0,D.DB)(e)}_stat(e,t,i,r,s,n,a){return(0,D.DB)({calculated:!1})}get gdbVersion(){return this.relatedLayer.gdbVersion}_canDoAggregates(e,t,i,r,s){return(0,D.DB)(!1)}relationshipMetaData(){return this.relatedLayer.relationshipMetaData()}serviceUrl(){return this.relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this.relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this.relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this.relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this.relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this.relatedLayer}}var X=i(48039),Y=i(65587),ee=i(15235);function te(){null===X.Z.applicationCache&&(X.Z.applicationCache=new X.Z)}function ie(e,t){if(X.Z.applicationCache){const i=X.Z.applicationCache.getLayerInfo(e);if(i)return i.then((i=>(0,D.DB)(new j.default({url:e,outFields:t,sourceJSON:i}))));const r=new j.default({url:e,outFields:t});let s=(0,D.Ue)(((e,t)=>{r.load().then((()=>{e(r.sourceJSON)}),(e=>{t(e)}))}));return X.Z.applicationCache&&(X.Z.applicationCache.setLayerInfo(e,s),s=s.catch((t=>{throw X.Z.applicationCache.clearLayerInfo(e),t}))),s.then((()=>(0,D.DB)(r)))}return(0,D.DB)(new j.default({url:e,outFields:t}))}function re(e,t,i,r,s,n=null){return ie(e,["*"]).then((e=>(0,D.DB)(se(e,t,i,r,s,n))))}function se(e,t=null,i=null,r=!0,s=null,n=null){return!0===e._hasMemorySource()?new $.Z({layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:s,interceptor:n}):new K({layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:s,interceptor:n})}function ne(e){if(null!==X.Z.applicationCache){const t=X.Z.applicationCache.getLayerInfo(e);if(null!==t)return t}let t=(0,s.default)(e,{responseType:"json",query:{f:"json"}}).then((e=>{if(e.data){const t=e.data;return t.layers||(t.layers=[]),t.tables||(t.tables=[]),(0,D.DB)(t)}return(0,D.DB)({layers:[],tables:[]})}));return null!==X.Z.applicationCache&&(X.Z.applicationCache.setLayerInfo(e,t),t=t.catch((t=>{throw X.Z.applicationCache.clearLayerInfo(e),t}))),t}function ae(e,t){const i={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null};return ne(e).then((r=>{if(i.metadata=r,r.controllerDatasetLayers&&void 0!==r.controllerDatasetLayers.utilityNetworkLayerId&&null!==r.controllerDatasetLayers.utilityNetworkLayerId){if(r.layers)for(const e of r.layers)i.layerNameLkp[e.id]=e.name;if(r.tables)for(const e of r.tables)i.layerNameLkp[e.id]=e.name;const n=r.controllerDatasetLayers.utilityNetworkLayerId;return i.networkId=n,function(e,t){const i="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==X.Z.applicationCache){const e=X.Z.applicationCache.getLayerInfo(i);if(null!==e)return e}let r=(0,s.default)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}}).then((e=>{if(e.data){const t=e.data;if(t.layerDataElements&&t.layerDataElements[0])return t.layerDataElements[0]}throw new Error("Not Found")}));return null!==X.Z.applicationCache&&(X.Z.applicationCache.setLayerInfo(i,r),r=r.catch((e=>{throw X.Z.applicationCache.clearLayerInfo(i),e}))),r}(e,n).then((r=>{if(r){i.queryelem=r,i.queryelem&&i.queryelem.dataElement&&void 0!==i.queryelem.dataElement.schemaGeneration&&(i.unVersion=i.queryelem.dataElement.schemaGeneration),i.lkp={},i.queryelem.dataElement.domainNetworks||(i.queryelem.dataElement.domainNetworks=[]);for(const e of i.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources?e.edgeSources:[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:i.layerNameLkp[t.layerId]?i.layerNameLkp[t.layerId]:null};e.className&&(i.lkp[e.className]=e)}for(const t of e.junctionSources?e.junctionSources:[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:i.layerNameLkp[t.layerId]?i.layerNameLkp[t.layerId]:null};e.className&&(i.lkp[e.className]=e)}}if(i.queryelem.dataElement.terminalConfigurations)for(const e of i.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)i.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});return function(e){if(null!==X.Z.applicationCache){const t=X.Z.applicationCache.getLayerInfo(e);if(null!==t)return t}let t=(0,s.default)(e,{responseType:"json",query:{f:"json"}}).then((e=>{if(e.data){const t=e.data;return(0,D.DB)(t)}return(0,D.DB)(null)}));return null!==X.Z.applicationCache&&(X.Z.applicationCache.setLayerInfo(e,t),t=t.catch((t=>{throw X.Z.applicationCache.clearLayerInfo(e),t}))),t}(e+"/"+n).then((r=>{if(r.systemLayers&&void 0!==r.systemLayers.associationsTableId&&null!==r.systemLayers.associationsTableId){const s=[];return i.unVersion>=4&&(s.push("STATUS"),s.push("PERCENTALONG")),re(e+"/"+r.systemLayers.associationsTableId.toString(),t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...s],!1,null,null).then((e=>e.load())).then((e=>i.unVersion>=4?(e=e.filter(g.WhereClause.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62,63)",e.getFieldsIndex()))).load():e)).then((e=>({lkp:i.lkp,associations:e,unVersion:i.unVersion,terminals:i.terminals})))}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[]}}))}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[]}}))}return{associations:null,unVersion:i.unVersion,lkp:null,terminals:[]}}))}function le(e,t,i,r=null,s=null,n=!0,a=null,l=null){let o=e.serviceUrl();return o?(o="/"===o.charAt(o.length-1)?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString(),re(o,r,s,n,a,l).then((o=>new H({layer:e,relatedLayer:o,relationship:t,objectId:i,spatialReference:r,outFields:s,includeGeometry:n,lrucache:a,interceptor:l})))):null}a.Z.registerAction(),A.registerAction(),h.Z.registerAction(),P.Z.registerAction(),N.Z.registerAction();class oe extends n.Z{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overridespref=t,this.lrucache=i,this.interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=se(e,this._overridespref,null===i?["*"]:i,t,this.lrucache,this.interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}featureSetByName(e,t=!0,i=null){if(void 0!==this._map.loaded&&void 0!==this._map.load&&!1===this._map.loaded)return this._map.load().then((()=>{try{return this.featureSetByName(e,t,i)}catch(e){return(0,D.d1)(e)}}));null===i&&(i=["*"]),i=(i=i.slice(0)).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.title===e&&s.includeGeometry===t&&s.outFields===r)return this.resolvePromise(this._instantLayers[i].featureset)}const s=this._map.allLayers.find((t=>t instanceof j.default&&t.title===e));if(s)return this.resolvePromise(this._makeAndAddFeatureSet(s,t,i));if(this._map.tables){const r=this._map.tables.find((t=>!!(t.title&&t.title===e||t.title&&t.title===e)));if(r){if(r instanceof j.default)return this.resolvePromise(this._makeAndAddFeatureSet(r,t,i));if(r._materializedTable);else{const e=r.outFields?r:{...r,outFields:["*"]};r._materializedTable=new j.default(e)}return r._materializedTable.load().then((()=>this.resolvePromise(this._makeAndAddFeatureSet(r._materializedTable,t,i))))}}return this.resolvePromise(null)}featureSetById(e,t=!0,i=["*"]){if(void 0!==this._map.loaded&&void 0!==this._map.load&&!1===this._map.loaded)return this._map.load().then((()=>{try{return this.featureSetById(e,t,i)}catch(e){return(0,D.d1)(e)}}));null===i&&(i=["*"]),i=(i=i.slice(0)).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.id===e&&s.includeGeometry===t&&s.outFields===r)return this.resolvePromise(this._instantLayers[i].featureset)}const s=this._map.allLayers.find((t=>t instanceof j.default&&t.id===e));if(s)return this.resolvePromise(this._makeAndAddFeatureSet(s,t,i));if(this._map.tables){const r=this._map.tables.find((t=>t.id===e));if(r){if(r instanceof j.default)return this.resolvePromise(this._makeAndAddFeatureSet(r,t,i));if(r._materializedTable);else{const e={...r,outFields:["*"]};r._materializedTable=new j.default(e)}return r._materializedTable.load().then((()=>this.resolvePromise(this._makeAndAddFeatureSet(r._materializedTable,t,i))))}}return this.resolvePromise(null)}}class ue extends n.Z{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overridespref=t,this.lrucache=i,this.interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=se(e,this._overridespref,null===i?["*"]:i,t,this.lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}_loadMetaData(){return ne(this._url).then((e=>(this.metadata=e,e)))}load(){return this._loadMetaData()}clone(){return new ue(this._url,this._overridespref,this.lrucache,this.interceptor)}featureSetByName(e,t=!0,i=null){null===i&&(i=["*"]),i=(i=i.slice(0)).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.title===e&&s.includeGeometry===t&&s.outFields===r)return this.resolvePromise(this._instantLayers[i].featureset)}return this._loadMetaData().then((r=>{let s=null;for(const t of r.layers?r.layers:[])t.name===e&&(s=t);if(!s)for(const t of r.tables?r.tables:[])t.name===e&&(s=t);return s?ie(this._url+"/"+s.id,["*"]).then((e=>this._makeAndAddFeatureSet(e,t,i))):this.resolvePromise(null)}))}featureSetById(e,t=!0,i=["*"]){null===i&&(i=["*"]),i=(i=i.slice(0)).sort();const r=JSON.stringify(i);e=null!=e?e.toString():"";for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.id===e&&s.includeGeometry===t&&s.outFields===r)return this.resolvePromise(this._instantLayers[i].featureset)}return this._loadMetaData().then((r=>{let s=null;for(const t of r.layers?r.layers:[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);if(!s)for(const t of r.tables?r.tables:[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(s=t);return s?ie(this._url+"/"+s.id,["*"]).then((e=>this._makeAndAddFeatureSet(e,t,i))):this.resolvePromise(null)}))}}function he(e,t,i=null,r=null){return new oe(e,t,i,r)}function ce(e,t,i=null,r=null){return new ue(e,t,i,r)}function de(e,t){return null===e?t:new Y.Z({url:e.field("url")})}function pe(e,t,i){return r.id.findCredential(e.restUrl)?"loaded"===e.loadStatus&&""===t&&e.user&&e.user.sourceJSON&&!1===i?(0,D.DB)(e.user.sourceJSON):""===t?(0,s.default)(e.restUrl+"/community/self",{responseType:"json",query:{f:"json",...!1===i?{}:{returnUserLicenseTypeExtensions:!0}}}).then((e=>{if(e.data){const t=e.data;if(t&&t.username)return(0,D.DB)(t)}return(0,D.DB)(null)})):(0,s.default)(e.restUrl+"/community/users/"+t,{responseType:"json",query:{f:"json"}}).then((e=>{if(e.data){const t=e.data;return t.error?null:(0,D.DB)(t)}return(0,D.DB)(null)})):(0,D.DB)(null)}function fe(e,t,i,r,s){if(null===e)return null;if(e instanceof j.default){switch(t){case"datasource":return se(e,s,e.outFields,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return se(e,s,e.outFields,!0,i,r)}return null}if(e instanceof c.Z)switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}function _e(e,t,i,r,s,n,a,l=null){if(X.Z.applicationCache){const o=X.Z.applicationCache.getLayerInfo(e+":"+n.url);if(o)return o.then((e=>{try{const n=new j.default({url:(0,f.US)(e.url)+"/"+t,outFields:["*"]});return(0,D.DB)(se(n,i,r,s,a,l))}catch(e){return(0,D.d1)(e)}}),(e=>(0,D.d1)(e)))}return(0,D.Ue)(((o,u)=>{const h=new ee.default({id:e,portal:n}).load();X.Z.applicationCache&&X.Z.applicationCache.setLayerInfo(e+":"+n.url,h),h.then((e=>{try{const n=new j.default({url:(0,f.US)(e.url)+"/"+t,outFields:["*"]});o(se(n,i,r,s,a,l))}catch(e){u(e)}}),(t=>{X.Z.applicationCache&&X.Z.applicationCache.clearLayerInfo(e+":"+n.url),u(t)}))}))}},70409:(e,t,i)=>{i.d(t,{$X:()=>p,QP:()=>f,TO:()=>_,Xx:()=>g,yN:()=>y});var r=i(38171),s=i(77286),n=i(91136),a=i(90961),l=i(90658),o=i(36515),u=i(95330),h=i(41534),c=i(82971);class d{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class p extends d{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class f extends d{constructor(e,t,i){super((0,l.JW)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=i}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:(0,o.bB)(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class _ extends d{constructor(e,t,i){super(e),this.codefield=t,this.lkp=i,this.reverseLkp={};for(const e in i)this.reverseLkp[i[e]]=e;this.sqlRewritable=!0}rewriteSql(e,t){const i=this.evaluateNodeToWhereClause(e.parseTree,l.Bj.Standardised,this.field.name,this.codefield instanceof h.WhereClause?(0,o.zR)(this.codefield,l.Bj.Standardised):this.codefield,e.parameters);return i.includes(_.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:h.WhereClause.create(i,t._parent.getFieldsIndex())}}evaluateNodeToWhereClause(e,t,i=null,r=null,s){let n,a,l,u;switch(e.type){case"interval":return(0,o.TE)(this.evaluateNodeToWhereClause(e.value,t,i,r,s),e.qualifier,e.op);case"case-expression":{let r=" CASE ";"simple"===e.format&&(r+=this.evaluateNodeToWhereClause(e.operand,t,i,_.BADNESS,s));for(let n=0;n<e.clauses.length;n++)r+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[n].operand,t,i,_.BADNESS,s)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[n].value,t,i,_.BADNESS,s);return null!==e.else&&(r+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,i,_.BADNESS,s)),r+=" END ",r}case"parameter":{const i=s[e.value.toLowerCase()];if("string"==typeof i)return"'"+s[e.value.toLowerCase()].toString().replace(/'/g,"''")+"'";if(i instanceof Date)return(0,o.oX)(i,t);if(i instanceof Array){const e=[];for(let r=0;r<i.length;r++)"string"==typeof i[r]?e.push("'"+i[r].toString().replace(/'/g,"''")+"'"):i[r]instanceof Date?e.push((0,o.oX)(i[r],t)):e.push(i[r].toString());return e}return i.toString()}case"expression-list":a=[];for(const n of e.value)a.push(this.evaluateNodeToWhereClause(n,t,i,r,s));return a;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,i,_.BADNESS,s)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" AND "+this.evaluateNodeToWhereClause(e.right,t,i,r,s)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" OR "+this.evaluateNodeToWhereClause(e.right,t,i,r,s)+") ";case"IS":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new Error("Unsupported RHS for IS");return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IS NOT NULL )";case"IN":if(n=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const n=[];let a=!0;for(const t of e.right.value){if("string"!==t.type){a=!1;break}if(void 0===this.lkp[t.value]){a=!1;break}n.push(this.lkp[t.value].toString())}if(a)return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IN ("+n.join(",")+")) "}return n=this.evaluateNodeToWhereClause(e.right,t,i,r,s)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IN ("+n.join(",")+")) "}return u=this.evaluateNodeToWhereClause(e.right,t,i,r,s),u instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IN ("+u.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IN ("+u+")) ";case"NOT IN":if(n=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const n=[];let a=!0;for(const t of e.right.value){if("string"!==t.type){a=!1;break}if(void 0===this.lkp[t.value]){a=!1;break}n.push(this.lkp[t.value].toString())}if(a)return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" NOT IN ("+n.join(",")+")) "}return n=this.evaluateNodeToWhereClause(e.right,t,i,r,s)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" NOT IN ("+n.join(",")+")) "}return u=this.evaluateNodeToWhereClause(e.right,t,i,r,s),u instanceof Array?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" NOT IN ("+u.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" NOT IN ("+u+")) ";case"BETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)," ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"NOTBETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)," ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" NOT BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+") ";case"<>":case"=":if("column-reference"===e.left.type&&"string"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this.lkp[e.right.value.toString()])return" ("+r+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if("column-reference"===e.right.type&&"string"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return(0,o.oX)(e.value,t);case"number":return e.value.toString();case"current-time":return(0,o.vR)("date"===e.mode,t);case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":e.column;case"function":{const r=this.evaluateNodeToWhereClause(e.args,t,i,_.BADNESS,s);return(0,o.fz)(e.name,r,t)}}throw new Error("Unsupported sql syntax "+e.type)}extractValue(e){return this.codefield instanceof h.WhereClause?this.reverseLkp[this.codefield.calculateValueCompiled(e)]:this.reverseLkp[e.attributes[this.codefield]]}}_.BADNESS="_!!!_BAD_LKP_!!!!";class y extends d{constructor(e,t){super(e),this.sql=t}rewriteSql(e,t){return{rewritten:!0,where:(0,o.bB)(e,this.field.name,(0,o.zR)(this.sql,l.Bj.Standardised),t.getFieldsIndex())}}extractValue(e){return this.sql.calculateValueCompiled(e)}}class g extends n.Z{constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=null,this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}static findField(e,t){for(const i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;return null}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new c.Z({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=l.Qk.point,this.typeIdField="",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._extraFilter?this._getFilteredSet("",null,null,null,e):this._parent._getSet(e))).then((t=>(this._checkCancelled(e),this._wset=new a.Z(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset))):(0,u.DB)(this._wset)}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,n){const l=[];-1!==t&&void 0===this._featureCache[t]&&l.push(t);const o=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,o))return this._expandPagedSet(e,o,0,0,n).then((()=>this._getFeatures(e,t,i,n)));let h=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(h++,h<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&l.push(e._known[r]),l.length>=o)));r++);if(0===l.length)return(0,u.DB)("success");e=new a.Z([],l,e._ordered,null);const c=Math.min(l.length,i);return this._parent._getFeatures(e,-1,c,n).then((()=>{this._checkCancelled(n);const e=[];for(let t=0;t<c;t++){const i=this._parent._featureFromCache(l[t]);void 0!==i&&e.push({geometry:i.geometry,attributes:i.attributes,id:l[t]})}for(const t of e){const e=[];for(const i of this.adaptedFields)e[i.field.name]=i.extractValue(t);this._featureCache[t.id]=new r.Z({attributes:e,geometry:(0,s.r1)(t.geometry)})}return"success"}))}_fetchAndRefineFeatures(){return(0,u.d1)(new Error("Fetch and Refine should not be called in this featureset"))}_getFilteredSet(e,t,i,r,s){let n=!1;const l=this._reformulateWithoutAdaptions(i);n=l.cannot,i=l.where;let u=!1;if(null!==r){u=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof p)&&!0===r.scanForField(t.field.name)){if(!(t instanceof f)){r=null,u=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}r&&e.length>0&&(r=r.replaceFields(e))}return null!==i?null!==this._extraFilter&&(i=(0,o.$e)(this._extraFilter,i)):i=this._extraFilter,this._ensureLoaded().then((()=>this._parent._getFilteredSet(e,t,i,r,s))).then((e=>{let t;return this._checkCancelled(s),t=!0===n?new a.Z(e._candidates.slice(0).concat(e._known.slice(0)),[],!0===u&&e._ordered,this._clonePageDefinition(e.pagesDefinition)):new a.Z(e._candidates.slice(0),e._known.slice(0),!0===u&&e._ordered,this._clonePageDefinition(e.pagesDefinition)),t}))}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const i of this.adaptedFields)if(!0===(0,o.hq)(e,i.field.name)){const r=i.rewriteSql(e,this);if(!0!==r.rewritten){t.cannot=!0,t.where=null;break}t.where=r.where}return t}_stat(e,t,i,r,s,n,a){let l=!1,h=this._reformulateWithoutAdaptions(t);return l=h.cannot,t=h.where,h=this._reformulateWithoutAdaptions(s),l=l||h.cannot,null!==(s=h.where)?null!==this._extraFilter&&(s=(0,o.$e)(this._extraFilter,s)):s=this._extraFilter,!0===l?null===s&&""===i&&null===r?this._manualStat(e,t,n,a):(0,u.DB)({calculated:!1}):this._parent._stat(e,t,i,r,s,n,a).then((l=>!1===l.calculated?null===s&&""===i&&null===r?this._manualStat(e,t,n,a):{calculated:!1}:l))}_canDoAggregates(e,t,i,r,s){if(null===this._parent)return(0,u.DB)(!1);for(let t=0;t<e.length;t++)for(const i of this.adaptedFields)if(e[t].toLowerCase()===i.field.name.toLowerCase()&&!(i instanceof p))return(0,u.DB)(!1);const n=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)return(0,u.DB)(!1);const t=i.clone();t.workingexpr=e.where,n.push(t)}else n.push(i)}const a=this._reformulateWithoutAdaptions(s);return a.cannot?(0,u.DB)(!1):(null!==(s=a.where)?null!==this._extraFilter&&(s=(0,o.$e)(this._extraFilter,s)):s=this._extraFilter,this._parent._canDoAggregates(e,n,i,r,s))}_getAggregatePagesDataSourceDefinition(e,t,i,r,s,n,a){if(null===this._parent)return(0,u.d1)(new Error("Should never be called"));const l=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)return(0,u.d1)(new Error("Should never be called"));const t=i.clone();t.workingexpr=e.where,l.push(t)}else l.push(i)}const h=this._reformulateWithoutAdaptions(s);return h.cannot?(0,u.d1)(new Error("Should never be called")):(null!==(s=h.where)?null!==this._extraFilter&&(s=(0,o.$e)(this._extraFilter,s)):s=this._extraFilter,this._parent._getAggregatePagesDataSourceDefinition(e,l,i,r,s,n,a))}}},84328:(e,t,i)=>{i.d(t,{Z:()=>h});var r=i(91136),s=i(90961),n=i(90658),a=i(36515),l=i(95330),o=i(41534),u=i(82971);class h extends r.Z{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof o.WhereClause?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new u.Z({wkid:4326}),this.geometryType=n.Qk.point)}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._parent._getFilteredSet("",null,this._whereclause,null,e))).then((t=>(this._checkCancelled(e),null!==this._whereClauseFunction?this._wset=new s.Z(t._candidates.slice(0).concat(t._known.slice(0)),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new s.Z(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset))):(0,l.DB)(this._wset)}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===n.dj.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?n.dj.Unknown:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause.testFeature(e)}executeWhereClauseDeferred(e){if(null!==this._whereClauseFunction)try{const t=this._whereClauseFunction(e);return(0,l.y8)(t)?t:(0,l.DB)(t)}catch(e){return(0,l.d1)(e)}return(0,l.DB)(this.executeWhereClause(e))}_fetchAndRefineFeatures(e,t,i){const r=new s.Z([],e,!1,null),a=Math.min(t,e.length);return this._parent._getFeatures(r,-1,a,i).then((()=>{if(this._checkCancelled(i),null==this._whereClauseFunction){for(let t=0;t<a;t++){const i=this._parent._featureFromCache(e[t]);!0===this.executeWhereClause(i)?this._idstates[e[t]]=n.dj.InFeatureSet:this._idstates[e[t]]=n.dj.NotInFeatureSet}return"success"}const r=[];for(let t=0;t<a;t++){const i=this._parent._featureFromCache(e[t]);r.push(this.executeWhereClauseDeferred(i))}return(0,l.$6)(r).then((i=>{for(let r=0;r<t;r++)!0===i[r]?this._idstates[e[r]]=n.dj.InFeatureSet:this._idstates[e[r]]=n.dj.NotInFeatureSet;return"success"}))}))}_getFilteredSet(e,t,i,r,n){return null!==this._whereClauseFunction||(null!==i?null!==this._whereclause&&(i=(0,a.$e)(this._whereclause,i)):i=this._whereclause),this._ensureLoaded().then((()=>this._parent._getFilteredSet(e,t,i,r,n))).then((e=>{let t;return this._checkCancelled(n),t=null!==this._whereClauseFunction?new s.Z(e._candidates.slice(0).concat(e._known.slice(0)),[],e._ordered,this._clonePageDefinition(e.pagesDefinition)):new s.Z(e._candidates.slice(0),e._known.slice(0),e._ordered,this._clonePageDefinition(e.pagesDefinition)),t}))}_stat(e,t,i,r,s,n,o){if(null!==this._whereClauseFunction)return null===s&&""===i&&null===r?this._manualStat(e,t,n,o):(0,l.DB)({calculated:!1});let u=this._whereclause;return null!==s&&null!==this._whereclause&&(u=(0,a.$e)(this._whereclause,s)),this._parent._stat(e,t,i,r,u,n,o).then((a=>!1===a.calculated?null===s&&""===i&&null===r?this._manualStat(e,t,n,o):{calculated:!1}:a))}_canDoAggregates(e,t,i,r,s){return null!==this._whereClauseFunction?(0,l.DB)(!1):(null!==s?null!==this._whereclause&&(s=(0,a.$e)(this._whereclause,s)):s=this._whereclause,null===this._parent?(0,l.DB)(!1):this._parent._canDoAggregates(e,t,i,r,s))}_getAggregatePagesDataSourceDefinition(e,t,i,r,s,n,o){return null===this._parent?(0,l.d1)(new Error("Should never be called")):(null!==s?null!==this._whereclause&&(s=(0,a.$e)(this._whereclause,s)):s=this._whereclause,this._parent._getAggregatePagesDataSourceDefinition(e,t,i,r,s,n,o))}static registerAction(){r.Z._featuresetFunctions.filter=function(e){if("function"==typeof e)return new h({parentfeatureset:this,whereclause:e});let t=null;return e instanceof o.WhereClause&&(t=e),new h({parentfeatureset:this,whereclause:t})}}}},85065:(e,t,i)=>{i.d(t,{Z:()=>o});var r=i(61363),s=i(91136),n=i(90961),a=i(3823),l=i(95330);class o extends s.Z{constructor(e){super(e),this._orderbyclause=null,this.declaredClass="esri.arcade.featureset.actions.OrderBy",this._maxProcessing=100,this._orderbyclause=e.orderbyclause,this._parent=e.parentfeatureset}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._getFilteredSet("",null,null,this._orderbyclause,e))).then((t=>(this._checkCancelled(e),this._wset=t,this._wset))):(0,l.DB)(this._wset)}manualOrderSet(e,t){return this.getIdColumnDictionary(e,[],-1,t).then((e=>{this._orderbyclause.order(e);const t=new n.Z([],[],!0,null);for(let i=0;i<e.length;i++)t._known.push(e[i].id);return t}))}getIdColumnDictionary(e,t,i,s){if(i<e._known.length-1){const n=this._maxQueryRate();if("GETPAGES"===e._known[i+1])return(0,r.X)(this._parent._expandPagedSet(e,n,0,0,s)).then((()=>this.getIdColumnDictionary(e,t,i,s)));let a=i+1;const l=[];for(;a<e._known.length&&"GETPAGES"!==e._known[a];)l.push(e._known[a]),a++;return i+=l.length,(0,r.X)(this._parent._getFeatureBatch(l,s)).then((r=>{this._checkCancelled(s);for(const e of r)t.push({id:e.attributes[this.objectIdField],feature:e});return this.getIdColumnDictionary(e,t,i,s)}))}return e._candidates.length>0?(0,r.X)(this._refineSetBlock(e,this._maxProcessingRate(),s)).then((()=>(this._checkCancelled(s),this.getIdColumnDictionary(e,t,i,s)))):(0,l.DB)(t)}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){if(void 0===this._featureCache[e]){const t=this._parent._featureFromCache(e);if(void 0===t)return;return null===t?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}_fetchAndRefineFeatures(){return(0,l.d1)(new Error("Fetch and Refine should not be called in this featureset"))}_getFilteredSet(e,t,i,r,s){return this._ensureLoaded().then((()=>this._parent._getFilteredSet(e,t,i,null===r?this._orderbyclause:r,s))).then((e=>{this._checkCancelled(s);const r=new n.Z(e._candidates.slice(0),e._known.slice(0),e._ordered,this._clonePageDefinition(e.pagesDefinition));let a=!0;return e._candidates.length>0&&(a=!1),!1===r._ordered?this.manualOrderSet(r,s).then((e=>(!1===a&&(null===t&&null===i||(e=new n.Z(e._candidates.slice(0).concat(e._known.slice(0)),[],e._ordered,this._clonePageDefinition(e.pagesDefinition)))),e))):r}))}static registerAction(){s.Z._featuresetFunctions.orderBy=function(e){return""===e?this:new o({parentfeatureset:this,orderbyclause:new a.Z(e)})}}}},63991:(e,t,i)=>{i.d(t,{Z:()=>l});var r=i(91136),s=i(90961),n=i(90658),a=i(95330);class l extends r.Z{constructor(e){super(e),this._topnum=0,this.declaredClass="esri.arcade.featureset.actions.Top",this._countedin=0,this._maxProcessing=100,this._topnum=e.topnum,this._parent=e.parentfeatureset}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._parent._getSet(e))).then((e=>(this._wset=new s.Z(e._candidates.slice(0),e._known.slice(0),!1,this._clonePageDefinition(e.pagesDefinition)),this._setKnownLength(this._wset)>this._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset))):(0,a.DB)(this._wset)}_setKnownLength(e){return e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===n.dj.NotInFeatureSet)return t;const i=this._idstates[e];return i===n.dj.InFeatureSet||i===n.dj.NotInFeatureSet?i:t===n.dj.InFeatureSet&&void 0===i?this._countedin<this._topnum?(this._idstates[e]=n.dj.InFeatureSet,this._countedin++,n.dj.InFeatureSet):(this._idstates[e]=n.dj.NotInFeatureSet,n.dj.NotInFeatureSet):n.dj.Unknown}_expandPagedSet(e,t,i,r,s){if(null===this._parent)return(0,a.d1)(new Error("Parent Paging not implemented"));if(t>this._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let t=e._known.length;return t>0&&"GETPAGES"===e._known[t-1]&&(e._known.length=t-1),t=e._candidates.length,t>0&&"GETPAGES"===e._candidates[t-1]&&(e._candidates.length=t-1),(0,a.DB)("success")}return this._parent._expandPagedSet(e,t,i,r,s).then((t=>(this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),t)))}_getFeatures(e,t,i,r){const n=[],l=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,l))return this._expandPagedSet(e,l,0,0,r).then((()=>this._getFeatures(e,t,i,r)));-1!==t&&void 0===this._featureCache[t]&&n.push(t);let o=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(o++,o<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&n.push(e._known[r]),n.length>l)));r++);if(0===n.length)return(0,a.DB)("success");const u=new s.Z([],n,!1,null),h=Math.min(n.length,i);return this._parent._getFeatures(u,-1,h,r).then((()=>{for(let e=0;e<h;e++){const t=this._parent._featureFromCache(n[e]);void 0!==t&&(this._featureCache[n[e]]=t)}return"success"}))}_getFilteredSet(e,t,i,r,n){return this._ensureLoaded().then((()=>this._getSet(n))).then((e=>new s.Z(e._candidates.slice(0).concat(e._known.slice(0)),[],!1,this._clonePageDefinition(e.pagesDefinition))))}_refineKnowns(e,t){let i=0,r=null;const s=[];for(let a=0;a<e._candidates.length;a++){const l=this._isInFeatureSet(e._candidates[a]);if(l===n.dj.InFeatureSet){if(e._known.push(e._candidates[a]),i+=1,null===r?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),e._known.length>=this._topnum)break}else if(l===n.dj.NotInFeatureSet)null===r?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),i+=1;else if(l===n.dj.Unknown)break;if(i>=t)break}null!==r&&s.push(r);for(let t=s.length-1;t>=0;t--)e._candidates.splice(s[t].start,s[t].end-s[t].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}_stat(){return(0,a.DB)({calculated:!1})}_canDoAggregates(){return(0,a.DB)(!1)}static registerAction(){r.Z._featuresetFunctions.top=function(e){return new l({parentfeatureset:this,topnum:e})}}}},17805:(e,t,i)=>{i.d(t,{Z:()=>f});var r=i(38171),s=i(91136),n=i(90961),a=i(90658),l=i(36515),o=i(95330),u=i(9361),h=i(3121),c=i(16451),d=i(1231),p=i(57444);class f extends s.Z{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return a.tI}end(){return this._layer}optimisePagingFeatureQueries(){}load(){return null===this._loadPromise&&(this._loadPromise=(0,o.Ue)(((e,t)=>{if(!0===this._layer.loaded)return this._initialiseFeatureSet(),void e(this);this._layer.when().then((()=>{try{this._initialiseFeatureSet(),e(this)}catch(e){t(e)}}),t),this._layer.load()}))),this._loadPromise}get gdbVersion(){return""}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._layer.outFields)if(1===this._layer.outFields.length&&"*"===this._layer.outFields[0]);else{const e=[];for(const t of this.fields)if("oid"===t.type)e.push(t);else for(const i of this._layer.outFields)if(i.toLowerCase()===t.name.toLowerCase()){e.push(t);break}this.fields=e}if(null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.hasM=this._layer.supportsM,this.hasZ=this._layer.supportsZ,this._databaseType=a.Bj.Standardised,this.typeIdField=this._layer.typeIdField,this.types=this._layer.types}isTable(){return this._forceIsTable||this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}_isInFeatureSet(){return a.dj.InFeatureSet}_candidateIdTransform(e){return e}_getSet(e){return null===this._wset?this._ensureLoaded().then((()=>this._getFilteredSet("",null,null,null,e))).then((e=>(this._wset=e,e))):(0,o.DB)(this._wset)}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new r.Z({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}_getFilteredSet(e,t,i,r,s){let u="",h=!1;if(null!==r&&(u=r.constructClause(),h=!0),this.isTable()&&t&&null!==e&&""!==e){const e=new n.Z([],[],!0,null);return(0,o.DB)(e)}const c=new p.Z;return c.where=null===i?null===t?"1=1":"":(0,l.zR)(i,a.Bj.Standardised),c.spatialRelationship=this._makeRelationshipEnum(e),c.outSpatialReference=this.spatialReference,c.orderByFields=""!==u?u.split(","):null,c.geometry=null===t?null:t,c.returnGeometry=!0,c.relationParameter=this._makeRelationshipParam(e),this._layer.queryFeatures(c).then((e=>{if(null===e)return new n.Z([],[],h,null);this._checkCancelled(s);const t=[];return e.features.forEach((e=>{const i=e.attributes[this._layer.objectIdField];t.push(i),this._featureCache[i]=this._changeFeature(e)})),new n.Z([],t,h,null)}))}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}_queryAllFeatures(){if(this._wset)return(0,o.DB)(this._wset);const e=new p.Z;return e.where="1=1",this._ensureLoaded().then((()=>{if(this._layer.source&&this._layer.source.items){const e=[];return this._layer.source.items.forEach((t=>{const i=t.attributes[this._layer.objectIdField];e.push(i),this._featureCache[i]=this._changeFeature(t)})),this._wset=new n.Z([],e,!1,null),this._wset}return this._layer.queryFeatures(e).then((e=>{const t=[];return e.features.forEach((e=>{const i=e.attributes[this._layer.objectIdField];t.push(i),this._featureCache[i]=this._changeFeature(e)})),this._wset=new n.Z([],t,!1,null),this._wset}))}))}_getFeatures(e,t,i){const r=[];-1!==t&&void 0===this._featureCache[t]&&r.push(t);for(let s=e._lastFetchedIndex;s<e._known.length&&(e._lastFetchedIndex+=1,!(void 0===this._featureCache[e._known[s]]&&(e._known[s]!==t&&r.push(e._known[s]),r.length>i)));s++);return 0===r.length?(0,o.DB)("success"):(0,o.d1)(new Error("Unaccounted for Features. Not in Feature Collection"))}_refineSetBlock(e){return(0,o.DB)(e)}_stat(){return(0,o.DB)({calculated:!1})}_canDoAggregates(){return(0,o.DB)(!1)}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title,canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField?e.layerDefinition.typeIdField:"",s=[];if(e.layerDefinition.types)for(const t of e.layerDefinition.types)s.push(c.Z.fromJSON(t));let n=e.layerDefinition.geometryType;void 0===n&&(n=e.featureSet.geometryType||"");let a=e.featureSet.features;const l=t.toJSON();if(""===i||void 0===i){let t=!1;for(const r of e.layerDefinition.fields)if("oid"===r.type||"esriFieldTypeOID"===r.type){i=r.name,t=!0;break}if(!1===t){let t="FID",r=!0,s=0;for(;r;){let i=!0;for(const r of e.layerDefinition.fields)if(r.name===t){i=!1;break}!0===i?r=!1:(s++,t="FID"+s.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const n=[];for(let i=0;i<a.length;i++)n.push({geometry:e.featureSet.features[i].geometry,attributes:e.featureSet.features[i].attributes?this._cloneAttr(e.featureSet.features[i].attributes):{}}),n[i].attributes[t]=i;a=n,i=t}}const o=[];for(const t of e.layerDefinition.fields)t instanceof d.Z?o.push(t):o.push(d.Z.fromJSON(t));let p=n;switch(p){case"esriGeometryPoint":p="point";break;case"esriGeometryPolyline":p="polyline";break;case"esriGeometryPolygon":p="polygon";break;case"esriGeometryExtent":p="extent";break;case"esriGeometryMultipoint":p="multipoint"}for(const e of a)e.geometry&&e.geometry instanceof u.Z==0&&(e.geometry.type=p,void 0===e.geometry.spatialReference&&(e.geometry.spatialReference=l));const _={outFields:["*"],source:a,fields:o,types:s,typeIdField:r,objectIdField:i,spatialReference:t};_.geometryType=p||"point";const y=new h.default(_);return new f({layer:y,spatialReference:t,isTable:null===p||""===p})}queryAttachments(){return(0,o.DB)([])}getFeatureByObjectId(e){const t=new p.Z;return t.where=this.objectIdField+"="+e.toString(),this._layer.queryFeatures(t).then((e=>1===e.features.length?e.features[0]:null))}getOwningSystemUrl(){return(0,o.DB)("")}getIdentityUser(){return(0,o.DB)("")}}},3823:(e,t,i)=>{function r(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}i.d(t,{Z:()=>s});class s{constructor(e){const t=e.split(",");this._fields=[],this._directions=[];for(let e=0;e<t.length;e++){const i=t[e].match(/\S+/g);this._fields.push(i[0]),2===i.length?"asc"===i[1].toLowerCase()?this._directions.push(1):this._directions.push(0):this._directions.push(1)}}constructClause(){let e="";for(let t=0;t<this._fields.length;t++)0!==t&&(e+=","),e+=this._fields[t],1===this._directions[t]?e+=" ASC":e+=" DESC";return e}order(e){e.sort(((e,t)=>{for(let i=0;i<this._fields.length;i++){const s=this.featureValue(e.feature,this._fields[i],i),n=this.featureValue(t.feature,this._fields[i],i);let a=0;if(a=1===this._directions[i]?r(s,n):-1*r(s,n),0!==a)return a}return 0}))}scanForField(e){for(let t=0;t<this._fields.length;t++)if(this._fields[t].toLowerCase().trim()===e.toLowerCase().trim())return!0;return!1}replaceFields(e){let t="";for(let i=0;i<this._fields.length;i++){0!==i&&(t+=",");let r=this._fields[i];for(const t of e)if(r.toLowerCase()===t.field.toLowerCase()){r=t.newfield;break}t+=r,1===this._directions[i]?t+=" ASC":t+=" DESC"}return new s(t)}featureValue(e,t,i){const r=e.attributes[t];if(void 0!==r)return r;for(const r in e.attributes)if(t.toLowerCase()===r.toLowerCase())return this._fields[i]=r,e.attributes[r];return null}}},25929:(e,t,i)=>{i.d(t,{M:()=>p,f:()=>n,i:()=>c,p:()=>_,r:()=>l,t:()=>a,w:()=>o});var r=i(70586),s=i(17452);function n(e,t){const i=t&&t.url&&t.url.path;if(e&&i&&(e=(0,s.hF)(e,i,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const i=(0,s.PF)(e,t.portalItem.itemUrl);h.test(i)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(i).path)}return d(e,t&&t.portal)}function a(e,t,i=p.YES){if(!e)return e;!(0,s.YP)(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let r=(0,s.hF)(e);if(t){const i=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(i){const n=d(i,t.portal);r=(0,s.PF)(d(r,t.portal),n,n),r!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(r)}}return r=function(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,s.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}(r,t&&t.portal),(0,s.YP)(r)&&(r=(0,s.Fv)(r)),t?.resources&&t?.portalItem&&!(0,s.YP)(r)&&!(0,s.HK)(r)&&i===p.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(r)}),r}function l(e,t,i){return n(e,i)}function o(e,t,i,r){const s=a(e,r);void 0!==s&&(t[i]=s)}const u=/\/items\/([^\/]+)\/resources\//,h=/^\.\/resources\//;function c(e){const t=(0,r.pC)(e)?e.match(u):null;return(0,r.pC)(t)?t[1]:null}function d(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const i=`${t.urlKey}.${t.customBaseUrl}`,r=(0,s.TI)();return(0,s.D6)(r,`${r.scheme}://${i}`)?(0,s.Ie)(e,t.portalHostname,i):(0,s.Ie)(e,i,t.portalHostname)}var p,f;(f=p||(p={}))[f.YES=0]="YES",f[f.NO=1]="NO";const _=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:n,toJSON:a,read:l,write:o,itemIdFromResourceUrl:c,get MarkKeep(){return p}},Symbol.toStringTag,{value:"Module"}))},80539:(e,t,i)=>{i.d(t,{Z:()=>T});var r,s=i(43697),n=i(3894),a=i(32448),l=i(22974),o=i(70586),u=i(71143);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(r||(r={}));var h,c=i(1654),d=i(5600),p=i(75215),f=i(52421),_=i(52011),y=i(58971),g=i(39020);class m{constructor(){this._observers=[]}observe(e){return this._observers.includes(e)||this._observers.push(e),new g.X(this._observers,e)}notify(){const e=this._observers.slice();for(let t=0;t<e.length;++t){const i=e[t];i.onInvalidated(),i.onCommitted()}}}const b=new u.Z(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1})),w=()=>{};function v(e){return e?e instanceof E?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function S(e){if(e&&e.length)return e[0]}function F(e,t,i,r){const s=Math.min(e.length-i,t.length-r);let n=0;for(;n<s&&e[i+n]===t[r+n];)n++;return n}function I(e,t,i,r){t&&t.forEach(((t,s,n)=>{e.push(t),I(e,i.call(r,t,s,n),i,r)}))}const C=new Set,x=new Set,D=new Set,R=new Map;let k=0,E=h=class extends a.Z.EventedAccessor{constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new m,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:k++})}static isCollection(e){return null!=e&&e instanceof h}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof h?{items:e}:e:{}}destroy(){this.removeAll()}*[Symbol.iterator](){yield*this.items}get items(){return(0,y.it)(this._observable),this._items}set items(e){this._emitBeforeChanges(r.ADD)||(this._splice(0,this.length,v(e)),this._emitAfterChanges(r.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,i={removed:!1,callback:t};return e.push(i),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=w,i.removed=!0,e.splice(e.indexOf(i),1)}}}return this._emitter.on(e,t)}once(e,t){const i=this.on(e,t);return{remove(){i.remove()}}}add(e,t){if((0,y.it)(this._observable),this._emitBeforeChanges(r.ADD))return this;const i=this.getNextIndex(t??null);return this._splice(i,0,[e]),this._emitAfterChanges(r.ADD),this}addMany(e,t=this._items.length){if((0,y.it)(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(r.ADD))return this;const i=this.getNextIndex(t);return this._splice(i,0,v(e)),this._emitAfterChanges(r.ADD),this}at(e){if((0,y.it)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,y.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return[];const e=this._splice(0,this.length)||[];return this._emitAfterChanges(r.REMOVE),e}clone(){return(0,y.it)(this._observable),this._createNewInstance({items:this._items.map(l.d9)})}concat(...e){(0,y.it)(this._observable);const t=e.map(v);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,y.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const i=(0,o.j0)(this._splice(0,this.length)),s=i.length;for(let r=0;r<s;r++)e.call(t,i[r],r,i);this._emitAfterChanges(r.REMOVE)}every(e,t){return(0,y.it)(this._observable),this._items.every(e,t)}filter(e,t){let i;return(0,y.it)(this._observable),i=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:i})}find(e,t){return(0,y.it)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,y.it)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,y.it)(this._observable);const i=[];return I(i,this,e,t),new h(i)}forEach(e,t){return(0,y.it)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,y.it)(this._observable),this._items[e]}getNextIndex(e){(0,y.it)(this._observable);const t=this.length;return(e=null==e?t:e)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,y.it)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,y.it)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,y.it)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,y.it)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,y.it)(this._observable);const i=this._items.map(e,t);return new h({items:i})}reorder(e,t=this.length-1){(0,y.it)(this._observable);const i=this.indexOf(e);if(-1!==i){if(t<0?t=0:t>=this.length&&(t=this.length-1),i!==t){if(this._emitBeforeChanges(r.MOVE))return e;this._splice(i,1),this._splice(t,0,[e]),this._emitAfterChanges(r.MOVE)}return e}}pop(){if((0,y.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const e=S(this._splice(this.length-1,1));return this._emitAfterChanges(r.REMOVE),e}push(...e){return(0,y.it)(this._observable),this._emitBeforeChanges(r.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(r.ADD)),this.length}reduce(e,t){(0,y.it)(this._observable);const i=this._items;return 2===arguments.length?i.reduce(e,t):i.reduce(e)}reduceRight(e,t){(0,y.it)(this._observable);const i=this._items;return 2===arguments.length?i.reduceRight(e,t):i.reduceRight(e)}remove(e){return(0,y.it)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,y.it)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(r.REMOVE))return;const t=S(this._splice(e,1));return this._emitAfterChanges(r.REMOVE),t}removeMany(e){if((0,y.it)(this._observable),!e||!e.length||this._emitBeforeChanges(r.REMOVE))return[];const t=e instanceof h?e.toArray():e,i=this._items,s=[],n=t.length;for(let e=0;e<n;e++){const r=t[e],n=i.indexOf(r);if(n>-1){const r=1+F(t,i,e+1,n+1),a=this._splice(n,r);a&&a.length>0&&s.push.apply(s,a),e+=r-1}}return this._emitAfterChanges(r.REMOVE),s}reverse(){if((0,y.it)(this._observable),this._emitBeforeChanges(r.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(r.MOVE),this}shift(){if((0,y.it)(this._observable),!this.length||this._emitBeforeChanges(r.REMOVE))return;const e=S(this._splice(0,1));return this._emitAfterChanges(r.REMOVE),e}slice(e=0,t=this.length){return(0,y.it)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,y.it)(this._observable),this._items.some(e,t)}sort(e){if((0,y.it)(this._observable),!this.length||this._emitBeforeChanges(r.MOVE))return this;const t=(0,o.j0)(this._splice(0,this.length));return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(r.MOVE),this}splice(e,t,...i){(0,y.it)(this._observable);const s=(t?r.REMOVE:0)|(i.length?r.ADD:0);if(this._emitBeforeChanges(s))return[];const n=this._splice(e,t,i)||[];return this._emitAfterChanges(s),n}toArray(){return(0,y.it)(this._observable),this._items.slice()}toJSON(){return(0,y.it)(this._observable),this.toArray()}toLocaleString(){return(0,y.it)(this._observable),this._items.toLocaleString()}toString(){return(0,y.it)(this._observable),this._items.toString()}unshift(...e){return(0,y.it)(this._observable),!e.length||this._emitBeforeChanges(r.ADD)||(this._splice(0,0,e),this._emitAfterChanges(r.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,i){const r=this._items,s=this.itemType;let n,a;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=(0,c.Os)((()=>this._dispatchChange()))),t){if(a=r.splice(e,t),this.hasEventListener("before-remove")){const t=b.acquire();t.target=this,t.cancellable=!0;for(let i=0,s=a.length;i<s;i++)n=a[i],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(a.splice(i,1),r.splice(e,0,n),e+=1,i-=1,s-=1);b.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=b.acquire();e.target=this,e.cancellable=!1;const t=a.length;for(let i=0;i<t;i++)e.reset(a[i]),this.emit("after-remove",e);b.release(e)}}if(i&&i.length){if(s){const e=[];for(const t of i){const i=s.ensureType(t);null==i&&null!=t||e.push(i)}i=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),a=e===this.length;if(t||n){const s=b.acquire();s.target=this,s.cancellable=!0;const l=b.acquire();l.target=this,l.cancellable=!1;for(const o of i)t?(s.reset(o),this.emit("before-add",s),s.defaultPrevented||(a?r.push(o):r.splice(e++,0,o),this._set("length",r.length),n&&(l.reset(o),this.emit("after-add",l)))):(a?r.push(o):r.splice(e++,0,o),this._set("length",r.length),l.reset(o),this.emit("after-add",l));b.release(l),b.release(s)}else{if(a)for(const e of i)r.push(e);else r.splice(e,0,...i);this._set("length",r.length)}}return(i&&i.length||a&&a.length)&&this._notifyChangeEvent(i,a),a}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const i=b.acquire();i.target=this,i.cancellable=!0,i.type=e,this.emit("before-changes",i),t=i.defaultPrevented,b.release(i)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=b.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),b.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;C.clear(),x.clear(),D.clear();for(const{added:t,removed:i}of e){if(t)if(0===D.size&&0===x.size)for(const e of t)C.add(e);else for(const e of t)x.has(e)?(D.add(e),x.delete(e)):D.has(e)||C.add(e);if(i)if(0===D.size&&0===C.size)for(const e of i)x.add(e);else for(const e of i)C.has(e)?C.delete(e):(D.delete(e),x.add(e))}const i=n.Z.acquire();C.forEach((e=>{i.push(e)}));const r=n.Z.acquire();x.forEach((e=>{r.push(e)}));const s=this._items,a=t.items,l=n.Z.acquire();if(D.forEach((e=>{a.indexOf(e)!==s.indexOf(e)&&l.push(e)})),t.listeners&&(i.length||r.length||l.length)){const e={target:this,added:i,removed:r,moved:l},s=t.listeners.length;for(let i=0;i<s;i++){const r=t.listeners[i];r.removed||r.callback.call(this,e)}}n.Z.release(i),n.Z.release(r),n.Z.release(l)}C.clear(),x.clear(),D.clear()}};E.ofType=e=>{if(!e)return h;if(R.has(e))return R.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const i in e.typeMap){const r=e.typeMap[i].prototype.declaredClass;t?t+=` | ${r}`:t=r}let i=class extends h{};return(0,s._)([(0,f.c)({Type:e,ensureType:"function"==typeof e?(0,p.se)(e):(0,p.N7)(e)})],i.prototype,"itemType",void 0),i=(0,s._)([(0,_.j)(`esri.core.Collection<${t}>`)],i),R.set(e,i),i},(0,s._)([(0,d.Cb)()],E.prototype,"length",void 0),(0,s._)([(0,d.Cb)()],E.prototype,"items",null),E=h=(0,s._)([(0,_.j)("esri.core.Collection")],E);const T=E},32448:(e,t,i)=>{i.d(t,{Z:()=>o});var r=i(43697),s=i(15923),n=i(50758),a=i(52011);class l{constructor(){this._emitter=new l.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this.target=e,this._listenersMap=null}clear(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null}emit(e,t){const i=this._listenersMap&&this._listenersMap.get(e);if(!i)return!1;const r=this.target||this;return[...i].forEach((e=>{e.call(r,t)})),i.length>0}on(e,t){if(Array.isArray(e)){const i=e.map((e=>this.on(e,t)));return(0,n.AL)(i)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const i=this._listenersMap.get(e)||[];return i.push(t),this._listenersMap.set(e,i),{remove:()=>{const i=this._listenersMap&&this._listenersMap.get(e)||[],r=i.indexOf(t);r>=0&&i.splice(r,1)}}}once(e,t){const i=this.on(e,(e=>{i.remove(),t.call(null,e)}));return i}hasEventListener(e){const t=this._listenersMap&&this._listenersMap.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let i=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return i=(0,r._)([(0,a.j)("esri.core.Evented")],i),i};let i=class extends s.Z{constructor(){super(...arguments),this._emitter=new l.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};i=(0,r._)([(0,a.j)("esri.core.Evented")],i),e.EventedAccessor=i}(l||(l={}));const o=l},61247:(e,t,i)=>{i.d(t,{Z:()=>h});var r=i(43697),s=i(15923),n=i(80539),a=i(70586),l=i(5600),o=i(52011);let u=class extends s.Z{constructor(e){super(e),this._groups=new Map}destroy(){this.removeAll()}get size(){let e=0;return this._groups.forEach((t=>{e+=t.length})),e}add(e,t){if(!this._isHandle(e)&&!Array.isArray(e)&&!n.Z.isCollection(e))return this;const i=this._getOrCreateGroup(t);return Array.isArray(e)||n.Z.isCollection(e)?e.forEach((e=>this._isHandle(e)&&i.push(e))):i.push(e),this.notifyChange("size"),this}forEach(e,t){if("function"==typeof e)this._groups.forEach((t=>t.forEach(e)));else{const i=this._getGroup(e);i&&t&&i.forEach(t)}}has(e){return this._groups.has(this._ensureGroupKey(e))}remove(e){if(Array.isArray(e)||n.Z.isCollection(e))return e.forEach(this.remove,this),this;if(!this.has(e))return this;const t=this._getGroup(e);for(let e=0;e<t.length;e++)t[e].remove();return this._deleteGroup(e),this.notifyChange("size"),this}removeAll(){return this._groups.forEach((e=>{for(let t=0;t<e.length;t++)e[t].remove()})),this._groups.clear(),this.notifyChange("size"),this}_isHandle(e){return e&&!!e.remove}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const t=[];return this._groups.set(this._ensureGroupKey(e),t),t}_getGroup(e){return(0,a.j0)(this._groups.get(this._ensureGroupKey(e)))}_deleteGroup(e){return this._groups.delete(this._ensureGroupKey(e))}_ensureGroupKey(e){return e||"_default_"}};(0,r._)([(0,l.Cb)({readOnly:!0})],u.prototype,"size",null),u=(0,r._)([(0,o.j)("esri.core.Handles")],u);const h=u},69801:(e,t,i)=>{i.d(t,{WJ:()=>o,Xq:()=>l});var r,s,n=i(70586),a=i(44553);(s=r||(r={}))[s.ALL=0]="ALL",s[s.SOME=1]="SOME";class l{constructor(e,t,i){this._namespace=e,this._storage=t,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),this._namespace+=":",i&&(this._storage.registerRemoveFunc(this._namespace,i),this._removeFunc=!0)}destroy(){this._storage.clear(this._namespace),this._removeFunc&&this._storage.deregisterRemoveFunc(this._namespace),this._storage.deregister(this),this._storage=null}get namespace(){return this._namespace.slice(0,-1)}get hitRate(){return this._hit/(this._hit+this._miss)}get size(){return this._storage.size}get maxSize(){return this._storage.maxSize}resetHitRate(){this._hit=this._miss=0}put(e,t,i,r=0){this._storage.put(this._namespace+e,t,i,r)}get(e){const t=this._storage.get(this._namespace+e);return void 0===t?++this._miss:++this._hit,t}pop(e){const t=this._storage.pop(this._namespace+e);return void 0===t?++this._miss:++this._hit,t}updateSize(e,t,i){this._storage.updateSize(this._namespace+e,t,i)}clear(){this._storage.clear(this._namespace)}clearAll(){this._storage.clearAll()}getStats(){return this._storage.getStats()}resetStats(){this._storage.resetStats()}}class o{constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new a.Z,this._users=new a.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get size(){return this._size}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimit()}put(e,t,i,s){const n=this._db.get(e);if(n&&(this._size-=n.size,this._db.delete(e),n.entry!==t&&this._notifyRemove(e,n.entry,r.ALL)),i>this._maxSize)return void this._notifyRemove(e,t,r.ALL);if(void 0===t)return void console.warn("Refusing to cache undefined entry ");if(!i||i<0)return void console.warn("Refusing to cache entry with invalid size "+i);const a=1+Math.max(s,-3)- -3;this._db.set(e,{entry:t,size:i,lifetime:a,lives:a}),this._size+=i,this._checkSizeLimit()}updateSize(e,t,i){const s=this._db.get(e);if(s&&s.entry===t){for(this._size-=s.size;i>this._maxSize;){const s=this._notifyRemove(e,t,r.SOME);if(!((0,n.pC)(s)&&s>0))return void this._db.delete(e);i=s}s.size=i,this._size+=i,this._checkSizeLimit()}}pop(e){const t=this._db.get(e);if(t)return this._size-=t.size,this._db.delete(e),++this._hit,t.entry;++this._miss}get(e){const t=this._db.get(e);if(void 0!==t)return this._db.delete(e),t.lives=t.lifetime,this._db.set(e,t),++this._hit,t.entry;++this._miss}getStats(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach(((e,r)=>{const s=e.lifetime;i[s]=(i[s]||0)+e.size,this._users.forAll((i=>{const s=i.namespace;if(r.startsWith(s)){const i=t[s]||0;t[s]=i+e.size}}))}));const r={};this._users.forAll((e=>{const i=e.namespace;if(!isNaN(e.hitRate)&&e.hitRate>0){const s=t[i]||0;t[i]=s,r[i]=Math.round(100*e.hitRate)+"%"}else r[i]="0%"}));const s=Object.keys(t);s.sort(((e,i)=>t[i]-t[e])),s.forEach((i=>e[i]=Math.round(t[i]/2**20)+"MB / "+r[i]));for(let t=i.length-1;t>=0;--t){const r=i[t];r&&(e["Priority "+(t+-3-1)]=Math.round(r/this.size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){this._db.forEach(((t,i)=>{i.startsWith(e)&&(this._size-=t.size,this._db.delete(i),this._notifyRemove(i,t.entry,r.ALL))}))}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,r.ALL))),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i){let r;return this._removeFuncs.some((s=>{if(e.startsWith(s[0])){const e=s[1](t,i);return"number"==typeof e&&(r=e),!0}return!1})),r}_checkSizeLimit(){if(!(this._size<=this._maxSize))for(const[e,t]of this._db){if(this._db.delete(e),t.lives<=1){this._size-=t.size;const i=this._notifyRemove(e,t.entry,r.SOME);(0,n.pC)(i)&&i>0&&(this._size+=i,t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t);if(this._size<=.9*this.maxSize)return}}}},52421:(e,t,i)=>{function r(e){return(t,i)=>{t[i]=e}}i.d(t,{c:()=>r})},22862:(e,t,i)=>{i.d(t,{Hg:()=>_,V7:()=>f,uD:()=>p});var r=i(15923),s=i(80539),n=i(70586),a=i(1153);const l=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function o(e){return e instanceof r.Z}function u(e){return e instanceof s.Z?Object.keys(e.items):o(e)?(0,a.vw)(e).keys():e?Object.keys(e):[]}function h(e,t){return e instanceof s.Z?e.items[t]:e[t]}function c(e){return e?e.declaredClass:null}function d(e,t){const i=e.diff;if(i&&"function"==typeof i)return i(e,t);const r=u(e),s=u(t);if(0===r.length&&0===s.length)return;if(!r.length||!s.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const a=s.filter((e=>!r.includes(e))),p=r.filter((e=>!s.includes(e))),f=r.filter((i=>s.includes(i)&&h(e,i)!==h(t,i))).concat(a,p).sort(),_=c(e);if(_&&l.includes(_)&&f.length)return{type:"complete",oldValue:e,newValue:t};let y;const g=o(e)&&o(t);for(const r of f){const s=h(e,r),a=h(t,r);let l;(g||"function"!=typeof s&&"function"!=typeof a)&&s!==a&&(null==s&&null==a||(l=i&&i[r]&&"function"==typeof i[r]?i[r](s,a):"object"==typeof s&&"object"==typeof a&&c(s)===c(a)?d(s,a):{type:"complete",oldValue:s,newValue:a},(0,n.pC)(l)&&((0,n.pC)(y)?y.diff[r]=l:y={type:"partial",diff:{[r]:l}})))}return y}function p(e,t){if((0,n.Wi)(e))return!1;const i=t.split(".");let r=e;for(const e of i){if("complete"===r.type)return!0;if("partial"!==r.type)return!1;{const t=r.diff[e];if(!t)return!1;r=t}}return!0}function f(e,t){for(const i of t)if(p(e,i))return!0;return!1}function _(e,t){if(!("function"==typeof e||"function"==typeof t||(0,n.Wi)(e)&&(0,n.Wi)(t)))return(0,n.Wi)(e)||(0,n.Wi)(t)||"object"==typeof e&&"object"==typeof t&&c(e)!==c(t)?{type:"complete",oldValue:e,newValue:t}:d(e,t)}},66643:(e,t,i)=>{i.d(t,{Ed:()=>n,UI:()=>a,mt:()=>o,q6:()=>l});var r=i(70586),s=i(95330);function n(e,t,i){return(0,s.as)(e.map(((e,r)=>t.apply(i,[e,r]))))}async function a(e,t,i){return(await(0,s.as)(e.map(((e,r)=>t.apply(i,[e,r]))))).map((e=>e.value))}async function l(e){if((0,r.Wi)(e))return{ok:!1,error:new Error("no promise provided")};try{return{ok:!0,value:await e}}catch(e){return{ok:!1,error:e}}}async function o(e){try{return{ok:!0,value:await e}}catch(e){return(0,s.r9)(e),{ok:!1,error:e}}}},17445:(e,t,i)=>{i.d(t,{N1:()=>d,YP:()=>o,Z_:()=>_,gx:()=>u,nn:()=>y,on:()=>c,tX:()=>g});var r=i(91460),s=i(50758),n=i(70586),a=i(95330),l=i(26258);function o(e,t,i={}){return h(e,t,i,p)}function u(e,t,i={}){return h(e,t,i,f)}function h(e,t,i={},r){let s=null;const a=i.once?(e,i)=>{r(e)&&((0,n.hw)(s),t(e,i))}:(e,i)=>{r(e)&&t(e,i)};if(s=(0,l.aQ)(e,a,i.sync,i.equals),i.initial){const t=e();a(t,t)}return s}function c(e,t,i,a={}){let l=null,u=null,h=null;function c(){l&&u&&(u.remove(),a.onListenerRemove?.(l),l=null,u=null)}function d(e){a.once&&a.once&&(0,n.hw)(h),i(e)}const p=o(e,((e,i)=>{c(),(0,r.vT)(e)&&(l=e,u=(0,r.on)(e,t,d),a.onListenerAdd?.(e))}),{sync:a.sync,initial:!0});return h=(0,s.kB)((()=>{p.remove(),c()})),h}function d(e,t){return function(e,t,i){if((0,a.Hc)(i))return Promise.reject((0,a.zE)());const r=e();if(t?.(r))return Promise.resolve(r);let l=null;function o(){l=(0,n.hw)(l)}return new Promise(((r,n)=>{l=(0,s.AL)([(0,a.fu)(i,(()=>{o(),n((0,a.zE)())})),h(e,(e=>{o(),r(e)}),{sync:!1,once:!0},t??p)])}))}(e,f,t)}function p(e){return!0}function f(e){return!!e}i(87538);const _={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},42033:(e,t,i)=>{i.d(t,{E:()=>s,_:()=>n});var r=i(70586);async function s(e,t){const{WhereClause:r}=await Promise.resolve().then(i.bind(i,41534));return r.create(e,t)}function n(e,t){return(0,r.pC)(e)?(0,r.pC)(t)?`(${e}) AND (${t})`:e:t}},60437:(e,t,i)=>{i.d(t,{Gv:()=>y,JR:()=>p,TC:()=>a,Tn:()=>h,Ue:()=>s,al:()=>n,cS:()=>d,dp:()=>o,fS:()=>_,op:()=>u,pp:()=>l,t8:()=>c});var r=i(70586);function s(e=g){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function n(e,t,i,r,n,a,l=s()){return l[0]=e,l[1]=t,l[2]=i,l[3]=r,l[4]=n,l[5]=a,l}function a(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function o(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function u(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function h(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function c(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function d(e){return e?c(e,y):s(y)}function p(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function f(e){return 6===e.length}function _(e,t,i){if((0,r.Wi)(e)||(0,r.Wi)(t))return e===t;if(!f(e)||!f(t))return!1;if(i){for(let r=0;r<e.length;r++)if(!i(e[r],t[r]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}i(6570),i(24470);const y=[1/0,1/0,1/0,-1/0,-1/0,-1/0],g=[0,0,0,0,0,0];s()},24470:(e,t,i)=>{i.d(t,{Gv:()=>p,HH:()=>o,SO:()=>u,Ue:()=>n,al:()=>a,jE:()=>h,kK:()=>c,oJ:()=>l,r3:()=>d}),i(80442),i(22021);var r=i(70586),s=i(6570);function n(e=f){return[e[0],e[1],e[2],e[3]]}function a(e,t,i,r,s=n()){return s[0]=e,s[1]=t,s[2]=i,s[3]=r,s}function l(e,t=n()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function o(e,t){return new s.Z({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}function u(e){return function(e){return(0,r.Wi)(e)||e[0]>=e[2]?0:e[2]-e[0]}(e)*function(e){return e[1]>=e[3]?0:e[3]-e[1]}(e)}function h(e,t,i){return t>=e[0]&&i>=e[1]&&t<=e[2]&&i<=e[3]}function c(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function d(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}const p=[1/0,1/0,-1/0,-1/0],f=[0,0,0,0]},82526:(e,t,i)=>{i.d(t,{aX:()=>C});var r=i(68773),s=i(20102),n=i(92604),a=i(70586),l=i(38913),o=i(58901),u=i(82971),h=i(33955),c=i(8744);const d={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new o.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:u.Z.WebMercator}),minus180Line:new o.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:u.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new o.Z({paths:[[[180,-180],[180,180]]],spatialReference:u.Z.WGS84}),minus180Line:new o.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:u.Z.WGS84})}};function p(e,t){return Math.ceil((e-t)/(2*t))}function f(e,t){const i=_(e);for(const e of i)for(const i of e)i[0]+=t;return e}function _(e){return(0,h.oU)(e)?e.rings:e.paths}var y=i(40488),g=(i(66577),i(3172)),m=i(17452);const b=n.Z.getLogger("esri.geometry.support.normalizeUtils");function w(e){return"polygon"===e[0].type}function v(e){return"polyline"===e[0].type}function S(e,t,i){if(t){const t=function(e,t){if(!(e instanceof o.Z||e instanceof l.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw b.error(e),new s.Z(e)}const i=_(e),r=[];for(const e of i){const i=[];r.push(i),i.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const s=e[r][0],n=e[r][1],a=e[r+1][0],l=e[r+1][1],o=Math.sqrt((a-s)*(a-s)+(l-n)*(l-n)),u=(l-n)/o,h=(a-s)/o,c=o/t;if(c>1){for(let e=1;e<=c-1;e++){const r=e*t,a=h*r+s,l=u*r+n;i.push([a,l])}const e=(o+Math.floor(c-1)*t)/2,r=h*e+s,a=u*e+n;i.push([r,a])}i.push([a,l])}}return function(e){return"polygon"===e.type}(e)?new l.Z({rings:r,spatialReference:e.spatialReference}):new o.Z({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,y.Sx)(t,!0)}return i&&(e=f(e,i)),e}function F(e,t,i){if(Array.isArray(e)){const r=e[0];if(r>t){const i=p(r,t);e[0]=r+i*(-2*t)}else if(r<i){const t=p(r,i);e[0]=r+t*(-2*i)}}else{const r=e.x;if(r>t){const i=p(r,t);e=e.clone().offset(i*(-2*t),0)}else if(r<i){const t=p(r,i);e=e.clone().offset(t*(-2*i),0)}}return e}function I(e,t){let i=-1;for(let r=0;r<t.cutIndexes.length;r++){const s=t.cutIndexes[r],n=t.geometries[r],a=_(n);for(let e=0;e<a.length;e++){const t=a[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const r=t[e][0];i=r>i?r:i}i=Number(i.toFixed(9));const r=-360*p(i,180);for(let i=0;i<t.length;i++){const t=n.getPoint(e,i);n.setPoint(e,i,t.clone().offset(r,0))}return!0}}))}if(s===i){if(w(e))for(const t of _(n))e[s]=e[s].addRing(t);else if(v(e))for(const t of _(n))e[s]=e[s].addPath(t)}else i=s,e[s]=n}return e}async function C(e,t,i){if(!Array.isArray(e))return C([e],t);t&&"string"!=typeof t&&b.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??r.Z.geometryServiceUrl;let n,u,_,w,v,x,D,R,k=0;const E=[],T=[];for(const t of e)if((0,a.Wi)(t))T.push(t);else if(n||(n=t.spatialReference,u=(0,c.C5)(n),_=n.isWebMercator,x=_?102100:4326,w=d[x].maxX,v=d[x].minX,D=d[x].plus180Line,R=d[x].minus180Line),u)if("mesh"===t.type)T.push(t);else if("point"===t.type)T.push(F(t.clone(),w,v));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>F(e,w,v))),T.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,u);T.push(e.rings?new l.Z(e):e)}else if(t.extent){const e=t.extent,i=p(e.xmin,v)*(2*w);let r=0===i?t.clone():f(t.clone(),i);e.offset(i,0),e.intersects(D)&&e.xmax!==w?(k=e.xmax>k?e.xmax:k,r=S(r,_),E.push(r),T.push("cut")):e.intersects(R)&&e.xmin!==v?(k=e.xmax*(2*w)>k?e.xmax*(2*w):k,r=S(r,_,360),E.push(r),T.push("cut")):T.push(r)}else T.push(t.clone());else T.push(t);let A=p(k,w),P=-90;const N=A,L=new o.Z;for(;A>0;){const e=360*A-180;L.addPath([[e,P],[e,-1*P]]),P*=-1,A--}if(E.length>0&&N>0){const t=I(E,await async function(e,t,i,r){const s="string"==typeof e?(0,m.mN)(e):e,n=t[0].spatialReference,a={...r,query:{...s.query,f:"json",sr:JSON.stringify(n),target:JSON.stringify({geometryType:(0,h.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},l=await(0,g.default)(s.path+"/cut",a),{cutIndexes:o,geometries:u=[]}=l.data;return{cutIndexes:o,geometries:u.map((e=>{const t=(0,h.im)(e);return t.spatialReference=n,t}))}}(s,E,L,i)),r=[],n=[];for(let i=0;i<T.length;i++){const s=T[i];if("cut"!==s)n.push(s);else{const s=t.shift(),l=e[i];(0,a.pC)(l)&&"polygon"===l.type&&l.rings&&l.rings.length>1&&s.rings.length>=l.rings.length?(r.push(s),n.push("simplify")):n.push(_?(0,y.$)(s):s)}}if(!r.length)return n;const l=await async function(e,t,i){const r="string"==typeof e?(0,m.mN)(e):e,s=t[0].spatialReference,n=(0,h.Ji)(t[0]),a={...i,query:{...r.query,f:"json",sr:s.wkid?s.wkid:JSON.stringify(s),geometries:JSON.stringify((l=t,{geometryType:(0,h.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}};var l;return function(e,t,i){const r=(0,h.q9)(t);return e.map((e=>{const t=r.fromJSON(e);return t.spatialReference=i,t}))}((await(0,g.default)(r.path+"/simplify",a)).data,n,s)}(s,r,i),o=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?o.push(t):o.push(_?(0,y.$)(l.shift()):l.shift())}return o}const O=[];for(let e=0;e<T.length;e++){const t=T[e];if("cut"!==t)O.push(t);else{const e=E.shift();O.push(!0===_?(0,y.$)(e):e)}}return O}},69285:(e,t,i)=>{i.d(t,{k:()=>a});var r=i(70586),s=i(67900),n=i(8744);function a(e,t,i){if((0,r.Wi)(t)||(0,r.Wi)(i)||i.vcsWkid||(0,n.fS)(t,i))return null;const a=(0,s._R)(t)/(0,s._R)(i);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,a);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},54295:(e,t,i)=>{i.d(t,{V:()=>a});var r=i(43697),s=i(5600),n=(i(67676),i(80442),i(75215),i(52011));const a=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,r._)([(0,s.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,r._)([(0,n.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,i)=>{i.d(t,{Y:()=>u});var r=i(43697),s=i(92604),n=i(70586),a=i(5600),l=(i(67676),i(80442),i(75215),i(52011)),o=i(66677);const u=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,o.Qc)(this.url);if((0,n.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,o.Nm)(e,s.Z.getLogger(this.declaredClass)))}};return(0,r._)([(0,a.Cb)()],t.prototype,"title",null),(0,r._)([(0,a.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,l.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>w});var r=i(43697),s=i(40330),n=i(3172),a=i(66643),l=i(20102),o=i(92604),u=i(70586),h=i(95330),c=i(17452),d=i(5600),p=(i(67676),i(80442),i(75215),i(71715)),f=i(52011),_=i(30556),y=i(65587),g=i(15235),m=i(86082);const b=o.Z.getLogger("esri.layers.mixins.PortalLayer"),w=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new g.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const r=await i.e(8062).then(i.bind(i,18062));return(0,h.k_)(t),await r.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,h.D_)(e)||b.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,h.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const i=v.credential===t?v.user:await this._fetchEditingUser(e);return v.credential=t,v.user=i,(0,u.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=s.id.findServerInfo(this.url);if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,l=y.Z.getDefault();if(l&&l.loaded&&(0,c.Fv)(l.restUrl)===(0,c.Fv)(r))return l.user;const o=`${r}/community/self`,h=(0,u.pC)(e)?e.signal:null,d=await(0,a.q6)((0,n.default)(o,{authMode:"no-prompt",query:{f:"json"},signal:h}));return d.ok?m.default.fromJSON(d.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||y.Z.getDefault());return i&&r&&!(0,c.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new l.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,d.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,r._)([(0,p.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,_.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,r._)([(0,f.j)("esri.layers.mixins.PortalLayer")],t),t},v={credential:null,user:null}},56765:(e,t,i)=>{i.d(t,{Z:()=>h});var r,s=i(43697),n=i(80539),a=i(96674),l=i(5600),o=(i(67676),i(80442),i(75215),i(52011));let u=r=class extends a.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new n.Z}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s._)([(0,l.Cb)({type:String,json:{write:!0}})],u.prototype,"floorField",void 0),(0,s._)([(0,l.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,s._)([(0,l.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=r=(0,s._)([(0,o.j)("esri.layers.support.LayerFloorInfo")],u);const h=u},66677:(e,t,i)=>{i.d(t,{B5:()=>c,DR:()=>p,G:()=>w,M8:()=>y,Nm:()=>g,Qc:()=>d,XG:()=>m,a7:()=>_,ld:()=>f,wH:()=>b});var r=i(70586),s=i(17452),n=i(25929);const a={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},l=Object.values(a),o=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${l.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${l.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),h=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function c(e){return!!o.test(e)}function d(e){const t=(0,s.mN)(e),i=t.path.match(o)||t.path.match(u);if(!i)return null;const[,r,n,l,h]=i,c=n.indexOf("/");return{title:f(-1!==c?n.slice(c+1):n),serverType:a[l.toLowerCase()],sublayer:null!=h&&""!==h?parseInt(h,10):null,url:{path:r}}}function p(e){const t=(0,s.mN)(e).path.match(h);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function f(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function _(e,t){const i=[];if(e){const t=d(e);(0,r.pC)(t)&&t.title&&i.push(t.title)}if(t){const e=f(t);i.push(e)}if(2===i.length){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function y(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),i=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&i}function g(e,t){return e?(0,s.Qj)((0,s.Hu)(e,t)):e}function m(e){let{url:t}=e;if(!t)return{url:t};t=(0,s.Hu)(t,e.logger);const i=(0,s.mN)(t),n=d(i.path);let a;if((0,r.pC)(n))null!=n.sublayer&&null==e.layer.layerId&&(a=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=p(i.path);(0,r.pC)(e)&&(t=e.serviceUrl,a=e.sublayerId)}return{url:(0,s.Qj)(t),layerId:a}}function b(e,t,i,r,a){(0,n.w)(t,r,"url",a),r.url&&null!=e.layerId&&(r.url=(0,s.v_)(r.url,i,e.layerId.toString()))}function w(e){if(!e)return!1;const t=e.toLowerCase(),i=t.includes("/services/"),r=t.includes("/mapserver/wmsserver"),s=t.includes("/imageserver/wmsserver"),n=t.includes("/wmsserver");return i&&(r||s||n)}},15235:(e,t,i)=>{i.r(t),i.d(t,{default:()=>D});var r=i(43697),s=i(99880),n=i(20102),a=i(96674),l=i(22974),o=i(83379),u=i(70586),h=i(17452),c=i(5600),d=i(75215),p=i(71715),f=i(52011),_=i(6570),y=i(65587),g=i(15923),m=i(92604),b=(i(67676),i(80442),i(90578));const w=m.Z.getLogger("esri.portal.PortalItemResource");let v=class extends g.Z{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){(0,u.pC)(e)&&(0,h.YP)(e)?w.error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const i=this.url;if((0,u.Wi)(i))throw new n.Z("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal._request(i,{responseType:e,query:{token:this.portalItem.apiKey},signal:(0,u.U2)(t,"signal")})}async update(e,t){return(await i.e(7873).then(i.bind(i,97873))).addOrUpdateResource(this,"update",e,t)}hasPath(){return(0,u.pC)(this.path)}_normalizePath(e,t){return(0,u.Wi)(e)?e:(e=e.replace(/^\/+/,""),(0,u.pC)(t)&&(0,h.YP)(e)&&(e=(0,h.PF)(e,t.itemUrl)),e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};(0,r._)([(0,c.Cb)()],v.prototype,"portalItem",void 0),(0,r._)([(0,c.Cb)({type:String,value:null})],v.prototype,"path",null),(0,r._)([(0,b.p)("path")],v.prototype,"_castPath",null),(0,r._)([(0,c.Cb)({type:String,readOnly:!0})],v.prototype,"url",null),(0,r._)([(0,c.Cb)({type:String,readOnly:!0})],v.prototype,"itemRelativeUrl",null),v=(0,r._)([(0,f.j)("esri.portal.PortalItemResource")],v);const S=v;let F=class extends g.Z{constructor(e){super(e),this.created=null,this.rating=null}};(0,r._)([(0,c.Cb)()],F.prototype,"created",void 0),(0,r._)([(0,c.Cb)()],F.prototype,"rating",void 0),F=(0,r._)([(0,f.j)("esri.portal.PortalRating")],F);const I=F;var C;let x=C=class extends((0,a.eC)(o.Z)){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return(0,d.TJ)(C,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e&&this.portal&&this.portal.isPortal?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":"Geocoding Service"===e?i="Locator":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replace(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.includes("configurableApp")&&(i="Instant App"),i}readExtent(e){return e&&e.length?new _.Z(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",t=this.typeKeywords||[];let i,r=!1,n=!1,a=!1,l=!1,o=!1,u=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(r=t.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(n=t.includes("Table"),a=t.includes("Route Layer"),l=t.includes("Markup"),o=t.includes("Spatiotemporal"),u=t.includes("UtilityNetwork"),i=o&&n?"spatiotemporaltable":n?"table":a?"routelayer":l?"markup":o?"spatiotemporal":r?"featureshosted":u?"utilitynetwork":"features"):i="map service"===e||"wms"===e||"wmts"===e?r||t.includes("Tiled")||"wmts"===e?"maptiles":"mapimages":"scene service"===e?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"video service"===e?"mediaservice":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e?t.includes("Web Tool")&&this.portal&&this.portal.isPortal?"tool":"layers":"geodata service"===e?"geodataservice":"layers"):i="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&t.includes("configurableApp")?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&t.includes("ArcGIS Pro")||"explorer map"===e&&t.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"360 vr experience"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&t.includes("Explorer Mapping Application")||t.includes("Document")?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"hub project"===e?"hubproject":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"experience builder widget"===e?"experiencebuilderwidget":"experience builder widget package"===e?"experiencebuilderwidgetpackage":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"notebook code snippets"===e?"notebookcodesnippets":"suitability model"===e?"suitabilitymodel":"esri classifier definition"===e?"classifierdefinition":"esri classification schema"===e?"classificationschema":"insights data engineering workbook"===e?"dataengineeringworkbook":"insights data engineering model"===e?"dataengineeringmodel":"deep learning studio project"===e?"deeplearningproject":"maps",i?(0,s.V)("esri/images/portal/"+i+"16.png"):null}get isLayer(){return["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","WMTS","WMS"].includes(this.type)}get itemUrl(){const e=this.get("portal.restUrl");return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){this.portal||(this.portal=y.Z.getDefault());const t=this.portal.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?this.portal._request(this.itemUrl,{signal:(0,u.pC)(e)?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}addRating(e){const t={method:"post",query:{}};return e instanceof I&&(e=e.rating),isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal._request(this.itemUrl+"/addRating",t).then((()=>new I({rating:e,created:new Date})))}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:(0,l.d9)(this.applicationProxies),avgRating:this.avgRating,categories:(0,l.d9)(this.categories),created:(0,l.d9)(this.created),culture:this.culture,description:this.description,extent:(0,l.d9)(this.extent),groupCategories:(0,l.d9)(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:(0,l.d9)(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:(0,l.d9)(this.screenshots),size:this.size,snippet:this.snippet,spatialReference:this.spatialReference,tags:(0,l.d9)(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:(0,l.d9)(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new C({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]&&(e[t]=e[t].join(", "));const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}deleteRating(){return this.portal._request(this.itemUrl+"/deleteRating",{method:"post"}).then((()=>{}))}fetchData(e="json",t){return this.portal._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}fetchRating(e){return this.portal._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e}).then((e=>null!=e.rating?(e.created=new Date(e.created),new I(e)):null))}fetchRelatedItems(e,t){return this.portal._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},C)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal._request(this.itemUrl,{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new n.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then((()=>this.portal._signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)(0,h.HK)(t)?r.query={data:t}:r.query={url:(0,h.hF)(t)},(0,u.pC)(i)&&(r.query.filename=i);else{const e=new FormData;(0,u.pC)(i)?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new n.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await i.e(7873).then(i.bind(i,97873))).fetchResources(this,e,t)}async addResource(e,t,r){const s=await i.e(7873).then(i.bind(i,97873));return e.portalItem=this,s.addOrUpdateResource(e,"add",t,r)}async removeResource(e,t){const r=await i.e(7873).then(i.bind(i,97873));if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new n.Z("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r.removeResource(this,e,t)}async removeAllResources(e){return(await i.e(7873).then(i.bind(i,97873))).removeAllResources(this,e)}resourceFromPath(e){return new S({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:(0,l.d9)(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,spatialReference:this.spatialReference,tags:(0,l.d9)(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:(0,l.d9)(this.typeKeywords),url:this.url};return(0,l.yd)(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new C({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};(0,r._)([(0,c.Cb)({type:["private","shared","org","public"]})],x.prototype,"access",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"accessInformation",void 0),(0,r._)([(0,c.Cb)({type:String})],x.prototype,"apiKey",void 0),(0,r._)([(0,c.Cb)({json:{read:{source:"appProxies"}}})],x.prototype,"applicationProxies",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"avgRating",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"categories",void 0),(0,r._)([(0,c.Cb)({type:Date})],x.prototype,"created",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"culture",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"description",void 0),(0,r._)([(0,c.Cb)({readOnly:!0})],x.prototype,"displayName",null),(0,r._)([(0,c.Cb)({type:_.Z})],x.prototype,"extent",void 0),(0,r._)([(0,p.r)("extent")],x.prototype,"readExtent",null),(0,r._)([(0,c.Cb)()],x.prototype,"groupCategories",void 0),(0,r._)([(0,c.Cb)({readOnly:!0})],x.prototype,"iconUrl",null),(0,r._)([(0,c.Cb)()],x.prototype,"id",void 0),(0,r._)([(0,c.Cb)({readOnly:!0})],x.prototype,"isLayer",null),(0,r._)([(0,c.Cb)()],x.prototype,"itemControl",void 0),(0,r._)([(0,c.Cb)({readOnly:!0})],x.prototype,"itemUrl",null),(0,r._)([(0,c.Cb)()],x.prototype,"licenseInfo",void 0),(0,r._)([(0,c.Cb)({type:Date})],x.prototype,"modified",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"name",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"numComments",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"numRatings",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"numViews",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"owner",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"ownerFolder",void 0),(0,r._)([(0,c.Cb)({type:y.Z})],x.prototype,"portal",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"screenshots",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"size",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"snippet",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"sourceJSON",void 0),(0,r._)([(0,c.Cb)({type:String})],x.prototype,"spatialReference",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"tags",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"thumbnail",void 0),(0,r._)([(0,c.Cb)({readOnly:!0})],x.prototype,"thumbnailUrl",null),(0,r._)([(0,c.Cb)()],x.prototype,"title",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"type",void 0),(0,r._)([(0,c.Cb)()],x.prototype,"typeKeywords",void 0),(0,r._)([(0,c.Cb)({type:String,json:{read(e,t){if("KML"!==t.type)return e;const i=this.portal?.restUrl;return e||(e=i&&this.id?`${i}/content/items/${this.id}/data`:null),e}}})],x.prototype,"url",void 0),(0,r._)([(0,c.Cb)({readOnly:!0})],x.prototype,"userItemUrl",null),x=C=(0,r._)([(0,f.j)("esri.portal.PortalItem")],x);const D=x},41818:(e,t,i)=>{i.d(t,{P:()=>a});var r=i(11282),s=i(34599),n=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,s.executeQueryForCount)(a,n.Z.from(t),{...i}).then((e=>e.data.count))}},5396:(e,t,i)=>{i.d(t,{G:()=>a});var r=i(11282),s=i(34599),n=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,s.executeQueryForIds)(a,n.Z.from(t),{...i}).then((e=>e.data.objectIds))}},4967:(e,t,i)=>{i.d(t,{F:()=>o,e:()=>l});var r=i(11282),s=i(34599),n=i(74889),a=i(57444);async function l(e,t,i){const r=await o(e,t,i);return n.default.fromJSON(r)}async function o(e,t,i){const n=(0,r.en)(e),l={...i},o=a.Z.from(t),{data:u}=await(0,s.executeQuery)(n,o,o.sourceSpatialReference,l);return u}},98326:(e,t,i)=>{i.d(t,{Z:()=>c});var r,s=i(43697),n=i(96674),a=i(5600),l=(i(67676),i(80442),i(75215)),o=i(52011);const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let h=r=class extends n.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=function(e){const{exifInfo:t,exifName:i,tagName:r}=e;if(!t||!i||!r)return null;const s=t.find((e=>e.name===i));return s?function(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const r=i.find((e=>e.name===t));return r&&r.value||null}({tagName:r,tags:s.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return u[t]||null}clone(){return new r({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,s._)([(0,a.Cb)({type:String})],h.prototype,"contentType",void 0),(0,s._)([(0,a.Cb)()],h.prototype,"exifInfo",void 0),(0,s._)([(0,a.Cb)({readOnly:!0})],h.prototype,"orientationInfo",null),(0,s._)([(0,a.Cb)({type:l.z8})],h.prototype,"id",void 0),(0,s._)([(0,a.Cb)({type:String})],h.prototype,"globalId",void 0),(0,s._)([(0,a.Cb)({type:String})],h.prototype,"keywords",void 0),(0,s._)([(0,a.Cb)({type:String})],h.prototype,"name",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],h.prototype,"parentGlobalId",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],h.prototype,"parentObjectId",void 0),(0,s._)([(0,a.Cb)({type:l.z8})],h.prototype,"size",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],h.prototype,"url",void 0),h=r=(0,s._)([(0,o.j)("esri.layers.support.AttachmentInfo")],h);const c=h},11282:(e,t,i)=>{i.d(t,{cv:()=>l,en:()=>a,lA:()=>n});var r=i(22974),s=i(17452);function n(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function a(e){return"string"==typeof e?(0,s.mN)(e):(0,r.d9)(e)}function l(e,t,i){const r={};for(const s in e){if("declaredClass"===s)continue;const n=e[s];if(null!=n&&"function"!=typeof n)if(Array.isArray(n)){r[s]=[];for(let e=0;e<n.length;e++)r[s][e]=l(n[e])}else if("object"==typeof n)if(n.toJSON){const e=n.toJSON(i&&i[s]);r[s]=t?e:JSON.stringify(e)}else r[s]=t?n:JSON.stringify(n);else r[s]=n}return r}},58333:(e,t,i)=>{i.d(t,{ET:()=>n,I4:()=>s,eG:()=>o,lF:()=>a,lj:()=>h,qP:()=>l,wW:()=>u});const r=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:r,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},n={type:"esriSLS",style:"esriSLSSolid",width:.75,color:r},a={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},l={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},o={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},h={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);