@arcgis/core 4.34.0-next.7 → 4.34.0-next.8

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 (355) hide show
  1. package/Map.js +1 -1
  2. package/applications/ExperienceBuilder/sketchUtils.d.ts +1 -0
  3. package/applications/ExperienceBuilder/sketchUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{feaf79b69d2e2a1f2aa2.js → 06877ea5b9df7de89aff.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{44db659fd4e711f8e22f.js → 076f830d6d0337dfce9d.js} +1 -1
  7. package/assets/esri/core/workers/chunks/09907c9ff597df9bc954.js +1 -0
  8. package/assets/esri/core/workers/chunks/0dbb350ce651bc236ec8.js +1 -0
  9. package/assets/esri/core/workers/chunks/0ed4ec00ef16aa58a33d.js +1 -0
  10. package/assets/esri/core/workers/chunks/{0624ae07d3af8d5f1ac8.js → 15b3eb60f86954783fab.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{b845586219f284a215b2.js → 1db026cc25338dbc208e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/21de4516bf5c9630edfd.js +1 -0
  13. package/assets/esri/core/workers/chunks/2254989ca3ff3960f2fe.js +1 -0
  14. package/assets/esri/core/workers/chunks/248a198f97871a8d6dd6.js +1 -0
  15. package/assets/esri/core/workers/chunks/2dbd18df5c691c8d0a61.js +1 -0
  16. package/assets/esri/core/workers/chunks/2e1ceff3f88a6c78dfa2.js +1 -0
  17. package/assets/esri/core/workers/chunks/{847e88e1d6da1e74cdc8.js → 2ecc1057d53e0b4a60b7.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3025e420e13e2bc8c0a1.js +1 -0
  19. package/assets/esri/core/workers/chunks/32537e2b014bc3d82f5c.js +346 -0
  20. package/assets/esri/core/workers/chunks/34f55bb89ddf26b10260.js +1 -0
  21. package/assets/esri/core/workers/chunks/355ab428a04ee9fcf888.js +1 -0
  22. package/assets/esri/core/workers/chunks/{28e31ac00dc95a1318e9.js → 3916879b9ca8c6979011.js} +1 -1
  23. package/assets/esri/core/workers/chunks/3a74654fa539f78ceb86.js +1 -0
  24. package/assets/esri/core/workers/chunks/3bec10a4f01757590c1c.js +1 -0
  25. package/assets/esri/core/workers/chunks/{a4c108e913d2dc0edc7b.js → 4088f4c25a09932a3eb1.js} +1 -1
  26. package/assets/esri/core/workers/chunks/427318722815bef1496b.js +1 -0
  27. package/assets/esri/core/workers/chunks/4c3bd6cc0badb78c7112.js +1 -0
  28. package/assets/esri/core/workers/chunks/500fb5f615f0c1db1b66.js +1 -0
  29. package/assets/esri/core/workers/chunks/5222523fff30d07f88de.js +1 -0
  30. package/assets/esri/core/workers/chunks/{412eef58cb0d24826375.js → 52c34d6ecd9d45a33e69.js} +1 -1
  31. package/assets/esri/core/workers/chunks/539541dec5fcf3b657aa.js +1 -0
  32. package/assets/esri/core/workers/chunks/53e8c061f36516c3c3e4.js +1 -0
  33. package/assets/esri/core/workers/chunks/{ca76950d81ab4ebb65e1.js → 58f403f956b7b3467344.js} +1 -1
  34. package/assets/esri/core/workers/chunks/5a01bd7a9ee24be7bac4.js +1 -0
  35. package/assets/esri/core/workers/chunks/5bfcb3d87380e7f85b08.js +1 -0
  36. package/assets/esri/core/workers/chunks/5d3246b8fc50f9d9e2c4.js +1 -0
  37. package/assets/esri/core/workers/chunks/{4dd0a5f327fa5fc7249d.js → 5ef1095842e21090f1f4.js} +1 -1
  38. package/assets/esri/core/workers/chunks/614bc3f05873b37af091.js +1 -0
  39. package/assets/esri/core/workers/chunks/6194636638b0439fccd8.js +1 -0
  40. package/assets/esri/core/workers/chunks/66e4cb2479bed1384ed5.js +1 -0
  41. package/assets/esri/core/workers/chunks/6b0ae9ccdd1acef5b5b4.js +1 -0
  42. package/assets/esri/core/workers/chunks/7112b092d98172b7db8b.js +1 -0
  43. package/assets/esri/core/workers/chunks/72ea996b03932c0f004f.js +1 -0
  44. package/assets/esri/core/workers/chunks/74d18c22fa1c178bd9df.js +1 -0
  45. package/assets/esri/core/workers/chunks/766e08d0c56b2b31b63b.js +1 -0
  46. package/assets/esri/core/workers/chunks/77dbb1d5d5e1a6ced932.js +1 -0
  47. package/assets/esri/core/workers/chunks/{bd7b54db7fd278b15500.js → 7a2189614f2dad49ffcd.js} +1 -1
  48. package/assets/esri/core/workers/chunks/7ae88c141a5d85e5bb88.js +1 -0
  49. package/assets/esri/core/workers/chunks/7aef81778155be373d3e.js +1 -0
  50. package/assets/esri/core/workers/chunks/7e1906d35a764f7f10b0.js +1 -0
  51. package/assets/esri/core/workers/chunks/80777a9db53bee2ad8a8.js +1 -0
  52. package/assets/esri/core/workers/chunks/8249b5de5c15461a6787.js +1 -0
  53. package/assets/esri/core/workers/chunks/8385c13ac10e595374cb.js +1 -0
  54. package/assets/esri/core/workers/chunks/83db8bd42f94f97c7cf1.js +1 -0
  55. package/assets/esri/core/workers/chunks/87623ebe32c6ae9cb223.js +1 -0
  56. package/assets/esri/core/workers/chunks/88b1214c284c2ec7d51b.js +1 -0
  57. package/assets/esri/core/workers/chunks/8b86c75426c55b29ebed.js +1 -0
  58. package/assets/esri/core/workers/chunks/8c4b26d86483646c70d2.js +1 -0
  59. package/assets/esri/core/workers/chunks/9cb242dfc3765b590f51.js +1 -0
  60. package/assets/esri/core/workers/chunks/9ddb0b07be31c3747238.js +1 -0
  61. package/assets/esri/core/workers/chunks/9f0f1472f36b42c507d1.js +1 -0
  62. package/assets/esri/core/workers/chunks/{f840e1655c4f6b6630be.js → 9f964467f7353039dd9c.js} +19 -19
  63. package/assets/esri/core/workers/chunks/9fe62638dc7dce466612.js +1 -0
  64. package/assets/esri/core/workers/chunks/a2e9141ff4efd13413a1.js +66 -0
  65. package/assets/esri/core/workers/chunks/adf6982e2d8102669cdf.js +1 -0
  66. package/assets/esri/core/workers/chunks/{d9b2263e0a9f9068ab62.js → b6c3a2d93a59df9a1418.js} +1 -1
  67. package/assets/esri/core/workers/chunks/b763292829aa4d3fab60.js +1 -0
  68. package/assets/esri/core/workers/chunks/ba015f4f72714820a12f.js +1 -0
  69. package/assets/esri/core/workers/chunks/bbbd58b02a3ee8fe595e.js +1 -0
  70. package/assets/esri/core/workers/chunks/c3d95f7f4370486eed2c.js +1 -0
  71. package/assets/esri/core/workers/chunks/c3df693d1bce8f189fa2.js +1 -0
  72. package/assets/esri/core/workers/chunks/{6993a59cbb78bc26f029.js → c45a314ace9725aa250e.js} +1 -1
  73. package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +1 -0
  74. package/assets/esri/core/workers/chunks/c9fbada1e84981784f6c.js +1 -0
  75. package/assets/esri/core/workers/chunks/cefcecbeef4f0a46f58c.js +1 -0
  76. package/assets/esri/core/workers/chunks/d2317b87aa2ac3ad97a6.js +1 -0
  77. package/assets/esri/core/workers/chunks/{0bbb38f59f37c51c72f0.js → d45a4e5806a80b69ceec.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{7a23dc625a812a562c21.js → d5f770302dc686e55ba7.js} +1 -1
  79. package/assets/esri/core/workers/chunks/dc14507cfc052faa5890.js +1 -0
  80. package/assets/esri/core/workers/chunks/e7a440476cd1eb4c6547.js +1 -0
  81. package/assets/esri/core/workers/chunks/ede9738ac20e7dd5ce63.js +1 -0
  82. package/assets/esri/core/workers/chunks/eec034d88db320880133.js +1 -0
  83. package/assets/esri/core/workers/chunks/f1e87720b425d7fb348a.js +1 -0
  84. package/assets/esri/core/workers/chunks/f2863c501d62dece5fdd.js +1 -0
  85. package/assets/esri/core/workers/chunks/f5741d09fd4e1809f580.js +1 -0
  86. package/assets/esri/core/workers/chunks/f9e1b73976027e17cd03.js +1 -0
  87. package/assets/esri/core/workers/chunks/fd207a40faf882d3b2a3.js +1 -0
  88. package/assets/esri/core/workers/chunks/fe3832107278244dc04d.js +1 -0
  89. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  90. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  91. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  92. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  93. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  94. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  95. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  96. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  97. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  98. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  99. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  100. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  101. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  102. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  103. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  104. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  105. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  106. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  107. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  108. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  109. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  110. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  111. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  112. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  113. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  114. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  115. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  116. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  117. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  118. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  119. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  120. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  121. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  122. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  123. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  124. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  125. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  126. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  127. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  128. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  129. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  130. package/chunks/aiServices.js +1 -1
  131. package/config.js +1 -1
  132. package/core/workers/Connection.js +1 -1
  133. package/core/workers/RemoteClient.js +1 -1
  134. package/core/workers/WorkerHandle.js +1 -1
  135. package/effects/FocusArea.d.ts +4 -0
  136. package/effects/FocusArea.js +1 -1
  137. package/effects/FocusAreaOutline.d.ts +4 -0
  138. package/effects/FocusAreaOutline.js +1 -1
  139. package/effects/FocusAreas.d.ts +4 -0
  140. package/effects/FocusAreas.js +1 -1
  141. package/geometry.js +1 -1
  142. package/interfaces.d.ts +307 -43
  143. package/kernel.js +1 -1
  144. package/layers/BuildingSceneLayer.js +1 -1
  145. package/layers/GroupLayer.js +1 -1
  146. package/layers/ImageryLayer.js +1 -1
  147. package/layers/ImageryTileLayer.js +1 -1
  148. package/layers/VideoLayer.js +1 -1
  149. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  150. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  151. package/layers/graphics/editingSupport.js +1 -1
  152. package/layers/mixins/ImageryTileMixin.js +1 -1
  153. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  154. package/layers/mixins/operationalLayers.js +1 -1
  155. package/layers/support/BuildingSummaryStatistics.js +1 -1
  156. package/layers/support/PromiseQueue.js +1 -1
  157. package/layers/support/TelemetryDisplay.js +1 -1
  158. package/layers/support/TitleCreator.js +1 -1
  159. package/layers/support/arcgisLayers.js +1 -1
  160. package/layers/support/featurePopupQueryUtils.js +5 -0
  161. package/layers/support/fieldUtils.js +1 -1
  162. package/layers/support/layersCreator.js +1 -1
  163. package/layers/support/multiLayerServiceUtils.js +5 -0
  164. package/networks/CircuitManager.js +1 -1
  165. package/networks/UnitIdentifierManager.js +1 -1
  166. package/networks/UtilityNetwork.js +1 -1
  167. package/networks/support/UNTraceConfiguration.js +1 -1
  168. package/networks/support/typeUtils.js +1 -1
  169. package/package.json +1 -1
  170. package/portal/PortalItem.js +1 -1
  171. package/portal/support/layersLoader.js +1 -1
  172. package/portal/support/portalLayers.js +1 -1
  173. package/rasterRenderers.js +1 -1
  174. package/renderers.js +1 -1
  175. package/rest/featureService/FeatureService.js +1 -1
  176. package/rest/networks/circuits/queryCircuits.js +1 -1
  177. package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
  178. package/rest/networks/support/CircuitTraceResult.js +5 -0
  179. package/rest/networks/support/TraceResult.js +1 -1
  180. package/rest/networks/unitIdentifiers/support/{QueryUnitIdentifiersParamters.js → QueryUnitIdentifiersParameters.js} +1 -1
  181. package/support/revision.js +1 -1
  182. package/symbols/cim/animationUtils.js +1 -1
  183. package/symbols/cim/cimAnalyzer.js +1 -1
  184. package/symbols/cim/defaultCIMValues.js +1 -1
  185. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  186. package/symbols/cim/utils.js +1 -1
  187. package/symbols/support/cimSymbolUtils.js +1 -1
  188. package/symbols/support/previewCIMSymbol.js +1 -1
  189. package/symbols.js +1 -1
  190. package/views/2d/engine/webgl/animations/infos.js +1 -1
  191. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  192. package/views/2d/engine/webgl/animations/utils.js +1 -1
  193. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  194. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
  195. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
  196. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +5 -0
  197. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +5 -0
  198. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +5 -0
  199. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +5 -0
  200. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  201. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  202. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +5 -0
  203. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechniques.js +5 -0
  205. package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +5 -0
  206. package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +5 -0
  207. package/views/2d/engine/webgl/shaderGraph/techniques/animated/enums.js +1 -1
  208. package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
  209. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  210. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  211. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  213. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  214. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  215. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  216. package/views/2d/layers/MediaLayerView2D.js +1 -1
  217. package/views/2d/layers/TileLayerView2D.js +1 -1
  218. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  219. package/views/2d/layers/features/schema/processor/symbols/utils.js +1 -1
  220. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  221. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  222. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  223. package/views/3d/layers/I3SMeshView3D.js +1 -1
  224. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  225. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  226. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  227. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  228. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  229. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  230. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  231. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  232. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  233. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  234. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  235. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  236. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  237. package/views/3d/terrain/OverlayRenderer.js +1 -1
  238. package/views/3d/terrain/TerrainRenderer.js +1 -1
  239. package/views/3d/terrain/TerrainSurface.js +1 -1
  240. package/views/3d/terrain/TileRenderer.js +1 -1
  241. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  242. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  243. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
  244. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  245. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  246. package/views/SelectionManager.js +1 -1
  247. package/views/VideoView.js +1 -1
  248. package/views/draw/support/GraphicMover.js +1 -1
  249. package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
  250. package/views/layers/FeatureLayerView.js +1 -1
  251. package/views/layers/ImageryLayerView.js +1 -1
  252. package/views/layers/ImageryTileLayerView.js +1 -1
  253. package/views/layers/PointCloudLayerView.js +1 -1
  254. package/views/support/TextureCompressionTracker.js +5 -0
  255. package/views/webgl/Texture.js +1 -1
  256. package/webdoc/support/writeUtils.js +1 -1
  257. package/webmap/utils.js +1 -1
  258. package/widgets/Attachments.js +1 -1
  259. package/widgets/BatchAttributeForm.js +1 -1
  260. package/widgets/Directions/DirectionsVisibleElements.js +1 -1
  261. package/widgets/Directions.js +1 -1
  262. package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
  263. package/widgets/Editor/EditorViewModel.js +1 -1
  264. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  265. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  266. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  267. package/widgets/Editor/workflowUtils.js +1 -1
  268. package/widgets/Feature/support/featureUtils.js +1 -1
  269. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  270. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  271. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  272. package/widgets/FeatureForm.js +1 -1
  273. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  274. package/widgets/Features/FeaturesViewModel.js +1 -1
  275. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  276. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  277. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  278. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  279. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  280. package/widgets/OrientedImageryViewer/videoViewerUtils.js +5 -0
  281. package/widgets/OrientedImageryViewer.js +1 -1
  282. package/widgets/Sketch.js +1 -1
  283. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  284. package/widgets/support/SelectionToolbar.js +1 -1
  285. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  286. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  287. package/assets/esri/core/workers/chunks/003ddb190a5cc56f7925.js +0 -1
  288. package/assets/esri/core/workers/chunks/03db109e9b695528c35d.js +0 -1
  289. package/assets/esri/core/workers/chunks/09da6b3085fc84cd69d5.js +0 -1
  290. package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +0 -1
  291. package/assets/esri/core/workers/chunks/0b70b2ee62904318a12c.js +0 -1
  292. package/assets/esri/core/workers/chunks/0c2dccec20c0994366fe.js +0 -1
  293. package/assets/esri/core/workers/chunks/0d78fc2c2bc1152f84db.js +0 -1
  294. package/assets/esri/core/workers/chunks/0fb5de3f8a4d69b2d514.js +0 -1
  295. package/assets/esri/core/workers/chunks/17e43a050fbf8dc87588.js +0 -1
  296. package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +0 -1
  297. package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +0 -1
  298. package/assets/esri/core/workers/chunks/22e53cb1c8c575fa4d46.js +0 -1
  299. package/assets/esri/core/workers/chunks/2cf82d3645c75d311e99.js +0 -1
  300. package/assets/esri/core/workers/chunks/2d90806faa4269828948.js +0 -1
  301. package/assets/esri/core/workers/chunks/377a7f0f7d304ff9fe5b.js +0 -1
  302. package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +0 -1
  303. package/assets/esri/core/workers/chunks/3d7eedb787c1e3b9fbfc.js +0 -1
  304. package/assets/esri/core/workers/chunks/3fe7be535affae31de7e.js +0 -1
  305. package/assets/esri/core/workers/chunks/417293f00b2c21cc3175.js +0 -1
  306. package/assets/esri/core/workers/chunks/41cbba9b286cf5558a9c.js +0 -1
  307. package/assets/esri/core/workers/chunks/42bb9bb6fe44a47d9b81.js +0 -1
  308. package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +0 -1
  309. package/assets/esri/core/workers/chunks/4ca0738ed38c15b68a77.js +0 -1
  310. package/assets/esri/core/workers/chunks/515e3295495d0958db7e.js +0 -1
  311. package/assets/esri/core/workers/chunks/51ba7345c31e6eb79060.js +0 -1
  312. package/assets/esri/core/workers/chunks/5200be8bce60fa831026.js +0 -1
  313. package/assets/esri/core/workers/chunks/52a57106a41b8c9483d7.js +0 -1
  314. package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +0 -1
  315. package/assets/esri/core/workers/chunks/5617532299f73d186968.js +0 -1
  316. package/assets/esri/core/workers/chunks/56d2a20c1b143697aa19.js +0 -1
  317. package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +0 -1
  318. package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +0 -1
  319. package/assets/esri/core/workers/chunks/5e1f7fe6bbc5754efee1.js +0 -1
  320. package/assets/esri/core/workers/chunks/61f9747c960d959b571b.js +0 -346
  321. package/assets/esri/core/workers/chunks/74182421ba425720dc7f.js +0 -1
  322. package/assets/esri/core/workers/chunks/74c0db9e3a62e9839b23.js +0 -1
  323. package/assets/esri/core/workers/chunks/7b12607633bbdc318936.js +0 -1
  324. package/assets/esri/core/workers/chunks/86023cc5ccbc7ac43479.js +0 -1
  325. package/assets/esri/core/workers/chunks/87eca6de502d18d8b7eb.js +0 -1
  326. package/assets/esri/core/workers/chunks/8aa8f9986b966ccb64e2.js +0 -1
  327. package/assets/esri/core/workers/chunks/8d14e957219364a81d5f.js +0 -66
  328. package/assets/esri/core/workers/chunks/937b653b10e8704b38bf.js +0 -1
  329. package/assets/esri/core/workers/chunks/98ef17d15517368d2383.js +0 -1
  330. package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +0 -1
  331. package/assets/esri/core/workers/chunks/a0c35521e677459f6fa3.js +0 -1
  332. package/assets/esri/core/workers/chunks/a32dcd5bc4680374d30c.js +0 -1
  333. package/assets/esri/core/workers/chunks/aaa6d45316a7d3466d0f.js +0 -1
  334. package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +0 -1
  335. package/assets/esri/core/workers/chunks/b2a6afa0cd537805b4b8.js +0 -1
  336. package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +0 -1
  337. package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +0 -1
  338. package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +0 -1
  339. package/assets/esri/core/workers/chunks/c77cfd8790877393353a.js +0 -1
  340. package/assets/esri/core/workers/chunks/c9ab067b07d1eab974d1.js +0 -1
  341. package/assets/esri/core/workers/chunks/d3c0d7799c92c6f0e7d3.js +0 -1
  342. package/assets/esri/core/workers/chunks/d52f5214a0330ed2e05e.js +0 -1
  343. package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +0 -1
  344. package/assets/esri/core/workers/chunks/df7ca2fe12e22ccfde17.js +0 -1
  345. package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +0 -1
  346. package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +0 -1
  347. package/assets/esri/core/workers/chunks/ee6240636d04d7d37b7b.js +0 -1
  348. package/assets/esri/core/workers/chunks/ef7955a2509be0f03ca2.js +0 -1
  349. package/assets/esri/core/workers/chunks/f1c6df5cf2ccb6ac47a1.js +0 -1
  350. package/assets/esri/core/workers/chunks/f3d97a4c4f433adbdab5.js +0 -1
  351. package/assets/esri/core/workers/chunks/fc0a3db3d6d26c763fb9.js +0 -1
  352. package/assets/esri/core/workers/chunks/fd4c020297badcb81947.js +0 -1
  353. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerTechnique.js +0 -5
  354. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedShader.js +0 -5
  355. package/views/support/TextureCompressionHandle.js +0 -5
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5973,6061],{563:(t,e,s)=>{s.d(e,{QueueProcessor:()=>l});var i=s(97768),r=s(74887),n=s(9775),o=s(32587),a=s(11932),h=s(44794);class c{constructor(t,e){this.item=t,this.controller=e,this.promise=null}}class l{constructor(t){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,h.v)(!1),this.concurrency=1,t.concurrency&&(this.concurrency=t.concurrency),this._queue=new n.A(t.peeker),this.process=t.process}destroy(){this.clear(),this._schedule=(0,i.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}abort(t){const e=this._controllers.get(t);e&&e.abort()}clear(){this._queue.clear();const t=[];this._controllers.forEach((e=>t.push(e))),this._controllers.clear(),t.forEach((t=>t.abort())),this._processingItems.clear(),this._cancelNext()}forEach(t){this._deferreds.forEach(((e,s)=>t(s)))}get(t){const e=this._deferreds.get(t);return e?e.promise:void 0}isOngoing(t){return this._processingItems.has(t)}has(t){return this._deferreds.has(t)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(t,e){const s=this.get(t);if(s)return s;const i=new AbortController;let n=null;e&&(n=(0,r.u7)(e,(()=>i.abort())));const o=()=>{a.remove(),null!=n&&n.remove(),this._removeItem(t),this._queue.remove(t),this._scheduleNext()},a=(0,r.NY)(i.signal,(()=>{const e=this._processingItems.get(t);e&&e.controller.abort(),o(),h.reject((0,r.NK)())})),h=(0,r.Tw)();return this._deferreds.set(t,h),this._controllers.set(t,i),h.promise.then(o,o),this._queue.push(t),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const t=this.last();return t?this.get(t):null}peek(){return this._queue.peek()}popLast(){const t=this._queue.popLast();return t&&(this._deferreds.get(t)?.reject((0,r.NK)()),this._removeItem(t)),t}reset(){const t=Array.from(this._processingItems.values());this._processingItems.clear();for(const e of t)this._queue.push(e.item),e.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const t=[];for(;this._queue.length;)t.push(this._queue.pop());return this.clear(),t}_removeItem(t){this._deferreds.delete(t),this._controllers.delete(t),this._processingItems.delete(t)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,a._)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(t,e){this._canProcessFulfillment(t)&&(this._scheduleNext(),this._deferreds.get(t.item).resolve(e))}_processError(t,e){this._canProcessFulfillment(t)&&(this._scheduleNext(),this._deferreds.get(t.item).reject(e))}_canProcessFulfillment(t){return!!this._deferreds.get(t.item)&&this._processingItems.get(t.item)===t}_process(t){if(null==t)return;let e;const s=new AbortController,i=new c(t,s);this._processingItems.set(t,i);try{e=this.process(t,s.signal)}catch(t){this._processError(i,t)}(0,r.$X)(e)?(i.promise=e,e.then((t=>this._processResult(i,t)),(t=>this._processError(i,t)))):this._processResult(i,e)}}},5503:(t,e,s)=>{s.d(e,{A:()=>E});var i,r=s(90237),n=s(98291),o=s(65529),a=s(36563),h=s(4718),c=s(93687);!function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE",t[t.MOVE=4]="MOVE"}(i||(i={}));var l,u=s(11932),d=s(56507),_=s(62788),p=s(10107),f=s(7695),g=s(40608),m=s(95488),y=s(12195);class x{constructor(t,e,s,i,r){this.target=t,this.added=e,this.removed=s,this.start=i,this.deleteCount=r}}const b=new c.A(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(t){this.defaultPrevented=!1,this.item=t}},void 0,(t=>{t.item=null,t.target=null,t.defaultPrevented=!1,t.cancellable=!1}));function w(t){t&&"object"==typeof t&&"destroy"in t&&"function"==typeof t.destroy&&t.destroy()}function v(t){return t?t instanceof F?t.toArray():t.length?Array.prototype.slice.apply(t):[]:[]}function I(t){if(t?.length)return t[0]}function S(t,e,s,i){const r=Math.min(t.length-s,e.length-i);let n=0;for(;n<r&&t[s+n]===e[i+n];)n++;return n}function P(t,e,s,i){e&&e.forEach(((e,r,n)=>{t.push(e),P(t,s.call(i,e,r,n),s,i)}))}const M=new Set,A=new Set,T=new Set,k=new Map;let C=0,F=class extends o.A.EventedAccessor{static{l=this}static{this.ofType=t=>{if(!t)return l;if(k.has(t))return k.get(t);let e=null;if("function"==typeof t)e=t.prototype.declaredClass;else if(t.base)e=t.base.prototype.declaredClass;else for(const s in t.typeMap){const i=t.typeMap[s].prototype.declaredClass;e?e+=` | ${i}`:e=i}let s=class extends l{};return(0,r._)([(0,f.u)({Type:t,ensureType:"function"==typeof t?(0,d.dp)(t):(0,d.aq)(t)})],s.prototype,"itemType",void 0),s=(0,r._)([(0,g.$)(`esri.core.Collection<${e}>`)],s),k.set(t,s),s}}static isCollection(t){return null!=t&&t instanceof l}constructor(t){super(t),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new m.I,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:C++})}normalizeCtorArgs(t){return t?Array.isArray(t)||t instanceof l?{items:t}:t:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),this._emitter.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get items(){return(0,_.gc)(this._observable),this._items}set items(t){this._emitBeforeChanges(i.ADD)||(this._splice(0,this.length,v(t)),this._emitAfterChanges(i.ADD))}hasEventListener(t){return!this.destroyed&&("change"===t?this._chgListeners.length>0:this._emitter.hasEventListener(t))}on(t,e){if(this.destroyed)return(0,a.hA)();if("change"===t){const t=this._chgListeners,s={removed:!1,callback:e};return t.push(s),this._notifications&&this._notifications.push({listeners:t.slice(),items:this._items.slice(),changes:[]}),(0,a.hA)((()=>{s.removed=!0,t.splice(t.indexOf(s),1)}))}return this._emitter.on(t,e)}once(t,e){const s="deref"in e?()=>e.deref():()=>e,i=this.on(t,(t=>{s()?.call(null,t),i.remove()}));return i}add(t,e){if((0,_.gc)(this._observable),this._emitBeforeChanges(i.ADD))return this;const s=this.getNextIndex(e??null);return this._splice(s,0,[t]),this._emitAfterChanges(i.ADD),this}addMany(t,e=this._items.length){if((0,_.gc)(this._observable),!t?.length)return this;if(this._emitBeforeChanges(i.ADD))return this;const s=this.getNextIndex(e);return this._splice(s,0,v(t)),this._emitAfterChanges(i.ADD),this}at(t){if((0,_.gc)(this._observable),(t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this._items[t]}removeAll(){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return[];const t=this._removeAllRaw();return this._emitAfterChanges(i.REMOVE),t}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,_.gc)(this._observable),this._createNewInstance({items:this._items.map(h.o8)})}concat(...t){(0,_.gc)(this._observable);const e=t.map(v);return this._createNewInstance({items:this._items.concat(...e)})}drain(t,e){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const s=this._splice(0,this.length),r=s.length;for(let i=0;i<r;i++)t.call(e,s[i],i,s);this._emitAfterChanges(i.REMOVE)}destroyAll(){this.drain(w)}destroyMany(t){const e=this.removeMany(t);return e.forEach(w),e}every(t,e){return(0,_.gc)(this._observable),this._items.every(t,e)}filter(t,e){(0,_.gc)(this._observable);const s=2===arguments.length?this._items.filter(t,e):this._items.filter(t);return this._createNewInstance({items:s})}find(t,e){return(0,_.gc)(this._observable),this._items.find(t,e)}findIndex(t,e){return(0,_.gc)(this._observable),this._items.findIndex(t,e)}flatten(t,e){(0,_.gc)(this._observable);const s=[];return P(s,this,t,e),new l(s)}forEach(t,e){return(0,_.gc)(this._observable),this._items.forEach(t,e)}getItemAt(t){return(0,_.gc)(this._observable),this._items[t]}getNextIndex(t){(0,_.gc)(this._observable);const e=this.length;return(t=t??e)<0?t=0:t>e&&(t=e),t}includes(t,e=0){return(0,_.gc)(this._observable),this._items.includes(t,e)}indexOf(t,e=0){return(0,_.gc)(this._observable),this._items.indexOf(t,e)}join(t=","){return(0,_.gc)(this._observable),this._items.join(t)}lastIndexOf(t,e=this.length-1){return(0,_.gc)(this._observable),this._items.lastIndexOf(t,e)}map(t,e){(0,_.gc)(this._observable);const s=this._items.map(t,e);return new l({items:s})}reorder(t,e=this.length-1){(0,_.gc)(this._observable);const s=this.indexOf(t);if(-1!==s){if(e<0?e=0:e>=this.length&&(e=this.length-1),s!==e){if(this._emitBeforeChanges(i.MOVE))return t;this._splice(s,1),this._splice(e,0,[t]),this._emitAfterChanges(i.MOVE)}return t}}pop(){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const t=I(this._splice(this.length-1,1));return this._emitAfterChanges(i.REMOVE),t}push(...t){return(0,_.gc)(this._observable),this._emitBeforeChanges(i.ADD)||(this._splice(this.length,0,t),this._emitAfterChanges(i.ADD)),this.length}reduce(t,e){(0,_.gc)(this._observable);const s=this._items;return 2===arguments.length?s.reduce(t,e):s.reduce(t)}reduceRight(t,e){(0,_.gc)(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(t,e):s.reduceRight(t)}remove(t){return(0,_.gc)(this._observable),this.removeAt(this.indexOf(t))}removeAt(t){if((0,_.gc)(this._observable),t<0||t>=this.length||this._emitBeforeChanges(i.REMOVE))return;const e=I(this._splice(t,1));return this._emitAfterChanges(i.REMOVE),e}removeMany(t){if((0,_.gc)(this._observable),!t?.length||this._emitBeforeChanges(i.REMOVE))return[];const e=t instanceof l?t.toArray():t,s=this._items,r=[],n=e.length;for(let t=0;t<n;t++){const i=e[t],n=s.indexOf(i);if(n>-1){const i=1+S(e,s,t+1,n+1),o=this._splice(n,i);o&&o.length>0&&r.push.apply(r,o),t+=i-1}}return this._emitAfterChanges(i.REMOVE),r}reverse(){if((0,_.gc)(this._observable),this._emitBeforeChanges(i.MOVE))return this;const t=this._splice(0,this.length);return t&&(t.reverse(),this._splice(0,0,t)),this._emitAfterChanges(i.MOVE),this}shift(){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const t=I(this._splice(0,1));return this._emitAfterChanges(i.REMOVE),t}slice(t=0,e=this.length){return(0,_.gc)(this._observable),this._createNewInstance({items:this._items.slice(t,e)})}some(t,e){return(0,_.gc)(this._observable),this._items.some(t,e)}sort(t){if((0,_.gc)(this._observable),!this.length||this._emitBeforeChanges(i.MOVE)||!this._requiresSort(t))return this;const e=this._splice(0,this.length);return arguments.length?e.sort(t):e.sort(),this._splice(0,0,e),this._emitAfterChanges(i.MOVE),this}_requiresSort(t=(t,e)=>t===e?0:t<e?-1:1){const e=this.length-1;for(let s=0;s<e;s++)if(t(this.items[s],this.items[s+1])>0)return!0;return!1}splice(t,e,...s){(0,_.gc)(this._observable),1===arguments.length&&(e=this.length),e??=0;const r=(e?i.REMOVE:0)|(s.length?i.ADD:0);if(this._emitBeforeChanges(r))return[];const n=this._splice(t,e,s)||[];return this._emitAfterChanges(r),n}toArray(){return(0,_.gc)(this._observable),this._items.slice()}toJSON(t){return(0,_.gc)(this._observable),this.toArray().map((e=>(0,y.W)(e)?e.toJSON(t):e))}toLocaleString(){return(0,_.gc)(this._observable),this._items.toLocaleString()}toString(){return(0,_.gc)(this._observable),this._items.toString()}unshift(...t){return(0,_.gc)(this._observable),!t.length||this._emitBeforeChanges(i.ADD)||(this._splice(0,0,t),this._emitAfterChanges(i.ADD)),this.length}_createNewInstance(t){return new this.constructor(t)}_splice(t,e,s){const i=this._items,r=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=(0,u._)((()=>this._dispatchChange()))),t<0&&(t+=this.length),e){if(o=i.splice(t,e),this.hasEventListener("before-remove")){const e=b.acquire();e.target=this,e.cancellable=!0;for(let s=0,r=o.length;s<r;s++)n=o[s],e.reset(n),this.emit("before-remove",e),e.defaultPrevented&&(o.splice(s,1),i.splice(t,0,n),t+=1,s-=1,r-=1);b.release(e)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const t=b.acquire();t.target=this,t.cancellable=!1;const e=o.length;for(let s=0;s<e;s++)t.reset(o[s]),this.emit("after-remove",t);b.release(t)}}if(s?.length){if(r){const t=[];for(const e of s){const s=r.ensureType(e);null==s&&null!=e||t.push(s)}s=t}const e=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),o=t===this.length;if(e||n){const r=b.acquire();r.target=this,r.cancellable=!0;const a=b.acquire();a.target=this,a.cancellable=!1;for(const h of s)e?(r.reset(h),this.emit("before-add",r),r.defaultPrevented||(o?i.push(h):i.splice(t++,0,h),this._set("length",i.length),n&&(a.reset(h),this.emit("after-add",a)))):(o?i.push(h):i.splice(t++,0,h),this._set("length",i.length),a.reset(h),this.emit("after-add",a));b.release(a),b.release(r)}else{if(o)for(const t of s)i.push(t);else i.splice(t,0,...s);this._set("length",i.length)}}if((s?.length||o?.length)&&this._notifyChangeEvent(s,o),this.hasEventListener("after-splice")){const i=new x(this,s,o,t,e);this.emit("after-splice",i)}return o}_emitBeforeChanges(t){let e=!1;if(this.hasEventListener("before-changes")){const s=b.acquire();s.target=this,s.cancellable=!0,s.type=t,this.emit("before-changes",s),e=s.defaultPrevented,b.release(s)}return e}_emitAfterChanges(t){if(this.hasEventListener("after-changes")){const e=b.acquire();e.target=this,e.cancellable=!1,e.type=t,this.emit("after-changes",e),b.release(e)}this._observable.notify()}_notifyChangeEvent(t,e){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:t,removed:e})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const t=this._notifications;this._notifications=null;for(const e of t){const t=e.changes;M.clear(),A.clear(),T.clear();for(const{added:e,removed:s}of t){if(e)if(0===T.size&&0===A.size)for(const t of e)M.add(t);else for(const t of e)A.has(t)?(T.add(t),A.delete(t)):T.has(t)||M.add(t);if(s)if(0===T.size&&0===M.size)for(const t of s)A.add(t);else for(const t of s)M.has(t)?M.delete(t):(T.delete(t),A.add(t))}const s=n.A.acquire();M.forEach((t=>{s.push(t)}));const i=n.A.acquire();A.forEach((t=>{i.push(t)}));const r=this._items,o=e.items,a=n.A.acquire();if(T.forEach((t=>{o.indexOf(t)!==r.indexOf(t)&&a.push(t)})),e.listeners&&(s.length||i.length||a.length)){const t={target:this,added:s,removed:i,moved:a},r=e.listeners.length;for(let s=0;s<r;s++){const i=e.listeners[s];i.removed||i.callback.call(this,t)}}n.A.release(s),n.A.release(i),n.A.release(a)}M.clear(),A.clear(),T.clear()}};(0,r._)([(0,p.MZ)()],F.prototype,"_updating",void 0),(0,r._)([(0,p.MZ)()],F.prototype,"length",void 0),(0,r._)([(0,p.MZ)()],F.prototype,"items",null),(0,r._)([(0,p.MZ)({readOnly:!0})],F.prototype,"updating",null),F=l=(0,r._)([(0,g.$)("esri.core.Collection")],F);const E=F},5808:(t,e,s)=>{s.d(e,{O:()=>i});const i={geodesic:0,loxodrome:1,"great-elliptic":2,"normal-section":3,"shape-preserving":4}},7695:(t,e,s)=>{function i(t){return(e,s)=>{e[s]=t}}s.d(e,{u:()=>i})},9775:(t,e,s)=>{s.d(e,{A:()=>n});var i=s(62788),r=s(95488);class n{constructor(t=t=>t.values().next().value){this._peeker=t,this._observable=new r.I,this._items=new Set}get length(){return(0,i.gc)(this._observable),this._items.size}clear(){0!==this.length&&(this._items.clear(),this._observable.notify())}last(){if(0===this.length)return;let t;for(t of this._items);return t}peek(){if(0!==this.length)return this._peeker(this._items)}push(t){this.contains(t)||(this._items.add(t),this._observable.notify())}contains(t){return(0,i.gc)(this._observable),this._items.has(t)}pop(){if(0===this.length)return;const t=this.peek();return this._items.delete(t),this._observable.notify(),t}popLast(){if(0===this.length)return;const t=this.last();return this._items.delete(t),this._observable.notify(),t}remove(t){this.contains(t)&&(this._items.delete(t),this._observable.notify())}filter(t){const e=this.length;return this._items.forEach((e=>{t(e)||this._items.delete(e)})),e!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){(0,i.gc)(this._observable),yield*this._items}}},10382:(t,e,s)=>{s.d(e,{A:()=>c});var i=s(36563),r=(s(44208),s(74887)),n=s(9775),o=s(72457),a=s(52268),h=s(61322);class c{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new n.A,this._ongoingLowPriorityJobsQueue=new n.A}destroy(){this.close()}get closed(){return!this._clients?.length}open(t,e){return new Promise(((s,i)=>{let n=!0;const o=t=>{(0,r.Te)(e.signal),n&&(n=!1,t())};this._clients.length=t.length,this._clientPromises.length=t.length,this._inUseClients.length=t.length;for(let n=0;n<t.length;++n){const a=t[n];(0,r.$X)(a)?this._clientPromises[n]=a.then((t=>(this._clients[n]=new h.default(t,e,this._ongoingJobsQueue,this._ongoingLowPriorityJobsQueue),o(s),this._clients[n])),(()=>(o(i),null))):(this._clients[n]=new h.default(a,e,this._ongoingJobsQueue,this._ongoingLowPriorityJobsQueue),this._clientPromises[n]=Promise.resolve(this._clients[n]),o(s))}}))}broadcast(t,e,s){const i=new Array(this._clientPromises.length);for(let r=0;r<this._clientPromises.length;++r){const n=this._clientPromises[r];i[r]=n.then((i=>i?.invoke(t,e,s)))}return i}close(){let t;for(;t=this._ongoingJobsQueue.pop();)t.resolver.reject((0,r.NK)(`Worker closing, aborting job calling '${t.methodName}'`));for(;t=this._ongoingLowPriorityJobsQueue.pop();)t.resolver.reject((0,r.NK)(`Worker closing, aborting job calling '${t.methodName}'`));for(const t of this._clientPromises)t.then((t=>t?.close()));this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,(0,o.h)(this)}invoke(t,e,s){return this.apply(t,[e],s)}apply(t,e,s){const i=(0,r.Tw)();("low"===s?.priority?this._ongoingLowPriorityJobsQueue:this._ongoingJobsQueue).push({methodName:t,data:e,invokeOptions:s,resolver:i});for(let t=0;t<this._clientPromises.length;t++){const e=this._clients[t];e?e.jobAdded():this._clientPromises[t].then((t=>t?.jobAdded()))}return i.promise}createInvokeProxy(t){return(0,a.L)(this,t)}on(t,e){return Promise.all(this._clientPromises).then((()=>(0,i.vE)(this._clients.map((s=>s.on(t,e))))))}openPorts(){return new Promise((t=>{const e=new Array(this._clientPromises.length);let s=e.length;for(let i=0;i<this._clientPromises.length;++i)this._clientPromises[i].then((r=>{r&&(e[i]=r.openPort()),0===--s&&t(e)}))}))}get test(){}}},18047:(t,e,s)=>{s.d(e,{ZV:()=>h,yx:()=>a});var i=s(73444);const r={ar:"ar-u-nu-latn",bs:"hr",nn:"no-NN"};let n=new WeakMap,o={};function a(t={}){const e={};return null!=t.digitSeparator&&(e.useGrouping=t.digitSeparator),null!=t.places&&(e.minimumFractionDigits=e.maximumFractionDigits=t.places),e}function h(t,e){return Object.is(t,-0)&&(t=0),function(t){const e=t||o;if(!n.has(e)){const s=(0,i.JK)(),o=(0,i.ZS)(s)?.language,a=o&&r[o]||s;n.set(e,new Intl.NumberFormat(a,t))}return n.get(e)}(e).format(t)}(0,i.Ml)((()=>{n=new WeakMap,o={}})),new Map},30624:(t,e,s)=>{s.r(e),s.d(e,{createConnection:()=>P});var i=s(90237),r=s(78888),n=s(49186),o=s(53966),a=s(74887),h=s(84952),c=(s(44208),s(87811),s(40608)),l=s(16930),u=s(65864),d=s(10107),_=s(62815),p=s(65529);let f=class extends p.A.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new n.A("stream-connection",this.errorString):null}onFeature(t){this.emit("data-received",t)}onMessage(t){this.emit("message-received",t)}};var g,m;(0,i._)([(0,d.MZ)({readOnly:!0})],f.prototype,"connectionError",null),f=(0,i._)([(0,c.$)("esri.layers.support.StreamConnection")],f),(m=g||(g={}))[m.CONNECTING=0]="CONNECTING",m[m.OPEN=1]="OPEN",m[m.CLOSING=2]="CLOSING",m[m.CLOSED=3]="CLOSED";let y=class extends f{constructor(t){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:e,spatialReference:s,sourceSpatialReference:i}=t;this._config=t,this._featureZScaler=(0,_.N)(e,i,s),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(t){null!=this._websocket?this._websocket.send(JSON.stringify(t)):this._outstandingMessages.push(t)}sendMessageToClient(t){this._onMessage(t)}updateCustomParameters(t){this._config.customParameters=t,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(t=this._config.source.path,e=1e3,s=0){try{if(this.destroyed)return;const e=(0,h.a6)(t,this._config.customParameters??{});this._websocket=await this._createWebSocket(e),this.notifyChange("connectionStatus")}catch(i){const r=e/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(o.A.getLogger(this).error(new n.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(o.A.getLogger(this).error(new n.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${r}s`,i)),await(0,a.Pl)(e),this._tryCreateWebSocket(t,Math.min(1.5*e,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(t){t.onmessage=t=>{try{const e=JSON.parse(t.data);this._onMessage(e)}catch(t){return void o.A.getLogger(this).error(new n.A("websocket-connection","Failed to parse message, invalid JSON",{error:t}))}}}_createWebSocket(t){return new Promise(((e,s)=>{const i=new WebSocket(t);i.onopen=()=>{if(i.onopen=null,this.destroyed)return i.onclose=null,void i.close();i.onclose=t=>this._onClose(t),i.onerror=t=>this._onError(t),this._setWebSocketJSONParseHandler(i),e(i)},i.onclose=t=>{i.onopen=i.onclose=null,s(t)}}))}async _handshake(t=1e4){const e=this._websocket;if(null==e)return;const s=(0,a.Tw)(),i=e.onmessage,{filter:r,outFields:h,spatialReference:c}=this._config;return s.timeout(t),e.onmessage=t=>{let a=null;try{a=JSON.parse(t.data)}catch(t){}a&&"object"==typeof a||(o.A.getLogger(this).error(new n.A("websocket-connection","Protocol violation. Handshake failed - malformed message",t.data)),s.reject(),this.destroy()),a.spatialReference?.wkid!==c?.wkid&&(o.A.getLogger(this).error(new n.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${c.wkid}`,t.data)),s.reject(),this.destroy()),"json"!==a.format&&(o.A.getLogger(this).error(new n.A("websocket-connection","Protocol violation. Handshake failed - format is not set",t.data)),s.reject(),this.destroy()),r&&a.filter!==r&&o.A.getLogger(this).error(new n.A("websocket-connection","Tried to set filter, but server doesn't support it")),h&&a.outFields!==h&&o.A.getLogger(this).error(new n.A("websocket-connection","Tried to set outFields, but server doesn't support it")),e.onmessage=i;for(const t of this._outstandingMessages)e.send(JSON.stringify(t));this._outstandingMessages=[],s.resolve()},e.send(JSON.stringify({filter:r,outFields:h,format:"json",spatialReference:{wkid:c.wkid}})),s.promise}_onMessage(t){if(this.onMessage(t),"type"in t)switch(t.type){case"features":case"featureResult":for(const e of t.features)null!=this._featureZScaler&&this._featureZScaler(e.geometry),this.onFeature(e)}}_onError(t){const e="Encountered an error over WebSocket connection";this._set("errorString",e),o.A.getLogger(this).error("websocket-connection",e)}_onClose(t){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==t.code&&o.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${t.code}`),this.destroyed||this._open()}};(0,i._)([(0,d.MZ)()],y.prototype,"connectionStatus",null),(0,i._)([(0,d.MZ)()],y.prototype,"errorString",void 0),y=(0,i._)([(0,c.$)("esri.layers.graphics.sources.connections.WebSocketConnection")],y);var x=s(80893),b=s(61956);const w={maxQueryDepth:5,maxRecordCountFactor:3};let v=class extends y{constructor(t){super({...w,...t}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const t=await this._fetchServiceDefinition(this._config.source);t.timeInfo.trackIdField||o.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const e=this._fetchWebSocketUrl(t.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(e);const{filter:s,outFields:i}=this._config;this.destroyed||this._setFilter(s,i)}_onMessage(t){if("attributes"in t){let e;try{e=this._enrich(t),null!=this._featureZScaler&&this._featureZScaler(e.geometry)}catch(t){return void o.A.getLogger(this).error(new n.A("geoevent-connection","Failed to parse message",t))}this.onFeature(e)}else this.onMessage(t)}async _fetchServiceDefinition(t){const e={f:"json",...this._config.customParameters},s=(0,r.A)(t.path,{query:e,responseType:"json"}),i=(await s).data;return this._serviceDefinition=i,i}_fetchWebSocketUrl(t,e){const s=t[0],{urls:i,token:r}=s,n=this._inferWebSocketBaseUrl(i);return(0,h.a6)(`${n}/subscribe`,{outSR:""+e.wkid,token:r})}_inferWebSocketBaseUrl(t){if(1===t.length)return t[0];for(const e of t)if(e.includes("wss"))return e;return o.A.getLogger(this).error(new n.A("geoevent-connection","Unable to infer WebSocket url",t)),null}async _setFilter(t,e){const s=this._websocket;if(null==s||null==t&&null==e)return;const i=JSON.stringify({filter:this._serializeFilter(t,e)});let r=!1;const h=(0,a.Tw)();return s.onmessage=t=>{const e=JSON.parse(t.data);e.filter&&(e.error&&(o.A.getLogger(this).error(new n.A("geoevent-connection","Failed to set service filter",e.error)),this._set("errorString",`Could not set service filter - ${e.error}`),h.reject(e.error)),this._setWebSocketJSONParseHandler(s),r=!0,h.resolve())},s.send(i),setTimeout((()=>{r||(this.destroyed||this._websocket!==s||o.A.getLogger(this).error(new n.A("geoevent-connection","Server timed out when setting filter")),h.reject())}),1e4),h.promise}_serializeFilter(t,e){const s={};if(null==t&&null==e)return s;if(t?.geometry)try{const e=(0,u.rS)(t.geometry);if("extent"!==e.type)throw new n.A("geoevent-connection",`Expected extent but found type ${e.type}`);s.geometry=JSON.stringify(e.shiftCentralMeridian())}catch(t){o.A.getLogger(this).error(new n.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",t))}return t?.where&&"1 = 1"!==t.where&&"1=1"!==t.where&&(s.where=t.where),null!=e&&(s.outFields=e.join(",")),s}_enrich(t){if(!this._relatedFeatures)return t;const e=this._serviceDefinition.relatedFeatures.joinField,s=t.attributes[e],i=this._relatedFeatures.get(s);if(!i)return o.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",t),t;const{attributes:r,geometry:a}=i;for(const e in r)t.attributes[e]=r[e];return a&&(t.geometry=a),t.geometry||t.centroid||o.A.getLogger(this).error(new n.A("geoevent-connection","Found malformed feature - no geometry found",t)),t}async _queryBuddyServices(){try{const{relatedFeatures:t,keepLatestArchive:e}=this._serviceDefinition,s=this._queryRelatedFeatures(t),i=this._queryArchive(e);await s;const r=await i;if(!r)return;for(const t of r.features)this.onFeature(this._enrich(t))}catch(t){o.A.getLogger(this).error(new n.A("geoevent-connection","Encountered an error when querying buddy services",{error:t}))}}async _queryRelatedFeatures(t){if(!t)return;const e=await this._queryBuddy(t.featuresUrl);this._addRelatedFeatures(e)}async _queryArchive(t){if(t)return this._queryBuddy(t.featuresUrl)}async _queryBuddy(t){const e=new((await Promise.all([s.e(6131),s.e(8219),s.e(8948),s.e(3910),s.e(13),s.e(1214),s.e(9953),s.e(4796),s.e(3029),s.e(4111),s.e(8506),s.e(3600),s.e(812),s.e(655),s.e(4697)]).then(s.bind(s,13600))).default)({url:t}),{capabilities:i}=await e.load(),r=i.query.supportsMaxRecordCountFactor,n=i.query.supportsPagination,o=i.query.supportsCentroid,a=this._config.maxRecordCountFactor,h=e.capabilities.query.maxRecordCount,c=r?h*a:h,u=new b.A;if(u.outFields=this._config.outFields??["*"],u.where=this._config.filter?.where??"1=1",u.returnGeometry=!0,u.returnExceededLimitFeatures=!0,u.outSpatialReference=l.A.fromJSON(this._config.spatialReference),o&&(u.returnCentroid=!0),r&&(u.maxRecordCountFactor=a),n)return u.num=c,e.destroy(),this._queryPages(t,u);const d=await(0,x.eW)(t,u,this._config.sourceSpatialReference);return e.destroy(),d.data}async _queryPages(t,e,s=[],i=0){e.start=null!=e.num?i*e.num:null;const{data:r}=await(0,x.eW)(t,e,this._config.sourceSpatialReference);return r.exceededTransferLimit&&i<(this._config.maxQueryDepth??0)?(r.features.forEach((t=>s.push(t))),this._queryPages(t,e,s,i+1)):(s.forEach((t=>r.features.push(t))),r)}_addRelatedFeatures(t){const e=new Map,s=t.features,i=this._serviceDefinition.relatedFeatures.joinField;for(const t of s){const s=t.attributes[i];e.set(s,t)}this._relatedFeatures=e}};v=(0,i._)([(0,c.$)("esri.layers.graphics.sources.connections.GeoEventConnection")],v);let I=class extends f{constructor(t){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:e,spatialReference:s,sourceSpatialReference:i}=t;this._featureZScaler=(0,_.N)(e,i,s)}normalizeCtorArgs(){return{}}updateCustomParameters(t){}sendMessageToSocket(t){}sendMessageToClient(t){if("type"in t)switch(t.type){case"features":case"featureResult":for(const e of t.features)null!=this._featureZScaler&&this._featureZScaler(e.geometry),this.onFeature(e)}this.onMessage(t)}};function S(t,e){if(null==t&&null==e)return null;const s={};return null!=e&&(s.geometry=e),null!=t&&(s.where=t),s}function P(t,e,s,i,r,n,o,a,h){const c={source:t,sourceSpatialReference:e,spatialReference:s,geometryType:i,filter:S(r,n),maxReconnectionAttempts:o,maxReconnectionInterval:a,customParameters:h};return t?t.path.startsWith("wss://")||t.path.startsWith("ws://")?new y(c):new v(c):new I(c)}(0,i._)([(0,d.MZ)()],I.prototype,"connectionStatus",void 0),(0,i._)([(0,d.MZ)()],I.prototype,"errorString",void 0),I=(0,i._)([(0,c.$)("esri.layers.support.ClientSideConnection")],I)},32587:(t,e,s)=>{s.d(e,{A:()=>n});var i=s(62788),r=s(95488);class n{constructor(t){this._observable=new r.I,this._map=new Map(t)}get size(){return(0,i.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const e=this._map.delete(t);return e&&this._observable.notify(),e}entries(){return(0,i.gc)(this._observable),this._map.entries()}forEach(t,e){(0,i.gc)(this._observable),this._map.forEach(((s,i)=>t.call(e,s,i,this)),e)}get(t){return(0,i.gc)(this._observable),this._map.get(t)}has(t){return(0,i.gc)(this._observable),this._map.has(t)}keys(){return(0,i.gc)(this._observable),this._map.keys()}set(t,e){return this._map.set(t,e),this._observable.notify(),this}values(){return(0,i.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,i.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},32730:(t,e,s)=>{s.d(e,{BI:()=>g,D3:()=>p,XJ:()=>f,lc:()=>_,mX:()=>y,rU:()=>m,tH:()=>I});var i=s(799);const r="__begin__",n="__end__",o=new RegExp(r,"ig"),a=new RegExp(n,"ig"),h=new RegExp("^"+r,"i"),c=new RegExp(n+"$","i"),l='"',u=l+" + ",d=" + "+l;function _(t){return t.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function p(t){return t.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(t){const e={expression:"",type:"none"};return t.labelExpressionInfo?t.labelExpressionInfo.value?(e.expression=t.labelExpressionInfo.value,e.type="conventional"):t.labelExpressionInfo.expression&&(e.expression=t.labelExpressionInfo.expression,e.type="arcade"):null!=t.labelExpression&&(e.expression=_(t.labelExpression),e.type="conventional"),e}function g(t){const e=f(t);if(!e)return null;switch(e.type){case"conventional":return y(e.expression);case"arcade":return e.expression}return null}function m(t){const e=f(t);if(!e)return null;switch(e.type){case"conventional":return function(t){const e=t?.match(x);return e?.[1].trim()||null}(e.expression);case"arcade":return I(e.expression)}return null}function y(t){let e;return t?(e=(0,i.HC)(t,(t=>r+'$feature["'+t+'"]'+n)),e=h.test(e)?e.replace(h,""):l+e,e=c.test(e)?e.replace(c,""):e+l,e=e.replaceAll(o,u).replaceAll(a,d)):e='""',e}const x=/^\s*\{([^}]+)\}\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,v=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function I(t){if(!t)return null;let e=b.exec(t)||w.exec(t);return e?e[1]||e[3]:(e=v.exec(t),e?e[2]:null)}},36708:(t,e,s)=>{s.d(e,{C_:()=>d,OH:()=>f,Vh:()=>g,on:()=>u,pc:()=>m,wB:()=>h,z7:()=>c});var i=s(37955),r=s(36563),n=s(97768),o=s(74887),a=s(14012);function h(t,e,s={}){return l(t,e,s,_)}function c(t,e,s={}){return l(t,e,s,p)}function l(t,e,s={},i){let r=null;const o=s.once?(t,s)=>{i(t)&&((0,n.xt)(r),e(t,s))}:(t,s)=>{i(t)&&e(t,s)};if(r=(0,a.Cn)(t,o,s.sync,s.equals),s.initial){const e=t();o(e,e)}return r}function u(t,e,s,o={}){let a=null,c=null,l=null;function u(){a&&c&&(c.remove(),o.onListenerRemove?.(a),a=null,c=null)}function d(t){o.once&&o.once&&(0,n.xt)(l),s(t)}const _=h(t,((t,s)=>{u(),(0,i.wb)(t)&&(a=t,c=(0,i.on)(t,e,d),o.onListenerAdd?.(t))}),{sync:o.sync,initial:!0});return l=(0,r.hA)((()=>{_.remove(),u()})),l}function d(t,e){return function(t,e,s){if((0,o.G4)(s))return Promise.reject((0,o.NK)());const i=t();if(e?.(i))return Promise.resolve(i);let a=null;function h(){a=(0,n.xt)(a)}return new Promise(((i,n)=>{a=(0,r.vE)([(0,o.u7)(s,(()=>{h(),n((0,o.NK)())})),l(t,(t=>{h(),i(t)}),{sync:!1,once:!0},e??_)])}))}(t,p,e)}function _(t){return!0}function p(t){return!!t}s(80559);const f={sync:!0},g={initial:!0},m={sync:!0,initial:!0}},37585:(t,e,s)=>{s.d(e,{C:()=>r,Cc:()=>g,Io:()=>u,S8:()=>f,WQ:()=>o,e$:()=>y,hZ:()=>n,hs:()=>l,jb:()=>b,l0:()=>m});var i=s(34304);function r(t,e){return t[0]=e[0],t[1]=e[1],t}function n(t,e,s){return t[0]=e,t[1]=s,t}function o(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t}function a(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t}function h(t,e,s){return t[0]=e[0]*s[0],t[1]=e[1]*s[1],t}function c(t,e,s){return t[0]=e[0]/s[0],t[1]=e[1]/s[1],t}function l(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t}function u(t,e){const s=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(s*s+i*i)}function d(t,e){const s=e[0]-t[0],i=e[1]-t[1];return s*s+i*i}function _(t){const e=t[0],s=t[1];return Math.sqrt(e*e+s*s)}function p(t){const e=t[0],s=t[1];return e*e+s*s}function f(t,e){const s=e[0],i=e[1];let r=s*s+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t}function g(t,e,s,i){const r=e[0],n=e[1];return t[0]=r+i*(s[0]-r),t[1]=n+i*(s[1]-n),t}function m(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[2]*r+s[4],t[1]=s[1]*i+s[3]*r+s[5],t}function y(t,e,s,i){const r=e[0]-s[0],n=e[1]-s[1],o=Math.sin(i),a=Math.cos(i);return t[0]=r*a-n*o+s[0],t[1]=r*o+n*a+s[1],t}const x=_,b=a,w=h,v=c,I=u,S=d,P=p;Object.freeze(Object.defineProperty({__proto__:null,add:o,angle:function(t,e){const s=t[0],i=t[1],r=e[0],n=e[1];let o=s*s+i*i;o>0&&(o=1/Math.sqrt(o));let a=r*r+n*n;a>0&&(a=1/Math.sqrt(a));const h=(s*r+i*n)*o*a;return h>1?0:h<-1?Math.PI:Math.acos(h)},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},copy:r,cross:function(t,e,s){const i=e[0]*s[1]-e[1]*s[0];return t[0]=t[1]=0,t[2]=i,t},dist:I,distance:u,div:v,divide:c,dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},equals:function(t,e){const s=t[0],r=t[1],n=e[0],o=e[1],a=(0,i.FD)();return Math.abs(s-n)<=a*Math.max(1,Math.abs(s),Math.abs(n))&&Math.abs(r-o)<=a*Math.max(1,Math.abs(r),Math.abs(o))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},len:x,length:_,lerp:g,max:function(t,e,s){return t[0]=Math.max(e[0],s[0]),t[1]=Math.max(e[1],s[1]),t},min:function(t,e,s){return t[0]=Math.min(e[0],s[0]),t[1]=Math.min(e[1],s[1]),t},mul:w,multiply:h,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:f,projectAndScale:function(t,e,s,i,r){let n=e[0]-s[0],o=e[1]-s[1];const a=(i[0]*n+i[1]*o)*(r-1);return n=i[0]*a,o=i[1]*a,t[0]=e[0]+n,t[1]=e[1]+o,t},random:function(t,e=1){const s=2*(0,i.Ov)()*Math.PI;return t[0]=Math.cos(s)*e,t[1]=Math.sin(s)*e,t},rotate:y,round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:l,scaleAndAdd:function(t,e,s,i){return t[0]=e[0]+s[0]*i,t[1]=e[1]+s[1]*i,t},set:n,sqrDist:S,sqrLen:P,squaredDistance:d,squaredLength:p,str:function(t){return"vec2("+t[0]+", "+t[1]+")"},sub:b,subtract:a,transformMat2:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[2]*r,t[1]=s[1]*i+s[3]*r,t},transformMat2d:m,transformMat3:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[3]*r+s[6],t[1]=s[1]*i+s[4]*r+s[7],t},transformMat4:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[4]*r+s[12],t[1]=s[1]*i+s[5]*r+s[13],t}},Symbol.toStringTag,{value:"Module"}))},37730:(t,e,s)=>{s.d(e,{T:()=>r});var i=s(43334);const r={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new i.Om(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>t.ensureCentroid(e)}},38487:(t,e,s)=>{s.r(e),s.d(e,{default:()=>au});var i=s(49186),r=s(36563),n=s(44208),o=s(26390),a=s(74887),h=s(87811),c=s(36708),l=s(90629),u=s(8341),d=s(87045),_=s(76213);class p{constructor(t){this._client=t,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(t){(0,u.oV)(this._eventLog.onEvent(t))}}var f=s(97768),g=s(93637),m=s(6797),y=s(16930),x=s(21325),b=s(44159);function w(t,e){return[t,e]}function v(t,e,s){return t[0]=e,t[1]=s,t}const I=new b.A("0/0/0/0");class S{static create(t,e,s=null){const i=(0,x.Vp)(t.spatialReference),r=e.origin||w(t.origin.x,t.origin.y),n=w(t.size[0]*e.resolution,t.size[1]*e.resolution),o=w(-1/0,-1/0),a=w(1/0,1/0),h=w(1/0,1/0);null!=s&&(v(o,Math.max(0,Math.floor((s.xmin-r[0])/n[0])),Math.max(0,Math.floor((r[1]-s.ymax)/n[1]))),v(a,Math.max(0,Math.floor((s.xmax-r[0])/n[0])),Math.max(0,Math.floor((r[1]-s.ymin)/n[1]))),v(h,a[0]-o[0]+1,a[1]-o[1]+1));const{cols:c,rows:l}=e;let u,d,_,p;return!s&&c&&l&&(v(o,c[0],l[0]),v(a,c[1],l[1]),v(h,c[1]-c[0]+1,l[1]-l[0]+1)),t.isWrappable?(u=w(Math.ceil(Math.round((i.valid[1]-i.valid[0])/e.resolution)/t.size[0]),h[1]),d=!0,_=i.origin,p=i.valid):(u=h,d=!1),new S(e.level,e.resolution,e.scale,r,o,a,h,n,u,d,_,p)}constructor(t,e,s,i,r,n,o,a,h,c,l,u){this.level=t,this.resolution=e,this.scale=s,this.origin=i,this.first=r,this.last=n,this.size=o,this.norm=a,this.worldSize=h,this.wrap=c,this._spatialReferenceOrigin=l,this._spatialReferenceValid=u}normalizeCol(t){if(!this.wrap)return t;const e=this.worldSize[0];return t<0?e-1-Math.abs((t+1)%e):t%e}normalizeKey(t){if(!this.wrap)return;const e=this.worldSize[0],s=t.col;s<0?(t.col=s+e,t.world-=1):s>=e&&(t.col=s-e,t.world+=1)}denormalizeCol(t,e){return this.wrap?this.worldSize[0]*e+t:t}getWorldForColumn(t){return this.wrap?Math.floor(t/this.worldSize[0]):0}getFirstColumnForWorld(t){return t*this.worldSize[0]+this.first[0]}getLastColumnForWorld(t){return t*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(t){return(t-this.origin[0])/this.norm[0]}getXForColumn(t){const e=this.origin[0]+t*this.norm[0],s=this._spatialReferenceOrigin,i=this._spatialReferenceValid;return this.wrap&&s&&i?e===s[0]?i[0]:this.origin[0]===s[0]&&t===this.worldSize[0]?i[1]:e:e}getRowForY(t){return(this.origin[1]-t)/this.norm[1]}getYForRow(t){return this.origin[1]-t*this.norm[1]}getTileBounds(t,e,s=!1){I.set(e);const i=s?I.col:this.denormalizeCol(I.col,I.world),r=I.row;return function(t,e,s,i,r){t[0]=e,t[1]=s,t[2]=i,t[3]=r}(t,this.getXForColumn(i),this.getYForRow(r+1),this.getXForColumn(i+1),this.getYForRow(r)),t}getTileCoords(t,e,s=!1){I.set(e);const i=s?I.col:this.denormalizeCol(I.col,I.world);return Array.isArray(t)?v(t,this.getXForColumn(i),this.getYForRow(I.row)):(t.x=this.getXForColumn(i),t.y=this.getYForRow(I.row)),t}}var P=s(93687);class M{constructor(){this.spans=[]}static{this.pool=new P.A(M)}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:e,colFrom:s,colTo:i}of this.spans)for(let r=s;r<=i;r++){const s=t.getWorldForColumn(r);yield new b.A(t.level,e,t.normalizeCol(r),s)}}forEach(t,e){const{spans:s,lodInfo:i}=this,{level:r}=i;if(0!==s.length)for(const{row:n,colFrom:o,colTo:a}of s)for(let s=o;s<=a;s++)t.call(e,r,n,i.normalizeCol(s),i.getWorldForColumn(s))}}class A{constructor(t,e,s){this.row=t,this.colFrom=e,this.colTo=s}}const T=new b.A("0/0/0/0");class k{static create(t,e){t[1]>e[1]&&([t,e]=[e,t]);const[s,i]=t,[r,n]=e,o=r-s,a=n-i,h=0!==a?o/a:0,c=(Math.ceil(i)-i)*h,l=(Math.floor(i)-i)*h;return new k(s,Math.floor(i),Math.ceil(n),h,o<0?c:l,o<0?l:c,o<0?r:s,o<0?s:r)}constructor(t,e,s,i,r,n,o,a){this.x=t,this.ymin=e,this.ymax=s,this.invM=i,this.leftAdjust=r,this.rightAdjust=n,this.leftBound=o,this.rightBound=a}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const C=[[0,0],[0,0],[0,0],[0,0]];class F{constructor(t,e=null,s=t.lods[0].level,i=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=e,this.scales=[],this._infoByScale={},this._infoByLevel={};const r=t.lods.filter((t=>t.level>=s&&t.level<=i));this.minScale=r[0].scale,this.maxScale=r[r.length-1].scale;const n=this._lodInfos=r.map((s=>S.create(t,s,e)));r.forEach(((t,e)=>{this._infoByLevel[t.level]=n[e],this._infoByScale[t.scale]=n[e],this.scales[e]=t.scale}),this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel["number"==typeof t?t:t.level]}getTileBounds(t,e,s=!1){T.set(e);const i=this._infoByLevel[T.level];return i?i.getTileBounds(t,T,s):t}getTileCoords(t,e,s=!1){T.set(e);const i=this._infoByLevel[T.level];return i?i.getTileCoords(t,T,s):t}getTileCoverage(t,e=192,s=!0,i="closest"){if(!s&&(t.scale>this.minScale||t.scale<this.maxScale))return null;const r="closest"===i?this.getClosestInfoForScale(t.scale):this.getSmallestInfoForScale(t.scale),n=M.pool.acquire(r),o=this._wrap;let a,h,c,l=1/0,u=-1/0;const d=n.spans;C[0][0]=C[0][1]=C[1][1]=C[3][0]=-e,C[1][0]=C[2][0]=t.size[0]+e,C[2][1]=C[3][1]=t.size[1]+e;for(const e of C)t.toMap(e,e),e[0]=r.getColumnForX(e[0]),e[1]=r.getRowForY(e[1]);const _=[];let p=3;for(let t=0;t<4;t++){if(C[t][1]===C[p][1]){p=t;continue}const e=k.create(C[t],C[p]);l=Math.min(e.ymin,l),u=Math.max(e.ymax,u),void 0===_[e.ymin]&&(_[e.ymin]=[]),_[e.ymin].push(e),p=t}if(null==l||null==u||u-l>100)return null;let f=[];for(a=l;a<u;){null!=_[a]&&(f=f.concat(_[a])),h=1/0,c=-1/0;for(let t=f.length-1;t>=0;t--){const e=f[t];h=Math.min(h,e.getLeftCol()),c=Math.max(c,e.getRightCol())}if(h=Math.floor(h),c=Math.floor(c),a>=r.first[1]&&a<=r.last[1])if(o)if(r.size[0]<r.worldSize[0]){const t=Math.floor(c/r.worldSize[0]);for(let e=Math.floor(h/r.worldSize[0]);e<=t;e++)d.push(new A(a,Math.max(r.getFirstColumnForWorld(e),h),Math.min(r.getLastColumnForWorld(e),c)))}else d.push(new A(a,h,c));else h>r.last[0]||c<r.first[0]||(h=Math.max(h,r.first[0]),c=Math.min(c,r.last[0]),d.push(new A(a,h,c)));a+=1;for(let t=f.length-1;t>=0;t--){const e=f[t];e.ymax>=a?e.incrRow():f.splice(t,1)}}return n}getTileParentId(t){T.set(t);const e=this._infoByLevel[T.level],s=this._lodInfos.indexOf(e)-1;return s<0?null:(this._getTileIdAtLOD(T,this._lodInfos[s],T),T.id)}getTileResolution(t){const e=this._infoByLevel["object"==typeof t?t.level:t];return e?e.resolution:-1}getTileScale(t){const e=this._infoByLevel[t.level];return e?e.scale:-1}intersects(t,e){T.set(e);const s=this._infoByLevel[T.level],i=t.lodInfo;if(i.resolution>s.resolution){this._getTileIdAtLOD(T,i,T);const e=i.denormalizeCol(T.col,T.world);for(const s of t.spans)if(s.row===T.row&&s.colFrom<=e&&s.colTo>=e)return!0}if(i.resolution<s.resolution){const[e,r,n,o]=t.spans.reduce(((t,e)=>(t[0]=Math.min(t[0],e.row),t[1]=Math.max(t[1],e.row),t[2]=Math.min(t[2],e.colFrom),t[3]=Math.max(t[3],e.colTo),t)),[1/0,-1/0,1/0,-1/0]),a=s.denormalizeCol(T.col,T.world),h=i.getColumnForX(s.getXForColumn(a)),c=i.getRowForY(s.getYForRow(T.row)),l=i.getColumnForX(s.getXForColumn(a+1))-1,u=i.getRowForY(s.getYForRow(T.row+1))-1;return!(h>o||l<n||c>r||u<e)}const r=i.denormalizeCol(T.col,T.world);return t.spans.some((t=>t.row===T.row&&t.colFrom<=r&&t.colTo>=r))}normalizeBounds(t,e,s){if(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._wrap){const e=(0,x.Vp)(this.tileInfo.spatialReference),i=-s*(e.valid[1]-e.valid[0]);t[0]+=i,t[2]+=i}return t}getSmallestInfoForScale(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>e[0])return this._infoByScale[e[0]];for(let s=1;s<e.length-1;s++)if(t>e[s]+1e-6)return this._infoByScale[e[s-1]];return this._infoByScale[e[e.length-1]]}getClosestInfoForScale(t){const e=this.scales;return this._infoByScale[t]||(t=e.reduce(((e,s)=>Math.abs(s-t)<Math.abs(e-t)?s:e),e[0])),this._infoByScale[t]}scaleToLevel(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t].level;for(let s=e.length-1;s>=0;s--)if(t<e[s])return s===e.length-1?this._infoByScale[e[e.length-1]].level:this._infoByScale[e[s]].level+(e[s]-t)/(e[s]-e[s+1]);return this._infoByScale[e[0]].level}scaleToZoom(t){return this.tileInfo.scaleToZoom(t)}zoomToScale(t){return this.tileInfo.zoomToScale(t)}_getTileIdAtLOD(t,e,s){const i=this._infoByLevel[s.level];return t.set(s),e.resolution<i.resolution?null:(e.resolution===i.resolution||(t.level=e.level,t.col=Math.floor(s.col*i.resolution/e.resolution+.01),t.row=Math.floor(s.row*i.resolution/e.resolution+.01)),t)}}var E=s(90237),O=s(69622),z=s(91869),R=s(3483),L=s(10107),D=s(53966),N=s(40608),G=s(37585),B=s(9775),q=s(32587),W=s(11932),Y=s(44794);class U{constructor(t,e){this.item=t,this.controller=e,this.promise=null}}class j{constructor(t){this._schedule=null,this._task=null,this._deferreds=new q.A,this._controllers=new q.A,this._processingItems=new q.A,this._pausedSignal=(0,Y.v)(!1),this.concurrency=1,t.concurrency&&(this.concurrency=t.concurrency),this._queue=new B.A(t.peeker),this.process=t.process;const e=t.scheduler;t.priority&&e&&(this._task=e.registerTask(t.priority,this))}destroy(){this.clear(),this._schedule=(0,f.xt)(this._schedule),this._task=(0,f.xt)(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(t){const e=this._controllers.get(t);e&&e.abort()}clear(){this._queue.clear();const t=[];this._controllers.forEach((e=>t.push(e))),this._controllers.clear(),t.forEach((t=>t.abort())),this._processingItems.clear(),this._cancelNext()}forEach(t){this._deferreds.forEach(((e,s)=>t(s)))}get(t){const e=this._deferreds.get(t);return e?e.promise:void 0}isOngoing(t){return this._processingItems.has(t)}has(t){return this._deferreds.has(t)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(t,e){const s=this.get(t);if(s)return s;const i=new AbortController;let r=null;e&&(r=(0,a.u7)(e,(()=>i.abort())));const n=()=>{o.remove(),null!=r&&r.remove(),this._removeItem(t),this._queue.remove(t),this._scheduleNext()},o=(0,a.NY)(i.signal,(()=>{const e=this._processingItems.get(t);e&&e.controller.abort(),n(),h.reject((0,a.NK)())})),h=(0,a.Tw)();return this._deferreds.set(t,h),this._controllers.set(t,i),h.promise.then(n,n),this._queue.push(t),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const t=this.last();return t?this.get(t):null}peek(){return this._queue.peek()}popLast(){const t=this._queue.popLast();return t&&(this._deferreds.get(t)?.reject((0,a.NK)()),this._removeItem(t)),t}reset(){const t=Array.from(this._processingItems.values());this._processingItems.clear();for(const e of t)this._queue.push(e.item),e.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const t=[];for(;this._queue.length;)t.push(this._queue.pop());return this.clear(),t}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}runTask(t){for(;!t.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),t.madeProgress()}_removeItem(t){this._deferreds.delete(t),this._controllers.delete(t),this._processingItems.delete(t)}_scheduleNext(){this._task||this._pausedSignal.value||this._schedule||(this._schedule=(0,W._)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(t,e){this._canProcessFulfillment(t)&&(this._scheduleNext(),this._deferreds.get(t.item).resolve(e))}_processError(t,e){this._canProcessFulfillment(t)&&(this._scheduleNext(),this._deferreds.get(t.item).reject(e))}_canProcessFulfillment(t){return!!this._deferreds.get(t.item)&&this._processingItems.get(t.item)===t}_process(t){if(null==t)return;let e;const s=new AbortController,i=new U(t,s);this._processingItems.set(t,i);try{e=this.process(t,s.signal)}catch(t){this._processError(i,t)}(0,a.$X)(e)?(i.promise=e,e.then((t=>this._processResult(i,t)),(t=>this._processError(i,t)))):this._processResult(i,e)}get test(){}}const V=[0,0];let X=class extends O.A{constructor(t){super(t),this._keyToItem=new Map,this._tilesByScale=new Map,this.concurrency=6}initialize(){const{concurrency:t,process:e,scheduler:s,priority:i}=this;this._queue=new j({concurrency:t,scheduler:s,priority:i,process:(t,s)=>{const i=this._keyToItem.get(t);return e(i,{signal:s})},peeker:t=>this._peek(t)})}destroy(){this.clear(),this._queue=(0,f.pR)(this._queue)}get length(){return this._queue?this._queue.length:0}abort(t){const e="string"==typeof t?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(t){return"string"==typeof t?this._keyToItem.has(t):this._keyToItem.has(t.id)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const s=this._queue.push(e),i=this.tileInfoView.getTileScale(t.key),r=(0,z.tE)(this._tilesByScale,i,(()=>new Set)),n=()=>{r.delete(t.key),0===r.size&&this._tilesByScale.delete(i),this._keyToItem.delete(e)};return r.add(t.key),this._keyToItem.set(e,t),s.then(n,n),s}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(t){if(!this.state)return t.values().next().value;const e=new Set;for(const s of t)e.add(this._keyToItem.get(s).key);const s=this.state.scale;let i,r=Number.POSITIVE_INFINITY;for(const[t,n]of this._tilesByScale)if((0,R.bw)(n,(t=>e.has(t)))){const e=Math.abs(t-s);e<r&&(i=n,r=e)}return this._getClosestTileKey(i,t).id}_getClosestTileKey(t,e){const s=this.tileInfoView,i=this.state.center;let r,n=Number.POSITIVE_INFINITY;for(const o of t)if(e.has(o.id)){s.getTileCoords(V,o);const t=(0,G.Io)(V,i);t<n&&(n=t,r=o)}return r}};(0,E._)([(0,L.MZ)({constructOnly:!0})],X.prototype,"concurrency",void 0),(0,E._)([(0,L.MZ)({constructOnly:!0})],X.prototype,"priority",void 0),(0,E._)([(0,L.MZ)({constructOnly:!0})],X.prototype,"process",void 0),(0,E._)([(0,L.MZ)({constructOnly:!0})],X.prototype,"scheduler",void 0),(0,E._)([(0,L.MZ)()],X.prototype,"state",void 0),(0,E._)([(0,L.MZ)({constructOnly:!0})],X.prototype,"tileInfoView",void 0),X=(0,E._)([(0,N.$)("esri.views.2d.tiling.TileQueue")],X);var H=s(19419);new b.A(0,0,0,0),new Map;class Q{static{this.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT}constructor(t,e,s,i,r,n,o){this.instanceId=t,this.textureKey=e,this.indexStart=s,this.indexCount=i,this.vertexStart=r,this.vertexCount=n,this.overlaps=o}updateBaseOffsets(t){this.vertexStart+=t.vertexFrom,this.indexStart+=t.indexFrom}clone(){return new Q(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(t,e,s,i,r,n,o,a){t.push(e),t.push(s),t.push(i),t.push(r),t.push(n),t.push(o),t.push(a)}serialize(t){return t.push(this.instanceId),t.push(this.textureKey),t.push(this.indexStart),t.push(this.indexCount),t.push(this.vertexStart),t.push(this.vertexCount),t.push(this.overlaps),t}static deserialize(t){const e=t.readInt32(),s=t.readInt32(),i=t.readInt32(),r=t.readInt32(),n=t.readInt32(),o=t.readInt32(),a=t.readInt32();return new Q(e,s,i,r,n,o,a)}}function Z(t,e){if(null!==e){t.push(e.length);for(const s of e)s.serialize(t);return t}t.push(0)}function $(t,e,s){const i=t.readInt32(),r=new Array(i);for(let i=0;i<r.length;i++)r[i]=e.deserialize(t,s);return r}class J{static{this.byteSizeHint=2*Uint32Array.BYTES_PER_ELEMENT+Q.byteSizeHint}constructor(t,e){this.id=t,this.sortKey=e,this.records=[]}serialize(t){return t.push(this.id),t.writeF32(this.sortKey),Z(t,this.records),t}static deserialize(t){const e=t.readInt32(),s=t.readF32(),i=new J(e,s);return i.records=$(t,Q)??[],i}}class K{get length(){return this._pos}constructor(t,e){this._pos=0;const s=e?this._roundToNearest(e,t.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(s),this._buffer=new t(this._array),this._ctor=t,this._i16View=new Int16Array(this._array)}_roundToNearest(t,e){const s=Math.round(t);return 1===e?s:s+(e-s%e)}_ensureSize(t){if(this._pos+t>=this._buffer.length){const e=this._roundToNearest(1.25*(this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),s=new ArrayBuffer(e),i=new this._ctor(s);i.set(this._buffer,0),this._array=s,this._buffer=i,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,s){this._i16View[2*t]+=e,this._i16View[2*t+1]+=s}getValue(t){return this._buffer[t]}getValueF32(t){return new Float32Array(this._array,4*t,1)[0]}incr(t){if(this._buffer.length<t)throw new Error("Increment index overflows the target buffer");this._buffer[t]++}decr(t){this._buffer[t]--}writeRegion(t){this._ensureSize(t.length);const e=this._pos;return this._buffer.set(t,this._pos),this._pos+=t.length,e}writeManyFrom(t,e,s){this._ensureSize(s-e);for(let i=e;i!==s;i++)this.writeFixed(t._buffer[i])}buffer(){const t=this._array.slice(0,4*this._pos);return this.destroy(),t}toArray(){return[...this._buffer]}seek(t){this._pos=t}destroy(){this._array=null,this._buffer=null}}class tt{constructor(t,e,s=0){const i=6*s*Uint32Array.BYTES_PER_ELEMENT,r=4*s*e.stride,n=e.stride/4,o=e.attributes.find((t=>"pos"===t.name||"position"===t.name));if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...e,position:o},this._indices=new K(Uint32Array,i),this._vertices=new K(Uint32Array,r),this._metrics=new K(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=t}serialize(t){const e=this._indices.buffer(),s=this._vertices.buffer(),i=this._metrics.length?this._metrics.buffer():null;return t.push(e,s),{instanceId:this._instanceId,layout:this.layout,indices:e,vertices:s,metrics:i}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(t){this._vertices.ensureSize(t)}indexEnsureSize(t){this._indices.ensureSize(t)}writeIndex(t){this._indices.push(t)}writeVertex(t){this._vertices.push(t)}writeVertexRegion(t){this._vertices.writeRegion(t)}writeVertexF32(t){this._vertices.writeF32(t)}writeMetric(t){this._metrics.incr(this._metricCountOffset),t.serialize(this._metrics)}}class et{constructor(t,e=0){this._id=t,this._sizeHint=e,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new K(Uint32Array,this._sizeHint*J.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const t=new Array,e=[],s=this._entities.buffer();for(const s of this._instanceIdToVertexData.values())e.push(s.serialize(t));return{message:{data:e,entities:s},transferList:t}}vertexStart(){return this._current.vertexStart??0}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(t){this._current.writer.vertexEnsureSize(t)}indexEnsureSize(t){this._current.writer.indexEnsureSize(t)}vertexWrite(t){this._current.writer.writeVertex(t)}vertexWriteRegion(t){this._current.writer.writeVertexRegion(t)}vertexWriteF32(t){this._current.writer.writeVertexF32(t)}recordBounds(t,e,s,i){}indexWrite(t){this._current.writer.writeIndex(t)}metricStart(t){this._current.metric=t,this._current.metric.recordStart=this.recordCount()}metricEnd(){const t=this._current.writer;this._current.metric&&(this._current.metric.recordCount=this.recordCount()-this._current.metric.recordStart),this._current.metric?.bounds.length&&this._current.metric?.recordCount?(t.writeMetric(this._current.metric),this._current.metric=null):this._current.metric=null}metricBoxWrite(t){this._current.metric.bounds.push(t)}entityStart(t,e=t){this._entityIdIndex=this._entities.push(t),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(0===this.entityRecordCount()?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(t,e,s=0){this._current.writer=this._getVertexWriter(t,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=t,this._current.layoutHash=e.hash,this._current.textureKey=s}recordEnd(t=0){const e=this._current.vertexStart,s=this._current.writer.vertexCount-e;if(!s)return!1;const i=this._current.indexStart,r=this._current.writer.indexCount-i;return this._recordIndexStart=i,this._recordIndexCount=r,this._recordVertexStart=e,this._recordVertexCount=s,this._entities.incr(this._entityRecordCountOffset),Q.write(this._entities,this._current.instanceId,this._current.textureKey,i,r,e,s,t),!0}copyLast(t,e){const s=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),Q.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,s,this._recordVertexCount,0);const i=this._current.writer.indexWriter,r=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let t=this._recordIndexStart;t!==n;t++){const e=i.getValue(t);i.push(e+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*a,c=(this._recordVertexStart+this._recordVertexCount)*a;for(let t=h;t!==c;t++){const e=r.getValue(t);r.push(e)}const l=this._current.writer.layout.position,u=l.packPrecisionFactor??1,d=l.offset/Uint32Array.BYTES_PER_ELEMENT,_=t*u,p=e*u;for(let t=s*a;t<=r.length;t+=a)r.i1616Add(t+d,_,p)}copyLastFrom(t,e,s){const i=t._entities.getValue(t._entityIdIndex);if(i!==this._entities.getValue(this._entityIdIndex)){const e=t._entities.getValueF32(t._entitySortKeyIndex);this.entityStart(i,e)}this.recordStart(t._current.instanceId,t._current.writer.layout,t._current.textureKey);const r=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=t._current.vertexStart-n,a=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,c=t._current.writer.indexWriter,l=t._current.writer.vertexWriter;for(let e=t._current.indexStart;e!==c.length;e++){const t=c.getValue(e);a.push(t-o)}for(let e=t._current.vertexStart*r;e!==l.length;e++){const t=l.getValue(e);h.push(t)}const u=this._current.writer.layout.position,d=u.packPrecisionFactor??1,_=u.offset/Uint32Array.BYTES_PER_ELEMENT,p=e*d,f=s*d;for(let t=n*r;t<=h.length;t+=r)h.i1616Add(t+_,p,f);this.recordEnd()}_getVertexWriter(t,e){const s=this._instanceIdToVertexData;return s.has(t)||s.set(t,new tt(t,e,this._sizeHint)),s.get(t)}}function st(t){switch(t){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function it(t){switch(t){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class rt{constructor(t,e,s,i,r=0){this.tileKey=t,this._bufferingEnabled=e,this._sizeHint=r,this._meshes={self:new et(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=i?1:0;this._copyBufferedDataIntoSelf=s&&this._bufferingEnabled&&t.level===n}get id(){return this.tileKey.id}vertexStart(){return this._meshes.self.vertexStart()??0}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(t){this._meshes.self.indexEnsureSize(t)}entityStart(t,e=t){this._currentEntityOverlaps=0,this._meshes.self.entityStart(t,e)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let t=0;t<8;t++){const e=1<<t;this._currentEntityOverlaps&e&&this._meshes.neighbors[t].entityEnd()}}}recordStart(t,e,s){this._currentRecordOverlaps=0,this._meshes.self.recordStart(t,e,s)}recordEnd(t=0){const e=this._meshes.self.recordEnd(this._currentRecordOverlaps);return e&&0!==this._currentRecordOverlaps?(this._copyIntoNeighbors(),this._currentEntityOverlaps|=this._currentRecordOverlaps,!0):e}recordBounds(t,e,s,i){this._bufferingEnabled&&this._addOverlap(t,e,s,i)}recordCount(){return this._meshes.self.recordCount()}metricStart(t){this._meshes.self.metricStart(t)}metricBoxWrite(t){this._meshes.self.metricBoxWrite(t)}metricEnd(){this._meshes.self.metricEnd()}vertexWrite(t){this._meshes.self.vertexWrite(t)}vertexWriteF32(t){this._meshes.self.vertexWriteF32(t)}vertexWriteRegion(t){this._meshes.self.vertexWriteRegion(t)}indexWrite(t){this._meshes.self.indexWrite(t)}serialize(t){const e={message:[],transferList:[]},s=this._meshes.self.serialize();return e.message.push({tileId:this.tileKey.id,...s.message}),e.transferList.push(...s.transferList),this._meshes.neighbors.forEach(((s,i)=>{const r=s.serialize(),n=1<<i,o=st(n),a=it(n),h=new b.A(this.tileKey).getNormalizedNeighbor(o,a,t);e.message.push({tileId:h.id,...r.message}),e.transferList.push(...r.transferList)})),e}_addOverlap(t,e,s,i){const r=Math.min(_.CQ/2,s),n=Math.min(_.CQ/2,i),o=255^((t<0+r?148:t>=_.CQ-r?41:189)|(e<0+n?224:e>=_.CQ-n?7:231));this._currentRecordOverlaps|=o}_copyIntoNeighbors(){for(let t=0;t<8;t++){const e=1<<t;if(this._currentRecordOverlaps&e){if(this._copyBufferedDataIntoSelf){const t=-st(e)*_.CQ,s=-it(e)*_.CQ;if(0!==s)continue;this._meshes.self.copyLast(t,s);continue}if(!this._meshes.neighbors[t]){const s=Math.floor(this._sizeHint/16);this._meshes.neighbors[t]=new et(e,s)}const s=this._meshes.neighbors[t],i=-st(e)*_.CQ,r=-it(e)*_.CQ;s.copyLastFrom(this._meshes.self,i,r)}}}}class nt{}var ot=s(72691),at=s(73681);class ht{constructor(){this._defaultResult=null,this._backgroundFillResult=null}static async from(t,e){const s=new ht;return s.setDefault(await t.createMeshWriters(e.meshes)),s}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}getBackgroundFill(){return this._backgroundFillResult}setBackgroundFill(t){this._backgroundFillResult=t}hasArcadeDependency(t){return this._defaultResult?.some((e=>e.hasArcadeDependency(t)))??!1}match(t,e,s){const i=this.doMatch(t,e)||this.getDefault();if(i&&i.length>0){const t=this.getBackgroundFill();if(t)return[...t,...i]}return i}getSortKey(t,e){return 0}doMatch(t,e){return null}async fetchResources(t,e){}}class ct extends ht{static async fromDictionaryRenderer(t,e){const s=await at.n.from(e.dictionaryInfo,e.userConfig,e.fieldMap);return new ct(t,s)}constructor(t,e){super(),this._context=t,this._evaluator=e,this._controlStringToPromise=new Map,this._controlStringToGroup=new Map}async fetchResources(t,e){const s=e.getCursor(),i=new Set;for(;s.next();){const t=this._evaluateControlString(s);t&&i.add(t)}const r=Array.from(i.values()).map((e=>this._ensureGroup(t,e)));await Promise.all(r)}match(t,e){const s=this._evaluateControlString(t);return s?this._controlStringToGroup.get(s):null}_evaluateControlString(t){const e=t.readLegacyFeatureWorldSpace();return this._evaluator.evaluate(e,0,t.fields,null)}_ensureGroup(t,e){let s=this._controlStringToPromise.get(e);return null==s&&(s=this._fetchGroup(t,e),this._controlStringToPromise.set(e,s)),s}async _fetchGroup(t,e){const s=await t.fetchDictionaryResourceImmediate({type:"dictionary-request",controlString:e});if(!s)return;const i=await this._context.createMeshWriters(s.meshes);this._controlStringToGroup.set(e,i)}}class lt extends ht{constructor(t,e){super(),this._intervals=[],this._isMaxInclusive=e,this._field=t}static async fromIntervalSchema(t,e){const s=await t.storage.createComputedField(e),i=new lt(s,e.isMaxInclusive);await Promise.all(e.intervals.map((async e=>{const s=await t.createMeshWriters(e.meshes);i.add(e,s)})));const r=await t.createMeshWriters(e.defaultSymbol);i.setDefault(r);const n=await t.createMeshWriters(e.backgroundFill);return i.setBackgroundFill(n),i}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort(((t,e)=>t.interval.min-e.interval.min))}size(){return super.size()+this._intervals.length}hasArcadeDependency(t){return this._field?.hasArcadeDependency(t)||this._intervals.some((e=>e.result.some((e=>e.hasArcadeDependency(t)))))}doMatch(t,e){const s=this._field?.read(t,e);if(null==s||isNaN(s)||s===1/0||s===-1/0)return null;for(let t=0;t<this._intervals.length;t++){const{interval:e,result:i}=this._intervals[t],r=s>=e.min,n=this._isMaxInclusive?s<=e.max:s<e.max;if(r&&n)return i}return null}}class ut extends ht{static async fromLabelSchema(t,e){const s=e.classes.map((async e=>{const s=await t.createMeshWriters(e.meshes);return{minScale:e.minScale,maxScale:e.maxScale,meshes:s,expression:null,where:await t.storage.createWhereClause(e.where)}})),i=await Promise.all(s);return new ut(i)}constructor(t){super(),this._labels=t}match(t,e,s){if(!this._labels.length)return null;const i=this._getLabels(e.$view.scale),r=[];for(const e of i)e.where&&!e.where(t,s)||r.push(...e.meshes);return r}hasArcadeDependency(t){return this._labels.some((e=>e.meshes.some((e=>e.hasArcadeDependency(t)))))}_getLabels(t){return this._labels.filter((e=>this._validForTileScale(e,t)))}_validForTileScale(t,e){const s=e-e/4,i=e+e/2;return(!t.minScale||t.minScale>=s)&&(!t.maxScale||t.maxScale<=i)}}class dt extends ht{constructor(t,e){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=t,this._separator=e||""}static async fromMatcherSchema(t,e){const s=e.expression?[t.storage.createComputedField({expression:e.expression})]:[e.field?t.storage.createComputedField({field:e.field}):null,e.field2?t.storage.createComputedField({field:e.field2}):null,e.field3?t.storage.createComputedField({field:e.field3}):null],i=(await Promise.all(s)).filter((t=>!!t)),r=new dt(i,e.fieldDelimiter),n=await t.createMeshWriters(e.defaultSymbol);r.setDefault(n);const o=await t.createMeshWriters(e.backgroundFill);return r.setBackgroundFill(o),await Promise.all(e.map.map((async(e,s)=>{const i=await t.createMeshWriters(e.symbol);"<Null>"===e.value?r.setNullResult(i):r.add(e.value,i,s+1)}))),r}setNullResult(t){this._nullResult=t}getSortKey(t,e){const s=this._getValueFromFields(t,e);if(null==s||""===s||"<Null>"===s)return 0;const i=this._resultsMap.get(s.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(t,e,s){this._resultsMap.set(t.toString(),{meshWriters:e,sortKey:s}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,s+1)}size(){return super.size()+this._resultsMap.size}hasArcadeDependency(t){return this._fields.some((e=>e.hasArcadeDependency(t)))||[...this._resultsMap.values()].some((e=>e.meshWriters.some((e=>e.hasArcadeDependency(t)))))||this._nullResult?.some((e=>e.hasArcadeDependency(t)))||!1}doMatch(t,e){const s=this._getValueFromFields(t,e);if(null!==this._nullResult&&(null==s||""===s||"<Null>"===s))return this._nullResult;if(null==s)return null;const i=s.toString();return this._resultsMap.get(i)?.meshWriters}_getValueFromFields(t,e){const s=[];for(const i of this._fields){const r=i.read(t,e);null==r||""===r?s.push("<Null>"):s.push(r)}return s.join(this._separator)}}async function _t(t,e){switch(e.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return ht.from(t,e);case"interval":return lt.fromIntervalSchema(t,e);case"dictionary":return ct.fromDictionaryRenderer(t,e);case"label":return ut.fromLabelSchema(t,e);case"map":return dt.fromMatcherSchema(t,e);case"subtype":return pt.fromSubtypes(t,e);case"cluster":return ft.fromClusterSchema(t,e);case"track":return gt.fromTrackSchema(t,e);default:throw new Error("Impl")}}class pt extends ht{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e){const s=new Map,i=[];for(const r in e.renderers){const n=parseInt(r,10),o=_t(t,e.renderers[r]).then((t=>s.set(n,t)));i.push(o)}return await Promise.all(i),new pt(s,e.subtypeField)}match(t,e,s){const i=t.readAttribute(this._subtypeField),r=this._subMatchers.get(i);return r?r.match(t,e,s):null}hasArcadeDependency(t){for(const e of this._subMatchers.values())if(e.hasArcadeDependency(t))return!0;return!1}}class ft extends ht{static async fromClusterSchema(t,e){const[s,i]=await Promise.all([_t(t,e.feature),_t(t,e.cluster)]);return new ft(s,i)}constructor(t,e){super(),this._featureMatcher=t,this._clusterMatcher=e}match(t,e,s){return 1===t.readAttribute("cluster_count")?this._featureMatcher.match(t,e,s):this._clusterMatcher.match(t,e,s)}hasArcadeDependency(t){return this._featureMatcher.hasArcadeDependency(t)||this._clusterMatcher.hasArcadeDependency(t)}}class gt extends ht{static async fromTrackSchema(t,e){const[s,i,r]=await Promise.all([_t(t,e.previousObservation),_t(t,e.latestObservation),_t(t,e.trackLine)]);return new gt(s,i,r)}constructor(t,e,s){super(),this._previousObservationMatcher=t,this._latestObservationMatcher=e,this._trackLineMatcher=s}match(t,e,s){switch(t.readAttribute(ot.EA)){case ot.t0.TrackLine:return this._trackLineMatcher.match(t,e,s);case ot.t0.LatestObservation:return this._latestObservationMatcher.match(t,e,s);case ot.t0.PreviousObservation:return this._previousObservationMatcher.match(t,e,s)}return null}hasArcadeDependency(t){return this._trackLineMatcher.hasArcadeDependency(t)||this._latestObservationMatcher.hasArcadeDependency(t)||this._previousObservationMatcher.hasArcadeDependency(t)}}class mt extends nt{static async create(t,e){const s=await _t(t,e.symbology),i=e.labels?await _t(t,e.labels):null;return new mt(s,i)}constructor(t,e){super(),this._symbology=t,this._labels=e}destroy(){}async enqueueMatcherRequests(t,e){await Promise.all([this._symbology.fetchResources(t,e),this._labels?.fetchResources(t,e)])}enqueueWriterRequests(t,e,s,i){const r=this._symbology.match(e,s,i);if(r){for(const i of r)i.enqueueRequest(t,e,s);if(this._labels){const r=this._labels.match(e,s,i);if(!r)return;for(const i of r)i.enqueueRequest(t,e,s)}}}write(t,e,s,i,r,n){const o=this._symbology.match(s,i,r);if(o){for(const r of o)r.write(t,e,s,i,n);if(t.entityRecordCount()>=1&&this._labels){const a=this._labels.match(s,i,r);if(!a)return;for(const r of a)r.setReferences(o),r.write(t,e,s,i,n)}}}getSortKey(t,e){return this._symbology.getSortKey(t,e)}hasArcadeDependency(t){return!(!this._symbology.hasArcadeDependency(t)&&!this._labels?.hasArcadeDependency(t))}}var yt,xt,bt,wt=s(799);class vt{}class It extends vt{constructor(t){super(),this._fetcher=t,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(t){const e=function(t){return"url"in t&&"urlHash"in t?{...t,url:""}:t}(t.resource),s=(0,wt.Wm)(JSON.stringify(e));return this._pendingIds.has(s)||(this._pendingIds.add(s),this._pendingRequests.push({...t,resourceId:s})),s}async fetchEnqueuedResources(){const t=this._pendingRequests;if(this._pendingIds.clear(),this._pendingRequests=[],0===t.length)return;const e=await this._fetcher.fetch(t,this._abortOptions);for(let s=0;s<e.length;s++){const i=t[s].resourceId;this._resourceIdToResource.set(i,e[s])}}async fetchResourceImmediate(t){const e=await this._fetcher.fetch([t]);if(1!==e.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch resources");return e[0]}async fetchDictionaryResourceImmediate(t){const e=await this._fetcher.fetchDictionary([t]);if(1!==e.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch dictionary resources");return e[0]}getResource(t){return this._resourceIdToResource.get(t)}}(bt=yt||(yt={}))[bt.AnimatedMarker=0]="AnimatedMarker",bt[bt.AnimatedMarkerShift=1]="AnimatedMarkerShift",bt[bt.AnimatedFill=2]="AnimatedFill",bt[bt.AnimatedLine=3]="AnimatedLine",bt[bt.Blend=4]="Blend",bt[bt.ComplexFill=5]="ComplexFill",bt[bt.ComplexOutlineFill=6]="ComplexOutlineFill",bt[bt.DotDensity=7]="DotDensity",bt[bt.Fill=8]="Fill",bt[bt.GradientFill=9]="GradientFill",bt[bt.GradientStroke=10]="GradientStroke",bt[bt.Grid=11]="Grid",bt[bt.Heatmap=12]="Heatmap",bt[bt.Label=13]="Label",bt[bt.Line=14]="Line",bt[bt.Magnifier=15]="Magnifier",bt[bt.Marker=16]="Marker",bt[bt.OutlineFill=17]="OutlineFill",bt[bt.Overlay=18]="Overlay",bt[bt.PatternFill=19]="PatternFill",bt[bt.PatternOutlineFill=20]="PatternOutlineFill",bt[bt.PieChart=21]="PieChart",bt[bt.Test=22]="Test",bt[bt.Text=23]="Text",bt[bt.TexturedLine=24]="TexturedLine",bt[bt.Bitmap=25]="Bitmap",function(t){t[t.RasterColorizer=0]="RasterColorizer",t[t.RasterProcessor=1]="RasterProcessor",t[t.Aspect=2]="Aspect",t[t.BandArithmetic=3]="BandArithmetic",t[t.ColormapToRGB=4]="ColormapToRGB",t[t.CompositeBand=5]="CompositeBand",t[t.ComputeChange=6]="ComputeChange",t[t.ContrastBrightness=7]="ContrastBrightness",t[t.Convolution=8]="Convolution",t[t.Curvature=9]="Curvature",t[t.ExtractBand=10]="ExtractBand",t[t.Grayscale=11]="Grayscale",t[t.Hillshade=12]="Hillshade",t[t.Local=13]="Local",t[t.Mask=14]="Mask",t[t.NDVI=15]="NDVI",t[t.Remap=16]="Remap",t[t.Reproject=17]="Reproject",t[t.ShadedRelief=18]="ShadedRelief",t[t.Slope=19]="Slope",t[t.Statistics=20]="Statistics",t[t.Stretch=21]="Stretch"}(xt||(xt={}));var St=s(4718),Pt=s(51118),Mt=s(65864),At=s(92722);class Tt{static fromOptimized(t,e,s=!1,i=!1,r=1){return(new kt).initialize(t,e,s,i,r)}static fromJSON(t,e=!1,s=!1){const[i,r]=Ft(t);return(new Et).initialize(i,r,e,s,1)}static fromOptimizedCIM(t,e,s=!1,i=!1,r=1){return(new Ot).initialize(t,e,s,i,r)}static fromJSONCIM(t,e=!1,s=!1,i=1){const[r,n]=Ft(t);return(new zt).initialize(r,n,e,s,i)}static fromFeatureSetReader(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimized(e,s):null}static fromFeatureSetReaderCIM(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimizedCIM(e,s):null}static createEmptyOptimized(t,e=!1,s=!1,i=1){return(new kt).initialize(new At.A,t,e,s,i)}static createEmptyJSON(t,e=!1,s=!1){return(new Et).initialize([],t,e,s,1)}static createEmptyOptimizedCIM(t,e=!1,s=!1,i=1){return(new Ot).initialize(new At.A,t,e,s,i)}static createEmptyJSONCIM(t,e=!1,s=!1,i=1){return(new zt).initialize([],t,e,s,i)}asJSON(){const t=(0,Pt.x)(this);return"esriGeometryEnvelope"===this.geometryType?{xmin:t[0][0][0],ymin:t[0][0][1],xmax:t[0][2][0],ymax:t[0][2][1]}:"esriGeometryMultipoint"===this.geometryType?{points:t.flat()}:"esriGeometryPoint"===this.geometryType?{x:t[0][0][0],y:t[0][0][1]}:"esriGeometryPolygon"===this.geometryType?{rings:t}:{paths:t}}getCurrentRingArea(){if(this.pathSize<3)return 0;let t,e,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;t=this.x,e=this.y;const i=t,r=e;for(;this.nextPoint();)s+=(t-this.x)*(e+this.y),t=this.x,e=this.y;return s+=(t-i)*(e+r),-.5*s}invertY(){this.yFactor*=-1}}class kt extends Tt{constructor(){super(...arguments),this._end=-1}initialize(t,e,s,i,r){return this.hasZ=s,this.hasM=i,this.geometryType=e,this._stride=2+Number(s)+Number(i),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=r,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&t<this.totalSize){if(this._pathIndex<t)for(;this._pathIndex<t&&this.nextPath(););else if(this._pathIndex>t)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const e=this._pathOffset+t*this._stride;return e>=0&&e<this._end&&(this._pointOffset=e,!0)}nextPoint(){return(this._pointOffset+=this._stride)<this._end}prevPoint(){return(this._pointOffset-=this._stride)>=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1||(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,0))}prevPath(){return!(this.pathIndex<=0||(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,0))}getCurrentPath(){const t=this._end,e=this._geometry.coords,s=this._pathOffset;return(new kt).initialize(new At.A([this.pathSize],e.slice(s,t)),this.geometryType,this.hasZ,this.hasM,this.yFactor)}pathLength(){const t=this._end,e=this._stride,s=this._geometry.coords;let i=0;for(let r=this._pathOffset+e;r<t;r+=e){const t=s[r-e],n=s[r-e+1],o=s[r]-t,a=s[r+1]-n;i+=Math.sqrt(o*o+a*a)}return i}startPath(){this._geometry.lengths.push(0)}pushPath(t){this.startPath(),this.pushPoints(t)}pushPoint(t){for(let e=0;e<this._stride;++e)this._geometry.coords.push(t[e]);this._geometry.lengths[this.totalSize-1]++}pushXY(t,e){this._geometry.coords.push(t,e),this._geometry.lengths[this.totalSize-1]++}pushPoints(t){for(const e of t)for(let t=0;t<this._stride;++t)this._geometry.coords.push(e[t]);this._geometry.lengths[this.totalSize-1]+=t.length}pushCursor(t){const e=t.asOptimized();this._geometry.coords.push(...e.coords),this._geometry.lengths.push(...e.lengths)}asOptimized(){const t=this._geometry.clone();if(1!==this.yFactor)for(let e=1;e<t.coords.length;e+=this._stride)t.coords[e]*=this.yFactor;return"esriGeometryPoint"===this.geometryType&&(t.lengths.length=0),t}isClosed(){const t=this._geometry.coords,e=this._pathOffset,s=this._end-this._stride;for(let i=0;i<this._stride;i++)if(t[e+i]!==t[s+i])return!1;return!0}clone(){return(new kt).initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor)}get totalPoints(){return this._geometry.isPoint?1:this._geometry.lengths.reduce(((t,e)=>t+e))}get pathSize(){const{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}}function Ct(t){const e=[t.x,t.y];return t.z&&e.push(t.z),t.m&&e.push(t.m),e}function Ft(t){return(0,Mt.Bi)(t)?[t.rings,"esriGeometryPolygon"]:(0,Mt.Rg)(t)?[t.paths,"esriGeometryPolyline"]:(0,Mt.U9)(t)?[[t.points],"esriGeometryMultipoint"]:(0,Mt.ZC)(t)?[[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]],"esriGeometryEnvelope"]:(0,Mt.fT)(t)?[[[Ct(t)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}class Et extends Tt{initialize(t,e,s,i,r){return this._paths=t,this.geometryType=e,this.hasZ=s,this.hasM=i,this._pathIndex=this._pointIndex=-1,this.yFactor=r,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t<this.totalSize&&(this._currentPath=this._paths[t],!0)}seekPathStart(){this._pointIndex=-1}seekPathEnd(){this._pointIndex=this._currentPath.length}seekInPath(t){return t>=0&&t<this._currentPath.length&&(this._pointIndex=t,this._currentPoint=this._currentPath[this._pointIndex],!0)}nextPoint(){return this._currentPoint=this._currentPath[++this._pointIndex],this._pointIndex<this._currentPath.length}prevPoint(){return this._currentPoint=this._currentPath[--this._pointIndex],this._pointIndex>=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex<this.totalSize}prevPath(){return this.pathIndex>0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,e=this._currentPath;let s=0;for(let i=1;i<t;i++){const t=e[i-1],r=e[i],n=t[0],o=t[1],a=r[0]-n,h=r[1]-o;s+=Math.sqrt(a*a+h*h)}return s}startPath(){this._paths.push([])}getCurrentPath(){return(new Et).initialize([this._currentPath],this.geometryType,this.hasZ,this.hasM,this.yFactor)}pushPath(t){this._paths.push(t)}pushPoint(t){this._paths[this.totalSize-1].push(t)}pushXY(t,e){this._paths[this.totalSize-1].push([t,e])}pushPoints(t){this._paths[this.totalSize-1].push(...t)}pushCursor(t){const e=(0,Pt.x)(t);for(const t of e)this.pushPath(t)}asOptimized(){const t=new At.A;if("esriGeometryPoint"===this.geometryType)t.coords.push(...this._paths[0][0]),t.lengths.length=0;else for(const e of this._paths){for(const s of e)t.coords.push(s[0]),t.coords.push(s[1]*this.yFactor),this.hasZ&&t.coords.push(s[2]),this.hasM&&t.coords.push(s[this._mIndex]);t.lengths.push(e.length)}return t}isClosed(){const t=this._currentPath[0],e=this._currentPath[this._currentPath.length-1];for(let s=0;s<t.length;s++)if(t[s]!==e[s])return!1;return!0}clone(){return(new Et).initialize((0,St.o8)(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}get totalPoints(){return this._paths.map((t=>t.length)).reduce(((t,e)=>t+e))}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}}class Ot extends kt{initialize(t,e,s,i,r){return super.initialize(t,e,s,i,r),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map((t=>new Set))),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=(new Ot).initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}}class zt extends Et{initialize(t,e,s,i,r){return super.initialize(t,e,s,i,r)}clone(){return(new zt).initialize((0,St.o8)(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][4]=1}getControlPoint(){return 1===this._paths[this.pathIndex][this._pointIndex][4]}setControlPointAt(t){this._paths[this.pathIndex][t][4]=1}getControlPointAt(t){return 1===this._paths[this.pathIndex][t][4]}}var Rt=s(28076);const Lt=1024;Rt.D.CIMSolidStroke.capstyle,Rt.D.CIMSolidStroke.joinstyle,Rt.D.CIMSolidStroke.miterlimit;var Dt=s(15294);class Nt{static{this.instance=null}static local(){return null===Nt.instance&&(Nt.instance=new Nt),Nt.instance}execute(t,e,s,i){return new Gt(t,e)}}class Gt{constructor(t,e){this._inputGeometries=t,this._angleTolerance=void 0!==e.angleTolerance?e.angleTolerance:120,this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}next(){let t=this._inputGeometries.next();if(!t)return null;for(;t;){if("esriGeometryPolygon"===t.geometryType)this._isClosed=!0;else if("esriGeometryPolyline"===t.geometryType)this._isClosed=!1;else{if("esriGeometryEnvelope"!==t.geometryType){t=this._inputGeometries.next();continue}if(this._maxCosAngle)return t;this._isClosed=!0}for(;t.nextPath();)this._processPath(t);return t.reset(),t}return null}_processPath(t){if(t.nextPoint()){const e=t.x,s=t.y;let i=e,r=s,n=t.pathSize,o=0,a=0,h=0,c=0,l=0,u=0;this._isClosed&&++n;for(let d=1;t.nextPoint()||d<n;++d){let _,p;this._isClosed&&d===n-1?(_=e,p=s):(_=t.x,p=t.y);const f=_-i,g=p-r,m=Math.sqrt(f*f+g*g);d>1&&m>0&&h>0&&(o*f+a*g)/m/h<=this._maxCosAngle&&t.setControlPointAt(d-1),1===d&&(c=f,l=g,u=m),m>0&&(i=_,r=p,o=f,a=g,h=m)}this._isClosed&&h>0&&u>0&&(o*c+a*l)/u/h<=this._maxCosAngle&&t.setControlPointAt(0)}}}class Bt{constructor(){this.setIdentity()}getAngle(){return(null==this.rz||0===this.rz&&1!==this.rzCos&&0!==this.rzSin)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}}function qt(t,e){t[4]=e}class Wt{constructor(t,e=!0,s=!0,i=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!e&&"esriGeometryPolygon"===t.geometryType||!s&&"esriGeometryPolyline"===t.geometryType?null:t,this.geomUnitsPerPoint=i,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new Bt}next(){if(!this.geometryCursor)return null;const t=this.processMultiPath(this.geometryCursor);return this.iterateMultiPath&&t||(this.geometryCursor=null),t}processMultiPath(t){for(;this.iteratePath||t.pathIndex<t.totalSize-1;){this.iteratePath||t.nextPath(),this.iterateMultiPath=!0;const e=this.processPath(t);if(e)return e}return this.iterateMultiPath=!1,null}}class Yt{constructor(t,e,s,i=0){this.isClosed=!1,this.inputGeometries=t,this.acceptPolygon=e,this.acceptPolyline=s,this.geomUnitsPerPoint=i,this.iteratePath=!1,this.multiPathCursor=null}next(){for(;;){if(!this.multiPathCursor){let t=this.inputGeometries.next();for(;t&&(this.isClosed=this.acceptPolygon&&"esriGeometryPolygon"===t.geometryType||"esriGeometryEnvelope"===t.geometryType,this.multiPathCursor=t,!this.multiPathCursor);)t=this.inputGeometries.next();if(!this.multiPathCursor)return null}for(;this.iteratePath||this.multiPathCursor.nextPath();){this.multiPathCursor.seekPathStart();const t=this.processPath(this.multiPathCursor);if(t)return t}this.multiPathCursor=null}}}const Ut=.03;class jt{constructor(t=0,e=!1){}isEmpty(t){if(!t.nextPoint())return!0;let e,s,i,r;for(e=t.x,s=t.y;t.nextPoint();e=s,s=r)if(i=t.x,r=t.y,i!==e||r!==s)return t.seekPathStart(),!1;return t.seekPathStart(),!0}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);0!==e&&(t[0]/=e,t[1]/=e)}getLength(t,e,s,i){const r=s-t,n=i-e;return Math.sqrt(r*r+n*n)}getSegLength(t){const[[e,s],[i,r]]=t;return this.getLength(e,s,i,r)}getCoord2D(t,e,s,i,r){return[t+(s-t)*r,e+(i-e)*r]}getSegCoord2D(t,e){const[[s,i],[r,n]]=t;return this.getCoord2D(s,i,r,n,e)}getAngle(t,e,s,i,r){const n=s-t,o=i-e;return Math.atan2(o,n)}getAngleCS(t,e,s,i,r,n){null==t&&(t=[0,0]);const o=i-e,a=r-s,h=Math.sqrt(o*o+a*a);return 0!==h?(t[0]=o/h,t[1]=a/h,t):(t[0]=1,t[1]=0,t)}getSegAngleCS(t,e,s){const[[i,r],[n,o]]=e;return this.getAngleCS(t,i,r,n,o,s)}cut(t,e,s,i,r,n){return[r<=0?[t,e]:this.getCoord2D(t,e,s,i,r),n>=1?[s,i]:this.getCoord2D(t,e,s,i,n)]}getSubCurve(t,e,s){const i=Tt.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(i,t,e,s)?i:null}appendSubCurve(t,e,s,i){t.startPath(),e.seekPathStart();let r=0,n=!0;if(!e.nextPoint())return!1;let o=e.x,a=e.y;for(;e.nextPoint();){const h=this.getLength(o,a,e.x,e.y);if(0!==h){if(n){if(r+h>s){const c=(s-r)/h;let l=1,u=!1;r+h>=i&&(l=(i-r)/h,u=!0);const d=this.cut(o,a,e.x,e.y,c,l);if(d&&t.pushPoints(d),u)break;n=!1}}else{if(r+h>i){const s=this.cut(o,a,e.x,e.y,0,(i-r)/h);s&&t.pushPoint(s[1]);break}t.pushXY(e.x,e.y)}r+=h,o=e.x,a=e.y}else o=e.x,a=e.y}return!0}getCIMPointAlong(t,e){if(!t.nextPoint())return null;let s,i,r,n,o=0;for(s=t.x,i=t.y;t.nextPoint();s=r,i=n){r=t.x,n=t.y;const a=this.getLength(s,i,r,n);if(0!==a){if(o+a>e){const t=(e-o)/a;return this.getCoord2D(s,i,r,n,t)}o+=a}}return null}offset(t,e,s,i,r){if(!t||t.length<2)return null;let n=0,o=t[n++],a=n;for(;n<t.length;){const e=t[n];e[0]===o[0]&&e[1]===o[1]||(n!==a&&(t[a]=t[n]),o=t[a++]),n++}const h=t[0][0]===t[a-1][0]&&t[0][1]===t[a-1][1];if(h&&--a,a<(h?3:2))return null;const c=[];o=h?t[a-1]:null;let l=t[0];for(let r=0;r<a;r++){const n=r===a-1?h?t[0]:null:t[r+1];if(o)if(n){const t=[n[0]-l[0],n[1]-l[1]];this.normalize(t);const r=[l[0]-o[0],l[1]-o[1]];this.normalize(r);const a=r[0]*t[1]-r[1]*t[0],h=r[0]*t[0]+r[1]*t[1];if(0===a&&1===h){l=n;continue}if(a>=0==e<=0){if(h<1){const s=[t[0]-r[0],t[1]-r[1]];this.normalize(s);const n=Math.sqrt((1+h)/2);if(n>1/i){const t=-Math.abs(e)/n;c.push([l[0]-s[0]*t,l[1]-s[1]*t])}}}else switch(s){case Dt.xw.Mitered:{const s=Math.sqrt((1+h)/2);if(s>0&&1/s<i){const i=[t[0]-r[0],t[1]-r[1]];this.normalize(i);const n=Math.abs(e)/s;c.push([l[0]-i[0]*n,l[1]-i[1]*n]);break}}case Dt.xw.Bevelled:c.push([l[0]+r[1]*e,l[1]-r[0]*e]),c.push([l[0]+t[1]*e,l[1]-t[0]*e]);break;case Dt.xw.Rounded:if(h<1){c.push([l[0]+r[1]*e,l[1]-r[0]*e]);const s=Math.floor(2.5*(1-h));if(s>0){const i=1/s;let n=i;for(let o=1;o<s;o++,n+=i){const s=[r[1]*(1-n)+t[1]*n,-r[0]*(1-n)-t[0]*n];this.normalize(s),c.push([l[0]+s[0]*e,l[1]+s[1]*e])}}c.push([l[0]+t[1]*e,l[1]-t[0]*e])}break;case Dt.xw.Square:default:if(a<0)c.push([l[0]+(r[1]+r[0])*e,l[1]+(r[1]-r[0])*e]),c.push([l[0]+(t[1]-t[0])*e,l[1]-(t[0]+t[1])*e]);else{const s=Math.sqrt((1+Math.abs(h))/2),i=[t[0]-r[0],t[1]-r[1]];this.normalize(i);const n=e/s;c.push([l[0]-i[0]*n,l[1]-i[1]*n])}}}else{const t=[l[0]-o[0],l[1]-o[1]];this.normalize(t),c.push([l[0]+t[1]*e,l[1]-t[0]*e])}else{const t=[n[0]-l[0],n[1]-l[1]];this.normalize(t),c.push([l[0]+t[1]*e,l[1]-t[0]*e])}o=l,l=n}return c.length<(h?3:2)?null:(h&&c.push([c[0][0],c[0][1]]),c)}}const Vt=Dt.oF.OpenEnded;class Xt{static{this.instance=null}static local(){return null===Xt.instance&&(Xt.instance=new Xt),Xt.instance}execute(t,e,s,i,r){return new Ht(t,e,s)}}class Ht extends Yt{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new jt,this._width=(void 0!==e.width?e.width:5)*s,this._arrowType=void 0!==e.geometricEffectArrowType?e.geometricEffectArrowType:void 0!==e.arrowType?e.arrowType:Vt,this._offsetFlattenError=Ut*s}processPath(t){const e=Tt.createEmptyOptimizedCIM(t.geometryType);switch(this._arrowType){case Dt.oF.OpenEnded:default:this._constructSimpleArrow(e,t,!0);break;case Dt.oF.Block:this._constructSimpleArrow(e,t,!1);break;case Dt.oF.Crossed:this._constructCrossedArrow(e,t)}return e}_constructSimpleArrow(t,e,s){const i=e.pathLength();let r=this._width;i<2*r&&(r=i/2);const n=this._curveHelper.getSubCurve(e,0,i-r);if(!n||!n.nextPath())return;n.seekPathStart();const o=r/2;if(this._curveHelper.isEmpty(n))return;const a=(0,Pt.A)(n),h=this._constructOffset(a,-o);if(!h)return;const c=this._constructOffset(a,o);if(!c)return;const l=this._constructArrowBasePoint(h,-o/2);if(!l)return;const u=this._constructArrowBasePoint(c,o/2);if(!u)return;e.seekInPath(e.pathSize-1);const d=[e.x,e.y];t.pushPath(c),t.nextPath(),t.nextPoint(),t.setControlPoint(),t.pushPoint(u),t.nextPoint(),t.setControlPoint(),t.pushPoint(d),t.nextPoint(),t.setControlPoint(),t.pushPoint(l),t.nextPoint(),t.setControlPoint(),t.pushPoints(h.reverse()),t.setControlPoint(),s||(t.setControlPointAt(0),t.setControlPointAt(t.pathSize-1),t.pushPoint(c[0])),t.reset()}_constructCrossedArrow(t,e){const s=e.pathLength();let i=this._width;s<3.732050807568877*i&&(i=s/3.732050807568877),e.seekPathStart();const r=this._curveHelper.getSubCurve(e,0,s-2.732050807568877*i);if(!r)return;r.nextPath();const n=i/2;if(this._curveHelper.isEmpty(r))return;const o=(0,Pt.A)(r),a=this._constructOffset(o,n);if(!a)return;const h=this._constructOffset(o,-n);if(!h)return;const c=this._curveHelper.getSubCurve(e,0,s-i);if(!c)return;if(c.nextPath(),this._curveHelper.isEmpty(c))return;const l=(0,Pt.A)(c),u=this._constructOffset(l,n);if(!u)return;const d=this._constructOffset(l,-n);if(!d)return;const _=u[u.length-1],p=this._constructArrowBasePoint(u,n/2);if(!p)return;const f=d[d.length-1],g=this._constructArrowBasePoint(d,-n/2);if(!g)return;e.seekInPath(e.pathSize-1);const m=[e.x,e.y];t.pushPath(a),t.nextPath(),t.nextPoint(),t.setControlPoint(),t.pushPoint(f),t.nextPoint(),t.setControlPoint(),t.pushPoint(g),t.nextPoint(),t.setControlPoint(),t.pushPoint(m),t.nextPoint(),t.setControlPoint(),t.pushPoint(p),t.nextPoint(),t.setControlPoint(),t.pushPoint(_),t.nextPoint(),t.setControlPoint(),t.pushPoints(h.reverse()),t.nextPoint(),t.setControlPoint(),t.reset()}_constructOffset(t,e){return this._curveHelper.offset(t,e,Dt.xw.Rounded,4,this._offsetFlattenError)}_constructArrowBasePoint(t,e){if(!t||t.length<2)return null;const s=t[t.length-2],i=t[t.length-1],r=[i[0]-s[0],i[1]-s[1]];return this._curveHelper.normalize(r),[i[0]+r[1]*e,i[1]-r[0]*e]}}var Qt=s(6774);let Zt;class $t{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}}function Jt(t,e,s){if(!t)return null;Zt||(Zt=new Qt.O3(0,0,0,1));const i=s?-1:1,r="esriGeometryPolygon"===t.geometryType,n=r?Qt.dC.Polygon:Qt.dC.LineString,o=r?3:2;let a,h;for(Zt.reset(n),Zt.setPixelMargin(e+1),Zt.setExtent(512);t.nextPath();)if(!(t.pathSize<o)){for(t.nextPoint(),a=t.x,h=i*t.y,Zt.moveTo(a,h);t.nextPoint();)a=t.x,h=i*t.y,Zt.lineTo(a,h);r&&Zt.close()}const c=Zt.result(!1);if(c){const e=Tt.createEmptyOptimizedCIM(t.geometryType);for(const t of c){e.startPath();for(const s of t)e.pushXY(s.x,i*s.y)}return e.reset(),e}return null}class Kt{static{this.instance=null}static local(){return null===Kt.instance&&(Kt.instance=new Kt),Kt.instance}execute(t,e,s,i,r,n,o){return new te(t,e,s,i,r,n,o)}}class te{constructor(t,e,s,i,r,n,o){this._preventClipping=o,this._inputGeometries=t,this._tileKey=i,this._geometryEngine=r,this._curveHelper=new jt,this._size=(void 0!==e.size?e.size:1)*s,this._maxInflateSize=n*s,this._offsetFlattenError=Ut*s}next(){let t;for(;t=this._inputGeometries.next();){if(0===this._size)return t;if("esriGeometryEnvelope"===t.geometryType)if(this._size>0){const e=Tt.createEmptyOptimizedCIM(t.geometryType),s=(0,Pt.x)(t)[0],i=this._curveHelper.offset(s,this._size,Dt.xw.Rounded,4,this._offsetFlattenError);if(i)return e.pushPath(i),e}else if(this._size<0){const e=t.asJSON();if(Math.min(e.xmax-e.xmin,e.ymax-e.ymin)+2*this._size>0)return Tt.fromJSONCIM({xmin:e.xmin-this._size,xmax:e.xmax+this._size,ymin:e.ymin-this._size,ymax:e.ymax+this._size})}const e=this._geometryEngine;if(null==e)return null;const s=!this._preventClipping&&this._tileKey?Jt(t,this._maxInflateSize,!0):t;if(!s)continue;const i=e.buffer(y.A.WebMercator,s.asJSON(),this._size,1);return i?Tt.fromJSONCIM(i):null}return null}}var ee,se,ie=s(95108);class re{static{this.instance=null}static local(){return null===re.instance&&(re.instance=new re),re.instance}execute(t,e,s,i,r){return new ne(t,e,s)}}class ne{constructor(t,e,s){this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=s,this._rule=e.rule??Dt.uQ.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let t;for(;t=this._inputGeometries.next();){const e=this._processGeom((0,Pt.x)(t));if(e?.length)return Tt.fromJSONCIM({paths:e})}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,s,i){return[t[0]*e+s[0]*i,t[1]*e+s[1]*i]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,s){return[t[0]+e,t[1]+s]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const s=e/this._norm(t);t[0]*=s,t[1]*=s}_leftPerpendicular(t){const e=-t[1],s=t[0];t[0]=e,t[1]=s}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],s=-t[0];t[0]=e,t[1]=s}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,s){const i=t[0]*e-t[1]*s,r=t[0]*s+t[1]*e;t[0]=i,t[1]=r}_makeCtrlPt(t){const e=[t[0],t[1]];return qt(e,1),e}_addAngledTicks(t,e,s,i){const r=this._sub(s,e);this._normalize(r);const n=this._crossProduct(r,this._sub(i,e));let o;o=n>0?this._rightPerp(r):this._leftPerp(r);const a=Math.abs(n)/2,h=[];h.push([e[0]+(o[0]-r[0])*a,e[1]+(o[1]-r[1])*a]),h.push(e),h.push(s),h.push([s[0]+(o[0]+r[0])*a,s[1]+(o[1]+r[1])*a]),t.push(h)}_addBezier2(t,e,s,i,r){if(0===r--)return void t.push(i);const n=this._mid(e,s),o=this._mid(s,i),a=this._mid(n,o);this._addBezier2(t,e,n,a,r),this._addBezier2(t,a,o,i,r)}_addBezier3(t,e,s,i,r,n){if(0===n--)return void t.push(r);const o=this._mid(e,s),a=this._mid(s,i),h=this._mid(i,r),c=this._mid(o,a),l=this._mid(a,h),u=this._mid(c,l);this._addBezier3(t,e,o,c,u,n),this._addBezier3(t,u,l,h,r,n)}_add90DegArc(t,e,s,i,r){const n=r??this._crossProduct(this._sub(s,e),this._sub(i,e))>0,o=this._mid(e,s),a=this._sub(o,e);n?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(t,e,this._mix(e,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(t,e,s){const i=e[0],r=e[1],n=e[e.length-1],o=this._sub(i,r),a=this._norm(o);this._normalize(o);const h=Math.abs(this._crossProduct(o,this._sub(n,r)));let c=this._dotProduct(o,this._sub(n,r));c<.05*a?c=.05*a:c>.95*a&&(c=.95*a);const l=.5*h,u=this._leftPerp(o),d=[r[0]+o[0]*c,r[1]+o[1]*c],_=e.length-1,p=[];p.push(s?[-u[0],-u[1]]:u);let f=[-o[0],-o[1]];for(let t=1;t<_-1;t++){const s=this._sub(e[t+1],e[t]);this._normalize(s);const i=this._dotProduct(s,f),r=this._crossProduct(s,f),n=Math.sqrt((1+i)/2),o=this._sub(s,f);this._normalize(o),o[0]/=n,o[1]/=n,p.push(r<0?[-o[0],-o[1]]:o),f=s}p.push(this._rightPerp(f));for(let s=p.length-1;s>0;s--)t.push([e[s][0]+p[s][0]*l,e[s][1]+p[s][1]*l]);t.push([d[0]+p[0][0]*l,d[1]+p[0][1]*l]),t.push([d[0]+p[0][0]*h,d[1]+p[0][1]*h]),t.push(i),t.push([d[0]-p[0][0]*h,d[1]-p[0][1]*h]),t.push([d[0]-p[0][0]*l,d[1]-p[0][1]*l]);for(let s=1;s<p.length;s++)t.push([e[s][0]-p[s][0]*l,e[s][1]-p[s][1]*l])}_addDash(t,e,s){const i=this._norm(s)/7;this._normalize(s);let r=[];for(let n=0;n<=7;n++)r.push([e[0]+s[0]*n*i,e[1]+s[1]*n*i]),1&n&&(t.push(r),r=[])}_cp2(t,e,s){return t.length>=2?t[1]:this._add2(t[0],e*this._defaultSize,s*this._defaultSize)}_cp3(t,e,s,i){if(t.length>=3)return t[2];const r=this._mix(t[0],1-s,e,s),n=this._sub(e,t[0]);return this._normalize(n),this._rightPerpendicular(n),[r[0]+n[0]*i*this._defaultSize,r[1]+n[1]*i*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],s=this._cp2(t,-4,0),i=this._sub(e,s);this._normalize(i);const r=this._rightPerp(i);return[e,s,[e[0]+(r[0]-i[0])*this._defaultSize,e[1]+(r[1]-i[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],s=this._cp2(t,-4,0);let i;if(t.length>=3)i=t[t.length-1];else{const t=this._sub(e,s);this._normalize(t);const r=this._rightPerp(t);i=[e[0]+(r[0]-t[0])*this._defaultSize,e[1]+(r[1]-t[1])*this._defaultSize]}return[s,i]}_processGeom(t){if(!t)return null;const e=[];for(const s of t){const t=s.length>1&&(0,ie.Yl)(s)<this._defaultSize;if(!s||0===s.length||t)continue;const i=s.length;let r=s[0];switch(this._rule){case Dt.uQ.PerpendicularFromFirstSegment:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,.5,4),n=[];n.push(i),n.push(this._mid(r,t)),e.push(n);break}case Dt.uQ.ReversedFirstSegment:{const t=this._cp2(s,0,-1);e.push([t,r]);break}case Dt.uQ.PerpendicularToSecondSegment:{if(s.length<3)return[];const t=this._cp2(s,-4,1),i=this._cp3(s,t,.882353,-1.94),n=[];n.push(this._mid(t,i)),n.push(r),e.push(n);break}case Dt.uQ.SecondSegmentWithTicks:{if(s.length<3)return[];const t=this._cp2(s,-4,1),i=this._cp3(s,t,.882353,-1.94),n=this._sub(i,t);let o;o=this._crossProduct(n,this._sub(r,t))>0?this._rightPerp(n):this._leftPerp(n);const a=[];a.push([t[0]+(o[0]-n[0])/3,t[1]+(o[1]-n[1])/3]),a.push(t),a.push(i),a.push([i[0]+(o[0]+n[0])/3,i[1]+(o[1]+n[1])/3]),e.push(a);break}case Dt.uQ.DoublePerpendicular:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,.5,3),n=this._mid(r,t),o=this._sub(n,i);this._normalize(o);const a=this._crossProduct(o,this._sub(r,i));this._leftPerpendicular(o);const h=[];h.push(r),h.push([i[0]+o[0]*a,i[1]+o[1]*a]),e.push(h);const c=[];c.push([i[0]-o[0]*a,i[1]-o[1]*a]),c.push(t),e.push(c);break}case Dt.uQ.OppositeToFirstSegment:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,.5,3),n=this._mid(r,t),o=this._sub(n,i);this._normalize(o);const a=this._crossProduct(o,this._sub(r,i));this._leftPerpendicular(o);const h=[];h.push([i[0]+o[0]*a,i[1]+o[1]*a]),h.push([i[0]-o[0]*a,i[1]-o[1]*a]),e.push(h);break}case Dt.uQ.TriplePerpendicular:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,.5,4),n=this._mid(r,t),o=this._sub(n,i);this._normalize(o);const a=this._crossProduct(o,this._sub(r,i));this._leftPerpendicular(o);const h=[];h.push([i[0]+o[0]*a*.8,i[1]+o[1]*a*.8]),h.push([n[0]+.8*(r[0]-n[0]),n[1]+.8*(r[1]-n[1])]),e.push(h),e.push([i,n]);const c=[];c.push([i[0]-o[0]*a*.8,i[1]-o[1]*a*.8]),c.push([n[0]+.8*(t[0]-n[0]),n[1]+.8*(t[1]-n[1])]),e.push(c);break}case Dt.uQ.HalfCircleFirstSegment:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,.5,4),n=this._mid(r,t);let o=this._sub(t,r);const a=Math.cos(Math.PI/18),h=Math.sin(Math.PI/18),c=Math.sqrt((1+a)/2),l=Math.sqrt((1-a)/2),u=[];let d;this._crossProduct(o,this._sub(i,r))>0?(u.push(r),o=this._sub(r,n),d=t):(u.push(t),o=this._sub(t,n),d=r),this._rotateDirect(o,c,l),o[0]/=c,o[1]/=c;for(let t=1;t<=18;t++)u.push(this._add(n,o)),this._rotateDirect(o,a,h);u.push(d),e.push(u);break}case Dt.uQ.HalfCircleSecondSegment:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,1,-1);let n=this._sub(r,t);this._normalize(n);const o=this._crossProduct(n,this._sub(i,t))/2;this._leftPerpendicular(n);const a=[t[0]+n[0]*o,t[1]+n[1]*o];n=this._sub(t,a);const h=Math.cos(Math.PI/18);let c=Math.sin(Math.PI/18);o>0&&(c=-c);const l=[t];for(let t=1;t<=18;t++)this._rotateDirect(n,h,c),l.push(this._add(a,n));e.push(l);break}case Dt.uQ.HalfCircleExtended:{const t=this._cp2(s,0,-2),n=this._cp3(s,t,1,-1);let o;if(i>=4)o=s[3];else{const e=this._sub(r,t);o=this._add(n,e)}const a=this._dist(t,n)/2/.75,h=this._sub(t,r);this._normalize(h,a);const c=this._sub(n,o);this._normalize(c,a);const l=[o,n];e.push(l);const u=[this._clone(n)];this._addBezier3(u,n,this._add(n,c),this._add(t,h),t,4),u.push(r),e.push(u);break}case Dt.uQ.OpenCircle:{const t=this._cp2(s,-2,0),i=this._sub(t,r),n=Math.cos(Math.PI/18),o=-Math.sin(Math.PI/18),a=[t];for(let t=1;t<=33;t++)this._rotateDirect(i,n,o),a.push(this._add(r,i));e.push(a);break}case Dt.uQ.CoverageEdgesWithTicks:{const t=this._cp2(s,0,-1);let n,o;if(i>=3)n=s[2];else{const e=this._sub(t,r),s=this._leftPerp(e);n=[r[0]+s[0]-.25*e[0],r[1]+s[1]-.25*e[1]]}if(i>=4)o=s[3];else{const e=this._mid(r,t),s=this._sub(r,t);this._normalize(s),this._leftPerpendicular(s);const i=this._crossProduct(s,this._sub(n,e));this._rightPerpendicular(s),o=[n[0]+s[0]*i*2,n[1]+s[1]*i*2]}const a=this._sub(t,r);let h,c;h=this._crossProduct(a,this._sub(n,r))>0?this._rightPerp(a):this._leftPerp(a),c=[],c.push(n),c.push(r),c.push([r[0]+(h[0]-a[0])/3,r[1]+(h[1]-a[1])/3]),e.push(c),h=this._crossProduct(a,this._sub(o,t))>0?this._rightPerp(a):this._leftPerp(a),c=[],c.push([t[0]+(h[0]+a[0])/3,t[1]+(h[1]+a[1])/3]),c.push(t),c.push(o),e.push(c);break}case Dt.uQ.GapExtentWithDoubleTicks:{const t=this._cp2(s,0,2),n=this._cp3(s,t,0,1);let o;if(i>=4)o=s[3];else{const e=this._sub(t,r);o=this._add(n,e)}this._addAngledTicks(e,r,t,this._mid(n,o)),this._addAngledTicks(e,n,o,this._mid(r,t));break}case Dt.uQ.GapExtentMidline:{const t=this._cp2(s,2,0),n=this._cp3(s,t,0,1);let o;if(i>=4)o=s[3];else{const e=this._sub(t,r);o=this._add(n,e)}const a=[];a.push(this._mid(r,n)),a.push(this._mid(t,o)),e.push(a);break}case Dt.uQ.Chevron:{const t=this._cp2(s,-1,-1);let n;if(i>=3)n=s[2];else{const e=this._sub(t,r);this._leftPerpendicular(e),n=this._add(r,e)}e.push([t,this._makeCtrlPt(r),n]);break}case Dt.uQ.PerpendicularWithArc:{const t=this._cp2(s,0,-2),n=this._cp3(s,t,.5,-1),o=this._sub(t,r),a=this._norm(o);o[0]/=a,o[1]/=a;const h=this._crossProduct(o,this._sub(n,r));let c=this._dotProduct(o,this._sub(n,r));c<.05*a?c=.05*a:c>.95*a&&(c=.95*a);const l=[r[0]+o[0]*c,r[1]+o[1]*c];let u=this._leftPerp(o),d=[];if(d.push([l[0]-u[0]*h,l[1]-u[1]*h]),d.push([l[0]+u[0]*h,l[1]+u[1]*h]),e.push(d),i>=4){const t=s[3];let i=this._dotProduct(o,this._sub(t,r));i<.1*a?i=.1*a:i>.9*a&&(i=.9*a);const n=[r[0]+o[0]*i,r[1]+o[1]*i],h=this._crossProduct(o,this._sub(t,r)),c=[];c.push([n[0]-u[0]*h,n[1]-u[1]*h]),c.push([n[0]+u[0]*h,n[1]+u[1]*h]),e.push(c)}const _=[t[0]+u[0]*h,t[1]+u[1]*h];u=this._sub(t,_);const p=Math.cos(Math.PI/18);let f=Math.sin(Math.PI/18);h<0&&(f=-f),d=[r,t];for(let t=1;t<=9;t++)this._rotateDirect(u,p,f),d.push(this._add(_,u));e.push(d);break}case Dt.uQ.ClosedHalfCircle:{const t=this._cp2(s,2,0),i=this._mid(r,t),n=this._sub(t,i),o=Math.cos(Math.PI/18),a=Math.sin(Math.PI/18),h=[r,t];for(let t=1;t<=18;t++)this._rotateDirect(n,o,a),h.push(this._add(i,n));e.push(h);break}case Dt.uQ.TripleParallelExtended:{const t=this._cp2(s,0,-2),i=this._cp3(s,t,1,-2),n=this._mid(r,t),o=this._sub(i,t);this._normalize(o);const a=Math.abs(this._crossProduct(o,this._sub(n,t)))/2,h=this._dist(t,i),c=[t,r];c.push([r[0]+o[0]*h*.5,r[1]+o[1]*h*.5]),e.push(c);const l=[];l.push([n[0]-o[0]*a,n[1]-o[1]*a]),l.push([n[0]+o[0]*h*.375,n[1]+o[1]*h*.375]),qt(l[l.length-1],1),l.push([n[0]+o[0]*h*.75,n[1]+o[1]*h*.75]),e.push(l);const u=[t,i];e.push(u);break}case Dt.uQ.ParallelWithTicks:{const t=this._cp2(s,3,0),i=this._cp3(s,t,.5,-1),n=this._sub(i,t);this._normalize(n);const o=this._crossProduct(n,this._sub(i,r));this._leftPerpendicular(n),this._addAngledTicks(e,r,t,i),this._addAngledTicks(e,this._mix(r,1,n,o),this._mix(t,1,n,o),this._mid(r,t));break}case Dt.uQ.Parallel:{const t=this._cp2(s,3,0),i=this._cp3(s,t,.5,-1),n=this._sub(t,r);this._normalize(n);const o=this._leftPerp(n),a=this._crossProduct(n,this._sub(i,r));let h=[r,t];e.push(h),h=[],h.push([r[0]+o[0]*a,r[1]+o[1]*a]),h.push([t[0]+o[0]*a,t[1]+o[1]*a]),e.push(h);break}case Dt.uQ.PerpendicularToFirstSegment:{const t=this._cp2(s,3,0),i=this._cp3(s,t,.5,-1),n=this._mid(r,t),o=this._sub(t,r);this._normalize(o);const a=this._crossProduct(o,this._sub(i,r));this._leftPerpendicular(o);const h=[];h.push([n[0]-o[0]*a*.25,n[1]-o[1]*a*.25]),h.push([n[0]+o[0]*a*1.25,n[1]+o[1]*a*1.25]),e.push(h);break}case Dt.uQ.ParallelOffset:{const t=this._cp2(s,3,0),i=this._cp3(s,t,.5,-1),n=this._sub(t,r);this._normalize(n);const o=this._crossProduct(n,this._sub(i,r));this._leftPerpendicular(n);const a=[];a.push([r[0]-n[0]*o,r[1]-n[1]*o]),a.push([t[0]-n[0]*o,t[1]-n[1]*o]),e.push(a);const h=[];h.push([r[0]+n[0]*o,r[1]+n[1]*o]),h.push([t[0]+n[0]*o,t[1]+n[1]*o]),e.push(h);break}case Dt.uQ.OffsetOpposite:{const t=this._cp2(s,3,0),i=this._cp3(s,t,.5,-1),n=this._sub(t,r);this._normalize(n);const o=this._crossProduct(n,this._sub(i,r));this._leftPerpendicular(n);const a=[];a.push([r[0]-n[0]*o,r[1]-n[1]*o]),a.push([t[0]-n[0]*o,t[1]-n[1]*o]),e.push(a);break}case Dt.uQ.OffsetSame:{const t=this._cp2(s,3,0),i=this._cp3(s,t,.5,-1),n=this._sub(t,r);this._normalize(n);const o=this._crossProduct(n,this._sub(i,r));this._leftPerpendicular(n);const a=[];a.push([r[0]+n[0]*o,r[1]+n[1]*o]),a.push([t[0]+n[0]*o,t[1]+n[1]*o]),e.push(a);break}case Dt.uQ.CircleWithArc:{let t=this._cp2(s,3,0);const n=this._cp3(s,t,.5,-1);let o,a;if(i>=4)o=s[3],a=this._crossProduct(this._sub(o,t),this._sub(n,t))>0;else{o=t,a=this._crossProduct(this._sub(o,r),this._sub(n,r))>0;const e=24*this._geomUnitsPerPoint,s=this._sub(o,r);this._normalize(s,e);const i=Math.sqrt(2)/2;this._rotateDirect(s,i,a?i:-i),t=this._add(r,s)}const h=this._sub(t,r),c=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18),u=[t];for(let t=1;t<=36;t++)this._rotateDirect(h,c,l),u.push(this._add(r,h));this._add90DegArc(u,t,o,n,a),qt(u[u.length-8],1),e.push(u);break}case Dt.uQ.DoubleJog:{let t,n=this._cp2(s,-3,1),o=this._cp3(s,n,-1,-.5);if(i>=4)t=s[3];else{const e=r;r=n,t=o;const s=this._dist(r,e),i=this._dist(t,e);let a=30*this._geomUnitsPerPoint;.5*s<a&&(a=.5*s),.5*i<a&&(a=.5*i),n=this._mix(r,a/s,e,(s-a)/s),o=this._mix(t,a/i,e,(i-a)/i)}const a=this._mid(r,n),h=this._mid(t,o),c=this._dist(r,n),l=this._dist(o,t);let u=Math.min(c,l)/8;u=Math.min(u,24*this._geomUnitsPerPoint);const d=Math.cos(Math.PI/4);let _=this._sub(r,n);this._normalize(_,u),this._crossProduct(_,this._sub(t,n))>0?this._rotateDirect(_,d,-d):this._rotateDirect(_,d,d);let p=[];p.push(n),p.push(this._add(a,_)),p.push(this._sub(a,_)),p.push(r),e.push(p),_=this._sub(t,o),this._normalize(_,u),this._crossProduct(_,this._sub(r,o))<0?this._rotateDirect(_,d,d):this._rotateDirect(_,d,-d),p=[],p.push(o),p.push(this._add(h,_)),p.push(this._sub(h,_)),p.push(t),e.push(p);break}case Dt.uQ.PerpendicularOffset:{const t=this._cp2(s,-4,1),i=this._cp3(s,t,.882353,-1.94),n=this._sub(i,t);this._crossProduct(n,this._sub(r,t))>0?this._rightPerpendicular(n):this._leftPerpendicular(n);const o=[n[0]/8,n[1]/8],a=this._sub(this._mid(t,i),o);e.push([a,r]);break}case Dt.uQ.LineExcludingLastSegment:{const t=this._arrowPath(s),i=[];let r=t.length-2;for(;r--;)i.push(t[r]);e.push(i);break}case Dt.uQ.MultivertexArrow:{const t=this._arrowPath(s),i=[];this._addArrow(i,t,!1),e.push(i);break}case Dt.uQ.CrossedArrow:{const t=this._arrowPath(s),i=[];this._addArrow(i,t,!0),e.push(i);break}case Dt.uQ.ChevronArrow:{const[t,i]=this._arrowLastSeg(s),n=10*this._geomUnitsPerPoint,o=this._sub(r,t),a=this._norm(o);this._normalize(o);const h=this._crossProduct(o,this._sub(i,t));let c=this._dotProduct(o,this._sub(i,t));c<.05*a?c=.05*a:c>.95*a-n&&(c=.95*a-n);const l=[t[0]+o[0]*c,t[1]+o[1]*c],u=this._leftPerp(o),d=[];d.push([l[0]+u[0]*h+o[0]*n,l[1]+u[1]*h+o[1]*n]),d.push(r),d.push([l[0]-u[0]*h+o[0]*n,l[1]-u[1]*h+o[1]*n]),e.push(d);break}case Dt.uQ.ChevronArrowOffset:{const[t,i]=this._arrowLastSeg(s),n=this._sub(r,t),o=this._norm(n);this._normalize(n);const a=this._crossProduct(n,this._sub(i,t));let h=this._dotProduct(n,this._sub(i,t));h<.05*o?h=.05*o:h>.95*o&&(h=.95*o);const c=[t[0]+n[0]*h,t[1]+n[1]*h];this._leftPerpendicular(n);const l=[];l.push([c[0]+n[0]*a*.5,c[1]+n[1]*a*.5]),l.push(this._mid(c,r)),l.push([c[0]-n[0]*a*.5,c[1]-n[1]*a*.5]),e.push(l);break}case Dt.uQ.PartialFirstSegment:{const[t,i]=this._arrowLastSeg(s),n=this._sub(r,t),o=this._norm(n);this._normalize(n);let a=this._dotProduct(n,this._sub(i,t));a<.05*o?a=.05*o:a>.95*o&&(a=.95*o);const h=[t[0]+n[0]*a,t[1]+n[1]*a];e.push([t,h]);break}case Dt.uQ.Arch:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,.5,1),n=this._sub(r,t),o=this._mix(i,1,n,.55),a=this._mix(i,1,n,-.55),h=[r];this._addBezier2(h,r,o,i,4),this._addBezier2(h,i,a,t,4),e.push(h);break}case Dt.uQ.CurvedParallelTicks:{const t=this._cp2(s,-4,1),i=this._cp3(s,t,.882353,-1.94),n=this._sub(i,t);this._crossProduct(n,this._sub(r,t))>0?this._rightPerpendicular(n):this._leftPerpendicular(n);const o=[n[0]/8,n[1]/8],a=this._sub(this._mid(t,i),o),h=this._sub(this._mix(t,.75,i,.25),o),c=this._sub(this._mix(t,.25,i,.75),o),l=[t];this._addBezier2(l,t,h,a,3),this._addBezier2(l,a,c,i,3),e.push(l);for(let t=0;t<8;t++){const s=l[2*t+1],i=[this._clone(s)];i.push(this._add(s,[n[0]/4,n[1]/4])),e.push(i)}break}case Dt.uQ.Arc90Degrees:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,.5,1),n=[t];this._add90DegArc(n,t,r,i),e.push(n);break}case Dt.uQ.TipWithPerpendicularAndTicks:{const[t,i]=this._arrowLastSeg(s),n=10*this._geomUnitsPerPoint,o=this._sub(r,t),a=this._norm(o);this._normalize(o);let h=this._crossProduct(o,this._sub(i,t)),c=this._dotProduct(o,this._sub(i,t));c<.05*a?c=.05*a:c>.95*a-n&&(c=.95*a-n);const l=this._leftPerp(o),u=[r[0]-o[0]*n,r[1]-o[1]*n],d=.5*Math.max(a-c-n,n);h=Math.abs(h);const _=[];_.push([u[0]+l[0]*(h+d)-o[0]*d,u[1]+l[1]*(h+d)-o[1]*d]),_.push([u[0]+l[0]*h,u[1]+l[1]*h]),_.push([u[0]-l[0]*h,u[1]-l[1]*h]),_.push([u[0]-l[0]*(h+d)-o[0]*d,u[1]-l[1]*(h+d)-o[1]*d]),e.push(_),e.push([u,r]);break}case Dt.uQ.ConcentricCircles:{const t=this._cp2(s,1,0),n=this._cp3(s,t,2,0),o=Math.cos(Math.PI/18),a=Math.sin(Math.PI/18);let h=this._dist(t,r),c=[h,0],l=[];for(let t=0;t<=36;t++)l.push(this._add(r,c)),this._rotateDirect(c,o,a);if(e.push(l),i>=4){l=[];const t=s[3];h=this._dist(t,r),c=[h,0];for(let t=0;t<=36;t++)l.push(this._add(r,c)),0===t&&(l.push(this._add(r,c)),qt(l[1],1)),this._rotateDirect(c,o,a);e.push(l)}l=[],h=this._dist(n,r),c=[h,0];for(let t=0;t<=36;t++)l.push(this._add(r,c)),this._rotateDirect(c,o,a);e.push(l);break}case Dt.uQ.DoubleJogArrow:{r=this._arrowPath(s)[0];const[t,i]=this._arrowLastSeg(s),n=this._sub(r,t),o=this._norm(n);this._normalize(n);const a=Math.abs(this._crossProduct(n,this._sub(i,r)));let h=Math.abs(this._dotProduct(n,this._sub(i,r)));h<.05*o?h=.05*o:h>.95*o&&(h=.95*o);const c=Math.max(a,h),l=this._leftPerp(n);let u=[];const d=[r[0]-n[0]*h*.5+l[0]*a*.5,r[1]-n[1]*h*.5+l[1]*a*.5];u.push([d[0],d[1]]),d[0]+=n[0]*c*.5+l[0]*c*.4,d[1]+=n[1]*c*.5+l[1]*c*.4,u.push([d[0],d[1]]),d[0]-=l[0]*c*.25,d[1]-=l[1]*c*.25,u.push([d[0],d[1]]),d[0]+=n[0]*c*.5+l[0]*c*.4,d[1]+=n[1]*c*.5+l[1]*c*.4,u.push([d[0],d[1]]),e.push(u),u=[],d[0]=r[0]-n[0]*h*.5-l[0]*a*.5,d[1]=r[1]-n[1]*h*.5-l[1]*a*.5,u.push([d[0],d[1]]),d[0]+=n[0]*c*.5-l[0]*c*.4,d[1]+=n[1]*c*.5-l[1]*c*.4,u.push([d[0],d[1]]),d[0]+=l[0]*c*.25,d[1]+=l[1]*c*.25,u.push([d[0],d[1]]),d[0]+=n[0]*c*.5-l[0]*c*.4,d[1]+=n[1]*c*.5-l[1]*c*.4,u.push([d[0],d[1]]),e.push(u);break}case Dt.uQ.LinkedChevrons:{const t=this._cp2(s,-5,0),i=this._cp3(s,t,-.2,1),n=this._sub(r,t);this._normalize(n);const o=this._leftPerp(n),a=Math.abs(this._crossProduct(n,this._sub(i,t)));e.push([t,r]);const h=[];h.push([r[0]-n[0]*a+o[0]*a,r[1]-n[1]*a+o[1]*a]),h.push(r),h.push([r[0]-n[0]*a-o[0]*a,r[1]-n[1]*a-o[1]*a]),e.push(h),this._addDash(e,t,[-n[0]*a+o[0]*a,-n[1]*a+o[1]*a]),this._addDash(e,t,[-n[0]*a-o[0]*a,-n[1]*a-o[1]*a]);break}case Dt.uQ.SegmentThenHalfCircle:{const t=this._cp2(s,2,0),n=this._cp3(s,t,1.5,0);let o;o=i>=4?s[3]:this._cp3(s,t,1.25,-.5);const a=this._sub(t,r);this._normalize(a);const h=.5*this._dist(t,n),c=this._crossProduct(a,this._sub(o,r))>0,l=Math.cos(Math.PI/18);let u=Math.sin(Math.PI/18);c&&(u=-u);const d=[r,t];a[0]*=h,a[1]*=h;const _=this._add(t,a);a[0]=-a[0],a[1]=-a[1];for(let t=1;t<=18;t++)this._rotateDirect(a,l,u),d.push(this._add(_,a));e.push(d);break}case Dt.uQ.LineWithStraightTicks:{const t=this._cp2(s,-2,1),i=this._cp3(s,t,-1,-.5),n=this._sub(i,t);this._normalize(n);const o=this._dotProduct(n,this._sub(t,r)),a=this._dotProduct(n,this._sub(i,r));let h=[r];h.push([r[0]+n[0]*o,r[1]+n[1]*o]),h.push(t),e.push(h),h=[r],h.push([r[0]+n[0]*a,r[1]+n[1]*a]),h.push(i),e.push(h);break}case Dt.uQ.DoubleCurve:{const t=this._cp2(s,-5,-1),i=this._cp3(s,t,2,0),n=Math.atan2(1,5),o=Math.cos(n),a=Math.sin(n),h=this._sub(t,r),c=this._dist(r,t);this._normalize(h),this._rotateDirect(h,o,-a);const l=[r];l.push([r[0]+h[0]*c*.5,r[1]+h[1]*c*.5]),qt(l[1],1),l.push([r[0]+h[0]*c*.8,r[1]+h[1]*c*.8]),this._addBezier2(l,l[2],[r[0]+h[0]*c,r[1]+h[1]*c],t,3);const u=this._sub(i,t),d=this._dist(t,i);this._normalize(u),this._rotateDirect(u,o,-a),this._addBezier2(l,t,[i[0]-u[0]*d,i[1]-u[1]*d],[i[0]-u[0]*d*.8,i[1]-u[1]*d*.8],3),l.push(i),e.push(l);break}case Dt.uQ.ParallelWithTicksByWidth:{const t=this._cp2(s,0,-1),i=this._cp3(s,t,.5,3),n=this._sub(t,r);this._normalize(n);const o=this._crossProduct(n,this._sub(i,r));this._leftPerpendicular(n),o>0?(this._addAngledTicks(e,r,[r[0]+n[0]*o,r[1]+n[1]*o],t),this._addAngledTicks(e,t,[t[0]+n[0]*o,t[1]+n[1]*o],r)):(this._addAngledTicks(e,[r[0]+n[0]*o,r[1]+n[1]*o],r,t),this._addAngledTicks(e,[t[0]+n[0]*o,t[1]+n[1]*o],r,t));break}case Dt.uQ.EnclosingRoundedRectangle:{const t=this._cp2(s,3,-2),e=[Math.min(r[0],t[0]),Math.max(r[1],t[1])],i=[Math.max(r[0],t[0]),Math.min(r[1],t[1])],n=i[0]-e[0],o=e[1]-i[1],a=Math.min(n,o)/10,h=[];h.push([e[0]+a+.75*(n-2*a),e[1]]),h.push([i[0]-a,e[1]]),this._add90DegArc(h,[i[0]-a,e[1]],[i[0],e[1]-a],[i[0],e[1]]),h.push([i[0],i[1]+a]),this._add90DegArc(h,[i[0],i[1]+a],[i[0]-a,i[1]],i),h.push([e[0]+a,i[1]]),this._add90DegArc(h,[e[0]+a,i[1]],[e[0],i[1]+a],[e[0],i[1]]),h.push([e[0],e[1]-a]),this._add90DegArc(h,[e[0],e[1]-a],[e[0]+a,e[1]],e),h.push([e[0]+a+.75*(n-2*a),e[1]]);break}case Dt.uQ.FullGeometry:default:e.push(s)}}return e}}class oe{static{this.instance=null}static local(){return null===oe.instance&&(oe.instance=new oe),oe.instance}execute(t,e,s,i,r){return new ae(t,e,s)}}class ae extends Yt{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new jt,this._beginCut=(void 0!==e.beginCut?e.beginCut:1)*s,this._endCut=(void 0!==e.endCut?e.endCut:1)*s,this._middleCut=(void 0!==e.middleCut?e.middleCut:0)*s,this._invert=void 0!==e.invert&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const{_beginCut:e,_endCut:s,_middleCut:i}=this,r=t.pathLength(),n=Tt.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(0!==e||0!==s||0!==i)if(e+s+i>=r)for(n.startPath();t.nextPoint();)n.pushXY(t.x,t.y);else this._curveHelper.appendSubCurve(n,t,0,e),this._curveHelper.appendSubCurve(n,t,.5*(r-i),.5*(r+i)),this._curveHelper.appendSubCurve(n,t,r-s,s)}else if(0===e&&0===s&&0===i)for(n.startPath();t.nextPoint();)n.pushXY(t.x,t.y);else e+s+i<r&&(0===i?this._curveHelper.appendSubCurve(n,t,e,r-s):(this._curveHelper.appendSubCurve(n,t,e,.5*(r-i)),this._curveHelper.appendSubCurve(n,t,.5*(r+i),r-s)));return 0===n.totalSize?null:n}}class he{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return 0===this._values.length}size(){return this._values.length}init(t,e,s=!0){if(this._setEmpty(),!t||0===t.length)return!1;for(let e=0;e<t.length;e++){let i=Math.abs(t[e]);s&&i<1e-7&&(i=1e-7),this._values.push(i),this._length+=i}return e&&1&t.length&&(this._length*=2),0!==this._length&&(this.ctrlPtGap=this.extPtGap=0,this._currentValue=-1,!0)}scale(t){const e=this._values?this._values.length:0;for(let s=0;s<e;++s)this._values[s]*=t;this._length*=t,this.extPtGap*=t,this.ctrlPtGap*=t}addValue(t){this._length+=t,this._values.push(t)}firstValue(){return this._values[0]}lastValue(){return this._values[this._values.length-1]}nextValue(){return this._currentValue++,this._currentValue===this._values.length&&(this._currentValue=0),this._values[this._currentValue]}reset(){this._currentValue=-1}length(){return this._length}_setEmpty(){this.extPtGap=this.ctrlPtGap=this._length=0,this._currentValue=-1,this._values.length=0}}class ce{constructor(){this.pt=null,this.ca=0,this.sa=0}}(se=ee||(ee={}))[se.FAIL=0]="FAIL",se[se.END=1]="END",se[se.CONTINUE=2]="CONTINUE";class le{constructor(){this.reset()}reset(){this.segment=null,this.segmentLength=0,this.abscissa=0,this.isPathEnd=!1,this.isPartEnd=!1}isValid(){return null!==this.segment}copyTo(t){t.segment=this.segment,t.segmentLength=this.segmentLength,t.abscissa=this.abscissa,t.isPathEnd=this.isPathEnd,t.isPartEnd=this.isPartEnd}}class ue extends jt{constructor(t=0,e=!1){super(t,e),this._tempPos=new le,this._tempPt=[0,0],this._tolerance=Ut,this._currentPosition=new le}updateTolerance(t){this._tolerance=Ut*t}init(t,e,s=!0){return s?(this._patternLength=e.length(),this._partExtPtGap=e.extPtGap,this._partCtrlPtGap=e.ctrlPtGap):(this._patternLength=0,this._partExtPtGap=0,this._partCtrlPtGap=0),this._currentPosition.reset(),this._partSegCount=0,this._pathCursor=t,this._seg=-1,this._setPosAtNextPart()}curPositionIsValid(){return this._currentPosition.isValid()}nextPosition(t,e=ee.FAIL){const s=new le;return!!this._nextPosition(t,s,null,e)&&(s.copyTo(this._currentPosition),!0)}curPointAndAngle(t){t.pt=this._getPoint(this._currentPosition);const[e,s]=this._getAngleCS(this._tempPt,this._currentPosition);t.ca=e,t.sa=s}nextPointAndAngle(t,e,s=ee.FAIL){const i=this._tempPos;if(!this._nextPosition(t,i,null,s))return!1;i.copyTo(this._currentPosition),e.pt=this._getPoint(i);const[r,n]=this._getAngleCS(this._tempPt,i);return e.ca=r,e.sa=n,!0}nextCurve(t){if(0===t)return null;const e=Tt.createEmptyOptimizedCIM("esriGeometryPolyline");e.startPath(),e.nextPath();const s=new le;return this._nextPosition(t,s,e,ee.END)?(s.copyTo(this._currentPosition),e):null}isPathEnd(){return this._currentPosition.isPathEnd}getPathEnd(){return this._currentPosition.segment[1]}getPt(t){return this._pathCursor.seekInPath(t),[this._pathCursor.x,this._pathCursor.y]}getSeg(t){return[this.getPt(t),this.getPt(t+1)]}_nextPosition(t,e,s,i){if(this._currentPosition.isPathEnd)return!1;let r=this._currentPosition.abscissa;for(this._currentPosition.segmentLength>0&&(r/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(0===s.pathSize)if(0===r){const t=e.segment[0];s.pushXY(t[0],t[1])}else s.pushPoint(this.getSegCoord2D(e.segment,r));const t=e.segment[1];s.pushXY(t[0],t[1])}if(r=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.getSegLength(e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==ee.FAIL&&(e.segmentLength=this.getSegLength(e.segment),e.isPartEnd=!0,i===ee.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){0===s.pathSize&&(0===r?s.pushPoint(e.segment[0]):s.pushPoint(this.getSegCoord2D(e.segment,r)));const t=e.abscissa/e.segmentLength;1===t?s.pushPoint(e.segment[1]):s.pushPoint(this.getSegCoord2D(e.segment,t))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)<this._tolerance&&(e.isPathEnd=this._partIsLast,e.isPartEnd=!0),!0}_getPoint(t){const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegCoord2D(this._currentPosition.segment,e)}_getAngleCS(t,e){const s=e.segmentLength<=0?0:e.abscissa/e.segmentLength;return this.getSegAngleCS(t,this._currentPosition.segment,s)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;for(this._partLength=0,this._partIsLast=!0,this._partSegCount=0;this._hasNextSegment();)if(this._partLength+=this.getSegLength(this._nextSegment()),this._partSegCount++,this._pathCursor.getControlPointAt(this._getEndPointIndex())){this._partIsLast=!this._hasNextSegment();break}let t=this._partSegCount;for(;t;)this._previousSegment(),--t;this._currentPosition.segment=this._nextSegment(),this._currentPosition.segmentLength=this.getSegLength(this._currentPosition.segment),this._currentPosition.abscissa=0,this._currentPosition.isPathEnd=this._currentPosition.isPartEnd=!1,--this._partSegCount;const e=this._getStartPointIndex();this._ctrlPtBegin=this._pathCursor.getControlPointAt(e);let s=e+this._partSegCount+1;if(s>=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const t=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,e=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let s=Math.round((this._partLength-(t+e))/this._patternLength);s<=0&&(s=t+e>0?0:1),this._partLengthRatio=this._partLength/(t+e+s*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg<this._pathCursor.pathSize-2}_previousSegment(){return this.getSeg(--this._seg)}_nextSegment(){return this.getSeg(++this._seg)}_getStartPointIndex(){return this._seg}_getEndPointIndex(){return this._seg+1}}var de=s(93397);class _e{static{this.instance=null}static local(){return null===_e.instance&&(_e.instance=new _e),_e.instance}execute(t,e,s,i,r){return new pe(t,e,s)}}class pe extends Yt{constructor(t,e,s){super(t,!0,!0),this._firstCurve=null,this._walker=new ue,this._walker.updateTolerance(s),this._endings=e.lineDashEnding,this._customDashPos=-(e.offsetAlongLine??0)*s,this._offsetAtEnd=(e.customEndingOffset??0)*s;let i=(0,de.FH)(e).dashTemplate;null==i&&(i=[]),i.length%2&&(i=[...i,...i]),this._pattern=new he,this._pattern.init(i,!0),this._pattern.scale(s)}processPath(t){if(0===this._pattern.length()){this.iteratePath=!1;const e=(0,Pt.A)(t);return Tt.fromJSONCIM({paths:[e]})}if(!this.iteratePath){let e=!0;switch(this._endings){case Dt.yS.HalfPattern:case Dt.yS.HalfGap:default:this._pattern.extPtGap=0;break;case Dt.yS.FullPattern:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case Dt.yS.FullGap:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case Dt.yS.NoConstraint:this.isClosed||(e=!1);break;case Dt.yS.Custom:this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const s=t.pathLength();if(this._pattern.isEmpty()||s<.1*this._pattern.length()){const e=(0,Pt.A)(t);return Tt.fromJSONCIM({paths:[e]})}if(!this._walker.init(t,this._pattern,e)){const e=(0,Pt.A)(t);return Tt.fromJSONCIM({paths:[e]})}}let e;if(this.iteratePath)e=this._pattern.nextValue();else{let t;switch(this._endings){case Dt.yS.HalfPattern:default:t=.5*this._pattern.firstValue();break;case Dt.yS.HalfGap:t=.5*-this._pattern.lastValue();break;case Dt.yS.FullGap:t=-this._pattern.lastValue();break;case Dt.yS.FullPattern:t=0;break;case Dt.yS.NoConstraint:case Dt.yS.Custom:t=-this._customDashPos}let s=t/this._pattern.length();s-=Math.floor(s),t=s*this._pattern.length(),this._pattern.reset(),e=this._pattern.nextValue();let i=!1;for(;t>=e;)t-=e,e=this._pattern.nextValue(),i=!i;e-=t,i?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let s=this._walker.nextCurve(e);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s?.reset(),s}}class fe{static{this.instance=null}static local(){return null===fe.instance&&(fe.instance=new fe),fe.instance}execute(t,e,s,i,r,n,o){return new ge(t,e,s,i,r,n,o)}}class ge{constructor(t,e,s,i,r,n,o){switch(this._preventClipping=o,this._inputGeometries=t,this._tileKey=i,this._geometryEngine=r,this._maxInflateSize=n*s,this._width=(void 0!==e.width?e.width:2)*s,e.method){case Dt.M1.Mitered:case Dt.M1.Bevelled:case Dt.M1.Rounded:case Dt.M1.TrueBuffer:case Dt.M1.Square:}this._option=e.option}next(){let t;for(;t=this._inputGeometries.next();){if("esriGeometryEnvelope"===t.geometryType&&this._width>0){const e=t.asJSON();return Math.min(e.xmax-e.xmin,e.ymax-e.ymin)-2*this._width<0?t:Tt.fromJSONCIM({paths:[[[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]],[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]})}if("esriGeometryPolygon"===t.geometryType){if(0===this._width)return t.clone();const e=this._geometryEngine;if(null==e)return null;const s=!this._preventClipping&&this._tileKey?Jt(t,this._maxInflateSize,!0):t.clone();if(!s)continue;const i=e.buffer(y.A.WebMercator,s.asJSON(),-this._width,1);if(i)for(const t of i.rings)if(t){s.startPath();for(const e of t.reverse())s.pushXY(e[0],s.yFactor*e[1])}return s}}return null}}var me=s(537);class ye{static{this.instance=null}static local(){return null===ye.instance&&(ye.instance=new ye),ye.instance}execute(t,e,s,i,r){return new xe(t,e,s,r)}}class xe{constructor(t,e,s,i){this._inputGeometries=t,this._medhod=e.method,this._geometryEngine=i}next(){let t=this._inputGeometries.next();const e=this._medhod;for(;null!=t;){if(t.totalSize>0)switch(e){case Dt.Ao.RectangularBox:return be(t);case Dt.Ao.ConvexHull:return this._constructConvexHull(t);default:return we(t)}t=this._inputGeometries.next()}return null}_constructConvexHull(t){switch(t.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const e=this._geometryEngine;if(null==e)return null;const s=e.convexHull(y.A.WebMercator,t.asJSON());return s?Tt.fromJSONCIM(s):null}case"esriGeometryEnvelope":return t;default:return null}}}function be(t){const e=(0,me.z8)(t),s={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]};return Tt.fromJSONCIM(s)}function we(t){switch(t.geometryType){case"esriGeometryPolyline":{const e=[];for(;t.nextPath();)ve(t,e);return Tt.fromJSONCIM({rings:e})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return t;default:return null}}function ve(t,e){if(t.seekPathStart(),!t.nextPoint())return;const s=t.x,i=t.y,r=[[s,i]];for(e.push(r);t.nextPoint();)r.push([t.x,t.y]);r.push([s,i])}class Ie{static{this.instance=null}static local(){return null===Ie.instance&&(Ie.instance=new Ie),Ie.instance}execute(t,e,s,i,r){return new Se(t,e,s)}}class Se extends Yt{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new jt,this._length=(void 0!==e.length?e.length:20)*s,this._angle=void 0!==e.angle?e.angle:225,this._position=void 0!==e.position?e.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(t){const e=Tt.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(t))return null;t.seekInPath(0);const s=t.x,i=t.y;t.seekInPath(t.pathSize-1);const r=t.x,n=t.y,o=[r-s,n-i];this._curveHelper.normalize(o);const a=s+(r-s)*this._position/100,h=i+(n-i)*this._position/100,c=Math.cos((90-this._angle)/180*Math.PI);let l=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(l=-l),this._mirror=!this._mirror;const u=[a-this._length/2*c,h-this._length/2*l],d=[a+this._length/2*c,h+this._length/2*l];return e.pushPath([[s,i],u,d,[r,n]]),e}}class Pe{static{this.instance=null}static local(){return null===Pe.instance&&(Pe.instance=new Pe),Pe.instance}execute(t,e,s,i,r){return new Me(t,e,s)}}class Me{constructor(t,e,s){this._inputGeometries=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if(t.totalSize>0)return this._move(t.clone(),this._offsetX,this._offsetY);t=this._inputGeometries.next()}return null}_move(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=t.x+e,t.y=t.y+s;return t.reset(),t}}class Ae{static{this.instance=null}static local(){return null===Ae.instance&&(Ae.instance=new Ae),Ae.instance}execute(t,e,s,i,r,n,o){return new Te(t,e,s,i,r,n,o)}}class Te{constructor(t,e,s,i,r,n,o){this._preventClipping=o,this._inputGeometries=t,this._tileKey=i,this._geometryEngine=r,this._curveHelper=new jt,this._offset=(e.offset??1)*s,this._method=e.method,this._maxInflateSize=Math.max(Math.abs(n*s),10),this._option=e.option,this._offsetFlattenError=Ut*s}next(){let t;for(;t=this._inputGeometries.next();){if(0===this._offset)return t.clone();if("esriGeometryEnvelope"===t.geometryType){if(this._method===Dt.xw.Rounded&&this._offset>0){const e=(0,Pt.A)(t),s=this._curveHelper.offset(e,-this._offset,this._method,4,this._offsetFlattenError);if(s){const e=Tt.createEmptyOptimizedCIM(t.geometryType);return e.pushPath(s),e}return null}const e=t.asJSON();if((0,Mt.ZC)(e)&&Math.min(e.xmax-e.xmin,e.ymax-e.ymin)+2*this._offset>0)return Tt.fromJSONCIM({xmin:e.xmin-this._offset,xmax:e.xmax+this._offset,ymin:e.ymin-this._offset,ymax:e.ymax+this._offset})}const e=this._geometryEngine;if(null==e)continue;const s=!this._preventClipping&&this._tileKey?Jt(t,this._maxInflateSize,!0):t.clone();if(!s)continue;const i=e.offset(y.A.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return i?Tt.fromJSONCIM(i):null}return null}}var ke=s(12359);class Ce{static{this.instance=null}static local(){return null===Ce.instance&&(Ce.instance=new Ce),Ce.instance}execute(t,e,s,i,r){return new Fe(t,e,s)}}class Fe{constructor(t,e,s){this._inputGeometries=t,this._length=(void 0!==e.length?e.length:Rt.D.CIMGeometricEffectRadial.length)*s,this._angle=void 0!==e.angle?e.angle*Math.PI/180:Rt.D.CIMGeometricEffectRadial.angle,this._lx=Math.cos(this._angle)*this._length,this._ly=Math.sin(this._angle)*this._length}next(){let t=this._inputGeometries.next();for(;t;){if("esriGeometryPoint"===t.geometryType){const e=Tt.createEmptyOptimizedCIM("esriGeometryPolyline");return t.nextPath()&&t.nextPoint()&&e.pushPath([[t.x,t.y],[t.x+this._lx,t.y+this._ly]]),e}if("esriGeometryPolygon"===t.geometryType){const e=(0,ke.IK)(t);if(!e)return null;const s=Tt.createEmptyOptimizedCIM("esriGeometryPolyline");return s.pushPath([[e[0],e[1]],[e[0]+this._lx,e[1]+this._ly]]),s}t=this._inputGeometries.next()}return null}}class Ee{static{this.instance=null}static local(){return null===Ee.instance&&(Ee.instance=new Ee),Ee.instance}execute(t,e,s,i,r){return new Oe(t,e,s)}}class Oe{constructor(t,e,s){this._inputGeometries=t,this._reverse=void 0===e.reverse||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if("esriGeometryPolyline"===t.geometryType)return ze(t.clone());t=this._inputGeometries.next()}return null}}function ze(t){for(;t.nextPath();)for(let e=0;e<t.pathSize/2;e++){t.seekInPath(e);const s=t.x,i=t.y;t.seekInPath(t.pathSize-e-1);const r=t.x,n=t.y;t.x=s,t.y=i,t.seekInPath(e),t.x=r,t.y=n}return t.reset(),t}class Re{static{this.instance=null}static local(){return null===Re.instance&&(Re.instance=new Re),Re.instance}execute(t,e,s,i,r){return new Le(t,e,s)}}class Le{constructor(t,e,s){this._inputGeometries=t,this._rotateAngle=void 0!==e.angle?e.angle*Math.PI/180:0}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._rotateAngle||"esriGeometryPoint"===t.geometryType)return t;if(t.totalSize>0){const e=(0,me.z8)(t),s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;return t.reset(),this._rotate(t.clone(),s,i)}t=this._inputGeometries.next()}return null}_rotate(t,e,s){const i=Math.cos(this._rotateAngle),r=Math.sin(this._rotateAngle);for(;t.nextPath();)for(;t.nextPoint();){const n=t.x-e,o=t.y-s;t.x=e+n*i-o*r,t.y=s+n*r+o*i}return t.reset(),t}}class De{static{this.instance=null}static local(){return null===De.instance&&(De.instance=new De),De.instance}execute(t,e,s,i,r){return new Ne(t,e,s)}}class Ne{constructor(t,e,s){this._inputGeometries=t,this._xFactor=void 0!==e.xScaleFactor?e.xScaleFactor:1.15,this._yFactor=void 0!==e.yScaleFactor?e.yScaleFactor:1.15}next(){const t=this._inputGeometries.next();if(t){if(1===this._xFactor&&1===this._yFactor)return t;if("esriGeometryPoint"===t.geometryType)return t;if(t.totalSize>0){const e=(0,me.z8)(t),s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;return t.reset(),this._scaleCursor(t.clone(),s,i)}}return null}_scaleCursor(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=e+(t.x-e)*this._xFactor,t.y=s+(t.y-s)*this._yFactor;return t.reset(),t}}class Ge{constructor(){this._polyline=[]}beginPath(t){this._polyline.push([t])}lineTo(t){if(0===this._polyline.length)throw new Error("No path started. Call beginPath first.");this._polyline[this._polyline.length-1].push(t)}getPointCount(){return this._polyline.reduce(((t,e)=>t+e.length),0)}addSegment(t,e,s){s&&this.beginPath(t),this.lineTo(e)}getXY(t){let e=0;for(const s of this._polyline){if(t<e+s.length)return s[t-e];e+=s.length}return null}getGeometry(){return this._polyline}}class Be{static{this.instance=null}static local(){return null===Be.instance&&(Be.instance=new Be),Be.instance}execute(t,e,s,i,r){return new qe(t,e,s)}}class qe extends Yt{constructor(t,e,s){super(t,!1,!0),this._suppress=void 0!==e.suppress&&e.suppress,this._invert=void 0!==e.invert&&e.invert}processPath(t){if(t.totalSize<=0)return null;if(!this._suppress){const e=Tt.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,t.yFactor);for(t.seekPathEnd();t.nextPoint();)e.pushXY(t.x,t.y);return e}const e=[],s=new Array(t.pathSize);let i=0;for(t.seekPathStart();t.nextPoint();)s[i++]=t.getControlPoint(),e.push([t.x,t.y]);let r=!0,n=!0,o=!1,a=!this._invert;i=0;const h=new Ge;let c=e[0];for(;i<e.length;){const t=e[i+1],l=s[i],u=s[i+1];i++,n&&(a=l||u?this._invert:!this._invert,n=!1),a?(h.addSegment(c,t,r),r=!1):o=!0,c=t,u&&(a?(a=!1,r=!0):a=!0)}const l=h.getGeometry();if(0===l.length)return null;if(!o&&e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]){const t=l[l.length-1];return t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]||t.push([t[0][0],t[0][1]]),Tt.fromJSONCIM({paths:l})}const u=l[l.length-1];return h.getPointCount()>1&&"esriGeometryPolygon"===t.geometryType&&u[0][0]===u[u.length-1][0]&&u[0][1]===u[u.length-1][1]&&l.length>1&&(l[l.length-1].push(...l[0]),l.splice(0,1)),Tt.fromJSONCIM({paths:l})}}function We(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t}function Ye(t,e){return Math.sqrt(t*t+e*e)}function Ue(t){const e=Ye(t[0],t[1]);t[0]/=e,t[1]/=e}function je(t,e){return Ye(t[0]-e[0],t[1]-e[1])}function Ve(t){return t.length-1}function Xe(t,e,s=1){let[i,r]=function(t,e){return t[e+1]}(t,e);return[i,r]=[Math.round(i),Math.round(r)],Math.sqrt(i*i+r*r)*s}class He{constructor(t,e,s,i,r){this._segments=t,this._index=e,this._distance=s,this._xStart=i,this._yStart=r,this._done=!1}static create(t){return new He(t,0,0,t[0][0],t[0][1])}clone(){return new He(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(t){return this._index===t._index||t._index===this._index-1&&(0===this._distance||1===t._distance)||t._index===this._index+1&&(1===this._distance||0===t._distance)}leq(t){return this._index<t._index||this._index===t._index&&this._distance<=t._distance}geq(t){return this._index>t._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let s=Math.acos(e);return t>0&&(s=2*Math.PI-s),s}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<Ve(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(t,e){const s=this.backwardLength;if(t<=s)return this._distance=(s-t)/this.length,this;let i=this.backwardLength;for(;this.prev();){if(i+this.length>t)return this._seekBackwards(t-i);i+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let s=this.remainingLength;for(;this.next();){if(s+this.length>t)return this.seek(t-s,e);s+=this.length}return this._distance=1,e?this:null}}function Qe(t,e,s,i=!0){const r=function(t){let e=0;for(let s=0;s<Ve(t);s++)e+=Xe(t,s);return e}(t),n=He.create(t),o=r/2;if(!i)return n.seek(o),void(n.x<_.CQ&&n.y<_.CQ&&n.x>0&&n.y>0&&s(n.clone(),0,o+0*e,r));const a=Math.max((r-e)/2,0),h=Math.floor(a/e),c=o-h*e;n.seek(c);for(let t=-h;t<=h;t++)n.x<_.CQ&&n.y<_.CQ&&n.x>0&&n.y>0&&s(n.clone(),t,o+t*e,r),n.seek(e)}function Ze(t,e){const s=e;for(let e=0;e<t.length;e++){let i=t[e];$e(i,s);const r=[];r.push(i[0]);for(let t=1;t<i.length;t++){const[e,s]=i[t-1],[n,o]=i[t],a=n-e,h=o-s;r.push([a,h])}t[e]=r,i=r}return t}function $e(t,e){const s=1e-6;if(e<=0)return;const i=t.length;if(i<3)return;const r=[];let n=0;r.push(0);for(let e=1;e<i;e++)n+=je(t[e],t[e-1]),r.push(n);e=Math.min(e,.2*n);const o=[];o.push(t[0][0]),o.push(t[0][1]);const a=t[i-1][0],h=t[i-1][1],c=We([0,0],t[0],t[1]);Ue(c),t[0][0]+=e*c[0],t[0][1]+=e*c[1],We(c,t[i-1],t[i-2]),Ue(c),t[i-1][0]+=e*c[0],t[i-1][1]+=e*c[1];for(let t=1;t<i;t++)r[t]+=e;r[i-1]+=e;const l=.5*e;for(let n=1;n<i-1;n++){let a=0,h=0,c=0;for(let i=n-1;i>=0&&!(r[i+1]<r[n]-l);i--){const o=l+r[i+1]-r[n],u=r[i+1]-r[i],d=r[n]-r[i]<l?1:o/u;if(Math.abs(d)<s)break;const _=d*d,p=d*o-.5*_*u,f=d*u/e,g=t[i+1],m=t[i][0]-g[0],y=t[i][1]-g[1];a+=f/p*(g[0]*d*o+.5*_*(o*m-u*g[0])-_*d*u*m/3),h+=f/p*(g[1]*d*o+.5*_*(o*y-u*g[1])-_*d*u*y/3),c+=f}for(let o=n+1;o<i&&!(r[o-1]>r[n]+l);o++){const i=l-r[o-1]+r[n],u=r[o]-r[o-1],d=r[o]-r[n]<l?1:i/u;if(Math.abs(d)<s)break;const _=d*d,p=d*i-.5*_*u,f=d*u/e,g=t[o-1],m=t[o][0]-g[0],y=t[o][1]-g[1];a+=f/p*(g[0]*d*i+.5*_*(i*m-u*g[0])-_*d*u*m/3),h+=f/p*(g[1]*d*i+.5*_*(i*y-u*g[1])-_*d*u*y/3),c+=f}o.push(a/c),o.push(h/c)}o.push(a),o.push(h);for(let e=0,s=0;e<i;e++)t[e][0]=o[s++],t[e][1]=o[s++]}const Je=()=>D.A.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class Ke{static{this.instance=null}static local(){return null===Ke.instance&&(Ke.instance=new Ke),Ke.instance}execute(t,e,s,i,r){return new ts(t,e,s,i,r)}}class ts extends Yt{constructor(t,e,s,i,r){super(t,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new Qt.bR(NaN,NaN),this._lastWidth=0,this._tileKey=null,this._halfFromWidth=Math.abs(void 0!==e.fromWidth?e.fromWidth:0)*s*.5,this._halfToWidth=Math.abs(void 0!==e.toWidth?e.toWidth:1)*s*.5,this._originalLength=(void 0!==e.length?e.length:0)*s,this._length=0,this._tileKey=i,this._geometryEngine=r}processPath(t){if(t.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const e=Tt.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,t.yFactor);for(t.seekPathEnd();t.prevPoint();)e.pushXY(t.x,t.y);for(t.seekPathStart();t.nextPoint();)e.pushXY(t.x,t.y);return e}const e=[];t.seekPathStart();let s=0,r=0;for(;t.nextPoint();)e.push([t.x-s,t.y-r]),s=t.x,r=t.y;let n=this._geometryEngine?.simplify(y.A.WebMercator,{paths:[e]});n||null!=this._tileKey||(n={paths:[e]});const o=(0,Mt.Bi)(n)?n.rings:(0,Mt.Rg)(n)?n.paths:null;if(!o)return Je().error(new i.A("mapview-bad-resource","Unable to process geometry")),null;const a=new Ge,h=new Ge;let c=0;for(const t of o){s=t[0][0],r=t[0][1];for(let e=1;e<t.length;e++){const i=s+t[e][0],n=r+t[e][1];c+=Math.sqrt((i-s)*(i-s)+(n-r)*(n-r)),s=i,r=n}}if(0===this._originalLength||this._originalLength>c){this._length=c;const t=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(t)<1){const e=t*t;this._slopeC=Math.sqrt(1/(1+e)),this._slopeS=Math.sqrt(e/(1+e)),t<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;let l=0;const u=[];for(const t of o){const e=He.create(t),s=He.create(t);this._setFromOffset(s,a,h);let i=s.next(),r=e;for(;i&&r;)l=this._setOffset(r,i,l,a,h),r=e.next(),i=s.next();r=e,r&&this._setToOffset(r,l,a,h);const n=a.getGeometry(),o=h.getGeometry(),c=[];for(const t of n)c.push(...t);for(let t=o.length-1;t>=0;t--){const e=o[t];for(let t=e.length-1;t>=0;t--)c.push(e[t])}u.push(c)}const d={rings:u};(0,ie.uC)(d);let _=this._geometryEngine?.simplify(y.A.WebMercator,d);if(!_){if(null!=this._tileKey)return null;_=d}return Tt.fromJSONCIM(_)}_setFromOffset(t,e,s){const i=this._halfFromWidth,r=new Qt.bR(t.xEnd-t.xStart,t.yEnd-t.yStart);r.normalize(),r.scale(i),e.beginPath([t.xStart-r.y,t.yStart+r.x]),s.beginPath([t.xStart+r.y,t.yStart-r.x])}_setToOffset(t,e,s,i){let r;r=(e+=Math.sqrt((t.xEnd-t.xStart)*(t.xEnd-t.xStart)+(t.yEnd-t.yStart)*(t.yEnd-t.yStart)))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*e/this._length;const n=new Qt.bR(t.xEnd-t.xStart,t.yEnd-t.yStart);n.normalize(),n.scale(r),s.lineTo([t.xEnd-n.y,t.yEnd+n.x]),i.lineTo([t.xEnd+n.y,t.yEnd-n.x])}_setOffset(t,e,s,r,n){const o=Math.sqrt((t.xEnd-t.xStart)*(t.xEnd-t.xStart)+(t.yEnd-t.yStart)*(t.yEnd-t.yStart));let a;a=s+o>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(s+o)/this._length,s+=o;const h=new Qt.bR(t.xEnd,t.yEnd),c=new Qt.bR(t.xEnd-t.xStart,t.yEnd-t.yStart);c.normalize();const l=new Qt.bR(e.xEnd-e.xStart,e.yEnd-e.yStart);l.normalize();const u=c.x*l.y-c.y*l.x;0===u&&Je().error(new i.A("mapview-bad-resource","Unable to process geometry"));const d=new Qt.bR((l.x-c.x)/u,(l.y-c.y)/u),_=r.getPointCount(),p=n.getPointCount();c.leftPerpendicular(),l.leftPerpendicular();const f=c.x*l.x+c.y*l.y;if(f>.99){const t=new Qt.bR((c.x+l.x)*a/2,(c.y+l.y)*a/2),e=t.clone();e.rotate(this._slopeC,this._slopeS),r.lineTo([h.x+e.x,h.y+e.y]);const s=t.clone();s.rotateReverse(this._slopeC,this._slopeS),n.lineTo([h.x-s.x,h.y-s.y])}else{if(u<0){const t=d.clone().scale(-a);t.rotateReverse(this._slopeC,this._slopeS);const e=n.getXY(p-1);e||Je().error(new i.A("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=Qt.bR.add(h,t),r=Qt.bR.sub(s,Qt.bR.fromArray(e));if(c.x*r.y-c.y*r.x>0){const t=new Qt.bR(-c.x*a,-c.y*a);t.rotateReverse(this._slopeC,this._slopeS);const e=new Qt.bR(-l.x*a,-l.y*a);e.rotateReverse(this._slopeC,this._slopeS),n.lineTo([h.x+t.x,h.y+t.y]),n.lineTo([h.x,h.y]),n.lineTo([h.x+e.x,h.y+e.y])}else n.lineTo([h.x+t.x,h.y+t.y])}else{const t=d.clone().scale(a);t.rotate(this._slopeC,this._slopeS);const e=r.getXY(_-1);e||Je().error(new i.A("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=Qt.bR.add(h,t),n=Qt.bR.sub(s,Qt.bR.fromArray(e));if(c.x*n.y-c.y*n.x>0){const t=c.clone().scale(a);t.rotate(this._slopeC,this._slopeS);const e=l.clone().scale(a);e.rotate(this._slopeC,this._slopeS),r.lineTo([h.x+t.x,h.y+t.y]),r.lineTo([h.x,h.y]),r.lineTo([h.x+e.x,h.y+e.y])}else r.lineTo([h.x+t.x,h.y+t.y])}const e=Math.acos(f);let s=1;if(a>.25){const t=2*Math.acos(1-.25/a);t<e&&(s=Math.round(e/t))}const o=Math.cos(e/s),g=Math.sin(e/s),m=c.clone();if(u<0){m.rotate(this._slopeC,this._slopeS);const e=r.getXY(_-1);e||Je().error(new i.A("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=Qt.bR.add(h,m.clone().scale(this._lastWidth)),n=Qt.bR.sub(s,Qt.bR.fromArray(e)),o=c.x*n.y-c.y*n.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&o>0){const e=new Qt.bR(t.xStart,t.yStart),s=this._lastTangent1.clone().scale(this._lastWidth);s.rotate(this._slopeC,this._slopeS);const i=c.clone().scale(this._lastWidth);i.rotate(this._slopeC,this._slopeS),r.lineTo([e.x+s.x,e.y+s.y]),r.lineTo([e.x,e.y]),r.lineTo([e.x+i.x,e.y+i.y])}}else{m.scale(-1).rotateReverse(this._slopeC,this._slopeS);const e=n.getXY(p-1);e||Je().error(new i.A("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=Qt.bR.add(h,m.clone().scale(this._lastWidth)),r=Qt.bR.sub(s,Qt.bR.fromArray(e)),o=c.x*r.y-c.y*r.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&o>0){const e=new Qt.bR(t.xStart,t.yStart),s=this._lastTangent1.clone().scale(-this._lastWidth);s.rotateReverse(this._slopeC,this._slopeS);const i=c.clone().scale(-this._lastWidth);i.rotateReverse(this._slopeC,this._slopeS),n.lineTo([e.x+s.x,e.y+s.y]),n.lineTo([e.x,e.y]),n.lineTo([e.x+i.x,e.y+i.y])}}m.scale(a);for(let t=0;t<=s;t++)u<0?(r.lineTo([h.x+m.x,h.y+m.y]),m.rotateReverse(o,g)):(n.lineTo([h.x+m.x,h.y+m.y]),m.rotate(o,g))}return this._lastTangent1.setCoords(c.x,c.y),this._lastWidth=a,s}}class es{static{this.instance=null}static local(){return null===es.instance&&(es.instance=new es),es.instance}execute(t,e,s,i,r){return new ss(t,e,s)}}class ss{constructor(t,e,s){this._inputGeometries=t,this._height=(void 0!==e.amplitude?e.amplitude:2)*s,this._period=(void 0!==e.period?e.period:3)*s,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new he,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new ue,this._walker.updateTolerance(s)}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._height||0===this._period)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(t){const e=Tt.createEmptyOptimizedCIM(t.geometryType);for(;t.nextPath();){e.startPath();const s=t.pathLength();if(this._walker.init(t,this._pattern))switch(this._style){case Dt.WE.Sinus:default:this._constructCurve(e,s,!1);break;case Dt.WE.Square:this._constructSquare(e,s);break;case Dt.WE.Triangle:this._constructTriangle(e,s);break;case Dt.WE.Random:this._constructCurve(e,s,!0)}else for(;t.nextPoint();)e.pushXY(t.x,t.y)}return e}_constructCurve(t,e,s){let i=Math.round(e/this._period);0===i&&(i=1);const r=16*i+1,n=e/i,o=this._period/16,a=1/r,h=2*Math.PI*e/n,c=2*Math.PI*Math.random(),l=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),d=.75-Math.random()/2,_=.75-Math.random()/2,p=new ce;this._walker.curPointAndAngle(p),t.pushPoint(p.pt);let f=0;for(;;){if(!this._walker.nextPointAndAngle(o,p)){t.pushPoint(this._walker.getPathEnd());break}{const e=f;let i;if(f+=a,s){const t=this._height/2*(1+.3*Math.sin(d*h*e+c));i=t*Math.sin(h*e+l),i+=t*Math.sin(_*h*e+u),i/=2}else i=.5*this._height*Math.sin(.5*h*e);t.pushXY(p.pt[0]-i*p.sa,p.pt[1]+i*p.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let s=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const i=new ce;this._walker.curPointAndAngle(i);const r=new ce;if(this._walker.nextPointAndAngle(this._period,r)){const n=new ce;this._walker.nextPointAndAngle(this._period,n)&&(s?(t.pushPoint(i.pt),s=!1):t.pushPoint(i.pt),t.pushXY(i.pt[0]-this._height/2*i.sa,i.pt[1]+this._height/2*i.ca),t.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),t.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let s=!0;for(;;){let e=!1;if(this._walker.curPositionIsValid()){const i=new ce;this._walker.curPointAndAngle(i);const r=new ce;if(this._walker.nextPointAndAngle(this._period/2,r)){const n=new ce;this._walker.nextPointAndAngle(this._period,n)&&(this._walker.nextPosition(this._period/2)&&(s?(t.pushPoint(i.pt),s=!1):t.pushPoint(i.pt),t.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),t.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca)),e=!0)}}if(!e){t.pushPoint(this._walker.getPathEnd());break}}}}class is{static{this.instance=null}static local(){return null===is.instance&&(is.instance=new is),is.instance}execute(t,e,s,i,r){return new rs(t,e,s)}}class rs extends Wt{constructor(t,e,s){super(t),this._geometryWalker=new ue,this._geometryWalker.updateTolerance(s),this._angleToLine=e.angleToLine??!0,this._offset=(e.offset?e.offset:0)*s,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*s,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*s,this._pattern=new he,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===Dt.e_.WithFullGap&&this.isClosed?this._endings=Dt.e_.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case Dt.e_.NoConstraint:s=-this._position,s=this._adjustPosition(s),i=!1;break;case Dt.e_.WithHalfGap:default:s=-this._pattern.lastValue()/2;break;case Dt.e_.WithFullGap:s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Dt.e_.WithMarkers:s=0;break;case Dt.e_.Custom:s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let r=0;for(;s>r;)s-=r,r=this._pattern.nextValue();r-=s,e=r,this.iteratePath=!0}const s=new ce;return this._geometryWalker.nextPointAndAngle(e,s)?this._endings===Dt.e_.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Dt.e_.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}class ns{static{this.instance=null}static local(){return null===ns.instance&&(ns.instance=new ns),ns.instance}execute(t,e,s,i,r){return new os(t,e,s)}}class os extends Wt{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new jt,this._placePerPart=e.placePerPart??!1,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._type=e.extremityPlacement,this._position=void 0!==e.offsetAlongLine?e.offsetAlongLine*s:0,this._beginProcessed=!1}processMultiPath(t){return this._placePerPart?super.processMultiPath(t):this.processPath(t)}processPath(t){let e;switch(this._type){case Dt.$2.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case Dt.$2.JustBegin:e=this._atExtremities(t,this._position,!0);break;case Dt.$2.JustEnd:e=this._atExtremities(t,this._position,!1);case Dt.$2.None:}return e}_atExtremities(t,e,s){if(this._placePerPart||(s?t.seekPath(0):t.seekPath(t.totalSize-1)),s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let i=0,[r,n]=[0,0],[o,a]=[t.x,t.y];const h=[0,0];for(;s?t.nextPoint():t.prevPoint();){r=o,n=a,o=t.x,a=t.y;const s=this._curveHelper.getLength(r,n,o,a);if(i+s>e){const t=(e-i)/s,[c,l]=this._curveHelper.getAngleCS(h,r,n,o,a,t),u=this._curveHelper.getCoord2D(r,n,o,a,t);return this.internalPlacement.setTranslate(u[0]-this._offset*l,u[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(-c,-l),this.internalPlacement}i+=s}}return null}}class as{static{this.instance=null}static local(){return null===as.instance&&(as.instance=new as),as.instance}execute(t,e,s,i,r){return new hs(t,e,s)}}class hs extends Wt{constructor(t,e,s){super(t),this._walker=new ue,this._walker.updateTolerance(s),this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._beginGap=void 0!==e.beginPosition?e.beginPosition*s:0,this._endGap=void 0!==e.endPosition?e.endPosition*s:0,this._flipFirst=void 0===e.flipFirst||e.flipFirst,this._pattern=new he,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+t;e=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,i=this._beginGap+s;e=i-this._prevPos,this._prevPos=i,this.iteratePath=!0}const s=new ce;if(!this._walker.nextPointAndAngle(e,s,ee.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const i=this._isFirst&&this._flipFirst;let r,n;return this._angleToLine?(r=s.ca,n=s.sa):(r=1,n=0),i&&(r=-r,n=-n),this.internalPlacement.setRotateCS(r,n),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}const cs=512,ls=24,us=1e-6;class ds{static{this.instance=null}static local(){return null===ds.instance&&(ds.instance=new ds),ds.instance}execute(t,e,s,i,r){return new _s(t,e,s,i,r)}}class _s{constructor(t,e,s,i,r){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(e.stepX??16)*s,this._stepY=Math.abs(e.stepY??16)*s,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,0!==this._stepX&&0!==this._stepY){if(this._gridType=e.gridType??Dt.Q1.Fixed,this._gridType===Dt.Q1.Random){const t=e.seed??13,s=1;this._randomLCG=new h.A(t*s),this._randomness=(e.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=e.gridAngle??0,this._shiftOddRows=e.shiftOddRows??!1,this._offsetX=(e.offsetX??0)*s,this._offsetY=(e.offsetY??0)*s,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,null!=i){const[t,e,s,r]=i.split("/"),n=parseFloat(t),o=parseFloat(e),a=parseFloat(s),h=parseFloat(r);this._graphicOriginX=-(h*2**n+a)*cs,this._graphicOriginY=o*cs,this._testInsidePolygon=!0}this._internalPlacement=new Bt,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!_s._randValues){_s._randValues=[];for(let t=0;t<ls;t++)for(let t=0;t<ls;t++)_s._randValues.push(this._randomLCG.getFloat()),_s._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(t){let e,s,i,r,n,o,a,h,c,l,u,d,_,p;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,a=h=_=u=Number.MAX_VALUE,c=l=p=d=-Number.MAX_VALUE;const f=1!==this._cosAngle;for(t.reset();t.nextPath();)for(;t.nextPoint();)o=t.x,n=t.y,e=o-this._graphicOriginX-this._offsetX,s=n-this._graphicOriginY-this._offsetY,f?(i=this._cosAngle*e-this._sinAngle*s,r=this._sinAngle*e+this._cosAngle*s):(i=e,r=s),a=Math.min(a,i),c=Math.max(c,i),h=Math.min(h,r),l=Math.max(l,r),u=Math.min(u,n),d=Math.max(d,n),_=Math.min(_,o),p=Math.max(p,o);u=u!==Number.MAX_VALUE?u:-512-this._stepY,d=d!==-Number.MAX_VALUE?d:this._stepY,_=_!==Number.MAX_VALUE?_:-this._stepX,p=p!==-Number.MAX_VALUE?p:cs+this._stepX;const g=d-u,m=p-_;if(this._verticalSubdivision=g>=m,this._polygonMin=this._verticalSubdivision?u:_,this._testInsidePolygon){let t=0-this._graphicOriginX-this._offsetX-this._stepX,e=cs-this._graphicOriginX-this._offsetX+this._stepX,s=-512-this._graphicOriginY-this._offsetY-this._stepY,i=0-this._graphicOriginY-this._offsetY+this._stepY;if(f){const r=[[t,s],[t,i],[e,s],[e,i]];t=s=Number.MAX_VALUE,e=i=-Number.MAX_VALUE;for(const n of r){const r=this._cosAngle*n[0]-this._sinAngle*n[1],o=this._sinAngle*n[0]+this._cosAngle*n[1];t=Math.min(t,r),e=Math.max(e,r),s=Math.min(s,o),i=Math.max(i,o)}}a=a!==Number.MAX_VALUE?Math.max(a,t):t,h=h!==Number.MAX_VALUE?Math.max(h,s):s,c=c!==-Number.MAX_VALUE?Math.min(c,e):e,l=l!==-Number.MAX_VALUE?Math.min(l,i):i}this._xMin=Math.round(a/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(h/this._stepY),this._yMax=Math.round(l/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,_,p,u,d)}_buildAccelerationMap(t,e,s,i,r){t.reset();const n=new Map,o=this._verticalSubdivision,a=o?r-i:s-e;let h=Math.ceil(a/10);if(h<=1)return;const c=Math.floor(a/h);let l,u,d,_,p,f,g,m,y,x,b;for(h++,this._delta=c,o?(y=-512-2*this._stepY,x=2*this._stepY,b=i):(y=-2*this._stepX,x=cs+2*this._stepX,b=e);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(l=t.x,u=t.y;t.nextPoint();l=d,u=_){if(d=t.x,_=t.y,o){if(u===_||u<y&&_<y||u>x&&_>x)continue;p=Math.min(u,_),f=Math.max(u,_)}else{if(l===d||l<y&&d<y||l>x&&d>x)continue;p=Math.min(l,d),f=Math.max(l,d)}for(;p<f;)g=Math.floor((p-b)/c),ps(g,l,u,d,_,n),p+=c;m=Math.floor((f-b)/c),m>g&&ps(m,l,u,d,_,n)}this._accelerationMap=n}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const e=this._currentY*this._stepY+this._offsetY;let s,i;if(this._currentX++,this._gridType===Dt.Q1.Random){const r=(this._currentX%ls+ls)%ls,n=(this._currentY%ls+ls)%ls;s=this._graphicOriginX+t+this._stepX*this._randomness*(.5-_s._randValues[n*ls+r])*2/3,i=this._graphicOriginY+e+this._stepY*this._randomness*(.5-_s._randValues[n*ls+r+1])*2/3}else s=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,i=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e;if(!this._testInsidePolygon||this._isInsidePolygon(s,i,this._geometryCursor))return this._internalPlacement.setTranslate(s,i),this._internalPlacement}}_isInsidePolygon(t,e,s){if(null==this._accelerationMap)return function(t,e,s){let i,r,n,o,a=0;for(t+=us,e+=us,s.reset();s.nextPath();)if(s.nextPoint())for(i=s.x,r=s.y;s.nextPoint();i=n,r=o)n=s.x,o=s.y,r>e!=o>e&&((n-i)*(e-r)-(o-r)*(t-i)>0?a++:a--);return 0!==a}(t,e,s);t+=us,e+=us;const i=this._verticalSubdivision,r=i?e:t,n=Math.floor((r-this._polygonMin)/this._delta),o=this._accelerationMap.get(n);if(!o)return!1;let a,h,c,l=0;for(const s of o){if(a=s[0],h=s[1],i){if(a[1]>e==h[1]>e)continue;c=(h[0]-a[0])*(e-a[1])-(h[1]-a[1])*(t-a[0])}else{if(a[0]>t==h[0]>t)continue;c=(h[1]-a[1])*(t-a[0])-(h[0]-a[0])*(e-a[1])}c>0?l++:l--}return 0!==l}}function ps(t,e,s,i,r,n){let o=n.get(t);o||(o=[],n.set(t,o)),o.push([[e,s],[i,r]])}class fs{static{this.instance=null}static local(){return null===fs.instance&&(fs.instance=new fs),fs.instance}execute(t,e,s,i,r){return new gs(t,e,s)}}class gs extends Wt{constructor(t,e,s){super(t),this._curveHelper=new jt,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._relativeTo=e.relativeTo,this._position=void 0!==e.startPointOffset?e.startPointOffset*s:0,this._epsilon=.001*s}processPath(t){const e=this._position;if(this._relativeTo===Dt.ip.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[e,s]=[t.x,t.y],[i,r]=[0,0];const n=[0,0];for(;t.nextPoint();){i=t.x,r=t.y;const o=this._curveHelper.getLength(e,s,i,r);if(o<this._epsilon){e=i,s=r;continue}const a=.5+this._position/o,[h,c]=this._curveHelper.getAngleCS(n,e,s,i,r,a),l=this._curveHelper.getCoord2D(e,s,i,r,a);return this.internalPlacement.setTranslate(l[0]-this._offset*c,l[1]+this._offset*h),this._angleToLine&&this.internalPlacement.setRotateCS(h,c),this.internalPlacement}}return this.iteratePath=!1,null}const s=this._relativeTo===Dt.ip.LineEnd;return this.onLine(t,e,s)}onLine(t,e,s){let i,r=!1;switch(this._relativeTo){case Dt.ip.LineMiddle:default:t.seekPathStart(),i=t.pathLength()/2+e;break;case Dt.ip.LineBeginning:i=e;break;case Dt.ip.LineEnd:i=e,r=!0}s?t.seekPathEnd():t.seekPathStart();let n=0;if(s?t.prevPoint():t.nextPoint()){let[e,o]=[t.x,t.y],[a,h]=[0,0];const c=[0,0];for(;s?t.prevPoint():t.nextPoint();){a=t.x,h=t.y;const s=this._curveHelper.getLength(e,o,a,h);if(n+s>i){const t=(i-n)/s,[l,u]=this._curveHelper.getAngleCS(c,e,o,a,h,t),d=this._curveHelper.getCoord2D(e,o,a,h,t),_=r?-this._offset:this._offset;return this.internalPlacement.setTranslate(d[0]-_*u,d[1]+_*l),this._angleToLine&&(r?this.internalPlacement.setRotateCS(-l,-u):this.internalPlacement.setRotateCS(l,u)),this.internalPlacement}e=a,o=h,n+=s}}return null}}class ms{static{this.instance=null}static local(){return null===ms.instance&&(ms.instance=new ms),ms.instance}execute(t,e,s,i,r){return new ys(t,e,s)}}class ys extends Wt{constructor(t,e,s){super(t),this._curveHelper=new jt,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._endPoints=void 0===e.placeOnEndPoints||e.placeOnEndPoints,this._controlPoints=void 0===e.placeOnControlPoints||e.placeOnControlPoints,this._regularVertices=void 0===e.placeOnRegularVertices||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(0!==this._offset){const t=Math.cos(e[2]),r=Math.sin(e[2]);s-=this._offset*r,i+=this._offset*t}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let s=0,i=!1,r=0,n=0;if(t.seekPathStart(),t.nextPoint()){let o=t.x,a=t.y,h=t.getControlPoint(),c=!0,l=t.nextPoint();for(;l;){const u=t.x,d=t.y,_=t.getControlPoint();(this._angleToLine||0!==this._offset)&&(r=this._curveHelper.getAngle(o,a,u,d,0)),c?(c=!1,e?(s=r,i=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,r])):h?this._controlPoints&&this._tags.push([o,a,xs(n,r)]):this._regularVertices&&this._tags.push([o,a,xs(n,r)]),(this._angleToLine||0!==this._offset)&&(n=this._curveHelper.getAngle(o,a,u,d,1)),l=t.nextPoint(),l||(e?_||i?this._controlPoints&&this._tags.push([u,d,xs(n,s)]):this._regularVertices&&this._tags.push([u,d,xs(n,s)]):(this._endPoints||this._controlPoints&&_)&&this._tags.push([u,d,n])),o=u,a=d,h=_}}this._tagIterator=0}}function xs(t,e){const s=Math.PI;for(;Math.abs(e-t)>s+2e-15;)e-t>s?e-=2*s:e+=2*s;return(t+e)/2}var bs=s(12176);function ws(t){if(0===t.totalSize)return null;const e=(0,me.z8)(t);if(!e)return null;const s=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*222045e-19;let i=0,r=0;t.reset();for(let e=0;t.nextPath();e++){const s=t.getCurrentRingArea();s>r&&(r=s,i=e)}if(t.seekPath(i),0===t.pathSize)return null;t.seekPathStart();const n=(0,me.B$)(t);if(Math.abs(r)<=2*s*s)return[(n[0]+n[2])/2,(n[1]+n[3])/2];t.seekPathStart();const o=(0,ke.w2)(t,(0,H.vt)());if(null===o)return null;if(t.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],c=[NaN,NaN,NaN,NaN];let l=!1,u=Is(o,t,!0);0===u.distance&&(l=!0,a[0][0]=o[0],a[0][1]=o[1],u=Is(o,t,!1)),h[0]=u.distance,c[0]=0;const d=[NaN,NaN];let _=!1,p=.25,f=-1,g=NaN;do{if(g=NaN,a[1]=Ss(t,Es(n[0],n[2],p),0,e),isNaN(a[1][0])||isNaN(a[1][1])||(u=Is(a[1],t,!1),g=u.distance),!isNaN(g)&&g>s&&vs(a[1],t))_=!0,h[1]=g,c[1]=Os(a[1],o);else if(!isNaN(g)&&g>f&&(f=g,d[0]=a[1][0],d[1]=a[1][1]),p-=.01,p<.1){if(!(f>=0))break;_=!0,h[1]=f,a[1][0]=d[0],a[1][1]=d[1],c[1]=Os(a[1],o)}}while(!_);_=!1,p=.5,f=-1;let m=.01,y=1;do{if(g=NaN,a[2]=Ss(t,Es(n[0],n[2],p),0,e),isNaN(a[2][0])||isNaN(a[2][1])||(u=Is(a[2],t,!1),g=u.distance),!isNaN(g)&&g>s&&vs(a[2],t))_=!0,h[2]=g,c[2]=Os(a[2],o);else if(!isNaN(g)&&g>f)f=g,d[0]=a[2][0],d[1]=a[2][1];else if(g>f&&(f=g,d[0]=a[2][0],d[1]=a[2][1]),p=.5+m*y,m+=.01,y*=-1,p<.3||p>.7){if(!(f>=0))break;_=!0,h[2]=f,a[2][0]=d[0],a[2][1]=d[1],c[2]=Os(a[2],o)}}while(!_);_=!1,p=.75,f=-1;do{if(g=NaN,a[3]=Ss(t,Es(n[0],n[2],p),0,e),isNaN(a[3][0])||isNaN(a[3][1])||(u=Is(a[3],t,!1),g=u.distance),!isNaN(g)&&g>s&&vs(a[3],t))_=!0,h[3]=g,c[3]=Os(a[3],o);else if(g>f&&(f=g,d[0]=a[3][0],d[1]=a[3][1]),p+=.01,p>.9){if(!(f>=0))break;_=!0,h[3]=f,a[3][0]=d[0],a[3][1]=d[1],c[3]=Os(a[3],o)}}while(!_);const x=[0,1,2,3],b=l?0:1;let w;for(let t=b;t<4;t++)for(let t=b;t<3;t++){const e=c[t],s=c[t+1];zs(e,s)>0&&(w=x[t],x[t]=x[t+1],x[t+1]=w,c[t]=s,c[t+1]=e)}let v=b,I=0,S=0;for(let t=b;t<4;t++){switch(t){case 0:S=2*h[x[t]];break;case 1:S=1.66666666*h[x[t]];break;case 2:S=1.33333333*h[x[t]];break;case 3:S=h[x[t]]}S>I&&(I=S,v=x[t])}return a[v]}function vs(t,e){let s,i,r,n,o=0;for(e.reset();e.nextPath()&&e.nextPoint();)for(s=e.x,i=e.y;e.nextPoint();s=r,i=n)r=e.x,n=e.y,i>t[1]!=n>t[1]&&((r-s)*(t[1]-i)-(n-i)*(t[0]-s)>0?o++:o--);return 0!==o}function Is(t,e,s){if(s&&vs(t,e))return{coord:t,distance:0};let i=1/0,r=0,n=0,o=[0,0],a=[0,0];const h=[0,0];for(e.reset();e.nextPath()&&e.nextPoint();)if(!(e.pathSize<2))for(o[0]=e.x,o[1]=e.y;e.nextPoint();o=a){a=[e.x,e.y],(0,ie.gR)(h,t,o,a);const s=Os(t,h);s<i&&(i=s,r=h[0],n=h[1])}return{coord:[r,n],distance:Math.sqrt(i)}}function Ss(t,e,s,i){const r=[e,0];let n=1/0,o=1/0,a=!1,h=!1;const c=[[e,i[1]-1],[e,i[3]+1]],l=[0,0],u=[0,0],d=[0,0],_=[[0,0],[0,0]],p=(0,H.vt)();for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(_[0][0]=t.x,_[0][1]=t.y;t.nextPoint();_[0][0]=_[1][0],_[0][1]=_[1][1]){if(_[1][0]=t.x,_[1][1]=t.y,null===Ps(p,_))continue;if(u[0]=c[0][0],u[1]=c[0][1],d[0]=c[1][0],d[1]=c[1][1],0===Cs(p,u,d))continue;if(!(0,bs.Ql)(c[0],c[1],_[0],_[1],l))continue;const e=l[1];n>o?e<n&&(n=e,a=!0):e<o&&(o=e,h=!0)}return a&&h?r[1]=(n+o)/2:r[0]=r[1]=NaN,r}function Ps(t,e){if(e.length<2)return null;t||(t=(0,H.vt)());const[s,i]=e[0],[r,n]=e[1];return t[0]=Math.min(s,r),t[1]=Math.min(i,n),t[2]=Math.max(s,r),t[3]=Math.max(i,n),t}const Ms=1,As=4,Ts=3,ks=12;function Cs(t,e,s){let i=Fs(e,t),r=Fs(s,t);const n=t[0],o=t[1],a=t[2],h=t[3];if(i&r)return 0;if(!(i|r))return 4;const c=(i?1:0)|(r?2:0);do{const c=s[0]-e[0],l=s[1]-e[1];if(c>l)i&Ts?(i&Ms?(e[1]+=l*(n-e[0])/c,e[0]=n):(e[1]+=l*(a-e[0])/c,e[0]=a),i=Fs(e,t)):r&Ts?(r&Ms?(s[1]+=l*(n-s[0])/c,s[0]=n):(s[1]+=l*(a-s[0])/c,s[0]=a),r=Fs(s,t)):i?(i&As?(e[0]+=c*(o-e[1])/l,e[1]=o):(e[0]+=c*(h-e[1])/l,e[1]=h),i=Fs(e,t)):(r&As?(s[0]+=c*(o-s[1])/l,s[1]=o):(s[0]+=c*(h-s[1])/l,s[1]=h),r=Fs(s,t));else if(i&ks?(i&As?(e[0]+=c*(o-e[1])/l,e[1]=o):(e[0]+=c*(h-e[1])/l,e[1]=h),i=Fs(e,t)):r&ks?(r&As?(s[0]+=c*(o-s[1])/l,s[1]=o):(s[0]+=c*(h-s[1])/l,s[1]=h),r=Fs(s,t)):i?(i&Ms?(e[1]+=l*(n-e[0])/c,e[0]=n):(e[1]+=l*(a-e[0])/c,e[0]=a),i=Fs(e,t)):(r&Ms?(s[1]+=l*(n-s[0])/c,s[0]=n):(s[1]+=l*(a-s[0])/c,s[0]=a),r=Fs(s,t)),i&r)return 0}while(i|r);return c}function Fs(t,e){return(t[0]<e[0]?1:0)|(t[0]>e[2]?1:0)<<1|(t[1]<e[1]?1:0)<<2|(t[1]>e[3]?1:0)<<3}function Es(t,e,s){return t+(e-t)*s}function Os(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function zs(t,e){if(t<e)return-1;if(t>e)return 1;if(t===e)return 0;const s=isNaN(t),i=isNaN(e);return s<i?-1:s>i?1:0}class Rs{static{this.instance=null}static local(){return null===Rs.instance&&(Rs.instance=new Rs),Rs.instance}execute(t,e,s,i,r){return new Ls(t,e,s)}}class Ls{constructor(t,e,s){this._geometryCursor=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?e.offsetY*s:0,this._method=void 0!==e.method?e.method:Dt.YI.OnPolygon,this._placementPerPart=void 0!==e.placePerPart&&e.placePerPart,this._internalPlacement=new Bt}next(){const t=this._geometryCursor;if(!t)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(t);for(;t.nextPath();)if(!(t.getCurrentRingArea()<0))return this._polygonCenter(t.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(t){let e=!1;switch(this._method){case Dt.YI.CenterOfMass:{const s=(0,ke.TP)(t);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}break;case Dt.YI.BoundingBoxCenter:{const s=(0,me.z8)(t);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),e=!0)}break;case Dt.YI.OnPolygon:default:{const s=ws(t);null!==s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}}function Ds(t){if(!t)return null;switch(t.type){case"CIMGeometricEffectAddControlPoints":return Nt.local();case"CIMGeometricEffectArrow":return Xt.local();case"CIMGeometricEffectBuffer":return Kt.local();case"CIMGeometricEffectControlMeasureLine":return re.local();case"CIMGeometricEffectCut":return oe.local();case"CIMGeometricEffectDashes":return _e.local();case"CIMGeometricEffectDonut":return fe.local();case"CIMGeometricEffectJog":return Ie.local();case"CIMGeometricEffectMove":return Pe.local();case"CIMGeometricEffectOffset":return Ae.local();case"CIMGeometricEffectRadial":return Ce.local();case"CIMGeometricEffectReverse":return Ee.local();case"CIMGeometricEffectRotate":return Re.local();case"CIMGeometricEffectScale":return De.local();case"CIMGeometricEffectSuppress":return Be.local();case"CIMGeometricEffectTaperedPolygon":return Ke.local();case"CIMGeometricEffectWave":return es.local();case"CIMGeometricEffectEnclosingPolygon":return ye.local()}return null}class Ns{static getPlacement(t,e,s,i,r,n){const o=function(t){if(!t)return null;switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":return is.local();case"CIMMarkerPlacementAtExtremities":return ns.local();case"CIMMarkerPlacementAtRatioPositions":return as.local();case"CIMMarkerPlacementInsidePolygon":return ds.local();case"CIMMarkerPlacementOnLine":return fs.local();case"CIMMarkerPlacementOnVertices":return ms.local();case"CIMMarkerPlacementPolygonCenter":return Rs.local()}return null}(s);return o?(-1===e&&t.invertY(),o.execute(t,s,i,r,n)):null}}var Gs=s(68197);function Bs(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||0,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||100]}function qs(t){return 1<<t}function Ws(t){let e=0;for(const[s,i]of t)i&&(e|=1<<s);return e}function Ys(t){let e;if(!t)return[0,0,0,0];if("string"==typeof t){const s=Gs.A.fromString(t);if(!s)return D.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils").errorOnce(new i.A("mapview:mesh-processing","Unable to parse string into color",{color:t})),[0,0,0,0];e=s.toArray()}else e=t;const[s,r,n,o]=e;return[s*(o/255),r*(o/255),n*(o/255),o]}function Us(t){switch(t){case"butt":case Dt.uT.Butt:return Dt.xR.BUTT;case"round":case Dt.uT.Round:return Dt.xR.ROUND;case"square":case Dt.uT.Square:return Dt.xR.SQUARE}}function js(t){switch(t){case"bevel":case Dt.wd.Bevel:return Dt.JO.BEVEL;case"miter":case Dt.wd.Miter:return Dt.JO.MITER;case"round":case Dt.wd.Round:return Dt.JO.ROUND}}function Vs(t,e){return Math.round(Math.min(Math.sqrt(t*e),255))}function Xs(t,e){return Math.round(t*e)/e}const Hs=0,Qs=1,Zs=2,$s=3,Js=4,Ks=5;new(s(32488).A),s(11831),s(92602),new Map,new Set;var ti=s(34727);s(40804),s(5760);var ei=s(34304);function si(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function ii(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],h=e[5],c=s[0],l=s[1],u=s[2],d=s[3],_=s[4],p=s[5];return t[0]=i*c+n*l,t[1]=r*c+o*l,t[2]=i*u+n*d,t[3]=r*u+o*d,t[4]=i*_+n*p+a,t[5]=r*_+o*p+h,t}function ri(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],h=e[5],c=Math.sin(s),l=Math.cos(s);return t[0]=i*l+n*c,t[1]=r*l+o*c,t[2]=i*-c+n*l,t[3]=r*-c+o*l,t[4]=a,t[5]=h,t}function ni(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],h=e[5],c=s[0],l=s[1];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=i*c+n*l+a,t[5]=r*c+o*l+h,t}function oi(t,e){const s=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=s,t[2]=-s,t[3]=i,t[4]=0,t[5]=0,t}function ai(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t[2]=e[2]-s[2],t[3]=e[3]-s[3],t[4]=e[4]-s[4],t[5]=e[5]-s[5],t}const hi=ii,ci=ai;function li(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function ui(t,e,s,i){const r=e[i],n=e[i+1];t[i]=s[0]*r+s[2]*n+s[4],t[i+1]=s[1]*r+s[3]*n+s[5]}function di(t,e,s,i=0,r=0,n=2){const o=r||e.length/n;for(let r=i;r<o;r++)ui(t,e,s,r*n)}Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t[2]=e[2]+s[2],t[3]=e[3]+s[3],t[4]=e[4]+s[4],t[5]=e[5]+s[5],t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},equals:function(t,e){const s=t[0],i=t[1],r=t[2],n=t[3],o=t[4],a=t[5],h=e[0],c=e[1],l=e[2],u=e[3],d=e[4],_=e[5],p=(0,ei.FD)();return Math.abs(s-h)<=p*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(i-c)<=p*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(r-l)<=p*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-u)<=p*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(o-d)<=p*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-_)<=p*Math.max(1,Math.abs(a),Math.abs(_))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)},fromRotation:oi,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},identity:si,invert:function(t,e){const s=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5];let h=s*n-i*r;return h?(h=1/h,t[0]=n*h,t[1]=-i*h,t[2]=-r*h,t[3]=s*h,t[4]=(r*a-n*o)*h,t[5]=(i*o-s*a)*h,t):null},mul:hi,multiply:ii,multiplyScalar:function(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*s,t[5]=e[5]*s,t},multiplyScalarAndAdd:function(t,e,s,i){return t[0]=e[0]+s[0]*i,t[1]=e[1]+s[1]*i,t[2]=e[2]+s[2]*i,t[3]=e[3]+s[3]*i,t[4]=e[4]+s[4]*i,t[5]=e[5]+s[5]*i,t},rotate:ri,scale:function(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],h=e[5],c=s[0],l=s[1];return t[0]=i*c,t[1]=r*c,t[2]=n*l,t[3]=o*l,t[4]=a,t[5]=h,t},set:function(t,e,s,i,r,n,o){return t[0]=e,t[1]=s,t[2]=i,t[3]=r,t[4]=n,t[5]=o,t},str:function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},sub:ci,subtract:ai,translate:ni},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,clone:function(t){const e=new Float32Array(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},create:li,fromValues:function(t,e,s,i,r,n){const o=new Float32Array(6);return o[0]=t,o[1]=e,o[2]=s,o[3]=i,o[4]=r,o[5]=n,o},transform:ui,transformMany:di},Symbol.toStringTag,{value:"Module"}));var _i,pi,fi=s(88340);!function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"}(_i||(_i={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(pi||(pi={}));var gi=s(18989);class mi{constructor(t,e,s,i){this.transformedX=0,this.transformedY=0,this.center=(0,fi.fA)(t,e),this.centerT=(0,fi.vt)(),this.halfWidth=s/2,this.halfHeight=i/2,this.width=s,this.height=i}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new mi(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,e=4){const s=Math.abs(t.centerT[0]-this.centerT[0]),i=Math.abs(t.centerT[1]-this.centerT[1]),r=(t.halfWidth+this.halfWidth+e)/s,n=(t.halfHeight+this.halfHeight+e)/i,o=Math.min(r,n);return Math.log2(o)}extend(t){const e=Math.min(this.xmin,t.xmin),s=Math.min(this.ymin,t.ymin),i=Math.max(this.xmax,t.xmax)-e,r=Math.max(this.ymax,t.ymax)-s,n=e+i/2,o=s+r/2;this.width=i,this.height=r,this.halfWidth=i/2,this.halfHeight=r/2,this.x=n,this.y=o}static deserialize(t){const e=t.readF32(),s=t.readF32(),i=t.readInt32(),r=t.readInt32();return new mi(e,s,i,r)}}const yi=Math.PI/180;class xi{constructor(t,e,s,i){this._rotationT=li(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const r=s.rect,n=new Float32Array(8);t*=i,e*=i;const o=s.code?r.width*i:s.metrics.width,a=s.code?r.height*i:s.metrics.height;this.width=o,this.height=a,n[0]=t,n[1]=e,n[2]=t+o,n[3]=e,n[4]=t,n[5]=e+a,n[6]=t+o,n[7]=e+a,this._data=n,this._setTextureCoords(r),this._scale=i,this._mosaic=s,this.x=t,this.y=e,this.maxOffset=Math.max(t+o,e+a)}get mosaic(){return this._mosaic}set angle(t){this._angle=t,oi(this._rotationT,-t),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,s=e*this._scale,i=Math.abs(t)*this._scale,r=new Float32Array(8);r[0]=this.x,r[1]=this.y,r[2]=this.x+s,r[3]=this.y,r[4]=this.x,r[5]=this.y+i,r[6]=this.x+s,r[7]=this.y+i,di(r,r,ii(li(),this._rotationT,this._transform));let n=1/0,o=1/0,a=-1/0,h=-1/0;for(let t=0;t<4;t++){const e=r[2*t],s=r[2*t+1];n=Math.min(n,e),o=Math.min(o,s),a=Math.max(a,e),h=Math.max(h,s)}const c=a-n,l=h-o,u=n+c/2,d=o+l/2;this._bounds=new mi(u,d,c,l)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const t=ii(li(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],(0,G.l0)(this._offsets.topLeft,this._offsets.topLeft,t),(0,G.l0)(this._offsets.topRight,this._offsets.topRight,t),(0,G.l0)(this._offsets.bottomLeft,this._offsets.bottomLeft,t),(0,G.l0)(this._offsets.bottomRight,this._offsets.bottomRight,t)}_setTextureCoords({x:t,y:e,width:s,height:i}){this._texcoords={topLeft:[t,e],topRight:[t+s,e],bottomLeft:[t,e+i],bottomRight:[t+s,e+i]}}}const bi=(t,e)=>({code:0,page:0,sdf:!0,rect:new gi.A(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:t,left:0,top:0}});function wi(t,e){return t.forEach((t=>(0,G.l0)(t,t,e))),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class vi{constructor(t,e,s){this._rotation=0,this._decorate(t,e,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==s.angle,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const e of t)e.setTransform(this._transform)}setRotation(t){if(0===t&&0===this._rotation)return;this._rotation=t;const e=this._transform;ii(e,oi(li(),t),e);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,s){if(!s.decoration||"none"===s.decoration||!t.length)return;const i=s.scale,r="underline"===s.decoration?26:16,n=t[0].textureBinding;for(const s of e){const e=s.startX*i,o=s.startY*i,a=(s.width+s.glyphWidthEnd)*i;t.push(new xi(e,o+r*i,bi(a,n),1))}}shapeBackground(t){const e=(1.5+(this._borderLineSizePx||0))/2,s=this._borderLineSizePx?e:0,{xmin:i,ymin:r,xmax:n,ymax:o,x:a,y:h,width:c,height:l}=this.bounds,u=[i-8,r-8],d=[n+8,r-8],_=[i-8,o+8],p=[n+8,o+8],f=wi([[u[0]-e,u[1]-e],[d[0]+e,d[1]-e],[u[0]+s,u[1]+s],[d[0]-s,d[1]+s]],t),g=wi([[_[0]+s,_[1]-s],[p[0]-s,p[1]-s],[_[0]-e,_[1]+e],[p[0]+e,p[1]+e]],t),m=wi([[u[0]-e,u[1]-e],[u[0]+s,u[1]+s],[_[0]-e,_[1]+e],[_[0]+s,_[1]-s]],t),y=wi([[d[0]-s,d[1]+s],[d[0]+e,d[1]-e],[p[0]-s,p[1]-s],[p[0]+e,p[1]+e]],t),x={main:wi([u,d,_,p],t),top:f,bot:g,left:m,right:y};return[new mi(a,h,c+2*e,l+2*e),x]}get boundsT(){const t=this.bounds,e=(0,G.hZ)((0,fi.vt)(),t.x,t.y);if((0,G.l0)(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new mi(e[0],e[1],s,s)}return new mi(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,r=0;for(const n of t)e=Math.min(e,n.xTopLeft),s=Math.min(s,n.yTopLeft),i=Math.max(i,n.xBottomRight),r=Math.max(r,n.yBottomRight);const n=i-e,o=r-s;return new mi(e+n/2,s+o/2,n,o)}_createGlyphTransform(t,e){const s=yi*e.angle,i=li(),r=(0,fi.vt)();return ni(i,i,(0,G.hZ)(r,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?ri(i,i,s):(ni(i,i,(0,G.hZ)(r,t.x,t.y)),ri(i,i,s),ni(i,i,(0,G.hZ)(r,-t.x,-t.y))),i}}class Ii{constructor(t,e,s,i,r,n){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].metrics.width),this.width=i,this.yMin=r,this.yMax=n}}const Si=t=>10===t,Pi=t=>32===t;function Mi(t,e){const s=e.scale,i=new Array,{glyphs:r,isRightToLeft:n}=t,o=function(t,e,s){const i=new Array,r=1/s.scale,n=s.maxLineWidth*r,o=e?t.length-1:0,a=e?-1:t.length,h=e?-1:1;let c=o,l=0,u=0,d=c,_=d,p=0,f=1/0,g=0;for(;c!==a;){const{code:e,metrics:s}=t[c],r=Math.abs(s.top);if(Si(e)||Pi(e)||(f=Math.min(f,r),g=Math.max(g,r+s.height)),Si(e))c!==o&&(i.push(new Ii(t,d,c-h,l,f===1/0?0:f,g)),f=1/0,g=0),l=0,d=c+h,_=c+h,u=0;else if(Pi(e))_=c+h,u=0,p=s.advance,l+=s.advance;else if(l>n){if(_!==d){const e=_-2*h;l-=p,i.push(new Ii(t,d,e,l-u,f,g)),f=1/0,g=0,d=_,l=u}else i.push(new Ii(t,d,c-h,l,f,g)),f=1/0,g=0,d=c,_=c,l=0;l+=s.advance,u+=s.advance}else l+=s.advance,u+=s.advance;c+=h}const m=new Ii(t,d,c-h,l,f,g);return m.start>=0&&m.end<t.length&&i.push(m),i}(r,n,e),a=o.length?function(t,e){let s=0;for(let e=0;e<t.length;e++){const{width:i}=t[e];s=Math.max(i,s)}const i="underline"===e.decoration?4:0,r=t[0].yMin;return{x:0,y:r,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-r,width:s}}(o,e):{y:0,height:0},h=function(t){if(!t)return _i.Center;switch(t){case"Left":case"left":return _i.Left;case"Right":case"right":return _i.Right;case"Justify":return D.A.getLogger("esri.views.2d.engine.webgl.alignmentUtils").warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),_i.Center;case"Center":case"center":return _i.Center}}(e.horizontalAlignment),c=function(t){if(!t)return pi.Center;switch(t){case"Top":case"top":return pi.Top;case"Center":case"middle":return pi.Center;case"Baseline":case"baseline":return pi.Baseline;case"Bottom":case"bottom":return pi.Bottom}}(e.verticalAlignment),l=c===pi.Baseline?1:0,u=l?0:c-1,d=(1-l)*-a.y+u*(a.height/2)+-22*(l?1:0);for(let n=0;n<o.length;n++){const{start:a,end:c,width:l}=o[n];let u=-1*(h+1)*(l/2)-3;const _=(t.isRightToLeft?o.length-1-n:n)*e.lineHeight+d-3;o[n].startX=u,o[n].startY=_;for(let t=a;t<=c;t++){const e=r[t];if(Si(e.code))continue;const n=new xi(u+e.metrics.left,_-e.metrics.top,e,s);u+=e.metrics.advance,i.push(n)}}return new vi(i,o,e)}var Ai=s(39829);Math.PI,s(59868);var Ti=s(13195);function ki(t){if(!t)return 0;switch(t.type){case"CIMGeometricEffectArrow":return Math.abs(.5*t.width);case"CIMGeometricEffectBuffer":return Math.abs(t.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(t.length);case"CIMGeometricEffectJog":return Math.abs(.5*t.length);case"CIMGeometricEffectMove":return Math.max(Math.abs((0,de.$w)(t.offsetX)),Math.abs((0,de.$w)(t.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(t.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(t.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(t.fromWidth),Math.abs(t.toWidth));case"CIMGeometricEffectWave":return Math.abs(t.amplitude);case"CIMGeometricEffectDonut":return Math.abs(t.width)}}function Ci(t){if(!t)return 0;let e=0;for(const s of t)e+=ki(s);return e}Math.PI,Math.PI;const Fi=96/72;class Ei{static executeEffects(t,e,s,i,r){const n=Fi,o=Ci(t);let a=new $t(e);for(const e of t){const t=Ds(e);t&&(a=t.execute(a,e,n,s,i,o,r))}return a}static applyEffects(t,e,s){if(!t)return e;const i=Ci(t);let r,n=new $t(Tt.fromJSONCIM(e));for(const e of t){const t=Ds(e);t&&(n=t.execute(n,e,1,null,s,i,!1))}const o=[];let a=null;for(;r=n.next();)o.push(...(0,Pt.x)(r)),a=r.geometryType;return 0===o.length||null===a?null:"esriGeometryPolygon"===a?{rings:o}:{paths:o}}}let Oi=null;function zi(){return Oi}const Ri=new Float32Array(1),Li=new Uint32Array(Ri.buffer);function Di(t){const e=function(t){return Ri[0]=t,Li[0]}(t),s=e>>>31;let i=e>>>23&255,r=8388607&e;return i-=127,i>15?s<<15|31744:i<-25?0:(i<-14&&(r+=8388608,r/=2**(-14-i),i=-15),i+=15,r/=8192,r=function(t){const e=Math.floor(t),s=t-e;return e<1023&&(s>.5||.5===s&&e%2==1)?e+1:e}(r),s<<15|i<<10|r)}function Ni(t,e,s,i,r,n,o){if(t.primitiveName===e){let e=i?.readWithDefault(r,n,t[s]&&o);return"text"===t.type&&(e=e.toString()),void(t[s]=e)}if("type"in t&&null!=t.type){if(t.effects)for(const a of t.effects)Ni(a,e,s,i,r,n,o);switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.symbolLayers)for(const a of t.symbolLayers)Ni(a,e,s,i,r,n,o);break;case"CIMTextSymbol":t.symbol&&Ni(t.symbol,e,s,i,r,n,o);break;case"CIMHatchFill":t.lineSymbol&&Ni(t.lineSymbol,e,s,i,r,n,o);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(t.markerPlacement&&Ni(t.markerPlacement,e,s,i,r,n,o),"CIMVectorMarker"===t.type&&t.markerGraphics)for(const a of t.markerGraphics)Ni(a,e,s,i,r,n,o),Ni(a.symbol,e,s,i,r,n,o)}}}function Gi(t){const e=Math.max(1.25*t.width,20);return null!=t.effects&&t.effects.length>0?400:e}var Bi=s(63907);function qi(t){switch(t){case Bi.pe.BYTE:case Bi.pe.UNSIGNED_BYTE:return 1;case Bi.pe.SHORT:case Bi.pe.UNSIGNED_SHORT:case Bi.pe.HALF_FLOAT:return 2;case Bi.pe.FLOAT:case Bi.pe.INT:case Bi.pe.UNSIGNED_INT:return 4}}class Wi{static fromVertexSpec(t,e){const{attributes:s,optionalAttributes:i}=t;let r,n,o;const a=[];for(const t in s){if(s[t].otherSource)continue;const e=s[t];"position"===e.pack?r={...e,name:t,offset:0}:"id"===e.pack?n={...e,name:t,offset:4}:"bitset"===t?o={...e,name:t,offset:7}:a.push({...e,name:t})}for(const t in i)if(!0===e[t]){const e=i[t];a.push({...e,name:t})}const h=function(t){const e=[],s=[],i=[];for(const r of t){const t=qi(r.type)*r.count;switch(t%2||t%4||4){case 4:e.push(r);continue;case 2:s.push(r);continue;case 1:i.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...s),e.push(...i),e}(a),c=[];let l=8,u=1;for(const t of h)c.push({...t,offset:l}),l+=qi(t.type)*t.count,t.packAlternating&&(u=Math.max(t.packAlternating.count,u));const d=Uint32Array.BYTES_PER_ELEMENT,_=l%d;return new Wi(r,n,o,c,l+(_?d-_:0),u)}constructor(t,e,s,i,r,n){this.position=t,this.id=e,this.bitset=s,this.standardAttributes=i,this.stride=r,this.packVertexCount=n,i.push(s),this._attributes=[t,e,s,...i]}get attributeLayout(){if(!this._attributeLayout){const t=function(t){const e=t.map((({name:t,count:e,type:s})=>`${t}.${e}.${s}`)).join(",");return(0,wt.Wm)(e)}(this._attributes),e=this._attributes.map((t=>({name:t.name,count:t.count,offset:t.offset,type:t.type,packPrecisionFactor:t.packPrecisionFactor,normalized:t.normalized??!1})));this._attributeLayout={attributes:e,hash:t,stride:this.stride}}return this._attributeLayout}}class Yi{static fromVertexSpec(t,e){const s=Wi.fromVertexSpec(t,e);return new Yi(s)}constructor(t){this._spec=t,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(t,e,s,i,r,n){for(let t=0;t<this._spec.packVertexCount;t++){const o=t*this._spec.stride;this._packPosition(s,i,o),this._packId(e,o);const a=this._spec.bitset;if(n){if(a.packTessellation){const t=a.packTessellation(n,r,s,i);this._pack(t,a,o)}for(const t of this._spec.standardAttributes)if(null!=t.packTessellation){const e=t.packTessellation(n,r,s,i);this._pack(e,t,o)}else if(t.packAlternating?.packTessellation){const e=t.packAlternating.packTessellation(n,r,s,i);for(let s=0;s<this._spec.packVertexCount;s++){const i=e[s];this._pack(i,t,s*this._spec.stride)}}}}t.vertexWriteRegion(this._packedU32View)}pack(t,e){for(const s of this._spec.standardAttributes)if(s.pack&&"string"!=typeof s.pack){const i=s.pack(t,e);for(let t=0;t<this._spec.packVertexCount;t++)this._pack(i,s,t*this._spec.stride)}else if(s.packAlternating?.pack){const i=s.packAlternating.pack(t,e);for(let t=0;t<this._spec.packVertexCount;t++){const e=i[t];this._pack(e,s,t*this._spec.stride)}}}_packPosition(t,e,s){const{offset:i}=this._spec.position,r=this._spec.position.packPrecisionFactor??1,n=function(t,e){return 65535&t|e<<16}(t*r,e*r);this._dataView.setUint32(s+i,n,!0)}_packId(t,e){const s=t*(this._spec.id.packPrecisionFactor??1),i=4278190080&this._dataView.getUint32(e+this._spec.id.offset,!0);this._dataView.setUint32(e+this._spec.id.offset,s|i,!0)}_pack(t,e,s){!function(t,e,s,i){const r=s.packPrecisionFactor??1;switch(s.type){case Bi.pe.BYTE:if(1===s.count)t.setInt8(i+s.offset,e*r);else for(let n=0;n<s.count;n++){const o=n*Int8Array.BYTES_PER_ELEMENT;t.setInt8(i+s.offset+o,e[n]*r)}break;case Bi.pe.UNSIGNED_BYTE:if(1===s.count)t.setUint8(i+s.offset,e*r);else for(let n=0;n<s.count;n++){const o=n*Uint8Array.BYTES_PER_ELEMENT;t.setUint8(i+s.offset+o,e[n]*r)}break;case Bi.pe.SHORT:if(1===s.count)t.setInt16(i+s.offset,e*r,!0);else for(let n=0;n<s.count;n++){const o=n*Int16Array.BYTES_PER_ELEMENT;t.setInt16(i+s.offset+o,e[n]*r,!0)}break;case Bi.pe.UNSIGNED_SHORT:if(1===s.count)t.setUint16(i+s.offset,e*r,!0);else for(let n=0;n<s.count;n++){const o=n*Uint16Array.BYTES_PER_ELEMENT;t.setUint16(i+s.offset+o,e[n]*r,!0)}break;case Bi.pe.INT:if(1===s.count)t.setInt32(i+s.offset,e*r,!0);else for(let n=0;n<s.count;n++){const o=n*Int32Array.BYTES_PER_ELEMENT;t.setInt32(i+s.offset+o,e[n]*r,!0)}break;case Bi.pe.UNSIGNED_INT:if(1===s.count)t.setUint32(i+s.offset,e*r,!0);else for(let n=0;n<s.count;n++){const o=n*Uint32Array.BYTES_PER_ELEMENT;t.setUint32(i+s.offset+o,e[n]*r,!0)}break;case Bi.pe.FLOAT:if(1===s.count)t.setFloat32(i+s.offset,e*r,!0);else for(let n=0;n<s.count;n++){const o=n*Float32Array.BYTES_PER_ELEMENT;t.setFloat32(i+s.offset+o,e[n]*r,!0)}break;case Bi.pe.HALF_FLOAT:if(1===s.count)t.setUint16(i+s.offset,Di(e*r),!0);else for(let n=0;n<s.count;n++){const o=n*Uint16Array.BYTES_PER_ELEMENT;t.setUint16(i+s.offset+o,Di(e[n]*r),!0)}}}(this._dataView,t,e,s)}}class Ui{constructor(t,e,s,i){this._instanceId=t,this._evaluator=e,this._enabledOptionalAttributes=s,this._viewParams=i,this._evaluator.evaluator=t=>this.vertexSpec.createComputedParams(t)}get _vertexPack(){if(!this._cachedVertexPack){const t=Yi.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get effectInfos(){return this._evaluator.inputMeshParams.effects?.effectInfos}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}get _preventEffectClipping(){return!1}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){(function(t){if(!t)return!1;for(const e of t)switch(e.effect.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectDonut":case"CIMGeometricEffectOffset":case"CIMGeometricEffectTaperedPolygon":case"CIMGeometricEffectEnclosingPolygon":return!0}return!1})(this.effectInfos)&&await async function(){Oi=await Promise.all([s.e(9930),s.e(9940)]).then(s.bind(s,47559))}()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const n=this.evaluatedMeshParams.effects;if(!n||0===n.length)return void this._write(t,s,void 0,r);const o=this.getEffectCursor(t,s,n);if(!o)return;let a;for(;a=o.next();)a.invertY(),this._write(t,s,a,r)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(i,this._viewParams)}hasArcadeDependency(t){return this._evaluator.hasArcadeDependency(t)}_writeVertex(t,e,s,i,r){const n=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,i,n,r)}getEffectCursor(t,e,s){const i=e.readGeometryForDisplay()?.clone();if(!i)return;const r=Tt.fromOptimizedCIM(i,e.geometryType),n=zi();r.invertY();const o=t.id||"";return Ei.executeEffects(s,r,o,n,this._preventEffectClipping)}}class ji extends Ui{}function Vi(t,e){let s;if("string"==typeof t)s=(0,wt.Wm)(t+`-seed(${e})`);else{let i=12;s=t^e;do{s=107*(s>>8^s)+i|0}while(0!==--i)}return(1+s/(1<<31))/2}function Xi(t){return Math.floor(Vi(t,Hi)*Qi)}const Hi=53290320,Qi=10;var Zi;!function(t){t.Local="Local",t.Global="Global"}(Zi||(Zi={}));class $i{generateSource(t){const e=[];for(let s=1;s<this.length;s++)e.push(`vec4 atom${s} = texture(${t.animationTexture}, (pointer + 0.5) / size);`),e.push("pointer.x += 1.0;");for(let t=0;t<this.ins;t++)e.push("top--;"),e.push(`vec4 in${this.ins-t-1} = stack[top];`);for(let t=0;t<this.outs;t++)e.push(`vec4 out${t};`);const{microcode:s}=this;for(const t of s)e.push(t);for(let t=0;t<this.outs;t++)e.push(`stack[top] = out${t};`),e.push("top++;"),e.push(`if (top >= ${nr}) { top = ${nr-1}; }`);return e}}let Ji=128;function Ki(t){return[`float duration = clamp(${t.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${t.startTimeOffset};`,`float repeatDelay = ${t.repeatDelay};`,`float timeOriginSelector = ${t.timeOriginSelector};`,`float repeatType = ${t.repeatType};`,`float easing = ${t.easing};`,`float playAnimation = ${t.playAnimation} * (1.0 - step(0.0, -${t.duration}));`,`float reverseAnimation = ${t.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${t.out} = oscillate ? 1.0 - of : of;`]}const tr={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},er={Loop:1,None:2,Oscillate:3},sr={Local:1,Global:2};function ir(t){const e=tr[t.easing],s=er[t.repeatType],i=sr[t.timeOriginSelector];return[[t.duration,t.startTimeOffset,t.repeatDelay,i],[s,e,t.playAnimation,t.reverseAnimation]]}const rr={scalar:new class extends $i{constructor(){super(...arguments),this.opcode=++Ji,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}},vector3:new class extends $i{constructor(){super(...arguments),this.opcode=++Ji,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}},vector4:new class extends $i{constructor(){super(...arguments),this.opcode=++Ji,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}},animatedTransform:new class extends $i{constructor(){super(...arguments),this.opcode=++Ji,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...Ki({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...Ki({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...Ki({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;","\n vec2 translation = vec2(\n cos1 * s1 * x2 - sin1 * s1 * y2 + x1,\n sin1 * s1 * x2 + cos1 * s1 * y2 + y1\n );\n ","out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...ir(t.translation.timing),...ir(t.rotation.timing),...ir(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,0,0]]}},animatedColor:new class extends $i{constructor(){super(...arguments),this.opcode=++Ji,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...Ki({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...Ki({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...ir(t.color.timing),...ir(t.opacity.timing)]}},animatedShift:new class extends $i{constructor(){super(...arguments),this.opcode=++Ji,this.length=4,this.ins=1,this.outs=1,this.microcode=["float fromShift = atom0.y;","float toShift = atom0.z;","float duration = atom1.x;","bool multiplyByLineLength = atom3.x == 1.0;","float fShift;","{",...Ki({duration:"duration",startTimeOffset:"atom1.y",repeatDelay:"atom1.z",timeOriginSelector:"atom1.w",repeatType:"atom2.x",easing:"atom2.y",playAnimation:"atom2.z",reverseAnimation:"atom2.w",out:"fShift"}),"}","toShift *= multiplyByLineLength ? lineLength : 1.0;","float aShift = mix(fromShift, toShift, fShift);","vec4 pShift = in0;","out0 = mod(aShift + pShift, lineLength);"]}encode(t){return[[this.opcode,t.shift.from,t.shift.to,0],...ir(t.shift.timing),[t.multiplyByLineLength?1:0,0,0,0]]}},ret:new class extends $i{constructor(){super(...arguments),this.opcode=++Ji,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}},nr=4;function or(t){return t instanceof ar?t:"object"==typeof t&&"type"in t?dr[t.type].hydrate(t):new hr(t)}class ar{constructor(t){this.inputs=t}encode(){const t=[];for(const e of this.inputs)t.push(...e.encode());return t.push(...this.instructions),t}}class hr extends ar{constructor(t){super([]),this.value=t}simplify(){return this}get instructions(){if(Array.isArray(this.value)){const[t,e,s,i]=this.value;return null!=i?rr.vector4.encode([t,e||0,s||0,i]):rr.vector3.encode([t,e||0,s||0])}return rr.scalar.encode(this.value)}}class cr extends ar{constructor(t,e){super([e]),this._config=t,this._parent=e}static hydrate(t){return new cr(t,or(t.parent))}simplify(){if(this._config.relativeTranslation||this._config.absoluteScale)return this;const t=this._parent.simplify();if(!(t instanceof hr))return this;const[e,s,i,r]=t.value,n=this._config.translation.from[0],o=this._config.translation.from[1],a=this._config.rotation.from,h=this._config.scale.from;if(n===this._config.translation.to[0]&&o===this._config.translation.to[1]&&a===this._config.rotation.to&&h===this._config.scale.to){const t=i+a,c=r*h,l=Math.sin(i),u=Math.cos(i);return new hr([u*r*n-l*r*o+e,l*r*n+u*r*o+s,t,c])}return new cr(this._config,t)}get instructions(){return rr.animatedTransform.encode(this._config)}}class lr extends ar{constructor(t,e){super([e]),this._config=t,this._parent=e}static hydrate(t){return new lr(t,or(t.parent))}simplify(){const t=this._parent.simplify();if(!(t instanceof hr))return this;const[e,s,i,r]=t.value,n=this._config.color.from[0],o=this._config.color.from[1],a=this._config.color.from[2];let h=this._config.color.from[3];const c=this._config.opacity.from;return n===this._config.color.to[0]&&o===this._config.color.to[1]&&a===this._config.color.to[2]&&h===this._config.color.to[3]&&c===this._config.opacity.to?(h*=c,new hr([e*n,s*o,i*a,r*h])):new lr(this._config,t)}get instructions(){return rr.animatedColor.encode(this._config)}}class ur extends ar{constructor(t,e){super([e]),this._config=t,this._parent=e}static hydrate(t){return new ur(t,or(t.parent))}simplify(){const t=this._parent.simplify();return t instanceof hr?new ur(this._config,t):this}get instructions(){return rr.animatedShift.encode(this._config)}}const dr={AnimatedTransform:cr,AnimatedColor:lr,AnimatedShift:ur};function _r(t){return fr(t.map((t=>mr(t))).map((t=>or(t).simplify())))}function pr(t){const e=[];return e.push(t.transform),e.push(t.fromColor),e.push(t.toColor),e.push(t.colorMix),e.push(t.toOpacity),e.push(t.opacityMix),t?.shift?e.push(t?.shift):e.push([1,1,1,1]),e}function fr(t){const e=[],s=[];let i=0;for(const r of t){const n=[...r.encode(),...rr.ret.encode()];e.push([i+t.length,0,0,0]),s.push(...n),i+=n.length}return[...e,...s]}async function gr(t,e){const s=t;let i;if("number"==typeof s||"string"==typeof s||"boolean"==typeof s)i=s;else if(Array.isArray(s))i=await Promise.all(s.map((t=>gr(t,e))));else if("object"==typeof s)if("valueExpressionInfo"in s){const{valueExpressionInfo:t}=s,{expression:r}=t;i={...s,computed:await e.createComputedField({expression:r})}}else{i={};for(const t in s)i[t]=await gr(s[t],e)}return i}function mr(t,e,s){const i=t;let r;if("number"==typeof i||"string"==typeof i||"boolean"==typeof i)r=i;else if(Array.isArray(i))r=i.map((t=>mr(t,e,s)));else if("object"==typeof i)if("type"in i&&null!=i.type&&"Process"===i.type)switch(i.op){case"ArcadeColor":{const t=mr(i.value,e,s);xr(Array.isArray(t)&&4===t.length),r=[t[0]/255,t[1]/255,t[2]/255,t[3]]}break;case"Transparency":{const t=mr(i.value,e,s);xr("number"==typeof t),r=1-t/100}break;case"Divide":case"Multiply":case"Add":{const t=mr(i.left,e,s);xr("number"==typeof t);const n=mr(i.right,e,s);switch(xr("number"==typeof n),i.op){case"Divide":r=t/n;break;case"Multiply":r=t*n;break;case"Add":r=t+n}}break;case"Random":{const t=mr(i.seed,e,s),n=mr(i.min,e,s),o=mr(i.max,e,s);r=n+Vi(Xi(e.getObjectId()||0),t)*(o-n)}break;case"Cond":{const t=mr(i.condition,e,s),n=mr(i.ifTrue,e,s),o=mr(i.ifFalse,e,s);r=t?n:o}break;case"MatchWinding":{const t=mr(i.sign,e,s);let n=mr(i.angle,e,s);if(t>0)for(;n<0;)n+=2*Math.PI;else for(;n>0;)n-=2*Math.PI;r=n}}else if("computed"in i)r=function(t){if(!("computed"in t))return t;let i=t.computed.readWithDefault(e,s,[255*t.defaultValue[0],255*t.defaultValue[1],255*t.defaultValue[2],t.defaultValue[3]]);if("string"==typeof i){const t=Gs.A.fromString(i);t&&(i=[t.r,t.g,t.b,t.a])}return i}(i);else{r={};for(const t in i)r[t]=mr(i[t],e,s)}return r}function*yr(t){const e=t;if(Array.isArray(e))for(const t of e)yield*yr(t);else if("object"==typeof e)if("type"in e&&null!=e.type&&"Process"===e.type)switch(e.op){case"ArcadeColor":case"Transparency":yield*yr(e.value);break;case"Divide":case"Multiply":case"Add":yield*yr(e.left),yield*yr(e.right);break;case"Random":yield*yr(e.seed),yield*yr(e.min),yield*yr(e.max);break;case"Cond":yield*yr(e.condition),yield*yr(e.ifTrue),yield*yr(e.ifFalse);break;case"MatchWinding":yield*yr(e.sign),yield*yr(e.angle)}else if("computed"in e)yield e.computed;else for(const t in e)yield*yr(e[t])}function xr(t){if(!t)throw new Error("Assertion failed.")}const br={type:Bi.pe.SHORT,count:2,packPrecisionFactor:_.fq,pack:({scaleInfo:t},{tileInfo:e})=>Bs(t,e)},wr={type:Bi.pe.FLOAT,count:4,packPrecisionFactor:1,packTessellation:({value1Position2Value2:t})=>(xr(t),t)},vr={type:Bi.pe.FLOAT,count:4,packPrecisionFactor:1,packTessellation:()=>[0,0,0,1]},Ir={type:Bi.pe.FLOAT,count:1,packPrecisionFactor:1,pack:()=>0},Sr={type:Bi.pe.FLOAT,count:1,packPrecisionFactor:1,packTessellation:({lineLength:t})=>t},Pr={type:Bi.pe.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},Mr={type:Bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},Ar={type:Bi.pe.FLOAT,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[t,e]},Tr={type:Bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},kr={type:Bi.pe.UNSIGNED_BYTE,count:1,pack:function(t){const{sprite:e,isMapAligned:s,colorLocked:i,scaleSymbolsProportionally:r,isStroke:n}=t;let o=0;return s&&(o|=qs(Qs)),i&&(o|=qs(Js)),e.sdf&&(o|=qs(Hs)),r&&(o|=qs(Zs)),n&&(o|=qs(Ks)),o}},Cr={type:Bi.pe.SHORT,count:2,pack:"position",packPrecisionFactor:1},Fr={marker:{type:Bi.pe.FLOAT,count:2,packAlternating:{count:4,pack:({texelDimensions:t})=>[[-.5*t[0],-.5*t[1]],[.5*t[0],-.5*t[1]],[-.5*t[0],.5*t[1]],[.5*t[0],.5*t[1]]]}},line:{type:Bi.pe.FLOAT,count:2,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e},{baseSize:s})=>[t*s/2,e*s/2]},fill:{type:Bi.pe.FLOAT,count:2,packTessellation:()=>[0,0]}},Er={marker:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:t,texXmin:e,texYmax:s,texYmin:i})=>[[e,i],[t,i],[e,s],[t,s]]}}},Or={type:Bi.pe.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+_.hM,n=e.y+_.hM;return[r+1,n+1,r+s-1,n+i-1]}},zr={type:Bi.pe.UNSIGNED_SHORT,count:4,packPrecisionFactor:1,pack:({animations:t,baseSize:e,referenceSize:s})=>[t.dataColumn,t.dataRow,e,s]},Rr={type:Bi.pe.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:t,pixelDimensions:e,baseSize:s,sprite:i,sizeRatio:r})=>{const n=Math.max(s*i.width/i.height,s),o=i.sdfDecodeCoeff*n*r;return[e[0],e[1],t,o]}},Lr={type:Bi.pe.BYTE,count:1,packTessellation:({angle:t})=>t};function Dr(t){let{pixelDimensions:e,texelDimensions:s,baseSize:i,referenceSize:r,strokeWidth:n,sizeRatio:o}=t;if(e||(e=t.sprite.sdf?[0,0]:[t.sprite.width,t.sprite.height]),s||(s=t.sprite.sdf?[0,0]:e),null!=t.patternHeight){const s=t.patternHeight/e[1];e[1]*=s,e[0]*=s}-1===i&&(i=e[1]),i=(0,l.Lz)(i),r=(0,l.Lz)(r),n=(0,l.Lz)(n);const a=(t.sprite.sdfDecodeCoeff??1)*o;return{...t,pixelDimensions:e,texelDimensions:s,baseSize:i,referenceSize:r,strokeWidth:n,sdfDecodeCoeff:a}}var Nr,Gr;(Gr=Nr||(Nr={}))[Gr.Geographic=0]="Geographic",Gr[Gr.Arithmatic=1]="Arithmatic";class Br extends ji{get vertexSpec(){return{createComputedParams:Dr,optionalAttributes:{zoomRange:br,value1Position2Value2:wr,lineLength:Sr},attributes:{id:Tr,bitset:kr,pos:Cr,offset:Fr.marker,uv:Er.marker,animationPointerAndBaseSizeAndReferenceSize:zr,sizing:Rr,angle:Lr}}}_write(t,e){const s=this.evaluatedMeshParams.sprite,{textureBinding:i}=s;t.recordStart(this.instanceId,this.attributeLayout,i);const r=e.getDisplayId();if(this.shift&&"esriGeometryPolyline"===e.geometryType)this._writeParticles(t,e);else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(t,e);else if("esriGeometryPolygon"===e.geometryType){const s=e.readCentroidForDisplay();if(!s)return;const[i,n]=s.coords;this._writeQuad(t,r,i,n)}else if("esriGeometryPoint"===e.geometryType){const s=e.readXForDisplay(),i=e.readYForDisplay();this._writeQuad(t,r,s,i)}else{const s=e.readGeometryForDisplay();s&&s.forEachVertex(((e,s)=>{this._writeQuad(t,r,e,s)}))}t.recordEnd()}_writePlacedMarkers(t,e){const s=Tt.fromFeatureSetReaderCIM(e)?.clone();if(!s)return;const i=Ns.getPlacement(s,-1,this.evaluatedMeshParams.placement,(0,l.Lz)(1),t.id,zi());if(!i)return;const r=e.getDisplayId();let n=i.next(),o=null;for(;null!=n;){const e=n.tx,s=-n.ty;if(Math.abs(e)>Lt||Math.abs(s)>Lt){n=i.next();continue}const a=-n.getAngle();t.recordBounds(e,s,64,64),this.shift?o&&this._writeQuad(t,r,o[0],o[1],void 0,a):this._writeQuad(t,r,e,s,void 0,a),o=[e,s],n=i.next()}}_writeParticles(t,e){const s=e.getDisplayId(),i=e.readGeometryForDisplay();if(!i)return;const r=[];i.forEachVertex(((t,e)=>{r.push([t,e])}));const n=function(t){const e=[];let s=0;for(let i=1;i<t.length;i++){const r=t[i-1],n=t[i],o=n[0]-r[0],a=n[1]-r[1],h=Math.sqrt(o*o+a*a),c=o/h,l=a/h;e.push({a:{position:r,distance:s,direction:[c,l]},b:{position:n,distance:s+h,direction:[c,l]}}),s+=h}return e}(r);let o=0;for(let t=1;t<r.length;t++){const e=r[t][0]-r[t-1][0],s=r[t][1]-r[t-1][1],i=Math.sqrt(e*e+s*s);o+=i}const a=e=>{for(const i of n){const{a:r,b:n}=i;this._writeQuad(t,s,r.position[0],r.position[1],[r.distance-e,n.position[0],n.position[1],n.distance-e],this.evaluatedMeshParams.angleToLine?Math.atan2(r.direction[1],r.direction[0]):0,o,!0)}},{placement:h}=this.evaluatedMeshParams;if(!h||"placementTemplate"in h||"CIMMarkerPlacementOnVertices"===h.type){let t;if(h&&"CIMMarkerPlacementOnVertices"!==h.type)t=h.placementTemplate;else{t=[0];for(const e of n){const{a:s,b:i}=e,r=s.position[0]-i.position[0],n=s.position[1]-i.position[1],o=Math.sqrt(r*r+n*n);t.push(o)}}let e=-1*o;for(;e<2*o;)for(const s of t)e+=s,a(e)}else"CIMMarkerPlacementAtExtremities"===h.type?h.extremityPlacement===Dt.$2.JustBegin?a(1):h.extremityPlacement===Dt.$2.JustEnd?(a(o-1),a(-1)):h.extremityPlacement===Dt.$2.Both&&(a(1),a(o-1)):"CIMMarkerPlacementOnLine"===h.type&&a(o/2)}_writeQuad(t,e,s,i,r,n=0,o=0,a=!1){const h=this.evaluatedMeshParams.sprite,{rect:c}=h,l=c.x+_.hM,u=c.y+_.hM,d=c.x+c.width-_.hM,p=c.y+c.height-_.hM,f=t.vertexCount();a||t.recordBounds(s,i,64,64);const g={texXmin:l,texYmin:u,texXmax:d,texYmax:p,value1Position2Value2:r,angle:n/.024543692606171875,lineLength:o};for(let r=0;r<4;r++)this._writeVertex(t,e,s,i,g);t.indexEnsureSize(6),t.indexWrite(f),t.indexWrite(f+1),t.indexWrite(f+2),t.indexWrite(f+1),t.indexWrite(f+3),t.indexWrite(f+2)}}class qr extends Br{constructor(){super(...arguments),this.shift=!1}}class Wr extends Br{constructor(){super(...arguments),this.shift=!0}}var Yr=s(83773),Ur=(s(83349),s(15585));function jr(t,e,s,i,r,n,o){gn=0;const a=(i-s)*n,h=r&&r.length,c=h?(r[0]-s)*n:a;let l,u,d,_,p,f=Vr(e,s,0,0,c,n,!0);if(f&&f.next!==f.prev){if(h&&(f=function(t,e,s,i,r,n){const o=new Array;for(let r=0,a=i.length;r<a;r++){const h=Vr(t,e,0,i[r]*n,r<a-1?i[r+1]*n:s*n,n,!1);h===h.next&&(h.steiner=!0),o.push(Kr(h))}o.sort(cn);for(const t of o)r=tn(t,r);return r}(e,s,i,r,f,n)),a>80*n){l=d=e[0+s*n],u=_=e[1+s*n];for(let t=n;t<c;t+=n){const i=e[t+s*n],r=e[t+1+s*n];l=Math.min(l,i),u=Math.min(u,r),d=Math.max(d,i),_=Math.max(_,r)}p=Math.max(d-l,_-u),p=0!==p?1/p:0}Hr(f,t,n,l,u,p,o,0)}}function Vr(t,e,s,i,r,n,o){let a;if(o===function(t,e,s,i,r,n){let o=0;for(let s=i,a=r-n;s<r;s+=n)o+=(t[a+e*n]-t[s+e*n])*(t[s+1+e*n]+t[a+1+e*n]),a=s;return o}(t,e,0,i,r,n)>0)for(let s=i;s<r;s+=n)a=$r(s+e*n,t[s+e*n],t[s+1+e*n],a);else for(let s=r-n;s>=i;s-=n)a=$r(s+e*n,t[s+e*n],t[s+1+e*n],a);return a&&hn(a,a.next)&&(Jr(a),a=a.next),a}function Xr(t,e=t){if(!t)return t;let s,i=t;do{if(s=!1,i.steiner||!hn(i,i.next)&&0!==sn(i.prev,i,i.next))i=i.next;else{if(Jr(i),i=e=i.prev,i===i.next)break;s=!0}}while(s||i!==e);return e}function Hr(t,e,s,i,r,n,o,a){if(!t)return;!a&&n&&(t=en(t,i,r,n));let h=t;for(;t.prev!==t.next;){const c=t.prev,l=t.next;if(n?Zr(t,i,r,n):Qr(t))e.push(c.index/s+o),e.push(t.index/s+o),e.push(l.index/s+o),Jr(t),t=l.next,h=l.next;else if((t=l)===h){a?1===a?Hr(t=ln(t,e,s,o),e,s,i,r,n,o,2):2===a&&un(t,e,s,i,r,n,o):Hr(Xr(t),e,s,i,r,n,o,1);break}}}function Qr(t){const e=t.prev,s=t,i=t.next;if(sn(e,s,i)>=0)return!1;let r=t.next.next;const n=r;let o=0;for(;r!==t.prev&&(0===o||r!==n);){if(o++,nn(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&sn(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Zr(t,e,s,i){const r=t.prev,n=t,o=t.next;if(sn(r,n,o)>=0)return!1;const a=r.x<n.x?r.x<o.x?r.x:o.x:n.x<o.x?n.x:o.x,h=r.y<n.y?r.y<o.y?r.y:o.y:n.y<o.y?n.y:o.y,c=r.x>n.x?r.x>o.x?r.x:o.x:n.x>o.x?n.x:o.x,l=r.y>n.y?r.y>o.y?r.y:o.y:n.y>o.y?n.y:o.y,u=an(a,h,e,s,i),d=an(c,l,e,s,i);let _=t.prevZ,p=t.nextZ;for(;_&&_.z>=u&&p&&p.z<=d;){if(_!==t.prev&&_!==t.next&&nn(r.x,r.y,n.x,n.y,o.x,o.y,_.x,_.y)&&sn(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,p!==t.prev&&p!==t.next&&nn(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&sn(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;_&&_.z>=u;){if(_!==t.prev&&_!==t.next&&nn(r.x,r.y,n.x,n.y,o.x,o.y,_.x,_.y)&&sn(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&nn(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&sn(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function $r(t,e,s,i){const r=pn.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Jr(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Kr(t){let e=t,s=t;do{(e.x<s.x||e.x===s.x&&e.y<s.y)&&(s=e),e=e.next}while(e!==t);return s}function tn(t,e){const s=function(t,e){let s=e;const i=t.x,r=t.y;let n,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){const t=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(t<=i&&t>o){if(o=t,t===i){if(r===s.y)return s;if(r===s.next.y)return s.next}n=s.x<s.next.x?s:s.next}}s=s.next}while(s!==e);if(!n)return null;if(i===o)return n.prev;const a=n,h=n.x,c=n.y;let l,u=1/0;for(s=n.next;s!==a;)i>=s.x&&s.x>=h&&i!==s.x&&nn(r<c?i:o,r,h,c,r<c?o:i,r,s.x,s.y)&&(l=Math.abs(r-s.y)/(i-s.x),(l<u||l===u&&s.x>n.x)&&on(s,t)&&(n=s,u=l)),s=s.next;return n}(t,e);if(!s)return e;const i=_n(s,t);return Xr(i,i.next),Xr(s,s.next)}function en(t,e,s,i){let r;for(;r!==t;r=r.next){if(r=r||t,null===r.z&&(r.z=an(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,en(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,function(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let n=0;for(;r;){n++,i=r;let o=0;for(;o<s&&i;o++)i=i.nextZ;let a=s;for(;o>0||a>0&&i;){let s;0===o?(s=i,i=i.nextZ,a--):0!==a&&i?r.z<=i.z?(s=r,r=r.nextZ,o--):(s=i,i=i.nextZ,a--):(s=r,r=r.nextZ,o--),e?e.nextZ=s:t=s,s.prevZ=e,e=s}r=i}if(e.nextZ=null,s*=2,n<2)return t}}(t)}function sn(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function rn(t,e,s,i){return!!(hn(t,e)&&hn(s,i)||hn(t,i)&&hn(s,e))||sn(t,e,s)>0!=sn(t,e,i)>0&&sn(s,i,t)>0!=sn(s,i,e)>0}function nn(t,e,s,i,r,n,o,a){return(r-o)*(e-a)-(t-o)*(n-a)>=0&&(t-o)*(i-a)-(s-o)*(e-a)>=0&&(s-o)*(n-a)-(r-o)*(i-a)>=0}function on(t,e){return sn(t.prev,t,t.next)<0?sn(t,e,t.next)>=0&&sn(t,t.prev,e)>=0:sn(t,e,t.prev)<0||sn(t,t.next,e)<0}function an(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function hn(t,e){return t.x===e.x&&t.y===e.y}function cn(t,e){return t.x-e.x}function ln(t,e,s,i){let r=t;do{const n=r.prev,o=r.next.next;!hn(n,o)&&rn(n,r,r.next,o)&&on(n,o)&&on(o,n)&&(e.push(n.index/s+i),e.push(r.index/s+i),e.push(o.index/s+i),Jr(r),Jr(r.next),r=t=o),r=r.next}while(r!==t);return r}function un(t,e,s,i,r,n,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.index!==t.index&&dn(a,t)){let h=_n(a,t);return a=Xr(a,a.next),h=Xr(h,h.next),Hr(a,e,s,i,r,n,o,0),void Hr(h,e,s,i,r,n,o,0)}t=t.next}a=a.next}while(a!==t)}function dn(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!function(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&rn(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}(t,e)&&on(t,e)&&on(e,t)&&function(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{s.y>n!=s.next.y>n&&s.next.y!==s.y&&r<(s.next.x-s.x)*(n-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next}while(s!==t);return i}(t,e)}function _n(t,e){const s=pn.create(t.index,t.x,t.y),i=pn.create(e.index,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,n.next=i,i.prev=n,i}class pn{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,s){const i=gn<fn.length?fn[gn++]:new pn;return i.index=t,i.x=e,i.y=s,i.prev=null,i.next=null,i.z=null,i.prevZ=null,i.nextZ=null,i.steiner=!1,i}}const fn=[];let gn=0;for(let t=0;t<8096;t++)fn.push(new pn);const mn=new Qt.O3(0,0,0,1,0),yn=new Qt.O3(0,0,0,1,0);function xn(t,e,s){let i=0;for(let r=1;r<s;r++){const s=t[2*(e+r-1)],n=t[2*(e+r-1)+1];i+=(t[2*(e+r)]-s)*(t[2*(e+r)+1]+n)}return i}function bn(t,e,s,i,r){let n=0;for(let o=s;o<i;o+=3){const s=2*(t[o]-r),i=2*(t[o+1]-r),a=2*(t[o+2]-r);n+=Math.abs((e[s]-e[a])*(e[i+1]-e[s+1])-(e[s]-e[i])*(e[a+1]-e[s+1]))}return n}function wn(t,e){const{coords:s,lengths:i}=e,r=t;let n=0;for(let t=0;t<i.length;){let e=t,o=i[t],a=xn(s,n,o);const h=[];for(;++e<i.length;){const t=i[e],r=xn(s,n+o,t);if(!(r>0))break;a+=r,h.push(n+o),o+=t}const c=r.length;jr(r,s,n,n+o,h,2,0);const l=bn(r,s,c,r.length,0),u=Math.abs(a);if(Math.abs((l-u)/Math.max(1e-7,u))>1e-5)return r.length=0,!1;t=e,n+=o}return!0}function vn(t,e){if(null==t)return null;if(!function(t,e,s){let i=0;for(let e=0;e<t.lengths.length;e++){const r=t.lengths[e];for(let e=0;e<r;e++){const r=t.coords[2*(e+i)],n=t.coords[2*(e+i)+1];if(r<-128||r>s||n<-128||n>s)return!0}i+=r}return!1}(t,0,_.CQ+128))return t;mn.setPixelMargin(e),mn.reset(Qt.dC.Polygon);let s=0;for(let e=0;e<t.lengths.length;e++){const i=t.lengths[e];let r=t.coords[2*(0+s)],n=t.coords[2*(0+s)+1];mn.moveTo(r,n);for(let e=1;e<i;e++)r=t.coords[2*(e+s)],n=t.coords[2*(e+s)+1],mn.lineTo(r,n);mn.close(),s+=i}const i=mn.result(!1);if(!i)return null;const r=[],n=[];for(const t of i){let e=0;for(const s of t)n.push(s.x),n.push(s.y),e++;r.push(e)}return new At.A(r,n)}function In(t,e){yn.setPixelMargin(e);const s=yn,i=-e,r=_.CQ+e;let n=[],o=!1;if(!t.nextPath())return null;let a=t.pathLength(),h=!0;for(;h;){t.seekPathStart();const e=[];if(!t.pathSize)return null;s.reset(Qt.dC.LineString),t.nextPoint();let c=t.x,l=t.y;if(o)s.moveTo(c,l);else{if(c<i||c>r||l<i||l>r){o=!0;continue}e.push({x:c,y:l})}let u=!1;for(;t.nextPoint();)if(c=t.x,l=t.y,o)s.lineTo(c,l);else{if(c<i||c>r||l<i||l>r){u=!0;break}e.push({x:c,y:l})}if(u)o=!0;else{if(o){const t=s.resultWithStarts();if(t)for(const e of t)n.push({...e,pathLength:a})}else n.push({line:e,start:0,pathLength:a});h=t.nextPath(),a=h?t.pathLength():0,o=!1}}return n=n.filter((t=>t.line.length>1)),0===n.length?null:n}mn.setExtent(_.CQ),yn.setExtent(_.CQ);class Sn{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0,this.pathLength=0,this.distanceOffset=0,this.lineLength=0}}const Pn={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:_.fq,pack:({scaleInfo:t},{tileInfo:e})=>Bs(t,e)}},attributes:{id:{type:Bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:Bi.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1},color:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>Ys(t)},offset:{type:Bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[Xs(t,16),Xs(e,16)]},normal:{type:Bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[Xs(t,16),Xs(e,16)]},halfWidth:{type:Bi.pe.HALF_FLOAT,count:1,pack:({width:t})=>(0,l.Lz)(.5*t)},referenceHalfWidth:{type:Bi.pe.HALF_FLOAT,count:1,pack:({referenceWidth:t})=>(0,l.Lz)(.5*t)}}};class Mn{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0,this.pathLength=0,this.distanceOffset=0}}const An=65535;class Tn extends Ui{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Pn,this._currentWrite=new Mn,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:An,textured:!1},this._tessParams=new Sn,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);null!=i&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new Yr.i(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const i=s??Tt.fromFeatureSetReaderCIM(e);i&&this._writeGeometry(t,e,i)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return In(t,Gi(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:i,_tessellationOptions:r,evaluatedMeshParams:n}=this,{width:o,capType:a,joinType:h,miterLimit:c,hasSizeVV:u}=n,d=(0,l.Lz)(.5*o);r.halfWidth=d,r.capType=Us(a),r.joinType=js(h),r.miterLimit=c;const p=!u;i.out=t,i.id=e.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=t.vertexCount(),i.vertexBounds=p&&d<_.Gh?0:1;for(const{line:t,start:e,pathLength:n}of s)r.initialDistance=e%An,i.pathLength=n,i.distanceOffset=Math.floor(e/An)*An,this._lineTessellator.tessellate(t,r,p)}_writeTesselatedVertex(t,e,s,i,r,n,o,a,h,c,l){const{out:u,id:d,vertexBounds:_,pathLength:p,distanceOffset:f}=this._currentWrite;return this.hasEffects&&u.recordBounds(t,e,_,_),this._tessParams.extrusionOffsetX=o,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=h,this._tessParams.normalY=c,this._tessParams.directionX=r,this._tessParams.directionY=n,this._tessParams.distance=l,this._tessParams.pathLength=p,this._tessParams.distanceOffset=f,this._writeVertex(u,d,t,e,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(t,e,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(t),i.indexWrite(e),i.indexWrite(s),this._currentWrite.indexCount+=3}}class kn extends ji{_write(t,e){const s=e.readGeometryForDisplay();if(!s)return;const i=this.evaluatedMeshParams.sprite,{textureBinding:r}=i;t.recordStart(this.instanceId,this.attributeLayout,r);const n=e.getDisplayId();this._writePoly(t,n,s),t.recordEnd()}}class Cn extends kn{constructor(){super(...arguments),this.vertexSpec={createComputedParams:Dr,attributes:{id:Tr,bitset:kr,pos:Cr,offset:Fr.fill,tlbr:Or,animationPointerAndBaseSizeAndReferenceSize:zr,sizing:Rr},optionalAttributes:{zoomRange:br,value1Position2Value2:vr,lineLength:Ir}}}_writePoly(t,e,s){const i=[];if(!wn(i,s))return;const r=t.vertexCount();s.forEachVertex(((s,i)=>{this._writeVertex(t,e,s,i)})),t.indexEnsureSize(i.length);for(const e of i)t.indexWrite(r+e)}}class Fn{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0,this.pathLength=0}}class En extends kn{constructor(){super(...arguments),this.vertexSpec={createComputedParams:Dr,attributes:{id:Tr,bitset:kr,pos:Cr,offset:Fr.line,tlbr:Or,animationPointerAndBaseSizeAndReferenceSize:zr,sizing:Rr,accumulatedDistance:Pr,normal:Ar,segmentDirection:Mr},optionalAttributes:{zoomRange:br,value1Position2Value2:vr,lineLength:Sr}},this._tessParams=new Sn,this._currentWrite=new Fn,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:65535,textured:!1},this._lineLength=0,this._lineTessellator=new Yr.i(((t,e,s,i,r,n,o,a,h,c,l)=>this._writeTesselatedVertex(t,e,s,i,r,n,o,a,h,c,l,this._lineLength)),this._writeTriangle.bind(this),!1)}_writePoly(t,e,s){const i=In(Tt.fromOptimized(s,"esriGeometryPolyline"),64);if(null==i)return;const{_currentWrite:r,_tessellationOptions:n}=this,{baseSize:o,capType:a,joinType:h,miterLimit:c}=this.evaluatedMeshParams,u=(0,l.Lz)(.5*o);n.halfWidth=u,n.capType=Us(a||Dt.uT.Round),n.joinType=js(h||Dt.wd.Round),n.miterLimit=c||2,r.out=t,r.id=e,r.vertexCount=0,r.indexCount=0,r.vertexFrom=t.vertexCount(),r.vertexBounds=1;for(const{line:t,start:e,pathLength:s}of i){n.initialDistance=e%65535,r.pathLength=s,this._lineLength=0;for(let e=1;e<t.length;e++){const s=t[e].x-t[e-1].x,i=t[e].y-t[e-1].y;this._lineLength+=Math.sqrt(s*s+i*i)}this._lineTessellator.tessellate(t,n,!1)}}_writeTesselatedVertex(t,e,s,i,r,n,o,a,h,c,l,u){const{out:d,id:_,vertexBounds:p,pathLength:f}=this._currentWrite;return this.hasEffects&&d.recordBounds(t,e,p,p),this._tessParams.extrusionOffsetX=o,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=h,this._tessParams.normalY=c,this._tessParams.directionX=r,this._tessParams.directionY=n,this._tessParams.distance=l,this._tessParams.pathLength=f,this._tessParams.lineLength=u,this._writeVertex(d,_,t,e,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(t,e,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(t),i.indexWrite(e),i.indexWrite(s),this._currentWrite.indexCount+=3}}const On=(0,n.A)("featurelayer-fast-triangulation-enabled");class zn extends Ui{async loadDependencies(){await Promise.all([super.loadDependencies(),(0,Ur.F)()])}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,r),t.recordEnd())}_clip(t){return t?vn(t,this.hasEffects?256:8):null}_writeGeometry(t,e,s){const i=s.maxLength>100,r=[],n=this.createTesselationParams(e);if(!i&&On&&wn(r,s))return void(r.length&&this._writeVertices(t,e,s.coords,n,r));const o=function(t){const{coords:e,lengths:s}=t,{buffer:i}=(0,Ur.l)(e,s);return i}(s);this._writeVertices(t,e,o,n)}_writeVertices(t,e,s,i,r){const n=e.getDisplayId(),o=t.vertexCount(),a=this.hasEffects;let h=0;if(r)for(const e of r){const r=s[2*e],o=s[2*e+1];a&&t.recordBounds(r,o,0,0),this._writeVertex(t,n,r,o,i),h++}else for(let e=0;e<s.length;e+=2){const r=Math.round(s[e]),o=Math.round(s[e+1]);a&&t.recordBounds(r,o,0,0),this._writeVertex(t,n,r,o,i),h++}t.indexEnsureSize(h);for(let e=0;e<h;e++)t.indexWrite(e+o)}}const Rn={createComputedParams:t=>t,optionalAttributes:{},attributes:{id:{type:Bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1},pos:{type:Bi.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:Bi.pe.FLOAT,count:1,packTessellation:({inverseArea:t})=>t}}};class Ln extends zn{constructor(){super(...arguments),this.vertexSpec=Rn}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}}const Dn={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:_.fq,pack:({scaleInfo:t},{tileInfo:e})=>Bs(t,e)}},attributes:{id:{type:Bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1},pos:{type:Bi.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>Ys(t)}}};class Nn extends zn{constructor(){super(...arguments),this.vertexSpec=Dn}createTesselationParams(t){return null}}const Gn={createComputedParams:t=>t,optionalAttributes:Dn.optionalAttributes,attributes:{...Dn.attributes,tlbr:{count:4,type:Bi.pe.UNSIGNED_SHORT,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+_.hM,n=e.y+_.hM;return[r,n,r+s,n+i]}},inverseRasterizationScale:{count:1,type:Bi.pe.BYTE,packPrecisionFactor:16,pack:({sprite:t})=>1/t.rasterizationScale}}};class Bn extends Nn{constructor(){super(...arguments),this.vertexSpec=Gn}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(t,e,r),t.recordEnd()}}function qn(t){const{sprite:e,aspectRatio:s,scaleProportionally:i}=t,r=(0,l.Lz)(t.height),n=r>0?r:e.height;let o=r*s;return o<=0?o=e.width:i&&(o*=e.width/e.height),{width:o,height:n}}function Wn(t){const{applyRandomOffset:e,sampleAlphaOnly:s}=t;return Ws([[2,e],[4,s]])}const Yn={createComputedParams:t=>t,optionalAttributes:Gn.optionalAttributes,attributes:{...Gn.attributes,bitset:{count:1,type:Bi.pe.UNSIGNED_BYTE,pack:Wn},width:{count:1,type:Bi.pe.HALF_FLOAT,pack:t=>qn(t).width},height:{count:1,type:Bi.pe.HALF_FLOAT,pack:t=>qn(t).height},offset:{count:2,type:Bi.pe.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[(0,l.Lz)(t),-(0,l.Lz)(e)]},scale:{count:2,type:Bi.pe.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:t,scaleY:e})=>[t,e]},angle:{count:1,type:Bi.pe.UNSIGNED_BYTE,pack:({angle:t})=>(0,Ti.wV)(t)}}};class Un extends Bn{constructor(){super(...arguments),this.vertexSpec=Yn}}const jn={createComputedParams:t=>t,optionalAttributes:Pn.optionalAttributes,attributes:{...Pn.attributes,bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:t=>0},color:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>Ys(t)}}},Vn={createComputedParams:t=>t,optionalAttributes:Pn.optionalAttributes,attributes:{...Pn.attributes,bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:t=>Ws([[0,!0],[1,t.outlineUsesColorVV]])},color:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>Ys(t)}}};class Xn extends Tn{constructor(){super(...arguments),this.vertexSpec=Vn}}class Hn extends Nn{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=jn,this._lineMeshWriter=this._createOutlineWriter(t,e,s,i)}_createOutlineWriter(t,e,s,i){return new Xn(t,e,s,i)}_write(t,e){const s=this.evaluatedMeshParams.effects,i=this.evaluatedMeshParams.outlineEffects;if(s?.length||i?.length){if(s?.length){const i=this.getEffectCursor(t,e,s);if(i){let s;for(;s=i?.next();)s.invertY(),this._writeFill(t,e,s)}}else this._writeFill(t,e);if(i?.length){const s=this.getEffectCursor(t,e,i);if(s){let i;for(;i=s?.next();)i.invertY(),this._writeOutline(t,e,i)}}else this._writeOutline(t,e)}else this._writeSimpleOutlineFill(t,e)}_writeSimpleOutlineFill(t,e){const s=e.readGeometryForDisplay(),i=this._clip(s);i&&(this._writeGeometry(t,e,i),this._lineMeshWriter.writeLineVertices(t,Tt.fromOptimizedCIM(i,"esriGeometryPolyline"),e))}_writeFill(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&this._writeGeometry(t,e,r)}_writeOutline(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&this._lineMeshWriter.writeLineVertices(t,Tt.fromOptimizedCIM(r,"esriGeometryPolyline"),e)}_clip(t){return t?vn(t,Gi(this.evaluatedMeshParams)):null}get effectInfos(){return[...this._evaluator.inputMeshParams.effects?.effectInfos??[],...this._evaluator.inputMeshParams.outlineEffects?.effectInfos??[]]}write(t,e,s,i,r){this.ensurePacked(e,s,i),t.recordStart(this.instanceId,this.attributeLayout),this._write(t,s),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}get hasEffects(){return!!this.evaluatedMeshParams.outlineEffects}}const Qn=Yn,Zn=Vn,$n={createComputedParams:t=>t,optionalAttributes:Qn.optionalAttributes,attributes:{...Qn.attributes,bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:t=>Wn(t)},aux1:{count:1,type:Bi.pe.HALF_FLOAT,pack:t=>qn(t).width},aux2:{count:1,type:Bi.pe.HALF_FLOAT,pack:t=>qn(t).height},aux3:{count:2,type:Bi.pe.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[(0,l.Lz)(t),(0,l.Lz)(e)]},aux4:{count:2,type:Bi.pe.UNSIGNED_BYTE,pack:({scaleX:t,scaleY:e})=>[16*t,16*e]}}},Jn={createComputedParams:t=>t,optionalAttributes:Qn.optionalAttributes,attributes:{...Qn.attributes,color:Zn.attributes.color,bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:t=>Ws([[0,!0]])},aux1:{count:1,type:Bi.pe.HALF_FLOAT,pack:t=>(0,l.Lz)(.5*t.width)},aux2:{count:1,type:Bi.pe.HALF_FLOAT,pack:t=>(0,l.Lz)(.5*t.referenceWidth)},aux3:{count:2,type:Bi.pe.HALF_FLOAT,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[t,e]},aux4:{count:2,type:Bi.pe.UNSIGNED_BYTE,packTessellation:({normalX:t,normalY:e})=>[16*t+128,16*e+128]}}};class Kn extends Xn{constructor(){super(...arguments),this.vertexSpec=Jn}}class to extends Hn{constructor(){super(...arguments),this.vertexSpec=$n}_createOutlineWriter(t,e,s,i){return new Kn(t,e,s,i)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const n=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,n),this._write(t,s),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}class eo{constructor(t,e){this._size=t,this._sizeUnits=e,this._relativeSize=null}get relativeSize(){return this._relativeSize??=this.calculateRelativeSize(),this._relativeSize}calculateRelativeSize(){if(this._sizeUnits===Dt.OW.Relative){const t=Math.min(this._size/100,1);return[t,t]}return this.calculateRelativeSizeFromAbsolute()}}class so extends eo{constructor(t,e,s,i){super(e,s),this.rotationMatrix00=1,this.rotationMatrix01=0,this.rotationMatrix10=0,this.rotationMatrix11=1,this.bounds={xmin:1/0,ymin:1/0,xmax:-1/0,ymax:-1/0},this.rotationMatrix00=Math.cos(i),this.rotationMatrix01=-Math.sin(i),this.rotationMatrix10=-this.rotationMatrix01,this.rotationMatrix11=this.rotationMatrix00;const{bounds:r,rotationMatrix00:n,rotationMatrix01:o,rotationMatrix10:a,rotationMatrix11:h}=this;t.forEachVertex(((t,e)=>{const s=t*n+e*o,i=t*a+e*h;r.xmin=Math.min(r.xmin,s),r.ymin=Math.min(r.ymin,i),r.xmax=Math.max(r.xmax,s),r.ymax=Math.max(r.ymax,i)})),this.center=[(r.xmin+r.xmax)/2,(r.ymin+r.ymax)/2]}}class io extends so{constructor(t,e,s,i){super(t,e,s,i),this.method="linear"}getRelativePosition(t,e){const{rotationMatrix00:s,rotationMatrix01:i,bounds:r}=this,{xmin:n,xmax:o}=r;return[(t*s+e*i-n)/(o-n),0]}calculateRelativeSizeFromAbsolute(){const{_size:t,bounds:e}=this,{xmin:s,xmax:i}=e;return[(0,l.Lz)(t)/(i-s),0]}}class ro extends so{constructor(t,e,s,i){super(t,e,s,i),this.method="rectangular"}getRelativePosition(t,e){const{bounds:s,center:i,rotationMatrix00:r,rotationMatrix01:n,rotationMatrix10:o,rotationMatrix11:a}=this,h=t*o+e*a,c=t*r+e*n-i[0],l=h-i[1];return[c*(2/(s.xmax-s.xmin)),-l*(2/(s.ymax-s.ymin))]}calculateRelativeSizeFromAbsolute(){const{_size:t,bounds:e}=this,{xmin:s,ymin:i,xmax:r,ymax:n}=e;return[(0,l.Lz)(2*t)/(r-s),(0,l.Lz)(2*t)/(n-i)]}}class no extends so{constructor(t,e,s){super(t,e,s,0),this.method="circular";const{xmin:i,xmax:r,ymin:n,ymax:o}=this.bounds,a=r-i,h=o-n;this.radius=Math.sqrt(a*a+h*h)/2}getRelativePosition(t,e){const{center:s,radius:i}=this;return[(t-s[0])/i,-(e-s[1])/i]}calculateRelativeSizeFromAbsolute(){const{_size:t}=this;return[(0,l.Lz)(t)/this.radius,0]}}function oo(t,e){if(null==t)return null;const s=(0,ti.kU)(e.angle),i=e.gradientSize,r=e.gradientSizeUnits;switch(e.gradientMethod.toLowerCase()){case"linear":return new io(t,i,r,s);case"rectangular":return new ro(t,i,r,s);case"circular":return new no(t,i,r);default:return D.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.fill.GradientSizeHelper").errorOnce(`Gradient fill method "${e.gradientMethod}" currently unsupported.`),null}}const ao={createComputedParams:t=>t,optionalAttributes:Dn.optionalAttributes,attributes:{...Dn.attributes,bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:({gradientSizeUnits:t,gradientType:e})=>{let s=0;return t===Dt.OW.Absolute&&(s|=qs(0)),"discrete"===e.toLowerCase()&&(s|=qs(1)),s}},tlbr:{count:4,type:Bi.pe.UNSIGNED_SHORT,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+_.hM+_.MZ,n=e.y+_.hM;return[r,n,r+s-2*_.MZ,n+i]}},relativePosition:{count:2,type:Bi.pe.HALF_FLOAT,packTessellation:({gradientStats:t},e,s,i)=>t?.getRelativePosition(s,i)??[0,0]},relativeGradientSize:{count:2,type:Bi.pe.HALF_FLOAT,packTessellation:({gradientStats:t})=>t?.relativeSize??[1,1]},gradientMethod:{count:1,type:Bi.pe.UNSIGNED_BYTE,pack:({gradientMethod:t})=>{switch(t.toLowerCase()){case"rectangular":return 1;case"circular":return 2;default:return 0}}}}};class ho extends zn{constructor(){super(...arguments),this.vertexSpec=ao}get _preventEffectClipping(){return!0}createTesselationParams(t){return{gradientStats:oo(this._unclippedGeometry,this.evaluatedMeshParams)}}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay();this._unclippedGeometry=i;const r=this._clip(i);if(!r)return void(this._unclippedGeometry=null);const n=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(t,e,r),this._unclippedGeometry=null,t.recordEnd()}}const co={optionalAttributes:Gn.optionalAttributes,createComputedParams:t=>t,attributes:{...Gn.attributes,...jn.attributes}},lo={optionalAttributes:Gn.optionalAttributes,createComputedParams:t=>t,attributes:{...Gn.attributes,...Vn.attributes}};class uo extends Xn{constructor(){super(...arguments),this.vertexSpec=lo}}class _o extends Hn{constructor(){super(...arguments),this.vertexSpec=co}_createOutlineWriter(t,e,s,i){return new uo(t,e,s,i)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const n=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,n),this._write(t,s),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const po={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:Bi.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1},offset:{type:Bi.pe.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};class fo extends Ui{constructor(){super(...arguments),this.vertexSpec=po}_write(t,e){t.recordStart(this.instanceId,this.attributeLayout);const s=e.getDisplayId();if("esriGeometryPoint"===e.geometryType){const i=e.readXForDisplay(),r=e.readYForDisplay();this._writeQuad(t,s,i,r)}else if("esriGeometryMultipoint"===e.geometryType){const i=e.readGeometryForDisplay();i?.forEachVertex(((e,i)=>{e>=0&&e<=512&&i>=0&&i<=512&&this._writeQuad(t,s,e,i)}))}t.recordEnd()}_writeQuad(t,e,s,i){const r=t.vertexCount();this._writeVertex(t,e,s,i),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}}var go,mo,yo,xo,bo,wo,vo,Io,So,Po,Mo=s(48163),Ao=s(90708);(Po=go||(go={}))[Po.FILL=0]="FILL",Po[Po.LINE=1]="LINE",Po[Po.MARKER=2]="MARKER",Po[Po.TEXT=3]="TEXT",Po[Po.LABEL=4]="LABEL",function(t){t[t.NONE=0]="NONE",t[t.MAP=1]="MAP",t[t.LABEL=2]="LABEL",t[t.LABEL_ALPHA=4]="LABEL_ALPHA",t[t.HITTEST=8]="HITTEST",t[t.HIGHLIGHT=16]="HIGHLIGHT",t[t.CLIP=32]="CLIP",t[t.DEBUG=64]="DEBUG",t[t.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(mo||(mo={})),function(t){t[t.SIZE=0]="SIZE",t[t.COLOR=1]="COLOR",t[t.OPACITY=2]="OPACITY",t[t.ROTATION=3]="ROTATION"}(yo||(yo={})),function(t){t[t.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",t[t.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",t[t.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",t[t.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(xo||(xo={})),function(t){t[t.SPRITE=0]="SPRITE",t[t.GLYPH=1]="GLYPH"}(bo||(bo={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.SIMPLE=1]="SIMPLE",t[t.DOT_DENSITY=2]="DOT_DENSITY",t[t.OUTLINE_FILL=3]="OUTLINE_FILL",t[t.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE",t[t.HEATMAP=5]="HEATMAP",t[t.PIE_CHART=6]="PIE_CHART"}(wo||(wo={})),function(t){t[t.All=0]="All",t[t.Highlight=1]="Highlight",t[t.InsideEffect=2]="InsideEffect",t[t.OutsideEffect=3]="OutsideEffect"}(vo||(vo={})),function(t){t[t.BATCHING=0]="BATCHING",t[t.STRICT_ORDER=1]="STRICT_ORDER",t[t.STRICT_MARKERS_AND_TEXT=2]="STRICT_MARKERS_AND_TEXT"}(Io||(Io={})),function(t){t[t.FILL=0]="FILL",t[t.LINE=1]="LINE",t[t.MARKER=2]="MARKER",t[t.TEXT=3]="TEXT"}(So||(So={}));class To{constructor(t,e,s,i,r,n,o,a,h,c,l=[],u=0,d=0){this.displayId=t,this.labelClassId=e,this.hash=s,this.anchorX=i,this.anchorY=r,this.directionX=n,this.directionY=o,this.maxScale=a,this.minScale=h,this.referenceBounds=c,this.bounds=l,this.recordStart=u,this.recordCount=d,this.priority=0,this._colliders=null,this.uniqueSymbol=null,this.selectedForRendering=!1}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(t){if(!this._colliders){const e=t.attributeView,s=_.C2;let i=this.referenceBounds?.size??0;const r=t.layerView.labelingCollisionInfos[0].vvEvaluators[0];if(null!=r){const t=r(e.getVisualVariableData(this.displayId,yo.SIZE));i=isNaN(t)||null==t||t===1/0?i:t}const n=this.minScale?t.layerView.view.featuresTilingScheme.scaleToZoom(this.minScale):0,o=this.maxScale?t.layerView.view.featuresTilingScheme.scaleToZoom(this.maxScale):25,a=this.directionX*(s+i/2),h=this.directionY*(s+i/2);this._colliders=this.bounds.map((t=>({xTile:this.anchorX,yTile:this.anchorY,dxPixels:t.x-t.halfWidth+a,dyPixels:t.y-t.halfHeight+h,hard:!0,partIndex:1,width:t.width+2,height:t.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:n,maxLod:o})))}return this._colliders}get id(){return this.displayId}serialize(t){t.push(this.displayId),t.push(this.labelClassId),t.push(this.hash),t.push(this.recordStart),t.push(this.recordCount),t.writeF32(this.anchorX),t.writeF32(this.anchorY),t.writeF32(this.directionX),t.writeF32(this.directionY),t.writeF32(this.maxScale),t.writeF32(this.minScale),this.referenceBounds?(t.writeF32(this.referenceBounds.size),t.writeF32(this.referenceBounds.offsetX),t.writeF32(this.referenceBounds.offsetY)):(t.writeF32(0),t.writeF32(0),t.writeF32(0)),Z(t,this.bounds)}static deserialize(t){const e=t.readInt32(),s=t.readInt32(),i=t.readInt32(),r=t.readInt32(),n=t.readInt32(),o=t.readF32(),a=t.readF32(),h=t.readF32(),c=t.readF32(),l=t.readF32(),u=t.readF32(),d=t.readF32(),_=t.readF32(),p=t.readF32(),f=$(t,mi)??[];return new To(e,s,i,o,a,h,c,l,u,{size:d,offsetX:_,offsetY:p},f,r,n)}}class ko{constructor(t){const{offsetX:e,offsetY:s,postAngle:i,fontSize:r,haloSize:n,outlineSize:o,scaleFactor:a,transforms:h}=t;if(this.offsetX=e,this.offsetY=s,this.postAngle=i,this.fontSize=Math.min(r,96),this.haloSize=n??0,this.outlineSize=o??0,this.transforms=h,h&&h.infos.length>1){const t=(0,de.zb)(r,i,!1,e,s,h,!1);this.fontSize=Math.min(t.size,96);const n=t.size/r;this.haloSize*=n,this.outlineSize*=n,this.postAngle=t.rotation,this.offsetX=t.offsetX,this.offsetY=t.offsetY}a&&(this.fontSize*=a,this.offsetX*=a,this.offsetY*=a)}}const Co=[4,4],Fo=[16,4],Eo={topLeft:Fo,topRight:Fo,bottomLeft:Fo,bottomRight:Fo},Oo=[4,2],zo=[4,6],Ro={topLeft:Oo,topRight:Oo,bottomLeft:zo,bottomRight:zo},Lo={topLeft:Oo,topRight:zo,bottomLeft:Oo,bottomRight:zo},Do={topLeft:zo,topRight:zo,bottomLeft:Co,bottomRight:Co},No={topLeft:Co,topRight:Co,bottomLeft:zo,bottomRight:zo},Go={topLeft:zo,topRight:Co,bottomLeft:zo,bottomRight:Co},Bo={topLeft:Co,topRight:zo,bottomLeft:Co,bottomRight:zo},qo={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:Bi.pe.UNSIGNED_SHORT,count:2,packPrecisionFactor:_.fq,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||28]},clipAngle:{type:Bi.pe.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>Yo(t||0)},referenceSymbol:{type:Bi.pe.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,e)=>{const s=t.isLineLabel||!t.referenceBounds,i=function(t){switch(t){case _i.Right:case"right":return-1;case _i.Center:case"center":return 0;case _i.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}(s?"center":e.horizontalAlignment),r=function(t){switch(t){case pi.Top:case"top":return 1;case pi.Center:case"middle":return 0;case pi.Bottom:case pi.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${t}`),0}}(s?"middle":e.verticalAlignment),{offsetX:n,offsetY:o,size:a}=s?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[(0,l.Lz)(n),-(0,l.Lz)(o),Math.round((0,l.Lz)(a)),i+1<<2|r+1]}},visibility:{type:Bi.pe.FLOAT,count:1,otherSource:!0}},attributes:{pos:{type:Bi.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>Ws([[0,t],[3,!!e]])},offset:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},textureUV:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},color:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontAndReferenceSize:{type:Bi.pe.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:e})=>[Math.round((0,l.Lz)(t)),Math.round((0,l.Lz)(e??t))]},outlineColor:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>Ys(t)},haloColor:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>Ys(t)},outlineAndHaloSize:{type:Bi.pe.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:e})=>[Math.round((0,l.Lz)(t)),Math.round((0,l.Lz)(e))]}}};class Wo extends Ui{constructor(){super(...arguments),this.vertexSpec=qo,this._textMeshParamsPropsInitialized=!1}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new ko(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(t,e,s){const i=this._getShaping();if(!i)return;const r=e.getDisplayId();if(null!=this.evaluatedMeshParams.placement)return this._writePlacedTextMarkers(t,e,i,s);if(s?.nextPath())return s.nextPoint(),this._writeGlyphs(t,r,s.x,s.y,i,0);if("esriGeometryPolygon"===e.geometryType){const s=e.readCentroidForDisplay();if(!s)return;const[n,o]=s.coords;return this._writeGlyphs(t,r,n,o,i,0)}if("esriGeometryMultipoint"===e.geometryType){const s=e.readGeometryForDisplay();return void s?.forEachVertex(((e,s)=>this._writeGlyphs(t,r,e,s,i,0)))}const n=e.readXForDisplay(),o=e.readYForDisplay();return this._writeGlyphs(t,r,n,o,i,0)}_writePlacedTextMarkers(t,e,s,i){const r=i??Tt.fromFeatureSetReaderCIM(e);if(!r)return;const n=Ns.getPlacement(r,-1,this.evaluatedMeshParams.placement,(0,l.Lz)(1),t.id,zi());if(!n)return;const o=e.getDisplayId();let a=n.next();for(;null!=a;){const e=a.tx,i=-a.ty,r=-a.getAngle();this._writeGlyphs(t,o,e,i,s,r),a=n.next()}}_getShaping(t){const e=this._textMeshTransformProps,s=this.evaluatedMeshParams;if(!s.glyphs?.glyphs.length)return null;const i=(0,l.Lz)(e.fontSize),r=(0,l.Lz)(e.offsetX),n=(0,l.Lz)(e.offsetY),o=(0,ti.qE)((0,l.Lz)(s.lineWidth),_.GR,_.cp),a=_.DY*(0,ti.qE)(s.lineHeightRatio,.25,4);return Mi(s.glyphs,{scale:i/_.eG,angle:e.postAngle,xOffset:r,yOffset:n,horizontalAlignment:s.horizontalAlignment,verticalAlignment:t||s.verticalAlignment,maxLineWidth:o,lineHeight:a,decoration:s.decoration,borderLineSizePx:(0,l.Lz)(s.boxBorderLineSize),hasBackground:!!s.boxBackgroundColor,useCIMAngleBehavior:s.useCIMAngleBehavior})}_writeGlyphs(t,e,s,i,r,n,o,a,h=!0){const c=this.evaluatedMeshParams,u=this._textMeshTransformProps,d=(0,l.Lz)(u.fontSize),_=u.haloSize,p=u.outlineSize,f=(0,l.Lz)(u.offsetX),g=(0,l.Lz)(u.offsetY),[m,y]=Bs(c.scaleInfo,this.getTileInfo());0!==n&&r.setRotation(n);const x=r.bounds,b=s+x.x+f,w=i+x.y-g,v=2*(c.minPixelBuffer?c.minPixelBuffer/d:1),I=Math.max(x.width,x.height)*v;r.textBox&&(t.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding),h&&t.recordBounds(b,w,I,I),this._writeTextBox(t,e,s,i,r.textBox,o,a),t.recordEnd());for(const n of r.glyphs){t.recordStart(this.instanceId,this.attributeLayout,n.textureBinding),h&&t.recordBounds(b,w,I,I);const{texcoords:r,offsets:l}=n;this._writeQuad(t,e,s,i,{texcoords:r,offsets:l,fontSize:d,haloSize:_,outlineSize:p,color:Ys(c.color),isBackground:!1,referenceBounds:o,minZoom:m,maxZoom:y,...a}),t.recordEnd()}0!==n&&r.setRotation(-n)}_writeTextBox(t,e,s,i,r,n,o){const a=this.evaluatedMeshParams,{fontSize:h,haloSize:c,outlineSize:l}=this._textMeshTransformProps,{boxBackgroundColor:u,boxBorderLineColor:d}=a,_={isBackground:!0,fontSize:h,haloSize:c,outlineSize:l,referenceBounds:n,...o};u&&(this._writeQuad(t,e,s,i,{texcoords:Eo,offsets:r.main,color:Ys(u),..._}),d||(this._writeQuad(t,e,s,i,{texcoords:Do,offsets:r.top,color:Ys(u),..._}),this._writeQuad(t,e,s,i,{texcoords:No,offsets:r.bot,color:Ys(u),..._}),this._writeQuad(t,e,s,i,{texcoords:Go,offsets:r.left,color:Ys(u),..._}),this._writeQuad(t,e,s,i,{texcoords:Bo,offsets:r.right,color:Ys(u),..._}))),d&&(this._writeQuad(t,e,s,i,{texcoords:Ro,offsets:r.top,color:Ys(d),..._}),this._writeQuad(t,e,s,i,{texcoords:Ro,offsets:r.bot,color:Ys(d),..._}),this._writeQuad(t,e,s,i,{texcoords:Lo,offsets:r.left,color:Ys(d),..._}),this._writeQuad(t,e,s,i,{texcoords:Lo,offsets:r.right,color:Ys(d),..._}))}_writeQuad(t,e,s,i,r){const n=t.vertexCount();this._writeVertex(t,e,s,i,r),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2)}}const Yo=t=>Math.round(t*(254/360)),Uo=(0,z.Bj)((t=>{let e=0;if(0===t)return 1/0;for(;!(t%2);)e++,t/=2;return e}));class jo extends Wo{constructor(){super(...arguments),this._zoomLevel=0}_write(t,e,s,i){if(this._zoomLevel=i||0,null!=s)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(e.geometryType){case"esriGeometryPoint":{const s=e.readXForDisplay(),i=e.readYForDisplay();this._writePoint(t,s,i,0,e);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const s=e.readCentroidForDisplay();if(!s)return;const[i,r]=s.coords;this._writePoint(t,i,r,0,e);break}case"esriGeometryMultipoint":{let s=0;const i=Tt.fromFeatureSetReader(e);if(i?.nextPath())for(;i.nextPoint();)this._writePoint(t,i.x,i.y,s++,e);break}case"esriGeometryPolyline":this._writeLines(t,e)}}_getMetricDir(){const{horizontalAlignment:t,verticalAlignment:e}=this.evaluatedMeshParams;return["center"===t?0:"right"===t?-1:1,"middle"===e?0:"bottom"===e?-1:1]}_createLineLabelMetric(t,e,s,i,r){const[n,o]=this._getMetricDir(),a=this.evaluatedMeshParams.scaleInfo?.maxScale??0,h=this.evaluatedMeshParams.scaleInfo?.minScale??0,c=this.evaluatedMeshParams.labelClassId;return new To(t,c,e,s,i,n,o,a,h,r)}_writePoint(t,e,s,i,r){if(e<0||e>_.CQ||s<0||s>_.CQ)return;const n=this._getShaping();if(!n)return;const o=r.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,h=function(t,e,s){return(0,wt.Wm)(`${t}${e}${s}`)}(r.getObjectId(),a,i),[c,l]=this._getMetricDir(),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,p=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};t.metricStart(new To(o,a,h,e,s,c,l,u,d,p)),this._writeGlyphs(t,o,e,s,n,0,p,void 0,!1),t.metricBoxWrite(n.boundsT),t.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const t of this._references){const e=t.getBoundsInfo();if(e)return e}return null}_writeLines(t,e){const{scaleInfo:s,verticalAlignment:i}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,n=this._getShaping("middle");if(!n)return;const o=(t,e,s,i)=>this._placeSubdivGlyphs(t,e,s,i),a=(n.bounds.width+r)/2;this._current={out:t,id:e.getDisplayId(),objId:e.getObjectId(),shaping:n,zoomRange:Bs(s,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===i?"above":"top"===i?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(e,o,a):this._writeCenterAlong(e,o,a)}_writeAboveAndBelowAlong(t,e,s){const{repeatLabel:i}=this.evaluatedMeshParams,{shaping:r}=this._current,n=r.bounds.halfHeight,o=t.readGeometryForDisplay();if(!o)return;const a=new At.A;(0,Ao.kz)(a,o,!1,!1,"esriGeometryPolyline",1);const h=Vo(new At.A,a,n),c=Vo(new At.A,a,-n),l=(0,Ao.zv)(c,"esriGeometryPolyline",!1,!1),u=Ze((0,Ao.zv)(h,"esriGeometryPolyline",!1,!1).paths,r.bounds.width),d=Ze(l.paths,r.bounds.width);this._current.offsetDirection="above";for(let t=0;t<u.length;t++)this._current.pathIndex=t,Qe(u[t],s,e,!!i);this._current.offsetDirection="below";for(let t=0;t<d.length;t++)this._current.pathIndex=t,Qe(d[t],s,e,!!i)}_writeCenterAlong(t,e,s){const{repeatLabel:i}=this.evaluatedMeshParams,{shaping:r}=this._current,n=Ze(t.readLegacyGeometryForDisplay().paths,r.bounds.width);for(let t=0;t<n.length;t++)this._current.pathIndex=t,Qe(n[t],s,e,!!i)}_placeSubdivGlyphs(t,e,s,i){const{allowOverrun:r,labelPosition:n,repeatLabelDistance:o}=this.evaluatedMeshParams,a=this._current.zoomRange[0],h=Uo(e),c=this._current.shaping.bounds.width/2,l=Math.sqrt(o||128)/2,u=Math.min(s,i-s),d=this._current.shaping.isMultiline?28:Math.log2(u/(l+c/2)),_=0===e?d:Math.min(h,d),p=Math.max(a,this._zoomLevel+1-_),f=this._zoomLevel-p,g=this._current.shaping.bounds.width/2*2**f,m=function(t,e,s,i,r){return(0,wt.Wm)(`${t}${r}${e}${s*2**(28-i)}`)}(this._current.objId,this._current.pathIndex,e,this._zoomLevel,this.evaluatedMeshParams.labelClassId);this._current.shaping.isMultiline?0===e&&this._placeStraight(t,p,m):r&&f<0?this._placeStraightAlong(t,a,m):"parallel"===n?this._placeStraightAlong(t,p,m):"curved"===n&&this._placeCurved(t,p,g,m)}_placeStraight(t,e,s){const{out:i,id:r,shaping:n,referenceBounds:o}=this._current,{x:a,y:h}=t;i.metricStart(this._createLineLabelMetric(r,s,a,h)),i.metricBoxWrite(n.boundsT);const c=t.angle*(180/Math.PI)%360,l=(t.angle*(180/Math.PI)+180)%360,u={clipAngle:c,mapAligned:!0,isLineLabel:!0,minZoom:e};this._writeGlyphs(i,r,a,h,n,0,o,u,!1);const d={clipAngle:l,mapAligned:!0,isLineLabel:!0,minZoom:e};this._writeGlyphs(i,r,a,h,n,0,o,d,!1),i.metricEnd()}_placeCurved(t,e,s,i){const{out:r,id:n}=this._current;r.metricStart(this._createLineLabelMetric(n,i,t.x,t.y));const o=t.clone(),a=t.angle*(180/Math.PI)%360,h=(t.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(o,e,1,a),this._placeBack(t,o,e,s,1,a),this._placeForward(t,o,e,s,1,a)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(o,e,0,h),this._placeBack(t,o,e,s,0,h),this._placeForward(t,o,e,s,0,h)),r.metricEnd()}_placeStraightAlong(t,e,s){const{out:i,id:r,shaping:n,zoomRange:o,referenceBounds:a}=this._current,{boxBorderLineColor:h,boxBackgroundColor:c}=this.evaluatedMeshParams,u=t.clone(),d=t.angle*(180/Math.PI)%360,_=(t.angle*(180/Math.PI)+180)%360,p=n.glyphs.length>0&&!(!h&&!c);if(i.metricStart(this._createLineLabelMetric(r,s,t.x,t.y)),p){const s=Math.max(e,o[0],0),h=Math.min(28,o[1]),c=oi(li(),-t.angle),u={minZoom:s,maxZoom:h,clipAngle:d,mapAligned:!0,isLineLabel:!0},p=(0,l.Lz)(this.evaluatedMeshParams.offsetX),f=(0,l.Lz)(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e=(0,fi.fA)(p,-1*f),[s,o]=n.shapeBackground(ni(li(),c,e));i.recordStart(this.instanceId,this.attributeLayout,n.glyphs[0].textureBinding),this._writeTextBox(i,r,t.x,t.y,o,a,u),i.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e=(0,fi.fA)(p,f),[s,o]=n.shapeBackground(ni(li(),c,e));u.clipAngle=_,i.recordStart(this.instanceId,this.attributeLayout,n.glyphs[0].textureBinding),this._writeTextBox(i,r,t.x,t.y,o,a,u),i.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(u,e,1,d,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(u,e,0,_,!0),i.metricEnd()}_placeBack(t,e,s,i,r,n){const o=t.clone();let a=t.backwardLength+0;for(;o.prev()&&!(a>=i);)this._placeOnSegment(o,e,a,s,-1,r,n),a+=o.length+0}_placeForward(t,e,s,i,r,n){const o=t.clone();let a=t.remainingLength+0;for(;o.next()&&!(a>=i);)this._placeOnSegment(o,e,a,s,1,r,n),a+=o.length+0}_placeFirst(t,e,s,i,r=!1){const{out:n,id:o,shaping:a,zoomRange:h,referenceBounds:c}=this._current,u=a.glyphs,d=(0,l.Lz)(this.evaluatedMeshParams.offsetX),_=(0,l.Lz)(this.evaluatedMeshParams.offsetY),p=(0,fi.fA)(d,_),f=oi(li(),-t.angle);(0,G.l0)(p,p,f);for(const l of u){const u=l.x>a.bounds.x?s:1-s,d=u*t.remainingLength+(1-u)*t.backwardLength,_=Math.abs(l.x+l.width/2-a.bounds.x),f=Math.max(0,this._zoomLevel+Math.log2(_/(d+0))),g=Math.max(e,r?0:f);if(l.maxZoom=Math.min(h[1],28),l.angle=t.angle+(1-s)*Math.PI,l.minZoom=Math.max(h[0],g),this._writeLineGlyph(n,o,t.x,t.y,l,i,c,!0),(s||this._current.offsetDirection)&&this._isVisible(l.minZoom,l.maxZoom)){const t=new mi(l.bounds.x+p[0],l.bounds.y+p[1],l.bounds.width,l.bounds.height);n.metricBoxWrite(t)}}}_placeOnSegment(t,e,s,i,r,n,o){const{out:a,id:h,shaping:c,referenceBounds:u}=this._current,d=c.glyphs,_=t.dx/t.length,p=t.dy/t.length,f={x:t.x+s*-r*_,y:t.y+s*-r*p},g=(0,l.Lz)(this.evaluatedMeshParams.offsetX),m=(0,l.Lz)(this.evaluatedMeshParams.offsetY),y=(0,fi.fA)(g,m),x=oi(li(),-t.angle);(0,G.l0)(y,y,x);for(const e of d){const l=e.x>c.bounds.x?n:1-n;if(!(l&&1===r||!l&&-1===r))continue;const d=Math.abs(e.x+e.width/2-c.bounds.x),_=Math.max(0,this._zoomLevel+Math.log2(d/s)-.1),p=Math.max(i,this._zoomLevel+Math.log2(d/(s+t.length+0)));if(0!==_&&(e.angle=t.angle+(1-n)*Math.PI,e.minZoom=p,e.maxZoom=_,this._writeLineGlyph(a,h,f.x,f.y,e,o,u,!0),(n||this._current.offsetDirection)&&this._isVisible(e.minZoom,e.maxZoom))){const t=new mi(e.bounds.x+y[0],e.bounds.y+y[1],e.bounds.width,e.bounds.height);a.metricBoxWrite(t)}}}_writeLineGlyph(t,e,s,i,r,n,o,a){if(s<0||s>_.CQ||i<0||i>_.CQ)return;t.recordStart(this.instanceId,this.attributeLayout,r.textureBinding);const{texcoords:h,offsets:c}=r,{fontSize:l,haloSize:u,outlineSize:d}=this._textMeshTransformProps;this._writeQuad(t,e,s,i,{texcoords:h,offsets:c,fontSize:l,haloSize:u,outlineSize:d,color:Ys(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:o,minZoom:Math.max(this._current.zoomRange[0],r.minZoom),maxZoom:Math.min(this._current.zoomRange[1],r.maxZoom),clipAngle:n,mapAligned:a,isLineLabel:!0}),t.recordEnd()}_packedZoom(t){return Math.floor(t*_.fq)/_.fq}_isVisible(t,e){let s=Math.max(this._current.zoomRange[0],t),i=Math.min(this._current.zoomRange[1],e);s=this._packedZoom(s),i=this._packedZoom(i);const r=this._packedZoom(this._zoomLevel);return s<=r&&r<=i}}function Vo(t,e,s){const{coords:i,lengths:r}=e,n=(0,Mo.vt)(),o=(0,Mo.vt)(),a=(0,Mo.vt)(),h=(0,Mo.vt)(),c=(0,Mo.vt)(),l=(0,Mo.vt)();let u=0;for(let e=0;e<r.length;e++){const d=r[e];for(let e=0;e<d;e++){const r=2*(e+u-1),_=2*(e+u),p=2*(e+u+1);e>0?(0,G.hZ)(n,i[r],i[r+1]):(0,G.hZ)(n,0,0),(0,G.hZ)(o,i[_],i[_+1]),e<d-1?(0,G.hZ)(a,i[p],i[p+1]):(0,G.hZ)(a,0,0),0===e?(0,G.hZ)(h,0,0):((0,G.jb)(h,o,n),(0,G.S8)(h,h),(0,G.hZ)(h,h[1],-h[0])),e===d-1?(0,G.hZ)(c,0,0):((0,G.jb)(c,a,o),(0,G.S8)(c,c),(0,G.hZ)(c,c[1],-c[0])),(0,G.WQ)(l,h,c),(0,G.S8)(l,l);const f=l[0]*c[0]+l[1]*c[1];0!==f&&(0,G.hs)(l,l,f),(0,G.hs)(l,l,s),t.coords.push(o[0]+l[0],o[1]+l[1])}t.lengths.push(d),u+=d}return t}const Xo={createComputedParams:t=>t,optionalAttributes:Pn.optionalAttributes,attributes:{...Pn.attributes,bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:({gradientMethod:t,gradientSizeUnits:e,gradientType:s})=>Ws([[0,"alongline"===t.toLowerCase()],[1,e===Dt.OW.Absolute],[2,"discrete"===s.toLowerCase()]])},tlbr:{type:Bi.pe.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+_.hM+_.MZ,n=e.y+_.hM;return[r,n,r+s-2*_.MZ,n+i]}},accumulatedDistance:{type:Bi.pe.HALF_FLOAT,count:1,packTessellation:({distance:t,pathLength:e,distanceOffset:s})=>(s+t)/e},gradientSize:{type:Bi.pe.HALF_FLOAT,count:1,pack:({gradientSize:t,gradientSizeUnits:e})=>e===Dt.OW.Relative?t/100:(0,l.Lz)(t)},totalLength:{type:Bi.pe.HALF_FLOAT,count:1,packTessellation:({pathLength:t})=>t},segmentDirection:{type:Bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]}}};class Ho extends Tn{get _preventEffectClipping(){return!0}constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Xo,this._tessellationOptions.textured=!0}_write(t,e,s){const i=s??Tt.fromFeatureSetReaderCIM(e);if(!i)return;const{sprite:r}=this.evaluatedMeshParams;this._writeGeometry(t,e,i,r?.textureBinding)}}const Qo={createComputedParams:t=>t,optionalAttributes:Pn.optionalAttributes,attributes:{...Pn.attributes,bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:s})=>Ws([[4,t],[2,e],[3,s]])},tlbr:{type:Bi.pe.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+_.hM,n=e.y+_.hM;return[r,n,r+s,n+i]}},accumulatedDistance:{type:Bi.pe.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:Bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:Bi.pe.HALF_FLOAT,count:1,pack:({offsetAlongLine:t})=>(0,l.Lz)(t)},capType:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case Dt.uT.Butt:case"butt":return 0;case Dt.uT.Square:case"square":return 1;case Dt.uT.Round:case"round":return 2;default:return 0}}}}};class Zo extends Tn{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Qo,this._tessellationOptions.textured=!0}_write(t,e,s){const i=s??Tt.fromFeatureSetReaderCIM(e);if(!i)return;const{sprite:r}=this.evaluatedMeshParams;this._writeGeometry(t,e,i,r?.textureBinding)}}class $o{static from(t){return"width"in t?this.fromSimpleMeshParams(t):this.fromComplexMeshParams(t)}static fromSimpleMeshParams(t){const e=new $o(t.sprite,t.color,t.outlineColor,t.minPixelBuffer,t.placement,t.scaleInfo,t.effects),{type:s,width:i,height:r,angle:n,alignment:o,outlineSize:a,referenceSize:h,sprite:c,overrideOutlineColor:u}=t;return e.rawWidth=(0,l.Lz)(i),e.rawHeight=(0,l.Lz)(r),e.angle=n,e.alignment=o,e.outlineSize=(0,l.Lz)(a),e.referenceSize=(0,l.Lz)(h),e.overrideOutlineColor=u,e.offsetX=(0,l.Lz)(t.offsetX),e.offsetY=(0,l.Lz)(t.offsetY),"simple"!==s||c.sdf||(e.rawWidth=c.width,e.rawHeight=c.height),e._computeSize(t,!1),e}static fromComplexMeshParams(t){const e=new $o(t.sprite,t.color,t.outlineColor,t.minPixelBuffer,t.placement,t.scaleInfo,t.effects);let{alignment:s,transforms:i,size:r,scaleX:n,anchorX:o,anchorY:a,angle:h,colorLocked:c,frameHeight:u,widthRatio:d,offsetX:_,offsetY:p,outlineSize:f,referenceSize:g,scaleFactor:m,sizeRatio:y,isAbsoluteAnchorPoint:x,rotateClockwise:b,scaleSymbolsProportionally:w,sprite:v}=t;if(i&&i.infos.length>0){const t=(0,de.zb)(r,h,b,_,p,i);r=t.size,h=t.rotation,_=t.offsetX,p=t.offsetY,b=!1}m&&(r*=m,_*=m,p*=m);const I=n*(v.width/v.height);e.alignment=s,e.rawHeight=(0,l.Lz)(r),e.rawWidth=e.rawHeight*I,e.referenceSize=(0,l.Lz)(g),e.sizeRatio=y,e.sdfDecodeCoeff=(v.sdfDecodeCoeff??1)*y,e.angle=h,e.rotateClockwise=b,e.anchorX=o,e.anchorY=a,e.offsetX=(0,l.Lz)(_),e.offsetY=(0,l.Lz)(p),x&&r&&(v.sdf?e.anchorX=o/(r*d):e.anchorX=o/(r*I),e.anchorY=a/r);const S=w&&u?r/u:1;return e.outlineSize=0===f||isNaN(f)?0:(0,l.Lz)(f)*S,e.scaleSymbolsProportionally=w,e.colorLocked=c,e._computeSize(t,!0),e}constructor(t,e,s,i,r,n,o){this.sprite=t,this.color=e,this.outlineColor=s,this.minPixelBuffer=i,this.placement=r,this.scaleInfo=n,this.effects=o,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=Dt.C1.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(t,e){const{sprite:s,hasSizeVV:i}=t,r=!!s.sdf,n=s.sdfPaddingRatio??.5,{rawWidth:o,rawHeight:a,sizeRatio:h,outlineSize:c}=this,l=s.rect;let u=o*h,d=a*h,p=0,f=0;if(r){const t=1/(1-n);if(u*=t,d*=t,i)this.computedWidth=u,this.computedHeight=d;else{const t=e&&o>a?u:o,i=a,r=c+2;this.computedWidth=Math.min(t+r,u),this.computedHeight=Math.min(i+r,d);const n=Math.max(s.width,s.height)/Math.max(u,d);p=(this.computedWidth-u)*n,f=(this.computedHeight-d)*n}}else this.computedWidth=u*(l.width/s.width),this.computedHeight=d*(l.height/s.height),p=2*_.hM,f=2*_.hM;const g=l.x+_.hM-p/2,m=l.y+_.hM-f/2,y=g+s.width+p,x=m+s.height+f;this.texXmin=Jo(g),this.texYmin=Jo(m),this.texXmax=Ko(y),this.texYmax=Ko(x),this.computedWidth*=(this.texXmax-this.texXmin)/(y-g),this.computedHeight*=(this.texYmax-this.texYmin)/(x-m),this.anchorX*=u/this.computedWidth,this.anchorY*=d/this.computedHeight}}function Jo(t,e=1e-7){const s=Math.ceil(t);return s-t<e?s:Math.floor(t)}function Ko(t,e=1e-7){const s=Math.floor(t);return t-s<e?s:Math.ceil(t)}const ta=128/Math.PI;const ea={createComputedParams:t=>$o.from(t),optionalAttributes:{zoomRange:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:_.fq,pack:({scaleInfo:t},{tileInfo:e})=>Bs(t,e)}},attributes:{pos:{type:Bi.pe.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:({sprite:t,alignment:e,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let n=0;return t.sdf&&(n|=qs(Hs)),e===Dt.C1.MAP&&(n|=qs(Qs)),s&&(n|=qs(Zs)),i&&(n|=qs($s)),r&&(n|=qs(Js)),n}},offset:{type:Bi.pe.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:t,computedWidth:e,computedHeight:s,anchorX:i,anchorY:r,offsetX:n,offsetY:o,rotateClockwise:a})=>{const h=function(t,e,s,i,r=!1){const n=li(),o=r?1:-1;return si(n),(e||s)&&ni(n,n,[e,-s]),i&&ri(n,n,.017453292519944444*o*-i),n}(0,n,o,-t,a),c=-(.5+i)*e,l=-(.5-r)*s,u=[c,l],d=[c+e,l],_=[c,l+s],p=[c+e,l+s];return(0,G.l0)(u,u,h),(0,G.l0)(d,d,h),(0,G.l0)(_,_,h),(0,G.l0)(p,p,h),[u,d,_,p]}}},textureUV:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:t,texXmin:e,texYmax:s,texYmin:i})=>[[e,i],[t,i],[e,s],[t,s]]}},color:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>Ys(t)},outlineColor:{type:Bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>Ys(t)},sizing:{type:Bi.pe.UNSIGNED_BYTE,count:4,pack:({rawWidth:t,rawHeight:e,outlineSize:s,referenceSize:i})=>[Vs(Math.max(t,e),128),Vs(s,128),Vs(i,128),0]},placementAngle:{type:Bi.pe.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:t})=>function(t){return function(t){return t%=256,Math.abs(t>=0?t:t+256)}(t*ta)}(t)},sdfDecodeCoeff:{type:Bi.pe.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:t})=>t}}};class sa extends Ui{constructor(){super(...arguments),this.vertexSpec=ea}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(t,e,s){const i=this.evaluatedMeshParams.sprite?.textureBinding,r=e.getDisplayId();t.recordStart(this.instanceId,this.attributeLayout,i);const n=this.evaluatedMeshParams.minPixelBuffer,o=Math.max(this.evaluatedMeshParams.computedWidth,n),a=Math.max(this.evaluatedMeshParams.computedHeight,n),h=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,c=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,l=this.evaluatedMeshParams.offsetX+h,u=-this.evaluatedMeshParams.offsetY+c;if(null!=this.evaluatedMeshParams.placement){let i=null;if(null!=s&&(i=Jt(s,2*Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight),!1),null===i))return;this._writePlacedMarkers(t,e,i,o,a)}else if(s?.nextPath()){s.nextPoint();const e=s.x,i=s.y;t.recordBounds(e+l,i+u,o,a),this._writeQuad(t,r,e,i)}else if("esriGeometryPolygon"===e.geometryType){const s=e.readCentroidForDisplay();if(!s)return;const[i,n]=s.coords;t.recordBounds(i+l,n+u,o,a),this._writeQuad(t,r,i,n)}else if("esriGeometryPoint"===e.geometryType){const s=e.readXForDisplay(),i=e.readYForDisplay();t.recordBounds(s+l,i+u,o,a),this._writeQuad(t,r,s,i)}else{const s=e.readGeometryForDisplay();s?.forEachVertex(((e,s)=>{t.recordBounds(e+l,s+u,o,a),Math.abs(e)>Lt||Math.abs(s)>Lt||this._writeQuad(t,r,e,s)}))}t.recordEnd()}_writePlacedMarkers(t,e,s,i,r){const n=s??Tt.fromFeatureSetReaderCIM(e);if(!n)return;const o=Ns.getPlacement(n,-1,this.evaluatedMeshParams.placement,(0,l.Lz)(1),t.id,zi());if(!o)return;const a=e.getDisplayId();let h=o.next();const c=this.evaluatedMeshParams.offsetX,u=-this.evaluatedMeshParams.offsetY;for(;null!=h;){const e=h.tx,s=-h.ty;if(Math.abs(e)>Lt||Math.abs(s)>Lt){h=o.next();continue}const n=-h.getAngle();t.recordBounds(e+c,s+u,i,r),this._writeQuad(t,a,e,s,n),h=o.next()}}_writeQuad(t,e,s,i,r){const n=t.vertexCount(),o=null==r?null:{placementAngle:r};this._writeVertex(t,e,s,i,o),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2)}}var ia=s(4576),ra=s(55674);class na{destroy(){}}class oa extends na{constructor(t){super(),this._value=t}resize(t){}read(t,e){return this._value}readWithDefault(t,e,s){return this._value}hasArcadeDependency(t){return!1}}async function aa(t,e,s,i){const{defaultValue:r,valueExpressionInfo:n,value:o}=e;if(n){if("dictionary-template"===n.type)return{...e,computed:t.createDictionaryTemplateField(n,s),defaultValue:r};const{expression:o}=n,a=await t.createComputedField({expression:o},i);return a?{...e,computed:a,defaultValue:r}:null}return{...e,computed:new oa(o),defaultValue:r}}async function ha(t,e,s){const{valueExpressionInfo:i}=e,r="dictionary-template"===i.type?t.createDictionaryTemplateField(i,s):await t.createComputedField({expression:i.expression});return r?{...e,computed:r}:null}function ca(t){return"object"==typeof t&&null!=t&&(!(!("valueExpressionInfo"in t)||!t.valueExpressionInfo)||"type"in t&&"Process"===t.type&&"op"in t&&"Random"===t.op)}function la(t){if(Array.isArray(t))for(const e of t)if(la(e))return!0;if("object"==typeof t){if(ca(t))return!0;for(const e in t)if(la(t[e]))return!0}return!1}class ua{static async create(t,e,s,i){const r={},n=new Map,o=new Map,a=new Map,h=new Map,c=new Map,l=new Map;for(const u in s){const d=s[u];if(null!=d&&"object"==typeof d)if(Array.isArray(d)){if("object"==typeof d[0])throw new Error(`InternalError: Cannot handle ${u}. Nested array params are not supported`);r[u]=d}else if("valueExpressionInfo"in d){if(d.value){r[u]=d.value;continue}const e=await ha(t,d,i);if(!e){r[u]=d.defaultValue;continue}n.set(u,e),r[u]=null}else switch(d.type){case"cim-effect-infos":if(d.effectInfos.some((t=>t.overrides.length))){o.set(u,{effects:await Promise.all(d.effectInfos.map((async e=>{const s=e.overrides.map((e=>aa(t,e,i,!1)));return{effect:e.effect,compiledOverrides:(await Promise.all(s)).filter(ia.Ru)}})))});break}r[u]=d.effectInfos.map((t=>t.effect));break;case"cim-marker-placement-param":d.overrides.length&&a.set(u,{placementInfo:d,compiledOverrides:(await Promise.all(d.overrides.map((e=>aa(t,e,i,!1))))).filter(ia.Ru)}),r[u]=d.placement;break;case"text-rasterization-param":{if(d.overrides.length){const e=d.overrides.map((e=>aa(t,e,i,d.useLegacyLabelEvaluationRules??!1)));h.set(u,{compiledOverrides:(await Promise.all(e)).filter(ia.Ru),rasterizationParam:d,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:d.resource};r[u]=await e.fetchResourceImmediate(s)??null;break}case"sprite-rasterization-param":{if(d.overrides.length){const e=d.overrides.map((e=>aa(t,e,i,!1)));h.set(u,{compiledOverrides:(await Promise.all(e)).filter(ia.Ru),rasterizationParam:d,objectIdToResourceId:new Map});continue}if("animated"===d.resource.type){h.set(u,{compiledOverrides:[],rasterizationParam:d,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:d.resource};r[u]=await e.fetchResourceImmediate(s)??null;break}case"cim-marker-transform-param":{const{params:e}=d;if(la(e)){const s={compiledMarkerInfos:[]};await Promise.all(e.map((async e=>{const r={props:{}};for(const s in e)if(ca(e[s])){const n=await ha(t,e[s],i);r.compiledExpressionMap||(r.compiledExpressionMap=new Map);const o=r.compiledExpressionMap;n&&o.set(s,n)}else r.props[s]=e[s];s.compiledMarkerInfos.push(r)}))),c.set(u,s)}else r[u]={type:"cim-marker-transform-info",infos:e};break}case"animation-params":{const{params:s}=d,i=pr(s);if(la(i)){const e=await Promise.all(i.map((e=>gr(e,t))));l.set(u,{params:e,propertyIdToResourceId:new Map,key:u})}else{const t=_r(i),s=await e.fetchResourceImmediate({type:"animation-info",resource:t});null!=s&&"sprite"===s.type&&(r[u]={dataRow:s.rect.y,dataColumn:s.rect.x})}break}default:r[u]=d}else r[u]=d}return new ua(s,r,n,o,a,h,c,l)}constructor(t,e,s,i,r,n,o,a){this.inputMeshParams=t,this._resolvedMeshParams=e,this._dynamicProperties=s,this._dynamicEffectProperties=i,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=n,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=a,this.evaluator=t=>t,this._arcadeDependencies=new Set;for(const t of this._expressions())(0,ra.QY)(this._arcadeDependencies,t)}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size||this._dynamicAsyncAnimations.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(t,e,s){for(const r of this._dynamicAsyncProperties.values()){const n=(0,St.o8)(r.rasterizationParam.resource);"animated"===r.rasterizationParam.resource.type&&r.rasterizationParam.resource.randomizeStartTime&&(n.primitiveName="__RESERVED__PRIMITIVE__NAME__",n.startGroup=Xi(e.getObjectId()||0));for(const{primitiveName:t,propertyName:o,computed:a,defaultValue:h,valueExpressionInfo:c}of r.compiledOverrides)try{Ni(n,"animated"===r.rasterizationParam.resource.type?n.primitiveName:t,o,a,e,s,h)}catch(t){D.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator").errorOnce(new i.A("invalid-arcade-expression","Encountered an error when evaluating the arcade expression",{error:t,valueExpressionInfo:c}))}const o=t.enqueueRequest({type:"cim-rasterization-info",resource:n});r.objectIdToResourceId.set(e.getObjectId(),o)}for(const i of this._dynamicAsyncAnimations.values()){const r=i.params.map((t=>mr(t,e,s))).map(or).map((t=>t.simplify())),n=fr(r),o=t.enqueueRequest({type:"animation-info",resource:n});i.propertyIdToResourceId.set(e.getObjectId()+"."+i.key,o)}}evaluateMeshParams(t,e,s){for(const[t,i]of this._dynamicProperties.entries())this._resolvedMeshParams[t]=i.computed.readWithDefault(e,s,i.defaultValue);for(const[t,i]of this._dynamicPlacementProperties.entries())for(const{computed:r,defaultValue:n,propertyName:o}of i.compiledOverrides){const a=r.readWithDefault(e,s,n);i.placementInfo.placement[o]=a,this._resolvedMeshParams[t]=i.placementInfo.placement}for(const[t,i]of this._dynamicEffectProperties.entries())for(const r of i.effects){for(const{computed:t,defaultValue:i,propertyName:n}of r.compiledOverrides){const o=t.readWithDefault(e,s,i);r.effect[n]=o}this._resolvedMeshParams[t]=i.effects.map((t=>t.effect))}for(const[t,i]of this._dynamicTransformProperties.entries()){const r={type:"cim-marker-transform-info",infos:[]};for(const t of i.compiledMarkerInfos){const i={...t.props};if(t.compiledExpressionMap)for(const[r,n]of t.compiledExpressionMap){const t=n.computed.readWithDefault(e,s,n.defaultValue);i[r]="number"==typeof t||"boolean"==typeof t?t:n.defaultValue}r.infos.push(i)}this._resolvedMeshParams[t]=r}for(const[s,i]of this._dynamicAsyncProperties.entries()){const r=i.objectIdToResourceId.get(e.getObjectId());if(null==r)continue;const n=t.getResource(r);this._resolvedMeshParams[s]=n}for(const[s,i]of this._dynamicAsyncAnimations.entries()){const r=i.propertyIdToResourceId.get(e.getObjectId()+"."+s);if(null==r)continue;const n=t.getResource(r);this._resolvedMeshParams[s]={dataRow:n.rect.y,dataColumn:n.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}*_expressions(){for(const t of this._dynamicProperties.values())yield t.computed;for(const t of this._dynamicEffectProperties.values())for(const e of t.effects)for(const t of e.compiledOverrides)yield t.computed;for(const t of this._dynamicPlacementProperties.values())for(const e of t.compiledOverrides)yield e.computed;for(const t of this._dynamicAsyncProperties.values())for(const e of t.compiledOverrides)yield e.computed;for(const t of this._dynamicTransformProperties.values())for(const e of t.compiledMarkerInfos)if(null!=e.compiledExpressionMap)for(const t of e.compiledExpressionMap.values())yield t.computed;for(const t of this._dynamicAsyncAnimations.values())for(const e of t.params)yield*yr(e)}}const da={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:Bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:t=>0},offset:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const e=(0,l.Lz)(t),s=-e/2,i=-e/2;return[[s,i],[s+e,i],[s,i+e],[s+e,i+e]]}}},texCoords:{type:Bi.pe.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:Bi.pe.UNSIGNED_BYTE,count:2,pack:({size:t})=>[t,t]},referenceSize:{type:Bi.pe.UNSIGNED_BYTE,count:1,pack:({size:t})=>(0,l.Lz)(t)},zoomRange:{type:Bi.pe.UNSIGNED_BYTE,count:2,pack:({scaleInfo:t},{tileInfo:e})=>Bs(t,e)}}};class _a extends Ui{constructor(){super(...arguments),this.vertexSpec=da}_write(t,e){const s=e.getDisplayId(),i=this.evaluatedMeshParams.minPixelBuffer,r=Math.max((0,l.Lz)(this.evaluatedMeshParams.size),i);let n,o;if("esriGeometryPoint"===e.geometryType)n=e.readXForDisplay(),o=e.readYForDisplay();else{const t=e.readCentroidForDisplay();if(!t)return;n=t?.coords[0],o=t?.coords[1]}t.recordStart(this.instanceId,this.attributeLayout),t.recordBounds(n,o,r,r);const a=t.vertexCount();this._writeVertex(t,s,n,o),t.indexWrite(a+0),t.indexWrite(a+1),t.indexWrite(a+2),t.indexWrite(a+1),t.indexWrite(a+3),t.indexWrite(a+2),t.recordEnd()}}class pa{async createMeshWriter(t,e,s,i,r){const n=this._getMeshWriter(i.techniqueType),o=await ua.create(t,e,i.inputParams,r),a=new n(i.id,o,i.optionalAttributes,s);return await a.loadDependencies(),a}_getMeshWriter(t){switch(t){case yt.Fill:return Nn;case yt.DotDensity:return Ln;case yt.ComplexFill:return Un;case yt.PatternFill:return Bn;case yt.GradientFill:return ho;case yt.OutlineFill:return Hn;case yt.PatternOutlineFill:return _o;case yt.ComplexOutlineFill:return to;case yt.Marker:return sa;case yt.PieChart:return _a;case yt.Text:return Wo;case yt.Line:return Tn;case yt.TexturedLine:return Zo;case yt.GradientStroke:return Ho;case yt.Heatmap:return fo;case yt.Label:return jo;case yt.AnimatedMarker:return qr;case yt.AnimatedMarkerShift:return Wr;case yt.AnimatedFill:return Cn;case yt.AnimatedLine:return En;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}class fa{constructor(t,e,s,i,r){this.storage=t,this.proxy=e,this.viewParams=s,this.registry=i,this.fieldsMap=r}async createMeshWriters(t){const e=t.map((t=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,t,this.fieldsMap)));return Promise.all(e)}}var ga=s(563);class ma{constructor(t){this._outstandingMessages=[],this._queue=new ga.QueueProcessor({concurrency:t.concurrency,process:e=>t.process(e)})}async push(t){if(t.end)return await Promise.all(this._outstandingMessages),await this._queue.push(t),void(this._outstandingMessages=[]);const e=this._queue.push(t);return this._outstandingMessages.push(e),e}}var ya=s(43334),xa=s(31464),ba=s(95466);class wa{static async create(t,e){if("count"===e.statisticType){const t=new oa(1);return new wa(e.name,e.alias,e.type,e.statisticType,t)}const s=await t.createComputedField({expression:e.onStatisticExpression?.expression,field:e.onStatisticField});return new wa(e.name,e.alias,e.type,e.statisticType,s)}constructor(t,e,s,i,r){this.name=t,this.alias=e,this.type=s,this.statisticType=i,this.computed=r}}var va=s(65529),Ia=s(70328),Sa=s(37730),Pa=s(68298);class Ma{constructor(t){this.subscription=t,this.handledChunks=new Set}destroy(){}}class Aa{constructor(t,e,s){this._source=t,this._attributeStore=e,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}onSubscribe(t){const e=this.createState(t);this._sendStates.set(t.key.id,e),this.updateChunks()}onUnsubscribe(t){this._sendStates.get(t.key.id)?.destroy(),this._sendStates.delete(t.key.id)}requiresInvalidation(){return!1}invalidate(){const t=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of t)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(t){}hasArcadeDependency(t){return!1}getFeatureObjectIdsForAggregate(t){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(t){return this.displayMap(t,(t=>t),(t=>t))}getDisplayAndObjectIds(t){return this.displayMap(t,(t=>t),((t,e,s)=>[t,s]))}afterUpdateChunks(){}}class Ta extends Aa{constructor(t,e,s,i,r){super(t,e,r),this.spatialReference=s,this.aggregateFields=i,this._arcadeDependencies=new Set,this.events=new va.A,this.featureAdapter=Sa.T;for(const t of i)(0,ra.QY)(this._arcadeDependencies,t.computed)}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new Pa.do({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,featureIdInfo:this._metadata.featureIdInfo,spatialReference:this.spatialReference})),this._aggregateQueryEngine}get isAggregate(){return!0}removeChunks(t){}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}forEach(t){return this.forEachAggregateWorldSpace(t)}forEachInBounds(t,e){}forEachBounds(t,e){const s=(0,Ia.vt)();for(const i of t){const t=(0,Ao.jQ)(s,i.geometry,!1,!1);t&&e(t)}}}class ka{constructor(t,e,s,i,r){this.subscription=t,this.reader=e,this.clear=s,this.end=i,this.debugInfo=r,this.type="append"}get id(){return this.subscription.tile.id}createMessage(t,e,s){return{type:"append",clear:this.clear,id:this.id,append:t,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:e,attributeEpoch:s}}}class Ca{constructor(t,e,s,i,r){this.subscription=t,this.reader=e,this.remove=s,this.end=i,this.debugInfo=r,this.type="update"}get id(){return this.subscription.tile.id}createMessage(t,e,s){return{type:"update",id:this.id,modify:t,debugInfo:this.debugInfo,remove:this.remove,version:e,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:s}}}const Fa=8388607,Ea=t=>t&Fa;class Oa extends na{constructor(t){super(),this._field=t}resize(t){throw new Error("Method not implemented.")}read(t,e){return t.readAttribute(this._field)}readWithDefault(t,e){return t.readAttribute(this._field)}hasArcadeDependency(t){return!1}}function za(t,e,s){if(null==t)return null;const i=e.readArcadeFeature();e.contextTimeZone=s.$view?.timeZone;try{return t.evaluate(i,s)}catch(t){return D.A.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",t),null}}function Ra(t){return null==t||t===1/0||t===-1/0||"number"==typeof t&&isNaN(t)}function La(t,e,s,i){if(null==t)return null!=i?i:null;const r=e.readArcadeFeature();e.contextTimeZone=s.$view?.timeZone;const n=t.evaluate(r,s);return Ra(n)?null!=i?i:null:n}class Da extends na{static async create(t,e){const s=await(0,ra.Ad)(t,e.spatialReference),i=(0,wt.Wm)(t);return new Da(s,i)}constructor(t,e){super(),this._compiled=t,this._cacheKey=e}resize(t){}read(t,e){return this.hasArcadeDependency("scale")||"system"!==e.$view.timeZone?za(this._compiled,t,e):this._readCached(t,e)}readWithDefault(t,e,s){return this.hasArcadeDependency("scale")||"system"!==e.$view.timeZone?La(this._compiled,t,e,s):this._readWithDefaultCached(t,e,s)}hasArcadeDependency(t){return this._compiled?.references(t)??!1}_getCacheKey(t){if(!this._compiled?.references("timeProperties"))return this._cacheKey;const{currentStart:e,currentEnd:s}=t.$view.timeProperties;return this._cacheKey+function(t,e){const s=43758.5453*Math.sin(12.9898*t+78.233*e);return s-Math.floor(s)}(e??1,s??1)}_readCached(t,e){if(t.setCache(this._getCacheKey(e)),t.hasCachedValue())return t.getCachedValue();const s=za(this._compiled,t,e);return t.setCachedValue(s),s}_readWithDefaultCached(t,e,s){if(t.setCache(this._getCacheKey(e)),t.hasCachedValue())return t.getCachedValue();const i=La(this._compiled,t,e,s);return t.setCachedValue(i),i}}var Na=s(97770),Ga=s(18047),Ba=s(68463),qa=s(30524),Wa=s(32730);class Ya extends na{static async create(t,e){const s=(0,Wa.lc)(t);return new Ya((t=>s.replaceAll(/{[^}]*}/g,(e=>{const s=e.slice(1,-1),i=t.metadata.fieldsIndex.get(s);if(null==i)return e;const r=t.readAttribute(s);return null==r?"":function(t,e){if(null==t)return"";const s=e.domain;if(s)if("codedValue"===s.type||"coded-value"===s.type){const e=t;for(const t of s.codedValues)if(t.code===e)return t.name}else if("range"===s.type){const{max:i,min:r}=(0,Ba.A5)(e),n=+t;if(null!=r&&null!=i&&r<=n&&n<=i)return s.name}let i=t;return(0,qa.vE)(e)?i=(0,Na.Yq)(i,(0,Na.J2)("short-date")):(0,qa.WA)(e)&&(i=(0,Ga.ZV)(+i)),i||""}(r,i)}))))}constructor(t){super(),this._evaluator=t}resize(t){}read(t,e){return this._evaluator(t)}readWithDefault(t,e,s){const i=this._evaluator(t);return Ra(i)?s:i}hasArcadeDependency(t){return!1}}class Ua extends na{constructor(t,e){super(),this._template=t,this._parts=(0,de.gQ)(t.template,e)}resize(t){}read(t,e){return(0,de._h)(t,this._parts,this._template.textCase)}readWithDefault(t,e,s){return(0,de._h)(t,this._parts,this._template.textCase)}hasArcadeDependency(t){return!1}}class ja extends na{constructor(t,e){super(),this._field=t,this._normalizationInfo=e}resize(t){throw new Error("Method not implemented.")}read(t,e){return this._readNormalized(t)}readWithDefault(t,e){return this._readNormalized(t)}hasArcadeDependency(t){return!1}_readNormalized(t){const e=t.readAttribute(this._field);if(null==e)return null;const{normalizationField:s,normalizationTotal:i,normalizationType:r}=this._normalizationInfo,n=t.readAttribute(s);switch(r??"esriNormalizeByField"){case"esriNormalizeByField":return n?n?e/n:void 0:null;case"esriNormalizeByLog":return Math.log(e)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return i?e/i*100:null}}}class Va{static fromBuffer(t,e){return new Va(t,e)}static create(t,e=4294967295){const s=new Uint32Array(Math.ceil(t/32));return new Va(s,e)}constructor(t,e){this._mask=0,this._buf=t,this._mask=e}_getIndex(t){return Math.floor(t/32)}has(t){const e=this._mask&t;return!!(this._buf[this._getIndex(e)]&1<<e%32)}hasRange(t,e){let s=t,i=e;for(;s%32&&s!==i;){if(this.has(s))return!0;s++}for(;i%32&&s!==i;){if(this.has(s))return!0;i--}if(s===i)return!1;for(let t=s/32;t!==i/32;t++)if(this._buf[t])return!0;return!1}set(t){const e=this._mask&t,s=this._getIndex(e),i=1<<e%32;this._buf[s]|=i}setRange(t,e){let s=t,i=e;for(;s%32&&s!==i;)this.set(s++);for(;i%32&&s!==i;)this.set(i--);if(s!==i)for(let t=s/32;t!==i/32;t++)this._buf[t]=4294967295}unset(t){const e=this._mask&t,s=this._getIndex(e),i=1<<e%32;this._buf[s]&=4294967295^i}resize(t){const e=this._buf,s=new Uint32Array(Math.ceil(t/32));s.set(e),this._buf=s}or(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=t._buf[e];return this}and(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=t._buf[e];return this}xor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=t._buf[e];return this}ior(t){for(let e=0;e<this._buf.length;e++)this._buf[e]|=~t._buf[e];return this}iand(t){for(let e=0;e<this._buf.length;e++)this._buf[e]&=~t._buf[e];return this}ixor(t){for(let e=0;e<this._buf.length;e++)this._buf[e]^=~t._buf[e];return this}any(){for(let t=0;t<this._buf.length;t++)if(this._buf[t])return!0;return!1}copy(t){for(let e=0;e<this._buf.length;e++)this._buf[e]=t._buf[e];return this}clone(){return new Va(this._buf.slice(),this._mask)}clear(){for(let t=0;t<this._buf.length;t++)this._buf[t]=0;return this}forEachSet(t){for(let e=0;e<this._buf.length;e++){let s=this._buf[e],i=32*e;if(s)for(;s;)1&s&&t(i),s>>>=1,i++}}countSet(){let t=0;return this.forEachSet((e=>{t++})),t}}var Xa=s(39516);const Ha=()=>D.A.getLogger("esri.views.2d.layers.FeatureLayerView2D"),Qa={getAttribute:(t,e)=>t.readAttribute(e)};async function Za(t,e){try{const s=await(0,Xa.GP)(t,e);return s.isStandardized||Ha().error(new i.A("sql-parse-error","expression is not standardized",{where:t})),(e,r)=>{const n=e.readArcadeFeature();try{return s.testFeatureCompiled(n,Qa,r.currentUser)}catch(e){return Ha().warn(new i.A("sql-runtime-error","Encountered an error when evaluating where clause",{where:t,error:e})),!0}}}catch(e){return Ha().warn(new i.A("sql-runtime-error","Encountered an error when evaluating where clause",{where:t,error:e})),t=>!0}}const $a=()=>D.A.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),Ja=4294967295;function Ka(t,e,s){if(!(t.length>e))for(;t.length<=e;)t.push(s)}class th{constructor(t){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=t}createBitset(){const t=this._bitsets.length;return this._bitsets.push(Va.create(this._allocatedSize,Fa)),t+1}createDictionaryTemplateField(t,e){return new Ua(t,e)}async createComputedField(t,e=!1){if(t.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return e?await Ya.create(t.expression,this.compilationOptions):await Da.create(t.expression,this.compilationOptions)}catch(e){const s=new i.A("featurelayer","Failed to compile arcade expression",{error:e,expression:t.expression});return $a().error(s),null}if(t.normalizationType||t.normalizationField)return new ja(t.field,t);if(t.field)return new Oa(t.field);const s=new i.A("featurelayer","Unable to create computed field. No expression or field found",{info:t});return $a().error(s),null}async createWhereClause(t){return t?Za(t,this.compilationOptions.fields):null}getBitset(t){return this._bitsets[t-1]}getComputedNumeric(t,e){return this.getComputedNumericAtIndex(t&Fa,0)}setComputedNumeric(t,e,s){return this.setComputedNumericAtIndex(t&Fa,s,0)}getComputedString(t,e){return this.getComputedStringAtIndex(t&Fa,0)}setComputedString(t,e,s){return this.setComputedStringAtIndex(t&Fa,0,s)}getComputedNumericAtIndex(t,e){const s=t&Fa;return this._ensureNumeric(e,s),this._numerics[e][s]}setComputedNumericAtIndex(t,e,s){const i=t&Fa;this._ensureNumeric(e,i),this._numerics[e][i]=s}getPackedChunkId(t){const e=t&Fa;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(t,e){const s=t&Fa;this._ensureInstanceId(s),this._instanceIds[s]=e}getComputedStringAtIndex(t,e){const s=t&Fa;return this._ensureString(e,s),this._strings[e][s]}setComputedStringAtIndex(t,e,s){const i=t&Fa;this._ensureString(e,i),this._strings[e][i]=s}getXMin(t){return this._bounds[4*(t&Fa)]}getYMin(t){return this._bounds[4*(t&Fa)+1]}getXMax(t){return this._bounds[4*(t&Fa)+2]}getYMax(t){return this._bounds[4*(t&Fa)+3]}setBounds(t,e,s=!1){const i=t&Fa;if(!s&&!this._dirtyBitset.has(t))return this._bounds[4*i]!==Ja;this._dirtyBitset.unset(t);const r=e.readGeometryWorldSpace();if(Ka(this._bounds,4*i+4,0),!r||!r.coords.length)return this._bounds[4*i]=Ja,this._bounds[4*i+1]=Ja,this._bounds[4*i+2]=Ja,this._bounds[4*i+3]=Ja,!1;let n=1/0,o=1/0,a=-1/0,h=-1/0;return r.forEachVertex(((t,e)=>{n=Math.min(n,t),o=Math.min(o,e),a=Math.max(a,t),h=Math.max(h,e)})),this._bounds[4*i]=n,this._bounds[4*i+1]=o,this._bounds[4*i+2]=a,this._bounds[4*i+3]=h,!0}getBounds(t,e){const s=this.getXMin(e),i=this.getYMin(e),r=this.getXMax(e),n=this.getYMax(e);return(0,Ia.BI)(t,s,i,r,n),s!==Ja}_ensureNumeric(t,e){this._numerics[t]||(this._numerics[t]=[]),Ka(this._numerics[t],e,0)}_ensureInstanceId(t){Ka(this._instanceIds,t,0)}_ensureString(t,e){this._strings[t]||(this._strings[t]=[]),Ka(this._strings[t],e,null)}}var eh=s(58727),sh=s(62660),ih=s(86420),rh=s(61956),nh=s(66131),oh=s(44729),ah=s(15032),hh=s(62577),ch=s(27647),lh=s(98623);class uh{constructor(t){this._valid=Va.create(t),this._data=new Array(t)}has(t){return this._valid.has(t)}set(t,e){this._valid.set(t),this._data[t]=e}get(t){return this._data[t]}}const dh=(0,n.A)("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],_h=dh[0],ph=dh[1],fh=dh[2],gh=dh[3],mh=(0,n.A)("featurelayer-simplify-payload-size-factors")??[1,2,4],yh=mh[0],xh=mh[1],bh=mh[2],wh=(0,n.A)("featurelayer-simplify-mobile-factor")??2,vh=(0,n.A)("esri-mobile"),Ih=4294967295;class Sh{constructor(t){this.metadata=t,this.type="FeatureSetReader",this._overrides=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}getAreaSimplificationThreshold(t,e){let s=1;const i=vh?wh:1;e>4e6?s=bh*i:e>1e6?s=xh*i:e>5e5?s=yh*i:e>1e5&&(s=i);let r=0;return t>4e3?r=gh*s:t>2e3?r=fh*s:t>100?r=ph:t>15&&(r=_h),r}getBounds(t){if(function(t,e){if(!(t.length>e))for(;t.length<=e;)t.push(0)}(this._boundsBuffer,4*this.getIndex()+4),this.getBoundsXMin()===Ih)return!1;if(0===this.getBoundsXMin()){const e=this.readGeometryWorldSpace();if(!e)return this.setBoundsXMin(Ih),!1;let s=1/0,i=1/0,r=-1/0,n=-1/0;return e.forEachVertex(((t,e)=>{s=Math.min(s,t),i=Math.min(i,e),r=Math.max(r,t),n=Math.max(n,e)})),this.setBoundsXMin(s),this.setBoundsYMin(i),this.setBoundsXMax(r),this.setBoundsYMax(n),(0,Ia.BI)(t,s,i,r,n),!0}const e=this.getBoundsXMin(),s=this.getBoundsYMin(),i=this.getBoundsXMax(),r=this.getBoundsYMax();return(0,Ia.BI)(t,e,s,i,r),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(t){this._boundsBuffer[4*this.getIndex()]=t}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(t){this._boundsBuffer[4*this.getIndex()+1]=t}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(t){this._boundsBuffer[4*this.getIndex()+2]=t}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(t){this._boundsBuffer[4*this.getIndex()+3]=t}readAttributeAsTimestamp(t){const e=this.readAttribute(t);return"string"==typeof e?new Date(e).getTime():"number"==typeof e||null==e?e:null}readAttribute(t,e=!1){const s=this._readAttribute(t,e);if(void 0!==s)return s;for(const s of this._joined){s.setIndex(this.getIndex());const i=s._readAttribute(t,e);if(void 0!==i)return i}}readAttributes(){const t=this._readAttributes();for(const e of this._joined){e.setIndex(this.getIndex());const s=e._readAttributes();for(const e of Object.keys(s))t[e]=s[e]}return t}joinAttributes(t){this._joined.push(t)}registerOverrides(t){this._overrides=t}withoutOverrides(){const t=this.copy();return t._overrides=null,t}readOptimizedFeatureWorldSpace(){const t=this.readGeometryWorldSpace(),e=this.readAttributes(),s=this.readCentroidWorldSpace();return new ya.Om(t,e,s,this.getObjectId(),this.getDisplayId())}readLegacyFeatureForDisplay(){const t=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(t&&{x:t.coords[0],y:t.coords[1]})??null}}readLegacyFeatureWorldSpace(){const t=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(t&&{x:t.coords[0],y:t.coords[1]})??null}}readLegacyGeometryForDisplay(){const t=this.readGeometryForDisplay();return(0,Ao.zv)(t,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const t=this._readX(),e=this.getInTransform();return null==e?t:t*e.scale[0]+e.translate[0]}readYWorldSpace(){const t=this._readY(),e=this.getInTransform();return null==e?t:e.translate[1]-t*e.scale[1]}readGeometryForDisplay(){const t=this._readGeometryDeltaDecoded(!0);if(!t){const t=this._createDeltaQuantizedGeometryFromServerCentroid();return t?t.deltaDecode():null}return t}readGeometryForDisplayTransformed(t){let e=this.readGeometryForDisplay();if(e&&(e=(0,Ao.hK)(e,t,this.metadata.geometryType,this.hasZ,this.hasM)),!e){const e=this.readCentroidForDisplay();if(!e)return null;const s=(0,hh.IE)(t,e.coords[0]),i=(0,hh.B2)(t,e.coords[1]);return this._createDeltaQuantizedExtrudedGeometry(s,i).deltaDecode()}return e}readGeometryWorldSpace(){let t=this._readGeometry();if(t||(t=this._createDeltaQuantizedGeometryFromServerCentroid()),!t)return null;const e=t.clone(),s=this.getInTransform();return null!=s&&(0,Ao.Ch)(e,e,this.hasZ,this.hasM,s),e}readCentroidForDisplay(){const t=this.readGeometryForDisplay();return t?this._computeDisplayCentroid(t):this._readServerCentroid()}readCentroidWorldSpace(){const t=this.readGeometryForDisplay(),e=t?this._computeDisplayCentroid(t):this._readServerCentroid();if(!e)return null;const s=e.clone(),i=this.getInTransform();return null!=i&&(0,Ao.Ch)(s,s,this.hasZ,this.hasM,i),s}setCache(t){let e=this._caches.get(t);null==e&&(e=new uh(this.getSize()),this._caches.set(t,e)),this._activeCache=e}setCachedValue(t){this._activeCache.set(this.getIndex(),t)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(t){const e=this._readGeometry(t);return"esriGeometryPoint"!==this.geometryType&&e&&this.getInTransform()?e.deltaDecode():e}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(t){this._contextTimeZone=t}readArcadeFeature(){return this}hasField(t){return this.fields.has(t)||this._joined.some((e=>e.hasField(t)))}geometry(){const t=this.readGeometryWorldSpace(),e=(0,Ao.zv)(t,this.geometryType,this.hasZ,this.hasM),s=(0,Mt.rS)(e);if(s){if(!this.metadata.outSpatialReference)throw new Error("InternalError: Expected spatial reference to be defined");s.spatialReference=this.metadata.outSpatialReference}return s}autocastArcadeDate(t,e){return e&&e instanceof Date?this.isUnknownDateTimeField(t)?nh.lY.unknownDateJSToArcadeDate(e):nh.lY.dateJSAndZoneToArcadeDate(e,this.contextTimeZone??lh.qU):e}isUnknownDateTimeField(t){return this.metadata.fieldsIndex.getTimeZone(t)===lh.L5}field(t){let e=this.fields.get(t);if(e)switch(e.type){case"date-only":case"esriFieldTypeDateOnly":return oh.n.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return ah.k.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return nh.lY.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const s of this._joined)if(s.setIndex(this.getIndex()),e=s.fields.get(t),e)switch(e.type){case"date-only":case"esriFieldTypeDateOnly":return oh.n.fromReader(s._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return ah.k.fromReader(s._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return nh.lY.fromReaderAsTimeStampOffset(s._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,s._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(t,e){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((t=>t.name))}castToText(t=!1){if(!t)return JSON.stringify(this.readLegacyFeatureForDisplay());const e=this.readLegacyFeatureForDisplay();if(!e)return JSON.stringify(null);const s={geometry:e.geometry,attributes:{...e.attributes??{}}};for(const t in s.attributes){const e=s.attributes[t];e instanceof Date&&(s.attributes[t]=e.getTime())}return JSON.stringify(s)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(t=null){return{attributes:this._readAttributes(),geometry:!0===t?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(t=null,e=null){return Promise.resolve(this.castAsJson(e))}_getExists(){if(this._overrides){const t=this.getObjectId();return!this._overrides.hasOverride(t)}return!0}_computeDisplayCentroid(t){if(null==this.getInTransform())return(0,ch.Q)(new At.A,t,this.hasM,this.hasZ);const e=Tt.fromOptimized(t,this.geometryType);e.yFactor*=-1;const s=ws(e);return s?(s[1]*=-1,new At.A([],s)):null}copyInto(t){t._joined=this._joined,t._overrides=this._overrides,t._objectIdToIndex=this._objectIdToIndex,t._boundsBuffer=this._boundsBuffer,t._activeCache=this._activeCache,t._caches=this._caches,t._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const t=this.readGeometryWorldSpace();return(0,Ao.zv)(t,this.geometryType,!1,!1)}_createDeltaQuantizedGeometryFromServerCentroid(){const t=this._readServerCentroid();if(!t)return null;const[e,s]=t.coords;return this._createDeltaQuantizedExtrudedGeometry(e,s)}_createDeltaQuantizedExtrudedGeometry(t,e){return"esriGeometryPolyline"===this.geometryType?this._createDeltaQuantizedExtrudedLine(t,e):this._createDeltaQuantizedExtrudedQuad(t,e)}_createDeltaQuantizedExtrudedQuad(t,e){return new At.A([5],[t-1,e,1,-1,1,1,-1,1,-1,-1])}_createDeltaQuantizedExtrudedLine(t,e){return new At.A([2],[t-1,e+1,1,-1])}}class Ph extends Sh{static fromFeatures(t,e){const{geometryType:s}=e,i=(0,Ao.Di)([],t,s,!1,!1,e.featureIdInfo);for(let e=0;e<i.length;e++)i[e].displayId=t[e].displayId;return Ph.fromOptimizedFeatures(i,e)}static fromFeatureSet(t,e){const s=(0,Ao.q3)(t,e.featureIdInfo);return Ph.fromOptimizedFeatureSet(s,e)}static fromOptimizedFeatureSet(t,e){const s=Ph.fromOptimizedFeatures(t.features,e);return s._exceededTransferLimit=t.exceededTransferLimit,s._transform=t.transform,s._fieldsIndex=new ba.A(t.fields),s}static fromOptimizedFeatures(t,e,s){const i=new Ph(t,e);return i._fieldsIndex=e.fieldsIndex,i._transform=s,i}static empty(t){return new Ph([],t)}constructor(t,e){super(e),this._exceededTransferLimit=!1,this._featureIndex=-1,this._fieldsIndex=null,this._geometryType=e.geometryType,this._features=t}get fields(){return this._fieldsIndex}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}get _current(){return this._features[this._featureIndex]}get usedMemory(){return this._current.usedMemory}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}copy(){const t=new Ph(this._features,this.metadata);return this.copyInto(t),t}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readGeometryArea(){return(0,ya.N3)(this._current)?(0,Ao.Rk)(this._current.geometry,2):0}_readX(){return(0,ya.N3)(this._current)?this._current.geometry.coords[0]:0}_readY(){return(0,ya.N3)(this._current)?this._current.geometry.coords[1]:0}_readGeometry(){return(0,ya.N3)(this._current)?this._current.geometry??null:null}_readServerCentroid(){return this._current.centroid}_readAttribute(t,e){if(!this._fieldsIndex){const e=this._current.attributes[t];if(void 0!==e)return e;const s=t.toLowerCase();for(const t in this._current.attributes)if(t.toLowerCase()===s)return this._current.attributes[t];return}const s=this._fieldsIndex.get(t);if(!s)return;const i=this._current.attributes[s.name];return null==i?i:e&&this.fields.isDateField(t)?new Date(i):i}_readAttributes(){return this._current.attributes}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._transform=this._transform,t._fieldsIndex=this._fieldsIndex}}class Mh{static{this.Shared=new Mh}getObjectId(t){return t.getObjectId()}getAttributes(t){return t.readAttributes()}getAttribute(t,e){return t.readAttribute(e)}getAttributeAsTimestamp(t,e){return t.readAttributeAsTimestamp(e)}cloneWithGeometry(t,e){const s=t.readAttributes(),i=new ya.Om(e,s,null,t.getObjectId(),t.getDisplayId()),r=Ph.fromOptimizedFeatures([i],t.metadata);return r.setIndex(0),r}getGeometry(t){return t.readGeometryWorldSpace()}getCentroid(t,e){return t.readCentroidForDisplay()}}class Ah{constructor(t){this._geometryBounds=(0,H.vt)(),this._idToVisibility=new Map,this._serviceInfo=t}static async create(t){const e=new Ah(t);return await e.update(t.filterJSON,t.spatialReference),e}get hash(){return this._hash}check(t,e){return this._applyFilter(t,e)}invalidate(){this._idToVisibility.forEach(((t,e)=>{this._idToVisibility.set(e,0)}))}setKnownIds(t){for(const e of t)this._idToVisibility.set(e,1)}setTrue(t){const e=[],s=[],i=new Set(t);return this._idToVisibility.forEach(((t,r)=>{const n=!!(1&this._idToVisibility.get(r)),o=i.has(r);!n&&o?e.push(r):n&&!o&&s.push(r),this._idToVisibility.set(r,o?3:0)})),{show:e,hide:s}}createQuery(){const{geometry:t,spatialRel:e,where:s,timeExtent:i,objectIds:r}=this;return rh.A.fromJSON({geometry:t,spatialRel:e,where:s,timeExtent:i,objectIds:r})}async update(t,e){this._hash=JSON.stringify(t);const s=await(0,eh.T2)(t,null,e);await Promise.all([this._setGeometryFilter(s),this._setIdFilter(s),this._setAttributeFilter(s),this._setTimeFilter(s)])}async _setAttributeFilter(t){if(!t?.where)return this._clause=null,void(this.where=null);this._clause=await Za(t.where,this._serviceInfo.fieldsIndex),this.where=t.where}_setIdFilter(t){this._idsToShow=t?.objectIds&&new Set(t.objectIds),this._idsToHide=t?.hiddenIds&&new Set(t.hiddenIds),this.objectIds=t?.objectIds}async _setGeometryFilter(t){if(!t?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const e=t.geometry,s=t.spatialRel??"esriSpatialRelIntersects",i=await(0,sh.xt)(s,e,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);(0,me.Rg)(this._geometryBounds,e),this._spatialQueryOperator=i,this.geometry=e,this.spatialRel=s}_setTimeFilter(t){if(this.timeExtent=this._timeOperator=null,t?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=t.timeExtent,this._timeOperator=(0,ih.I)(this._serviceInfo.timeInfo,t.timeExtent,Mh.Shared);else{const e=new i.A("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",t.timeExtent);D.A.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(e)}}_applyFilter(t,e){return this._filterByGeometry(t)&&this._filterById(t)&&this._filterByTime(t)&&this._filterByExpression(t,e)}_filterByExpression(t,e){return!this.where||this._clause(t,e)}_filterById(t){return(!this._idsToHide?.size||!this._idsToHide.has(t.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(t.getObjectId()))}_filterByGeometry(t){if(!this.geometry)return!0;const e=t.readGeometryWorldSpace();return!!e&&this._spatialQueryOperator(e)}_filterByTime(t){return null==this._timeOperator||this._timeOperator(t)}}class Th{static minimal(t,e,s=[]){return new Th({geometryType:t,fieldsIndex:new ba.A(s).toJSON(),featureIdInfo:{type:"object-id",fieldName:e},subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null})}static createFeature(t){return new Th(t)}constructor(t){let e;this._options=t,this._fieldsIndex=ba.A.fromJSON(t.fieldsIndex),t.spatialReference&&(this._spatialReference=y.A.fromJSON(t.spatialReference)),t.outSpatialReference&&(this._outSpatialReference=y.A.fromJSON(t.outSpatialReference)),"object-id"===t.featureIdInfo.type&&(e=t.featureIdInfo.fieldName),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:e,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0,datesInUnknownTimezone:this._options.timeReferenceUnknownClient??void 0,dateFieldsTimeZone:this._options.dateFieldsTimeZone??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return"esriGeometryMultiPatch"===this._options.geometryType?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get featureIdInfo(){return this._options.featureIdInfo}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get outSpatialReference(){return this._outSpatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}weakCloneWithAdditionalFields(t){return new Th({fieldsIndex:{fields:[...this._fieldsIndex.fields,...t],timeZoneByFieldName:null},geometryType:this.geometryType,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.spatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types})}}class kh extends Ma{constructor(t,e){super(t),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=e}reset(){this.destroy(),this.done=!1}destroy(){const t=this.subscription.tile.key.level;for(const e of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${e}.${t}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const t of this.featureCache.values()){const e=t.clone();e.geometry&&(0,Ao.Ch)(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}}class Ch extends Ta{static async create(t,e,s,i,r,n){const o=new th({spatialReference:e}),a=await Promise.all(t.fields.map((async t=>wa.create(o,t)))),h=t.featureFilter?await Ah.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return"geohash"===t.index.type&&await(0,xa.Nk)(e,y.A.WGS84),new Ch(t,h,r,a,e,s,i,n)}constructor(t,e,s,i,r,n,o,a){super(n,o,r,i,a),this._schema=t,this._featureFilter=e,this._arcadeContextInfo=s,this._metadata=Th.createFeature({geometryType:"esriGeometryPolygon",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new ba.A(t.fields).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,outSpatialReference:n.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}createState(t){return new kh(t,this._attributeStore)}async*applyOverrideUpdate(t){for(const t of this._sendStates.values()){t.reset();const e=new ka(t.subscription,Ph.empty(this._source.metadata),!0,!1,{});yield e}}displayMap(t,e,s){const i=new Map(t.map((t=>[e(t),t]))),r=[];for(const t of this._sendStates.values())for(const e of t.featuresWorldSpace()){const{objectId:t,displayId:n}=e,o=i.get(t);if(null!=o){const e=s(n,o,t);r.push(e),i.delete(t)}}return r}getDisplayFeatures(t){const e=new Set(t),s=new Set,i=[];for(const t of this._sendStates.values())for(const r of t.featuresWorldSpace())e.has(r.displayId)&&!s.has(r.objectId)&&(r.geometry&&i.push({...(0,Ao.oN)(r,this._metadata.geometryType,!1,!1),displayId:r.displayId}),s.add(r.objectId));return{features:[],aggregates:i,tracks:[]}}getFeatureObjectIdsForAggregate(t){for(const e of this._sendStates.values())for(const s of e.bins.values())if(s.id===t)return Array.from(s.containedObjectIds);return[]}async*updateChunks(){for(const t of this._sendStates.values())yield*this._update(t,this._source)}forEachAggregateWorldSpace(t){const e=new Set;for(const s of this._sendStates.values())for(const i of s.featuresWorldSpace())e.has(i.objectId)||(t(i),e.add(i.objectId))}_createIndexOptions(t){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:t.scale,sqlOptions:this._sqlOptions};case"grid":{const e=this._schema.index.fixedBinLevel,s=null!=e?t.tileInfoView.getLODInfoAt(e).scale:t.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:s,sqlOptions:this._sqlOptions}}}}async*_update(t,e){const{handledChunks:s,subscription:i,bins:r,featureCache:n}=t,o=i.tile;if(t.done)return;for(const i of e.chunks()){if(s.has(i.chunkId))continue;s.add(i.chunkId);const e=i.queryInfo;if("tileId"in e){const t=new b.A(e.tileId);if(t.level!==o.level||t.world!==o.key.world)continue}i.getAggregateIndex(this._createIndexOptions(t.tile)).putBounded(r,t.tile.extent,t.tile.resolution)}const a=[],h=i.tile.transform,c=i.tile.key.level;for(const t of r.values()){let e=n.get(t.id);if(e)e.attributes=t.getAttributes();else{const s=t.getGeometry(this.spatialReference,h);e=new ya.Om(s,t.getAttributes(),null,t.id),s||(e.centroid=t.getGeometricCentroid(this.spatialReference,h)),e.displayId=this._attributeStore.createDisplayIdForObjectId(`${e.objectId}.${c}`),n.set(t.id,e)}a.push(e)}this.events.emit("changed"),t.done=!e.updateTracking.updating;const l=Ph.fromOptimizedFeatures(a,this._metadata,h),u=l.getCursor(),d=t.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;u.next();)this._attributeStore.setAttributeData(u.getDisplayId(),u,d,this._sqlOptions);const _=new Ca(t.subscription,l,[],t.done,{});yield _}}class Fh{constructor(t){this._statistics=t}get statistics(){return this._statistics}}const Eh=Math.PI/180;class Oh{static create(t){return new Oh(t.map((t=>function(t){switch(t.statisticType){case"min":return new Rh(t);case"max":return new Lh(t);case"avg":return new Nh(t);case"avg_angle":return new Gh(t);case"sum":case"count":return new Dh(t);case"mode":return new Bh(t)}}(t))))}constructor(t){this._statistics=t}values(){return this._statistics.values()}insert(t,e){for(const s of this._statistics)s.insert(t,e)}merge(t){for(let e=0;e<this._statistics.length;e++){const s=this._statistics[e],i=t._statistics[e];if(s.field.name!==i.field.name)throw new Error("InternalError: Tried to merge incompatible statistics");s.merge(i)}}clone(){return new Oh(this._statistics.map((t=>t.clone())))}}class zh{constructor(t){this.field=t}insert(t,e){if(!this.field.computed)return;const s=this.field.computed.read(t,e);Ra(s)||this._insertValue(s)}}class Rh extends zh{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(t){this.value=Math.min(this.value,t)}merge(t){this.value=Math.min(this.value,t.value)}clone(){const t=new Rh(this.field);return t.value=this.value,t}}class Lh extends zh{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(t){this.value=Math.max(this.value,t)}merge(t){this.value=Math.max(this.value,t.value)}clone(){const t=new Lh(this.field);return t.value=this.value,t}}class Dh extends zh{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(t){this.value+=t}merge(t){this.value+=t.value}clone(){const t=new Dh(this.field);return t.value=this.value,t}}class Nh extends zh{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(t){this._total+=t,this._count+=1}merge(t){this._total+=t._total,this._count+=t._count}clone(){const t=new Nh(this.field);return t._total=this._total,t._count=this._count,t}}class Gh extends zh{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const t=this._x/this._count,e=this._y/this._count,s=180/Math.PI;return Math.atan2(e,t)*s}_insertValue(t){this._x=this._x+Math.cos(t*Eh),this._y=this._y+Math.sin(t*Eh),this._count+=1}merge(t){this._x+=t._x,this._y+=t._y,this._count+=t._count}clone(){const t=new Gh(this.field);return t._x=this._x,t._y=this._y,t._count=this._count,t}}class Bh extends zh{constructor(){super(...arguments),this._frequencies=new Map}get value(){let t,e=0;for(const[s,i]of this._frequencies.entries())i>e&&(e=i,t=s);return t}_insertValue(t){const e=this._frequencies.get(t);null!=e?this._frequencies.set(t,e+1):this._frequencies.set(t,1)}merge(t){for(const[e,s]of t._frequencies.entries()){const t=this._frequencies.get(e);null!=t?this._frequencies.set(e,t+s):this._frequencies.set(e,s)}}clone(){const t=new Bh(this.field);return t._frequencies=new Map(this._frequencies),t}}class qh extends Fh{static createId(t,e){return`${t}.${e}`}static create(t,e,s,i){return new qh(t,e,Oh.create(s),i)}constructor(t,e,s,i){super(s),this.gridX=t,this.gridY=e,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return qh.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const t=new qh(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return t._count=this._count,t._xWorldTotal=this._xWorldTotal,t._yWorldTotal=this._yWorldTotal,t._firstFeatureAttributes=this._firstFeatureAttributes,t._objectIds=new Set(this._objectIds),t}insert(t,e,s,i){0===this._count?this._firstFeatureAttributes=t.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=s,this._yWorldTotal+=i,this._statistics.insert(t,e),this._objectIds.add(t.getObjectId())}merge(t){if(0!==t._count){this._count+=t._count,this._firstFeatureAttributes=t._firstFeatureAttributes,this._xWorldTotal+=t._xWorldTotal,this._yWorldTotal+=t._yWorldTotal,this._statistics.merge(t._statistics);for(const e of t._objectIds.values())this._objectIds.add(e)}}getCentroidX(t){return null==t?this.centroidXWorld:(0,Ao.IE)(t,this.centroidXWorld)}getCentroidY(t){return null==t?this.centroidYWorld:(0,Ao.B2)(t,this.centroidYWorld)}getGeometry(t,e){const s=this.gridX*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell,r=new At.A([4],[s,i,s+this._worldUnitsPerCell,i,s+this._worldUnitsPerCell,i+this._worldUnitsPerCell,s,i+this._worldUnitsPerCell]);if(null!=e){const t=new At.A;return(0,Ao.Nl)(t,r,!1,!1,"esriGeometryPolygon",e)}return r}getCentroid(t){const e=new At.A([],[this.centroidXWorld,this.centroidYWorld]);if(null!=t){const s=new At.A;return(0,Ao.Nl)(s,e,!1,!1,"esriGeometryPoint",t)}return e}getGeometricCentroid(t,e){const s=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,r=new At.A([],[s,i]);if(null!=e){const t=new At.A;return(0,Ao.Nl)(t,r,!1,!1,"esriGeometryPoint",e)}return r}getAttributes(){const t={aggregateId:this.id};for(const e of this._statistics.values())t[e.field.name]=e.value;return null!=this._firstFeatureAttributes?{...t,...this._firstFeatureAttributes}:t}}var Wh=s(83047);function Yh(t,{timeZone:e,timeExtent:s}){return{$view:{scale:t,timeZone:e,timeProperties:{currentStart:s?.start,currentEnd:s?.end}}}}class Uh{constructor(t){this._options=t}insert(t,e){const s=t.getCursor(),{arcadeContextInfo:i,scale:r}=this._options,n=Yh(r,i);for(;s.next();)this._insertFeature(s,n,this._options.sqlOptions,e)}_insertFeature(t,e,s,i){const{featureFilter:r}=this._options;if(null!==r&&!r.check(t,s))return;let n=0,o=0;if("esriGeometryPoint"===t.geometryType)n=t.readXWorldSpace(),o=t.readYWorldSpace();else{if(i){const e=t.readCentroidForDisplay();if(null==e)return;const[s,i]=e.coords;if(s<0||s>_.CQ||i<0||i>_.CQ)return}const e=t.readCentroidWorldSpace();if(null==e)return;n=e.coords[0],o=e.coords[1]}this._insert(t,n,o,e)}}function jh(t,e){return(0,Wh.GA)(t)*Wh.dy*96/e}class Vh extends Uh{constructor(t){super(t),this._cells=new Map,this._pixelsPerMapUnit=jh(t.spatialReference,t.scale)}put(t){for(const e of this._cells.values()){const s=t.get(e.id);s?s.merge(e):t.set(e.id,e.clone())}}putBounded(t,e,s){const i=[e.xmin,e.ymin,e.xmax,e.ymax],[r,n,o,a]=i,h=Math.floor(r*this._pixelsPerMapUnit/this._options.cellSize),c=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),l=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize),u=Math.ceil(a*this._pixelsPerMapUnit/this._options.cellSize);for(let e=c;e<=u;e++)for(let s=h;s<=l;s++){const i=`${s}.${e}`,r=this._cells.get(i);if(!r)continue;const n=t.get(r.id);n?r&&!t.has(r.id)&&n.merge(r):t.set(r.id,r.clone())}}_insert(t,e,s,i){const r=e*this._pixelsPerMapUnit,n=s*this._pixelsPerMapUnit,o=Math.floor(r/this._options.cellSize),a=Math.floor(n/this._options.cellSize);this._getCellOrCreate(o,a).insert(t,i,e,s)}_getCellOrCreate(t,e){const s=qh.createId(t,e);let i=this._cells.get(s);if(!i){const r=1*this._options.cellSize/this._pixelsPerMapUnit;i=qh.create(t,e,this._options.fields,r),this._cells.set(s,i)}return i}}class Xh{constructor(t,e){this.inner=t,this.displayId=e}}class Hh extends Ma{constructor(t){super(t),this.didSend=!1,this.done=!1}}class Qh{constructor(t,e,s,i,r){this._level=t,this._scale=e,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const t of this._clusters.values())this._store.releaseDisplayIdForObjectId(t.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const t of this._clusters.values()){const e=t.inner.getCentroid(null),s=new ya.Om(e,t.inner.getAttributes(),null,t.inner.id,t.displayId);yield s}}clusters(){return this._clusters.values()}updateChunks(t,e){let s=!1;for(const e of t){const t=e.queryInfo;"tileId"in t&&new b.A(t.tileId).level!==this._level||this._handledChunks.has(e.normalizedChunkId)||(this._handledChunks.add(e.normalizedChunkId),s=!0,e.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells))}const i={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},r=jh(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:t}of e){const e=t.tile.bounds,s=Math.floor(e[0]*r/n),o=Math.floor(e[1]*r/n),a=Math.ceil(e[2]*r/n),h=Math.ceil(e[3]*r/n);i.xMin=Math.min(i.xMin,s),i.yMin=Math.min(i.yMin,o),i.xMax=Math.max(i.xMax,a),i.yMax=Math.max(i.yMax,h)}return null!=this._lastCellBounds&&i.xMin===this._lastCellBounds.xMin&&i.yMin===this._lastCellBounds.yMin&&i.yMin===this._lastCellBounds.yMin&&i.yMax===this._lastCellBounds.yMax||(s=!0,this._lastCellBounds=i),s&&this._clusterCells(i),s}async updateStatistics(t){let e=!1;for(const t of this._clusters.values())t.inner.count>1&&(e=this._updateAggregateStatistics(this._statistics,t.inner)||e);if(e){const e=Array.from(this._statistics.entries()).map((([t,e])=>({fieldName:t,minValue:e.minValue,maxValue:e.maxValue})));await t.container.updateStatistics(this._level,e)}}createAggregateFeatures(t,e){const s=t.subscription,i=[],r=s.tile.transform;for(const t of this._clusters.values()){let e=t.inner.getCentroidX(r);const n=t.inner.getCentroidY(r),o=s.tile.lod,a=o.wrap?o.worldSize[0]:null,h=1===t.inner.count?t.inner.firstObjectId:t.inner.id,c=t.displayId;if(null!=a)if(1===a){const s=new At.A([],[e,n]),r=new ya.Om(s,t.inner.getAttributes(),null,h,c);r.geometry.coords[0]-=_.CQ,i.push(r);const o=new At.A([],[e,n]),a=new ya.Om(o,t.inner.getAttributes(),null,h,c);a.geometry.coords[0]+=_.CQ,i.push(a)}else e>_.CQ+_.CQ/2?e-=a*_.CQ:e<-256&&(e+=a*_.CQ);if(e<_.CQ+128&&e>=-128&&n<_.CQ+128&&n>=-128){const s=new At.A([],[e,n]),r=new ya.Om(s,t.inner.getAttributes(),null,h,c);i.push(r)}}return Ph.fromOptimizedFeatures(i,e,s.tile.transform)}_clusterCells(t){let e=Array.from(this._cells.values());e=e.sort(((t,e)=>e.count-t.count));const s=[];for(const t of this._clusters.values())s.push(t.inner.id);this._clusters.clear();const i=this._clusterRadius*(1/jh(this._indexOptions.spatialReference,this._scale)),r=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const s of e){if(n.has(s.id))continue;if(s.gridX<t.xMin||s.gridX>t.xMax||s.gridY<t.yMin||s.gridY>t.yMax)continue;const e=this._store.createDisplayIdForObjectId(s.id),o=new Xh(s.clone(),e);n.add(s.id),this._clusters.set(s.id,o);const a=s.centroidXWorld,h=s.centroidYWorld;for(let t=s.gridY-r;t<=s.gridY+r;t++)for(let e=s.gridX-r;e<=s.gridX+r;e++){if(t===s.gridY&&e===s.gridX)continue;const r=this._cells.get(qh.createId(e,t));if(!r||n.has(r.id))continue;const c=Math.abs(r.centroidXWorld-a),l=Math.abs(r.centroidYWorld-h);c<i&&l<i&&(o.inner.merge(r),n.add(r.id))}}for(const t of s)this._store.releaseDisplayIdForObjectId(t)}_updateAggregateStatistics(t,e){let s=!1;for(const i of e.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const e=i.value,r=i.field,n=t.get(r.name);if(n){const{minValue:t,maxValue:i}=n,r=Math.min(n.minValue,e),o=Math.max(n.maxValue,e);t===r&&i===o||(n.minValue=r,n.maxValue=o,s=!0)}else t.set(r.name,{minValue:e,maxValue:e}),s=!0}return s}}class Zh extends Ta{static async create(t,e,s,i,r,n,o){const a=new th({spatialReference:s}),h={type:"grid",fields:await Promise.all(e.fields.map((async t=>wa.create(a,t)))),spatialReference:s,featureFilter:e.featureFilter?await Ah.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:s,filterJSON:e.featureFilter}):null,cellSize:e.clusterRadius/4,arcadeContextInfo:n,sqlOptions:o};return new Zh(t,e.clusterRadius,h,e.fields,i,r,o)}constructor(t,e,s,i,r,n,o){super(r,n,s.spatialReference,s.fields,o),this._connection=t,this._clusterRadius=e,this._indexOptions=s,this._cellsPerScale=new Map,this._metadata=Th.createFeature({geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new ba.A([...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:r.metadata.spatialReference,outSpatialReference:r.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear()}onSubscribe(t){super.onSubscribe(t),this._requiredLevel=t.tile.level,this._requiredScale=t.tile.scale}createState(t){return new Hh(t)}async*applyOverrideUpdate(t){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(t,e,s){const i=new Map(t.map((t=>[e(t),t]))),r=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const t of n.clusters()){const e=i.get(t.inner.id);if(null==e){if(1===t.inner.count){const{firstObjectId:e}=t.inner,n=e?i.get(e):null;if(null!=n){const o=s(t.displayId,n,e);r.push(o),i.delete(e)}}}else{const n=s(t.displayId,e,t.inner.id);r.push(n),i.delete(t.inner.id)}}return r}getDisplayFeatures(t){const e=new Set(t),s=new Set,i=[],r=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const t of n.aggregatesWorldSpace())if(e.has(t.displayId)&&!s.has(t.displayId)){const e=(0,Ao.oN)(t,this._metadata.geometryType,!1,!1);if(s.add(t.displayId),1===e.attributes.cluster_count){i.push({...e,displayId:t.displayId});continue}r.push({...e,displayId:t.displayId})}return{features:i,aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(t){const e=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of e.clusters())if(s.inner.id===t)return Array.from(s.inner.containedObjectIds);return[]}async*updateChunks(){const t=this._source.chunks();if(!t.length)return;const e=this._getClusterState(this._requiredLevel,this._requiredScale),s=Array.from(this._sendStates.values()).filter((t=>t.subscription.tile.level===this._requiredLevel));if(e.updateChunks(t,s)||!this._source.updateTracking.updating)for(const t of s)t.subscription.tile.level===this._requiredLevel&&(t.didSend=!1,t.done=!1);const i=Array.from(this._sendStates.values()).filter((t=>t.done)).map((t=>t.subscription.tile.key)),r=new Set(i);for(const t of this._sendStates.values()){if(this._source.updateTracking.updating){if(i.some((e=>e.containsChild(t.subscription.tile.key))))continue;if(t.subscription.tile.key.getChildKeys().every((t=>r.has(t))))continue}t.didSend||t.subscription.tile.level!==this._requiredLevel||(t.didSend=!0,yield*this._update(t,e,this._source))}await e.updateStatistics(this._connection)}forEachAggregateWorldSpace(t){if(null==this._requiredLevel||null==this._requiredScale)return;const e=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of e.aggregatesWorldSpace())t(s)}_getClusterState(t,e){if(null==t||null==e)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(e);return s||(s=new Qh(t,e,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(e,s)),s}async*_update(t,e,s){if(t.done)return;const i=e.createAggregateFeatures(t,this._metadata);this.events.emit("changed"),t.done=!s.updateTracking.updating;const r=i.getCursor(),n=t.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.arcadeContextInfo);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,n,this._sqlOptions);const o=new ka(t.subscription,i,!0,t.done,{});yield o}}var $h=s(11006);function Jh(t,e){if(!(this instanceof Jh))return new Jh(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&("function"==typeof e?this.toBBox=e:this._initFormat(e)),this.clear()}function Kh(t,e,s){if(!s)return e.indexOf(t);for(var i=0;i<e.length;i++)if(s(t,e[i]))return i;return-1}function tc(t,e){ec(t,0,t.children.length,e,t)}function ec(t,e,s,i,r){r||(r=uc(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var n,o=e;o<s;o++)n=t.children[o],sc(r,t.leaf?i(n):n);return r}function sc(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function ic(t,e){return t.minX-e.minX}function rc(t,e){return t.minY-e.minY}function nc(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function oc(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ac(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function hc(t,e){var s=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),n=Math.min(t.maxY,e.maxY);return Math.max(0,r-s)*Math.max(0,n-i)}function cc(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function lc(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function uc(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function dc(t,e,s,i,r){for(var n,o=[e,s];o.length;)(s=o.pop())-(e=o.pop())<=i||(n=e+Math.ceil((s-e)/i/2)*i,(0,$h.q)(t,n,e,s,r),o.push(e,n,n,s))}Jh.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,s=[],i=this.toBBox;if(!lc(t,e))return s;for(var r,n,o,a,h=[];e;){for(r=0,n=e.children.length;r<n;r++)o=e.children[r],lc(t,a=e.leaf?i(o):o)&&(e.leaf?s.push(o):cc(t,a)?this._all(o,s):h.push(o));e=h.pop()}return s},collides:function(t){var e=this.data,s=this.toBBox;if(!lc(t,e))return!1;for(var i,r,n,o,a=[];e;){for(i=0,r=e.children.length;i<r;i++)if(n=e.children[i],lc(t,o=e.leaf?s(n):n)){if(e.leaf||cc(t,o))return!0;a.push(n)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,s=t.length;e<s;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},insert:function(t){return null!=t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=uc([]),this},remove:function(t,e){if(null==t)return this;for(var s,i,r,n,o=this.data,a=this.toBBox(t),h=[],c=[];o||h.length;){if(o||(o=h.pop(),i=h[h.length-1],s=c.pop(),n=!0),o.leaf&&-1!==(r=Kh(t,o.children,e)))return o.children.splice(r,1),h.push(o),this._condense(h),this;n||o.leaf||!cc(o,a)?i?(s++,o=i.children[s],n=!1):o=null:(h.push(o),c.push(s),s=0,i=o,o=o.children[0])}return this},toBBox:function(t){return t},compareMinX:ic,compareMinY:rc,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var s=[];t;)t.leaf?e.push.apply(e,t.children):s.push.apply(s,t.children),t=s.pop();return e},_build:function(t,e,s,i){var r,n=s-e+1,o=this._maxEntries;if(n<=o)return tc(r=uc(t.slice(e,s+1)),this.toBBox),r;i||(i=Math.ceil(Math.log(n)/Math.log(o)),o=Math.ceil(n/Math.pow(o,i-1))),(r=uc([])).leaf=!1,r.height=i;var a,h,c,l,u=Math.ceil(n/o),d=u*Math.ceil(Math.sqrt(o));for(dc(t,e,s,d,this.compareMinX),a=e;a<=s;a+=d)for(dc(t,a,c=Math.min(a+d-1,s),u,this.compareMinY),h=a;h<=c;h+=u)l=Math.min(h+u-1,c),r.children.push(this._build(t,h,l,i-1));return tc(r,this.toBBox),r},_chooseSubtree:function(t,e,s,i){for(var r,n,o,a,h,c,l,u;i.push(e),!e.leaf&&i.length-1!==s;){for(l=u=1/0,r=0,n=e.children.length;r<n;r++)h=nc(o=e.children[r]),(c=ac(t,o)-h)<u?(u=c,l=h<l?h:l,a=o):c===u&&h<l&&(l=h,a=o);e=a||e.children[0]}return e},_insert:function(t,e,s){var i=this.toBBox,r=s?t:i(t),n=[],o=this._chooseSubtree(r,this.data,e,n);for(o.children.push(t),sc(o,r);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)},_split:function(t,e){var s=t[e],i=s.children.length,r=this._minEntries;this._chooseSplitAxis(s,r,i);var n=this._chooseSplitIndex(s,r,i),o=uc(s.children.splice(n,s.children.length-n));o.height=s.height,o.leaf=s.leaf,tc(s,this.toBBox),tc(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(s,o)},_splitRoot:function(t,e){this.data=uc([t,e]),this.data.height=t.height+1,this.data.leaf=!1,tc(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,s){var i,r,n,o,a,h,c,l;for(h=c=1/0,i=e;i<=s-e;i++)o=hc(r=ec(t,0,i,this.toBBox),n=ec(t,i,s,this.toBBox)),a=nc(r)+nc(n),o<h?(h=o,l=i,c=a<c?a:c):o===h&&a<c&&(c=a,l=i);return l},_chooseSplitAxis:function(t,e,s){var i=t.leaf?this.compareMinX:ic,r=t.leaf?this.compareMinY:rc;this._allDistMargin(t,e,s,i)<this._allDistMargin(t,e,s,r)&&t.children.sort(i)},_allDistMargin:function(t,e,s,i){t.children.sort(i);var r,n,o=this.toBBox,a=ec(t,0,e,o),h=ec(t,s-e,s,o),c=oc(a)+oc(h);for(r=e;r<s-e;r++)n=t.children[r],sc(a,t.leaf?o(n):n),c+=oc(a);for(r=s-e-1;r>=e;r--)n=t.children[r],sc(h,t.leaf?o(n):n),c+=oc(h);return c},_adjustParentBBoxes:function(t,e,s){for(var i=s;i>=0;i--)sc(e[i],t)},_condense:function(t){for(var e,s=t.length-1;s>=0;s--)0===t[s].children.length?s>0?(e=t[s-1].children).splice(e.indexOf(t[s]),1):this.clear():tc(t[s],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};class _c{static fromReader(t){const e=[],s=t.copy(),i=(0,Ia.vt)();for(;s.next();)s.getBounds(i)&&e.push(s.getIndex());const r=Jh(9,(t=>(s.setIndex(t),{minX:s.getBoundsXMin(),minY:s.getBoundsYMin(),maxX:s.getBoundsXMax(),maxY:s.getBoundsYMax()})));return r.load(e),new _c(r)}constructor(t){this._index=t}search(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this._index.search(e)}}var pc=s(79258);function fc(t,e,s,i){if(i.isWebMercator){const i=(0,ti.KJ)(t/pc.$O.radius),r=i-360*Math.floor((i+180)/360),n=[0,0];return gc(n,0,(0,ti.KJ)(Math.PI/2-2*Math.atan(Math.exp(-e/pc.$O.radius))),r,s),n}const r=(0,xa.Cv)({x:t,y:e},i,y.A.WGS84);if(!r)return null;const n=[0,0];return gc(n,0,r.y,r.x,s),n}function gc(t,e,s,i,r){r%2&&(r+=1);let n=0,o=0,a=-90,h=90,c=-180,l=180;for(let t=0;t<r/2;t++){for(let e=0;e<5;e++){const s=(c+l)/2,r=i>s?1:0;n|=r<<29-(e+5*t),c=(1-r)*c+r*s,l=(1-r)*s+r*l}for(let e=0;e<5;e++){const i=(a+h)/2,r=s>i?1:0;o|=r<<29-(e+5*t),a=(1-r)*a+r*i,h=(1-r)*i+r*h}}t[2*e]=n,t[2*e+1]=o}(0,Mo.vt)(),(0,Mo.vt)();class mc extends Fh{static create(t,e,s,i){const r=Oh.create(t),n=new Array(32);for(let t=0;t<n.length;t++)n[t]=null;return new mc(r,e,s,i,n)}constructor(t,e,s,i,r){super(t),this.xNode=e,this.yNode=s,this.depth=i,this.children=r,this._objectIds=new Set,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._xGeohashTotal=0,this._yGeohashTotal=0,this.next=null}get id(){return`${this.xNode}.${this.yNode}`}get containedObjectIds(){return this._objectIds}get count(){return this._count}clone(){const t=new mc(this._statistics.clone(),this.xNode,this.yNode,this.depth,this.children);return t._count=this._count,t._xWorldTotal=this._xWorldTotal,t._yWorldTotal=this._yWorldTotal,t._xGeohashTotal=this._xGeohashTotal,t._yGeohashTotal=this._yGeohashTotal,t.next=this.next,t._objectIds=new Set(this._objectIds),t}insert(t,e,s,i,r,n){this._count+=1,this._xWorldTotal+=e,this._yWorldTotal+=s,this._xGeohashTotal+=i,this._yGeohashTotal+=r,this._statistics.insert(t,n),this._objectIds.add(t.getObjectId())}merge(t){if(0!==t._count){this._count+=t._count,this._xWorldTotal+=t._xWorldTotal,this._yWorldTotal+=t._yWorldTotal,this._xGeohashTotal+=t._xWorldTotal,this._yGeohashTotal+=t._yWorldTotal,this._statistics.merge(t._statistics);for(const e of t._objectIds.values())this._objectIds.add(e)}}getCentroid(t){throw new Error("getCentroid not supported for GeohashNode")}getGeometry(t,e){const s=this._getLngLatBounds(),[i,r,n,o]=s,a=(0,xa.Cv)({rings:[[[i,r],[i,o],[n,o],[n,r],[i,r]]]},y.A.WGS84,t),h=(0,Ao.Ye)(new At.A,a,!1,!1);return null!=e?(0,Ao.Nl)(new At.A,h,!1,!1,"esriGeometryPolygon",e,!1,!1):h}getGeometricCentroid(t,e){const s=this._getLngLatBounds(),[i,r,n,o]=s,a=(0,xa.Cv)({x:(i+n)/2,y:(r+o)/2},y.A.WGS84,t),h=(0,Ao.qN)(new At.A,a);return null!=e?(0,Ao.Nl)(new At.A,h,!1,!1,"esriGeometryPoint",e,!1,!1):h}getAttributes(){const t={aggregateId:this.id};for(const e of this._statistics.values())t[e.field.name]=e.value;return t.aggregateCount=this._count,t}find(t,e,s,i,r,n){if(i>=s)return this;const o=1-i%2,a=3*o+2*(1-o),h=2*o+3*(1-o),c=30-r-a,l=30-n-h,u=((t&7*o+3*(1-o)<<c)>>c)+((e&3*o+7*(1-o)<<l)>>l)*(8*o+4*(1-o)),d=this.children[u];return null==d?null:d.find(t,e,s,i+1,r+a,n+h)}_getLngLatBounds(){const t=this.depth,e=Math.ceil(t/2),s=Math.floor(t/2),i=30-(3*e+2*s),r=30-(2*e+3*s);return function(t,e){let s=-90,i=90,r=-180,n=180;for(let o=0;o<e;o++){const e=Math.ceil((o+1)/2),a=Math.floor((o+1)/2),h=1-o%2,c=30-(3*e+2*a),l=30-(2*e+3*a),u=2*h+3*(1-h),d=(7*h+3*(1-h)<<c&t.geohashX)>>c,_=(3*h+7*(1-h)<<l&t.geohashY)>>l;for(let t=3*h+2*(1-h)-1;t>=0;t--){const e=(r+n)/2,s=d&1<<t?1:0;r=(1-s)*r+s*e,n=(1-s)*e+s*n}for(let t=u-1;t>=0;t--){const e=(s+i)/2,r=_&1<<t?1:0;s=(1-r)*s+r*e,i=(1-r)*e+r*i}}return[r,s,n,i]}({geohashX:this.xNode<<i,geohashY:this.yNode<<r},this.depth)}}class yc{constructor(t){this._fields=t,this._size=0,this._depth=0,this._root=mc.create(this._fields,0,0,0)}destroy(){}get size(){return this._size}get depth(){return this._depth}find(t,e,s){return this._root.find(t,e,s,0,0,0)}insert(t,e,s,i,r,n,o){let a=this._root,h=0,c=0,l=0;for(;null!==a;){if(a.insert(t,e,s,i,r,o),h>=n)return;const u=Math.ceil((h+1)/2),d=Math.floor((h+1)/2),_=1-h%2,p=30-(3*u+2*d),f=30-(2*u+3*d),g=(i&7*_+3*(1-_)<<p)>>p,m=(r&3*_+7*(1-_)<<f)>>f,y=g+m*(8*_+4*(1-_));c=c<<3*_+2*(1-_)|g,l=l<<2*_+3*(1-_)|m,null==a.children[y]&&(a.children[y]=mc.create(this._fields,c,l,h+1),this._depth=Math.max(this._depth,h+1),this._size+=1),h+=1,a=a.children[y]}}putBins(t,e){for(const s of this.getNodes(e)){const e=t.get(s.id);e?e.merge(s):t.set(s.id,s.clone())}}getNodes(t){const e=[],{geohashBounds:s,level:i}=t;let r=this._root;for(;null!==r;){const t=r.depth,n=r.xNode,o=r.yNode;if(t>=i){e.push(r),r=r.next;continue}const a=Math.ceil((t+1)/2),h=Math.floor((t+1)/2),c=1-t%2,l=30-(3*a+2*h),u=30-(2*a+3*h),d=~((1<<l)-1),_=~((1<<u)-1),p=(s.xLL&d)>>l,f=(s.yLL&_)>>u,g=(s.xTR&d)>>l,m=(s.yTR&_)>>u,y=n<<3*c+2*(1-c),x=o<<2*c+3*(1-c),b=y+8*c+4*(1-c),w=x+4*c+8*(1-c),v=Math.max(y,p),I=Math.max(x,f),S=Math.min(b,g),P=Math.min(w,m);let M=null,A=null;for(let t=I;t<=P;t++)for(let e=v;e<=S;e++){const s=e-y+(t-x)*(8*c+4*(1-c)),i=r.children[s];i&&(M||(M=i,M.next=r.next),A&&(A.next=i),A=i,i.next=r.next)}r=M||r.next}return e}}class xc extends Uh{constructor(t){super(t),this._tree=new yc(this._options.fields)}put(t){throw new Error("Geohash tree does not support put")}putBounded(t,e,s){const{geohashLevel:i,spatialReference:r}=this._options,n=function(t,e,s,i){const r=[t.xmin,t.ymin,t.xmax,t.ymax],n=Ai.A.fromExtent((0,H.w1)(r,i)),o=(0,xa.Cv)(n,i,y.A.WGS84,{densificationStep:64*e});if(!o)return null;const a=(0,Ao.Ye)(new At.A,o,!1,!1),h=a.coords.filter(((t,e)=>!(e%2))),c=a.coords.filter(((t,e)=>e%2)),l=Math.min(...h),u=Math.min(...c),d=Math.max(...h),_=Math.max(...c),p=fc(l,u,s,y.A.WGS84),f=fc(d,_,s,y.A.WGS84);return p&&f?{bounds:r,geohashBounds:{xLL:p[0],yLL:p[1],xTR:f[0],yTR:f[1]},level:s}:null}(e,s,i,r);null!=n&&this._tree.putBins(t,n)}_insert(t,e,s,i){const{geohashLevel:r,spatialReference:n}=this._options,o=fc(e,s,r,n);o&&this._tree.insert(t,e,s,o[0],o[1],r,i)}}var bc=s(69397);class wc extends Sh{static from(t,e){if(t instanceof this){const s=new Set(e),i=t._indices.filter((t=>s.has(t)));return new wc(t._reader,i)}return new wc(t.copy(),e)}constructor(t,e){super(t.metadata),this._currentIndex=-1,this._displayTransform=null,this._reader=t,this._indices=e}setTransformForDisplay(t){const e=this._reader.getInTransform();if(null==e)return void(this._displayTransform=(0,hh.Q1)(t));const s=(0,hh.Q1)(e),i=(0,hh.Q1)(t),[r,n]=s.scale,[o,a]=s.translate,[h,c]=i.scale,[l,u]=i.translate,d=r/h,_=n/c,p=(o-l)/h,f=(a-u)/c;this._displayTransform={originPosition:"lowerLeft",scale:[1/d,1/_,1,1],translate:[-p/d,-f/_,0,0]}}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const t=new wc(this._reader.copy(),this._indices);return t._currentIndex=this._currentIndex,t._displayTransform=this._displayTransform,t._processorAttributes=this._processorAttributes,t}get contextTimeZone(){return this._reader.contextTimeZone}set contextTimeZone(t){this._reader.contextTimeZone=t}get usedMemory(){return bc.qK+this._reader.usedMemory}setProcessorAttributes(t){this._processorAttributes=Object.assign(this._processorAttributes??{},t)}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}readXForDisplay(){return this._displayTransform?(0,hh.IE)(this._displayTransform,this._reader.readXForDisplay()):this._reader.readXForDisplay()}readYForDisplay(){return this._displayTransform?(0,hh.B2)(this._displayTransform,this._reader.readYForDisplay()):this._reader.readYForDisplay()}readGeometryForDisplay(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform):this._reader.readGeometryForDisplay()}readCentroidForDisplay(){const t=this._reader.readCentroidForDisplay()?.clone();if(t){const[e,s]=t.coords;this._displayTransform?(t.coords[0]=(0,hh.IE)(this._displayTransform,e),t.coords[1]=(0,hh.B2)(this._displayTransform,s)):(t.coords[0]=e,t.coords[1]=s)}return t}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}readAttribute(t,e=!1){return this._reader.readAttribute(t,e)??this._processorAttributes?.[t]}readAttributes(){return{...this._processorAttributes??{},...this._reader.readAttributes()}}joinAttributes(t){return this._reader.joinAttributes(t)}getBounds(t){return this._reader.getBounds(t)}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(t){return this._reader.setDisplayId(t)}setIndex(t){return this._reader.setIndex(t)}getIndex(){return this._reader.getIndex()}readXWorldSpace(){return this._reader.readXWorldSpace()}readYWorldSpace(){return this._reader.readYWorldSpace()}_readX(){return this._reader.readXForDisplay()}_readY(){return this._reader.readYForDisplay()}_readServerCentroid(){return this._reader._readServerCentroid()}readLegacyFeatureForDisplay(){const t=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(t&&{x:t.coords[0],y:t.coords[1]})??null}}readLegacyGeometryForDisplay(){const t=this.readGeometryForDisplay();return(0,Ao.zv)(t,this.geometryType,!1,!1)}readGeometryArea(){return this._displayTransform?this._reader.readGeometryForDisplayTransformed(this._displayTransform)?.area()??0:this._reader.readGeometryArea()}readGeometryWorldSpace(){return this._reader.readGeometryWorldSpace()}_readGeometry(){return this._reader._readGeometry()}_readAttribute(t,e){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(t){return this._reader.field(t)}hasField(t){return this._reader.hasField(t)}setField(t,e){return this._reader.setField(t,e)}keys(){return this._reader.keys()}castToText(t=!1){return this._reader.castToText(t)}}class vc{size(){return this.reader.getSize()}get fields(){return this.reader.fields}invalidate(){this._aggregateIndex=null,this._aggregateIndexHash=null,this._spatialIndex=null}registerOverrides(t){this.reader.registerOverrides(t),this.invalidate()}queryFeaturesInBounds(t){const e=this._getSpatialIndex().search(t);return wc.from(this.reader,e)}getAggregateIndex(t){const e=JSON.stringify(t);if(e!==this._aggregateIndexHash){switch(this._aggregateIndexHash=e,t.type){case"grid":this._aggregateIndex=new Vh(t);break;case"geohash":this._aggregateIndex=new xc(t)}this._aggregateIndex.insert(this.reader,this.isTiled)}return this._aggregateIndex}_getSpatialIndex(){return this._spatialIndex||(this._spatialIndex=_c.fromReader(this.reader)),this._spatialIndex}}class Ic{constructor(){this.modified=[],this.removed=[]}modify(t){this.modified.push(t)}remove(t){this.removed.push(t)}get isEmpty(){return 0===this.modified.length&&0===this.removed.length}}class Sc extends vc{constructor(t){super(),this._reader=t,this.chunkId="override",this.normalizedChunkId="override"}static fromFeatures(t,e){const s=Ph.fromOptimizedFeatures(t,e);return new Sc(s)}get reader(){return this._reader}get queryInfo(){return{}}get first(){return!1}get end(){return!1}get isTiled(){return!1}getTileReader(t){if(!this._reader.getSize())return null;const e=this.queryFeaturesInBounds(t.bounds);return e.setTransformForDisplay(t.transform),e}}class Pc{constructor(t,e){this.inner=t,this.isWeak=e,this.lastWeak=null}get isStrong(){return!this.isWeak}}class Mc{constructor(){this._overrides=new Map,this._update=new Ic,this._lastCleanup=0}hasOverride(t){return this._overrides.has(t)}onChunkInsert(t){if(this._overrides.size){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId(),s=this._overrides.get(t);if(s?.lastWeak&&(s.lastWeak=null),s?.isWeak){const t=e.readOptimizedFeatureWorldSpace();s.inner=t,this._update.modify(t),this.invalidate()}}}t.registerOverrides(this)}apply(t,e){const{updateWeak:s,removeWeak:i,update:r,remove:n,release:o}=t.commands;this.invalidate();for(const t of s){const e=new Pc(t,!0),s=this._overrides.get(t.objectId);s?.isStrong?s.lastWeak=e:(this._overrides.set(t.objectId,e),this._update.modify(t))}for(const t of r){const e=new Pc(t,!1),s=this._overrides.get(t.objectId);e.lastWeak=s?.isWeak?s:s?.lastWeak??null,this._overrides.set(t.objectId,e),this._update.modify(t)}for(const t of i){const e=new Pc(null,!0),s=this._overrides.get(t);s?.isStrong?s.lastWeak=e:(this._overrides.set(t,e),this._update.remove(t))}for(const t of n){const e=new Pc(null,!1),s=this._overrides.get(t);e.lastWeak=s?.isWeak?s:s?.lastWeak??null,this._overrides.set(t,e),this._update.remove(t)}if(o.length){const t=new Set;for(const e of o){const s=this._overrides.get(e);s?.lastWeak?(this._overrides.set(e,s.lastWeak),null==s.lastWeak.inner?this._update.remove(e):this._update.modify(s.lastWeak.inner)):s&&!s.isWeak&&(this._overrides.delete(e),t.add(e))}e.forEachUnsafe((e=>{const s=e.getObjectId();t.has(s)&&(this._update.modify(e.readOptimizedFeatureWorldSpace()),t.delete(s))}));for(const e of t.values())this._update.remove(e)}}clearWeakOverrides(){for(const[t,e]of this._overrides.entries())e.isWeak&&this._overrides.delete(t);this.invalidate()}cleanup(t){if(this._overrides.size<1e4)return;const e=performance.now();if(e-this._lastCleanup<1e3)return;this._lastCleanup=e;const s=this._getWeakDeletions();if(!(s.size<1e4)){for(const e of t){const t=e.reader.withoutOverrides().getCursor();for(;t.next();){const e=t.getObjectId();s.delete(e)}}for(const t of s)this._overrides.delete(t);s.size&&this.invalidate()}}takeOverrideUpdate(){const t=this._update;return t.isEmpty?null:(this._update=new Ic,t)}asChunk(t){if(!this._chunk){const e=[];for(const t of this._overrides.values())null!=t.inner&&e.push(t.inner);this._chunk=Sc.fromFeatures(e,t)}return this._chunk}invalidate(){this._chunk=null}putWeakObjectIdsFromGlobalIds(t,e,s){for(const[i,r]of this._overrides.entries())if(r.isWeak&&null!=r.inner){const n=r.inner.attributes[s];n&&e.has(n)&&!t.has(n)&&t.set(n,i)}else if(null!=r.lastWeak&&null!=r.lastWeak.inner){const n=r.lastWeak.inner.attributes[s];n&&e.has(n)&&!t.has(n)&&t.set(n,i)}}_getWeakDeletions(){const t=new Set;for(const[e,s]of this._overrides.entries())s.isWeak&&null==s.inner&&t.add(e);return t}}class Ac extends Ma{}class Tc extends Aa{constructor(t,e,s,i){super(t,e,i),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const t of this._source.chunks())this._cleanupChunkIds(t)}invalidateAttributeData(t){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=t,null!=this._evalOptions&&(this._evalOptions=Yh(this._evalOptions.$view.scale,t))}onSubscribe(t){super.onSubscribe(t),this._evalOptions=t.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(t){return new Ac(t)}get aggregateQueryEngine(){return null}displayMap(t,e,s){const i=new Map(t.map((t=>[e(t),t]))),r=[];for(const t of this._source.chunks()){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId(),n=e.getDisplayId(),o=i.get(t);if(null!=o){const e=s(n,o,t);r.push(e),i.delete(t)}}}return r}getDisplayFeatures(t){const e=new Set(t),s=new Set,i=[];for(const t of this._source.chunks()){const r=t.reader.getCursor();for(;r.next();){const t=r.getObjectId(),n=r.getDisplayId();e.has(n)&&!s.has(t)&&(i.push({...r.readLegacyFeatureWorldSpace(),displayId:n}),s.add(t))}}return{features:i,aggregates:[],tracks:[]}}async*applyOverrideUpdate(t){const e=[];for(const s of t.modified){const t=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=t,e.push(t)}const s=Ph.fromOptimizedFeatures(t.modified,this._source.metadata).getCursor();for(;s.next();)this._attributeStore.setAttributeData(s.getDisplayId(),s,this._evalOptions,this._sqlOptions);const i=[];for(const e of t.removed){const t=this._attributeStore.getDisplayIdForObjectId(e);null!=t&&i.push(t)}(0,n.A)("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:t,modifiedDisplayIds:e,removedDisplayIds:i});const r=Sc.fromFeatures(t.modified,this._source.metadata);this.handledChunks.add(r.chunkId),this.handledChunksForAttributeData.add(r.chunkId),this.handledChunksForIdCreation.add(r.chunkId);for(const t of this._sendStates.values())t.handledChunks.add(r.chunkId),yield new Ca(t.subscription,null,e,!1,r.queryInfo);for(const t of this._sendStates.values()){const e=r.getTileReader(t.subscription.tile);yield new Ca(t.subscription,e,i,!1,r.queryInfo)}for(const e of t.removed)this._attributeStore.releaseDisplayIdForObjectId(e)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const t of this._sendStates.values())yield*this._update(t)}}removeChunks(t){for(const e of t)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const t of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(t);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(t){if(this.handledChunksForIdCreation.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(t.chunkId)}}async _updateAttributeData(){for(const t of this._source.chunks()){const{chunkId:e,reader:s}=t;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const t=s.getCursor();for(;t.next();){const e=this._attributeStore.createDisplayIdForObjectId(t.getObjectId());t.setDisplayId(e)}}}for(const t of this._source.chunks())if(!this.handledChunksForAttributeData.has(t.chunkId)){this.handledChunksForAttributeData.add(t.chunkId);const e=t.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions,this._sqlOptions)}}}*_update(t){const{subscription:e,handledChunks:s}=t;for(const i of this._source.chunks()){const{chunkId:r}=i;if(s.has(r))continue;s.add(r);const n=i.getTileReader(e.tile);n&&(yield new ka(t.subscription,n,!1,i.end,i.queryInfo))}}}var kc=s(77085),Cc=s(5808),Fc=s(17136),Ec=s(89056);let Oc;class zc{constructor(t,e,s,i,r){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=i,this.time=r}}class Rc{static getOid(t){return ot.xq+t}constructor(t,e,s,i,r,n,o,a){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=i,this._fields=r,this._spatialReference=n,this._metadata=o,this._isStream=a,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new At.A}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes??{},aggregateId:this.objectId,[ot.EA]:ot.t0.TrackLine};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}stageObservation(t,e){this._nextObservationRecords.push(new zc(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e){const s=new Set(this._nextObservationRecords.map((t=>t.objectId))),i=this._observationRecords.filter((t=>!s.has(t.objectId))).map((t=>t.objectId));let r,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort(((t,e)=>{const s=t.time,i=e.time;return null!=s&&null!=i?s-i:0})),this._schema.timeField){case"startTimeField":r=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":r=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":r=this._isStream?ot.Aw:null}n=this._isStream?e?.end??Date.now():e?.end??-1/0;const o=t.map((t=>t.reader.getCursor()));let a;for(let t=this._nextObservationRecords.length-1;t>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);t--){const e=this._nextObservationRecords[t],s=o[e.chunkIndex];(0,f.Lw)(s),s.setIndex(e.featureIndex);const i=null!=r?s.readAttributeAsTimestamp(r):null;(null!=i?n-i:0)>=this._maxDisplayDuration||(this._commitObservation(e,s),a??=e)}if(null!=a){const{chunkIndex:t,featureIndex:e,objectId:s,displayId:i}=a,r=o[t];(0,f.Lw)(r),r.setIndex(e);const n=new ya.Om(r.readGeometryWorldSpace(),{...r.readAttributes(),[ot.EA]:ot.t0.LatestObservation},null,s,i);this._latestObservationFeature=n}else this._latestObservationFeature=null;return this._trackLineGeometry=function(t,e,s){if(e.length<2)return(0,Ao.eU)(t,[e],!1,!1);if(s.isWrappable){let i=!1;for(let t=1;t<e.length;t++){const r=e[t][0],n=(0,Fc.O7)(r,e[t-1][0],s);r!==n&&(e[t][0]=n,i=!0)}if(i){const i=(0,Ec.b3)({paths:[e],spatialReference:s});if(null!=i)return(0,Ao.eU)(t,i.paths,!1,!1)}return(0,Ao.eU)(t,[e],!1,!1)}const i=Oc.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),r=Oc.fromSpatialReference(s);if(null!=r){const e=(0,kc.g7)(i,1e6,r,Cc.O.geodesic);if(null!=e){const s=Oc.toGeometry(e,r);if(null!=s&&"paths"in s)return(0,Ao.eU)(t,s.paths,!1,!1)}}return(0,Ao.eU)(t,[e],!1,!1)}(this._trackLineGeometry,this._trackLinePath,this._spatialReference),this._bounds=function(t){const{lengths:e,coords:s}=t;if(!e.length)return[(0,H.Ie)()];const i=[];let r=0;for(let t=0;t<e.length;t++){const n=e[t],o=(0,H.Ie)();i.push(o);for(let t=0;t<n;t++){const e=s[2*(t+r)],i=s[2*(t+r)+1];(0,H.tK)(o,[e,i])}r+=n}return i}(this._trackLineGeometry),this._nextObservationRecords=[],i}updateStatistics(t,e){this._statistics=Oh.create(this._fields);const s=t.map((t=>t.reader.getCursor()));for(const{chunkIndex:t,featureIndex:i}of this._observationRecords){const r=s[t];(0,f.Lw)(r),r.setIndex(i),this._statistics.insert(r,e)}}overlapsTile(t){for(const e of this._bounds)if((0,H.$9)(e,t.bounds,32))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:i,attributes:r}=this._latestObservationFeature,n=new At.A;(0,Ao.Nl)(n,i,!1,!1,this._metadata.geometryType,t.subscription.tile.transform);const o=(0,H.fA)(1/0,1/0,-1/0,-1/0);return function(t,e){const{coords:s,lengths:i}=t;if(!i.length)return void e(s[0],s[1]);let r=0;for(let t=0;t<i.length;t++){const n=i[t];let o=0,a=0;for(let t=0;t<n;t++)o+=s[2*(t+r)],a+=s[2*(t+r)+1],e(o,a);r+=n}}(n,((t,e)=>(0,H.tK)(o,[t,e]))),(0,H.HY)(o,(0,H.fA)(0,0,_.CQ,_.CQ))?new ya.Om(n,r,null,e,s):null}getTrackLineFeatureForTile(t){const e=new At.A;return(0,Ao.Nl)(e,this._trackLineGeometry,!1,!1,"esriGeometryPolyline",t.subscription.tile.transform),new ya.Om(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new ya.Om(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:(0,Ao.zv)(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let i=s?.coords[0],r=s?.coords[1];null==s&&(i=e.readXWorldSpace(),r=e.readYWorldSpace()),null!=i&&null!=r&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([i,r]))}}class Lc extends Ma{constructor(t){super(t),this.done=!1}}class Dc extends Ta{static async create(t,e,i,r,n,o){const a=new th({spatialReference:e}),h=await Promise.all(t.fields.map((async t=>wa.create(a,t)))),c=t.featureFilter?await Ah.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||(0,kc.s1)()||await Promise.all([Promise.all([s.e(3661),s.e(1878),s.e(2189),s.e(3299),s.e(8125)]).then(s.bind(s,78125)),Promise.all([s.e(3661),s.e(1878),s.e(2189),s.e(3299)]).then(s.bind(s,83299)),(0,kc.Hh)()]).then((([t,e,s])=>{Oc={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}})),new Dc(t,i,r,e,h,c,n,o)}constructor(t,e,s,i,r,n,o,a){super(e,s,i,r,a),this._schema=t,this._featureFilter=n,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:ot.EA,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=Th.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:ot.EA,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map((t=>t.chunkId)));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new Lc(t)}async*applyOverrideUpdate(t){D.A.getLogger("esri.views.2d.layers.features.processor.TrackStrategy").error("Applying override to tracks is not supported")}displayMap(t,e,s){const i=new Map(t.map((t=>[e(t),t]))),r=[];for(const t of this._tracks.values()){const e=i.get(t.objectId);if(null==e)for(const e of t.observations()){const t=i.get(e.objectId);if(null!=t){const n=s(e.displayId,t,e.objectId);r.push(n),i.delete(e.objectId)}}else{const n=s(t.displayId,e,t.objectId);r.push(n),i.delete(t.objectId)}}return r}getDisplayFeatures(t){const e=new Set(t),s=[],i=[],r=this._source.chunks().map((t=>t.reader.getCursor()));for(const t of this._tracks.values()){e.has(t.displayId)&&i.push(t.getTrackLineDisplayFeature());for(const{displayId:i,chunkIndex:n,featureIndex:o}of t.observations())if(e.has(i)){const t=r[n];t.setIndex(o),s.push({displayId:i,attributes:{},...t.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:i}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),(t=>t.objectId));return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let i=0;i<t.length;i++){const r=t[i];this._handledChunks.add(r.chunkId);const n=r.reader.getCursor();for(;n.next();){const t=n.readAttribute(e),r=n.getObjectId();if(null!=t&&null!=r&&(null===this._featureFilter||this._featureFilter.check(n,this._sqlOptions))){if(n.getDisplayId()||n.setDisplayId(this._attributeStore.createDisplayIdForObjectId(r)),!this._tracks.has(t)){const e=Rc.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),i=new Rc(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,i)}this._tracks.get(t).stageObservation(i,n),s.add(t)}}}for(const e of this._tracks.values())if(s.has(e.trackId)){const s=e.commitObservations(t,this._featureFilter?.timeExtent);for(const t of s)this._attributeStore.releaseDisplayIdForObjectId(t);e.updateStatistics(t,Yh(1,this._arcadeContextInfo))}else this._removeTrack(e)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e)}*_update(t){if(t.done)return;t.done=!this._source.updateTracking.updating;const e=[],s=[];for(const i of this._tracks.values())if(i.length>0){if(this._schema.showLatestObservation){const s=i.getLatestObservationFeatureForTile(t);null!=s&&e.push(s)}this._schema.showTrackLine&&i.overlapsTile(t.subscription.tile)&&s.push(i.getTrackLineFeatureForTile(t))}const i=Ph.fromOptimizedFeatures(e,this._metadata,t.subscription.tile.transform),r=Ph.fromOptimizedFeatures(s,this._trackLineMetadata,t.subscription.tile.transform);let n=[];if(this._schema.showPreviousObservations){const e=this._source.chunks().map((()=>[]));for(const t of this._tracks.values())for(const{chunkIndex:s,featureIndex:i}of t.previousObservations())e[s].push(i);n=this._source.chunks().map(((s,i)=>{const r=s.getTileReader(t.subscription.tile);if(null==r)return null;const n=wc.from(r,e[i]);return n.setProcessorAttributes({[ot.EA]:ot.t0.PreviousObservation}),"esriGeometryPoint"!==n.geometryType&&null!=n.getInTransform()||n.setTransformForDisplay(t.subscription.tile.transform),n})).filter(ia.Ru)}this.events.emit("changed");const o=t.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),a=r.getCursor();for(;a.next();)this._attributeStore.setAttributeData(a.getDisplayId(),a,o,this._sqlOptions);for(const t of n){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,o,this._sqlOptions)}const h=i.getCursor();for(;h.next();)this._attributeStore.setAttributeData(h.getDisplayId(),h,o,this._sqlOptions);yield new ka(t.subscription,r,!1,!1,{});for(const e of n)yield new ka(t.subscription,e,!1,!1,{});yield new ka(t.subscription,i,!1,t.done,{})}}s(62298);new Map;class Nc{constructor(t){this.data=t,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return 0===this._referenceCount}}class Gc{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(t){let e=this._objectIdToDisplayId.get(t);return e?e.increment():(e=new Nc((0|this._getFreeId())>>>0),e.increment(),this._objectIdToDisplayId.set(t,e)),e.data}releaseIdForObjectId(t){const e=this._objectIdToDisplayId.get(t);e&&(e.decrement(),e.empty()&&(this._objectIdToDisplayId.delete(t),this._freeIds.push(e.data)))}getDisplayIdForObjectId(t){const e=this._objectIdToDisplayId.get(t);return null!=e?e.data:null}releaseAll(){for(const t of this._objectIdToDisplayId.values())this._freeIds.push(t.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}const Bc=()=>D.A.getLogger("esri.views.layers.2d.features.support.AttributeStore"),qc=(Bc(),()=>null),Wc=(0,n.A)("esri-shared-array-buffer");(0,n.A)("esri-atomics");class Yc{constructor(t,e,s){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:i,layout:r,textureOnly:n}=e;this.textureOnly=n||!1,this.pixelType=i,this.layout=r,this._resetRange(),this.size=t,this.isLocal=s,n||(this.data=this._initData(i,t))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const s=this.data;for(let i=0;i<this.size*this.size;i++)s[i*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const s=this.data;for(let i=0;i<this.size*this.size;i++)s[i*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,s){const i=this.data;for(const r of s)i[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,s){this.data[s*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}unsetComponentTexel(t,e,s){this.data[s*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}getData(t,e){const s=Ea(t);return this.data[s*this.texelSize+e]}setData(t,e,s){const i=Ea(t),r=1<<e;0!==(this.layout&r)?null!=this.data&&(this.data[i*this.texelSize+e]=s,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)):Bc().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),s=this.data;e.set(s),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,s=this.texelSize;if(t>e)return null;this._resetRange();const i=!this.isLocal,r=this.pixelType,n=this.layout,o=this.data;return{start:t,end:e,data:i&&o.slice(t*s,(e+1)*s)||null,pixelType:r,layout:n}}_initData(t,e){const s=ArrayBuffer,r=function(t){switch(t){case Bi.ld.UNSIGNED_BYTE:return Uint8Array;case Bi.ld.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case Bi.ld.FLOAT:return Float32Array;default:return void D.A.getLogger("esri.views.2d.engine.webgl.Utils").error(new i.A("webgl-utils",`Unable to handle type ${t}`))}}(t),n=new r(new s(e*e*4*r.BYTES_PER_ELEMENT));for(let t=0;t<n.length;t+=4)n[t+1]=255;return n}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class Uc{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=_.TB,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new Gc,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=Bi.ld.FLOAT;qc(`Creating AttributeStore ${Wc?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:Bi.ld.UNSIGNED_BYTE,layout:1},{pixelType:Bi.ld.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:Bi.ld.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:Bi.ld.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,i=0){const r=(0,m.Ui)(this._schema,t);if(this.version=i,r&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStore.update`,{changed:r}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map((t=>t?Ah.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null)))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map((async t=>{const s=await this._bind(e,t);this._updateReferences(s)})));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const s in t.bindings){const i=t.bindings[s];await Promise.all(i.map((async t=>{const i=await this._bind(e,t,parseInt(s,10));this._updateReferences(i)})))}}}setHighlight(t,e){const s=this._getBlock(0);s.unsetComponentAllTexels(0,(1<<_.U5)-1);for(const{displayId:e,highlightFlags:i}of t){if(null==e)continue;const t=Ea(e);s.setComponent(0,i,[t])}this._idsToHighlight.clear();for(const{objectId:e,highlightFlags:s}of t)this._idsToHighlight.set(e,s);for(const{objectId:t,highlightFlags:s}of e)this._idsToHighlight.set(t,s)}setData(t,e,s,i){const r=Ea(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,s,i)}getData(t,e,s){return this._getBlock(e).getData(t,s)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=Ea(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e,s,i){const r=Ea(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,i));const n=this._attributeComputeInfo;let o=null;n&&(o="multi"===n.type?n.map.get(e.readAttribute(n.keyField)):n.map,o?.size&&o.forEach(((t,i)=>{const n=1*i%4,o=Math.floor(1*i/4),a=this._getBlock(o+_.dV.VV);let h=t.field?.read(e,s);t.valueRepresentation&&(h=function(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}(h,t.valueRepresentation)),(null===h||isNaN(h)||h===1/0||h===-1/0)&&(h=1e-30),a.setData(r,n,h)})))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map((t=>null!=t?t.toMessage():null)),e=this._getInitArgs();(0,n.A)("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,(0,n.A)("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,s){const i=await t.createComputedField(e),{valueRepresentation:r}=e,n=this._attributeComputeInfo;if("multi"===n.type){const t=n.map.get(s)??new Map;t.set(e.binding,{field:i,valueRepresentation:r}),n.map.set(s,t)}else n.map.set(e.binding,{field:i,valueRepresentation:r});return i}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(_.dV.Animation),this._getBlock(_.dV.GPGPU),this._getBlock(_.dV.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map((t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null))})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;qc(`Initializing AttributeBlock at index ${t}`);const s=new Yc(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=s,this._initialized=!1,s}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;qc("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return Bc().error(new i.A("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){(0,ra.QY)(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<_.U5)}getFilterFlags(t,e){let s=0;for(let i=0;i<this._filters.length;i++){const r=!!(1<<i),n=this._filters[i];s|=(!r||null==n||n.check(t,e)?1:0)<<i}let i=0;if(this._idsToHighlight.size){const e=t.getObjectId();i=this.getHighlightFlags(e)}return s<<_.U5|i}}class jc{constructor(t,e){this._connection=t,this._source=e,this._version=1,this._registry=new pa,this._proxy=new It({fetch:(t,e)=>this._connection.layerView.fetch(t,e),fetchDictionary:(t,e)=>this._connection.layerView.fetchDictionary(t,e)}),this._attributeStore=new Uc({isLocal:!1,update:t=>(0,u.oV)(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get version(){return this._version}getDisplayFeatures(t){return this._strategy?this._strategy.getDisplayFeatures(t):{features:[],aggregates:[],tracks:[]}}getDisplayIds(t){const e={};return this._strategy?(this._strategy.displayMap(t,(t=>t),((t,s,i)=>{e[i]=t})),e):e}getFeatureObjectIdsForAggregate(t){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(t):[]}onSubscribe(t){this._strategy?.onSubscribe(t)}onUnsubscribe(t){this._strategy?.onUnsubscribe(t)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(t,e,s,i,r){const o=t.processor,a=(0,g.i8)(this._schema?.storage,o.storage),h=(0,g.i8)(this._schema?.mesh.properties,o.mesh.properties),c=(0,g.i8)(this._schema?.mesh.factory,o.mesh.factory),l=(0,g.i8)(this._schema?.mesh.strategy,o.mesh.strategy),u=function(t,e){const s=[];return t?.timeExtent?.start===e.timeExtent?.start&&t?.timeExtent?.end===e.timeExtent?.end||s.push("timeProperties"),s}(this._schema?.expressionProperties,o.expressionProperties),d=u.some((t=>this._attributeStore.hasArcadeDependency(t))),_=u.some((t=>this._factory?.hasArcadeDependency(t)??!1)),p=u.some((t=>this._strategy?.hasArcadeDependency(t)))||this._strategy?.isAggregate&&d,f=_||p,x=h||c||l;if(!(a||x||_||d||p||i))return!1;(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:(0,m.Ui)(this._schema,o),schema:o}),this._schema=o;const b=y.A.fromJSON(this._source.service.outSpatialReference),w=new th({fields:this._source.metadata.fieldsIndex,spatialReference:b}),v={currentUser:o.mesh.properties.currentUser};if((a||x||d)&&(await this._attributeStore.update(o.storage,w,this._source.metadata,e),this._strategy?.invalidateAttributeData(Vc(o))),!i&&!x&&!f)return!1;(l||h||f)&&await this._updateStrategy(o.mesh.strategy,b,r,Vc(o),v),this._updateSortKey(w,"sortKey"in o.mesh.properties?o.mesh.properties.sortKey:null);const I="dictionary"===o.mesh.factory.symbology.type?o.mesh.factory.symbology.fieldMap:null,S=new fa(w,this._proxy,s,this._registry,I);return(c||"dictionary"===o.mesh.factory.symbology.type)&&(this._factory=await mt.create(S,o.mesh.factory)),this._version=e,!0}async applyOverrideUpdate(t){if(!this._strategy)return;const e=this._strategy.applyOverrideUpdate(t);for await(const t of e)try{await this._process(t)}catch(t){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(t){this._strategy?.removeChunks(t),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:t}){if(!this._strategy)return void this._attributeStore.setHighlight(t.map((({objectId:t,highlightFlags:e})=>({objectId:t,highlightFlags:e,displayId:-1}))),t);const e=this._strategy.displayMap(t,(({objectId:t})=>t),((t,{highlightFlags:e},s)=>({objectId:s,displayId:t,highlightFlags:e})));this._attributeStore.setHighlight(e,t)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const t=this._strategy.updateChunks(),e=[],s=new Map;for await(const i of t){let t=s.get(i.id);null==t&&(t=new ma({concurrency:16,process:t=>this._process(t)}),s.set(i.id,t));const r=t.push(i).catch((t=>(0,a.jH)(t)));e.push(r)}try{await Promise.all(e)}catch(t){}(0,n.A)("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),(0,n.A)("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(t,e,s,i,r){switch(this._strategy?.destroy(),t.type){case"feature":this._strategy=new Tc(this._source,this._attributeStore,i,r);break;case"binning":this._strategy=await Ch.create(t,e,this._source,this._attributeStore,i,r);break;case"cluster":this._strategy=await Zh.create(this._connection,t,e,this._source,this._attributeStore,i,r);break;case"track":this._strategy=await Dc.create(t,e,this._source,this._attributeStore,i,r)}for(const t of s)this._strategy.onSubscribe(t)}async _updateSortKey(t,e){if(this._sortInfo=(0,f.pR)(this._sortInfo?.computed),null!=e){const s=e.byRenderer?null:await t.createComputedField(e);this._sortInfo={...e,computed:s}}}async _process(t){const e=t.subscription;if((0,n.A)("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(t,s),(0,a.Te)(e.signal);const i=await this._write(t,e.tile.createArcadeEvaluationOptions(Vc(this._schema)),s),r=e.tile.tileInfoView.getLODInfoAt(e.tile.key);(0,a.Te)(e.signal);const{message:o,transferList:h}=i.serialize(r),c={objectIdMap:null,inner:t.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const e=t.reader?.getCursor();if(e)for(;e.next();)c.objectIdMap[e.getDisplayId()]=e.getObjectId()}if((0,a.Te)(e.signal),await this._connection.container.onMessage(c,{signal:e.signal,transferList:h}),this._attributeStore.sendUpdates(),(0,n.A)("esri-2d-update-debug")){const s=e.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${t.end}] Processor._process.await`)}}async _fetchResources(t,e){await this._fetchMatcherResources(t),await this._fetchWriterResources(t,e)}async _fetchMatcherResources(t){if(t.reader)return this._factory.enqueueMatcherRequests(this._proxy,t.reader)}async _fetchWriterResources(t,e){if(!t.reader)return;const s=t.reader.getCursor(),i=t.subscription.tile.createArcadeEvaluationOptions(Vc(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,i,e);await this._proxy.fetchEnqueuedResources()}async _write(t,e,s){const i=t.subscription.tile,r=t.reader?.getCursor(),n=r?.getSize()??0,o=i.tileInfoView.tileInfo.isWrappable,h=i.tileInfoView.tileInfo.spatialReference.isWGS84,c=new rt(i.key,this._strategy.enablePixelBuffering,o,h,n);if(!r)return c;const l=i.createArcadeEvaluationOptions(Vc(this._schema));let u=0;for(;r.next();){++u%1e3||(await(0,a.Pl)(0),(0,a.Te)(t.subscription));const n=this._getSortKeyValue(r,e);c.entityStart(r.getDisplayId(),n),this._factory.write(c,this._proxy,r,l,s,i.level),c.entityEnd()}return c}_getSortKeyValue(t,e){if(!this._sortInfo)return 0;const{computed:s,order:i,byRenderer:r}=this._sortInfo,n=r?this._factory.getSortKey(t,e):s?.read(t,e);return null==n||isNaN(n)?0:n*("asc"===i?-1:1)}}function Vc(t){const{timeZone:e}=t?.mesh.properties??{},{timeExtent:s}=t?.expressionProperties??{};return{timeZone:e,timeExtent:s}}var Xc=s(78888),Hc=s(80893),Qc=s(7562);class Zc{static from(t){let e=0,s=0,i=0;return t.forEach((t=>{const r=t._readGeometry();r&&(s+=r.isPoint?1:r.lengths.reduce(((t,e)=>t+e),0),i+=r.isPoint?1:r.lengths.length,e+=1)})),new Zc(e,s,i)}constructor(t,e,s){this.featureCount=t,this.vertexCount=e,this.ringCount=s}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}}var $c=s(60694),Jc=s(41560),Kc=s(64272);class tl{static fromSchema(t,e,s){const i="feature"===e.type?e.mutable.dataFilter.queryScaleRanges:[],r=e.mutable.displayFilterInfo;return new tl(function(t,e,s){const i=function(t){switch(t.type){case"object-id":case"unique-id-simple":return`${t.fieldName} ASC`;case"unique-id-composite":return`${t.fieldNames.join(",")} ASC`}}(s.featureIdInfo),r=t.source,n={returnCentroid:!(null!==r&&"object"==typeof r&&"path"in r&&(0,$c.Wo)(r.path))&&"esriGeometryPolygon"===s.serviceGeometryType,returnGeometry:!0,timeReferenceUnknownClient:s.timeReferenceUnknownClient??void 0,outSpatialReference:y.A.fromJSON(t.outSpatialReference),orderByFields:"memory"===t.type?[]:[i],where:e.mutable.dataFilter.definitionExpression??"1=1",outFields:e.mutable.availableFields,multipatchOption:"esriGeometryMultiPatch"===s.serviceGeometryType?"xyFootprint":null};if("feature"===e.type){const{gdbVersion:t,historicMoment:s,timeExtent:i}=e.mutable.dataFilter;return{...n,gdbVersion:t,historicMoment:s?new Date(s):null,timeExtent:i?Kc.T.fromJSON(i):null,outFields:e.mutable.availableFields}}return n}(t,e,s),r,i,s.subtypeField,e.mutable.dataFilter.customParameters,s.geometryType,t.queryMetadata)}constructor(t,e,s,i,r,n,o){this._queryParams=t,this._displayFilter=e,this._queryScaleRanges=s,this._subtypeField=i,this._customParameters=r,this._geometryType=n,this._queryMetadata=o}get pageSize(){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const t=this._queryMetadata.supportsMaxRecordCountFactor?4:null,e=(this._queryMetadata.maxRecordCount??8e3)*(t??1);return Math.min(8e3,e)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(t){this._queryParams.historicMoment=t}updateFields(t){this._queryParams.outFields=t}createPatchFieldsQuery(t,e,s){if(!e.getSize())return null;const i=t.clone();if("*"===this._queryParams.outFields[0]){if("*"===(i.outFields??[])[0])return null;i.outFields=this._queryParams.outFields}else{const t=new Set(this._queryParams.outFields),s=[];for(const i of t)e.hasField(i)||s.push(i);if(0===s.length)return null;i.outFields=s}i.returnGeometry=!1,i.returnCentroid=!1,i.quantizationParameters=null,i.cacheHint=!0;const r={inner:i,customParameters:this._customParameters};if((0,n.A)("esri-tiles-debug")&&null!=s){const t=s.chunkId.toString().replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,chunkId:t}:{chunkId:t}}return r}createQuery(t={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new rh.A({...this._queryParams,...t}),customParameters:this._customParameters}}createTileQuery(t,e){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const s=this.createQuery(e),i=s.inner;if(this._queryScaleRanges.length){const e=this._queryScaleRanges.filter((e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale))).map((t=>t.subtypeCode));if(e.length){const t=`${this._subtypeField} IN (${e})`;i.where=(0,Xa.mA)(i.where,t)}}if(this._displayFilter&&(i.where=(0,Xa.mA)(i.where,(0,Jc.Ch)(this._displayFilter,t.minScale,t.maxScale))),i.quantizationParameters=e.quantizationParameters??t.getQuantizationParameters(),i.resultType="tile",i.geometry=t.extent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset=t.resolution*(0,n.A)("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(i.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset*=(0,n.A)("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=4),(0,n.A)("esri-tiles-debug")){const e=t.id.replaceAll("/",".");s.customParameters=s.customParameters?{...s.customParameters,tileId:e}:{tileId:e}}return s}createPagedTileQuery(t,e){const s=this.pageSize;return this.createTileQuery(t,{start:s*e,num:s,returnExceededLimitFeatures:!0})}createPagedQuery(t,e){const s=this.pageSize;return this.createQuery({start:s*t,num:s,returnExceededLimitFeatures:!0,maxRecordCountFactor:4,quantizationParameters:e,cacheHint:!0})}createObjectIdsQuery(t){return this.createQuery({objectIds:t,outFields:["*"]})}}let el=class extends O.A{constructor(t){super(),this._connection=t,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this._queuedCommands=[],this.addHandles([(0,c.wB)((()=>this._strategy?.connectionStatus??"disconnected"),(t=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:t})}),{initial:!0}),(0,c.wB)((()=>this._strategy?.errorString||null),(t=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:t})),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(t){null==this._strategy&&this._resetUpdateInfo(performance.now());const e="event-handles";this.removeHandles(e),null!=t&&(this.addHandles([t.events.on("data-received",(t=>this._onFeature(t))),t.events.on("message-received",(t=>this._onWebSocketMessage(t))),t.events.on("features-updated",(t=>this._onUpdate(t))),t.events.on("tick",(()=>this._onTick()))],e),this._queuedCommands.forEach((e=>e(t))),this._queuedCommands=[]),this._strategy=t}updateCustomParameters(t){null!=t&&this._callOrEnqueue((e=>e.updateCustomParameters(t)))}sendMessageToSocket(t){this._callOrEnqueue((e=>e.sendMessageToSocket(t)))}sendMessageToClient(t){this._callOrEnqueue((e=>e.sendMessageToClient(t)))}enableEvent(t,e){e?this._enabledEventTypes.add(t):this._enabledEventTypes.delete(t)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(t){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:t})}_onFeature(t){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:t.attributes,centroid:t.centroid,geometry:t.geometry}})}_onUpdate(t){this._updateInfo.client+=t}_onTick(){const t=performance.now(),e=t-this._lastTime;if(e>2500){const s=Math.round(this._updateInfo.client/(e/1e3)),i=Math.round(this._updateInfo.websocket/(e/1e3));this._resetUpdateInfo(t),this._layerView.emitEvent({name:"update-rate",event:{client:s,websocket:i}})}}_resetUpdateInfo(t){this._lastTime=t,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(t){null!=this._strategy?t(this._strategy):this._queuedCommands.push(t)}};(0,E._)([(0,L.MZ)()],el.prototype,"_strategy",void 0),el=(0,E._)([(0,N.$)("esri.views.2d.layers.features.sources.StreamMessenger")],el);var sl=s(13069);class il extends vc{constructor(t,e,s,i){super(),this._reader=t,this._queryJSON=e,this._page=s,this._end=i,this.chunkId=`${this._page}${this.end?"e":""}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader}get first(){return 0===this._page}get end(){return this._end}get queryInfo(){return{type:"snapshot",chunkId:this.chunkId,queryJSON:this._queryJSON,page:this._page,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(t){const e=this.queryFeaturesInBounds(t.bounds);return e.setTransformForDisplay(t.transform),e}}class rl{constructor(t,e,s,r){this.store=t,this.queryInfo=e,this._options=s,this._fetch=r,this._nextBatch=new Set,this._fetchFeatures=(0,a.sg)((async()=>{if(0===this._nextBatch.size||this._options.signal?.aborted)return;const t=Array.from(this._nextBatch);this._nextBatch.clear(),t.length>8e3&&D.A.getLogger("esri.views.2d.layers.FeatureLayerView2D").warn(new i.A("highlight-too-many-features","highlight is limited to 8000 features on large layers configured with a display filter to avoid performance issues"));const e=this.queryInfo.objectIdsQueryPageSize,s=Math.ceil(8e3/e),r=Math.min(s,Math.ceil(t.length/e)),n=Array.from({length:r},((s,i)=>{const r=i*e,n=Math.min(r+e,t.length);return{num:i,query:this.queryInfo.createObjectIdsQuery(t.slice(r,n))}}));try{await async function(t,e,s,r={}){const n=(await Promise.allSettled(s.map((s=>async function(t,e,s,i={}){const r=`${t.chunkPrefix??""}${s.num}`,n=await t.fetch(s.query,i,{chunkId:r}),o=new il(n,s.query.inner.toJSON(),s.num,!1);o.chunkId=o.normalizedChunkId=r,(0,a.Te)(i),e.insert(o)}(t,e,s,r))))).filter((t=>"rejected"===t.status)).map((t=>t.reason));if(n.length)throw new i.A("featurelayer-query","Encountered errors when downloading data",{errors:n})}({chunkPrefix:"cache."+(0,sl.lk)(),fetch:this._fetch},this.store,n,this._options)}catch(t){}}))}prepareCacheUpdate(t,e){if(e)for(const t of e)this._nextBatch.delete(t);for(const e of t)this._nextBatch.add(e)}applyCacheUpdate(){return 0===this._nextBatch.size||this._options.signal?.aborted?null:this._fetchFeatures().catch((()=>{}))}}class nl{constructor(t){this._store=t,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(t){throw new Error("InternalError: LoadStrategy does not support query info")}async queryByObjectId(t){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(t){throw new Error("InternalError: LoadStrategy does not support loading blobs")}prepareCacheUpdate(t,e){}applyCacheUpdate(){return null}}var ol=s(10382),al=s(75321),hl=s(51624),cl=s(53655);const ll=268435455;class ul{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}}const dl=268435455,_l=128e3,pl={small:{delta:new Int32Array(128),decoded:new Int32Array(128)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(_l),decoded:new Int32Array(_l)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function fl(t,e){return e?t<=pl.small64.delta.length?pl.small64:(t<=pl.large64.delta.length||(pl.large64.delta=new Float64Array(Math.round(1.25*t)),pl.large64.decoded=new Float64Array(Math.round(1.25*t))),pl.large64):t<=pl.small.delta.length?pl.small:(t<=pl.large.delta.length||(pl.large.delta=new Int32Array(Math.round(1.25*t)),pl.large.decoded=new Int32Array(Math.round(1.25*t))),pl.large)}function gl(t){for(;t.next();){if(1===t.tag())return t.getMessage();t.skip()}return null}function ml(t,e,s,i,r,n){return.5*Math.abs(t*i+s*n+r*e-t*n-s*e-r*i)}function yl(t,e,s,i,r){return!!t&&0===e*r-i*s&&e*i+s*r>0}class xl extends Sh{static fromBuffer(t,e,s=!1){const r=e.geometryType,n=function(t){try{const e=2,s=new hl.A(new Uint8Array(t),new DataView(t));for(;s.next();){if(s.tag()===e)return gl(s.getMessage());s.skip()}}catch(t){const e=new i.A("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:t});D.A.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(e)}return null}(t),o=function(t,e,s,i=!1){const r=t.asUnsafe(),n=r.pos(),o=new ul;let a=0,h=0,c=null,l=!1;const u=[];for(;r.next();)switch(r.tag()){case 12:c=r.processMessage(cl.ae);break;case 9:if(o.exceededTransferLimit=r.getBool(),o.exceededTransferLimit){o.offsets.geometry=i?new Float64Array(8e3):new Int32Array(8e3),o.centroid=i?new Float64Array(16e3):new Int32Array(16e3);for(let t=0;t<o.centroid.length;t++)o.centroid[t]=ll}break;case 13:{const t=r.processMessage(cl.cn);t.index=a++,u.push(t);break}case 15:{const t=r.getLength(),s=r.pos()+t;if(!o.exceededTransferLimit){const t=o.offsets.geometry,e=o.centroid;t.push(0),e.push(ll),e.push(ll)}!l&&o.exceededTransferLimit&&(l=!0,o.offsets.attributes=i?new Float64Array(8e3*a):new Uint32Array(8e3*a));let n=h*a;for(;r.pos()<s&&r.next();)switch(r.tag()){case 1:{l?o.offsets.attributes[n++]=r.pos():o.offsets.attributes.push(r.pos());const t=r.getLength();r.skipLen(t);break}case 2:if(e){const t=r.getLength(),e=r.pos()+t;for(;r.pos()<e&&r.next();)switch(r.tag()){case 3:{r.getUInt32();const t=r.getSInt64(),e=r.getSInt64();o.centroid[2*h]=t,o.centroid[2*h+1]=e;break}default:r.skip()}}else{o.offsets.geometry[h]=r.pos();const t=r.getLength();o.vertexCount+=t,r.skipLen(t)}break;case 4:{const t=r.getLength(),e=r.pos()+t;for(;r.pos()<e&&r.next();)switch(r.tag()){case 3:{r.getUInt32();const t=r.getSInt64(),e=r.getSInt64();o.centroid[2*h]=t,o.centroid[2*h+1]=e;break}default:r.skip()}break}default:r.skip()}h++,o.hasFeatures=!0;break}default:r.skip()}o.fields=new ba.A(u),o.featureCount=h,o.fieldCount=a;const d=function*(t){switch(t.type){case"object-id":case"unique-id-simple":return void(yield t.fieldName);case"unique-id-composite":return void(yield*t.fieldNames)}}(s);return o.idFieldIndices=Array.from(d,(t=>o.fields.get(t)?.index)),o.transform=c,o.displayIds=new Uint32Array(o.featureCount),o.groupIds=new Uint16Array(o.featureCount),r.move(n),o}(n,"esriGeometryPoint"===r,e.featureIdInfo,s);return new xl(n,o,e,s)}constructor(t,e,s,i){super(s),this._use64Bit=i,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=s.geometryType,this._reader=t,this._header=e,this._hasNext=e.hasFeatures,this._isPoints="esriGeometryPoint"===s.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(t){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=t}getAttributeHash(){let t="";for(const e of this._header.fields.fields)t+=this._readAttributeAtIndex(e.index)+".";return t}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const t=this._header.idFieldIndices.map((t=>this._readAttributeAtIndex(t)));return JSON.stringify(t)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(t){this._header.displayIds[this._featureIndex]=t}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const t=this._reader.clone(),e=new xl(t,this._header,this.metadata,this._use64Bit);return this.copyInto(e),e}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return bc.qK+(this._cache.geometry?.usedMemory??0)}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const t=this._header.centroid[2*this._featureIndex],e=this._header.centroid[2*this._featureIndex+1];return t===dl?null:new At.A([],[t,e])}_readGeometry(t=!1){if(void 0===this._cache.geometry){let e=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===dl)return null;const t=this._header.centroid[2*this._featureIndex],s=this._header.centroid[2*this._featureIndex+1];e=new At.A([],[t,s])}else{const s=this._header.offsets.geometry[this._featureIndex],i=this._reader;if(0===s)return null;i.move(s);try{e=t?this._parseGeometryForDisplay(i):this._parseGeometry(i)}catch(t){return null}}return 0===e?.coords.length&&(e=null),this._cache.geometry=e,e}return this._cache.geometry}_readAttribute(t,e){const s=this._header.fields.get(t);if(null==s)return;const i=this._readAttributeAtIndex(s.index),r=this._header.fields.isDateField(s.name);return e?null==i?i:r?new Date(i):i:i}_readAttributes(){const t={};for(const e of this._header.fields.fields)t[e.name]=this._readAttributeAtIndex(e.index);return t}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._featureOffset=this._featureOffset,t._hasNext=this._hasNext,t._parseCaches=this._parseCaches}_readAttributeAtIndex(t){let e=this._parseCaches[t];if(e||(e=new uh(this.getSize()),this._parseCaches[t]=e),e.has(this._featureIndex))return e.get(this._featureIndex);const s=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+t],i=this._reader;i.move(s);const r=function(t){const e=t.getLength(),s=t.pos()+e;for(;t.pos()<s&&t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}(i);return e.set(this._featureIndex,r),r}_readGeometryDeltaDecoded(t=!1){if(void 0===this._cache.unquantGeometry){const e=this._readGeometry(t);if(!e)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=e,e;const s=fl(e.coords.length,this._use64Bit).decoded,i=e.clone(s),r=i.coords;let n=0;for(const t of i.lengths){for(let e=1;e<t;e++){const t=2*(n+e),s=2*(n+e-1);r[t]+=r[s],r[t+1]+=r[s+1]}n+=t}return this._cache.unquantGeometry=i,i}return this._cache.unquantGeometry}_parseGeometry(t){const e=t.asUnsafe(),s=e.getLength(),i=e.pos()+s,r=[],n=[];for(;e.pos()<i&&e.next();)switch(e.tag()){case 2:{const t=e.getUInt32(),s=e.pos()+t;for(;e.pos()<s;)n.push(e.getUInt32());break}case 3:{const t=e.getUInt32(),s=e.pos()+t;for(r.push(e.getSInt64()),r.push(e.getSInt64()),this.hasZ&&e.getSInt64(),this.hasM&&e.getSInt64();e.pos()<s;)r.push(e.getSInt64()),r.push(e.getSInt64()),this.hasZ&&e.getSInt64(),this.hasM&&e.getSInt64();break}default:e.skip()}return new At.A(n,r)}_parseGeometryForDisplay(t){const e=t.asUnsafe(),s=e.getLength(),i=e.pos()+s,r=[],n=[];let o=0,a=0,h=null,c=0;const l="esriGeometryPolygon"===this.geometryType,u="esriGeometryPolyline"===this.geometryType,d=l||u;for(;e.pos()<i&&e.next();)switch(e.tag()){case 2:{const t=e.getUInt32(),s=e.pos()+t;for(;e.pos()<s;){const t=e.getUInt32();r.push(t),o+=t}h=fl(2*o,this._use64Bit).delta;break}case 3:{e.getUInt32();const t=2+(this.hasZ?1:0)+(this.hasM?1:0);(0,f.Lw)(h);for(const s of r)if(a+t*s>h.length)for(let t=0;t<s;t++)e.getSInt64(),e.getSInt64(),this.hasZ&&e.getSInt64(),this.hasM&&e.getSInt64();else if(l){const t=this.getAreaSimplificationThreshold(s,this._header.vertexCount);let i=2,r=1;const o=!1;let l=e.getSInt64(),u=e.getSInt64();h[a++]=l,h[a++]=u,this.hasZ&&e.getSInt64(),this.hasM&&e.getSInt64();let _=e.getSInt64(),p=e.getSInt64();for(this.hasZ&&e.getSInt64(),this.hasM&&e.getSInt64();i<s;){let s=e.getSInt64(),n=e.getSInt64();this.hasZ&&e.getSInt64(),this.hasM&&e.getSInt64();const o=l+_,f=u+p;ml(l,u,o,f,o+s,f+n)>=t?(c+=-.5*(o-l)*(f+u),r>1&&yl(d,h[a-2],h[a-1],_,p)?(h[a-2]+=_,h[a-1]+=p):(h[a++]=_,h[a++]=p,r++),l=o,u=f):(s+=_,n+=p),_=s,p=n,i++}r<3||o?a-=2*r:(c+=-.5*(l+_-l)*(u+p+u),yl(d,h[a-2],h[a-1],_,p)?(h[a-2]+=_,h[a-1]+=p,n.push(r)):(h[a++]=_,h[a++]=p,n.push(++r)))}else{let t=0,i=e.getSInt64(),r=e.getSInt64();this.hasZ&&e.getSInt64(),this.hasM&&e.getSInt64(),h[a++]=i,h[a++]=r,t+=1;for(let n=1;n<s;n++){const s=e.getSInt64(),o=e.getSInt64(),l=i+s,u=r+o;c+=-.5*(l-i)*(u+r),this.hasZ&&e.getSInt64(),this.hasM&&e.getSInt64(),n>2&&yl(d,h[a-2],h[a-1],s,o)?(h[a-2]+=s,h[a-1]+=o):(h[a++]=s,h[a++]=o,t+=1),i=l,r=u}n.push(t)}break}default:e.skip()}return this._cache.area=c,n.length?new At.A(n,h):null!=h?this._createDeltaQuantizedExtrudedGeometry(h[0],h[1]):null}}class bl{constructor(t,e){this.service=t,this._metadata=e}destroy(){}}class wl extends bl{constructor(t,e){super(t,e),this._portsOpen=async function(t){const e=new ol.A;return await e.open(t,{}),e}(t.source).then((t=>this.client=t))}destroy(){this.client.close(),this.client=null}async executeQuery(t,e){await this._portsOpen;const s=await this.client.invoke("queryFeatures",t.toJSON(),e);return Ph.fromFeatureSet(s,this._metadata)}}class vl extends bl{async executeQuery(t,e){const{data:s}=await(0,Hc.kS)(this.service.source,t,e),i=!t.quantizationParameters;return xl.fromBuffer(s,this._metadata,i)}}class Il extends bl{async executeQuery(t,e){const{source:s,queryMetadata:i}=this.service;if(null!=t.quantizationParameters&&!i.supportsQuantization){const i=t.clone(),r=(0,hh.VV)(i.quantizationParameters);i.quantizationParameters=null;const{data:n}=await(0,Hc.eW)(s,i,this._metadata.spatialReference,e),o=(0,Ao.q3)(n,this._metadata.featureIdInfo);return(0,Ao.jH)(r,o),Ph.fromOptimizedFeatureSet(o,this._metadata)}const{data:r}=await(0,Hc.eW)(s,t,this._metadata.spatialReference,e);return"esriGeometryPoint"===this._metadata.geometryType&&(r.features=r.features?.filter((t=>{if(null!=t.geometry){const e=t.geometry;return Number.isFinite(e.x)&&Number.isFinite(e.y)}return!0}))),Ph.fromFeatureSet(r,this._metadata)}}class Sl extends bl{async executeQuery(t,e){if(t.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const s=t.clone(),i=(0,hh.VV)(s.quantizationParameters);s.quantizationParameters=null;const r=await(0,al.I)(this.service.source,t,e);return(0,Ao.jH)(i,r),Ph.fromOptimizedFeatureSet(r,this._metadata)}const s=await(0,al.I)(this.service.source,t,e);return Ph.fromOptimizedFeatureSet(s,this._metadata)}}class Pl extends nl{constructor(t,e,s,i,r){super(s),this._serviceInfo=t,this._queryInfo=e,this._metadata=i,this._connection=r,this._queue=new ga.QueueProcessor({concurrency:32,process:async t=>{const e={signal:t.options?.signal,query:t.query.customParameters,useRequestQueue:!0};return this._adapter.executeQuery(t.query.inner,e)}}),this._adapter=function(t,e){switch(t.type){case"memory":return new wl(t,e);case"ogc":return new Sl(t,e);case"feature-service":return t.queryMetadata.supportsFormatPBF&&(0,n.A)("featurelayer-pbf")?new vl(t,e):new Il(t,e)}}(t,i)}unsafeSetQueryHistoricMoment(t){this._queryInfo.updateHistoricMoment(t)}async updateFields(t){this._queryInfo.updateFields(t);const e=Array.from(this._store.chunks()).map((async t=>{const e=rh.A.fromJSON(t.queryInfo.queryJSON);if(e)try{return await this._tryUpdateFields(t.reader,e,{chunkId:t.chunkId}),null}catch(t){return t}})),s=(await Promise.all(e)).filter((t=>t));if(s.length)throw new i.A("featurelayer-query","Encountered errors when downloading fields",{errors:s})}async queryByObjectId(t){if(0===t.length)return Ph.empty(this._metadata);const e=this._queryInfo.createQuery({objectIds:t});return this._fetch(e,null,null)}async _fetch(t,e,s){const i=await this._enqueue(t,e);return await this._tryUpdateFields(i,t.inner,s),i}async _tryUpdateFields(t,e,s){const r=this._queryInfo.createPatchFieldsQuery(e,t,s);if(!r)return;const n=await this._enqueue(r,this._options);n.getSize()===t.getSize()?t.joinAttributes(n):D.A.getLogger("esri.views.2d.layers.features.sources.strategies.AFetchLoadStrategy").error(new i.A("featurelayer-query",`Failed to join features. Expected a count of ${t.getSize()} features, but got ${n.getSize()}`,{query:r.inner.toJSON(),debugInfo:s}))}async _enqueue(t,e){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:t,options:e}).finally((()=>{this._connection.onEvent({type:"fetchEnd",done:0===this._queue.length})}))}}class Ml extends Pl{constructor(t,e,s,i,r){super(t,e,s,i,r),this._chunksById=new Map,this._featureCache=new rl(s,e,this._options,this._fetch.bind(this))}prepareCacheUpdate(t,e){return this._featureCache.prepareCacheUpdate(t,e)}applyCacheUpdate(){return this._featureCache.applyCacheUpdate()}unload(t){this._removeChunks(t.tile)}_addChunk(t){const e=t.tile.id;this._chunksById.has(e)||this._chunksById.set(e,[]);const s=t.size();(s||t.first||t.end)&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Chunk[${t.chunkId}] ATileLoadStrategy.addChunk [count=${s}]`),this._chunksById.get(e).push(t),this._store.insert(t))}_removeChunks(t){const e=this._chunksById.get(t.key.id)??[];for(const s of e)(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${t.key.id}] Chunk[${s.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(s);this._chunksById.delete(t.key.id)}}class Al extends vc{constructor(t,e,s,i,r,n){super(),this._reader=t,this._queryJSON=e,this._tile=s,this._sourceTile=i,this._sourceTileDepth=r,this._end=n,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return 0===this._sourceTileDepth}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(t){return this._tile.key.id===t.key.id?this.reader:null}}class Tl{constructor(t,e){this.subscription=t,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=(0,r.vE)([(0,a.u7)(t.signal,(()=>this._controller.abort())),(0,a.u7)(e,(()=>this._controller.abort()))])}destroy(){this._controller.abort(),this._handles.remove()}get(t){return this._tileIdToResult.get(t)}set(t,e){this._tileIdToResult.set(t,e)}get options(){return{signal:this._controller.signal}}}class kl extends Ml{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const t of this._loadStates.values())t.destroy();this._loadStates.clear()}get about(){return{supportsDisplayFilter:!0,willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(t){this._loadStates.has(t.key.id)||this._loadStates.set(t.key.id,new Tl(t,this._options));const e=this._loadStates.get(t.key.id);let s;try{for await(const s of this._fetchChunkInfos(e,t.tile,0)){const{queryJSON:t,reader:i,sourceTile:r,sourceTileDepth:n,tile:o}=s,h=new Al(i,t,o,r,n,!1);(0,a.Te)(e.options),this._addChunk(h)}}catch(t){s=t}const i=new Al(Ph.empty(this._metadata),null,t.tile,null,-1,!0);if(this._addChunk(i),s)throw s}unload(t){super.unload(t),this._loadStates.get(t.key.id)?.destroy(),this._loadStates.delete(t.key.id)}async*_fetchChunkInfos(t,e,s){let i=t.get(e.id);const r=!!i;if(i||(i=await this._fetchChunkInfo(t,e,s),t.set(e.id,i)),i.reader.exceededTransferLimit&&s<(0,n.A)("featurelayer-query-max-depth"))for(const i of e.createChildTiles())yield*this._fetchChunkInfos(t,i,s+1);else r||(yield i)}async _fetchChunkInfo(t,e,s){const i=t.subscription.tile.getQuantizationParameters(),r=this._queryInfo.createTileQuery(e,{returnExceededLimitFeatures:!1,quantizationParameters:i});return{reader:await this._fetch(r,t.options,{chunkId:e.id}),queryJSON:r.inner.toJSON(),tile:t.subscription.tile,sourceTile:e,sourceTileDepth:s}}}class Cl extends vc{constructor(t,e,s,i,r){super(),this._reader=t,this._queryJSON=e,this._tile=s,this._page=i,this._end=r,this.chunkId=`${this._tile.key.id}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._page}${this.end?"e":""}`}get queryInfo(){return{type:"paged-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,page:this._page,size:this.size(),end:this.end}}get reader(){return this._reader}get first(){return 0===this._page}get end(){return this._end}get page(){return this._page}get tile(){return this._tile}get isTiled(){return!0}getTileReader(t){return this._tile.key.id===t.key.id?this.reader:null}}class Fl{constructor(t,e){this.subscription=t,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=(0,r.vE)([(0,a.u7)(t.signal,(()=>this._controller.abort())),(0,a.u7)(e,(()=>this._controller.abort()))])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let t=-1;for(const e of this._pages.values())t=Math.max(t,e);return t+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(t,e){this._pages.add(t),this._done=this._done||e}}class El extends Ml{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const t of this._loadStates.values())t.destroy();this._loadStates.clear()}get about(){return{supportsDisplayFilter:!0,willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(t){const e=(0,z.tE)(this._loadStates,t.key.id,(()=>new Fl(t,this._options)));for await(const t of this._fetchPages(e))this._addChunk(t)}unload(t){super.unload(t),this._loadStates.get(t.key.id)?.destroy(),this._loadStates.delete(t.key.id)}async*_fetchPages(t){let e;try{for await(const e of this._concurrentPageStream(t))(0,a.Te)(t.options),0!==e.size()&&(yield e)}catch(t){e=t}if(e&&(0,a.zf)(e)||(yield new Cl(Ph.empty(this._metadata),null,t.subscription.tile,-1,!0)),e)throw e}async*_concurrentPageStream(t){const e=(0,n.A)("featurelayer-query-tile-concurrency"),s=this._pageStreamAll(t),i=[];let r=!1,o=1;for(;!r;){const t=[];for(;!r&&i.length<o;){const e=s.next();if(!e.value){r=!0;break}const n=e.value;n.then((t=>{t.reader.exceededTransferLimit||(r=!0)})).catch((t=>{r=!0})).finally((()=>{i.splice(i.indexOf(n),1)})),i.push(n),t.push(n)}for(const e of t)yield e;i.length&&await Promise.race(i),o<e&&(o+=1)}}*_pageStreamAll(t){const e=Math.ceil((0,n.A)("featurelayer-query-tile-max-features")/this._queryInfo.pageSize);for(let s=0;s<e;s++)yield this._downloadPage(s,t)}async _downloadPage(t,e){(0,a.Te)(e.options);const s=e.subscription.tile,i=this._queryInfo.createPagedTileQuery(s,t),r=await this._fetch(i,e.options,{chunkId:`${s.id}-${t}`});return(0,a.Te)(e.options),new Cl(r,i.inner.toJSON(),s,t,!1)}}var Ol=s(2741);let zl=null;async function Rl(){return zl||(zl=async function(){const t=await Promise.resolve().then(s.bind(s,57733));return await t.default({module_or_path:(0,Ol.s)("esri/libs/parquet/pkg/bundle_bg.wasm")}),t}()),zl}var Ll=s(57733);const Dl=t=>async function(e,s,i){const r=t(),{data:n}=await(0,Xc.A)(e,{responseType:"array-buffer",query:r,headers:{range:`bytes=${s}-${i}`},useRequestQueue:!0});return n},Nl=t=>async function(e){const s=t(),{data:i}=await(0,Xc.A)(e,{responseType:"native",method:"head",query:s,useRequestQueue:!0}),r=i.headers.get("Content-Length");if(null==r)throw new Error("Unable to parse content length");return parseInt(r,10)};class Gl{static async create(t,e){const s=await Rl(),i=await s.readMetadata(t,Dl(e),Nl(e));return Gl.fromFileMetadata(i)}static fromFileMetadata(t){const e=[];for(let s=0;s<t.numFields();s++){const i=t.getFieldByIndex(s);e.push({name:i.name,type:i.type,alias:i.name,index:i.index}),i.free()}return new Gl(t,e)}constructor(t,e){this._inner=t,this.fields=e}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(t){return this._inner.getFieldIndex(t)}tryReadGeoMetadata(){const t=this._inner.keyValueMetadata("geo");return null==t?null:JSON.parse(t)}tryReadEsriMetadata(){const t=this._inner.keyValueMetadata("esri");return null==t?null:JSON.parse(t)}}function Bl(t,e,s){const i=Ll.GeometryInfoDescriptor.new();if(i.geometryType=function(t){switch(t){case"esriGeometryPoint":return Ll.GeometryType.Point;case"esriGeometryPolygon":return Ll.GeometryType.Polygon;case"esriGeometryPolyline":return Ll.GeometryType.Polyline;case"esriGeometryMultipoint":return Ll.GeometryType.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${t}`)}}(t.geometryType),"location"===t.encoding.type)i.latIndex=e.getFieldIndex(t.encoding.latitudeFieldName),i.lngIndex=e.getFieldIndex(t.encoding.longitudeFieldName);else if(i.wkbIndex=e.getFieldIndex(t.encoding.primaryFieldName),t.encoding.multiscale){const s=Ll.MultiScaleInfo.new();for(const i of t.encoding.multiscale.levels){const[t,r]=i.transform.translate,[n,o]=i.transform.scale,a=e.getFieldIndex(i.column);s.push(a,t,r,n,o)}i.setMultiscaleInfo(s)}return i.inWkid=t.spatialReference.wkid,s&&(i.outWkid=s.wkid),i}class ql{static async create(t,e){const s=await Rl(),i=Dl(e.getCustomParameters),r=Nl(e.getCustomParameters),n=await s.readMetadata(t,i,r),o=Bl(e.geometryInfo,n,e.outSpatialReference),a=await s.readFile(t,i,r,n,o);return new ql(a,Gl.fromFileMetadata(a.metadata()))}static async fromFile(t,e,s){const i=await Rl(),r=await i.readMetadataFromFile(t),n=e?Bl(e,r,s):void 0,o=await i.readFileFromBinary(n,t);return new ql(o,Gl.fromFileMetadata(o.metadata()))}constructor(t,e){this.inner=t,this.metadata=e}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}class Wl extends Sh{constructor(t,e,s,i,r,n=new Uint32Array(i.size())){super(t),this._fields=e,this._geometryInfo=s,this._inner=i,this._chunkId=r,this._displayIds=n,this._index=-1,this.usedMemory=bc.qK,this._size=this._inner.size();const o=t.featureIdInfo;"object-id"===o.type&&(this._objectIdFieldIndex=this._fields.get(o.fieldName)?.index),this._chunkId>65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this._geometryInfo.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let t="";for(const e of this.fields.fields)t+=this._readAttribute(e.name,!1)+".";return t}getObjectId(){return null!=this._objectIdFieldIndex?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(t){this._displayIds[this._index]=t}setIndex(t){this._index=t}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(t){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(t){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(t){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(t){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const t=new Wl(this.metadata,this._fields,this._geometryInfo,this._inner,this._chunkId,this._displayIds);return this.copyInto(t),t}copyInto(t){super.copyInto(t),t._index=this._index}readGeometryForDisplayTransformed(t){const[e,s]=t.translate,[i,r]=t.scale,n=this._inner.readGeometryTransformed(this._index,e,s,i,r);return n?new At.A(n.readLengthsUnsafe(),n.readCoordsUnsafe()):null}_readGeometry(t){const e=this._inner.readCoords(this._index),s=this._inner.readLengths(this._index);return e&&s?new At.A(s,e):null}_readX(){return this._readGeometry()?.coords[0]}_readY(){return this._readGeometry()?.coords[1]}_readServerCentroid(){return null}_readAttribute(t,e){const s=this.fields.get(t);if(!s)return;if(null==s.index)return this.getObjectId();const i=this._inner.readAttribute(this._index,s.index);if(null==i)return i;const r=this.fields.isDateField(s.name);return e?null==i?i:r?new Date(i):i:i}_readAttributes(){const t={};for(const e of this._fields.fields)null!=e.index?this._inner.hasField(e.index)&&(t[e.name]=this._readAttribute(e.name,!1)):t.__OBJECTID=this.getObjectId();return t}}class Yl extends nl{constructor(t,e,s,i){super(i),this._service=t,this._metadata=e,this._schema=s,this._chunkId=0,this._files=[],this._availableFields=new Set(s.mutable.availableFields);const{geometryInfo:r}=this._service;if("location"===r.encoding.type)this._availableFields.add(r.encoding.latitudeFieldName),this._availableFields.add(r.encoding.longitudeFieldName);else if(null!=r.encoding.multiscale&&r.encoding.multiscale.levels.length>=1){const t=r.encoding.multiscale.levels[0];this._availableFields.add(t.column)}else this._availableFields.add(r.encoding.primaryFieldName)}destroy(){for(const t of this._files)t.destroy()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async updateFields(t){await this._promise;const e=new Set(t),s=(0,R.iv)(e,this._availableFields);this._availableFields=(0,R.KC)(s,this._availableFields),s.size&&await Promise.all(this._files.map((t=>{const e=Array.from(s).map((e=>t.metadata.getFieldIndex(e)));return t.inner.updateChunks(new Uint16Array(e))})))}async load(t){return null==this._promise&&(this._promise=this._download().then((()=>{this._loadHigherResGeometry()}))),this._promise}unload(t){}async addParquetFile(t){this._insert(t)}async _loadHigherResGeometry(){const{geometryInfo:t}=this._service;if("wkb"===t.encoding.type){if(!(null!=t.encoding.multiscale&&t.encoding.multiscale.levels.length>=1))return;await this.updateFields([t.encoding.primaryFieldName])}const e=Array.from(this._store.chunks());this._store.clear();for(const t of e)this._store.insert(t);this._store.refresh()}async _insert(t){const e=await ql.create(t,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:s}=this._service;(0,a.Te)(this._options);const{fields:i,timeZoneByFieldName:r}=this._service.metadata.fieldsIndex,n=i.map((t=>({...t,index:e.metadata.getFieldIndex(t.name)}))),o=ba.A.fromJSON({fields:n,timeZoneByFieldName:r}),h=new Uint16Array(Array.from(this._availableFields.values()).map((t=>o.get(t)?.index)).filter((t=>null!=t)));await e.inner.readChunksWithCallback(h,(t=>{const e=this._chunkId++,i=new Wl(this._metadata,o,s,t,e),r=new il(i,null,e,!1);this._store.insert(r)})),this._files.push(e)}async _download(){try{await Promise.all(this._service.source.urls.map((t=>this._insert(t))));const t=new il(Ph.empty(this._metadata),null,-1,!0);this._store.insert(t)}catch(t){throw console.error(t),t}}}var Ul=s(27348);class jl extends Pl{constructor(t,e,s,i,r,n){super(t,e,s,r,n),this._snapshotInfo=i}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(t){return null==this._promise&&(this._promise=this._download()),this._promise}unload(t){}async _download(){const t=this._snapshotInfo.initialTolerance,e=t?new Ul.A({mode:"view",originPosition:"upper-left",tolerance:t}):null;await this._downloadStreaming(e),null!=e&&await this._downloadRefresh()}async _downloadStreaming(t){try{for await(const e of this._fetchPages(t))this._store.insert(e)}catch(t){throw new i.A("featurelayer-query","Encountered error when downloading data",{error:t})}}async _downloadRefresh(){try{const t=[];for await(const e of this._fetchPages(null))t.push(e);this._store.clear();for(const e of t)this._store.insert(e);this._store.refresh()}catch(t){throw new i.A("featurelayer-query","Encountered error when downloading data",{error:t})}}async*_fetchPages(t){let e;try{for await(const e of this._concurrentPageStream(t))0!==e.size()&&(yield e)}catch(t){e=t}if(e&&(0,a.zf)(e)||(yield new il(Ph.empty(this._metadata),null,-1,!0)),e)throw e}async*_concurrentPageStream(t){const e=(0,n.A)("featurelayer-snapshot-concurrency"),s=this._pageStreamAll(t),i=[];let r=!1,o=1;for(;!r;){const t=[];for(;!r&&i.length<o;){const e=s.next();if(!e.value){r=!0;break}const n=e.value;n.then((t=>{t.reader.exceededTransferLimit||(r=!0)})).catch((t=>{r=!0})).finally((()=>{i.splice(i.indexOf(n),1)})),i.push(n),t.push(n)}for(const e of t)yield e;i.length&&await Promise.race(i),o<e&&(o+=1)}}*_pageStreamAll(t){const e=Math.ceil(this._snapshotInfo.maxFeatureCount/this._queryInfo.pageSize);for(let s=0;s<e;s++)yield this._downloadPage(s,t)}async _downloadPage(t,e){(0,a.Te)(this._options);const s=this._queryInfo.createPagedQuery(t,e),i=await this._fetch(s,this._options,{chunkId:t.toString()}),r=new il(i,s.inner.toJSON(),t,!1);return(0,a.Te)(this._options),r}}class Vl{constructor(t){this.size=0,this._start=0,this.maxSize=t,this._buffer=new Array(t)}get entries(){return this._buffer}enqueue(t){if(this.size===this.maxSize){const e=this._buffer[this._start];return this._buffer[this._start]=t,this._start=(this._start+1)%this.maxSize,e}return this._buffer[(this._start+this.size++)%this.maxSize]=t,null}dequeue(){if(0===this.size)return null;const t=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,t}peek(){return 0===this.size?null:this._buffer[this._start]}peekLast(){return 0===this.size?null:this._buffer[(this._start+(this.size-1))%this.maxSize]}find(t){if(0===this.size)return null;for(const e of this._buffer)if(null!=e&&t(e))return e;return null}clear(t){let e=this.dequeue();for(;null!=e;)t&&t(e),e=this.dequeue()}}class Xl{constructor(t,e,s,r,n=128){if(this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=r,this.store=t,"unique-id-composite"===e.type)throw new i.A("stream-layer","composite uniqueIds are not supported");this.idField=e.fieldName,this.purgeInterval=n,this._useGeneratedIds=this.idField===ot.DN}removeById(t){this._removed.push(t)}removeByTrackId(t){const e=this._trackIdToObservations.get(t);if(e)for(const t of e.entries)this._removed.push(t)}add(t){if(this._useGeneratedIds){const e=this._nextId();t.attributes[this.idField]=e,t.objectId=e}else t.objectId=t.attributes[this.idField];const e=t.objectId;if(this._addOrUpdated.set(e,t),this._maxAge=Math.max(this._maxAge,t.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return null==this._trackIdLessObservations&&(this._trackIdLessObservations=new Vl(1e5)),void this._trackIdLessObservations.enqueue(e);const s=t.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(s)){const t=null!=this._purgeOptions?.maxObservations?this._purgeOptions.maxObservations:1e3,e=(0,ti.qE)(t,0,1e3);this._trackIdToObservations.set(s,new Vl(e))}const i=this._trackIdToObservations.get(s),r=i?.enqueue(e);null!=r&&(this._addOrUpdated.has(r)?this._addOrUpdated.delete(r):this._removed.push(r))}checkForUpdates(){const t=this._getToAdd(),e=this._getToRemove(),s=performance.now(),i=s-this._lastPurge,r=Date.now();i>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const n=[];if(null!=e)for(const t of e){const e=this.store.removeById(t);null!=e&&n.push(e)}const o=[];if(null!=t){const i=new Set(e??[]);for(const e of t)i.has(e.objectId)||(e.attributes[ot.Gm]=s,e.attributes[ot.Aw]=r,this.store.add(e),o.push(e))}return!(!o.length&&!n?.length||(this.store.update(o,n),0))}_getToAdd(){if(!this._addOrUpdated.size)return null;const t=new Array(this._addOrUpdated.size);let e=0;return this._addOrUpdated.forEach((s=>t[e++]=s)),this._addOrUpdated.clear(),t}_getToRemove(){const t=this._removed;return this._removed.length?(this._removed=[],t):null}_nextId(){const t=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,t}_purge(t){const e=this._purgeOptions;null!=e&&(this._purgeSomeByDisplayCount(e),this._purgeByAge(e),this._purgeByAgeReceived(t,e),this._purgeTracks())}_purgeSomeByDisplayCount(t){if(!t.displayCount)return;let e=this.store.size;if(e>t.displayCount){if(this._timeInfo.trackIdField)for(const s of this._trackIdToObservations.values())if(e>t.displayCount&&s.size){const t=s.dequeue();this._removed.push(t),e--}if(null!=this._trackIdLessObservations){let s=e-t.displayCount;for(;s-- >0;){const t=this._trackIdLessObservations.dequeue();null!=t&&this._removed.push(t)}}}}_purgeByAge(t){const e=this._timeInfo?.startTimeField;if(!t.age||!e)return;const s=60*t.age*1e3,i=this._maxAge-s;this.store.forEach((t=>{t.attributes[e]<i&&this._removed.push(t.objectId)}))}_purgeByAgeReceived(t,e){if(!e.ageReceived)return;const s=t-60*e.ageReceived*1e3;this.store.forEach((t=>{t.attributes[ot.Gm]<s&&this._removed.push(t.objectId)}))}_purgeTracks(){this._trackIdToObservations.forEach(((t,e)=>{0===t.size&&this._trackIdToObservations.delete(e)}))}}var Hl=s(30624);let Ql=class extends O.A{constructor(t){super(t)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};(0,E._)([(0,L.MZ)()],Ql.prototype,"connection",void 0),(0,E._)([(0,L.MZ)()],Ql.prototype,"connectionStatus",null),(0,E._)([(0,L.MZ)()],Ql.prototype,"errorString",null),Ql=(0,E._)([(0,N.$)("esri.views.2d.layers.features.sources.StreamConnectionState")],Ql);class Zl{constructor(t,e){this._metadata=t,this._onUpdate=e,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return Ph.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(t){this._objectIdToFeature.set(t.objectId,t)}forEach(t){this._objectIdToFeature.forEach(t)}removeById(t){const e=this._objectIdToFeature.get(t);return e?(this._objectIdToFeature.delete(t),e):null}clear(){this._objectIdToFeature=new Map}update(t,e){this._onUpdate(t?.length??0)}}class $l extends vc{constructor(t){super(),this._reader=t,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(t){const e=this.queryFeaturesInBounds(t.bounds);return e.setTransformForDisplay(t.transform),e}}class Jl extends nl{constructor(t,e,s,i,r){super(s),this._service=t,this._dataFilter=e,this._streamOptions=i,this._metadata=r,this._connectionState=new Ql,this._forceRefresh=!1,this.events=new va.A;const{timeInfo:n}=this._metadata,{purgeOptions:o}=e;this._stagingStore=new Zl(this._metadata.weakCloneWithAdditionalFields([{name:ot.Aw,alias:"timeReceived",type:"esriFieldTypeDate"}]),(t=>this.events.emit("features-updated",t))),this._manager=new Xl(this._stagingStore,r.featureIdInfo,n,o),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const t=null!=this._chunk;return this._manager.checkForUpdates()||!t||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new $l(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick"),!0):(this.events.emit("tick"),!1)}async updateFields(t){throw new Error("Updating available fields not supported for StreamLayer")}async load(t){}unload(t){}disconnect(){this._connection=(0,f.pR)(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(null!=this._connection)return;const{geometryType:t,spatialReference:e}=this._metadata,{maxReconnectionAttempts:s,maxReconnectionInterval:i,geometryDefinition:n,definitionExpression:o,customParameters:a}=this._dataFilter;this._connection=(0,Hl.createConnection)(this._service.source,e,this._streamOptions.outSR,t,o,n,s,i,a),this._handlesGroup=(0,r.vE)([this._connection.on("data-received",(t=>this._onFeature(t))),this._connection.on("message-received",(t=>this._onWebSocketMessage(t)))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(t){this._connection?.updateCustomParameters(t)}sendMessageToSocket(t){this._connection?.sendMessageToSocket(t)}sendMessageToClient(t){this._connection?.sendMessageToClient(t)}_onWebSocketMessage(t){if("type"in t)switch(t.type){case"delete":if(t.objectIds)for(const e of t.objectIds)this._manager.removeById(e);if(t.trackIds)for(const e of t.trackIds)this._manager.removeByTrackId(e);break;case"clear":this.clear()}this.events.emit("message-received",t)}_onFeature(t){try{this._manager.add(t),this.events.emit("data-received",t)}catch(t){}}}class Kl{constructor(t){this._metadata=t,this._chunks=new Map,this._chunksToRemove=[],this._overrides=new Mc,this.events=new va.A,this.featureAdapter=new Mh}destroy(){this.clear()}clear(){for(const t of this._chunks.values())this._chunksToRemove.push(t);this._chunks.clear(),this._overrides.clearWeakOverrides()}*chunks(){this._overrides&&(yield this._overrides.asChunk(this._metadata)),yield*this._chunks.values()}insert(t){(0,n.A)("esri-2d-update-debug")&&console.debug(`Chunk[${t.chunkId}] SourceChunkStore.insert`),this._overrides.onChunkInsert(t),this._chunks.set(t.chunkId,t),this.events.emit("changed")}remove(t){(0,n.A)("esri-2d-update-debug")&&console.debug(`Chunk[${t.chunkId}] SourceChunkStore.remove`),this._chunks.delete(t.chunkId),this._chunksToRemove.push(t)}cleanup(){const t=this._chunksToRemove;return this._chunksToRemove=[],this._overrides.cleanup(this._chunks.values()),t}applyOverride(t){this._overrides.apply(t,this),this.events.emit("changed");for(const t of this._chunks.values())t.invalidate()}takeOverrideUpdate(){return this._overrides.takeOverrideUpdate()}refresh(){this.events.emit("refresh")}forEach(t){const e=new Set;for(const s of this.chunks()){const i=s.reader.getCursor();for(;i.next();){const s=i.getObjectId();e.has(s)||(t(i.copy()),e.add(s))}}}forEachUnsafe(t){const e=new Set;for(const s of this.chunks()){const i=s.reader.getCursor();for(;i.next();){const s=i.getObjectId();e.has(s)||(t(i),e.add(s))}}}mapObjectIdsFromGlobalIds(t,e){const s=new Map,i=new Set(t);return this._overrides.putWeakObjectIdsFromGlobalIds(s,i,e),this._forEachUnsafeIgnoreOverrides((t=>{const r=t.readAttribute(e);if(r&&i.has(r)&&!s.has(r)){const e=t.getObjectId();s.set(r,e)}})),s}forEachInBounds(t,e){const s=new Set;for(const i of this.chunks()){const r=i.queryFeaturesInBounds(t);for(;r.next();){const t=r.getObjectId();s.has(t)||(e(r.copy()),s.add(t))}}}forEachBounds(t,e){const s=(0,Ia.vt)();for(const i of t)i.getBounds(s)&&e(s)}_forEachUnsafeIgnoreOverrides(t){const e=new Set;for(const s of this._chunks.values()){const i=s.reader.withoutOverrides().getCursor();for(;i.next();){const s=i.getObjectId();e.has(s)||(t(i),e.add(s))}}}}var tu=s(79897);let eu=class extends O.A{constructor(t){super(t),this.debugName="",this._updatingHandles=new tu.U,this._idToUpdatingState=new q.A}get updating(){const t=this._updatingHandles.updating||Array.from(this._idToUpdatingState.values()).some((t=>t));if((0,n.A)("esri-2d-log-updating")){const e=Array.from(this._idToUpdatingState.entries()).map((([t,e])=>`-> ${t}: ${e}`)).join("\n");console.log(`${this.debugName}: Updating: ${t}\n-> Handles: ${this._updatingHandles.updating}\n${e}`)}return t}addUpdateTracking(t,e){const s=(0,c.wB)((()=>e.updating),(e=>this._idToUpdatingState.set(t,e)),{sync:!0});this.addHandles(s)}addPromise(t){return this._updatingHandles.addPromise(t)}};(0,E._)([(0,L.MZ)({constructOnly:!0})],eu.prototype,"debugName",void 0),(0,E._)([(0,L.MZ)({readOnly:!0})],eu.prototype,"updating",null),eu=(0,E._)([(0,N.$)("esri.views.2d.layers.support.UpdateTracking2D")],eu);class su{constructor(t,e,s,i,r){this.service=t,this._aggregateAdapter=e,this._subscriptions=s,this._connection=i,this._cachedObjectIds=r,this._updateTracking=new eu({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._metadata=Th.createFeature(t.metadata),this._store=new Kl(this._metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map((t=>t.close()))}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return Zc.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:t}=this._schema.mutable,e=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new Pa.do({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,featureIdInfo:s.featureIdInfo,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:t.definitionExpression,availableFields:e})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasDisplayFilter(){return!!this._schema&&"displayFilterInfo"in this._schema.mutable&&null!=this._schema.mutable.displayFilterInfo}chunks(){return Array.from(this._store.chunks())}prepareCacheUpdate(t,e){const s=new Set,i=new Set;for(const e of t)this._cachedObjectIds.has(e)||(this._cachedObjectIds.add(e),s.add(e));for(const t of e)this._cachedObjectIds.delete(t),i.add(t);this.hasDisplayFilter&&this._strategy.prepareCacheUpdate(s,i)}async applyCacheUpdate(){this.hasDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this._store.cleanup()}onSubscribe(t){this._connection.onEvent({type:"subscribe",tile:t.tile.id});const e=this._strategy?.load(t);e&&(e.then((()=>this._connection.onEvent({type:"loaded",tile:t.tile.id}))).catch((e=>this._connection.onEvent({type:"error",tile:t.tile.id,error:e}))),this._updateTracking.addPromise(e))}onResume(t){this._updateTracking.addPromise((0,a.QZ)(this._strategy?.load(t)))}onUnsubscribe(t){this._connection.onEvent({type:"unsubscribe",tile:t.tile.id}),this._strategy?.unload(t)}applyOverride(t){this._didInvalidateData=!0,this._store.applyOverride(t)}takeOverrideUpdate(){return this._store.takeOverrideUpdate()}async update(t,e){const s=t.source,i=(0,m.Ui)(this._schema?.mutable,s.mutable);if(!i)return!1;if((0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.update`,{changes:i}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),(0,m.w2)(i,"sourceRefreshVersion")&&this._strategy?.refresh)return this._strategy.refresh();if(("feature"===s.type||"parquet"===s.type)&&(0,m.w2)(i,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(e);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(t){this._connection.onEvent({type:"updateFieldsError",error:t})}}return!1}return!!((0,m.Mj)(i,"dataFilter")||(0,m.Mj)(i,"sourceRefreshVersion")||this._strategy.about.supportsDisplayFilter&&(0,m.Mj)(i,"displayFilterInfo"))&&(await this._updateStrategy(e),!0)}async addParquetFile(t){this._strategy.addParquetFile(t)}unsafeSetQueryHistoricMoment(t){"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=t,this._strategy.unsafeSetQueryHistoricMoment(new Date(t)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new el(this._connection))}async normalizeOverrides(t){const e={historicMoment:t.historicMoment,commands:{updateWeak:t.commands.updateWeak.map(ya.Om.fromJSON),removeWeak:t.commands.removeWeak,update:t.commands.update.map(ya.Om.fromJSON),remove:t.commands.remove,release:t.commands.release}},s=t.commands.updateByIdWeak,i=await this._queryOptimizedFeatures(s);return e.commands.updateWeak.push(...i),e}async _queryOptimizedFeatures(t){if(0===t.length)return[];const e=[],s=(await this._strategy.queryByObjectId(t)).getCursor();for(;s.next();)e.push(s.readOptimizedFeatureWorldSpace());return e}getObjectIdsFromGlobalIds(t){const e=this.metadata.globalIdField;if(null==e)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=this._store.mapObjectIdsFromGlobalIds(t,e).values();return Array.from(s)}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,e={...t.query,f:"json"},s=(await(0,Xc.A)(t.path,{query:e,responseType:"json"})).data.editingInfo.lastEditDate;return s!==this._lastEditDate&&(this._lastEditDate=s,!0)}async _createStrategy(){const t="isSourceHosted"in this.service&&this.service.isSourceHosted,e=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,i=t||e||s;if("stream"===this._schema.type){const t=new Jl(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=t,t}if("parquet"===this._schema.type){const t=this.service;return new Yl(t,this._metadata,this._schema,this._store)}const r=this.service,n=tl.fromSchema(r,this._schema,this._metadata),o=await this._supportSnapshotMode(r,n);return o?new jl(r,n,this._store,o,this.metadata,this._connection):i?new El(r,n,this._store,this.metadata,this._connection):new kl(r,n,this._store,this.metadata,this._connection)}async _updateStrategy(t){const e=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:e.about});const s=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=e,(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.updateStrategy`,{strategy:e});const i=Array.from(this._subscriptions.values());if(!i.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const r=Promise.all(i.map((t=>this._strategy.load(t).then((()=>this._connection.onEvent({type:"loaded",tile:t.tile.id}))).catch((e=>this._connection.onEvent({type:"error",tile:t.tile.id,error:e}))))));this._updateTracking.addPromise(r),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{s&&await r}catch(t){(0,a.jH)(t)}this._connection.onEvent({type:"updateStrategyEnd"}),(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.updateStrategyEnd`,{strategy:e})}async _supportSnapshotMode(t,e){const{queryMetadata:s}=t,i=s.snapshotInfo;return i?await this._executeExceedsLimitQuery(t,e,i)?null:i:null}async _executeExceedsLimitQuery(t,e,s){if(!s.supportsExceedsLimit)return this._executeExceedsLimitFallbackQuery(t,e,s);try{const i=t.source,r=e.createQuery();r.inner.orderByFields=[],r.inner.returnGeometry=!1;const n=new Qc.A;n.statisticType="exceedslimit",n.maxPointCount=s.maxFeatureCount,n.maxRecordCount=s.maxFeatureCount,n.outStatisticFieldName="exceedslimit",s.maxVertexCount&&(n.maxVertexCount=s.maxVertexCount),r.inner.outStatistics=[n],r.inner.cacheHint=!0;const o=await(0,Hc.eW)(i,r.inner,void 0,{query:r.customParameters}),a=o.data.features[0]?.attributes.exceedslimit;return!(0===a)}catch(t){return!0}}async _executeExceedsLimitFallbackQuery(t,e,s){if(s.maxVertexCount)return!0;const i=t.source,r=e.createQuery();r.inner.orderByFields=[],r.inner.returnGeometry=!1,r.inner.cacheHint=!0;try{return(await(0,Hc.gW)(i,r.inner,{query:r.customParameters})).data.count>s.maxFeatureCount}catch(t){return!0}}}class iu{constructor(t,e){this.tile=t,this.version=e,this._abortController=new AbortController}get key(){return this.tile.key}get signal(){return this._abortController.signal}abort(){this._abortController.abort()}}var ru=s(98291);class nu{constructor(t,e){this.key=new b.A(0,0,0,0),this.bounds=(0,H.vt)(),this.objectIds=new Set,this.key.set(e);const s=t.getLODInfoAt(this.key);this.tileInfoView=t,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=t.zoomToScale(s.level-1),this.maxScale=t.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return(0,H.w1)(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(t){return Yh(this.scale,t)}createChildTiles(){const t=this.key.getChildKeys(),e=ru.A.acquire();for(let s=0;s<t.length;s++)e[s]=new nu(this.tileInfoView,t[s]);return e}getQuantizationParameters(){return Ul.A.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})}}class ou{constructor(t){this.inner=t,this.resolver=(0,a.Tw)()}}class au{constructor(){this._aggregateAdapter={getFeatureObjectIds:t=>this._processor.getFeatureObjectIdsForAggregate(t)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(t){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const e=this._connection,s=d.A.fromJSON(t.tileInfoJSON);this._tileInfoView=new F(s),this._source=new su(t.service,this._aggregateAdapter,this._subscriptions,e,this._cachedObjectIds),this._processor=new jc(e,this._source),this._handles=(0,r.vE)([this._source.store.events.on("changed",(()=>this._requestUpdate())),this._source.store.events.on("refresh",(()=>this._requestRefresh())),(0,c.wB)((()=>this._source.updateTracking.updating),(()=>{this._requestUpdate(),(0,a.QZ)(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))}))])}onDetach(){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(t){this._connection=new p(t)}get features(){const t=this._source?.queryEngine;if(!t)throw new i.A("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new i.A("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(t){return this._processor.getDisplayFeatures(t)}getDisplayIds(t){return this._processor.getDisplayIds(t)}getObjectIdsFromGlobalIds(t){return this._source.getObjectIdsFromGlobalIds(t)}async updateSchema(t,e){return(0,n.A)("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new ou({schema:t,version:e}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(t){const e=new ou(t);return this._updateSubscriptionRequests.push(e),this._requestUpdate(),e.resolver.promise}updateHighlight(t){const e=new ou(t);return this._updateHighlightRequests.push(e),this._requestUpdate(),e.resolver.promise}async addParquetFile(t){return this._source.addParquetFile(t)}async onOverride(t){if(null!=this._updateOverridesRequest)throw new i.A("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new ou(t);const e=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),e}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(t,e){return this.features.executeQuery(t,e)}async queryHeatmapStatistics(t){const e=Math.round((0,l.Lz)(t.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof t.fieldOffset,n=t.fieldOffset??0,o=Array.from(this._subscriptions.values()),a=this._source.chunks(),h=e**2,c=3/(Math.PI*h),u=2*e,d=Math.ceil(_.CQ/u);for(const e of o){const o=e.tile,l=new Float64Array(d*d);for(const e of a){const s=e.getTileReader(o);if(!s)continue;const i=s.getCursor();for(;i.next();){let e=1;if(null!=t.field){const s=i.readAttribute(t.field);e=r?-1*+s:+s+n}const s=i.readXForDisplay()/u,o=i.readYForDisplay()/u,a=Math.floor(s),_=Math.floor(o);if(a<0||_<0||a>=d||_>=d)continue;const p=((.5+a-s)*u)**2+((.5+_-o)*u)**2;if(p>h)continue;const f=e*(c*(1-p/h)**2);l[_+a*d]+=f}}for(let t=0;t<l.length;t++)s=Math.min(s,l[t]),i=Math.max(i,l[t])}return{max:i,min:s}}async getSampleFeatures(t){const e=this._source.chunks();if(e.reduce(((t,e)=>t+e.size()),0)<=t.minFeatureCount){if(!this._source.updateTracking.updating){const t=[];return this._source.store.forEachUnsafe((e=>t.push(e.readLegacyFeatureWorldSpace()))),t}return null}const s=new Set,i=[],r=e.map((t=>t.reader.getCursor())),n=new h.A,o=3*t.sampleSize;for(let a=0;a<o&&i.length<t.sampleSize;a++){const t=r[n.getIntRange(0,e.length-1)];if(0===t.getSize())continue;const o=n.getIntRange(0,t.getSize()-1);t.setIndex(o);const a=t.getObjectId();s.has(a)||(s.add(a),i.push(t.readLegacyFeatureWorldSpace()))}return i.length>=t.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,(0,o.d)((()=>this._scheduleNextUpdate())))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=(0,u.oV)(this._doUpdate()).finally((()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()})),this._updateRequested=!1))}_subscribe(t){const e=t.tileId;if(this._subscriptions.has(e))return;(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.subscribe`);const s=new nu(this._tileInfoView,e),i=new iu(s,t.version);this._subscriptions.set(e,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(t){const e=this._subscriptions.get(t);e&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.unsubscribe`),e.abort(),this._source.onUnsubscribe(e),this._processor.onUnsubscribe(e),this._subscriptions.delete(e.key.id))}async _doUpdate(){if((0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const t=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const e of t)this._doUpdateSubscriptions(e.inner),e.resolver.resolve()}if(this._updateHighlightRequests.length){const t=this._updateHighlightRequests,e=new Set,s=new Set;for(const i of t)for(const{objectId:t,highlightFlags:r}of i.inner.highlights)r?(e.add(t),s.delete(t)):(s.add(t),e.delete(t));this._source.prepareCacheUpdate(e,s)}const t=this._updateSchemaRequest;this._updateSchemaRequest=null;let e=!1;if(null!=t){const{schema:s,version:i}=t.inner;e=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(e=!0),this._didSourceRefresh&&(e=!0,this._didSourceRefresh=!1),e&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const t=await this._source.normalizeOverrides(s.inner);this._source.applyOverride(t),(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const t=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const e of t)this._processor.updateHighlight(e.inner),e.resolver.resolve()}const i=this._source.cleanup();this._processor.removeChunks(i);try{const t=this._source.takeOverrideUpdate();if(null!=t&&this._subscriptions.size){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(t)}catch(t){(0,n.A)("esri-2d-update-debug")&&console.debug("InternalError",t)}await this._connection.container.unlockForOverrides(),(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&((0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(t){(0,a.jH)(t)}null!=s&&s.resolver.resolve(),null!=t&&t.resolver.resolve(),null==t&&e&&await this._connection.container.trySwapRenderState(),this._updateRequested?((0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):((0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(t,e){(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${e}] Pipeline.updateStart`,{schema:t});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(t,e),r=Array.from(this._subscriptions.values()),o=this._processor.update(t,e,s,i,r);return(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${e}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(t){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",t);for(const e of t.subscribe)this._subscribe(e);for(const e of t.unsubscribe)this._unsubscribe(e)}}},39516:(t,e,s)=>{let i;async function r(){return null==i&&(i=Promise.all([s.e(8368),s.e(4123)]).then(s.bind(s,44123)).then((t=>new t.WhereClauseCache(500,500)))),i}async function n(t,e){const s=await r(),i=s.get(t,e);if(null==i)throw s.getError(t,e);return i}function o(t,e){return t||=null,e||=null,"1=1"===t?e??t:"1=1"===e?t??e:t&&e?`(${t}) AND (${e})`:t??e}function a(t,e){return t||=null,e||=null,"1=1"===t||"1=1"===e||t===e?"1=1"===t?t:e:t&&e?`(${t}) OR (${e})`:t??e}s.d(e,{GP:()=>n,IW:()=>a,mA:()=>o})},40804:(t,e,s)=>{s.d(e,{U:()=>r});var i=s(34727);function r(t,e,s=0){const r=(0,i.qE)(t,0,a);for(let t=0;t<4;t++)e[s+t]=Math.floor(256*h(r*n[t]))}const n=[1,256,65536,16777216],o=[1/256,1/65536,1/16777216,1/4294967296],a=function(t,e=0){let s=0;for(let i=0;i<4;i++)s+=t[e+i]*o[i];return s}(new Uint8ClampedArray([255,255,255,255]));function h(t){return t-Math.floor(t)}},44159:(t,e,s)=>{s.d(e,{A:()=>r});var i=s(93687);class r{static{this.pool=new i.A(r,null,null,25,50)}static getId(t,e,s,i){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${s}/${i}`}constructor(t,e,s,i){this.set(t,e,s,i)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,s=63&this.level;return(3&this.world)<<30|e<<22|t<<8|s}acquire(t,e,s,i){this.set(t,e,s,i)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}containsChild(t){const e=t.level-this.level;return e>0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new r(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,s,i){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,s,i,r]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(s),this.col=parseFloat(i),this.world=parseFloat(r)}else this.level=+t,this.row=+e,this.col=+s,this.world=+i||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new r(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(t,e,s){const i=this.clone();return i.col+=t,i.row+=e,s.normalizeKey(i),i}getChildKeys(){const t=this.level+1,e=this.row<<1,s=this.col<<1,i=this.world;return[new r(t,e,s,i),new r(t,e,s+1,i),new r(t,e+1,s,i),new r(t,e+1,s+1,i)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}},46140:(t,e,s)=>{s.d(e,{R:()=>r});var i=s(49186);let r=class t{constructor(t,e,s=""){this.major=t,this.minor=e,this._context=s}lessThan(t,e){return this.major<t||t===this.major&&this.minor<e}greaterEqual(t,e){return!this.lessThan(t,e)}validate(t){if(this.major!==t.major){const e=this._context&&this._context+":",s=this._context&&this._context+" ";throw new i.A(e+"unsupported-version",`Required major ${s}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:t})}}clone(){return new t(this.major,this.minor,this._context)}static parse(e,s=""){const[r,n]=e.split("."),o=/^\s*\d+\s*$/;if(!r?.match||!o.test(r))throw new i.A((s&&s+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!o.test(n))throw new i.A((s&&s+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(r,10),h=parseInt(n,10);return new t(a,h,s)}}},48163:(t,e,s)=>{function i(){return[0,0]}function r(t,e){return[t,e]}function n(){return r(1,1)}function o(){return r(1,0)}function a(){return r(0,1)}s.d(e,{Un:()=>h,fA:()=>r,vt:()=>i});const h=n(),c=o(),l=a();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:c,UNIT_Y:l,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:i,freeze:function(t,e){return[t,e]},fromArray:function(t,e=[0,0]){const s=Math.min(2,t.length);for(let i=0;i<s;++i)e[i]=t[i];return e},fromValues:r,ones:n,unitX:o,unitY:a,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},55674:(t,e,s)=>{s.d(e,{Ad:()=>_,Gj:()=>g,QY:()=>d,lL:()=>m,xR:()=>p});var i=s(66131),r=s(49186),n=(s(44208),s(44729)),o=s(15032),a=s(65864),h=s(95466),c=s(43668),l=s(98623);const u=["geometry","scale","timeProperties"];function d(t,e){if(null!=e)for(const s of u)e.hasArcadeDependency(s)&&t.add(s);return t}function _(t,e){return f.create(t,e,null,["$feature","$view"])}function p(t,e,s){return f.create(t,e,s,["$feature","$view","$config"])}class f{static async create(t,e,s,i){const{arcade:n,Dictionary:o}=await(0,c.l)();let a;try{a=n.parseScript(t)}catch(e){throw new r.A("arcade-bad-expression","Failed to parse arcade script",{script:t,error:e})}const h=n.scriptUsesGeometryEngine(a);h&&await n.enableGeometrySupport(),await n.loadDependentModules(new Set,a,null,!1,h);const l={vars:i.reduce(((t,e)=>({...t,[e]:null})),{}),spatialReference:e,useAsync:!1},u=n.compileScript(a,l);let d=null;null!=s&&(d=new o(s),d.immutable=!0);const _=new o;return _.immutable=!1,_.setField("scale",0),new f(t,n,a,u,e,_,d,o)}constructor(t,e,s,i,r,n,o,a){this.script=t,this._arcade=e,this._syntaxTree=s,this._compiled=i,this._spatialReference=r,this._viewDict=n,this._configDict=o,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new g,this._dependencies.set("geometry",e.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(t,e){const s=e.$view?.timeZone;if(e.$view){let t;if(this._viewDict.setField("scale",e.$view.scale),null!=e.$view.timeProperties){const{currentStart:r,currentEnd:n}=e.$view.timeProperties;t=new this._dictionaryCtor({currentStart:null!=r?null!=s?i.lY.epochToArcadeDate(r,s):i.lY.unknownEpochToArcadeDate(r):void 0,currentEnd:null!=n?null!=s?i.lY.epochToArcadeDate(n,s):i.lY.unknownEpochToArcadeDate(n):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",t)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:t},spatialReference:this._spatialReference,timeZone:s})}repurposeFeature(t,e){return this._featureReader.bind(t,e,this._spatialReference),this._featureReader}references(t){return this._dependencies.get(t)??!1}}class g{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(t,e,s){const i=e??new h.A(m(t.attributes));this._boundTarget=t,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=s}_getField(t){return this._boundSchema.fieldsIndex.get(t)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(t){this._contextTimeZone=t}readArcadeFeature(){return this}hasField(t){return this._boundSchema.fieldsIndex.has(t)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const t=(0,a.rS)(this._boundTarget.geometry);if(t){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");t.spatialReference=this._boundSchema.spatialReference}return t}isUnknownDateTimeField(t){return this._boundSchema.fieldsIndex.getTimeZone(t)===l.L5}field(t,e=!0){const s=this._getField(t);if(s)switch(s.type){case"date-only":case"esriFieldTypeDateOnly":return n.n.fromReader(this._boundTarget.attributes[s.name]);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(this._boundTarget.attributes[s.name]);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(this._boundTarget.attributes[s.name]);case"date":case"esriFieldTypeDate":{const e=this._boundTarget.attributes[s.name];return this.isUnknownDateTimeField(t)?i.lY.unknownEpochToArcadeDate(e):i.lY.epochToArcadeDate(e,this.contextTimeZone??l.qU)}default:return this._boundTarget.attributes[s.name]}if(e)throw new Error(`Field ${t} does not exist`);return null}setField(t,e){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map((t=>t.name))}castToText(t=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(t=null){return{attributes:this._boundTarget.attributes,geometry:!0===t?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(t=null,e=null){return Promise.resolve(this.castAsJson(e))}}function m(t){const e=[];for(const s in t)e.push({name:s,alias:s,type:"string"==typeof t[s]?"esriFieldTypeString":"esriFieldTypeDouble"});return e}},57733:(t,e,s)=>{let i;s.r(e),s.d(e,{ColumnDescriptor:()=>j,FieldMetadata:()=>X,FileMetadata:()=>Q,GeometryInfoDescriptor:()=>$,GeometryType:()=>W,MultiScaleInfo:()=>K,PageEncodingDescriptor:()=>et,ParquetChunk:()=>it,ParquetFile:()=>nt,QuantizedGeometry:()=>at,RangeProviderJs:()=>ct,RowGroup:()=>ut,default:()=>ft,enableTracing:()=>P,initSync:()=>pt,readFile:()=>N,readFileFromBinary:()=>G,readMetadata:()=>z,readMetadataFromFile:()=>L});const r=new Array(128).fill(void 0);function n(t){return r[t]}r.push(void 0,null,!0,!1);let o=r.length;function a(t){o===r.length&&r.push(r.length+1);const e=o;return o=r[e],r[e]=t,e}function h(t,e){try{return t.apply(this,e)}catch(t){i.__wbindgen_exn_store(a(t))}}const c="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&c.decode();let l=null;function u(){return null!==l&&0!==l.byteLength||(l=new Uint8Array(i.memory.buffer)),l}function d(t,e){return t>>>=0,c.decode(u().subarray(t,t+e))}let _=0;const p="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},f="function"==typeof p.encodeInto?function(t,e){return p.encodeInto(t,e)}:function(t,e){const s=p.encode(t);return e.set(s),{read:t.length,written:s.length}};function g(t,e,s){if(void 0===s){const s=p.encode(t),i=e(s.length,1)>>>0;return u().subarray(i,i+s.length).set(s),_=s.length,i}let i=t.length,r=e(i,1)>>>0;const n=u();let o=0;for(;o<i;o++){const e=t.charCodeAt(o);if(e>127)break;n[r+o]=e}if(o!==i){0!==o&&(t=t.slice(o)),r=s(r,i,i=o+3*t.length,1)>>>0;const e=u().subarray(r+o,r+i);o+=f(t,e).written,r=s(r,i,o,1)>>>0}return _=o,r}let m=null;function y(){return(null===m||!0===m.buffer.detached||void 0===m.buffer.detached&&m.buffer!==i.memory.buffer)&&(m=new DataView(i.memory.buffer)),m}function x(t){return null==t}function b(t){t<132||(r[t]=o,o=t)}function w(t){const e=n(t);return b(t),e}const v="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>{i.__wbindgen_export_4.get(t.dtor)(t.a,t.b)}));function I(t,e,s,r){const n={a:t,b:e,cnt:1,dtor:s},o=(...t)=>{n.cnt++;const e=n.a;n.a=0;try{return r(e,n.b,...t)}finally{0===--n.cnt?(i.__wbindgen_export_4.get(n.dtor)(e,n.b),v.unregister(n)):n.a=e}};return o.original=n,v.register(o,n,n),o}function S(t,e){return t>>>=0,u().subarray(t/1,t/1+e)}function P(){i.enableTracing()}let M=null;function A(){return null!==M&&0!==M.byteLength||(M=new Float64Array(i.memory.buffer)),M}let T=null;function k(){return null!==T&&0!==T.byteLength||(T=new Uint32Array(i.memory.buffer)),T}function C(t,e){t>>>=0;const s=y(),i=[];for(let r=t;r<t+4*e;r+=4)i.push(w(s.getUint32(r,!0)));return i}let F=null;function E(){return null!==F&&0!==F.byteLength||(F=new Uint16Array(i.memory.buffer)),F}function O(t,e){const s=e(2*t.length,2)>>>0;return E().set(t,s/2),_=t.length,s}function z(t,e,s){const r=g(t,i.__wbindgen_malloc,i.__wbindgen_realloc),n=_;return w(i.readMetadata(r,n,a(e),a(s)))}function R(t,e){const s=e(1*t.length,1)>>>0;return u().set(t,s/1),_=t.length,s}function L(t){const e=R(t,i.__wbindgen_malloc),s=_;return w(i.readMetadataFromFile(e,s))}function D(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`)}function N(t,e,s,r,n){const o=g(t,i.__wbindgen_malloc,i.__wbindgen_realloc),h=_;D(r,Q);var c=r.__destroy_into_raw();let l=0;return x(n)||(D(n,$),l=n.__destroy_into_raw()),w(i.readFile(o,h,a(e),a(s),c,l))}function G(t,e){let s=0;x(t)||(D(t,$),s=t.__destroy_into_raw());const r=R(e,i.__wbindgen_malloc),n=_;return w(i.readFileFromBinary(s,r,n))}function B(t,e,s){i._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h94c9328f486d7193(t,e,a(s))}function q(t,e,s,r){i.wasm_bindgen__convert__closures__invoke2_mut__ha20fd0c25f0fd1fd(t,e,a(s),a(r))}const W=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),Y=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],U="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_columndescriptor_free(t>>>0,1)));class j{static __wrap(t){t>>>=0;const e=Object.create(j.prototype);return e.__wbg_ptr=t,U.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,U.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_columndescriptor_free(t,0)}name(){let t,e;try{const n=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_name(n,this.__wbg_ptr);var s=y().getInt32(n+0,!0),r=y().getInt32(n+4,!0);return t=s,e=r,d(s,r)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_free(t,e,1)}}physicalType(){let t,e;try{const n=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_physicalType(n,this.__wbg_ptr);var s=y().getInt32(n+0,!0),r=y().getInt32(n+4,!0);return t=s,e=r,d(s,r)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_free(t,e,1)}}logicalType(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_logicalType(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getInt32(s+4,!0);let r;return 0!==t&&(r=d(t,e).slice(),i.__wbindgen_free(t,1*e,1)),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const r=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_encodings(r,this.__wbg_ptr);var t=y().getInt32(r+0,!0),e=y().getInt32(r+4,!0),s=C(t,e).slice();return i.__wbindgen_free(t,4*e,4),s}finally{i.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_pageEncodings(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getInt32(s+4,!0);let r;return 0!==t&&(r=C(t,e).slice(),i.__wbindgen_free(t,4*e,4)),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}numValues(){return i.columndescriptor_numValues(this.__wbg_ptr)}compression(){let t,e;try{const n=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_compression(n,this.__wbg_ptr);var s=y().getInt32(n+0,!0),r=y().getInt32(n+4,!0);return t=s,e=r,d(s,r)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_free(t,e,1)}}compressedSize(){return i.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return i.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_nullCount(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getBigInt64(s+8,!0);return 0===t?void 0:e}finally{i.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_distinctCount(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getBigInt64(s+8,!0);return 0===t?void 0:e}finally{i.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_minValue(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getInt32(s+4,!0);let r;return 0!==t&&(r=S(t,e).slice(),i.__wbindgen_free(t,1*e,1)),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.columndescriptor_maxValue(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getInt32(s+4,!0);let r;return 0!==t&&(r=S(t,e).slice(),i.__wbindgen_free(t,1*e,1)),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}}const V="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_fieldmetadata_free(t>>>0,1)));class X{static __wrap(t){t>>>=0;const e=Object.create(X.prototype);return e.__wbg_ptr=t,V.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_fieldmetadata_free(t,0)}get name(){let t,e;try{const n=i.__wbindgen_add_to_stack_pointer(-16);i.fieldmetadata_name(n,this.__wbg_ptr);var s=y().getInt32(n+0,!0),r=y().getInt32(n+4,!0);return t=s,e=r,d(s,r)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_free(t,e,1)}}get index(){return i.fieldmetadata_index(this.__wbg_ptr)}get type(){const t=i.fieldmetadata_esri_type(this.__wbg_ptr);return Y[t]}get physicalType(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.fieldmetadata_physical_type(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getInt32(s+4,!0);let r;return 0!==t&&(r=d(t,e).slice(),i.__wbindgen_free(t,1*e,1)),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.fieldmetadata_logical_type(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getInt32(s+4,!0);let r;return 0!==t&&(r=d(t,e).slice(),i.__wbindgen_free(t,1*e,1)),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}}const H="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_filemetadata_free(t>>>0,1)));class Q{static __wrap(t){t>>>=0;const e=Object.create(Q.prototype);return e.__wbg_ptr=t,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_filemetadata_free(t,0)}version(){return i.filemetadata_version(this.__wbg_ptr)}numRows(){return i.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return i.filemetadata_numFields(this.__wbg_ptr)>>>0}numColumns(){return i.filemetadata_numColumns(this.__wbg_ptr)>>>0}createdBy(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.filemetadata_createdBy(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getInt32(s+4,!0);let r;return 0!==t&&(r=d(t,e).slice(),i.__wbindgen_free(t,1*e,1)),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(t){try{const r=i.__wbindgen_add_to_stack_pointer(-16),n=g(t,i.__wbindgen_malloc,i.__wbindgen_realloc),o=_;i.filemetadata_keyValueMetadata(r,this.__wbg_ptr,n,o);var e=y().getInt32(r+0,!0),s=y().getInt32(r+4,!0);let a;return 0!==e&&(a=d(e,s).slice(),i.__wbindgen_free(e,1*s,1)),a}finally{i.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const s=i.__wbindgen_add_to_stack_pointer(-16);i.filemetadata_keys(s,this.__wbg_ptr);var t=y().getInt32(s+0,!0),e=y().getInt32(s+4,!0);let r;return 0!==t&&(r=C(t,e).slice(),i.__wbindgen_free(t,4*e,4)),r}finally{i.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(t){const e=g(t,i.__wbindgen_malloc,i.__wbindgen_realloc),s=_,r=i.filemetadata_getFieldIndex(this.__wbg_ptr,e,s);return 16777215===r?void 0:r}getFieldByIndex(t){const e=i.filemetadata_getFieldByIndex(this.__wbg_ptr,t);return 0===e?void 0:X.__wrap(e)}getFields(){try{const r=i.__wbindgen_add_to_stack_pointer(-16);i.filemetadata_getFields(r,this.__wbg_ptr);var t=y().getInt32(r+0,!0),e=y().getInt32(r+4,!0),s=C(t,e).slice();return i.__wbindgen_free(t,4*e,4),s}finally{i.__wbindgen_add_to_stack_pointer(16)}}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_geometryinfodescriptor_free(t>>>0,1)));class ${static __wrap(t){t>>>=0;const e=Object.create($.prototype);return e.__wbg_ptr=t,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_geometryinfodescriptor_free(t,0)}get geometryType(){const t=i.__wbg_get_geometryinfodescriptor_geometryType(this.__wbg_ptr);return 4===t?void 0:t}set geometryType(t){i.__wbg_set_geometryinfodescriptor_geometryType(this.__wbg_ptr,x(t)?4:t)}get wkbIndex(){const t=i.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set wkbIndex(t){i.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,x(t)?16777215:t)}get lngIndex(){const t=i.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set lngIndex(t){i.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,x(t)?16777215:t)}get latIndex(){const t=i.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set latIndex(t){i.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,x(t)?16777215:t)}get xIndex(){const t=i.__wbg_get_geometryinfodescriptor_xIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set xIndex(t){i.__wbg_set_geometryinfodescriptor_xIndex(this.__wbg_ptr,x(t)?16777215:t)}get inWkid(){const t=i.__wbg_get_geometryinfodescriptor_inWkid(this.__wbg_ptr);return 4294967297===t?void 0:t}set inWkid(t){i.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,x(t)?4294967297:t>>>0)}get outWkid(){const t=i.__wbg_get_geometryinfodescriptor_outWkid(this.__wbg_ptr);return 4294967297===t?void 0:t}set outWkid(t){i.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,x(t)?4294967297:t>>>0)}static new(){const t=i.geometryinfodescriptor_new();return $.__wrap(t)}setMultiscaleInfo(t){D(t,K);var e=t.__destroy_into_raw();i.geometryinfodescriptor_setMultiscaleInfo(this.__wbg_ptr,e)}}const J="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_multiscaleinfo_free(t>>>0,1)));class K{static __wrap(t){t>>>=0;const e=Object.create(K.prototype);return e.__wbg_ptr=t,J.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_multiscaleinfo_free(t,0)}static new(){const t=i.multiscaleinfo_new();return K.__wrap(t)}push(t,e,s,r,n){i.multiscaleinfo_push(this.__wbg_ptr,t,e,s,r,n)}}const tt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_pageencodingdescriptor_free(t>>>0,1)));class et{static __wrap(t){t>>>=0;const e=Object.create(et.prototype);return e.__wbg_ptr=t,tt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,tt.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_pageencodingdescriptor_free(t,0)}pageType(){let t,e;try{const n=i.__wbindgen_add_to_stack_pointer(-16);i.pageencodingdescriptor_pageType(n,this.__wbg_ptr);var s=y().getInt32(n+0,!0),r=y().getInt32(n+4,!0);return t=s,e=r,d(s,r)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_free(t,e,1)}}encoding(){let t,e;try{const n=i.__wbindgen_add_to_stack_pointer(-16);i.pageencodingdescriptor_encoding(n,this.__wbg_ptr);var s=y().getInt32(n+0,!0),r=y().getInt32(n+4,!0);return t=s,e=r,d(s,r)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_free(t,e,1)}}count(){return i.pageencodingdescriptor_count(this.__wbg_ptr)}}const st="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_parquetchunk_free(t>>>0,1)));class it{static __wrap(t){t>>>=0;const e=Object.create(it.prototype);return e.__wbg_ptr=t,st.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,st.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_parquetchunk_free(t,0)}size(){return i.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(t){return 0!==i.parquetchunk_hasField(this.__wbg_ptr,t)}readX(t){return i.parquetchunk_readX(this.__wbg_ptr,t)}readY(t){return i.parquetchunk_readY(this.__wbg_ptr,t)}readCoords(t){try{const r=i.__wbindgen_add_to_stack_pointer(-16);i.parquetchunk_readCoords(r,this.__wbg_ptr,t);var e=y().getInt32(r+0,!0),s=y().getInt32(r+4,!0);let n;return 0!==e&&(n=function(t,e){return t>>>=0,A().subarray(t/8,t/8+e)}(e,s).slice(),i.__wbindgen_free(e,8*s,8)),n}finally{i.__wbindgen_add_to_stack_pointer(16)}}readLengths(t){try{const r=i.__wbindgen_add_to_stack_pointer(-16);i.parquetchunk_readLengths(r,this.__wbg_ptr,t);var e=y().getInt32(r+0,!0),s=y().getInt32(r+4,!0);let n;return 0!==e&&(n=function(t,e){return t>>>=0,k().subarray(t/4,t/4+e)}(e,s).slice(),i.__wbindgen_free(e,4*s,4)),n}finally{i.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(t,e,s,r,n){const o=i.parquetchunk_readGeometryTransformed(this.__wbg_ptr,t,e,s,r,n);return 0===o?void 0:at.__wrap(o)}boundsXMin(t){return i.parquetchunk_boundsXMin(this.__wbg_ptr,t)}boundsYMin(t){return i.parquetchunk_boundsYMin(this.__wbg_ptr,t)}boundsXMax(t){return i.parquetchunk_boundsXMax(this.__wbg_ptr,t)}boundsYMax(t){return i.parquetchunk_boundsYMax(this.__wbg_ptr,t)}readAttribute(t,e){return w(i.parquetchunk_readAttribute(this.__wbg_ptr,t,e))}}const rt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_parquetfile_free(t>>>0,1)));class nt{static __wrap(t){t>>>=0;const e=Object.create(nt.prototype);return e.__wbg_ptr=t,rt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,rt.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_parquetfile_free(t,0)}metadata(){const t=i.parquetfile_metadata(this.__wbg_ptr);return Q.__wrap(t)}rowGroups(){try{const r=i.__wbindgen_add_to_stack_pointer(-16);i.parquetfile_rowGroups(r,this.__wbg_ptr);var t=y().getInt32(r+0,!0),e=y().getInt32(r+4,!0),s=C(t,e).slice();return i.__wbindgen_free(t,4*e,4),s}finally{i.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(t,e){const s=O(t,i.__wbindgen_malloc),r=_;return w(i.parquetfile_readChunksWithCallback(this.__wbg_ptr,s,r,a(e)))}readFirstChunk(t){const e=O(t,i.__wbindgen_malloc),s=_;return w(i.parquetfile_readFirstChunk(this.__wbg_ptr,e,s))}readAllChunks(t){const e=O(t,i.__wbindgen_malloc),s=_;return w(i.parquetfile_readAllChunks(this.__wbg_ptr,e,s))}updateChunks(t){const e=O(t,i.__wbindgen_malloc),s=_;return w(i.parquetfile_updateChunks(this.__wbg_ptr,e,s))}}const ot="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_quantizedgeometry_free(t>>>0,1)));class at{static __wrap(t){t>>>=0;const e=Object.create(at.prototype);return e.__wbg_ptr=t,ot.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ot.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_quantizedgeometry_free(t,0)}readCoordsUnsafe(){return w(i.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return w(i.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const ht="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_rangeproviderjs_free(t>>>0,1)));class ct{static __wrap(t){t>>>=0;const e=Object.create(ct.prototype);return e.__wbg_ptr=t,ht.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ht.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_rangeproviderjs_free(t,0)}static new(t,e){const s=i.rangeproviderjs_new(a(t),a(e));return ct.__wrap(s)}static withFetch(){const t=i.rangeproviderjs_withFetch();return ct.__wrap(t)}}const lt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>i.__wbg_rowgroup_free(t>>>0,1)));class ut{static __wrap(t){t>>>=0;const e=Object.create(ut.prototype);return e.__wbg_ptr=t,lt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,lt.unregister(this),t}free(){const t=this.__destroy_into_raw();i.__wbg_rowgroup_free(t,0)}columns(){try{const r=i.__wbindgen_add_to_stack_pointer(-16);i.rowgroup_columns(r,this.__wbg_ptr);var t=y().getInt32(r+0,!0),e=y().getInt32(r+4,!0),s=C(t,e).slice();return i.__wbindgen_free(t,4*e,4),s}finally{i.__wbindgen_add_to_stack_pointer(16)}}}function dt(){const t={wbg:{}};return t.wbg.__wbg_buffer_609cc3eee51ed158=function(t){return a(n(t).buffer)},t.wbg.__wbg_call_672a4d21634d4a24=function(){return h((function(t,e){return a(n(t).call(n(e)))}),arguments)},t.wbg.__wbg_call_7cccdd69e0791ae2=function(){return h((function(t,e,s){return a(n(t).call(n(e),n(s)))}),arguments)},t.wbg.__wbg_call_b8adc8b1d0a0d8eb=function(){return h((function(t,e,s,i,r){return a(n(t).call(n(e),n(s),n(i),n(r)))}),arguments)},t.wbg.__wbg_columndescriptor_new=function(t){return a(j.__wrap(t))},t.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,e){let s,r;try{s=t,r=e,console.error(d(t,e))}finally{i.__wbindgen_free(s,r,1)}},t.wbg.__wbg_fieldmetadata_new=function(t){return a(X.__wrap(t))},t.wbg.__wbg_filemetadata_new=function(t){return a(Q.__wrap(t))},t.wbg.__wbg_length_a446193dc22c12f8=function(t){return n(t).length},t.wbg.__wbg_new_23a2665fac83c611=function(t,e){try{var s={a:t,b:e};return a(new Promise(((t,e)=>{const i=s.a;s.a=0;try{return q(i,s.b,t,e)}finally{s.a=i}})))}finally{s.a=s.b=0}},t.wbg.__wbg_new_8a6f238a6ece86ea=function(){return a(new Error)},t.wbg.__wbg_new_a12002a7f91c75be=function(t){return a(new Uint8Array(n(t)))},t.wbg.__wbg_newnoargs_105ed471475aaf50=function(t,e){return a(new Function(d(t,e)))},t.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(t,e,s){return a(new Uint32Array(n(t),e>>>0,s>>>0))},t.wbg.__wbg_newwithbyteoffsetandlength_f254047f7e80e7ff=function(t,e,s){return a(new Int16Array(n(t),e>>>0,s>>>0))},t.wbg.__wbg_pageencodingdescriptor_new=function(t){return a(et.__wrap(t))},t.wbg.__wbg_parquetchunk_new=function(t){return a(it.__wrap(t))},t.wbg.__wbg_parquetfile_new=function(t){return a(nt.__wrap(t))},t.wbg.__wbg_queueMicrotask_98e746b9f850fe3d=function(t){queueMicrotask(n(t))},t.wbg.__wbg_queueMicrotask_c847cc8372bec908=function(t){return a(n(t).queueMicrotask)},t.wbg.__wbg_resolve_4851785c9c5f573d=function(t){return a(Promise.resolve(n(t)))},t.wbg.__wbg_rowgroup_new=function(t){return a(ut.__wrap(t))},t.wbg.__wbg_set_65595bdd868b3009=function(t,e,s){n(t).set(n(e),s>>>0)},t.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,e){const s=g(n(e).stack,i.__wbindgen_malloc,i.__wbindgen_realloc),r=_;y().setInt32(t+4,r,!0),y().setInt32(t+0,s,!0)},t.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){const t="undefined"==typeof global?null:global;return x(t)?0:a(t)},t.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){const t="undefined"==typeof globalThis?null:globalThis;return x(t)?0:a(t)},t.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){const t="undefined"==typeof self?null:self;return x(t)?0:a(t)},t.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){const t="undefined"==typeof window?null:window;return x(t)?0:a(t)},t.wbg.__wbg_then_44b73946d2fb3e7d=function(t,e){return a(n(t).then(n(e)))},t.wbg.__wbg_then_48b406749878a531=function(t,e,s){return a(n(t).then(n(e),n(s)))},t.wbg.__wbg_valueOf_fdbb54fcdfe33477=function(t){return n(t).valueOf()},t.wbg.__wbindgen_array_new=function(){return a([])},t.wbg.__wbindgen_array_push=function(t,e){n(t).push(w(e))},t.wbg.__wbindgen_cb_drop=function(t){const e=w(t).original;return 1==e.cnt--&&(e.a=0,!0)},t.wbg.__wbindgen_closure_wrapper1479=function(t,e,s){return a(I(t,e,79,B))},t.wbg.__wbindgen_is_function=function(t){return"function"==typeof n(t)},t.wbg.__wbindgen_is_undefined=function(t){return void 0===n(t)},t.wbg.__wbindgen_memory=function(){return a(i.memory)},t.wbg.__wbindgen_number_new=function(t){return a(t)},t.wbg.__wbindgen_object_clone_ref=function(t){return a(n(t))},t.wbg.__wbindgen_object_drop_ref=function(t){w(t)},t.wbg.__wbindgen_string_new=function(t,e){return a(d(t,e))},t.wbg.__wbindgen_throw=function(t,e){throw new Error(d(t,e))},t.wbg.__wbindgen_uint8_array_new=function(t,e){var s=S(t,e).slice();return i.__wbindgen_free(t,1*e,1),a(s)},t}function _t(t,e){return i=t.exports,ft.__wbindgen_wasm_module=e,m=null,M=null,F=null,T=null,l=null,i.__wbindgen_start(),i}function pt(t){if(void 0!==i)return i;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module:t}=t):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=dt();return t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t)),_t(new WebAssembly.Instance(t,e),t)}async function ft(t){if(void 0!==i)return i;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const e=dt();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:s,module:r}=await async function(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(e){if("application/wasm"==t.headers.get("Content-Type"))throw e;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e)}const s=await t.arrayBuffer();return await WebAssembly.instantiate(s,e)}{const s=await WebAssembly.instantiate(t,e);return s instanceof WebAssembly.Instance?{instance:s,module:t}:s}}(await t,e);return _t(s,r)}},62298:(t,e,s)=>{s(63907)},65529:(t,e,s)=>{s.d(e,{A:()=>h});var i=s(90237),r=s(69622),n=s(36563),o=s(40608);class a{constructor(){this._emitter=new a.EventEmitter(this)}emit(t,e){return this._emitter.emit(t,e)}on(t,e){return this._emitter.on(t,e)}once(t,e){return this._emitter.once(t,e)}hasEventListener(t){return this._emitter.hasEventListener(t)}}!function(t){class e{constructor(t=null){this._target=t,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(t,e){let s=this._listenersMap?.get(t);if(!s)return!1;const i=this._target||this;let r=!1;for(const t of s.slice()){const s="deref"in t?t.deref():t;s?s?.call(i,e):r=!0}return r&&(s=s.filter((t=>!("deref"in t)||null!=t.deref())),this._listenersMap.set(t,s)),s.length>0}on(t,e){if(Array.isArray(t)){const s=t.map((t=>this.on(t,e)));return(0,n.vE)(s)}if(t.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const s=this._listenersMap.get(t)||[];return s.push(e),this._listenersMap.set(t,s),(0,n.hA)((()=>{const s=this._listenersMap?.get(t),i=s?.indexOf(e)??-1;i>=0&&s.splice(i,1)}))}once(t,e){const s=this.on(t,(t=>{s.remove();const i="deref"in e?e.deref():e;i?.call(null,t)}));return s}hasEventListener(t){const e=this._listenersMap?.get(t);return null!=e&&e.length>0}}t.EventEmitter=e,t.EventedMixin=t=>{let s=class extends t{constructor(){super(...arguments),this._emitter=new e}destroy(){this._emitter.clear()}emit(t,e){return this._emitter.emit(t,e)}on(t,e){return this._emitter.on(t,e)}once(t,e){return this._emitter.once(t,e)}hasEventListener(t){return this._emitter.hasEventListener(t)}};return s=(0,i._)([(0,o.$)("esri.core.Evented")],s),s};let s=class extends r.A{constructor(){super(...arguments),this._emitter=new a.EventEmitter(this)}destroy(){this._emitter.clear()}emit(t,e){return this._emitter.emit(t,e)}on(t,e){return this._emitter.on(t,e)}once(t,e){return this._emitter.once(t,e)}hasEventListener(t){return this._emitter.hasEventListener(t)}};s=(0,i._)([(0,o.$)("esri.core.Evented.EventedAccessor")],s),t.EventedAccessor=s}(a||(a={}));const h=a},72457:(t,e,s)=>{s.d(e,{h:()=>n,k:()=>r});const i=new FinalizationRegistry((t=>{t.close()}));function r(t,e){i.register(t,e,e)}function n(t){i.unregister(t)}},72691:(t,e,s)=>{s.d(e,{Aw:()=>o,DN:()=>i,EA:()=>n,Gm:()=>r,t0:()=>h,xq:()=>a});const i="__esri_stream_id__",r="__esri_timestamp__",n="__esri_track_part__",o="__esri_time_received__",a="__esri_track_line__";var h;!function(t){t[t.TrackLine=0]="TrackLine",t[t.LatestObservation=1]="LatestObservation",t[t.PreviousObservation=2]="PreviousObservation"}(h||(h={}))},73681:(t,e,s)=>{s.d(e,{n:()=>h});var i=s(49186),r=s(53966),n=s(46140),o=s(95466),a=s(55674);class h{static async from(t,e,s){const o=t.dictionary_version?n.R.parse(t.dictionary_version):null,l=new Set(t.itemsNames),u={};if(e)for(const t in e)u[t]=e[t];if(t.authoringInfo.configuration)for(const e of t.authoringInfo.configuration)u.hasOwnProperty(e.name)||(u[e.name]=e.value);const d=new Set(t.authoringInfo.symbol);for(const t of Object.keys(s))d.delete(t);d.size&&r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:d});const _=await(0,a.xR)(t.expression,null,u);if(!_)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const p=!o||!o.greaterEqual(4,0);p&&r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const f=new c(s,p);return new h(p,l,_,f)}constructor(t,e,s,i){this._requiresFieldCoercionToString=t,this._itemNames=e,this._compiled=s,this._reader=i}get itemNames(){return this._itemNames}evaluate(t,e,s,i){try{return this._reader.bind(t,s,i),this._compiled.evaluate(this._reader,{$view:{scale:e}})}catch(t){r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:t})}return null}createDictionaryFieldsIndex(t){if(!this._requiresFieldCoercionToString)return new o.A(t);const e=t.map((t=>({...t,type:"esriFieldTypeString"})));return new o.A(e)}}class c extends a.Gj{constructor(t,e){super(),this._fieldMap=t,this._requiresFieldCoercionToString=e}_getField(t){const e=this._fieldMap[t]??t;return this._boundSchema.fieldsIndex.get(e)}field(t){if(!this._requiresFieldCoercionToString)return super.field(t,!1);const e=this._getField(t);return null==e?"":""+this._boundTarget.attributes[e.name]}}},76061:(t,e,s)=>{s.d(e,{G:()=>i,S:()=>r});class i{*[Symbol.iterator](){let t=this.next();for(;t;)yield t,t=this.next()}}class r extends i{constructor(t){super(),this.m_iGeom=-1,this.m_aGeoms=t?t.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const t=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,t}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},77085:(t,e,s)=>{s.d(e,{Hh:()=>a,fz:()=>l,g7:()=>h,s1:()=>o,zo:()=>c});var i=s(76061),r=s(83290);let n;function o(){return!!n&&(0,r.i)()}async function a(){if(!o()){const[t,e]=await Promise.all([Promise.all([s.e(3661),s.e(1878),s.e(2189),s.e(1088)]).then(s.bind(s,31088)),Promise.all([s.e(3661),s.e(1878),s.e(2189)]).then(s.bind(s,12189)).then((t=>t.aG)).then((({injectPe:t})=>t)),(0,r.l)()]);n=new t.OperatorGeodeticDensifyByLength,e(r.p)}}function h(t,e,s,i){return n.execute(t,e,s,i,null)}function c(t,e,s,r){const o=n.executeMany(new i.S(t),e,s,r,null);return Array.from(o)}function l(){return n.supportsCurves()}},88340:(t,e,s)=>{function i(){return new Float32Array(2)}function r(t,e){const s=new Float32Array(2);return s[0]=t,s[1]=e,s}function n(){return i()}function o(){return r(1,1)}function a(){return r(1,0)}function h(){return r(0,1)}s.d(e,{Un:()=>l,fA:()=>r,uY:()=>c,vt:()=>i});const c=n(),l=o(),u=a(),d=h();Object.freeze(Object.defineProperty({__proto__:null,ONES:l,UNIT_X:u,UNIT_Y:d,ZEROS:c,clone:function(t){const e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e},create:i,fromValues:r,ones:o,unitX:a,unitY:h,zeros:n},Symbol.toStringTag,{value:"Module"}))},89056:(t,e,s)=>{s.d(e,{b3:()=>u,jZ:()=>l});var i=s(12195),r=s(19419),n=s(537),o=s(95108),a=s(65864),h=s(80754),c=s(21325);function l(t){return d(t,!0)}function u(t){return d(t,!1)}function d(t,e){if(null==t)return null;const s=t.spatialReference,r=(0,c.Vp)(s),o=(0,i.W)(t)?t.toJSON():t;if(!r)return o;const l=(0,c.K8)(s)?102100:4326,u=h.j7[l].maxX,d=h.j7[l].minX;if((0,a.fT)(o))return p(o,u,d);if((0,a.U9)(o))return o.points=o.points.map((t=>p(t,u,d))),o;if((0,a.ZC)(o))return _(o,r);if((0,a.Bi)(o)||(0,a.Rg)(o)){const t=(0,n.Rg)(b,o),s={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},i=(0,h.kd)(s.xmin,d)*(2*u),r=0===i?o:(0,h.kS)(o,i);return s.xmin+=i,s.xmax+=i,s.xmax>u?y(r,u,e):s.xmin<d?y(r,d,e):r}return o}function _(t,e){if(!e)return t;const s=function(t,e){const s=[],{ymin:i,ymax:r,xmin:n,xmax:o}=t,a=t.xmax-t.xmin,[h,c]=e.valid,{x:l,frameId:u}=f(t.xmin,e),{x:d,frameId:_}=f(t.xmax,e),p=l===d&&a>0;if(a>2*c){const t={xmin:n<o?l:d,ymin:i,xmax:c,ymax:r},e={xmin:h,ymin:i,xmax:n<o?d:l,ymax:r},a={xmin:0,ymin:i,xmax:c,ymax:r},p={xmin:h,ymin:i,xmax:0,ymax:r},f=[],m=[];g(t,a)&&f.push(u),g(t,p)&&m.push(u),g(e,a)&&f.push(_),g(e,p)&&m.push(_);for(let t=u+1;t<_;t++)f.push(t),m.push(t);s.push(new x(t,[u]),new x(e,[_]),new x(a,f),new x(p,m))}else l>d||p?s.push(new x({xmin:l,ymin:i,xmax:c,ymax:r},[u]),new x({xmin:h,ymin:i,xmax:d,ymax:r},[_])):s.push(new x({xmin:l,ymin:i,xmax:d,ymax:r},[u]));return s}(t,e).map((t=>t.extent));return s.length<2?s[0]||t:s.length>2?(t.xmin=e.valid[0],t.xmax=e.valid[1],t):{rings:s.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}function p(t,e,s){if(Array.isArray(t)){const i=t[0];if(i>e){const s=(0,h.kd)(i,e);t[0]=i+s*(-2*e)}else if(i<s){const e=(0,h.kd)(i,s);t[0]=i+e*(-2*s)}}else{const i=t.x;if(i>e){const s=(0,h.kd)(i,e);t.x+=s*(-2*e)}else if(i<s){const e=(0,h.kd)(i,s);t.x+=e*(-2*s)}}return t}function f(t,e){const[s,i]=e.valid,r=2*i;let n,o=0;return t>i?(n=Math.ceil(Math.abs(t-i)/r),t-=n*r,o=n):t<s&&(n=Math.ceil(Math.abs(t-s)/r),t+=n*r,o=-n),{x:t,frameId:o}}function g(t,e){const{xmin:s,ymin:i,xmax:r,ymax:n}=e;return m(t,s,i)&&m(t,s,n)&&m(t,r,n)&&m(t,r,i)}function m(t,e,s){return e>=t.xmin&&e<=t.xmax&&s>=t.ymin&&s<=t.ymax}function y(t,e,s=!0){const i=!(0,a.Rg)(t);if(i&&(0,o.m3)(t),s)return(new w).cut(t,e);const r=i?t.rings:t.paths,n=i?4:2,h=r.length,c=-2*e;for(let t=0;t<h;t++){const e=r[t];if(e&&e.length>=n){const t=[];for(const s of e)t.push([s[0]+c,s[1]]);r.push(t)}}return i?t.rings=r:t.paths=r,t}class x{constructor(t,e){this.extent=t,this.frameIds=e}}const b=(0,r.vt)();class w{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,e){let s;if(this._xCut=e,t.rings)this._closed=!0,s=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,s=t.paths,this._minPts=2}for(const t of s){if(!t||t.length<this._minPts)continue;let e=!0;for(const s of t)e?(this.moveTo(s),e=!1):this.lineTo(s);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const t of this._linesIn)t&&t.length>=this._minPts&&s.push(t);const i=-2*this._xCut;for(const t of this._linesOut)if(t&&t.length>=this._minPts){for(const e of t)e[0]+=i;s.push(t)}return this._closed?t.rings=s:t.paths=s,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const e=this._side(t[0]);if(e*this._prevSide===-1){const s=this._intersect(this._prevPt,t);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(t[0],t[1],e)}else this._lineTo(t[0],t[1],e);this._prevSide=e,this._prevPt=t}close(){const t=this._firstPt,e=this._prevPt;t[0]===e[0]&&t[1]===e[1]||this.lineTo(t),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(t,e,s){this._closed?(this._lineIn.push([s<=0?t:this._xCut,e]),this._lineOut.push([s>=0?t:this._xCut,e])):(s<=0&&this._lineIn.push([t,e]),s>=0&&this._lineOut.push([t,e]))}_lineTo(t,e,s){this._closed?(v(this._lineIn,s<=0?t:this._xCut,e),v(this._lineOut,s>=0?t:this._xCut,e)):s<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([t,e])):s>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([t,e])):this._prevSide<0?(this._lineIn.push([t,e]),this._lineOut.push([t,e])):this._prevSide>0&&(this._lineOut.push([t,e]),this._lineIn.push([t,e]))}_checkClosingPt(t){const e=t.length;e>3&&t[0][0]===this._xCut&&t[e-2][0]===this._xCut&&t[1][0]===this._xCut&&(t[0][1]=t[e-2][1],t.pop())}_side(t){return t<this._xCut?-1:t>this._xCut?1:0}_intersect(t,e){const s=(this._xCut-t[0])/(e[0]-t[0]);return t[1]+s*(e[1]-t[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function v(t,e,s){const i=t.length;i>1&&t[i-1][0]===e&&t[i-2][0]===e?t[i-1][1]=s:t.push([e,s])}}}]);