@arcgis/core 4.27.0-rc.2 → 4.27.0-rc.4

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 (192) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{a8565d1c676f3bfbcebb.js → 002fe1ec63ea33e6972d.js} +1 -1
  3. package/assets/esri/core/workers/chunks/09e677ca7532a281d262.js +1 -0
  4. package/assets/esri/core/workers/chunks/0f7ddb063ee0664f2fca.js +1 -0
  5. package/assets/esri/core/workers/chunks/17ab08f60764244b2cf8.js +1 -0
  6. package/assets/esri/core/workers/chunks/1aa8dd317ecd3c41e0ea.js +1 -0
  7. package/assets/esri/core/workers/chunks/28c67c98039503b62e6e.js +1 -0
  8. package/assets/esri/core/workers/chunks/{2446e336b1f7256d4fde.js → 2c587ed66e2586cccb8d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/3767b9e7660873b018c2.js +1 -0
  10. package/assets/esri/core/workers/chunks/{00c7b9fb375c9a934158.js → 38c6452dc9cf18e8bca8.js} +1 -1
  11. package/assets/esri/core/workers/chunks/39ae4b9b766f674bc6f2.js +1 -0
  12. package/assets/esri/core/workers/chunks/45629ff775e77234b227.js +1 -0
  13. package/assets/esri/core/workers/chunks/{16db0bc87d87a7313dc4.js → 4806df402845c717c842.js} +1 -1
  14. package/assets/esri/core/workers/chunks/4884432d80e9af947449.js +1 -0
  15. package/assets/esri/core/workers/chunks/4a4f14a3d8da270059c4.js +1 -0
  16. package/assets/esri/core/workers/chunks/588cd91d08cec5207be1.js +1 -0
  17. package/assets/esri/core/workers/chunks/{83e3d104886b48f00397.js → 633c00c02a81397fc8df.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{efb96aefe979a0f5c632.js → 640e8ac3498be30c6614.js} +1 -1
  19. package/assets/esri/core/workers/chunks/642c5a93c0a454bdd115.js +1 -0
  20. package/assets/esri/core/workers/chunks/{14145959a3dab1437818.js → 6627f1bc9ee6b620e3aa.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{33901eb1574e46abd9af.js → 6c213768715c52625855.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{5e6471dd2a08e66b47d0.js → 6e4940fe3bba014c921b.js} +57 -58
  23. package/assets/esri/core/workers/chunks/{170bdbdb4e21bf91a17f.js → 6eaa7a51efde2dd4a5a4.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{0407bf97ad621c89a734.js → 6f724f75f85dc3989d60.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{2bdc63395c7466ce1641.js → 7053c2f5a958d4c8629b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{4c35c663528f710e8c78.js → 79cb672c85ea29e8484a.js} +1 -1
  27. package/assets/esri/core/workers/chunks/82939ead43848a13f765.js +1 -0
  28. package/assets/esri/core/workers/chunks/8b05fb365336cc42fecc.js +1 -0
  29. package/assets/esri/core/workers/chunks/8b6b963230df56850580.js +1 -0
  30. package/assets/esri/core/workers/chunks/8eec6da5e862cc33ea2b.js +1 -0
  31. package/assets/esri/core/workers/chunks/90d8f297d9cb359e071d.js +1 -0
  32. package/assets/esri/core/workers/chunks/91785144901dfe56c5e2.js +1 -0
  33. package/assets/esri/core/workers/chunks/{471f6eba213412b82840.js → 927417abea79c955b216.js} +1 -1
  34. package/assets/esri/core/workers/chunks/9472184ef1432fc55d6b.js +1 -0
  35. package/assets/esri/core/workers/chunks/{adaa9d4239f4e905d011.js → 9d4bd73dd50400e9d328.js} +1 -1
  36. package/assets/esri/core/workers/chunks/a324cc07d486061d0d8e.js +1 -0
  37. package/assets/esri/core/workers/chunks/a40130579791293cefa2.js +1 -0
  38. package/assets/esri/core/workers/chunks/{3e239bfad611985e50fb.js → a49718c74053314ed741.js} +1 -1
  39. package/assets/esri/core/workers/chunks/a80a6267d88246ede5d3.js +1 -0
  40. package/assets/esri/core/workers/chunks/ad2891985e0fe45aa8d2.js +1 -0
  41. package/assets/esri/core/workers/chunks/afcba35eea836aea98ca.js +1 -0
  42. package/assets/esri/core/workers/chunks/b3d2e397ea74ebef4423.js +1 -0
  43. package/assets/esri/core/workers/chunks/b5fb9da45cc9dee286f8.js +1 -0
  44. package/assets/esri/core/workers/chunks/{f505ebd4bd3bfb6c790d.js → b6a55fdfe16795ebf02c.js} +1 -1
  45. package/assets/esri/core/workers/chunks/b846d4215210aac9f6ef.js +1 -0
  46. package/assets/esri/core/workers/chunks/c7dc821db8c14fec24a7.js +1 -0
  47. package/assets/esri/core/workers/chunks/c9df9a0a4a45f9a53ce9.js +1 -0
  48. package/assets/esri/core/workers/chunks/{45a4041881e6235d73a2.js → d0a9711f48dfa5fee68a.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{1f69fb9687de9ebfcf90.js → d4ba894a2583f3930a4f.js} +1 -1
  50. package/assets/esri/core/workers/chunks/d5dfd3d693d5e393a542.js +1 -0
  51. package/assets/esri/core/workers/chunks/{74fd2059ddda9083cbcc.js → dc6c97a43d642eeaf477.js} +1 -1
  52. package/assets/esri/core/workers/chunks/e23ec4f867c4735eec20.js +1 -0
  53. package/assets/esri/core/workers/chunks/ea16230a0edfc9f756bd.js +1 -0
  54. package/assets/esri/core/workers/chunks/{2154d395f405be3cd3ba.js → eca0c3d57b3a1e3a14ee.js} +1 -1
  55. package/assets/esri/core/workers/chunks/ef900614353505afb210.js +1 -0
  56. package/assets/esri/core/workers/chunks/f36697f6aac782007d1a.js +1 -0
  57. package/assets/esri/core/workers/chunks/f52054f27619a98b7bb7.js +1 -0
  58. package/assets/esri/core/workers/chunks/fb7fe307a583b6a22218.js +1 -0
  59. package/assets/esri/core/workers/chunks/fbd3c78ee8e2219a6c7a.js +1 -0
  60. package/assets/esri/images/portal/livestreamvideolayer16.png +0 -0
  61. package/assets/esri/images/portal/{mediaservice16.png → videolayer16.png} +0 -0
  62. package/assets/esri/themes/base/_View.scss +2 -5
  63. package/assets/esri/themes/base/widgets/_Feature.scss +12 -4
  64. package/assets/esri/themes/base/widgets/_FeatureForm.scss +19 -2
  65. package/assets/esri/themes/dark/main.css +1 -1
  66. package/assets/esri/themes/light/main.css +1 -1
  67. package/assets/esri/themes/light/view.css +1 -1
  68. package/chunks/DefaultMaterial.glsl.js +42 -42
  69. package/chunks/Terrain.glsl.js +7 -7
  70. package/copyright.txt +1 -1
  71. package/geometry/Mesh.js +1 -1
  72. package/geometry/support/DoubleArray.js +1 -1
  73. package/geometry/support/meshUtils/bounds.js +1 -1
  74. package/geometry/support/meshUtils/georeference.js +1 -1
  75. package/interfaces.d.ts +87 -3
  76. package/kernel.js +1 -1
  77. package/layers/OrientedImageryLayer.js +1 -1
  78. package/layers/SceneLayer.js +1 -1
  79. package/layers/VideoLayer.js +1 -1
  80. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  81. package/layers/graphics/editingSupport.js +1 -1
  82. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  83. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  84. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  85. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  86. package/layers/mixins/ArcGISImageService.js +1 -1
  87. package/layers/mixins/ImageryTileMixin.js +1 -1
  88. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  89. package/layers/orientedImagery/core/bestImageUtils.js +1 -1
  90. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  91. package/layers/orientedImagery/transformations/groundToImageUtils.js +1 -1
  92. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  93. package/layers/support/SubtypeSublayer.js +1 -1
  94. package/layers/support/capabilities.js +1 -1
  95. package/layers/support/editableLayers.js +1 -1
  96. package/layers/support/layerUtils.js +1 -1
  97. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  98. package/layers/video/VideoCameraSensorModel.js +5 -0
  99. package/layers/video/VideoController.js +1 -1
  100. package/layers/video/videoUtils.js +1 -1
  101. package/package.json +1 -1
  102. package/portal/PortalItem.js +1 -1
  103. package/renderers/support/colorRampUtils.js +1 -1
  104. package/request.js +1 -1
  105. package/rest/support/meshFeatureSet.js +1 -1
  106. package/smartMapping/labels/bins.js +5 -0
  107. package/smartMapping/labels/clusters.js +1 -1
  108. package/smartMapping/labels/support/utils.js +5 -0
  109. package/smartMapping/support/binningUtils.js +1 -1
  110. package/support/requestUtils.js +1 -1
  111. package/support/revision.js +1 -1
  112. package/views/2d/layers/features/schemaUtils.js +1 -1
  113. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  114. package/views/3d/layers/I3SMeshView3D.js +1 -1
  115. package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
  116. package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
  117. package/views/3d/layers/SceneLayerWorker.js +1 -1
  118. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  119. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +5 -0
  120. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  121. package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
  122. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  123. package/views/3d/terrain/TerrainRenderer.js +1 -1
  124. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +19 -20
  125. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -2
  126. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +9 -9
  127. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  128. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  129. package/views/DOMContainer.js +1 -1
  130. package/views/PopupView.js +1 -1
  131. package/views/ui/DefaultUI.js +1 -1
  132. package/views/ui/UI.js +1 -1
  133. package/webmap/initialViewPropertiesUtils.js +1 -1
  134. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  135. package/widgets/Editor/CreateWorkflow.js +1 -1
  136. package/widgets/Editor/EditorViewModel.js +1 -1
  137. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  138. package/widgets/Editor/UpdateWorkflow.js +1 -1
  139. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  140. package/widgets/Editor/workflowUtils.js +1 -1
  141. package/widgets/Feature/support/featureUtils.js +1 -1
  142. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  143. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  144. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  145. package/widgets/FeatureForm/css.js +1 -1
  146. package/widgets/FeatureForm.js +1 -1
  147. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  148. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  149. package/widgets/OrientedImageryViewer.js +1 -1
  150. package/widgets/Popup.js +1 -1
  151. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +4 -0
  152. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  153. package/widgets/UtilityNetworkValidateTopology.d.ts +4 -0
  154. package/widgets/support/geolocationUtils.js +1 -1
  155. package/assets/esri/core/workers/chunks/0610691a0c0d9fbbd6d2.js +0 -1
  156. package/assets/esri/core/workers/chunks/0618fb0058f39ecd363f.js +0 -1
  157. package/assets/esri/core/workers/chunks/0fcb8d408696075338e2.js +0 -1
  158. package/assets/esri/core/workers/chunks/16e459b16bdd6e1a821b.js +0 -1
  159. package/assets/esri/core/workers/chunks/1b8074269800b384ecf6.js +0 -1
  160. package/assets/esri/core/workers/chunks/2b55295590b4a0503749.js +0 -1
  161. package/assets/esri/core/workers/chunks/3ba2fcb9110230f8790c.js +0 -1
  162. package/assets/esri/core/workers/chunks/5576858f56314afcb4d5.js +0 -1
  163. package/assets/esri/core/workers/chunks/5706edf45402dff279a6.js +0 -1
  164. package/assets/esri/core/workers/chunks/624521961fe1f2c4f2c5.js +0 -1
  165. package/assets/esri/core/workers/chunks/659b7bad7281c0e2aed3.js +0 -1
  166. package/assets/esri/core/workers/chunks/6cd248d065f6d1616294.js +0 -1
  167. package/assets/esri/core/workers/chunks/6f510f28526c73ab453c.js +0 -1
  168. package/assets/esri/core/workers/chunks/7479dc0c790337af7597.js +0 -1
  169. package/assets/esri/core/workers/chunks/9326120c750799eb2d28.js +0 -1
  170. package/assets/esri/core/workers/chunks/99e0cec47e3ef72c1de4.js +0 -1
  171. package/assets/esri/core/workers/chunks/9c0e1e87790424f42d7e.js +0 -1
  172. package/assets/esri/core/workers/chunks/9e66af3b1c70cf25fb32.js +0 -1
  173. package/assets/esri/core/workers/chunks/a1c31bb8c12831539328.js +0 -1
  174. package/assets/esri/core/workers/chunks/a7fd2a95fde197c06828.js +0 -1
  175. package/assets/esri/core/workers/chunks/b0cda39b53ecd6c44cd0.js +0 -1
  176. package/assets/esri/core/workers/chunks/b8e6c64792a512df4c4d.js +0 -1
  177. package/assets/esri/core/workers/chunks/c08e03165043df67c11b.js +0 -1
  178. package/assets/esri/core/workers/chunks/c26148d4bfab3b3dfab2.js +0 -1
  179. package/assets/esri/core/workers/chunks/c96db6b7ce47bd343fdb.js +0 -1
  180. package/assets/esri/core/workers/chunks/d6b6bb8aecc85d2a3f6b.js +0 -1
  181. package/assets/esri/core/workers/chunks/d95ca50ca7af4c222036.js +0 -1
  182. package/assets/esri/core/workers/chunks/da57eba2fe25495ea217.js +0 -1
  183. package/assets/esri/core/workers/chunks/ee5ee03dd2c7dc940272.js +0 -1
  184. package/assets/esri/core/workers/chunks/eeaf8010e38b65a101ac.js +0 -1
  185. package/assets/esri/core/workers/chunks/f235392c56063fbf89c6.js +0 -1
  186. package/assets/esri/core/workers/chunks/f720967ba8c5486a26a2.js +0 -1
  187. package/assets/esri/core/workers/chunks/fdd0d3616c97e408b104.js +0 -1
  188. package/layers/orientedImagery/core/Affixes.js +0 -5
  189. package/layers/orientedImagery/core/CameraProperties.js +0 -5
  190. package/layers/orientedImagery/core/ImageProperties.js +0 -5
  191. package/layers/orientedImagery/core/ImageryTypes.js +0 -5
  192. package/layers/orientedImagery/core/imageryUtils.js +0 -5
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9689,2442],{45425:(e,t,r)=>{r.r(t),r.d(t,{default:()=>_});var o=r(43697),s=(r(66577),r(20102)),i=r(95330),n=r(81271),a=r(5600),l=(r(75215),r(67676),r(80442)),u=r(71715),p=r(52011),c=r(19238),d=r(83379),y=r(78346),h=r(74889),m=r(6570);let f=class extends d.Z{constructor(e){super(e),this.type="csv",this.refresh=(0,i.Ds)((async e=>{await this.load();const{extent:t,timeExtent:r}=await this._connection.invoke("refresh",e);return t&&(this.sourceJSON.extent=t),r&&(this.sourceJSON.timeInfo.timeExtent=[r.start,r.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}}))}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return h.Z.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:r.count,extent:m.Z.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _startWorker(e){this._connection=await(0,y.bA)("CSVSourceWorker",{strategy:(0,l.Z)("feature-layers-workers")?"dedicated":"local",signal:e});const{url:t,delimiter:r,fields:o,latitudeField:s,longitudeField:i,spatialReference:n,timeInfo:a}=this.loadOptions,u=await this._connection.invoke("load",{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:r,fields:o?.map((e=>e.toJSON())),latitudeField:s,longitudeField:i,spatialReference:n?.toJSON(),timeInfo:a?.toJSON()}},{signal:e});this.locationInfo=u.locationInfo,this.sourceJSON=u.layerDefinition,this.delimiter=u.delimiter}};(0,o._)([(0,a.Cb)()],f.prototype,"type",void 0),(0,o._)([(0,a.Cb)()],f.prototype,"loadOptions",void 0),(0,o._)([(0,a.Cb)()],f.prototype,"customParameters",void 0),(0,o._)([(0,a.Cb)()],f.prototype,"locationInfo",void 0),(0,o._)([(0,a.Cb)()],f.prototype,"sourceJSON",void 0),(0,o._)([(0,a.Cb)()],f.prototype,"delimiter",void 0),f=(0,o._)([(0,p.j)("esri.layers.graphics.sources.CSVSource")],f);var g=r(25278),S=r(14165),v=r(25929),w=r(82971);function b(e,t){throw new s.Z(t,`CSVLayer (title: ${e.title}, id: ${e.id}) cannot be saved to a portal item`)}let C=class extends c.default{constructor(...e){super(...e),this.geometryType="point",this.capabilities=(0,g.MS)(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=w.Z.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},e).catch(i.r9).then((async()=>this.initLayerProperties(await this.createGraphicsSource(t))));return this.addResolvingPromise(r),Promise.resolve(this)}get isTable(){return this.loaded&&null==this.geometryType}readWebMapLabelsVisible(e,t){return null!=t.showLabels?t.showLabels:!!(t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.labelingInfo)}set url(e){if(!e)return void this._set("url",e);const t=(0,n.mN)(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async createGraphicsSource(e){const t=new f({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",t),await t.load({signal:e}),this.read({locationInfo:t.locationInfo,columnDelimiter:t.delimiter},{origin:"service",url:this.parsedUrl}),t}queryFeatures(e,t){return this.load().then((()=>this.source.queryFeatures(S.Z.from(e)||this.createQuery()))).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this.load().then((()=>this.source.queryObjectIds(S.Z.from(e)||this.createQuery())))}queryFeatureCount(e,t){return this.load().then((()=>this.source.queryFeatureCount(S.Z.from(e)||this.createQuery())))}queryExtent(e,t){return this.load().then((()=>this.source.queryExtent(S.Z.from(e)||this.createQuery())))}read(e,t){super.read(e,t),t&&"service"===t.origin&&this.revert(["latitudeField","longitudeField"],"service")}write(e,t){return super.write(e,{...t,writeLayerSchema:!0})}clone(){throw new s.Z("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(e){return b(this,"csv-layer:save")}async saveAs(e,t){return b(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return null!=t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};(0,o._)([(0,a.Cb)({readOnly:!0,json:{read:!1,write:!1}})],C.prototype,"capabilities",void 0),(0,o._)([(0,a.Cb)({type:[","," ",";","|","\t"],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],C.prototype,"delimiter",void 0),(0,o._)([(0,a.Cb)({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],C.prototype,"editingEnabled",void 0),(0,o._)([(0,a.Cb)({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],C.prototype,"fields",void 0),(0,o._)([(0,a.Cb)({type:Boolean,readOnly:!0})],C.prototype,"isTable",null),(0,o._)([(0,u.r)("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],C.prototype,"readWebMapLabelsVisible",null),(0,o._)([(0,a.Cb)({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],C.prototype,"latitudeField",void 0),(0,o._)([(0,a.Cb)({type:["show","hide"]})],C.prototype,"listMode",void 0),(0,o._)([(0,a.Cb)({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],C.prototype,"locationType",void 0),(0,o._)([(0,a.Cb)({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],C.prototype,"longitudeField",void 0),(0,o._)([(0,a.Cb)({type:["CSV"]})],C.prototype,"operationalLayerType",void 0),(0,o._)([(0,a.Cb)()],C.prototype,"outFields",void 0),(0,o._)([(0,a.Cb)({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],C.prototype,"path",void 0),(0,o._)([(0,a.Cb)({json:{read:!1},cast:null,type:f,readOnly:!0})],C.prototype,"source",void 0),(0,o._)([(0,a.Cb)({json:{read:!1},value:"csv",readOnly:!0})],C.prototype,"type",void 0),(0,o._)([(0,a.Cb)({json:{read:v.r,write:{isRequired:!0,ignoreOrigin:!0,writer:v.w}}})],C.prototype,"url",null),C=(0,o._)([(0,p.j)("esri.layers.CSVLayer")],C);const _=C},61159:(e,t,r)=>{r.d(t,{g:()=>o});const o={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},25278:(e,t,r)=>{r.d(t,{Dm:()=>p,Hq:()=>c,MS:()=>d,bU:()=>a});var o=r(80442),s=r(22974),i=r(61159),n=r(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?n.I4:"esriGeometryPolyline"===e?n.ET:n.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function p(e,t){if((0,o.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const o=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new o}catch(r){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,s.d9)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:i.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1}}}},16451:(e,t,r)=>{r.d(t,{Z:()=>y});var o=r(43697),s=r(2368),i=r(96674),n=r(5600),a=(r(75215),r(67676),r(80442),r(71715)),l=r(52011),u=r(30556),p=r(72729),c=r(70082);let d=class extends((0,s.J)(i.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,o._)([(0,n.Cb)({json:{write:!0}})],d.prototype,"id",void 0),(0,o._)([(0,n.Cb)({json:{write:!0}})],d.prototype,"name",void 0),(0,o._)([(0,n.Cb)({json:{write:!0}})],d.prototype,"domains",void 0),(0,o._)([(0,a.r)("domains")],d.prototype,"readDomains",null),(0,o._)([(0,u.c)("domains")],d.prototype,"writeDomains",null),(0,o._)([(0,n.Cb)({type:[c.Z],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,o._)([(0,l.j)("esri.layers.support.FeatureType")],d);const y=d},28694:(e,t,r)=>{r.d(t,{p:()=>s});var o=r(69285);function s(e,t,r){if(!r||!r.features||!r.hasZ)return;const s=(0,o.k)(r.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of r.features)s(e.geometry)}},74889:(e,t,r)=>{r.d(t,{Z:()=>v});var o,s=r(43697),i=r(66577),n=r(38171),a=r(35454),l=r(96674),u=r(22974),p=r(5600),c=(r(75215),r(71715)),d=r(52011),y=r(30556),h=r(82971),m=r(33955),f=r(1231);const g=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let S=o=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=h.Z.fromJSON(t.spatialReference),o=[];for(let t=0;t<e.length;t++){const s=e[t],i=n.Z.fromJSON(s),a=s.geometry&&s.geometry.spatialReference;null==i.geometry||a||(i.geometry.spatialReference=r);const l=s.aggregateGeometries,u=i.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],o=l[e],s=o?.spatialReference;null==t||s||(t.spatialReference=r)}o.push(i)}return o}writeGeometryType(e,t,r,o){if(e)return void g.write(e,t,r,o);const{features:s}=this;if(s)for(const e of s)if(e&&null!=e.geometry)return void g.write(e.geometry.type,t,r,o)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,o=(0,m.im)(e);return o&&!r&&t.spatialReference&&(o.spatialReference=h.Z.fromJSON(t.spatialReference)),o}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new o(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const o=t.features[r];if(o.geometry){const t=e&&e[r];o.geometry=t&&t.toJSON()||o.geometry}}return t}quantize(e){const{scale:[t,r],translate:[o,s]}=e,i=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-o)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=i.length;e<t;e++)n?.(i[e].geometry)||(i.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[o,s],scale:[i,n]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*i+o),(e=>s-e*n),a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,r){let o,s;const i=[];for(let n=0,a=e.length;n<a;n++){const a=e[n];if(n>0){const e=t(a[0]),n=r(a[1]);e===o&&n===s||(i.push([e-o,n-s]),o=e,s=n)}else o=t(a[0]),s=r(a[1]),i.push([o,s])}return i.length>0?i:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const o=(0,m.oU)(e)?e.rings:e.paths,s=[];for(let e=0,i=o.length;e<i;e++){const i=o[e],n=this._quantizePoints(i,t,r);n&&s.push(n)}return s.length>0?((0,m.oU)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const o=this._quantizePoints(e.points,t,r);return o&&o.length>0?(e.points=o,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,o,s){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),o&&(e.z=o(e.z))}:"polyline"===e||"polygon"===e?e=>{const i=(0,m.oU)(e)?e.rings:e.paths;let n,a;for(let e=0,o=i.length;e<o;e++){const o=i[e];for(let e=0,s=o.length;e<s;e++){const s=o[e];e>0?(n+=s[0],a+=s[1]):(n=s[0],a=s[1]),s[0]=t(n),s[1]=r(a)}}if(o&&s)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2]),r[3]=s(r[3])}}else if(o)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2])}}else if(s)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),o&&null!=e.zmax&&null!=e.zmin&&(e.zmax=o(e.zmax),e.zmin=o(e.zmin)),s&&null!=e.mmax&&null!=e.mmin&&(e.mmax=s(e.mmax),e.mmin=s(e.mmin))}:"multipoint"===e?e=>{const i=e.points;let n,a;for(let e=0,o=i.length;e<o;e++){const o=i[e];e>0?(n+=o[0],a+=o[1]):(n=o[0],a=o[1]),o[0]=t(n),o[1]=r(a)}if(o&&s)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=o(t[2]),t[3]=s(t[3])}else if(o)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=o(t[2])}else if(s)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=s(t[2])}}:null}};(0,s._)([(0,p.Cb)({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,p.Cb)({type:[n.Z],json:{write:!0}})],S.prototype,"features",void 0),(0,s._)([(0,c.r)("features")],S.prototype,"readFeatures",null),(0,s._)([(0,p.Cb)({type:[f.Z],json:{write:!0}})],S.prototype,"fields",void 0),(0,s._)([(0,p.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],S.prototype,"geometryType",void 0),(0,s._)([(0,y.c)("geometryType")],S.prototype,"writeGeometryType",null),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"hasM",void 0),(0,s._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],S.prototype,"hasZ",void 0),(0,s._)([(0,p.Cb)({types:i.qM,json:{write:!0}})],S.prototype,"queryGeometry",void 0),(0,s._)([(0,c.r)("queryGeometry")],S.prototype,"readQueryGeometry",null),(0,s._)([(0,p.Cb)({type:h.Z,json:{write:!0}})],S.prototype,"spatialReference",void 0),(0,s._)([(0,y.c)("spatialReference")],S.prototype,"writeSpatialReference",null),(0,s._)([(0,p.Cb)({json:{write:!0}})],S.prototype,"transform",void 0),S=o=(0,s._)([(0,d.j)("esri.rest.support.FeatureSet")],S),S.prototype.toJSON.isDefaultToJSON=!0;const v=S},58333:(e,t,r)=>{r.d(t,{ET:()=>i,I4:()=>s,eG:()=>l,lF:()=>n,lj:()=>p,qP:()=>a,wW:()=>u});const o=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:o,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},i={type:"esriSLS",style:"esriSLSSolid",width:.75,color:o},n={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},p={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9291],{79291:(e,t,l)=>{l.r(t),l.d(t,{build:()=>s.b}),l(21787),l(46521),l(13598),l(1391),l(62707),l(55039),l(51546),l(77171),l(47624),l(60624),l(37099),l(76056),l(135),l(11317),l(15719),l(92555),l(89136),l(15817),l(95134),l(89753),l(5802),l(42001),l(19419),l(26322),l(85504),l(22539),l(57806),l(92302),l(85787),l(90692),l(62062),l(172),l(71250),l(21437),l(74709),l(19850),l(8319),l(33680),l(98069),l(93144),l(35065);var s=l(32078)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6459],{21787:(t,n,r)=>{r.d(n,{a:()=>c,b:()=>l,e:()=>s,f:()=>o,i:()=>h,m:()=>u,s:()=>a,t:()=>i});var e=r(46851);function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function a(t,n,r,e,o,a,i,s,c,u){return t[0]=n,t[1]=r,t[2]=e,t[3]=o,t[4]=a,t[5]=i,t[6]=s,t[7]=c,t[8]=u,t}function i(t,n){if(t===n){const r=n[1],e=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=r,t[5]=n[7],t[6]=e,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function s(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=n[4],s=n[5],c=n[6],u=n[7],l=n[8],f=l*i-s*u,h=-l*a+s*c,p=u*a-i*c;let M=r*f+e*h+o*p;return M?(M=1/M,t[0]=f*M,t[1]=(-l*e+o*u)*M,t[2]=(s*e-o*i)*M,t[3]=h*M,t[4]=(l*r-o*c)*M,t[5]=(-s*r+o*a)*M,t[6]=p*M,t[7]=(-u*r+e*c)*M,t[8]=(i*r-e*a)*M,t):null}function c(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=n[4],s=n[5],c=n[6],u=n[7],l=n[8];return t[0]=i*l-s*u,t[1]=o*u-e*l,t[2]=e*s-o*i,t[3]=s*c-a*l,t[4]=r*l-o*c,t[5]=o*a-r*s,t[6]=a*u-i*c,t[7]=e*c-r*u,t[8]=r*i-e*a,t}function u(t,n,r){const e=n[0],o=n[1],a=n[2],i=n[3],s=n[4],c=n[5],u=n[6],l=n[7],f=n[8],h=r[0],p=r[1],M=r[2],g=r[3],m=r[4],y=r[5],b=r[6],d=r[7],P=r[8];return t[0]=h*e+p*i+M*u,t[1]=h*o+p*s+M*l,t[2]=h*a+p*c+M*f,t[3]=g*e+m*i+y*u,t[4]=g*o+m*s+y*l,t[5]=g*a+m*c+y*f,t[6]=b*e+d*i+P*u,t[7]=b*o+d*s+P*l,t[8]=b*a+d*c+P*f,t}function l(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=n[4],s=n[5],c=n[6],u=n[7],l=n[8],f=n[9],h=n[10],p=n[11],M=n[12],g=n[13],m=n[14],y=n[15],b=r*s-e*i,d=r*c-o*i,P=r*u-a*i,A=e*c-o*s,x=e*u-a*s,F=o*u-a*c,w=l*g-f*M,v=l*m-h*M,T=l*y-p*M,C=f*m-h*g,_=f*y-p*g,R=h*y-p*m;let S=b*R-d*_+P*C+A*T-x*v+F*w;return S?(S=1/S,t[0]=(s*R-c*_+u*C)*S,t[1]=(c*T-i*R-u*v)*S,t[2]=(i*_-s*T+u*w)*S,t[3]=(o*_-e*R-a*C)*S,t[4]=(r*R-o*T+a*v)*S,t[5]=(e*T-r*_-a*w)*S,t[6]=(g*F-m*x+y*A)*S,t[7]=(m*P-M*F-y*d)*S,t[8]=(M*x-g*P+y*b)*S,t):null}function f(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[3]=n[3]-r[3],t[4]=n[4]-r[4],t[5]=n[5]-r[5],t[6]=n[6]-r[6],t[7]=n[7]-r[7],t[8]=n[8]-r[8],t}function h(t){const n=(0,e.g)(),r=t[0],o=t[1],a=t[2],i=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=t[8];return Math.abs(1-(r*r+i*i+u*u))<=n&&Math.abs(1-(o*o+s*s+l*l))<=n&&Math.abs(1-(a*a+c*c+f*f))<=n}const p=u,M=f;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[3]=n[3]+r[3],t[4]=n[4]+r[4],t[5]=n[5]+r[5],t[6]=n[6]+r[6],t[7]=n[7]+r[7],t[8]=n[8]+r[8],t},adjoint:c,copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},determinant:function(t){const n=t[0],r=t[1],e=t[2],o=t[3],a=t[4],i=t[5],s=t[6],c=t[7],u=t[8];return n*(u*a-i*c)+r*(-u*o+i*s)+e*(c*o-a*s)},equals:function(t,n){const r=t[0],o=t[1],a=t[2],i=t[3],s=t[4],c=t[5],u=t[6],l=t[7],f=t[8],h=n[0],p=n[1],M=n[2],g=n[3],m=n[4],y=n[5],b=n[6],d=n[7],P=n[8],A=(0,e.g)();return Math.abs(r-h)<=A*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-p)<=A*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-M)<=A*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(i-g)<=A*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(s-m)<=A*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(c-y)<=A*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(u-b)<=A*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(l-d)<=A*Math.max(1,Math.abs(l),Math.abs(d))&&Math.abs(f-P)<=A*Math.max(1,Math.abs(f),Math.abs(P))},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromMat4:o,fromQuat:function(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=r+r,s=e+e,c=o+o,u=r*i,l=e*i,f=e*s,h=o*i,p=o*s,M=o*c,g=a*i,m=a*s,y=a*c;return t[0]=1-f-M,t[3]=l-y,t[6]=h+m,t[1]=l+y,t[4]=1-u-M,t[7]=p-g,t[2]=h-m,t[5]=p+g,t[8]=1-u-f,t},fromRotation:function(t,n){const r=Math.sin(n),e=Math.cos(n);return t[0]=e,t[1]=r,t[2]=0,t[3]=-r,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:s,isOrthoNormal:h,mul:p,multiply:u,multiplyScalar:function(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=n[7]*r,t[8]=n[8]*r,t},multiplyScalarAndAdd:function(t,n,r,e){return t[0]=n[0]+r[0]*e,t[1]=n[1]+r[1]*e,t[2]=n[2]+r[2]*e,t[3]=n[3]+r[3]*e,t[4]=n[4]+r[4]*e,t[5]=n[5]+r[5]*e,t[6]=n[6]+r[6]*e,t[7]=n[7]+r[7]*e,t[8]=n[8]+r[8]*e,t},normalFromMat4:l,normalFromMat4Legacy:function(t,n){const r=n[0],e=n[1],o=n[2],a=n[4],i=n[5],s=n[6],c=n[8],u=n[9],l=n[10],f=l*i-s*u,h=-l*a+s*c,p=u*a-i*c,M=r*f+e*h+o*p;if(!M)return null;const g=1/M;return t[0]=f*g,t[1]=(-l*e+o*u)*g,t[2]=(s*e-o*i)*g,t[3]=h*g,t[4]=(l*r-o*c)*g,t[5]=(-s*r+o*a)*g,t[6]=p*g,t[7]=(-u*r+e*c)*g,t[8]=(i*r-e*a)*g,t},projection:function(t,n,r){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,n,r){const e=n[0],o=n[1],a=n[2],i=n[3],s=n[4],c=n[5],u=n[6],l=n[7],f=n[8],h=Math.sin(r),p=Math.cos(r);return t[0]=p*e+h*i,t[1]=p*o+h*s,t[2]=p*a+h*c,t[3]=p*i-h*e,t[4]=p*s-h*o,t[5]=p*c-h*a,t[6]=u,t[7]=l,t[8]=f,t},scale:function(t,n,r){const e=r[0],o=r[1],a=r[2];return t[0]=e*n[0],t[1]=e*n[1],t[2]=e*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=a*n[6],t[7]=a*n[7],t[8]=a*n[8],t},scaleByVec2:function(t,n,r){const e=r[0],o=r[1];return t[0]=e*n[0],t[1]=e*n[1],t[2]=e*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t},set:a,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:M,subtract:f,translate:function(t,n,r){const e=n[0],o=n[1],a=n[2],i=n[3],s=n[4],c=n[5],u=n[6],l=n[7],f=n[8],h=r[0],p=r[1];return t[0]=e,t[1]=o,t[2]=a,t[3]=i,t[4]=s,t[5]=c,t[6]=h*e+p*i+u,t[7]=h*o+p*s+l,t[8]=h*a+p*c+f,t},transpose:i},Symbol.toStringTag,{value:"Module"}))},51305:(t,n,r)=>{r.d(n,{c:()=>p,g:()=>l,j:()=>_,k:()=>g,m:()=>f,s:()=>u});var e=r(46521),o=r(94961),a=r(65617),i=r(46851),s=r(17896),c=r(98766);function u(t,n,r){r*=.5;const e=Math.sin(r);return t[0]=e*n[0],t[1]=e*n[1],t[2]=e*n[2],t[3]=Math.cos(r),t}function l(t,n){const r=2*Math.acos(n[3]),e=Math.sin(r/2);return e>(0,i.g)()?(t[0]=n[0]/e,t[1]=n[1]/e,t[2]=n[2]/e):(t[0]=1,t[1]=0,t[2]=0),r}function f(t,n,r){const e=n[0],o=n[1],a=n[2],i=n[3],s=r[0],c=r[1],u=r[2],l=r[3];return t[0]=e*l+i*s+o*u-a*c,t[1]=o*l+i*c+a*s-e*u,t[2]=a*l+i*u+e*c-o*s,t[3]=i*l-e*s-o*c-a*u,t}function h(t,n,r,e){const o=n[0],a=n[1],s=n[2],c=n[3];let u,l,f,h,p,M=r[0],g=r[1],m=r[2],y=r[3];return l=o*M+a*g+s*m+c*y,l<0&&(l=-l,M=-M,g=-g,m=-m,y=-y),1-l>(0,i.g)()?(u=Math.acos(l),f=Math.sin(u),h=Math.sin((1-e)*u)/f,p=Math.sin(e*u)/f):(h=1-e,p=e),t[0]=h*o+p*M,t[1]=h*a+p*g,t[2]=h*s+p*m,t[3]=h*c+p*y,t}function p(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function M(t,n){const r=n[0]+n[4]+n[8];let e;if(r>0)e=Math.sqrt(r+1),t[3]=.5*e,e=.5/e,t[0]=(n[5]-n[7])*e,t[1]=(n[6]-n[2])*e,t[2]=(n[1]-n[3])*e;else{let r=0;n[4]>n[0]&&(r=1),n[8]>n[3*r+r]&&(r=2);const o=(r+1)%3,a=(r+2)%3;e=Math.sqrt(n[3*r+r]-n[3*o+o]-n[3*a+a]+1),t[r]=.5*e,e=.5/e,t[3]=(n[3*o+a]-n[3*a+o])*e,t[o]=(n[3*o+r]+n[3*r+o])*e,t[a]=(n[3*a+r]+n[3*r+a])*e}return t}function g(t,n,r,e){const o=.5*Math.PI/180;n*=o,r*=o,e*=o;const a=Math.sin(n),i=Math.cos(n),s=Math.sin(r),c=Math.cos(r),u=Math.sin(e),l=Math.cos(e);return t[0]=a*c*l-i*s*u,t[1]=i*s*l+a*c*u,t[2]=i*c*u-a*s*l,t[3]=i*c*l+a*s*u,t}const m=c.c,y=c.s,b=c.a,d=f,P=c.b,A=c.d,x=c.l,F=c.e,w=F,v=c.f,T=v,C=c.n,_=c.g,R=c.h,S=(0,a.c)(),Z=(0,a.f)(1,0,0),O=(0,a.f)(0,1,0),j=(0,o.a)(),q=(0,o.a)(),I=(0,e.c)();Object.freeze(Object.defineProperty({__proto__:null,add:b,calculateW:function(t,n){const r=n[0],e=n[1],o=n[2];return t[0]=r,t[1]=e,t[2]=o,t[3]=Math.sqrt(Math.abs(1-r*r-e*e-o*o)),t},conjugate:p,copy:m,dot:A,equals:R,exactEquals:_,fromEuler:g,fromMat3:M,getAxisAngle:l,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},invert:function(t,n){const r=n[0],e=n[1],o=n[2],a=n[3],i=r*r+e*e+o*o+a*a,s=i?1/i:0;return t[0]=-r*s,t[1]=-e*s,t[2]=-o*s,t[3]=a*s,t},len:w,length:F,lerp:x,mul:d,multiply:f,normalize:C,random:function(t){const n=i.R,r=n(),e=n(),o=n(),a=Math.sqrt(1-r),s=Math.sqrt(r);return t[0]=a*Math.sin(2*Math.PI*e),t[1]=a*Math.cos(2*Math.PI*e),t[2]=s*Math.sin(2*Math.PI*o),t[3]=s*Math.cos(2*Math.PI*o),t},rotateX:function(t,n,r){r*=.5;const e=n[0],o=n[1],a=n[2],i=n[3],s=Math.sin(r),c=Math.cos(r);return t[0]=e*c+i*s,t[1]=o*c+a*s,t[2]=a*c-o*s,t[3]=i*c-e*s,t},rotateY:function(t,n,r){r*=.5;const e=n[0],o=n[1],a=n[2],i=n[3],s=Math.sin(r),c=Math.cos(r);return t[0]=e*c-a*s,t[1]=o*c+i*s,t[2]=a*c+e*s,t[3]=i*c-o*s,t},rotateZ:function(t,n,r){r*=.5;const e=n[0],o=n[1],a=n[2],i=n[3],s=Math.sin(r),c=Math.cos(r);return t[0]=e*c+o*s,t[1]=o*c-e*s,t[2]=a*c+i*s,t[3]=i*c-a*s,t},rotationTo:function(t,n,r){const e=(0,s.e)(n,r);return e<-.999999?((0,s.f)(S,Z,n),(0,s.u)(S)<1e-6&&(0,s.f)(S,O,n),(0,s.n)(S,S),u(t,S,Math.PI),t):e>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):((0,s.f)(S,n,r),t[0]=S[0],t[1]=S[1],t[2]=S[2],t[3]=1+e,C(t,t))},scale:P,set:y,setAxes:function(t,n,r,e){const o=I;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=e[0],o[4]=e[1],o[7]=e[2],o[2]=-n[0],o[5]=-n[1],o[8]=-n[2],C(t,M(t,o))},setAxisAngle:u,slerp:h,sqlerp:function(t,n,r,e,o,a){return h(j,n,o,a),h(q,r,e,a),h(t,j,q,2*a*(1-a)),t},sqrLen:T,squaredLength:v,str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}},Symbol.toStringTag,{value:"Module"}))},58995:(t,n,r)=>{r.d(n,{rS:()=>u});var e=r(2109),o=r(82971),a=r(8744);const i=new o.Z(e.kU),s=new o.Z(e.JL),c=new o.Z(e.mM);function u(t){return t&&((0,a.BZ)(t)||(0,a.fS)(t,s))?s:t&&((0,a.V2)(t)||(0,a.fS)(t,c))?c:i}new o.Z(e.pn)},2674:(t,n,r)=>{r.d(n,{Z:()=>y});var e,o=r(43697),a=r(96674),i=r(5600),s=(r(75215),r(67676),r(80442),r(52011)),c=r(52138),u=r(13598),l=r(51305),f=r(94961),h=r(17896),p=r(65617),M=r(3709);let g=e=class extends a.wq{constructor(t){super(t),this.translation=(0,p.c)(),this.rotationAxis=(0,p.g)(M.UP),this.rotationAngle=0,this.scale=(0,p.f)(1,1,1)}get rotation(){return(0,M.uT)(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=(0,p.a)((0,M.ZZ)(t)),this.rotationAngle=(0,M.EU)(t)}get localMatrix(){const t=(0,u.c)();return(0,l.s)(m,(0,M.ZZ)(this.rotation),(0,M.WH)(this.rotation)),(0,c.g)(t,m,this.translation,this.scale),t}get localMatrixInverse(){return(0,c.a)((0,u.c)(),this.localMatrix)}applyLocal(t,n){return(0,h.m)(n,t,this.localMatrix)}applyLocalInverse(t,n){return(0,h.m)(n,t,this.localMatrixInverse)}equals(t){return this===t||null!=t&&(0,c.h)(this.localMatrix,t.localMatrix)}clone(){const t={translation:(0,p.a)(this.translation),rotationAxis:(0,p.a)(this.rotationAxis),rotationAngle:this.rotationAngle,scale:(0,p.a)(this.scale)};return new e(t)}};(0,o._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],g.prototype,"translation",void 0),(0,o._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],g.prototype,"rotationAxis",void 0),(0,o._)([(0,i.Cb)({type:Number,nonNullable:!0,json:{write:!0}})],g.prototype,"rotationAngle",void 0),(0,o._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],g.prototype,"scale",void 0),(0,o._)([(0,i.Cb)()],g.prototype,"rotation",null),(0,o._)([(0,i.Cb)()],g.prototype,"localMatrix",null),(0,o._)([(0,i.Cb)()],g.prototype,"localMatrixInverse",null),g=e=(0,o._)([(0,s.j)("esri.geometry.support.MeshTransform")],g);const m=(0,f.a)(),y=g},3709:(t,n,r)=>{r.d(n,{EU:()=>p,UP:()=>g,Ue:()=>c,WH:()=>M,ZZ:()=>h,qC:()=>l,qw:()=>f,uT:()=>u});var e=r(22021),o=r(51305),a=r(94961),i=r(17896),s=r(65617);function c(t=g){return[t[0],t[1],t[2],t[3]]}function u(t,n,r=c()){return(0,i.c)(r,t),r[3]=n,r}function l(t,n,r=c()){return(0,o.s)(m,t,M(t)),(0,o.s)(y,n,M(n)),(0,o.m)(m,y,m),function(t,n){return t[3]=n,t}(r,(0,e.BV)((0,o.g)(r,m)))}function f(t,n,r,e=c()){return u(s.d,t,b),u(s.e,n,d),u(s.U,r,P),l(b,d,b),l(b,P,e),e}function h(t){return t}function p(t){return t[3]}function M(t){return(0,e.Vl)(t[3])}const g=[0,0,1,0],m=(0,a.a)(),y=(0,a.a)(),b=(c(),c()),d=c(),P=c()},13442:(t,n,r)=>{r.d(n,{A:()=>a,h:()=>o});var e=r(92604);function o(t,n){return t.isGeographic||t.isWebMercator&&(n?.geographic??!0)}function a(t,n,r){const o=!t.isGeoreferenced;null!=r?.geographic&&r.geographic!==o&&e.Z.getLogger(n).warnOnce(`Specifying the 'geographic' parameter (${r.geographic}) for a Mesh vertex space of type "${t.type}" is not supported. This parameter will be ignored.`)}},66459:(t,n,r)=>{r.d(n,{FF:()=>F,I5:()=>A,Yq:()=>w,iv:()=>P,project:()=>v,w1:()=>x});var e=r(67900),o=r(46521),a=r(52138),i=r(13598),s=r(17896),c=r(65617),u=r(21787),l=r(44547),f=r(58995),h=r(83025),p=r(85872),M=r(50567),g=r(84555),m=r(2674),y=r(20773),b=r(13442),d=r(56493);function P(t,n,r){return(0,b.h)(n.spatialReference,r)?function(t,n,r){const e=n.spatialReference,o=R(n,r,j),a=new Float64Array(t.position.length),i=function(t,n,r,e){(0,y.t)(e,t,n);const o=new Float64Array(t.length);return(0,d.To)(e,o,r)}(t.position,o,e,a),s=(0,u.b)(I,o);return{position:i,normal:T(i,a,t.normal,s,e),tangent:C(i,a,t.tangent,s,e)}}(t,n,r):function(t,n,r){const e=new Float64Array(t.position.length),o=t.position,a=n.x,i=n.y,s=n.z??0,c=O(r?r.unit:null,n.spatialReference);for(let t=0;t<o.length;t+=3)e[t]=o[t]*c+a,e[t+1]=o[t+1]*c+i,e[t+2]=o[t+2]*c+s;return{position:e,normal:t.normal,tangent:t.tangent}}(t,n,r)}function A(t,n,r,e){const{position:o,normal:a,tangent:s}=t;if(!n.isRelative)return{position:o,normal:a,tangent:s};const c=r?.localMatrix??i.I;return P({position:(0,y.t)(new Float64Array(o.length),o,c),normal:null!=a?(0,d.w9)(a,new Float32Array(a.length),c):null,tangent:null!=s?(0,d.VS)(s,new Float32Array(s.length),c):null},n.getOriginPoint(e),{geographic:!n.isGeoreferenced})}function x(t,n,r){if(r?.useTransform){const{position:e,normal:o,tangent:a}=t,{x:i,y:s,z:u}=n,l=(0,c.f)(i,s,u??0);return{vertexAttributes:{position:e,normal:o,tangent:a},vertexSpace:r.geographic??1?new g.Z({origin:l}):new p.Z({origin:l}),transform:new m.Z}}return{vertexAttributes:P(t,n,r),vertexSpace:new M.Z,transform:null}}function F(t,n,r){return(0,b.h)(n.spatialReference,r)?function(t,n,r){const e=n.spatialReference;R(n,r,j);const o=(0,a.a)(q,j),i=new Float64Array(t.position.length),s=function(t,n,r,e){const o=(0,d.XO)(t,n,e),a=new Float64Array(o.length);return(0,y.t)(a,o,r),a}(t.position,e,o,i),c=(0,u.b)(I,o);return{position:s,normal:S(t.normal,t.position,i,e,c),tangent:Z(t.tangent,t.position,i,e,c)}}(t,n,r):_(t,n,r)}function w(t,n,r,e,o){if(!n.isRelative)return F(t,e,o);const{spatialReference:a}=e,i=A(t,n,r,a);return e.equals(n.getOriginPoint(a))?_(i,e,o):F(i,e,o)}function v({positions:t,transform:n,vertexSpace:r,inSpatialReference:e,outSpatialReference:o,outPositions:u,local:p}){const M=r.isRelative?r.origin:c.Z,g=r.isRelative?n?.localMatrix??i.I:i.I;if(r.isGeoreferenced){const n=u??(0,h.bg)(t.length);if((0,a.j)(g,i.I)?(0,h.JK)(n,t):(0,y.t)(n,t,g),!(0,s.k)(M,c.Z)){const[t,r,e]=M;for(let o=0;o<n.length;o+=3)n[o]+=t,n[o+1]+=r,n[o+2]+=e}return(0,l.projectBuffer)(n,e,0,n,o,0,n.length/3),n}const m=(0,f.rS)(e),b=!p&&(0,l.Up)(e,m)?m:e;(0,l.Bm)(e,M,j,b),(0,a.m)(j,j,g);const d=u??(0,h.bg)(t.length);return(0,y.t)(d,t,j),(0,l.projectBuffer)(d,b,0,d,o,0,d.length/3),d}function T(t,n,r,e,o){if(null==r)return null;const a=new Float32Array(r.length);return(0,y.a)(a,r,e),(0,d.Yk)(a,t,n,o,a),a}function C(t,n,r,e,o){if(null==r)return null;const a=new Float32Array(r.length);(0,y.a)(a,r,e,4);for(let t=3;t<a.length;t+=4)a[t]=r[t];return(0,d.M2)(a,t,n,o,a),a}function _(t,n,r){const e=new Float64Array(t.position.length),o=t.position,a=n.x,i=n.y,s=n.z??0,c=O(r?r.unit:null,n.spatialReference);for(let t=0;t<o.length;t+=3)e[t]=(o[t]-a)/c,e[t+1]=(o[t+1]-i)/c,e[t+2]=(o[t+2]-s)/c;return{position:e,normal:t.normal,tangent:t.tangent}}function R(t,n,r){(0,l.Bm)(t.spatialReference,[t.x,t.y,t.z??0],r,(0,f.rS)(t.spatialReference));const e=O(n?n.unit:null,t.spatialReference);return(0,a.k)(r,r,[e,e,e]),r}function S(t,n,r,e,o){if(null==t)return null;const a=(0,d.Iz)(t,n,r,e,new Float32Array(t.length));return(0,y.a)(a,a,o),a}function Z(t,n,r,e,o){if(null==t)return null;const a=(0,d.wi)(t,n,r,e,new Float32Array(t.length));return(0,y.a)(a,a,o,4),a}function O(t,n){if(null==t)return 1;const r=(0,e.r6)(n);return 1/(0,e.En)(r,"meters",t)}const j=(0,i.c)(),q=(0,i.c)(),I=(0,o.c)()},56493:(t,n,r)=>{r.d(n,{Iz:()=>m,M2:()=>F,To:()=>d,VS:()=>A,XO:()=>b,Yk:()=>y,w9:()=>P,wi:()=>x});var e=r(92604),o=r(21787),a=r(46521),i=r(13598),s=r(17896),c=r(65617),u=r(44547),l=r(58995),f=r(8744),h=r(40488),p=r(56481),M=r(20773);const g=e.Z.getLogger("esri.geometry.support.meshUtils.normalProjection");function m(t,n,r,e,o){return v(e)?(w(C.TO_PCPF,p.ct.fromTypedArray(t),p.fP.fromTypedArray(n),p.fP.fromTypedArray(r),e,p.ct.fromTypedArray(o)),o):(g.error("Cannot convert spatial reference to PCPF"),o)}function y(t,n,r,e,o){return v(e)?(w(C.FROM_PCPF,p.ct.fromTypedArray(t),p.fP.fromTypedArray(n),p.fP.fromTypedArray(r),e,p.ct.fromTypedArray(o)),o):(g.error("Cannot convert to spatial reference from PCPF"),o)}function b(t,n,r){return(0,u.projectBuffer)(t,n,0,r,(0,l.rS)(n),0,t.length/3),r}function d(t,n,r){return(0,u.projectBuffer)(t,(0,l.rS)(r),0,n,r,0,t.length/3),n}function P(t,n,r){return(0,o.b)(O,r),(0,M.a)(n,t,O),(0,o.i)(O)||(0,M.n)(n,n),n}function A(t,n,r){if((0,o.b)(O,r),(0,M.a)(n,t,O,4),(0,o.i)(O)||(0,M.n)(n,n,4),t!==n)for(let r=3;r<t.length;r+=4)n[r]=t[r];return n}function x(t,n,r,e,o){if(!v(e))return g.error("Cannot convert spatial reference to PCPF"),o;w(C.TO_PCPF,p.ct.fromTypedArray(t,4*Float32Array.BYTES_PER_ELEMENT),p.fP.fromTypedArray(n),p.fP.fromTypedArray(r),e,p.ct.fromTypedArray(o,4*Float32Array.BYTES_PER_ELEMENT));for(let n=3;n<t.length;n+=4)o[n]=t[n];return o}function F(t,n,r,e,o){if(!v(e))return g.error("Cannot convert to spatial reference from PCPF"),o;w(C.FROM_PCPF,p.ct.fromTypedArray(t,16),p.fP.fromTypedArray(n),p.fP.fromTypedArray(r),e,p.ct.fromTypedArray(o,16));for(let n=3;n<t.length;n+=4)o[n]=t[n];return o}function w(t,n,r,e,a,i){if(!n)return;const c=r.count,f=(0,l.rS)(a);if(T(a))for(let r=0;r<c;r++)e.getVec(r,R),n.getVec(r,S),(0,u.Bm)(f,R,Z,f),(0,o.f)(O,Z),t===C.FROM_PCPF&&(0,o.t)(O,O),(0,s.t)(S,S,O),i.setVec(r,S);else for(let a=0;a<c;a++){e.getVec(a,R),n.getVec(a,S),(0,u.Bm)(f,R,Z,f),(0,o.f)(O,Z);const c=(0,h.mZ)(r.get(a,1));let l=Math.cos(c);t===C.TO_PCPF&&(l=1/l),O[0]*=l,O[1]*=l,O[2]*=l,O[3]*=l,O[4]*=l,O[5]*=l,t===C.FROM_PCPF&&(0,o.t)(O,O),(0,s.t)(S,S,O),(0,s.n)(S,S),i.setVec(a,S)}return i}function v(t){return T(t)||function(t){return t.isWebMercator}(t)}function T(t){return t.isWGS84||(0,f.yW)(t)||(0,f.BZ)(t)||(0,f.V2)(t)}var C,_;(_=C||(C={}))[_.TO_PCPF=0]="TO_PCPF",_[_.FROM_PCPF=1]="FROM_PCPF";const R=(0,c.c)(),S=(0,c.c)(),Z=(0,i.c)(),O=(0,a.c)()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7845],{66643:(e,t,n)=>{n.d(t,{Ed:()=>u,UI:()=>c,mt:()=>h,q6:()=>y,vr:()=>f});var s=n(43697),r=n(92036),i=n(70586),o=n(95330),a=n(5600),l=n(52011);function u(e,t,n){return(0,o.as)(e.map(((e,s)=>t.apply(n,[e,s]))))}async function c(e,t,n){return(await(0,o.as)(e.map(((e,s)=>t.apply(n,[e,s]))))).map((e=>e.value))}function p(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function y(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return p(await e)}catch(e){return d(e)}}async function h(e){try{return p(await e)}catch(e){return(0,o.r9)(e),d(e)}}function f(e,t){return new m(e,t)}let m=class extends r.Z{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,i.IM)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:n}=this._abortController;this.promise=e(n),this.promise.then((e=>{this._result=p(e),this._cleanup()}),(e=>{this._result=d(e),this._cleanup()})),this._abortHandle=(0,o.fu)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,i.hw)(this._abortHandle),this._abortController=null}};(0,s._)([(0,a.Cb)()],m.prototype,"value",null),(0,s._)([(0,a.Cb)()],m.prototype,"error",null),(0,s._)([(0,a.Cb)()],m.prototype,"finished",null),(0,s._)([(0,a.Cb)()],m.prototype,"promise",void 0),(0,s._)([(0,a.Cb)()],m.prototype,"_result",void 0),m=(0,s._)([(0,l.j)("esri.core.asyncUtils.ReactiveTask")],m)},97845:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var s=n(3172),r=n(66643),i=n(20102),o=n(92604),a=n(95330),l=n(33955),u=n(8744),c=n(98732),p=n(57191),d=n(37427),y=n(66202),h=n(92722),f=n(25278),m=n(23095),g=n(99514),_=n(86719),b=n(35671);const S={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class w{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const n=[];await this._checkProjection(e.spatialReference);let s=null;e.url&&(s=await this._fetch(t?.signal));const r=(0,h.my)(s,{geometryType:e.geometryType}),o=e.fields||r.fields||[],a=null!=e.hasZ?e.hasZ:r.hasZ,l=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const d=e.spatialReference||u.Zn;let m=e.timeInfo;o===r.fields&&r.unknownFields.length>0&&n.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});let w=new g.Z(o).get(c);w?("esriFieldTypeString"!==w.type&&(w.type="esriFieldTypeOID"),w.editable=!1,w.nullable=!1,c=w.name):(w={alias:c,name:c,type:"string"===r.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(w));const F={};for(const e of o){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),!e.name)throw new i.Z("geojson-layer:invalid-field-name","field name is missing",{field:e});if(!_.v.jsonValues.includes(e.type))throw new i.Z("geojson-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});if(e.name!==w.name){const t=(0,b.os)(e);void 0!==t&&(F[e.name]=t)}}this._fieldsIndex=new g.Z(o);const I=this._fieldsIndex.requiredFields.indexOf(w);if(I>-1&&this._fieldsIndex.requiredFields.splice(I,1),m){if(m.startTimeField){const e=this._fieldsIndex.get(m.startTimeField);e?(m.startTimeField=e.name,e.type="esriFieldTypeDate"):m.startTimeField=null}if(m.endTimeField){const e=this._fieldsIndex.get(m.endTimeField);e?(m.endTimeField=e.name,e.type="esriFieldTypeDate"):m.endTimeField=null}if(m.trackIdField){const e=this._fieldsIndex.get(m.trackIdField);e?m.trackIdField=e.name:(m.trackIdField=null,n.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:m}}))}m.startTimeField||m.endTimeField||(n.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:m}}),m=null)}const E=l?(0,f.bU)(l):void 0,T={warnings:n,featureErrors:[],layerDefinition:{...S,drawingInfo:E??void 0,templates:(0,f.Hq)(F),extent:void 0,geometryType:l,objectIdField:c,fields:o,hasZ:!!a,timeInfo:m}};this._queryEngine=new y.q({fields:o,geometryType:l,hasM:!1,hasZ:a,objectIdField:c,spatialReference:d,timeInfo:m,featureStore:new p.Z({geometryType:l,hasM:!1,hasZ:a}),cacheSpatialQueries:!0}),this._createDefaultAttributes=(0,f.Dm)(F,c);const j=await this._createFeatures(s);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,j);const q=this._normalizeFeatures(j,T.warnings,T.featureErrors);this._queryEngine.featureStore.addMany(q);const{fullExtent:C,timeExtent:x}=await this._queryEngine.fetchRecomputedExtents();if(T.layerDefinition.extent=C,x){const{start:e,end:t}=x;T.layerDefinition.timeInfo.timeExtent=[e,t]}return T}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([(0,m.b)(t,n),(0,d._W)(e.adds,t),(0,d._W)(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=(0,r.vr)(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)}),(e=>{this._queryEngine.featureStore.clear(),(0,a.D_)(e)||o.Z.getLogger("esri.layers.GeoJSONLayer").error(new i.Z("geojson-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:n}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:n}}async _createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:n,objectIdField:s}=this._queryEngine,r=(0,h.lG)(e,{geometryType:t,hasZ:n,objectIdField:s});if(!(0,u.fS)(this._queryEngine.spatialReference,u.Zn))for(const e of r)null!=e.geometry&&(e.geometry=(0,c.GH)((0,d.iV)((0,c.di)(e.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),u.Zn,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:n}=this._loadOptions,r=(await(0,s.default)(t,{responseType:"json",query:{...n},signal:e})).data;return await(0,h.O3)(r),r}_normalizeFeatures(e,t,n){const{objectIdField:s}=this._queryEngine,r=[];for(const i of e){const e=this._createDefaultAttributes(),o=(0,m.O0)(this._fieldsIndex,e,i.attributes,!0,t);o?n?.push(o):(this._assignObjectId(e,i.attributes,!0),i.attributes=e,i.objectId=e[s],r.push(i))}return r}async _applyEdits(e){const{adds:t,updates:n,deletes:s}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(r,t),n&&n.length&&this._applyUpdateEdits(r,n),s&&s.length){for(const e of s)r.deleteResults.push((0,m.d1)(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:i,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:i,timeExtent:o,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:n}=e,{geometryType:s,hasM:r,hasZ:i,objectIdField:o,spatialReference:a,featureStore:u}=this._queryEngine,p=[];for(const r of t){if(r.geometry&&s!==(0,l.Ji)(r.geometry)){n.push((0,m.av)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),i=(0,m.O0)(this._fieldsIndex,t,r.attributes);if(i)n.push(i);else{if(this._assignObjectId(t,r.attributes),r.attributes=t,null!=r.uid){const t=r.attributes[o];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??a;r.geometry=(0,d.iV)((0,m.og)(r.geometry,e),e,a)}p.push(r),n.push((0,m.d1)(r.attributes[o]))}}u.addMany((0,c.Yn)([],p,s,i,r,o))}_applyUpdateEdits({updateResults:e},t){const{geometryType:n,hasM:s,hasZ:r,objectIdField:i,spatialReference:o,featureStore:a}=this._queryEngine;for(const u of t){const{attributes:t,geometry:p}=u,y=t&&t[i];if(null==y){e.push((0,m.av)(`Identifier field ${i} missing`));continue}if(!a.has(y)){e.push((0,m.av)(`Feature with object id ${y} missing`));continue}const h=(0,c.EI)(a.getFeature(y),n,r,s);if(null!=p){if(n!==(0,l.Ji)(p)){e.push((0,m.av)("Incorrect geometry type."));continue}const t=p.spatialReference??o;h.geometry=(0,d.iV)((0,m.og)(p,t),t,o)}if(t){const n=(0,m.O0)(this._fieldsIndex,h.attributes,t);if(n){e.push(n);continue}}a.add((0,c.XA)(h,n,r,s,i)),e.push((0,m.d1)(y))}}_createObjectIdGenerator(e,t){const n=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===n.type)return()=>n.name+"-"+Date.now().toString(16);let s=Number.NEGATIVE_INFINITY;for(const e of t)e.objectId&&(s=Math.max(s,e.objectId));return s=Math.max(0,s)+1,()=>s++}_assignObjectId(e,t,n=!1){const s=this._queryEngine.objectIdField;e[s]=n&&s in t?t[s]:this._objectIdGenerator()}async _checkProjection(e){try{await(0,d._W)(u.Zn,e)}catch{throw new i.Z("geojson-layer","Projection not supported")}}}},92722:(e,t,n)=>{n.d(t,{O3:()=>w,lG:()=>I,my:()=>F,q9:()=>l});var s=n(20102),r=n(70272),i=n(5428),o=n(35671);const a={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function l(e){return a[e]}function*u(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*c(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function p(e){for(const t of e)if(t.length>2)return!0;return!1}function d(e){let t=0;for(let n=0;n<e.length;n++){const s=e[n],r=e[(n+1)%e.length];t+=s[0]*r[1]-r[0]*s[1]}return t<=0}function y(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function h(e,t,n){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,n){return g(e,t.coordinates,n),e}(e,t,n);case"MultiLineString":return function(e,t,n){for(const s of t.coordinates)g(e,s,n);return e}(e,t,n);case"MultiPolygon":return function(e,t,n){for(const s of t.coordinates){f(e,s[0],n);for(let t=1;t<s.length;t++)m(e,s[t],n)}return e}(e,t,n);case"Point":return function(e,t,n){return b(e,t.coordinates,n),e}(e,t,n);case"Polygon":return function(e,t,n){const s=t.coordinates;f(e,s[0],n);for(let t=1;t<s.length;t++)m(e,s[t],n);return e}(e,t,n)}}function f(e,t,n){const s=y(t);!function(e){return!d(e)}(s)?g(e,s,n):_(e,s,n)}function m(e,t,n){const s=y(t);!function(e){return d(e)}(s)?g(e,s,n):_(e,s,n)}function g(e,t,n){for(const s of t)b(e,s,n);e.lengths.push(t.length)}function _(e,t,n){for(let s=t.length-1;s>=0;s--)b(e,t[s],n);e.lengths.push(t.length)}function b(e,t,n){const[s,r,i]=t;e.coords.push(s,r),n.hasZ&&e.coords.push(i||0)}function S(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function w(e){if(!e)throw new s.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new s.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:t}=e;if(!t)return;const n="string"==typeof t?t:"name"===t.type?t.properties.name:"EPSG"===t.type?t.properties.code:null,r=new RegExp(".*(CRS84H?|4326)$","i");if(!n||!r.test(n))throw new s.Z("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function F(e,t={}){const n=[],s=new Set,r=new Set;let i,a=!1,d=null,y=!1,{geometryType:h=null}=t,f=!1;for(const t of u(e)){const{geometry:e,properties:u,id:m}=t;if((!e||(h||(h=l(e.type)),l(e.type)===h))&&(a||(a=p(c(e))),y||(y=null!=m,y&&(i=typeof m,u&&(d=Object.keys(u).filter((e=>u[e]===m))))),u&&d&&y&&null!=m&&(d.length>1?d=d.filter((e=>u[e]===m)):1===d.length&&(d=u[d[0]]===m?d:[])),!f&&u)){let e=!0;for(const t in u){if(s.has(t))continue;const i=u[t];if(null==i){e=!1,r.add(t);continue}const a=S(i);if("unknown"===a){r.add(t);continue}r.delete(t),s.add(t);const l=(0,o.q6)(t);l&&n.push({name:l,alias:t,type:a})}f=e}}const m=(0,o.q6)(1===d?.length&&d[0]||null)??void 0;if(m)for(const e of n)if(e.name===m&&(0,o.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:n,geometryType:h,hasZ:a,objectIdFieldName:m,objectIdFieldType:i,unknownFields:Array.from(r)}}function I(e,t){return Array.from(function*(e,t={}){const{geometryType:n,objectIdField:s}=t;for(const o of e){const{geometry:e,properties:a,id:u}=o;if(e&&l(e.type)!==n)continue;const c=a||{};let p;s&&(p=c[s],null==u||p||(c[s]=p=u));const d=new r.u_(e?h(new i.Z,e,t):null,c,null,p??void 0);yield d}}(u(e),t))}},25278:(e,t,n)=>{n.d(t,{Dm:()=>c,Hq:()=>p,MS:()=>d,bU:()=>a});var s=n(80442),r=n(22974),i=n(61159),o=n(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.I4:"esriGeometryPolyline"===e?o.ET:o.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,s.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let n=`this.${t} = null;`;for(const t in e)n+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${n};\n }\n }\n `)();return()=>new s}catch(n){return()=>({[t]:null,...e})}}function p(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,r.d9)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0},query:i.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1}}}},58333:(e,t,n)=>{n.d(t,{ET:()=>i,I4:()=>r,eG:()=>l,lF:()=>o,lj:()=>c,qP:()=>a,wW:()=>u});const s=[252,146,31,255],r={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},i={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},c={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7845],{66643:(e,t,n)=>{n.d(t,{Ed:()=>u,UI:()=>c,mt:()=>h,q6:()=>y,vr:()=>f});var s=n(43697),r=n(92036),i=n(70586),o=n(95330),a=n(5600),l=n(52011);function u(e,t,n){return(0,o.as)(e.map(((e,s)=>t.apply(n,[e,s]))))}async function c(e,t,n){return(await(0,o.as)(e.map(((e,s)=>t.apply(n,[e,s]))))).map((e=>e.value))}function p(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function y(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return p(await e)}catch(e){return d(e)}}async function h(e){try{return p(await e)}catch(e){return(0,o.r9)(e),d(e)}}function f(e,t){return new m(e,t)}let m=class extends r.Z{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,i.IM)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:n}=this._abortController;this.promise=e(n),this.promise.then((e=>{this._result=p(e),this._cleanup()}),(e=>{this._result=d(e),this._cleanup()})),this._abortHandle=(0,o.fu)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,i.hw)(this._abortHandle),this._abortController=null}};(0,s._)([(0,a.Cb)()],m.prototype,"value",null),(0,s._)([(0,a.Cb)()],m.prototype,"error",null),(0,s._)([(0,a.Cb)()],m.prototype,"finished",null),(0,s._)([(0,a.Cb)()],m.prototype,"promise",void 0),(0,s._)([(0,a.Cb)()],m.prototype,"_result",void 0),m=(0,s._)([(0,l.j)("esri.core.asyncUtils.ReactiveTask")],m)},97845:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var s=n(3172),r=n(66643),i=n(20102),o=n(92604),a=n(95330),l=n(33955),u=n(8744),c=n(98732),p=n(57191),d=n(37427),y=n(66202),h=n(92722),f=n(25278),m=n(23095),g=n(99514),_=n(86719),b=n(35671);const S={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class w{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const n=[];await this._checkProjection(e.spatialReference);let s=null;e.url&&(s=await this._fetch(t?.signal));const r=(0,h.my)(s,{geometryType:e.geometryType}),o=e.fields||r.fields||[],a=null!=e.hasZ?e.hasZ:r.hasZ,l=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const d=e.spatialReference||u.Zn;let m=e.timeInfo;o===r.fields&&r.unknownFields.length>0&&n.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});let w=new g.Z(o).get(c);w?("esriFieldTypeString"!==w.type&&(w.type="esriFieldTypeOID"),w.editable=!1,w.nullable=!1,c=w.name):(w={alias:c,name:c,type:"string"===r.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(w));const F={};for(const e of o){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),!e.name)throw new i.Z("geojson-layer:invalid-field-name","field name is missing",{field:e});if(!_.v.jsonValues.includes(e.type))throw new i.Z("geojson-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});if(e.name!==w.name){const t=(0,b.os)(e);void 0!==t&&(F[e.name]=t)}}this._fieldsIndex=new g.Z(o);const I=this._fieldsIndex.requiredFields.indexOf(w);if(I>-1&&this._fieldsIndex.requiredFields.splice(I,1),m){if(m.startTimeField){const e=this._fieldsIndex.get(m.startTimeField);e?(m.startTimeField=e.name,e.type="esriFieldTypeDate"):m.startTimeField=null}if(m.endTimeField){const e=this._fieldsIndex.get(m.endTimeField);e?(m.endTimeField=e.name,e.type="esriFieldTypeDate"):m.endTimeField=null}if(m.trackIdField){const e=this._fieldsIndex.get(m.trackIdField);e?m.trackIdField=e.name:(m.trackIdField=null,n.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:m}}))}m.startTimeField||m.endTimeField||(n.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:m}}),m=null)}const E=l?(0,f.bU)(l):void 0,T={warnings:n,featureErrors:[],layerDefinition:{...S,drawingInfo:E??void 0,templates:(0,f.Hq)(F),extent:void 0,geometryType:l,objectIdField:c,fields:o,hasZ:!!a,timeInfo:m}};this._queryEngine=new y.q({fields:o,geometryType:l,hasM:!1,hasZ:a,objectIdField:c,spatialReference:d,timeInfo:m,featureStore:new p.Z({geometryType:l,hasM:!1,hasZ:a}),cacheSpatialQueries:!0}),this._createDefaultAttributes=(0,f.Dm)(F,c);const j=await this._createFeatures(s);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,j);const q=this._normalizeFeatures(j,T.warnings,T.featureErrors);this._queryEngine.featureStore.addMany(q);const{fullExtent:C,timeExtent:x}=await this._queryEngine.fetchRecomputedExtents();if(T.layerDefinition.extent=C,x){const{start:e,end:t}=x;T.layerDefinition.timeInfo.timeExtent=[e,t]}return T}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([(0,m.b)(t,n),(0,d._W)(e.adds,t),(0,d._W)(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=(0,r.vr)(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)}),(e=>{this._queryEngine.featureStore.clear(),(0,a.D_)(e)||o.Z.getLogger("esri.layers.GeoJSONLayer").error(new i.Z("geojson-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:n}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:n}}async _createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:n,objectIdField:s}=this._queryEngine,r=(0,h.lG)(e,{geometryType:t,hasZ:n,objectIdField:s});if(!(0,u.fS)(this._queryEngine.spatialReference,u.Zn))for(const e of r)null!=e.geometry&&(e.geometry=(0,c.GH)((0,d.iV)((0,c.di)(e.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),u.Zn,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:n}=this._loadOptions,r=(await(0,s.default)(t,{responseType:"json",query:{...n},signal:e})).data;return await(0,h.O3)(r),r}_normalizeFeatures(e,t,n){const{objectIdField:s}=this._queryEngine,r=[];for(const i of e){const e=this._createDefaultAttributes(),o=(0,m.O0)(this._fieldsIndex,e,i.attributes,!0,t);o?n?.push(o):(this._assignObjectId(e,i.attributes,!0),i.attributes=e,i.objectId=e[s],r.push(i))}return r}async _applyEdits(e){const{adds:t,updates:n,deletes:s}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(r,t),n&&n.length&&this._applyUpdateEdits(r,n),s&&s.length){for(const e of s)r.deleteResults.push((0,m.d1)(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:i,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:i,timeExtent:o,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:n}=e,{geometryType:s,hasM:r,hasZ:i,objectIdField:o,spatialReference:a,featureStore:u}=this._queryEngine,p=[];for(const r of t){if(r.geometry&&s!==(0,l.Ji)(r.geometry)){n.push((0,m.av)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),i=(0,m.O0)(this._fieldsIndex,t,r.attributes);if(i)n.push(i);else{if(this._assignObjectId(t,r.attributes),r.attributes=t,null!=r.uid){const t=r.attributes[o];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??a;r.geometry=(0,d.iV)((0,m.og)(r.geometry,e),e,a)}p.push(r),n.push((0,m.d1)(r.attributes[o]))}}u.addMany((0,c.Yn)([],p,s,i,r,o))}_applyUpdateEdits({updateResults:e},t){const{geometryType:n,hasM:s,hasZ:r,objectIdField:i,spatialReference:o,featureStore:a}=this._queryEngine;for(const u of t){const{attributes:t,geometry:p}=u,y=t&&t[i];if(null==y){e.push((0,m.av)(`Identifier field ${i} missing`));continue}if(!a.has(y)){e.push((0,m.av)(`Feature with object id ${y} missing`));continue}const h=(0,c.EI)(a.getFeature(y),n,r,s);if(null!=p){if(n!==(0,l.Ji)(p)){e.push((0,m.av)("Incorrect geometry type."));continue}const t=p.spatialReference??o;h.geometry=(0,d.iV)((0,m.og)(p,t),t,o)}if(t){const n=(0,m.O0)(this._fieldsIndex,h.attributes,t);if(n){e.push(n);continue}}a.add((0,c.XA)(h,n,r,s,i)),e.push((0,m.d1)(y))}}_createObjectIdGenerator(e,t){const n=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===n.type)return()=>n.name+"-"+Date.now().toString(16);let s=Number.NEGATIVE_INFINITY;for(const e of t)e.objectId&&(s=Math.max(s,e.objectId));return s=Math.max(0,s)+1,()=>s++}_assignObjectId(e,t,n=!1){const s=this._queryEngine.objectIdField;e[s]=n&&s in t?t[s]:this._objectIdGenerator()}async _checkProjection(e){try{await(0,d._W)(u.Zn,e)}catch{throw new i.Z("geojson-layer","Projection not supported")}}}},92722:(e,t,n)=>{n.d(t,{O3:()=>w,lG:()=>I,my:()=>F,q9:()=>l});var s=n(20102),r=n(70272),i=n(5428),o=n(35671);const a={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function l(e){return a[e]}function*u(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*c(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function p(e){for(const t of e)if(t.length>2)return!0;return!1}function d(e){let t=0;for(let n=0;n<e.length;n++){const s=e[n],r=e[(n+1)%e.length];t+=s[0]*r[1]-r[0]*s[1]}return t<=0}function y(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function h(e,t,n){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,n){return g(e,t.coordinates,n),e}(e,t,n);case"MultiLineString":return function(e,t,n){for(const s of t.coordinates)g(e,s,n);return e}(e,t,n);case"MultiPolygon":return function(e,t,n){for(const s of t.coordinates){f(e,s[0],n);for(let t=1;t<s.length;t++)m(e,s[t],n)}return e}(e,t,n);case"Point":return function(e,t,n){return b(e,t.coordinates,n),e}(e,t,n);case"Polygon":return function(e,t,n){const s=t.coordinates;f(e,s[0],n);for(let t=1;t<s.length;t++)m(e,s[t],n);return e}(e,t,n)}}function f(e,t,n){const s=y(t);!function(e){return!d(e)}(s)?g(e,s,n):_(e,s,n)}function m(e,t,n){const s=y(t);!function(e){return d(e)}(s)?g(e,s,n):_(e,s,n)}function g(e,t,n){for(const s of t)b(e,s,n);e.lengths.push(t.length)}function _(e,t,n){for(let s=t.length-1;s>=0;s--)b(e,t[s],n);e.lengths.push(t.length)}function b(e,t,n){const[s,r,i]=t;e.coords.push(s,r),n.hasZ&&e.coords.push(i||0)}function S(e){switch(typeof e){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function w(e){if(!e)throw new s.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new s.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:t}=e;if(!t)return;const n="string"==typeof t?t:"name"===t.type?t.properties.name:"EPSG"===t.type?t.properties.code:null,r=new RegExp(".*(CRS84H?|4326)$","i");if(!n||!r.test(n))throw new s.Z("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function F(e,t={}){const n=[],s=new Set,r=new Set;let i,a=!1,d=null,y=!1,{geometryType:h=null}=t,f=!1;for(const t of u(e)){const{geometry:e,properties:u,id:m}=t;if((!e||(h||(h=l(e.type)),l(e.type)===h))&&(a||(a=p(c(e))),y||(y=null!=m,y&&(i=typeof m,u&&(d=Object.keys(u).filter((e=>u[e]===m))))),u&&d&&y&&null!=m&&(d.length>1?d=d.filter((e=>u[e]===m)):1===d.length&&(d=u[d[0]]===m?d:[])),!f&&u)){let e=!0;for(const t in u){if(s.has(t))continue;const i=u[t];if(null==i){e=!1,r.add(t);continue}const a=S(i);if("unknown"===a){r.add(t);continue}r.delete(t),s.add(t);const l=(0,o.q6)(t);l&&n.push({name:l,alias:t,type:a})}f=e}}const m=(0,o.q6)(1===d?.length&&d[0]||null)??void 0;if(m)for(const e of n)if(e.name===m&&(0,o.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:n,geometryType:h,hasZ:a,objectIdFieldName:m,objectIdFieldType:i,unknownFields:Array.from(r)}}function I(e,t){return Array.from(function*(e,t={}){const{geometryType:n,objectIdField:s}=t;for(const o of e){const{geometry:e,properties:a,id:u}=o;if(e&&l(e.type)!==n)continue;const c=a||{};let p;s&&(p=c[s],null==u||p||(c[s]=p=u));const d=new r.u_(e?h(new i.Z,e,t):null,c,null,p??void 0);yield d}}(u(e),t))}},25278:(e,t,n)=>{n.d(t,{Dm:()=>c,Hq:()=>p,MS:()=>d,bU:()=>a});var s=n(80442),r=n(22974),i=n(61159),o=n(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.I4:"esriGeometryPolyline"===e?o.ET:o.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,s.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let n=`this.${t} = null;`;for(const t in e)n+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${n};\n }\n }\n `)();return()=>new s}catch(n){return()=>({[t]:null,...e})}}function p(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,r.d9)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:i.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1}}}},58333:(e,t,n)=>{n.d(t,{ET:()=>i,I4:()=>r,eG:()=>l,lF:()=>o,lj:()=>c,qP:()=>a,wW:()=>u});const s=[252,146,31,255],r={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},i={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},c={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5261],{88764:(e,t,s)=>{s.d(t,{q:()=>l});var i,r,n,a=s(5732),o={exports:{}};i=o,r=function(){function e(s,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,l=i-r+1,u=Math.log(o),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);e(s,i,Math.max(r,Math.floor(i-l*c/o+h)),Math.min(n,Math.floor(i+(o-l)*c/o+h)),a)}var d=s[i],f=r,p=n;for(t(s,r,i),a(s[n],d)>0&&t(s,r,n);f<p;){for(t(s,f,p),f++,p--;a(s[f],d)<0;)f++;for(;a(s[p],d)>0;)p--}0===a(s[r],d)?t(s,r,p):t(s,++p,n),p<=i&&(r=p+1),i<=p&&(n=p-1)}}function t(e,t,s){var i=e[t];e[t]=e[s],e[s]=i}function s(e,t){return e<t?-1:e>t?1:0}return function(t,i,r,n,a){e(t,i,r||0,n||t.length-1,a||s)}},void 0!==(n=r())&&(i.exports=n);const l=(0,a.g)(o.exports)},37455:(e,t,s)=>{s.d(t,{N:()=>i});const i={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,s){const i=new r(e.getPointX(t),e.getPointY(t),s),n=e.hasZ(t),a=e.hasM(t);return n&&(i.z=e.getPointZ(t)),a&&(i.m=e.getPointM(t)),i},exportPolygon:function(e,t,s){return new n(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,s){return new a(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,s){return new o(e.exportPoints(t),s,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,s){const i=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),s);if(i){const s=e.getZExtent(t);n.zmin=s.vmin,n.zmax=s.vmax}if(r){const s=e.getMExtent(t);n.mmin=s.vmin,n.mmax=s.vmax}return n}};class r{constructor(e,t,s){this.x=e,this.y=t,this.spatialReference=s,this.z=void 0,this.m=void 0}}class n{constructor(e,t,s,i){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class a{constructor(e,t,s,i){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class o{constructor(e,t,s,i){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class l{constructor(e,t,s,i,r){this.xmin=e,this.ymin=t,this.xmax=s,this.ymax=i,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},29730:(e,t,s)=>{function i(e,t){return e?t?4:3:t?3:2}function r(e,t,s,r,o){if(null==t||!t.lengths.length)return null;const l="upperLeft"===o?.originPosition?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const u=e.coords,c=[],h=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:d,coords:f}=t,p=i(s,r);let m=0;for(const e of d){const t=n(h,f,m,e,s,r,l);t&&c.push(t),m+=e*p}if(c.sort(((e,t)=>{let i=l*e[2]-l*t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),c.length){let e=6*c[0][2];u[0]=c[0][0]/e,u[1]=c[0][1]/e,s&&(e=6*c[0][4],u[2]=0!==e?c[0][3]/e:0),(u[0]<h[0]||u[0]>h[1]||u[1]<h[2]||u[1]>h[3]||s&&(u[2]<h[4]||u[2]>h[5]))&&(u.length=0)}if(!u.length){const e=t.lengths[0]?a(f,0,d[0],s,r):null;if(!e)return null;u[0]=e[0],u[1]=e[1],s&&e.length>2&&(u[2]=e[2])}return e}function n(e,t,s,r,n,a,o=1){const l=i(n,a);let u=s,c=s+l,h=0,d=0,f=0,p=0,m=0;for(let s=0,i=r-1;s<i;s++,u+=l,c+=l){const s=t[u],i=t[u+1],r=t[u+2],a=t[c],o=t[c+1],l=t[c+2];let g=s*o-a*i;p+=g,h+=(s+a)*g,d+=(i+o)*g,n&&(g=s*l-a*r,f+=(r+l)*g,m+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(p*o>0&&(p*=-1),m*o>0&&(m*=-1),!p)return null;const g=[h,d,.5*p];return n&&(g[3]=f,g[4]=.5*m),g}function a(e,t,s,r,n){const a=i(r,n);let h=t,d=t+a,f=0,p=0,m=0,g=0;for(let t=0,i=s-1;t<i;t++,h+=a,d+=a){const t=e[h],s=e[h+1],i=e[h+2],n=e[d],a=e[d+1],_=e[d+2],y=r?l(t,s,i,n,a,_):o(t,s,n,a);if(y)if(f+=y,r){const e=c(t,s,i,n,a,_);p+=y*e[0],m+=y*e[1],g+=y*e[2]}else{const e=u(t,s,n,a);p+=y*e[0],m+=y*e[1]}}return f>0?r?[p/f,m/f,g/f]:[p/f,m/f]:s>0?r?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function o(e,t,s,i){const r=s-e,n=i-t;return Math.sqrt(r*r+n*n)}function l(e,t,s,i,r,n){const a=i-e,o=r-t,l=n-s;return Math.sqrt(a*a+o*o+l*l)}function u(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function c(e,t,s,i,r,n){return[e+.5*(i-e),t+.5*(r-t),s+.5*(n-s)]}s.d(t,{Y:()=>r})},66202:(e,t,s)=>{s.d(t,{q:()=>De});var i=s(67676),r=s(20102),n=s(22974),a=s(70586),o=s(69801),l=s(95330),u=s(67900),c=s(60437),h=s(24470),d=s(20322),f=s(33955),p=s(16306),m=s(8744),g=s(98732),_=s(35454),y=s(13867),I=s(41534);const S=new class{constructor(e,t){this._cache=new y.z(e),this._invalidCache=new y.z(t)}get(e,t){const s=`${t.uid}:${e}`,i=this._cache.get(s);if(i)return i;if(void 0!==this._invalidCache.get(s))return null;try{const i=I.WhereClause.create(e,t);return this._cache.put(s,i),i}catch{return this._invalidCache.put(s,null),null}}}(50,500),x="feature-store:unsupported-query",E=" as ",R=new _.X({esriFieldTypeString:"string"}),T=new _.X({esriFieldTypeOID:"oid",esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long"}),F=new _.X({esriFieldTypeDate:"date"}),w=new _.X({esriFieldTypeGUID:"guid",esriFieldTypeGlobalId:"global-id"}),b=new Set([...T.jsonValues,...F.jsonValues,...R.jsonValues,...w.jsonValues]),A=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...T.apiValues,...F.apiValues,...R.apiValues,...w.apiValues]);function v(e,t,s={}){const i=C(e,t);if(!i)throw new r.Z(x,"invalid SQL expression",{expression:e});const n=s.expressionName||"expression";if(s.validateStandardized&&!i.isStandardized)throw new r.Z(x,`${n} is not standard`,{expression:e});if(s.validateAggregate&&!i.isAggregate)throw new r.Z(x,`${n} does not contain a valid aggregate function`,{expression:e});return i.fieldNames}function N(e,t,s,i){if(!t)return!0;const n="having",a=v(t,e,{validateAggregate:!0,expressionName:n});P(e,a,{expressionName:n,query:i}),O(e,a,{expressionName:n,query:i});const o=S.get(t,e),l=o?.getExpressions().every((t=>{const{aggregateType:i,field:r}=t,n=e.get(r)?.name;return s.some((t=>{const{onStatisticField:s,statisticType:r}=t,a=e.get(s)?.name;return a===n&&r.toLowerCase().trim()===i}))}));if(!l)throw new r.Z(x,"expressions in having should also exist in outStatistics",{having:t});return!0}function C(e,t){return e?S.get(e,t):null}function P(e,t,s={}){s.errorMessage||(s.errorMessage=s.expressionName?`${s.expressionName} contains invalid fields`:"Fields are invalid"),M(e,t,((e,t)=>t.has(e)),s)}function O(e,t,s={}){s.errorMessage||(s.errorMessage=s.expressionName?`${s.expressionName} only supports ${A} field types`:`Only ${A} field types are supported`),M(e,t,((e,t)=>!G(e,t)),s)}function M(e,t,s,i={}){const n=i.verifyExpression??!0,a=[];for(const r of t){const t=s(r,e);if("*"!==r&&!t)if(n){const t=k(r);try{M(e,v(t,e,{validateStandardized:!0}),s,i)}catch(e){const t=e?.details;if(t?.expression)throw e;t?.invalidFields?a.push(...t.invalidFields):a.push(r)}}else a.push(r)}if(a.length)throw new r.Z(x,i.errorMessage,{invalidFields:a,query:i.query})}function k(e){return e.split(E)[0]}function G(e,t,s=b){const i=t.get(e);return!!i&&!s.has(i.type)}var V=s(37427),D=s(61159),L=s(35308),Q=s(49600),U=s(82397),q=s(11490),z=s(24452),Z=s(59266);class j{constructor(e,t,s){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=s,this.featureAdapter=t;const i=e.outFields;if(i&&!i.includes("*")){this.outFields=i;let e=0;for(const t of i){const i=k(t),r=this.fieldsIndex.get(i),n=r?null:C(i,s),a=r?r.name:t.split(E)[1]||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,s){const i=s?s.name:t;let r=null;return this._fieldDataCache.has(i)?r=this._fieldDataCache.get(i)?.clause:s||(r=C(t,this.fieldsIndex),this._fieldDataCache.set(i,{alias:i,clause:r})),s?this.featureAdapter.getAttribute(e,i):r?.calculateValue(e,this.featureAdapter)}getDataValues(e,t){const s=t.normalizationType,i=t.normalizationTotal;return e.map((e=>{let r=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2&&(r=`${(0,z.wk)(r)}${t.fieldDelimiter}${(0,z.wk)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,z.wk)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)),s&&Number.isFinite(r)){const n="field"===s&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;r=(0,z.fk)(r,s,n,i)}return r}))}async getExpressionValues(e,t,s,i){const{arcadeUtils:r}=await(0,Z.LC)(),n=r.hasGeometryOperations(t);n&&await r.enableGeometryOperations();const a=r.createFunction(t),o=s&&r.getViewInfo(s),l={fields:this.fieldsIndex.fields};return e.map((e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:l,geometry:n?{...(0,q.Op)(i.geometryType,i.hasZ,i.hasM,this.featureAdapter.getGeometry(e)),spatialReference:s?.spatialReference}:null},u=r.createExecContext(t,o);return r.executeFunction(a,u)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:C(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:C(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t||!t.length)return this.featureAdapter.getAttributes(e);const s={};for(const i of t){const{alias:t,clause:r}=this._fieldDataCache.get(i);s[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return s}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,s=[];if(t)for(const i of t){const{alias:t}=this._fieldDataCache.get(i);s.push(e[t])}else for(const t in e)s.push(e[t]);const i=`${(t||["*"]).join(",")}=${s.join(",")}`;let r=this._returnDistinctMap.get(i)||0;return this._returnDistinctMap.set(i,++r),r>1?null:e}}function B(e,t,s){return{objectId:e,target:t,distance:s,type:"vertex"}}function Y(e,t,s,i,r,n=!1){return{objectId:e,target:t,distance:s,type:"edge",start:i,end:r,draped:n}}var H=s(35671);class W{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new j(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of i){const{statisticType:i}=r,l="exceedslimit"!==i?r.onStatisticField:void 0;if(!a.has(l)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,n);s.push(t)}a.set(l,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:i,items:r}=u[t],n=i.join(",");s&&!e.validateItems(r,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,m.JY)(this.query.outSR)&&!(0,m.fS)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,q.S2)({spatialReference:this.query.outSR,...(0,V.iV)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,q.S2)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=$(this.hasZ,this.hasM),{point:r,mode:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=this._getPointCreator(n,this.spatialReference,t),h=new J(null,0),d=new J(null,0),f={x:0,y:0,z:0};for(const t of this.items){const n=s.getGeometry(t);if(null==n)continue;const{coords:p,lengths:m}=n;if(h.coords=p,d.coords=p,e.returnEdge){let e=0;for(let n=0;n<m.length;n++){const u=m[n];for(let n=0;n<u;n++,e+=i){const p=h;if(p.coordsIndex=e,n!==u-1){const n=d;n.coordsIndex=e+i;const u=f;X(f,r,p,n);const h=(r.x-u.x)/a,m=(r.y-u.y)/o,g=h*h+m*m;g<=1&&l.candidates.push(Y(s.getObjectId(t),c(u),Math.sqrt(g),c(p),c(n)))}}}}if(e.returnVertex){const e=u?p.length-i:p.length;for(let n=0;n<e;n+=i){const e=h;e.coordsIndex=n;const i=(r.x-e.x)/a,u=(r.y-e.y)/o,d=i*i+u*u;d<=1&&l.candidates.push(B(s.getObjectId(t),c(e),Math.sqrt(d)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s){const i=null==s||(0,m.fS)(t,s)?e=>e:e=>(0,V.iV)(e,t,s),{hasZ:r}=this;return"3d"===e?r?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:0}):({x:e,y:t})=>i({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l}=e,u=this.fieldsIndex.isDateField(t),c=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:l}),h=(0,z.S5)({normalizationType:r,normalizationField:i,minValue:a,maxValue:o}),d=this.fieldsIndex.get(t),f={value:.5,fieldType:d?.type},p=(0,H.qN)(d)?(0,z.H0)({values:c,supportsNullCount:h,percentileParams:f}):(0,z.i5)({values:c,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:h,percentileParams:f});return(0,z.F_)(p,u)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:r,scale:n}=e,a=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n}),o=(0,z.eT)(a);return(0,z.Qm)(o,i,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:h}=e,d=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h}),f=(0,z.G2)(d,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,z.DL)(f,a)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:h}=e,d=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h});return(0,z.oF)(d,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t&&t.length)for(const i of t.reverse()){const t=i.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,z.Lq)(n?.type,a);e.sort(((e,t)=>{const i=s(e,r,n),a=s(t,r,n);return o(i,a)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:r,objectIdField:n,spatialReference:a}=this,{outFields:o,outSR:l,quantizationParameters:u,resultRecordCount:c,resultOffset:h,returnZ:d,returnM:f}=e,p=null!=c&&t.length>(h||0)+c,m=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:p,features:this._createFeatures(e,t),fields:m,geometryType:s,hasM:i&&f,hasZ:r&&d,objectIdFieldName:n,spatialReference:(0,q.S2)(l||a),transform:u&&(0,U.vY)(u)||null}}_createFeatures(e,t){const s=new j(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:r}=this,{orderByFields:n,quantizationParameters:a,returnGeometry:o,returnCentroid:l,maxAllowableOffset:u,resultOffset:c,resultRecordCount:h,returnZ:d=!1,returnM:f=!1}=e,p=r&&d,m=i&&f;let g=[],_=0;const y=[...t];if(this._sortFeatures(y,n,((e,t,i)=>s.getFieldValue(e,t,i))),o||l){const e=(0,U.vY)(a)??void 0;if(o&&!l)for(const t of y)g[_++]={attributes:s.getAttributes(t),geometry:(0,q.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),u,e,p,m)};else if(!o&&l)for(const t of y)g[_++]={attributes:s.getAttributes(t),centroid:(0,q.EG)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of y)g[_++]={attributes:s.getAttributes(t),centroid:(0,q.EG)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,q.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),u,e,p,m)}}else for(const e of y){const t=s.getAttributes(e);t&&(g[_++]={attributes:t})}const I=c||0;if(null!=h){const e=I+h;g=g.slice(I,Math.min(g.length,e))}return g}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(const t of e.outStatistics??[])if("exceedslimit"===t.statisticType){s=null!=t.maxPointCount?t.maxPointCount:Number.POSITIVE_INFINITY,i=null!=t.maxRecordCount?t.maxRecordCount:Number.POSITIVE_INFINITY,r=null!=t.maxVertexCount?t.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>i)t=!0;else{const e=$(this.hasZ,this.hasM),s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)}),0)/e>r}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,r=new Map,n=new Map,a=new Map,o=new j(e,this.featureAdapter,this.fieldsIndex),l=e.outStatistics,{groupByFieldsForStatistics:u,having:c,orderByFields:h}=e,d=u&&u.length,f=!!d,p=f?u[0]:null,m=f&&!this.fieldsIndex.get(p);for(const e of l??[]){const{outStatisticFieldName:l,statisticType:h}=e,g=e,_="exceedslimit"!==h?e.onStatisticField:void 0,y="percentile_disc"===h||"percentile_cont"===h,I="EnvelopeAggregate"===h||"CentroidAggregate"===h||"ConvexHullAggregate"===h,S=f&&1===d&&(_===p||m)&&"count"===h;if(f){if(!n.has(_)){const e=[];for(const t of u){const s=this._getAttributeValues(o,t,i);e.push(s)}n.set(_,this._calculateUniqueValues(e,!I&&o.returnDistinctValues))}const e=n.get(_);for(const t in e){const{count:s,data:r,items:n,itemPositions:h}=e[t],d=r.join(",");if(!c||o.validateItems(n,c)){const e=a.get(d)||{attributes:{}};if(I){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:s}=await this._getAggregateGeometry(g,n);e.aggregateGeometries[s]=t}else{let t=null;if(S)t=s;else{const e=this._getAttributeValues(o,_,i),s=h.map((t=>e[t]));t=y&&"statisticParameters"in g?this._getPercentileValue(g,s):this._getStatisticValue(g,s,null,o.returnDistinctValues)}e.attributes[l]=t}let t=0;u.forEach(((s,i)=>e.attributes[this.fieldsIndex.get(s)?s:"EXPR_"+ ++t]=r[i])),a.set(d,e)}}}else if(I){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(g,this.items);t.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(o,_,i);t.attributes[l]=y&&"statisticParameters"in g?this._getPercentileValue(g,e):this._getStatisticValue(g,e,r,o.returnDistinctValues)}s.push({name:l,alias:l,type:"esriFieldTypeDouble"})}const g=f?Array.from(a.values()):[t];return this._sortFeatures(g,h,((e,t)=>e.attributes[t])),{fields:s,features:g}}async _getAggregateGeometry(e,t){const{convexHull:i,union:r}=await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)),{statisticType:n,outStatisticFieldName:a}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map((e=>(0,q.Op)(u,c,h,o.getGeometry(e)))),f=i(l,d,!0)[0],p={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===n){const e=f?(0,Q._w)(f):(0,Q.aO)(r(l,d));p.aggregateGeometries={...e,spatialReference:l},p.outStatisticFieldName=a||"extent"}else if("CentroidAggregate"===n){const e=f?(0,L.tO)(f):(0,L.$G)((0,Q.aO)(r(l,d)));p.aggregateGeometries={x:e[0],y:e[1],spatialReference:l},p.outStatisticFieldName=a||"centroid"}else"ConvexHullAggregate"===n&&(p.aggregateGeometries=f,p.outStatisticFieldName=a||"convexHull");return p}_getStatisticValue(e,t,s,i){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=s?.has(r)?s.get(r):(0,H.qN)(this.fieldsIndex.get(r))?(0,z.H0)({values:t,returnDistinct:i}):(0,z.i5)({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:r}=e,{value:n,orderBy:a}=i,o=this.fieldsIndex.get(s);return(0,z.XL)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),r=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,r),r}_calculateUniqueValues(e,t){const s={},i=this.items,r=i.length;for(let n=0;n<r;n++){const r=i[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(t||s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e){const t=new j(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:s,scale:i}=e,r=s?{viewingMode:"map",scale:i,spatialReference:this.query.outSR||this.spatialReference}:null;return s?t.getExpressionValues(this.items,s,r,{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM}):t.getDataValues(this.items,{field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal})}}function X(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,a=r*r+n*n,o=(t.x-s.x)*r+(t.y-s.y)*n,l=Math.min(1,Math.max(0,o/a));e.x=s.x+r*l,e.y=s.y+n*l}function $(e,t){return e?t?4:3:t?3:2}class J{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}var K=s(10402),ee=s(17590),te=s(99514),se=s(61247),ie=(s(80442),s(92604)),re=s(54790),ne=s(44553),ae=s(17445),oe=s(58971),le=s(10661);class ue{constructor(e,t){this._observable=new le.s,this._value=e,this._equalityFunction=t}get value(){return(0,oe.it)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function ce(e,t=n.y7){return new ue(e,t)}var he=s(76882);class de{constructor(){this._tasks=new Array,this._running=ce(!1)}get length(){return this._tasks.length}get running(){return this._running.value}destroy(){this.cancelAll()}runTask(e){for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,s){return this._running.value=!0,new Promise(((i,r)=>this._tasks.push(new fe(i,r,e,t,s))))}unshift(e,t,s){return this._running.value=!0,new Promise(((i,r)=>this._tasks.unshift(new fe(i,r,e,t,s))))}_process(e){if(0===this._tasks.length)return!1;const t=this._tasks.shift();try{const s=(0,l.Hc)(t.signal);if(s&&!t.abortCallback)t.reject((0,l.zE)());else{const i=s?t.abortCallback?.((0,l.zE)()):t.callback(e);(0,l.y8)(i)?i.then(t.resolve,t.reject):t.resolve(i)}}catch(e){t.reject(e)}return this._running.value=this._tasks.length>0,!0}cancelAll(){const e=(0,l.zE)();for(const t of this._tasks)if(t.abortCallback){const s=t.abortCallback(e);t.resolve(s)}else t.reject(e);this._tasks.length=0,this._running.value=!1}}class fe{constructor(e,t,s,i=void 0,r=void 0){this.resolve=e,this.reject=t,this.callback=s,this.signal=i,this.abortCallback=r}}var pe=s(43697),me=s(92036),ge=s(5600),_e=(s(75215),s(52011));let ye=class extends me.Z{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,pe._)([(0,ge.Cb)()],ye.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,pe._)([(0,ge.Cb)()],ye.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),ye=(0,pe._)([(0,_e.j)("esri.views.support.DebugFlags")],ye);const Ie=new ye;var Se,xe,Ee,Re;!function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(Se||(Se={})),(Re=xe||(xe={}))[Re.YIELD=1]="YIELD",function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(Ee||(Ee={}));const Te=new Map([[Ee.RESOURCE_CONTROLLER_IMMEDIATE,0],[Ee.RESOURCE_CONTROLLER,4],[Ee.SLIDE,0],[Ee.STREAM_DATA_LOADER,0],[Ee.ELEVATION_QUERY,0],[Ee.TERRAIN_SURFACE,1],[Ee.SURFACE_GEOMETRY_UPDATES,1],[Ee.LOD_RENDERER,2],[Ee.GRAPHICS_CORE,2],[Ee.I3S_CONTROLLER,2],[Ee.POINT_CLOUD_LAYER,2],[Ee.FEATURE_TILE_FETCHER,2],[Ee.OVERLAY,4],[Ee.STAGE,4],[Ee.GRAPHICS_DECONFLICTOR,4],[Ee.FILTER_VISIBILITY,4],[Ee.SCALE_VISIBILITY,4],[Ee.FRUSTUM_VISIBILITY,4],[Ee.CLOUDS_GENERATOR,4],[Ee.POINT_OF_INTEREST_FREQUENT,6],[Ee.POINT_OF_INTEREST_INFREQUENT,30],[Ee.LABELER,8],[Ee.FEATURE_QUERY_ENGINE,8],[Ee.FEATURE_TILE_TREE,16],[Ee.FEATURE_TILE_TREE_ACTIVE,0],[Ee.ELEVATION_ALIGNMENT,12],[Ee.TEXT_TEXTURE_ATLAS,12],[Ee.TEXTURE_UNLOAD,12],[Ee.LINE_OF_SIGHT_TOOL,16],[Ee.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[Ee.SNAPPING,0],[Ee.SHADOW_ACCUMULATOR,30]]);function Fe(e){return Te.has(e)?Te.get(e):"number"==typeof e?e:1}const we=(0,he.HA)(6.5),be=(0,he.HA)(1),Ae=(0,he.HA)(30),ve=(0,he.HA)(1e3/30),Ne=(0,he.HA)(100);var Ce,Pe;!function(e){e.Scheduler=class{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some((e=>e.needsUpdate))}constructor(){this._updating=ce(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new re.Z("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new s,this._state=Se.INTERACTING,this._tasks=new ne.Z,this._runQueue=new ne.Z,this._load=0,this._idleStateCallbacks=new ne.Z,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=(0,ae.YP)((()=>Ie.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),ae.nn);for(const e of Object.keys(Ee))this.performanceInfo.tasks.set(Ee[e],new re.Z(Ee[e]));const e=this;this._test={FRAME_SAFETY_BUDGET:we,INTERACTING_BUDGET:ve,IDLE_BUDGET:Ne,get availableBudget(){return e._budget.budget},usedBudget:0,getBudget:()=>e._budget,setBudget:t=>e._budget=t,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),(0,a.hw)(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())})))}registerTask(e,s){const i=Fe(e),r=new t(this,e,s,i);return this._tasks.push(r),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new re.Z(e)),r}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===Se.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const i=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){i._idleUpdatesStartFired&&(s.idleEnd(),i._state===Se.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==Se.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return this._state}updateBudget(e){this._test.usedBudget=0,++this._frameNumber;let t=we,s=e.frameDuration,i=be;switch(this.state){case Se.IDLE:t=(0,he.HA)(0),s=(0,he.HA)(Math.max(Ne,e.frameDuration)),i=Ae;break;case Se.INTERACTING:s=(0,he.HA)(Math.max(ve,e.frameDuration));case Se.ANIMATING:}return s=(0,he.HA)(s-e.elapsedFrameTime-t),this.state!==Se.IDLE&&s<be&&!this._forceTask?(this._forceTask=!0,!1):(s=(0,he.HA)(Math.max(s,i)),this._budget.reset(s,this.state),this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case Se.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case Se.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset((0,he.HA)(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return Pe.SCHEDULED;let t=Pe.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=Pe.READY:t!==Pe.READY&&(t=Pe.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=.9*this._load+e*(1-.9)}_schedule(){for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{0===e.basePriority&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{s.needsUpdate&&0!==s.schedulePriority&&0!==s.basePriority&&s.blockFrame!==this._frameNumber&&(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority?(s.schedulePriority=0,this._runQueue.push(s)):--s.schedulePriority)})),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===xe.YIELD&&(s.blockFrame=this._frameNumber)}catch(e){ie.Z.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e)}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,Ee.I3S_CONTROLLER,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now()-t;if(s.runtime+=i,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+i),this._debug&&i>2*this._budget.budget&&console.log("Task",s.name,"used",i,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(Ee))this._frameTaskTimes.set(Ee[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).record(e))),this.performanceInfo.total.record(e)}get test(){return this._test}};class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,t,s,i){this._scheduler=e,this.name=t,this._basePriority=i,this.blockFrame=0,this.runtime=0,this._queue=new de,this._handles=new se.Z,this.schedulePriority=this._basePriority,this._task=ce(null!=s?s:this._queue),this._handles.add((0,ae.gx)((()=>this.task.running),(t=>e.taskRunningChanged(t))))}remove(){this.processQueue(Oe),this._scheduler.removeTask(this),this.schedule=Me.schedule,this.reschedule=Me.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){this.name=e;const t=Fe(e);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){this._queue.runTask(e)}}class s{constructor(){this._begin="undefined"!=typeof performance?performance.now():0,this._budget=0,this._state=Se.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}e.Budget=s}(Ce||(Ce={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(Pe||(Pe={}));const Oe=(()=>{const e=new Ce.Budget;return e.enabled=!1,e})(),Me=new class{remove(){}processQueue(){}schedule(e,t,s){try{if((0,l.Hc)(t)){const e=(0,l.zE)();return s?Promise.resolve(s(e)):Promise.reject(e)}return(0,l.gx)(e(Oe))}catch(e){return Promise.reject(e)}}reschedule(e,t,s){return this.schedule(e,t,s)}},ke="feature-store:unsupported-query",Ge=new o.WJ(2e6);let Ve=0;class De{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:D.g},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",(()=>this.clearCache())),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new o.Xq(Ve+++"$$",Ge)),this.fieldsIndex=new te.Z(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=(0,a.hw)(this._frameTask),this.clearCache(),(0,a.SC)(this._geometryQueryCache),this._changeHandle=(0,a.hw)(this._changeHandle),(0,a.SC)(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(t){if(t!==q.vF)throw t;return new W([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(e){if(e!==q.vF)throw e;return 0}}async executeQueryForExtent(e,t){const s=e.outSR;try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=i.size;return r?{count:r,extent:await this._getBounds(i.items,i.spatialReference,s||this.spatialReference)}:{count:0,extent:null}}catch(e){if(e===q.vF)return{count:0,extent:null};throw e}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),i=s.items,r=new Set;return await this._reschedule((()=>{for(const e of i)r.add(s.featureAdapter.getObjectId(e))}),t),r}catch(e){if(e===q.vF)return new Set;throw e}}async executeQueryForSnapping(e,t){const{point:s,distance:i,returnEdge:r,returnVertex:n}=e;if(!r&&!n)return{candidates:[]};const a=await this._reschedule((()=>this._checkQuerySupport(e.query)),t),o=!(0,m.fS)(s.spatialReference,this.spatialReference);o&&await(0,V._W)(s.spatialReference,this.spatialReference);const l="number"==typeof i?i:i.x,u="number"==typeof i?i:i.y,c={xmin:s.x-l,xmax:s.x+l,ymin:s.y-u,ymax:s.y+u,spatialReference:s.spatialReference},h=o?(0,V.iV)(c,this.spatialReference):c;if(!h)return{candidates:[]};const d=(await(0,p.aX)((0,f.im)(s),null,{signal:t}))[0],g=(await(0,p.aX)((0,f.im)(h),null,{signal:t}))[0];if(null==d||null==g)return{candidates:[]};const _=new W(await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(g.toJSON()))),t),a,this);await this._reschedule((()=>this._executeObjectIdsQuery(_)),t),await this._reschedule((()=>this._executeTimeQuery(_)),t),await this._reschedule((()=>this._executeAttributesQuery(_)),t);const y=d.toJSON(),I=o?(0,V.iV)(y,this.spatialReference):y,S=o?Math.max(h.xmax-h.xmin,h.ymax-h.ymin)/2:i;return _.createSnappingResponse({...e,point:I,distance:S},s.spatialReference)}async executeQueryForLatestObservations(e,t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new r.Z(ke,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const s=await this._executeQuery(e,{},t);return await this._reschedule((()=>this._filterLatest(s)),t),s.createQueryResponse()}catch(t){if(t!==q.vF)throw t;return new W([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const{field:i,field2:r,field3:n,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:i,field2:r,field3:n,valueExpression:a},s)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const[t,s]=await Promise.all(["getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getBounds(await this._getAllFeatures(),this.spatialReference,this.spatialReference),null!=this._timeExtentPromise?this._timeExtentPromise:this._timeExtentPromise=(0,ee.R)(this.timeInfo,this.featureStore)]);return(0,l.k_)(e),{fullExtent:t,timeExtent:s}}async _getBounds(e,t,s){const i=(0,c.t8)((0,c.Ue)(),c.Gv);await this.featureStore.forEachBounds(e,(e=>(0,c.TC)(i,e)));const r={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:(0,q.S2)(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(r.zmin=i[2],r.zmax=i[5]);const n=(0,V.iV)(r,t,s);if(n.spatialReference=(0,q.S2)(s),n.xmax-n.xmin==0){const e=(0,u.c9)(n.spatialReference);n.xmin-=e,n.xmax+=e}if(n.ymax-n.ymin==0){const e=(0,u.c9)(n.spatialReference);n.ymin-=e,n.ymax+=e}if(this.hasZ&&null!=n.zmin&&null!=n.zmax&&n.zmax-n.zmin==0){const e=(0,u.c9)(n.spatialReference);n.zmin-=e,n.zmax+=e}return n}async _schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(Oe)}async _reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(Oe)}async _getAllFeaturesQueryEngineResult(e){return new W(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach((t=>e.push(t)))})().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=(0,n.d9)(e),e=await this._schedule((()=>(0,q.Up)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>this._checkQuerySupport(e)),s),e={...e,...t};const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this._reschedule((()=>this._executeObjectIdsQuery(r)),s),await this._reschedule((()=>this._executeTimeQuery(r)),s),await this._reschedule((()=>this._executeAttributesQuery(r)),s),r}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,o=null==n||(0,m.fS)(n,a.spatialReference)?a:(0,V.iV)(a,n);if(!o)return null;const l=i||r,u=(0,m.JY)(s)&&!(0,m.fS)(this.spatialReference,s)&&l?async e=>this._project(e,s):e=>e,c=this.featureAdapter,h=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(o))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const s=new Set;for(const e of h)s.add(c.getObjectId(e));const i=await this._reschedule((()=>this._getAllFeatures()),t),r=await this._reschedule((async()=>{const r=await(0,K.cW)("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(i,(e=>!s.has(c.getObjectId(e))||r(c.getGeometry(e))),t);return new W(n,e,this)}),t);return u(r)}if(!h.length)return new W([],e,this);if(this._canExecuteSinglePass(o,e))return u(new W(h,e,this));const d=await(0,K.cW)("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),f=await this._runSpatialFilter(h,(e=>d(c.getGeometry(e))),t);return u(new W(f,e,this))}async _executeGeometryQuery(e,t,s){if(null!=t&&0===t.items.length)return t;e=null!=t?t.query:e;const{geometry:r,outSR:n,spatialRel:a,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!r||null==u||(0,m.fS)(u,r.spatialReference)?r:(0,V.iV)(r,u),h=o||l,d=(0,m.JY)(n)&&!(0,m.fS)(this.spatialReference,n),f=this._geometryQueryCache&&null==t?d&&h?JSON.stringify({originalFilterGeometry:r,spatialRelationship:a,outSpatialReference:n}):JSON.stringify({originalFilterGeometry:r,spatialRelationship:a}):null,p=f?this._geometryQueryCache.get(f):null;if(null!=p)return new W(p,e,this);const g=async e=>(d&&h&&await this._project(e,n),f&&this._geometryQueryCache.put(f,e.items,e.items.length+1),e);if(!c)return g(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const _=this.featureAdapter;let y=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(r))),s);if("esriSpatialRelDisjoint"===a){if(!y.length)return g(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of y)i.add(_.getObjectId(e));const r=null!=t?t.items:await this._reschedule((()=>this._getAllFeatures()),s),n=await this._reschedule((async()=>{const t=await(0,K.cW)(a,c,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(r,(e=>!i.has(_.getObjectId(e))||t(_.getGeometry(e))),s);return new W(n,e,this)}),s);return g(n)}if(null!=t){const e=new i.SO;y=y.filter((s=>(0,i.cq)(t.items,s,t.items.length,e)>=0))}if(!y.length){const t=new W([],e,this);return f&&this._geometryQueryCache.put(f,t.items,1),t}if(this._canExecuteSinglePass(c,e))return g(new W(y,e,this));const I=await(0,K.cW)(a,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(y,(e=>I(_.getGeometry(e))),s);return g(new W(S,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds||!e.query.aggregateIds.length||null==this.aggregateAdapter)return;const t=new Set;for(const s of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(s).forEach((e=>t.add(e)));const s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds||!e.query.objectIds.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,ee.y)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=C(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let i=0;const r=new Array,n=async a=>{for(;i<e.length;){const o=e[i++];t(o)&&(r.push(o),a.madeProgress()),a.done&&await this._reschedule((e=>n(e)),s)}};return this._reschedule((e=>n(e)),s).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,n=new Map,a=this.featureAdapter.getAttribute;for(const s of e.items){const e=a(s,t),i=a(s,r),o=n.get(e);(!o||i>a(o,r))&&n.set(e,s)}e.items=Array.from(n.values())}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return(0,K.hN)(e)&&("esriSpatialRelEnvelopeIntersects"===s||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===s||"esriSpatialRelContains"===s||"esriSpatialRelWithin"===s))}async _project(e,t){if(!t||(0,m.fS)(this.spatialReference,t))return e;const s=this.featureAdapter,i=await(0,V.oj)(e.items.map((e=>(0,q.Op)(this.geometryType,this.hasZ,this.hasM,s.getGeometry(e)))),this.spatialReference,t);return e.items=i.map(((t,i)=>s.cloneWithGeometry(e.items[i],(0,g.GH)(t,this.hasZ,this.hasM)))),e}_getQueryBBoxes(e){if((0,K.hN)(e)){if((0,f.YX)(e))return[(0,h.al)(e.xmin,e.ymin,e.xmax,e.ymax)];if((0,f.oU)(e))return e.rings.map((e=>(0,h.al)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[(0,d.$P)((0,h.Ue)(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const s=Array.from(t.values());return t.clear(),s}async _checkStatisticsSupport(e,t){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.Z(ke,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(t,e),(0,K.P0)(e,this.geometryType,this.spatialReference),(0,V._W)(this.spatialReference,e.outSR)]).then((()=>e))}async _checkStatisticsParamsSupport(e,t){let s=[];if(e.valueExpression){const{arcadeUtils:t}=await(0,Z.LC)();s=t.extractFieldNames(e.valueExpression)}if(e.field&&s.push(e.field),e.field2&&s.push(e.field2),e.field3&&s.push(e.field3),e.normalizationField&&s.push(e.normalizationField),!s.length&&!e.valueExpression)throw new r.Z(ke,"field or valueExpression is required",{params:e});P(this.fieldsIndex,s,{errorMessage:"Cannot calculate statistics for missing fields",query:t}),O(this.fieldsIndex,s,{expressionName:"statistics",query:t})}async _checkQuerySupport(e){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.Z(ke,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([(0,K.P0)(e,this.geometryType,this.spatialReference),(0,V._W)(this.spatialReference,e.outSR)]).then((()=>e))}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:s,returnDistinctValues:i,outStatistics:n}=e,a=n?n.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(s&&s.length>0){const t=" asc",i=" desc",r=s.map((e=>{const s=e.toLowerCase();return s.includes(t)?s.split(t)[0]:s.includes(i)?s.split(i)[0]:e})).filter((e=>!a.includes(e)));P(this.fieldsIndex,r,{expressionName:"orderByFields",query:e})}if(t&&t.length>0)P(this.fieldsIndex,t,{expressionName:"outFields",query:e});else if(i)throw new r.Z(ke,"outFields should be specified for returnDistinctValues",{query:e});!function(e,t,s){if(!t)return!0;const i="where clause",r=v(t,e,{validateStandardized:!0,expressionName:i});P(e,r,{expressionName:i,query:s}),O(e,r,{expressionName:i,query:s})}(this.fieldsIndex,e.where,e)}_checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:s,having:i}=e,n=s&&s.length,a=t&&t.length;if(i){if(!n||!a)throw new r.Z(ke,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});N(this.fieldsIndex,i,t,e)}if(a){if(!function(e){return null!=e&&e.every((e=>"exceedslimit"!==e.statisticType))}(t))return;const i=t.map((e=>e.onStatisticField)).filter(Boolean);P(this.fieldsIndex,i,{expressionName:"onStatisticFields",query:e}),n&&P(this.fieldsIndex,s,{expressionName:"groupByFieldsForStatistics",query:e});const a=new Set([...T.jsonValues,...F.jsonValues]),o=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...T.apiValues,...F.apiValues]);for(const s of t){const{onStatisticField:t,statisticType:i}=s;if("percentile_disc"!==i&&"percentile_cont"!==i||!("statisticParameters"in s)){if("count"!==i&&"min"!==i&&"max"!==i&&t&&G(t,this.fieldsIndex,a))throw new r.Z(ke,`outStatistics with '${i}' statistic type, only supports ${o} field types`,{definition:s,query:e})}else{const{statisticParameters:t}=s;if(!t)throw new r.Z(ke,"statisticParameters should be set for percentile type",{definition:s,query:e})}}}}async _getQueryEngineResultForStats(e,t,s){e=(0,n.d9)(e);try{e=await this._schedule((()=>(0,q.Up)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>this._checkStatisticsSupport(e,t)),s);const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this._reschedule((()=>this._executeObjectIdsQuery(r)),s),await this._reschedule((()=>this._executeTimeQuery(r)),s),await this._reschedule((()=>this._executeAttributesQuery(r)),s),r}catch(t){if(t!==q.vF)throw t;return new W([],e,this)}}}},61159:(e,t,s)=>{s.d(t,{g:()=>i});const i={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},37427:(e,t,s)=>{s.d(t,{_W:()=>d,iV:()=>m,oj:()=>_});var i=s(67676),r=s(44547),n=s(37455),a=s(8744),o=s(40488);const l=[0,0];function u(e,t){if(!t)return null;if("x"in t){const s={x:0,y:0};return[s.x,s.y]=e(t.x,t.y,l),null!=t.z&&(s.z=t.z),null!=t.m&&(s.m=t.m),s}if("xmin"in t){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(t.xmin,t.ymin,l),[s.xmax,s.ymax]=e(t.xmax,t.ymax,l),t.hasZ&&(s.zmin=t.zmin,s.zmax=t.zmax,s.hasZ=!0),t.hasM&&(s.mmin=t.mmin,s.mmax=t.mmax,s.hasM=!0),s}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:h(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const s=[];for(const i of e)s.push(h(i,t));return s}function h(e,t){const s=[];for(const i of e){const e=t(i[0],i[1],[0,0]);s.push(e),i.length>2&&e.push(i[2]),i.length>3&&e.push(i[3])}return s}async function d(e,t){if(!e||!t)return;const s=Array.isArray(e)?e.map((e=>null!=e.geometry?e.geometry.spatialReference:null)).filter(i.pC):[e];await(0,r.iQ)(s.map((e=>({source:e,dest:t}))))}const f=u.bind(null,o.hG),p=u.bind(null,o.R6);function m(e,t,s,i){if(!e)return e;if(s||(s=t,t=e.spatialReference),!(0,a.JY)(t)||!(0,a.JY)(s)||(0,a.fS)(t,s))return e;if((0,o.Q8)(t,s)){const t=(0,a.sS)(s)?f(e):p(e);return t.spatialReference=s,t}return(0,r.oj)(n.N,[e],t,s,null,i)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,s){if(!e||!e.length||!t||!s||(0,a.fS)(t,s))return e;const i={geometries:e,inSpatialReference:t,outSpatialReference:s,resolve:null};return this._jobs.push(i),new Promise((e=>{i.resolve=e,null===this._timer&&(this._timer=setTimeout(this._process,10))}))}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:s,outSpatialReference:i,resolve:l}=e;(0,o.Q8)(s,i)?(0,a.sS)(i)?l(t.map(f)):l(t.map(p)):l((0,r.oj)(n.N,t,s,i,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function _(e,t,s){return g.push(e,t,s)}},10402:(e,t,s)=>{s.d(t,{hN:()=>x,P0:()=>S,cW:()=>I});var i=s(20102),r=s(54102),n=s(87416),a=s(33955),o=s(8744);function l(e,t){return e?t?4:3:t?3:2}function u(e,t,s,i,r,n){const a=l(r,n),{coords:o,lengths:u}=i;if(!u)return!1;for(let i=0,r=0;i<u.length;i++,r+=a)if(!c(e,t,s,o[r],o[r+1]))return!1;return!0}function c(e,t,s,i,r){if(!e)return!1;const n=l(t,s),{coords:a,lengths:o}=e;let u=!1,c=0;for(const e of o)u=h(u,a,n,c,e,i,r),c+=e*n;return u}function h(e,t,s,i,r,n,a){let o=e,l=i;for(let e=i,u=i+r*s;e<u;e+=s){l=e+s,l===u&&(l=i);const r=t[e],c=t[e+1],h=t[l],d=t[l+1];(c<a&&d>=a||d<a&&c>=a)&&r+(a-c)/(d-c)*(h-r)<n&&(o=!o)}return o}var d=s(98732),f=s(5428),p=s(37427),m=s(11490);const g="feature-store:unsupported-query",_={esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null},y={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}};function I(e,t,i,o,l){if((0,a.oU)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,d.Uy)(new f.Z,t,!1,!1);return Promise.resolve((t=>function(e,t,s,i){return c(e,!1,!1,i.coords[0],i.coords[1])}(e,0,0,t)))}if((0,a.oU)(t)&&"esriGeometryMultipoint"===i){const s=(0,d.Uy)(new f.Z,t,!1,!1);if("esriSpatialRelContains"===e)return Promise.resolve((e=>u(s,!1,!1,e,o,l)))}if((0,a.YX)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return Promise.resolve((e=>(0,r.aV)(t,(0,m.Op)(i,o,l,e))));if((0,a.YX)(t)&&"esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return Promise.resolve((e=>(0,r.lQ)(t,(0,m.Op)(i,o,l,e))));if((0,a.YX)(t)&&"esriSpatialRelIntersects"===e){const e="mesh"===(h=i)?n.h_:(0,n.IY)(h);return Promise.resolve((s=>e(t,(0,m.Op)(i,o,l,s))))}var h;return Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)).then((s=>{const r=s[_[e]].bind(null,t.spatialReference,t);return e=>r((0,m.Op)(i,o,l,e))}))}async function S(e,t,s){const{spatialRel:r,geometry:n}=e;if(n){if(!function(e){return null!=e&&!0===y.spatialRelationship[e]}(r))throw new i.Z(g,"Unsupported query spatial relationship",{query:e});if((0,o.JY)(n.spatialReference)&&(0,o.JY)(s)){if(!function(e){return null!=e&&!0===y.queryGeometry[(0,a.Ji)(e)]}(n))throw new i.Z(g,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===y.layerGeometry[e]}(t))throw new i.Z(g,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,p._W)(e.geometry&&e.geometry.spatialReference,e.outSR)}}}function x(e){if((0,a.YX)(e))return!0;if((0,a.oU)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},17590:(e,t,s)=>{async function i(e,t){if(!e)return null;const s=t.featureAdapter,{startTimeField:i,endTimeField:r}=e;let n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if(i&&r)await t.forEach((e=>{const t=s.getAttribute(e,i),o=s.getAttribute(e,r);null==t||isNaN(t)||(n=Math.min(n,t)),null==o||isNaN(o)||(a=Math.max(a,o))}));else{const e=i||r;await t.forEach((t=>{const i=s.getAttribute(t,e);null==i||isNaN(i)||(n=Math.min(n,i),a=Math.max(a,i))}))}return{start:n,end:a}}function r(e,t,s){if(!t||!e)return null;const{startTimeField:i,endTimeField:r}=e;if(!i&&!r)return null;const{start:n,end:a}=t;return null===n&&null===a?null:void 0===n&&void 0===a?()=>!1:i&&r?function(e,t,s,i,r){return null!=i&&null!=r?n=>{const a=e.getAttribute(n,t),o=e.getAttribute(n,s);return(null==a||a<=r)&&(null==o||o>=i)}:null!=i?t=>{const r=e.getAttribute(t,s);return null==r||r>=i}:null!=r?s=>{const i=e.getAttribute(s,t);return null==i||i<=r}:void 0}(s,i,r,n,a):function(e,t,s,i){return null!=s&&null!=i&&s===i?i=>e.getAttribute(i,t)===s:null!=s&&null!=i?r=>{const n=e.getAttribute(r,t);return n>=s&&n<=i}:null!=s?i=>e.getAttribute(i,t)>=s:null!=i?s=>e.getAttribute(s,t)<=i:void 0}(s,i||r,n,a)}s.d(t,{R:()=>i,y:()=>r})},11490:(e,t,s)=>{s.d(t,{EG:()=>I,Op:()=>S,S2:()=>T,Up:()=>x,j6:()=>E,vF:()=>p});var i=s(35454),r=s(67900),n=s(44547),a=s(49600),o=s(33955),l=s(16306),u=s(8744),c=s(98732),h=s(5428),d=s(37427);const f=new i.X({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),p=Object.freeze({}),m=new h.Z,g=new h.Z,_=new h.Z,y={esriGeometryPoint:c.fQ,esriGeometryPolyline:c.J6,esriGeometryPolygon:c.eG,esriGeometryMultipoint:c.Iv};function I(e,t,s,i=e.hasZ,r=e.hasM){if(null==t)return null;const n=e.hasZ&&i,a=e.hasM&&r;if(s){const o=(0,c.Nh)(_,t,e.hasZ,e.hasM,"esriGeometryPoint",s,i,r);return(0,c.fQ)(o,n,a)}return(0,c.fQ)(t,n,a)}function S(e,t,s,i,r,n,a=t,o=s){const l=t&&a,u=s&&o,h=null!=i?"coords"in i?i:i.geometry:null;if(null==h)return null;if(r){let i=(0,c.zj)(g,h,t,s,e,r,a,o);return n&&(i=(0,c.Nh)(_,i,l,u,e,n)),y[e]?.(i,l,u)??null}if(n){const i=(0,c.Nh)(_,h,t,s,e,n,a,o);return y[e]?.(i,l,u)??null}return(0,c.hY)(m,h,t,s,a,o),y[e]?.(m,l,u)??null}async function x(e,t,s){const{outFields:i,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(i)for(let e=0;e<i.length;e++)i[e]=i[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),E(e,t,s)}async function E(e,t,i){if(!e)return null;let{where:n}=e;if(e.where=n=n&&n.trim(),(!n||/^1 *= *1$/.test(n)||t&&t===n)&&(e.where=null),!e.geometry)return e;let c=await async function(e){const{distance:t,units:i}=e,n=e.geometry;if(null==t||"vertexAttributes"in n)return n;const a=n.spatialReference,o=i?f.fromJSON(i):(0,r.qE)(a),l=a&&((0,u.sT)(a)||(0,u.sS)(a))?n:await(0,d._W)(a,u.Zn).then((()=>(0,d.iV)(n,u.Zn)));return(await async function(){return(await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247))).geodesicBuffer}())(l.spatialReference,l,t,o)}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;c=(0,a.aO)(c),c.spatialReference=t}if(c){await(0,d._W)(c.spatialReference,i),c=function(e,t){const s=e.spatialReference;return R(e,t)&&(0,o.YX)(e)?{spatialReference:s,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(c,i);const t=(await(0,l.aX)((0,o.im)(c)))[0];if(null==t)throw p;const s="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,r=s&&R(c,i)?{densificationStep:8*s}:void 0,n=t.toJSON(),a=await(0,d.iV)(n,n.spatialReference,i,r);if(!a)throw p;a.spatialReference=i,e.geometry=a}return e}function R(e,t){if(!e)return!1;const s=e.spatialReference;return((0,o.YX)(e)||(0,o.oU)(e)||(0,o.l9)(e))&&!(0,u.fS)(s,t)&&!(0,n.Up)(s,t)}function T(e){return e&&F in e?JSON.parse(JSON.stringify(e,w)):e}const F="_geVersion",w=(e,t)=>e!==F?t:void 0}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5261],{88764:(e,t,s)=>{s.d(t,{q:()=>l});var i,r,n,a=s(5732),o={exports:{}};i=o,r=function(){function e(s,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,l=i-r+1,u=Math.log(o),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);e(s,i,Math.max(r,Math.floor(i-l*c/o+h)),Math.min(n,Math.floor(i+(o-l)*c/o+h)),a)}var d=s[i],f=r,p=n;for(t(s,r,i),a(s[n],d)>0&&t(s,r,n);f<p;){for(t(s,f,p),f++,p--;a(s[f],d)<0;)f++;for(;a(s[p],d)>0;)p--}0===a(s[r],d)?t(s,r,p):t(s,++p,n),p<=i&&(r=p+1),i<=p&&(n=p-1)}}function t(e,t,s){var i=e[t];e[t]=e[s],e[s]=i}function s(e,t){return e<t?-1:e>t?1:0}return function(t,i,r,n,a){e(t,i,r||0,n||t.length-1,a||s)}},void 0!==(n=r())&&(i.exports=n);const l=(0,a.g)(o.exports)},37455:(e,t,s)=>{s.d(t,{N:()=>i});const i={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,s){const i=new r(e.getPointX(t),e.getPointY(t),s),n=e.hasZ(t),a=e.hasM(t);return n&&(i.z=e.getPointZ(t)),a&&(i.m=e.getPointM(t)),i},exportPolygon:function(e,t,s){return new n(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,s){return new a(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,s){return new o(e.exportPoints(t),s,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,s){const i=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),s);if(i){const s=e.getZExtent(t);n.zmin=s.vmin,n.zmax=s.vmax}if(r){const s=e.getMExtent(t);n.mmin=s.vmin,n.mmax=s.vmax}return n}};class r{constructor(e,t,s){this.x=e,this.y=t,this.spatialReference=s,this.z=void 0,this.m=void 0}}class n{constructor(e,t,s,i){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class a{constructor(e,t,s,i){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class o{constructor(e,t,s,i){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class l{constructor(e,t,s,i,r){this.xmin=e,this.ymin=t,this.xmax=s,this.ymax=i,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},29730:(e,t,s)=>{function i(e,t){return e?t?4:3:t?3:2}function r(e,t,s,r,o){if(null==t||!t.lengths.length)return null;const l="upperLeft"===o?.originPosition?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const u=e.coords,c=[],h=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:d,coords:f}=t,p=i(s,r);let m=0;for(const e of d){const t=n(h,f,m,e,s,r,l);t&&c.push(t),m+=e*p}if(c.sort(((e,t)=>{let i=l*e[2]-l*t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),c.length){let e=6*c[0][2];u[0]=c[0][0]/e,u[1]=c[0][1]/e,s&&(e=6*c[0][4],u[2]=0!==e?c[0][3]/e:0),(u[0]<h[0]||u[0]>h[1]||u[1]<h[2]||u[1]>h[3]||s&&(u[2]<h[4]||u[2]>h[5]))&&(u.length=0)}if(!u.length){const e=t.lengths[0]?a(f,0,d[0],s,r):null;if(!e)return null;u[0]=e[0],u[1]=e[1],s&&e.length>2&&(u[2]=e[2])}return e}function n(e,t,s,r,n,a,o=1){const l=i(n,a);let u=s,c=s+l,h=0,d=0,f=0,p=0,m=0;for(let s=0,i=r-1;s<i;s++,u+=l,c+=l){const s=t[u],i=t[u+1],r=t[u+2],a=t[c],o=t[c+1],l=t[c+2];let g=s*o-a*i;p+=g,h+=(s+a)*g,d+=(i+o)*g,n&&(g=s*l-a*r,f+=(r+l)*g,m+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(p*o>0&&(p*=-1),m*o>0&&(m*=-1),!p)return null;const g=[h,d,.5*p];return n&&(g[3]=f,g[4]=.5*m),g}function a(e,t,s,r,n){const a=i(r,n);let h=t,d=t+a,f=0,p=0,m=0,g=0;for(let t=0,i=s-1;t<i;t++,h+=a,d+=a){const t=e[h],s=e[h+1],i=e[h+2],n=e[d],a=e[d+1],_=e[d+2],y=r?l(t,s,i,n,a,_):o(t,s,n,a);if(y)if(f+=y,r){const e=c(t,s,i,n,a,_);p+=y*e[0],m+=y*e[1],g+=y*e[2]}else{const e=u(t,s,n,a);p+=y*e[0],m+=y*e[1]}}return f>0?r?[p/f,m/f,g/f]:[p/f,m/f]:s>0?r?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function o(e,t,s,i){const r=s-e,n=i-t;return Math.sqrt(r*r+n*n)}function l(e,t,s,i,r,n){const a=i-e,o=r-t,l=n-s;return Math.sqrt(a*a+o*o+l*l)}function u(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function c(e,t,s,i,r,n){return[e+.5*(i-e),t+.5*(r-t),s+.5*(n-s)]}s.d(t,{Y:()=>r})},66202:(e,t,s)=>{s.d(t,{q:()=>De});var i=s(67676),r=s(20102),n=s(22974),a=s(70586),o=s(69801),l=s(95330),u=s(67900),c=s(60437),h=s(24470),d=s(20322),f=s(33955),p=s(16306),m=s(8744),g=s(98732),_=s(35454),y=s(13867),I=s(41534);const S=new class{constructor(e,t){this._cache=new y.z(e),this._invalidCache=new y.z(t)}get(e,t){const s=`${t.uid}:${e}`,i=this._cache.get(s);if(i)return i;if(void 0!==this._invalidCache.get(s))return null;try{const i=I.WhereClause.create(e,t);return this._cache.put(s,i),i}catch{return this._invalidCache.put(s,null),null}}}(50,500),x="feature-store:unsupported-query",E=" as ",R=new _.X({esriFieldTypeString:"string"}),T=new _.X({esriFieldTypeOID:"oid",esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long"}),F=new _.X({esriFieldTypeDate:"date"}),w=new _.X({esriFieldTypeGUID:"guid",esriFieldTypeGlobalId:"global-id"}),b=new Set([...T.jsonValues,...F.jsonValues,...R.jsonValues,...w.jsonValues]),A=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...T.apiValues,...F.apiValues,...R.apiValues,...w.apiValues]);function v(e,t,s={}){const i=C(e,t);if(!i)throw new r.Z(x,"invalid SQL expression",{expression:e});const n=s.expressionName||"expression";if(s.validateStandardized&&!i.isStandardized)throw new r.Z(x,`${n} is not standard`,{expression:e});if(s.validateAggregate&&!i.isAggregate)throw new r.Z(x,`${n} does not contain a valid aggregate function`,{expression:e});return i.fieldNames}function N(e,t,s,i){if(!t)return!0;const n="having",a=v(t,e,{validateAggregate:!0,expressionName:n});P(e,a,{expressionName:n,query:i}),O(e,a,{expressionName:n,query:i});const o=S.get(t,e),l=o?.getExpressions().every((t=>{const{aggregateType:i,field:r}=t,n=e.get(r)?.name;return s.some((t=>{const{onStatisticField:s,statisticType:r}=t,a=e.get(s)?.name;return a===n&&r.toLowerCase().trim()===i}))}));if(!l)throw new r.Z(x,"expressions in having should also exist in outStatistics",{having:t});return!0}function C(e,t){return e?S.get(e,t):null}function P(e,t,s={}){s.errorMessage||(s.errorMessage=s.expressionName?`${s.expressionName} contains invalid fields`:"Fields are invalid"),M(e,t,((e,t)=>t.has(e)),s)}function O(e,t,s={}){s.errorMessage||(s.errorMessage=s.expressionName?`${s.expressionName} only supports ${A} field types`:`Only ${A} field types are supported`),M(e,t,((e,t)=>!G(e,t)),s)}function M(e,t,s,i={}){const n=i.verifyExpression??!0,a=[];for(const r of t){const t=s(r,e);if("*"!==r&&!t)if(n){const t=k(r);try{M(e,v(t,e,{validateStandardized:!0}),s,i)}catch(e){const t=e?.details;if(t?.expression)throw e;t?.invalidFields?a.push(...t.invalidFields):a.push(r)}}else a.push(r)}if(a.length)throw new r.Z(x,i.errorMessage,{invalidFields:a,query:i.query})}function k(e){return e.split(E)[0]}function G(e,t,s=b){const i=t.get(e);return!!i&&!s.has(i.type)}var V=s(37427),D=s(61159),L=s(35308),Q=s(49600),U=s(82397),q=s(11490),z=s(24452),Z=s(59266);class j{constructor(e,t,s){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=s,this.featureAdapter=t;const i=e.outFields;if(i&&!i.includes("*")){this.outFields=i;let e=0;for(const t of i){const i=k(t),r=this.fieldsIndex.get(i),n=r?null:C(i,s),a=r?r.name:t.split(E)[1]||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,s){const i=s?s.name:t;let r=null;return this._fieldDataCache.has(i)?r=this._fieldDataCache.get(i)?.clause:s||(r=C(t,this.fieldsIndex),this._fieldDataCache.set(i,{alias:i,clause:r})),s?this.featureAdapter.getAttribute(e,i):r?.calculateValue(e,this.featureAdapter)}getDataValues(e,t){const s=t.normalizationType,i=t.normalizationTotal;return e.map((e=>{let r=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2&&(r=`${(0,z.wk)(r)}${t.fieldDelimiter}${(0,z.wk)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,z.wk)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)),s&&Number.isFinite(r)){const n="field"===s&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;r=(0,z.fk)(r,s,n,i)}return r}))}async getExpressionValues(e,t,s,i){const{arcadeUtils:r}=await(0,Z.LC)(),n=r.hasGeometryOperations(t);n&&await r.enableGeometryOperations();const a=r.createFunction(t),o=s&&r.getViewInfo(s),l={fields:this.fieldsIndex.fields};return e.map((e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:l,geometry:n?{...(0,q.Op)(i.geometryType,i.hasZ,i.hasM,this.featureAdapter.getGeometry(e)),spatialReference:s?.spatialReference}:null},u=r.createExecContext(t,o);return r.executeFunction(a,u)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:C(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:C(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t||!t.length)return this.featureAdapter.getAttributes(e);const s={};for(const i of t){const{alias:t,clause:r}=this._fieldDataCache.get(i);s[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return s}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,s=[];if(t)for(const i of t){const{alias:t}=this._fieldDataCache.get(i);s.push(e[t])}else for(const t in e)s.push(e[t]);const i=`${(t||["*"]).join(",")}=${s.join(",")}`;let r=this._returnDistinctMap.get(i)||0;return this._returnDistinctMap.set(i,++r),r>1?null:e}}function B(e,t,s){return{objectId:e,target:t,distance:s,type:"vertex"}}function Y(e,t,s,i,r,n=!1){return{objectId:e,target:t,distance:s,type:"edge",start:i,end:r,draped:n}}var H=s(35671);class W{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new j(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of i){const{statisticType:i}=r,l="exceedslimit"!==i?r.onStatisticField:void 0;if(!a.has(l)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,n);s.push(t)}a.set(l,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:i,items:r}=u[t],n=i.join(",");s&&!e.validateItems(r,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,m.JY)(this.query.outSR)&&!(0,m.fS)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,q.S2)({spatialReference:this.query.outSR,...(0,V.iV)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,q.S2)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=$(this.hasZ,this.hasM),{point:r,mode:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=this._getPointCreator(n,this.spatialReference,t),h=new J(null,0),d=new J(null,0),f={x:0,y:0,z:0};for(const t of this.items){const n=s.getGeometry(t);if(null==n)continue;const{coords:p,lengths:m}=n;if(h.coords=p,d.coords=p,e.returnEdge){let e=0;for(let n=0;n<m.length;n++){const u=m[n];for(let n=0;n<u;n++,e+=i){const p=h;if(p.coordsIndex=e,n!==u-1){const n=d;n.coordsIndex=e+i;const u=f;X(f,r,p,n);const h=(r.x-u.x)/a,m=(r.y-u.y)/o,g=h*h+m*m;g<=1&&l.candidates.push(Y(s.getObjectId(t),c(u),Math.sqrt(g),c(p),c(n)))}}}}if(e.returnVertex){const e=u?p.length-i:p.length;for(let n=0;n<e;n+=i){const e=h;e.coordsIndex=n;const i=(r.x-e.x)/a,u=(r.y-e.y)/o,d=i*i+u*u;d<=1&&l.candidates.push(B(s.getObjectId(t),c(e),Math.sqrt(d)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s){const i=null==s||(0,m.fS)(t,s)?e=>e:e=>(0,V.iV)(e,t,s),{hasZ:r}=this;return"3d"===e?r?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:0}):({x:e,y:t})=>i({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l}=e,u=this.fieldsIndex.isDateField(t),c=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:l}),h=(0,z.S5)({normalizationType:r,normalizationField:i,minValue:a,maxValue:o}),d=this.fieldsIndex.get(t),f={value:.5,fieldType:d?.type},p=(0,H.qN)(d)?(0,z.H0)({values:c,supportsNullCount:h,percentileParams:f}):(0,z.i5)({values:c,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:h,percentileParams:f});return(0,z.F_)(p,u)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:r,scale:n}=e,a=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n}),o=(0,z.eT)(a);return(0,z.Qm)(o,i,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:h}=e,d=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h}),f=(0,z.G2)(d,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,z.DL)(f,a)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:h}=e,d=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h});return(0,z.oF)(d,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t&&t.length)for(const i of t.reverse()){const t=i.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,z.Lq)(n?.type,a);e.sort(((e,t)=>{const i=s(e,r,n),a=s(t,r,n);return o(i,a)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:r,objectIdField:n,spatialReference:a}=this,{outFields:o,outSR:l,quantizationParameters:u,resultRecordCount:c,resultOffset:h,returnZ:d,returnM:f}=e,p=null!=c&&t.length>(h||0)+c,m=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:p,features:this._createFeatures(e,t),fields:m,geometryType:s,hasM:i&&f,hasZ:r&&d,objectIdFieldName:n,spatialReference:(0,q.S2)(l||a),transform:u&&(0,U.vY)(u)||null}}_createFeatures(e,t){const s=new j(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:r}=this,{orderByFields:n,quantizationParameters:a,returnGeometry:o,returnCentroid:l,maxAllowableOffset:u,resultOffset:c,resultRecordCount:h,returnZ:d=!1,returnM:f=!1}=e,p=r&&d,m=i&&f;let g=[],_=0;const y=[...t];if(this._sortFeatures(y,n,((e,t,i)=>s.getFieldValue(e,t,i))),o||l){const e=(0,U.vY)(a)??void 0;if(o&&!l)for(const t of y)g[_++]={attributes:s.getAttributes(t),geometry:(0,q.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),u,e,p,m)};else if(!o&&l)for(const t of y)g[_++]={attributes:s.getAttributes(t),centroid:(0,q.EG)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of y)g[_++]={attributes:s.getAttributes(t),centroid:(0,q.EG)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,q.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),u,e,p,m)}}else for(const e of y){const t=s.getAttributes(e);t&&(g[_++]={attributes:t})}const I=c||0;if(null!=h){const e=I+h;g=g.slice(I,Math.min(g.length,e))}return g}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(const t of e.outStatistics??[])if("exceedslimit"===t.statisticType){s=null!=t.maxPointCount?t.maxPointCount:Number.POSITIVE_INFINITY,i=null!=t.maxRecordCount?t.maxRecordCount:Number.POSITIVE_INFINITY,r=null!=t.maxVertexCount?t.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>i)t=!0;else{const e=$(this.hasZ,this.hasM),s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)}),0)/e>r}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,r=new Map,n=new Map,a=new Map,o=new j(e,this.featureAdapter,this.fieldsIndex),l=e.outStatistics,{groupByFieldsForStatistics:u,having:c,orderByFields:h}=e,d=u&&u.length,f=!!d,p=f?u[0]:null,m=f&&!this.fieldsIndex.get(p);for(const e of l??[]){const{outStatisticFieldName:l,statisticType:h}=e,g=e,_="exceedslimit"!==h?e.onStatisticField:void 0,y="percentile_disc"===h||"percentile_cont"===h,I="EnvelopeAggregate"===h||"CentroidAggregate"===h||"ConvexHullAggregate"===h,S=f&&1===d&&(_===p||m)&&"count"===h;if(f){if(!n.has(_)){const e=[];for(const t of u){const s=this._getAttributeValues(o,t,i);e.push(s)}n.set(_,this._calculateUniqueValues(e,!I&&o.returnDistinctValues))}const e=n.get(_);for(const t in e){const{count:s,data:r,items:n,itemPositions:h}=e[t],d=r.join(",");if(!c||o.validateItems(n,c)){const e=a.get(d)||{attributes:{}};if(I){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:s}=await this._getAggregateGeometry(g,n);e.aggregateGeometries[s]=t}else{let t=null;if(S)t=s;else{const e=this._getAttributeValues(o,_,i),s=h.map((t=>e[t]));t=y&&"statisticParameters"in g?this._getPercentileValue(g,s):this._getStatisticValue(g,s,null,o.returnDistinctValues)}e.attributes[l]=t}let t=0;u.forEach(((s,i)=>e.attributes[this.fieldsIndex.get(s)?s:"EXPR_"+ ++t]=r[i])),a.set(d,e)}}}else if(I){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(g,this.items);t.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(o,_,i);t.attributes[l]=y&&"statisticParameters"in g?this._getPercentileValue(g,e):this._getStatisticValue(g,e,r,o.returnDistinctValues)}s.push({name:l,alias:l,type:"esriFieldTypeDouble"})}const g=f?Array.from(a.values()):[t];return this._sortFeatures(g,h,((e,t)=>e.attributes[t])),{fields:s,features:g}}async _getAggregateGeometry(e,t){const{convexHull:i,union:r}=await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)),{statisticType:n,outStatisticFieldName:a}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map((e=>(0,q.Op)(u,c,h,o.getGeometry(e)))),f=i(l,d,!0)[0],p={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===n){const e=f?(0,Q._w)(f):(0,Q.aO)(r(l,d));p.aggregateGeometries={...e,spatialReference:l},p.outStatisticFieldName=a||"extent"}else if("CentroidAggregate"===n){const e=f?(0,L.tO)(f):(0,L.$G)((0,Q.aO)(r(l,d)));p.aggregateGeometries={x:e[0],y:e[1],spatialReference:l},p.outStatisticFieldName=a||"centroid"}else"ConvexHullAggregate"===n&&(p.aggregateGeometries=f,p.outStatisticFieldName=a||"convexHull");return p}_getStatisticValue(e,t,s,i){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=s?.has(r)?s.get(r):(0,H.qN)(this.fieldsIndex.get(r))?(0,z.H0)({values:t,returnDistinct:i}):(0,z.i5)({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:r}=e,{value:n,orderBy:a}=i,o=this.fieldsIndex.get(s);return(0,z.XL)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),r=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,r),r}_calculateUniqueValues(e,t){const s={},i=this.items,r=i.length;for(let n=0;n<r;n++){const r=i[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(t||s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e){const t=new j(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:s,scale:i}=e,r=s?{viewingMode:"map",scale:i,spatialReference:this.query.outSR||this.spatialReference}:null;return s?t.getExpressionValues(this.items,s,r,{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM}):t.getDataValues(this.items,{field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal})}}function X(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,a=r*r+n*n,o=(t.x-s.x)*r+(t.y-s.y)*n,l=Math.min(1,Math.max(0,o/a));e.x=s.x+r*l,e.y=s.y+n*l}function $(e,t){return e?t?4:3:t?3:2}class J{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}var K=s(10402),ee=s(17590),te=s(99514),se=s(61247),ie=(s(80442),s(92604)),re=s(54790),ne=s(44553),ae=s(17445),oe=s(58971),le=s(10661);class ue{constructor(e,t){this._observable=new le.s,this._value=e,this._equalityFunction=t}get value(){return(0,oe.it)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function ce(e,t=n.y7){return new ue(e,t)}var he=s(76882);class de{constructor(){this._tasks=new Array,this._running=ce(!1)}get length(){return this._tasks.length}get running(){return this._running.value}destroy(){this.cancelAll()}runTask(e){for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,s){return this._running.value=!0,new Promise(((i,r)=>this._tasks.push(new fe(i,r,e,t,s))))}unshift(e,t,s){return this._running.value=!0,new Promise(((i,r)=>this._tasks.unshift(new fe(i,r,e,t,s))))}_process(e){if(0===this._tasks.length)return!1;const t=this._tasks.shift();try{const s=(0,l.Hc)(t.signal);if(s&&!t.abortCallback)t.reject((0,l.zE)());else{const i=s?t.abortCallback?.((0,l.zE)()):t.callback(e);(0,l.y8)(i)?i.then(t.resolve,t.reject):t.resolve(i)}}catch(e){t.reject(e)}return this._running.value=this._tasks.length>0,!0}cancelAll(){const e=(0,l.zE)();for(const t of this._tasks)if(t.abortCallback){const s=t.abortCallback(e);t.resolve(s)}else t.reject(e);this._tasks.length=0,this._running.value=!1}}class fe{constructor(e,t,s,i=void 0,r=void 0){this.resolve=e,this.reject=t,this.callback=s,this.signal=i,this.abortCallback=r}}var pe=s(43697),me=s(92036),ge=s(5600),_e=(s(75215),s(52011));let ye=class extends me.Z{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,pe._)([(0,ge.Cb)()],ye.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,pe._)([(0,ge.Cb)()],ye.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),ye=(0,pe._)([(0,_e.j)("esri.views.support.DebugFlags")],ye);const Ie=new ye;var Se,xe,Ee,Re;!function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(Se||(Se={})),(Re=xe||(xe={}))[Re.YIELD=1]="YIELD",function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(Ee||(Ee={}));const Te=new Map([[Ee.RESOURCE_CONTROLLER_IMMEDIATE,0],[Ee.RESOURCE_CONTROLLER,4],[Ee.SLIDE,0],[Ee.STREAM_DATA_LOADER,0],[Ee.ELEVATION_QUERY,0],[Ee.TERRAIN_SURFACE,1],[Ee.SURFACE_GEOMETRY_UPDATES,1],[Ee.LOD_RENDERER,2],[Ee.GRAPHICS_CORE,2],[Ee.I3S_CONTROLLER,2],[Ee.POINT_CLOUD_LAYER,2],[Ee.FEATURE_TILE_FETCHER,2],[Ee.OVERLAY,4],[Ee.STAGE,4],[Ee.GRAPHICS_DECONFLICTOR,4],[Ee.FILTER_VISIBILITY,4],[Ee.SCALE_VISIBILITY,4],[Ee.FRUSTUM_VISIBILITY,4],[Ee.CLOUDS_GENERATOR,4],[Ee.POINT_OF_INTEREST_FREQUENT,6],[Ee.POINT_OF_INTEREST_INFREQUENT,30],[Ee.LABELER,8],[Ee.FEATURE_QUERY_ENGINE,8],[Ee.FEATURE_TILE_TREE,16],[Ee.FEATURE_TILE_TREE_ACTIVE,0],[Ee.ELEVATION_ALIGNMENT,12],[Ee.TEXT_TEXTURE_ATLAS,12],[Ee.TEXTURE_UNLOAD,12],[Ee.LINE_OF_SIGHT_TOOL,16],[Ee.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[Ee.SNAPPING,0],[Ee.SHADOW_ACCUMULATOR,30]]);function Fe(e){return Te.has(e)?Te.get(e):"number"==typeof e?e:1}const we=(0,he.HA)(6.5),be=(0,he.HA)(1),Ae=(0,he.HA)(30),ve=(0,he.HA)(1e3/30),Ne=(0,he.HA)(100);var Ce,Pe;!function(e){e.Scheduler=class{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some((e=>e.needsUpdate))}constructor(){this._updating=ce(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new re.Z("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new s,this._state=Se.INTERACTING,this._tasks=new ne.Z,this._runQueue=new ne.Z,this._load=0,this._idleStateCallbacks=new ne.Z,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=(0,ae.YP)((()=>Ie.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),ae.nn);for(const e of Object.keys(Ee))this.performanceInfo.tasks.set(Ee[e],new re.Z(Ee[e]));const e=this;this._test={FRAME_SAFETY_BUDGET:we,INTERACTING_BUDGET:ve,IDLE_BUDGET:Ne,get availableBudget(){return e._budget.budget},usedBudget:0,getBudget:()=>e._budget,setBudget:t=>e._budget=t,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),(0,a.hw)(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())})))}registerTask(e,s){const i=Fe(e),r=new t(this,e,s,i);return this._tasks.push(r),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new re.Z(e)),r}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===Se.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const i=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){i._idleUpdatesStartFired&&(s.idleEnd(),i._state===Se.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==Se.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return this._state}updateBudget(e){this._test.usedBudget=0,++this._frameNumber;let t=we,s=e.frameDuration,i=be;switch(this.state){case Se.IDLE:t=(0,he.HA)(0),s=(0,he.HA)(Math.max(Ne,e.frameDuration)),i=Ae;break;case Se.INTERACTING:s=(0,he.HA)(Math.max(ve,e.frameDuration));case Se.ANIMATING:}return s=(0,he.HA)(s-e.elapsedFrameTime-t),this.state!==Se.IDLE&&s<be&&!this._forceTask?(this._forceTask=!0,!1):(s=(0,he.HA)(Math.max(s,i)),this._budget.reset(s,this.state),this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case Se.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case Se.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset((0,he.HA)(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return Pe.SCHEDULED;let t=Pe.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=Pe.READY:t!==Pe.READY&&(t=Pe.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=.9*this._load+e*(1-.9)}_schedule(){for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{0===e.basePriority&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{s.needsUpdate&&0!==s.schedulePriority&&0!==s.basePriority&&s.blockFrame!==this._frameNumber&&(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority?(s.schedulePriority=0,this._runQueue.push(s)):--s.schedulePriority)})),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===xe.YIELD&&(s.blockFrame=this._frameNumber)}catch(e){ie.Z.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e)}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,Ee.I3S_CONTROLLER,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now()-t;if(s.runtime+=i,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+i),this._debug&&i>2*this._budget.budget&&console.log("Task",s.name,"used",i,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(Ee))this._frameTaskTimes.set(Ee[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).record(e))),this.performanceInfo.total.record(e)}get test(){return this._test}};class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,t,s,i){this._scheduler=e,this.name=t,this._basePriority=i,this.blockFrame=0,this.runtime=0,this._queue=new de,this._handles=new se.Z,this.schedulePriority=this._basePriority,this._task=ce(null!=s?s:this._queue),this._handles.add((0,ae.gx)((()=>this.task.running),(t=>e.taskRunningChanged(t))))}remove(){this.processQueue(Oe),this._scheduler.removeTask(this),this.schedule=Me.schedule,this.reschedule=Me.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){this.name=e;const t=Fe(e);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){this._queue.runTask(e)}}class s{constructor(){this._begin="undefined"!=typeof performance?performance.now():0,this._budget=0,this._state=Se.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}e.Budget=s}(Ce||(Ce={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(Pe||(Pe={}));const Oe=(()=>{const e=new Ce.Budget;return e.enabled=!1,e})(),Me=new class{remove(){}processQueue(){}schedule(e,t,s){try{if((0,l.Hc)(t)){const e=(0,l.zE)();return s?Promise.resolve(s(e)):Promise.reject(e)}return(0,l.gx)(e(Oe))}catch(e){return Promise.reject(e)}}reschedule(e,t,s){return this.schedule(e,t,s)}},ke="feature-store:unsupported-query",Ge=new o.WJ(2e6);let Ve=0;class De{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:D.g},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",(()=>this.clearCache())),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new o.Xq(Ve+++"$$",Ge)),this.fieldsIndex=new te.Z(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=(0,a.hw)(this._frameTask),this.clearCache(),(0,a.SC)(this._geometryQueryCache),this._changeHandle=(0,a.hw)(this._changeHandle),(0,a.SC)(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(t){if(t!==q.vF)throw t;return new W([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(e){if(e!==q.vF)throw e;return 0}}async executeQueryForExtent(e,t){const s=e.outSR;try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=i.size;return r?{count:r,extent:await this._getBounds(i.items,i.spatialReference,s||this.spatialReference)}:{count:0,extent:null}}catch(e){if(e===q.vF)return{count:0,extent:null};throw e}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),i=s.items,r=new Set;return await this._reschedule((()=>{for(const e of i)r.add(s.featureAdapter.getObjectId(e))}),t),r}catch(e){if(e===q.vF)return new Set;throw e}}async executeQueryForSnapping(e,t){const{point:s,distance:i,returnEdge:r,returnVertex:n}=e;if(!r&&!n)return{candidates:[]};const a=await this._reschedule((()=>this._checkQuerySupport(e.query)),t),o=!(0,m.fS)(s.spatialReference,this.spatialReference);o&&await(0,V._W)(s.spatialReference,this.spatialReference);const l="number"==typeof i?i:i.x,u="number"==typeof i?i:i.y,c={xmin:s.x-l,xmax:s.x+l,ymin:s.y-u,ymax:s.y+u,spatialReference:s.spatialReference},h=o?(0,V.iV)(c,this.spatialReference):c;if(!h)return{candidates:[]};const d=(await(0,p.aX)((0,f.im)(s),null,{signal:t}))[0],g=(await(0,p.aX)((0,f.im)(h),null,{signal:t}))[0];if(null==d||null==g)return{candidates:[]};const _=new W(await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(g.toJSON()))),t),a,this);await this._reschedule((()=>this._executeObjectIdsQuery(_)),t),await this._reschedule((()=>this._executeTimeQuery(_)),t),await this._reschedule((()=>this._executeAttributesQuery(_)),t);const y=d.toJSON(),I=o?(0,V.iV)(y,this.spatialReference):y,S=o?Math.max(h.xmax-h.xmin,h.ymax-h.ymin)/2:i;return _.createSnappingResponse({...e,point:I,distance:S},s.spatialReference)}async executeQueryForLatestObservations(e,t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new r.Z(ke,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const s=await this._executeQuery(e,{},t);return await this._reschedule((()=>this._filterLatest(s)),t),s.createQueryResponse()}catch(t){if(t!==q.vF)throw t;return new W([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const{field:i,field2:r,field3:n,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:i,field2:r,field3:n,valueExpression:a},s)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const[t,s]=await Promise.all(["getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getBounds(await this._getAllFeatures(),this.spatialReference,this.spatialReference),null!=this._timeExtentPromise?this._timeExtentPromise:this._timeExtentPromise=(0,ee.R)(this.timeInfo,this.featureStore)]);return(0,l.k_)(e),{fullExtent:t,timeExtent:s}}async _getBounds(e,t,s){const i=(0,c.t8)((0,c.Ue)(),c.Gv);await this.featureStore.forEachBounds(e,(e=>(0,c.TC)(i,e)));const r={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:(0,q.S2)(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(r.zmin=i[2],r.zmax=i[5]);const n=(0,V.iV)(r,t,s);if(n.spatialReference=(0,q.S2)(s),n.xmax-n.xmin==0){const e=(0,u.c9)(n.spatialReference);n.xmin-=e,n.xmax+=e}if(n.ymax-n.ymin==0){const e=(0,u.c9)(n.spatialReference);n.ymin-=e,n.ymax+=e}if(this.hasZ&&null!=n.zmin&&null!=n.zmax&&n.zmax-n.zmin==0){const e=(0,u.c9)(n.spatialReference);n.zmin-=e,n.zmax+=e}return n}async _schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(Oe)}async _reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(Oe)}async _getAllFeaturesQueryEngineResult(e){return new W(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach((t=>e.push(t)))})().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=(0,n.d9)(e),e=await this._schedule((()=>(0,q.Up)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>this._checkQuerySupport(e)),s),e={...e,...t};const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this._reschedule((()=>this._executeObjectIdsQuery(r)),s),await this._reschedule((()=>this._executeTimeQuery(r)),s),await this._reschedule((()=>this._executeAttributesQuery(r)),s),r}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,o=null==n||(0,m.fS)(n,a.spatialReference)?a:(0,V.iV)(a,n);if(!o)return null;const l=i||r,u=(0,m.JY)(s)&&!(0,m.fS)(this.spatialReference,s)&&l?async e=>this._project(e,s):e=>e,c=this.featureAdapter,h=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(o))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const s=new Set;for(const e of h)s.add(c.getObjectId(e));const i=await this._reschedule((()=>this._getAllFeatures()),t),r=await this._reschedule((async()=>{const r=await(0,K.cW)("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(i,(e=>!s.has(c.getObjectId(e))||r(c.getGeometry(e))),t);return new W(n,e,this)}),t);return u(r)}if(!h.length)return new W([],e,this);if(this._canExecuteSinglePass(o,e))return u(new W(h,e,this));const d=await(0,K.cW)("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),f=await this._runSpatialFilter(h,(e=>d(c.getGeometry(e))),t);return u(new W(f,e,this))}async _executeGeometryQuery(e,t,s){if(null!=t&&0===t.items.length)return t;e=null!=t?t.query:e;const{geometry:r,outSR:n,spatialRel:a,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!r||null==u||(0,m.fS)(u,r.spatialReference)?r:(0,V.iV)(r,u),h=o||l,d=(0,m.JY)(n)&&!(0,m.fS)(this.spatialReference,n),f=this._geometryQueryCache&&null==t?d&&h?JSON.stringify({originalFilterGeometry:r,spatialRelationship:a,outSpatialReference:n}):JSON.stringify({originalFilterGeometry:r,spatialRelationship:a}):null,p=f?this._geometryQueryCache.get(f):null;if(null!=p)return new W(p,e,this);const g=async e=>(d&&h&&await this._project(e,n),f&&this._geometryQueryCache.put(f,e.items,e.items.length+1),e);if(!c)return g(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const _=this.featureAdapter;let y=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(r))),s);if("esriSpatialRelDisjoint"===a){if(!y.length)return g(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of y)i.add(_.getObjectId(e));const r=null!=t?t.items:await this._reschedule((()=>this._getAllFeatures()),s),n=await this._reschedule((async()=>{const t=await(0,K.cW)(a,c,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(r,(e=>!i.has(_.getObjectId(e))||t(_.getGeometry(e))),s);return new W(n,e,this)}),s);return g(n)}if(null!=t){const e=new i.SO;y=y.filter((s=>(0,i.cq)(t.items,s,t.items.length,e)>=0))}if(!y.length){const t=new W([],e,this);return f&&this._geometryQueryCache.put(f,t.items,1),t}if(this._canExecuteSinglePass(c,e))return g(new W(y,e,this));const I=await(0,K.cW)(a,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(y,(e=>I(_.getGeometry(e))),s);return g(new W(S,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds||!e.query.aggregateIds.length||null==this.aggregateAdapter)return;const t=new Set;for(const s of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(s).forEach((e=>t.add(e)));const s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds||!e.query.objectIds.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,ee.y)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=C(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let i=0;const r=new Array,n=async a=>{for(;i<e.length;){const o=e[i++];t(o)&&(r.push(o),a.madeProgress()),a.done&&await this._reschedule((e=>n(e)),s)}};return this._reschedule((e=>n(e)),s).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,n=new Map,a=this.featureAdapter.getAttribute;for(const s of e.items){const e=a(s,t),i=a(s,r),o=n.get(e);(!o||i>a(o,r))&&n.set(e,s)}e.items=Array.from(n.values())}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return(0,K.hN)(e)&&("esriSpatialRelEnvelopeIntersects"===s||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===s||"esriSpatialRelContains"===s||"esriSpatialRelWithin"===s))}async _project(e,t){if(!t||(0,m.fS)(this.spatialReference,t))return e;const s=this.featureAdapter,i=await(0,V.oj)(e.items.map((e=>(0,q.Op)(this.geometryType,this.hasZ,this.hasM,s.getGeometry(e)))),this.spatialReference,t);return e.items=i.map(((t,i)=>s.cloneWithGeometry(e.items[i],(0,g.GH)(t,this.hasZ,this.hasM)))),e}_getQueryBBoxes(e){if((0,K.hN)(e)){if((0,f.YX)(e))return[(0,h.al)(e.xmin,e.ymin,e.xmax,e.ymax)];if((0,f.oU)(e))return e.rings.map((e=>(0,h.al)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[(0,d.$P)((0,h.Ue)(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const s=Array.from(t.values());return t.clear(),s}async _checkStatisticsSupport(e,t){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.Z(ke,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(t,e),(0,K.P0)(e,this.geometryType,this.spatialReference),(0,V._W)(this.spatialReference,e.outSR)]).then((()=>e))}async _checkStatisticsParamsSupport(e,t){let s=[];if(e.valueExpression){const{arcadeUtils:t}=await(0,Z.LC)();s=t.extractFieldNames(e.valueExpression)}if(e.field&&s.push(e.field),e.field2&&s.push(e.field2),e.field3&&s.push(e.field3),e.normalizationField&&s.push(e.normalizationField),!s.length&&!e.valueExpression)throw new r.Z(ke,"field or valueExpression is required",{params:e});P(this.fieldsIndex,s,{errorMessage:"Cannot calculate statistics for missing fields",query:t}),O(this.fieldsIndex,s,{expressionName:"statistics",query:t})}async _checkQuerySupport(e){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.Z(ke,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([(0,K.P0)(e,this.geometryType,this.spatialReference),(0,V._W)(this.spatialReference,e.outSR)]).then((()=>e))}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:s,returnDistinctValues:i,outStatistics:n}=e,a=n?n.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(s&&s.length>0){const t=" asc",i=" desc",r=s.map((e=>{const s=e.toLowerCase();return s.includes(t)?s.split(t)[0]:s.includes(i)?s.split(i)[0]:e})).filter((e=>!a.includes(e)));P(this.fieldsIndex,r,{expressionName:"orderByFields",query:e})}if(t&&t.length>0)P(this.fieldsIndex,t,{expressionName:"outFields",query:e});else if(i)throw new r.Z(ke,"outFields should be specified for returnDistinctValues",{query:e});!function(e,t,s){if(!t)return!0;const i="where clause",r=v(t,e,{validateStandardized:!0,expressionName:i});P(e,r,{expressionName:i,query:s}),O(e,r,{expressionName:i,query:s})}(this.fieldsIndex,e.where,e)}_checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:s,having:i}=e,n=s&&s.length,a=t&&t.length;if(i){if(!n||!a)throw new r.Z(ke,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});N(this.fieldsIndex,i,t,e)}if(a){if(!function(e){return null!=e&&e.every((e=>"exceedslimit"!==e.statisticType))}(t))return;const i=t.map((e=>e.onStatisticField)).filter(Boolean);P(this.fieldsIndex,i,{expressionName:"onStatisticFields",query:e}),n&&P(this.fieldsIndex,s,{expressionName:"groupByFieldsForStatistics",query:e});const a=new Set([...T.jsonValues,...F.jsonValues]),o=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...T.apiValues,...F.apiValues]);for(const s of t){const{onStatisticField:t,statisticType:i}=s;if("percentile_disc"!==i&&"percentile_cont"!==i||!("statisticParameters"in s)){if("count"!==i&&"min"!==i&&"max"!==i&&t&&G(t,this.fieldsIndex,a))throw new r.Z(ke,`outStatistics with '${i}' statistic type, only supports ${o} field types`,{definition:s,query:e})}else{const{statisticParameters:t}=s;if(!t)throw new r.Z(ke,"statisticParameters should be set for percentile type",{definition:s,query:e})}}}}async _getQueryEngineResultForStats(e,t,s){e=(0,n.d9)(e);try{e=await this._schedule((()=>(0,q.Up)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>this._checkStatisticsSupport(e,t)),s);const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this._reschedule((()=>this._executeObjectIdsQuery(r)),s),await this._reschedule((()=>this._executeTimeQuery(r)),s),await this._reschedule((()=>this._executeAttributesQuery(r)),s),r}catch(t){if(t!==q.vF)throw t;return new W([],e,this)}}}},61159:(e,t,s)=>{s.d(t,{g:()=>i});const i={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},37427:(e,t,s)=>{s.d(t,{_W:()=>d,iV:()=>m,oj:()=>_});var i=s(67676),r=s(44547),n=s(37455),a=s(8744),o=s(40488);const l=[0,0];function u(e,t){if(!t)return null;if("x"in t){const s={x:0,y:0};return[s.x,s.y]=e(t.x,t.y,l),null!=t.z&&(s.z=t.z),null!=t.m&&(s.m=t.m),s}if("xmin"in t){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(t.xmin,t.ymin,l),[s.xmax,s.ymax]=e(t.xmax,t.ymax,l),t.hasZ&&(s.zmin=t.zmin,s.zmax=t.zmax,s.hasZ=!0),t.hasM&&(s.mmin=t.mmin,s.mmax=t.mmax,s.hasM=!0),s}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:h(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const s=[];for(const i of e)s.push(h(i,t));return s}function h(e,t){const s=[];for(const i of e){const e=t(i[0],i[1],[0,0]);s.push(e),i.length>2&&e.push(i[2]),i.length>3&&e.push(i[3])}return s}async function d(e,t){if(!e||!t)return;const s=Array.isArray(e)?e.map((e=>null!=e.geometry?e.geometry.spatialReference:null)).filter(i.pC):[e];await(0,r.initializeProjection)(s.map((e=>({source:e,dest:t}))))}const f=u.bind(null,o.hG),p=u.bind(null,o.R6);function m(e,t,s,i){if(!e)return e;if(s||(s=t,t=e.spatialReference),!(0,a.JY)(t)||!(0,a.JY)(s)||(0,a.fS)(t,s))return e;if((0,o.Q8)(t,s)){const t=(0,a.sS)(s)?f(e):p(e);return t.spatialReference=s,t}return(0,r.oj)(n.N,[e],t,s,null,i)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,s){if(!e||!e.length||!t||!s||(0,a.fS)(t,s))return e;const i={geometries:e,inSpatialReference:t,outSpatialReference:s,resolve:null};return this._jobs.push(i),new Promise((e=>{i.resolve=e,null===this._timer&&(this._timer=setTimeout(this._process,10))}))}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:s,outSpatialReference:i,resolve:l}=e;(0,o.Q8)(s,i)?(0,a.sS)(i)?l(t.map(f)):l(t.map(p)):l((0,r.oj)(n.N,t,s,i,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function _(e,t,s){return g.push(e,t,s)}},10402:(e,t,s)=>{s.d(t,{hN:()=>x,P0:()=>S,cW:()=>I});var i=s(20102),r=s(54102),n=s(87416),a=s(33955),o=s(8744);function l(e,t){return e?t?4:3:t?3:2}function u(e,t,s,i,r,n){const a=l(r,n),{coords:o,lengths:u}=i;if(!u)return!1;for(let i=0,r=0;i<u.length;i++,r+=a)if(!c(e,t,s,o[r],o[r+1]))return!1;return!0}function c(e,t,s,i,r){if(!e)return!1;const n=l(t,s),{coords:a,lengths:o}=e;let u=!1,c=0;for(const e of o)u=h(u,a,n,c,e,i,r),c+=e*n;return u}function h(e,t,s,i,r,n,a){let o=e,l=i;for(let e=i,u=i+r*s;e<u;e+=s){l=e+s,l===u&&(l=i);const r=t[e],c=t[e+1],h=t[l],d=t[l+1];(c<a&&d>=a||d<a&&c>=a)&&r+(a-c)/(d-c)*(h-r)<n&&(o=!o)}return o}var d=s(98732),f=s(5428),p=s(37427),m=s(11490);const g="feature-store:unsupported-query",_={esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null},y={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}};function I(e,t,i,o,l){if((0,a.oU)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,d.Uy)(new f.Z,t,!1,!1);return Promise.resolve((t=>function(e,t,s,i){return c(e,!1,!1,i.coords[0],i.coords[1])}(e,0,0,t)))}if((0,a.oU)(t)&&"esriGeometryMultipoint"===i){const s=(0,d.Uy)(new f.Z,t,!1,!1);if("esriSpatialRelContains"===e)return Promise.resolve((e=>u(s,!1,!1,e,o,l)))}if((0,a.YX)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return Promise.resolve((e=>(0,r.aV)(t,(0,m.Op)(i,o,l,e))));if((0,a.YX)(t)&&"esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return Promise.resolve((e=>(0,r.lQ)(t,(0,m.Op)(i,o,l,e))));if((0,a.YX)(t)&&"esriSpatialRelIntersects"===e){const e="mesh"===(h=i)?n.h_:(0,n.IY)(h);return Promise.resolve((s=>e(t,(0,m.Op)(i,o,l,s))))}var h;return Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)).then((s=>{const r=s[_[e]].bind(null,t.spatialReference,t);return e=>r((0,m.Op)(i,o,l,e))}))}async function S(e,t,s){const{spatialRel:r,geometry:n}=e;if(n){if(!function(e){return null!=e&&!0===y.spatialRelationship[e]}(r))throw new i.Z(g,"Unsupported query spatial relationship",{query:e});if((0,o.JY)(n.spatialReference)&&(0,o.JY)(s)){if(!function(e){return null!=e&&!0===y.queryGeometry[(0,a.Ji)(e)]}(n))throw new i.Z(g,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===y.layerGeometry[e]}(t))throw new i.Z(g,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,p._W)(e.geometry&&e.geometry.spatialReference,e.outSR)}}}function x(e){if((0,a.YX)(e))return!0;if((0,a.oU)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},17590:(e,t,s)=>{async function i(e,t){if(!e)return null;const s=t.featureAdapter,{startTimeField:i,endTimeField:r}=e;let n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if(i&&r)await t.forEach((e=>{const t=s.getAttribute(e,i),o=s.getAttribute(e,r);null==t||isNaN(t)||(n=Math.min(n,t)),null==o||isNaN(o)||(a=Math.max(a,o))}));else{const e=i||r;await t.forEach((t=>{const i=s.getAttribute(t,e);null==i||isNaN(i)||(n=Math.min(n,i),a=Math.max(a,i))}))}return{start:n,end:a}}function r(e,t,s){if(!t||!e)return null;const{startTimeField:i,endTimeField:r}=e;if(!i&&!r)return null;const{start:n,end:a}=t;return null===n&&null===a?null:void 0===n&&void 0===a?()=>!1:i&&r?function(e,t,s,i,r){return null!=i&&null!=r?n=>{const a=e.getAttribute(n,t),o=e.getAttribute(n,s);return(null==a||a<=r)&&(null==o||o>=i)}:null!=i?t=>{const r=e.getAttribute(t,s);return null==r||r>=i}:null!=r?s=>{const i=e.getAttribute(s,t);return null==i||i<=r}:void 0}(s,i,r,n,a):function(e,t,s,i){return null!=s&&null!=i&&s===i?i=>e.getAttribute(i,t)===s:null!=s&&null!=i?r=>{const n=e.getAttribute(r,t);return n>=s&&n<=i}:null!=s?i=>e.getAttribute(i,t)>=s:null!=i?s=>e.getAttribute(s,t)<=i:void 0}(s,i||r,n,a)}s.d(t,{R:()=>i,y:()=>r})},11490:(e,t,s)=>{s.d(t,{EG:()=>I,Op:()=>S,S2:()=>T,Up:()=>x,j6:()=>E,vF:()=>p});var i=s(35454),r=s(67900),n=s(44547),a=s(49600),o=s(33955),l=s(16306),u=s(8744),c=s(98732),h=s(5428),d=s(37427);const f=new i.X({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),p=Object.freeze({}),m=new h.Z,g=new h.Z,_=new h.Z,y={esriGeometryPoint:c.fQ,esriGeometryPolyline:c.J6,esriGeometryPolygon:c.eG,esriGeometryMultipoint:c.Iv};function I(e,t,s,i=e.hasZ,r=e.hasM){if(null==t)return null;const n=e.hasZ&&i,a=e.hasM&&r;if(s){const o=(0,c.Nh)(_,t,e.hasZ,e.hasM,"esriGeometryPoint",s,i,r);return(0,c.fQ)(o,n,a)}return(0,c.fQ)(t,n,a)}function S(e,t,s,i,r,n,a=t,o=s){const l=t&&a,u=s&&o,h=null!=i?"coords"in i?i:i.geometry:null;if(null==h)return null;if(r){let i=(0,c.zj)(g,h,t,s,e,r,a,o);return n&&(i=(0,c.Nh)(_,i,l,u,e,n)),y[e]?.(i,l,u)??null}if(n){const i=(0,c.Nh)(_,h,t,s,e,n,a,o);return y[e]?.(i,l,u)??null}return(0,c.hY)(m,h,t,s,a,o),y[e]?.(m,l,u)??null}async function x(e,t,s){const{outFields:i,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(i)for(let e=0;e<i.length;e++)i[e]=i[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),E(e,t,s)}async function E(e,t,i){if(!e)return null;let{where:n}=e;if(e.where=n=n&&n.trim(),(!n||/^1 *= *1$/.test(n)||t&&t===n)&&(e.where=null),!e.geometry)return e;let c=await async function(e){const{distance:t,units:i}=e,n=e.geometry;if(null==t||"vertexAttributes"in n)return n;const a=n.spatialReference,o=i?f.fromJSON(i):(0,r.qE)(a),l=a&&((0,u.sT)(a)||(0,u.sS)(a))?n:await(0,d._W)(a,u.Zn).then((()=>(0,d.iV)(n,u.Zn)));return(await async function(){return(await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247))).geodesicBuffer}())(l.spatialReference,l,t,o)}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;c=(0,a.aO)(c),c.spatialReference=t}if(c){await(0,d._W)(c.spatialReference,i),c=function(e,t){const s=e.spatialReference;return R(e,t)&&(0,o.YX)(e)?{spatialReference:s,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(c,i);const t=(await(0,l.aX)((0,o.im)(c)))[0];if(null==t)throw p;const s="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,r=s&&R(c,i)?{densificationStep:8*s}:void 0,n=t.toJSON(),a=await(0,d.iV)(n,n.spatialReference,i,r);if(!a)throw p;a.spatialReference=i,e.geometry=a}return e}function R(e,t){if(!e)return!1;const s=e.spatialReference;return((0,o.YX)(e)||(0,o.oU)(e)||(0,o.l9)(e))&&!(0,u.fS)(s,t)&&!(0,n.Up)(s,t)}function T(e){return e&&F in e?JSON.parse(JSON.stringify(e,w)):e}const F="_geVersion",w=(e,t)=>e!==F?t:void 0}}]);