@arcgis/core 4.23.0-next.20220119 → 4.23.0-next.20220123

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 (168) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +1 -0
  3. package/assets/esri/core/workers/chunks/199670a3a564ebe3bd79.js +1 -0
  4. package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +1 -0
  5. package/assets/esri/core/workers/chunks/{99f0d896c17dd09cd285.js → 2629adf79e7fd9f25f07.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{8a250ec51097f16feb66.js → 40a1e713f63ec77110c0.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{4b69129c0557852d9b3d.js → 4c9084a04948b6924749.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{1b28042fdf3f4dbc8ea5.js → 5383a8f3e4ec1a8a4fcd.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{9d9dffc8884d66a258e4.js → 5538639a49c7cc2eca63.js} +1 -1
  10. package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +1 -0
  11. package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +1 -0
  12. package/assets/esri/core/workers/chunks/68a59ce98177d8513337.js +1 -0
  13. package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +1 -0
  14. package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +1 -0
  15. package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +1 -0
  16. package/assets/esri/core/workers/chunks/{47395d225229d237f0ac.js → 7bc5cc5dbf1b7b70ddac.js} +1 -1
  17. package/assets/esri/core/workers/chunks/8fa0a14165d43ffe87a5.js +1 -0
  18. package/assets/esri/core/workers/chunks/94b8dbf859df71858d1c.js +1 -0
  19. package/assets/esri/core/workers/chunks/{e2d68bcd2f99a65387bf.js → 9cb2ae42a8e328b1d98d.js} +1 -1
  20. package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +1 -0
  21. package/assets/esri/core/workers/chunks/a78757b9c7e8cbea08fa.js +1 -0
  22. package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +1 -0
  23. package/assets/esri/core/workers/chunks/{b10fcbe1393c812fc219.js → aa861b8eae6c85f3dad4.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{a960074644c3722be71e.js → afa6912454f2a5ffadce.js} +1 -1
  25. package/assets/esri/core/workers/chunks/b0b036ad3ad3cd956747.js +1 -0
  26. package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +1 -0
  27. package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +1 -0
  28. package/assets/esri/core/workers/chunks/bf6dda4a2af14c4b7716.js +1 -0
  29. package/assets/esri/core/workers/chunks/{ed0297fc61014e848c18.js → c080114a69fa95b88d22.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{573dc3064e84ca86844d.js → c959e0d1cf7dce0421b9.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{1fd48459afb58a6cf14f.js → ca2f5faa01d99c21ec14.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{7aa543a97f055cddea99.js → cc146c57bbdac8029fd8.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{631c5b514bb73782c570.js → cd7d83d127e085d52584.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{7e596478507466953e65.js → cef4af64860ebbfc1c47.js} +1 -1
  35. package/assets/esri/core/workers/chunks/d72488db62fcf39447b6.js +1 -0
  36. package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +981 -0
  37. package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +1 -0
  38. package/assets/esri/core/workers/chunks/{f7fc4c993536e62f7f3e.js → e97e986120aaadad7d4c.js} +1 -1
  39. package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +1 -0
  40. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  41. package/chunks/CloudsComposition.glsl.js +4 -4
  42. package/chunks/vxlLayer.js +1 -1
  43. package/core/has.js +1 -1
  44. package/core/workers/workerFactory.js +1 -1
  45. package/geometry/support/heightModelInfoUtils.js +1 -1
  46. package/interfaces.d.ts +279 -76
  47. package/layers/RouteLayer.js +1 -1
  48. package/layers/VoxelLayer.js +1 -1
  49. package/layers/VoxelWasmPerScene.js +1 -1
  50. package/layers/support/RasterWorker.js +1 -1
  51. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  52. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  53. package/libs/vxl/enums.js +1 -1
  54. package/package.json +1 -1
  55. package/portal/schemas/buildingSceneLayerItem.js +1 -1
  56. package/portal/schemas/definitions.js +1 -1
  57. package/portal/schemas/integratedMeshLayerItem.js +1 -1
  58. package/portal/schemas/pointCloudLayerItem.js +1 -1
  59. package/portal/schemas/sceneLayerItem.js +1 -1
  60. package/portal/schemas/webScene.js +1 -1
  61. package/rest/find.js +1 -1
  62. package/rest/geometryService/generalize.js +1 -1
  63. package/rest/geometryService/lengths.js +1 -1
  64. package/rest/geometryService/offset.js +1 -1
  65. package/rest/geometryService/relation.js +1 -1
  66. package/rest/geometryService/trimExtend.js +1 -1
  67. package/rest/identify.js +1 -1
  68. package/{tasks → rest}/operations/find.js +0 -0
  69. package/{tasks → rest}/operations/generalize.js +0 -0
  70. package/rest/operations/identify.js +5 -0
  71. package/{tasks → rest}/operations/lengths.js +0 -0
  72. package/{tasks → rest}/operations/offset.js +0 -0
  73. package/{tasks → rest}/operations/relation.js +0 -0
  74. package/{tasks → rest}/operations/trimExtend.js +0 -0
  75. package/{tasks → rest}/operations/urlUtils.js +0 -0
  76. package/rest/print.js +1 -1
  77. package/rest/query/operations/query.js +1 -1
  78. package/rest/query/operations/queryAttachments.js +1 -1
  79. package/rest/query/operations/queryRelatedRecords.js +1 -1
  80. package/rest/query/operations/queryTopFeatures.js +1 -1
  81. package/rest/route/utils.js +1 -1
  82. package/rest/support/NetworkServiceDescription.js +1 -1
  83. package/rest/support/RouteInfo.js +1 -1
  84. package/rest/support/RouteParameters.js +1 -1
  85. package/rest/support/RouteSettings.js +5 -0
  86. package/rest/support/Stop.js +1 -1
  87. package/rest/support/networkEnums.js +1 -1
  88. package/support/revision.js +1 -1
  89. package/symbols/Font.js +1 -1
  90. package/symbols/TextSymbol.js +1 -1
  91. package/symbols/TextSymbol3DLayer.js +1 -1
  92. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  93. package/symbols/support/cimSymbolUtils.js +1 -1
  94. package/symbols/support/textUtils.js +5 -0
  95. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  96. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  97. package/views/2d/support/engineHelpers.js +1 -1
  98. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  99. package/views/3d/environment/CloudsComposition.js +1 -1
  100. package/views/3d/environment/CloudsGenerator.js +1 -1
  101. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  102. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  103. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  104. package/views/3d/layers/GraphicsView3D.js +1 -1
  105. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  106. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  108. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  109. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  110. package/views/3d/layers/graphics/{Graphics3DFeatureLikeLayerView.js → Graphics3DFeatureProcessor.js} +1 -1
  111. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  112. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  113. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  114. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  115. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  116. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  117. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  118. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  119. package/views/3d/layers/graphics/{Graphics3DGraphicLikeLayerView.js → GraphicsProcessor.js} +1 -1
  120. package/views/3d/layers/graphics/IGraphics3DFeatureProcessor.js +4 -0
  121. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  122. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +12 -14
  123. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  124. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  125. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  126. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  127. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  128. package/views/SceneView.js +1 -1
  129. package/views/webgl/ContextState.js +1 -1
  130. package/views/webgl/FramebufferObject.js +1 -1
  131. package/views/webgl/Program.js +1 -1
  132. package/views/webgl/Renderbuffer.js +1 -1
  133. package/views/webgl/RenderingContext.js +1 -1
  134. package/views/webgl/Texture.js +1 -1
  135. package/views/webgl/Util.js +1 -1
  136. package/views/webgl/enums.js +1 -1
  137. package/views/webgl/rasterUtils.js +1 -1
  138. package/views/webgl/testFloatBufferBlend.js +1 -1
  139. package/widgets/Feature/FeatureExpression.js +1 -1
  140. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  141. package/widgets/Feature/FeatureMedia.js +1 -1
  142. package/widgets/Feature/FeatureViewModel.js +1 -1
  143. package/widgets/LayerList/LayerListViewModel.js +1 -1
  144. package/widgets/support/geolocationUtils.js +1 -1
  145. package/assets/esri/core/workers/chunks/01ef8de7f76a8c61b464.js +0 -1
  146. package/assets/esri/core/workers/chunks/05db312a0ca6bd3f014a.js +0 -1
  147. package/assets/esri/core/workers/chunks/0f254c3e91e8fee55f28.js +0 -1
  148. package/assets/esri/core/workers/chunks/21a77eed1a4ef5b0ff08.js +0 -1
  149. package/assets/esri/core/workers/chunks/3564e14010953def6df9.js +0 -1
  150. package/assets/esri/core/workers/chunks/403c7d64f12f00330d88.js +0 -1
  151. package/assets/esri/core/workers/chunks/4409d77c9734de4e82a7.js +0 -1
  152. package/assets/esri/core/workers/chunks/615aa2d3ecafe30c80c0.js +0 -1
  153. package/assets/esri/core/workers/chunks/618076e6de605873e433.js +0 -1
  154. package/assets/esri/core/workers/chunks/6c1e92ff4c732dfda756.js +0 -1
  155. package/assets/esri/core/workers/chunks/722a10c65456844d72b9.js +0 -1
  156. package/assets/esri/core/workers/chunks/75d53b28afe732c459b2.js +0 -1
  157. package/assets/esri/core/workers/chunks/8fdd5bca3716816d359b.js +0 -1
  158. package/assets/esri/core/workers/chunks/a28b53c61bddefb6616e.js +0 -1
  159. package/assets/esri/core/workers/chunks/b9de831ac379cf1d2969.js +0 -1
  160. package/assets/esri/core/workers/chunks/c3eca92d02958732e141.js +0 -1
  161. package/assets/esri/core/workers/chunks/c8f976e53e232e8da9cc.js +0 -981
  162. package/assets/esri/core/workers/chunks/cb68db7169b9dfd1c3ff.js +0 -1
  163. package/assets/esri/core/workers/chunks/cc96608b2802fbfe7a08.js +0 -1
  164. package/assets/esri/core/workers/chunks/cd02fe27eb07681cb366.js +0 -1
  165. package/assets/esri/core/workers/chunks/dd433c160f7a0c120b82.js +0 -1
  166. package/assets/esri/core/workers/chunks/ef8b75b92cf549e0507e.js +0 -1
  167. package/symbols/support/constants.js +0 -5
  168. package/tasks/operations/identify.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5404,5732],{92835:(e,t,s)=>{s.d(t,{Z:()=>y});var r,i=s(43697),n=s(96674),a=s(70586),o=s(35463),l=s(5600),u=(s(67676),s(80442),s(75215),s(71715)),d=s(52011),c=s(30556);let h=r=class extends n.wq{constructor(e){super(e),this.end=null,this.start=null}static get allTime(){return p}static get empty(){return g}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?e.getTime():null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=(0,a.pC)(this.start)?this.start.getTime():this.start,s=(0,a.pC)(this.end)?this.end.getTime():this.end,r=(0,a.pC)(e.start)?e.start.getTime():e.start,i=(0,a.pC)(e.end)?e.end.getTime():e.end;return t===r&&s===i}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=(0,a.Po)(this.start,(t=>(0,o.JE)(t,e))),s=(0,a.Po)(this.end,(t=>(0,o.Nm)((0,o.JE)(t,e),1,e)));return new r({start:t,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=(0,a.R2)(this.start,-1/0,(e=>e.getTime())),s=(0,a.R2)(this.end,1/0,(e=>e.getTime())),i=(0,a.R2)(e.start,-1/0,(e=>e.getTime())),n=(0,a.R2)(e.end,1/0,(e=>e.getTime()));let o,l;if(i>=t&&i<=s?o=i:t>=i&&t<=n&&(o=t),s>=i&&s<=n?l=s:n>=t&&n<=s&&(l=n),!isNaN(o)&&!isNaN(l)){const e=new r;return e.start=o===-1/0?null:new Date(o),e.end=l===1/0?null:new Date(l),e}return r.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const s=new r,{start:i,end:n}=this;return(0,a.pC)(i)&&(s.start=(0,o.Nm)(i,e,t)),(0,a.pC)(n)&&(s.end=(0,o.Nm)(n,e,t)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=(0,a.pC)(this.start)&&(0,a.pC)(e.start)?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=(0,a.pC)(this.end)&&(0,a.pC)(e.end)?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:s})}};(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,i._)([(0,u.r)("end")],h.prototype,"readEnd",null),(0,i._)([(0,c.c)("end")],h.prototype,"writeEnd",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,i._)([(0,u.r)("start")],h.prototype,"readStart",null),(0,i._)([(0,c.c)("start")],h.prototype,"writeStart",null),h=r=(0,i._)([(0,d.j)("esri.TimeExtent")],h);const p=new h,g=new h({start:void 0,end:void 0}),y=h},84552:(e,t,s)=>{s.d(t,{Z:()=>c});var r,i=s(43697),n=s(96674),a=s(35463),o=s(5600),l=(s(67676),s(80442),s(75215),s(52011)),u=s(78981);let d=r=class extends n.wq{constructor(e){super(e),this.value=0,this.unit="milliseconds"}toMilliseconds(){return(0,a.rJ)(this.value,this.unit,"milliseconds")}clone(){return new r({value:this.value,unit:this.unit})}};(0,i._)([(0,o.Cb)({type:Number,json:{write:!0},nonNullable:!0})],d.prototype,"value",void 0),(0,i._)([(0,o.Cb)({type:u.v.apiValues,json:{type:u.v.jsonValues,read:u.v.read,write:u.v.write},nonNullable:!0})],d.prototype,"unit",void 0),d=r=(0,i._)([(0,l.j)("esri.TimeInterval")],d);const c=d},5732:(e,t,s)=>{s.d(t,{a:()=>n,c:()=>r,g:()=>i});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}},25929:(e,t,s)=>{s.d(t,{M:()=>p,f:()=>n,i:()=>c,p:()=>y,r:()=>o,t:()=>a,w:()=>l});var r=s(70586),i=s(17452);function n(e,t){const s=t&&t.url&&t.url.path;if(e&&s&&(e=(0,i.hF)(e,s,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=(0,i.PF)(e,t.portalItem.itemUrl);d.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return h(e,t&&t.portal)}function a(e,t,s=p.YES){if(!e)return e;!(0,i.YP)(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let r=(0,i.hF)(e);if(t){const s=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(s){const n=h(s,t.portal);r=(0,i.PF)(h(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,i.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}(r,t&&t.portal),(0,i.YP)(r)&&(r=(0,i.Fv)(r)),null!=t&&t.resources&&null!=t&&t.portalItem&&!(0,i.YP)(r)&&!(0,i.HK)(r)&&s===p.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(r)}),r}function o(e,t,s){return n(e,s)}function l(e,t,s,r){const i=a(e,r);void 0!==i&&(t[s]=i)}const u=/\/items\/([^\/]+)\/resources\//,d=/^\.\/resources\//;function c(e){const t=(0,r.pC)(e)?e.match(u):null;return(0,r.pC)(t)?t[1]:null}function h(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const s=`${t.urlKey}.${t.customBaseUrl}`,r=(0,i.TI)();return(0,i.D6)(r,`${r.scheme}://${s}`)?(0,i.Ie)(e,t.portalHostname,s):(0,i.Ie)(e,s,t.portalHostname)}var p,g;(g=p||(p={}))[g.YES=0]="YES",g[g.NO=1]="NO";const y=Object.freeze({__proto__:null,fromJSON:n,toJSON:a,read:o,write:l,itemIdFromResourceUrl:c,get MarkKeep(){return p}})},3920:(e,t,s)=>{s.d(t,{r:()=>d,p:()=>u});var r=s(43697),i=s(15923),n=s(61247),a=s(5600),o=s(52011),l=s(89749);const u=e=>{let t=class extends e{destroy(){var e,t;this.destroyed||(null==(e=this._get("handles"))||e.destroy(),null==(t=this._get("updatingHandles"))||t.destroy())}get handles(){return this._get("handles")||new n.Z}get updatingHandles(){return this._get("updatingHandles")||new l.t}};return(0,r._)([(0,a.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,r._)([(0,a.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,r._)([(0,o.j)("esri.core.HandleOwner")],t),t};let d=class extends(u(i.Z)){};d=(0,r._)([(0,o.j)("esri.core.HandleOwner")],d)},66643:(e,t,s)=>{s.d(t,{Ed:()=>n,UI:()=>a,q6:()=>o,mt:()=>l});var r=s(70586),i=s(95330);function n(e,t,s){return(0,i.as)(e.map(((e,r)=>t.apply(s,[e,r]))))}function a(e,t,s){return(0,i.as)(e.map(((e,r)=>t.apply(s,[e,r])))).then((e=>e.map((e=>e.value))))}function o(e){return(0,r.Wi)(e)?(0,i.DB)():e.then((e=>({ok:!0,value:e}))).catch((e=>({ok:!1,error:e})))}function l(e){return e.then((e=>({ok:!0,value:e}))).catch((e=>((0,i.r9)(e),{ok:!1,error:e})))}},43090:(e,t,s)=>{function r(e){return 32+e.length}function i(e){if(!e)return 0;let t=32;for(const s in e)if(e.hasOwnProperty(s)){const i=e[s];switch(typeof i){case"string":t+=r(i);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e,t){return 32+e.length*t}var a;s.d(t,{Y8:()=>a,f2:()=>i,do:()=>n}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(a||(a={}))},45091:(e,t,s)=>{s.d(t,{Z:()=>d});var r,i,n=s(80442),a=s(71143);(i=r||(r={}))[i.varint=0]="varint",i[i.fixed64=1]="fixed64",i[i.delimited=2]="delimited",i[i.fixed32=5]="fixed32",i[i.unknown=99]="unknown";const o=4294967296,l=new TextDecoder("utf-8"),u=(0,n.Z)("safari")||(0,n.Z)("ios")?6:(0,n.Z)("ff")?12:32;class d{constructor(e,t,s=0,i=(e?e.byteLength:0)){this._tag=0,this._dataType=r.unknown,this._init(e,t,s,i)}_init(e,t,s,r){this._data=e,this._dataView=t,this._pos=s,this._end=r}clone(){return new d(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*o;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*o;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,r){const i=this.getMessage(),n=e(i,t,s,r);return i.release(),n}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=d.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){d.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case r.varint:this._decodeVarint();break;case r.fixed64:this._skip(8);break;case r.delimited:this._skip(this._getLength());break;case r.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t,s=this._pos,r=0;if(this._end-s>=10)do{if(t=e[s++],r|=127&t,0==(128&t))break;if(t=e[s++],r|=(127&t)<<7,0==(128&t))break;if(t=e[s++],r|=(127&t)<<14,0==(128&t))break;if(t=e[s++],r|=(127&t)<<21,0==(128&t))break;if(t=e[s++],r+=268435456*(127&t),0==(128&t))break;if(t=e[s++],r+=34359738368*(127&t),0==(128&t))break;if(t=e[s++],r+=4398046511104*(127&t),0==(128&t))break;if(t=e[s++],r+=562949953421312*(127&t),0==(128&t))break;if(t=e[s++],r+=72057594037927940*(127&t),0==(128&t))break;if(t=e[s++],r+=0x8000000000000000*(127&t),0==(128&t))break;throw new Error("Varint too long!")}while(0);else{let i=1;for(;s!==this._end&&(t=e[s],0!=(128&t));)++s,r+=(127&t)*i,i*=128;if(s===this._end)throw new Error("Varint overrun!");++s,r+=t*i}return this._pos=s,r}_decodeSVarint(){const e=this._decodeVarint();return e%2?-(e+1)/2:e/2}_getLength(){if(this._dataType!==r.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>u){const r=e.subarray(t,s);return l.decode(r)}let r="",i="";for(let n=t;n<s;++n){const t=e[n];128&t?i+="%"+t.toString(16):(r+=decodeURIComponent(i)+String.fromCharCode(t),i="")}return i.length&&(r+=decodeURIComponent(i)),r}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}}d.pool=new a.Z(d,null,(e=>{e._data=null,e._dataView=null}))},35463:(e,t,s)=>{s.d(t,{rJ:()=>o,Nm:()=>n,JE:()=>a}),s(80442);const r={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},i={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function n(e,t,s){const r=new Date(e.getTime());if(t&&s){const e=i[s],{getter:n,setter:a,multiplier:o}=e;if("months"===s){const e=function(e,t){const s=new Date(e,t+1,1);return s.setDate(0),s.getDate()}(r.getFullYear(),r.getMonth()+t);r.getDate()>e&&r.setDate(e)}r[a](r[n]()+t*o)}return r}function a(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function o(e,t,s){return 0===e?0:e*r[t]/r[s]}},60437:(e,t,s)=>{s.d(t,{Gv:()=>f,Ue:()=>i,cS:()=>h,fS:()=>y,TC:()=>a,pp:()=>o,JR:()=>p,al:()=>n,t8:()=>c,Tn:()=>d,op:()=>u,dp:()=>l});var r=s(70586);function i(e=m){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function n(e,t,s,r,n,a,o=i()){return o[0]=e,o[1]=t,o[2]=s,o[3]=r,o[4]=n,o[5]=a,o}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 o(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 l(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,s=e){return s[0]=t[0],s[1]=t[1],s[2]=t[2],s!==e&&(s[3]=e[3],s[4]=e[4],s[5]=e[5]),s}function d(e,t,s=e){return s[3]=t[0],s[4]=t[1],s[5]=t[2],s!==e&&(s[0]=e[0],s[1]=e[1],s[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 h(e){return e?c(e,f):i(f)}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 g(e){return 6===e.length}function y(e,t,s){if((0,r.Wi)(e)||(0,r.Wi)(t))return e===t;if(!g(e)||!g(t))return!1;if(s){for(let r=0;r<e.length;r++)if(!s(e[r],t[r]))return!1}else for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}s(6570),s(24470);const f=[1/0,1/0,1/0,-1/0,-1/0,-1/0],m=[0,0,0,0,0,0];i()},37549:(e,t,s)=>{s.d(t,{H:()=>a});var r=s(80442),i=s(24133);const n={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new i.QB(9,(0,r.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,r)=>{e[t++]=r})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))),this._boundsToLoad.length=0)}}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){n.minX=t[0],n.minY=t[1],n.maxX=t[2],n.maxY=t[3],e.search(n,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},57191:(e,t,s)=>{s.d(t,{Z:()=>y});var r=s(20102),i=s(32448),n=s(92604),a=s(70586),o=s(60437),l=s(24470),u=s(98732),d=s(37549),c=s(29730),h=s(70272),p=s(5428);const g={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new h.ZP(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(e.centroid||(e.centroid=(0,c.Y)(new p.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)};class y{constructor(e){this.geometryInfo=e,this._boundsStore=new d.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new i.Z,this.featureAdapter=g}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){if(!this.numFeatures)return null;const e=(0,l.Ue)(l.Gv);return this._featuresById.forEach((t=>{const s=this._boundsStore.get(t.objectId);s&&(e[0]=Math.min(s[0],e[0]),e[1]=Math.min(s[1],e[1]),e[2]=Math.max(s[2],e[2]),e[3]=Math.max(s[3],e[3]))})),e}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{(0,a.pC)(t.geometry)&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t,s){for(const r of e){const e=this._boundsStore.get(r.objectId);e&&t((0,o.JR)(s,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void n.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):(0,a.pC)(this.onFeatureAdd)&&this.onFeatureAdd(e),(0,a.Wi)(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.$)((0,a.pC)(i)?i:(0,l.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),(0,a.pC)(i)&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_remove(e){return(0,a.pC)(this.onFeatureRemove)&&this.onFeatureRemove(e),this._markedIds.delete(e.objectId),this._boundsStore.delete(e.objectId),this._featuresById.delete(e.objectId),e}}},1231:(e,t,s)=>{s.d(t,{Z:()=>f});var r,i=s(43697),n=s(35454),a=s(96674),o=s(5600),l=(s(67676),s(80442),s(75215)),u=s(36030),d=s(71715),c=s(52011),h=s(72729),p=s(86719);const g=new n.Xn({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let y=r=class extends a.wq{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=-1,this.name=null,this.nullable=!0,this.type=null,this.valueType=null}readDescription(e,{description:t}){let s;try{s=JSON.parse(t)}catch(e){}return s?s.value:null}readValueType(e,{description:t}){let s;try{s=JSON.parse(t)}catch(e){}return s?g.fromJSON(s.fieldValueType):null}clone(){return new r({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType})}};(0,i._)([(0,o.Cb)({type:String,json:{write:!0}})],y.prototype,"alias",void 0),(0,i._)([(0,o.Cb)({type:[String,Number],json:{write:{allowNull:!0}}})],y.prototype,"defaultValue",void 0),(0,i._)([(0,o.Cb)()],y.prototype,"description",void 0),(0,i._)([(0,d.r)("description")],y.prototype,"readDescription",null),(0,i._)([(0,o.Cb)({types:h.V5,json:{read:{reader:h.im},write:!0}})],y.prototype,"domain",void 0),(0,i._)([(0,o.Cb)({type:Boolean,json:{write:!0}})],y.prototype,"editable",void 0),(0,i._)([(0,o.Cb)({type:l.z8,json:{write:!0}})],y.prototype,"length",void 0),(0,i._)([(0,o.Cb)({type:String,json:{write:!0}})],y.prototype,"name",void 0),(0,i._)([(0,o.Cb)({type:Boolean,json:{write:!0}})],y.prototype,"nullable",void 0),(0,i._)([(0,u.J)(p.v)],y.prototype,"type",void 0),(0,i._)([(0,o.Cb)()],y.prototype,"valueType",void 0),(0,i._)([(0,d.r)("valueType",["description"])],y.prototype,"readValueType",null),y=r=(0,i._)([(0,c.j)("esri.layers.support.Field")],y);const f=y},30547:(e,t,s)=>{s.d(t,{Z:()=>v});var r,i=s(43697),n=s(92835),a=s(84552),o=s(96674),l=s(22974),u=s(70586),d=s(5600),c=(s(75215),s(71715)),h=s(52011),p=s(30556);s(67676),s(80442);let g=r=class extends o.wq{constructor(e){super(e),this.respectsDaylightSaving=!1,this.timezone=null}readRespectsDaylightSaving(e,t){return void 0!==t.respectsDaylightSaving?t.respectsDaylightSaving:void 0!==t.respectDaylightSaving&&t.respectDaylightSaving}clone(){const{respectsDaylightSaving:e,timezone:t}=this;return new r({respectsDaylightSaving:e,timezone:t})}};(0,i._)([(0,d.Cb)({type:Boolean,json:{write:!0}})],g.prototype,"respectsDaylightSaving",void 0),(0,i._)([(0,c.r)("respectsDaylightSaving",["respectsDaylightSaving","respectDaylightSaving"])],g.prototype,"readRespectsDaylightSaving",null),(0,i._)([(0,d.Cb)({type:String,json:{read:{source:"timeZone"},write:{target:"timeZone"}}})],g.prototype,"timezone",void 0),g=r=(0,i._)([(0,h.j)("esri.layers.support.TimeReference")],g);const y=g;var f,m=s(78981);let _=f=class extends o.wq{constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,t){if(!t.timeExtent||!Array.isArray(t.timeExtent)||2!==t.timeExtent.length)return null;const s=new Date(t.timeExtent[0]),r=new Date(t.timeExtent[1]);return new n.Z({start:s,end:r})}writeFullTimeExtent(e,t){e&&(0,u.pC)(e.start)&&(0,u.pC)(e.end)?t.timeExtent=[e.start.getTime(),e.end.getTime()]:t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?new a.Z({value:t.timeInterval,unit:m.v.fromJSON(t.timeIntervalUnits)}):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?new a.Z({value:t.defaultTimeInterval,unit:m.v.fromJSON(t.defaultTimeIntervalUnits)}):null}writeInterval(e,t){if(e){const s=e.toJSON();t.timeInterval=s.value,t.timeIntervalUnits=s.unit}else t.timeInterval=null,t.timeIntervalUnits=null}clone(){const{cumulative:e,endField:t,hasLiveData:s,interval:r,startField:i,timeReference:n,fullTimeExtent:a,trackIdField:o,useTime:u}=this;return new f({cumulative:e,endField:t,hasLiveData:s,interval:r,startField:i,timeReference:(0,l.d9)(n),fullTimeExtent:(0,l.d9)(a),trackIdField:o,useTime:u})}};(0,i._)([(0,d.Cb)({type:Boolean,json:{read:{source:"exportOptions.timeDataCumulative"},write:{target:"exportOptions.timeDataCumulative"}}})],_.prototype,"cumulative",void 0),(0,i._)([(0,d.Cb)({type:String,json:{read:{source:"endTimeField"},write:{target:"endTimeField",allowNull:!0}}})],_.prototype,"endField",void 0),(0,i._)([(0,d.Cb)({type:n.Z,json:{write:{enabled:!0,allowNull:!0}}})],_.prototype,"fullTimeExtent",void 0),(0,i._)([(0,c.r)("fullTimeExtent",["timeExtent"])],_.prototype,"readFullTimeExtent",null),(0,i._)([(0,p.c)("fullTimeExtent")],_.prototype,"writeFullTimeExtent",null),(0,i._)([(0,d.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"hasLiveData",void 0),(0,i._)([(0,d.Cb)({type:a.Z,json:{write:{enabled:!0,allowNull:!0}}})],_.prototype,"interval",void 0),(0,i._)([(0,c.r)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],_.prototype,"readInterval",null),(0,i._)([(0,p.c)("interval")],_.prototype,"writeInterval",null),(0,i._)([(0,d.Cb)({type:String,json:{read:{source:"startTimeField"},write:{target:"startTimeField",allowNull:!0}}})],_.prototype,"startField",void 0),(0,i._)([(0,d.Cb)({type:y,json:{write:{enabled:!0,allowNull:!0}}})],_.prototype,"timeReference",void 0),(0,i._)([(0,d.Cb)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],_.prototype,"trackIdField",void 0),(0,i._)([(0,d.Cb)({type:Boolean,json:{read:{source:"exportOptions.useTime"},write:{target:"exportOptions.useTime"}}})],_.prototype,"useTime",void 0),_=f=(0,i._)([(0,h.j)("esri.layers.support.TimeInfo")],_);const v=_},66677:(e,t,s)=>{s.d(t,{ld:()=>g,B5:()=>c,M8:()=>f,G:()=>b,Qc:()=>h,DR:()=>p,Nm:()=>m,XG:()=>_,a7:()=>y,wH:()=>v});var r=s(70586),i=s(17452),n=s(25929);const a={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},o=Object.values(a),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),d=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function c(e){return!!l.test(e)}function h(e){const t=(0,i.mN)(e),s=t.path.match(l)||t.path.match(u);if(!s)return null;const[,r,n,o,d]=s,c=n.indexOf("/");return{title:g(-1!==c?n.slice(c+1):n),serverType:a[o.toLowerCase()],sublayer:null!=d&&""!==d?parseInt(d,10):null,url:{path:r}}}function p(e){const t=(0,i.mN)(e).path.match(d);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function g(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function y(e,t){const s=[];if(e){const t=h(e);(0,r.pC)(t)&&t.title&&s.push(t.title)}if(t){const e=g(t);s.push(e)}if(2===s.length){if(-1!==s[0].toLowerCase().indexOf(s[1].toLowerCase()))return s[0];if(-1!==s[1].toLowerCase().indexOf(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function f(e){if(!e)return!1;const t=-1!==(e=e.toLowerCase()).indexOf(".arcgis.com/"),s=-1!==e.indexOf("//services")||-1!==e.indexOf("//tiles")||-1!==e.indexOf("//features");return t&&s}function m(e,t){return e?(0,i.Qj)((0,i.Hu)(e,t)):e}function _(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.Hu)(t,e.logger);const s=(0,i.mN)(t),n=h(s.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(s.path);(0,r.pC)(e)&&(t=e.serviceUrl,a=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:a}}function v(e,t,s,r,a){(0,n.w)(t,r,"url",a),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function b(e){if(!e)return!1;const t=e.toLowerCase(),s=-1!==t.indexOf("/services/"),r=-1!==t.indexOf("/mapserver/wmsserver"),i=-1!==t.indexOf("/imageserver/wmsserver"),n=-1!==t.indexOf("/wmsserver");return s&&(r||i||n)}},72729:(e,t,s)=>{s.d(t,{im:()=>F,V5:()=>S}),s(80442);var r,i=s(43697),n=s(22974),a=s(5600),o=(s(75215),s(36030)),l=s(52011),u=s(96674);s(67676);let d=r=class extends u.wq{constructor(e){super(e),this.name=null,this.code=null}clone(){return new r({name:this.name,code:this.code})}};(0,i._)([(0,a.Cb)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,i._)([(0,a.Cb)({type:[String,Number],json:{write:!0}})],d.prototype,"code",void 0),d=r=(0,i._)([(0,l.j)("esri.layers.support.CodedValue")],d);const c=d,h=new(s(35454).Xn)({inherited:"inherited",codedValue:"coded-value",range:"range"});let p=class extends u.wq{constructor(e){super(e),this.name=null,this.type=null}};(0,i._)([(0,a.Cb)({type:String,json:{write:!0}})],p.prototype,"name",void 0),(0,i._)([(0,o.J)(h)],p.prototype,"type",void 0),p=(0,i._)([(0,l.j)("esri.layers.support.Domain")],p);const g=p;var y;let f=y=class extends g{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new y({codedValues:(0,n.d9)(this.codedValues),name:this.name})}};(0,i._)([(0,a.Cb)({type:[c],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,i._)([(0,o.J)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=y=(0,i._)([(0,l.j)("esri.layers.support.CodedValueDomain")],f);const m=f;var _;s(92604),s(37697);let v=_=class extends g{constructor(e){super(e),this.type="inherited"}clone(){return new _}};(0,i._)([(0,o.J)({inherited:"inherited"})],v.prototype,"type",void 0),v=_=(0,i._)([(0,l.j)("esri.layers.support.InheritedDomain")],v);const b=v;var T;let C=T=class extends g{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new T({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,i._)([(0,a.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,s){t[s]=[this.minValue||0,e]}}}})],C.prototype,"maxValue",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],C.prototype,"minValue",void 0),(0,i._)([(0,o.J)({range:"range"})],C.prototype,"type",void 0),C=T=(0,i._)([(0,l.j)("esri.layers.support.RangeDomain")],C);const w=C,S={key:"type",base:g,typeMap:{range:C,"coded-value":m,inherited:b}};function F(e){if(!e||!e.type)return null;switch(e.type){case"range":return w.fromJSON(e);case"codedValue":return m.fromJSON(e);case"inherited":return b.fromJSON(e)}return null}},86719:(e,t,s)=>{s.d(t,{v:()=>r});const r=new(s(35454).Xn)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml"})},78981:(e,t,s)=>{s.d(t,{v:()=>r});const r=(0,s(35454).wY)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},77863:(e,t,s)=>{s.d(t,{K9:()=>k,O7:()=>c,G$:()=>S});var r=s(20102),i=s(70586),n=s(45091),a=s(5428),o=s(78760);const l=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],u=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],d=["upperLeft","lowerLeft"];function c(e){return e>=l.length?null:l[e]}function h(e){return e>=u.length?null:u[e]}function p(e){return e>=d.length?null:d[e]}function g(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function y(e,t,s){const r=t.createPointGeometry(s);for(;e.next();)switch(e.tag()){case 3:{const s=e.getUInt32(),i=e.pos()+s;let n=0;for(;e.pos()<i;)t.addCoordinatePoint(r,e.getSInt64(),n++);break}default:e.skip()}return r}function f(e,t,s){const r=t.createGeometry(s),i=2+(s.hasZ?1:0)+(s.hasM?1:0);for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),i=e.pos()+s;let n=0;for(;e.pos()<i;)t.addLength(r,e.getUInt32(),n++);break}case 3:{const s=e.getUInt32(),n=e.pos()+s;let a=0;for(t.allocateCoordinates(r);e.pos()<n;)t.addCoordinate(r,e.getSInt64(),a),a++,a===i&&(a=0);break}default:e.skip()}return r}function m(e){const t=new a.Z;let s="esriGeometryPoint";for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.lengths.push(e.getUInt32());break}case 3:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.coords.push(e.getSInt64());break}case 1:s=o.A[e.getEnum()];break;default:e.skip()}return{queryGeometry:t,queryGeometryType:s}}function _(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function v(e){const t={type:c(0)};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.type=c(e.getEnum());break;case 3:t.alias=e.getString();break;case 4:t.sqlType=h(e.getEnum());break;case 5:default:e.skip();break;case 6:t.defaultValue=e.getString()}return t}function b(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.isSystemMaintained=e.getBool();break;default:e.skip()}return t}function T(e,t,s,r){const i=t.createFeature(s);let n=0;for(;e.next();)switch(e.tag()){case 1:{const t=r[n++].name;i.attributes[t]=e.processMessage(_);break}case 2:i.geometry=e.processMessageWithArgs(f,t,s);break;case 4:i.centroid=e.processMessageWithArgs(y,t,s);break;default:e.skip()}return i}function C(e){const t=[1,1,1,1];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function w(e){const t=[0,0,0,0];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function S(e){const t={originPosition:p(0)};for(;e.next();)switch(e.tag()){case 1:t.originPosition=p(e.getEnum());break;case 2:t.scale=e.processMessage(C);break;case 3:t.translate=e.processMessage(w);break;default:e.skip()}return t}function F(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.shapeAreaFieldName=e.getString();break;case 2:t.shapeLengthFieldName=e.getString();break;case 3:t.units=e.getString();break;default:e.skip()}return t}function I(e,t){const s=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:s.wkid=e.getUInt32();break;case 5:s.wkt=e.getString();break;case 2:s.latestWkid=e.getUInt32();break;case 3:s.vcsWkid=e.getUInt32();break;case 4:s.latestVcsWkid=e.getUInt32();break;default:e.skip()}return s}function E(e,t){const s=t.createFeatureResult();s.geometryType=g(t,0);let r=!1;for(;e.next();)switch(e.tag()){case 1:s.objectIdFieldName=e.getString();break;case 3:s.globalIdFieldName=e.getString();break;case 4:s.geohashFieldName=e.getString();break;case 5:s.geometryProperties=e.processMessage(F);break;case 7:s.geometryType=g(t,e.getEnum());break;case 8:s.spatialReference=e.processMessageWithArgs(I,t);break;case 10:s.hasZ=e.getBool();break;case 11:s.hasM=e.getBool();break;case 12:s.transform=e.processMessage(S);break;case 9:{const t=e.getBool();s.exceededTransferLimit=t;break}case 13:t.addField(s,e.processMessage(v));break;case 15:r||(t.prepareFeatures(s),r=!0),t.addFeature(s,e.processMessageWithArgs(T,t,s,s.fields));break;case 2:s.uniqueIdField=e.processMessage(b);break;default:e.skip()}return t.finishFeatureResult(s),s}function x(e,t){const s={};let r=null;for(;e.next();)switch(e.tag()){case 4:r=e.processMessageWithArgs(m);break;case 1:s.featureResult=e.processMessageWithArgs(E,t);break;default:e.skip()}return(0,i.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function k(e,t){try{const s=2,r=new n.Z(new Uint8Array(e),new DataView(e)),i={};for(;r.next();)r.tag()===s?i.queryResult=r.processMessageWithArgs(x,t):r.skip();return i}catch(e){throw new r.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},78760:(e,t,s)=>{s.d(t,{A:()=>l,J:()=>u});var r=s(67900),i=s(8744),n=s(70272),a=s(44876),o=s(5428);const l=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class u{constructor(e){this.options=e,this.geometryTypes=l,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new a.Z}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this.options.sourceSpatialReference||!e.spatialReference||(0,i.fS)(e.spatialReference,this.options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,r._R)(this.options.sourceSpatialReference)/(0,r._R)(e.spatialReference);if(1!==t)for(const s of e.features){if(!(0,n.S6)(s))continue;const e=s.geometry.coords;for(let s=2;s<e.length;s+=3)e[s]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new n.ZP}createSpatialReference(){return{wkid:0}}createGeometry(){return new o.Z}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new o.Z}}},45178:(e,t,s)=>{s.d(t,{C:()=>i});var r=s(77863);function i(e,t){const s=(0,r.K9)(e,t),i=s.queryResult.featureResult,n=s.queryResult.queryGeometry,a=s.queryResult.queryGeometryType;if(i&&i.features&&i.features.length&&i.objectIdFieldName){const e=i.objectIdFieldName;for(const t of i.features)t.attributes&&(t.objectId=t.attributes[e])}return i&&(i.queryGeometry=n,i.queryGeometryType=a),i}},34599:(e,t,s)=>{s.r(t),s.d(t,{executeQuery:()=>g,executeQueryForCount:()=>_,executeQueryForExtent:()=>v,executeQueryForIds:()=>m,executeQueryPBF:()=>y,executeQueryPBFBuffer:()=>f,queryToQueryStringParameters:()=>p,runQuery:()=>b});var r=s(3172),i=s(70586),n=s(17452),a=s(33955),o=s(38581),l=s(66677),u=s(45178),d=s(28694),c=s(99306);const h="Layer does not support extent calculation.";function p(e,t,s=!1){const r=e.geometry,n=e.toJSON(),o=n,l=e.outSpatialReference;let u,d;if((0,i.pC)(r)){if(u=r.spatialReference,d=r.spatialReference.wkid||JSON.stringify(r.spatialReference),o.geometryType=(0,a.Ji)(r),s&&"extent"===r.type)o.geometry=`${r.xmin},${r.ymin},${r.xmax},${r.ymax}`;else if(s&&"point"===r.type)o.geometry=`${r.x},${r.y}`;else{const e=r.toJSON();delete e.spatialReference,o.geometry=JSON.stringify(e)}o.inSR=d}if(u||(u=l),n.groupByFieldsForStatistics&&(o.groupByFieldsForStatistics=n.groupByFieldsForStatistics.join(",")),n.objectIds&&(o.objectIds=n.objectIds.join(",")),n.orderByFields&&(o.orderByFields=n.orderByFields.join(",")),!n.outFields||!n.returnDistinctValues&&(null!=t&&t.returnCountOnly||null!=t&&t.returnExtentOnly||null!=t&&t.returnIdsOnly)?delete o.outFields:-1!==n.outFields.indexOf("*")?o.outFields="*":o.outFields=n.outFields.join(","),n.outSR?o.outSR=n.outSR.wkid||JSON.stringify(n.outSR):r&&(n.returnGeometry||n.returnCentroid)&&(o.outSR=o.inSR),n.returnGeometry&&delete n.returnGeometry,n.outStatistics&&(o.outStatistics=JSON.stringify(n.outStatistics)),n.pixelSize&&(o.pixelSize=JSON.stringify(n.pixelSize)),n.quantizationParameters&&(s&&(0,i.pC)(u)&&(0,i.pC)(e.quantizationParameters)&&(0,i.pC)(e.quantizationParameters.extent)&&u.equals(e.quantizationParameters.extent.spatialReference)&&delete n.quantizationParameters.extent.spatialReference,o.quantizationParameters=JSON.stringify(n.quantizationParameters)),n.parameterValues&&(o.parameterValues=JSON.stringify(n.parameterValues)),n.rangeValues&&(o.rangeValues=JSON.stringify(n.rangeValues)),n.dynamicDataSource&&(o.layer=JSON.stringify({source:n.dynamicDataSource}),delete n.dynamicDataSource),n.timeExtent){const e=n.timeExtent,{start:t,end:s}=e;null==t&&null==s||(o.time=t===s?t:`${null==t?"null":t},${null==s?"null":s}`),delete n.timeExtent}return o}async function g(e,t,s,r){const n=(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await b(e,t,"json",r);return(0,d.p)(t,s,n.data),n}async function y(e,t,s,r){if((0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty)return Promise.resolve({data:s.createFeatureResult()});const n=await f(e,t,r),a=n;return a.data=(0,u.C)(n.data,s),a}function f(e,t,s){return b(e,t,"pbf",s)}function m(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):b(e,t,"json",s,{returnIdsOnly:!0})}function _(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):b(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function v(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):b(e,t,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then((e=>{const t=e.data;if(t.hasOwnProperty("extent"))return e;if(t.features)throw new Error(h);if(t.hasOwnProperty("count"))throw new Error(h);return e}))}function b(e,t,s,a={},u={}){const d="string"==typeof e?(0,n.mN)(e):e,h=t.geometry?[t.geometry]:[];return a.responseType="pbf"===s?"array-buffer":"json",(0,o.aX)(h,null,a).then((e=>{const o=e&&e[0];(0,i.pC)(o)&&((t=t.clone()).geometry=o);const h=(0,l.M8)(d.path),g=(0,c.A)({...d.query,f:s,...u,...p(t,u,h)});return(0,r.default)((0,n.v_)(d.path,"query"),{...a,query:{...g,...a.query}})}))}},28694:(e,t,s)=>{s.d(t,{p:()=>n});var r=s(70586),i=s(69285);function n(e,t,s){if(!s||!s.features||!s.hasZ)return;const n=(0,i.k)(s.geometryType,t,e.outSpatialReference);if(!(0,r.Wi)(n))for(const e of s.features)n(e.geometry)}},98046:(e,t,s)=>{s.d(t,{Z:()=>p});var r,i=s(43697),n=s(22303),a=s(22974),o=s(5600),l=s(75215),u=s(36030),d=s(52011),c=s(899);let h=r=class extends c.Z{constructor(e){super(e),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new r({fromColor:(0,a.d9)(this.fromColor),toColor:(0,a.d9)(this.toColor),algorithm:this.algorithm})}};(0,i._)([(0,u.J)({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],h.prototype,"algorithm",void 0),(0,i._)([(0,o.Cb)({type:n.Z,json:{type:[l.z8],write:!0}})],h.prototype,"fromColor",void 0),(0,i._)([(0,o.Cb)({type:n.Z,json:{type:[l.z8],write:!0}})],h.prototype,"toColor",void 0),(0,i._)([(0,o.Cb)({type:["algorithmic"]})],h.prototype,"type",void 0),h=r=(0,i._)([(0,d.j)("esri.rest.support.AlgorithmicColorRamp")],h);const p=h},899:(e,t,s)=>{s.d(t,{Z:()=>l});var r=s(43697),i=s(96674),n=s(5600),a=(s(67676),s(80442),s(75215),s(52011));let o=class extends i.wq{constructor(e){super(e),this.type=null}};(0,r._)([(0,n.Cb)({readOnly:!0,json:{read:!1,write:!0}})],o.prototype,"type",void 0),o=(0,r._)([(0,a.j)("esri.rest.support.ColorRamp")],o);const l=o},1515:(e,t,s)=>{s.d(t,{Z:()=>c});var r,i=s(43697),n=s(22974),a=s(5600),o=(s(75215),s(52011)),l=s(98046),u=s(899);let d=r=class extends u.Z{constructor(e){super(e),this.colorRamps=null,this.type="multipart"}clone(){return new r({colorRamps:(0,n.d9)(this.colorRamps)})}};(0,i._)([(0,a.Cb)({type:[l.Z],json:{write:!0}})],d.prototype,"colorRamps",void 0),(0,i._)([(0,a.Cb)({type:["multipart"]})],d.prototype,"type",void 0),d=r=(0,i._)([(0,o.j)("esri.rest.support.MultipartColorRamp")],d);const c=d},94593:(e,t,s)=>{s.d(t,{i:()=>o,V:()=>a});var r=s(98046),i=s(899),n=s(1515);const a={key:"type",base:i.Z,typeMap:{algorithmic:r.Z,multipart:n.Z}};function o(e){return e&&e.type?"algorithmic"===e.type?r.Z.fromJSON(e):"multipart"===e.type?n.Z.fromJSON(e):null:null}},89164:(e,t,s)=>{s.d(t,{Z:()=>p});var r=s(43697),i=s(22303),n=s(35454),a=s(96674),o=s(5600),l=(s(67676),s(80442),s(75215),s(71715)),u=s(52011);const d=new n.Xn({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let c=0,h=class extends a.wq{constructor(e){super(e),this.id="sym"+c++,this.type=null,this.color=new i.Z([0,0,0,1])}readColor(e){return e&&null!=e[0]?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,t){}hash(){return JSON.stringify(this.toJSON())}clone(){}};(0,r._)([(0,o.Cb)({type:d.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:d.write}}})],h.prototype,"type",void 0),(0,r._)([(0,o.Cb)({type:i.Z,json:{write:{allowNull:!0}}})],h.prototype,"color",void 0),(0,r._)([(0,l.r)("color")],h.prototype,"readColor",null),h=(0,r._)([(0,u.j)("esri.symbols.Symbol")],h);const p=h},99306:(e,t,s)=>{function r(e){const t={};for(const s in e){if("declaredClass"===s)continue;const i=e[s];if(null!=i&&"function"!=typeof i)if(Array.isArray(i)){t[s]=[];for(let e=0;e<i.length;e++)t[s][e]=r(i[e])}else"object"==typeof i?i.toJSON&&(t[s]=JSON.stringify(i)):t[s]=i}return t}s.d(t,{A:()=>r})},2255:(e,t,s)=>{s.r(t),s.d(t,{FeatureServiceSnappingSourceWorker:()=>X,default:()=>K});var r=s(43697),i=s(32448),n=s(61247),a=s(70586),o=s(95330),l=s(43050),u=s(5600),d=s(67676),c=(s(80442),s(75215),s(52011)),h=s(82971),p=s(57191),g=s(7673),y=s(11145),f=s(30547),m=s(57444),_=s(15923);let v=class extends _.Z{constructor(){super(...arguments),this.updating=!1,this.pending=[]}push(e,t){this.pending.push({promise:e,callback:t}),1===this.pending.length&&this._process()}_process(){if(!this.pending.length)return void(this.updating=!1);this.updating=!0;const e=this.pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this.pending.shift(),this._process()}))}};(0,r._)([(0,u.Cb)()],v.prototype,"updating",void 0),v=(0,r._)([(0,c.j)("esri.core.AsyncSequence")],v);var b,T=s(3920),C=s(50758),w=s(92604),S=s(17445),F=s(6570),I=s(24470),E=s(98732),x=s(78760),k=s(34599),O=s(66643);class D{constructor(e,t){this.data=e,this.resolution=t,this.state={type:b.CREATED},this.alive=!0}process(e){switch(this.state.type){case b.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case b.FETCH_COUNT:break;case b.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case b.FETCH_FEATURES:break;case b.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case b.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this.featureCount,state:this.stateToString}}get featureCount(){switch(this.state.type){case b.CREATED:case b.FETCH_COUNT:return 0;case b.FETCHED_COUNT:return this.state.featureCount;case b.FETCH_FEATURES:return this.state.previous.featureCount;case b.FETCHED_FEATURES:return this.state.features.length;case b.DONE:return this.state.previous.features.length}}get stateToString(){switch(this.state.type){case b.CREATED:return"created";case b.FETCH_COUNT:return"fetch-count";case b.FETCHED_COUNT:return"fetched-count";case b.FETCH_FEATURES:return"fetch-features";case b.FETCHED_FEATURES:return"fetched-features";case b.DONE:return"done"}}_gotoFetchCount(e,t){return{type:b.FETCH_COUNT,previous:e,task:(0,o.vr)((async e=>{const s=await(0,O.mt)(t.fetchCount(this,e));this.state.type===b.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:b.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:b.FETCH_FEATURES,previous:e,task:(0,o.vr)((async s=>{const r=await(0,O.mt)(t.fetchFeatures(this,e.featureCount,s));this.state.type===b.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,r.ok?r.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:b.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:b.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:b.CREATED},e.type){case b.CREATED:case b.FETCHED_COUNT:case b.FETCHED_FEATURES:case b.DONE:break;case b.FETCH_COUNT:case b.FETCH_FEATURES:e.task.abort()}}intersects(e){return!(!(0,a.Wi)(e)&&this.data.extent)||((0,I.oJ)(e,R),(0,I.kK)(this.data.extent,R))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(b||(b={}));const R=(0,I.Ue)(),N=w.Z.getLogger("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher");let M=class extends T.r{constructor(e){super(e),this.tilesOfInterest=[],this.availability=0,this.pendingTiles=new Map,this.pendingEdits=new v,this.pendingEditsAbortController=new AbortController}get minimumVerticesPerFeature(){var e;switch(null==(e=this.store)?void 0:e.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&((0,a.pC)(e)&&(0,a.pC)(t)&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingHandles.updating||this.pendingEdits.updating}initialize(){this._initializeFetchExtent(),this.updatingHandles.add((()=>this.configuration),(()=>this.refresh())),this.updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,d.fS)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),S.Z_)}destroy(){this.pendingTiles.forEach((e=>this._deletePendingTile(e))),this.pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this.pendingEditsAbortController.abort(),this.pendingEditsAbortController=null}refresh(){this.store.refresh(),this.pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this.pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this.pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this.updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this.pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent)return;const e=(0,o.vr)((async e=>{try{var t;const s=await(0,k.executeQueryForExtent)(this.url,new m.Z({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this.configuration.customParameters,signal:e});this.store.extent=F.Z.fromJSON(null==(t=s.data)?void 0:t.extent)}catch(e){(0,o.r9)(e),N.warn("Failed to fetch data extent",e)}}));this.updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.handles.add((0,C.kB)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this.pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this.pendingTiles)e.alive=!1}_createPendingTiles(){const e=this._collectMissingTilesInfo();if(this._setAvailability((0,a.Wi)(e)?1:e.coveredArea/e.fullArea),!(0,a.Wi)(e))for(const{data:t,resolution:s}of e.missingTiles){const e=this.pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],r=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)));(0,a.Wi)(e)?e=r:e.prepend(r)}return e}_deletePendingTiles(){for(const[,e]of this.pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this.pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this.updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this.minimumVerticesPerFeature<B}_verifyFeatureDensity(e,t){if((0,a.Wi)(this.tileInfo))return!1;const s=this.tileSize*t;return e*(j/(s*s))<U}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this.pendingTiles)s.state.type<b.FETCHED_COUNT&&this.updatingHandles.addPromise(s.process(e)),s.state.type<=b.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability((0,a.Wi)(e)?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new D(e,t);return this.pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this.pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:P,signal:t})}async _fetchFeatures(e,t,s){let r,i=0,n=0,o=t;for(;;){const l=this._createFeaturesQuery(e),u=this._setPagingParameters(l,i,o),{features:d,exceededTransferLimit:c}=await this._queryFeatures(l,s);if(u&&(i+=(0,a.Wg)(l.num)),n+=d.length,r=r?r.concat(d):d,o=t-n,!u||!c||o<=0)return r}}_filterProperties(e){return(0,a.Wi)(e)?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if((0,a.Wi)(t))throw new Error("Expected globalIdField to be defined");let r=null;if(this.store.featureStore.forEach((i=>{var n;e===i.attributes[t]&&(r=null!=(n=i.objectId)?n:i.attributes[s])})),(0,a.Wi)(r))throw new Error(`Expected to find a feature with globalId ${e}`);return r}_queryFeaturesById(e,t){const s=this._createFeaturesQuery(null);return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:r}=await(0,k.executeQueryPBF)(this.url,e,new x.J({sourceSpatialReference:s}),{query:this.configuration.customParameters,timeout:P,signal:t});return(0,E.lM)(r)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:r}=await(0,k.executeQuery)(this.url,e,s,{query:this.configuration.customParameters,timeout:P,signal:t});return(0,E.h_)(r,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e){const t=this._createBaseQuery(e);return t.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],t.returnGeometry=!0,(0,a.pC)(e)&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new m.Z({returnZ:!1,returnM:!1,geometry:(0,a.pC)(this.tileInfo)&&(0,a.pC)(e)?(0,I.HH)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this.configuration.filter;return(0,a.pC)(s)&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:r,supportsCacheHint:i,tileMaxRecordCount:n,maxRecordCount:a,supportsResultType:o}=this.capabilities.query,l=r?m.Z.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((o||i)&&n?n:a||A);return e.start=t,r?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"url",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"objectIdField",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"globalIdField",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"capabilities",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"sourceSpatialReference",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"spatialReference",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"store",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],M.prototype,"minimumVerticesPerFeature",null),(0,r._)([(0,u.Cb)()],M.prototype,"filter",null),(0,r._)([(0,u.Cb)()],M.prototype,"customParameters",null),(0,r._)([(0,u.Cb)({readOnly:!0})],M.prototype,"configuration",null),(0,r._)([(0,u.Cb)()],M.prototype,"tileInfo",null),(0,r._)([(0,u.Cb)()],M.prototype,"tileSize",null),(0,r._)([(0,u.Cb)()],M.prototype,"tilesOfInterest",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],M.prototype,"updating",null),(0,r._)([(0,u.Cb)({readOnly:!0})],M.prototype,"availability",void 0),M=(0,r._)([(0,c.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],M);const A=2e3,P=6e5,B=1e6,j=25,U=1;var q=s(43090),V=s(37549);class H{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(this._byteSize-=t.byteSize,!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,r]of this._store){if(this._byteSize<=e)break;this.delete(s),t(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let Z=class extends _.Z{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*q.Y8.MEGABYTES,this.tileBounds=new V.H,this.tiles=new H,this.refCounts=new Map,this.tileFeatureCounts=new Map,this.tmpBoundingRect=(0,I.Ue)()}add(e,t){const s=[];for(const e of t)this._referenceFeature(e.objectId)===W.ADDED&&s.push(e);this._addTileStorage(e,new Set(t.map((({objectId:e})=>e))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if((0,a.Wi)(e))return 0;const t=(0,q.do)(e.lengths,4);return 32+(0,q.do)(e.coords,8)+t}(e.geometry)+(0,q.f2)(e.attributes)}(t)),0)}(t)),this.featureStore.addMany(s),this.tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}destroy(){this.clear(),this.tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this.tileBounds.clear(),this.tiles.clear(),this.refCounts.clear()}refresh(){this.clear(),this.tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){this.tiles.set(e.id,new L(e,t,s)),this.tileBounds.set(e.id,e.extent),this.tileFeatureCounts.set(e.id,t.size)}_remove({id:e}){const t=this.tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===W.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this.tiles.delete(s),this.tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this.tiles){for(const s of e)t.objectIds.delete(s);this.tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this.refCounts.delete(t)}async _processEditsRefetch(e,t,s){const r=(await t(e,s)).features,{hasZ:i,hasM:n}=this.featureStore;for(const e of r){const t=(0,E.$)(this.tmpBoundingRect,e.geometry,i,n);(0,a.Wi)(t)||this.tileBounds.forEachInBounds(t,(t=>{const s=this.tiles.get(t);this.featureStore.add(e),s.objectIds.has(e.objectId)||(s.objectIds.add(e.objectId),this._referenceFeature(e.objectId),this.tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0)){if((0,a.Wi)(this.tileInfo)||!e.extent||(0,a.pC)(this.extent)&&!(0,I.kK)((0,I.oJ)(this.extent,this.tmpBoundingRect),e.extent))return new G(e);if(this.tiles.has(e.id))return new G(e);const s=this._createTileTree(e,this.tileInfo);return this._simplify(s,t,null,0,1),this._collectMissingTiles(e,s,this.tileInfo)}get debugInfo(){return Array.from(this.tiles.values()).map((({data:e})=>({data:e,featureCount:this.tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){const t=this.tileFeatureCounts.get(e.id);return null!=t?t:0}async fetchCount(e,t,s,r){const i=this.tileFeatureCounts.get(e.id);if(null!=i)return i;const n=await(0,k.executeQueryForCount)(t,s,r);return this.tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new J(e.level,e.row,e.col);return t.updateTileInfo(s,y.Z.ExtrapolateOptions.POWER_OF_TWO),this.tileBounds.forEachInBounds(e.extent,(r=>{const i=this.tiles.get(r).data;this._tilesAreRelated(e,i)&&this._populateChildren(s,i,t,this.tileFeatureCounts.get(i.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,r=s?e:t,i=s?t:e,n=1<<i.level-r.level;return Math.floor(i.row/n)===r.row&&Math.floor(i.col/n)===r.col}_populateChildren(e,t,s,r){const i=t.level-e.level-1;if(i<0)return void(e.isLeaf=!0);const n=t.row>>i,o=t.col>>i,l=e.row<<1,u=o-(e.col<<1)+(n-l<<1),d=e.children[u];if((0,a.pC)(d))this._populateChildren(d,t,s,r);else{const i=new J(e.level+1,n,o);s.updateTileInfo(i,y.Z.ExtrapolateOptions.POWER_OF_TWO),e.children[u]=i,this._populateChildren(i,t,s,r)}}_simplify(e,t,s,r,i){const n=i*i;if(e.isLeaf)return t(this.getFeatureCount(e),i)?0:(this._remove(e),(0,a.pC)(s)&&(s.children[r]=null),n);const o=i/2,l=o*o;let u=0;for(let s=0;s<e.children.length;s++){const r=e.children[s];u+=(0,a.pC)(r)?this._simplify(r,t,e,s,o):l}return 0===u?this._mergeChildren(e):1-u/n<Y&&(this._purge(e),(0,a.pC)(s)&&(s.children[r]=null),u=n),u}_mergeChildren(e){const t=new Set;let s=0;this._forEachLeaf(e,(e=>{const r=this.tiles.get(e.id);if(r){s+=r.byteSize;for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,s),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this.tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)(0,a.Wi)(s)||(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(!(0,a.Wi)(e))if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s){const r=new z(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1),r.info}_collectMissingTilesRecurse(e,t,s){if(e.isLeaf)return;if(!e.hasChildren)return void t.addMissing(e.level,e.row,e.col,s);const r=s/2;for(let s=0;s<e.children.length;s++){const i=e.children[s];(0,a.Wi)(i)?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),r):this._collectMissingTilesRecurse(i,t,r)}}_referenceFeature(e){const t=(this.refCounts.get(e)||0)+1;return this.refCounts.set(e,t),1===t?W.ADDED:W.UNCHANGED}_unreferenceFeature(e){const t=(this.refCounts.get(e)||0)-1;return 0===t?(this.refCounts.delete(e),W.REMOVED):(t>0&&this.refCounts.set(e,t),W.UNCHANGED)}get test(){return{tiles:Array.from(this.tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this.refCounts.keys()).map((e=>`${e}:${this.refCounts.get(e)}`))}}};(0,r._)([(0,u.Cb)({constructOnly:!0})],Z.prototype,"featureStore",void 0),(0,r._)([(0,u.Cb)()],Z.prototype,"tileInfo",void 0),(0,r._)([(0,u.Cb)()],Z.prototype,"extent",void 0),(0,r._)([(0,u.Cb)()],Z.prototype,"maximumByteSize",void 0),Z=(0,r._)([(0,c.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],Z);class L{constructor(e,t,s){this.data=e,this.objectIds=t,this.byteSize=s}}class J{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&((0,a.pC)(this.children[0])||(0,a.pC)(this.children[1])||(0,a.pC)(this.children[2])||(0,a.pC)(this.children[3]))}}class G{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,I.SO)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class z{constructor(e,t,s){this.tileInfo=e,this.extent=null,this.info=new G(t),(0,a.pC)(s)&&(this.extent=(0,I.oJ)(s))}addMissing(e,t,s,r){const i={id:null,level:e,row:t,col:s};this.tileInfo.updateTileInfo(i,y.Z.ExtrapolateOptions.POWER_OF_TWO),!(0,a.pC)(i.extent)||(0,a.pC)(this.extent)&&!(0,I.kK)(this.extent,i.extent)||(this.info.missingTiles.push({data:i,resolution:r}),this.info.coveredArea-=(0,I.SO)(i.extent))}}const Y=.18751;var W,Q;(Q=W||(W={}))[Q.ADDED=0]="ADDED",Q[Q.REMOVED=1]="REMOVED",Q[Q.UNCHANGED=2]="UNCHANGED";var $=s(89749);let X=class extends i.Z.EventedAccessor{constructor(){super(...arguments),this.isInitializing=!0,this.whenSetup=(0,o.dD)(),this.handles=new n.Z,this.updatingHandles=new $.t,this.pendingApplyEdits=new Map}get updating(){return this.featureFetcher.updating||this.isInitializing||this.updatingHandles.updating}destroy(){this.featureFetcher.destroy(),this.queryEngine.destroy(),this.featureStore.clear(),this.handles.destroy()}async setup(e){const{geometryType:t,objectIdField:s,timeInfo:r,fields:i}=e.serviceInfo;return this.featureStore=new p.Z({...e.serviceInfo,hasZ:!1,hasM:!1}),this.queryEngine=new g.Z({spatialReference:e.spatialReference,featureStore:this.featureStore,geometryType:t,fields:i,hasZ:!1,hasM:!1,objectIdField:s,timeInfo:r?f.Z.fromJSON(r):null}),this.featureFetcher=new M({store:new Z({featureStore:this.featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:h.Z.fromJSON(e.spatialReference),sourceSpatialReference:h.Z.fromJSON(e.serviceInfo.spatialReference)}),this.handles.add([this.featureFetcher.watch("availability",(e=>this.emit("notify-availability",{availability:e})),!0),this.watch("updating",(()=>this._notifyUpdating()))]),this.whenSetup.resolve(),this.isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this.updatingHandles.addPromise(this.whenSetup.promise),this._updateFeatureFetcherConfiguration(e),{result:{}}}async fetchCandidates(e,t){return await this.whenSetup.promise,(0,o.k_)(t),{result:await this.queryEngine.executeQueryForSnapping({point:e.point,distance:e.distance,types:e.types,query:(0,a.pC)(e.filter)?e.filter:{where:"1=1"}},(0,a.pC)(t)?t.signal:null)}}async updateTiles(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,o.k_)(t),this.featureFetcher.tileSize=e.tileSize,this.featureFetcher.tilesOfInterest=e.tiles,this.featureFetcher.tileInfo=(0,a.pC)(e.tileInfo)?y.Z.fromJSON(e.tileInfo):null,{result:{}}}async refresh(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,o.k_)(t),this.featureFetcher.refresh(),{result:{}}}async whenNotUpdating(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,o.k_)(t),await(0,o.Hl)((0,l.cm)(this,"updating"),t),{result:{}}}async getDebugInfo(e,t){return(0,o.k_)(t),{result:this.featureFetcher.debugInfo}}async beginApplyEdits(e,t){this.updatingHandles.addPromise(this.whenSetup.promise),(0,o.k_)(t);const s=(0,o.dD)();return this.pendingApplyEdits.set(e.id,s),this.featureFetcher.applyEdits(s.promise),this.updatingHandles.addPromise(s.promise),{result:{}}}async endApplyEdits(e,t){const s=this.pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,o.k_)(t),{result:{}}}_updateFeatureFetcherConfiguration(e){this.featureFetcher.filter=(0,a.pC)(e.filter)?m.Z.fromJSON(e.filter):null,this.featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};function K(){return new X}(0,r._)([(0,u.Cb)({readOnly:!0})],X.prototype,"updating",null),(0,r._)([(0,u.Cb)()],X.prototype,"isInitializing",void 0),X=(0,r._)([(0,c.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],X)},89749:(e,t,s)=>{s.d(t,{t:()=>c});var r=s(43697),i=s(15923),n=s(61247),a=s(70586),o=s(17445),l=s(1654),u=s(5600),d=s(52011);let c=class extends i.Z{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new n.Z,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,t,s={}){const r=++this.handleId;s.sync||this._installSyncUpdatingWatch(e,r);const i=(0,o.YP)(e,t,s);return this.handles.add(i,r),{remove:()=>this.handles.remove(r)}}addOnCollectionChange(e,t,{initial:s=!1}={}){const r=++this.handleId;return this.handles.add([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.Z_),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.items,removed:[],moved:[],target:e}):void 0})],r),{remove:()=>this.handles.remove(r)}}addPromise(e){if((0,a.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(h)||this._set("updating",!1))}},t),this.pendingPromises.add(e),this._set("updating",!0);const s=()=>this.handles.remove(t);return e.then(s,s),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),r=(0,o.YP)(e,s,{sync:!0,equals:()=>!1});return this.handles.add(r,t),r}_createSyncUpdatingCallback(){return()=>{this.handles.remove(h),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,l.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(h))})),h)}}};(0,r._)([(0,u.Cb)({readOnly:!0})],c.prototype,"updating",void 0),c=(0,r._)([(0,d.j)("esri.views.support.WatchUpdatingTracking")],c);const h=-42;var p,g;(g=p||(p={}))[g.NONE=0]="NONE",g[g.SYNC=1]="SYNC",g[g.INIT=2]="INIT"}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5404,5732],{92835:(e,t,s)=>{s.d(t,{Z:()=>y});var r,i=s(43697),n=s(96674),a=s(70586),o=s(35463),l=s(5600),u=(s(67676),s(80442),s(75215),s(71715)),d=s(52011),c=s(30556);let h=r=class extends n.wq{constructor(e){super(e),this.end=null,this.start=null}static get allTime(){return p}static get empty(){return g}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?e.getTime():null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=(0,a.pC)(this.start)?this.start.getTime():this.start,s=(0,a.pC)(this.end)?this.end.getTime():this.end,r=(0,a.pC)(e.start)?e.start.getTime():e.start,i=(0,a.pC)(e.end)?e.end.getTime():e.end;return t===r&&s===i}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=(0,a.Po)(this.start,(t=>(0,o.JE)(t,e))),s=(0,a.Po)(this.end,(t=>(0,o.Nm)((0,o.JE)(t,e),1,e)));return new r({start:t,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=(0,a.R2)(this.start,-1/0,(e=>e.getTime())),s=(0,a.R2)(this.end,1/0,(e=>e.getTime())),i=(0,a.R2)(e.start,-1/0,(e=>e.getTime())),n=(0,a.R2)(e.end,1/0,(e=>e.getTime()));let o,l;if(i>=t&&i<=s?o=i:t>=i&&t<=n&&(o=t),s>=i&&s<=n?l=s:n>=t&&n<=s&&(l=n),!isNaN(o)&&!isNaN(l)){const e=new r;return e.start=o===-1/0?null:new Date(o),e.end=l===1/0?null:new Date(l),e}return r.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const s=new r,{start:i,end:n}=this;return(0,a.pC)(i)&&(s.start=(0,o.Nm)(i,e,t)),(0,a.pC)(n)&&(s.end=(0,o.Nm)(n,e,t)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=(0,a.pC)(this.start)&&(0,a.pC)(e.start)?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=(0,a.pC)(this.end)&&(0,a.pC)(e.end)?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:s})}};(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,i._)([(0,u.r)("end")],h.prototype,"readEnd",null),(0,i._)([(0,c.c)("end")],h.prototype,"writeEnd",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,i._)([(0,l.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,i._)([(0,u.r)("start")],h.prototype,"readStart",null),(0,i._)([(0,c.c)("start")],h.prototype,"writeStart",null),h=r=(0,i._)([(0,d.j)("esri.TimeExtent")],h);const p=new h,g=new h({start:void 0,end:void 0}),y=h},84552:(e,t,s)=>{s.d(t,{Z:()=>c});var r,i=s(43697),n=s(96674),a=s(35463),o=s(5600),l=(s(67676),s(80442),s(75215),s(52011)),u=s(78981);let d=r=class extends n.wq{constructor(e){super(e),this.value=0,this.unit="milliseconds"}toMilliseconds(){return(0,a.rJ)(this.value,this.unit,"milliseconds")}clone(){return new r({value:this.value,unit:this.unit})}};(0,i._)([(0,o.Cb)({type:Number,json:{write:!0},nonNullable:!0})],d.prototype,"value",void 0),(0,i._)([(0,o.Cb)({type:u.v.apiValues,json:{type:u.v.jsonValues,read:u.v.read,write:u.v.write},nonNullable:!0})],d.prototype,"unit",void 0),d=r=(0,i._)([(0,l.j)("esri.TimeInterval")],d);const c=d},5732:(e,t,s)=>{s.d(t,{a:()=>n,c:()=>r,g:()=>i});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}},25929:(e,t,s)=>{s.d(t,{M:()=>p,f:()=>n,i:()=>c,p:()=>y,r:()=>o,t:()=>a,w:()=>l});var r=s(70586),i=s(17452);function n(e,t){const s=t&&t.url&&t.url.path;if(e&&s&&(e=(0,i.hF)(e,s,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=(0,i.PF)(e,t.portalItem.itemUrl);d.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return h(e,t&&t.portal)}function a(e,t,s=p.YES){if(!e)return e;!(0,i.YP)(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let r=(0,i.hF)(e);if(t){const s=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(s){const n=h(s,t.portal);r=(0,i.PF)(h(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,i.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}(r,t&&t.portal),(0,i.YP)(r)&&(r=(0,i.Fv)(r)),null!=t&&t.resources&&null!=t&&t.portalItem&&!(0,i.YP)(r)&&!(0,i.HK)(r)&&s===p.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(r)}),r}function o(e,t,s){return n(e,s)}function l(e,t,s,r){const i=a(e,r);void 0!==i&&(t[s]=i)}const u=/\/items\/([^\/]+)\/resources\//,d=/^\.\/resources\//;function c(e){const t=(0,r.pC)(e)?e.match(u):null;return(0,r.pC)(t)?t[1]:null}function h(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const s=`${t.urlKey}.${t.customBaseUrl}`,r=(0,i.TI)();return(0,i.D6)(r,`${r.scheme}://${s}`)?(0,i.Ie)(e,t.portalHostname,s):(0,i.Ie)(e,s,t.portalHostname)}var p,g;(g=p||(p={}))[g.YES=0]="YES",g[g.NO=1]="NO";const y=Object.freeze({__proto__:null,fromJSON:n,toJSON:a,read:o,write:l,itemIdFromResourceUrl:c,get MarkKeep(){return p}})},3920:(e,t,s)=>{s.d(t,{r:()=>d,p:()=>u});var r=s(43697),i=s(15923),n=s(61247),a=s(5600),o=s(52011),l=s(89749);const u=e=>{let t=class extends e{destroy(){var e,t;this.destroyed||(null==(e=this._get("handles"))||e.destroy(),null==(t=this._get("updatingHandles"))||t.destroy())}get handles(){return this._get("handles")||new n.Z}get updatingHandles(){return this._get("updatingHandles")||new l.t}};return(0,r._)([(0,a.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,r._)([(0,a.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,r._)([(0,o.j)("esri.core.HandleOwner")],t),t};let d=class extends(u(i.Z)){};d=(0,r._)([(0,o.j)("esri.core.HandleOwner")],d)},66643:(e,t,s)=>{s.d(t,{Ed:()=>n,UI:()=>a,q6:()=>o,mt:()=>l});var r=s(70586),i=s(95330);function n(e,t,s){return(0,i.as)(e.map(((e,r)=>t.apply(s,[e,r]))))}function a(e,t,s){return(0,i.as)(e.map(((e,r)=>t.apply(s,[e,r])))).then((e=>e.map((e=>e.value))))}function o(e){return(0,r.Wi)(e)?(0,i.DB)():e.then((e=>({ok:!0,value:e}))).catch((e=>({ok:!1,error:e})))}function l(e){return e.then((e=>({ok:!0,value:e}))).catch((e=>((0,i.r9)(e),{ok:!1,error:e})))}},43090:(e,t,s)=>{function r(e){return 32+e.length}function i(e){if(!e)return 0;let t=32;for(const s in e)if(e.hasOwnProperty(s)){const i=e[s];switch(typeof i){case"string":t+=r(i);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e,t){return 32+e.length*t}var a;s.d(t,{Y8:()=>a,f2:()=>i,do:()=>n}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(a||(a={}))},45091:(e,t,s)=>{s.d(t,{Z:()=>d});var r,i,n=s(80442),a=s(71143);(i=r||(r={}))[i.varint=0]="varint",i[i.fixed64=1]="fixed64",i[i.delimited=2]="delimited",i[i.fixed32=5]="fixed32",i[i.unknown=99]="unknown";const o=4294967296,l=new TextDecoder("utf-8"),u=(0,n.Z)("safari")||(0,n.Z)("ios")?6:(0,n.Z)("ff")?12:32;class d{constructor(e,t,s=0,i=(e?e.byteLength:0)){this._tag=0,this._dataType=r.unknown,this._init(e,t,s,i)}_init(e,t,s,r){this._data=e,this._dataView=t,this._pos=s,this._end=r}clone(){return new d(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*o;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*o;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,r){const i=this.getMessage(),n=e(i,t,s,r);return i.release(),n}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=d.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){d.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case r.varint:this._decodeVarint();break;case r.fixed64:this._skip(8);break;case r.delimited:this._skip(this._getLength());break;case r.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t,s=this._pos,r=0;if(this._end-s>=10)do{if(t=e[s++],r|=127&t,0==(128&t))break;if(t=e[s++],r|=(127&t)<<7,0==(128&t))break;if(t=e[s++],r|=(127&t)<<14,0==(128&t))break;if(t=e[s++],r|=(127&t)<<21,0==(128&t))break;if(t=e[s++],r+=268435456*(127&t),0==(128&t))break;if(t=e[s++],r+=34359738368*(127&t),0==(128&t))break;if(t=e[s++],r+=4398046511104*(127&t),0==(128&t))break;if(t=e[s++],r+=562949953421312*(127&t),0==(128&t))break;if(t=e[s++],r+=72057594037927940*(127&t),0==(128&t))break;if(t=e[s++],r+=0x8000000000000000*(127&t),0==(128&t))break;throw new Error("Varint too long!")}while(0);else{let i=1;for(;s!==this._end&&(t=e[s],0!=(128&t));)++s,r+=(127&t)*i,i*=128;if(s===this._end)throw new Error("Varint overrun!");++s,r+=t*i}return this._pos=s,r}_decodeSVarint(){const e=this._decodeVarint();return e%2?-(e+1)/2:e/2}_getLength(){if(this._dataType!==r.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>u){const r=e.subarray(t,s);return l.decode(r)}let r="",i="";for(let n=t;n<s;++n){const t=e[n];128&t?i+="%"+t.toString(16):(r+=decodeURIComponent(i)+String.fromCharCode(t),i="")}return i.length&&(r+=decodeURIComponent(i)),r}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}}d.pool=new a.Z(d,null,(e=>{e._data=null,e._dataView=null}))},35463:(e,t,s)=>{s.d(t,{rJ:()=>o,Nm:()=>n,JE:()=>a}),s(80442);const r={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},i={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function n(e,t,s){const r=new Date(e.getTime());if(t&&s){const e=i[s],{getter:n,setter:a,multiplier:o}=e;if("months"===s){const e=function(e,t){const s=new Date(e,t+1,1);return s.setDate(0),s.getDate()}(r.getFullYear(),r.getMonth()+t);r.getDate()>e&&r.setDate(e)}r[a](r[n]()+t*o)}return r}function a(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function o(e,t,s){return 0===e?0:e*r[t]/r[s]}},60437:(e,t,s)=>{s.d(t,{Gv:()=>f,Ue:()=>i,cS:()=>h,fS:()=>y,TC:()=>a,pp:()=>o,JR:()=>p,al:()=>n,t8:()=>c,Tn:()=>d,op:()=>u,dp:()=>l});var r=s(70586);function i(e=m){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function n(e,t,s,r,n,a,o=i()){return o[0]=e,o[1]=t,o[2]=s,o[3]=r,o[4]=n,o[5]=a,o}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 o(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 l(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,s=e){return s[0]=t[0],s[1]=t[1],s[2]=t[2],s!==e&&(s[3]=e[3],s[4]=e[4],s[5]=e[5]),s}function d(e,t,s=e){return s[3]=t[0],s[4]=t[1],s[5]=t[2],s!==e&&(s[0]=e[0],s[1]=e[1],s[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 h(e){return e?c(e,f):i(f)}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 g(e){return 6===e.length}function y(e,t,s){if((0,r.Wi)(e)||(0,r.Wi)(t))return e===t;if(!g(e)||!g(t))return!1;if(s){for(let r=0;r<e.length;r++)if(!s(e[r],t[r]))return!1}else for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}s(6570),s(24470);const f=[1/0,1/0,1/0,-1/0,-1/0,-1/0],m=[0,0,0,0,0,0];i()},37549:(e,t,s)=>{s.d(t,{H:()=>a});var r=s(80442),i=s(24133);const n={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new i.QB(9,(0,r.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,r)=>{e[t++]=r})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))),this._boundsToLoad.length=0)}}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){n.minX=t[0],n.minY=t[1],n.maxX=t[2],n.maxY=t[3],e.search(n,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},57191:(e,t,s)=>{s.d(t,{Z:()=>y});var r=s(20102),i=s(32448),n=s(92604),a=s(70586),o=s(60437),l=s(24470),u=s(98732),d=s(37549),c=s(29730),h=s(70272),p=s(5428);const g={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new h.ZP(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(e.centroid||(e.centroid=(0,c.Y)(new p.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)};class y{constructor(e){this.geometryInfo=e,this._boundsStore=new d.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new i.Z,this.featureAdapter=g}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){if(!this.numFeatures)return null;const e=(0,l.Ue)(l.Gv);return this._featuresById.forEach((t=>{const s=this._boundsStore.get(t.objectId);s&&(e[0]=Math.min(s[0],e[0]),e[1]=Math.min(s[1],e[1]),e[2]=Math.max(s[2],e[2]),e[3]=Math.max(s[3],e[3]))})),e}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{(0,a.pC)(t.geometry)&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t,s){for(const r of e){const e=this._boundsStore.get(r.objectId);e&&t((0,o.JR)(s,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void n.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):(0,a.pC)(this.onFeatureAdd)&&this.onFeatureAdd(e),(0,a.Wi)(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.$)((0,a.pC)(i)?i:(0,l.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),(0,a.pC)(i)&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_remove(e){return(0,a.pC)(this.onFeatureRemove)&&this.onFeatureRemove(e),this._markedIds.delete(e.objectId),this._boundsStore.delete(e.objectId),this._featuresById.delete(e.objectId),e}}},1231:(e,t,s)=>{s.d(t,{Z:()=>f});var r,i=s(43697),n=s(35454),a=s(96674),o=s(5600),l=(s(67676),s(80442),s(75215)),u=s(36030),d=s(71715),c=s(52011),h=s(72729),p=s(86719);const g=new n.Xn({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let y=r=class extends a.wq{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=-1,this.name=null,this.nullable=!0,this.type=null,this.valueType=null}readDescription(e,{description:t}){let s;try{s=JSON.parse(t)}catch(e){}return s?s.value:null}readValueType(e,{description:t}){let s;try{s=JSON.parse(t)}catch(e){}return s?g.fromJSON(s.fieldValueType):null}clone(){return new r({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType})}};(0,i._)([(0,o.Cb)({type:String,json:{write:!0}})],y.prototype,"alias",void 0),(0,i._)([(0,o.Cb)({type:[String,Number],json:{write:{allowNull:!0}}})],y.prototype,"defaultValue",void 0),(0,i._)([(0,o.Cb)()],y.prototype,"description",void 0),(0,i._)([(0,d.r)("description")],y.prototype,"readDescription",null),(0,i._)([(0,o.Cb)({types:h.V5,json:{read:{reader:h.im},write:!0}})],y.prototype,"domain",void 0),(0,i._)([(0,o.Cb)({type:Boolean,json:{write:!0}})],y.prototype,"editable",void 0),(0,i._)([(0,o.Cb)({type:l.z8,json:{write:!0}})],y.prototype,"length",void 0),(0,i._)([(0,o.Cb)({type:String,json:{write:!0}})],y.prototype,"name",void 0),(0,i._)([(0,o.Cb)({type:Boolean,json:{write:!0}})],y.prototype,"nullable",void 0),(0,i._)([(0,u.J)(p.v)],y.prototype,"type",void 0),(0,i._)([(0,o.Cb)()],y.prototype,"valueType",void 0),(0,i._)([(0,d.r)("valueType",["description"])],y.prototype,"readValueType",null),y=r=(0,i._)([(0,c.j)("esri.layers.support.Field")],y);const f=y},30547:(e,t,s)=>{s.d(t,{Z:()=>v});var r,i=s(43697),n=s(92835),a=s(84552),o=s(96674),l=s(22974),u=s(70586),d=s(5600),c=(s(75215),s(71715)),h=s(52011),p=s(30556);s(67676),s(80442);let g=r=class extends o.wq{constructor(e){super(e),this.respectsDaylightSaving=!1,this.timezone=null}readRespectsDaylightSaving(e,t){return void 0!==t.respectsDaylightSaving?t.respectsDaylightSaving:void 0!==t.respectDaylightSaving&&t.respectDaylightSaving}clone(){const{respectsDaylightSaving:e,timezone:t}=this;return new r({respectsDaylightSaving:e,timezone:t})}};(0,i._)([(0,d.Cb)({type:Boolean,json:{write:!0}})],g.prototype,"respectsDaylightSaving",void 0),(0,i._)([(0,c.r)("respectsDaylightSaving",["respectsDaylightSaving","respectDaylightSaving"])],g.prototype,"readRespectsDaylightSaving",null),(0,i._)([(0,d.Cb)({type:String,json:{read:{source:"timeZone"},write:{target:"timeZone"}}})],g.prototype,"timezone",void 0),g=r=(0,i._)([(0,h.j)("esri.layers.support.TimeReference")],g);const y=g;var f,m=s(78981);let _=f=class extends o.wq{constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,t){if(!t.timeExtent||!Array.isArray(t.timeExtent)||2!==t.timeExtent.length)return null;const s=new Date(t.timeExtent[0]),r=new Date(t.timeExtent[1]);return new n.Z({start:s,end:r})}writeFullTimeExtent(e,t){e&&(0,u.pC)(e.start)&&(0,u.pC)(e.end)?t.timeExtent=[e.start.getTime(),e.end.getTime()]:t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?new a.Z({value:t.timeInterval,unit:m.v.fromJSON(t.timeIntervalUnits)}):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?new a.Z({value:t.defaultTimeInterval,unit:m.v.fromJSON(t.defaultTimeIntervalUnits)}):null}writeInterval(e,t){if(e){const s=e.toJSON();t.timeInterval=s.value,t.timeIntervalUnits=s.unit}else t.timeInterval=null,t.timeIntervalUnits=null}clone(){const{cumulative:e,endField:t,hasLiveData:s,interval:r,startField:i,timeReference:n,fullTimeExtent:a,trackIdField:o,useTime:u}=this;return new f({cumulative:e,endField:t,hasLiveData:s,interval:r,startField:i,timeReference:(0,l.d9)(n),fullTimeExtent:(0,l.d9)(a),trackIdField:o,useTime:u})}};(0,i._)([(0,d.Cb)({type:Boolean,json:{read:{source:"exportOptions.timeDataCumulative"},write:{target:"exportOptions.timeDataCumulative"}}})],_.prototype,"cumulative",void 0),(0,i._)([(0,d.Cb)({type:String,json:{read:{source:"endTimeField"},write:{target:"endTimeField",allowNull:!0}}})],_.prototype,"endField",void 0),(0,i._)([(0,d.Cb)({type:n.Z,json:{write:{enabled:!0,allowNull:!0}}})],_.prototype,"fullTimeExtent",void 0),(0,i._)([(0,c.r)("fullTimeExtent",["timeExtent"])],_.prototype,"readFullTimeExtent",null),(0,i._)([(0,p.c)("fullTimeExtent")],_.prototype,"writeFullTimeExtent",null),(0,i._)([(0,d.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"hasLiveData",void 0),(0,i._)([(0,d.Cb)({type:a.Z,json:{write:{enabled:!0,allowNull:!0}}})],_.prototype,"interval",void 0),(0,i._)([(0,c.r)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],_.prototype,"readInterval",null),(0,i._)([(0,p.c)("interval")],_.prototype,"writeInterval",null),(0,i._)([(0,d.Cb)({type:String,json:{read:{source:"startTimeField"},write:{target:"startTimeField",allowNull:!0}}})],_.prototype,"startField",void 0),(0,i._)([(0,d.Cb)({type:y,json:{write:{enabled:!0,allowNull:!0}}})],_.prototype,"timeReference",void 0),(0,i._)([(0,d.Cb)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],_.prototype,"trackIdField",void 0),(0,i._)([(0,d.Cb)({type:Boolean,json:{read:{source:"exportOptions.useTime"},write:{target:"exportOptions.useTime"}}})],_.prototype,"useTime",void 0),_=f=(0,i._)([(0,h.j)("esri.layers.support.TimeInfo")],_);const v=_},66677:(e,t,s)=>{s.d(t,{ld:()=>g,B5:()=>c,M8:()=>f,G:()=>b,Qc:()=>h,DR:()=>p,Nm:()=>m,XG:()=>_,a7:()=>y,wH:()=>v});var r=s(70586),i=s(17452),n=s(25929);const a={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},o=Object.values(a),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),d=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function c(e){return!!l.test(e)}function h(e){const t=(0,i.mN)(e),s=t.path.match(l)||t.path.match(u);if(!s)return null;const[,r,n,o,d]=s,c=n.indexOf("/");return{title:g(-1!==c?n.slice(c+1):n),serverType:a[o.toLowerCase()],sublayer:null!=d&&""!==d?parseInt(d,10):null,url:{path:r}}}function p(e){const t=(0,i.mN)(e).path.match(d);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function g(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function y(e,t){const s=[];if(e){const t=h(e);(0,r.pC)(t)&&t.title&&s.push(t.title)}if(t){const e=g(t);s.push(e)}if(2===s.length){if(-1!==s[0].toLowerCase().indexOf(s[1].toLowerCase()))return s[0];if(-1!==s[1].toLowerCase().indexOf(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function f(e){if(!e)return!1;const t=-1!==(e=e.toLowerCase()).indexOf(".arcgis.com/"),s=-1!==e.indexOf("//services")||-1!==e.indexOf("//tiles")||-1!==e.indexOf("//features");return t&&s}function m(e,t){return e?(0,i.Qj)((0,i.Hu)(e,t)):e}function _(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.Hu)(t,e.logger);const s=(0,i.mN)(t),n=h(s.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(s.path);(0,r.pC)(e)&&(t=e.serviceUrl,a=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:a}}function v(e,t,s,r,a){(0,n.w)(t,r,"url",a),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function b(e){if(!e)return!1;const t=e.toLowerCase(),s=-1!==t.indexOf("/services/"),r=-1!==t.indexOf("/mapserver/wmsserver"),i=-1!==t.indexOf("/imageserver/wmsserver"),n=-1!==t.indexOf("/wmsserver");return s&&(r||i||n)}},72729:(e,t,s)=>{s.d(t,{im:()=>F,V5:()=>S}),s(80442);var r,i=s(43697),n=s(22974),a=s(5600),o=(s(75215),s(36030)),l=s(52011),u=s(96674);s(67676);let d=r=class extends u.wq{constructor(e){super(e),this.name=null,this.code=null}clone(){return new r({name:this.name,code:this.code})}};(0,i._)([(0,a.Cb)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,i._)([(0,a.Cb)({type:[String,Number],json:{write:!0}})],d.prototype,"code",void 0),d=r=(0,i._)([(0,l.j)("esri.layers.support.CodedValue")],d);const c=d,h=new(s(35454).Xn)({inherited:"inherited",codedValue:"coded-value",range:"range"});let p=class extends u.wq{constructor(e){super(e),this.name=null,this.type=null}};(0,i._)([(0,a.Cb)({type:String,json:{write:!0}})],p.prototype,"name",void 0),(0,i._)([(0,o.J)(h)],p.prototype,"type",void 0),p=(0,i._)([(0,l.j)("esri.layers.support.Domain")],p);const g=p;var y;let f=y=class extends g{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new y({codedValues:(0,n.d9)(this.codedValues),name:this.name})}};(0,i._)([(0,a.Cb)({type:[c],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,i._)([(0,o.J)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=y=(0,i._)([(0,l.j)("esri.layers.support.CodedValueDomain")],f);const m=f;var _;s(92604),s(37697);let v=_=class extends g{constructor(e){super(e),this.type="inherited"}clone(){return new _}};(0,i._)([(0,o.J)({inherited:"inherited"})],v.prototype,"type",void 0),v=_=(0,i._)([(0,l.j)("esri.layers.support.InheritedDomain")],v);const b=v;var T;let C=T=class extends g{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new T({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,i._)([(0,a.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,s){t[s]=[this.minValue||0,e]}}}})],C.prototype,"maxValue",void 0),(0,i._)([(0,a.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],C.prototype,"minValue",void 0),(0,i._)([(0,o.J)({range:"range"})],C.prototype,"type",void 0),C=T=(0,i._)([(0,l.j)("esri.layers.support.RangeDomain")],C);const w=C,S={key:"type",base:g,typeMap:{range:C,"coded-value":m,inherited:b}};function F(e){if(!e||!e.type)return null;switch(e.type){case"range":return w.fromJSON(e);case"codedValue":return m.fromJSON(e);case"inherited":return b.fromJSON(e)}return null}},86719:(e,t,s)=>{s.d(t,{v:()=>r});const r=new(s(35454).Xn)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml"})},78981:(e,t,s)=>{s.d(t,{v:()=>r});const r=(0,s(35454).wY)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},76497:(e,t,s)=>{function r(e){const t={};for(const s in e){if("declaredClass"===s)continue;const i=e[s];if(null!=i&&"function"!=typeof i)if(Array.isArray(i)){t[s]=[];for(let e=0;e<i.length;e++)t[s][e]=r(i[e])}else"object"==typeof i?i.toJSON&&(t[s]=JSON.stringify(i)):t[s]=i}return t}s.d(t,{A:()=>r})},77863:(e,t,s)=>{s.d(t,{K9:()=>k,O7:()=>c,G$:()=>S});var r=s(20102),i=s(70586),n=s(45091),a=s(5428),o=s(78760);const l=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],u=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],d=["upperLeft","lowerLeft"];function c(e){return e>=l.length?null:l[e]}function h(e){return e>=u.length?null:u[e]}function p(e){return e>=d.length?null:d[e]}function g(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function y(e,t,s){const r=t.createPointGeometry(s);for(;e.next();)switch(e.tag()){case 3:{const s=e.getUInt32(),i=e.pos()+s;let n=0;for(;e.pos()<i;)t.addCoordinatePoint(r,e.getSInt64(),n++);break}default:e.skip()}return r}function f(e,t,s){const r=t.createGeometry(s),i=2+(s.hasZ?1:0)+(s.hasM?1:0);for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),i=e.pos()+s;let n=0;for(;e.pos()<i;)t.addLength(r,e.getUInt32(),n++);break}case 3:{const s=e.getUInt32(),n=e.pos()+s;let a=0;for(t.allocateCoordinates(r);e.pos()<n;)t.addCoordinate(r,e.getSInt64(),a),a++,a===i&&(a=0);break}default:e.skip()}return r}function m(e){const t=new a.Z;let s="esriGeometryPoint";for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.lengths.push(e.getUInt32());break}case 3:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.coords.push(e.getSInt64());break}case 1:s=o.A[e.getEnum()];break;default:e.skip()}return{queryGeometry:t,queryGeometryType:s}}function _(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function v(e){const t={type:c(0)};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.type=c(e.getEnum());break;case 3:t.alias=e.getString();break;case 4:t.sqlType=h(e.getEnum());break;case 5:default:e.skip();break;case 6:t.defaultValue=e.getString()}return t}function b(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.isSystemMaintained=e.getBool();break;default:e.skip()}return t}function T(e,t,s,r){const i=t.createFeature(s);let n=0;for(;e.next();)switch(e.tag()){case 1:{const t=r[n++].name;i.attributes[t]=e.processMessage(_);break}case 2:i.geometry=e.processMessageWithArgs(f,t,s);break;case 4:i.centroid=e.processMessageWithArgs(y,t,s);break;default:e.skip()}return i}function C(e){const t=[1,1,1,1];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function w(e){const t=[0,0,0,0];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function S(e){const t={originPosition:p(0)};for(;e.next();)switch(e.tag()){case 1:t.originPosition=p(e.getEnum());break;case 2:t.scale=e.processMessage(C);break;case 3:t.translate=e.processMessage(w);break;default:e.skip()}return t}function F(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.shapeAreaFieldName=e.getString();break;case 2:t.shapeLengthFieldName=e.getString();break;case 3:t.units=e.getString();break;default:e.skip()}return t}function I(e,t){const s=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:s.wkid=e.getUInt32();break;case 5:s.wkt=e.getString();break;case 2:s.latestWkid=e.getUInt32();break;case 3:s.vcsWkid=e.getUInt32();break;case 4:s.latestVcsWkid=e.getUInt32();break;default:e.skip()}return s}function E(e,t){const s=t.createFeatureResult();s.geometryType=g(t,0);let r=!1;for(;e.next();)switch(e.tag()){case 1:s.objectIdFieldName=e.getString();break;case 3:s.globalIdFieldName=e.getString();break;case 4:s.geohashFieldName=e.getString();break;case 5:s.geometryProperties=e.processMessage(F);break;case 7:s.geometryType=g(t,e.getEnum());break;case 8:s.spatialReference=e.processMessageWithArgs(I,t);break;case 10:s.hasZ=e.getBool();break;case 11:s.hasM=e.getBool();break;case 12:s.transform=e.processMessage(S);break;case 9:{const t=e.getBool();s.exceededTransferLimit=t;break}case 13:t.addField(s,e.processMessage(v));break;case 15:r||(t.prepareFeatures(s),r=!0),t.addFeature(s,e.processMessageWithArgs(T,t,s,s.fields));break;case 2:s.uniqueIdField=e.processMessage(b);break;default:e.skip()}return t.finishFeatureResult(s),s}function x(e,t){const s={};let r=null;for(;e.next();)switch(e.tag()){case 4:r=e.processMessageWithArgs(m);break;case 1:s.featureResult=e.processMessageWithArgs(E,t);break;default:e.skip()}return(0,i.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function k(e,t){try{const s=2,r=new n.Z(new Uint8Array(e),new DataView(e)),i={};for(;r.next();)r.tag()===s?i.queryResult=r.processMessageWithArgs(x,t):r.skip();return i}catch(e){throw new r.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},78760:(e,t,s)=>{s.d(t,{A:()=>l,J:()=>u});var r=s(67900),i=s(8744),n=s(70272),a=s(44876),o=s(5428);const l=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class u{constructor(e){this.options=e,this.geometryTypes=l,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new a.Z}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this.options.sourceSpatialReference||!e.spatialReference||(0,i.fS)(e.spatialReference,this.options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,r._R)(this.options.sourceSpatialReference)/(0,r._R)(e.spatialReference);if(1!==t)for(const s of e.features){if(!(0,n.S6)(s))continue;const e=s.geometry.coords;for(let s=2;s<e.length;s+=3)e[s]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new n.ZP}createSpatialReference(){return{wkid:0}}createGeometry(){return new o.Z}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new o.Z}}},45178:(e,t,s)=>{s.d(t,{C:()=>i});var r=s(77863);function i(e,t){const s=(0,r.K9)(e,t),i=s.queryResult.featureResult,n=s.queryResult.queryGeometry,a=s.queryResult.queryGeometryType;if(i&&i.features&&i.features.length&&i.objectIdFieldName){const e=i.objectIdFieldName;for(const t of i.features)t.attributes&&(t.objectId=t.attributes[e])}return i&&(i.queryGeometry=n,i.queryGeometryType=a),i}},34599:(e,t,s)=>{s.r(t),s.d(t,{executeQuery:()=>g,executeQueryForCount:()=>_,executeQueryForExtent:()=>v,executeQueryForIds:()=>m,executeQueryPBF:()=>y,executeQueryPBFBuffer:()=>f,queryToQueryStringParameters:()=>p,runQuery:()=>b});var r=s(3172),i=s(70586),n=s(17452),a=s(33955),o=s(38581),l=s(66677),u=s(76497),d=s(45178),c=s(28694);const h="Layer does not support extent calculation.";function p(e,t,s=!1){const r=e.geometry,n=e.toJSON(),o=n,l=e.outSpatialReference;let u,d;if((0,i.pC)(r)){if(u=r.spatialReference,d=r.spatialReference.wkid||JSON.stringify(r.spatialReference),o.geometryType=(0,a.Ji)(r),s&&"extent"===r.type)o.geometry=`${r.xmin},${r.ymin},${r.xmax},${r.ymax}`;else if(s&&"point"===r.type)o.geometry=`${r.x},${r.y}`;else{const e=r.toJSON();delete e.spatialReference,o.geometry=JSON.stringify(e)}o.inSR=d}if(u||(u=l),n.groupByFieldsForStatistics&&(o.groupByFieldsForStatistics=n.groupByFieldsForStatistics.join(",")),n.objectIds&&(o.objectIds=n.objectIds.join(",")),n.orderByFields&&(o.orderByFields=n.orderByFields.join(",")),!n.outFields||!n.returnDistinctValues&&(null!=t&&t.returnCountOnly||null!=t&&t.returnExtentOnly||null!=t&&t.returnIdsOnly)?delete o.outFields:-1!==n.outFields.indexOf("*")?o.outFields="*":o.outFields=n.outFields.join(","),n.outSR?o.outSR=n.outSR.wkid||JSON.stringify(n.outSR):r&&(n.returnGeometry||n.returnCentroid)&&(o.outSR=o.inSR),n.returnGeometry&&delete n.returnGeometry,n.outStatistics&&(o.outStatistics=JSON.stringify(n.outStatistics)),n.pixelSize&&(o.pixelSize=JSON.stringify(n.pixelSize)),n.quantizationParameters&&(s&&(0,i.pC)(u)&&(0,i.pC)(e.quantizationParameters)&&(0,i.pC)(e.quantizationParameters.extent)&&u.equals(e.quantizationParameters.extent.spatialReference)&&delete n.quantizationParameters.extent.spatialReference,o.quantizationParameters=JSON.stringify(n.quantizationParameters)),n.parameterValues&&(o.parameterValues=JSON.stringify(n.parameterValues)),n.rangeValues&&(o.rangeValues=JSON.stringify(n.rangeValues)),n.dynamicDataSource&&(o.layer=JSON.stringify({source:n.dynamicDataSource}),delete n.dynamicDataSource),n.timeExtent){const e=n.timeExtent,{start:t,end:s}=e;null==t&&null==s||(o.time=t===s?t:`${null==t?"null":t},${null==s?"null":s}`),delete n.timeExtent}return o}async function g(e,t,s,r){const n=(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await b(e,t,"json",r);return(0,c.p)(t,s,n.data),n}async function y(e,t,s,r){if((0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty)return Promise.resolve({data:s.createFeatureResult()});const n=await f(e,t,r),a=n;return a.data=(0,d.C)(n.data,s),a}function f(e,t,s){return b(e,t,"pbf",s)}function m(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):b(e,t,"json",s,{returnIdsOnly:!0})}function _(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):b(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function v(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):b(e,t,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then((e=>{const t=e.data;if(t.hasOwnProperty("extent"))return e;if(t.features)throw new Error(h);if(t.hasOwnProperty("count"))throw new Error(h);return e}))}function b(e,t,s,a={},d={}){const c="string"==typeof e?(0,n.mN)(e):e,h=t.geometry?[t.geometry]:[];return a.responseType="pbf"===s?"array-buffer":"json",(0,o.aX)(h,null,a).then((e=>{const o=e&&e[0];(0,i.pC)(o)&&((t=t.clone()).geometry=o);const h=(0,l.M8)(c.path),g=(0,u.A)({...c.query,f:s,...d,...p(t,d,h)});return(0,r.default)((0,n.v_)(c.path,"query"),{...a,query:{...g,...a.query}})}))}},28694:(e,t,s)=>{s.d(t,{p:()=>n});var r=s(70586),i=s(69285);function n(e,t,s){if(!s||!s.features||!s.hasZ)return;const n=(0,i.k)(s.geometryType,t,e.outSpatialReference);if(!(0,r.Wi)(n))for(const e of s.features)n(e.geometry)}},98046:(e,t,s)=>{s.d(t,{Z:()=>p});var r,i=s(43697),n=s(22303),a=s(22974),o=s(5600),l=s(75215),u=s(36030),d=s(52011),c=s(899);let h=r=class extends c.Z{constructor(e){super(e),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new r({fromColor:(0,a.d9)(this.fromColor),toColor:(0,a.d9)(this.toColor),algorithm:this.algorithm})}};(0,i._)([(0,u.J)({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],h.prototype,"algorithm",void 0),(0,i._)([(0,o.Cb)({type:n.Z,json:{type:[l.z8],write:!0}})],h.prototype,"fromColor",void 0),(0,i._)([(0,o.Cb)({type:n.Z,json:{type:[l.z8],write:!0}})],h.prototype,"toColor",void 0),(0,i._)([(0,o.Cb)({type:["algorithmic"]})],h.prototype,"type",void 0),h=r=(0,i._)([(0,d.j)("esri.rest.support.AlgorithmicColorRamp")],h);const p=h},899:(e,t,s)=>{s.d(t,{Z:()=>l});var r=s(43697),i=s(96674),n=s(5600),a=(s(67676),s(80442),s(75215),s(52011));let o=class extends i.wq{constructor(e){super(e),this.type=null}};(0,r._)([(0,n.Cb)({readOnly:!0,json:{read:!1,write:!0}})],o.prototype,"type",void 0),o=(0,r._)([(0,a.j)("esri.rest.support.ColorRamp")],o);const l=o},1515:(e,t,s)=>{s.d(t,{Z:()=>c});var r,i=s(43697),n=s(22974),a=s(5600),o=(s(75215),s(52011)),l=s(98046),u=s(899);let d=r=class extends u.Z{constructor(e){super(e),this.colorRamps=null,this.type="multipart"}clone(){return new r({colorRamps:(0,n.d9)(this.colorRamps)})}};(0,i._)([(0,a.Cb)({type:[l.Z],json:{write:!0}})],d.prototype,"colorRamps",void 0),(0,i._)([(0,a.Cb)({type:["multipart"]})],d.prototype,"type",void 0),d=r=(0,i._)([(0,o.j)("esri.rest.support.MultipartColorRamp")],d);const c=d},94593:(e,t,s)=>{s.d(t,{i:()=>o,V:()=>a});var r=s(98046),i=s(899),n=s(1515);const a={key:"type",base:i.Z,typeMap:{algorithmic:r.Z,multipart:n.Z}};function o(e){return e&&e.type?"algorithmic"===e.type?r.Z.fromJSON(e):"multipart"===e.type?n.Z.fromJSON(e):null:null}},89164:(e,t,s)=>{s.d(t,{Z:()=>p});var r=s(43697),i=s(22303),n=s(35454),a=s(96674),o=s(5600),l=(s(67676),s(80442),s(75215),s(71715)),u=s(52011);const d=new n.Xn({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let c=0,h=class extends a.wq{constructor(e){super(e),this.id="sym"+c++,this.type=null,this.color=new i.Z([0,0,0,1])}readColor(e){return e&&null!=e[0]?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,t){}hash(){return JSON.stringify(this.toJSON())}clone(){}};(0,r._)([(0,o.Cb)({type:d.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:d.write}}})],h.prototype,"type",void 0),(0,r._)([(0,o.Cb)({type:i.Z,json:{write:{allowNull:!0}}})],h.prototype,"color",void 0),(0,r._)([(0,l.r)("color")],h.prototype,"readColor",null),h=(0,r._)([(0,u.j)("esri.symbols.Symbol")],h);const p=h},2255:(e,t,s)=>{s.r(t),s.d(t,{FeatureServiceSnappingSourceWorker:()=>X,default:()=>K});var r=s(43697),i=s(32448),n=s(61247),a=s(70586),o=s(95330),l=s(43050),u=s(5600),d=s(67676),c=(s(80442),s(75215),s(52011)),h=s(82971),p=s(57191),g=s(7673),y=s(11145),f=s(30547),m=s(57444),_=s(15923);let v=class extends _.Z{constructor(){super(...arguments),this.updating=!1,this.pending=[]}push(e,t){this.pending.push({promise:e,callback:t}),1===this.pending.length&&this._process()}_process(){if(!this.pending.length)return void(this.updating=!1);this.updating=!0;const e=this.pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this.pending.shift(),this._process()}))}};(0,r._)([(0,u.Cb)()],v.prototype,"updating",void 0),v=(0,r._)([(0,c.j)("esri.core.AsyncSequence")],v);var b,T=s(3920),C=s(50758),w=s(92604),S=s(17445),F=s(6570),I=s(24470),E=s(98732),x=s(78760),k=s(34599),O=s(66643);class D{constructor(e,t){this.data=e,this.resolution=t,this.state={type:b.CREATED},this.alive=!0}process(e){switch(this.state.type){case b.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case b.FETCH_COUNT:break;case b.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case b.FETCH_FEATURES:break;case b.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case b.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this.featureCount,state:this.stateToString}}get featureCount(){switch(this.state.type){case b.CREATED:case b.FETCH_COUNT:return 0;case b.FETCHED_COUNT:return this.state.featureCount;case b.FETCH_FEATURES:return this.state.previous.featureCount;case b.FETCHED_FEATURES:return this.state.features.length;case b.DONE:return this.state.previous.features.length}}get stateToString(){switch(this.state.type){case b.CREATED:return"created";case b.FETCH_COUNT:return"fetch-count";case b.FETCHED_COUNT:return"fetched-count";case b.FETCH_FEATURES:return"fetch-features";case b.FETCHED_FEATURES:return"fetched-features";case b.DONE:return"done"}}_gotoFetchCount(e,t){return{type:b.FETCH_COUNT,previous:e,task:(0,o.vr)((async e=>{const s=await(0,O.mt)(t.fetchCount(this,e));this.state.type===b.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:b.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:b.FETCH_FEATURES,previous:e,task:(0,o.vr)((async s=>{const r=await(0,O.mt)(t.fetchFeatures(this,e.featureCount,s));this.state.type===b.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,r.ok?r.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:b.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:b.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:b.CREATED},e.type){case b.CREATED:case b.FETCHED_COUNT:case b.FETCHED_FEATURES:case b.DONE:break;case b.FETCH_COUNT:case b.FETCH_FEATURES:e.task.abort()}}intersects(e){return!(!(0,a.Wi)(e)&&this.data.extent)||((0,I.oJ)(e,R),(0,I.kK)(this.data.extent,R))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(b||(b={}));const R=(0,I.Ue)(),N=w.Z.getLogger("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher");let M=class extends T.r{constructor(e){super(e),this.tilesOfInterest=[],this.availability=0,this.pendingTiles=new Map,this.pendingEdits=new v,this.pendingEditsAbortController=new AbortController}get minimumVerticesPerFeature(){var e;switch(null==(e=this.store)?void 0:e.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&((0,a.pC)(e)&&(0,a.pC)(t)&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingHandles.updating||this.pendingEdits.updating}initialize(){this._initializeFetchExtent(),this.updatingHandles.add((()=>this.configuration),(()=>this.refresh())),this.updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,d.fS)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),S.Z_)}destroy(){this.pendingTiles.forEach((e=>this._deletePendingTile(e))),this.pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this.pendingEditsAbortController.abort(),this.pendingEditsAbortController=null}refresh(){this.store.refresh(),this.pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this.pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this.pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this.updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this.pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent)return;const e=(0,o.vr)((async e=>{try{var t;const s=await(0,k.executeQueryForExtent)(this.url,new m.Z({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this.configuration.customParameters,signal:e});this.store.extent=F.Z.fromJSON(null==(t=s.data)?void 0:t.extent)}catch(e){(0,o.r9)(e),N.warn("Failed to fetch data extent",e)}}));this.updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.handles.add((0,C.kB)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this.pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this.pendingTiles)e.alive=!1}_createPendingTiles(){const e=this._collectMissingTilesInfo();if(this._setAvailability((0,a.Wi)(e)?1:e.coveredArea/e.fullArea),!(0,a.Wi)(e))for(const{data:t,resolution:s}of e.missingTiles){const e=this.pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],r=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)));(0,a.Wi)(e)?e=r:e.prepend(r)}return e}_deletePendingTiles(){for(const[,e]of this.pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this.pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this.updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this.minimumVerticesPerFeature<B}_verifyFeatureDensity(e,t){if((0,a.Wi)(this.tileInfo))return!1;const s=this.tileSize*t;return e*(j/(s*s))<U}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this.pendingTiles)s.state.type<b.FETCHED_COUNT&&this.updatingHandles.addPromise(s.process(e)),s.state.type<=b.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability((0,a.Wi)(e)?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new D(e,t);return this.pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this.pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:P,signal:t})}async _fetchFeatures(e,t,s){let r,i=0,n=0,o=t;for(;;){const l=this._createFeaturesQuery(e),u=this._setPagingParameters(l,i,o),{features:d,exceededTransferLimit:c}=await this._queryFeatures(l,s);if(u&&(i+=(0,a.Wg)(l.num)),n+=d.length,r=r?r.concat(d):d,o=t-n,!u||!c||o<=0)return r}}_filterProperties(e){return(0,a.Wi)(e)?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if((0,a.Wi)(t))throw new Error("Expected globalIdField to be defined");let r=null;if(this.store.featureStore.forEach((i=>{var n;e===i.attributes[t]&&(r=null!=(n=i.objectId)?n:i.attributes[s])})),(0,a.Wi)(r))throw new Error(`Expected to find a feature with globalId ${e}`);return r}_queryFeaturesById(e,t){const s=this._createFeaturesQuery(null);return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:r}=await(0,k.executeQueryPBF)(this.url,e,new x.J({sourceSpatialReference:s}),{query:this.configuration.customParameters,timeout:P,signal:t});return(0,E.lM)(r)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:r}=await(0,k.executeQuery)(this.url,e,s,{query:this.configuration.customParameters,timeout:P,signal:t});return(0,E.h_)(r,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e){const t=this._createBaseQuery(e);return t.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],t.returnGeometry=!0,(0,a.pC)(e)&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new m.Z({returnZ:!1,returnM:!1,geometry:(0,a.pC)(this.tileInfo)&&(0,a.pC)(e)?(0,I.HH)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this.configuration.filter;return(0,a.pC)(s)&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:r,supportsCacheHint:i,tileMaxRecordCount:n,maxRecordCount:a,supportsResultType:o}=this.capabilities.query,l=r?m.Z.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((o||i)&&n?n:a||A);return e.start=t,r?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"url",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"objectIdField",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"globalIdField",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"capabilities",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"sourceSpatialReference",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"spatialReference",void 0),(0,r._)([(0,u.Cb)({constructOnly:!0})],M.prototype,"store",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],M.prototype,"minimumVerticesPerFeature",null),(0,r._)([(0,u.Cb)()],M.prototype,"filter",null),(0,r._)([(0,u.Cb)()],M.prototype,"customParameters",null),(0,r._)([(0,u.Cb)({readOnly:!0})],M.prototype,"configuration",null),(0,r._)([(0,u.Cb)()],M.prototype,"tileInfo",null),(0,r._)([(0,u.Cb)()],M.prototype,"tileSize",null),(0,r._)([(0,u.Cb)()],M.prototype,"tilesOfInterest",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],M.prototype,"updating",null),(0,r._)([(0,u.Cb)({readOnly:!0})],M.prototype,"availability",void 0),M=(0,r._)([(0,c.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],M);const A=2e3,P=6e5,B=1e6,j=25,U=1;var q=s(43090),V=s(37549);class H{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(this._byteSize-=t.byteSize,!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,r]of this._store){if(this._byteSize<=e)break;this.delete(s),t(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let Z=class extends _.Z{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*q.Y8.MEGABYTES,this.tileBounds=new V.H,this.tiles=new H,this.refCounts=new Map,this.tileFeatureCounts=new Map,this.tmpBoundingRect=(0,I.Ue)()}add(e,t){const s=[];for(const e of t)this._referenceFeature(e.objectId)===W.ADDED&&s.push(e);this._addTileStorage(e,new Set(t.map((({objectId:e})=>e))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if((0,a.Wi)(e))return 0;const t=(0,q.do)(e.lengths,4);return 32+(0,q.do)(e.coords,8)+t}(e.geometry)+(0,q.f2)(e.attributes)}(t)),0)}(t)),this.featureStore.addMany(s),this.tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}destroy(){this.clear(),this.tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this.tileBounds.clear(),this.tiles.clear(),this.refCounts.clear()}refresh(){this.clear(),this.tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){this.tiles.set(e.id,new L(e,t,s)),this.tileBounds.set(e.id,e.extent),this.tileFeatureCounts.set(e.id,t.size)}_remove({id:e}){const t=this.tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===W.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this.tiles.delete(s),this.tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this.tiles){for(const s of e)t.objectIds.delete(s);this.tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this.refCounts.delete(t)}async _processEditsRefetch(e,t,s){const r=(await t(e,s)).features,{hasZ:i,hasM:n}=this.featureStore;for(const e of r){const t=(0,E.$)(this.tmpBoundingRect,e.geometry,i,n);(0,a.Wi)(t)||this.tileBounds.forEachInBounds(t,(t=>{const s=this.tiles.get(t);this.featureStore.add(e),s.objectIds.has(e.objectId)||(s.objectIds.add(e.objectId),this._referenceFeature(e.objectId),this.tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0)){if((0,a.Wi)(this.tileInfo)||!e.extent||(0,a.pC)(this.extent)&&!(0,I.kK)((0,I.oJ)(this.extent,this.tmpBoundingRect),e.extent))return new G(e);if(this.tiles.has(e.id))return new G(e);const s=this._createTileTree(e,this.tileInfo);return this._simplify(s,t,null,0,1),this._collectMissingTiles(e,s,this.tileInfo)}get debugInfo(){return Array.from(this.tiles.values()).map((({data:e})=>({data:e,featureCount:this.tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){const t=this.tileFeatureCounts.get(e.id);return null!=t?t:0}async fetchCount(e,t,s,r){const i=this.tileFeatureCounts.get(e.id);if(null!=i)return i;const n=await(0,k.executeQueryForCount)(t,s,r);return this.tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new J(e.level,e.row,e.col);return t.updateTileInfo(s,y.Z.ExtrapolateOptions.POWER_OF_TWO),this.tileBounds.forEachInBounds(e.extent,(r=>{const i=this.tiles.get(r).data;this._tilesAreRelated(e,i)&&this._populateChildren(s,i,t,this.tileFeatureCounts.get(i.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,r=s?e:t,i=s?t:e,n=1<<i.level-r.level;return Math.floor(i.row/n)===r.row&&Math.floor(i.col/n)===r.col}_populateChildren(e,t,s,r){const i=t.level-e.level-1;if(i<0)return void(e.isLeaf=!0);const n=t.row>>i,o=t.col>>i,l=e.row<<1,u=o-(e.col<<1)+(n-l<<1),d=e.children[u];if((0,a.pC)(d))this._populateChildren(d,t,s,r);else{const i=new J(e.level+1,n,o);s.updateTileInfo(i,y.Z.ExtrapolateOptions.POWER_OF_TWO),e.children[u]=i,this._populateChildren(i,t,s,r)}}_simplify(e,t,s,r,i){const n=i*i;if(e.isLeaf)return t(this.getFeatureCount(e),i)?0:(this._remove(e),(0,a.pC)(s)&&(s.children[r]=null),n);const o=i/2,l=o*o;let u=0;for(let s=0;s<e.children.length;s++){const r=e.children[s];u+=(0,a.pC)(r)?this._simplify(r,t,e,s,o):l}return 0===u?this._mergeChildren(e):1-u/n<Y&&(this._purge(e),(0,a.pC)(s)&&(s.children[r]=null),u=n),u}_mergeChildren(e){const t=new Set;let s=0;this._forEachLeaf(e,(e=>{const r=this.tiles.get(e.id);if(r){s+=r.byteSize;for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,s),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this.tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)(0,a.Wi)(s)||(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(!(0,a.Wi)(e))if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s){const r=new z(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1),r.info}_collectMissingTilesRecurse(e,t,s){if(e.isLeaf)return;if(!e.hasChildren)return void t.addMissing(e.level,e.row,e.col,s);const r=s/2;for(let s=0;s<e.children.length;s++){const i=e.children[s];(0,a.Wi)(i)?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),r):this._collectMissingTilesRecurse(i,t,r)}}_referenceFeature(e){const t=(this.refCounts.get(e)||0)+1;return this.refCounts.set(e,t),1===t?W.ADDED:W.UNCHANGED}_unreferenceFeature(e){const t=(this.refCounts.get(e)||0)-1;return 0===t?(this.refCounts.delete(e),W.REMOVED):(t>0&&this.refCounts.set(e,t),W.UNCHANGED)}get test(){return{tiles:Array.from(this.tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this.refCounts.keys()).map((e=>`${e}:${this.refCounts.get(e)}`))}}};(0,r._)([(0,u.Cb)({constructOnly:!0})],Z.prototype,"featureStore",void 0),(0,r._)([(0,u.Cb)()],Z.prototype,"tileInfo",void 0),(0,r._)([(0,u.Cb)()],Z.prototype,"extent",void 0),(0,r._)([(0,u.Cb)()],Z.prototype,"maximumByteSize",void 0),Z=(0,r._)([(0,c.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],Z);class L{constructor(e,t,s){this.data=e,this.objectIds=t,this.byteSize=s}}class J{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&((0,a.pC)(this.children[0])||(0,a.pC)(this.children[1])||(0,a.pC)(this.children[2])||(0,a.pC)(this.children[3]))}}class G{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,I.SO)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class z{constructor(e,t,s){this.tileInfo=e,this.extent=null,this.info=new G(t),(0,a.pC)(s)&&(this.extent=(0,I.oJ)(s))}addMissing(e,t,s,r){const i={id:null,level:e,row:t,col:s};this.tileInfo.updateTileInfo(i,y.Z.ExtrapolateOptions.POWER_OF_TWO),!(0,a.pC)(i.extent)||(0,a.pC)(this.extent)&&!(0,I.kK)(this.extent,i.extent)||(this.info.missingTiles.push({data:i,resolution:r}),this.info.coveredArea-=(0,I.SO)(i.extent))}}const Y=.18751;var W,Q;(Q=W||(W={}))[Q.ADDED=0]="ADDED",Q[Q.REMOVED=1]="REMOVED",Q[Q.UNCHANGED=2]="UNCHANGED";var $=s(89749);let X=class extends i.Z.EventedAccessor{constructor(){super(...arguments),this.isInitializing=!0,this.whenSetup=(0,o.dD)(),this.handles=new n.Z,this.updatingHandles=new $.t,this.pendingApplyEdits=new Map}get updating(){return this.featureFetcher.updating||this.isInitializing||this.updatingHandles.updating}destroy(){this.featureFetcher.destroy(),this.queryEngine.destroy(),this.featureStore.clear(),this.handles.destroy()}async setup(e){const{geometryType:t,objectIdField:s,timeInfo:r,fields:i}=e.serviceInfo;return this.featureStore=new p.Z({...e.serviceInfo,hasZ:!1,hasM:!1}),this.queryEngine=new g.Z({spatialReference:e.spatialReference,featureStore:this.featureStore,geometryType:t,fields:i,hasZ:!1,hasM:!1,objectIdField:s,timeInfo:r?f.Z.fromJSON(r):null}),this.featureFetcher=new M({store:new Z({featureStore:this.featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:h.Z.fromJSON(e.spatialReference),sourceSpatialReference:h.Z.fromJSON(e.serviceInfo.spatialReference)}),this.handles.add([this.featureFetcher.watch("availability",(e=>this.emit("notify-availability",{availability:e})),!0),this.watch("updating",(()=>this._notifyUpdating()))]),this.whenSetup.resolve(),this.isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this.updatingHandles.addPromise(this.whenSetup.promise),this._updateFeatureFetcherConfiguration(e),{result:{}}}async fetchCandidates(e,t){return await this.whenSetup.promise,(0,o.k_)(t),{result:await this.queryEngine.executeQueryForSnapping({point:e.point,distance:e.distance,types:e.types,query:(0,a.pC)(e.filter)?e.filter:{where:"1=1"}},(0,a.pC)(t)?t.signal:null)}}async updateTiles(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,o.k_)(t),this.featureFetcher.tileSize=e.tileSize,this.featureFetcher.tilesOfInterest=e.tiles,this.featureFetcher.tileInfo=(0,a.pC)(e.tileInfo)?y.Z.fromJSON(e.tileInfo):null,{result:{}}}async refresh(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,o.k_)(t),this.featureFetcher.refresh(),{result:{}}}async whenNotUpdating(e,t){return await this.updatingHandles.addPromise(this.whenSetup.promise),(0,o.k_)(t),await(0,o.Hl)((0,l.cm)(this,"updating"),t),{result:{}}}async getDebugInfo(e,t){return(0,o.k_)(t),{result:this.featureFetcher.debugInfo}}async beginApplyEdits(e,t){this.updatingHandles.addPromise(this.whenSetup.promise),(0,o.k_)(t);const s=(0,o.dD)();return this.pendingApplyEdits.set(e.id,s),this.featureFetcher.applyEdits(s.promise),this.updatingHandles.addPromise(s.promise),{result:{}}}async endApplyEdits(e,t){const s=this.pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,o.k_)(t),{result:{}}}_updateFeatureFetcherConfiguration(e){this.featureFetcher.filter=(0,a.pC)(e.filter)?m.Z.fromJSON(e.filter):null,this.featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};function K(){return new X}(0,r._)([(0,u.Cb)({readOnly:!0})],X.prototype,"updating",null),(0,r._)([(0,u.Cb)()],X.prototype,"isInitializing",void 0),X=(0,r._)([(0,c.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],X)},89749:(e,t,s)=>{s.d(t,{t:()=>c});var r=s(43697),i=s(15923),n=s(61247),a=s(70586),o=s(17445),l=s(1654),u=s(5600),d=s(52011);let c=class extends i.Z{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new n.Z,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,t,s={}){const r=++this.handleId;s.sync||this._installSyncUpdatingWatch(e,r);const i=(0,o.YP)(e,t,s);return this.handles.add(i,r),{remove:()=>this.handles.remove(r)}}addOnCollectionChange(e,t,{initial:s=!1}={}){const r=++this.handleId;return this.handles.add([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.Z_),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.items,removed:[],moved:[],target:e}):void 0})],r),{remove:()=>this.handles.remove(r)}}addPromise(e){if((0,a.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(h)||this._set("updating",!1))}},t),this.pendingPromises.add(e),this._set("updating",!0);const s=()=>this.handles.remove(t);return e.then(s,s),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),r=(0,o.YP)(e,s,{sync:!0,equals:()=>!1});return this.handles.add(r,t),r}_createSyncUpdatingCallback(){return()=>{this.handles.remove(h),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,l.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(h))})),h)}}};(0,r._)([(0,u.Cb)({readOnly:!0})],c.prototype,"updating",void 0),c=(0,r._)([(0,d.j)("esri.views.support.WatchUpdatingTracking")],c);const h=-42;var p,g;(g=p||(p={}))[g.NONE=0]="NONE",g[g.SYNC=1]="SYNC",g[g.INIT=2]="INIT"}}]);