@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 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[402,3172,5732],{7301:(e,t,r)=>{r.r(t),r.d(t,{registerFunctions:()=>h});var n=r(77286),o=r(61363),s=r(53073),a=r(75148),i=r(95330),l=r(9361),c=r(8667);function d(e){return e instanceof l.Z}function u(e,t,r,u,h){return h(e,t,(function(e,t,h){if(h.length<2)return u(new Error("Missing Parameters"));if(null===(h=(0,o.K)(h))[0]&&null===h[1])return(0,i.DB)(!1);if((0,o.o)(h[0]))return h[1]instanceof l.Z?(0,i.DB)(new s.Z({parentfeatureset:h[0],relation:r,relationGeom:h[1]})):null===h[1]?(0,i.DB)(new a.Z({parentfeatureset:h[0]})):u("Spatial Relation cannot accept this parameter type");if(d(h[0])){if(d(h[1])){let e=null;switch(r){case"esriSpatialRelEnvelopeIntersects":e=(0,c.kK)((0,n.SV)(h[0]),(0,n.SV)(h[1]));break;case"esriSpatialRelIntersects":e=(0,c.kK)(h[0],h[1]);break;case"esriSpatialRelContains":e=(0,c.r3)(h[0],h[1]);break;case"esriSpatialRelOverlaps":e=(0,c.Nm)(h[0],h[1]);break;case"esriSpatialRelWithin":e=(0,c.uh)(h[0],h[1]);break;case"esriSpatialRelTouches":e=(0,c.W4)(h[0],h[1]);break;case"esriSpatialRelCrosses":e=(0,c.jU)(h[0],h[1])}return null!==e?e:(0,i.d1)(new Error("Unrecognised Relationship"))}return(0,o.o)(h[1])?(0,i.DB)(new s.Z({parentfeatureset:h[1],relation:r,relationGeom:h[0]})):null===h[1]?(0,i.DB)(!1):u("Spatial Relation cannot accept this parameter type")}return null!==h[0]?u("Spatial Relation cannot accept this parameter type"):(0,o.o)(h[1])?(0,i.DB)(new a.Z({parentfeatureset:h[1]})):h[1]instanceof l.Z||null===h[1]?(0,i.DB)(!1):void 0}))}function h(e){"async"===e.mode&&(e.functions.intersects=function(t,r){return u(t,r,"esriSpatialRelIntersects",e.failDefferred,e.standardFunctionAsync)},e.functions.envelopeintersects=function(t,r){return u(t,r,"esriSpatialRelEnvelopeIntersects",e.failDefferred,e.standardFunctionAsync)},e.signatures.push({name:"envelopeintersects",min:"2",max:"2"}),e.functions.contains=function(t,r){return u(t,r,"esriSpatialRelContains",e.failDefferred,e.standardFunctionAsync)},e.functions.overlaps=function(t,r){return u(t,r,"esriSpatialRelOverlaps",e.failDefferred,e.standardFunctionAsync)},e.functions.within=function(t,r){return u(t,r,"esriSpatialRelWithin",e.failDefferred,e.standardFunctionAsync)},e.functions.touches=function(t,r){return u(t,r,"esriSpatialRelTouches",e.failDefferred,e.standardFunctionAsync)},e.functions.crosses=function(t,r){return u(t,r,"esriSpatialRelCrosses",e.failDefferred,e.standardFunctionAsync)},e.functions.relate=function(t,r){return e.standardFunctionAsync(t,r,(function(e,t,r){if(r=(0,o.K)(r),(0,o.p)(r,3,3),d(r[0])&&d(r[1]))return(0,c.LV)(r[0],r[1],(0,o.d)(r[2]));if(r[0]instanceof l.Z&&null===r[1])return!1;if(r[1]instanceof l.Z&&null===r[0])return!1;if((0,o.o)(r[0])&&null===r[1])return new a.Z({parentfeatureset:r[0]});if((0,o.o)(r[1])&&null===r[0])return new a.Z({parentfeatureset:r[1]});if((0,o.o)(r[0])&&r[1]instanceof l.Z)return r[0].relate(r[1],(0,o.d)(r[2]));if((0,o.o)(r[1])&&r[0]instanceof l.Z)return r[1].relate(r[0],(0,o.d)(r[2]));if(null===r[0]&&null===r[1])return!1;throw new Error("Illegal Argument")}))})}},5732:(e,t,r)=>{r.d(t,{a:()=>s,c:()=>n,g:()=>o});var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(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.')}},78346:(e,t,r)=>{r.d(t,{bA:()=>N});var n=r(20102),o=r(80442),s=r(95330),a=r(80903),i=r(25045),l=r(40330),c=r(92604),d=r(94362),u=r(99880),h=r(68773),f=(r(2587),r(17452));const m={};function p(e){var t;const r={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(r.async=!0),e.hasOwnProperty("isDebug")||(r.isDebug=!1),e.baseUrl||(r.baseUrl=m.baseUrl),null==(t=m.packages)||t.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(r.packages,e)})),r}var g=r(41213);class y{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class w{constructor(){this._dispatcher=new y,this._workerPostMessage({type:d.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,g.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,g.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,d.QM)(e);if(t&&t.type===d.Cs.OPEN){const{modulePath:e,jobId:r}=t;let n=await i.default.loadWorker(e);n||(n=await import(e));const o=i.default.connect(n);this._workerPostMessage({type:d.Cs.OPENED,jobId:r,data:o})}}}var b=r(70171),k=r(17202);const v=c.Z.getLogger("esri.core.workers"),{HANDSHAKE:E}=d.Cs;let S,_;const L="Failed to create Worker. Fallback to execute module in main thread";async function T(e){return new Promise((t=>{function r(o){const s=(0,d.QM)(o);s&&s.type===E&&(e.removeEventListener("message",r),e.removeEventListener("error",n),t(e))}function n(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",n),v.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new w).addEventListener("message",r),e.addEventListener("error",n)}e.addEventListener("message",r),e.addEventListener("error",n)}))}let O=0;const D=c.Z.getLogger("esri.core.workers"),{ABORT:M,INVOKE:C,OPEN:q,OPENED:P,RESPONSE:R}=d.Cs;class Z{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),D.error(e)}))}static async create(e){const t=await async function(){if(!(0,o.Z)("esri-workers"))return T(new w);if(!S&&!_)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=h.Z.default){const t={...h.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(h.Z));e.assetsPath=(0,f.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,b.Kd)(),e.has={"esri-csp-restrictions":(0,o.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,o.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,o.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,o.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,o.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,o.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,o.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,o.Z)("esri-atomics"),"esri-shared-array-buffer":(0,o.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,o.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,o.Z)("esri-workers-arraybuffer-transfer"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,f.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,f.hF)(e.workers.workerPath):e.workers.workerPath=(0,f.hF)((0,u.V)("esri/core/workers/RemoteClient.js"));const t=h.Z.workers.loaderConfig,r=p({baseUrl:null==t?void 0:t.baseUrl,locale:(0,b.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...null==t?void 0:t.has},map:{...null==t?void 0:t.map},paths:{...null==t?void 0:t.paths},packages:(null==t?void 0:t.packages)||[]}),n={version:l.i8,buildDate:k.r,revision:k.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:n})}()}'`);S=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){_=e||{}}let e;if(S)try{e=new Worker(S,{name:"esri-worker-"+O++})}catch(t){v.warn(L,_),e=new w}else v.warn(L,_),e=new w;return T(e)}();return new Z(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=(0,d.jt)();return new Promise(((t,o)=>{const a={resolve:t,reject:o,abortHandle:(0,s.$F)(r,(()=>{this._outJobs.delete(n),this._post({type:M,jobId:n})}))};this._outJobs.set(n,a),this._post({type:q,jobId:n,modulePath:e})}))}_onMessage(e){const t=(0,d.QM)(e);if(t)switch(t.type){case P:this._onOpenedMessage(t);break;case R:this._onResponseMessage(t);break;case M:this._onAbortMessage(t);break;case C:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,a=o?new AbortController:null,i=this._inJobs,c=l.Nv[t];let u;try{if("function"!=typeof c)throw new TypeError(`${t} is not a function`);u=c.call(null,n,{signal:a?a.signal:null})}catch(e){return void this._post({type:R,jobId:r,error:(0,d.AB)(e)})}(0,s.y8)(u)?(i.set(r,{controller:a,promise:u}),u.then((e=>{i.has(r)&&(i.delete(r),this._post({type:R,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),e||(e={message:"Error encountered at method"+t}),(0,s.D_)(e)||this._post({type:R,jobId:r,error:(0,d.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:R,jobId:r},u)}_onOpenedMessage(e){var t;const{jobId:r,data:n}=e,o=this._outJobs.get(r);o&&(this._outJobs.delete(r),null==(t=o.abortHandle)||t.remove(),o.resolve(n))}_onResponseMessage(e){var t;const{jobId:r,error:o,data:s}=e,a=this._outJobs.get(r);a&&(this._outJobs.delete(r),null==(t=a.abortHandle)||t.remove(),o?a.reject(n.Z.fromJSON(JSON.parse(o))):a.resolve(s))}_post(e,t,r){return(0,d.oi)(this.worker,e,t,r)}}let F=(0,o.Z)("esri-workers-debug")?1:(0,o.Z)("host-browser")?navigator.hardwareConcurrency-1:0;F||(F=(0,o.Z)("safari")&&(0,o.Z)("mac")||(0,o.Z)("trident")?7:2);let I=0;const A=[];async function x(e,t){const r=new a.Z;return await r.open(e,t),r}async function N(e,t={}){if("string"!=typeof e)throw new n.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,o.Z)("host-webworker")&&!(0,o.Z)("esri-workers")&&(r="local"),"local"===r){let r=await i.default.loadWorker(e);r||(r=await import(e)),(0,s.k_)(t.signal);const n=t.client||r;return x([i.default.connect(r)],{...t,client:n})}if(await async function(){if(U)return U;j=new AbortController;const e=[];for(let t=0;t<F;t++){const r=Z.create(t).then((e=>(A[t]=e,e)));e.push(r)}return U=Promise.all(e),U}(),(0,s.k_)(t.signal),"dedicated"===r){const r=I++%F;return x([await A[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,F);if(r<F){const n=new Array(r);for(let o=0;o<r;++o){const r=I++%F;n[o]=A[r].open(e,t)}return x(n,t)}}return x(A.map((r=>r.open(e,t))),t)}let j,U=null},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var n=r(94443),o=r(3172),s=r(20102),a=r(70586);async function i(e){if((0,a.pC)(l.fetchBundleAsset))return l.fetchBundleAsset(e);const t=await(0,o.default)(e,{responseType:"text"});return JSON.parse(t.data)}const l={};var c,d=r(99880);(0,n.tz)((c={pattern:"esri/",location:d.V},new class{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,o){const a=t.exec(r);if(!a)throw new s.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",c=a[2],d=(0,n.Su)(o),u=`${l}${c}.json`,h=d?`${l}${c}_${d}.json`:u;let f;try{f=await i(e(h))}catch(t){if(h===u)throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{f=await i(e(u))}catch(e){throw new s.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return f}(this.getAssetUrl,this.matcher,e,t)}}(c)))},90344:(e,t,r)=>{r.d(t,{Ze:()=>g,p6:()=>y});var n=r(35454),o=r(70171);const s={year:"numeric",month:"numeric",day:"numeric"},a={year:"numeric",month:"long",day:"numeric"},i={year:"numeric",month:"short",day:"numeric"},l={year:"numeric",month:"long",weekday:"long",day:"numeric"},c={hour:"numeric",minute:"numeric"},d={...c,second:"numeric"},u={"short-date":s,"short-date-short-time":{...s,...c},"short-date-short-time-24":{...s,...c,hour12:!1},"short-date-long-time":{...s,...d},"short-date-long-time-24":{...s,...d,hour12:!1},"short-date-le":s,"short-date-le-short-time":{...s,...c},"short-date-le-short-time-24":{...s,...c,hour12:!1},"short-date-le-long-time":{...s,...d},"short-date-le-long-time-24":{...s,...d,hour12:!1},"long-month-day-year":a,"long-month-day-year-short-time":{...a,...c},"long-month-day-year-short-time-24":{...a,...c,hour12:!1},"long-month-day-year-long-time":{...a,...d},"long-month-day-year-long-time-24":{...a,...d,hour12:!1},"day-short-month-year":i,"day-short-month-year-short-time":{...i,...c},"day-short-month-year-short-time-24":{...i,...c,hour12:!1},"day-short-month-year-long-time":{...i,...d},"day-short-month-year-long-time-24":{...i,...d,hour12:!1},"long-date":l,"long-date-short-time":{...l,...c},"long-date-short-time-24":{...l,...c,hour12:!1},"long-date-long-time":{...l,...d},"long-date-long-time-24":{...l,...d,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":c,"long-time":d},h=(0,n.wY)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),f=(h.apiValues,h.toJSON.bind(h),h.fromJSON.bind(h),{ar:"ar-u-nu-latn-ca-gregory"});let m=new WeakMap,p=u["short-date-short-time"];function g(e){return u[e]||null}function y(e,t){return function(e){const t=e||p;if(!m.has(t)){const e=(0,o.Kd)(),r=f[(0,o.Kd)()]||e;m.set(t,new Intl.DateTimeFormat(r,t))}return m.get(t)}(t).format(e)}(0,o.Ze)((()=>{m=new WeakMap,p=u["short-date-short-time"]}))},94443:(e,t,r)=>{r.d(t,{ME:()=>f,Su:()=>m,tz:()=>h});var n=r(20102),o=r(95330),s=r(70171);const a=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,i={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function l(e){var t;return null!=(t=i[e])&&t}const c=[],d=new Map;function u(e){for(const t of d.keys())p(e.pattern,t)&&d.delete(t)}function h(e){return c.includes(e)||(u(e),c.unshift(e)),{remove(){const t=c.indexOf(e);t>-1&&(c.splice(t,1),u(e))}}}async function f(e){const t=(0,s.Kd)();d.has(e)||d.set(e,async function(e,t){const r=[];for(const n of c)if(p(n.pattern,e))try{return await n.fetchMessageBundle(e,t)}catch(e){r.push(e)}if(r.length)throw new n.Z("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:r});throw new n.Z("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}(e,t));const r=d.get(e);return await g.add(r),r}function m(e){if(!a.test(e))return null;const[,t,r]=a.exec(e),n=t+(r?"-"+r.toUpperCase():"");return l(n)?n:l(t)?t:null}function p(e,t){return"string"==typeof e?t.startsWith(e):e.test(t)}(0,s.Ze)((()=>{d.clear()}));const g=new class{constructor(){this._numLoading=0}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then((()=>this._decrease()),(()=>this._decrease())),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=(0,o.dD)())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&0===this._numLoading&&(this._dfd.resolve(),this._dfd=null)}}},18848:(e,t,r)=>{r.d(t,{sh:()=>l,uf:()=>c});var n=r(70586),o=r(70171);const s={ar:"ar-u-nu-latn"};let a=new WeakMap,i={};function l(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function c(e,t){return function(e){const t=e||i;if(!a.has(t)){const r=(0,o.Kd)(),n=s[(0,o.Kd)()]||r;a.set(t,new Intl.NumberFormat(n,e))}return(0,n.j0)(a.get(t))}(t).format(e)}(0,o.Ze)((()=>{a=new WeakMap,i={}}))},940:(e,t,r)=>{r.d(t,{n:()=>c});var n=r(92604),o=r(78286),s=r(19153),a=r(90344),i=r(18848);const l=n.Z.getLogger("esri.intl");function c(e,t,r={}){const{format:n={}}=r;return(0,s.gx)(e,(e=>function(e,t,r){let n,s;const a=e.indexOf(":");if(-1===a?n=e.trim():(n=e.slice(0,a).trim(),s=e.slice(a+1).trim()),!n)return"";const i=(0,o.hS)(n,t);if(null==i)return"";const l=r[s]||r[n];return l?d(i,l):s?u(i,s):h(i)}(e,t,n)))}function d(e,t){switch(t.type){case"date":return(0,a.p6)(e,t.intlOptions);case"number":return(0,i.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),h(e)}}function u(e,t){switch(t.toLowerCase()){case"dateformat":return(0,a.p6)(e);case"numberformat":return(0,i.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,a.p6)(e):/^numberformat/i.test(t)?(0,i.uf)(e):h(e)}}function h(e){switch(typeof e){case"string":return e;case"number":return(0,i.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,a.p6)(e):""}}},99514:(e,t,r)=>{r.d(t,{Z:()=>a});var n=r(35671);function o(e){return"oid"===e.type||"esriFieldTypeOID"===e.type}function s(e){return"global-id"===e.type||"esriFieldTypeGlobalID"===e.type}class a{constructor(e){if(this.fields=e,this._fieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!e)return;const t=[];for(const a of e){const e=a&&a.name;if(e){const l=i(e);this._fieldsMap.set(e,a),this._fieldsMap.set(l,a),t.push(l),"date"===(r=a).type||"esriFieldTypeDate"===r.type?(this.dateFields.push(a),this._dateFieldsSet.add(a)):(0,n.H7)(a)&&(this._numericFieldsSet.add(a),this.numericFields.push(a)),o(a)||s(a)||(a.editable=null==a.editable||!!a.editable,a.nullable=null==a.nullable||!!a.nullable)}}var r;t.sort(),this.uid=t.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)o(e)||s(e)||e.nullable||void 0!==(0,n.os)(e)||this._requiredFields.push(e)}return this._requiredFields}has(e){return null!=this.get(e)}get(e){return null!=e?this._fieldsMap.get(e)||this._fieldsMap.get(i(e)):void 0}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const t=this.get(e);if(t)return t.name}}function i(e){return e.toLowerCase().trim()}},3172:(e,t,r)=>{r.r(t),r.d(t,{default:()=>f});var n=r(68773),o=r(40330),s=r(20102),a=r(80442),i=r(22974),l=r(70586),c=r(95330),d=r(17452),u=r(71058),h=r(85958);async function f(e,t){var i;const h=(0,d.HK)(e),y=(0,d.jc)(e);y||h||(e=(0,d.Fv)(e));const w={url:e,requestOptions:{...(0,l.Wg)(t)}};let b=(0,d.oh)(e);if(b){const e=await async function(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let r,n;try{n=await e.before(t)}catch(e){r=S("request:interceptor",e,t)}if((n instanceof Error||n instanceof s.Z)&&(r=S("request:interceptor",n,t)),r)throw e.error&&e.error(r),r;return n}}(b,w);if(null!=e)return{data:e,getHeader:k,requestOptions:w.requestOptions,url:w.url};b.after||b.error||(b=null)}if(e=w.url,"image"===(t=w.requestOptions).responseType){if((0,a.Z)("host-webworker")||(0,a.Z)("host-node"))throw S("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),w)}else if(h)throw S("request:invalid-parameters",new Error("Data URLs are not supported for responseType = "+t.responseType),w);if("head"===t.method){if(t.body)throw S("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),w);if(h||y)throw S("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),w)}if(await async function(){(0,a.Z)("host-webworker")?m||(m=await Promise.all([r.e(102),r.e(9884)]).then(r.bind(r,29884))):f._abortableFetch||(f._abortableFetch=globalThis.fetch.bind(globalThis))}(),m)return m.execute(e,t);const v=new AbortController;(0,c.fu)(t,(()=>v.abort()));const E={controller:v,credential:null,credentialToken:null,fetchOptions:null,hasToken:!1,interceptor:b,params:w,redoRequest:!1,useIdentity:p.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},O=await async function(e){var t,r;let s,a;await async function(e){const t=e.params.url,r=e.params.requestOptions,s=e.controller.signal,a=r.body;let i=null,l=null,d=null;if(g&&"HTMLFormElement"in globalThis&&(a instanceof FormData?i=a:a instanceof HTMLFormElement&&(l=a,i=new FormData(l))),"string"==typeof a&&(d=a),e.fetchOptions={cache:r.cacheBust&&!f._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:r.headers||{},method:"head"===r.method?"HEAD":"GET",mode:"cors",redirect:"follow",signal:s},(i||d)&&(e.fetchOptions.body=i||d),"anonymous"===r.authMode&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||r.query&&r.query.token||i&&i.get&&i.get("token")||l&&l.elements.token),!e.hasToken&&n.Z.apiKey&&(0,u.r)(t)&&(r.query||(r.query={}),r.query.token=n.Z.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!L(t)&&!(0,c.Hc)(s)){let n;"immediate"===r.authMode?(await _(),n=await o.id.getCredential(t,{signal:s}),e.credential=n):"no-prompt"===r.authMode?(await _(),n=await o.id.getCredential(t,{prompt:!1,signal:s}).catch((()=>{})),e.credential=n):o.id&&(n=o.id.findCredential(t)),n&&(e.credentialToken=n.token,e.useSSL=!!n.ssl)}}(e);try{do{[s,a]=await T(e)}while(!await D(e,s,a))}catch(t){const r=S("request:server",t,e.params,s);throw r.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(r),r}const i=e.params.url;if(/\/sharing\/rest\/(accounts|portals)\/self/i.test(i)&&!e.hasToken&&!e.credentialToken&&null!=(t=a)&&null!=(r=t.user)&&r.username&&!(0,d.kl)(i)){const e=(0,d.P$)(i,!0);e&&p.trustedServers.push(e)}const l=e.credential;if(l&&o.id){const e=o.id.findServerInfo(l.server);let t=e&&e.owningSystemUrl;if(t){t=t.replace(/\/?$/,"/sharing");const e=o.id.findCredential(t,l.userId);e&&-1===o.id._getIdenticalSvcIdx(t,e)&&e.resources.unshift(t)}}return{data:a,getHeader:s?e=>s.headers.get(e):k,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}(E);return null==(i=b)||null==i.after||i.after(O),O}let m;const p=n.Z.request,g="FormData"in globalThis,y=[499,498,403,401],w=["COM_0056","COM_0057","SB_0008"],b=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],k=()=>null,v=Symbol();function E(e){const t=(0,d.P$)(e);return!t||t.endsWith(".arcgis.com")||f._corsServers.includes(t)||(0,d.kl)(t)}function S(e,t,r,n){let o="Error";const a={url:r.url,requestOptions:r.requestOptions,getHeader:k,ssl:!1};if(t instanceof s.Z)return t.details?(t.details=(0,i.d9)(t.details),t.details.url=r.url,t.details.requestOptions=r.requestOptions):t.details=a,t;if(t){const e=n&&(e=>n.headers.get(e)),r=n&&n.status,s=t.message;s&&(o=s),e&&(a.getHeader=e),a.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||r||0,a.subCode=t.subcode,a.messageCode=t.messageCode,"string"==typeof t.details?a.messages=[t.details]:a.messages=t.details,a.raw=v in t?t[v]:t}return(0,c.D_)(t)?(0,c.zE)():new s.Z(e,o,a)}async function _(){o.id||await Promise.all([r.e(280),r.e(2785),r.e(102),r.e(8536)]).then(r.bind(r,85976))}function L(e){return b.some((t=>t.test(e)))}async function T(e){let t=e.params.url;const r=e.params.requestOptions,n=e.fetchOptions,s=(0,d.jc)(t)||(0,d.HK)(t),i=r.responseType||"json",l=s?0:null!=r.timeout?r.timeout:p.timeout;let u=!1;if(!s){e.useSSL&&(t=(0,d.hO)(t)),r.cacheBust&&"default"===n.cache&&(t=(0,d.ZN)(t,"request.preventCache",Date.now()));let s={...r.query};e.credentialToken&&(s.token=e.credentialToken);let i=(0,d.B7)(s);(0,a.Z)("esri-url-encodes-apostrophe")&&(i=i.replace(/'/g,"%27"));const l=t.length+1+i.length;let c;u="delete"===r.method||"post"===r.method||"put"===r.method||!!r.body||l>p.maxUrlLength;const h=r.useProxy||!!(0,d.ed)(t);if(h){const e=(0,d.b7)(t);c=e.path,!u&&c.length+1+l>p.maxUrlLength&&(u=!0),e.query&&(s={...e.query,...s})}if("HEAD"===n.method&&(u||h)){if(u){if(l>p.maxUrlLength)throw S("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params);throw S("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params)}if(h)throw S("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(u?(n.method="delete"===r.method?"DELETE":"put"===r.method?"PUT":"POST",r.body?t=(0,d.fl)(t,s):(n.body=(0,d.B7)(s),n.headers["Content-Type"]="application/x-www-form-urlencoded")):t=(0,d.fl)(t,s),h&&(e.useProxy=!0,t=`${c}?${t}`),s.token&&g&&n.body instanceof FormData){const e=n.body;e.set?e.set("token",s.token):e.append("token",s.token)}if(r.hasOwnProperty("withCredentials"))e.withCredentials=r.withCredentials;else if(!(0,d.D6)(t,(0,d.TI)()))if((0,d.kl)(t))e.withCredentials=!0;else if(o.id){const r=o.id.findServerInfo(t);r&&r.webTierAuth&&(e.withCredentials=!0)}e.withCredentials&&(n.credentials="include")}let h,m,y=0,w=!1;l>0&&(y=setTimeout((()=>{w=!0,e.controller.abort()}),l));try{if("native-request-init"===r.responseType)m=n,m.url=t;else if("image"!==r.responseType||"default"!==n.cache||"GET"!==n.method||u||function(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}(r.headers)||!s&&!e.useProxy&&p.proxyUrl&&!E(t)){if(h=await f._abortableFetch(t,n),e.useProxy||function(e){const t=(0,d.P$)(e);t&&!f._corsServers.includes(t)&&f._corsServers.push(t)}(t),"native"===r.responseType)m=h;else if("HEAD"!==n.method)if(h.ok){switch(i){case"array-buffer":m=await h.arrayBuffer();break;case"blob":case"image":m=await h.blob();break;default:m=await h.text()}if(y&&(clearTimeout(y),y=0),"json"===i||"xml"===i||"document"===i)if(m)switch(i){case"json":m=JSON.parse(m);break;case"xml":m=O(m,"application/xml");break;case"document":m=O(m,"text/html")}else m=null;if(m){if("array-buffer"===i||"blob"===i){const e=h.headers.get("Content-Type");if(/application\/json|text\/plain/i.test(e)&&m["blob"===i?"size":"byteLength"]<=750)try{const e=await new Response(m).json();e.error&&(m=e)}catch{}}"image"===i&&m instanceof Blob&&(m=await M(URL.createObjectURL(m),e,!0))}}else m=await h.text()}else m=await M(t,e)}catch(n){if("AbortError"===n.name){if(w)throw new Error("Timeout exceeded");throw(0,c.zE)("Request canceled")}if(!(!h&&n instanceof TypeError&&p.proxyUrl)||r.body||"delete"===r.method||"head"===r.method||"post"===r.method||"put"===r.method||e.useProxy||E(t))throw n;e.redoRequest=!0,(0,d.tD)({proxyUrl:p.proxyUrl,urlPrefix:(0,d.P$)(t)})}finally{y&&clearTimeout(y)}return[h,m]}function O(e,t){let r;try{r=(new DOMParser).parseFromString(e,t)}catch{}if(!r||r.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return r}async function D(e,t,r){if(e.redoRequest)return e.redoRequest=!1,!1;const n=e.params.requestOptions;if(!t||"native"===n.responseType||"native-request-init"===n.responseType)return!0;let s,a,i,l;if(!t.ok)throw s=new Error(`Unable to load ${t.url} status: ${t.status}`),s[v]=r,s;null!=r&&r.error&&(s=r.error),s&&(a=Number(s.code),i=s.hasOwnProperty("subcode")?Number(s.subcode):null,l=s.messageCode,l=l&&l.toUpperCase());const c=n.authMode;if(403===a&&(4===i||s.message&&s.message.toLowerCase().indexOf("ssl")>-1&&-1===s.message.toLowerCase().indexOf("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==c||498===a)&&-1!==y.indexOf(a)&&!L(e.params.url)&&(403!==a||-1===w.indexOf(l)&&(null==i||2===i&&e.credentialToken))){await _();try{const t=await o.id.getCredential(e.params.url,{error:S("request:server",s,e.params),prompt:"no-prompt"!==c,signal:e.controller.signal,token:e.credentialToken});return e.credential=t,e.credentialToken=t.token,e.useSSL=e.useSSL||t.ssl,!1}catch(t){if("no-prompt"===c)return e.credential=null,e.credentialToken=null,!1;s=t}}if(s)throw s;return!0}function M(e,t,r=!1){const n=t.controller.signal,o=new Image;return t.withCredentials?o.crossOrigin="use-credentials":o.crossOrigin="anonymous",o.alt="",o.src=e,(0,h.f)(o,e,r,n)}f._abortableFetch=null,f._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"]},71058:(e,t,r)=>{r.d(t,{r:()=>s});var n=r(17452);const o=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function s(e){const t=(0,n.P$)(e,!0);return t&&t.endsWith(".arcgis.com")&&!o.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}},85958:(e,t,r)=>{r.d(t,{f:()=>a});var n=r(80442),o=r(70586),s=r(95330);function a(e,t,r=!1,a){return new Promise(((l,c)=>{if((0,s.Hc)(a))return void c(i());let d=()=>{f(),c(new Error(`Unable to load ${t}`))},u=()=>{const t=e;f(),l(t)},h=()=>{if(!e)return;const t=e;f(),t.src="",c(i())};const f=()=>{(0,n.Z)("esri-image-decode")||(e.removeEventListener("error",d),e.removeEventListener("load",u)),d=null,u=null,e=null,(0,o.pC)(a)&&a.removeEventListener("abort",h),h=null,r&&URL.revokeObjectURL(t)};(0,o.pC)(a)&&a.addEventListener("abort",h),(0,n.Z)("esri-image-decode")?e.decode().then(u,d):(e.addEventListener("error",d),e.addEventListener("load",u))}))}function i(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7783],{96794:(e,t,s)=>{s.d(t,{r:()=>i});var r=s(88764);function i(e,t){if(!(this instanceof i))return new i(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this.toBBox=t:this._initFormat(t)),this.clear()}function n(e,t,s){if(!s)return t.indexOf(e);for(var r=0;r<t.length;r++)if(s(e,t[r]))return r;return-1}function o(e,t){a(e,0,e.children.length,t,e)}function a(e,t,s,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var n,o=t;o<s;o++)n=e.children[o],h(i,e.leaf?r(n):n);return i}function h(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function c(e,t){return e.minX-t.minX}function u(e,t){return e.minY-t.minY}function l(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){var s=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,i-s)*Math.max(0,n-r)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function f(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,s,i,n){for(var o,a=[t,s];a.length;)(s=a.pop())-(t=a.pop())<=i||(o=t+Math.ceil((s-t)/i/2)*i,(0,r.q)(e,o,t,s,n),a.push(t,o,o,s))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,s=[],r=this.toBBox;if(!f(e,t))return s;for(var i,n,o,a,h=[];t;){for(i=0,n=t.children.length;i<n;i++)o=t.children[i],f(e,a=t.leaf?r(o):o)&&(t.leaf?s.push(o):_(e,a)?this._all(o,s):h.push(o));t=h.pop()}return s},collides:function(e){var t=this.data,s=this.toBBox;if(!f(e,t))return!1;for(var r,i,n,o,a=[];t;){for(r=0,i=t.children.length;r<i;r++)if(n=t.children[r],f(e,o=t.leaf?s(n):n)){if(t.leaf||_(e,o))return!0;a.push(n)}t=a.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(e,t){if(!e)return this;for(var s,r,i,o,a=this.data,h=this.toBBox(e),c=[],u=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],s=u.pop(),o=!0),a.leaf&&-1!==(i=n(e,a.children,t)))return a.children.splice(i,1),c.push(a),this._condense(c),this;o||a.leaf||!_(a,h)?r?(s++,a=r.children[s],o=!1):a=null:(c.push(a),u.push(s),s=0,r=a,a=a.children[0])}return this},toBBox:function(e){return e},compareMinX:c,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var s=[];e;)e.leaf?t.push.apply(t,e.children):s.push.apply(s,e.children),e=s.pop();return t},_build:function(e,t,s,r){var i,n=s-t+1,a=this._maxEntries;if(n<=a)return o(i=m(e.slice(t,s+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,r-1))),(i=m([])).leaf=!1,i.height=r;var h,c,u,l,d=Math.ceil(n/a),p=d*Math.ceil(Math.sqrt(a));for(y(e,t,s,p,this.compareMinX),h=t;h<=s;h+=p)for(y(e,h,u=Math.min(h+p-1,s),d,this.compareMinY),c=h;c<=u;c+=d)l=Math.min(c+d-1,u),i.children.push(this._build(e,c,l,r-1));return o(i,this.toBBox),i},_chooseSubtree:function(e,t,s,r){for(var i,n,o,a,h,c,u,d;r.push(t),!t.leaf&&r.length-1!==s;){for(u=d=1/0,i=0,n=t.children.length;i<n;i++)h=l(o=t.children[i]),(c=p(e,o)-h)<d?(d=c,u=h<u?h:u,a=o):c===d&&h<u&&(u=h,a=o);t=a||t.children[0]}return t},_insert:function(e,t,s){var r=this.toBBox,i=s?e:r(e),n=[],o=this._chooseSubtree(i,this.data,t,n);for(o.children.push(e),h(o,i);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(i,n,t)},_split:function(e,t){var s=e[t],r=s.children.length,i=this._minEntries;this._chooseSplitAxis(s,i,r);var n=this._chooseSplitIndex(s,i,r),a=m(s.children.splice(n,s.children.length-n));a.height=s.height,a.leaf=s.leaf,o(s,this.toBBox),o(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(s,a)},_splitRoot:function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,s){var r,i,n,o,h,c,u,d;for(c=u=1/0,r=t;r<=s-t;r++)o=g(i=a(e,0,r,this.toBBox),n=a(e,r,s,this.toBBox)),h=l(i)+l(n),o<c?(c=o,d=r,u=h<u?h:u):o===c&&h<u&&(u=h,d=r);return d},_chooseSplitAxis:function(e,t,s){var r=e.leaf?this.compareMinX:c,i=e.leaf?this.compareMinY:u;this._allDistMargin(e,t,s,r)<this._allDistMargin(e,t,s,i)&&e.children.sort(r)},_allDistMargin:function(e,t,s,r){e.children.sort(r);var i,n,o=this.toBBox,c=a(e,0,t,o),u=a(e,s-t,s,o),l=d(c)+d(u);for(i=t;i<s-t;i++)n=e.children[i],h(c,e.leaf?o(n):n),l+=d(c);for(i=s-t-1;i>=t;i--)n=e.children[i],h(u,e.leaf?o(n):n),l+=d(u);return l},_adjustParentBBoxes:function(e,t,s){for(var r=s;r>=0;r--)h(t[r],e)},_condense:function(e){for(var t,s=e.length-1;s>=0;s--)0===e[s].children.length?s>0?(t=e[s-1].children).splice(t.indexOf(e[s]),1):this.clear():o(e[s],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},8557:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(70586);class i{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(0===this.size)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return 0===this.size?null:this._buffer[this._start]}find(e){if(0===this.size)return null;for(const t of this._buffer)if((0,r.pC)(t)&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;(0,r.pC)(t);)e&&e(t),t=this.dequeue()}}},3920:(e,t,s)=>{s.d(t,{r:()=>u,p:()=>c});var r=s(43697),i=s(15923),n=s(61247),o=s(5600),a=s(52011),h=s(89749);const c=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 h.t}};return(0,r._)([(0,o.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,r._)([(0,o.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,r._)([(0,a.j)("esri.core.HandleOwner")],t),t};let u=class extends(c(i.Z)){};u=(0,r._)([(0,a.j)("esri.core.HandleOwner")],u)},45091:(e,t,s)=>{s.d(t,{Z:()=>u});var r,i,n=s(80442),o=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 a=4294967296,h=new TextDecoder("utf-8"),c=(0,n.Z)("safari")||(0,n.Z)("ios")?6:(0,n.Z)("ff")?12:32;class u{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 u(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)*a;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*a;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=u.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){u.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>c){const r=e.subarray(t,s);return h.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)}}u.pool=new o.Z(u,null,(e=>{e._data=null,e._dataView=null}))},80903:(e,t,s)=>{s.d(t,{Z:()=>h});var r=s(50758),i=s(92604),n=s(95330),o=s(25045);const a=i.Z.getLogger("esri.core.workers.Connection");class h{constructor(){this._clients=new Array,this._clientPromises=new Array,this._clientIdx=0}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((s,r)=>{let i=!0;const a=e=>{(0,n.k_)(t.signal),i&&(i=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length;for(let i=0;i<e.length;++i){const h=e[i];(0,n.y8)(h)?this._clientPromises[i]=h.then((e=>(this._clients[i]=new o.default(e,t),a(s),this._clients[i])),(()=>(a(r),null))):(this._clients[i]=new o.default(h,t),this._clientPromises[i]=Promise.resolve(this._clients[i]),a(s))}}))}broadcast(e,t,s){const r=new Array(this._clientPromises.length);for(let i=0;i<this._clientPromises.length;++i){const n=this._clientPromises[i];r[i]=n.then((r=>r.invoke(e,t,s)))}return r}close(){for(const e of this._clientPromises)e.then((e=>e.close()));this._clients.length=0,this._clientPromises.length=0}getAvailableClient(){let e;for(let t=0;t<this._clients.length;++t){const s=this._clients[t];if(s){if(!s.isBusy())return Promise.resolve(s)}else e=e||[],e.push(this._clientPromises[t])}return e?Promise.race(e):(this._clientIdx=(this._clientIdx+1)%this._clients.length,Promise.resolve(this._clients[this._clientIdx]))}invoke(e,t,s){let r=null;return Array.isArray(s)?(a.warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:s}):r=s,this.closed?Promise.reject(new Error("Connection closed")):this.getAvailableClient().then((s=>s.invoke(e,t,r)))}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,r.AL)(this._clients.map((s=>s.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let s=t.length;for(let r=0;r<this._clientPromises.length;++r)this._clientPromises[r].then((i=>{t[r]=i.openPort(),0==--s&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},66677:(e,t,s)=>{s.d(t,{ld:()=>g,B5:()=>l,M8:()=>f,G:()=>x,Qc:()=>d,DR:()=>p,Nm:()=>m,XG:()=>y,a7:()=>_,wH:()=>I});var r=s(70586),i=s(17452),n=s(25929);const o={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},a=Object.values(o),h=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${a.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),c=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${a.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function l(e){return!!h.test(e)}function d(e){const t=(0,i.mN)(e),s=t.path.match(h)||t.path.match(c);if(!s)return null;const[,r,n,a,u]=s,l=n.indexOf("/");return{title:g(-1!==l?n.slice(l+1):n),serverType:o[a.toLowerCase()],sublayer:null!=u&&""!==u?parseInt(u,10):null,url:{path:r}}}function p(e){const t=(0,i.mN)(e).path.match(u);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 _(e,t){const s=[];if(e){const t=d(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 y(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.Hu)(t,e.logger);const s=(0,i.mN)(t),n=d(s.path);let o;if((0,r.pC)(n))null!=n.sublayer&&null==e.layer.layerId&&(o=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=p(s.path);(0,r.pC)(e)&&(t=e.serviceUrl,o=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:o}}function I(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function x(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)}},77863:(e,t,s)=>{s.d(t,{K9:()=>A,O7:()=>l,G$:()=>S});var r=s(20102),i=s(70586),n=s(45091),o=s(5428),a=s(78760);const h=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],c=["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"],u=["upperLeft","lowerLeft"];function l(e){return e>=h.length?null:h[e]}function d(e){return e>=c.length?null:c[e]}function p(e){return e>=u.length?null:u[e]}function g(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function _(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 o=0;for(t.allocateCoordinates(r);e.pos()<n;)t.addCoordinate(r,e.getSInt64(),o),o++,o===i&&(o=0);break}default:e.skip()}return r}function m(e){const t=new o.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=a.A[e.getEnum()];break;default:e.skip()}return{queryGeometry:t,queryGeometryType:s}}function y(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 I(e){const t={type:l(0)};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.type=l(e.getEnum());break;case 3:t.alias=e.getString();break;case 4:t.sqlType=d(e.getEnum());break;case 5:default:e.skip();break;case 6:t.defaultValue=e.getString()}return t}function x(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 b(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(y);break}case 2:i.geometry=e.processMessageWithArgs(f,t,s);break;case 4:i.centroid=e.processMessageWithArgs(_,t,s);break;default:e.skip()}return i}function w(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 v(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(w);break;case 3:t.translate=e.processMessage(v);break;default:e.skip()}return t}function T(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 C(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 F(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(T);break;case 7:s.geometryType=g(t,e.getEnum());break;case 8:s.spatialReference=e.processMessageWithArgs(C,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(I));break;case 15:r||(t.prepareFeatures(s),r=!0),t.addFeature(s,e.processMessageWithArgs(b,t,s,s.fields));break;case 2:s.uniqueIdField=e.processMessage(x);break;default:e.skip()}return t.finishFeatureResult(s),s}function E(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(F,t);break;default:e.skip()}return(0,i.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function A(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(E,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:()=>h,J:()=>c});var r=s(67900),i=s(8744),n=s(70272),o=s(44876),a=s(5428);const h=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class c{constructor(e){this.options=e,this.geometryTypes=h,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new o.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 a.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 a.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,o=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=o),i}},34599:(e,t,s)=>{s.r(t),s.d(t,{executeQuery:()=>g,executeQueryForCount:()=>y,executeQueryForExtent:()=>I,executeQueryForIds:()=>m,executeQueryPBF:()=>_,executeQueryPBFBuffer:()=>f,queryToQueryStringParameters:()=>p,runQuery:()=>x});var r=s(3172),i=s(70586),n=s(17452),o=s(33955),a=s(38581),h=s(66677),c=s(45178),u=s(28694),l=s(99306);const d="Layer does not support extent calculation.";function p(e,t,s=!1){const r=e.geometry,n=e.toJSON(),a=n,h=e.outSpatialReference;let c,u;if((0,i.pC)(r)){if(c=r.spatialReference,u=r.spatialReference.wkid||JSON.stringify(r.spatialReference),a.geometryType=(0,o.Ji)(r),s&&"extent"===r.type)a.geometry=`${r.xmin},${r.ymin},${r.xmax},${r.ymax}`;else if(s&&"point"===r.type)a.geometry=`${r.x},${r.y}`;else{const e=r.toJSON();delete e.spatialReference,a.geometry=JSON.stringify(e)}a.inSR=u}if(c||(c=h),n.groupByFieldsForStatistics&&(a.groupByFieldsForStatistics=n.groupByFieldsForStatistics.join(",")),n.objectIds&&(a.objectIds=n.objectIds.join(",")),n.orderByFields&&(a.orderByFields=n.orderByFields.join(",")),!n.outFields||!n.returnDistinctValues&&(null!=t&&t.returnCountOnly||null!=t&&t.returnExtentOnly||null!=t&&t.returnIdsOnly)?delete a.outFields:-1!==n.outFields.indexOf("*")?a.outFields="*":a.outFields=n.outFields.join(","),n.outSR?a.outSR=n.outSR.wkid||JSON.stringify(n.outSR):r&&(n.returnGeometry||n.returnCentroid)&&(a.outSR=a.inSR),n.returnGeometry&&delete n.returnGeometry,n.outStatistics&&(a.outStatistics=JSON.stringify(n.outStatistics)),n.pixelSize&&(a.pixelSize=JSON.stringify(n.pixelSize)),n.quantizationParameters&&(s&&(0,i.pC)(c)&&(0,i.pC)(e.quantizationParameters)&&(0,i.pC)(e.quantizationParameters.extent)&&c.equals(e.quantizationParameters.extent.spatialReference)&&delete n.quantizationParameters.extent.spatialReference,a.quantizationParameters=JSON.stringify(n.quantizationParameters)),n.parameterValues&&(a.parameterValues=JSON.stringify(n.parameterValues)),n.rangeValues&&(a.rangeValues=JSON.stringify(n.rangeValues)),n.dynamicDataSource&&(a.layer=JSON.stringify({source:n.dynamicDataSource}),delete n.dynamicDataSource),n.timeExtent){const e=n.timeExtent,{start:t,end:s}=e;null==t&&null==s||(a.time=t===s?t:`${null==t?"null":t},${null==s?"null":s}`),delete n.timeExtent}return a}async function g(e,t,s,r){const n=(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await x(e,t,"json",r);return(0,u.p)(t,s,n.data),n}async function _(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),o=n;return o.data=(0,c.C)(n.data,s),o}function f(e,t,s){return x(e,t,"pbf",s)}function m(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):x(e,t,"json",s,{returnIdsOnly:!0})}function y(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):x(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function I(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):x(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(d);if(t.hasOwnProperty("count"))throw new Error(d);return e}))}function x(e,t,s,o={},c={}){const u="string"==typeof e?(0,n.mN)(e):e,d=t.geometry?[t.geometry]:[];return o.responseType="pbf"===s?"array-buffer":"json",(0,a.aX)(d,null,o).then((e=>{const a=e&&e[0];(0,i.pC)(a)&&((t=t.clone()).geometry=a);const d=(0,h.M8)(u.path),g=(0,l.A)({...u.query,f:s,...c,...p(t,c,d)});return(0,r.default)((0,n.v_)(u.path,"query"),{...o,query:{...g,...o.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)}},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})},61027:(e,t,s)=>{s.d(t,{_I:()=>r,xp:()=>o,PX:()=>n,QS:()=>l,KS:()=>c,jL:()=>h,vs:()=>a,nE:()=>u});const r=8388607,i=8388608,n=0,o=1,a=e=>(e&i)>>>23,h=e=>e&r,c=e=>a(e)===o?254:255;function u(e){return a(e)===o}function l(e,t){return((t?i:0)|e)>>>0}},29996:(e,t,s)=>{s.d(t,{ws:()=>E,xV:()=>A,UK:()=>k,$_:()=>C,nU:()=>M,hj:()=>F});var r=s(20102),i=s(92604),n=(s(22021),s(95648)),o=(s(37720),s(66039)),a=s(71143);class h{constructor(){this.color=[0,0,0,0],this.haloColor=[0,0,0,0],this.haloSize=0,this.size=12,this.angle=0,this.offsetX=0,this.offsetY=0,this.hAnchor=0,this.vAnchor=0}acquire(e,t,s,r,i,n,o,a,h){this.color=e,this.haloColor=t,this.haloSize=s,this.size=r,this.angle=i,this.offsetX=n,this.offsetY=o,this.hAnchor=a,this.vAnchor=h}release(){this.color[0]=this.color[1]=this.color[2]=this.color[3]=0,this.haloColor[0]=this.haloColor[1]=this.haloColor[2]=this.haloColor[3]=0,this.haloSize=0,this.size=0,this.angle=0,this.offsetX=0,this.offsetY=0,this.hAnchor=0,this.vAnchor=0}}h.pool=new a.Z(h);var c=s(35371);s(75656);const u=i.Z.getLogger("esri.views.2d.engine.webgl.Utils"),l="geometry",d=[{name:l,strideInBytes:32}],p=[{name:l,strideInBytes:20}],g=[{name:l,strideInBytes:12}],_=[{name:l,strideInBytes:40}],f=[{name:l,strideInBytes:36}],m=[{name:l,strideInBytes:36}];function y(e){const t={};for(const s of e)t[s.name]=s.strideInBytes;return t}const I=y([{name:l,strideInBytes:36}]),x=y(d),b=y(p),w=y(g),v=y(_),S=y(f),T=y(m);function C(e,{fill:t}){switch(e){case o.LW.MARKER:return I;case o.LW.FILL:return"dot-density"===t?w:"simple"===t?b:x;case o.LW.LINE:return v;case o.LW.TEXT:return S;case o.LW.LABEL:return T}}function F(e){return"number"==typeof e}function E(e){switch(e){case"butt":return n.RL.BUTT;case"round":return n.RL.ROUND;case"square":return n.RL.SQUARE;default:return u.error(new r.Z("mapview-invalid-type",`Cap type ${e} is not a valid option. Defaulting to round`)),n.RL.ROUND}}function A(e){switch(e){case"miter":return n.AH.MITER;case"bevel":return n.AH.BEVEL;case"round":return n.AH.ROUND;default:return u.error(new r.Z("mapview-invalid-type",`Join type ${e} is not a valid option. Defaulting to round`)),n.AH.ROUND}}function M(e){switch(e){case"opacity":return o.pc.OPACITY;case"color":return o.pc.COLOR;case"rotation":return o.pc.ROTATION;case"size":return o.pc.SIZE;default:return u.error(`Cannot interpret unknown vv: ${e}`),null}}function k(e){switch(e){case c.Br.UNSIGNED_BYTE:return Uint8Array;case c.Br.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case c.Br.FLOAT:return Float32Array;default:return void u.error(new r.Z("webgl-utils",`Unable to handle type ${e}`))}}c.l1.STATIC_DRAW,new Map},37720:(e,t,s)=>{s.d(t,{t2:()=>i,aH:()=>n});var r=s(12142);function i(e){if(!e)return 0;const{r:t,g:s,b:i,a:n}=e;return(0,r.Jz)(t*n,s*n,i*n,255*n)}function n(e){if(!e)return 0;const[t,s,i,n]=e;return(0,r.Jz)(t*(n/255),s*(n/255),i*(n/255),n)}},66039:(e,t,s)=>{var r,i,n,o,a,h,c;s.d(t,{pc:()=>o,LW:()=>r,X:()=>a,mf:()=>h}),function(e){e[e.FILL=0]="FILL",e[e.LINE=1]="LINE",e[e.MARKER=2]="MARKER",e[e.TEXT=3]="TEXT",e[e.LABEL=4]="LABEL"}(r||(r={})),function(e){e[e.SUCCEEDED=0]="SUCCEEDED",e[e.FAILED_OUT_OF_MEMORY=1]="FAILED_OUT_OF_MEMORY"}(i||(i={})),function(e){e[e.NONE=0]="NONE",e[e.MAP=1]="MAP",e[e.LABEL=2]="LABEL",e[e.LABEL_ALPHA=4]="LABEL_ALPHA",e[e.HITTEST=8]="HITTEST",e[e.HIGHLIGHT=16]="HIGHLIGHT",e[e.CLIP=32]="CLIP",e[e.DEBUG=64]="DEBUG",e[e.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(n||(n={})),function(e){e[e.SIZE=0]="SIZE",e[e.COLOR=1]="COLOR",e[e.OPACITY=2]="OPACITY",e[e.ROTATION=3]="ROTATION"}(o||(o={})),function(e){e[e.NONE=0]="NONE",e[e.OPACITY=1]="OPACITY",e[e.COLOR=2]="COLOR",e[e.ROTATION=4]="ROTATION",e[e.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",e[e.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",e[e.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",e[e.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(a||(a={})),function(e){e[e.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",e[e.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",e[e.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",e[e.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(h||(h={})),function(e){e[e.SPRITE=0]="SPRITE",e[e.GLYPH=1]="GLYPH"}(c||(c={}))},12142:(e,t,s)=>{s.d(t,{UJ:()=>i,Jz:()=>n});const r=new Float32Array(1);function i(e,t){return 65535&e|t<<16}function n(e,t,s,r){return 255&e|(255&t)<<8|(255&s)<<16|r<<24}new Uint32Array(r.buffer)},40660:(e,t,s)=>{s.d(t,{a:()=>h});var r=s(20102),i=s(92604),n=s(66039),o=s(29996);const a=i.Z.getLogger("esri.views.2d.engine.webgl");function h(e){return(0,o.hj)(e.minDataValue)&&(0,o.hj)(e.maxDataValue)&&null!=e.minSize&&null!=e.maxSize?n.X.SIZE_MINMAX_VALUE:(e.expression&&"view.scale"===e.expression||e.valueExpression&&"$view.scale"===e.valueExpression)&&Array.isArray(e.stops)?n.X.SIZE_SCALE_STOPS:(null!=e.field||e.expression&&"view.scale"!==e.expression||e.valueExpression&&"$view.scale"!==e.valueExpression)&&(Array.isArray(e.stops)||"levels"in e&&e.levels)?n.X.SIZE_FIELD_STOPS:(null!=e.field||e.expression&&"view.scale"!==e.expression||e.valueExpression&&"$view.scale"!==e.valueExpression)&&null!=e.valueUnit?n.X.SIZE_UNIT_VALUE:(a.error(new r.Z("mapview-bad-type","Found invalid size VisualVariable",e)),n.X.NONE)}},74259:(e,t,s)=>{s.d(t,{p:()=>g,k:()=>p});var r=s(8557),i=s(32448),n=(s(80442),s(70586)),o=s(96794),a=s(60437),h=s(59999),c=s(61800);function u(e,t){return e<<16|t}function l(e){return(4294901760&e)>>>16}function d(e){return 65535&e}const p={getObjectId:e=>e.getObjectId(),getAttributes:e=>e.readAttributes(),getAttribute:(e,t)=>e.readAttribute(t),cloneWithGeometry:(e,t)=>e,getGeometry:e=>e.readHydratedGeometry(),getCentroid:(e,t)=>e.readCentroid()};class g extends h.J{constructor(e,t,s){super(e,t),this.featureAdapter=p,this.events=new i.Z,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new r.Z(50),this._index=(0,o.r)(9,(e=>({minX:this._storage.getXMin(e),minY:this._storage.getYMin(e),maxX:this._storage.getXMax(e),maxY:this._storage.getYMax(e)}))),this._storage=t,this.mode=s}get storage(){return this._storage}get storeStatistics(){let e=0,t=0,s=0;return this.forEach((r=>{const i=r.readGeometry();i&&(t+=i.isPoint?1:i.lengths.reduce(((e,t)=>e+t),0),s+=i.isPoint?1:i.lengths.length,e+=1)})),{featureCount:e,vertexCount:t,ringCount:s}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,t){if((0,n.Wi)(t.addOrUpdate))return t;if(t.addOrUpdate.attachStorage(this._storage),"snapshot"===this.mode){const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this.setComputedAttributes(this._storage,s,t,e.scale)}return t}this._featureSetsByInstance.set(t.addOrUpdate.instance,t.addOrUpdate);const s=t.addOrUpdate.getCursor();for(;s.next();)this._insertFeature(s,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),t}search(e){this._rebuildIndex();const t=e.id,s=this._indexSearchCache.find((e=>e.tileId===t));if((0,n.pC)(s))return s.readers;const r=new Map,i=this._searchIndex(e.bounds),o=[];for(const e of i){const t=this._storage.getInstanceId(e),s=l(t),i=d(t);r.has(s)||r.set(s,[]),r.get(s).push(i)}return r.forEach(((e,t)=>{const s=this._featureSetsByInstance.get(t);o.push(c.t.from(s,e))})),this._indexSearchCache.enqueue({tileId:t,readers:o}),o}insert(e){const t=e.getCursor(),s=this._storage;for(;t.next();){var r;const e=u(t.instance,t.getIndex()),i=t.getObjectId(),n=null!=(r=this._objectIdToDisplayId.get(i))?r:this._storage.createDisplayId();t.setDisplayId(n),s.setInstanceId(n,e),this._objectIdToDisplayId.set(i,n)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const t=this._objectIdToDisplayId.get(e);if(!t)return;const s=this._storage.getInstanceId(t),r=d(s),i=l(s),n=this._featureSetsByInstance.get(i);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(t),n.removeAtIndex(r),n.isEmpty&&this._featureSetsByInstance.delete(i),this._spatialIndexInvalid=!0}forEach(e){this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t),r=this._lookupFeature(s);e(r)}))}forEachUnsafe(e){this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t),r=l(s),i=d(s),n=this._getFeatureSet(r);n.setIndex(i),e(n)}))}forEachInBounds(e,t){const s=this._searchIndex(e);for(const e of s){const s=this.lookupFeatureByDisplayId(e,this._storage);t((0,n.Wg)(s))}}forEachBounds(e,t,s){this._rebuildIndex();const r=[0,0,0,0];for(const i of e){if(!i.readGeometry())continue;const e=i.getDisplayId();r[0]=this._storage.getXMin(e),r[1]=this._storage.getYMin(e),r[2]=this._storage.getXMax(e),r[3]=this._storage.getYMax(e),t((0,a.JR)(s,r))}}sweepFeatures(e,t,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach(((r,i)=>{e.has(r)||(t.releaseDisplayId(r),s&&s.unsetAttributeData(r),this._objectIdToDisplayId.delete(i))})),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach(((t,s)=>{e.has(s)||this._featureSetsByInstance.delete(s)}))}lookupObjectId(e,t){const s=this.lookupFeatureByDisplayId(e,t);return(0,n.Wi)(s)?null:s.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,t){const s=t.getInstanceId(e);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(e){const t=this._storage.getInstanceId(e),s=l(t),r=d(t),i=this._getFeatureSet(s);return i?(i.setIndex(r),i):null}_insertFeature(e,t){const s=this._storage,r=e.getObjectId(),i=u(e.instance,e.getIndex());s.getInstanceId(e.getDisplayId());let n=this._objectIdToDisplayId.get(r);n||(n=s.createDisplayId(),this._objectIdToDisplayId.set(r,n),this._spatialIndexInvalid=!0),e.setDisplayId(n),s.setInstanceId(n,i),this.setComputedAttributes(s,e,n,t)}_searchIndex(e){this._rebuildIndex();const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const e=[];"snapshot"===this.mode?this._featureSetsByInstance.forEach((t=>{const s=t.getCursor();for(;s.next();){const t=s.getDisplayId();this._storage.setBounds(t,s)&&e.push(t)}})):this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t);this._storage.setBounds(t,this._lookupFeature(s))&&e.push(t)})),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const t=l(e),s=d(e),r=this._getFeatureSet(t);if(!r)return null;const i=r.getCursor();return i.setIndex(s),i}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}}},97783:(e,t,s)=>{s.r(t),s.d(t,{default:()=>vt,getInstances:()=>bt});var r=s(43697),i=s(3920),n=s(80442),o=s(5600),a=(s(67676),s(75215),s(52011)),h=s(11145),c=s(70586),u=s(95330),l=s(43050),d=s(98732),p=s(7673),g=s(99514),_=s(61027),f=s(74259),m=s(66677),y=s(3172),I=s(20102),x=s(92604),b=s(80903),w=s(82397),v=s(16467),S=s(34599),T=s(70272),C=s(87554);class F extends C.s{constructor(e,t,s){super(e),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=s,this._features=t}static fromFeatures(e,t,s){const r=(0,d.Yn)([],e,t,!1,!1,s);for(let t=0;t<r.length;t++)r[t].displayId=e[t].displayId;return F.fromOptimizedFeatures(r,t)}static fromFeatureSet(e,t){const s=(0,d.h_)(e,t);return F.fromOptimizedFeatureSet(s)}static fromOptimizedFeatureSet(e){const{features:t,geometryType:s}=e,r=F.fromOptimizedFeatures(t,s);r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform;for(const t of e.fields)"esriFieldTypeDate"===t.type&&r._dateFields.add(t.name);return r}static fromOptimizedFeatures(e,t,s){const r=C.s.createInstance(),i=new F(r,e,t);return i._transform=s,i}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(e){const t=new Set(e);this._features=this._features.filter((e=>!t.has(e.objectId)))}append(e){for(const t of e)this._features.push(t)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}getGroupId(){return this._current.groupId}setGroupId(e){this._current.groupId=e}copy(){const e=new F(this.instance,this._features,this.geometryType);return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return(0,d.EI)(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const e=this.readGeometry();return(0,d.di)(e,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return(0,c.Wi)(e)?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return(0,T.S6)(this._current)?(0,d.lz)(this._current.geometry,2):0}readUnquantizedGeometry(){const e=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!e)return e;const t=e.clone();return function({coords:e,lengths:t}){let s=0;for(const r of t){for(let t=1;t<r;t++)e[2*(s+t)]+=e[2*(s+t)-2],e[2*(s+t)+1]+=e[2*(s+t)-1];s+=r}}(t),t}readHydratedGeometry(){const e=this._current.geometry;if((0,c.Wi)(e))return null;const t=e.clone();return(0,c.pC)(this._transform)&&(0,d.$g)(t,t,this.hasZ,this.hasM,this._transform),t}getXHydrated(){if(!(0,T.S6)(this._current))return 0;const e=this._current.geometry.coords[0],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){if(!(0,T.S6)(this._current))return 0;const e=this._current.geometry.coords[1],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:t.translate[1]-e*t.scale[1]}getX(){return(0,T.S6)(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return(0,T.S6)(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!(0,T.S6)(this._current))return null;const e=this._current.geometry.clone();if(e.isPoint)return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sy+this._ty,e;let t=0;for(const s of e.lengths)e.coords[2*t]=e.coords[2*t]*this._sx+this._tx,e.coords[2*t+1]=e.coords[2*t+1]*this._sy+this._ty,t+=s;return e}readCentroid(){if(!(0,T.S6)(this._current))return null;if(!this._current.centroid){const e=this._computeCentroid();if(!e)return null;e.coords[0]=(e.coords[0]-this._tx)/this._sx,e.coords[1]=(e.coords[1]-this._ty)/this._sy,this._current.centroid=e}const e=this._current.centroid.clone();return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sx+this._ty,e}_readAttribute(e,t){const s=this._current.attributes[e];if(void 0!==s)return null!=s&&t&&this._dateFields.has(e)?new Date(s):s;const r=this.readAttributes(),i=e.toLocaleLowerCase().trim();for(const e in r)if(e.toLocaleLowerCase().trim()===i){const s=this._current.attributes[e];return null!=s&&t&&this._dateFields.has(e)?new Date(s):s}}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}var E=s(45091),A=s(5428),M=s(77863);const k=268435455;class R{constructor(){this.fieldMap=new Map,this.fields=[],this.hasFeatures=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}hasField(e){return this.fieldMap.has(e)}isDateField(e){var t;return null==(t=this.fieldMap.get(e))?void 0:t.isDate}getFieldIndex(e){var t;return null==(t=this.fieldMap.get(e))?void 0:t.index}}function O(e){const t=e.getLength(),s=e.pos()+t,r={name:"",isDate:!1};for(;e.pos()<s&&e.next();)switch(e.tag()){case 1:r.name=e.getString();break;case 2:"esriFieldTypeDate"===(0,M.O7)(e.getEnum())&&(r.isDate=!0);break;default:e.skip()}return r}function L(e){return e.toLowerCase().trim()}function P(e,t,s=!1){const r=e.pos(),i=new R;let n=0,o=0,a=null,h=null,c=null,u=!1;for(;e.next();)switch(e.tag()){case 1:a=e.getString();break;case 3:h=e.getString();break;case 12:c=e.processMessage(M.G$);break;case 9:if(i.exceededTransferLimit=e.getBool(),i.exceededTransferLimit){i.offsets.geometry=s?new Float64Array(8e3):new Int32Array(8e3),i.centroid=s?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<i.centroid.length;e++)i.centroid[e]=k}break;case 13:{const t=O(e),s=t.name,r=L(t.name),o={fieldName:s,index:n++,isDate:t.isDate};i.fields.push(o),i.fieldMap.set(t.name,o),i.fieldMap.set(r,o);break}case 15:{const r=e.getLength(),a=e.pos()+r;if(!i.exceededTransferLimit){const e=i.offsets.geometry,t=i.centroid;e.push(0),t.push(k),t.push(k)}!u&&i.exceededTransferLimit&&(u=!0,i.offsets.attributes=s?new Float64Array(8e3*n):new Uint32Array(8e3*n));let h=o*n;for(;e.pos()<a&&e.next();)switch(e.tag()){case 1:{u?i.offsets.attributes[h++]=e.pos():i.offsets.attributes.push(e.pos());const t=e.getLength();e.skipLen(t);break}case 2:if(t){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 3:{e.getUInt32();const t=e.getSInt64(),s=e.getSInt64();i.centroid[2*o]=t,i.centroid[2*o+1]=s;break}default:e.skip()}}else{i.offsets.geometry[o]=e.pos();const t=e.getLength();i.vertexCount+=t,e.skipLen(t)}break;case 4:{const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 3:{e.getUInt32();const t=e.getSInt64(),s=e.getSInt64();i.centroid[2*o]=t,i.centroid[2*o+1]=s;break}default:e.skip()}break}default:e.skip()}o++,i.hasFeatures=!0;break}default:e.skip()}const l=a||h;if(!l)throw new I.Z("FeatureSet has no objectId or globalId field name");return i.featureCount=o,i.fieldCount=n,i.objectIdFieldIndex=i.getFieldIndex(l),i.transform=c,i.displayIds=new Uint32Array(i.featureCount),i.groupIds=new Uint16Array(i.featureCount),e.move(r),i}const N=x.Z.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF"),U=268435455,D=128e3,q={small:{delta:new Int32Array(128),decoded:new Int32Array(128)},large:{delta:new Int32Array(D),decoded:new Int32Array(D)}};function B(e){return e<=q.small.delta.length?q.small:(e<=q.large.delta.length||(q.large.delta=new Int32Array(Math.round(1.25*e)),q.large.decoded=new Int32Array(Math.round(1.25*e))),q.large)}function z(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function G(e,t,s,r,i,n){return.5*Math.abs(e*r+s*n+i*t-e*n-s*t-i*r)}function Z(e,t,s,r){return 0==e*r-s*t&&e*s+t*r>0}class j extends C.s{constructor(e,t,s,r){super(e),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._geometryType=r,this._reader=t,this._header=s,this._hasNext=s.hasFeatures,this._isPoints="esriGeometryPoint"===r}static fromBuffer(e,t,s=!1){const r=function(e){try{const t=2,s=new E.Z(new Uint8Array(e),new DataView(e));for(;s.next();){if(s.tag()===t)return z(s.getMessage());s.skip()}}catch(e){const t=new I.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e});N.error(t)}return null}(e),i=P(r,"esriGeometryPoint"===t,s),n=C.s.createInstance();return new j(n,r,i,t)}get geometryType(){return this._geometryType}get size(){return this._header.featureCount}get hasZ(){return!1}get hasM(){return!1}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this.size}getQuantizationTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";return this._header.fields.forEach((({index:t})=>{e+=this._readAttributeAtIndex(t)+"."})),e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}getGroupId(){return this._header.groupIds[this._featureIndex]}setGroupId(e){this._header.groupIds[this._featureIndex]=e}readLegacyFeature(){if(void 0===this._cache.legacyFeature){var e;const t=this.readCentroid(),s={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:null!=(e=t&&{x:t.coords[0],y:t.coords[1]})?e:null};return this._cache.legacyFeature=s,s}return this._cache.legacyFeature}readOptimizedFeature(){if(void 0===this._cache.optFeature){const e=new T.ZP(this.readGeometry(),this.readAttributes(),this.readCentroid());return e.objectId=this.getObjectId(),e.displayId=this.getDisplayId(),this._cache.optFeature=e,e}return this._cache.optFeature}getXHydrated(){const e=this._header.centroid[2*this._featureIndex],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:t.translate[1]-e*t.scale[1]}getX(){return this._header.centroid[2*this._featureIndex]*this._sx+this._tx}getY(){return this._header.centroid[2*this._featureIndex+1]*this._sy+this._ty}readLegacyPointGeometry(){return{x:this.getX(),y:this.getY()}}readLegacyGeometry(e){const t=this.readGeometry(e);return(0,d.di)(t,this.geometryType,!1,!1)}readLegacyCentroid(){const e=this.readCentroid();if(!e)return null;const[t,s]=e.coords;return{x:t,y:s}}readGeometryArea(){return this._cache.area||this.readGeometry(!0),this._cache.area}readUnquantizedGeometry(e=!1){if(void 0===this._cache.unquantGeometry){const t=this.readGeometry(e);if(!t)return this._cache.unquantGeometry=null,null;const s=B(t.coords.length).decoded,r=t.clone(s),i=r.coords;let n=0;for(const e of r.lengths){for(let t=1;t<e;t++){const e=2*(n+t),s=2*(n+t-1);i[e]+=i[s],i[e+1]+=i[s+1]}n+=e}return this._cache.unquantGeometry=r,r}return this._cache.unquantGeometry}readHydratedGeometry(){if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===U)return null;const e=this.getXHydrated(),t=this.getYHydrated();return new A.Z([],[e,t])}const e=this.readGeometry();if(!e)return null;const t=e.clone(),s=this.getQuantizationTransform();return(0,c.pC)(s)&&(0,d.$g)(t,t,this.hasZ,this.hasM,s),t}readGeometry(e=!1){if(void 0===this._cache.geometry){let t=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===U)return null;const e=this.getX(),s=this.getY();t=new A.Z([],[e,s])}else{const s=this._header.offsets.geometry[this._featureIndex],r=this._reader;if(0===s)return null;r.move(s);try{t=e?this._parseGeometryForDisplay(r):this._parseGeometry(r)}catch(e){return console.error("Failed to parse geometry!",e),null}}return this._cache.geometry=t,t}return this._cache.geometry}readCentroid(){if(void 0===this._cache.centroid){let e=null;const t=this._header.centroid[2*this._featureIndex]+this._tx,s=this._header.centroid[2*this._featureIndex+1]+this._ty;return t===U?(e=this._computeCentroid(),e&&(this._header.centroid[2*this._featureIndex]=e.coords[0]-this._tx,this._header.centroid[2*this._featureIndex+1]=e.coords[1]-this._ty)):e=new A.Z([],[t,s]),this._cache.centroid=e,e}return this._cache.centroid}copy(){const e=this._reader.clone(),t=new j(this.instance,e,this._header,this.geometryType);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndex<this.size&&!this._getExists(););return this._featureIndex<this.size}_readAttribute(e,t){const s=this._header.hasField(e)?e:function(e){return e.toLowerCase().trim()}(e),r=this._header.getFieldIndex(s);if(null==r)return;const i=this._readAttributeAtIndex(r);return t?null==i?i:this._header.isDateField(s)?new Date(i):i:i}_readAttributes(){const e={};return this._header.fields.forEach((({fieldName:t,index:s})=>{e[t]=this._readAttributeAtIndex(s)})),e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext}_readAttributeAtIndex(e){const t=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;return s.move(t),function(e){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&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}(s)}_parseGeometry(e){const t=e.getLength(),s=e.pos()+t,r=[],i=[];for(;e.pos()<s&&e.next();)switch(e.tag()){case 2:{const t=e.getUInt32(),s=e.pos()+t;for(;e.pos()<s;)i.push(e.getUInt32());break}case 3:{const t=e.getUInt32(),s=e.pos()+t;for(r.push(e.getSInt32()+this._tx),r.push(e.getSInt32()+this._ty),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();e.pos()<s;)r.push(e.getSInt32()),r.push(e.getSInt32()),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();break}default:e.skip()}return new A.Z(i,r)}_parseGeometryForDisplay(e){const t=e.getLength(),s=e.pos()+t,r=[],i=[];let n=0,o=0,a=null,h=0;const c="esriGeometryPolygon"===this.geometryType;for(;e.pos()<s&&e.next();)switch(e.tag()){case 2:{const t=e.getUInt32(),s=e.pos()+t;for(;e.pos()<s;){const t=e.getUInt32();r.push(t),n+=t}a=B(2*n).delta;break}case 3:{e.getUInt32();const t=2+(this.hasZ?1:0)+(this.hasM?1:0);for(const s of r)if(o+t*s>a.length)for(let t=0;t<s;t++)e.getSInt32(),e.getSInt32(),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();else if(c){const t=this.getAreaSimplificationThreshold(s,this._header.vertexCount);let r=2,n=1;const c=!1;let u=e.getSInt32(),l=e.getSInt32();a[o++]=u,a[o++]=l,this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();let d=e.getSInt32(),p=e.getSInt32();for(this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();r<s;){let s=e.getSInt32(),i=e.getSInt32();this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();const c=u+d,g=l+p;G(u,l,c,g,c+s,g+i)>=t?(h+=-.5*(c-u)*(g+l),n>1&&Z(a[o-2],a[o-1],d,p)?(a[o-2]+=d,a[o-1]+=p):(a[o++]=d,a[o++]=p,n++),u=c,l=g):(s+=d,i+=p),d=s,p=i,r++}n<3||c?o-=2*n:(h+=-.5*(u+d-u)*(l+p+l),Z(a[o-2],a[o-1],d,p)?(a[o-2]+=d,a[o-1]+=p,i.push(n)):(a[o++]=d,a[o++]=p,i.push(++n)))}else{let t=0,r=e.getSInt32(),n=e.getSInt32();this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32(),a[o++]=r,a[o++]=n,t+=1;for(let i=1;i<s;i++){const s=e.getSInt32(),c=e.getSInt32(),u=r+s,l=n+c;h+=-.5*(u-r)*(l+n),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32(),i>2&&Z(a[o-2],a[o-1],s,c)?(a[o-2]+=s,a[o-1]+=c):(a[o++]=s,a[o++]=c,t+=1),r=u,n=l}i.push(t)}break}default:e.skip()}if(this._cache.area=h,!i.length)return null;if(this._tx||this._ty){let e=0;for(const t of i)a[2*e]+=this._tx,a[2*e+1]+=this._ty,e+=t}return new A.Z(i,a)}}class X{constructor(e){this.service=e}destroy(){}}class W extends X{constructor(e){super(e),this._portsOpen=async function(e){const t=new b.Z;return await t.open(e,{}),t}(e.source).then((e=>this.client=e))}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const s=await this.client.invoke("queryFeatures",e.toJSON(),t);return F.fromFeatureSet(s,this.service.objectIdField)}}class Y extends X{async executeQuery(e,t){const{data:s}=await(0,S.executeQueryPBFBuffer)(this.service.source,e,t),r=!e.quantizationParameters;return j.fromBuffer(s,this.service.geometryType,r)}}class V extends X{async executeQuery(e,t){const{source:s,capabilities:r,spatialReference:i,objectIdField:n,geometryType:o}=this.service;if((0,c.pC)(e.quantizationParameters)&&!r.query.supportsQuantization){const r=e.clone(),o=(0,w.vY)((0,c.Wg)(r.quantizationParameters));r.quantizationParameters=null;const{data:a}=await(0,S.executeQuery)(s,r,i,t),h=(0,d.h_)(a,n);return(0,d.RZ)(o,h),F.fromOptimizedFeatureSet(h)}const{data:a}=await(0,S.executeQuery)(s,e,this.service.spatialReference,t);var h;return"esriGeometryPoint"===o&&(a.features=null==(h=a.features)?void 0:h.filter((e=>{if((0,c.pC)(e.geometry)){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0}))),F.fromFeatureSet(a,this.service.objectIdField)}}class H extends X{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const s=e.clone(),r=(0,w.vY)((0,c.Wg)(s.quantizationParameters));s.quantizationParameters=null;const i=await(0,v.WW)(this.service.source,e,t);return(0,d.RZ)(r,i),F.fromOptimizedFeatureSet(i)}const r=await(0,v.WW)(this.service.source,e,t);return F.fromOptimizedFeatureSet(r)}}var Q=s(92835),$=s(32448),J=s(22862),K=s(57444),ee=s(8557);class te{constructor(){this.source=!1,this.targets={feature:!1,aggregate:!1},this.storage={filters:!1,data:!1},this.mesh=!1,this.queryFilter=!1,this.why={mesh:[],source:[]}}static create(e){const t=new te;for(const s in e){const r=e[s];if("object"==typeof r)for(const e in r){const i=r[e];t[s][e]=i}t[s]=r}return t}static empty(){return te.create({})}static all(){return te.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){e.source&&(this.source=!1),e.targets.feature&&(this.targets.feature=!1),e.targets.aggregate&&(this.targets.aggregate=!1),e.storage.filters&&(this.storage.filters=!1),e.storage.data&&(this.storage.data=!1),e.mesh&&(this.mesh=!1),e.queryFilter&&(this.queryFilter=!1)}any(){return this.source||this.mesh||this.storage.filters||this.storage.data||this.targets.feature||this.targets.aggregate||this.queryFilter}describe(){let e=0,t="";if(this.mesh){e+=20,t+="-> (20) Mesh needs update\n";for(const e of this.why.mesh)t+=` + ${e}\n`}if(this.source){e+=10,t+="-> (10) The source needs update\n";for(const e of this.why.source)t+=` + ${e}\n`}this.targets.feature&&(e+=5,t+="-> (5) Feature target parameters changed\n"),this.storage.filters&&(e+=5,t+="-> (5) Feature filter parameters changed\n"),this.targets.aggregate&&(e+=4,t+="-> (4) Aggregate target parameters changed\n"),this.storage.data&&(e+=1,t+="-> (1) Texture storage parameters changed");const s=e<5?"Fastest":e<10?"Fast":e<15?"Moderate":e<20?"Slow":"Very Slow";console.debug(`Applying ${s} update of cost ${e}/45 `),console.debug(t)}toJSON(){return{queryFilter:this.queryFilter,source:this.source,targets:this.targets,storage:this.storage,mesh:this.mesh}}}class se{constructor(e){this.requests={done:new Array,stream:new ee.Z(10)},this._edits=null,this._abortController=new AbortController,this._done=!1,this.didSend=!1,this.tile=e}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length}get edits(){return this._edits}get done(){return this._done}end(){this._done=!0}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach((t=>t.message.status.unset(e))),(0,c.pC)(this._edits)&&this._edits.status.unset(e)}add(e){var t;e.message.status=null!=(t=e.message.status)?t:te.empty(),e.message.end&&this.requests.done.forEach((e=>{(0,c.pC)(e.message)&&e.message.end&&(e.message.end=!1)})),this.requests.done.push(e)}edit(e,t){const s=e.getQuantizationTransform(),r=e.geometryType,i=Array.from(e.features()),n=[...t,...i.map((e=>e.objectId))];this.removeIds(n),this._invalidate(),(0,c.Wi)(this._edits)?this._edits={type:"append",addOrUpdate:F.fromOptimizedFeatures(i,r,(0,c.Wg)(s)),id:this.tile.id,status:te.empty(),end:!0}:(this.requests.done.forEach((e=>e.message.end=!1)),(0,c.Wg)(this._edits.addOrUpdate).append(e.features()))}*readers(){for(const{message:e}of this.requests.done)(0,c.pC)(e.addOrUpdate)&&(yield e.addOrUpdate);(0,c.pC)(this._edits)&&(0,c.pC)(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=te.empty();(0,c.pC)(this._edits)&&(this._edits.status=te.empty())}removeIds(e){this._invalidate();for(const{message:t}of this.requests.done){const s=t.addOrUpdate;(0,c.pC)(s)&&(s.removeIds(e),s.isEmpty&&(t.addOrUpdate=null))}(0,c.pC)(this._edits)&&(0,c.pC)(this._edits.addOrUpdate)&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter((e=>e.message.addOrUpdate||e.message.end))}abort(){this._abortController.abort()}}class re{constructor(e){this.events=new $.Z,this._resolver=(0,u.hh)(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}destroy(){}async _onMessage(e){var t;const s=this._subscriptions.get(e.id);if(!s)return;const r={...e,remove:null!=(t=e.remove)?t:[],status:e.status};return this._onTileUpdateMessage(r,s.options)}update(e,t){var s;const r=t.fields.length;t.outFields=function(e,t){const s=new Set;return e&&e.forEach((e=>s.add(e))),t&&t.forEach((e=>s.add(e))),s.has("*")?["*"]:Array.from(s)}(null==(s=this._schema)?void 0:s.outFields,t.outFields),t.outFields=t.outFields.length>=.75*r?["*"]:t.outFields,t.outFields.sort();const i=(0,J.Hg)(this._schema,t);if(!i)return;(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - Source:",i);const o="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",a={returnCentroid:(0,n.Z)("esri-2d-query-centroid-enabled")&&"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:t.outFields,outSpatialReference:this._outSR,orderByFields:[o],where:t.definitionExpression||"1=1",gdbVersion:t.gdbVersion,historicMoment:t.historicMoment,timeExtent:Q.Z.fromJSON(t.timeExtent),customParameters:t.customParameters},h=this._schema&&(0,J.uD)(i,"outFields");this._schema&&(0,J.V7)(i,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(e.why.mesh.push("Layer filter and/or custom parameters changed"),e.why.source.push("Layer filter and/or custom parameters changed"),e.mesh=!0,e.source=!0,e.queryFilter=!0),h&&(e.why.source.push("Layer required fields changed"),e.source=!0),(0,J.Hg)(a,this._queryInfo)&&(this._queryInfo=a),this._schema=t,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(),void(this._didEdit=!1);this._subscriptions.forEach((t=>t.applyUpdate(e))),await this.resend()}refresh(){for(const e of this._tiles())this.unsubscribe(e),this.subscribe(e)}subscribe(e){const t=new se(e);this._subscriptions.set(e.id,t)}unsubscribe(e){const t=this.get(e.id);(0,c.pC)(t)&&t.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const t=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new K.Z({...this._queryInfo,historicMoment:t,...e})}get(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const t of e)yield t.tile}async edit(e,t){const s=Array.from(this._subscriptions.values()),r=s.map((({tile:e})=>e));for(const e of s)e.removeIds(t);if(e.length){const s=r.map((t=>{const s=this.createTileQuery(t);return s.objectIds=e,{tile:t,query:s}})).map((async({tile:e,query:t})=>({tile:e,result:await this.query(t),query:t}))),i=(await(0,u.WW)(s)).map((async({tile:s,result:r})=>{if(!r.hasFeatures&&!t.length&&!e.length)return;const i=this._subscriptions.get(s.key.id);i&&i.edit(r,e)}));await(0,u.as)(i)}this._didEdit=!0}}var ie=s(34084);const ne=x.Z.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource");class oe extends re{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=function(e){const{capabilities:t}=e;return(s=e.source)&&s.capabilities&&s.collection&&s.layerDefinition?new H(e):function(e){return Array.isArray(e.source)}(e)?new W(e):t.query.supportsFormatPBF&&(0,n.Z)("featurelayer-pbf")?new Y(e):new V(e);var s}(e.serviceInfo),this._queue=new ie.e({concurrency:8,process:async e=>{if((0,u.k_)(e),(0,c.pC)(e.tile)){const t=e.tile.key.id,{signal:s}=e,r=(0,n.Z)("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:s,query:{...r,...this._schema.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}}),this._patchQueue=new ie.e({concurrency:8,process:async e=>{if((0,u.k_)(e),(0,c.pC)(e.tile)){const t=e.tile.key.id,{signal:s}=e,r=(0,n.Z)("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:s,query:{...r,...this._schema.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}get updating(){return!!this._queue.length||Array.from(this._subscriptions.values()).some((e=>!e.done))}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?4:null}get maxPageSize(){var e;const{query:t}=this._serviceInfo.capabilities;return(null!=(e=t.maxRecordCount)?e:8e3)*(0,c.Pt)(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e){super.subscribe(e);const t=this._subscriptions.get(e.id);this._fetchDataTile(e).catch((t=>{(0,u.D_)(t)||ne.error(new I.Z("mapview-query-error","Encountered error when fetching tile",{tile:e,error:t}))})).then((()=>t.end()))}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e){return this._adapter.executeQuery(e,{query:this._schema.customParameters})}async queryLastEditDate(){const e=this._serviceInfo.source,t={...e.query,f:"json"};return(await(0,y.default)(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,t={}){var s;const r=this.createQuery(t);return r.quantizationParameters=null!=(s=t.quantizationParameters)?s:e.getQuantizationParameters(),r.resultType="tile",r.geometry=e.extent,r.quantizationParameters&&"esriGeometryPolyline"===this._serviceInfo.geometryType&&(r.maxAllowableOffset=e.resolution),r}async _executePatchQuery(e,t,s,r){const i=t.clone();i.outFields=[this._serviceInfo.objectIdField,...s],i.returnCentroid=!1,i.returnGeometry=!1;const n=(0,c.pC)(i.start)?i.start/8e3:0,o=r.signal;return this._patchQueue.push({tile:e,query:i,signal:o,depth:n})}async _resend(e,t){const{query:s,message:r}=e,i=(0,c.pC)(s.outFields)?s.outFields:[],n=this._queryInfo.outFields,o=n.filter((e=>-1===i.indexOf(e)));if((0,c.Wi)(r.addOrUpdate))this._onMessage({...r,type:"append"});else if(o.length)try{const e=this._subscriptions.get(r.id).tile,i=await this._executePatchQuery(e,s,o,t);(0,u.k_)(t),s.outFields=n,r.addOrUpdate.joinAttributes(i),this._onMessage({...r,end:r.end,type:"append"})}catch(e){}else this._onMessage({...r,type:"append"})}async _resendSubscription(e){if(e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const t=e.signal;for(const s of e.requests.done)await this._resend(s,{signal:t});return(0,c.pC)(e.edits)?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map((e=>this._resendSubscription(e))))}}const ae=(0,n.Z)("esri-mobile"),he={maxDrillLevel:ae?1:4,maxRecordCountFactor:ae?1:3};class ce extends oe{constructor(e){super(e)}async _fetchDataTile(e){const t=this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,s=this._subscriptions.get(e.key.id),r=s.signal,i=e.getQuantizationParameters();let n=0;const o=async(a,h)=>{const c=this._queryInfo,l=this.createTileQuery(a,{maxRecordCountFactor:t?he.maxRecordCountFactor:void 0,returnExceededLimitFeatures:!1,quantizationParameters:i});n++;try{const t=await this._queue.push({tile:e,query:l,signal:r,depth:h});if(n--,(0,u.k_)(r),!t)return;if(c!==this._queryInfo)return void o(a,h);if(t.exceededTransferLimit&&h<he.maxDrillLevel){for(const e of a.createChildTiles())o(e,h+1);return}const i={id:e.id,addOrUpdate:t,end:0===n,type:"append"};s.add({query:l,message:i}),this._onMessage(i)}catch(t){(0,u.D_)(t)||this._onMessage({id:e.id,addOrUpdate:null,end:!0,type:"append"})}};o(e,0)}}var ue=s(96794),le=s(22021);class de{constructor(e,t,s,r,i=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=r,this.store=e,this.objectIdField=t,this.purgeInterval=i,this._useGeneratedIds="__esri_stream_id__"===this.objectIdField}add(e){if(this._useGeneratedIds){const t=this._nextId();e.attributes[this.objectIdField]=t,e.objectId=t}else e.objectId=e.attributes[this.objectIdField];if(this._addOrUpdated.set(e.objectId,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return(0,c.Wi)(this._trackIdLessObservations)&&(this._trackIdLessObservations=new ee.Z(1e5)),void this._trackIdLessObservations.enqueue(e.objectId);const t=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(t)){const e=(0,c.pC)(this._purgeOptions)&&null!=this._purgeOptions.maxObservations?this._purgeOptions.maxObservations:1e3,s=(0,le.uZ)(e,0,1e3);this._trackIdToObservations.set(t,new ee.Z(s))}const s=this._trackIdToObservations.get(t).enqueue(e.objectId);(0,c.pC)(s)&&(this._addOrUpdated.has(s)?this._addOrUpdated.delete(s):this._removed.push(s))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),s=performance.now();s-this._lastPurge>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const r=[];if((0,c.pC)(t))for(const e of t){const t=this.store.removeById(e);(0,c.pC)(t)&&r.push(t)}if((0,c.pC)(e))for(const t of e)t.attributes.__esri_timestamp__=s,this.store.add(t);(e||r)&&this.store.update(e,r)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach((s=>e[t++]=s)),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;(0,c.pC)(t)&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField)for(const s of this._trackIdToObservations.values())if(t>e.displayCount&&s.size){const e=(0,c.Wg)(s.dequeue());this._removed.push(e),t--}if((0,c.pC)(this._trackIdLessObservations)){let s=t-e.displayCount;for(;s-- >0;){const e=this._trackIdLessObservations.dequeue();(0,c.pC)(e)&&this._removed.push(e)}}}}_purgeByAge(e){var t;if(!e.age||null==(t=this._timeInfo)||!t.startTimeField)return;const s=60*e.age*1e3,r=this._maxAge-s;this.store.forEach((e=>{e.attributes[this._timeInfo.startTimeField]<r&&this._removed.push(e.objectId)}))}_purgeByAgeReceived(e,t){if(!t.ageReceived)return;const s=e-60*t.ageReceived*1e3;this.store.forEach((e=>{e.attributes.__esri_timestamp__<s&&this._removed.push(e.objectId)}))}_purgeTracks(){this._trackIdToObservations.forEach(((e,t)=>{0===e.size&&this._trackIdToObservations.delete(t)}))}}s(66577);var pe=s(17452),ge=(s(37697),s(69285));let _e=class extends($.Z.EventedMixin(i.r)){onFeature(e){this.emit("feature",e)}};_e=(0,r._)([(0,a.j)("esri.layers.graphics.sources.connections.StreamConnection")],_e);const fe=_e,me=x.Z.getLogger("esri.layers.graphics.sources.connections.WebSocketConnection");var ye,Ie;(Ie=ye||(ye={}))[Ie.CONNECTING=0]="CONNECTING",Ie[Ie.OPEN=1]="OPEN",Ie[Ie.CLOSING=2]="CLOSING",Ie[Ie.CLOSED=3]="CLOSED";let xe=class extends fe{constructor(e){super(),this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._config=e,this._featureZScaler=(0,ge.k)(t,r,s),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){(0,c.pC)(this._websocket)&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if((0,c.Wi)(this._websocket))return"disconnected";switch(this._websocket.readyState){case ye.CONNECTING:case ye.OPEN:return"connected";case ye.CLOSING:case ye.CLOSED:return"disconnected"}}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,pe.fl)(e,this._config.customParameters);this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(r){const i=t/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(me.error(new I.Z("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(me.error(new I.Z("websocket-connection",`Failed to connect. Attempting to reconnect in ${i}s`,r)),await(0,u.e4)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_createWebSocket(e){return new Promise(((t,s)=>{const r=new WebSocket(e);r.onopen=()=>{if(r.onopen=null,this.destroyed)return r.onclose=null,void r.close();r.onclose=e=>this._onClose(e),r.onerror=e=>this._onError(e),r.onmessage=e=>this._onMessage(e),t(r)},r.onclose=e=>{r.onopen=r.onclose=null,s(e)}}))}async _handshake(e=1e4){const t=this._websocket;if((0,c.Wi)(t))return;const s=(0,u.hh)(),r=t.onmessage,{filter:i,outFields:n,spatialReference:o}=this._config;return s.timeout(e),t.onmessage=e=>{var a;let h=null;try{h=JSON.parse(e.data)}catch(e){}h&&"object"==typeof h||(me.error(new I.Z("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),s.reject(),this.destroy()),(null==(a=h.spatialReference)?void 0:a.wkid)!==(null==o?void 0:o.wkid)&&(me.error(new I.Z("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${o.wkid}`,e.data)),s.reject(),this.destroy()),"json"!==h.format&&(me.error(new I.Z("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),s.reject(),this.destroy()),i&&h.filter!==i&&me.error(new I.Z("websocket-connection","Tried to set filter, but server doesn't support it")),n&&h.outFields!==n&&me.error(new I.Z("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=r,s.resolve()},t.send(JSON.stringify({filter:i,outFields:n,format:"json",spatialReference:{wkid:o.wkid}})),s.promise}_onMessage(e){try{const t=JSON.parse(e.data);if("featureResult"!==t.type)throw new I.Z("websocket-connection","Protocol violation - Expected to find message of type 'featureResult'",t);for(const e of t.features)(0,c.pC)(this._featureZScaler)&&this._featureZScaler(e.geometry),this.onFeature(e)}catch(e){return me.error(new I.Z("websocket-connection","Failed to parse message",e)),void this.destroy()}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),me.error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&me.error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,r._)([(0,o.Cb)()],xe.prototype,"connectionStatus",null),(0,r._)([(0,o.Cb)()],xe.prototype,"errorString",void 0),xe=(0,r._)([(0,a.j)("esri.layers.graphics.sources.connections.WebSocketConnection")],xe);var be=s(33955),we=s(82971);const ve=x.Z.getLogger("esri.layers.graphics.sources.connections.GeoEventConnection"),Se={maxQueryDepth:5,maxRecordCountFactor:3};let Te=class extends xe{constructor(e){super({...Se,...e})}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||ve.warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:s,outFields:r}=this._config;this.destroyed||this._setFilter(s,r)}_onMessage(e){let t;try{t=this._enrich(JSON.parse(e.data)),(0,c.pC)(this._featureZScaler)&&this._featureZScaler(t.geometry)}catch(e){return void ve.error(new I.Z("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,y.default)(e.path,{query:t,responseType:"json"}),r=(await s).data;return this._serviceDefinition=r,r}_fetchWebSocketUrl(e,t){const s=e[0],{urls:r,token:i}=s,n=this._inferWebSocketBaseUrl(r);return(0,pe.fl)(`${n}/subscribe`,{outSR:""+t.wkid,token:i})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(-1!==t.indexOf("wss"))return t;return ve.error(new I.Z("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if((0,c.Wi)(s)||(0,c.Wi)(e)&&(0,c.Wi)(t))return;const r=JSON.stringify({filter:this._serializeFilter(e,t)});let i=!1;const n=(0,u.hh)();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(ve.error(new I.Z("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),n.reject(t.error)),s.onmessage=this._onMessage.bind(this),i=!0,n.resolve())},s.send(r),setTimeout((()=>{i||(this.destroyed||this._websocket!==s||ve.error(new I.Z("geoevent-connection","Server timed out when setting filter")),n.reject())}),1e4),n.promise}_serializeFilter(e,t){const s={};if((0,c.Wi)(e)&&(0,c.Wi)(t))return s;if((0,c.pC)(e)&&e.geometry)try{const t=(0,be.im)(e.geometry);if("extent"!==t.type)throw new I.Z(`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){ve.error(new I.Z("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return(0,c.pC)(e)&&e.where&&"1 = 1"!==e.where&&(s.where=e.where),(0,c.pC)(t)&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t];if(!this._relatedFeatures.has(s))return ve.warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:r,geometry:i}=this._relatedFeatures.get(s);for(const t in r)e.attributes[t]=r[t];return i&&(e.geometry=i),e.geometry||e.centroid||ve.error(new I.Z("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),r=this._queryArchive(t);await s;const i=await r;if(!i)return;for(const e of i.features)this.onFeature(this._enrich(e))}catch(e){ve.error(new I.Z("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(6968),s.e(7319),s.e(1773),s.e(755),s.e(3471),s.e(511),s.e(635),s.e(9101),s.e(7284),s.e(8422),s.e(8121)]).then(s.bind(s,67284))).default)({url:e}),{capabilities:r}=await t.load(),i=r.query.supportsMaxRecordCountFactor,n=r.query.supportsPagination,o=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,u=i?h*a:h,l=new K.Z;if(l.outFields=(0,c.Pt)(this._config.outFields,["*"]),l.where=(0,c.Pt)((0,c.U2)(this._config.filter,"where"),"1=1"),l.returnGeometry=!0,l.returnExceededLimitFeatures=!0,l.outSpatialReference=we.Z.fromJSON(this._config.spatialReference),o&&(l.returnCentroid=!0),i&&(l.maxRecordCountFactor=a),n)return l.num=u,t.destroy(),this._queryPages(e,l);const d=await(0,S.executeQuery)(e,l,this._config.sourceSpatialReference);return t.destroy(),d.data}async _queryPages(e,t,s=[],r=0){t.start=(0,c.pC)(t.num)?r*t.num:null;const{data:i}=await(0,S.executeQuery)(e,t,this._config.sourceSpatialReference);return i.exceededTransferLimit&&r<this._config.maxQueryDepth?(i.features.forEach((e=>s.push(e))),this._queryPages(e,t,s,r+1)):(s.forEach((e=>i.features.push(e))),i)}_addRelatedFeatures(e){const t=new Map,s=e.features,r=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[r];t.set(s,e)}this._relatedFeatures=t}};Te=(0,r._)([(0,a.j)("esri.layers.graphics.sources.connections.GeoEventConnection")],Te);const Ce=Te;function Fe(e,t){const s=e.weakClone();if((0,c.pC)(e.geometry)){const r=(0,d.Jd)(t,e.geometry.coords[0]),i=(0,d.IN)(t,e.geometry.coords[1]);s.geometry=new A.Z([],[r,i])}return s}class Ee{constructor(e,t){this.onUpdate=e,this._geometryType=t,this._objectIdToFeature=new Map}get _features(){const e=[];return this._objectIdToFeature.forEach((t=>e.push(t))),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=function(e,t){const s=(0,ue.r)(9,"esriGeometryPoint"===t?e=>(0,c.pC)(e.geometry)?{minX:e.geometry.coords[0],minY:e.geometry.coords[1],maxX:e.geometry.coords[0],maxY:e.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:e=>{let t=1/0,s=1/0,r=-1/0,i=-1/0;return(0,c.pC)(e.geometry)&&e.geometry.forEachVertex(((e,n)=>{t=Math.min(t,e),s=Math.min(s,n),r=Math.max(r,e),i=Math.max(i,n)})),{minX:t,minY:s,maxX:r,maxY:i}});return s.load(e),s}(this._features,this._geometryType)),function(e,t){return e.search({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]})}(this._index,e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),this._index=null,t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._objectIdToFeature.size}}class Ae extends re{constructor(e){super(e),this.type="geoevent",this._dataReceiveEventEnabled=!1,this._level=0,this._updateInfo={websocket:0,client:0};const{outSR:t}=e,{geometryType:s,objectIdField:r,timeInfo:i,purgeOptions:n,source:o,spatialReference:a,serviceFilter:h,maxReconnectionAttempts:c,maxReconnectionInterval:u,updateInterval:l,enableDataReceived:p,customParameters:g}=e.serviceInfo,_=new Ee(this._onUpdate.bind(this),s),f=new de(_,r,i,n),m=function(e,t,s,r,i,n,o,a){const h=0===e.path.indexOf("wss://")||0===e.path.indexOf("ws://"),c={source:e,sourceSpatialReference:t,spatialReference:s,geometryType:r,filter:i,maxReconnectionAttempts:n,maxReconnectionInterval:o,customParameters:a};return h?new xe(c):new Ce(c)}(o,a,t,s,h,c,u,g);this._store=_,this._manager=f,this._connection=m,this._quantize=function(e){return"esriGeometryPoint"===e?Fe:(t,s)=>{const r=t.weakClone(),i=new A.Z,n=(0,d.Nh)(i,t.geometry,!1,!1,e,s,!1,!1);return r.geometry=n,r}}(s),this._dataReceiveEventEnabled=p,this._handles=[this._connection.on("feature",(e=>this._onFeature(e))),this._connection.watch("connectionStatus",(e=>this.events.emit("connectionStatus",e))),this._connection.watch("errorString",(e=>this.events.emit("errorString",e)))];let y=performance.now();this._updateIntervalId=setInterval((()=>{const t=performance.now(),s=t-y;if(s>2500){y=t;const e=Math.round(this._updateInfo.client/(s/1e3)),r=Math.round(this._updateInfo.websocket/(s/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:e,websocket:r})}e.canAcceptRequest()&&this._manager.checkForUpdates()}),l)}destroy(){super.destroy(),clearInterval(this._updateIntervalId),this._handles.forEach((e=>e.remove())),this._connection.destroy()}_fetchDataTile(){}resume(){}enableEvent(e,t){"data-received"===e&&(this._dataReceiveEventEnabled=t)}get updating(){return!1}subscribe(e){super.subscribe(e);const t=this._subscriptions.get(e.id);this._level=e.level;const s=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:s,end:!0}),t.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(e){const t=this._subscriptions.get(e),{tile:s}=t;yield this._getTileFeatures(s);for(const e of t.requests.stream.entries)(0,c.pC)(e)&&(0,c.pC)(e.addOrUpdate)&&(yield e.addOrUpdate)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach((e=>{const{tile:t}=e,s={type:"append",id:t.id,addOrUpdate:this._getTileFeatures(t),end:!0};this._onMessage(s)}))}_getTileFeatures(e){const t=this._store.search(e).map((t=>this._quantize(t,e.transform)));return F.fromOptimizedFeatures(t,this._serviceInfo.geometryType,e.transform)}_onFeature(e){this._updateInfo.websocket++;try{this._dataReceiveEventEnabled&&this.events.emit("feature",e);const t=(0,d.XA)(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(t)}catch(e){}}_onUpdate(e,t){(0,c.pC)(e)&&(this._updateInfo.client+=e.length),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,clear:!0,end:!1})})),this._subscriptions.forEach(((e,t)=>{if(!e.didSend||e.tile.level!==this._level)return;const s=e.tile,r={type:"append",id:t,addOrUpdate:this._getTileFeatures(s),remove:[],end:!0,status:te.empty()};e.requests.stream.enqueue(r),this._onMessage(r)}))}}const Me=x.Z.getLogger("esri.views.2d.layers.features.sources.FeatureSource");class ke extends oe{constructor(e){super(e)}async _fetchDataTile(e){const t=this._subscriptions.get(e.key.id);let s=!1,r=0,i=0;const n=(r,n)=>{i--,(0,u.k_)(t);const o=e.id,a=r.reader,h=r.query;if(!a.exceededTransferLimit){if(s=!0,0!==n&&!a.hasFeatures){const e={id:o,addOrUpdate:a,end:0===i,type:"append"};return t.add({message:e,query:h}),void this._onMessage(e)}const e={id:o,addOrUpdate:a,end:0===i,type:"append"};return t.add({message:e,query:h}),void this._onMessage(e)}const c={id:o,addOrUpdate:a,end:s&&0===i,type:"append"};t.add({message:c,query:h}),this._onMessage(c)};let o=0,a=0;for(;!s&&a++<20;){let a;for(let h=0;h<o+1;h++){const o=r++;i++,a=this._fetchDataTilePage(e,o,t).then((e=>e&&n(e,o))).catch((t=>{s=!0,(0,u.D_)(t)||(Me.error(new I.Z("mapview-query-error","Encountered error when fetching tile",{tile:e,error:t})),this._onMessage({id:e.id,addOrUpdate:null,end:s,type:"append"}))}))}await a,(0,u.k_)(t),o=Math.min(o+2,6)}}async _fetchDataTilePage(e,t,s){(0,u.k_)(s);const r=this._queryInfo,i={start:this.pageSize*t,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};(0,c.pC)(this.maxRecordCountFactor)&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createTileQuery(e,i);try{const i=s.signal,o=await this._queue.push({tile:e,query:n,signal:i,depth:t});return(0,u.k_)(s),o?r!==this._queryInfo?this._fetchDataTilePage(e,t,s):{reader:o,query:n}:null}catch(e){return(0,u.H9)(e),null}}}var Re=s(77734),Oe=s(61800);const Le=x.Z.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource");function Pe(e,t,s){const r=e.getXHydrated(),i=e.getYHydrated(),n=t.getColumnForX(r),o=Math.floor(t.normalizeCol(n));return`${s}/${Math.floor(t.getRowForY(i))}/${o}`}function Ne(e,t){if((0,c.Wi)(e))return null;const s=t.transform,r=e.getQuantizationTransform();if((0,c.Wi)(r)){const[t,r]=s.scale,[i,n]=s.translate,o=-i/t,a=1/t,h=n/r,c=1/-r;return e.transform(o,h,a,c)}const[i,n]=r.scale,[o,a]=r.translate,[h,u]=s.scale,[l,d]=s.translate,p=i/h,g=(o-l)/h,_=n/u,f=(-a+d)/u;return e.transform(g,f,p,_)}class Ue extends oe{constructor(e){super(e),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new Re.Z(1e3),this._store=e.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(e,t){super.update(e,t),this._hasAggregates=e.targets.aggregate}async resend(e=!1){if(await this._downloadPromise,this._invalidated||e){const e=(0,c.s3)(this._schema.featureCount,"Expected featureCount to be defined");return this._invalidated=!1,this._subscriptions.forEach((e=>e.clear())),this._downloadPromise=this._download(e),void await this._downloadPromise}const t=this._queries.map((({query:e,reader:t})=>this._sendPatchQuery(e,t)));await Promise.all(t),this._subscriptions.forEach((e=>{e.requests.done.forEach((e=>this._onMessage(e.message)))}))}async refresh(){await this.resend(!0)}async _sendPatchQuery(e,t){const s=(0,c.pC)(e.outFields)?e.outFields:[],r=this._queryInfo.outFields,i=r.filter((e=>-1===s.indexOf(e)));if(!i.length)return;const n=e.clone(),o=this._signal;n.returnGeometry=!1,n.returnCentroid=!1,n.outFields=i,e.outFields=r;const a=await this._queue.push({query:n,depth:0,signal:o});(0,u.k_)({signal:o}),t.joinAttributes(a)}async _fetchDataTile(e){if(!this._downloadPromise){const e=(0,c.s3)(this._schema.featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(e)}const t=this._store.search(e),s=this._subscriptions.get(e.key.id),r=t.length-1;for(let i=0;i<r;i++){const r=Ne(t[i],e),n={type:"append",id:e.id,addOrUpdate:r,end:!1,status:te.empty()};s.add({query:null,message:n}),this._hasAggregates||await(0,u.e4)(1),this._onMessage(n)}const i=Ne(r>=0?t[r]:null,e),n=this._didSendEnd,o={type:"append",id:e.id,addOrUpdate:i,end:n,status:te.empty()};s.add({query:null,message:o}),this._onMessage(o)}async _download(e){try{await this.whenInitialized();const t=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;t.clear();const r=Math.ceil(e/this.pageSize),i=Array.from({length:r},((e,t)=>t)).sort(((e,t)=>this._random.getInt()-this._random.getInt())).map((e=>this._downloadPage(e,t,s)));await Promise.all(i),this._store.sweepFeatures(t,this._store.storage),this._store.sweepFeatureSets(s)}catch(e){Le.error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",e)}this._sendEnd(),this._loading=!1}async _downloadPage(e,t,s){const r=this.pageSize,i={start:e*r,num:r,cacheHint:!0};(0,c.pC)(this.maxRecordCountFactor)&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createQuery(i),o=this._signal,a=await this._queue.push({query:n,depth:e,signal:o});(0,u.k_)({signal:o}),this._queries.push({query:n,reader:a}),this._store.insert(a),s.add(a.instance);const h=a.getCursor();for(;h.next();)t.set(h.getDisplayId());this._send(a)}_send(e){if(!this._subscriptions.size)return;let t=null;const s=new Map,r=new Set,i=new Map;this._subscriptions.forEach((e=>{var n;const o=e.tile;s.set(o.key.id,null),t=o.tileInfoView,r.add(o.level);const{row:a,col:h}=o.key,c=`${o.level}/${a}/${h}`,u=null!=(n=i.get(c))?n:[];u.push(e),i.set(c,u)}));for(const n of r){const r=t.getLODInfoAt(n),o=e.getCursor();for(;o.next();){const e=Pe(o,r,n),t=o.getIndex();if(i.has(e))for(const r of i.get(e)){const e=r.tile.id;let i=s.get(e);(0,c.Wi)(i)&&(i=[],s.set(e,i)),i.push(t)}}}s.forEach(((t,s)=>{if((0,c.pC)(t)){const r=this._subscriptions.get(s),i={type:"append",id:s,addOrUpdate:Ne(Oe.t.from(e,t),r.tile),end:!1,status:te.empty()};r.add({query:null,message:i}),this._onMessage(i)}}))}_sendEnd(){this._subscriptions.forEach((e=>{const t={type:"append",id:e.tile.id,addOrUpdate:null,end:!0,status:te.empty()};e.add({query:null,message:t}),this._onMessage(t)})),this._didSendEnd=!0}}var De=s(16534),qe=s(29996);s(37720),s(66039),s(40660);var Be=s(35371);const ze=x.Z.getLogger("esri.views.layers.2d.features.support.AttributeStore"),Ge=()=>null,Ze={sharedArrayBuffer:(0,n.Z)("esri-shared-array-buffer"),atomics:(0,n.Z)("esri-atomics")};function je(e,t){return s=>t(e(s))}class Xe{constructor(e,t,s,r){this.size=0,this.texelSize=4;const{pixelType:i,layout:n,textureOnly:o}=r;this.textureOnly=o||!1,this.pixelType=i,this._ctype=t,this.layout=n,this._resetRange(),this._shared=e,this.size=s,o||(this.data=this._initData(i,s,e,t))}get buffer(){return(0,c.Po)(this.data,(e=>e.buffer))}unsetComponentAllTexels(e,t){const s=(0,c.Wg)(this.data);for(let r=0;r<this.size*this.size;r++)s[r*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){const s=(0,c.Wg)(this.data);for(let r=0;r<this.size*this.size;r++)s[r*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,s){const r=(0,c.Wg)(this.data);for(const i of s)r[i*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}setComponentTexel(e,t,s){(0,c.Wg)(this.data)[s*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}unsetComponentTexel(e,t,s){(0,c.Wg)(this.data)[s*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}getData(e,t){const s=(0,_.jL)(e);return(0,c.Wg)(this.data)[s*this.texelSize+t]}setData(e,t,s){const r=(0,_.jL)(e),i=1<<t;0!=(this.layout&i)?(this.data[r*this.texelSize+t]=s,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)):ze.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===Be.Br.UNSIGNED_BYTE&&this._shared&&Ze.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===Be.Br.UNSIGNED_BYTE&&this._shared&&Ze.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(e){if(this.size=e,!this.textureOnly){const t=this._initData(this.pixelType,e,this._shared,this._ctype),s=(0,c.Wg)(this.data);t.set(s),this.data=t}}toMessage(){const e=this.dirtyStart,t=this.dirtyEnd,s=this.texelSize;if(e>t)return null;this._resetRange();const r=!(this._shared||"local"===this._ctype),i=this.pixelType,n=this.layout,o=(0,c.Wg)(this.data);return{start:e,end:t,data:r&&o.slice(e*s,(t+1)*s)||null,pixelType:i,layout:n}}_initData(e,t,s,r){const i=s&&"local"!==r?SharedArrayBuffer:ArrayBuffer,n=(0,qe.UK)(e),o=new n(new i(t*t*4*n.BYTES_PER_ELEMENT));for(let e=0;e<o.length;e+=4)o[e+1]=255;return o}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class We{constructor(e,t){this._client=e,this.config=t,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(De.m4),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const s=t.supportsTextureFloat?Be.Br.FLOAT:Be.Br.UNSIGNED_BYTE;Ge(`Creating AttributeStore ${Ze.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:Be.Br.UNSIGNED_BYTE,layout:1},{pixelType:Be.Br.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:s,layout:15},{pixelType:s,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}update(e,t){this.config=t;const s=t.schema.processors[0].storage,r=(0,J.Hg)(this._schema,s);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),r&&((0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",r),e.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!(0,c.Wi)(s))){switch(s.target){case"feature":this._targetType=_.PX;break;case"aggregate":this._targetType=_.xp}if("subtype"===s.type)for(const e in s.mapping){const t=s.mapping[e];if((0,c.pC)(t))for(const e of t.mapping)this._bindAttribute(e)}else for(const e of s.mapping)this._bindAttribute(e)}}onTileData(e,t){if((0,c.Wi)(t.addOrUpdate))return;const s=t.addOrUpdate.getCursor();for(;s.next();){const e=s.getDisplayId();this.setAttributeData(e,s)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(e,t){const s=this._getBlock(0),r=t.map((e=>(0,_.jL)(e)));s.lock(),s.unsetComponentAllTexels(0,1),s.setComponent(0,1,r),s.unlock(),this._idsToHighlight.clear();for(const t of e)this._idsToHighlight.add(t);await this.sendUpdates()}async updateFilters(e,t){const{config:s,service:r,spatialReference:i}=t,{filters:o}=s,a=o.map(((e,t)=>this._updateFilter(e,t,r,i)));(await Promise.all(a)).some((e=>e))&&(e.storage.filters=!0,(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,t,s,r){const i=(0,_.jL)(e);this._ensureSizeForTexel(i),this._getBlock(t).setData(e,s,r)}getData(e,t,s){return this._getBlock(t).getData(e,s)}getHighlightFlag(e){return this._idsToHighlight.has(e)?De.uG:0}unsetAttributeData(e){const t=(0,_.jL)(e);this._getBlock(0).setData(t,0,0)}setAttributeData(e,t){const s=(0,_.jL)(e);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(t)),this._targetType!==(0,_.vs)(e))return;const r=this._attributeComputeMap,i=this.config.supportsTextureFloat?1:2;r.size&&r.forEach(((e,r)=>{const n=r*i%4,o=Math.floor(r*i/4),a=this._getBlock(o+De.aK),h=e(t);if(this.config.supportsTextureFloat)a.setData(s,n,h);else if(h===De.AI)a.setData(s,n,255),a.setData(s,n+1,255);else{const e=(0,le.uZ)(Math.round(h),-32767,32766)+32768,t=255&e,r=(65280&e)>>8;a.setData(s,n,t),a.setData(s,n+1,r)}}))}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=(0,u.hh)(),this._nextUpdate.promise;const e={blocks:this._blocks.map((e=>(0,c.pC)(e)?e.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const e=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>e.resolve()))}},s=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),s})).catch((e=>(0,u.D_)(e)?(this._createResourcesPromise=null,this._createResources()):(ze.error(new I.Z("mapview-attribute-store","Encountered an error during client update",e)),Promise.resolve()))),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e){let t;if(null!=e.fieldIndex)e.normalizationField&&ze.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),t=t=>t.getComputedNumericAtIndex(e.fieldIndex);else{if(!e.field)return;t=e.normalizationField?t=>{const s=t.readAttribute(e.normalizationField);return s?t.readAttribute(e.field)/s:null}:t=>t.readAttribute(e.field)}e.valueRepresentation&&(t=je(t,(t=>function(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}(t,e.valueRepresentation)))),this._attributeComputeMap.set(e.binding,je(t,(e=>null===e||isNaN(e)||e===1/0?De.AI:e)))}_createResources(){if((0,c.pC)(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(De.xl),Ge("Initializing AttributeStore");const e={shared:Ze.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:(0,c.Fd)(this._blocks,(e=>({textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType})))},t=this._client.initialize(e,this._signal).catch((e=>{(0,u.D_)(e)?this._createResourcesPromise=null:ze.error(new I.Z("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=t,t.then((()=>(0,c.Wi)(this._createResourcesPromise)?this._createResources():void 0)),t}_getBlock(e){const t=this._blocks[e];if((0,c.pC)(t))return t;Ge(`Initializing AttributeBlock at index ${e}`);const s=Ze.sharedArrayBuffer,r=this._client.type,i=new Xe(s,r,this._size,this._blockDescriptors[e]);return this._blocks[e]=i,this._createResourcesPromise=null,i}_expand(){if(this._size<this.config.maxTextureSize){const e=this._size<<=1;return Ge("Expanding block size to",e,this._blocks),(0,c.JR)(this._blocks,(t=>t.expand(e))),this._createResourcesPromise=null,this._size=e,0}return ze.error(new I.Z("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(e,t,s,r){const i=this._filters[t],n=(0,c.pC)(i)&&i.hash;if(!i&&!e)return!1;if(n===JSON.stringify(e))return!1;if((0,c.Wi)(e)){if(!i)return!1;const e=1<<t+1,s=this._getBlock(0);return this._filters[t]=null,s.setComponentAllTexels(0,e),this.sendUpdates(),!0}const o=await this._getFilter(t,s);return await o.update(e,r),!0}async _getFilter(e,t){const r=this._filters[e];if((0,c.pC)(r))return r;const{default:i}=await s.e(9169).then(s.bind(s,29169)),n=new i({geometryType:t.geometryType,hasM:!1,hasZ:!1,timeInfo:t.timeInfo,fieldsIndex:new g.Z(t.fields)});return this._filters[e]=n,n}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let t=0;const s=(0,_.KS)(e.getDisplayId());for(let r=0;r<this._filters.length;r++){const i=!!(s&1<<r),n=this._filters[r];t|=(!i||(0,c.Wi)(n)||n.check(e)?1:0)<<r}let r=0;if(this._idsToHighlight.size){const t=e.getObjectId();r=this.getHighlightFlag(t)}return t<<1|r}}function Ye(e,t,s,r){r%2&&(r+=1);let i=0,n=0,o=-90,a=90,h=-180,c=180;for(let e=0;e<r/2;e++){for(let t=0;t<5;t++){const r=(h+c)/2,n=s>r?1:0;i|=n<<29-(t+5*e),h=(1-n)*h+n*r,c=(1-n)*r+n*c}for(let s=0;s<5;s++){const r=(o+a)/2,i=t>r?1:0;n|=i<<29-(s+5*e),o=(1-i)*o+i*r,a=(1-i)*r+i*a}}e.geohashX=i,e.geohashY=n}function Ve(e,t,s,r,i){i%2&&(i+=1);let n=0,o=0,a=-90,h=90,c=-180,u=180;for(let e=0;e<i/2;e++){for(let t=0;t<5;t++){const s=(c+u)/2,i=r>s?1:0;n|=i<<29-(t+5*e),c=(1-i)*c+i*s,u=(1-i)*s+i*u}for(let t=0;t<5;t++){const r=(a+h)/2,i=s>r?1:0;o|=i<<29-(t+5*e),a=(1-i)*a+i*r,h=(1-i)*r+i*h}}e[2*t]=n,e[2*t+1]=o}new Float64Array(2),new Float64Array(2);class He{constructor(e=[],t=8096){this._nodes=0,this._root=new Qe(0,0,0),this._statisticFields=e,this._pool=t?new ee.Z(8096):null}_acquire(e,t,s){this._nodes++;let r=null;return(0,c.pC)(this._pool)&&(r=this._pool.dequeue()),(0,c.pC)(r)?r.realloc(e,t,s):new Qe(e,t,s)}_release(e){this._nodes--,(0,c.pC)(this._pool)&&this._pool.enqueue(e)}get count(){return this._root.count}get size(){return this._nodes}get poolSize(){return(0,c.R2)(this._pool,0,(e=>e.size))}get depth(){let e=0;return this._forEachNode((t=>e=Math.max(e,t.depth))),e}dropLevels(e){this._forEachNode((t=>{if(t.depth>=e)for(let e=0;e<t.children.length;e++){const s=t.children[e];t.children[e]=null,s&&this._release(s)}}))}clear(){this.dropLevels(0)}insert(e,t,s=0){const r=F.fromOptimizedFeatures([e],"esriGeometryPoint").getCursor();r.next();const i=r.readGeometry();if(!i)return;const[n,o]=i.coords,a=e.geohashX,h=e.geohashY;this.insertCursor(r,e.displayId,n,o,a,h,t,s)}insertCursor(e,t,s,r,i,n,o,a=0){let h=this._root,c=0,u=0,l=0;for(;null!==h;){if(h.depth>=a&&(h.count+=1,h.xTotal+=s,h.yTotal+=r,h.xGeohashTotal+=i,h.yGeohashTotal+=n,h.displayId=t,this._updateStatisticsCursor(e,h,1)),c>=o)return void h.add(t);const d=Math.ceil((c+1)/2),p=Math.floor((c+1)/2),g=1-c%2,_=30-(3*d+2*p),f=30-(2*d+3*p),m=(i&7*g+3*(1-g)<<_)>>_,y=(n&3*g+7*(1-g)<<f)>>f,I=m+y*(8*g+4*(1-g));u=u<<3*g+2*(1-g)|m,l=l<<2*g+3*(1-g)|y,null==h.children[I]&&(h.children[I]=this._acquire(u,l,c+1)),c+=1,h=h.children[I]}}remove(e,t){const s=F.fromOptimizedFeatures([e],"esriGeometryPoint").getCursor();s.next();const r=s.readGeometry();if(!r)return;const[i,n]=r.coords,o=e.geohashX,a=e.geohashY;this.removeCursor(s,i,n,o,a,t)}removeCursor(e,t,s,r,i,n){let o=this._root,a=0;for(;null!==o;){if(o.count-=1,o.xTotal-=t,o.yTotal-=s,o.xGeohashTotal-=r,o.yGeohashTotal-=i,this._updateStatisticsCursor(e,o,-1),a>=n)return void o.remove(e.getDisplayId());const h=Math.ceil((a+1)/2),c=Math.floor((a+1)/2),u=1-a%2,l=30-(3*h+2*c),d=30-(2*h+3*c),p=((r&7*u+3*(1-u)<<l)>>l)+((i&3*u+7*(1-u)<<d)>>d)*(8*u+4*(1-u)),g=o.children[p];1===g.count&&(this._release(g),o.children[p]=null),a+=1,o=g}}find(e,t,s){return this._root.find(e,t,s,0,0,0)}findSingleOccupancyNode(e,t,s,r,i){let n=this._root;for(;null!==n;){const o=n.depth,a=n.xNode,h=n.yNode,c=1-o%2,u=n.xGeohashTotal/n.count,l=n.yGeohashTotal/n.count;if(1===n.count&&e<u&&u<=s&&t<l&&l<=r)return n;if(o>=i){n=n.next;continue}const d=Math.ceil((o+1)/2),p=Math.floor((o+1)/2),g=30-(3*d+2*p),_=30-(2*d+3*p),f=~((1<<g)-1),m=~((1<<_)-1),y=(e&f)>>g,I=(t&m)>>_,x=(s&f)>>g,b=(r&m)>>_,w=a<<3*c+2*(1-c),v=h<<2*c+3*(1-c),S=w+8*c+4*(1-c),T=v+4*c+8*(1-c),C=Math.max(w,y),F=Math.max(v,I),E=Math.min(S,x),A=Math.min(T,b);let M=null,k=null;for(let e=F;e<=A;e++)for(let t=C;t<=E;t++){const s=t-w+(e-v)*(8*c+4*(1-c)),r=n.children[s];r&&(M||(M=r,M.next=n.next),k&&(k.next=r),k=r,r.next=n.next)}n=M||n.next}return null}getRegionDisplayIds(e,t,s,r,i){let n=this._root;const o=[];for(;null!==n;){const a=n.depth,h=n.xNode,c=n.yNode;if(a>=i){const i=n.xGeohashTotal/n.count,a=n.yGeohashTotal/n.count;e<=i&&i<=s&&t<=a&&a<=r&&n.displayIds.forEach((e=>o.push(e))),n=n.next;continue}const u=Math.ceil((a+1)/2),l=Math.floor((a+1)/2),d=1-a%2,p=30-(3*u+2*l),g=30-(2*u+3*l),_=~((1<<p)-1),f=~((1<<g)-1),m=(e&_)>>p,y=(t&f)>>g,I=(s&_)>>p,x=(r&f)>>g,b=h<<3*d+2*(1-d),w=c<<2*d+3*(1-d),v=b+8*d+4*(1-d),S=w+4*d+8*(1-d),T=Math.max(b,m),C=Math.max(w,y),F=Math.min(v,I),E=Math.min(S,x);let A=null,M=null;for(let e=C;e<=E;e++)for(let t=T;t<=F;t++){const s=t-b+(e-w)*(8*d+4*(1-d)),r=n.children[s];r&&(A||(A=r,A.next=n.next),M&&(M.next=r),M=r,r.next=n.next)}n=A||n.next}return o}getRegionStatistics(e,t,s,r,i){let n=this._root,o=0,a=0,h=0;const c={};let u=0;for(;null!==n;){const l=n.depth,d=n.xNode,p=n.yNode;if(l>=i){const i=n.xGeohashTotal/n.count,l=n.yGeohashTotal/n.count;e<i&&i<=s&&t<l&&l<=r&&(o+=n.count,a+=n.xTotal,h+=n.yTotal,1===n.count&&(u=n.displayId),this._aggregateStatistics(c,n.statistics)),n=n.next;continue}const g=Math.ceil((l+1)/2),_=Math.floor((l+1)/2),f=1-l%2,m=30-(3*g+2*_),y=30-(2*g+3*_),I=~((1<<m)-1),x=~((1<<y)-1),b=(e&I)>>m,w=(t&x)>>y,v=(s&I)>>m,S=(r&x)>>y,T=d<<3*f+2*(1-f),C=p<<2*f+3*(1-f),F=T+8*f+4*(1-f),E=C+4*f+8*(1-f),A=Math.max(T,b),M=Math.max(C,w),k=Math.min(F,v),R=Math.min(E,S);let O=null,L=null;for(let i=M;i<=R;i++)for(let l=A;l<=k;l++){const d=l-T+(i-C)*(8*f+4*(1-f)),p=n.children[d];if(p){if(i!==M&&i!==R&&l!==A&&l!==k){const i=p.xGeohashTotal/p.count,n=p.yGeohashTotal/p.count;e<i&&i<=s&&t<n&&n<=r&&(o+=p.count,a+=p.xTotal,h+=p.yTotal,1===p.count&&(u=p.displayId),this._aggregateStatistics(c,p.statistics));continue}O||(O=p,O.next=n.next),L&&(L.next=p),L=p,p.next=n.next}}n=O||n.next}return{count:o,attributes:this._normalizeStatistics(c,o),xTotal:a,yTotal:h,referenceId:u}}_forEachNode(e){let t=this._root;for(;null!==t;){const s=this._linkChildren(t)||t.next;e(t),t=s}}_linkChildren(e){let t=null,s=null;for(let r=0;r<=e.children.length;r++){const i=e.children[r];i&&(t||(t=i,t.next=e.next),s&&(s.next=i),s=i,i.next=e.next)}return t}_updateStatisticsCursor(e,t,s){for(const r of this._statisticFields){const i=r.name,n=r.inField?e.readAttribute(r.inField):e.getComputedNumericAtIndex(r.inFieldIndex);switch(r.statisticType){case"norm":{t.statistics[i]||(t.statistics[i]={});const o=r.inNormalizationField,a=e.readAttribute(o),h=t.statistics[i].onStatisticField||0,c=t.statistics[i].onStatisticNormalizationField||0;null==n||isNaN(n)||null==a||0===a||isNaN(a)||(t.statistics[i].onStatisticField=h+s*n,t.statistics[i].onStatisticNormalizationField=c+s*a);break}case"sum":case"avg":{t.statistics[i]||(t.statistics[i]={value:0,nanCount:0});const e=t.statistics[i].value,r=t.statistics[i].nanCount;null==n||isNaN(n)?t.statistics[i].nanCount=r+s:t.statistics[i].value=e+s*n;break}case"avg_angle":{t.statistics[i]||(t.statistics[i]={x:0,y:0,nanCount:0});const e=t.statistics[i].x,r=t.statistics[i].y,o=t.statistics[i].nanCount,a=Math.PI/180;null==n||isNaN(n)?t.statistics[i].nanCount=o+s:(t.statistics[i].x=e+s*Math.cos(n*a),t.statistics[i].y=r+s*Math.sin(n*a));break}case"mode":{t.statistics[i]||(t.statistics[i]={});const e=t.statistics[i][n]||0;t.statistics[i][n]=e+s;break}}}}_aggregateStatistics(e,t){for(const s of this._statisticFields){const r=s.name;switch(s.statisticType){case"sum":case"avg":case"avg_angle":case"mode":case"norm":e[r]||(e[r]={});for(const s in t[r]){const i=e[r][s]||0;e[r][s]=i+t[r][s]}}}}_normalizeStatistics(e,t){const s={};for(const r of this._statisticFields){const i=r.name;switch(r.statisticType){case"norm":{const r=e[i];if(t&&null==r.onStatisticNormalizationField)break;if(t&&r.onStatisticNormalizationField){s[i]=r.onStatisticField/r.onStatisticNormalizationField;break}s[i]=0;break}case"sum":{if(!t)break;const{value:r,nanCount:n}=e[i];if(!(t-n))break;s[i]=r;break}case"avg":{if(!t)break;const{value:r,nanCount:n}=e[i];if(!(t-n))break;s[i]=r/(t-n);break}case"avg_angle":{if(!t)break;const{x:r,y:n,nanCount:o}=e[i];if(!(t-o))break;const a=r/(t-o),h=n/(t-o),c=180/Math.PI,u=Math.atan2(h,a)*c;s[i]=u;break}case"mode":{const t=e[i];let r=0,n=null;for(const e in t){const s=t[e];s>r&&(r=s,n=e)}s[i]="null"===n?null:n;break}}}return s}}class Qe{constructor(e,t,s){this.count=0,this.xTotal=0,this.yTotal=0,this.statistics={},this.displayId=0,this.displayIds=new Set,this.next=null,this.depth=0,this.xNode=0,this.yNode=0,this.xGeohashTotal=0,this.yGeohashTotal=0,this.children=new Array(32);for(let e=0;e<this.children.length;e++)this.children[e]=null;this.xNode=e,this.yNode=t,this.depth=s}realloc(e,t,s){for(let e=0;e<this.children.length;e++)this.children[e]=null;return this.xNode=e,this.yNode=t,this.depth=s,this.next=null,this.xGeohashTotal=0,this.yGeohashTotal=0,this.xTotal=0,this.yTotal=0,this.count=0,this.statistics={},this.displayIds.clear(),this}add(e){this.displayIds.add(e)}remove(e){this.displayIds.delete(e)}getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),s=Math.floor(e/2),r=30-(3*t+2*s),i=30-(2*t+3*s);return function(e,t){let s=-90,r=90,i=-180,n=180;for(let o=0;o<t;o++){const t=Math.ceil((o+1)/2),a=Math.floor((o+1)/2),h=1-o%2,c=30-(3*t+2*a),u=30-(2*t+3*a),l=2*h+3*(1-h),d=(7*h+3*(1-h)<<c&e.geohashX)>>c,p=(3*h+7*(1-h)<<u&e.geohashY)>>u;for(let e=3*h+2*(1-h)-1;e>=0;e--){const t=(i+n)/2,s=d&1<<e?1:0;i=(1-s)*i+s*t,n=(1-s)*t+s*n}for(let e=l-1;e>=0;e--){const t=(s+r)/2,i=p&1<<e?1:0;s=(1-i)*s+i*t,r=(1-i)*t+i*r}}return[i,s,n,r]}({geohashX:this.xNode<<r,geohashY:this.yNode<<i},this.depth)}find(e,t,s,r,i,n){if(r>=s)return this;const o=1-r%2,a=3*o+2*(1-o),h=2*o+3*(1-o),c=30-i-a,u=30-n-h,l=((e&7*o+3*(1-o)<<c)>>c)+((t&3*o+7*(1-o)<<u)>>u)*(8*o+4*(1-o)),d=this.children[l];return null==d?null:d.find(e,t,s,r+1,i+a,n+h)}}var $e=s(68441),Je=s(8744),Ke=s(37427),et=s(59999);class tt extends T.nd{constructor(e,t,s,r,i){super(new A.Z([],[t,s]),r,null,e),this.geohashBoundsInfo=i}get count(){return this.attributes.cluster_count}static create(e,t,s,r,i,n,o,a){const h=new tt(t,s,r,n,o);return h.displayId=e.createDisplayId(!0),h.referenceId=a,h.tileLevel=i,h}update(e,t,s,r,i,n){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=i,this.referenceId=null,this.referenceId=n,this}toJSON(){return{objectId:this.objectId,referenceId:1===this.attributes.cluster_count?this.referenceId:null,attributes:{...this.attributes,clusterId:this.objectId},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function st(e){return 57.29577951308232*e}class rt extends et.J{constructor(e,t,s){super(e,s),this.events=new $.Z,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=(0,Ke._W)(t,we.Z.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch(e){}const r=(0,J.Hg)(s,t);t&&(!(0,c.Wi)(r)||e.source||e.storage.filters)?(((0,J.uD)(r,"params.fields")||!this._tree||e.source)&&(this._tree=new He(this._statisticFields),this._rebuildTree(),(0,n.Z)("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",r),e.targets[t.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepClusters(e,t,s){this._clusters.forEach(((r,i)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(i))}))}onTileData(e,t,s,r,i=!0){if(!this._schema||(0,c.Wi)(t.addOrUpdate))return t;const n=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,r)}if(t.status.mesh||!i)return t;const o=new Array,a=this._schema.params.clusterRadius;this._getClustersForTile(o,e,a,s,n),t.addOrUpdate=F.fromOptimizedFeatures(o,"esriGeometryPoint"),t.addOrUpdate.attachStorage(s),t.end=!0;{const r=t.addOrUpdate.getCursor();for(;r.next();){const t=r.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(s,r,t,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const t=e[0].level;this._tileLevel=t,this._setGeohashLevel(t)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach((e=>{this._tiles.delete(e.key.id),this._markTileClustersForDeletion(e,s)}))}getAggregate(e){for(const t of this._clusters.values())if((null==t?void 0:t.displayId)===e)return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())(null==t?void 0:t.tileLevel)===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);if(!t)return[];const s=t.geohashBoundsInfo;return this._tree.getRegionDisplayIds(s.xLL,s.yLL,s.xTR,s.yTR,s.level)}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if((null==t?void 0:t.referenceId)===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){for(const[t,s]of this._clusters)s&&e(s,t)}size(){let e=0;return this.forEach((t=>e++)),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const n=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,n,o))return;const a=this._geohashBuf[2*s],h=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,o,a,h,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=st(t/$e.sv.radius),n=i-360*Math.floor((i+180)/360);Ve(r,e,st(Math.PI/2-2*Math.atan(Math.exp(-s/$e.sv.radius))),n,12)}else{const i=(0,Ke.iV)({x:t,y:s},this._spatialReference,we.Z.WGS84);if(!i)return!1;Ve(r,e,i.y,i.x,12)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,s,r,i,n=!0){const o=this._schema.params.clusterPixelBuffer,a=2*s,h=this._getGeohashLevel(t.key.level),u=Math.ceil(2**t.key.level*De.I_/a),l=Math.ceil(o/a)+0,p=Math.ceil(De.I_/a),{row:g,col:_}=t.key,f=_*De.I_,m=g*De.I_,y=Math.floor(f/a)-l,I=Math.floor(m/a)-l,x=y+p+2*l,b=I+p+2*l,w=t.tileInfoView.getLODInfoAt(t.key.level);for(let s=y;s<=x;s++)for(let o=I;o<=b;o++){let a=s;w.wrap&&(a=s<0?s+u:s%u);const l=w.wrap&&s<0,p=w.wrap&&s%u!==s,g=this._lookupCluster(r,w,t.key.level,a,o,h);if((0,c.pC)(g)){const t=(0,c.Po)(i,(e=>l?e.left:p?e.right:e.tile));if(n&&(0,c.Wi)(t))continue;if(!g.count)continue;if((0,c.pC)(t)&&n){const s=g.geometry.clone();let r=g.attributes;s.coords[0]=(0,d.Jd)(t,s.coords[0]),s.coords[1]=(0,d.IN)(t,s.coords[1]),1===g.count&&(0,c.pC)(g.referenceId)&&(r={...g.attributes,referenceId:g.referenceId});const i=new T.ZP(s,r);i.displayId=g.displayId,e.push(i)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),12)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=1*(Math.floor(t/1)+1)-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=(0,Je.C5)(t);if(!r)return{tile:s,left:null,right:null};const[i,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[i-n+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,i=2*r;let n=s%2?t*i:t*i-r;const o=s*i;let a=n+i;const h=o-i,c=2**e.level*De.I_;e.wrap&&n<0&&(n=0),e.wrap&&a>c&&(a=c);const u=n/De.I_,l=o/De.I_,d=a/De.I_,p=h/De.I_;return[e.getXForColumn(u),e.getYForRow(l),e.getXForColumn(d),e.getYForRow(p)]}_lookupCluster(e,t,s,r,i,n){const o=this._getClusterId(s,r,i),a=this._clusters.get(o),[h,u,l,d]=this._getClusterBounds(t,r,i),p={x:h,y:u},g={x:l,y:d};let _=0,f=0,m=0,y=0;if(this._spatialReference.isWebMercator){{const e=st(p.x/$e.sv.radius);_=e-360*Math.floor((e+180)/360),f=st(Math.PI/2-2*Math.atan(Math.exp(-p.y/$e.sv.radius)))}{const e=st(g.x/$e.sv.radius);m=e-360*Math.floor((e+180)/360),y=st(Math.PI/2-2*Math.atan(Math.exp(-g.y/$e.sv.radius)))}}else{const e=(0,Ke.iV)(p,this._spatialReference,we.Z.WGS84),t=(0,Ke.iV)(g,this._spatialReference,we.Z.WGS84);if(!e||!t)return null;_=e.x,f=e.y,m=t.x,y=t.y}const I={geohashX:0,geohashY:0},x={geohashX:0,geohashY:0};Ye(I,f,_,n),Ye(x,y,m,n);const b=I.geohashX,w=I.geohashY,v=x.geohashX,S=x.geohashY,T={xLL:b,yLL:w,xTR:v,yTR:S,level:n},C=this._tree.getRegionStatistics(b,w,v,S,n),{count:F,xTotal:E,yTotal:A,referenceId:M}=C,k=F?E/F:0,R=F?A/F:0;if(0===F)return this._clusters.set(o,null),null;const O={cluster_count:F,...C.attributes},L=(0,c.pC)(a)?a.update(k,R,s,O,T,M):tt.create(e,o,k,R,s,O,T,M);return 0===F&&(L.geometry.coords[0]=(h+l)/2,L.geometry.coords[1]=(u+d)/2),this._clusters.set(o,L),this._updateAggregateValueRangeForCluster(L,L.tileLevel),L}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,i=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(i,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&i===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(De.I_/s),{row:i,col:n}=e.key,o=n*De.I_,a=i*De.I_,h=Math.floor(o/s),c=Math.floor(a/s);for(let t=h;t<h+r;t++)for(let s=c;s<c+r;s++)this._markForDeletion(e.key.level,t,s)}}class it{constructor(){this._freeIds=[],this._idCounter=1}createId(e=!1){return(0,_.QS)(this._getFreeId(),e)}releaseId(e){this._freeIds.push(e)}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}var nt=s(93054);function ot(e,t,s){if(!(e.length>t))for(;e.length<=t;)e.push(s)}class at{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new it,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push(nt.p.create(this._allocatedSize,_._I)),e+1}getBitset(e){return this._bitsets[e-1]}_expand(){this._allocatedSize<<=1;for(const e of this._bitsets)e.resize(this._allocatedSize)}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),ot(this._numerics[e],t,0)}_ensureInstanceId(e){ot(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),ot(this._strings[e],t,null)}createDisplayId(e=!1){const t=this._idGenerator.createId();return t>this._allocatedSize&&this._expand(),(0,_.QS)(t,e)}releaseDisplayId(e){for(const t of this._bitsets)t.unset(e);return this._idGenerator.releaseId(e&_._I)}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&_._I,0)}setComputedNumeric(e,t,s){return this.setComputedNumericAtIndex(e&_._I,s,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&_._I,0)}setComputedString(e,t,s){return this.setComputedStringAtIndex(e&_._I,0,s)}getComputedNumericAtIndex(e,t){const s=e&_._I;return this._ensureNumeric(t,s),this._numerics[t][s]}setComputedNumericAtIndex(e,t,s){const r=e&_._I;this._ensureNumeric(t,r),this._numerics[t][r]=s}getInstanceId(e){const t=e&_._I;return this._ensureInstanceId(t),this._instanceIds[t]}setInstanceId(e,t){const s=e&_._I;this._ensureInstanceId(s),this._instanceIds[s]=t}getComputedStringAtIndex(e,t){const s=e&_._I;return this._ensureString(t,s),this._strings[t][s]}setComputedStringAtIndex(e,t,s){const r=e&_._I;this._ensureString(t,r),this._strings[t][r]=s}getXMin(e){return this._bounds[4*(e&_._I)]}getYMin(e){return this._bounds[4*(e&_._I)+1]}getXMax(e){return this._bounds[4*(e&_._I)+2]}getYMax(e){return this._bounds[4*(e&_._I)+3]}setBounds(e,t){const s=t.readHydratedGeometry();if(!s||!s.coords.length)return!1;let r=1/0,i=1/0,n=-1/0,o=-1/0;s.forEachVertex(((e,t)=>{r=Math.min(r,e),i=Math.min(i,t),n=Math.max(n,e),o=Math.max(o,t)}));const a=e&_._I;return ot(this._bounds,4*a+4,0),this._bounds[4*a]=r,this._bounds[4*a+1]=i,this._bounds[4*a+2]=n,this._bounds[4*a+3]=o,!0}}function ht(e){if(!(0,u.D_)(e)&&!function(e){return"worker:port-closed"===e.name}(e))throw e}function ct(e){return"feature"===e.type&&"snapshot"===e.mode}let ut=class extends i.r{constructor(){super(...arguments),this._storage=new at,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initAttributeStore(),this._initStores(),this._initQueryEngine(),this._initSource(),this._updateQueue=new ie.e({concurrency:"geoevent"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this)),this.watch("updating",(e=>!e&&this.onIdle()))]),this._checkUpdating=setInterval((()=>this.notifyChange("updating")),300)}async startup(){this._initAttributeStore()}_initSource(){const e=this.tileStore.tileScheme;this._source=function(e,t,s,r,i,n){const o=function(e,t,s,r,i,n){switch(e.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:(0,c.Pt)(e.featureCount,0),serviceInfo:e,onMessage:r,outSR:t,tileInfoView:s,canAcceptRequest:i,store:n};case"stream":return{type:"geoevent",serviceInfo:e,onMessage:r,outSR:t,canAcceptRequest:i};case"memory":case"on-demand":return{type:"feature",serviceInfo:e,onMessage:r,outSR:t,origin:function(e){return Array.isArray(e)?"local":"path"in e&&(0,m.M8)(e.path)?"hosted":"unknown"}(e.source),tileInfoView:s,canAcceptRequest:i}}}(e,t,s,r,i,n);switch(o.type){case"feature":switch(o.origin){case"hosted":case"local":return new ke(o);case"snapshot":return new Ue(o);case"unknown":return new ce(o)}case"geoevent":return new Ae(o)}}(this.service,this.spatialReference,e,((e,t)=>(this._invalidated=!0,this._patchTile(e,t))),(()=>this._updateQueue.length<50),this.featureStore),this._proxyEvents()}_proxyEvents(){if("geoevent"===this._source.type){const e=this._source.events;this.handles.add([e.on("connectionStatus",(e=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:e}).catch(ht))),e.on("errorString",(e=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:e}).catch(ht))),e.on("feature",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(ht))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(ht)))])}}_initAttributeStore(){this.attributeStore?this.attributeStore.invalidateResources():this.attributeStore=new We({type:"remote",initialize:(e,t)=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.attributeView.initialize",e,{signal:t}).catch(ht)),update:(e,t)=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.attributeView.requestUpdate",e,{signal:t}).catch(ht)),render:e=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.requestRender",void 0,{signal:e}).catch(ht))},this.config)}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new f.p(t,this._storage,e),this.aggregateStore=new rt(t,this.spatialReference,this._storage),this.handles.add(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(ht)})))}_initQueryEngine(){var e;const t=this;null==(e=this.queryEngine)||e.destroy(),this.queryEngine=new p.Z({definitionExpression:this.config.definitionExpression,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds:e=>t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))},timeInfo:this.service.timeInfo})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.queryEngine.destroy(),this.attributeStore&&this.attributeStore.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new g.Z(this.service.fields)}get hasAggregates(){return!!this.config.schema.targets.aggregate}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){return this._source.updating||!!this._updateQueue.length}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}async update(e,t){this._set("config",t),this._schema=t.schema,this._initQueryEngine(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,this)]),await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),(0,n.Z)("esri-2d-update-debug")&&e.describe()}async applyUpdate(e){e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await(0,l.OY)(this,"updating",!0),this.hasAggregates&&(await(0,u.e4)(10),await(0,l.OY)(this,"updating",!0))}async onEdits({edits:e}){(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),s=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(s,t),this.clearTiles(),this.notifyChange("updating"),this.aggregateStore.clear(),await this._source.resend(),await(0,l.OY)(this,"updating",!0)}catch(e){}}async refresh(e){if(!e){const e=te.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(),this._cleanupNeeded=!0,this.notifyChange("updating"),await(0,l.OY)(this,"updating",!0)}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}onIdle(){this._invalidated&&((this.hasAggregates||"heatmap"===this.processor.type)&&this._repushCurrentLevelTiles(),this._invalidated=!1),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.queryEngine.executeQueryForSummaryStatistics(e,t)}async queryUniqueValues({query:e,params:t}){return this.queryEngine.executeQueryForUniqueValues(e,t)}async queryClassBreaks({query:e,params:t}){return this.queryEngine.executeQueryForClassBreaks(e,t)}async queryHistogram({query:e,params:t}){return this.queryEngine.executeQueryForHistogram(e,t)}queryExtent(e){return this.queryEngine.executeQueryForExtent(e)}queryFeatures(e){return this.queryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.queryEngine.executeQuery(e),s=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[s],r=this.getDisplayId(t);return this.attributeStore.isVisible(r)})),t}queryFeatureCount(e){return this.queryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.queryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.queryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(this._schema.targets.aggregate){const t=this.aggregateStore.getDisplayId(e);if((0,c.Wi)(t)){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],s=[];for(const r of e)if((0,_.nE)(r)){const e=this.getAggregate(r);if((0,c.pC)(e))if((0,c.pC)(e.referenceId)){const s=this.getFeature(e.referenceId);(0,c.pC)(s)&&t.push(s)}else s.push(e)}else{const e=this.getFeature(r);(0,c.pC)(e)&&t.push(e)}return{features:t,aggregates:s}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if((0,c.Wi)(t))return null;const s=t.readHydratedGeometry(),r=(0,d.di)(s,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:r}}getAggregate(e){return this.aggregateStore.getAggregate(e)}getAggregates(){return this.aggregateStore.getAggregates()}async setHighlight(e){const t=e.map((e=>this.getDisplayId(e)));return this.attributeStore.setHighlight(e,t)}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if((0,c.Wi)(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.featureStore.forEach((r=>{e===r.readAttribute(t)&&(s=r.getObjectId())})),(0,c.Wi)(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}_repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level));for(const t of e)this._patchTile({type:"append",id:t.key.id,addOrUpdate:F.fromOptimizedFeatures([],this.service.geometryType),remove:[],end:!0,status:te.empty()})}_maybeForceCleanup(){performance.now()-this._lastCleanup>5e3&&this._markAndSweep()}_patchTile(e,t){const s=this._updateQueue.push(e,t).then((()=>{this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating")}));return this.notifyChange("updating"),s}async _onTileMessage(e,t){(0,u.k_)(t);const s=this.tileStore.get(e.id);if(!s)return;if(e.clear)return this.processor.onTileClear(s);const r=e.status;this._cleanupNeeded=!0;const i=[];for(const t of e.remove){const e=this.featureStore.lookupDisplayId(t);e&&i.push(e)}e.remove=i;try{if((0,c.Wi)(e.addOrUpdate))return void this.processor.onTileMessage(s,{...e,addOrUpdate:null},this.hasAggregates,t).catch(u.H9);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&r.targets.feature||(r.targets.feature=!0,this.featureStore.onTileData(s,e)),r.storage.data&&r.storage.filters||(r.storage.data=!0,r.storage.filters=!0,this.attributeStore.onTileData(s,e),"geoevent"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),(0,u.k_)(t)):this.attributeStore.sendUpdates()),this.hasAggregates&&!r.targets.aggregate){r.targets.aggregate=!0;const t=ct(this._source)&&this._source.loading,i=!ct(this._source)||t||e.end;if(this.aggregateStore.onTileData(s,e,this._storage,this.attributeStore,i),!i)return;r.mesh||(this.attributeStore.onTileData(s,e),await this.attributeStore.sendUpdates(),this.processor.onTileClear(s))}r.mesh||(r.mesh=!0,await this.processor.onTileMessage(s,e,this.hasAggregates,t),(0,u.k_)(t)),this._maybeForceCleanup()}catch(e){(0,u.H9)(e)}}_mark(e,t,s){const r=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(r),s.set(e))}_markAndSweep(){if(this._lastCleanup=performance.now(),"feature"===this._source.type&&"snapshot"===this._source.mode||"geoevent"!==this._source.type&&!this._cleanupNeeded)return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const s of this.tileStore.tiles)for(const r of this._source.readers(s.id)){const s=r.getCursor();for(;s.next();){let r=s.getDisplayId();if(!r){const e=s.getObjectId();r=this.featureStore.lookupDisplayId(e)}this._mark(r,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((s=>{this._mark(s,t,e)})),this._updateQueue.forEach((s=>{for(const r of s.remove){const s=this.featureStore.lookupDisplayId(r);this._mark(s,t,e)}})),this.config.schema.targets.aggregate&&(this.aggregateStore.sweepFeatures(e,this.featureStore),this.aggregateStore.sweepClusters(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};(0,r._)([(0,o.Cb)({constructOnly:!0})],ut.prototype,"tileStore",void 0),(0,r._)([(0,o.Cb)()],ut.prototype,"config",void 0),(0,r._)([(0,o.Cb)({readOnly:!0})],ut.prototype,"fieldsIndex",null),(0,r._)([(0,o.Cb)()],ut.prototype,"processor",void 0),(0,r._)([(0,o.Cb)({constructOnly:!0})],ut.prototype,"remoteClient",void 0),(0,r._)([(0,o.Cb)({constructOnly:!0})],ut.prototype,"service",void 0),(0,r._)([(0,o.Cb)()],ut.prototype,"spatialReference",null),(0,r._)([(0,o.Cb)()],ut.prototype,"updating",null),ut=(0,r._)([(0,a.j)("esri.views.2d.layers.features.controllers.FeatureController2D")],ut);const lt=ut;var dt=s(3651),pt=s(67524),gt=s(55415);const _t={added:[],removed:[]},ft=new Set,mt=new gt.Z(0,0,0,0);class yt extends $.Z{constructor(e){super(),this._tiles=new Map,this._index=(0,ue.r)(9,(0,n.Z)("esri-csp-restrictions")?e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const s of e.added)if(!this.has(s)){const e=new dt.n(this.tileScheme,s);this._tiles.set(s,e),this._index.insert(e),t.added.push(e)}for(const s of e.removed)if(this.has(s)){const e=this.get(s);this._tiles.delete(s),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach((e=>this.tiles.push(e))),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:s,lodInfo:r}=t,{level:i}=r;if(s.length>0)for(const{row:e,colFrom:t,colTo:n}of s)for(let s=t;s<=n;s++){const t=mt.set(i,e,r.normalizeCol(s),r.getWorldForColumn(s)).id;if(ft.add(t),!this.has(t)){const e=new dt.n(this.tileScheme,t);this._tiles.set(t,e),this._index.insert(e),this.tiles.push(e),_t.added.push(e)}}for(let e=this.tiles.length-1;e>=0;e--){const t=this.tiles[e];ft.has(t.id)||(this._tiles.delete(t.id),this.tiles.splice(e,1),this._index.remove(t),_t.removed.push(t))}(_t.added.length||_t.removed.length)&&this.emit("update",_t),pt.Z.pool.release(t),ft.clear(),_t.added.length=0,_t.removed.length=0}}var It=s(83068);const xt=new Set;function bt(){return xt}let wt=class extends i.r{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(this.watch("updating",(e=>{this.remoteClient.invoke("setUpdating",e).catch((e=>{}))})))}destroy(){var e,t,s;null==(e=this.controller)||e.destroy(),null==(t=this.processor)||t.destroy(),null==(s=this.tileStore)||s.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}async startup({service:e,config:t,tileInfo:s,tiles:r}){if(this._paused=!0,this.service=e,!this.tileStore){const e=new It.Z(h.Z.fromJSON(s));this.tileStore=new yt(e)}for(await this._createProcessorAndController(t),await this.update({config:t},!0),this.tileStore.clear(),this.tileStore.updateTiles(r),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore.updateTiles(e)}async update({config:e},t=!1){const s=te.empty();return t||this.controller.pause(),await Promise.all([this.processor.update(s,e),this.controller.update(s,e)]),s.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(te.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){const t=await this._createController(this.service,e);return await t.startup(),t}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,t){this.controller&&this.controller.destroy();const{tileStore:s,remoteClient:r}=this,i=new lt({service:e,config:t,tileStore:s,remoteClient:r});return this.controller=i,i}async _createProcessor(e,t){const r=t.schema.processors[0].type,i=(await function(e){return"heatmap"===e?s.e(2399).then(s.bind(s,12399)):Promise.all([s.e(8422),s.e(6810),s.e(3437)]).then(s.bind(s,61945))}(r)).default,{remoteClient:n,tileStore:o}=this,a=new i({service:e,config:t,tileStore:o,remoteClient:n});return this.processor&&this.processor.destroy(),this.processor=a,a}};(0,r._)([(0,o.Cb)()],wt.prototype,"controller",void 0),(0,r._)([(0,o.Cb)()],wt.prototype,"processor",void 0),(0,r._)([(0,o.Cb)()],wt.prototype,"updating",null),(0,r._)([(0,o.Cb)()],wt.prototype,"viewState",void 0),wt=(0,r._)([(0,a.j)("esri.views.2d.layers.features.Pipeline")],wt);const vt=wt},59999:(e,t,s)=>{s.d(t,{J:()=>c});var r=s(80442),i=s(70586),n=s(22862),o=s(59266),a=s(92604);const h=s.e(4695).then(s.bind(s,14695));class c{constructor(e,t){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._bitsets={computed:t.getBitset(t.createBitset())}}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,t){const s=(0,n.Hg)(this._schema,t);if(this._schema=t,!t||(0,i.Wi)(s)||!(0,n.uD)(s,"attributes"))return;(0,r.Z)("esri-2d-update-debug")&&console.debug("Applying Update - Store:",s),this._bitsets.computed.clear(),e.targets[t.name]=!0;const o=t.attributes,a=[],h=[];for(const e in o){const t=o[e];switch(t.type){case"field":break;case"expression":a.push(this._createArcadeComputedField(t));break;case"label-expression":a.push(this._createLabelArcadeComputedField(t));break;case"statistic":h.push(t)}}this._computedFields=await Promise.all(a),this._canCacheExpressionValue=!this._computedFields.some((e=>"expression"===e.type&&e.expression.referencesScale())),this._statisticFields=h}setComputedAttributes(e,t,s,r){const i=this._bitsets.computed;if(!this._canCacheExpressionValue||!i.has(s)){i.set(s);for(const i of this._computedFields){const n=this._evaluateField(t,i,r);switch(i.resultType){case"numeric":e.setComputedNumericAtIndex(s,i.fieldIndex,n);break;case"string":e.setComputedStringAtIndex(s,i.fieldIndex,n)}}}}async _createArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex;return{...e,expression:await(0,o.Yi)(e.valueExpression,t,s)}}async _createLabelArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex,{createLabelFunction:r}=await h,i=await r(e.label,s,t);return{...e,builder:i}}_evaluateField(e,t,s){switch(t.type){case"label-expression":{const s=e.readArcadeFeature();return t.builder.evaluate(s)||""}case"expression":{const{expression:r}=t;return function(e,t,s){e.referencesGeometry();const r=t.readArcadeFeature();try{return e.evaluate({...s,$feature:r})}catch(e){return a.Z.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",e),null}}(r,e,{$view:{scale:s}})}}}}},87554:(e,t,s)=>{s.d(t,{s:()=>T}),s(66577);var r,i,n,o=s(80442),a=s(70586),h=s(29730),c=s(98732),u=s(5428),l=s(93054),d=s(33955);let p=0;const g=null!=(r=(0,o.Z)("featurelayer-simplify-thresholds"))?r:[.5,.5,.5,.5],_=g[0],f=g[1],m=g[2],y=g[3],I=null!=(i=(0,o.Z)("featurelayer-simplify-payload-size-factors"))?i:[1,2,4],x=I[0],b=I[1],w=I[2],v=null!=(n=(0,o.Z)("featurelayer-simplify-mobile-factor"))?n:2,S=(0,o.Z)("esri-mobile");class T{constructor(e){this.type="FeatureSetReader",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this.instance=e}static createInstance(){return p++,p=p>65535?0:p,p}get isEmpty(){return(0,a.pC)(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let s=1;const r=S?v:1;t>4e6?s=w*r:t>1e6?s=b*r:t>5e5?s=x*r:t>1e5&&(s=r);let i=0;e>4e3?i=y*s:e>2e3?i=m*s:e>100?i=f:e>15&&(i=_);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),i*n}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,s,r){const i=this.copy();return i._tx+=e,i._ty+=t,i._sx*=s,i._sy*=r,i}readAttribute(e,t=!1){const s=this._readAttribute(e,t);if(void 0!==s)return s;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const s=t._readAttributes();for(const t of Object.keys(s))e[t]=s[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}geometry(){const e=this.readHydratedGeometry(),t=(0,c.di)(e,this.geometryType,this.hasZ,this.hasM),s=(0,d.im)(t);return s&&(s.spatialReference=this._arcadeSpatialReference),s}field(e){return this.readAttribute(e,!0)}hasField(e){return!0}setField(e,t){}keys(){return[]}castToText(){return""}removeIds(e){if((0,a.Wi)(this._objectIdToIndex)){const e=new Map,t=this.getCursor();for(;t.next();)e.set(t.getObjectId(),t.getIndex());this._objectIdToIndex=e}const t=this._objectIdToIndex;for(const s of e)t.has(s)&&this.removeAtIndex(t.get(s))}removeAtIndex(e){(0,a.Wi)(this._deleted)&&(this._deleted=l.p.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return(0,a.Wi)(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=(0,a.Pt)(this.getQuantizationTransform(),null);return(0,h.Y)(new u.Z,e,this.hasM,this.hasZ,t)}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}}},61800:(e,t,s)=>{s.d(t,{t:()=>i});var r=s(87554);class i extends r.s{constructor(e,t){super(r.s.createInstance()),this._currentIndex=-1,this._reader=e,this._indices=t}static from(e,t){return new i(e.copy(),t)}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new i(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}setArcadeSpatialReference(e){this._reader.setArcadeSpatialReference(e)}attachStorage(e){this._reader.attachStorage(e)}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}getStorage(){return this._reader.getStorage()}getComputedNumeric(e){return this._reader.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this._reader.setComputedNumericAtIndex(t,0)}getComputedString(e){return this._reader.getComputedStringAtIndex(0)}setComputedString(e,t){return this._reader.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._reader.getComputedNumericAtIndex(e)}setComputedNumericAtIndex(e,t){this._reader.setComputedNumericAtIndex(e,t)}getComputedStringAtIndex(e){return this._reader.getComputedStringAtIndex(e)}setComputedStringAtIndex(e,t){return this._reader.setComputedStringAtIndex(e,t)}transform(e,t,s,r){const i=this.copy();return i._reader=this._reader.transform(e,t,s,r),i}readAttribute(e,t=!1){return this._reader.readAttribute(e,t)}readAttributes(){return this._reader.readAttributes()}joinAttributes(e){return this._reader.joinAttributes(e)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this.readAttribute(e,!0)}hasField(e){return this._reader.hasField(e)}setField(e,t){return this._reader.setField(e,t)}keys(){return this._reader.keys()}castToText(){return this._reader.castToText()}getQuantizationTransform(){return this._reader.getQuantizationTransform()}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}getGroupId(){return this._reader.getGroupId()}setGroupId(e){return this._reader.setGroupId(e)}getXHydrated(){return this._reader.getXHydrated()}getYHydrated(){return this._reader.getYHydrated()}getX(){return this._reader.getX()}getY(){return this._reader.getY()}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readLegacyFeature(){return this._reader.readLegacyFeature()}readOptimizedFeature(){return this._reader.readOptimizedFeature()}readLegacyPointGeometry(){return this._reader.readLegacyPointGeometry()}readLegacyGeometry(){return this._reader.readLegacyGeometry()}readLegacyCentroid(){return this._reader.readLegacyCentroid()}readGeometryArea(){return this._reader.readGeometryArea()}readUnquantizedGeometry(){return this._reader.readUnquantizedGeometry()}readHydratedGeometry(){return this._reader.readHydratedGeometry()}readGeometry(){return this._reader.readGeometry()}readCentroid(){return this._reader.readCentroid()}_readAttribute(e,t){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}}},93054:(e,t,s)=>{s.d(t,{p:()=>r});class r{constructor(e,t){this._mask=0,this._buf=e,this._mask=t}static fromBuffer(e,t){return new r(e,t)}static create(e,t=4294967295){const s=new Uint32Array(Math.ceil(e/32));return new r(s,t)}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<<t%32)}hasRange(e,t){let s=e,r=t;for(;s%32&&s!==r;){if(this.has(s))return!0;s++}for(;r%32&&s!==r;){if(this.has(s))return!0;r--}if(s===r)return!1;for(let e=s/32;e!==r/32;e++)if(this._buf[e])return!0;return!1}set(e){const t=this._mask&e,s=this._getIndex(t),r=1<<t%32;this._buf[s]|=r}setRange(e,t){let s=e,r=t;for(;s%32&&s!==r;)this.set(s++);for(;r%32&&s!==r;)this.set(r--);if(s!==r)for(let e=s/32;e!==r/32;e++)this._buf[e]=4294967295}unset(e){const t=this._mask&e,s=this._getIndex(t),r=1<<t%32;this._buf[s]&=4294967295^r}resize(e){const t=this._buf,s=new Uint32Array(Math.ceil(e/32));s.set(t),this._buf=s}or(e){for(let t=0;t<this._buf.length;t++)this._buf[t]|=e._buf[t];return this}and(e){for(let t=0;t<this._buf.length;t++)this._buf[t]&=e._buf[t];return this}xor(e){for(let t=0;t<this._buf.length;t++)this._buf[t]^=e._buf[t];return this}ior(e){for(let t=0;t<this._buf.length;t++)this._buf[t]|=~e._buf[t];return this}iand(e){for(let t=0;t<this._buf.length;t++)this._buf[t]&=~e._buf[t];return this}ixor(e){for(let t=0;t<this._buf.length;t++)this._buf[t]^=~e._buf[t];return this}any(){for(let e=0;e<this._buf.length;e++)if(this._buf[e])return!0;return!1}copy(e){for(let t=0;t<this._buf.length;t++)this._buf[t]=e._buf[t];return this}clone(){return new r(this._buf.slice(),this._mask)}clear(){for(let e=0;e<this._buf.length;e++)this._buf[e]=0}forEachSet(e){for(let t=0;t<this._buf.length;t++){let s=this._buf[t],r=32*t;if(s)for(;s;)1&s&&e(r),s>>>=1,r++}}countSet(){let e=0;return this.forEachSet((t=>{e++})),e}}},3651:(e,t,s)=>{s.d(t,{n:()=>h});var r=s(3894),i=s(6570),n=s(24470),o=s(6388),a=s(55415);class h{constructor(e,t){this.key=new a.Z(0,0,0,0),this.bounds=(0,n.Ue)(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.scale=s.scale,this.level=s.level}get id(){return this.key.id}get extent(){return i.Z.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),t=r.Z.acquire();for(let s=0;s<e.length;s++)t[s]=new h(this.tileInfoView,e[s]);return t}getQuantizationParameters(){return o.Z.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})}}},67524:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(71143);class i{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}forEach(e,t){const{spans:s,lodInfo:r}=this,{level:i}=r;if(0!==s.length)for(const{row:n,colFrom:o,colTo:a}of s)for(let s=o;s<=a;s++)e.call(t,i,n,r.normalizeCol(s),r.getWorldForColumn(s))}}i.pool=new r.Z(i)},83068:(e,t,s)=>{s.d(t,{Z:()=>_});var r=s(8744),i=s(70586),n=s(55415);function o(e,t){return[e,t]}function a(e,t,s){return e[0]=t,e[1]=s,e}const h=new n.Z("0/0/0/0");class c{constructor(e,t,s,r,i,n,o,a,h,c,u,l){this.level=e,this.resolution=t,this.scale=s,this.origin=r,this.first=i,this.last=n,this.size=o,this.norm=a,this.worldStart=h,this.worldEnd=c,this.worldSize=u,this.wrap=l}static create(e,t,s=null){const n=(0,r.C5)(e.spatialReference),h=t.origin||o(e.origin.x,e.origin.y),u=o(e.size[0]*t.resolution,e.size[1]*t.resolution),l=o(-1/0,-1/0),d=o(1/0,1/0),p=o(1/0,1/0);(0,i.pC)(s)&&(a(l,Math.max(0,Math.floor((s.xmin-h[0])/u[0])),Math.max(0,Math.floor((h[1]-s.ymax)/u[1]))),a(d,Math.max(0,Math.floor((s.xmax-h[0])/u[0])),Math.max(0,Math.floor((h[1]-s.ymin)/u[1]))),a(p,d[0]-l[0]+1,d[1]-l[1]+1));const{cols:g,rows:_}=t;let f,m,y,I;return!s&&g&&_&&(a(l,g[0],_[0]),a(d,g[1],_[1]),a(p,g[1]-g[0]+1,_[1]-_[0]+1)),e.isWrappable?(f=o(Math.ceil(Math.round((n.valid[1]-n.valid[0])/t.resolution)/e.size[0]),p[1]),m=o(Math.floor((n.origin[0]-h[0])/u[0]),l[1]),y=o(f[0]+m[0]-1,d[1]),I=!0):(m=l,y=d,f=p,I=!1),new c(t.level,t.resolution,t.scale,h,l,d,p,u,m,y,f,I)}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){return this.origin[0]+e*this.norm[0]}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,s=!1){h.set(t);const r=s?h.col:this.denormalizeCol(h.col,h.world),i=h.row;return function(e,t,s,r,i){e[0]=t,e[1]=s,e[2]=r,e[3]=i}(e,this.getXForColumn(r),this.getYForRow(i+1),this.getXForColumn(r+1),this.getYForRow(i)),e}getTileCoords(e,t,s=!1){h.set(t);const r=s?h.col:this.denormalizeCol(h.col,h.world);return Array.isArray(e)?a(e,this.getXForColumn(r),this.getYForRow(h.row)):(e.x=this.getXForColumn(r),e.y=this.getYForRow(h.row)),e}}var u=s(67524);class l{constructor(e,t,s){this.row=e,this.colFrom=t,this.colTo=s}}const d=new n.Z("0/0/0/0");class p{constructor(e,t,s,r,i,n,o,a){this.x=e,this.ymin=t,this.ymax=s,this.invM=r,this.leftAdjust=i,this.rightAdjust=n,this.leftBound=o,this.rightBound=a}static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[s,r]=e,[i,n]=t,o=i-s,a=n-r,h=0!==a?o/a:0,c=(Math.ceil(r)-r)*h,u=(Math.floor(r)-r)*h;return new p(s,Math.floor(r),Math.ceil(n),h,o<0?c:u,o<0?u:c,o<0?i:s,o<0?s:i)}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const g=[[0,0],[0,0],[0,0],[0,0]];class _{constructor(e,t=null){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._lodInfos=null,this._infoByScale={},this._infoByLevel={};const s=e.lods.slice();s.sort((function(e,t){return t.scale-e.scale}));const r=this._lodInfos=s.map((s=>c.create(e,s,t)));s.forEach(((e,t)=>{this._infoByLevel[e.level]=r[t],this._infoByScale[e.scale]=r[t],this.scales[t]=e.scale}),this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel["number"==typeof e?e:e.level]}getTileBounds(e,t,s=!1){d.set(t);const r=this._infoByLevel[d.level];return r?r.getTileBounds(e,d,s):e}getTileCoords(e,t,s=!1){d.set(t);const r=this._infoByLevel[d.level];return r?r.getTileCoords(e,d,s):e}getTileCoverage(e,t=192,s="closest"){const r="closest"===s?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),i=u.Z.pool.acquire(r),n=this._wrap;let o,a,h,c=1/0,d=-1/0;const _=i.spans;g[0][0]=g[0][1]=g[1][1]=g[3][0]=-t,g[1][0]=g[2][0]=e.size[0]+t,g[2][1]=g[3][1]=e.size[1]+t;for(const t of g)e.toMap(t,t),t[0]=r.getColumnForX(t[0]),t[1]=r.getRowForY(t[1]);const f=[];let m=3;for(let e=0;e<4;e++){if(g[e][1]===g[m][1]){m=e;continue}const t=p.create(g[e],g[m]);c=Math.min(t.ymin,c),d=Math.max(t.ymax,d),void 0===f[t.ymin]&&(f[t.ymin]=[]),f[t.ymin].push(t),m=e}if(null==c||null==d||d-c>100)return null;let y=[];for(o=c;o<d;){null!=f[o]&&(y=y.concat(f[o])),a=1/0,h=-1/0;for(let e=y.length-1;e>=0;e--){const t=y[e];a=Math.min(a,t.getLeftCol()),h=Math.max(h,t.getRightCol())}if(a=Math.floor(a),h=Math.floor(h),o>=r.first[1]&&o<=r.last[1])if(n)if(r.size[0]<r.worldSize[0]){const e=Math.floor(h/r.worldSize[0]);for(let t=Math.floor(a/r.worldSize[0]);t<=e;t++)_.push(new l(o,Math.max(r.getFirstColumnForWorld(t),a),Math.min(r.getLastColumnForWorld(t),h)))}else _.push(new l(o,a,h));else a>r.last[0]||h<r.first[0]||(a=Math.max(a,r.first[0]),h=Math.min(h,r.last[0]),_.push(new l(o,a,h)));o+=1;for(let e=y.length-1;e>=0;e--){const t=y[e];t.ymax>=o?t.incrRow():y.splice(e,1)}}return i}getTileParentId(e){d.set(e);const t=this._infoByLevel[d.level],s=this._lodInfos.indexOf(t)-1;return s<0?null:(this._getTileIdAtLOD(d,this._lodInfos[s],d),d.id)}getTileResolution(e){const t=this._infoByLevel["object"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){d.set(t);const s=this._infoByLevel[d.level],r=e.lodInfo;if(r.resolution>s.resolution){this._getTileIdAtLOD(d,r,d);const t=r.denormalizeCol(d.col,d.world);for(const s of e.spans)if(s.row===d.row&&s.colFrom<=t&&s.colTo>=t)return!0}if(r.resolution<s.resolution){const[t,i,n,o]=e.spans.reduce(((e,t)=>(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e)),[1/0,-1/0,1/0,-1/0]),a=s.denormalizeCol(d.col,d.world),h=r.getColumnForX(s.getXForColumn(a)),c=r.getRowForY(s.getYForRow(d.row)),u=r.getColumnForX(s.getXForColumn(a+1))-1,l=r.getRowForY(s.getYForRow(d.row+1))-1;return!(h>o||u<n||c>i||l<t)}const i=r.denormalizeCol(d.col,d.world);return e.spans.some((e=>e.row===d.row&&e.colFrom<=i&&e.colTo>=i))}normalizeBounds(e,t,s){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const t=(0,r.C5)(this.tileInfo.spatialReference),i=-s*(t.valid[1]-t.valid[0]);e[0]+=i,e[2]+=i}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let s=1;s<t.length-1;s++)if(e>t[s]+1e-6)return this._infoByScale[t[s-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce(((t,s)=>Math.abs(s-e)<Math.abs(t-e)?s:t),t[0])),this._infoByScale[e]}scaleToLevel(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let s=t.length-1;s>=0;s--)if(e<t[s])return s===t.length-1?this._infoByScale[t[t.length-1]].level:this._infoByScale[t[s]].level+(t[s]-e)/(t[s]-t[s+1]);return this._infoByScale[t[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}_getTileIdAtLOD(e,t,s){const r=this._infoByLevel[s.level];return e.set(s),t.resolution<r.resolution?null:(t.resolution===r.resolution||(e.level=t.level,e.col=Math.floor(s.col*r.resolution/t.resolution+.01),e.row=Math.floor(s.row*r.resolution/t.resolution+.01)),e)}}},55415:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(71143);class i{constructor(e,t,s,r){this.set(e,t,s,r)}static getId(e,t,s,r){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${s}/${r}`}get key(){return this}get id(){return this.toString()}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,s=63&this.level;return(3&this.world)<<30|t<<22|e<<8|s}acquire(e,t,s,r){this.set(e,t,s,r)}contains(e){const t=e.level-this.level;return this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new i(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,s,r){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,s,r,i]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(s),this.col=parseFloat(r),this.world=parseFloat(i)}else this.level=+e,this.row=+t,this.col=+s,this.world=+r||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new i(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,t=this.row<<1,s=this.col<<1,r=this.world;return[new i(e,t,s,r),new i(e,t,s+1,r),new i(e,t+1,s,r),new i(e,t+1,s+1,r)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}i.pool=new r.Z(i,null,null,25,50)},34084:(e,t,s)=>{s.d(t,{e:()=>h});var r=s(70586),i=s(95330);class n{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(0===this._items.size)return;let e;for(e of this._items);return e}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,r.j0)(e)),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete((0,r.j0)(e)),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}var o=s(1654);class a{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class h{constructor(e){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new n(e.peeker),this.process=e.process;const t=e.scheduler;e.priority&&(0,r.pC)(t)&&(this._task=t.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule&&(this._schedule.remove(),this._schedule=null),this._task&&(this._task.remove(),this._task=null)}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,s)=>e(s)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(e,t){const s=this.get(e);if(s)return s;const n=new AbortController;let o=null;t&&(o=(0,i.fu)(t,(()=>n.abort())));const a=()=>{h.remove(),(0,r.pC)(o)&&o.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},h=(0,i.$F)(n.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),c.reject((0,i.zE)())})),c=(0,i.dD)();return this._deferreds.set(e,c),this._controllers.set(e,n),c.promise.then(a,a),this._queue.push(e),this._scheduleNext(),c.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach((t=>e.push(t))),this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._isPaused&&this._queue.length>0&&this._processingItems.size<this.concurrency}runTask(e){for(;!e.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),e.madeProgress()}_scheduleNext(){this._task||this._isPaused||this._schedule||(this._schedule=(0,o.Os)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if((0,r.Wi)(e))return;let t;const s=new AbortController,n=new a(e,s);this._processingItems.set(e,n);try{t=this.process(e,s.signal)}catch(e){this._processError(n,e)}(0,i.y8)(t)?(n.promise=t,t.then((e=>this._processResult(n,e)),(e=>this._processError(n,e)))):this._processResult(n,t)}get test(){return{update:e=>this.runTask(e)}}}},89749:(e,t,s)=>{s.d(t,{t:()=>l});var r=s(43697),i=s(15923),n=s(61247),o=s(70586),a=s(17445),h=s(1654),c=s(5600),u=s(52011);let l=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,a.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,a.on)(e,"after-changes",this._createSyncUpdatingCallback(),a.Z_),(0,a.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,o.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(d)||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,a.YP)(e,s,{sync:!0,equals:()=>!1});return this.handles.add(r,t),r}_createSyncUpdatingCallback(){return()=>{this.handles.remove(d),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,h.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(d))})),d)}}};(0,r._)([(0,c.Cb)({readOnly:!0})],l.prototype,"updating",void 0),l=(0,r._)([(0,u.j)("esri.views.support.WatchUpdatingTracking")],l);const d=-42;var p,g;(g=p||(p={}))[g.NONE=0]="NONE",g[g.SYNC=1]="SYNC",g[g.INIT=2]="INIT"},75656:(e,t,s)=>{s.d(t,{x:()=>c});var r=s(22021),i=s(70586),n=s(49300),o=s(54738),a=s(35371),h=s(46314);class c{constructor(e,t,s=null){this._context=e,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,e.instanceCounter.increment(a._g.Texture,this),this._descriptor={target:a.No.TEXTURE_2D,samplingMode:a.cw.LINEAR,wrapMode:a.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,...t},this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(s):this.setData(s)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTextureAllUnits(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(a._g.Texture,this))}release(){this.dispose()}resize(e,t){const s=this._descriptor;s.width===e&&s.height===t||(s.width=e,s.height=t,this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null))}_setDataCubeMap(e=null){for(let t=a.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=a.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this.setData(e,t)}setData(e,t=a.No.TEXTURE_2D){if(!this._context||!this._context.gl)return;const s=this._context.gl;this._glName||(this._glName=s.createTexture()),void 0===e&&(e=null),null===e&&(this._descriptor.width=this._descriptor.width||4,this._descriptor.height=this._descriptor.height||4);const r=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES),o=this._descriptor;c._validateTexture(this._context,o),s.pixelStorei(s.UNPACK_ALIGNMENT,o.unpackAlignment),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,o.flipped?1:0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.preMultiplyAlpha?1:0);const h=o.pixelFormat;let u=o.internalFormat?o.internalFormat:this._deriveInternalFormat(h,o.dataType);if(e instanceof ImageData||e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let r=e.width,i=e.height;e instanceof HTMLVideoElement&&(r=e.videoWidth,i=e.videoHeight),o.width&&o.height,s.texImage2D(t,0,u,h,o.dataType,e),(0,n.zu)(s),o.hasMipmap&&this.generateMipmap(),void 0===o.width&&(o.width=r),void 0===o.height&&(o.height=i)}else{null!=o.width&&null!=o.height||console.error("Width and height must be specified!"),s.DEPTH24_STENCIL8&&u===s.DEPTH_STENCIL&&(u=s.DEPTH24_STENCIL8);let r=o.width,a=o.height;if(function(e){return(0,i.pC)(e)&&"type"in e&&"compressed"===e.type}(e)){const i=Math.round(Math.log(Math.max(r,a))/Math.LN2)+1;o.hasMipmap=o.hasMipmap&&i===e.levels.length;for(let i=0;;++i){const n=e.levels[Math.min(i,e.levels.length-1)];if(s.compressedTexImage2D(t,i,u,r,a,0,n),1===r&&1===a||!o.hasMipmap)break;r=Math.max(1,r>>1),a=Math.max(1,a>>1)}}else if((0,i.pC)(e))s.texImage2D(t,0,u,r,a,0,h,o.dataType,e),(0,n.zu)(s),o.hasMipmap&&this.generateMipmap();else for(let e=0;s.texImage2D(t,e,u,r,a,0,h,o.dataType,null),(0,n.zu)(s),(1!==r||1!==a)&&o.hasMipmap;++e)r=Math.max(1,r>>1),a=Math.max(1,a>>1)}c._applySamplingMode(s,this._descriptor),c._applyWrapMode(s,this._descriptor),c._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,n.zu)(s),this._context.bindTexture(r,c.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,s,r,i,n,o=a.No.TEXTURE_2D){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const h=this._context.gl,u=this._descriptor,l=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);(t<0||s<0||r>u.width||i>u.height||t+r>u.width||s+i>u.height)&&console.error("An attempt to update out of bounds of the texture!"),h.pixelStorei(h.UNPACK_ALIGNMENT,u.unpackAlignment),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,u.flipped?1:0),h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u.preMultiplyAlpha?1:0),n instanceof ImageData||n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement?h.texSubImage2D(o,e,t,s,u.pixelFormat,u.dataType,n):h.texSubImage2D(o,e,t,s,r,i,u.pixelFormat,u.dataType,n),this._context.bindTexture(l,c.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;e.hasMipmap||(e.hasMipmap=!0,this._samplingModeDirty=!0,c._validateTexture(this._context,e)),e.samplingMode===a.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=a.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===a.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=a.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,c.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,c._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(c._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(c._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===o.zO.WEBGL1)return e;if(t===a.Br.FLOAT)switch(e){case a.VI.RGBA:return a.VI.RGBA32F;case a.VI.RGB:return a.VI.RGB32F;default:throw new Error("Unable to derive format")}return e}static _validateTexture(e,t){(t.width<0||t.height<0)&&console.error("Negative dimension parameters are not allowed!");const s=(0,r.wt)(t.width)&&(0,r.wt)(t.height);(0,h.Z)(e.gl)||s||("number"==typeof t.wrapMode?t.wrapMode!==a.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===a.e8.CLAMP_TO_EDGE&&t.wrapMode.t===a.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let s=t.samplingMode,r=t.samplingMode;s===a.cw.LINEAR_MIPMAP_NEAREST||s===a.cw.LINEAR_MIPMAP_LINEAR?(s=a.cw.LINEAR,t.hasMipmap||(r=a.cw.LINEAR)):s!==a.cw.NEAREST_MIPMAP_NEAREST&&s!==a.cw.NEAREST_MIPMAP_LINEAR||(s=a.cw.NEAREST,t.hasMipmap||(r=a.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,s),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){var s;const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,null!=(s=t.maxAnisotropy)?s:1)}}c.TEXTURE_UNIT_FOR_UPDATES=0},46314:(e,t,s)=>{function r(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}s.d(t,{Z:()=>r})},49300:(e,t,s)=>{s.d(t,{zu:()=>c,hZ:()=>a,CG:()=>h});var r=s(20102),i=s(80442);const n=s(92604).Z.getLogger("esri/views/webgl"),o=!!(0,i.Z)("enable-feature:webgl-debug");function a(){return o}function h(){return o}function c(e){if(a()){const t=e.getError();if(t){const s=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),i=(new Error).stack;n.error(new r.Z("webgl-error","WebGL error occured",{message:s,stack:i}))}}}},54738:(e,t,s)=>{var r,i;function n(e,t,s={}){const i=t===r.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let n=null;for(const t of i){try{n=e.getContext(t,s)}catch(e){}if(n)break}return n}s.d(t,{zO:()=>r,kr:()=>n}),s(80442),(i=r||(r={}))[i.WEBGL1=1]="WEBGL1",i[i.WEBGL2=2]="WEBGL2"}}]);