@arcgis/core 5.1.0-next.64 → 5.1.0-next.66

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 (802) hide show
  1. package/Camera.d.ts +1 -1
  2. package/Ground.d.ts +7 -7
  3. package/PopupTemplate.d.ts +8 -8
  4. package/WebDocument2D.js +1 -1
  5. package/WebScene.d.ts +1 -1
  6. package/WebScene.js +1 -1
  7. package/analysis/AreaMeasurementAnalysis.d.ts +1 -1
  8. package/analysis/DirectLineMeasurementAnalysis.d.ts +1 -1
  9. package/analysis/LengthDimension.d.ts +4 -4
  10. package/analysis/ShadowCastAnalysis.d.ts +3 -3
  11. package/analysis/SliceAnalysis.d.ts +1 -1
  12. package/analysis/SlicePlane.d.ts +1 -1
  13. package/applications/Components/featureUtils.d.ts +24 -0
  14. package/applications/Components/featureUtils.js +1 -1
  15. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +11 -1
  16. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  17. package/applications/WebEditor/drawToolZSnapping.d.ts +17 -0
  18. package/applications/WebEditor/drawToolZSnapping.js +2 -0
  19. package/arcade/Dictionary.js +1 -1
  20. package/arcade/Feature.js +1 -1
  21. package/arcade/Pixel.js +1 -1
  22. package/arcade/Voxel.js +1 -1
  23. package/arcade/geometry/wkt.js +1 -1
  24. package/assets/esri/core/workers/RemoteClient.js +1 -1
  25. package/assets/esri/core/workers/chunks/01be1315c60810651783.js +1 -0
  26. package/assets/esri/core/workers/chunks/02e8fc598ee09cf1b678.js +1 -0
  27. package/assets/esri/core/workers/chunks/0d650b0d090a425c9c18.js +1 -0
  28. package/assets/esri/core/workers/chunks/0e90e9ea1ad587eb3495.js +1 -0
  29. package/assets/esri/core/workers/chunks/0f196ec93925dfefc69a.js +1 -0
  30. package/assets/esri/core/workers/chunks/12294f8c32c34788b6de.js +1 -0
  31. package/assets/esri/core/workers/chunks/13a8346abe5509167578.js +1 -0
  32. package/assets/esri/core/workers/chunks/1515824f11ef5ab95378.js +1 -0
  33. package/assets/esri/core/workers/chunks/151c2766a4cacc6adbd6.js +1 -0
  34. package/assets/esri/core/workers/chunks/155f57fe9886ef322e2a.js +1 -0
  35. package/assets/esri/core/workers/chunks/170f4d83555d238e365b.js +1 -0
  36. package/assets/esri/core/workers/chunks/171cca726a763c770469.js +1 -0
  37. package/assets/esri/core/workers/chunks/17445fd8048966617d49.js +1 -0
  38. package/assets/esri/core/workers/chunks/1761dc5799850ca7b66c.js +1 -0
  39. package/assets/esri/core/workers/chunks/17d54e77001ccb48a258.js +1 -0
  40. package/assets/esri/core/workers/chunks/19afacc9a741038e4bfb.js +1 -0
  41. package/assets/esri/core/workers/chunks/1d8777266fb1c5cfca55.js +1 -0
  42. package/assets/esri/core/workers/chunks/1f16bc8c02d8c4b2f693.js +1 -0
  43. package/assets/esri/core/workers/chunks/1f76c06af4682c85bc21.js +1 -0
  44. package/assets/esri/core/workers/chunks/{9eef3cd5f519c8ae88c0.js → 205e957ffd7e95f530f7.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{fa6e1ad099b43a6f5501.js → 21a8e2a11ffacc226e2b.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{811b378fa5bf8a4d3d66.js → 224461c1d9755966d0b6.js} +1 -1
  47. package/assets/esri/core/workers/chunks/27262083d37fe623ca9c.js +1 -0
  48. package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +1 -0
  49. package/assets/esri/core/workers/chunks/2a65bbe6c63c384cbf5f.js +1 -0
  50. package/assets/esri/core/workers/chunks/2fa69ca3ba8c442dd7d6.js +1 -0
  51. package/assets/esri/core/workers/chunks/314140e2e9b813191907.js +1 -0
  52. package/assets/esri/core/workers/chunks/32e22d6eee9fed1f70b0.js +1 -0
  53. package/assets/esri/core/workers/chunks/{af40e2e6eaf3d2226812.js → 3464a38e758c687a28d4.js} +1 -1
  54. package/assets/esri/core/workers/chunks/38816f95e801f1c5bbad.js +1 -0
  55. package/assets/esri/core/workers/chunks/3f8e8f83ebda07d29ca8.js +1 -0
  56. package/assets/esri/core/workers/chunks/41396724040180d2537f.js +1 -0
  57. package/assets/esri/core/workers/chunks/{66baacbef23291eab853.js → 413d2fa54508e6f42c74.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{32e9e92bbbd000fbbaf7.js → 4141a3a93732996601e8.js} +2 -2
  59. package/assets/esri/core/workers/chunks/41e59d75ccb51a238739.js +1 -0
  60. package/assets/esri/core/workers/chunks/44016e1176629c36bc11.js +1 -0
  61. package/assets/esri/core/workers/chunks/468c70e5fdb61dfaad80.js +1 -0
  62. package/assets/esri/core/workers/chunks/4d069a0ebadb9c53b550.js +1 -0
  63. package/assets/esri/core/workers/chunks/4e7b084f7104deea1ddb.js +1 -0
  64. package/assets/esri/core/workers/chunks/{9c72127de7afcbaafbaf.js → 51852ef71ac04954fdae.js} +1 -1
  65. package/assets/esri/core/workers/chunks/549a51dedcc49f366e53.js +1 -0
  66. package/assets/esri/core/workers/chunks/{42e084704dea6e4135b6.js → 54c0306082d30d59cba2.js} +1 -1
  67. package/assets/esri/core/workers/chunks/56036327e721f9c42b33.js +1 -0
  68. package/assets/esri/core/workers/chunks/57cdd5d4ae073d5ca725.js +1 -0
  69. package/assets/esri/core/workers/chunks/5b9257c5359fa05f4f28.js +1 -0
  70. package/assets/esri/core/workers/chunks/5d574079f0e96e883aab.js +1 -0
  71. package/assets/esri/core/workers/chunks/5d967bcf71c05ddb1ab6.js +1 -0
  72. package/assets/esri/core/workers/chunks/5fccb372b4d5ee2f64cc.js +1 -0
  73. package/assets/esri/core/workers/chunks/61778185d702da468b00.js +1 -0
  74. package/assets/esri/core/workers/chunks/61794a861a9209b72622.js +1 -0
  75. package/assets/esri/core/workers/chunks/61b49cdaf288f36f9288.js +1 -0
  76. package/assets/esri/core/workers/chunks/{8ea67b502f9355dab7e9.js → 621ea864e2774f160d1c.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{9d289cee96e7c7fe1029.js → 62a2da0ffc67f98445c1.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{254898b41cabe313b6ce.js → 62d96b012c2d6f601863.js} +1 -1
  79. package/assets/esri/core/workers/chunks/644dd906bee3ef465ec0.js +1 -0
  80. package/assets/esri/core/workers/chunks/66692d6edc1bd96645e2.js +1 -0
  81. package/assets/esri/core/workers/chunks/679086351352756b33c9.js +1 -0
  82. package/assets/esri/core/workers/chunks/681e97ebbf9c69c410c6.js +1 -0
  83. package/assets/esri/core/workers/chunks/69520cad347947b09f21.js +1 -0
  84. package/assets/esri/core/workers/chunks/{c86b15f6a18880f921cd.js → 6a567755b67c06d16f21.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{fdf4c1f202cfddf0f226.js → 6d11ec355e5474b2968b.js} +1 -1
  86. package/assets/esri/core/workers/chunks/6e7bb6d3e739527116a4.js +1 -0
  87. package/assets/esri/core/workers/chunks/751f3cfb000045ac78bb.js +1 -0
  88. package/assets/esri/core/workers/chunks/{64ad6130de549083caba.js → 789357e0f79823f145dd.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{b6d94cbd1c5adad2f247.js → 78fbfc03d9b827c3f767.js} +1 -1
  90. package/assets/esri/core/workers/chunks/79df97e3f5975b42dc4d.js +1 -0
  91. package/assets/esri/core/workers/chunks/{25e4568a3ff76f48ac5e.js → 7a56c836c89a8b978800.js} +1 -1
  92. package/assets/esri/core/workers/chunks/7e97684e851274efd11f.js +1 -0
  93. package/assets/esri/core/workers/chunks/7e9b790fe01b89acdf6d.js +1 -0
  94. package/assets/esri/core/workers/chunks/7fb9a5bc22d7581f1d20.js +1 -0
  95. package/assets/esri/core/workers/chunks/{5c1abb46b9937a050c32.js → 7ffcd308087c35adda04.js} +1 -1
  96. package/assets/esri/core/workers/chunks/84eb889b9cce35dac2e5.js +1 -0
  97. package/assets/esri/core/workers/chunks/891d97d0da6361d63679.js +1 -0
  98. package/assets/esri/core/workers/chunks/8a0f254d45d00b293479.js +1 -0
  99. package/assets/esri/core/workers/chunks/8ede12f54b215c52cf3c.js +1 -0
  100. package/assets/esri/core/workers/chunks/8fed6becd107d2ed9bbd.js +1 -0
  101. package/assets/esri/core/workers/chunks/90cef6f96df7dc27db39.js +1 -0
  102. package/assets/esri/core/workers/chunks/921c30b7f4dfc3e018d9.js +1 -0
  103. package/assets/esri/core/workers/chunks/927773ed23b1fc245bf7.js +1 -0
  104. package/assets/esri/core/workers/chunks/{b056b4c79bcd542dd1d2.js → 9622a83b29acb768fcb5.js} +1 -1
  105. package/assets/esri/core/workers/chunks/97062996e1e4196cfa7c.js +1 -0
  106. package/assets/esri/core/workers/chunks/97210bcb5e3cf3ac961b.js +1 -0
  107. package/assets/esri/core/workers/chunks/{f550fc8c078ebd47d7a3.js → 97e15e66e55d9149fd48.js} +1 -1
  108. package/assets/esri/core/workers/chunks/9c819ebdc98ed8b6afcf.js +1 -0
  109. package/assets/esri/core/workers/chunks/9dfd00972c12a4adc15d.js +1 -0
  110. package/assets/esri/core/workers/chunks/9fab410b9fa668dc498b.js +1 -0
  111. package/assets/esri/core/workers/chunks/a118de5a163ae42bee60.js +1 -0
  112. package/assets/esri/core/workers/chunks/a4b6fdbc995be03d2afb.js +1 -0
  113. package/assets/esri/core/workers/chunks/a59db907ec1e31002100.js +1 -0
  114. package/assets/esri/core/workers/chunks/a5b395e518e4c5fc95d0.js +1414 -0
  115. package/assets/esri/core/workers/chunks/a5d9dbb1fef8c4465943.js +1 -0
  116. package/assets/esri/core/workers/chunks/{62c2757f5dc4aaca2df8.js → a73e8b80760dc88f926f.js} +1 -1
  117. package/assets/esri/core/workers/chunks/a96692514dcaa50340dd.js +1 -0
  118. package/assets/esri/core/workers/chunks/b4fb4484fa39eede1f62.js +1 -0
  119. package/assets/esri/core/workers/chunks/b50a42a9f96515beb929.js +1 -0
  120. package/assets/esri/core/workers/chunks/b8acb6c2538053c01cc6.js +1 -0
  121. package/assets/esri/core/workers/chunks/b8bf3e8b8b870f69f231.js +1 -0
  122. package/assets/esri/core/workers/chunks/b8e85b7d5eed6e7c79b5.js +1 -0
  123. package/assets/esri/core/workers/chunks/{fd629a3ab558adf52617.js → bc2c7cb99e227ddbd3a6.js} +1 -1
  124. package/assets/esri/core/workers/chunks/bc85bb82cfcbc216fa31.js +1 -0
  125. package/assets/esri/core/workers/chunks/{354351ab3fc79dedf9a8.js → bcb8a25438c66815e37a.js} +1 -1
  126. package/assets/esri/core/workers/chunks/be1e4c3ec53fc92a26f1.js +1 -0
  127. package/assets/esri/core/workers/chunks/be4d13088a557b7de4b1.js +1 -0
  128. package/assets/esri/core/workers/chunks/bf758d57091fa534c1f8.js +1 -0
  129. package/assets/esri/core/workers/chunks/bfd516c37fb717e14d71.js +1 -0
  130. package/assets/esri/core/workers/chunks/c22945637a40355fbe61.js +1 -0
  131. package/assets/esri/core/workers/chunks/c25a58d9f94aaa96957d.js +1 -0
  132. package/assets/esri/core/workers/chunks/c4e936879c6cb25cf586.js +1 -0
  133. package/assets/esri/core/workers/chunks/c6a43f748dbf8bac4bb5.js +1 -0
  134. package/assets/esri/core/workers/chunks/cb9185ed31109781fe59.js +1 -0
  135. package/assets/esri/core/workers/chunks/d21fdd67477800101f3b.js +1 -0
  136. package/assets/esri/core/workers/chunks/d264aed5dbe09e34040f.js +1 -0
  137. package/assets/esri/core/workers/chunks/d315098b038a96084ff5.js +1 -0
  138. package/assets/esri/core/workers/chunks/d4465fd3319d0b6a26cc.js +1 -0
  139. package/assets/esri/core/workers/chunks/{13eb0162d95b4d27389c.js → d598d08dbf2796742e8c.js} +1 -1
  140. package/assets/esri/core/workers/chunks/d5c7ebfd5c2ca635a7a8.js +1 -0
  141. package/assets/esri/core/workers/chunks/{d4368e281c12fa7c17c5.js → d635f97b7b82a37482d6.js} +1 -1
  142. package/assets/esri/core/workers/chunks/d7b92bd9198dd3b27eb5.js +1 -0
  143. package/assets/esri/core/workers/chunks/d83ac66478a419e08af6.js +1 -0
  144. package/assets/esri/core/workers/chunks/d8dde0d1759e009b8373.js +1 -0
  145. package/assets/esri/core/workers/chunks/d94dfb2ce31e59b3306b.js +1 -0
  146. package/assets/esri/core/workers/chunks/{8166ad6bbd7d7a8f91cf.js → deddf6ae4498a3d0d0e5.js} +1 -1
  147. package/assets/esri/core/workers/chunks/{45f1e682668cffc00b44.js → e0df7554b1679168663d.js} +1 -1
  148. package/assets/esri/core/workers/chunks/e0fcb5fa0e9f21fde2b6.js +1 -0
  149. package/assets/esri/core/workers/chunks/e305ced975d885c28e7e.js +1 -0
  150. package/assets/esri/core/workers/chunks/e3c60b7df2740e600066.js +1 -0
  151. package/assets/esri/core/workers/chunks/e611cd03eee4fae7c413.js +1 -0
  152. package/assets/esri/core/workers/chunks/e64a92b6f4075616f40f.js +1 -0
  153. package/assets/esri/core/workers/chunks/e78b442417f6a903b9b1.js +1 -0
  154. package/assets/esri/core/workers/chunks/{ba72989749543122a6fe.js → e9f2b573f482718306e6.js} +1 -1
  155. package/assets/esri/core/workers/chunks/ea6d3b7c7d720aa7bc94.js +1 -0
  156. package/assets/esri/core/workers/chunks/eab1b45ab5a802e29f8c.js +1 -0
  157. package/assets/esri/core/workers/chunks/eb7392799a01c2a8497a.js +1 -0
  158. package/assets/esri/core/workers/chunks/{c17c3453d014dc73fe0b.js → ef013a77950c1902de11.js} +1 -1
  159. package/assets/esri/core/workers/chunks/ef0fe4e1a9e960a74c60.js +1 -0
  160. package/assets/esri/core/workers/chunks/efbbcf467b2a27a92b85.js +1 -0
  161. package/assets/esri/core/workers/chunks/f201edf9b68717a6106d.js +1 -0
  162. package/assets/esri/core/workers/chunks/f43a63094190d2074cd0.js +1 -0
  163. package/assets/esri/core/workers/chunks/f59f1db572be1f19887f.js +1 -0
  164. package/assets/esri/core/workers/chunks/{dc07dc1cd30edc0c4193.js → f62e42659b406435573d.js} +1 -1
  165. package/assets/esri/core/workers/chunks/fa160a2a5dc9f5a7c34b.js +1 -0
  166. package/assets/esri/core/workers/chunks/fa7ae035472540999721.js +1 -0
  167. package/assets/esri/core/workers/chunks/fe3b42eadcdd9ba54f05.js +1 -0
  168. package/assets/esri/core/workers/chunks/fee31d9297648219375d.js +1 -0
  169. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
  170. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
  171. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
  172. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
  173. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
  174. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
  175. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
  176. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
  177. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
  178. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
  179. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
  180. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
  181. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
  182. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
  183. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
  184. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
  185. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
  186. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
  187. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
  188. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
  189. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
  190. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
  191. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
  192. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
  193. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
  194. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
  195. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
  196. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
  197. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
  198. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
  199. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
  200. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
  201. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
  202. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
  203. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
  204. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
  205. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
  206. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
  207. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
  208. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  209. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  210. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  211. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  212. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  213. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  214. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  215. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  216. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  217. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  218. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  219. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  220. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  221. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  222. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  223. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  224. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  225. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  226. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  227. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  228. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  229. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  230. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  231. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  232. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  233. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  234. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  235. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  236. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  237. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  238. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  239. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  240. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  241. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  242. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  243. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  244. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  245. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  246. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  247. package/chunks/ComponentShader.glsl.js +1 -1
  248. package/chunks/DefaultMaterial.glsl.js +1 -1
  249. package/chunks/GaussianSplat.glsl.js +14 -2
  250. package/chunks/OITDim.glsl.js +3 -2
  251. package/chunks/Path.glsl.js +1 -1
  252. package/chunks/RealisticTree.glsl.js +1 -1
  253. package/chunks/ShadowCastAccumulate.glsl.js +2 -2
  254. package/chunks/ShadowHighlight.glsl.js +3 -3
  255. package/chunks/ShadowHighlightBuffer.glsl.js +1 -1
  256. package/chunks/Terrain.glsl.js +1 -1
  257. package/chunks/Water.glsl.js +1 -1
  258. package/config.js +1 -1
  259. package/core/timeUtils.js +1 -1
  260. package/core/workers/Connection.js +1 -1
  261. package/effects/FocusAreas.d.ts +1 -1
  262. package/form/elements/FieldElement.d.ts +3 -3
  263. package/form/elements/GroupElement.d.ts +1 -1
  264. package/form/elements/TextElement.d.ts +1 -1
  265. package/form/elements/inputs/ComboBoxInput.d.ts +1 -1
  266. package/form/elements/inputs/DateTimeOffsetPickerInput.d.ts +1 -1
  267. package/form/elements/inputs/DateTimeOffsetPickerInput.js +1 -1
  268. package/form/elements/inputs/Input.d.ts +1 -1
  269. package/form/elements/inputs/RadioButtonsInput.d.ts +1 -1
  270. package/form/elements/inputs/SwitchInput.d.ts +1 -1
  271. package/form/elements/inputs/inputUtils.js +1 -1
  272. package/form/elements/inputs.js +1 -1
  273. package/geometry/Mesh.d.ts +7 -7
  274. package/geometry/operators/alphaShapeOperator.d.ts +1 -1
  275. package/geometry/operators/areaOperator.d.ts +1 -1
  276. package/geometry/operators/bufferOperator.d.ts +1 -1
  277. package/geometry/operators/centroidOperator.d.ts +1 -1
  278. package/geometry/operators/clipOperator.d.ts +1 -1
  279. package/geometry/operators/containsOperator.d.ts +1 -1
  280. package/geometry/operators/convexHullOperator.d.ts +1 -1
  281. package/geometry/operators/crossesOperator.d.ts +1 -1
  282. package/geometry/operators/cutOperator.d.ts +1 -1
  283. package/geometry/operators/densifyOperator.d.ts +1 -1
  284. package/geometry/operators/differenceOperator.d.ts +1 -1
  285. package/geometry/operators/disjointOperator.d.ts +1 -1
  286. package/geometry/operators/distanceOperator.d.ts +1 -1
  287. package/geometry/operators/generalizeOperator.d.ts +1 -1
  288. package/geometry/operators/geodesicProximityOperator.d.ts +1 -1
  289. package/geometry/operators/geodeticDistanceOperator.d.ts +1 -1
  290. package/geometry/operators/geodeticUtilsOperator.d.ts +2 -2
  291. package/geometry/operators/graphicBufferOperator.d.ts +1 -1
  292. package/geometry/operators/intersectionOperator.d.ts +1 -1
  293. package/geometry/operators/intersectsOperator.d.ts +1 -1
  294. package/geometry/operators/isNearOperator.d.ts +1 -1
  295. package/geometry/operators/lengthOperator.d.ts +1 -1
  296. package/geometry/operators/locateBetweenOperator.d.ts +1 -1
  297. package/geometry/operators/multiPartToSinglePartOperator.d.ts +1 -1
  298. package/geometry/operators/offsetOperator.d.ts +5 -5
  299. package/geometry/operators/overlapsOperator.d.ts +1 -1
  300. package/geometry/operators/proximityOperator.d.ts +1 -1
  301. package/geometry/operators/simplifyOGCOperator.d.ts +1 -1
  302. package/geometry/operators/simplifyOperator.d.ts +1 -1
  303. package/geometry/operators/support/Transformation.d.ts +6 -6
  304. package/geometry/operators/symmetricDifferenceOperator.d.ts +1 -1
  305. package/geometry/operators/touchesOperator.d.ts +1 -1
  306. package/geometry/operators/unionOperator.d.ts +1 -1
  307. package/geometry/operators/withinOperator.d.ts +1 -1
  308. package/geometry/support/MeshMaterialMetallicRoughness.d.ts +1 -1
  309. package/geometry/support/spatialReferenceUtils.js +1 -1
  310. package/geometry/support/vcsData.js +2 -0
  311. package/geometry/support/vcsLookup.js +2 -0
  312. package/interfaces.d.ts +4 -2
  313. package/intl.js +1 -1
  314. package/kernel.js +1 -1
  315. package/layers/BuildingSceneLayer.d.ts +4 -4
  316. package/layers/CSVLayer.d.ts +2 -2
  317. package/layers/CatalogLayer.d.ts +2 -2
  318. package/layers/ElevationLayer.d.ts +1 -1
  319. package/layers/FeatureLayer.d.ts +9 -2
  320. package/layers/FeatureLayer.js +1 -1
  321. package/layers/GeoJSONLayer.d.ts +2 -2
  322. package/layers/GeoRSSLayer.d.ts +1 -1
  323. package/layers/GraphicsLayer.d.ts +2 -2
  324. package/layers/ImageryLayer.d.ts +3 -3
  325. package/layers/ImageryTileLayer.d.ts +2 -2
  326. package/layers/IntegratedMesh3DTilesLayer.d.ts +6 -6
  327. package/layers/IntegratedMeshLayer.d.ts +7 -7
  328. package/layers/MapImageLayer.d.ts +1 -1
  329. package/layers/MediaLayer.d.ts +1 -1
  330. package/layers/OGCFeatureLayer.d.ts +2 -2
  331. package/layers/PointCloudLayer.d.ts +1 -1
  332. package/layers/SceneLayer.d.ts +9 -9
  333. package/layers/StreamLayer.d.ts +2 -2
  334. package/layers/SubtypeGroupLayer.js +1 -1
  335. package/layers/VectorTileLayer.d.ts +2 -2
  336. package/layers/VideoLayer.d.ts +1 -1
  337. package/layers/VoxelLayer.d.ts +8 -8
  338. package/layers/VoxelWasmPerSceneView.js +1 -1
  339. package/layers/WFSLayer.d.ts +6 -6
  340. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
  341. package/layers/graphics/data/AttributesBuilder.js +1 -1
  342. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  343. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  344. package/layers/mixins/ArcGISImageService.js +1 -1
  345. package/layers/mixins/BlendLayer.d.ts +6 -6
  346. package/layers/pointCloudFilters/PointCloudReturnFilter.d.ts +1 -1
  347. package/layers/pointCloudFilters/PointCloudValueFilter.d.ts +1 -1
  348. package/layers/support/DimensionalDefinition.d.ts +2 -2
  349. package/layers/support/FeatureEffect.d.ts +4 -4
  350. package/layers/support/FeatureFilter.d.ts +17 -17
  351. package/layers/support/FeatureReductionBinning.d.ts +1 -1
  352. package/layers/support/FeatureReductionCluster.d.ts +9 -9
  353. package/layers/support/FeatureReductionSelection.d.ts +1 -1
  354. package/layers/support/LabelClass.d.ts +2 -2
  355. package/layers/support/RasterFunction.d.ts +1 -1
  356. package/layers/support/SceneFilter.d.ts +2 -2
  357. package/layers/support/SceneModification.d.ts +3 -3
  358. package/layers/support/SymbolLayerDrawing.d.ts +15 -0
  359. package/layers/support/SymbolLayerDrawing.js +2 -0
  360. package/layers/support/capabilities.js +1 -1
  361. package/layers/support/featureLayerUtils.js +1 -1
  362. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  363. package/layers/types.d.ts +6 -0
  364. package/networks/support/jsonTypes.d.ts +36 -11
  365. package/package.json +4 -4
  366. package/popup/Feature.d.ts +20 -10
  367. package/popup/Feature.js +1 -1
  368. package/popup/Features.d.ts +82 -227
  369. package/popup/Features.js +1 -1
  370. package/popup/content/AttachmentsContent.d.ts +1 -1
  371. package/popup/content/BarChartMediaInfo.d.ts +1 -1
  372. package/popup/content/ColumnChartMediaInfo.d.ts +1 -1
  373. package/popup/content/FieldsContent.d.ts +1 -1
  374. package/popup/content/ImageMediaInfo.d.ts +1 -1
  375. package/popup/content/LineChartMediaInfo.d.ts +1 -1
  376. package/popup/content/MediaContent.d.ts +1 -1
  377. package/popup/content/PieChartMediaInfo.d.ts +1 -1
  378. package/popup/content/RelationshipContent.d.ts +1 -1
  379. package/popup/content/TextContent.d.ts +1 -1
  380. package/popup/support/FeatureAbilities.d.ts +45 -9
  381. package/popup/support/featureUtils.js +1 -1
  382. package/popup/types.d.ts +126 -8
  383. package/portal/schemas/definitions.js +1 -1
  384. package/renderers/ClassBreaksRenderer.d.ts +1 -1
  385. package/renderers/DictionaryRenderer.d.ts +1 -1
  386. package/renderers/DotDensityRenderer.d.ts +3 -3
  387. package/renderers/FlowRenderer.d.ts +5 -5
  388. package/renderers/HeatmapRenderer.d.ts +3 -3
  389. package/renderers/PieChartRenderer.d.ts +1 -1
  390. package/renderers/RasterShadedReliefRenderer.d.ts +1 -1
  391. package/renderers/Renderer.d.ts +4 -4
  392. package/renderers/SimpleRenderer.d.ts +2 -2
  393. package/renderers/UniqueValueRenderer.d.ts +2 -2
  394. package/renderers/VectorFieldRenderer.d.ts +1 -1
  395. package/renderers/mixins/VisualVariablesMixin.d.ts +12 -12
  396. package/renderers/visualVariables/ColorVariable.d.ts +1 -1
  397. package/renderers/visualVariables/OpacityVariable.d.ts +1 -1
  398. package/renderers/visualVariables/RotationVariable.d.ts +1 -1
  399. package/renderers/visualVariables/SizeVariable.d.ts +1 -1
  400. package/renderers/visualVariables/VisualVariable.d.ts +1 -1
  401. package/rest/query/support/AttachmentInfo.d.ts +1 -1
  402. package/rest/support/AttributeBinsQuery.d.ts +8 -8
  403. package/rest/support/AutoIntervalBinParameters.d.ts +1 -1
  404. package/rest/support/DateBinParameters.d.ts +1 -1
  405. package/rest/support/FixedBoundariesBinParameters.d.ts +1 -1
  406. package/rest/support/FixedIntervalBinParameters.d.ts +1 -1
  407. package/rest/support/Query.d.ts +8 -8
  408. package/rest/support/TopFeaturesQuery.d.ts +8 -8
  409. package/smartMapping/labels/clusters.d.ts +1 -1
  410. package/smartMapping/popup/clusters.d.ts +2 -2
  411. package/smartMapping/popup/templates.d.ts +1 -1
  412. package/smartMapping/raster/renderers/flow.d.ts +2 -2
  413. package/smartMapping/renderers/color.d.ts +12 -12
  414. package/smartMapping/renderers/predominance.d.ts +3 -3
  415. package/smartMapping/renderers/relationship.d.ts +15 -15
  416. package/smartMapping/renderers/univariateColorSize.d.ts +4 -4
  417. package/smartMapping/statistics/support/utils.js +1 -1
  418. package/smartMapping/support/adapters/support/utils.js +1 -1
  419. package/smartMapping/symbology/color.d.ts +4 -4
  420. package/smartMapping/symbology/flow.d.ts +2 -2
  421. package/smartMapping/symbology/types.d.ts +18 -18
  422. package/support/actions/ActionButton.d.ts +1 -1
  423. package/support/basemapDefinitions.js +1 -1
  424. package/support/revision.js +1 -1
  425. package/symbols/CIMSymbol.d.ts +1 -1
  426. package/symbols/ExtrudeSymbol3DLayer.d.ts +1 -1
  427. package/symbols/FillSymbol3DLayer.d.ts +3 -3
  428. package/symbols/IconSymbol3DLayer.d.ts +1 -1
  429. package/symbols/LabelSymbol3D.d.ts +2 -2
  430. package/symbols/LineStyleMarker3D.d.ts +7 -7
  431. package/symbols/LineSymbol3D.d.ts +2 -2
  432. package/symbols/LineSymbol3DLayer.d.ts +7 -7
  433. package/symbols/LineSymbolMarker.d.ts +6 -6
  434. package/symbols/MarkerSymbol.d.ts +1 -1
  435. package/symbols/MeshSymbol3D.d.ts +2 -2
  436. package/symbols/ObjectSymbol3DLayer.d.ts +1 -1
  437. package/symbols/PathSymbol3DLayer.d.ts +14 -14
  438. package/symbols/PictureFillSymbol.d.ts +1 -1
  439. package/symbols/PictureMarkerSymbol.d.ts +1 -1
  440. package/symbols/PointSymbol3D.d.ts +3 -3
  441. package/symbols/PolygonSymbol3D.d.ts +5 -5
  442. package/symbols/SimpleFillSymbol.d.ts +8 -8
  443. package/symbols/SimpleLineSymbol.d.ts +20 -20
  444. package/symbols/SimpleMarkerSymbol.d.ts +7 -7
  445. package/symbols/Symbol3DLayer.d.ts +16 -16
  446. package/symbols/TextSymbol.d.ts +1 -1
  447. package/symbols/TextSymbol3DLayer.d.ts +1 -1
  448. package/symbols/WaterSymbol3DLayer.d.ts +3 -3
  449. package/symbols/WebStyleSymbol.d.ts +12 -12
  450. package/symbols/callouts/Callout3D.d.ts +1 -1
  451. package/symbols/callouts/LineCallout3D.d.ts +3 -3
  452. package/symbols/cim/cimAnalyzer.js +1 -1
  453. package/symbols/cim/types.d.ts +29 -23
  454. package/symbols/edges/Edges3D.d.ts +1 -1
  455. package/symbols/edges/SolidEdges3D.d.ts +1 -1
  456. package/symbols/patterns/LineStylePattern3D.d.ts +11 -11
  457. package/symbols/patterns/StylePattern3D.d.ts +8 -8
  458. package/symbols/support/ElevationInfo.d.ts +2 -2
  459. package/symbols/support/IconSymbol3DLayerResource.d.ts +6 -6
  460. package/symbols/support/ObjectSymbol3DLayerResource.d.ts +7 -7
  461. package/symbols/support/Symbol3DEmissive.d.ts +2 -2
  462. package/symbols/support/Symbol3DVerticalOffset.d.ts +2 -2
  463. package/views/2d/engine/Stage.js +1 -1
  464. package/views/2d/engine/flow/FlowStrategy.js +1 -1
  465. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  466. package/views/2d/engine/flow/styles/Particles.js +1 -1
  467. package/views/2d/engine/flow/styles/Stack.js +1 -1
  468. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  469. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  470. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  471. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  472. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  473. package/views/2d/engine/webgl/Painter.js +1 -1
  474. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  475. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  476. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  477. package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
  478. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  479. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  480. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  481. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  482. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
  483. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
  484. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  485. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  486. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  487. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  488. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  489. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  490. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  491. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  492. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  493. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  494. package/views/2d/layers/BaseLayerViewGL2D.d.ts +2 -2
  495. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  496. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  497. package/views/2d/layers/features/FeatureContainer.js +1 -1
  498. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  499. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  500. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  501. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  502. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  503. package/views/2d/layers/support/DisplayGL.js +1 -1
  504. package/views/2d/types.d.ts +3 -3
  505. package/views/3d/FocusAreasView.js +1 -1
  506. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  507. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  508. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  509. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  510. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  511. package/views/3d/environment/CloudyWeather.d.ts +1 -1
  512. package/views/3d/environment/Environment.d.ts +4 -4
  513. package/views/3d/environment/FoggyWeather.d.ts +1 -1
  514. package/views/3d/environment/RainyWeather.d.ts +1 -1
  515. package/views/3d/environment/SnowyWeather.d.ts +1 -1
  516. package/views/3d/environment/SunLighting.d.ts +1 -1
  517. package/views/3d/environment/SunnyWeather.d.ts +1 -1
  518. package/views/3d/environment/VirtualLighting.d.ts +1 -1
  519. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  520. package/views/3d/layers/graphics/extrudeUtils.js +1 -1
  521. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  522. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  523. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  524. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  525. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  526. package/views/3d/webgl/ManagedFBO.js +1 -1
  527. package/views/3d/webgl/RenderNode.d.ts +2 -2
  528. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  529. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  530. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +18 -5
  531. package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +2 -2
  532. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +2 -2
  533. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +1 -1
  534. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  535. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  536. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  537. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  538. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  539. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  540. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  541. package/views/3d/webgl-engine/effects/transparency/OITDim.glsl.js +1 -1
  542. package/views/3d/webgl-engine/effects/transparency/OITDimTechniqueConfiguration.js +2 -0
  543. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  544. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  545. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  546. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  547. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  548. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  549. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  550. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  551. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  552. package/views/3d/webgl.d.ts +1 -1
  553. package/views/Magnifier.d.ts +3 -3
  554. package/views/MapView.d.ts +7 -7
  555. package/views/SceneView.d.ts +16 -16
  556. package/views/View.d.ts +17 -3
  557. package/views/View.js +1 -1
  558. package/views/draw/DrawTool.js +1 -1
  559. package/views/draw/support/InteractiveHandle.js +1 -1
  560. package/views/draw/support/Reshape.js +1 -1
  561. package/views/draw/support/drawUtils.js +1 -1
  562. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  563. package/views/draw/support/types.d.ts +9 -1
  564. package/views/interactive/sketch/SketchLabelOptions.d.ts +1 -1
  565. package/views/interactive/sketch/SketchTooltipOptions.d.ts +1 -1
  566. package/views/interactive/snapping/SnappingOptions.d.ts +7 -7
  567. package/views/layers/FeatureLikeLayerView.js +1 -1
  568. package/views/layers/LineOfSightLayerView.d.ts +3 -2
  569. package/views/support/HighlightOptions.d.ts +1 -1
  570. package/views/support/imageReprojection.js +1 -1
  571. package/views/types.d.ts +59 -2
  572. package/views/ui/DefaultUI.d.ts +2 -2
  573. package/views/webgl/FramebufferObject.js +1 -1
  574. package/views/webgl/RenderingContext.js +1 -1
  575. package/views/webgl/Texture.js +1 -1
  576. package/views/webgl/testFloatBufferBlend.js +1 -1
  577. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  578. package/webscene/Environment.d.ts +10 -10
  579. package/webscene/Glow.d.ts +1 -1
  580. package/webscene/background/ColorBackground.d.ts +1 -1
  581. package/widgets/AreaMeasurement2D.d.ts +1 -1
  582. package/widgets/AreaMeasurement3D.d.ts +2 -2
  583. package/widgets/Attachments.d.ts +1 -1
  584. package/widgets/Attribution.d.ts +1 -1
  585. package/widgets/BasemapGallery.d.ts +1 -1
  586. package/widgets/BasemapLayerList.d.ts +3 -3
  587. package/widgets/BasemapToggle.d.ts +1 -1
  588. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  589. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  590. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  591. package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +1 -1
  592. package/widgets/Bookmarks.d.ts +2 -2
  593. package/widgets/BuildingExplorer.d.ts +1 -1
  594. package/widgets/CatalogLayerList.d.ts +3 -3
  595. package/widgets/Compass.d.ts +2 -2
  596. package/widgets/CoordinateConversion.d.ts +1 -1
  597. package/widgets/Daylight.d.ts +5 -5
  598. package/widgets/DirectLineMeasurement3D.d.ts +2 -2
  599. package/widgets/Directions.d.ts +4 -4
  600. package/widgets/DistanceMeasurement2D.d.ts +1 -1
  601. package/widgets/Editor/CreateFeaturesWorkflow.d.ts +1 -1
  602. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  603. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  604. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  605. package/widgets/Editor/UpdateWorkflow.js +1 -1
  606. package/widgets/Editor/Workflow.js +1 -1
  607. package/widgets/Editor.d.ts +8 -8
  608. package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +1 -1
  609. package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +1 -1
  610. package/widgets/ElevationProfile/ElevationProfileLineView.d.ts +1 -1
  611. package/widgets/ElevationProfile.d.ts +3 -3
  612. package/widgets/Expand.d.ts +1 -1
  613. package/widgets/Feature/FeatureViewModel.d.ts +14 -4
  614. package/widgets/Feature/FeatureViewModel.js +1 -1
  615. package/widgets/FeatureForm/FieldInput.js +1 -1
  616. package/widgets/FeatureForm.d.ts +1 -1
  617. package/widgets/FeatureTable/ActionColumn.d.ts +2 -2
  618. package/widgets/FeatureTable/AttachmentsColumn.d.ts +1 -1
  619. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +3 -3
  620. package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -1
  621. package/widgets/FeatureTable/RelationshipColumn.d.ts +1 -1
  622. package/widgets/FeatureTable/VisibleElements.d.ts +1 -1
  623. package/widgets/FeatureTable.d.ts +10 -10
  624. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.d.ts +5 -5
  625. package/widgets/FeatureTemplates.d.ts +8 -8
  626. package/widgets/Features/FeaturesViewModel.d.ts +18 -7
  627. package/widgets/Features/FeaturesViewModel.js +1 -1
  628. package/widgets/Features/FeaturesVisibleElements.d.ts +2 -2
  629. package/widgets/Features.d.ts +1 -1
  630. package/widgets/Features.js +1 -1
  631. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  632. package/widgets/FloorFilter.d.ts +2 -2
  633. package/widgets/Histogram.d.ts +2 -2
  634. package/widgets/HistogramRangeSlider.d.ts +1 -1
  635. package/widgets/Home.d.ts +1 -1
  636. package/widgets/LayerList/ListItemPanel.d.ts +1 -1
  637. package/widgets/LayerList.d.ts +4 -4
  638. package/widgets/Legend.d.ts +8 -8
  639. package/widgets/LineOfSight.d.ts +1 -1
  640. package/widgets/Locate.d.ts +2 -2
  641. package/widgets/Measurement.d.ts +1 -1
  642. package/widgets/NavigationToggle/NavigationToggleViewModel.d.ts +1 -1
  643. package/widgets/NavigationToggle.d.ts +3 -3
  644. package/widgets/Popup/PopupViewModel.d.ts +2 -1
  645. package/widgets/Popup/PopupViewModel.js +1 -1
  646. package/widgets/Popup/PopupVisibleElements.d.ts +2 -2
  647. package/widgets/Popup.d.ts +18 -9
  648. package/widgets/Popup.js +1 -1
  649. package/widgets/Print/CustomTemplate.d.ts +1 -1
  650. package/widgets/Print/TemplateOptions.d.ts +4 -4
  651. package/widgets/ScaleRangeSlider.d.ts +1 -1
  652. package/widgets/Search/SearchViewModel.d.ts +4 -4
  653. package/widgets/Search.d.ts +5 -5
  654. package/widgets/ShadowCast.d.ts +3 -3
  655. package/widgets/Sketch/SketchViewModel.d.ts +39 -39
  656. package/widgets/Sketch.d.ts +43 -43
  657. package/widgets/Slice.d.ts +2 -2
  658. package/widgets/Slider/SliderViewModel.d.ts +2 -2
  659. package/widgets/Slider.d.ts +9 -9
  660. package/widgets/Swipe/SwipeViewModel.d.ts +1 -1
  661. package/widgets/Swipe.d.ts +2 -2
  662. package/widgets/TableList/ListItemPanel.d.ts +1 -1
  663. package/widgets/TableList.d.ts +1 -1
  664. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +10 -10
  665. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  666. package/widgets/TimeSlider/types.d.ts +1 -1
  667. package/widgets/TimeSlider.d.ts +13 -13
  668. package/widgets/Track.d.ts +2 -2
  669. package/widgets/UtilityNetworkAssociations.d.ts +3 -3
  670. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  671. package/widgets/UtilityNetworkTrace.d.ts +4 -4
  672. package/widgets/UtilityNetworkValidateTopology.d.ts +1 -1
  673. package/widgets/ValuePicker.d.ts +5 -5
  674. package/widgets/VideoPlayer.d.ts +1 -1
  675. package/widgets/smartMapping/ClassedColorSlider.d.ts +1 -1
  676. package/widgets/smartMapping/ClassedSizeSlider.d.ts +1 -1
  677. package/widgets/smartMapping/ColorSizeSlider.d.ts +2 -2
  678. package/widgets/smartMapping/ColorSlider.d.ts +1 -1
  679. package/widgets/smartMapping/HeatmapSlider.d.ts +1 -1
  680. package/widgets/smartMapping/OpacitySlider.d.ts +1 -1
  681. package/widgets/smartMapping/SizeSlider.d.ts +1 -1
  682. package/widgets/smartMapping/SmartMappingSliderBase.d.ts +4 -4
  683. package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +6 -6
  684. package/widgets/support/GridControls.d.ts +1 -1
  685. package/widgets/support/SnappingControls/VisibleElements.d.ts +1 -1
  686. package/widgets/support/SnappingControls.d.ts +6 -6
  687. package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +0 -1
  688. package/assets/esri/core/workers/chunks/05c8d2c0362af4511d86.js +0 -1
  689. package/assets/esri/core/workers/chunks/06868e4f52de9d918255.js +0 -1
  690. package/assets/esri/core/workers/chunks/06c0b93e276cfc1fb7ac.js +0 -1
  691. package/assets/esri/core/workers/chunks/0888baa99c9007ad63bc.js +0 -1
  692. package/assets/esri/core/workers/chunks/0de66f13e84830a654fb.js +0 -1
  693. package/assets/esri/core/workers/chunks/0f597c690e5c60fe944b.js +0 -1
  694. package/assets/esri/core/workers/chunks/0f8736242544f9e9a57a.js +0 -1
  695. package/assets/esri/core/workers/chunks/0ff12fe9e358100668d9.js +0 -1
  696. package/assets/esri/core/workers/chunks/11a8541f3909f9ffb000.js +0 -1
  697. package/assets/esri/core/workers/chunks/13a009229c96ecb7b04f.js +0 -1
  698. package/assets/esri/core/workers/chunks/185f59f90070d5d6ac94.js +0 -1
  699. package/assets/esri/core/workers/chunks/190bc75254bc0542a6be.js +0 -1
  700. package/assets/esri/core/workers/chunks/1af247c86d1c4ae8fef3.js +0 -1
  701. package/assets/esri/core/workers/chunks/2339465190c9d5ede25f.js +0 -1
  702. package/assets/esri/core/workers/chunks/23eb204d3cb818adea32.js +0 -1
  703. package/assets/esri/core/workers/chunks/241ef4a1bea20b49d812.js +0 -1
  704. package/assets/esri/core/workers/chunks/2669a7195f1de21a9cf3.js +0 -1
  705. package/assets/esri/core/workers/chunks/2a2d5f9ea42cb2eee9c6.js +0 -1
  706. package/assets/esri/core/workers/chunks/2a7e7a497823e9f05aa3.js +0 -1
  707. package/assets/esri/core/workers/chunks/2aaeaf022af8493281dc.js +0 -1
  708. package/assets/esri/core/workers/chunks/2d92ba11781a3cfc3a78.js +0 -1
  709. package/assets/esri/core/workers/chunks/31e0bfc2cab055aebf9a.js +0 -1
  710. package/assets/esri/core/workers/chunks/32360a55d1836b2a737e.js +0 -1
  711. package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +0 -1
  712. package/assets/esri/core/workers/chunks/34acecd7a314fed12335.js +0 -1
  713. package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +0 -1
  714. package/assets/esri/core/workers/chunks/368b4c0a5eecbb06feac.js +0 -1
  715. package/assets/esri/core/workers/chunks/37729578a7c4cf15eded.js +0 -1
  716. package/assets/esri/core/workers/chunks/3af1e2f0b3d30c58d0c2.js +0 -1
  717. package/assets/esri/core/workers/chunks/3c155efd5768003a91eb.js +0 -1
  718. package/assets/esri/core/workers/chunks/3d4bb59ab2f644f4d675.js +0 -1
  719. package/assets/esri/core/workers/chunks/3f0d9fdd8c37605dd85d.js +0 -1
  720. package/assets/esri/core/workers/chunks/48eca6f51112ba80bd3b.js +0 -1
  721. package/assets/esri/core/workers/chunks/4b5737021a149aa786af.js +0 -1
  722. package/assets/esri/core/workers/chunks/55214e1d9f3d98fa7ed9.js +0 -1
  723. package/assets/esri/core/workers/chunks/55a0b69cf034ac32fc25.js +0 -1
  724. package/assets/esri/core/workers/chunks/576a1784e93c5406e657.js +0 -1
  725. package/assets/esri/core/workers/chunks/59289867cce97da74e39.js +0 -1
  726. package/assets/esri/core/workers/chunks/5a6d6082c5bcb1a80eda.js +0 -1
  727. package/assets/esri/core/workers/chunks/5a9620cb66c8e64e4668.js +0 -1
  728. package/assets/esri/core/workers/chunks/5c6e5f22450dd0583074.js +0 -1
  729. package/assets/esri/core/workers/chunks/5eeb6d3a7b815d41621e.js +0 -1
  730. package/assets/esri/core/workers/chunks/5f06a57b4f7d7de16bbf.js +0 -1
  731. package/assets/esri/core/workers/chunks/5f2e246ffcbdedea4de5.js +0 -1
  732. package/assets/esri/core/workers/chunks/5ff41f43e57be0557541.js +0 -1414
  733. package/assets/esri/core/workers/chunks/6b32b3f98872771ff81e.js +0 -1
  734. package/assets/esri/core/workers/chunks/6be9d00839002f24fafd.js +0 -1
  735. package/assets/esri/core/workers/chunks/6c72dbd5275bffde1583.js +0 -1
  736. package/assets/esri/core/workers/chunks/6c886f19875291d02407.js +0 -1
  737. package/assets/esri/core/workers/chunks/75f7c1f600c4051bc905.js +0 -1
  738. package/assets/esri/core/workers/chunks/77f6659e400064d38130.js +0 -1
  739. package/assets/esri/core/workers/chunks/78c7eace6ec3fa5c7413.js +0 -1
  740. package/assets/esri/core/workers/chunks/7cee28575fd57430cf02.js +0 -1
  741. package/assets/esri/core/workers/chunks/82e0691995d821137d5f.js +0 -1
  742. package/assets/esri/core/workers/chunks/8435b6bf356959009b76.js +0 -1
  743. package/assets/esri/core/workers/chunks/8677865189081e0b83bc.js +0 -1
  744. package/assets/esri/core/workers/chunks/86f70bd786d6d57fde69.js +0 -1
  745. package/assets/esri/core/workers/chunks/8878ab87ef7961fafae8.js +0 -1
  746. package/assets/esri/core/workers/chunks/8a893f23827769d42092.js +0 -1
  747. package/assets/esri/core/workers/chunks/8d1d0c3f0532aa98487d.js +0 -1
  748. package/assets/esri/core/workers/chunks/8e68b4628e9616356c34.js +0 -1
  749. package/assets/esri/core/workers/chunks/8edae79554843dd77ada.js +0 -1
  750. package/assets/esri/core/workers/chunks/9032c040b214b5af775b.js +0 -1
  751. package/assets/esri/core/workers/chunks/909ef35fa33be2b6da41.js +0 -1
  752. package/assets/esri/core/workers/chunks/90b7acc70adba193b215.js +0 -1
  753. package/assets/esri/core/workers/chunks/91718795fc4ca6516ac7.js +0 -1
  754. package/assets/esri/core/workers/chunks/92d4e962284e13ba2fc5.js +0 -1
  755. package/assets/esri/core/workers/chunks/94f80c46ccf5e19038b8.js +0 -1
  756. package/assets/esri/core/workers/chunks/979c2f52b6d6e1e8241b.js +0 -1
  757. package/assets/esri/core/workers/chunks/97f10efb0fe05bedcebd.js +0 -1
  758. package/assets/esri/core/workers/chunks/98f5bf1b91f3696b2fce.js +0 -1
  759. package/assets/esri/core/workers/chunks/9c52d4b54dfdb69dee29.js +0 -1
  760. package/assets/esri/core/workers/chunks/9de8149ae0a0726a4ab2.js +0 -1
  761. package/assets/esri/core/workers/chunks/9def5d17b94e5db71883.js +0 -1
  762. package/assets/esri/core/workers/chunks/9f272445c285ee9abb7b.js +0 -1
  763. package/assets/esri/core/workers/chunks/a10be7eb05a007fff1ed.js +0 -1
  764. package/assets/esri/core/workers/chunks/a32c87b89567a9fd1efc.js +0 -1
  765. package/assets/esri/core/workers/chunks/a3b29eca5807978fb2a3.js +0 -1
  766. package/assets/esri/core/workers/chunks/a446dff865332268625a.js +0 -1
  767. package/assets/esri/core/workers/chunks/a5bf2718c02a0e645013.js +0 -1
  768. package/assets/esri/core/workers/chunks/a6d166058e3025bb280e.js +0 -1
  769. package/assets/esri/core/workers/chunks/a8e111a5cfd6151d5dbb.js +0 -1
  770. package/assets/esri/core/workers/chunks/aed45f7e7eee154a21b8.js +0 -1
  771. package/assets/esri/core/workers/chunks/af3bd661b355eed3da21.js +0 -1
  772. package/assets/esri/core/workers/chunks/b0f2ce61d3cad413898e.js +0 -1
  773. package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +0 -1
  774. package/assets/esri/core/workers/chunks/b744b950999b92393e37.js +0 -1
  775. package/assets/esri/core/workers/chunks/b75165880704efccc47c.js +0 -1
  776. package/assets/esri/core/workers/chunks/ba9e107edc2027238be3.js +0 -1
  777. package/assets/esri/core/workers/chunks/bc3b22dc08c147b8d425.js +0 -1
  778. package/assets/esri/core/workers/chunks/c08e9914deb1dc62bc0f.js +0 -1
  779. package/assets/esri/core/workers/chunks/c0bb53d8d58ad18334d3.js +0 -1
  780. package/assets/esri/core/workers/chunks/c0d453f93af2d4a6ce64.js +0 -1
  781. package/assets/esri/core/workers/chunks/c9a42d86185a0ad35dd1.js +0 -1
  782. package/assets/esri/core/workers/chunks/cbb50415f7de8746ee1a.js +0 -1
  783. package/assets/esri/core/workers/chunks/d23dd7da45a7aa341540.js +0 -1
  784. package/assets/esri/core/workers/chunks/d2801df3fa44dee15ec8.js +0 -1
  785. package/assets/esri/core/workers/chunks/d53b31c9056f82831bc0.js +0 -1
  786. package/assets/esri/core/workers/chunks/d626e08d23330d84413b.js +0 -1
  787. package/assets/esri/core/workers/chunks/db6e03fe8dd316f5005f.js +0 -1
  788. package/assets/esri/core/workers/chunks/de79645e559a2d1ffa67.js +0 -1
  789. package/assets/esri/core/workers/chunks/e2779965db231fb666a5.js +0 -1
  790. package/assets/esri/core/workers/chunks/e4e2f059c52674dcae5b.js +0 -1
  791. package/assets/esri/core/workers/chunks/ec21311584e4fb13e510.js +0 -1
  792. package/assets/esri/core/workers/chunks/eca45cd479f7fd28ca6e.js +0 -1
  793. package/assets/esri/core/workers/chunks/ee8cd91c27e9cdfc3b2e.js +0 -1
  794. package/assets/esri/core/workers/chunks/efdd75896ca53eb6242f.js +0 -1
  795. package/assets/esri/core/workers/chunks/f1c348cf2a1e35da9b20.js +0 -1
  796. package/assets/esri/core/workers/chunks/f4053e4e2d6e678db48a.js +0 -1
  797. package/assets/esri/core/workers/chunks/f4d577ff61da7964e08a.js +0 -1
  798. package/assets/esri/core/workers/chunks/f7da652f8dab57677cc3.js +0 -1
  799. package/assets/esri/core/workers/chunks/fe92f54e45fd21ccd75f.js +0 -1
  800. package/assets/esri/core/workers/chunks/fee1d873127dca02459f.js +0 -1
  801. package/assets/esri/core/workers/chunks/ff31936236dd9b1acb24.js +0 -1
  802. /package/assets/esri/core/workers/chunks/{32e9e92bbbd000fbbaf7.js.LICENSE.txt → 4141a3a93732996601e8.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1056,6061],{61691(e,t,s){s.d(t,{G:()=>i});class i{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}},76061(e,t,s){s.d(t,{S:()=>r});var i=s(61691);class r extends i.G{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},46140(e,t,s){s.d(t,{A:()=>r});var i=s(49186);class r{constructor(e,t,s=""){this.major=e,this.minor=t,this._context=s}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",s=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${s}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new r(this.major,this.minor,this._context)}static parse(e,t=""){const[s,n]=e.split("."),o=/^\s*\d+\s*$/;if(!s?.match||!o.test(s))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!o.test(n))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(s,10),h=parseInt(n,10);return new r(a,h,t)}}},6797(e,t,s){s.d(t,{Ui:()=>d});var i=s(69622),r=s(7762),n=s(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function a(e){return e instanceof i.A}function h(e){return e instanceof r.A?Object.keys(e.items):a(e)?(0,n.oY)(e).keys():e?Object.keys(e):[]}function c(e,t){return e instanceof r.A?e.items[t]:e[t]}function l(e){return e?e.declaredClass:null}function u(e,t){const s=e.diff;if(s&&"function"==typeof s)return s(e,t);const i=h(e),r=h(t);if(0===i.length&&0===r.length)return;if(!i.length||!r.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const n=r.filter(e=>!i.includes(e)),d=i.filter(e=>!r.includes(e)),p=i.filter(s=>r.includes(s)&&c(e,s)!==c(t,s)).concat(n,d).sort(),f=l(e);if(f&&o.has(f)&&p.length)return{type:"complete",oldValue:e,newValue:t};let _;const m=a(e)&&a(t);for(const i of p){const r=c(e,i),n=c(t,i);let o;if((m||"function"!=typeof r&&"function"!=typeof n)&&r!==n&&(null!=r||null!=n)){if(s&&s[i]&&"function"==typeof s[i])o=s[i]?.(r,n);else if(r instanceof Date&&n instanceof Date){if(r.getTime()===n.getTime())continue;o={type:"complete",oldValue:r,newValue:n}}else o="object"==typeof r&&"object"==typeof n&&l(r)===l(n)?u(r,n):{type:"complete",oldValue:r,newValue:n};null!=o&&(null!=_?_.diff[i]=o:_={type:"partial",diff:{[i]:o}})}}return _}function d(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&l(e)!==l(t)?{type:"complete",oldValue:e,newValue:t}:u(e,t)}},67482(e,t,s){function i(e){return null!=a(e)||null!=o(e)}function r(e){return h.test(e)}function n(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let s=!0;if(l&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,i=0;for(;!t&&i<=e.length;)t=!c.test(e[i]),i++;s=!t}}return s}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=h.exec(e);if(!t?.groups)return null;const s=t.groups,i=+s.year,r=+s.month-1,n=+s.day,o=+(s.hours??"0"),a=+(s.minutes??"0"),c=+(s.seconds??"0");if(o>23)return null;if(a>59)return null;if(c>59)return null;const l=s.ms??"0",u=l?+l.padEnd(3,"0").slice(0,3):0;let d;if(s.isUTC||!s.offsetSign)d=Date.UTC(i,r,n,o,a,c,u);else{const e=+s.offsetHours,t=+s.offsetMinutes;d=6e4*("+"===s.offsetSign?-1:1)*(60*e+t)+Date.UTC(i,r,n,o,a,c,u)}return Number.isNaN(d)?null:d}s.d(t,{Br:()=>r,Cq:()=>i,_U:()=>n});const h=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,c=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,l=!Number.isNaN(new Date("technology 10").getTime())},88340(e,t,s){function i(){return new Float32Array(2)}function r(e,t){const s=new Float32Array(2);return s[0]=e,s[1]=t,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(t,{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(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:r,ones:o,unitX:a,unitY:h,zeros:n},Symbol.toStringTag,{value:"Module"}))},77085(e,t,s){s.d(t,{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[e,t]=await Promise.all([Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(1088)]).then(s.bind(s,31088)),Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756)]).then(s.bind(s,15756)).then(e=>e.aP).then(({injectPe:e})=>e),(0,r.l)()]);n=new e.OperatorGeodeticDensifyByLength,t(r.p)}}function h(e,t,s,i){return n.execute(e,t,s,i,null)}function c(e,t,s,r){const o=n.executeMany(new i.S(e),t,s,r,null);return Array.from(o)}function l(){return n.supportsCurves()}},5808(e,t,s){s.d(t,{O:()=>i});const i={geodesic:0,loxodrome:1,"great-elliptic":2,"normal-section":3,"shape-preserving":4}},89056(e,t,s){s.d(t,{b3:()=>u,jZ:()=>l});var i=s(12195),r=s(19419),n=s(537),o=s(95108),a=s(60408),h=s(80754),c=s(21325);function l(e){return d(e,!0)}function u(e){return d(e,!1)}function d(e,t){if(null==e)return null;const s=e.spatialReference,r=(0,c.Vp)(s),o=(0,i.W)(e)?e.toJSON():e;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 f(o,u,d);if((0,a.U9)(o))return o.points=o.points.map(e=>f(e,u,d)),o;if((0,a.ZC)(o))return p(o,r);if((0,a.Bi)(o)||(0,a.Rg)(o)){const e=(0,n.Rg)(b,o),s={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[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,t):s.xmin<d?y(r,d,t):r}return o}function p(e,t){if(!t)return e;const s=function(e,t){const s=[],{ymin:i,ymax:r,xmin:n,xmax:o}=e,a=e.xmax-e.xmin,[h,c]=t.valid,{x:l,frameId:u}=_(e.xmin,t),{x:d,frameId:p}=_(e.xmax,t),f=l===d&&a>0;if(a>2*c){const e={xmin:n<o?l:d,ymin:i,xmax:c,ymax:r},t={xmin:h,ymin:i,xmax:n<o?d:l,ymax:r},a={xmin:0,ymin:i,xmax:c,ymax:r},f={xmin:h,ymin:i,xmax:0,ymax:r},_=[],g=[];m(e,a)&&_.push(u),m(e,f)&&g.push(u),m(t,a)&&_.push(p),m(t,f)&&g.push(p);for(let e=u+1;e<p;e++)_.push(e),g.push(e);s.push(new x(e,[u]),new x(t,[p]),new x(a,_),new x(f,g))}else l>d||f?s.push(new x({xmin:l,ymin:i,xmax:c,ymax:r},[u]),new x({xmin:h,ymin:i,xmax:d,ymax:r},[p])):s.push(new x({xmin:l,ymin:i,xmax:d,ymax:r},[u]));return s}(e,t).map(e=>e.extent);return s.length<2?s[0]||e:s.length>2?(e.xmin=t.valid[0],e.xmax=t.valid[1],e):{rings:s.map(e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]])}}function f(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,h.kd)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,h.kd)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,h.kd)(i,t);e.x+=s*(-2*t)}else if(i<s){const t=(0,h.kd)(i,s);e.x+=t*(-2*s)}}return e}function _(e,t){const[s,i]=t.valid,r=2*i;let n,o=0;return e>i?(n=Math.ceil(Math.abs(e-i)/r),e-=n*r,o=n):e<s&&(n=Math.ceil(Math.abs(e-s)/r),e+=n*r,o=-n),{x:e,frameId:o}}function m(e,t){const{xmin:s,ymin:i,xmax:r,ymax:n}=t;return g(e,s,i)&&g(e,s,n)&&g(e,r,n)&&g(e,r,i)}function g(e,t,s){return t>=e.xmin&&t<=e.xmax&&s>=e.ymin&&s<=e.ymax}function y(e,t,s=!0){const i=!(0,a.Rg)(e);if(i&&(0,o.m3)(e),s)return(new w).cut(e,t);const r=i?e.rings:e.paths,n=i?4:2,h=r.length,c=-2*t;for(let e=0;e<h;e++){const t=r[e];if(t&&t.length>=n){const e=[];for(const[s,...i]of t)e.push([s+c,...i]);r.push(e)}}return i?e.rings=r:e.paths=r,e}class x{constructor(e,t){this.extent=e,this.frameIds=t}}const b=(0,r.vt)();class w{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let s;if(this._xCut=t,e.rings)this._closed=!0,s=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,s=e.paths,this._minPts=2}for(const e of s){if(!e||e.length<this._minPts)continue;let t=!0;for(const s of e)t?(this.moveTo(s),t=!1):this.lineTo(s);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),s=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&s.push(e);const i=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=i;s.push(e)}return this._closed?e.rings=s:e.paths=s,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide===-1){const s=this._intersect(this._prevPt,e);this._lineTo(this._xCut,s,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,s){this._closed?(this._lineIn.push([s<=0?e:this._xCut,t]),this._lineOut.push([s>=0?e:this._xCut,t])):(s<=0&&this._lineIn.push([e,t]),s>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,s){this._closed?(v(this._lineIn,s<=0?e:this._xCut,t),v(this._lineOut,s>=0?e:this._xCut,t)):s<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([e,t])):s>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return e<this._xCut?-1:e>this._xCut?1:0}_intersect(e,t){const s=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+s*(t[1]-e[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(e,t,s){const i=e.length;i>1&&e[i-1][0]===t&&e[i-2][0]===t?e[i-1][1]=s:e.push([t,s])}},37730(e,t,s){s.d(t,{T:()=>r});var i=s(43334);const r={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t,s)=>new i.Om(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},30624(e,t,s){s.r(t),s.d(t,{createConnection:()=>S});var i=s(5482),r=s(11254),n=s(49186),o=s(53966),a=s(84952),h=s(91429),c=s(16930),l=s(65864),u=s(17676),d=s(62815),p=s(65529);let f=class extends p.nJ{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new n.A("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,i.Cg)([(0,h.MZ)({readOnly:!0})],f.prototype,"connectionError",null),f=(0,i.Cg)([(0,h.$K)("esri.layers.support.StreamConnection")],f);let _=class extends f{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:i}=e;this._config=e,this._featureZScaler=(0,d.N)(t,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 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,a.a6)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(i){const r=t/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,u.Pl)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void o.A.getLogger(this).error(new n.A("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise((t,s)=>{const i=new WebSocket(e);i.onopen=()=>{if(i.onopen=null,this.destroyed)return i.onclose=null,void i.close();i.onclose=e=>this._onClose(e),i.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(i),t(i)},i.onclose=e=>{i.onopen=i.onclose=null,s(e)}})}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const s=Promise.withResolvers(),i=t.onmessage,{filter:r,outFields:a,spatialReference:h}=this._config,c=setTimeout(()=>s.reject(),e),l=()=>{clearTimeout(c),s.reject()};return t.onmessage=e=>{let u=null;try{u=JSON.parse(e.data)}catch(e){}u&&"object"==typeof u||(o.A.getLogger(this).error(new n.A("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),l(),this.destroy()),u.spatialReference?.wkid!==h?.wkid&&(o.A.getLogger(this).error(new n.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${h.wkid}`,e.data)),l(),this.destroy()),"json"!==u.format&&(o.A.getLogger(this).error(new n.A("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),l(),this.destroy()),r&&u.filter!==r&&o.A.getLogger(this).error(new n.A("websocket-connection","Tried to set filter, but server doesn't support it")),a&&u.outFields!==a&&o.A.getLogger(this).error(new n.A("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=i;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],clearTimeout(c),s.resolve()},t.send(JSON.stringify({filter:r,outFields:a,format:"json",spatialReference:{wkid:h.wkid}})),s.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),o.A.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&o.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,i.Cg)([(0,h.MZ)()],_.prototype,"connectionStatus",null),(0,i.Cg)([(0,h.MZ)()],_.prototype,"errorString",void 0),_=(0,i.Cg)([(0,h.$K)("esri.layers.graphics.sources.connections.WebSocketConnection")],_);var m=s(80893),g=s(61956);const y={maxQueryDepth:5,maxRecordCountFactor:3};let x=class extends _{constructor(e){super({...y,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.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 t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:s,outFields:i}=this._config;this.destroyed||this._setFilter(s,i)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void o.A.getLogger(this).error(new n.A("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,r.A)(e.path,{query:t,responseType:"json"}),i=(await s).data;return this._serviceDefinition=i,i}_fetchWebSocketUrl(e,t){const s=e[0],{urls:i,token:r}=s,n=this._inferWebSocketBaseUrl(i);return(0,a.a6)(`${n}/subscribe`,{outSR:""+t.wkid,token:r})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return o.A.getLogger(this).error(new n.A("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if(null==s||null==e&&null==t)return;const i=JSON.stringify({filter:this._serializeFilter(e,t)});let r=!1;const a=Promise.withResolvers();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(o.A.getLogger(this).error(new n.A("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),a.reject(t.error)),this._setWebSocketJSONParseHandler(s),r=!0,a.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")),a.reject())},1e4),a.promise}_serializeFilter(e,t){const s={};if(null==e&&null==t)return s;if(e?.geometry)try{const t=(0,l.rS)(e.geometry);if("extent"!==t.type)throw new n.A("geoevent-connection",`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){o.A.getLogger(this).error(new n.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(s.where=e.where),null!=t&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t],i=this._relatedFeatures.get(s);if(!i)return o.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:r,geometry:a}=i;for(const t in r)e.attributes[t]=r[t];return a&&(e.geometry=a),e.geometry||e.centroid||o.A.getLogger(this).error(new n.A("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),i=this._queryArchive(t);await s;const r=await i;if(!r)return;for(const e of r.features)this.onFeature(this._enrich(e))}catch(e){o.A.getLogger(this).error(new n.A("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(7632),s.e(3508),s.e(7865),s.e(6554),s.e(2869),s.e(3910),s.e(9953),s.e(1733),s.e(1214),s.e(8399),s.e(1017),s.e(4674),s.e(6606),s.e(8589),s.e(7609),s.e(812),s.e(8190)]).then(s.bind(s,18589))).default)({url:e}),{capabilities:i}=await t.load(),r=i.query.supportsMaxRecordCountFactor,n=i.query.supportsPagination,o=i.query.supportsCentroid,a=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,l=r?h*a:h,u=new g.A;if(u.outFields=this._config.outFields??["*"],u.where=this._config.filter?.where??"1=1",u.returnGeometry=!0,u.returnExceededLimitFeatures=!0,u.outSpatialReference=c.A.fromJSON(this._config.spatialReference),o&&(u.returnCentroid=!0),r&&(u.maxRecordCountFactor=a),n)return u.num=l,t.destroy(),this._queryPages(e,u);const d=await(0,m.eW)(e,u,this._config.sourceSpatialReference);return t.destroy(),d}async _queryPages(e,t,s=[],i=0){t.start=null!=t.num?i*t.num:null;const r=await(0,m.eW)(e,t,this._config.sourceSpatialReference);return r.exceededTransferLimit&&i<(this._config.maxQueryDepth??0)?(r.features.forEach(e=>s.push(e)),this._queryPages(e,t,s,i+1)):(s.forEach(e=>r.features.push(e)),r)}_addRelatedFeatures(e){const t=new Map,s=e.features,i=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[i];t.set(s,e)}this._relatedFeatures=t}};x=(0,i.Cg)([(0,h.$K)("esri.layers.graphics.sources.connections.GeoEventConnection")],x);var b=s(64108);let w=class extends f{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:i}=e;this._featureZScaler=(0,d.N)(t,i,s)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function v(e,t){if(null==e&&null==t)return null;const s={};return null!=t&&(s.geometry=t),null!=e&&(s.where=e),s}function S(e,t,s,i,r,n,o,a,h){const c={source:e,sourceSpatialReference:t,spatialReference:s,geometryType:i,filter:v(r,n),maxReconnectionAttempts:o,maxReconnectionInterval:a,customParameters:h};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new _(c):new x(c):new w(c)}(0,i.Cg)([(0,h.MZ)()],w.prototype,"connectionStatus",void 0),(0,i.Cg)([(0,h.MZ)()],w.prototype,"errorString",void 0),w=(0,i.Cg)([(0,b.$)("esri.layers.support.ClientSideConnection")],w)},85113(e,t,s){s.d(t,{BM:()=>P,bd:()=>M,sO:()=>I,xD:()=>u});var i=s(67482),r=s(49186),n=s(21325),o=s(90708),a=s(43334),h=s(92722),c=s(30524);const l={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function u(e){return l[e]}function*d(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*p(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function f(e){for(const t of e)if(t.length>2)return!0;return!1}function _(e){let t=0;for(let s=0;s<e.length;s++){const i=e[s],r=e[(s+1)%e.length];t+=i[0]*r[1]-r[0]*i[1]}return t<=0}function m(e){const t=e[0],s=e[e.length-1];t[0]===s[0]&&t[1]===s[1]&&t[2]===s[2]||e.push(t)}function g(e,t){const{coordinates:s,type:i}=e,r=t.hasZ??!1,n=!0;switch(i){case"Point":return new h.A([],[...s],r,!1);case"LineString":return(0,o.Ap)({paths:[s],hasZ:n},r,!1);case"MultiLineString":return(0,o.Ap)({paths:s,hasZ:n},r,!1);case"MultiPoint":return(0,o.PR)({points:s,hasZ:n},r,!1);case"Polygon":case"MultiPolygon":{const e=new h.A([],[],r,!1);for(const t of"Polygon"===i?[s]:s){y(e,t[0],r);for(let s=1;s<t.length;s++)x(e,t[s],r)}return e}}}function y(e,t,s){m(t),function(e){return!_(e)}(t)?w(e,t,s):b(e,t,s)}function x(e,t,s){m(t),function(e){return _(e)}(t)?w(e,t,s):b(e,t,s)}function b(e,t,s){for(const i of t)v(e,i,s);e.lengths.push(t.length)}function w(e,t,s){for(let i=t.length-1;i>=0;i--)v(e,t[i],s);e.lengths.push(t.length)}function v(e,[t,s,i],r){e.coords.push(t,s),r&&e.coords.push(i||0)}function S(e){switch(typeof e){case"string":return(0,i.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function I(e,t=4326){if(!e)throw new r.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new r.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:s}=e;if(!s)return;const i="string"==typeof s?s:"name"===s.type?s.properties.name:"EPSG"===s.type?s.properties.code:null,o=(0,n.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!i||!o.test(i))throw new r.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:s})}function P(e,t={}){const s=[],i=new Set,r=new Set;let n,o=!1,a=null,h=!1,{geometryType:l=null}=t;for(const t of d(e)){const{geometry:e,properties:d,id:_}=t;if((!e||(l||(l=u(e.type)),u(e.type)===l))&&(o||(o=f(p(e))),h||(h=null!=_,h&&(n=typeof _,d&&(a=Object.keys(d).filter(e=>d[e]===_)))),d&&a&&h&&null!=_&&(a.length>1?a=a.filter(e=>d[e]===_):1===a.length&&(a=d[a[0]]===_?a:[])),d))for(const e in d){if(i.has(e))continue;const t=S(d[e]);if("unknown"===t){r.add(e);continue}r.delete(e),i.add(e);const n=(0,c.rS)(e);n&&s.push({name:n,alias:e,type:t})}}const _=(0,c.rS)(1===a?.length&&a[0]||null)??void 0;if(_)for(const e of s)if(e.name===_&&(0,c.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:s,geometryType:l,hasZ:o,objectIdFieldName:_,objectIdFieldType:n,unknownFields:Array.from(r)}}function M(e,t){return Array.from(function*(e,t={}){const{geometryType:s,objectIdField:i}=t;for(const r of e){const{geometry:e,properties:n,id:o}=r;if(e&&u(e.type)!==s)continue;const h=n||{};let c;i&&(c=h[i],null==o||c||(h[i]=c=o)),yield new a.Om(e&&g(e,t),h,null,c)}}(d(e),t))}},82832(e,t,s){s.d(t,{$1:()=>m,CR:()=>_,MB:()=>d,PC:()=>g,Yx:()=>h,bP:()=>l});var i=s(67482),r=s(21325),n=s(30524);class o{constructor(e){this.description=e,this.code=null}}class a{constructor(e){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new o(e)}}function h(e){return new a(e)}class c{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function l(e){return new c(e)}const u=new Set;function d(e,t,s,i=!1){u.clear();for(const r in s){const o=e.get(r);if(!o)continue;const a=p(o,s[r]);if(u.add(o.name),o&&(i||o.editable)){const e=(0,n.CJ)(o,a);if(e)return h((0,n.uo)(e,o,a));t[o.name]=a}}for(const t of e.requiredFields??[])if(!u.has(t.name))return h(`missing required field "${t.name}"`);return null}function p(e,t){let s=t;return(0,n.WA)(e)&&"string"==typeof t?s=parseFloat(t):(0,n.yM)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,n.vE)(e)&&"string"==typeof t&&(s=(0,i._U)(t)),(0,n.WX)(s)}let f;function _(e,t){if(!e||!(0,r.fn)(t))return e;if("rings"in e||"paths"in e){if(null==f)throw new TypeError("geometry engine not loaded");return f.simplify(t,e)}return e}async function m(e,t){!(0,r.fn)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==f&&(f=await s.e(1023).then(s.bind(s,81023))),f}()}const g={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]}},75321(e,t,s){s.d(t,{CJ:()=>I,GA:()=>k,GL:()=>S,I:()=>T,J0:()=>C,Ki:()=>M,Px:()=>P,QE:()=>v,bW:()=>A,vJ:()=>w});var i=s(11254),r=s(49186),n=s(53966),o=s(84952),a=s(16930),h=s(21325),c=s(28735),l=s(90708),u=s(58512),d=s(85113),p=s(64714),f=s(82832),_=s(95466),m=s(98453),g=s(98623);const y=()=>n.A.getLogger("esri.layers.ogc.ogcFeatureUtils"),x="startindex",b=new Set([x,"offset"]),w="http://www.opengis.net/def/crs/",v=`${w}OGC/1.3/CRS84`;async function S(e,t,s={},n=5){const{links:a}=e,h=R(a);if(!h)throw new r.A("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:c,customParameters:l,signal:u}=s,f=(0,o.s2)(h.href,e.landingPage.url),b={limit:n,...l,token:c},w=(0,o.a6)(f,b),{data:v}=await(0,i.A)(w,{signal:u,headers:{accept:"application/geo+json"}}),S=q(w,n,v.links)??x;(0,d.sO)(v);const I=v.numberMatched,P=(0,d.BM)(v,{geometryType:t.geometryType}),M=t.fields||P.fields||[],k=null!=t.hasZ?t.hasZ:P.hasZ,C=P.geometryType,A=t.objectIdField||P.objectIdFieldName||"OBJECTID";let T=t.timeInfo;const F=M.find(({name:e})=>e===A);if(F)F.editable=!1,F.nullable=!1;else{if(!P.objectIdFieldType)throw new r.A("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");M.unshift({name:A,alias:A,type:"number"===P.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(A!==P.objectIdFieldName){const e=M.find(({name:e})=>e===P.objectIdFieldName);e&&(e.type="esriFieldTypeInteger")}M===P.fields&&P.unknownFields.length>0&&y().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:P.unknownFields}});for(const e of M){if(e.name??=e.alias,e.alias??=e.name,"esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type&&(e.editable??=!0,e.nullable??=!0),!e.name)throw new r.A("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!m.m.jsonValues.includes(e.type))throw new r.A("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(T){const e=new _.A(M);if(T.startTimeField){const t=e.get(T.startTimeField);t?(T.startTimeField=t.name,t.type="esriFieldTypeDate"):T.startTimeField=null}if(T.endTimeField){const t=e.get(T.endTimeField);t?(T.endTimeField=t.name,t.type="esriFieldTypeDate"):T.endTimeField=null}if(T.trackIdField){const t=e.get(T.trackIdField);t?T.trackIdField=t.name:(T.trackIdField=null,y().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:T}}))}T.timeReference||={timeZoneIANA:g.n$},T.startTimeField||T.endTimeField||(y().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:T}}),T=void 0)}return{drawingInfo:C?(0,p.F0)(C):null,extent:O(e),geometryType:C,fields:M,hasZ:!!k,objectIdField:A,paginationParameter:S,timeInfo:T,featureCount:I}}async function I(e,t={}){const{links:s,url:n}=e,a=L(h=s,"data","application/json")??L(h,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");var h;if(!a)throw new r.A("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:c,customParameters:l,signal:u}=t,d=(0,o.s2)(a.href,n),{data:p}=await(0,i.A)(d,{signal:u,headers:{accept:"application/json"},query:{...l,token:c}});for(const t of p.collections)t.landingPage=e;return p}async function P(e,t={}){const{links:s,url:n}=e,a=L(h=s,"conformance","application/json")??L(h,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");var h;if(!a)throw new r.A("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:c,customParameters:l,signal:u}=t,d=(0,o.s2)(a.href,n),{data:p}=await(0,i.A)(d,{signal:u,headers:{accept:"application/json"},query:{...l,token:c}});return p}async function M(e,t={}){const{apiKey:s,customParameters:r,signal:n}=t,{data:o}=await(0,i.A)(e,{signal:n,headers:{accept:"application/json"},query:{...r,token:s}});return o.url=e,o}async function k(e,t={}){const{links:s,url:r}=e,n=L(s,"service-desc","application/vnd.oai.openapi+json;version=3.0");if(!n)return y().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:a,customParameters:h,signal:c}=t,l=(0,o.s2)(n.href,r),{data:u}=await(0,i.A)(l,{signal:c,headers:{accept:"application/vnd.oai.openapi+json;version=3.0"},query:{...h,token:a}});return u}function C(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),s=t?.groups;if(!s)return null;const{authority:i,code:r}=s;switch(i.toLowerCase()){case"ogc":switch(r.toLowerCase()){case"crs27":return a.A.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return a.A.WGS84.wkid;default:return null}case"esri":case"epsg":{const e=Number.parseInt(r,10);return Number.isNaN(e)?null:e}default:return null}}async function A(e,t,s){const i=await T(e,t,s);return(0,l.ZF)(i)}async function T(e,t,s){const{collection:{links:n,landingPage:{url:p}},layerDefinition:m,maxRecordCount:g,queryParameters:{apiKey:y,customParameters:x},spatialReference:b,supportedCrs:w}=e,v=R(n);if(!v)throw new r.A("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:S,num:I,start:P,timeExtent:M,where:k}=t;if(t.objectIds)throw new r.A("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const C=a.A.fromJSON(b),A=t.outSpatialReference??C,T=A.isWGS84?null:F(A,w),z=E(S,w),O=function(e){if(!e)return null;const{start:t,end:s}=e;return`${null!=t?t.toISOString():".."}/${null!=s?s.toISOString():".."}`}(M),L=(Z=k)&&"1=1"!==Z?Z:null,q=I??(null==P?g:10),N=0===P?void 0:P,{fields:G,geometryType:B,hasZ:W,objectIdField:j,paginationParameter:U}=m,V=(0,o.s2)(v.href,p),{data:Y}=await(0,i.A)(V,{...s,query:{...x,...z,crs:T,datetime:O,query:L,limit:q,[U]:N,token:y},headers:{accept:"application/geo+json"}}),H=(0,d.bd)(Y,{geometryType:B,hasZ:W,objectIdField:j}),X=H.length===q&&!!D(Y.links??[]),$=new _.A(G);var Z;for(const e of H){const t={};(0,f.MB)($,t,e.attributes,!0);for(const e of $.fields)e.nullable&&!(e.name in t)&&(t[e.name]=null);t[j]=e.attributes[j],e.attributes=t}if(!T&&A.isWebMercator)for(const e of H)if(null!=e.geometry&&null!=B){const t=(0,l.zv)(e.geometry,B,W,!1);t.spatialReference=a.A.WGS84,e.geometry=(0,l.Ux)((0,c.Cv)(t,A))}for(const e of H)e.objectId=e.attributes[j];const Q=T||!T&&A.isWebMercator?A.toJSON():h.KK,J=new u.A;return J.exceededTransferLimit=X,J.features=H,J.fields=G,J.geometryType=B,J.hasZ=W,J.spatialReference=Q,J}function F(e,t){const{isWebMercator:s,wkid:i,latestWkid:r}=e;if(!i&&!r)return null;const n=s?t[3857]??t[102100]??t[102113]??t[900913]:i&&t[i]||r&&t[r];return n?`${w}${n}`:null}function z(e){if(!e)return"";const{xmin:t,ymin:s,xmax:i,ymax:r}=e;return`${t},${s},${i},${r}`}function E(e,t){if(!function(e){return null!=e&&"extent"===e.type}(e))return null;const{spatialReference:s}=e;if(!s||s.isWGS84)return{bbox:z(e)};const i=F(s,t);return null!=i?{bbox:z(e),"bbox-crs":i}:s.isWebMercator?{bbox:z((0,c.Cv)(e,a.A.WGS84))}:null}function O(e){const t=e.extent?.spatial;if(!t)return null;const s=t.bbox[0],i=4===s.length,[r,n]=s,o=i?void 0:s[2];return{xmin:r,ymin:n,xmax:i?s[2]:s[3],ymax:i?s[3]:s[4],zmin:o,zmax:i?void 0:s[5],spatialReference:a.A.WGS84.toJSON()}}function R(e){return L(e,"items","application/geo+json","http://www.opengis.net/def/profile/ogc/0/rfc7946")??L(e,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json","http://www.opengis.net/def/profile/ogc/0/rfc7946")}function L(e,t,s,i){return i?e.find(({rel:e,type:r,profile:n})=>e===t&&r===s&&n?.includes(i))??e.find(({rel:e,type:i,profile:r})=>e===t&&i===s&&!r):e.find(({rel:e,type:i})=>e===t&&i===s)??e.find(({rel:e,type:s})=>e===t&&!s)}function D(e){return L(e,"next","application/geo+json")}function q(e,t,s){if(!s)return;const i=D(s),r=(0,o.An)(i?.href)?.query;if(!r)return;const n=(0,o.An)(e).query,a=Object.keys(n??{}),h=Object.entries(r).filter(([e])=>!a.includes(e)).find(([e,s])=>b.has(e.toLowerCase())&&Number.parseInt(s,10)===t),c=h?.[0];return c}},41560(e,t,s){s.d(t,{Ch:()=>o,mW:()=>n});var i=s(34727),r=s(39516);function n(e,t){return{...t,filterMode:e.mode}}function o(e,t,s){const n=function(e){if("manual"===c(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:s,maxScale:i}of e.filters)t[0]=Math.max(t[0],l(s)),t[1]=Math.min(t[1],u(i));return t}(e);if(n&&((0,i.gg)(t,n[0])||(0,i.ZH)(s,n[1])))return"";const o=Array.from(a(e,t,s)),h=function(e,t,s){if(0===e.length)return!0;const r=l(e.at(0)?.minScale),n=u(e.at(-1)?.maxScale);if((0,i.ZH)(r,t)||(0,i.gg)(n,s))return!0;for(let t=0;t<e.length-1;t++){const s=e[t],r=e[t+1];if((0,i.ZH)(l(r.minScale),u(s.maxScale)))return!0}return!1}(o,t,s)?"1=1":o.map(e=>e.where||"1=1").reduce((e,t)=>(0,r.IW)(e,t),"");return h&&"1=1"!==h?h:""}function*a(e,t,s){if("manual"===c(e)){const t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const i of e.filters)h(i.minScale,i.maxScale,t,s)&&(yield i)}}function h(e,t,s,r){return e=l(e),s=l(s),t=u(t),!(!(0,i.Sp)(s,e)&&(r??s)>e||(0,i.Hx)(t,s)||void 0!==r&&(0,i.Sp)(r,e))}function c(e){return"mode"in e?e.mode:e.filterMode}function l(e){return e||Number.POSITIVE_INFINITY}function u(e){return e||0}},32730(e,t,s){s.d(t,{BI:()=>p,D3:()=>u,XJ:()=>d,lc:()=>l,mX:()=>_,rU:()=>f,tH:()=>b});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");function l(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function u(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function d(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=l(e.labelExpression),t.type="conventional"),t}function p(e){const t=d(e);if(!t)return null;switch(t.type){case"conventional":return _(t.expression);case"arcade":return t.expression}return null}function f(e){const t=d(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(m);return t?.[1].trim()||null}(t.expression);case"arcade":return b(t.expression)}return null}function _(e){let t;return e?(t=(0,i.HC)(e,e=>r+'$feature["'+e+'"]'+n),t=h.test(t)?t.replace(h,""):'"'+t,t=c.test(t)?t.replace(c,""):t+'"',t=t.replaceAll(o,'" + ').replaceAll(a,' + "')):t='""',t}const m=/^\s*\{([^}]+)\}\s*$/i,g=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,y=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,x=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function b(e){if(!e)return null;let t=g.exec(e)||y.exec(e);return t?t[1]||t[3]:(t=x.exec(e),t?t[2]:null)}},72691(e,t,s){s.d(t,{Aw:()=>o,DN:()=>i,EA:()=>n,Gm:()=>r,xq:()=>a});const i="__esri_stream_id__",r="__esri_timestamp__",n="__esri_track_part__",o="__esri_time_received__",a="__esri_track_line__"},73681(e,t,s){s.d(t,{n:()=>h});var i=s(49186),r=s(53966),n=s(46140),o=s(95466),a=s(55674);class h{static async from(e,t,s){const o=e.dictionary_version?n.A.parse(e.dictionary_version):null,l=new Set(e.itemsNames),u={};if(t)for(const e in t)u[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)u.hasOwnProperty(t.name)||(u[t.name]=t.value);const d=new Set(e.authoringInfo.symbol);for(const e of Object.keys(s))d.delete(e);d.size&&r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:d});const p=await(0,a.xR)(e.expression,null,u);if(!p)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const f=!o||!o.greaterEqual(4,0);f&&r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const _=new c(s,f);return new h(f,l,p,_)}constructor(e,t,s,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=s,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,s,i){try{return this._reader.bind(e,s,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){r.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class c extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},55674(e,t,s){s.d(t,{Ad:()=>p,Gj:()=>m,QY:()=>d,lL:()=>g,xR:()=>f});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(e,t){if(null!=t)for(const s of u)t.hasArcadeDependency(s)&&e.add(s);return e}function p(e,t){return _.create(e,t,null,["$feature","$view"])}function f(e,t,s){return _.create(e,t,s,["$feature","$view","$config"])}class _{static async create(e,t,s,i){const{arcade:n,Dictionary:o}=await(0,c.l)();let a;try{a=n.parseScript(e)}catch(t){throw new r.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const h=n.scriptUsesGeometryEngine(a);h&&await n.enableGeometrySupport(),await n.loadDependentModules(new Set,a,null,!1,h);const l={vars:i.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},u=n.compileScript(a,l);let d=null;null!=s&&(d=new o(s),d.immutable=!0);const p=new o;return p.immutable=!1,p.setField("scale",0),new _(e,n,a,u,t,p,d,o)}constructor(e,t,s,i,r,n,o,a){this.script=e,this._arcade=t,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 m,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const s=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:r,currentEnd:n}=t.$view.timeProperties;e=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",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:s})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class m{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(e,t,s){const i=t??new h.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=s}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===l.L5}field(e,t=!0){const s=this._getField(e);if(s){const t=this._boundTarget.attributes[s.name];if(null==t)return null;switch(s.type){case"date-only":case"esriFieldTypeDateOnly":return n.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??l.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const s in e)t.push({name:s,alias:s,type:"string"==typeof e[s]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},11831(e,t,s){s.d(t,{A:()=>c});var i,r=s(5482),n=s(25482),o=s(90629),a=s(91429),h=s(5760);let c=i=class extends n.o{constructor(e){super(e),this.decoration="none",this.family="sans-serif",this.style="normal",this.weight="normal"}get size(){return this._get("size")??9}set size(e){this._set("size",e)}castSize(e){return(0,o.cr)(e)}clone(){return new i({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};(0,r.Cg)([(0,a.MZ)({type:h.h9,json:{default:"none",write:!0}})],c.prototype,"decoration",void 0),(0,r.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],c.prototype,"family",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:{overridePolicy:(e,t,s)=>({enabled:!s||!s.textSymbol3D})}}})],c.prototype,"size",null),(0,r.Cg)([(0,a.wg)("size")],c.prototype,"castSize",null),(0,r.Cg)([(0,a.MZ)({type:h._R,json:{default:"normal",write:!0}})],c.prototype,"style",void 0),(0,r.Cg)([(0,a.MZ)({type:h.NM,json:{default:"normal",write:!0}})],c.prototype,"weight",void 0),c=i=(0,r.Cg)([(0,a.$K)("esri.symbols.Font")],c)},68249(e,t,s){s.d(t,{A:()=>f});var i,r=s(5482),n=s(68197),o=s(4718),a=s(90629),h=s(91429),c=s(11831),l=s(20378),u=s(5760),d=s(93223),p=s(43937);let f=i=class extends l.A{constructor(...e){super(...e),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new c.A,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.angle=0,this.width=null,this.lineHeight=1}normalizeCtorArgs(e,t,s){if(e&&"string"!=typeof e)return e;const i={};return e&&(i.text=e),t&&(i.font=t),s&&(i.color=s),i}get haloSize(){return this._get("haloSize")??null}set haloSize(e){this._set("haloSize",e)}get xoffset(){return this._get("xoffset")??0}set xoffset(e){this._set("xoffset",e)}get yoffset(){return this._get("yoffset")??0}set yoffset(e){this._set("yoffset",e)}get lineWidth(){return this._get("lineWidth")??192}set lineWidth(e){this._set("lineWidth",e)}writeLineWidth(e,t,s,i){i&&"string"!=typeof i?i.origin:t[s]=e}castLineWidth(e){return(0,a.cr)(e)}writeLineHeight(e,t,s,i){i&&"string"!=typeof i?i.origin:t[s]=e}clone(){return new i({angle:this.angle,backgroundColor:(0,o.o8)(this.backgroundColor),borderLineColor:(0,o.o8)(this.borderLineColor),borderLineSize:this.borderLineSize,color:(0,o.o8)(this.color),font:this.font&&this.font.clone(),haloColor:(0,o.o8)(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${this.backgroundColor?.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor?.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};(0,r.Cg)([(0,h.MZ)({type:n.A,json:{write:!0}})],f.prototype,"backgroundColor",void 0),(0,r.Cg)([(0,h.MZ)({type:n.A,json:{write:!0}})],f.prototype,"borderLineColor",void 0),(0,r.Cg)([(0,h.MZ)({type:Number,json:{write:!0},cast:a.cr})],f.prototype,"borderLineSize",void 0),(0,r.Cg)([(0,h.MZ)({type:c.A,json:{write:!0}})],f.prototype,"font",void 0),(0,r.Cg)([(0,h.MZ)({...u.rM,json:{write:!0}})],f.prototype,"horizontalAlignment",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"kerning",void 0),(0,r.Cg)([(0,h.MZ)({type:n.A,json:{write:!0}})],f.prototype,"haloColor",void 0),(0,r.Cg)([(0,h.MZ)({type:Number,cast:a.cr,json:{write:!0}})],f.prototype,"haloSize",null),(0,r.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"rightToLeft",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"rotated",void 0),(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],f.prototype,"text",void 0),(0,r.Cg)([(0,d.e)({esriTS:"text"},{readOnly:!0})],f.prototype,"type",void 0),(0,r.Cg)([(0,h.MZ)({...u.x0,json:{write:!0}})],f.prototype,"verticalAlignment",void 0),(0,r.Cg)([(0,h.MZ)({type:Number,cast:a.cr,json:{write:!0}})],f.prototype,"xoffset",null),(0,r.Cg)([(0,h.MZ)({type:Number,cast:a.cr,json:{write:!0}})],f.prototype,"yoffset",null),(0,r.Cg)([(0,h.MZ)({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],f.prototype,"angle",void 0),(0,r.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],f.prototype,"width",void 0),(0,r.Cg)([(0,h.MZ)({type:Number})],f.prototype,"lineWidth",null),(0,r.Cg)([(0,p.K)("lineWidth")],f.prototype,"writeLineWidth",null),(0,r.Cg)([(0,h.wg)("lineWidth")],f.prototype,"castLineWidth",null),(0,r.Cg)([(0,h.MZ)(u.Tb)],f.prototype,"lineHeight",void 0),(0,r.Cg)([(0,p.K)("lineHeight")],f.prototype,"writeLineHeight",null),f=i=(0,r.Cg)([(0,h.$K)("esri.symbols.TextSymbol")],f)},5760(e,t,s){s.d(t,{NM:()=>a,Tb:()=>h,_R:()=>o,h9:()=>n,rM:()=>c,x0:()=>l,y7:()=>u});var i=s(34727),r=s(56507);const n=["none","underline","line-through"],o=["normal","italic","oblique"],a=["normal","lighter","bold","bolder"],h={type:Number,cast:e=>{const t=(0,r.GB)(e);return 0===t?1:(0,i.qE)(t,.1,4)},nonNullable:!0},c={type:["left","right","center"],nonNullable:!0},l={type:["baseline","top","middle","bottom"],nonNullable:!0},u=8},94104(e,t,s){s.r(t),s.d(t,{default:()=>Bc});var i=s(49186),r=s(36563),n=s(44208),o=s(26390),a=s(17676),h=s(87811),c=s(36708),l=s(90629),u=s(8341),d=s(87045),p=s(76213);class f{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(e){"error"===e.type&&e.error&&"toJSON"in e.error&&(e.error=e.error.toJSON()),(0,u.oV)(this._eventLog.onEvent(e))}}var _=s(97768),m=s(93637),g=s(6797),y=s(62577),x=s(21325),b=s(44159);function w(e,t){return[e,t]}function v(e,t,s){return e[0]=t,e[1]=s,e}const S=new b.A("0/0/0/0");class I{static create(e,t,s=null){const i=(0,x.Vp)(e.spatialReference),r=t.origin||w(e.origin.x,e.origin.y),n=w(e.size[0]*t.resolution,e.size[1]*t.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}=t;let u,d,p,f;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)),e.isWrappable?(u=w(Math.ceil(Math.round((i.valid[1]-i.valid[0])/t.resolution)/e.size[0]),h[1]),d=!0,p=i.origin,f=i.valid):(u=h,d=!1),new I(t.level,t.resolution,t.scale,r,o,a,h,n,u,d,p,f)}constructor(e,t,s,i,r,n,o,a,h,c,l,u){this.level=e,this.resolution=t,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(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}normalizeKey(e){if(!this.wrap)return;const t=this.worldSize[0],s=e.col;s<0?(e.col=s+t,e.world-=1):s>=t&&(e.col=s-t,e.world+=1)}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const t=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,i=this._spatialReferenceValid;return this.wrap&&s&&i?t===s[0]?i[0]:this.origin[0]===s[0]&&e===this.worldSize[0]?i[1]:t:t}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,s=!1){S.set(t);const i=s?S.col:this.denormalizeCol(S.col,S.world),r=S.row;return function(e,t,s,i,r){e[0]=t,e[1]=s,e[2]=i,e[3]=r}(e,this.getXForColumn(i),this.getYForRow(r+1),this.getXForColumn(i+1),this.getYForRow(r)),e}getTileCoords(e,t,s=!1){S.set(t);const i=s?S.col:this.denormalizeCol(S.col,S.world);return Array.isArray(e)?v(e,this.getXForColumn(i),this.getYForRow(S.row)):(e.x=this.getXForColumn(i),e.y=this.getYForRow(S.row)),e}}var P=s(93687);class M{constructor(){this.spans=[]}static{this.pool=new P.A(()=>new M)}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}*keys(){const e=this.lodInfo;for(const{row:t,colFrom:s,colTo:i}of this.spans)for(let r=s;r<=i;r++){const s=e.getWorldForColumn(r);yield new b.A(e.level,t,e.normalizeCol(r),s)}}forEach(e,t){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++)e.call(t,r,n,i.normalizeCol(s),i.getWorldForColumn(s))}}class k{constructor(e,t,s){this.row=e,this.colFrom=t,this.colTo=s}}const C=new b.A("0/0/0/0");class A{static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[s,i]=e,[r,n]=t,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 A(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(e,t,s,i,r,n,o,a){this.x=e,this.ymin=t,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 T=[[0,0],[0,0],[0,0],[0,0]];class F{constructor(e,t=null,s=e.lods[0].level,i=e.lods[e.lods.length-1].level){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._infoByScale={},this._infoByLevel={};const r=e.lods.filter(e=>e.level>=s&&e.level<=i);this.minScale=r[0].scale,this.maxScale=r[r.length-1].scale;const n=this._lodInfos=r.map(s=>I.create(e,s,t));r.forEach((e,t)=>{this._infoByLevel[e.level]=n[t],this._infoByScale[e.scale]=n[t],this.scales[t]=e.scale},this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}get origin(){return this.tileInfo.origin}get size(){return this.tileInfo.size}getLODInfoAt(e){return this._infoByLevel["number"==typeof e?e:e.level]}getTileBounds(e,t,s=!1){C.set(t);const i=this._infoByLevel[C.level];return i?i.getTileBounds(e,C,s):e}getTileCoords(e,t,s=!1){C.set(t);const i=this._infoByLevel[C.level];return i?i.getTileCoords(e,C,s):e}getTileCoverage(e,t=192,s=!0,i="closest"){if(!s&&(e.scale>this.minScale||e.scale<this.maxScale))return null;const r="closest"===i?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),n=M.pool.acquire(r),o=this._wrap;let a,h,c,l=1/0,u=-1/0;const d=n.spans;T[0][0]=T[0][1]=T[1][1]=T[3][0]=-t,T[1][0]=T[2][0]=e.size[0]+t,T[2][1]=T[3][1]=e.size[1]+t;for(const t of T)e.toMap(t,t),t[0]=r.getColumnForX(t[0]),t[1]=r.getRowForY(t[1]);const p=[];let f=3;for(let e=0;e<4;e++){if(T[e][1]===T[f][1]){f=e;continue}const t=A.create(T[e],T[f]);l=Math.min(t.ymin,l),u=Math.max(t.ymax,u),void 0===p[t.ymin]&&(p[t.ymin]=[]),p[t.ymin].push(t),f=e}if(null==l||null==u||u-l>100)return null;let _=[];for(a=l;a<u;){null!=p[a]&&(_=_.concat(p[a])),h=1/0,c=-1/0;for(let e=_.length-1;e>=0;e--){const t=_[e];h=Math.min(h,t.getLeftCol()),c=Math.max(c,t.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 e=Math.floor(c/r.worldSize[0]);for(let t=Math.floor(h/r.worldSize[0]);t<=e;t++)d.push(new k(a,Math.max(r.getFirstColumnForWorld(t),h),Math.min(r.getLastColumnForWorld(t),c)))}else d.push(new k(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 k(a,h,c)));a+=1;for(let e=_.length-1;e>=0;e--){const t=_[e];t.ymax>=a?t.incrRow():_.splice(e,1)}}return n}getTileParentId(e){C.set(e);const t=this._infoByLevel[C.level],s=this._lodInfos.indexOf(t)-1;return s<0?null:(this._getTileIdAtLOD(C,this._lodInfos[s],C),C.id)}getTileResolution(e){const t=this._infoByLevel["object"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){C.set(t);const s=this._infoByLevel[C.level],i=e.lodInfo;if(i.resolution>s.resolution){this._getTileIdAtLOD(C,i,C);const t=i.denormalizeCol(C.col,C.world);for(const s of e.spans)if(s.row===C.row&&s.colFrom<=t&&s.colTo>=t)return!0}if(i.resolution<s.resolution){const[t,r,n,o]=e.spans.reduce((e,t)=>(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e),[1/0,-1/0,1/0,-1/0]),a=s.denormalizeCol(C.col,C.world),h=i.getColumnForX(s.getXForColumn(a)),c=i.getRowForY(s.getYForRow(C.row)),l=i.getColumnForX(s.getXForColumn(a+1))-1,u=i.getRowForY(s.getYForRow(C.row+1))-1;return!(h>o||l<n||c>r||u<t)}const r=i.denormalizeCol(C.col,C.world);return e.spans.some(e=>e.row===C.row&&e.colFrom<=r&&e.colTo>=r)}normalizeBounds(e,t,s){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const t=(0,x.Vp)(this.tileInfo.spatialReference),i=-s*(t.valid[1]-t.valid[0]);e[0]+=i,e[2]+=i}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let s=1;s<t.length-1;s++)if(e>t[s]+1e-6)return this._infoByScale[t[s-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce((t,s)=>Math.abs(s-e)<Math.abs(t-e)?s:t,t[0])),this._infoByScale[e]}scaleToLevel(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let s=t.length-1;s>=0;s--)if(e<t[s])return s===t.length-1?this._infoByScale[t[t.length-1]].level:this._infoByScale[t[s]].level+(t[s]-e)/(t[s]-t[s+1]);return this._infoByScale[t[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}zoomToScale(e){return this.tileInfo.zoomToScale(e)}_getTileIdAtLOD(e,t,s){const i=this._infoByLevel[s.level];return e.set(s),t.resolution<i.resolution?null:(t.resolution===i.resolution||(e.level=t.level,e.col=Math.floor(s.col*i.resolution/t.resolution+.01),e.row=Math.floor(s.row*i.resolution/t.resolution+.01)),e)}}var z=s(5482),E=s(69622),O=s(91869),R=s(3483),L=s(91429),D=s(37585),q=s(9775),N=s(32587),G=s(76030),B=s(44794);class W{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class j{constructor(e){this._schedule=null,this._task=null,this._deferreds=new N.A,this._controllers=new N.A,this._processingItems=new N.A,this._pausedSignal=(0,B.v)(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new q.A(e.peeker),this.process=e.process;const t=e.scheduler;e.priority&&t&&(this._task=t.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=(0,_.xt)(this._schedule),this._task=(0,_.xt)(this._task)}get updating(){return!!this._task?.updating||this.readyToRun}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(t=>e.push(t)),this._controllers.clear(),e.forEach(e=>e.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,s)=>e(s))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const s=this.get(e);if(s)return s;const i=new AbortController;let r=null;t&&(r=(0,a.u7)(t,()=>i.abort()));const n=()=>{o.remove(),null!=r&&r.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},o=(0,a.NY)(i.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),n(),h.reject((0,a.NK)())}),h=Promise.withResolvers();return this._deferreds.set(e,h),this._controllers.set(e,i),h.promise.then(n,n),this._queue.push(e),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject((0,a.NK)()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get readyToRun(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}runTask(e){for(;!e.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),e.madeProgress()}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._task||this._pausedSignal.value||this._schedule||(this._schedule=(0,G._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const s=new AbortController,i=new W(e,s);this._processingItems.set(e,i);try{t=this.process(e,s.signal)}catch(e){this._processError(i,e)}(0,a.$X)(t)?(i.promise=t,t.then(e=>this._processResult(i,e),e=>this._processError(i,e))):this._processResult(i,t)}get test(){}}const U=[0,0];let V=class extends E.A{constructor(e){super(e),this._keyToItem=new Map,this._tilesByScale=new Map,this.concurrency=6}initialize(){const{concurrency:e,process:t,scheduler:s,priority:i}=this;this._queue=new j({concurrency:e,scheduler:s,priority:i,process:(e,s)=>{const i=this._keyToItem.get(e);return t(i,{signal:s})},peeker:e=>this._peek(e)})}destroy(){this.clear(),this._queue=(0,_.pR)(this._queue)}get length(){return this._queue?this._queue.length:0}abort(e){const t="string"==typeof e?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(e){return"string"==typeof e?this._keyToItem.has(e):this._keyToItem.has(e.id)}pause(){this._queue.pause()}push(e){const t=e.key.id;if(this._queue.has(t))return this._queue.get(t);const s=this._queue.push(t),i=this.tileInfoView.getTileScale(e.key),r=(0,O.tE)(this._tilesByScale,i,()=>new Set),n=()=>{r.delete(e.key),0===r.size&&this._tilesByScale.delete(i),this._keyToItem.delete(t)};return r.add(e.key),this._keyToItem.set(t,e),s.then(n,n),s}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(e){if(!this.state)return e.values().next().value;const t=new Set;for(const s of e)t.add(this._keyToItem.get(s).key);const s=this.state.scale;let i,r=Number.POSITIVE_INFINITY;for(const[e,n]of this._tilesByScale)if((0,R.bw)(n,e=>t.has(e))){const t=Math.abs(e-s);t<r&&(i=n,r=t)}return this._getClosestTileKey(i,e).id}_getClosestTileKey(e,t){const s=this.tileInfoView,i=this.state.center;let r,n=Number.POSITIVE_INFINITY;for(const o of e)if(t.has(o.id)){s.getTileCoords(U,o);const e=(0,D.Io)(U,i);e<n&&(n=e,r=o)}return r}};(0,z.Cg)([(0,L.MZ)({constructOnly:!0})],V.prototype,"concurrency",void 0),(0,z.Cg)([(0,L.MZ)({constructOnly:!0})],V.prototype,"priority",void 0),(0,z.Cg)([(0,L.MZ)({constructOnly:!0})],V.prototype,"process",void 0),(0,z.Cg)([(0,L.MZ)({constructOnly:!0})],V.prototype,"scheduler",void 0),(0,z.Cg)([(0,L.MZ)()],V.prototype,"state",void 0),(0,z.Cg)([(0,L.MZ)({constructOnly:!0})],V.prototype,"tileInfoView",void 0),V=(0,z.Cg)([(0,L.$K)("esri.views.2d.tiling.TileQueue")],V);var Y=s(19419);new b.A(0,0,0,0),new Map;class H{static{this.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT}static{this.estimatedMemory=40}constructor(e,t,s,i,r,n,o){this.instanceId=e,this.textureKey=t,this.indexStart=s,this.indexCount=i,this.vertexStart=r,this.vertexCount=n,this.overlaps=o}updateBaseOffsets(e){this.vertexStart+=e.vertexFrom,this.indexStart+=e.indexFrom}clone(){return new H(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(e,t,s,i,r,n,o,a){e.push(t),e.push(s),e.push(i),e.push(r),e.push(n),e.push(o),e.push(a)}serialize(e){return e.push(this.instanceId),e.push(this.textureKey),e.push(this.indexStart),e.push(this.indexCount),e.push(this.vertexStart),e.push(this.vertexCount),e.push(this.overlaps),e}static deserialize(e){const t=e.readInt32(),s=e.readInt32(),i=e.readInt32(),r=e.readInt32(),n=e.readInt32(),o=e.readInt32(),a=e.readInt32();return new H(t,s,i,r,n,o,a)}}function X(e,t){if(null!==t){e.push(t.length);for(const s of t)s.serialize(e);return e}e.push(0)}function $(e,t,s){const i=e.readInt32(),r=new Array(i);for(let i=0;i<r.length;i++)r[i]=t.deserialize(e,s);return r}class Z{static{this.byteSizeHint=2*Uint32Array.BYTES_PER_ELEMENT+H.byteSizeHint}static estimateMemory(e){return 24+H.estimatedMemory*e}constructor(e,t){this.id=e,this.sortKey=t,this.records=[]}serialize(e){return e.push(this.id),e.writeF32(this.sortKey),X(e,this.records),e}static deserialize(e){const t=e.readInt32(),s=e.readF32(),i=new Z(t,s);return i.records=$(e,H)??[],i}}class Q{get length(){return this._pos}constructor(e,t){this._pos=0;const s=t?this._roundToNearest(t,e.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(s),this._buffer=new e(this._array),this._ctor=e,this._i16View=new Int16Array(this._array)}_roundToNearest(e,t){const s=Math.round(e);return 1===t?s:s+(t-s%t)}_ensureSize(e){if(this._pos+e>=this._buffer.length){const t=this._roundToNearest(1.25*(this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),s=new ArrayBuffer(t),i=new this._ctor(s);i.set(this._buffer,0),this._array=s,this._buffer=i,this._i16View=new Int16Array(this._array)}}ensureSize(e){this._ensureSize(e)}writeF32(e){this._ensureSize(1);const t=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,t}push(e){this._ensureSize(1);const t=this._pos;return this._buffer[this._pos++]=e,t}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,t){this._buffer[e]=t}i1616Add(e,t,s){this._i16View[2*e]+=t,this._i16View[2*e+1]+=s}getValue(e){return this._buffer[e]}getValueF32(e){return new Float32Array(this._array,4*e,1)[0]}incr(e){if(this._buffer.length<e)throw new Error("Increment index overflows the target buffer");this._buffer[e]++}decr(e){this._buffer[e]--}writeRegion(e){this._ensureSize(e.length);const t=this._pos;return this._buffer.set(e,this._pos),this._pos+=e.length,t}writeManyFrom(e,t,s){this._ensureSize(s-t);for(let i=t;i!==s;i++)this.writeFixed(e._buffer[i])}buffer(){const e=this._array.slice(0,4*this._pos);return this.destroy(),e}toArray(){return[...this._buffer]}seek(e){this._pos=e}destroy(){this._array=null,this._buffer=null}}class J{constructor(e,t,s=0){const i=6*s*Uint32Array.BYTES_PER_ELEMENT,r=4*s*t.stride,n=t.stride/4,o=t.attributes.find(e=>"pos"===e.name||"position"===e.name);if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...t,position:o},this._indices=new Q(Uint32Array,i),this._vertices=new Q(Uint32Array,r),this._metrics=new Q(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=e}serialize(e){const t=this._indices.buffer(),s=this._vertices.buffer(),i=this._metrics.length?this._metrics.buffer():null;return e.push(t,s),{instanceId:this._instanceId,layout:this.layout,indices:t,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(e){this._vertices.ensureSize(e)}indexEnsureSize(e){this._indices.ensureSize(e)}writeIndex(e){this._indices.push(e)}writeVertex(e){this._vertices.push(e)}writeVertexRegion(e){this._vertices.writeRegion(e)}writeVertexF32(e){this._vertices.writeF32(e)}writeMetric(e){this._metrics.incr(this._metricCountOffset),e.serialize(this._metrics)}}class K{constructor(e,t=0){this._id=e,this._sizeHint=t,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._requiresRefresh=!1,this._entities=new Q(Uint32Array,this._sizeHint*Z.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const e=new Array,t=[],s=this._entities.buffer();for(const s of this._instanceIdToVertexData.values())t.push(s.serialize(e));return{message:{data:t,entities:s},transferList:e}}get requiresRefresh(){return this._requiresRefresh}set requiresRefresh(e){this._requiresRefresh=e}vertexStart(){return this._current.vertexStart??0}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteRegion(e){this._current.writer.writeVertexRegion(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}recordBounds(e,t,s,i){}indexWrite(e){this._current.writer.writeIndex(e)}metricStart(e){this._current.metric=e,this._current.metric.recordStart=this.recordCount()}metricEnd(){const e=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?(e.writeMetric(this._current.metric),this._current.metric=null):this._current.metric=null}metricBoxWrite(e){this._current.metric.bounds.push(e)}entityStart(e,t=e){this._entityIdIndex=this._entities.push(e),this._entitySortKeyIndex=this._entities.writeF32(t),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(e,t,s=0){this._current.writer=this._getVertexWriter(e,t),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=e,this._current.layoutHash=t.hash,this._current.textureKey=s}recordEnd(e=0){const t=this._current.vertexStart,s=this._current.writer.vertexCount-t;if(!s)return!1;const i=this._current.indexStart,r=this._current.writer.indexCount-i;return this._recordIndexStart=i,this._recordIndexCount=r,this._recordVertexStart=t,this._recordVertexCount=s,this._entities.incr(this._entityRecordCountOffset),H.write(this._entities,this._current.instanceId,this._current.textureKey,i,r,t,s,e),!0}copyLast(e,t){const s=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),H.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 e=this._recordIndexStart;e!==n;e++){const t=i.getValue(e);i.push(t+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*a,c=(this._recordVertexStart+this._recordVertexCount)*a;for(let e=h;e!==c;e++){const t=r.getValue(e);r.push(t)}const l=this._current.writer.layout.position,u=l.packPrecisionFactor??1,d=l.offset/Uint32Array.BYTES_PER_ELEMENT,p=e*u,f=t*u;for(let e=s*a;e<=r.length;e+=a)r.i1616Add(e+d,p,f)}copyLastFrom(e,t,s){const i=e._entities.getValue(e._entityIdIndex);if(i!==this._entities.getValue(this._entityIdIndex)){const t=e._entities.getValueF32(e._entitySortKeyIndex);this.entityStart(i,t)}this.recordStart(e._current.instanceId,e._current.writer.layout,e._current.textureKey);const r=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=e._current.vertexStart-n,a=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,c=e._current.writer.indexWriter,l=e._current.writer.vertexWriter;for(let t=e._current.indexStart;t!==c.length;t++){const e=c.getValue(t);a.push(e-o)}for(let t=e._current.vertexStart*r;t!==l.length;t++){const e=l.getValue(t);h.push(e)}const u=this._current.writer.layout.position,d=u.packPrecisionFactor??1,p=u.offset/Uint32Array.BYTES_PER_ELEMENT,f=t*d,_=s*d;for(let e=n*r;e<=h.length;e+=r)h.i1616Add(e+p,f,_);this.recordEnd()}_getVertexWriter(e,t){const s=this._instanceIdToVertexData;return s.has(e)||s.set(e,new J(e,t,this._sizeHint)),s.get(e)}}function ee(e){switch(e){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function te(e){switch(e){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class se{constructor(e,t,s,i,r=0){this.tileKey=e,this._bufferingEnabled=t,this._sizeHint=r,this._meshes={self:new K(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=i?1:0;this._copyBufferedDataIntoSelf=s&&this._bufferingEnabled&&e.level===n}get id(){return this.tileKey.id}get requiresRefresh(){return this._meshes.self.requiresRefresh||this._meshes.neighbors.some(e=>e.requiresRefresh)}set requiresRefresh(e){this._meshes.self.requiresRefresh=e}vertexStart(){return this._meshes.self.vertexStart()??0}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,t=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,t)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const t=1<<e;this._currentEntityOverlaps&t&&this._meshes.neighbors[e].entityEnd()}}}recordStart(e,t,s){this._currentRecordOverlaps=0,this._meshes.self.recordStart(e,t,s)}recordEnd(e=0){const t=this._meshes.self.recordEnd(this._currentRecordOverlaps);return t&&0!==this._currentRecordOverlaps?(this._copyIntoNeighbors(),this._currentEntityOverlaps|=this._currentRecordOverlaps,!0):t}recordBounds(e,t,s,i){this._bufferingEnabled&&this._addOverlap(e,t,s,i)}recordCount(){return this._meshes.self.recordCount()}metricStart(e){this._meshes.self.metricStart(e)}metricBoxWrite(e){this._meshes.self.metricBoxWrite(e)}metricEnd(){this._meshes.self.metricEnd()}vertexWrite(e){this._meshes.self.vertexWrite(e)}vertexWriteF32(e){this._meshes.self.vertexWriteF32(e)}vertexWriteRegion(e){this._meshes.self.vertexWriteRegion(e)}indexWrite(e){this._meshes.self.indexWrite(e)}serialize(e){const t={message:[],transferList:[]},s=this._meshes.self.serialize();return t.message.push({tileId:this.tileKey.id,requiresRefresh:this.requiresRefresh,...s.message}),t.transferList.push(...s.transferList),this._meshes.neighbors.forEach((s,i)=>{const r=s.serialize(),n=1<<i,o=ee(n),a=te(n),h=new b.A(this.tileKey).getNormalizedNeighbor(o,a,e);t.message.push({tileId:h.id,requiresRefresh:this.requiresRefresh,...r.message}),t.transferList.push(...r.transferList)}),t}_addOverlap(e,t,s,i){const r=Math.min(p.CQ/2,s),n=Math.min(p.CQ/2,i),o=255^((e<0+r?148:e>=p.CQ-r?41:189)|(t<0+n?224:t>=p.CQ-n?7:231));this._currentRecordOverlaps|=o}_copyIntoNeighbors(){for(let e=0;e<8;e++){const t=1<<e;if(this._currentRecordOverlaps&t){if(this._copyBufferedDataIntoSelf){const e=-ee(t)*p.CQ,s=-te(t)*p.CQ;if(0!==s)continue;this._meshes.self.copyLast(e,s);continue}if(!this._meshes.neighbors[e]){const s=Math.floor(this._sizeHint/16);this._meshes.neighbors[e]=new K(t,s)}const s=this._meshes.neighbors[e],i=-ee(t)*p.CQ,r=-te(t)*p.CQ;s.copyLastFrom(this._meshes.self,i,r)}}}}class ie{}var re=s(72691),ne=s(73681);class oe{constructor(){this._defaultResult=null,this._backgroundFillResult=null}static async from(e,t){const s=new oe;return s.setDefault(await e.createMeshWriters(t.meshes)),s}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}getBackgroundFill(){return this._backgroundFillResult}setBackgroundFill(e){this._backgroundFillResult=e}hasArcadeDependency(e){return this._defaultResult?.some(t=>t.hasArcadeDependency(e))??!1}match(e,t,s){const i=this.doMatch(e,t)||this.getDefault();if(i&&i.length>0){const e=this.getBackgroundFill();if(e)return[...e,...i]}return i}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}}class ae extends oe{static async fromDictionaryRenderer(e,t){const s=await ne.n.from(t.dictionaryInfo,t.userConfig,t.fieldMap);return new ae(e,s)}constructor(e,t){super(),this._context=e,this._evaluator=t,this._controlStringToPromise=new Map,this._controlStringToGroup=new Map}async fetchResources(e,t){const s=t.getCursor(),i=new Set;for(;s.next();){const e=this._evaluateControlString(s);e&&i.add(e)}const r=Array.from(i.values()).map(t=>this._ensureGroup(e,t));await Promise.all(r)}match(e,t){const s=this._evaluateControlString(e);return s?this._controlStringToGroup.get(s):null}_evaluateControlString(e){const t=e.readLegacyFeatureWorldSpace();return this._evaluator.evaluate(t,0,e.fields,null)}_ensureGroup(e,t){let s=this._controlStringToPromise.get(t);return null==s&&(s=this._fetchGroup(e,t),this._controlStringToPromise.set(t,s)),s}async _fetchGroup(e,t){const s=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",controlString:t});if(!s)return;const i=await this._context.createMeshWriters(s.meshes);this._controlStringToGroup.set(t,i)}}class he extends oe{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t){const s=await e.storage.createComputedField(t),i=new he(s,t.isMaxInclusive);await Promise.all(t.intervals.map(async t=>{const s=[...await e.createMeshWriters(t.meshes),...await e.createMeshWriters(t.alternateMeshes)];i.add(t,s)}));const r=await e.createMeshWriters(t.defaultSymbol);i.setDefault(r);const n=await e.createMeshWriters(t.backgroundFill);return i.setBackgroundFill(n),i}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((e,t)=>e.interval.min-t.interval.min)}size(){return super.size()+this._intervals.length}hasArcadeDependency(e){return this._field?.hasArcadeDependency(e)||this._intervals.some(t=>t.result.some(t=>t.hasArcadeDependency(e)))}doMatch(e,t){const s=this._field?.read(e,t);if(null==s||isNaN(s)||s===1/0||s===-1/0)return null;for(let e=0;e<this._intervals.length;e++){const{interval:t,result:i}=this._intervals[e],r=s>=t.min,n=this._isMaxInclusive?s<=t.max:s<t.max;if(r&&n)return i}return null}}class ce extends oe{static async fromLabelSchema(e,t){const s=t.classes.map(async t=>{const s=await e.createMeshWriters(t.meshes);return{minScale:t.minScale,maxScale:t.maxScale,meshes:s,expression:null,where:await e.storage.createWhereClause(t.where)}}),i=await Promise.all(s);return new ce(i)}constructor(e){super(),this._labels=e}match(e,t,s){if(!this._labels.length)return null;const i=this._getLabels(t.$view.scale),r=[];for(const t of i)t.where&&!t.where(e,s)||r.push(...t.meshes);return r}hasArcadeDependency(e){return this._labels.some(t=>t.meshes.some(t=>t.hasArcadeDependency(e)))}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const s=t-t/4,i=t+t/2;return(!e.minScale||e.minScale>=s)&&(!e.maxScale||e.maxScale<=i)}}class le extends oe{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t){const s=t.expression?[e.storage.createComputedField({expression:t.expression})]:[t.field?e.storage.createComputedField({field:t.field}):null,t.field2?e.storage.createComputedField({field:t.field2}):null,t.field3?e.storage.createComputedField({field:t.field3}):null],i=(await Promise.all(s)).filter(e=>!!e),r=new le(i,t.fieldDelimiter),n=await e.createMeshWriters(t.defaultSymbol);r.setDefault(n);const o=await e.createMeshWriters(t.backgroundFill);return r.setBackgroundFill(o),await Promise.all(t.map.map(async(t,s)=>{const i=[...await e.createMeshWriters(t.meshes),...await e.createMeshWriters(t.alternateMeshes)];"<Null>"===t.value?r.setNullResult(i):r.add(t.value,i,s+1)})),r}setNullResult(e){this._nullResult=e}getSortKey(e,t){const s=this._getValueFromFields(e,t);if(null==s||""===s||"<Null>"===s)return 0;const i=this._resultsMap.get(s.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(e,t,s){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:s}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,s+1)}size(){return super.size()+this._resultsMap.size}hasArcadeDependency(e){return this._fields.some(t=>t.hasArcadeDependency(e))||[...this._resultsMap.values()].some(t=>t.meshWriters.some(t=>t.hasArcadeDependency(e)))||this._nullResult?.some(t=>t.hasArcadeDependency(e))||!1}doMatch(e,t){const s=this._getValueFromFields(e,t);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(e,t){const s=[];for(const i of this._fields){const r=i.read(e,t);null==r||""===r?s.push("<Null>"):s.push(r)}return s.join(this._separator)}}async function ue(e,t){switch(t.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return oe.from(e,t);case"interval":return he.fromIntervalSchema(e,t);case"dictionary":return ae.fromDictionaryRenderer(e,t);case"label":return ce.fromLabelSchema(e,t);case"map":return le.fromMatcherSchema(e,t);case"subtype":return de.fromSubtypes(e,t);case"cluster":return pe.fromClusterSchema(e,t);case"track":return fe.fromTrackSchema(e,t);default:throw new Error("Impl")}}class de extends oe{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const s=new Map,i=[];for(const r in t.renderers){const n=parseInt(r,10),o=ue(e,t.renderers[r]).then(e=>s.set(n,e));i.push(o)}return await Promise.all(i),new de(s,t.subtypeField)}match(e,t,s){const i=e.readAttribute(this._subtypeField),r=this._subMatchers.get(i);return r?r.match(e,t,s):null}hasArcadeDependency(e){for(const t of this._subMatchers.values())if(t.hasArcadeDependency(e))return!0;return!1}}class pe extends oe{static async fromClusterSchema(e,t){const[s,i]=await Promise.all([ue(e,t.feature),ue(e,t.cluster)]);return new pe(s,i)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t,s){return 1===e.readAttribute("cluster_count")?this._featureMatcher.match(e,t,s):this._clusterMatcher.match(e,t,s)}hasArcadeDependency(e){return this._featureMatcher.hasArcadeDependency(e)||this._clusterMatcher.hasArcadeDependency(e)}}class fe extends oe{static async fromTrackSchema(e,t){const[s,i,r]=await Promise.all([ue(e,t.previousObservation),ue(e,t.latestObservation),ue(e,t.trackLine)]);return new fe(s,i,r)}constructor(e,t,s){super(),this._previousObservationMatcher=e,this._latestObservationMatcher=t,this._trackLineMatcher=s}match(e,t,s){switch(e.readAttribute(re.EA)){case 0:return this._trackLineMatcher.match(e,t,s);case 1:return this._latestObservationMatcher.match(e,t,s);case 2:return this._previousObservationMatcher.match(e,t,s)}return null}hasArcadeDependency(e){return this._trackLineMatcher.hasArcadeDependency(e)||this._latestObservationMatcher.hasArcadeDependency(e)||this._previousObservationMatcher.hasArcadeDependency(e)}}class _e extends ie{static async create(e,t){const s=await ue(e,t.symbology),i=t.labels?await ue(e,t.labels):null;return new _e(s,i)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,s,i){const r=this._symbology.match(t,s,i);if(r){for(const i of r)i.enqueueRequest(e,t,s);if(this._labels){const r=this._labels.match(t,s,i);if(!r)return;for(const i of r)i.enqueueRequest(e,t,s)}}}write(e,t,s,i,r,n,o){const a=this._symbology.match(s,i,r);if(a){for(const r of a)r.write(e,t,s,i,n);if(e.entityRecordCount()>=1&&this._labels){const h=this._labels.match(s,i,r);if(!h)return;for(const r of h)r.setReferences(a),r.write(e,t,s,i,n,o)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}hasArcadeDependency(e){return!(!this._symbology.hasArcadeDependency(e)&&!this._labels?.hasArcadeDependency(e))}}var me=s(799);class ge{}class ye extends ge{constructor(e){super(),this._fetcher=e,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(e){const t=function(e){return"url"in e&&"urlHash"in e?{...e,url:""}:e}(e.resource),s=(0,me.Wm)(JSON.stringify(t));return this._pendingIds.has(s)||(this._pendingIds.add(s),this._pendingRequests.push({...e,resourceId:s})),s}async fetchEnqueuedResources(){const e=this._pendingRequests;if(this._pendingIds.clear(),this._pendingRequests=[],0===e.length)return;const t=await this._fetcher.fetch(e,this._abortOptions);for(let s=0;s<t.length;s++){const i=e[s].resourceId;this._resourceIdToResource.set(i,t[s])}}async fetchResourceImmediate(e){const t=await this._fetcher.fetch([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch resources");return t[0]}async fetchDictionaryResourceImmediate(e){const t=await this._fetcher.fetchDictionary([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch dictionary resources");return t[0]}getResource(e){return this._resourceIdToResource.get(e)}}var xe=s(36745),be=s(28076);const we=1024;be.D.CIMSolidStroke.capstyle,be.D.CIMSolidStroke.joinstyle,be.D.CIMSolidStroke.miterlimit;class ve{static{this.instance=null}static local(){return null===ve.instance&&(ve.instance=new ve),ve.instance}execute(e,t){return new Se(e,t)}}class Se{constructor(e,t){this._inputGeometries=e,this._angleTolerance=void 0!==t.angleTolerance?t.angleTolerance:120,this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}next(){let e=this._inputGeometries.next();if(!e)return null;for(;e;){if("esriGeometryPolygon"===e.geometryType)this._isClosed=!0;else if("esriGeometryPolyline"===e.geometryType)this._isClosed=!1;else{if("esriGeometryEnvelope"!==e.geometryType){e=this._inputGeometries.next();continue}if(this._maxCosAngle)return e;this._isClosed=!0}for(;e.nextPath();)this._processPath(e);return e.reset(),e}return null}_processPath(e){if(e.nextPoint()){const t=e.x,s=e.y;let i=t,r=s,n=e.pathSize,o=0,a=0,h=0,c=0,l=0,u=0;this._isClosed&&++n;for(let d=1;e.nextPoint()||d<n;++d){let p,f;this._isClosed&&d===n-1?(p=t,f=s):(p=e.x,f=e.y);const _=p-i,m=f-r,g=Math.sqrt(_*_+m*m);d>1&&g>0&&h>0&&(o*_+a*m)/g/h<=this._maxCosAngle&&e.setControlPointAt(d-1),1===d&&(c=_,l=m,u=g),g>0&&(i=p,r=f,o=_,a=m,h=g)}this._isClosed&&h>0&&u>0&&(o*c+a*l)/u/h<=this._maxCosAngle&&e.setControlPointAt(0)}}}var Ie=s(51118);class Pe{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(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}}function Me(e,t){e[4]=t}class ke{constructor(e,t=!0,s=!0,i=0){this._angleToLine=!0,this._keepUpright=!1,this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&"esriGeometryPolygon"===e.geometryType||!s&&"esriGeometryPolyline"===e.geometryType?null:e,this.geomUnitsPerPoint=i,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new Pe}next(){if(!this.geometryCursor)return null;const e=this.processMultiPath(this.geometryCursor);if(this.iterateMultiPath&&e||(this.geometryCursor=null),!e)return null;const t=e.getAngle();if(this._angleToLine&&this._keepUpright&&Math.abs(t)>.5*Math.PI){const s=t+Math.PI,i=Math.atan2(Math.sin(s),Math.cos(s));Number.isNaN(i)||e.setRotate(i)}return e}processMultiPath(e){for(;this.iteratePath||e.pathIndex<e.totalSize-1;){this.iteratePath||e.nextPath(),this.iterateMultiPath=!0;const t=this.processPath(e);if(t)return t}return this.iterateMultiPath=!1,null}}class Ce{constructor(e,t,s,i=0){this.isClosed=!1,this.inputGeometries=e,this.acceptPolygon=t,this.acceptPolyline=s,this.geomUnitsPerPoint=i,this.iteratePath=!1,this.multiPathCursor=null}next(){for(;;){if(!this.multiPathCursor){let e=this.inputGeometries.next();for(;e&&(this.isClosed=this.acceptPolygon&&"esriGeometryPolygon"===e.geometryType||"esriGeometryEnvelope"===e.geometryType,this.multiPathCursor=e,!this.multiPathCursor);)e=this.inputGeometries.next();if(!this.multiPathCursor)return null}for(;this.iteratePath||this.multiPathCursor.nextPath();){this.multiPathCursor.seekPathStart();const e=this.processPath(this.multiPathCursor);if(e)return e}this.multiPathCursor=null}}}const Ae=.03;class Te{constructor(e=0,t=!1){}isEmpty(e){if(!e.nextPoint())return!0;let t,s,i,r;for(t=e.x,s=e.y;e.nextPoint();t=s,s=r)if(i=e.x,r=e.y,i!==t||r!==s)return e.seekPathStart(),!1;return e.seekPathStart(),!0}normalize(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);0!==t&&(e[0]/=t,e[1]/=t)}getLength(e,t,s,i){const r=s-e,n=i-t;return Math.sqrt(r*r+n*n)}getSegLength(e){const[[t,s],[i,r]]=e;return this.getLength(t,s,i,r)}getCoord2D(e,t,s,i,r){return[e+(s-e)*r,t+(i-t)*r]}getSegCoord2D(e,t){const[[s,i],[r,n]]=e;return this.getCoord2D(s,i,r,n,t)}getAngle(e,t,s,i,r){const n=s-e,o=i-t;return Math.atan2(o,n)}getAngleCS(e,t,s,i,r,n){null==e&&(e=[0,0]);const o=i-t,a=r-s,h=Math.sqrt(o*o+a*a);return 0!==h?(e[0]=o/h,e[1]=a/h,e):(e[0]=1,e[1]=0,e)}getSegAngleCS(e,t,s){const[[i,r],[n,o]]=t;return this.getAngleCS(e,i,r,n,o,s)}cut(e,t,s,i,r,n){return[r<=0?[e,t]:this.getCoord2D(e,t,s,i,r),n>=1?[s,i]:this.getCoord2D(e,t,s,i,n)]}getSubCurve(e,t,s){const i=xe.z.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(i,e,t,s)?i:null}appendSubCurve(e,t,s,i){e.startPath(),t.seekPathStart();let r=0,n=!0;if(!t.nextPoint())return!1;let o=t.x,a=t.y;for(;t.nextPoint();){const h=this.getLength(o,a,t.x,t.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,t.x,t.y,c,l);if(d&&e.pushPoints(d),u)break;n=!1}}else{if(r+h>i){const s=this.cut(o,a,t.x,t.y,0,(i-r)/h);s&&e.pushPoint(s[1]);break}e.pushXY(t.x,t.y)}r+=h,o=t.x,a=t.y}else o=t.x,a=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let s,i,r,n,o=0;for(s=e.x,i=e.y;e.nextPoint();s=r,i=n){r=e.x,n=e.y;const a=this.getLength(s,i,r,n);if(0!==a){if(o+a>t){const e=(t-o)/a;return this.getCoord2D(s,i,r,n,e)}o+=a}}return null}offset(e,t,s,i,r){if(!e||e.length<2)return null;let n=0,o=e[n++],a=n;for(;n<e.length;){const t=e[n];t[0]===o[0]&&t[1]===o[1]||(n!==a&&(e[a]=e[n]),o=e[a++]),n++}const h=e[0][0]===e[a-1][0]&&e[0][1]===e[a-1][1];if(h&&--a,a<(h?3:2))return null;const c=[];o=h?e[a-1]:null;let l=e[0];for(let r=0;r<a;r++){const n=r===a-1?h?e[0]:null:e[r+1];if(o)if(n){const e=[n[0]-l[0],n[1]-l[1]];this.normalize(e);const r=[l[0]-o[0],l[1]-o[1]];this.normalize(r);const a=r[0]*e[1]-r[1]*e[0],h=r[0]*e[0]+r[1]*e[1];if(0===a&&1===h){l=n;continue}if(a>=0==t<=0){if(h<1){const s=[e[0]-r[0],e[1]-r[1]];this.normalize(s);const n=Math.sqrt((1+h)/2);if(n>1/i){const e=-Math.abs(t)/n;c.push([l[0]-s[0]*e,l[1]-s[1]*e])}}}else switch(s){case"Mitered":{const s=Math.sqrt((1+h)/2);if(s>0&&1/s<i){const i=[e[0]-r[0],e[1]-r[1]];this.normalize(i);const n=Math.abs(t)/s;c.push([l[0]-i[0]*n,l[1]-i[1]*n]);break}}case"Bevelled":c.push([l[0]+r[1]*t,l[1]-r[0]*t]),c.push([l[0]+e[1]*t,l[1]-e[0]*t]);break;case"Rounded":if(h<1){c.push([l[0]+r[1]*t,l[1]-r[0]*t]);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)+e[1]*n,-r[0]*(1-n)-e[0]*n];this.normalize(s),c.push([l[0]+s[0]*t,l[1]+s[1]*t])}}c.push([l[0]+e[1]*t,l[1]-e[0]*t])}break;default:if(a<0)c.push([l[0]+(r[1]+r[0])*t,l[1]+(r[1]-r[0])*t]),c.push([l[0]+(e[1]-e[0])*t,l[1]-(e[0]+e[1])*t]);else{const s=Math.sqrt((1+Math.abs(h))/2),i=[e[0]-r[0],e[1]-r[1]];this.normalize(i);const n=t/s;c.push([l[0]-i[0]*n,l[1]-i[1]*n])}}}else{const e=[l[0]-o[0],l[1]-o[1]];this.normalize(e),c.push([l[0]+e[1]*t,l[1]-e[0]*t])}else{const e=[n[0]-l[0],n[1]-l[1]];this.normalize(e),c.push([l[0]+e[1]*t,l[1]-e[0]*t])}o=l,l=n}return c.length<(h?3:2)?null:(h&&c.push([c[0][0],c[0][1]]),c)}}class Fe{static{this.instance=null}static local(){return null===Fe.instance&&(Fe.instance=new Fe),Fe.instance}execute(e,t,s){return new ze(e,t,s)}}class ze extends Ce{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Te,this._width=(void 0!==t.width?t.width:5)*s,this._arrowType=void 0!==t.geometricEffectArrowType?t.geometricEffectArrowType:void 0!==t.arrowType?t.arrowType:"OpenEnded",this._offsetFlattenError=Ae*s}processPath(e){const t=xe.z.createEmptyOptimizedCIM(e.geometryType);switch(this._arrowType){case"OpenEnded":default:this._constructSimpleArrow(t,e,!0);break;case"Block":this._constructSimpleArrow(t,e,!1);break;case"Crossed":this._constructCrossedArrow(t,e)}return t}_constructSimpleArrow(e,t,s){const i=t.pathLength();let r=this._width;i<2*r&&(r=i/2);const n=this._curveHelper.getSubCurve(t,0,i-r);if(!n||!n.nextPath())return;n.seekPathStart();const o=r/2;if(this._curveHelper.isEmpty(n))return;const a=(0,Ie.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;t.seekInPath(t.pathSize-1);const d=[t.x,t.y];e.pushPath(c),e.nextPath(),e.nextPoint(),e.setControlPoint(),e.pushPoint(u),e.nextPoint(),e.setControlPoint(),e.pushPoint(d),e.nextPoint(),e.setControlPoint(),e.pushPoint(l),e.nextPoint(),e.setControlPoint(),e.pushPoints(h.reverse()),e.setControlPoint(),s||(e.setControlPointAt(0),e.setControlPointAt(e.pathSize-1),e.pushPoint(c[0])),e.reset()}_constructCrossedArrow(e,t){const s=t.pathLength();let i=this._width;s<3.732050807568877*i&&(i=s/3.732050807568877),t.seekPathStart();const r=this._curveHelper.getSubCurve(t,0,s-2.732050807568877*i);if(!r)return;r.nextPath();const n=i/2;if(this._curveHelper.isEmpty(r))return;const o=(0,Ie.A)(r),a=this._constructOffset(o,n);if(!a)return;const h=this._constructOffset(o,-n);if(!h)return;const c=this._curveHelper.getSubCurve(t,0,s-i);if(!c)return;if(c.nextPath(),this._curveHelper.isEmpty(c))return;const l=(0,Ie.A)(c),u=this._constructOffset(l,n);if(!u)return;const d=this._constructOffset(l,-n);if(!d)return;const p=u[u.length-1],f=this._constructArrowBasePoint(u,n/2);if(!f)return;const _=d[d.length-1],m=this._constructArrowBasePoint(d,-n/2);if(!m)return;t.seekInPath(t.pathSize-1);const g=[t.x,t.y];e.pushPath(a),e.nextPath(),e.nextPoint(),e.setControlPoint(),e.pushPoint(_),e.nextPoint(),e.setControlPoint(),e.pushPoint(m),e.nextPoint(),e.setControlPoint(),e.pushPoint(g),e.nextPoint(),e.setControlPoint(),e.pushPoint(f),e.nextPoint(),e.setControlPoint(),e.pushPoint(p),e.nextPoint(),e.setControlPoint(),e.pushPoints(h.reverse()),e.nextPoint(),e.setControlPoint(),e.reset()}_constructOffset(e,t){return this._curveHelper.offset(e,t,"Rounded",4,this._offsetFlattenError)}_constructArrowBasePoint(e,t){if(!e||e.length<2)return null;const s=e[e.length-2],i=e[e.length-1],r=[i[0]-s[0],i[1]-s[1]];return this._curveHelper.normalize(r),[i[0]+r[1]*t,i[1]-r[0]*t]}}var Ee=s(16930),Oe=s(6774),Re=s(93397);const Le=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(1352),s.e(6160)]).then(s.bind(s,46160))),De=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(5666)]).then(s.bind(s,55666))),qe=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(1190)]).then(s.bind(s,51190))),Ne=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(7528)]).then(s.bind(s,97528))),Ge=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(1352),s.e(795)]).then(s.bind(s,50795))),Be=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(5605)]).then(s.bind(s,15605))),We=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(3637)]).then(s.bind(s,3637))),je=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299)]).then(s.bind(s,83299)));let Ue;function Ve(e){switch(e.type){case"CIMGeometricEffectDonut":case"CIMGeometricEffectBuffer":return Le.getImportPromise();case"CIMGeometricEffectEnclosingPolygon":return De.getImportPromise();case"CIMGeometricEffectOffset":return Promise.all([Be.getImportPromise(),Ge.getImportPromise()]);case"CIMGeometricEffectTaperedPolygon":return Promise.all([We.getImportPromise(),qe.getImportPromise(),Ne.getImportPromise()]);default:return Promise.resolve()}}class Ye{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}}function He(e,t,s){if(!e)return null;Ue||(Ue=new Oe.O3(0,0,0,1));const i=s?-1:1,r="esriGeometryPolygon"===e.geometryType,n=r?3:2,o=r?3:2;let a,h;for(Ue.reset(n),Ue.setPixelMargin(t+1),Ue.setExtent(512);e.nextPath();)if(!(e.pathSize<o)){for(e.nextPoint(),a=e.x,h=i*e.y,Ue.moveTo(a,h);e.nextPoint();)a=e.x,h=i*e.y,Ue.lineTo(a,h);r&&Ue.close()}const c=Ue.result(!1);if(c){const t=xe.z.createEmptyOptimizedCIM(e.geometryType);for(const e of c){t.startPath();for(const s of e)t.pushXY(s.x,i*s.y)}return t.reset(),t}return null}class Xe{static{this.instance=null}static local(){return null===Xe.instance&&(Xe.instance=new Xe),Xe.instance}execute(e,t,s,i,r,n){return new $e(e,t,s,i,r,n)}}class $e{constructor(e,t,s,i,r,n){this._preventClipping=n,this._inputGeometries=e,this._tileKey=i,this._curveHelper=new Te,this._size=(void 0!==t.size?t.size:1)*s,this._maxInflateSize=r*s,this._offsetFlattenError=Ae*s}next(){let e;for(;e=this._inputGeometries.next();){if(0===this._size)return e;if("esriGeometryEnvelope"===e.geometryType)if(this._size>0){const t=xe.z.createEmptyOptimizedCIM(e.geometryType),s=(0,Ie.x)(e)[0],i=this._curveHelper.offset(s,this._size,"Rounded",4,this._offsetFlattenError);if(i)return t.pushPath(i),t}else if(this._size<0){const t=e.asJSON();if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return xe.z.fromJSONCIM({xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size})}const t=!this._preventClipping&&this._tileKey?He(e,this._maxInflateSize,!0):e;if(!t)continue;const s=Le.module,i={...t.asJSON(),spatialReference:{wkid:Ee.A.WebMercator.wkid}},r=s.execute(i,this._size);return r?xe.z.fromJSONCIM(r):null}return null}}var Ze=s(95108);class Qe{static{this.instance=null}static local(){return null===Qe.instance&&(Qe.instance=new Qe),Qe.instance}execute(e,t,s){return new Je(e,t,s)}}class Je{constructor(e,t,s){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=s,this._rule=t.rule??"FullGeometry",this._defaultSize=this._defaultPointSize*s}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom((0,Ie.x)(e));if(t?.length)return xe.z.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,s,i){return[e[0]*t+s[0]*i,e[1]*t+s[1]*i]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,s){return[e[0]+t,e[1]+s]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const s=t/this._norm(e);e[0]*=s,e[1]*=s}_leftPerpendicular(e){const t=-e[1],s=e[0];e[0]=t,e[1]=s}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],s=-e[0];e[0]=t,e[1]=s}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,s){const i=e[0]*t-e[1]*s,r=e[0]*s+e[1]*t;e[0]=i,e[1]=r}_makeCtrlPt(e){const t=[e[0],e[1]];return Me(t,1),t}_addAngledTicks(e,t,s,i){const r=this._sub(s,t);this._normalize(r);const n=this._crossProduct(r,this._sub(i,t));let o;o=n>0?this._rightPerp(r):this._leftPerp(r);const a=Math.abs(n)/2,h=[];h.push([t[0]+(o[0]-r[0])*a,t[1]+(o[1]-r[1])*a]),h.push(t),h.push(s),h.push([s[0]+(o[0]+r[0])*a,s[1]+(o[1]+r[1])*a]),e.push(h)}_addBezier2(e,t,s,i,r){if(0===r--)return void e.push(i);const n=this._mid(t,s),o=this._mid(s,i),a=this._mid(n,o);this._addBezier2(e,t,n,a,r),this._addBezier2(e,a,o,i,r)}_addBezier3(e,t,s,i,r,n){if(0===n--)return void e.push(r);const o=this._mid(t,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(e,t,o,c,u,n),this._addBezier3(e,u,l,h,r,n)}_add90DegArc(e,t,s,i,r){const n=r??this._crossProduct(this._sub(s,t),this._sub(i,t))>0,o=this._mid(t,s),a=this._sub(o,t);n?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(e,t,s){const i=t[0],r=t[1],n=t[t.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],p=t.length-1,f=[];f.push(s?[-u[0],-u[1]]:u);let _=[-o[0],-o[1]];for(let e=1;e<p-1;e++){const s=this._sub(t[e+1],t[e]);this._normalize(s);const i=this._dotProduct(s,_),r=this._crossProduct(s,_),n=Math.sqrt((1+i)/2),o=this._sub(s,_);this._normalize(o),o[0]/=n,o[1]/=n,f.push(r<0?[-o[0],-o[1]]:o),_=s}f.push(this._rightPerp(_));for(let s=f.length-1;s>0;s--)e.push([t[s][0]+f[s][0]*l,t[s][1]+f[s][1]*l]);e.push([d[0]+f[0][0]*l,d[1]+f[0][1]*l]),e.push([d[0]+f[0][0]*h,d[1]+f[0][1]*h]),e.push(i),e.push([d[0]-f[0][0]*h,d[1]-f[0][1]*h]),e.push([d[0]-f[0][0]*l,d[1]-f[0][1]*l]);for(let s=1;s<f.length;s++)e.push([t[s][0]-f[s][0]*l,t[s][1]-f[s][1]*l])}_addDash(e,t,s){const i=this._norm(s)/7;this._normalize(s);let r=[];for(let n=0;n<=7;n++)r.push([t[0]+s[0]*n*i,t[1]+s[1]*n*i]),1&n&&(e.push(r),r=[])}_cp2(e,t,s){return e.length>=2?e[1]:this._add2(e[0],t*this._defaultSize,s*this._defaultSize)}_cp3(e,t,s,i){if(e.length>=3)return e[2];const r=this._mix(e[0],1-s,t,s),n=this._sub(t,e[0]);return this._normalize(n),this._rightPerpendicular(n),[r[0]+n[0]*i*this._defaultSize,r[1]+n[1]*i*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],s=this._cp2(e,-4,0),i=this._sub(t,s);this._normalize(i);const r=this._rightPerp(i);return[t,s,[t[0]+(r[0]-i[0])*this._defaultSize,t[1]+(r[1]-i[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],s=this._cp2(e,-4,0);let i;if(e.length>=3)i=e[e.length-1];else{const e=this._sub(t,s);this._normalize(e);const r=this._rightPerp(e);i=[t[0]+(r[0]-e[0])*this._defaultSize,t[1]+(r[1]-e[1])*this._defaultSize]}return[s,i]}_processGeom(e){if(!e)return null;const t=[];for(const s of e){const e=s.length>1&&(0,Ze.Yl)(s)<this._defaultSize;if(!s||0===s.length||e)continue;const i=s.length;let r=s[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,.5,4),n=[];n.push(i),n.push(this._mid(r,e)),t.push(n);break}case"ReversedFirstSegment":{const e=this._cp2(s,0,-1);t.push([e,r]);break}case"PerpendicularToSecondSegment":{if(s.length<3)return[];const e=this._cp2(s,-4,1),i=this._cp3(s,e,.882353,-1.94),n=[];n.push(this._mid(e,i)),n.push(r),t.push(n);break}case"SecondSegmentWithTicks":{if(s.length<3)return[];const e=this._cp2(s,-4,1),i=this._cp3(s,e,.882353,-1.94),n=this._sub(i,e);let o;o=this._crossProduct(n,this._sub(r,e))>0?this._rightPerp(n):this._leftPerp(n);const a=[];a.push([e[0]+(o[0]-n[0])/3,e[1]+(o[1]-n[1])/3]),a.push(e),a.push(i),a.push([i[0]+(o[0]+n[0])/3,i[1]+(o[1]+n[1])/3]),t.push(a);break}case"DoublePerpendicular":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,.5,3),n=this._mid(r,e),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]),t.push(h);const c=[];c.push([i[0]-o[0]*a,i[1]-o[1]*a]),c.push(e),t.push(c);break}case"OppositeToFirstSegment":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,.5,3),n=this._mid(r,e),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]),t.push(h);break}case"TriplePerpendicular":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,.5,4),n=this._mid(r,e),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])]),t.push(h),t.push([i,n]);const c=[];c.push([i[0]-o[0]*a*.8,i[1]-o[1]*a*.8]),c.push([n[0]+.8*(e[0]-n[0]),n[1]+.8*(e[1]-n[1])]),t.push(c);break}case"HalfCircleFirstSegment":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,.5,4),n=this._mid(r,e);let o=this._sub(e,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=e):(u.push(e),o=this._sub(e,n),d=r),this._rotateDirect(o,c,l),o[0]/=c,o[1]/=c;for(let e=1;e<=18;e++)u.push(this._add(n,o)),this._rotateDirect(o,a,h);u.push(d),t.push(u);break}case"HalfCircleSecondSegment":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,1,-1);let n=this._sub(r,e);this._normalize(n);const o=this._crossProduct(n,this._sub(i,e))/2;this._leftPerpendicular(n);const a=[e[0]+n[0]*o,e[1]+n[1]*o];n=this._sub(e,a);const h=Math.cos(Math.PI/18);let c=Math.sin(Math.PI/18);o>0&&(c=-c);const l=[e];for(let e=1;e<=18;e++)this._rotateDirect(n,h,c),l.push(this._add(a,n));t.push(l);break}case"HalfCircleExtended":{const e=this._cp2(s,0,-2),n=this._cp3(s,e,1,-1);let o;if(i>=4)o=s[3];else{const t=this._sub(r,e);o=this._add(n,t)}const a=this._dist(e,n)/2/.75,h=this._sub(e,r);this._normalize(h,a);const c=this._sub(n,o);this._normalize(c,a);const l=[o,n];t.push(l);const u=[this._clone(n)];this._addBezier3(u,n,this._add(n,c),this._add(e,h),e,4),u.push(r),t.push(u);break}case"OpenCircle":{const e=this._cp2(s,-2,0),i=this._sub(e,r),n=Math.cos(Math.PI/18),o=-Math.sin(Math.PI/18),a=[e];for(let e=1;e<=33;e++)this._rotateDirect(i,n,o),a.push(this._add(r,i));t.push(a);break}case"CoverageEdgesWithTicks":{const e=this._cp2(s,0,-1);let n,o;if(i>=3)n=s[2];else{const t=this._sub(e,r),s=this._leftPerp(t);n=[r[0]+s[0]-.25*t[0],r[1]+s[1]-.25*t[1]]}if(i>=4)o=s[3];else{const t=this._mid(r,e),s=this._sub(r,e);this._normalize(s),this._leftPerpendicular(s);const i=this._crossProduct(s,this._sub(n,t));this._rightPerpendicular(s),o=[n[0]+s[0]*i*2,n[1]+s[1]*i*2]}const a=this._sub(e,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]),t.push(c),h=this._crossProduct(a,this._sub(o,e))>0?this._rightPerp(a):this._leftPerp(a),c=[],c.push([e[0]+(h[0]+a[0])/3,e[1]+(h[1]+a[1])/3]),c.push(e),c.push(o),t.push(c);break}case"GapExtentWithDoubleTicks":{const e=this._cp2(s,0,2),n=this._cp3(s,e,0,1);let o;if(i>=4)o=s[3];else{const t=this._sub(e,r);o=this._add(n,t)}this._addAngledTicks(t,r,e,this._mid(n,o)),this._addAngledTicks(t,n,o,this._mid(r,e));break}case"GapExtentMidline":{const e=this._cp2(s,2,0),n=this._cp3(s,e,0,1);let o;if(i>=4)o=s[3];else{const t=this._sub(e,r);o=this._add(n,t)}const a=[];a.push(this._mid(r,n)),a.push(this._mid(e,o)),t.push(a);break}case"Chevron":{const e=this._cp2(s,-1,-1);let n;if(i>=3)n=s[2];else{const t=this._sub(e,r);this._leftPerpendicular(t),n=this._add(r,t)}t.push([e,this._makeCtrlPt(r),n]);break}case"PerpendicularWithArc":{const e=this._cp2(s,0,-2),n=this._cp3(s,e,.5,-1),o=this._sub(e,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]),t.push(d),i>=4){const e=s[3];let i=this._dotProduct(o,this._sub(e,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(e,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]),t.push(c)}const p=[e[0]+u[0]*h,e[1]+u[1]*h];u=this._sub(e,p);const f=Math.cos(Math.PI/18);let _=Math.sin(Math.PI/18);h<0&&(_=-_),d=[r,e];for(let e=1;e<=9;e++)this._rotateDirect(u,f,_),d.push(this._add(p,u));t.push(d);break}case"ClosedHalfCircle":{const e=this._cp2(s,2,0),i=this._mid(r,e),n=this._sub(e,i),o=Math.cos(Math.PI/18),a=Math.sin(Math.PI/18),h=[r,e];for(let e=1;e<=18;e++)this._rotateDirect(n,o,a),h.push(this._add(i,n));t.push(h);break}case"TripleParallelExtended":{const e=this._cp2(s,0,-2),i=this._cp3(s,e,1,-2),n=this._mid(r,e),o=this._sub(i,e);this._normalize(o);const a=Math.abs(this._crossProduct(o,this._sub(n,e)))/2,h=this._dist(e,i),c=[e,r];c.push([r[0]+o[0]*h*.5,r[1]+o[1]*h*.5]),t.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]),Me(l[l.length-1],1),l.push([n[0]+o[0]*h*.75,n[1]+o[1]*h*.75]),t.push(l);const u=[e,i];t.push(u);break}case"ParallelWithTicks":{const e=this._cp2(s,3,0),i=this._cp3(s,e,.5,-1),n=this._sub(i,e);this._normalize(n);const o=this._crossProduct(n,this._sub(i,r));this._leftPerpendicular(n),this._addAngledTicks(t,r,e,i),this._addAngledTicks(t,this._mix(r,1,n,o),this._mix(e,1,n,o),this._mid(r,e));break}case"Parallel":{const e=this._cp2(s,3,0),i=this._cp3(s,e,.5,-1),n=this._sub(e,r);this._normalize(n);const o=this._leftPerp(n),a=this._crossProduct(n,this._sub(i,r));let h=[r,e];t.push(h),h=[],h.push([r[0]+o[0]*a,r[1]+o[1]*a]),h.push([e[0]+o[0]*a,e[1]+o[1]*a]),t.push(h);break}case"PerpendicularToFirstSegment":{const e=this._cp2(s,3,0),i=this._cp3(s,e,.5,-1),n=this._mid(r,e),o=this._sub(e,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]),t.push(h);break}case"ParallelOffset":{const e=this._cp2(s,3,0),i=this._cp3(s,e,.5,-1),n=this._sub(e,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([e[0]-n[0]*o,e[1]-n[1]*o]),t.push(a);const h=[];h.push([r[0]+n[0]*o,r[1]+n[1]*o]),h.push([e[0]+n[0]*o,e[1]+n[1]*o]),t.push(h);break}case"OffsetOpposite":{const e=this._cp2(s,3,0),i=this._cp3(s,e,.5,-1),n=this._sub(e,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([e[0]-n[0]*o,e[1]-n[1]*o]),t.push(a);break}case"OffsetSame":{const e=this._cp2(s,3,0),i=this._cp3(s,e,.5,-1),n=this._sub(e,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([e[0]+n[0]*o,e[1]+n[1]*o]),t.push(a);break}case"CircleWithArc":{let e=this._cp2(s,3,0);const n=this._cp3(s,e,.5,-1);let o,a;if(i>=4)o=s[3],a=this._crossProduct(this._sub(o,e),this._sub(n,e))>0;else{o=e,a=this._crossProduct(this._sub(o,r),this._sub(n,r))>0;const t=24*this._geomUnitsPerPoint,s=this._sub(o,r);this._normalize(s,t);const i=Math.sqrt(2)/2;this._rotateDirect(s,i,a?i:-i),e=this._add(r,s)}const h=this._sub(e,r),c=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18),u=[e];for(let e=1;e<=36;e++)this._rotateDirect(h,c,l),u.push(this._add(r,h));this._add90DegArc(u,e,o,n,a),Me(u[u.length-8],1),t.push(u);break}case"DoubleJog":{let e,n=this._cp2(s,-3,1),o=this._cp3(s,n,-1,-.5);if(i>=4)e=s[3];else{const t=r;r=n,e=o;const s=this._dist(r,t),i=this._dist(e,t);let a=30*this._geomUnitsPerPoint;.5*s<a&&(a=.5*s),.5*i<a&&(a=.5*i),n=this._mix(r,a/s,t,(s-a)/s),o=this._mix(e,a/i,t,(i-a)/i)}const a=this._mid(r,n),h=this._mid(e,o),c=this._dist(r,n),l=this._dist(o,e);let u=Math.min(c,l)/8;u=Math.min(u,24*this._geomUnitsPerPoint);const d=Math.cos(Math.PI/4);let p=this._sub(r,n);this._normalize(p,u),this._crossProduct(p,this._sub(e,n))>0?this._rotateDirect(p,d,-d):this._rotateDirect(p,d,d);let f=[];f.push(n),f.push(this._add(a,p)),f.push(this._sub(a,p)),f.push(r),t.push(f),p=this._sub(e,o),this._normalize(p,u),this._crossProduct(p,this._sub(r,o))<0?this._rotateDirect(p,d,d):this._rotateDirect(p,d,-d),f=[],f.push(o),f.push(this._add(h,p)),f.push(this._sub(h,p)),f.push(e),t.push(f);break}case"PerpendicularOffset":{const e=this._cp2(s,-4,1),i=this._cp3(s,e,.882353,-1.94),n=this._sub(i,e);this._crossProduct(n,this._sub(r,e))>0?this._rightPerpendicular(n):this._leftPerpendicular(n);const o=[n[0]/8,n[1]/8],a=this._sub(this._mid(e,i),o);t.push([a,r]);break}case"LineExcludingLastSegment":{const e=this._arrowPath(s),i=[];let r=e.length-2;for(;r--;)i.push(e[r]);t.push(i);break}case"MultivertexArrow":{const e=this._arrowPath(s),i=[];this._addArrow(i,e,!1),t.push(i);break}case"CrossedArrow":{const e=this._arrowPath(s),i=[];this._addArrow(i,e,!0),t.push(i);break}case"ChevronArrow":{const[e,i]=this._arrowLastSeg(s),n=10*this._geomUnitsPerPoint,o=this._sub(r,e),a=this._norm(o);this._normalize(o);const h=this._crossProduct(o,this._sub(i,e));let c=this._dotProduct(o,this._sub(i,e));c<.05*a?c=.05*a:c>.95*a-n&&(c=.95*a-n);const l=[e[0]+o[0]*c,e[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]),t.push(d);break}case"ChevronArrowOffset":{const[e,i]=this._arrowLastSeg(s),n=this._sub(r,e),o=this._norm(n);this._normalize(n);const a=this._crossProduct(n,this._sub(i,e));let h=this._dotProduct(n,this._sub(i,e));h<.05*o?h=.05*o:h>.95*o&&(h=.95*o);const c=[e[0]+n[0]*h,e[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]),t.push(l);break}case"PartialFirstSegment":{const[e,i]=this._arrowLastSeg(s),n=this._sub(r,e),o=this._norm(n);this._normalize(n);let a=this._dotProduct(n,this._sub(i,e));a<.05*o?a=.05*o:a>.95*o&&(a=.95*o);const h=[e[0]+n[0]*a,e[1]+n[1]*a];t.push([e,h]);break}case"Arch":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,.5,1),n=this._sub(r,e),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,e,4),t.push(h);break}case"CurvedParallelTicks":{const e=this._cp2(s,-4,1),i=this._cp3(s,e,.882353,-1.94),n=this._sub(i,e);this._crossProduct(n,this._sub(r,e))>0?this._rightPerpendicular(n):this._leftPerpendicular(n);const o=[n[0]/8,n[1]/8],a=this._sub(this._mid(e,i),o),h=this._sub(this._mix(e,.75,i,.25),o),c=this._sub(this._mix(e,.25,i,.75),o),l=[e];this._addBezier2(l,e,h,a,3),this._addBezier2(l,a,c,i,3),t.push(l);for(let e=0;e<8;e++){const s=l[2*e+1],i=[this._clone(s)];i.push(this._add(s,[n[0]/4,n[1]/4])),t.push(i)}break}case"Arc90Degrees":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,.5,1),n=[e];this._add90DegArc(n,e,r,i),t.push(n);break}case"TipWithPerpendicularAndTicks":{const[e,i]=this._arrowLastSeg(s),n=10*this._geomUnitsPerPoint,o=this._sub(r,e),a=this._norm(o);this._normalize(o);let h=this._crossProduct(o,this._sub(i,e)),c=this._dotProduct(o,this._sub(i,e));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 p=[];p.push([u[0]+l[0]*(h+d)-o[0]*d,u[1]+l[1]*(h+d)-o[1]*d]),p.push([u[0]+l[0]*h,u[1]+l[1]*h]),p.push([u[0]-l[0]*h,u[1]-l[1]*h]),p.push([u[0]-l[0]*(h+d)-o[0]*d,u[1]-l[1]*(h+d)-o[1]*d]),t.push(p),t.push([u,r]);break}case"ConcentricCircles":{const e=this._cp2(s,1,0),n=this._cp3(s,e,2,0),o=Math.cos(Math.PI/18),a=Math.sin(Math.PI/18);let h=this._dist(e,r),c=[h,0],l=[];for(let e=0;e<=36;e++)l.push(this._add(r,c)),this._rotateDirect(c,o,a);if(t.push(l),i>=4){l=[];const e=s[3];h=this._dist(e,r),c=[h,0];for(let e=0;e<=36;e++)l.push(this._add(r,c)),0===e&&(l.push(this._add(r,c)),Me(l[1],1)),this._rotateDirect(c,o,a);t.push(l)}l=[],h=this._dist(n,r),c=[h,0];for(let e=0;e<=36;e++)l.push(this._add(r,c)),this._rotateDirect(c,o,a);t.push(l);break}case"DoubleJogArrow":{r=this._arrowPath(s)[0];const[e,i]=this._arrowLastSeg(s),n=this._sub(r,e),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]]),t.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]]),t.push(u);break}case"LinkedChevrons":{const e=this._cp2(s,-5,0),i=this._cp3(s,e,-.2,1),n=this._sub(r,e);this._normalize(n);const o=this._leftPerp(n),a=Math.abs(this._crossProduct(n,this._sub(i,e)));t.push([e,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]),t.push(h),this._addDash(t,e,[-n[0]*a+o[0]*a,-n[1]*a+o[1]*a]),this._addDash(t,e,[-n[0]*a-o[0]*a,-n[1]*a-o[1]*a]);break}case"SegmentThenHalfCircle":{const e=this._cp2(s,2,0),n=this._cp3(s,e,1.5,0);let o;o=i>=4?s[3]:this._cp3(s,e,1.25,-.5);const a=this._sub(e,r);this._normalize(a);const h=.5*this._dist(e,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,e];a[0]*=h,a[1]*=h;const p=this._add(e,a);a[0]=-a[0],a[1]=-a[1];for(let e=1;e<=18;e++)this._rotateDirect(a,l,u),d.push(this._add(p,a));t.push(d);break}case"LineWithStraightTicks":{const e=this._cp2(s,-2,1),i=this._cp3(s,e,-1,-.5),n=this._sub(i,e);this._normalize(n);const o=this._dotProduct(n,this._sub(e,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(e),t.push(h),h=[r],h.push([r[0]+n[0]*a,r[1]+n[1]*a]),h.push(i),t.push(h);break}case"DoubleCurve":{const e=this._cp2(s,-5,-1),i=this._cp3(s,e,2,0),n=Math.atan2(1,5),o=Math.cos(n),a=Math.sin(n),h=this._sub(e,r),c=this._dist(r,e);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]),Me(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],e,3);const u=this._sub(i,e),d=this._dist(e,i);this._normalize(u),this._rotateDirect(u,o,-a),this._addBezier2(l,e,[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),t.push(l);break}case"ParallelWithTicksByWidth":{const e=this._cp2(s,0,-1),i=this._cp3(s,e,.5,3),n=this._sub(e,r);this._normalize(n);const o=this._crossProduct(n,this._sub(i,r));this._leftPerpendicular(n),o>0?(this._addAngledTicks(t,r,[r[0]+n[0]*o,r[1]+n[1]*o],e),this._addAngledTicks(t,e,[e[0]+n[0]*o,e[1]+n[1]*o],r)):(this._addAngledTicks(t,[r[0]+n[0]*o,r[1]+n[1]*o],r,e),this._addAngledTicks(t,[e[0]+n[0]*o,e[1]+n[1]*o],r,e));break}case"EnclosingRoundedRectangle":{const e=this._cp2(s,3,-2),t=[Math.min(r[0],e[0]),Math.max(r[1],e[1])],i=[Math.max(r[0],e[0]),Math.min(r[1],e[1])],n=i[0]-t[0],o=t[1]-i[1],a=Math.min(n,o)/10,h=[];h.push([t[0]+a+.75*(n-2*a),t[1]]),h.push([i[0]-a,t[1]]),this._add90DegArc(h,[i[0]-a,t[1]],[i[0],t[1]-a],[i[0],t[1]]),h.push([i[0],i[1]+a]),this._add90DegArc(h,[i[0],i[1]+a],[i[0]-a,i[1]],i),h.push([t[0]+a,i[1]]),this._add90DegArc(h,[t[0]+a,i[1]],[t[0],i[1]+a],[t[0],i[1]]),h.push([t[0],t[1]-a]),this._add90DegArc(h,[t[0],t[1]-a],[t[0]+a,t[1]],t),h.push([t[0]+a+.75*(n-2*a),t[1]]);break}default:t.push(s)}}return t}}class Ke{static{this.instance=null}static local(){return null===Ke.instance&&(Ke.instance=new Ke),Ke.instance}execute(e,t,s){return new et(e,t,s)}}class et extends Ce{constructor(e,t,s){super(e,!0,!0),this._curveHelper=new Te,this._beginCut=(void 0!==t.beginCut?t.beginCut:1)*s,this._endCut=(void 0!==t.endCut?t.endCut:1)*s,this._middleCut=(void 0!==t.middleCut?t.middleCut:0)*s,this._invert=void 0!==t.invert&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:s,_middleCut:i}=this,r=e.pathLength(),n=xe.z.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(0!==t||0!==s||0!==i)if(t+s+i>=r)for(n.startPath();e.nextPoint();)n.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(n,e,0,t),this._curveHelper.appendSubCurve(n,e,.5*(r-i),.5*(r+i)),this._curveHelper.appendSubCurve(n,e,r-s,s)}else if(0===t&&0===s&&0===i)for(n.startPath();e.nextPoint();)n.pushXY(e.x,e.y);else t+s+i<r&&(0===i?this._curveHelper.appendSubCurve(n,e,t,r-s):(this._curveHelper.appendSubCurve(n,e,t,.5*(r-i)),this._curveHelper.appendSubCurve(n,e,.5*(r+i),r-s)));return 0===n.totalSize?null:n}}class tt{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(e,t=!0){if(this._setEmpty(),!e||0===e.length)return!1;for(let s=0;s<e.length;s++){let i=Math.abs(e[s]);t&&i<1e-7&&(i=1e-7),this._values.push(i),this._length+=i}return 0!==this._length&&(this.ctrlPtGap=this.extPtGap=0,this._currentValue=-1,!0)}scale(e){const t=this._values?this._values.length:0;for(let s=0;s<t;++s)this._values[s]*=e;this._length*=e,this.extPtGap*=e,this.ctrlPtGap*=e}addValue(e){this._length+=e,this._values.push(e)}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 st{constructor(){this.pt=null,this.ca=0,this.sa=0}}class it{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(e){e.segment=this.segment,e.segmentLength=this.segmentLength,e.abscissa=this.abscissa,e.isPathEnd=this.isPathEnd,e.isPartEnd=this.isPartEnd}}class rt extends Te{constructor(e=0,t=!1){super(e,t),this._tempPos=new it,this._tempPt=[0,0],this._tolerance=Ae,this._currentPosition=new it}updateTolerance(e){this._tolerance=Ae*e}init(e,t,s=!0){return s?(this._patternLength=t.length(),this._partExtPtGap=t.extPtGap,this._partCtrlPtGap=t.ctrlPtGap):(this._patternLength=0,this._partExtPtGap=0,this._partCtrlPtGap=0),this._currentPosition.reset(),this._partSegCount=0,this._pathCursor=e,this._seg=-1,this._setPosAtNextPart()}curPositionIsValid(){return this._currentPosition.isValid()}nextPosition(e,t=0){const s=new it;return!!this._nextPosition(e,s,null,t)&&(s.copyTo(this._currentPosition),!0)}curPointAndAngle(e){e.pt=this._getPoint(this._currentPosition);const[t,s]=this._getAngleCS(this._tempPt,this._currentPosition);e.ca=t,e.sa=s}nextPointAndAngle(e,t,s=0){const i=this._tempPos;if(!this._nextPosition(e,i,null,s))return!1;i.copyTo(this._currentPosition),t.pt=this._getPoint(i);const[r,n]=this._getAngleCS(this._tempPt,i);return t.ca=r,t.sa=n,!0}nextCurve(e){if(0===e)return null;const t=xe.z.createEmptyOptimizedCIM("esriGeometryPolyline");t.startPath(),t.nextPath();const s=new it;return this._nextPosition(e,s,t,1)?(s.copyTo(this._currentPosition),t):null}isPathEnd(){return this._currentPosition.isPathEnd}getPathEnd(){return this._currentPosition.segment[1]}getPt(e){return this._pathCursor.seekInPath(e),[this._pathCursor.x,this._pathCursor.y]}getSeg(e){return[this.getPt(e),this.getPt(e+1)]}_nextPosition(e,t,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(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(s){if(0===s.pathSize)if(0===r){const e=t.segment[0];s.pushXY(e[0],e[1])}else s.pushPoint(this.getSegCoord2D(t.segment,r));const e=t.segment[1];s.pushXY(e[0],e[1])}if(r=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return 0!==i&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,1===i?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,s){0===s.pathSize&&(0===r?s.pushPoint(t.segment[0]):s.pushPoint(this.getSegCoord2D(t.segment,r)));const e=t.abscissa/t.segmentLength;1===e?s.pushPoint(t.segment[1]):s.pushPoint(this.getSegCoord2D(t.segment,e))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)<this._tolerance&&(t.isPathEnd=this._partIsLast,t.isPartEnd=!0),!0}_getPoint(e){const t=e.segmentLength<=0?0:e.abscissa/e.segmentLength;return this.getSegCoord2D(this._currentPosition.segment,t)}_getAngleCS(e,t){const s=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegAngleCS(e,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 e=this._partSegCount;for(;e;)this._previousSegment(),--e;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 t=this._getStartPointIndex();this._ctrlPtBegin=this._pathCursor.getControlPointAt(t);let s=t+this._partSegCount+1;if(s>=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const e=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,t=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let s=Math.round((this._partLength-(e+t))/this._patternLength);s<=0&&(s=e+t>0?0:1),this._partLengthRatio=this._partLength/(e+t+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}}class nt{static{this.instance=null}static local(){return null===nt.instance&&(nt.instance=new nt),nt.instance}execute(e,t,s){return new ot(e,t,s)}}class ot extends Ce{constructor(e,t,s){super(e,!0,!0),this._firstCurve=null,this._walker=new rt,this._walker.updateTolerance(s),this._endings=t.lineDashEnding??"NoConstraint",this._customDashPos=-(t.offsetAlongLine??0)*s,this._offsetAtEnd=(t.customEndingOffset??0)*s;let i=(0,Re.FH)(t).dashTemplate;null==i&&(i=[]),i.length%2&&(i=[...i,...i]);let r=0;for(;r<i.length&&0===i[r];)r++;let n=0;const o=[];for(let e=r;e<i.length;e++)0===i[e]?n++:0===n?o.push(i[e]):1&n?(o[o.length-1]+=i[e],n=0):(o.push(i[e]),n=0);i=o,i.length<=1?i=0===i.length||r%2==0?[]:[-1]:i.length%2==1?r%2==1?i.unshift(0):i.push(0):r%2==1&&(i.unshift(0),i.push(0)),this._pattern=new tt,this._pattern.init(i,!1),this._pattern.scale(s)}processPath(e){if(this._pattern.size()%2==1)return null;if(0===this._pattern.length()){this.iteratePath=!1;const t=(0,Ie.A)(e);return xe.z.fromJSONCIM({paths:[t]})}if(!this.iteratePath){let t=!0;switch(this._endings){case"HalfPattern":case"HalfGap":default:this._pattern.extPtGap=0;break;case"FullPattern":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case"FullGap":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case"NoConstraint":this.isClosed||(t=!1);break;case"Custom":this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const s=e.pathLength();if(this._pattern.isEmpty()||s<.1*this._pattern.length()){const t=(0,Ie.A)(e);return xe.z.fromJSONCIM({paths:[t]})}if(!this._walker.init(e,this._pattern,t)){const t=(0,Ie.A)(e);return xe.z.fromJSONCIM({paths:[t]})}}let t;if(this.iteratePath)t=this._pattern.nextValue();else{let e;switch(this._endings){case"HalfPattern":default:e=.5*this._pattern.firstValue();break;case"HalfGap":e=.5*-this._pattern.lastValue();break;case"FullGap":e=-this._pattern.lastValue();break;case"FullPattern":e=0;break;case"NoConstraint":case"Custom":e=-this._customDashPos}let s=e/this._pattern.length();s-=Math.floor(s),e=s*this._pattern.length(),this._pattern.reset(),t=this._pattern.nextValue();let i=!1;for(;e>=t;)e-=t,t=this._pattern.nextValue(),i=!i;t-=e,i?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}0===t&&(t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue());let s=this._walker.nextCurve(t);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 t=this._pattern.nextValue(),!this._walker.nextPosition(t)||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 at{static{this.instance=null}static local(){return null===at.instance&&(at.instance=new at),at.instance}execute(e,t,s,i,r,n){return new ht(e,t,s,i,r,n)}}class ht{constructor(e,t,s,i,r,n){this._preventClipping=n,this._inputGeometries=e,this._tileKey=i,this._maxInflateSize=r*s,this._width=(void 0!==t.width?t.width:2)*s,t.method,this._option=t.option??"Accurate"}next(){let e;for(;e=this._inputGeometries.next();){if("esriGeometryEnvelope"===e.geometryType&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:xe.z.fromJSONCIM({paths:[[[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if("esriGeometryPolygon"===e.geometryType){if(0===this._width)return e.clone();const t=Le.module,s=!this._preventClipping&&this._tileKey?He(e,this._maxInflateSize,!0):e.clone();if(!s)continue;const i={...s.asJSON(),spatialReference:{wkid:Ee.A.WebMercator.wkid}},r=t.execute(i,-this._width);if(r)for(const e of r.rings)if(e){s.startPath();for(const t of e.reverse())s.pushXY(t[0],s.yFactor*t[1])}return s}}return null}}var ct=s(537);class lt{static{this.instance=null}static local(){return null===lt.instance&&(lt.instance=new lt),lt.instance}execute(e,t){return new ut(e,t)}}class ut{constructor(e,t){this._inputGeometries=e,this._medhod=t.method}next(){let e=this._inputGeometries.next();const t=this._medhod;for(;null!=e;){if(e.totalSize>0)switch(t){case"RectangularBox":return dt(e);case"ConvexHull":return this._constructConvexHull(e);default:return pt(e)}e=this._inputGeometries.next()}return null}_constructConvexHull(e){switch(e.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const t=De.module,s={...e.asJSON(),spatialReference:{wkid:Ee.A.WebMercator.wkid}},i=t.execute(s);return i?xe.z.fromJSONCIM(i):null}case"esriGeometryEnvelope":return e;default:return null}}}function dt(e){const t=(0,ct.z8)(e),s={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]};return xe.z.fromJSONCIM(s)}function pt(e){switch(e.geometryType){case"esriGeometryPolyline":{const t=[];for(;e.nextPath();)ft(e,t);return xe.z.fromJSONCIM({rings:t})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return e;default:return null}}function ft(e,t){if(e.seekPathStart(),!e.nextPoint())return;const s=e.x,i=e.y,r=[[s,i]];for(t.push(r);e.nextPoint();)r.push([e.x,e.y]);r.push([s,i])}class _t{static{this.instance=null}static local(){return null===_t.instance&&(_t.instance=new _t),_t.instance}execute(e,t,s){return new mt(e,t,s)}}class mt extends Ce{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Te,this._length=(void 0!==t.length?t.length:20)*s,this._angle=void 0!==t.angle?t.angle:225,this._position=void 0!==t.position?t.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(e){const t=xe.z.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const s=e.x,i=e.y;e.seekInPath(e.pathSize-1);const r=e.x,n=e.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 t.pushPath([[s,i],u,d,[r,n]]),t}}class gt{static{this.instance=null}static local(){return null===gt.instance&&(gt.instance=new gt),gt.instance}execute(e,t,s){return new yt(e,t,s)}}class yt{constructor(e,t,s){this._inputGeometries=e,this._offsetX=void 0!==t.offsetX?t.offsetX*s:0,this._offsetY=void 0!==t.offsetY?t.offsetY*s:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+s;return e.reset(),e}}var xt=s(60408);class bt{static{this.instance=null}static local(){return null===bt.instance&&(bt.instance=new bt),bt.instance}execute(e,t,s,i,r,n){return new wt(e,t,s,i,r,n)}}class wt{constructor(e,t,s,i,r,n){this._preventClipping=n,this._inputGeometries=e,this._tileKey=i,this._curveHelper=new Te,this._offset=(t.offset??1)*s,this._method=t.method??"Square",this._maxInflateSize=Math.max(Math.abs(r*s),10),this._option=t.option||"Fast",this._offsetFlattenError=Ae*s}next(){let e;for(;e=this._inputGeometries.next();){if(0===this._offset)return e.clone();if("esriGeometryEnvelope"===e.geometryType){if("Rounded"===this._method&&this._offset>0){const t=(0,Ie.A)(e),s=this._curveHelper.offset(t,-this._offset,this._method,4,this._offsetFlattenError);if(s){const t=xe.z.createEmptyOptimizedCIM(e.geometryType);return t.pushPath(s),t}return null}const t=e.asJSON();if((0,xt.ZC)(t)&&Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._offset>0)return xe.z.fromJSONCIM({xmin:t.xmin-this._offset,xmax:t.xmax+this._offset,ymin:t.ymin-this._offset,ymax:t.ymax+this._offset})}const t=!this._preventClipping&&this._tileKey?He(e,this._maxInflateSize,!0):e.clone();if(!t)continue;const s=Be.module,i=Ge.module,r={...t.asJSON(),spatialReference:{wkid:Ee.A.WebMercator.wkid}};let n,o=vt(this._method);return"esriGeometryPolygon"===e.geometryType&&this._offset>0?("square"===o&&(o="bevel"),n=i.executeMany([r],[this._offset],o,"round")[0]):n=s.execute(r,-this._offset,{joins:o,flattenError:this._offsetFlattenError,miterLimit:4}),n?xe.z.fromJSONCIM(n):null}return null}}function vt(e){switch(e){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}var St=s(12359);class It{static{this.instance=null}static local(){return null===It.instance&&(It.instance=new It),It.instance}execute(e,t,s){return new Pt(e,t,s)}}class Pt{constructor(e,t,s){this._inputGeometries=e,this._length=(void 0!==t.length?t.length:be.D.CIMGeometricEffectRadial.length)*s,this._angle=void 0!==t.angle?t.angle*Math.PI/180:be.D.CIMGeometricEffectRadial.angle,this._lx=Math.cos(this._angle)*this._length,this._ly=Math.sin(this._angle)*this._length}next(){let e=this._inputGeometries.next();for(;e;){if("esriGeometryPoint"===e.geometryType||"esriGeometryMultipoint"===e.geometryType){const t=xe.z.createEmptyOptimizedCIM("esriGeometryPolyline");return e.nextPath()&&e.nextPoint()&&t.pushPath([[e.x,e.y],[e.x+this._lx,e.y+this._ly]]),t}if("esriGeometryPolygon"===e.geometryType){const t=(0,St.IK)(e);if(!t)return null;const s=xe.z.createEmptyOptimizedCIM("esriGeometryPolyline");return s.pushPath([[t[0],t[1]],[t[0]+this._lx,t[1]+this._ly]]),s}e=this._inputGeometries.next()}return null}}class Mt{static{this.instance=null}static local(){return null===Mt.instance&&(Mt.instance=new Mt),Mt.instance}execute(e,t,s){return new kt(e,t,s)}}class kt{constructor(e,t,s){this._inputGeometries=e,this._reverse=void 0===t.reverse||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if("esriGeometryPolyline"===e.geometryType)return Ct(e.clone());e=this._inputGeometries.next()}return null}}function Ct(e){for(;e.nextPath();)for(let t=0;t<e.pathSize/2;t++){e.seekInPath(t);const s=e.x,i=e.y;e.seekInPath(e.pathSize-t-1);const r=e.x,n=e.y;e.x=s,e.y=i,e.seekInPath(t),e.x=r,e.y=n}return e.reset(),e}class At{static{this.instance=null}static local(){return null===At.instance&&(At.instance=new At),At.instance}execute(e,t,s){return new Tt(e,t,s)}}class Tt{constructor(e,t,s){this._inputGeometries=e,this._rotateAngle=void 0!==t.angle?t.angle*Math.PI/180:0}next(){let e=this._inputGeometries.next();for(;e;){if(0===this._rotateAngle||"esriGeometryPoint"===e.geometryType)return e;if(e.totalSize>0){const t=(0,ct.z8)(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),s,i)}e=this._inputGeometries.next()}return null}_rotate(e,t,s){const i=Math.cos(this._rotateAngle),r=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const n=e.x-t,o=e.y-s;e.x=t+n*i-o*r,e.y=s+n*r+o*i}return e.reset(),e}}class Ft{static{this.instance=null}static local(){return null===Ft.instance&&(Ft.instance=new Ft),Ft.instance}execute(e,t,s){return new zt(e,t,s)}}class zt{constructor(e,t,s){this._inputGeometries=e,this._xFactor=void 0!==t.xScaleFactor?t.xScaleFactor:1.15,this._yFactor=void 0!==t.yScaleFactor?t.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(1===this._xFactor&&1===this._yFactor)return e;if("esriGeometryPoint"===e.geometryType)return e;if(e.totalSize>0){const t=(0,ct.z8)(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,i)}}return null}_scaleCursor(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=s+(e.y-s)*this._yFactor;return e.reset(),e}}class Et{constructor(){this._polyline=[]}beginPath(e){this._polyline.push([e])}lineTo(e){if(0===this._polyline.length)throw new Error("No path started. Call beginPath first.");this._polyline[this._polyline.length-1].push(e)}getPointCount(){return this._polyline.reduce((e,t)=>e+t.length,0)}addSegment(e,t,s){s&&this.beginPath(e),this.lineTo(t)}getXY(e){let t=0;for(const s of this._polyline){if(e<t+s.length)return s[e-t];t+=s.length}return null}getGeometry(){return this._polyline}}class Ot{static{this.instance=null}static local(){return null===Ot.instance&&(Ot.instance=new Ot),Ot.instance}execute(e,t,s){return new Rt(e,t,s)}}class Rt extends Ce{constructor(e,t,s){super(e,!1,!0),this._suppress=void 0!==t.suppress&&t.suppress,this._invert=void 0!==t.invert&&t.invert}processPath(e){if(e.totalSize<=0)return null;if(!this._suppress){const t=xe.z.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,e.yFactor);for(e.seekPathEnd();e.nextPoint();)t.pushXY(e.x,e.y);return t}const t=[],s=new Array(e.pathSize);let i=0;for(e.seekPathStart();e.nextPoint();)s[i++]=e.getControlPoint(),t.push([e.x,e.y]);let r=!0,n=!0,o=!1,a=!this._invert;i=0;const h=new Et;let c=t[0];for(;i<t.length-1;){const e=t[i+1],l=s[i],u=s[i+1];i++,n&&(a=l||u?this._invert:!this._invert,n=!1),a?(h.addSegment(c,e,r),r=!1):o=!0,c=e,u&&(a?(a=!1,r=!0):a=!0)}const l=h.getGeometry();if(0===l.length)return null;if(!o&&t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]){const e=l[l.length-1];return e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]||e.push([e[0][0],e[0][1]]),xe.z.fromJSONCIM({paths:l})}const u=l[l.length-1];return h.getPointCount()>1&&"esriGeometryPolygon"===e.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)),xe.z.fromJSONCIM({paths:l})}}var Lt=s(53966);const Dt=()=>Lt.A.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class qt{static{this.instance=null}static local(){return null===qt.instance&&(qt.instance=new qt),qt.instance}execute(e,t,s){return new Nt(e,t,s)}}class Nt extends Ce{constructor(e,t,s){super(e,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new Oe.bR(NaN,NaN),this._lastWidth=0,this._geomUnitsPerPoint=s,this._halfFromWidth=Math.abs(void 0!==t.fromWidth?t.fromWidth:0)*s*.5,this._halfToWidth=Math.abs(void 0!==t.toWidth?t.toWidth:1)*s*.5,this._originalLength=(void 0!==t.length?t.length:0)*s,this._length=0}processPath(e){if(e.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const t=xe.z.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,e.yFactor);for(e.seekPathEnd();e.prevPoint();)t.pushXY(e.x,e.y);for(e.seekPathStart();e.nextPoint();)t.pushXY(e.x,e.y);return t}const t=e.getCurrentPath().asJSON(),s=Ne.module.execute(t,.25*this._geomUnitsPerPoint,{removeDegenerateParts:!0}),r=null==s?null:(0,xt.Bi)(s)?s.rings:(0,xt.Rg)(s)?s.paths:null;if(!r)return Dt().error(new i.A("mapview-bad-resource","Unable to process geometry")),null;const n=qe.module.execute(s);if((0===this._originalLength||this._originalLength>n)&&n>0){this._length=n;const e=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(e)<1){const t=e*e;this._slopeC=Math.sqrt(1/(1+t)),this._slopeS=Math.sqrt(t/(1+t)),e<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;const o=[];for(const e of r){const t=new Et,s=new Et;let i=0;this._setFromOffset(e.slice(0,2),t,s);for(let r=0,n=3;n<=e.length;++r,++n)i=this._setOffset(e.slice(r,n),i,t,s);this._setToOffset(e.slice(-2),i,t,s);const[r]=t.getGeometry(),[n]=s.getGeometry();o.push([...r,...n.reverse()])}const a={rings:o,spatialReference:{wkid:Ee.A.WebMercator.wkid}},h=We.module.execute(a);return xe.z.fromJSONCIM(h)}_setFromOffset([[e,t],[s,i]],r,n){const o=this._halfFromWidth,a=new Oe.bR(s-e,i-t).normalize().scale(o);r.beginPath([e-a.y,t+a.x]),n.beginPath([e+a.y,t-a.x])}_setToOffset([[e,t],[s,i]],r,n,o){let a;a=(r+=Math.sqrt((s-e)**2+(i-t)**2))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*r/this._length;const h=new Oe.bR(s-e,i-t).normalize().scale(a);n.lineTo([s-h.y,i+h.x]),o.lineTo([s+h.y,i-h.x])}_setOffset([[e,t],[s,r],[n,o]],a,h,c){const l=Math.sqrt((s-e)**2+(r-t)**2);let u;u=a+l>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(a+l)/this._length,a+=l;const d=new Oe.bR(s,r),p=new Oe.bR(s-e,r-t).normalize(),f=new Oe.bR(n-s,o-r).normalize(),_=Oe.bR.sub(f,p),m=h.getPointCount(),g=c.getPointCount();p.leftPerpendicular(),f.leftPerpendicular();const y=p.x*f.x+p.y*f.y;if(y>.99){const e=Oe.bR.add(p,f).scale(u/2),t=e.clone().rotate(this._slopeC,this._slopeS);h.lineTo([d.x+t.x,d.y+t.y]);const s=e.rotateReverse(this._slopeC,this._slopeS);c.lineTo([d.x-s.x,d.y-s.y])}else{const s=p.x*f.y-p.y*f.x;if(_.scale(1/s),s<0){_.scale(-u).rotateReverse(this._slopeC,this._slopeS);const e=c.getXY(g-1);e||Dt().error(new i.A("mapview-bad-resource","Unable to process geometry, index out of scope"));const t=Oe.bR.add(d,_).sub(Oe.bR.fromArray(e));if(p.x*t.y-p.y*t.x>0){const e=p.clone().scale(-u).rotateReverse(this._slopeC,this._slopeS),t=f.clone().scale(-u).rotateReverse(this._slopeC,this._slopeS);c.lineTo([d.x+e.x,d.y+e.y]),c.lineTo([d.x,d.y]),c.lineTo([d.x+t.x,d.y+t.y])}else c.lineTo([d.x+_.x,d.y+_.y])}else{_.scale(u).rotate(this._slopeC,this._slopeS);const e=h.getXY(m-1);e||Dt().error(new i.A("mapview-bad-resource","Unable to process geometry, index out of scope"));const t=Oe.bR.add(d,_).sub(Oe.bR.fromArray(e));if(p.x*t.y-p.y*t.x>0){const e=p.clone().scale(u).rotate(this._slopeC,this._slopeS),t=f.clone().scale(u).rotate(this._slopeC,this._slopeS);h.lineTo([d.x+e.x,d.y+e.y]),h.lineTo([d.x,d.y]),h.lineTo([d.x+t.x,d.y+t.y])}else h.lineTo([d.x+_.x,d.y+_.y])}const r=Math.acos(y);let n=1;if(u>.25){const e=2*Math.acos(1-.25/u);e<r&&(n=Math.round(r/e))}const o=Math.cos(r/n),a=Math.sin(r/n),l=p.clone();if(s<0){l.rotate(this._slopeC,this._slopeS);const s=h.getXY(m-1);s||Dt().error(new i.A("mapview-bad-resource","Unable to process geometry, index out of scope"));const r=Oe.bR.add(d,l.clone().scale(this._lastWidth)),n=Oe.bR.sub(r,Oe.bR.fromArray(s)),o=p.x*n.y-p.y*n.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&o>0){const s=new Oe.bR(e,t),i=this._lastTangent1.clone().scale(this._lastWidth);i.rotate(this._slopeC,this._slopeS);const r=p.clone().scale(this._lastWidth);r.rotate(this._slopeC,this._slopeS),h.lineTo([s.x+i.x,s.y+i.y]),h.lineTo([s.x,s.y]),h.lineTo([s.x+r.x,s.y+r.y])}}else{l.scale(-1).rotateReverse(this._slopeC,this._slopeS);const s=c.getXY(g-1);s||Dt().error(new i.A("mapview-bad-resource","Unable to process geometry, index out of scope"));const r=Oe.bR.add(d,l.clone().scale(this._lastWidth)),n=Oe.bR.sub(r,Oe.bR.fromArray(s)),o=p.x*n.y-p.y*n.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&o>0){const s=new Oe.bR(e,t),i=this._lastTangent1.clone().scale(-this._lastWidth);i.rotateReverse(this._slopeC,this._slopeS);const r=p.clone().scale(-this._lastWidth);r.rotateReverse(this._slopeC,this._slopeS),c.lineTo([s.x+i.x,s.y+i.y]),c.lineTo([s.x,s.y]),c.lineTo([s.x+r.x,s.y+r.y])}}l.scale(u);for(let e=0;e<=n;e++)s<0?(h.lineTo([d.x+l.x,d.y+l.y]),l.rotateReverse(o,a)):(c.lineTo([d.x+l.x,d.y+l.y]),l.rotate(o,a))}return this._lastTangent1.setCoords(p.x,p.y),this._lastWidth=u,a}}class Gt{static{this.instance=null}static local(){return null===Gt.instance&&(Gt.instance=new Gt),Gt.instance}execute(e,t,s){return new Bt(e,t,s)}}class Bt{constructor(e,t,s){this._inputGeometries=e,this._height=(void 0!==t.amplitude?t.amplitude:2)*s,this._period=(void 0!==t.period?t.period:3)*s,this._style=t.waveform??"Sinus",this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new tt,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new rt,this._walker.updateTolerance(s)}next(){let e=this._inputGeometries.next();for(;e;){if(0===this._height||0===this._period)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=xe.z.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const s=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case"Sinus":default:this._constructCurve(t,s,!1);break;case"Square":this._constructSquare(t,s);break;case"Triangle":this._constructTriangle(t,s);break;case"Random":this._constructCurve(t,s,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,s){let i=Math.round(t/this._period);0===i&&(i=1);const r=16*i+1,n=t/i,o=this._period/16,a=1/r,h=2*Math.PI*t/n,c=2*Math.PI*Math.random(),l=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),d=.75-Math.random()/2,p=.75-Math.random()/2,f=new st;this._walker.curPointAndAngle(f),e.pushPoint(f.pt);let _=0;for(;;){if(!this._walker.nextPointAndAngle(o,f)){e.pushPoint(this._walker.getPathEnd());break}{const t=_;let i;if(_+=a,s){const e=this._height/2*(1+.3*Math.sin(d*h*t+c));i=e*Math.sin(h*t+l),i+=e*Math.sin(p*h*t+u),i/=2}else i=.5*this._height*Math.sin(.5*h*t);e.pushXY(f.pt[0]-i*f.sa,f.pt[1]+i*f.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let s=!0;for(;;){let t=!1;if(this._walker.curPositionIsValid()){const i=new st;this._walker.curPointAndAngle(i);const r=new st;if(this._walker.nextPointAndAngle(this._period,r)){const n=new st;this._walker.nextPointAndAngle(this._period,n)&&(s?(e.pushPoint(i.pt),s=!1):e.pushPoint(i.pt),e.pushXY(i.pt[0]-this._height/2*i.sa,i.pt[1]+this._height/2*i.ca),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca),t=!0)}}if(!t){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let s=!0;for(;;){let t=!1;if(this._walker.curPositionIsValid()){const i=new st;this._walker.curPointAndAngle(i);const r=new st;if(this._walker.nextPointAndAngle(this._period/2,r)){const n=new st;this._walker.nextPointAndAngle(this._period,n)&&(this._walker.nextPosition(this._period/2)&&(s?(e.pushPoint(i.pt),s=!1):e.pushPoint(i.pt),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca)),t=!0)}}if(!t){e.pushPoint(this._walker.getPathEnd());break}}}}class Wt{static{this.instance=null}static local(){return null===Wt.instance&&(Wt.instance=new Wt),Wt.instance}execute(e,t,s){return new jt(e,t,s)}}class jt extends ke{constructor(e,t,s){super(e),this._geometryWalker=new rt,this._geometryWalker.updateTolerance(s),this._angleToLine=t.angleToLine??!0,this._keepUpright=t.keepUpright??!1,this._offset=(t.offset?t.offset:0)*s,this._originalEndings=t.endings??"WithHalfGap",this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*s,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*s,this._pattern=new tt,this._pattern.init(t.placementTemplate),this._pattern.scale(s),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{"WithFullGap"===this._originalEndings&&this.isClosed?this._endings="WithMarkers":this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case"NoConstraint":s=-this._position,s=this._adjustPosition(s),i=!1;break;case"WithHalfGap":default:s=-this._pattern.lastValue()/2;break;case"WithFullGap":s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case"WithMarkers":s=0;break;case"Custom":s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,i))return null;this._pattern.reset();let r=0;for(;s>r;)s-=r,r=this._pattern.nextValue();r-=s,t=r,this.iteratePath=!0}const s=new st;return this._geometryWalker.nextPointAndAngle(t,s)?"WithFullGap"===this._endings&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):"WithMarkers"===this._endings&&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(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}}class Ut{static{this.instance=null}static local(){return null===Ut.instance&&(Ut.instance=new Ut),Ut.instance}execute(e,t,s){return new Vt(e,t,s)}}class Vt extends ke{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Te,this._placePerPart=t.placePerPart??!1,this._angleToLine=void 0===t.angleToLine||t.angleToLine,this._keepUpright=t.keepUpright??!1,this._offset=void 0!==t.offset?t.offset*s:0,this._type=t.extremityPlacement??"Both",this._position=void 0!==t.offsetAlongLine?t.offsetAlongLine*s:0,this._beginProcessed=!1}processMultiPath(e){return this._placePerPart?super.processMultiPath(e):this.processPath(e)}processPath(e){let t;switch(this._type){case"Both":default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case"JustBegin":t=this._atExtremities(e,this._position,!0);break;case"JustEnd":t=this._atExtremities(e,this._position,!1);case"None":}return t}_atExtremities(e,t,s){if(this._placePerPart||(s?e.seekPath(0):e.seekPath(e.totalSize-1)),s||e.seekPathEnd(),s?e.nextPoint():e.prevPoint()){let i=0,[r,n]=[0,0],[o,a]=[e.x,e.y];const h=[0,0];for(;s?e.nextPoint():e.prevPoint();){r=o,n=a,o=e.x,a=e.y;const s=this._curveHelper.getLength(r,n,o,a);if(i+s>t){const e=(t-i)/s,[c,l]=this._curveHelper.getAngleCS(h,r,n,o,a,e),u=this._curveHelper.getCoord2D(r,n,o,a,e);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}}const Yt=.001;class Ht{static{this.instance=null}static local(){return null===Ht.instance&&(Ht.instance=new Ht),Ht.instance}execute(e,t,s){return new Xt(e,t,s)}}class Xt extends ke{constructor(e,t,s){super(e),this._segmentIterator=null,this._segCount=0,this._firstSeg=!0,this._seg=null,this._ms=[],this._from=0,this._to=0,this._pt=null,this._walker=new rt,this._walker.updateTolerance(s),this._placePerPart=t.placePerPart??!1,this._angleToLine=t.angleToLine??!1,this._keepUpright=t.keepUpright??!1,this._offset=(t.offset??0)*s,this._interval=(t.interval??0)*s,this._interval<=0&&(this._interval=.01),this._skipRate=t.skipMarkerRate??0,this._skipRate<=1&&(this._skipRate=0),this._placeAtExtremities=t.placeAtExtremities??!1}processPath(e){if(!this.iteratePath){const{fromGeometry:t}=je.module,s=t(e.getCurrentPath().asJSON()).getGeometry(),i=s.getPathStart(0);this._segmentIterator=s.querySegmentIteratorAtVertex(i),this._segCount=s.getSegmentCountPath(0),this._firstSeg=!0,this.iteratePath=!0,this._pt=s.getXY(0).clone()}for(;0===this._ms.length&&this._segmentIterator?.hasNextSegment();){--this._segCount,this._seg=this._segmentIterator.nextSegment(),this._from=this._seg.getStartAttributeAsDbl(2,0),this._to=this._seg.getEndAttributeAsDbl(2,0);const t=!isNaN(this._from),s=!isNaN(this._to);t&&(this._from=Math.round(this._from/Yt)*Yt,Math.abs(this._from)<Yt&&(this._from=0)),s&&(this._to=Math.round(this._to/Yt)*Yt,Math.abs(this._to)<Yt&&(this._to=0));let i=t?Math.floor(this._from/this._interval):0,r=s?Math.floor(this._to/this._interval):0;if(t&&(this._placeAtExtremities||!this._firstSeg||!this._placePerPart&&e.pathIndex>0)&&Math.abs(i*this._interval-this._from)<Yt&&(!this._skipRate||i%this._skipRate)&&this._ms.push(this._from),this._firstSeg=!1,t&&s&&!(Math.abs(this._from-this._to)<Yt))if(this._from<=this._to){i*this._interval<this._from+Yt&&++i,r*this._interval>this._to-Yt&&--r;for(let e=i;e<=r;++e)(!this._skipRate||e%this._skipRate)&&this._ms.push(e*this._interval)}else{i*this._interval>this._from-Yt&&--i,r*this._interval<this._to+Yt&&++r;for(let e=r;e<=i;++e)(!this._skipRate||e%this._skipRate)&&this._ms.push(e*this._interval)}}let t=0;if(0===this._ms.length){if(this.iteratePath=!1,!this._segCount&&this._placeAtExtremities&&!isNaN(this._to)&&(this._placePerPart||e.pathIndex===e.totalSize-1)){const e=Math.floor(this._to/this._interval);Math.abs(e*this._interval-this._to)<Yt&&(!this._skipRate||e%this._skipRate)&&(this._ms.push(this._to),t=1)}if(0===this._ms.length)return null}const s=this._ms.pop(),i=isNaN(this._from)||isNaN(this._to)||Math.abs(this._from-this._to)<Yt?t:(s-this._from)/(this._to-this._from);this._seg.queryCoord2D(i,this._pt);const r=this._seg.getTangent(i),{x:n,y:o}=r.normalize();return this.internalPlacement.setTranslate(this._pt.x-this._offset*o,this._pt.y+this._offset*n),this._angleToLine&&this.internalPlacement.setRotateCS(n,o),this.internalPlacement.setMeasure(s),this.internalPlacement}}class $t{static{this.instance=null}static local(){return null===$t.instance&&($t.instance=new $t),$t.instance}execute(e,t,s){return new Zt(e,t,s)}}class Zt extends ke{constructor(e,t,s){super(e),this._walker=new rt,this._walker.updateTolerance(s),this._angleToLine=void 0===t.angleToLine||t.angleToLine,this._keepUpright=t.keepUpright??!1,this._offset=void 0!==t.offset?t.offset*s:0,this._beginGap=void 0!==t.beginPosition?t.beginPosition*s:0,this._endGap=void 0!==t.endPosition?t.endPosition*s:0,this._flipFirst=void 0===t.flipFirst||t.flipFirst,this._pattern=new tt,this._pattern.init(t.positionArray,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const e=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+e;t=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,i=this._beginGap+s;t=i-this._prevPos,this._prevPos=i,this.iteratePath=!0}const s=new st;if(!this._walker.nextPointAndAngle(t,s,1))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 Qt=512,Jt=24,Kt=1e-6;class es{static{this.instance=null}static local(){return null===es.instance&&(es.instance=new es),es.instance}execute(e,t,s,i){return new ts(e,t,s,i)}}class ts{constructor(e,t,s,i){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(t.stepX??16)*s,this._stepY=Math.abs(t.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=t.gridType??"Fixed","Random"===this._gridType){const e=t.seed??13,s=1;this._randomLCG=new h.A(e*s),this._randomness=(t.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=t.gridAngle??0,this._shiftOddRows=t.shiftOddRows??!1,this._offsetX=(t.offsetX??0)*s,this._offsetY=(t.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[e,t,s,r]=i.split("/"),n=parseFloat(e),o=parseFloat(t),a=parseFloat(s),h=parseFloat(r);this._graphicOriginX=-(h*2**n+a)*Qt,this._graphicOriginY=o*Qt,this._testInsidePolygon=!0}this._internalPlacement=new Pe,this._calculateMinMax(e),this._geometryCursor=e}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!ts._randValues){ts._randValues=[];for(let e=0;e<Jt;e++)for(let e=0;e<Jt;e++)ts._randValues.push(this._randomLCG.getFloat()),ts._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(e){let t,s,i,r,n,o,a,h,c,l,u,d,p,f;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,a=h=p=u=Number.MAX_VALUE,c=l=f=d=-Number.MAX_VALUE;const _=1!==this._cosAngle;for(e.reset();e.nextPath();)for(;e.nextPoint();)o=e.x,n=e.y,t=o-this._graphicOriginX-this._offsetX,s=n-this._graphicOriginY-this._offsetY,_?(i=this._cosAngle*t-this._sinAngle*s,r=this._sinAngle*t+this._cosAngle*s):(i=t,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),p=Math.min(p,o),f=Math.max(f,o);u=u!==Number.MAX_VALUE?u:-512-this._stepY,d=d!==-Number.MAX_VALUE?d:this._stepY,p=p!==Number.MAX_VALUE?p:-this._stepX,f=f!==-Number.MAX_VALUE?f:Qt+this._stepX;const m=d-u,g=f-p;if(this._verticalSubdivision=m>=g,this._polygonMin=this._verticalSubdivision?u:p,this._testInsidePolygon){let e=0-this._graphicOriginX-this._offsetX-this._stepX,t=Qt-this._graphicOriginX-this._offsetX+this._stepX,s=-512-this._graphicOriginY-this._offsetY-this._stepY,i=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const r=[[e,s],[e,i],[t,s],[t,i]];e=s=Number.MAX_VALUE,t=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];e=Math.min(e,r),t=Math.max(t,r),s=Math.min(s,o),i=Math.max(i,o)}}a=a!==Number.MAX_VALUE?Math.max(a,e):e,h=h!==Number.MAX_VALUE?Math.max(h,s):s,c=c!==-Number.MAX_VALUE?Math.min(c,t):t,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(e,p,f,u,d)}_buildAccelerationMap(e,t,s,i,r){e.reset();const n=new Map,o=this._verticalSubdivision,a=o?r-i:s-t;let h=Math.ceil(a/10);if(h<=1)return;const c=Math.floor(a/h);let l,u,d,p,f,_,m,g,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=Qt+2*this._stepX,b=t);e.nextPath();)if(!(e.pathSize<2)&&e.nextPoint())for(l=e.x,u=e.y;e.nextPoint();l=d,u=p){if(d=e.x,p=e.y,o){if(u===p||u<y&&p<y||u>x&&p>x)continue;f=Math.min(u,p),_=Math.max(u,p)}else{if(l===d||l<y&&d<y||l>x&&d>x)continue;f=Math.min(l,d),_=Math.max(l,d)}for(;f<_;)m=Math.floor((f-b)/c),ss(m,l,u,d,p,n),f+=c;g=Math.floor((_-b)/c),g>m&&ss(g,l,u,d,p,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 e=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(e+=.5*this._stepX);const t=this._currentY*this._stepY+this._offsetY;let s,i;if(this._currentX++,"Random"===this._gridType){const r=(this._currentX%Jt+Jt)%Jt,n=(this._currentY%Jt+Jt)%Jt;s=this._graphicOriginX+e+this._stepX*this._randomness*(.5-ts._randValues[n*Jt+r])*2/3,i=this._graphicOriginY+t+this._stepY*this._randomness*(.5-ts._randValues[n*Jt+r+1])*2/3}else s=this._graphicOriginX+this._cosAngle*e+this._sinAngle*t,i=this._graphicOriginY-this._sinAngle*e+this._cosAngle*t;if(!this._testInsidePolygon||this._isInsidePolygon(s,i,this._geometryCursor))return this._internalPlacement.setTranslate(s,i),this._internalPlacement}}_isInsidePolygon(e,t,s){if(null==this._accelerationMap)return function(e,t,s){let i,r,n,o,a=0;for(e+=Kt,t+=Kt,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>t!=o>t&&((n-i)*(t-r)-(o-r)*(e-i)>0?a++:a--);return 0!==a}(e,t,s);e+=Kt,t+=Kt;const i=this._verticalSubdivision,r=i?t:e,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]>t==h[1]>t)continue;c=(h[0]-a[0])*(t-a[1])-(h[1]-a[1])*(e-a[0])}else{if(a[0]>e==h[0]>e)continue;c=(h[1]-a[1])*(e-a[0])-(h[0]-a[0])*(t-a[1])}c>0?l++:l--}return 0!==l}}function ss(e,t,s,i,r,n){let o=n.get(e);o||(o=[],n.set(e,o)),o.push([[t,s],[i,r]])}class is{static{this.instance=null}static local(){return null===is.instance&&(is.instance=new is),is.instance}execute(e,t,s){return new rs(e,t,s)}}class rs extends ke{constructor(e,t,s){super(e),this._curveHelper=new Te,this._angleToLine=void 0===t.angleToLine||t.angleToLine,this._keepUpright=t.keepUpright??!1,this._offset=void 0!==t.offset?t.offset*s:0,this._relativeTo=t.relativeTo??"LineMiddle",this._position=void 0!==t.startPointOffset?t.startPointOffset*s:0,this._epsilon=.001*s}processPath(e){const t=this._position;if("SegmentMidpoint"===this._relativeTo){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[t,s]=[e.x,e.y],[i,r]=[0,0];const n=[0,0];for(;e.nextPoint();){i=e.x,r=e.y;const o=this._curveHelper.getLength(t,s,i,r);if(o<this._epsilon){t=i,s=r;continue}const a=.5+this._position/o,[h,c]=this._curveHelper.getAngleCS(n,t,s,i,r,a),l=this._curveHelper.getCoord2D(t,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="LineEnd"===this._relativeTo;return this.onLine(e,t,s)}onLine(e,t,s){let i,r=!1;switch(this._relativeTo){case"LineMiddle":default:e.seekPathStart(),i=e.pathLength()/2+t;break;case"LineBeginning":i=t;break;case"LineEnd":i=t,r=!0}s?e.seekPathEnd():e.seekPathStart();let n=0;if(s?e.prevPoint():e.nextPoint()){let[t,o]=[e.x,e.y],[a,h]=[0,0];const c=[0,0];for(;s?e.prevPoint():e.nextPoint();){a=e.x,h=e.y;const s=this._curveHelper.getLength(t,o,a,h);if(n+s>i){const e=(i-n)/s,[l,u]=this._curveHelper.getAngleCS(c,t,o,a,h,e),d=this._curveHelper.getCoord2D(t,o,a,h,e),p=r?-this._offset:this._offset;return this.internalPlacement.setTranslate(d[0]-p*u,d[1]+p*l),this._angleToLine&&(r?this.internalPlacement.setRotateCS(-l,-u):this.internalPlacement.setRotateCS(l,u)),this.internalPlacement}t=a,o=h,n+=s}}return null}}class ns{static{this.instance=null}static local(){return null===ns.instance&&(ns.instance=new ns),ns.instance}execute(e,t,s){return new os(e,t,s)}}class os extends ke{constructor(e,t,s){super(e),this._curveHelper=new Te,this._angleToLine=void 0===t.angleToLine||t.angleToLine,this._keepUpright=t.keepUpright??!1,this._offset=void 0!==t.offset?t.offset*s:0,this._endPoints=void 0===t.placeOnEndPoints||t.placeOnEndPoints,this._controlPoints=void 0===t.placeOnControlPoints||t.placeOnControlPoints,this._regularVertices=void 0===t.placeOnRegularVertices||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let s=t[0],i=t[1];if(0!==this._offset){const e=Math.cos(t[2]),r=Math.sin(t[2]);s-=this._offset*r,i+=this._offset*e}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let s=0,i=!1,r=0,n=0;if(e.seekPathStart(),e.nextPoint()){let o=e.x,a=e.y,h=e.getControlPoint(),c=!0,l=e.nextPoint();for(;l;){const u=e.x,d=e.y,p=e.getControlPoint();(this._angleToLine||0!==this._offset)&&(r=this._curveHelper.getAngle(o,a,u,d,0)),c?(c=!1,t?(s=r,i=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,r])):h?this._controlPoints&&this._tags.push([o,a,as(n,r)]):this._regularVertices&&this._tags.push([o,a,as(n,r)]),(this._angleToLine||0!==this._offset)&&(n=this._curveHelper.getAngle(o,a,u,d,1)),l=e.nextPoint(),l||(t?p||i?this._controlPoints&&this._tags.push([u,d,as(n,s)]):this._regularVertices&&this._tags.push([u,d,as(n,s)]):(this._endPoints||this._controlPoints&&p)&&this._tags.push([u,d,n])),o=u,a=d,h=p}}this._tagIterator=0}}function as(e,t){const s=Math.PI;for(;Math.abs(t-e)>s+2e-15;)t-e>s?t-=2*s:t+=2*s;return(e+t)/2}var hs=s(32011);class cs{static{this.instance=null}static local(){return null===cs.instance&&(cs.instance=new cs),cs.instance}execute(e,t,s){return new ls(e,t,s)}}class ls{constructor(e,t,s){this._geometryCursor=e,this._offsetX=void 0!==t.offsetX?t.offsetX*s:0,this._offsetY=void 0!==t.offsetY?t.offsetY*s:0,this._method=void 0!==t.method?t.method:"OnPolygon",this._placementPerPart=void 0!==t.placePerPart&&t.placePerPart,this._internalPlacement=new Pe}next(){const e=this._geometryCursor;if(!e)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(e);for(;e.nextPath();)if(!(e.getCurrentRingArea()<0))return this._polygonCenter(e.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(e){let t=!1;switch(this._method){case"CenterOfMass":{const s=(0,St.TP)(e);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}break;case"BoundingBoxCenter":{const s=(0,ct.z8)(e);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),t=!0)}break;default:{const s=(0,hs.d)(e);null!==s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}}class us{static{this.instance=null}static local(){return null===us.instance&&(us.instance=new us),us.instance}execute(e,t,s){return new ds(e,t,s)}}class ds{constructor(e,t,s){}next(){throw new Error("Method not implemented.")}}class ps{static{this.instance=null}static local(){return null===ps.instance&&(ps.instance=new ps),ps.instance}execute(e,t,s){return new fs(e,t,s)}}class fs{constructor(e,t,s){}next(){throw new Error("Method not implemented.")}}class _s{static{this.instance=null}static local(){return null===_s.instance&&(_s.instance=new _s),_s.instance}execute(e,t,s){return new ms(e,t,s)}}class ms{constructor(e,t,s){}next(){throw new Error("Method not implemented.")}}class gs{static{this.instance=null}static local(){return null===gs.instance&&(gs.instance=new gs),gs.instance}execute(e,t,s){return new ys(e,t,s)}}class ys{constructor(e,t,s){}next(){throw new Error("Method not implemented.")}}class xs{static{this.instance=null}static local(){return null===xs.instance&&(xs.instance=new xs),xs.instance}execute(e,t,s){if("linearDimensionPointEffect"!==t?.type)throw new Error("Invalid effect type for LinearDimensionPointEffect");return new bs(e,t,s)}}class bs{constructor(e,t,s){}next(){throw new Error("Method not implemented.")}}class ws{static{this.instance=null}static local(){return null===ws.instance&&(ws.instance=new ws),ws.instance}execute(e,t,s){return new vs(e,t,s)}}class vs{constructor(e,t,s){}next(){throw new Error("Method not implemented.")}}function Ss(e){if(!e)return null;switch(e.type){case"CIMGeometricEffectAddControlPoints":return ve.local();case"CIMGeometricEffectArrow":return Fe.local();case"CIMGeometricEffectBuffer":return Xe.local();case"CIMGeometricEffectControlMeasureLine":return Qe.local();case"CIMGeometricEffectCut":return Ke.local();case"CIMGeometricEffectDashes":return nt.local();case"CIMGeometricEffectDonut":return at.local();case"CIMGeometricEffectJog":return _t.local();case"CIMGeometricEffectMove":return gt.local();case"CIMGeometricEffectOffset":return bt.local();case"CIMGeometricEffectRadial":return It.local();case"CIMGeometricEffectReverse":return Mt.local();case"CIMGeometricEffectRotate":return At.local();case"CIMGeometricEffectScale":return Ft.local();case"CIMGeometricEffectSuppress":return Ot.local();case"CIMGeometricEffectTaperedPolygon":return qt.local();case"CIMGeometricEffectWave":return Gt.local();case"CIMGeometricEffectEnclosingPolygon":return lt.local();case"LinearDimensionLineEffect":return gs.local();case"LinearDimensionLeaderLineEffect":return _s.local();case"LinearDimensionPointEffect":return xs.local();case"LinearDimensionArrowEffect":return us.local();case"LinearDimensionTextEffect":return ws.local();case"LinearDimensionExtensionLineEffect":return ps.local()}return null}class Is{static getPlacement(e,t,s,i,r){const n=function(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return Wt.local();case"CIMMarkerPlacementAtExtremities":return Ut.local();case"CIMMarkerPlacementAtMeasuredUnits":return Ht.local();case"CIMMarkerPlacementAtRatioPositions":return $t.local();case"CIMMarkerPlacementInsidePolygon":return es.local();case"CIMMarkerPlacementOnLine":return is.local();case"CIMMarkerPlacementOnVertices":return ns.local();case"CIMMarkerPlacementPolygonCenter":return cs.local()}return null}(s);return n?(-1===t&&e.invertY(),n.execute(e,s,i,r)):null}}var Ps=s(68197);function Ms(e,t){return[!!e?.minScale&&t.scaleToZoom(e.minScale)||0,!!e?.maxScale&&t.scaleToZoom(e.maxScale)||100]}function ks(e){return 1<<e}function Cs(e){let t=0;for(const[s,i]of e)i&&(t|=1<<s);return t}function As(e){let t;if(!e)return[0,0,0,0];if("string"==typeof e){const s=Ps.A.fromString(e);if(!s)return Lt.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils").errorOnce(new i.A("mapview:mesh-processing","Unable to parse string into color",{color:e})),[0,0,0,0];t=s.toArray()}else t=e;const[s,r,n,o]=t;return[s*(o/255),r*(o/255),n*(o/255),o]}function Ts(e){switch(e){case"butt":case"Butt":return 0;case"round":case"Round":return 1;case"square":case"Square":return 2}}function Fs(e){switch(e){case"bevel":case"Bevel":return 0;case"miter":case"Miter":return 2;case"round":case"Round":return 1}}function zs(e,t){return Math.round(Math.min(Math.sqrt(e*t),255))}function Es(e,t){return Math.round(e*t)/t}const Os=0,Rs=1,Ls=2,Ds=3,qs=4,Ns=5;new(s(32488).A);var Gs=s(4718);s(11831),s(92602),new Map,new Set;var Bs=s(34727);function Ws(e,t=0){let s=0;for(let i=0;i<4;i++)s+=e[t+i]*js[i];return s}const js=[1/256,1/65536,1/16777216,1/4294967296];Ws(new Uint8ClampedArray([255,255,255,255])),Ws(new Uint8ClampedArray([255,255,255,0])),s(5760);var Us=s(34304);function Vs(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Ys(e,t,s){const i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],h=t[5],c=s[0],l=s[1],u=s[2],d=s[3],p=s[4],f=s[5];return e[0]=i*c+n*l,e[1]=r*c+o*l,e[2]=i*u+n*d,e[3]=r*u+o*d,e[4]=i*p+n*f+a,e[5]=r*p+o*f+h,e}function Hs(e,t,s){const i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],h=t[5],c=Math.sin(s),l=Math.cos(s);return e[0]=i*l+n*c,e[1]=r*l+o*c,e[2]=i*-c+n*l,e[3]=r*-c+o*l,e[4]=a,e[5]=h,e}function Xs(e,t,s){const i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],h=t[5],c=s[0],l=s[1];return e[0]=i,e[1]=r,e[2]=n,e[3]=o,e[4]=i*c+n*l+a,e[5]=r*c+o*l+h,e}function $s(e,t){const s=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=s,e[2]=-s,e[3]=i,e[4]=0,e[5]=0,e}function Zs(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e[2]=t[2]-s[2],e[3]=t[3]-s[3],e[4]=t[4]-s[4],e[5]=t[5]-s[5],e}const Qs=Ys,Js=Zs;function Ks(){const e=new Float32Array(6);return e[0]=1,e[3]=1,e}function ei(e,t,s,i){const r=t[i],n=t[i+1];e[i]=s[0]*r+s[2]*n+s[4],e[i+1]=s[1]*r+s[3]*n+s[5]}Object.freeze(Object.defineProperty({__proto__:null,add:function(e,t,s){return e[0]=t[0]+s[0],e[1]=t[1]+s[1],e[2]=t[2]+s[2],e[3]=t[3]+s[3],e[4]=t[4]+s[4],e[5]=t[5]+s[5],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},determinant:function(e){return e[0]*e[3]-e[1]*e[2]},equals:function(e,t){const s=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5],h=t[0],c=t[1],l=t[2],u=t[3],d=t[4],p=t[5],f=(0,Us.FD)();return Math.abs(s-h)<=f*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(i-c)<=f*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(r-l)<=f*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-u)<=f*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(o-d)<=f*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-p)<=f*Math.max(1,Math.abs(a),Math.abs(p))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+1)},fromRotation:$s,fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e},identity:Vs,invert:function(e,t){const s=t[0],i=t[1],r=t[2],n=t[3],o=t[4],a=t[5];let h=s*n-i*r;return h?(h=1/h,e[0]=n*h,e[1]=-i*h,e[2]=-r*h,e[3]=s*h,e[4]=(r*a-n*o)*h,e[5]=(i*o-s*a)*h,e):null},mul:Qs,multiply:Ys,multiplyScalar:function(e,t,s){return e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e[3]=t[3]*s,e[4]=t[4]*s,e[5]=t[5]*s,e},multiplyScalarAndAdd:function(e,t,s,i){return e[0]=t[0]+s[0]*i,e[1]=t[1]+s[1]*i,e[2]=t[2]+s[2]*i,e[3]=t[3]+s[3]*i,e[4]=t[4]+s[4]*i,e[5]=t[5]+s[5]*i,e},rotate:Hs,scale:function(e,t,s){const i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],h=t[5],c=s[0],l=s[1];return e[0]=i*c,e[1]=r*c,e[2]=n*l,e[3]=o*l,e[4]=a,e[5]=h,e},set:function(e,t,s,i,r,n,o){return e[0]=t,e[1]=s,e[2]=i,e[3]=r,e[4]=n,e[5]=o,e},str:function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},sub:Js,subtract:Zs,translate:Xs},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(6);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},create:Ks,fromValues:function(e,t,s,i,r,n){const o=new Float32Array(6);return o[0]=e,o[1]=t,o[2]=s,o[3]=i,o[4]=r,o[5]=n,o},transform:ei,transformMany:function(e,t,s,i=0,r=0,n=2){const o=r||t.length/n;for(let r=i;r<o;r++)ei(e,t,s,r*n)}},Symbol.toStringTag,{value:"Module"}));var ti=s(88340);var si=s(18989);class ii{constructor(e,t,s,i){this.transformedX=0,this.transformedY=0,this.center=(0,ti.fA)(e,t),this.centerT=(0,ti.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(e){this.center[0]=e}set y(e){this.center[1]=e}clone(){return new ii(this.x,this.y,this.width,this.height)}serialize(e){return e.writeF32(this.center[0]),e.writeF32(this.center[1]),e.push(this.width),e.push(this.height),e}findCollisionDelta(e,t=4){const s=Math.abs(e.centerT[0]-this.centerT[0]),i=Math.abs(e.centerT[1]-this.centerT[1]),r=(e.halfWidth+this.halfWidth+t)/s,n=(e.halfHeight+this.halfHeight+t)/i,o=Math.min(r,n);return Math.log2(o)}extend(e){const t=Math.min(this.xmin,e.xmin),s=Math.min(this.ymin,e.ymin),i=Math.max(this.xmax,e.xmax)-t,r=Math.max(this.ymax,e.ymax)-s,n=t+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(e){const t=e.readF32(),s=e.readF32(),i=e.readInt32(),r=e.readInt32();return new ii(t,s,i,r)}}const ri=Math.PI/180;class ni{constructor(e,t,s,i){this._rotationT=Ks(),this._transform=Ks(),this._angle=0,this._bounds=null;const r=s.rect;e*=i,t*=i,this.width=0===s.code?s.metrics.width:r.width*i,this.height=0===s.code?s.metrics.height:r.height*i,this.x=e,this.y=t,this.textureBinding=s.textureBinding,this.texcoords={topLeft:[r.x,r.y],topRight:[r.x+r.width,r.y],bottomLeft:[r.x,r.y+r.height],bottomRight:[r.x+r.width,r.y+r.height]}}set angle(e){this._angle=e,$s(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:e,y:t,width:s,height:i}=this,r=$s(Ks(),-this.angle),n=Ys(Ks(),r,this._transform);this._offsets={topLeft:(0,D.l0)([0,0],[e,t],n),topRight:(0,D.l0)([0,0],[e+s,t],n),bottomLeft:(0,D.l0)([0,0],[e,t+i],n),bottomRight:(0,D.l0)([0,0],[e+s,t+i],n)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const e=this.offsets;let t=1/0,s=1/0,i=-1/0,r=-1/0;for(const[n,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,n),s=Math.min(s,o),i=Math.max(i,n),r=Math.max(r,o);const n=i-t,o=r-s,a=t+n/2,h=s+o/2;this._bounds=new ii(a,h,n,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const oi=(e,t)=>({code:0,page:0,sdf:!0,rect:new si.A(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:e,left:0,top:0}});function ai(e,t){return e.forEach(e=>(0,D.l0)(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class hi{constructor(e,t,s,i){this._rotation=0,this._decorate(e,t,s,i),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.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 t of e)t.setTransform(this._transform)}setRotation(e){if(0===e&&0===this._rotation)return;this._rotation=e;const t=this._transform;Ys(t,$s(Ks(),e),t);for(const e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,s,i){if(!s.decoration||"none"===s.decoration||!e.length)return;const r=s.scale,n="underline"===s.decoration?i?.baseline??26:i?.midline??16,o=e[0].textureBinding;for(const s of t){const t=s.startX*r,i=s.startY*r,a=(s.width+s.glyphWidthEnd)*r;e.push(new ni(t,i+n*r,oi(a,o),1))}}shapeBackground(e){const t=(1.5+(this._borderLineSizePx||0))/2,s=this._borderLineSizePx?t: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],p=[i-8,o+8],f=[n+8,o+8],_=ai([[u[0]-t,u[1]-t],[d[0]+t,d[1]-t],[u[0]+s,u[1]+s],[d[0]-s,d[1]+s]],e),m=ai([[p[0]+s,p[1]-s],[f[0]-s,f[1]-s],[p[0]-t,p[1]+t],[f[0]+t,f[1]+t]],e),g=ai([[u[0]-t,u[1]-t],[u[0]+s,u[1]+s],[p[0]-t,p[1]+t],[p[0]+s,p[1]-s]],e),y=ai([[d[0]-s,d[1]+s],[d[0]+t,d[1]-t],[f[0]-s,f[1]-s],[f[0]+t,f[1]+t]],e),x={main:ai([u,d,p,f],e),top:_,bot:m,left:g,right:y};return[new ii(a,h,c+2*t,l+2*t),x]}get boundsT(){const e=this.bounds,t=(0,D.hZ)((0,ti.vt)(),e.x,e.y);if((0,D.l0)(t,t,this._transform),this._hasRotation){const s=Math.max(e.width,e.height);return new ii(t[0],t[1],s,s)}return new ii(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,s=1/0,i=0,r=0;for(const n of e)t=Math.min(t,n.offsets.topLeft[0]),s=Math.min(s,n.offsets.topLeft[1]),i=Math.max(i,n.offsets.bottomRight[0]),r=Math.max(r,n.offsets.bottomRight[1]);const n=i-t,o=r-s;return new ii(t+n/2,s+o/2,n,o)}_createGlyphTransform(e,t){const s=ri*t.angle,i=Ks(),r=(0,ti.vt)();return Xs(i,i,(0,D.hZ)(r,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?Hs(i,i,s):(Xs(i,i,(0,D.hZ)(r,e.x,e.y)),Hs(i,i,s),Xs(i,i,(0,D.hZ)(r,-e.x,-e.y))),i}}class ci{constructor(e,t,s,i,r,n){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,s)),this.end=Math.max(0,Math.max(t,s)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].metrics.width),this.width=i,this.yMin=r,this.yMax=n}}const li=e=>10===e,ui=e=>32===e;function di(e,t){const s=t.scale,i=new Array,r=e.sdfPadding,{faceInfo:n,glyphs:o,isRightToLeft:a}=e,h=function(e,t,s){const i=new Array,r=1/s.scale,n=s.maxLineWidth*r,o=t?e.length-1:0,a=t?-1:e.length,h=t?-1:1;let c=o,l=0,u=0,d=c,p=d,f=0,_=1/0,m=0;for(;c!==a;){const{code:t,metrics:s}=e[c],r=Math.abs(s.top);if(li(t)||ui(t)||(_=Math.min(_,r),m=Math.max(m,r+s.height)),li(t))c!==o&&(i.push(new ci(e,d,c-h,l,_===1/0?0:_,m)),_=1/0,m=0),l=0,d=c+h,p=c+h,u=0;else if(ui(t))p=c+h,u=0,f=s.advance,l+=s.advance;else if(l>n){if(p!==d){const t=p-2*h;l-=f,i.push(new ci(e,d,t,l-u,_,m)),_=1/0,m=0,d=p,l=u}else i.push(new ci(e,d,c-h,l,_,m)),_=1/0,m=0,d=c,p=c,l=0;l+=s.advance,u+=s.advance}else l+=s.advance,u+=s.advance;c+=h}const g=new ci(e,d,c-h,l,_,m);return g.start>=0&&g.end<e.length&&i.push(g),i}(o,a,t),c=h.length?function(e,t){let s=0;for(let t=0;t<e.length;t++){const{width:i}=e[t];s=Math.max(i,s)}const i="underline"===t.decoration?4:0,r=e[0].yMin;return{x:0,y:r,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+i-r,width:s}}(h,t):{y:0,height:0},l=function(e){if(!e)return 0;switch(e){case"Left":case"left":return-1;case"Right":case"right":return 1;case"Justify":return Lt.A.getLogger("esri.views.2d.engine.webgl.alignmentUtils").warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),0;case"Center":case"center":return 0}}(t.horizontalAlignment),u=function(e){if(!e)return 0;switch(e){case"Top":case"top":return 1;case"Center":case"middle":return 0;case"Baseline":case"baseline":return 2;case"Bottom":case"bottom":return-1}}(t.verticalAlignment),d=2===u?1:0,p=d?0:u-1,f=(1-d)*-c.y+p*(c.height/2)+-22*d;for(let n=0;n<h.length;n++){const{start:a,end:c,width:u}=h[n];let d=-1*(l+1)*(u/2)-r;const p=(e.isRightToLeft?h.length-1-n:n)*t.lineHeight+f-r;h[n].startX=d,h[n].startY=p;for(let e=a;e<=c;e++){const t=o[e];if(li(t.code))continue;const r=new ni(d+t.metrics.left,p-t.metrics.top,t,s);d+=t.metrics.advance,i.push(r)}}return new hi(i,h,t,n)}s(39829),Math.PI,s(59868);var pi=s(13195);function fi(e){if(!e)return 0;let t=0;for(const s of e)t+=_i(s);return t}function _i(e){if(!e)return 0;if((0,Re.St)(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs((0,Re.$w)(e.offsetX)),Math.abs((0,Re.$w)(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRadial":return Math.abs(e.length??5);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}Math.PI,Math.PI;const mi=96/72;class gi{static executeEffects(e,t,s,i){const r=mi,n=fi(e);let o=new Ye(t);for(const t of e){const e=Ss(t);e&&(o=e.execute(o,t,r,s,n,i))}return o}static applyEffects(e,t){if(!e)return t;const s=fi(e);let i,r=new Ye(xe.z.fromJSONCIM(t));for(const t of e){const e=Ss(t);e&&(r=e.execute(r,t,1,null,s,!1))}const n=[];let o=null;for(;i=r.next();)n.push(...(0,Ie.x)(i)),o=i.geometryType;return 0===n.length||null===o?null:"esriGeometryPolygon"===o?{rings:n}:{paths:n}}}var yi=s(89518),xi=s(68572),bi=s(63907);class wi{static fromVertexSpec(e,t){const s=xi.q.fromVertexSpec(e,t);return new wi(s)}constructor(e){this._spec=e,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(e,t,s,i,r,n){for(let e=0;e<this._spec.packVertexCount;e++){const o=e*this._spec.stride;this._packPosition(s,i,o),this._packId(t,o);const a=this._spec.bitset;if(n){if(a.packTessellation){const e=a.packTessellation(n,r,s,i);this._pack(e,a,o)}for(const e of this._spec.standardAttributes)if(null!=e.packTessellation){const t=e.packTessellation(n,r,s,i);this._pack(t,e,o)}else if(e.packAlternating?.packTessellation){const t=e.packAlternating.packTessellation(n,r,s,i);for(let s=0;s<this._spec.packVertexCount;s++){const i=t[s];this._pack(i,e,s*this._spec.stride)}}}}e.vertexWriteRegion(this._packedU32View)}pack(e,t){for(const s of this._spec.standardAttributes)if(s.pack&&"string"!=typeof s.pack){const i=s.pack(e,t);for(let e=0;e<this._spec.packVertexCount;e++)this._pack(i,s,e*this._spec.stride)}else if(s.packAlternating?.pack){const i=s.packAlternating.pack(e,t);for(let e=0;e<this._spec.packVertexCount;e++){const t=i[e];this._pack(t,s,e*this._spec.stride)}}}_packPosition(e,t,s){const{offset:i}=this._spec.position,r=this._spec.position.packPrecisionFactor??1,n=(0,yi.M9)(e*r,t*r);this._dataView.setUint32(s+i,n,!0)}_packId(e,t){const s=e*(this._spec.id.packPrecisionFactor??1),i=4278190080&this._dataView.getUint32(t+this._spec.id.offset,!0);this._dataView.setUint32(t+this._spec.id.offset,s|i,!0)}_pack(e,t,s){!function(e,t,s,i){const r=s.packPrecisionFactor??1;switch(s.type){case bi.pe.BYTE:if(1===s.count)e.setInt8(i+s.offset,t*r);else for(let n=0;n<s.count;n++){const o=n*Int8Array.BYTES_PER_ELEMENT;e.setInt8(i+s.offset+o,t[n]*r)}break;case bi.pe.UNSIGNED_BYTE:if(1===s.count)e.setUint8(i+s.offset,t*r);else for(let n=0;n<s.count;n++){const o=n*Uint8Array.BYTES_PER_ELEMENT;e.setUint8(i+s.offset+o,t[n]*r)}break;case bi.pe.SHORT:if(1===s.count)e.setInt16(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Int16Array.BYTES_PER_ELEMENT;e.setInt16(i+s.offset+o,t[n]*r,!0)}break;case bi.pe.UNSIGNED_SHORT:if(1===s.count)e.setUint16(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Uint16Array.BYTES_PER_ELEMENT;e.setUint16(i+s.offset+o,t[n]*r,!0)}break;case bi.pe.INT:if(1===s.count)e.setInt32(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Int32Array.BYTES_PER_ELEMENT;e.setInt32(i+s.offset+o,t[n]*r,!0)}break;case bi.pe.UNSIGNED_INT:if(1===s.count)e.setUint32(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Uint32Array.BYTES_PER_ELEMENT;e.setUint32(i+s.offset+o,t[n]*r,!0)}break;case bi.pe.FLOAT:if(1===s.count)e.setFloat32(i+s.offset,t*r,!0);else for(let n=0;n<s.count;n++){const o=n*Float32Array.BYTES_PER_ELEMENT;e.setFloat32(i+s.offset+o,t[n]*r,!0)}break;case bi.pe.HALF_FLOAT:if(1===s.count)e.setUint16(i+s.offset,(0,yi.fw)(t*r),!0);else for(let n=0;n<s.count;n++){const o=n*Uint16Array.BYTES_PER_ELEMENT;e.setUint16(i+s.offset+o,(0,yi.fw)(t[n]*r),!0)}}}(this._dataView,e,t,s)}}class vi{constructor(e,t,s,i){this._instanceId=e,this._evaluator=t,this._enabledOptionalAttributes=s,this._viewParams=i,this._evaluator.evaluator=e=>this.vertexSpec.createComputedParams(e)}get _vertexPack(){if(!this._cachedVertexPack){const e=wi.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=e}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(e){this._references=e}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){for(const{effect:e}of this.effectInfos||[])await Ve(e)}enqueueRequest(e,t,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,s)}write(e,t,s,i,r,n){this.ensurePacked(t,s,i);const o=this.evaluatedMeshParams.effects;if(!o||0===o.length)return void this._write(e,s,void 0,r,n);const a=this.getEffectCursor(e,s,o);if(!a)return;let h;for(;h=a.next();)h.invertY(),this._write(e,s,h,r,n)}ensurePacked(e,t,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(e,t,s);this._vertexPack.pack(i,this._viewParams)}hasArcadeDependency(e){return this._evaluator.hasArcadeDependency(e)}_writeVertex(e,t,s,i,r){const n=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,s,i,n,r)}getEffectCursor(e,t,s){const i=t.readGeometryForDisplay()?.clone();if(!i)return;const r=xe.z.fromOptimizedCIM(i,t.geometryType);r.invertY();const n=e.id||"";return gi.executeEffects(s,r,n,this._preventEffectClipping)}}class Si extends vi{}function Ii(e,t){let s;if("string"==typeof e)s=(0,me.Wm)(e+`-seed(${t})`);else{let i=12;s=e^t;do{s=107*(s>>8^s)+i|0}while(0!==--i)}return(1+s/(1<<31))/2}function Pi(e){return Math.floor(Ii(e,Mi)*ki)}const Mi=53290320,ki=10;class Ci{generateSource(e){const t=[];for(let s=1;s<this.length;s++)t.push(`vec4 atom${s} = texture(${e.animationTexture}, (pointer + 0.5) / size);`),t.push("pointer.x += 1.0;");for(let e=0;e<this.ins;e++)t.push("top--;"),t.push(`vec4 in${this.ins-e-1} = stack[top];`);for(let e=0;e<this.outs;e++)t.push(`vec4 out${e};`);const{microcode:s}=this;for(const e of s)t.push(e);for(let e=0;e<this.outs;e++)t.push(`stack[top] = out${e};`),t.push("top++;"),t.push(`if (top >= ${Li}) { top = ${Li-1}; }`);return t}}let Ai=128;function Ti(e){return[`float duration = clamp(${e.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${e.startTimeOffset};`,`float repeatDelay = ${e.repeatDelay};`,`float timeOriginSelector = ${e.timeOriginSelector};`,`float repeatType = ${e.repeatType};`,`float easing = ${e.easing};`,`float playAnimation = ${e.playAnimation} * (1.0 - step(0.0, -${e.duration}));`,`float reverseAnimation = ${e.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;",`${e.out} = oscillate ? 1.0 - of : of;`]}const Fi={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},zi={Loop:1,None:2,Oscillate:3},Ei={Local:1,Global:2};function Oi(e){const t=Fi[e.easing],s=zi[e.repeatType],i=Ei[e.timeOriginSelector];return[[e.duration,e.startTimeOffset,e.repeatDelay,i],[s,t,e.playAnimation,e.reverseAnimation]]}const Ri={scalar:new class extends Ci{constructor(){super(...arguments),this.opcode=++Ai,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(e){return[[this.opcode,e,0,0]]}},vector3:new class extends Ci{constructor(){super(...arguments),this.opcode=++Ai,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(e){return[[this.opcode,e[0]||0,e[1]||0,e[2]||0]]}},vector4:new class extends Ci{constructor(){super(...arguments),this.opcode=++Ai,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(e){return[[this.opcode,0,0,0],e]}},animatedTransform:new class extends Ci{constructor(){super(...arguments),this.opcode=++Ai,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;","{",...Ti({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;","{",...Ti({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;","{",...Ti({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(e){return[[this.opcode,0,0,0],[e.translation.from[0],e.translation.from[1],e.translation.to[0],e.translation.to[1]],[e.rotation.from,e.rotation.to,e.scale.from,e.scale.to],...Oi(e.translation.timing),...Oi(e.rotation.timing),...Oi(e.scale.timing),[e.relativeTranslation?1:0,e.absoluteScale?1:0,0,0]]}},animatedColor:new class extends Ci{constructor(){super(...arguments),this.opcode=++Ai,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;","{",...Ti({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;","{",...Ti({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(e){return[[this.opcode,e.opacity.from,e.opacity.to,0],[e.color.from[0],e.color.from[1],e.color.from[2],e.color.from[3]],[e.color.to[0],e.color.to[1],e.color.to[2],e.color.to[3]],...Oi(e.color.timing),...Oi(e.opacity.timing)]}},animatedShift:new class extends Ci{constructor(){super(...arguments),this.opcode=++Ai,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;","{",...Ti({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(e){return[[this.opcode,e.shift.from,e.shift.to,0],...Oi(e.shift.timing),[e.multiplyByLineLength?1:0,0,0,0]]}},ret:new class extends Ci{constructor(){super(...arguments),this.opcode=++Ai,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}},Li=4;function Di(e){return e instanceof qi?e:"object"==typeof e&&"type"in e?ji[e.type].hydrate(e):new Ni(e)}class qi{constructor(e){this.inputs=e}encode(){const e=[];for(const t of this.inputs)e.push(...t.encode());return e.push(...this.instructions),e}}class Ni extends qi{constructor(e){super([]),this.value=e}simplify(){return this}get instructions(){if(Array.isArray(this.value)){const[e,t,s,i]=this.value;return null!=i?Ri.vector4.encode([e,t||0,s||0,i]):Ri.vector3.encode([e,t||0,s||0])}return Ri.scalar.encode(this.value)}}class Gi extends qi{constructor(e,t){super([t]),this._config=e,this._parent=t}static hydrate(e){return new Gi(e,Di(e.parent))}simplify(){if(this._config.relativeTranslation||this._config.absoluteScale)return this;const e=this._parent.simplify();if(!(e instanceof Ni))return this;const[t,s,i,r]=e.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 e=i+a,c=r*h,l=Math.sin(i),u=Math.cos(i);return new Ni([u*r*n-l*r*o+t,l*r*n+u*r*o+s,e,c])}return new Gi(this._config,e)}get instructions(){return Ri.animatedTransform.encode(this._config)}}class Bi extends qi{constructor(e,t){super([t]),this._config=e,this._parent=t}static hydrate(e){return new Bi(e,Di(e.parent))}simplify(){const e=this._parent.simplify();if(!(e instanceof Ni))return this;const[t,s,i,r]=e.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 Ni([t*n,s*o,i*a,r*h])):new Bi(this._config,e)}get instructions(){return Ri.animatedColor.encode(this._config)}}class Wi extends qi{constructor(e,t){super([t]),this._config=e,this._parent=t}static hydrate(e){return new Wi(e,Di(e.parent))}simplify(){const e=this._parent.simplify();return e instanceof Ni?new Wi(this._config,e):this}get instructions(){return Ri.animatedShift.encode(this._config)}}const ji={AnimatedTransform:Gi,AnimatedColor:Bi,AnimatedShift:Wi};function Ui(e){return Yi(e.map(e=>Xi(e)).map(e=>Di(e).simplify()))}function Vi(e){const t=[];return t.push(e.transform),t.push(e.fromColor),t.push(e.toColor),t.push(e.colorMix),t.push(e.toOpacity),t.push(e.opacityMix),e?.shift?t.push(e?.shift):t.push([1,1,1,1]),t}function Yi(e){const t=[],s=[];let i=0;for(const r of e){const n=[...r.encode(),...Ri.ret.encode()];t.push([i+e.length,0,0,0]),s.push(...n),i+=n.length}return[...t,...s]}async function Hi(e,t){const s=e;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(e=>Hi(e,t)));else if("object"==typeof s)if("valueExpressionInfo"in s){const{valueExpressionInfo:e}=s,{expression:r}=e;i={...s,computed:await t.createComputedField({expression:r})}}else{i={};for(const e in s)i[e]=await Hi(s[e],t)}return i}function Xi(e,t,s){const i=e;let r;if("number"==typeof i||"string"==typeof i||"boolean"==typeof i)r=i;else if(Array.isArray(i))r=i.map(e=>Xi(e,t,s));else if("object"==typeof i)if("type"in i&&null!=i.type&&"Process"===i.type)switch(i.op){case"ArcadeColor":{const e=Xi(i.value,t,s);Zi(Array.isArray(e)&&4===e.length),r=[e[0]/255,e[1]/255,e[2]/255,e[3]]}break;case"Transparency":{const e=Xi(i.value,t,s);Zi("number"==typeof e),r=1-e/100}break;case"Divide":case"Multiply":case"Add":{const e=Xi(i.left,t,s);Zi("number"==typeof e);const n=Xi(i.right,t,s);switch(Zi("number"==typeof n),i.op){case"Divide":r=e/n;break;case"Multiply":r=e*n;break;case"Add":r=e+n}}break;case"Random":{const e=Xi(i.seed,t,s),n=Xi(i.min,t,s),o=Xi(i.max,t,s);r=n+Ii(Pi(t.getObjectId()||0),e)*(o-n)}break;case"Cond":{const e=Xi(i.condition,t,s),n=Xi(i.ifTrue,t,s),o=Xi(i.ifFalse,t,s);r=e?n:o}break;case"MatchWinding":{const e=Xi(i.sign,t,s);let n=Xi(i.angle,t,s);if(e>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(e){if(!("computed"in e))return e;let i=e.computed.readWithDefault(t,s,[255*e.defaultValue[0],255*e.defaultValue[1],255*e.defaultValue[2],e.defaultValue[3]]);if("string"==typeof i){const e=Ps.A.fromString(i);e&&(i=[e.r,e.g,e.b,e.a])}return i}(i);else{r={};for(const e in i)r[e]=Xi(i[e],t,s)}return r}function*$i(e){const t=e;if(Array.isArray(t))for(const e of t)yield*$i(e);else if("object"==typeof t)if("type"in t&&null!=t.type&&"Process"===t.type)switch(t.op){case"ArcadeColor":case"Transparency":yield*$i(t.value);break;case"Divide":case"Multiply":case"Add":yield*$i(t.left),yield*$i(t.right);break;case"Random":yield*$i(t.seed),yield*$i(t.min),yield*$i(t.max);break;case"Cond":yield*$i(t.condition),yield*$i(t.ifTrue),yield*$i(t.ifFalse);break;case"MatchWinding":yield*$i(t.sign),yield*$i(t.angle)}else if("computed"in t)yield t.computed;else for(const e in t)yield*$i(t[e])}function Zi(e){if(!e)throw new Error("Assertion failed.")}const Qi={type:bi.pe.SHORT,count:2,packPrecisionFactor:p.fq,pack:({scaleInfo:e},{tileInfo:t})=>Ms(e,t)},Ji={type:bi.pe.FLOAT,count:4,packPrecisionFactor:1,packTessellation:({value1Position2Value2:e})=>(Zi(e),e)},Ki={type:bi.pe.FLOAT,count:4,packPrecisionFactor:1,packTessellation:()=>[0,0,0,1]},er={type:bi.pe.FLOAT,count:1,packPrecisionFactor:1,pack:()=>0},tr={type:bi.pe.FLOAT,count:1,packPrecisionFactor:1,packTessellation:({lineLength:e})=>e},sr={type:bi.pe.UNSIGNED_SHORT,count:1,packTessellation:({distance:e})=>e},ir={type:bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:e,directionY:t})=>[e,t]},rr={type:bi.pe.FLOAT,count:2,packPrecisionFactor:16,packTessellation:({normalX:e,normalY:t})=>[e,t]},nr={type:bi.pe.UNSIGNED_BYTE,count:3,pack:"id"},or={type:bi.pe.UNSIGNED_BYTE,count:1,pack:function(e){const{sprite:t,isMapAligned:s,colorLocked:i,scaleSymbolsProportionally:r,isStroke:n}=e;let o=0;return s&&(o|=ks(Rs)),i&&(o|=ks(qs)),t.sdf&&(o|=ks(Os)),r&&(o|=ks(Ls)),n&&(o|=ks(Ns)),o}},ar={type:bi.pe.SHORT,count:2,pack:"position",packPrecisionFactor:1},hr={marker:{type:bi.pe.FLOAT,count:2,packAlternating:{count:4,pack:({texelDimensions:e})=>[[-.5*e[0],-.5*e[1]],[.5*e[0],-.5*e[1]],[-.5*e[0],.5*e[1]],[.5*e[0],.5*e[1]]]}},line:{type:bi.pe.FLOAT,count:2,packTessellation:({extrusionOffsetX:e,extrusionOffsetY:t},{baseSize:s})=>[e*s/2,t*s/2]},fill:{type:bi.pe.FLOAT,count:2,packTessellation:()=>[0,0]}},cr={marker:{type:bi.pe.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:e,texXmin:t,texYmax:s,texYmin:i})=>[[t,i],[e,i],[t,s],[e,s]]}}},lr={type:bi.pe.UNSIGNED_SHORT,count:4,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM,n=t.y+p.hM;return[r+1,n+1,r+s-1,n+i-1]}},ur={type:bi.pe.UNSIGNED_SHORT,count:4,packPrecisionFactor:4,pack:({animations:e,baseSize:t,referenceSize:s})=>[e.dataColumn,e.dataRow,t,s]},dr={type:bi.pe.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:e,pixelDimensions:t,baseSize:s,sprite:i,sizeRatio:r})=>{const n=Math.max(s*i.width/i.height,s),o=i.sdfDecodeCoeff*n*r;return[t[0],t[1],e,o]}},pr={type:bi.pe.BYTE,count:1,packTessellation:({angle:e})=>e*pi.aA},fr={type:bi.pe.BYTE,count:1,pack:({angle:e})=>e?e*pi.aA:0},_r={type:bi.pe.BYTE,count:1,pack:()=>0};function mr(e){let{pixelDimensions:t,texelDimensions:s,baseSize:i,referenceSize:r,strokeWidth:n,sizeRatio:o}=e;if(t||(t=e.sprite.sdf?[0,0]:[e.sprite.width,e.sprite.height]),s||(s=e.sprite.sdf?[0,0]:t),null!=e.patternHeight){const s=e.patternHeight/t[1];t[1]*=s,t[0]*=s}-1===i&&(i=t[1]),i=(0,l.Lz)(i),r=(0,l.Lz)(r),n=(0,l.Lz)(n);const a=(e.sprite.sdfDecodeCoeff??1)*o;return{...e,pixelDimensions:t,texelDimensions:s,baseSize:i,referenceSize:r,strokeWidth:n,sdfDecodeCoeff:a}}class gr extends Si{get vertexSpec(){return{createComputedParams:mr,optionalAttributes:{zoomRange:Qi,value1Position2Value2:Ji,lineLength:tr},attributes:{id:nr,bitset:or,pos:ar,offset:hr.marker,uv:cr.marker,animationPointerAndBaseSizeAndReferenceSize:ur,sizing:dr,angle:pr}}}_write(e,t,s){const i=this.evaluatedMeshParams.sprite,{textureBinding:r}=i;e.recordStart(this.instanceId,this.attributeLayout,r);const n=t.getDisplayId();if(this.shift&&"esriGeometryPolyline"===t.geometryType){if(!s){const s=xe.z.fromFeatureSetReaderCIM(t);s&&this._writeParticles(e,t,s)}}else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,t);else if("esriGeometryPolygon"===t.geometryType){const s=t.readCentroidForDisplay();if(!s)return;const[i,r]=s.coords;this._writeQuad(e,n,i,r)}else if("esriGeometryPoint"===t.geometryType){const s=t.readXForDisplay(),i=t.readYForDisplay();this._writeQuad(e,n,s,i)}else{const s=t.readGeometryForDisplay();s&&s.forEachVertex((t,s)=>{this._writeQuad(e,n,t,s)})}e.recordEnd()}_writePlacedMarkers(e,t){const s=xe.z.fromFeatureSetReaderCIM(t)?.clone();if(!s)return;const i=Is.getPlacement(s,-1,this.evaluatedMeshParams.placement,(0,l.Lz)(1),e.id);if(!i)return;const r=t.getDisplayId();let n=i.next(),o=null;for(;null!=n;){const t=n.tx,s=-n.ty;if(Math.abs(t)>we||Math.abs(s)>we){n=i.next();continue}const a=-n.getAngle();e.recordBounds(t,s,64,64),this.shift?o&&this._writeQuad(e,r,o[0],o[1],void 0,a):this._writeQuad(e,r,t,s,void 0,a),o=[t,s],n=i.next()}}_writeParticles(e,t,s){const i=t.getDisplayId();for(;s.nextPath();){const t=[];for(;s.nextPoint();)t.push([s.x,s.y]);const r=yr(t);let n=0;for(let e=1;e<t.length;e++){const s=t[e][0]-t[e-1][0],i=t[e][1]-t[e-1][1],r=Math.sqrt(s*s+i*i);n+=r}const o=t=>{for(const s of r){const{a:r,b:o}=s;this._writeQuad(e,i,r.position[0],r.position[1],[r.distance-t,o.position[0],o.position[1],o.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(r.direction[1],r.direction[0]):0,n,!0)}},{placement:a}=this.evaluatedMeshParams;if(!a||"placementTemplate"in a||"CIMMarkerPlacementOnVertices"===a.type){let e;if(a&&"CIMMarkerPlacementOnVertices"!==a.type)e=a.placementTemplate;else{e=[0];for(const t of r){const{a:s,b:i}=t,r=s.position[0]-i.position[0],n=s.position[1]-i.position[1],o=Math.sqrt(r*r+n*n);e.push(o)}}let t=-1*n;for(;t<2*n;)for(const s of e)t+=s,o(t)}else"CIMMarkerPlacementAtExtremities"===a.type?"JustBegin"===a.extremityPlacement?o(1):"JustEnd"===a.extremityPlacement?(o(n-1),o(-1)):"Both"===a.extremityPlacement&&(o(1),o(n-1)):"CIMMarkerPlacementOnLine"===a.type&&("LineBeginning"===a.relativeTo?o(1):"LineEnd"===a.relativeTo?(o(n-1),o(-1)):"LineMiddle"===a.relativeTo&&o(n/2))}}_writeQuad(e,t,s,i,r,n=0,o=0,a=!1){const h=this.evaluatedMeshParams.sprite,{rect:c}=h,l=c.x+p.hM,u=c.y+p.hM,d=c.x+c.width-p.hM,f=c.y+c.height-p.hM,_=e.vertexCount();a||e.recordBounds(s,i,64,64);const m={texXmin:l,texYmin:u,texXmax:d,texYmax:f,value1Position2Value2:r,angle:n/.024543692606171875,lineLength:o};for(let r=0;r<4;r++)this._writeVertex(e,t,s,i,m);e.indexEnsureSize(6),e.indexWrite(_),e.indexWrite(_+1),e.indexWrite(_+2),e.indexWrite(_+1),e.indexWrite(_+3),e.indexWrite(_+2)}}function yr(e){const t=[];let s=0;for(let i=1;i<e.length;i++){const r=e[i-1],n=e[i],o=n[0]-r[0],a=n[1]-r[1],h=Math.sqrt(o*o+a*a),c=o/h,l=a/h;t.push({a:{position:r,distance:s,direction:[c,l]},b:{position:n,distance:s+h,direction:[c,l]}}),s+=h}return t}class xr extends gr{constructor(){super(...arguments),this.shift=!1}}class br extends gr{constructor(){super(...arguments),this.shift=!0}}var wr=s(15585),vr=s(83773),Sr=s(92722);function Ir(e,t,s,i,r,n,o){Xr=0;const a=(i-s)*n,h=r&&r.length,c=h?(r[0]-s)*n:a;let l,u,d,p,f,_=Pr(t,s,0,0,c,n,!0);if(_&&_.next!==_.prev){if(h&&(_=function(e,t,s,i,r,n){const o=new Array;for(let r=0,a=i.length;r<a;r++){const h=Pr(e,t,0,i[r]*n,r<a-1?i[r+1]*n:s*n,n,!1);h===h.next&&(h.steiner=!0),o.push(zr(h))}o.sort(Br);for(const e of o)r=Er(e,r);return r}(t,s,i,r,_,n)),a>80*n){l=d=t[0+s*n],u=p=t[1+s*n];for(let e=n;e<c;e+=n){const i=t[e+s*n],r=t[e+1+s*n];l=Math.min(l,i),u=Math.min(u,r),d=Math.max(d,i),p=Math.max(p,r)}f=Math.max(d-l,p-u),f=0!==f?1/f:0}kr(_,e,n,l,u,f,o,0)}}function Pr(e,t,s,i,r,n,o){let a;if(o===function(e,t,s,i,r,n){let o=0;for(let s=i,a=r-n;s<r;s+=n)o+=(e[a+t*n]-e[s+t*n])*(e[s+1+t*n]+e[a+1+t*n]),a=s;return o}(e,t,0,i,r,n)>0)for(let s=i;s<r;s+=n)a=Tr(s+t*n,e[s+t*n],e[s+1+t*n],a);else for(let s=r-n;s>=i;s-=n)a=Tr(s+t*n,e[s+t*n],e[s+1+t*n],a);return a&&Gr(a,a.next)&&(Fr(a),a=a.next),a}function Mr(e,t=e){if(!e)return e;let s,i=e;do{if(s=!1,i.steiner||!Gr(i,i.next)&&0!==Rr(i.prev,i,i.next))i=i.next;else{if(Fr(i),i=t=i.prev,i===i.next)break;s=!0}}while(s||i!==t);return t}function kr(e,t,s,i,r,n,o,a){if(!e)return;!a&&n&&(e=Or(e,i,r,n));let h=e;for(;e.prev!==e.next;){const c=e.prev,l=e.next;if(n?Ar(e,i,r,n):Cr(e))t.push(c.index/s+o),t.push(e.index/s+o),t.push(l.index/s+o),Fr(e),e=l.next,h=l.next;else if((e=l)===h){a?1===a?kr(e=Wr(e,t,s,o),t,s,i,r,n,o,2):2===a&&jr(e,t,s,i,r,n,o):kr(Mr(e),t,s,i,r,n,o,1);break}}}function Cr(e){const t=e.prev,s=e,i=e.next;if(Rr(t,s,i)>=0)return!1;let r=e.next.next;const n=r;let o=0;for(;r!==e.prev&&(0===o||r!==n);){if(o++,Dr(t.x,t.y,s.x,s.y,i.x,i.y,r.x,r.y)&&Rr(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ar(e,t,s,i){const r=e.prev,n=e,o=e.next;if(Rr(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=Nr(a,h,t,s,i),d=Nr(c,l,t,s,i);let p=e.prevZ,f=e.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Dr(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&Rr(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Dr(r.x,r.y,n.x,n.y,o.x,o.y,f.x,f.y)&&Rr(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&Dr(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&Rr(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Dr(r.x,r.y,n.x,n.y,o.x,o.y,f.x,f.y)&&Rr(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Tr(e,t,s,i){const r=Yr.create(e,t,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 Fr(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function zr(e){let t=e,s=e;do{(t.x<s.x||t.x===s.x&&t.y<s.y)&&(s=t),t=t.next}while(t!==e);return s}function Er(e,t){const s=function(e,t){let s=t;const i=e.x,r=e.y;let n,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){const e=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(e<=i&&e>o){if(o=e,e===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!==t);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&&Dr(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)&&qr(s,e)&&(n=s,u=l)),s=s.next;return n}(e,t);if(!s)return t;const i=Vr(s,e);return Mr(i,i.next),Mr(s,s.next)}function Or(e,t,s,i){let r;for(;r!==e;r=r.next){if(r=r||e,null===r.z&&(r.z=Nr(r.x,r.y,t,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Or(e,t,s,i);r.prevZ=r.prev,r.nextZ=r.next}return e.prevZ.nextZ=null,e.prevZ=null,function(e){let t,s=1;for(;;){let i,r=e;e=null,t=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--),t?t.nextZ=s:e=s,s.prevZ=t,t=s}r=i}if(t.nextZ=null,s*=2,n<2)return e}}(e)}function Rr(e,t,s){return(t.y-e.y)*(s.x-t.x)-(t.x-e.x)*(s.y-t.y)}function Lr(e,t,s,i){return!!(Gr(e,t)&&Gr(s,i)||Gr(e,i)&&Gr(s,t))||Rr(e,t,s)>0!=Rr(e,t,i)>0&&Rr(s,i,e)>0!=Rr(s,i,t)>0}function Dr(e,t,s,i,r,n,o,a){return(r-o)*(t-a)-(e-o)*(n-a)>=0&&(e-o)*(i-a)-(s-o)*(t-a)>=0&&(s-o)*(n-a)-(r-o)*(i-a)>=0}function qr(e,t){return Rr(e.prev,e,e.next)<0?Rr(e,t,e.next)>=0&&Rr(e,e.prev,t)>=0:Rr(e,t,e.prev)<0||Rr(e,e.next,t)<0}function Nr(e,t,s,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Gr(e,t){return e.x===t.x&&e.y===t.y}function Br(e,t){return e.x-t.x}function Wr(e,t,s,i){let r=e;do{const n=r.prev,o=r.next.next;!Gr(n,o)&&Lr(n,r,r.next,o)&&qr(n,o)&&qr(o,n)&&(t.push(n.index/s+i),t.push(r.index/s+i),t.push(o.index/s+i),Fr(r),Fr(r.next),r=e=o),r=r.next}while(r!==e);return r}function jr(e,t,s,i,r,n,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.index!==e.index&&Ur(a,e)){let h=Vr(a,e);return a=Mr(a,a.next),h=Mr(h,h.next),kr(a,t,s,i,r,n,o,0),void kr(h,t,s,i,r,n,o,0)}e=e.next}a=a.next}while(a!==e)}function Ur(e,t){return e.next.index!==t.index&&e.prev.index!==t.index&&!function(e,t){let s=e;do{if(s.index!==e.index&&s.next.index!==e.index&&s.index!==t.index&&s.next.index!==t.index&&Lr(s,s.next,e,t))return!0;s=s.next}while(s!==e);return!1}(e,t)&&qr(e,t)&&qr(t,e)&&function(e,t){let s=e,i=!1;const r=(e.x+t.x)/2,n=(e.y+t.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!==e);return i}(e,t)}function Vr(e,t){const s=Yr.create(e.index,e.x,e.y),i=Yr.create(t.index,t.x,t.y),r=e.next,n=t.prev;return e.next=t,t.prev=e,s.next=r,r.prev=s,i.next=s,s.prev=i,n.next=i,i.prev=n,i}class Yr{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(e,t,s){const i=Xr<Hr.length?Hr[Xr++]:new Yr;return i.index=e,i.x=t,i.y=s,i.prev=null,i.next=null,i.z=null,i.prevZ=null,i.nextZ=null,i.steiner=!1,i}}const Hr=[];let Xr=0;for(let e=0;e<8096;e++)Hr.push(new Yr);const $r=new Oe.O3(0,0,0,1,0),Zr=new Oe.O3(0,0,0,1,0);function Qr(e,t,s){let i=0;for(let r=1;r<s;r++){const s=e[2*(t+r-1)],n=e[2*(t+r-1)+1];i+=(e[2*(t+r)]-s)*(e[2*(t+r)+1]+n)}return i}function Jr(e,t,s,i,r){let n=0;for(let o=s;o<i;o+=3){const s=2*(e[o]-r),i=2*(e[o+1]-r),a=2*(e[o+2]-r);n+=Math.abs((t[s]-t[a])*(t[i+1]-t[s+1])-(t[s]-t[i])*(t[a+1]-t[s+1]))}return n}function Kr(e,t){const{coords:s,lengths:i}=t,r=e;let n=0;for(let e=0;e<i.length;){let t=e,o=i[e],a=Qr(s,n,o);const h=[];for(;++t<i.length;){const e=i[t],r=Qr(s,n+o,e);if(!(r>0))break;a+=r,h.push(n+o),o+=e}const c=r.length;Ir(r,s,n,n+o,h,2,0);const l=Jr(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;e=t,n+=o}return!0}function en(e){const{coords:t,lengths:s}=e,{buffer:i}=(0,wr.QT)(t,s);return i}function tn(e,t){if(null==e)return null;if(!function(e,t,s){let i=0;for(let t=0;t<e.lengths.length;t++){const r=e.lengths[t];for(let t=0;t<r;t++){const r=e.coords[2*(t+i)],n=e.coords[2*(t+i)+1];if(r<-128||r>s||n<-128||n>s)return!0}i+=r}return!1}(e,0,p.CQ+128))return e;$r.setPixelMargin(t),$r.reset(3);const{stride:s,lengths:i,coords:r}=e;let n=0;for(const e of i){const t=n+e*s;for($r.moveTo(r[n],r[n+1]),n+=s;n<t;)$r.lineTo(r[n],r[n+1]),n+=s;$r.close()}const o=$r.result(!1);if(!o)return null;const a=new Sr.A;for(const e of o){for(const{x:t,y:s}of e)a.coords.push(t,s);a.lengths.push(e.length)}return a}function sn(e,t){Zr.setPixelMargin(t);const s=Zr,i=-t,r=p.CQ+t;let n=[],o=!1;if(!e.nextPath())return null;let a=e.pathLength(),h=!0;for(;h;){e.seekPathStart();const t=[];if(!e.pathSize)return null;s.reset(2),e.nextPoint();let c=e.x,l=e.y;if(o)s.moveTo(c,l);else{if(c<i||c>r||l<i||l>r){o=!0;continue}t.push({x:c,y:l})}let u=!1;for(;e.nextPoint();)if(c=e.x,l=e.y,o)s.lineTo(c,l);else{if(c<i||c>r||l<i||l>r){u=!0;break}t.push({x:c,y:l})}if(u)o=!0;else{if(o){const e=s.resultWithStarts();if(e)for(const t of e)n.push({...t,pathLength:a})}else n.push({line:t,start:0,pathLength:a});h=e.nextPath(),a=h?e.pathLength():0,o=!1}}return n=n.filter(e=>e.line.length>1),0===n.length?null:n}$r.setExtent(p.CQ),Zr.setExtent(p.CQ);var rn=s(23304);class nn{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 on={createComputedParams:e=>e,optionalAttributes:{zoomRange:{type:bi.pe.SHORT,count:2,packPrecisionFactor:p.fq,pack:({scaleInfo:e},{tileInfo:t})=>Ms(e,t)}},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:e})=>As(e)},offset:{type:bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:e,extrusionOffsetY:t})=>[Es(e,16),Es(t,16)]},normal:{type:bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:e,normalY:t})=>[Es(e,16),Es(t,16)]},halfWidth:{type:bi.pe.HALF_FLOAT,count:1,pack:({width:e})=>(0,l.Lz)(.5*e)},referenceHalfWidth:{type:bi.pe.HALF_FLOAT,count:1,pack:({referenceWidth:e})=>(0,l.Lz)(.5*e)}}};class an{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 hn=65535;class cn extends vi{constructor(e,t,s,i){super(e,t,s,i),this.vertexSpec=on,this._currentWrite=new an,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:hn,textured:!1},this._tessParams=new nn,this._initializeTessellator()}writeLineVertices(e,t,s){const i=this._getLines(t);null!=i&&this._writeVertices(e,s,i)}_initializeTessellator(){this._lineTessellator=new vr.i(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(e,t,s){const i=s??xe.z.fromFeatureSetReaderCIM(t);i&&this._writeGeometry(e,t,i)}_writeGeometry(e,t,s,i){e.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(e,s,t),e.recordEnd()}_getLines(e){return sn(e,(0,rn.Z0)(this.evaluatedMeshParams))}_writeVertices(e,t,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=Ts(a),r.joinType=Fs(h),r.miterLimit=c;const f=!u;i.out=e,i.id=t.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=e.vertexCount(),i.vertexBounds=f&&d<p.Gh?0:1;for(const{line:e,start:t,pathLength:n}of s)r.initialDistance=t%hn,i.pathLength=n,i.distanceOffset=Math.floor(t/hn)*hn,this._lineTessellator.tessellate(e,r,f)}_writeTesselatedVertex(e,t,s,i,r,n,o,a,h,c,l){const{out:u,id:d,vertexBounds:p,pathLength:f,distanceOffset:_}=this._currentWrite;return this.hasEffects&&u.recordBounds(e,t,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.distanceOffset=_,this._writeVertex(u,d,e,t,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(e,t,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(e),i.indexWrite(t),i.indexWrite(s),this._currentWrite.indexCount+=3}}class ln extends Si{_write(e,t,s){const i=s??xe.z.fromFeatureSetReaderCIM(t);if(!i)return;const r=this.evaluatedMeshParams.sprite,{textureBinding:n}=r;e.recordStart(this.instanceId,this.attributeLayout,n);const o=t.getDisplayId();this._writePoly(e,o,i.asOptimized()),e.recordEnd()}}class un extends ln{constructor(){super(...arguments),this.vertexSpec={createComputedParams:mr,attributes:{id:nr,bitset:or,pos:ar,offset:hr.fill,tlbr:lr,animationPointerAndBaseSizeAndReferenceSize:ur,sizing:dr},optionalAttributes:{zoomRange:Qi,value1Position2Value2:Ki,lineLength:er,angle:fr}}}_writePoly(e,t,s){const i=this._clip(s);if(!i)return;s=i;const r=[],n=e.vertexCount();let o;if(Kr(r,s)){if(0===r.length)return;o=0;for(const i of r){const r=s.coords[2*i],n=s.coords[2*i+1];this._writeVertex(e,t,r,n),o++}}else{const{coords:i,lengths:r}=s,n=(0,wr.QT)(i,r);o=n.vertexCount;for(let s=0;s<n.buffer.length/2;s++){const i=n.buffer[2*s],r=n.buffer[2*s+1];this._writeVertex(e,t,i,r)}}if(o>0){e.indexEnsureSize(o);for(let t=0;t<o;t++)e.indexWrite(t+n)}}_clip(e){return tn(e,this.hasEffects?256:8)}}class dn{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0,this.pathLength=0}}class pn extends ln{constructor(){super(...arguments),this.vertexSpec={createComputedParams:mr,attributes:{id:nr,bitset:or,pos:ar,offset:hr.line,tlbr:lr,animationPointerAndBaseSizeAndReferenceSize:ur,sizing:dr,accumulatedDistance:sr,normal:rr,segmentDirection:ir},optionalAttributes:{zoomRange:Qi,value1Position2Value2:Ki,lineLength:tr,angle:_r}},this._tessParams=new nn,this._currentWrite=new dn,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:65535,textured:!1},this._lineLength=0,this._lineTessellator=new vr.i((e,t,s,i,r,n,o,a,h,c,l)=>this._writeTesselatedVertex(e,t,s,i,r,n,o,a,h,c,l,this._lineLength),this._writeTriangle.bind(this),!1)}_writePoly(e,t,s){const i=sn(xe.z.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=Ts(a||"Round"),n.joinType=Fs(h||"Round"),n.miterLimit=c||2,r.out=e,r.id=t,r.vertexCount=0,r.indexCount=0,r.vertexFrom=e.vertexCount(),r.vertexBounds=1;for(const{line:e,start:t,pathLength:s}of i){n.initialDistance=t%65535,r.pathLength=s,this._lineLength=0;for(let t=1;t<e.length;t++){const s=e[t].x-e[t-1].x,i=e[t].y-e[t-1].y;this._lineLength+=Math.sqrt(s*s+i*i)}this._lineTessellator.tessellate(e,n,!1)}}_writeTesselatedVertex(e,t,s,i,r,n,o,a,h,c,l,u){const{out:d,id:p,vertexBounds:f,pathLength:_}=this._currentWrite;return this.hasEffects&&d.recordBounds(e,t,f,f),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=_,this._tessParams.lineLength=u,this._writeVertex(d,p,e,t,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(e,t,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(e),i.indexWrite(t),i.indexWrite(s),this._currentWrite.indexCount+=3}}class fn extends vi{async loadDependencies(){await Promise.all([super.loadDependencies(),(0,wr.If)()])}_write(e,t,s){const i=s?.asOptimized()??t.readGeometryForDisplay(),r=this._clip(i);r&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,t,r),e.recordEnd())}_clip(e){return e?tn(e,this.hasEffects?256:8):null}_writeGeometry(e,t,s){const i=function(e){const t=[];return e.maxLength>100||!Kr(t,e)?{indices:null,vertices:en(e)}:t.length?{indices:t,vertices:e.coords}:null}(s=s.justXY());if(!i||!i.vertices.length)return;const r=this.createTesselationParams(t);this._writeVertices(e,t,i,r)}_writeVertices(e,t,s,i){const r=t.getDisplayId(),n=e.vertexCount(),o=this.hasEffects,{vertices:a,indices:h}=s;let c=0;if(h)for(const t of h){const s=a[2*t],n=a[2*t+1];o&&e.recordBounds(s,n,0,0),this._writeVertex(e,r,s,n,i),c++}else for(let t=0;t<a.length;t+=2){const s=Math.round(a[t]),n=Math.round(a[t+1]);o&&e.recordBounds(s,n,0,0),this._writeVertex(e,r,s,n,i),c++}e.indexEnsureSize(c);for(let t=0;t<c;t++)e.indexWrite(t+n)}}const _n={createComputedParams:e=>e,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:e})=>e}}};class mn extends fn{constructor(){super(...arguments),this.vertexSpec=_n}createTesselationParams(e){return{inverseArea:1/e.readGeometryArea()}}}const gn={createComputedParams:e=>e,optionalAttributes:{zoomRange:{type:bi.pe.SHORT,count:2,packPrecisionFactor:p.fq,pack:({scaleInfo:e},{tileInfo:t})=>Ms(e,t)}},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:e})=>As(e)}}};class yn extends fn{constructor(){super(...arguments),this.vertexSpec=gn}createTesselationParams(e){return null}}const xn={createComputedParams:e=>e,optionalAttributes:gn.optionalAttributes,attributes:{...gn.attributes,tlbr:{count:4,type:bi.pe.UNSIGNED_SHORT,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM,n=t.y+p.hM;return[r,n,r+s,n+i]}},inverseRasterizationScale:{count:1,type:bi.pe.BYTE,packPrecisionFactor:16,pack:({sprite:e})=>1/e.rasterizationScale}}};class bn extends yn{constructor(){super(...arguments),this.vertexSpec=xn}_write(e,t,s){const i=s?.asOptimized()??t.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,t,r),e.recordEnd()}}function wn(e){const{sprite:t,aspectRatio:s,scaleProportionally:i}=e,r=(0,l.Lz)(e.height),n=r>0?r:t.height;let o=r*s;return o<=0?o=t.width:i&&(o*=t.width/t.height),{width:o,height:n}}function vn(e){const{applyRandomOffset:t,sampleAlphaOnly:s}=e;return Cs([[2,t],[4,s]])}const Sn={createComputedParams:e=>e,optionalAttributes:xn.optionalAttributes,attributes:{...xn.attributes,bitset:{count:1,type:bi.pe.UNSIGNED_BYTE,pack:vn},width:{count:1,type:bi.pe.HALF_FLOAT,pack:e=>wn(e).width},height:{count:1,type:bi.pe.HALF_FLOAT,pack:e=>wn(e).height},offset:{count:2,type:bi.pe.HALF_FLOAT,pack:({offsetX:e,offsetY:t})=>[(0,l.Lz)(e),-(0,l.Lz)(t)]},scale:{count:2,type:bi.pe.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:e,scaleY:t})=>[e,t]},angle:{count:1,type:bi.pe.UNSIGNED_BYTE,pack:({angle:e})=>(0,pi.wV)(e)}}};class In extends bn{constructor(){super(...arguments),this.vertexSpec=Sn}}const Pn={createComputedParams:e=>e,optionalAttributes:on.optionalAttributes,attributes:{...on.attributes,bitset:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:e=>0},color:{type:bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>As(e)}}},Mn={createComputedParams:e=>e,optionalAttributes:on.optionalAttributes,attributes:{...on.attributes,bitset:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:e=>Cs([[0,!0],[1,e.outlineUsesColorVV]])},color:{type:bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>As(e)}}};class kn extends cn{constructor(){super(...arguments),this.vertexSpec=Mn}}class Cn extends yn{constructor(e,t,s,i){super(e,t,s,i),this.vertexSpec=Pn,this._lineMeshWriter=this._createOutlineWriter(e,t,s,i)}_createOutlineWriter(e,t,s,i){return new kn(e,t,s,i)}_write(e,t){const s=this.evaluatedMeshParams.effects,i=this.evaluatedMeshParams.outlineEffects;if(s?.length||i?.length){if(s?.length){const i=this.getEffectCursor(e,t,s);if(i){let s;for(;s=i?.next();)s.invertY(),this._writeFill(e,t,s)}}else this._writeFill(e,t);if(i?.length){const s=this.getEffectCursor(e,t,i);if(s){let i;for(;i=s?.next();)i.invertY(),this._writeOutline(e,t,i)}}else this._writeOutline(e,t)}else this._writeSimpleOutlineFill(e,t)}_writeSimpleOutlineFill(e,t){const s=t.readGeometryForDisplay(),i=this._clip(s);i&&(this._writeGeometry(e,t,i),this._lineMeshWriter.writeLineVertices(e,xe.z.fromOptimizedCIM(i,"esriGeometryPolyline"),t))}_writeFill(e,t,s){const i=s?.asOptimized()??t.readGeometryForDisplay(),r=this._clip(i);r&&this._writeGeometry(e,t,r)}_writeOutline(e,t,s){const i=s?.asOptimized()??t.readGeometryForDisplay(),r=this._clip(i);r&&this._lineMeshWriter.writeLineVertices(e,xe.z.fromOptimizedCIM(r,"esriGeometryPolyline"),t)}_clip(e){return e?tn(e,(0,rn.Z0)(this.evaluatedMeshParams)):null}get effectInfos(){return[...this._evaluator.inputMeshParams.effects?.effectInfos??[],...this._evaluator.inputMeshParams.outlineEffects?.effectInfos??[]]}write(e,t,s,i,r){this.ensurePacked(t,s,i),e.recordStart(this.instanceId,this.attributeLayout),this._write(e,s),e.recordEnd()}ensurePacked(e,t,s){super.ensurePacked(e,t,s),this._lineMeshWriter.ensurePacked(e,t,s)}enqueueRequest(e,t,s){super.enqueueRequest(e,t,s),this._lineMeshWriter.enqueueRequest(e,t,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}get hasEffects(){return!!this.evaluatedMeshParams.outlineEffects}}const An=Sn,Tn=Mn,Fn={createComputedParams:e=>e,optionalAttributes:An.optionalAttributes,attributes:{...An.attributes,bitset:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:e=>vn(e)},aux1:{count:1,type:bi.pe.HALF_FLOAT,pack:e=>wn(e).width},aux2:{count:1,type:bi.pe.HALF_FLOAT,pack:e=>wn(e).height},aux3:{count:2,type:bi.pe.HALF_FLOAT,pack:({offsetX:e,offsetY:t})=>[(0,l.Lz)(e),(0,l.Lz)(t)]},aux4:{count:2,type:bi.pe.UNSIGNED_BYTE,pack:({scaleX:e,scaleY:t})=>[16*e,16*t]}}},zn={createComputedParams:e=>e,optionalAttributes:An.optionalAttributes,attributes:{...An.attributes,color:Tn.attributes.color,bitset:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:e=>Cs([[0,!0]])},aux1:{count:1,type:bi.pe.HALF_FLOAT,pack:e=>(0,l.Lz)(.5*e.width)},aux2:{count:1,type:bi.pe.HALF_FLOAT,pack:e=>(0,l.Lz)(.5*e.referenceWidth)},aux3:{count:2,type:bi.pe.HALF_FLOAT,packTessellation:({extrusionOffsetX:e,extrusionOffsetY:t})=>[e,t]},aux4:{count:2,type:bi.pe.UNSIGNED_BYTE,packTessellation:({normalX:e,normalY:t})=>[16*e+128,16*t+128]}}};class En extends kn{constructor(){super(...arguments),this.vertexSpec=zn}}class On extends Cn{constructor(){super(...arguments),this.vertexSpec=Fn}_createOutlineWriter(e,t,s,i){return new En(e,t,s,i)}write(e,t,s,i,r){this.ensurePacked(t,s,i);const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._write(e,s),e.recordEnd()}ensurePacked(e,t,s){super.ensurePacked(e,t,s),this._lineMeshWriter.ensurePacked(e,t,s)}enqueueRequest(e,t,s){super.enqueueRequest(e,t,s),this._lineMeshWriter.enqueueRequest(e,t,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}var Rn=s(13337);class Ln{constructor(e,t){this._size=e,this._sizeUnits=t,this._relativeSize=null}get relativeSize(){return this._relativeSize??=this.calculateRelativeSize(),this._relativeSize}calculateRelativeSize(){if(this._sizeUnits===Rn.h.Relative){const e=Math.min(this._size/100,1);return[e,e]}return this.calculateRelativeSizeFromAbsolute()}}class Dn extends Ln{constructor(e,t,s,i){super(t,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;e.forEachVertex((e,t)=>{const s=e*n+t*o,i=e*a+t*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 qn extends Dn{constructor(e,t,s,i){super(e,t,s,i),this.method="linear"}getRelativePosition(e,t){const{rotationMatrix00:s,rotationMatrix01:i,bounds:r}=this,{xmin:n,xmax:o}=r;return[(e*s+t*i-n)/(o-n),0]}calculateRelativeSizeFromAbsolute(){const{_size:e,bounds:t}=this,{xmin:s,xmax:i}=t;return[(0,l.Lz)(e)/(i-s),0]}}class Nn extends Dn{constructor(e,t,s,i){super(e,t,s,i),this.method="rectangular"}getRelativePosition(e,t){const{bounds:s,center:i,rotationMatrix00:r,rotationMatrix01:n,rotationMatrix10:o,rotationMatrix11:a}=this,h=e*o+t*a,c=e*r+t*n-i[0],l=h-i[1];return[c*(2/(s.xmax-s.xmin)),-l*(2/(s.ymax-s.ymin))]}calculateRelativeSizeFromAbsolute(){const{_size:e,bounds:t}=this,{xmin:s,ymin:i,xmax:r,ymax:n}=t;return[(0,l.Lz)(2*e)/(r-s),(0,l.Lz)(2*e)/(n-i)]}}class Gn extends Dn{constructor(e,t,s){super(e,t,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(e,t){const{center:s,radius:i}=this;return[(e-s[0])/i,-(t-s[1])/i]}calculateRelativeSizeFromAbsolute(){const{_size:e}=this;return[(0,l.Lz)(e)/this.radius,0]}}function Bn(e,t){if(null==e)return null;const s=(0,Bs.kU)(t.angle),i=t.gradientSize,r=t.gradientSizeUnits;switch(t.gradientMethod.toLowerCase()){case"linear":return new qn(e,i,r,s);case"rectangular":return new Nn(e,i,r,s);case"circular":return new Gn(e,i,r);default:return Lt.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.fill.GradientSizeHelper").errorOnce(`Gradient fill method "${t.gradientMethod}" currently unsupported.`),null}}const Wn={createComputedParams:e=>e,optionalAttributes:gn.optionalAttributes,attributes:{...gn.attributes,bitset:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:({gradientSizeUnits:e,gradientType:t})=>{let s=0;return e===Rn.h.Absolute&&(s|=ks(0)),"discrete"===t.toLowerCase()&&(s|=ks(1)),s}},tlbr:{count:4,type:bi.pe.UNSIGNED_SHORT,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM+p.MZ,n=t.y+p.hM;return[r,n,r+s-2*p.MZ,n+i]}},relativePosition:{count:2,type:bi.pe.HALF_FLOAT,packTessellation:({gradientStats:e},t,s,i)=>e?.getRelativePosition(s,i)??[0,0]},relativeGradientSize:{count:2,type:bi.pe.HALF_FLOAT,packTessellation:({gradientStats:e})=>e?.relativeSize??[1,1]},gradientMethod:{count:1,type:bi.pe.UNSIGNED_BYTE,pack:({gradientMethod:e})=>{switch(e.toLowerCase()){case"rectangular":return 1;case"circular":return 2;default:return 0}}}}};class jn extends fn{constructor(){super(...arguments),this.vertexSpec=Wn}get _preventEffectClipping(){return!0}createTesselationParams(e){return{gradientStats:Bn(this._unclippedGeometry,this.evaluatedMeshParams)}}_write(e,t,s){const i=s?.asOptimized()??t.readGeometryForDisplay();this._unclippedGeometry=i;const r=this._clip(i);if(!r)return void(this._unclippedGeometry=null);const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,t,r),this._unclippedGeometry=null,e.recordEnd()}}const Un={optionalAttributes:xn.optionalAttributes,createComputedParams:e=>e,attributes:{...xn.attributes,...Pn.attributes}},Vn={optionalAttributes:xn.optionalAttributes,createComputedParams:e=>e,attributes:{...xn.attributes,...Mn.attributes}};class Yn extends kn{constructor(){super(...arguments),this.vertexSpec=Vn}}class Hn extends Cn{constructor(){super(...arguments),this.vertexSpec=Un}_createOutlineWriter(e,t,s,i){return new Yn(e,t,s,i)}write(e,t,s,i,r){this.ensurePacked(t,s,i);const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._write(e,s),e.recordEnd()}ensurePacked(e,t,s){super.ensurePacked(e,t,s),this._lineMeshWriter.ensurePacked(e,t,s)}enqueueRequest(e,t,s){super.enqueueRequest(e,t,s),this._lineMeshWriter.enqueueRequest(e,t,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const Xn={createComputedParams:e=>e,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 $n extends vi{constructor(){super(...arguments),this.vertexSpec=Xn}_write(e,t){e.recordStart(this.instanceId,this.attributeLayout);const s=t.getDisplayId();if("esriGeometryPoint"===t.geometryType){const i=t.readXForDisplay(),r=t.readYForDisplay();this._writeQuad(e,s,i,r)}else if("esriGeometryMultipoint"===t.geometryType){const i=t.readGeometryForDisplay();i?.forEachVertex((t,i)=>{t>=0&&t<=512&&i>=0&&i<=512&&this._writeQuad(e,s,t,i)})}e.recordEnd()}_writeQuad(e,t,s,i){const r=e.vertexCount();this._writeVertex(e,t,s,i),e.indexWrite(r+0),e.indexWrite(r+1),e.indexWrite(r+2),e.indexWrite(r+1),e.indexWrite(r+3),e.indexWrite(r+2)}}var Zn=s(48163),Qn=s(87992),Jn=s(90708);class Kn{constructor(e,t,s,i,r,n,o,a,h,c,l,u=[],d=0,p=0){this.displayId=e,this.labelClassId=t,this.labelIdHash=s,this.hash=i,this.anchorX=r,this.anchorY=n,this.directionX=o,this.directionY=a,this.maxScale=h,this.minScale=c,this.referenceBounds=l,this.bounds=u,this.recordStart=d,this.recordCount=p,this.priority=0,this._colliders=null,this.uniqueSymbol=null,this.selectedForRendering=!1}get xTile(){return this.anchorX}get yTile(){return this.anchorY}colliders(e){if(!this._colliders){const t=e.attributeView,s=p.C2;let i=this.referenceBounds?.size??0;const r=e.labelingCollisionInfos[0].vvEvaluators[0];if(null!=r){const e=r(t.getVisualVariableData(this.displayId,0));i=isNaN(e)||null==e||e===1/0?i:e}const n=this.minScale?e.tilingScheme.scaleToZoom(this.minScale):0,o=this.maxScale?e.tilingScheme.scaleToZoom(this.maxScale):25,a=this.directionX*(s+i/2),h=this.directionY*(s+i/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+a,dyPixels:e.y-e.halfHeight+h,hard:!0,partIndex:1,width:e.width+2,height:e.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(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),X(e,this.bounds)}static deserialize(e){const t=e.readInt32(),s=e.readInt32(),i=e.readInt32(),r=e.readInt32(),n=e.readInt32(),o=e.readInt32(),a=e.readF32(),h=e.readF32(),c=e.readF32(),l=e.readF32(),u=e.readF32(),d=e.readF32(),p=e.readF32(),f=e.readF32(),_=e.readF32(),m=$(e,ii)??[];return new Kn(t,s,i,r,a,h,c,l,u,d,{size:p,offsetX:f,offsetY:_},m,n,o)}}function eo(e,t,s){return e[0]=t[0]-s[0],e[1]=t[1]-s[1],e}function to(e,t){return Math.sqrt(e*e+t*t)}function so(e){const t=to(e[0],e[1]);e[0]/=t,e[1]/=t}function io(e,t){return to(e[0]-t[0],e[1]-t[1])}function ro(e){return e.length-1}function no(e,t,s=1){let[i,r]=function(e,t){return e[t+1]}(e,t);return[i,r]=[Math.round(i),Math.round(r)],Math.sqrt(i*i+r*r)*s}class oo{constructor(e,t,s,i,r){this._segments=e,this._index=t,this._distance=s,this._xStart=i,this._yStart=r,this._done=!1}static create(e){return new oo(e,0,0,e[0][0],e[0][1])}clone(){return new oo(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(0===this._distance||1===e._distance)||e._index===this._index+1&&(1===this._distance||0===e._distance)}leq(e){return this._index<e._index||this._index===e._index&&this._distance<=e._distance}geq(e){return this._index>e._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let s=Math.acos(t);return e>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:e,dy:t}=this;return Math.sqrt(e*e+t*t)}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<ro(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(e,t){const s=this.backwardLength;if(e<=s)return this._distance=(s-e)/this.length,this;let i=this.backwardLength;for(;this.prev();){if(i+this.length>e)return this._seekBackwards(e-i);i+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let s=this.remainingLength;for(;this.next();){if(s+this.length>e)return this.seek(e-s,t);s+=this.length}return this._distance=1,t?this:null}}function ao(e,t,s,i=!0){const r=function(e){let t=0;for(let s=0;s<ro(e);s++)t+=no(e,s);return t}(e),n=oo.create(e),o=r/2;if(!i)return n.seek(o),void(n.x<p.CQ&&n.y<p.CQ&&n.x>=0&&n.y>=0&&s(n.clone(),0,o+0*t,r));const a=Math.max((r-t)/2,0),h=Math.floor(a/t),c=o-h*t;n.seek(c);for(let e=-h;e<=h;e++)n.x<p.CQ&&n.y<p.CQ&&n.x>=0&&n.y>=0&&s(n.clone(),e,o+e*t,r),n.seek(t)}function ho(e,t){const s=t;for(let t=0;t<e.length;t++){let i=e[t];co(i,s);const r=[];r.push(i[0]);for(let e=1;e<i.length;e++){const[t,s]=i[e-1],[n,o]=i[e],a=n-t,h=o-s;r.push([a,h])}e[t]=r,i=r}return e}function co(e,t){const s=1e-6;if(t<=0)return;const i=e.length;if(i<3)return;const r=[];let n=0;r.push(0);for(let t=1;t<i;t++)n+=io(e[t],e[t-1]),r.push(n);t=Math.min(t,.2*n);const o=[];o.push(e[0][0]),o.push(e[0][1]);const a=e[i-1][0],h=e[i-1][1],c=eo([0,0],e[0],e[1]);so(c),e[0][0]+=t*c[0],e[0][1]+=t*c[1],eo(c,e[i-1],e[i-2]),so(c),e[i-1][0]+=t*c[0],e[i-1][1]+=t*c[1];for(let e=1;e<i;e++)r[e]+=t;r[i-1]+=t;const l=.5*t;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 p=d*d,f=d*o-.5*p*u,_=d*u/t,m=e[i+1],g=e[i][0]-m[0],y=e[i][1]-m[1];a+=_/f*(m[0]*d*o+.5*p*(o*g-u*m[0])-p*d*u*g/3),h+=_/f*(m[1]*d*o+.5*p*(o*y-u*m[1])-p*d*u*y/3),c+=_}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 p=d*d,f=d*i-.5*p*u,_=d*u/t,m=e[o-1],g=e[o][0]-m[0],y=e[o][1]-m[1];a+=_/f*(m[0]*d*i+.5*p*(i*g-u*m[0])-p*d*u*g/3),h+=_/f*(m[1]*d*i+.5*p*(i*y-u*m[1])-p*d*u*y/3),c+=_}o.push(a/c),o.push(h/c)}o.push(a),o.push(h);for(let t=0,s=0;t<i;t++)e[t][0]=o[s++],e[t][1]=o[s++]}class lo{constructor(e){const{offsetX:t,offsetY:s,postAngle:i,fontSize:r,haloSize:n,outlineSize:o,scaleFactor:a,transforms:h}=e;if(this.offsetX=t,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 e=(0,Re.zb)(r,i,!1,t,s,h,!1);this.fontSize=Math.min(e.size,96);const n=e.size/r;this.haloSize*=n,this.outlineSize*=n,this.postAngle=e.rotation,this.offsetX=e.offsetX,this.offsetY=e.offsetY}a&&(this.fontSize*=a,this.offsetX*=a,this.offsetY*=a)}}const uo=28,po=[4,4],fo=[16,4],_o={topLeft:fo,topRight:fo,bottomLeft:fo,bottomRight:fo},mo=[4,2],go=[4,6],yo={topLeft:mo,topRight:mo,bottomLeft:go,bottomRight:go},xo={topLeft:mo,topRight:go,bottomLeft:mo,bottomRight:go},bo={topLeft:go,topRight:go,bottomLeft:po,bottomRight:po},wo={topLeft:po,topRight:po,bottomLeft:go,bottomRight:go},vo={topLeft:go,topRight:po,bottomLeft:go,bottomRight:po},So={topLeft:po,topRight:go,bottomLeft:po,bottomRight:go},Io={createComputedParams:e=>e,optionalAttributes:{zoomRange:{type:bi.pe.UNSIGNED_SHORT,count:2,packPrecisionFactor:p.fq,packTessellation:({minZoom:e,maxZoom:t})=>[e||0,t||uo]},clipAngle:{type:bi.pe.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:e})=>Mo(e||0)},referenceSymbol:{type:bi.pe.BYTE,count:4,packTessellation:(e,t)=>{const s=e.isLineLabel||!e.referenceBounds,i=function(e){switch(e){case 1:case"right":return-1;case 0:case"center":return 0;case-1:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${e}`),0}}(s?"center":t.horizontalAlignment),r=function(e){switch(e){case 1:case"top":return 1;case 0:case"middle":return 0;case-1:case 2:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${e}`),0}}(s?"middle":t.verticalAlignment),{offsetX:n,offsetY:o,size:a}=s?{offsetX:0,offsetY:0,size:0}:e.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:e,mapAligned:t})=>Cs([[0,e],[3,!!t]])},offset:{type:bi.pe.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:e})=>{const{bottomLeft:t,bottomRight:s,topLeft:i,topRight:r}=e;return[i,r,t,s]}}},textureUV:{type:bi.pe.UNSIGNED_SHORT,count:2,packAlternating:{count:4,packTessellation:({texcoords:e})=>{const{bottomLeft:t,bottomRight:s,topLeft:i,topRight:r}=e;return[i,r,t,s]}}},color:{type:bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:e})=>e},fontAndReferenceSize:{type:bi.pe.UNSIGNED_SHORT,count:4,packPrecisionFactor:4,packTessellation:({fontSize:e,sdfSize:t,sdfRadius:s},{referenceSize:i})=>[Math.round((0,l.Lz)(e)),Math.round((0,l.Lz)(i??e)),t,s]},outlineColor:{type:bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>As(e)},haloColor:{type:bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:e})=>As(e)},outlineAndHaloSize:{type:bi.pe.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:e,haloSize:t})=>[Math.round((0,l.Lz)(e)),Math.round((0,l.Lz)(t))]}}};class Po extends vi{constructor(){super(...arguments),this.vertexSpec=Io,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,t,s){super.ensurePacked(e,t,s),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new lo(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,t,s){const i=this._getShaping();if(!i)return;const r=1===this.evaluatedMeshParams.alignment,n=t.getDisplayId();if(null!=this.evaluatedMeshParams.placement)return this._writePlacedTextMarkers(e,t,i,s);if(s?.nextPath())return s.nextPoint(),this._writeGlyphs(e,n,s.x,s.y,i,0,void 0,{mapAligned:r});if("esriGeometryPolygon"===t.geometryType){const s=t.readCentroidForDisplay();if(!s)return;const[o,a]=s.coords;return this._writeGlyphs(e,n,o,a,i,0,void 0,{mapAligned:r})}if("esriGeometryMultipoint"===t.geometryType){const s=t.readGeometryForDisplay();return void s?.forEachVertex((t,s)=>this._writeGlyphs(e,n,t,s,i,0,void 0,{mapAligned:r}))}const o=t.readXForDisplay(),a=t.readYForDisplay();return this._writeGlyphs(e,n,o,a,i,0,void 0,{mapAligned:r})}_writePlacedTextMarkers(e,t,s,i){const r=i??xe.z.fromFeatureSetReaderCIM(t);if(!r)return;const n=Is.getPlacement(r,-1,this.evaluatedMeshParams.placement,(0,l.Lz)(1),e.id);if(!n)return;const o=t.getDisplayId();let a=n.next();for(;null!=a;){const t=a.tx,i=-a.ty,r=-a.getAngle();this._writeGlyphs(e,o,t,i,s,r,void 0,{mapAligned:1===this.evaluatedMeshParams.alignment}),a=n.next()}}_getShaping(e){const t=this._textMeshTransformProps,s=this.evaluatedMeshParams;if(!s.glyphs?.glyphs.length)return null;const i=(0,l.Lz)(t.fontSize),r=(0,l.Lz)(t.offsetX),n=(0,l.Lz)(t.offsetY),o=s.glyphs.sdfSize,a=(0,Bs.qE)((0,l.Lz)(s.lineWidth),p.GR,p.cp),h=o/24*p.DY*(0,Bs.qE)(s.lineHeightRatio,.25,4);return di(s.glyphs,{scale:i/o,angle:t.postAngle,xOffset:r,yOffset:n,horizontalAlignment:s.horizontalAlignment,verticalAlignment:e||s.verticalAlignment,maxLineWidth:a,lineHeight:h,decoration:s.decoration,borderLineSizePx:(0,l.Lz)(s.boxBorderLineSize),hasBackground:!!s.boxBackgroundColor,useCIMAngleBehavior:s.useCIMAngleBehavior})}_writeGlyphs(e,t,s,i,r,n,o,a,h=!0){const c=this.evaluatedMeshParams,u=this._textMeshTransformProps,d=(0,l.Lz)(u.fontSize),p=u.haloSize,f=u.outlineSize,_=(0,l.Lz)(u.offsetX),m=(0,l.Lz)(u.offsetY),{sdfSize:g,sdfRadius:y}=c.glyphs,[x,b]=Ms(c.scaleInfo,this.getTileInfo());0!==n&&r.setRotation(n);const w=r.bounds,v=s+w.x+_,S=i+w.y-m,I=2*(c.minPixelBuffer?c.minPixelBuffer/d:1),P=Math.max(w.width,w.height)*I;r.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding),h&&e.recordBounds(v,S,P,P),this._writeTextBox(e,t,s,i,r.textBox,o,a),e.recordEnd());for(const n of r.glyphs){e.recordStart(this.instanceId,this.attributeLayout,n.textureBinding),h&&e.recordBounds(v,S,P,P);const{texcoords:r,offsets:l}=n;this._writeQuad(e,t,s,i,{texcoords:r,offsets:l,fontSize:d,haloSize:p,outlineSize:f,sdfSize:g,sdfRadius:y,color:As(c.color),isBackground:!1,referenceBounds:o,minZoom:x,maxZoom:b,...a}),e.recordEnd()}0!==n&&r.setRotation(-n)}_writeTextBox(e,t,s,i,r,n,o){const a=this.evaluatedMeshParams,{fontSize:h,haloSize:c,outlineSize:l}=this._textMeshTransformProps,{boxBackgroundColor:u,boxBorderLineColor:d,boxBorderLineSize:p}=a,{sdfSize:f,sdfRadius:_}=a.glyphs,m=!!d&&p>0,g={isBackground:!0,fontSize:h,haloSize:c,outlineSize:l,referenceBounds:n,sdfSize:f,sdfRadius:_,...o};u&&(this._writeQuad(e,t,s,i,{texcoords:_o,offsets:r.main,color:As(u),...g}),m||(this._writeQuad(e,t,s,i,{texcoords:bo,offsets:r.top,color:As(u),...g}),this._writeQuad(e,t,s,i,{texcoords:wo,offsets:r.bot,color:As(u),...g}),this._writeQuad(e,t,s,i,{texcoords:vo,offsets:r.left,color:As(u),...g}),this._writeQuad(e,t,s,i,{texcoords:So,offsets:r.right,color:As(u),...g}))),m&&(this._writeQuad(e,t,s,i,{texcoords:yo,offsets:r.top,color:As(d),...g}),this._writeQuad(e,t,s,i,{texcoords:yo,offsets:r.bot,color:As(d),...g}),this._writeQuad(e,t,s,i,{texcoords:xo,offsets:r.left,color:As(d),...g}),this._writeQuad(e,t,s,i,{texcoords:xo,offsets:r.right,color:As(d),...g}))}_writeQuad(e,t,s,i,r){const n=e.vertexCount();this._writeVertex(e,t,s,i,r),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Mo=e=>Math.round(e*(256/360)),ko=p.CQ*p.CQ/16,Co=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3708)]).then(s.bind(s,33708))),Ao=(0,Re.z9)(()=>Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(4690)]).then(s.bind(s,14690))),To=(0,O.Bj)(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class Fo extends Po{constructor(){super(...arguments),this._zoomLevel=0}async loadDependencies(){await Promise.all([super.loadDependencies(),Co.getImportPromise(),Ao.getImportPromise()])}_write(e,t,s,i,r){if(this._zoomLevel=i||0,null!=s)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const s=t.readXForDisplay(),i=t.readYForDisplay();this._writePoint(e,s,i,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":this._writePolygon(e,t,r);break;case"esriGeometryMultipoint":{let s=0;const i=xe.z.fromFeatureSetReader(t);if(i?.nextPath())for(;i.nextPoint();)this._writePoint(e,i.x,i.y,s++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,s,i,r,n){const[o,a]=this._getMetricDir(),h=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,l=this.evaluatedMeshParams.labelClassId;return new Kn(e,l,t,s,i,r,o,a,h,c,n)}_writePolygon(e,t,s){const i=Co.module,r=Ao.module.constructFromFlatGeometry,n=t.readGeometryForDisplay(),o=t.readCentroidForDisplay()?.coords,a=n?.area()||0;if(!o)return;const h=a>=ko;e.requiresRefresh||=h;const c=r((0,Qn.ME)(s)),l=r((0,Qn.ME)({x:o[0],y:o[1]})),u=!!i.execute(l,c,null);if(!n||!h||!u)return void this._writePoint(e,o[0],o[1],0,t);const d=r((0,Qn.Nh)("polygon",n,null)),p=i.execute(d,c,null);if(!p)return void this._writePoint(e,o[0],o[1],0,t);const f=(0,Qn.JR)(new Qn.uX(p.toFlatGeometry())),_=xe.z.fromOptimized(f,"esriGeometryPolygon",1),m=(0,hs.d)(_)??o;this._writePoint(e,m[0],m[1],0,t)}_writePoint(e,t,s,i,r){if(t<0||t>p.CQ||s<0||s>p.CQ)return;const n=this._getShaping();if(!n)return;const o=r.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,h=function(e,t,s){return(0,me.Wm)(`${e}${t}${s}`)}(this.evaluatedMeshParams.layerId,r.getObjectId(),i),c=function(e,t,s){return(0,me.Wm)(`${e}${t}${s}`)}(r.getObjectId(),a,i),[l,u]=this._getMetricDir(),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,f=this.evaluatedMeshParams.scaleInfo?.minScale??0,_=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new Kn(o,a,h,c,t,s,l,u,d,f,_)),this._writeGlyphs(e,o,t,s,n,0,_,void 0,!1),e.metricBoxWrite(n.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:s,verticalAlignment:i}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,n=this._getShaping("middle");if(!n)return;const o=(e,t,s,i)=>this._placeSubdivGlyphs(e,t,s,i),a=(n.bounds.width+r)/2;this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:n,zoomRange:Ms(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(t,o,a):this._writeCenterAlong(t,o,a)}_writeAboveAndBelowAlong(e,t,s){const{repeatLabel:i}=this.evaluatedMeshParams,{shaping:r}=this._current,n=r.bounds.halfHeight,o=e.readGeometryForDisplay();if(!o)return;const a=(0,Jn.kz)(o,"esriGeometryPolyline",1)??new Sr.A,h=zo(a,n),c=zo(a,-n),l=(0,Jn.zv)(c,"esriGeometryPolyline",!1,!1),u=ho((0,Jn.zv)(h,"esriGeometryPolyline",!1,!1).paths,r.bounds.width),d=ho(l.paths,r.bounds.width);this._current.offsetDirection="above";for(let e=0;e<u.length;e++)this._current.pathIndex=e,ao(u[e],s,t,!!i);this._current.offsetDirection="below";for(let e=0;e<d.length;e++)this._current.pathIndex=e,ao(d[e],s,t,!!i)}_writeCenterAlong(e,t,s){const{repeatLabel:i}=this.evaluatedMeshParams,{shaping:r}=this._current,n=ho(e.readLegacyGeometryForDisplay().paths,r.bounds.width);for(let e=0;e<n.length;e++)this._current.pathIndex=e,ao(n[e],s,t,!!i)}_placeSubdivGlyphs(e,t,s,i){const{allowOverrun:r,labelPosition:n,repeatLabelDistance:o,layerId:a,labelClassId:h}=this.evaluatedMeshParams,{objId:c,shaping:l,pathIndex:u}=this._current,d=this._current.zoomRange[0],p=To(t),f=this._current.shaping.bounds.width/2,_=Math.sqrt(o||128)/2,m=Math.min(s,i-s),g=l.isMultiline?uo:Math.log2(m/(_+f/2)),y=0===t?g:Math.min(p,g),x=Math.max(d,this._zoomLevel+1-y),b=this._zoomLevel-x,w=l.bounds.width/2*2**b,v=function(e,t,s,i,r){return(0,me.Wm)(`${e}${t}${s}${i*2**(uo-r)}`)}(a,c,u,t,this._zoomLevel),S=function(e,t,s,i,r){return(0,me.Wm)(`${e}${r}${t}${s*2**(uo-i)}`)}(c,u,t,this._zoomLevel,h);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,x,v,S):r&&b<0?this._placeStraightAlong(e,d,v,S):"parallel"===n?this._placeStraightAlong(e,x,v,S):"curved"===n&&this._placeCurved(e,x,w,v,S)}_placeStraight(e,t,s,i){const{out:r,id:n,shaping:o,referenceBounds:a}=this._current,{x:h,y:c}=e;r.metricStart(this._createLineLabelMetric(n,s,i,h,c)),r.metricBoxWrite(o.boundsT);const l=e.angle*(180/Math.PI)%360,u=(e.angle*(180/Math.PI)+180)%360;if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e={clipAngle:l,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(r,n,h,c,o,0,a,e,!1)}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e={clipAngle:u,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(r,n,h,c,o,0,a,e,!1)}r.metricEnd()}_placeCurved(e,t,s,i,r){const{out:n,id:o}=this._current;n.metricStart(this._createLineLabelMetric(o,i,r,e.x,e.y));const a=e.clone(),h=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,h),this._placeBack(e,a,t,s,1,h),this._placeForward(e,a,t,s,1,h)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,s,0,c),this._placeForward(e,a,t,s,0,c)),n.metricEnd()}_placeStraightAlong(e,t,s,i){const{out:r,id:n,shaping:o,zoomRange:a,referenceBounds:h}=this._current,{boxBorderLineColor:c,boxBackgroundColor:u}=this.evaluatedMeshParams,d=e.clone(),p=e.angle*(180/Math.PI)%360,f=(e.angle*(180/Math.PI)+180)%360,_=o.glyphs.length>0&&!(!c&&!u);if(r.metricStart(this._createLineLabelMetric(n,s,i,e.x,e.y)),_){const s=Math.max(t,a[0],0),i=Math.min(uo,a[1]),c=$s(Ks(),-e.angle),u={minZoom:s,maxZoom:i,clipAngle:p,mapAligned:!0,isLineLabel:!0},d=(0,l.Lz)(this.evaluatedMeshParams.offsetX),_=(0,l.Lz)(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=(0,ti.fA)(d,-1*_),[s,i]=o.shapeBackground(Xs(Ks(),c,t));r.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),this._writeTextBox(r,n,e.x,e.y,i,h,u),r.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=(0,ti.fA)(d,_),[s,i]=o.shapeBackground(Xs(Ks(),c,t));u.clipAngle=f,r.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),this._writeTextBox(r,n,e.x,e.y,i,h,u),r.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(d,t,1,p,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(d,t,0,f,!0),r.metricEnd()}_placeBack(e,t,s,i,r,n){const o=e.clone();let a=e.backwardLength+0;for(;o.prev()&&!(a>=i);)this._placeOnSegment(o,t,a,s,-1,r,n),a+=o.length+0}_placeForward(e,t,s,i,r,n){const o=e.clone();let a=e.remainingLength+0;for(;o.next()&&!(a>=i);)this._placeOnSegment(o,t,a,s,1,r,n),a+=o.length+0}_placeFirst(e,t,s,i,r=!1){const{out:n,id:o,shaping:a,zoomRange:h,referenceBounds:c}=this._current,l=a.glyphs,u=this._getBoundsOffset(e.angle);for(const d of l){const l=d.x>a.bounds.x?s:1-s,p=l*e.remainingLength+(1-l)*e.backwardLength,f=Math.abs(d.x+d.width/2-a.bounds.x),_=Math.max(0,this._zoomLevel+Math.log2(f/(p+0))),m=Math.max(t,r?0:_);d.angle=e.angle+(1-s)*Math.PI;const g=[Math.max(h[0],m),Math.min(h[1],uo)];this._writeLineGlyph(n,o,e.x,e.y,d,g,i,c),this._writeLineGlyphBox(n,d,s,g,u)}}_placeOnSegment(e,t,s,i,r,n,o){const{out:a,id:h,shaping:c,referenceBounds:l}=this._current,u=c.glyphs,d=e.dx/e.length,p=e.dy/e.length,f={x:e.x+s*-r*d,y:e.y+s*-r*p},_=this._getBoundsOffset(e.angle);for(const t of u){const u=t.x>c.bounds.x?n:1-n;if(!(u&&1===r||!u&&-1===r))continue;const d=Math.abs(t.x+t.width/2-c.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(d/s)-.1),m=Math.max(i,this._zoomLevel+Math.log2(d/(s+e.length+0)));if(0===p)continue;t.angle=e.angle+(1-n)*Math.PI;const g=[m,p];this._writeLineGlyph(a,h,f.x,f.y,t,g,o,l),this._writeLineGlyphBox(a,t,n,g,_)}}_getBoundsOffset(e){const t=(0,l.Lz)(this.evaluatedMeshParams.offsetX),s=(0,l.Lz)(this.evaluatedMeshParams.offsetY),i=(0,ti.fA)(t,s),r=$s(Ks(),-e);return(0,D.l0)(i,i,r)}_writeLineGlyph(e,t,s,i,r,n,o,a){if(s<0||s>p.CQ||i<0||i>p.CQ)return;e.recordStart(this.instanceId,this.attributeLayout,r.textureBinding);const{texcoords:h,offsets:c}=r,{fontSize:l,haloSize:u,outlineSize:d}=this._textMeshTransformProps,{sdfSize:f,sdfRadius:_}=this.evaluatedMeshParams.glyphs;this._writeQuad(e,t,s,i,{sdfSize:f,sdfRadius:_,texcoords:h,offsets:c,fontSize:l,haloSize:u,outlineSize:d,color:As(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:a,minZoom:Math.max(this._current.zoomRange[0],n[0]),maxZoom:Math.min(this._current.zoomRange[1],n[1]),clipAngle:o,mapAligned:!0,isLineLabel:!0}),e.recordEnd()}_writeLineGlyphBox(e,t,s,i,r){if((s||this._current.offsetDirection)&&this._isVisible(i)&&t.bounds){const s=t.bounds,i=new ii(s.x+r[0],s.y+r[1],s.width,s.height);e.metricBoxWrite(i)}}_packedZoom(e){return Math.floor(e*p.fq)/p.fq}_isVisible(e){let t=Math.max(this._current.zoomRange[0],e[0]),s=Math.min(this._current.zoomRange[1],e[1]);t=this._packedZoom(t),s=this._packedZoom(s);const i=this._packedZoom(this._zoomLevel);return t<=i&&i<=s}}function zo(e,t){const s=new Sr.A,{coords:i,lengths:r}=e,n=(0,Zn.vt)(),o=(0,Zn.vt)(),a=(0,Zn.vt)(),h=(0,Zn.vt)(),c=(0,Zn.vt)(),l=(0,Zn.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),p=2*(e+u),f=2*(e+u+1);e>0?(0,D.hZ)(n,i[r],i[r+1]):(0,D.hZ)(n,0,0),(0,D.hZ)(o,i[p],i[p+1]),e<d-1?(0,D.hZ)(a,i[f],i[f+1]):(0,D.hZ)(a,0,0),0===e?(0,D.hZ)(h,0,0):((0,D.jb)(h,o,n),(0,D.S8)(h,h),(0,D.hZ)(h,h[1],-h[0])),e===d-1?(0,D.hZ)(c,0,0):((0,D.jb)(c,a,o),(0,D.S8)(c,c),(0,D.hZ)(c,c[1],-c[0])),(0,D.WQ)(l,h,c),(0,D.S8)(l,l);const _=l[0]*c[0]+l[1]*c[1];0!==_&&(0,D.hs)(l,l,_),(0,D.hs)(l,l,t),s.coords.push(o[0]+l[0],o[1]+l[1])}s.lengths.push(d),u+=d}return s}const Eo={createComputedParams:e=>e,optionalAttributes:on.optionalAttributes,attributes:{...on.attributes,bitset:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:({gradientMethod:e,gradientSizeUnits:t,gradientType:s})=>Cs([[0,"alongline"===e.toLowerCase()],[1,t===Rn.h.Absolute],[2,"discrete"===s.toLowerCase()]])},tlbr:{type:bi.pe.UNSIGNED_SHORT,count:4,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM+p.MZ,n=t.y+p.hM;return[r,n,r+s-2*p.MZ,n+i]}},accumulatedDistance:{type:bi.pe.HALF_FLOAT,count:1,packTessellation:({distance:e,pathLength:t,distanceOffset:s})=>(s+e)/t},gradientSize:{type:bi.pe.HALF_FLOAT,count:1,pack:({gradientSize:e,gradientSizeUnits:t})=>t===Rn.h.Relative?e/100:(0,l.Lz)(e)},totalLength:{type:bi.pe.HALF_FLOAT,count:1,packTessellation:({pathLength:e})=>e},segmentDirection:{type:bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:e,directionY:t})=>[e,t]}}};class Oo extends cn{get _preventEffectClipping(){return!0}constructor(e,t,s,i){super(e,t,s,i),this.vertexSpec=Eo,this._tessellationOptions.textured=!0}_write(e,t,s){const i=s??xe.z.fromFeatureSetReaderCIM(t);if(!i)return;const{sprite:r}=this.evaluatedMeshParams;this._writeGeometry(e,t,i,r?.textureBinding)}}const Ro={createComputedParams:e=>e,optionalAttributes:on.optionalAttributes,attributes:{...on.attributes,bitset:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:e,shouldScaleDash:t,isSDF:s})=>Cs([[4,e],[2,t],[3,s]])},tlbr:{type:bi.pe.UNSIGNED_SHORT,count:4,pack:({sprite:e})=>{const{rect:t,width:s,height:i}=e,r=t.x+p.hM,n=t.y+p.hM;return[r,n,r+s,n+i]}},accumulatedDistance:{type:bi.pe.UNSIGNED_SHORT,count:1,packTessellation:({distance:e})=>e},segmentDirection:{type:bi.pe.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:e,directionY:t})=>[e,t]},offsetAlongLine:{type:bi.pe.HALF_FLOAT,count:1,pack:({offsetAlongLine:e})=>(0,l.Lz)(e)},capType:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:({capType:e})=>{switch(e){case"Butt":case"butt":default:return 0;case"Square":case"square":return 1;case"Round":case"round":return 2}}}}};class Lo extends cn{constructor(e,t,s,i){super(e,t,s,i),this.vertexSpec=Ro,this._tessellationOptions.textured=!0}_write(e,t,s){const i=s??xe.z.fromFeatureSetReaderCIM(t);if(!i)return;const{sprite:r}=this.evaluatedMeshParams;this._writeGeometry(e,t,i,r?.textureBinding)}}class Do{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const t=new Do(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:s,width:i,height:r,angle:n,alignment:o,outlineSize:a,referenceSize:h,sprite:c,overrideOutlineColor:u}=e;return t.rawWidth=(0,l.Lz)(i),t.rawHeight=(0,l.Lz)(r),t.angle=n,t.alignment=o,t.outlineSize=(0,l.Lz)(a),t.referenceSize=(0,l.Lz)(h),t.overrideOutlineColor=u,t.offsetX=(0,l.Lz)(e.offsetX),t.offsetY=(0,l.Lz)(e.offsetY),"simple"!==s||c.sdf||(t.rawWidth=c.width,t.rawHeight=c.height),t._computeSize(e,!1),t}static fromComplexMeshParams(e){const t=new Do(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:s,transforms:i,size:r,scaleX:n,anchorX:o,anchorY:a,angle:h,colorLocked:c,frameHeight:u,widthRatio:d,offsetX:p,offsetY:f,outlineSize:_,referenceSize:m,scaleFactor:g,sizeRatio:y,isAbsoluteAnchorPoint:x,rotateClockwise:b,scaleSymbolsProportionally:w,sprite:v}=e;if(i&&i.infos.length>0){const e=(0,Re.zb)(r,h,b,p,f,i);r=e.size,h=e.rotation,p=e.offsetX,f=e.offsetY,b=!1}g&&(r*=g,p*=g,f*=g);const S=n*(v.width/v.height);t.alignment=s,t.rawHeight=(0,l.Lz)(r),t.rawWidth=t.rawHeight*S,t.referenceSize=(0,l.Lz)(m),t.sizeRatio=y,t.sdfDecodeCoeff=(v.sdfDecodeCoeff??1)*y,t.angle=h,t.rotateClockwise=b,t.anchorX=o,t.anchorY=a,t.offsetX=(0,l.Lz)(p),t.offsetY=(0,l.Lz)(f),x&&r&&(v.sdf?t.anchorX=o/(r*d):t.anchorX=o/(r*S),t.anchorY=a/r);const I=w&&u?r/u:1;return t.outlineSize=0===_||isNaN(_)?0:(0,l.Lz)(_)*I,t.scaleSymbolsProportionally=w,t.colorLocked=c,t._computeSize(e,!0),t}constructor(e,t,s,i,r,n,o){this.sprite=e,this.color=t,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=0,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(e,t){const{sprite:s,hasSizeVV:i}=e,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,f=0,_=0;if(r){const e=1/(1-n);if(u*=e,d*=e,i)this.computedWidth=u,this.computedHeight=d;else{const e=t&&o>a?u:o,i=a,r=c+2;this.computedWidth=Math.min(e+r,u),this.computedHeight=Math.min(i+r,d);const n=Math.max(s.width,s.height)/Math.max(u,d);f=(this.computedWidth-u)*n,_=(this.computedHeight-d)*n}}else this.computedWidth=u*(l.width/s.width),this.computedHeight=d*(l.height/s.height),f=2*p.hM,_=2*p.hM;const m=l.x+p.hM-f/2,g=l.y+p.hM-_/2,y=m+s.width+f,x=g+s.height+_;this.texXmin=qo(m),this.texYmin=qo(g),this.texXmax=No(y),this.texYmax=No(x),this.computedWidth*=(this.texXmax-this.texXmin)/(y-m),this.computedHeight*=(this.texYmax-this.texYmin)/(x-g),this.anchorX*=u/this.computedWidth,this.anchorY*=d/this.computedHeight}}function qo(e,t=1e-7){const s=Math.ceil(e);return s-e<t?s:Math.floor(e)}function No(e,t=1e-7){const s=Math.floor(e);return e-s<t?s:Math.ceil(e)}const Go=128/Math.PI;const Bo={createComputedParams:e=>Do.from(e),optionalAttributes:{zoomRange:{type:bi.pe.SHORT,count:2,packPrecisionFactor:p.fq,pack:({scaleInfo:e},{tileInfo:t})=>Ms(e,t)}},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:e,alignment:t,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let n=0;return e.sdf&&(n|=ks(Os)),1===t&&(n|=ks(Rs)),s&&(n|=ks(Ls)),i&&(n|=ks(Ds)),r&&(n|=ks(qs)),n}},offset:{type:bi.pe.HALF_FLOAT,count:2,packAlternating:{count:4,pack:({angle:e,computedWidth:t,computedHeight:s,anchorX:i,anchorY:r,offsetX:n,offsetY:o,rotateClockwise:a})=>{const h=function(e,t,s,i,r=!1){const n=Ks(),o=r?1:-1;return Vs(n),(t||s)&&Xs(n,n,[t,-s]),i&&Hs(n,n,.017453292519944444*o*-i),n}(0,n,o,-e,a),c=-(.5+i)*t,l=-(.5-r)*s,u=[c,l],d=[c+t,l],p=[c,l+s],f=[c+t,l+s];return(0,D.l0)(u,u,h),(0,D.l0)(d,d,h),(0,D.l0)(p,p,h),(0,D.l0)(f,f,h),[u,d,p,f]}}},textureUV:{type:bi.pe.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:e,texXmin:t,texYmax:s,texYmin:i})=>[[t,i],[e,i],[t,s],[e,s]]}},color:{type:bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>As(e)},outlineColor:{type:bi.pe.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>As(e)},sizing:{type:bi.pe.UNSIGNED_BYTE,count:4,pack:({rawWidth:e,rawHeight:t,outlineSize:s,referenceSize:i})=>[zs(Math.max(e,t),128),zs(s,128),zs(i,128),0]},placementAngle:{type:bi.pe.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:e})=>function(e){return function(e){return e%=256,Math.abs(e>=0?e:e+256)}(e*Go)}(e)},sdfDecodeCoeff:{type:bi.pe.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:e})=>e}}};class Wo extends vi{constructor(){super(...arguments),this.vertexSpec=Bo}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,t,s){const i=this.evaluatedMeshParams.sprite?.textureBinding,r=t.getDisplayId();e.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=He(s,2*Math.max(this.evaluatedMeshParams.computedWidth,this.evaluatedMeshParams.computedHeight),!1),null===i))return;this._writePlacedMarkers(e,t,i,o,a)}else if(s?.nextPath()){s.nextPoint();const t=s.x,i=s.y;e.recordBounds(t+l,i+u,o,a),this._writeQuad(e,r,t,i)}else if("esriGeometryPolygon"===t.geometryType){const s=t.readCentroidForDisplay();if(!s)return;const[i,n]=s.coords;e.recordBounds(i+l,n+u,o,a),this._writeQuad(e,r,i,n)}else if("esriGeometryPoint"===t.geometryType){const s=t.readXForDisplay(),i=t.readYForDisplay();e.recordBounds(s+l,i+u,o,a),this._writeQuad(e,r,s,i)}else{const s=t.readGeometryForDisplay();s?.forEachVertex((t,s)=>{e.recordBounds(t+l,s+u,o,a),Math.abs(t)>we||Math.abs(s)>we||this._writeQuad(e,r,t,s)})}e.recordEnd()}_writePlacedMarkers(e,t,s,i,r){const n=s??xe.z.fromFeatureSetReaderCIM(t);if(!n)return;const o=Is.getPlacement(n,-1,this.evaluatedMeshParams.placement,(0,l.Lz)(1),e.id);if(!o)return;const a=t.getDisplayId();let h=o.next();const c=this.evaluatedMeshParams.offsetX,u=-this.evaluatedMeshParams.offsetY;for(;null!=h;){const t=h.tx,s=-h.ty;if(Math.abs(t)>we||Math.abs(s)>we){h=o.next();continue}const n=-h.getAngle();e.recordBounds(t+c,s+u,i,r),this._writeQuad(e,a,t,s,n),h=o.next()}}_writeQuad(e,t,s,i,r){const n=e.vertexCount(),o=null==r?null:{placementAngle:r};this._writeVertex(e,t,s,i,o),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}var jo=s(4576),Uo=s(55674);class Vo{destroy(){}}class Yo extends Vo{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,s){return this._value}hasArcadeDependency(e){return!1}}const Ho=()=>Lt.A.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function Xo(e,t,s,i){const{defaultValue:r,valueExpressionInfo:n,value:o}=t;if(n){if("dictionary-template"===n.type)return{...t,computed:e.createDictionaryTemplateField(n,s),defaultValue:r};const{expression:o}=n,a=await e.createComputedField({expression:o},i);return a?{...t,computed:a,defaultValue:r}:null}return{...t,computed:new Yo(o),defaultValue:r}}async function $o(e,t,s){const{valueExpressionInfo:i}=t,r="dictionary-template"===i.type?e.createDictionaryTemplateField(i,s):await e.createComputedField({expression:i.expression});return r?{...t,computed:r}:null}function Zo(e){return"object"==typeof e&&null!=e&&(!(!("valueExpressionInfo"in e)||!e.valueExpressionInfo)||"type"in e&&"Process"===e.type&&"op"in e&&"Random"===e.op)}function Qo(e){if(Array.isArray(e))for(const t of e)if(Qo(t))return!0;if("object"==typeof e){if(Zo(e))return!0;for(const t in e)if(Qo(e[t]))return!0}return!1}class Jo{static async create(e,t,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 t=await $o(e,d,i);if(!t){r[u]=d.defaultValue;continue}n.set(u,t),r[u]=null;continue}switch(d.type){case"cim-effect-infos":if(d.effectInfos.some(e=>e.overrides.length)){o.set(u,{effects:await Promise.all(d.effectInfos.map(async t=>{const s=t.overrides.map(t=>Xo(e,t,i,!1));return{effect:t.effect,compiledOverrides:(await Promise.all(s)).filter(jo.Ru)}}))});break}r[u]=d.effectInfos.map(e=>e.effect);break;case"cim-marker-placement-param":d.overrides.length&&a.set(u,{placementInfo:d,compiledOverrides:(await Promise.all(d.overrides.map(t=>Xo(e,t,i,!1)))).filter(jo.Ru)}),r[u]=d.placement;break;case"text-rasterization-param":{if(d.overrides.length){const t=d.overrides.map(t=>Xo(e,t,i,d.useLegacyLabelEvaluationRules??!1));h.set(u,{compiledOverrides:(await Promise.all(t)).filter(jo.Ru),rasterizationParam:d,objectIdToResourceId:new Map});continue}const s={type:"cim-rasterization-info",resource:d.resource};r[u]=await t.fetchResourceImmediate(s)??null;break}case"sprite-rasterization-param":{if(d.overrides.length){const t=d.overrides.map(t=>Xo(e,t,i,!1));h.set(u,{compiledOverrides:(await Promise.all(t)).filter(jo.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 t.fetchResourceImmediate(s)??null;break}case"cim-marker-transform-param":{const{params:t}=d;if(Qo(t)){const s={compiledMarkerInfos:[]};await Promise.all(t.map(async t=>{const r={props:{}};for(const s in t)if(Zo(t[s])){const n=await $o(e,t[s],i);r.compiledExpressionMap||(r.compiledExpressionMap=new Map);const o=r.compiledExpressionMap;n&&o.set(s,n)}else r.props[s]=t[s];s.compiledMarkerInfos.push(r)})),c.set(u,s)}else r[u]={type:"cim-marker-transform-info",infos:t};break}case"animation-params":{const{params:s}=d,i=Vi(s);if(Qo(i)){const t=await Promise.all(i.map(t=>Hi(t,e)));l.set(u,{params:t,propertyIdToResourceId:new Map,key:u})}else{const e=Ui(i),s=await t.fetchResourceImmediate({type:"animation-info",resource:e});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 Jo(s,r,n,o,a,h,c,l)}constructor(e,t,s,i,r,n,o,a){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=s,this._dynamicEffectProperties=i,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=n,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=a,this.evaluator=e=>e,this._arcadeDependencies=new Set;for(const e of this._expressions())(0,Uo.QY)(this._arcadeDependencies,e)}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(e,t,s){for(const r of this._dynamicAsyncProperties.values()){const n=(0,Gs.o8)(r.rasterizationParam.resource);"animated"===r.rasterizationParam.resource.type&&r.rasterizationParam.resource.randomizeStartTime&&(n.primitiveName="__RESERVED__PRIMITIVE__NAME__",n.startGroup=Pi(t.getObjectId()||0));for(const{primitiveName:e,propertyName:o,computed:a,defaultValue:h,valueExpressionInfo:c}of r.compiledOverrides)try{const i="animated"===r.rasterizationParam.resource.type?n.primitiveName:e;(0,rn.Ph)(n,i,o,a,t,s,h)}catch(e){Ho().errorOnce(new i.A("invalid-arcade-expression","Encountered an error when evaluating the arcade expression",{error:e,valueExpressionInfo:c}))}const o=e.enqueueRequest({type:"cim-rasterization-info",resource:n});r.objectIdToResourceId.set(t.getObjectId(),o)}for(const i of this._dynamicAsyncAnimations.values()){const r=i.params.map(e=>Xi(e,t,s)).map(Di).map(e=>e.simplify()),n=Yi(r),o=e.enqueueRequest({type:"animation-info",resource:n});i.propertyIdToResourceId.set(t.getObjectId()+"."+i.key,o)}}evaluateMeshParams(e,t,s){for(const[e,i]of this._dynamicProperties.entries())this._resolvedMeshParams[e]=i.computed.readWithDefault(t,s,i.defaultValue);for(const[e,i]of this._dynamicPlacementProperties.entries())for(const{computed:r,defaultValue:n,propertyName:o}of i.compiledOverrides){const a=r.readWithDefault(t,s,n);i.placementInfo.placement[o]=a,this._resolvedMeshParams[e]=i.placementInfo.placement}for(const[e,i]of this._dynamicEffectProperties.entries())for(const r of i.effects){for(const{computed:e,defaultValue:i,propertyName:n}of r.compiledOverrides){const o=e.readWithDefault(t,s,i);r.effect[n]=o}this._resolvedMeshParams[e]=i.effects.map(e=>e.effect)}for(const[e,i]of this._dynamicTransformProperties.entries()){const r={type:"cim-marker-transform-info",infos:[]};for(const e of i.compiledMarkerInfos){const i={...e.props};if(e.compiledExpressionMap)for(const[r,n]of e.compiledExpressionMap){const e=n.computed.readWithDefault(t,s,n.defaultValue);i[r]="number"==typeof e||"boolean"==typeof e?e:n.defaultValue}r.infos.push(i)}this._resolvedMeshParams[e]=r}for(const[s,i]of this._dynamicAsyncProperties.entries()){const r=i.objectIdToResourceId.get(t.getObjectId());if(null==r)continue;const n=e.getResource(r);this._resolvedMeshParams[s]=n}for(const[s,i]of this._dynamicAsyncAnimations.entries()){const r=i.propertyIdToResourceId.get(t.getObjectId()+"."+s);if(null==r)continue;const n=e.getResource(r);this._resolvedMeshParams[s]={dataRow:n.rect.y,dataColumn:n.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}*_expressions(){for(const e of this._dynamicProperties.values())yield e.computed;for(const e of this._dynamicEffectProperties.values())for(const t of e.effects)for(const e of t.compiledOverrides)yield e.computed;for(const e of this._dynamicPlacementProperties.values())for(const t of e.compiledOverrides)yield t.computed;for(const e of this._dynamicAsyncProperties.values())for(const t of e.compiledOverrides)yield t.computed;for(const e of this._dynamicTransformProperties.values())for(const t of e.compiledMarkerInfos)if(null!=t.compiledExpressionMap)for(const e of t.compiledExpressionMap.values())yield e.computed;for(const e of this._dynamicAsyncAnimations.values())for(const t of e.params)yield*$i(t)}}const Ko={createComputedParams:e=>e,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:e=>0},offset:{type:bi.pe.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:e})=>{const t=(0,l.Lz)(e),s=-t/2,i=-t/2;return[[s,i],[s+t,i],[s,i+t],[s+t,i+t]]}}},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:e})=>[e,e]},referenceSize:{type:bi.pe.UNSIGNED_BYTE,count:1,pack:({size:e})=>(0,l.Lz)(e)},zoomRange:{type:bi.pe.UNSIGNED_BYTE,count:2,pack:({scaleInfo:e},{tileInfo:t})=>Ms(e,t)}}};class ea extends vi{constructor(){super(...arguments),this.vertexSpec=Ko}_write(e,t){const s=t.getDisplayId(),i=this.evaluatedMeshParams.minPixelBuffer,r=Math.max((0,l.Lz)(this.evaluatedMeshParams.size),i);let n,o;if("esriGeometryPoint"===t.geometryType)n=t.readXForDisplay(),o=t.readYForDisplay();else{const e=t.readCentroidForDisplay();if(!e)return;n=e?.coords[0],o=e?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(n,o,r,r);const a=e.vertexCount();this._writeVertex(e,s,n,o),e.indexWrite(a+0),e.indexWrite(a+1),e.indexWrite(a+2),e.indexWrite(a+1),e.indexWrite(a+3),e.indexWrite(a+2),e.recordEnd()}}class ta{async createMeshWriter(e,t,s,i,r){const n=this._getMeshWriter(i.techniqueType),o=await Jo.create(e,t,i.inputParams,r),a=new n(i.id,o,i.optionalAttributes,s);return await a.loadDependencies(),a}_getMeshWriter(e){switch(e){case 15:return yn;case 12:return mn;case 10:return In;case 28:return bn;case 16:return jn;case 26:return Cn;case 29:return Hn;case 11:return On;case 23:return Wo;case 30:return ea;case 32:return Po;case 21:return cn;case 33:return Lo;case 17:return Oo;case 19:return $n;case 20:return Fo;case 2:return xr;case 3:return br;case 0:return un;case 1:return pn;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}class sa{constructor(e,t,s,i,r){this.storage=e,this.proxy=t,this.viewParams=s,this.registry=i,this.fieldsMap=r}async createMeshWriters(e){const t=e.map(e=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,e,this.fieldsMap));return Promise.all(t)}}var ia=s(563);class ra{constructor(e){this._outstandingMessages=[],this._queue=new ia.QueueProcessor({concurrency:e.concurrency,process:t=>e.process(t)})}async push(e){if(e.end)return await Promise.all(this._outstandingMessages),await this._queue.push(e),void(this._outstandingMessages=[]);const t=this._queue.push(e);return this._outstandingMessages.push(t),t}}var na=s(43334),oa=s(31464),aa=s(95466);class ha{static async create(e,t){if("count"===t.statisticType){const e=new Yo(1);return new ha(t.name,t.alias,t.type,t.statisticType,e)}const s=await e.createComputedField({expression:t.onStatisticExpression?.expression,field:t.onStatisticField});return new ha(t.name,t.alias,t.type,t.statisticType,s)}constructor(e,t,s,i,r){this.name=e,this.alias=t,this.type=s,this.statisticType=i,this.computed=r}}var ca=s(65529),la=s(70328),ua=s(37730),da=s(56390);class pa{constructor(e){this.subscription=e,this.handledChunks=new Set}destroy(){}}class fa{constructor(e,t,s){this._source=e,this._attributeStore=t,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}get usedMemory(){return 0}updateRequiredLevel(e,t){}onSubscribe(e){const t=this.createState(e);this._sendStates.set(e.key.id,t),this.updateChunks()}onUnsubscribe(e){this._sendStates.get(e.key.id)?.destroy(),this._sendStates.delete(e.key.id)}get hasSubscribers(){return this._sendStates.size>0}requiresInvalidation(){return!1}invalidate(){const e=Array.from(this._sendStates.values());this._sendStates.clear();for(const t of e)t.destroy(),this.onSubscribe(t.subscription)}invalidateAttributeData(e){}hasArcadeDependency(e){return!1}getFeatureObjectIdsForAggregate(e){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(e){return this.displayMap(e,e=>e,e=>e)}getDisplayAndObjectIds(e){return this.displayMap(e,e=>e,(e,t,s)=>[e,s])}afterUpdateChunks(){}}class _a extends fa{constructor(e,t,s,i,r){super(e,t,r),this.spatialReference=s,this.aggregateFields=i,this._arcadeDependencies=new Set,this.events=new ca.bk,this.featureAdapter=ua.T;for(const e of i)(0,Uo.QY)(this._arcadeDependencies,e.computed)}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new da.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(e){}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,t){}forEachBounds(e,t){const s=(0,la.vt)();for(const i of e){const e=(0,Jn.jQ)(s,i.geometry);e&&t(e)}}}class ma{constructor(e,t,s,i,r){this.subscription=e,this.reader=t,this.clear=s,this.end=i,this.debugInfo=r,this.type="append"}get id(){return this.subscription.tile.id}createMessage(e,t,s){return{type:"append",clear:this.clear,id:this.id,append:e,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:t,attributeEpoch:s}}}class ga{constructor(e,t,s,i,r){this.subscription=e,this.reader=t,this.remove=s,this.end=i,this.debugInfo=r,this.type="update"}get id(){return this.subscription.tile.id}createMessage(e,t,s){return{type:"update",id:this.id,modify:e,debugInfo:this.debugInfo,remove:this.remove,version:t,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:s}}}const ya=8388607,xa=e=>e&ya;class ba extends Vo{constructor(e){super(),this._field=e}resize(e){throw new Error("Method not implemented.")}read(e,t){return e.readAttribute(this._field)}readWithDefault(e,t){return e.readAttribute(this._field)}hasArcadeDependency(e){return!1}}var wa=s(50115);class va extends Vo{static async create(e,t){const s=await(0,Uo.Ad)(e,t.spatialReference),i=(0,me.Wm)(e);return new va(s,i)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.hasArcadeDependency("scale")||"system"!==t.$view.timeZone?(0,wa.V4)(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,s){return this.hasArcadeDependency("scale")||"system"!==t.$view.timeZone?(0,wa.OP)(this._compiled,e,t,s):this._readWithDefaultCached(e,t,s)}hasArcadeDependency(e){return this._compiled?.references(e)??!1}_getCacheKey(e){if(!this._compiled?.references("timeProperties"))return this._cacheKey;const{currentStart:t,currentEnd:s}=e.$view.timeProperties;return this._cacheKey+function(e,t){const s=43758.5453*Math.sin(12.9898*e+78.233*t);return s-Math.floor(s)}(t??1,s??1)}_readCached(e,t){if(e.setCache(this._getCacheKey(t)),e.hasCachedValue())return e.getCachedValue();const s=(0,wa.V4)(this._compiled,e,t);return e.setCachedValue(s),s}_readWithDefaultCached(e,t,s){if(e.setCache(this._getCacheKey(t)),e.hasCachedValue())return e.getCachedValue();const i=(0,wa.OP)(this._compiled,e,t,s);return e.setCachedValue(i),i}}var Sa=s(39516),Ia=s(97770),Pa=s(18047),Ma=s(68463),ka=s(30524),Ca=s(32730);class Aa extends Vo{static async create(e,t){const s=(0,Ca.lc)(e);return new Aa(e=>s.replaceAll(/{[^}]*}/g,t=>{const s=t.slice(1,-1),i=e.metadata.fieldsIndex.get(s);if(null==i)return t;const r=e.readAttribute(s);return null==r?"":function(e,t){if(null==e)return"";const s=t.domain;if(s)if("codedValue"===s.type||"coded-value"===s.type){const t=e;for(const e of s.codedValues)if(e.code===t)return e.name}else if("range"===s.type){const{max:i,min:r}=(0,Ma.A5)(t),n=+e;if(null!=r&&null!=i&&r<=n&&n<=i)return s.name}let i=e;return(0,ka.vE)(t)?i=(0,Ia.Yq)(i,(0,Ia.J2)("short-date")):(0,ka.WA)(t)&&(i=(0,Pa.ZV)(+i)),i||""}(r,i)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,s){const i=this._evaluator(e);return(0,wa.rZ)(i)?s:i}hasArcadeDependency(e){return!1}}class Ta extends Vo{constructor(e,t){super(),this._template=e,this._parts=(0,Re.gQ)(e.template,t)}resize(e){}read(e,t){return(0,Re._h)(e,this._parts,this._template.textCase)}readWithDefault(e,t,s){return(0,Re._h)(e,this._parts,this._template.textCase)}hasArcadeDependency(e){return!1}}class Fa extends Vo{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}hasArcadeDependency(e){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(null==t)return null;const{normalizationField:s,normalizationTotal:i,normalizationType:r}=this._normalizationInfo,n=e.readAttribute(s);switch(r??"esriNormalizeByField"){case"esriNormalizeByField":return n?n?t/n:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return i?t/i*100:null}}}var za=s(73250);const Ea=()=>Lt.A.getLogger("esri.views.2d.layers.FeatureLayerView2D"),Oa={getAttribute:(e,t)=>e.readAttribute(t)};async function Ra(e,t){try{const s=await(0,Sa.GP)(e,t);return s.isStandardized||Ea().error(new i.A("sql-parse-error","expression is not standardized",{where:e})),(t,r)=>{const n=t.readArcadeFeature();try{return s.testFeatureCompiled(n,Oa,r.currentUser)}catch(t){return Ea().warn(new i.A("sql-runtime-error","Encountered an error when evaluating where clause",{where:e,error:t})),!0}}}catch(t){return Ea().warn(new i.A("sql-runtime-error","Encountered an error when evaluating where clause",{where:e,error:t})),e=>!0}}const La=()=>Lt.A.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),Da=4294967295;function qa(e,t,s){if(!(e.length>t))for(;e.length<=t;)e.push(s)}class Na{constructor(e){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=e}createBitset(){const e=this._bitsets.length;return this._bitsets.push(za.y.create(this._allocatedSize,ya)),e+1}createDictionaryTemplateField(e,t){return new Ta(e,t)}async createComputedField(e,t=!1){if(e.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return t?await Aa.create(e.expression,this.compilationOptions):await va.create(e.expression,this.compilationOptions)}catch(t){const s=new i.A("featurelayer","Failed to compile arcade expression",{error:t,expression:e.expression});return La().error(s),null}if(e.normalizationType||e.normalizationField)return new Fa(e.field,e);if(e.field)return new ba(e.field);const s=new i.A("featurelayer","Unable to create computed field. No expression or field found",{info:e});return La().error(s),null}async createWhereClause(e){return e?Ra(e,this.compilationOptions.fields):null}getBitset(e){return this._bitsets[e-1]}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&ya,0)}setComputedNumeric(e,t,s){return this.setComputedNumericAtIndex(e&ya,s,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&ya,0)}setComputedString(e,t,s){return this.setComputedStringAtIndex(e&ya,0,s)}getComputedNumericAtIndex(e,t){const s=e&ya;return this._ensureNumeric(t,s),this._numerics[t][s]}setComputedNumericAtIndex(e,t,s){const i=e&ya;this._ensureNumeric(t,i),this._numerics[t][i]=s}getPackedChunkId(e){const t=e&ya;return this._ensureInstanceId(t),this._instanceIds[t]}setPackedChunkId(e,t){const s=e&ya;this._ensureInstanceId(s),this._instanceIds[s]=t}getComputedStringAtIndex(e,t){const s=e&ya;return this._ensureString(t,s),this._strings[t][s]}setComputedStringAtIndex(e,t,s){const i=e&ya;this._ensureString(t,i),this._strings[t][i]=s}getXMin(e){return this._bounds[4*(e&ya)]}getYMin(e){return this._bounds[4*(e&ya)+1]}getXMax(e){return this._bounds[4*(e&ya)+2]}getYMax(e){return this._bounds[4*(e&ya)+3]}setBounds(e,t,s=!1){const i=e&ya;if(!s&&!this._dirtyBitset.has(e))return this._bounds[4*i]!==Da;this._dirtyBitset.unset(e);const r=t.readGeometryWorldSpace();if(qa(this._bounds,4*i+4,0),!r||!r.coords.length)return this._bounds[4*i]=Da,this._bounds[4*i+1]=Da,this._bounds[4*i+2]=Da,this._bounds[4*i+3]=Da,!1;let n=1/0,o=1/0,a=-1/0,h=-1/0;return r.forEachVertex((e,t)=>{n=Math.min(n,e),o=Math.min(o,t),a=Math.max(a,e),h=Math.max(h,t)}),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(e,t){const s=this.getXMin(t),i=this.getYMin(t),r=this.getXMax(t),n=this.getYMax(t);return(0,la.BI)(e,s,i,r,n),s!==Da}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),qa(this._numerics[e],t,0)}_ensureInstanceId(e){qa(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),qa(this._strings[e],t,null)}}var Ga=s(58727),Ba=s(62660),Wa=s(86420),ja=s(61956),Ua=s(30661);class Va{constructor(e){this._geometryBounds=(0,Y.vt)(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new Va(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e,t){return this._applyFilter(e,t)}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,1)}setTrue(e){const t=[],s=[],i=new Set(e);return this._idToVisibility.forEach((e,r)=>{const n=!!(1&this._idToVisibility.get(r)),o=i.has(r);!n&&o?t.push(r):n&&!o&&s.push(r),this._idToVisibility.set(r,o?3:0)}),{show:t,hide:s}}createQuery(){const{geometry:e,spatialRel:t,where:s,timeExtent:i,objectIds:r}=this;return ja.A.fromJSON({geometry:e,spatialRel:t,where:s,timeExtent:i,objectIds:r})}async update(e,t){this._hash=JSON.stringify(e);const s=await(0,Ga.T2)(e,null,t);await Promise.all([this._setGeometryFilter(s),this._setIdFilter(s),this._setAttributeFilter(s),this._setTimeFilter(s)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await Ra(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,s=e.spatialRel??"esriSpatialRelIntersects",i=await(0,Ba.xt)(s,t,this._serviceInfo.geometryType);(0,ct.Rg)(this._geometryBounds,t),this._spatialQueryOperator=i,this.geometry=t,this.spatialRel=s}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent){if(!this._serviceInfo.timeInfo){const t=new i.A("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);return void Lt.A.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}this.timeExtent=e.timeExtent,this._timeOperator=(0,Wa.I)(this._serviceInfo.timeInfo,e.timeExtent,Ua.Z.Shared)}}_applyFilter(e,t){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e,t)}_filterByExpression(e,t){return!this.where||this._clause(e,t)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return null==this._timeOperator||this._timeOperator(e)}}var Ya=s(35258),Ha=s(8446);class Xa extends pa{constructor(e,t){super(e),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.done=!1}destroy(){const e=this.subscription.tile.key.level;for(const t of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${t}.${e}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const e of this.featureCache.values()){const t=e.clone();t.geometry&&(0,Jn.aQ)(t.geometry,this.subscription.tile.transform),yield t}}}class $a extends _a{static async create(e,t,s,i,r){const n=t.metadata.outSpatialReference,o=new Na({spatialReference:n}),a=await Promise.all(e.fields.map(async e=>ha.create(o,e))),h=e.featureFilter?await Va.create({geometryType:t.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:t.metadata.timeInfo,fieldsIndex:t.metadata.fieldsIndex,spatialReference:n,filterJSON:e.featureFilter}):null;return"geohash"===e.index.type&&await(0,oa.Nk)(n,Ee.A.WGS84),new $a(e,h,i,a,n,t,s,r)}constructor(e,t,s,i,r,n,o,a){super(n,o,r,i,a),this._schema=e,this._featureFilter=t,this._arcadeContextInfo=s,this._metadata=Ya.i.createFeature({geometryType:"esriGeometryPolygon",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new aa.A(e.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(e){return new Xa(e,this._attributeStore)}async*applyOverrideUpdate(e){for(const e of this._sendStates.values()){e.reset();const t=new ma(e.subscription,Ha.K.empty(this._source.metadata),!0,!1,{});yield t}}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[];for(const e of this._sendStates.values())for(const t of e.featuresWorldSpace()){const{objectId:e,displayId:n}=t,o=i.get(e);if(null!=o){const t=s(n,o,e);r.push(t),i.delete(e)}}return r}getDisplayFeatures(e){const t=new Set(e),s=new Set,i=[];for(const e of this._sendStates.values())for(const r of e.featuresWorldSpace())t.has(r.displayId)&&!s.has(r.objectId)&&(r.geometry&&i.push({...(0,Jn.oN)(r,this._metadata.geometryType,!1,!1),displayId:r.displayId}),s.add(r.objectId));return{features:[],aggregates:i,tracks:[]}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.containedObjectIds);return[]}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._sendStates.values())for(const i of s.featuresWorldSpace())t.has(i.objectId)||(e(i),t.add(i.objectId))}_createIndexOptions(e){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:e.scale,sqlOptions:this._sqlOptions};case"grid":{const t=this._schema.index.fixedBinLevel,s=null!=t?e.tileInfoView.getLODInfoAt(t).scale:e.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(e,t){const{handledChunks:s,subscription:i,bins:r,featureCache:n}=e,o=i.tile;if(e.done)return;for(const i of t.chunks()){if(s.has(i.chunkId))continue;s.add(i.chunkId);const t=i.queryInfo;if("tileId"in t){const e=new b.A(t.tileId);if(e.level!==o.level||e.world!==o.key.world)continue}i.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(r,e.tile.extent,e.tile.resolution)}const a=[],h=i.tile.transform,c=i.tile.key.level;for(const e of r.values()){let t=n.get(e.id);if(t)t.attributes=e.getAttributes();else{const s=e.getGeometry(this.spatialReference,h);t=new na.Om(s,e.getAttributes(),null,e.id),s||(t.centroid=e.getGeometricCentroid(this.spatialReference,h)),t.displayId=this._attributeStore.createDisplayIdForObjectId(`${t.objectId}.${c}`),n.set(e.id,t)}a.push(t)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=Ha.K.fromOptimizedFeatures(a,this._metadata,h),u=l.getCursor(),d=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;u.next();)this._attributeStore.setAttributeData(u.getDisplayId(),u,d,this._sqlOptions);const p=new ga(e.subscription,l,[],e.done,{});yield p}}var Za=s(75538),Qa=s(68974);class Ja{constructor(e,t){this.inner=e,this.displayId=t}}class Ka extends pa{constructor(e){super(e),this.didSend=!1,this.done=!1}}class eh{constructor(e,t,s,i,r){this._level=e,this._scale=t,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 e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const t=e.inner.getCentroid(null),s=new na.Om(t,e.inner.getAttributes(),null,e.inner.id,e.displayId);yield s}}clusters(){return this._clusters.values()}updateChunks(e,t){let s=!1;for(const t of e){const e=t.queryInfo;"tileId"in e&&new b.A(e.tileId).level!==this._level||this._handledChunks.has(t.normalizedChunkId)||(this._handledChunks.add(t.normalizedChunkId),s=!0,t.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells))}const i={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},r=(0,Qa.p)(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:e}of t){const t=e.tile.bounds,s=Math.floor(t[0]*r/n),o=Math.floor(t[1]*r/n),a=Math.ceil(t[2]*r/n),h=Math.ceil(t[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(e){let t=!1;for(const e of this._clusters.values())e.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,e.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map(([e,t])=>({fieldName:e,minValue:t.minValue,maxValue:t.maxValue}));await e.container.updateStatistics(this._level,t)}}createAggregateFeatures(e,t){const s=e.subscription,i=[],r=s.tile.transform;for(const e of this._clusters.values()){let t=e.inner.getCentroidX(r);const n=e.inner.getCentroidY(r),o=s.tile.lod,a=o.wrap?o.worldSize[0]:null,h=1===e.inner.count?e.inner.firstObjectId:e.inner.id,c=e.displayId;if(null!=a)if(1===a){const s=new Sr.A([],[t,n]),r=new na.Om(s,e.inner.getAttributes(),null,h,c);r.geometry.coords[0]-=p.CQ,i.push(r);const o=new Sr.A([],[t,n]),a=new na.Om(o,e.inner.getAttributes(),null,h,c);a.geometry.coords[0]+=p.CQ,i.push(a)}else t>p.CQ+p.CQ/2?t-=a*p.CQ:t<-256&&(t+=a*p.CQ);if(t<p.CQ+128&&t>=-128&&n<p.CQ+128&&n>=-128){const s=new Sr.A([],[t,n]),r=new na.Om(s,e.inner.getAttributes(),null,h,c);i.push(r)}}return Ha.K.fromOptimizedFeatures(i,t,s.tile.transform)}_clusterCells(e){let t=Array.from(this._cells.values());t=t.sort((e,t)=>t.count-e.count);const s=[];for(const e of this._clusters.values())s.push(e.inner.id);this._clusters.clear();const i=this._clusterRadius*(1/(0,Qa.p)(this._indexOptions.spatialReference,this._scale)),r=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const s of t){if(n.has(s.id))continue;if(s.gridX<e.xMin||s.gridX>e.xMax||s.gridY<e.yMin||s.gridY>e.yMax)continue;const t=this._store.createDisplayIdForObjectId(s.id),o=new Ja(s.clone(),t);n.add(s.id),this._clusters.set(s.id,o);const a=s.centroidXWorld,h=s.centroidYWorld;for(let e=s.gridY-r;e<=s.gridY+r;e++)for(let t=s.gridX-r;t<=s.gridX+r;t++){if(e===s.gridY&&t===s.gridX)continue;const r=this._cells.get(Za.L.createId(t,e));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 e of s)this._store.releaseDisplayIdForObjectId(e)}_updateAggregateStatistics(e,t){let s=!1;for(const i of t.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const t=i.value,r=i.field,n=e.get(r.name);if(n){const{minValue:e,maxValue:i}=n,r=Math.min(n.minValue,t),o=Math.max(n.maxValue,t);e===r&&i===o||(n.minValue=r,n.maxValue=o,s=!0);continue}e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class th extends _a{static async create(e,t,s,i,r,n,o,a){const h=s.metadata.outSpatialReference,c=new Na({spatialReference:h}),l={type:"grid",fields:await Promise.all(t.fields.map(async e=>ha.create(c,e))),spatialReference:h,featureFilter:t.featureFilter?await Va.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:h,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,arcadeContextInfo:r,sqlOptions:n};return new th(e,t.clusterRadius,l,t.fields,s,i,n,o,a)}constructor(e,t,s,i,r,n,o,a,h){super(r,n,s.spatialReference,s.fields,o),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._requiredLevel=a,this._requiredScale=h,this._cellsPerScale=new Map,this._metadata=Ya.i.createFeature({geometryType:"esriGeometryPoint",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new aa.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 e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}updateRequiredLevel(e,t){this._requiredLevel=e,this._requiredScale=t}createState(e){return new Ka(e)}async*applyOverrideUpdate(e){for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear();for(const e of this._sendStates.values())e.done=!1}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const e of n.clusters()){const t=i.get(e.inner.id);if(null!=t){const n=s(e.displayId,t,e.inner.id);r.push(n),i.delete(e.inner.id);continue}if(1===e.inner.count){const{firstObjectId:t}=e.inner,n=t?i.get(t):null;if(null!=n){const o=s(e.displayId,n,t);r.push(o),i.delete(t)}}}return r}getDisplayFeatures(e){const t=new Set(e),s=new Set,i=[],r=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const e of n.aggregatesWorldSpace())if(t.has(e.displayId)&&!s.has(e.displayId)){const t=(0,Jn.oN)(e,this._metadata.geometryType,!1,!1);if(s.add(e.displayId),1===t.attributes.cluster_count){i.push({...t,displayId:e.displayId});continue}r.push({...t,displayId:e.displayId})}return{features:i,aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.clusters())if(s.inner.id===e)return Array.from(s.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale),s=Array.from(this._sendStates.values()).filter(e=>e.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,s)||!this._source.updateTracking.updating)for(const e of s)e.subscription.tile.level===this._requiredLevel&&(e.didSend=!1,e.done=!1);const i=Array.from(this._sendStates.values()).filter(e=>e.done).map(e=>e.subscription.tile.key),r=new Set(i);for(const e of this._sendStates.values()){if(this._source.updateTracking.updating){if(i.some(t=>t.containsChild(e.subscription.tile.key)))continue;if(e.subscription.tile.key.getChildKeys().every(e=>r.has(e)))continue}e.didSend||e.subscription.tile.level!==this._requiredLevel||(e.didSend=!0,yield*this._update(e,t,this._source))}await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(null==this._requiredLevel||null==this._requiredScale)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.aggregatesWorldSpace())e(s)}_getClusterState(e,t){if(null==e||null==t)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(t);return s||(s=new eh(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,s)),s}async*_update(e,t,s){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!s.updateTracking.updating;const r=i.getCursor(),n=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.arcadeContextInfo);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,n,this._sqlOptions);const o=new ma(e.subscription,i,!0,e.done,{});yield o}}var sh=s(5162),ih=s(9012);class rh extends pa{}class nh extends fa{constructor(e,t,s,i){super(e,t,i),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(e){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=e,null!=this._evalOptions&&(this._evalOptions=(0,ih.N)(this._evalOptions.$view.scale,e))}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(e){return new rh(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[];for(const e of this._source.chunks()){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId(),n=t.getDisplayId(),o=i.get(e);if(null!=o){const t=s(n,o,e);r.push(t),i.delete(e)}}}return r}getDisplayFeatures(e){const t=new Set(e),s=new Set,i=[];for(const e of this._source.chunks()){const r=e.reader.getCursor();for(;r.next();){const e=r.getObjectId(),n=r.getDisplayId();t.has(n)&&!s.has(e)&&(i.push({...r.readLegacyFeatureWorldSpace(),displayId:n}),s.add(e))}}return{features:i,aggregates:[],tracks:[]}}async*applyOverrideUpdate(e){const t=[];for(const s of e.modified.values()){const e=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=e,t.push(e)}const s=Ha.K.fromOptimizedFeatures(Array.from(e.modified.values()),this._source.metadata).getCursor();for(;s.next();)this._attributeStore.setAttributeData(s.getDisplayId(),s,this._evalOptions,this._sqlOptions);const i=[];for(const t of e.removed){const e=this._attributeStore.getDisplayIdForObjectId(t);null!=e&&i.push(e)}(0,n.A)("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:e,modifiedDisplayIds:t,removedDisplayIds:i});const r=sh.KN.fromFeatures(Array.from(e.modified.values()),this._source.metadata);this.handledChunks.add(r.chunkId),this.handledChunksForAttributeData.add(r.chunkId),this.handledChunksForIdCreation.add(r.chunkId);for(const e of this._sendStates.values())e.handledChunks.add(r.chunkId),yield new ga(e.subscription,null,t,!1,r.queryInfo);for(const e of this._sendStates.values()){const t=r.getTileReader(e.subscription.tile);yield new ga(e.subscription,t,i,!1,r.queryInfo)}for(const t of e.removed)this._attributeStore.releaseDisplayIdForObjectId(t)}async*updateChunks(){if(this._source.chunks().length){this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}_updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(this._attributeStore.referencesScale()||!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions,this._sqlOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const i of this._source.chunks()){const{chunkId:r}=i;if(s.has(r)||!this.handledChunksForIdCreation.has(r)||!this.handledChunksForAttributeData.has(r))continue;s.add(r);const n=i.getTileReader(t.tile);n&&(yield new ma(e.subscription,n,!1,i.end,i.queryInfo))}}}var oh=s(77085),ah=s(5808),hh=s(17136),ch=s(89056),lh=s(92029),uh=s(52350);let dh;class ph{constructor(e,t,s,i,r){this.chunkIndex=e,this.featureIndex=t,this.objectId=s,this.displayId=i,this.time=r}}class fh{static getOid(e){return re.xq+e}constructor(e,t,s,i,r,n,o,a){this._schema=e,this.trackId=t,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 Sr.A}get _trackLineAttributes(){const e={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[re.EA]:0};if(null!=this._statistics)for(const t of this._statistics.values())e[t.field.name]=t.value;return e}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let e=0;e<this._observationRecords.length-1;e++)yield this._observationRecords[e]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(e,t){this._nextObservationRecords.push(new ph(e,t.getIndex(),t.getObjectId(),t.getDisplayId(),null!=this._startTimeField?t.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(e,t,s){const i=new Set(this._nextObservationRecords.map(e=>e.objectId)),r=this._observationRecords.filter(e=>!i.has(e.objectId)).map(e=>e.objectId);let n,o;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((e,t)=>{const s=e.time,i=t.time;return null!=s&&null!=i?s-i:0}),this._schema.timeField){case"startTimeField":n=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":n=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":n=this._isStream?re.Aw:null}o=this._isStream?s?.end??Date.now():s?.end??-1/0;const a=t.map(e=>e.reader.getCursor());let h;for(let e=this._nextObservationRecords.length-1;e>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);e--){const t=this._nextObservationRecords[e],s=a[t.chunkIndex];(0,_.Lw)(s),s.setIndex(t.featureIndex);const i=null!=n?s.readAttributeAsTimestamp(n):null;(null!=i?o-i:0)>=this._maxDisplayDuration||(this._commitObservation(t,s),h??=t)}if(null!=h){const{chunkIndex:t,featureIndex:s}=h,i=`${h.objectId}.latest`,n=e.createDisplayIdForObjectId(i),o=a[t];(0,_.Lw)(o),o.setIndex(s);const c=new na.Om(o.readGeometryWorldSpace(),{...o.readAttributes(),[re.EA]:1},null,i,n);this._latestObservationFeature&&r.push(this._latestObservationFeature.objectId),this._latestObservationFeature=c,this._latestObservationRecord=h}else this._latestObservationFeature=null;return this._trackLineGeometry=function(e,t){if(e.length<2)return(0,Jn.Ap)({paths:[e]},!1,!1);if(t.isWrappable){let s=!1;for(let i=1;i<e.length;i++){const r=e[i][0],n=(0,hh.O7)(r,e[i-1][0],t);r!==n&&(e[i][0]=n,s=!0)}if(s){const s=(0,ch.b3)({paths:[e],spatialReference:t});if(null!=s)return(0,Jn.Ap)({paths:s.paths},!1,!1)}return(0,Jn.Ap)({paths:[e]},!1,!1)}const s=dh.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[e]}),i=dh.fromSpatialReference(t);if(null!=i){const e=(0,oh.g7)(s,1e6,i,ah.O.geodesic);if(null!=e){const t=dh.toGeometry(e,i);if(null!=t&&"paths"in t)return(0,Jn.Ap)({paths:t.paths},!1,!1)}}return(0,Jn.Ap)({paths:[e]},!1,!1)}(this._trackLinePath,this._spatialReference),this._bounds=function(e){const{lengths:t,coords:s}=e;if(!t.length)return[(0,Y.Ie)()];const i=[];let r=0;for(let e=0;e<t.length;e++){const n=t[e],o=(0,Y.Ie)();i.push(o);for(let e=0;e<n;e++){const t=s[2*(e+r)],i=s[2*(e+r)+1];(0,Y.tK)(o,[t,i])}r+=n}return i}(this._trackLineGeometry),this._nextObservationRecords=[],r}updateStatistics(e,t){this._statistics=lh.o.create(this._fields);const s=e.map(e=>e.reader.getCursor());for(const{chunkIndex:e,featureIndex:i}of this._observationRecords){const r=s[e];(0,_.Lw)(r),r.setIndex(i),this._statistics.insert(r,t)}}overlapsTile(e){for(const t of this._bounds)if((0,Y.$9)(t,e.bounds,32))return!0;return!1}getLatestObservationFeatureForTile(e){if(null==this._latestObservationFeature)return null;const{objectId:t,displayId:s,geometry:i,attributes:r}=this._latestObservationFeature,n=(0,Jn.Nl)(i,this._metadata.geometryType,e.subscription.tile.transform)??new Sr.A,o=(0,Y.fA)(1/0,1/0,-1/0,-1/0);return function(e,t){const{coords:s,lengths:i}=e;if(!i.length)return void t(s[0],s[1]);let r=0;for(let e=0;e<i.length;e++){const n=i[e];let o=0,a=0;for(let e=0;e<n;e++)o+=s[2*(e+r)],a+=s[2*(e+r)+1],t(o,a);r+=n}}(n,(e,t)=>(0,Y.tK)(o,[e,t])),(0,Y.HY)(o,(0,Y.fA)(0,0,p.CQ,p.CQ))?new na.Om(n,r,null,t,s):null}getTrackLineFeatureForTile(e){const t=(0,Jn.Nl)(this._trackLineGeometry,"esriGeometryPolyline",e.subscription.tile.transform)??new Sr.A;return new na.Om(t,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new na.Om(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:e,_trackLineAttributes:t,displayId:s}=this;return{geometry:(0,Jn.zv)(e,"esriGeometryPolyline",!1,!1),attributes:t,displayId:s}}_commitObservation(e,t){const s=t.readCentroidWorldSpace();let i=s?.coords[0],r=s?.coords[1];null==s&&(i=t.readXWorldSpace(),r=t.readYWorldSpace()),null!=i&&null!=r&&(this._observationRecords.unshift(e),this._trackLinePath.unshift([i,r]))}}class _h extends pa{constructor(e){super(e),this.done=!1}}class mh extends _a{static async create(e,t,i,r,n){const o=t.metadata.outSpatialReference,a=new Na({spatialReference:o}),h=await Promise.all(e.fields.map(async e=>ha.create(a,e))),c=e.featureFilter?await Va.create({geometryType:t.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:t.metadata.timeInfo,fieldsIndex:t.metadata.fieldsIndex,spatialReference:o,filterJSON:e.featureFilter}):null;return o.isWrappable||(0,oh.s1)()||await Promise.all([Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299),s.e(8125)]).then(s.bind(s,78125)),Promise.all([s.e(3661),s.e(1878),s.e(8885),s.e(5756),s.e(3299)]).then(s.bind(s,83299)),(0,oh.Hh)()]).then(([e,t,s])=>{dh={fromGeometryToGXGeometry:t.fromGeometryToGXGeometry,toGeometry:t.toGeometry,fromSpatialReference:e.fromSpatialReference}}),new mh(e,t,i,o,h,c,r,n)}constructor(e,t,s,i,r,n,o,a){super(t,s,i,r,a),this._schema=e,this._featureFilter=n,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=t.metadata.weakCloneWithAdditionalFields([{name:re.EA,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=Ya.i.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:re.EA,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:t.metadata.spatialReference,outSpatialReference:t.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:t.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null,hasZ:!1,hasM:!1})}destroy(){super.destroy(),this._clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){super.invalidate(),this._clear()}createState(e){return new _h(e)}async*applyOverrideUpdate(e){Lt.A.getLogger("esri.views.2d.layers.features.processor.TrackStrategy").error("Applying override to tracks is not supported")}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[];for(const e of this._tracks.values()){const t=i.get(e.objectId);if(null!=t){const n=s(e.displayId,t,e.objectId);r.push(n),i.delete(e.objectId);continue}const n=e.latestObservationFeature;if(n?.objectId){const e=i.get(n.objectId);if(null!=e){const t=s(n.displayId,e,n.objectId);r.push(t),i.delete(n.objectId);continue}}for(const t of e.observations()){const e=i.get(t.objectId);if(null!=e){const n=s(t.displayId,e,t.objectId);r.push(n),i.delete(t.objectId)}}}return r}getDisplayFeatures(e){const t=new Set(e),s=[],i=[],r=this._source.chunks().map(e=>e.reader.getCursor());for(const e of this._tracks.values()){if(t.has(e.displayId)&&i.push(e.getTrackLineDisplayFeature()),null!=e.latestObservationFeature&&t.has(e.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:i,featureIndex:n}=e.latestObservationRecord,o=r[i];o.setIndex(n),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:i,chunkIndex:n,featureIndex:o}of e.observations())if(t.has(i)){const e=r[n];e.setIndex(o),s.push({displayId:i,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:i}}getFeatureObjectIdsForAggregate(e){for(const t of this._tracks.values())if(t.objectId===e)return Array.from(t.observations(),e=>e.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const e of this._sendStates.values())yield*this._update(e)}forEachAggregateWorldSpace(e){for(const t of this._tracks.values())e(t.getTrackLineOptimizedFeature())}_clear(){for(const e of this._source.chunks())if(this._handledChunks.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(e)}}this._handledChunks.clear();for(const e of this._tracks.values())this._removeTrack(e);this._tracks.clear()}_rebuildTracks(){const e=this._source.chunks();if(!e.length)return;const t=this._metadata.timeInfo?.trackIdField;if(null==t)return;const s=new Set;for(let i=0;i<e.length;i++){const r=e[i];if(this._handledChunks.has(r.chunkId))continue;this._handledChunks.add(r.chunkId);const n=r.reader.getCursor();for(;n.next();){const e=n.getObjectId();n.setDisplayId(this._attributeStore.createDisplayIdForObjectId(e));const r=n.readAttribute(t);if(null!=r&&null!=e&&(null===this._featureFilter||this._featureFilter.check(n,this._sqlOptions))){if(!this._tracks.has(r)){const e=fh.getOid(r),t=this._attributeStore.createDisplayIdForObjectId(e),s=new fh(this._schema,r,e,t,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(r,s)}this._tracks.get(r).stageObservation(i,n),s.add(r)}}}for(const t of this._tracks.values())if(s.has(t.trackId)){const s=t.commitObservations(this._attributeStore,e,this._featureFilter?.timeExtent);for(const e of s)this._attributeStore.releaseDisplayIdForObjectId(e);t.updateStatistics(e,(0,ih.N)(1,this._arcadeContextInfo))}else this._removeTrack(t)}_removeTrack(e){this._tracks.delete(e.trackId),this._attributeStore.releaseDisplayIdForObjectId(e.objectId),null!=e.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(e.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const t=[],s=[];for(const i of this._tracks.values())if(i.length>0){if(this._schema.showLatestObservation){const s=i.getLatestObservationFeatureForTile(e);null!=s&&t.push(s)}this._schema.showTrackLine&&i.overlapsTile(e.subscription.tile)&&s.push(i.getTrackLineFeatureForTile(e))}const i=Ha.K.fromOptimizedFeatures(t,this._metadata,e.subscription.tile.transform),r=Ha.K.fromOptimizedFeatures(s,this._trackLineMetadata,e.subscription.tile.transform);let n=[];if(this._schema.showPreviousObservations){const t=this._source.chunks().map(()=>[]);for(const e of this._tracks.values())for(const{chunkIndex:s,featureIndex:i}of e.previousObservations())t[s].push(i);n=this._source.chunks().map((s,i)=>{const r=s.getTileReader(e.subscription.tile);if(null==r)return null;const n=uh.e.from(r,t[i]);return n.setProcessorAttributes({[re.EA]:2}),"esriGeometryPoint"!==n.geometryType&&null!=n.getInTransform()||n.setTransformForDisplay(e.subscription.tile.transform),n}).filter(jo.Ru)}this.events.emit("changed");const o=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),a=r.getCursor();for(;a.next();)this._attributeStore.setAttributeData(a.getDisplayId(),a,o,this._sqlOptions);for(const e of n){const t=e.getCursor();for(;t.next();)this._attributeStore.setAttributeData(t.getDisplayId(),t,o,this._sqlOptions)}const h=i.getCursor();for(;h.next();)this._attributeStore.setAttributeData(h.getDisplayId(),h,o,this._sqlOptions);yield new ma(e.subscription,r,!1,!1,{});for(const t of n)yield new ma(e.subscription,t,!1,!1,{});yield new ma(e.subscription,i,!1,e.done,{})}}new Map;var gh=s(69397);class yh{constructor(e){this.data=e,this._referenceCount=0}static{this.estimatedMemory=20}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return 0===this._referenceCount}}class xh{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}get usedMemory(){let e=0;return e+=(0,gh.Qf)(this._freeIdsGenerationA),e+=(0,gh.Qf)(this._freeIdsGenerationB),e+=this._objectIdToDisplayId.size*(yh.estimatedMemory+8),e}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new yh(function(e){return(0|e)>>>0}(this._getFreeId())),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return null!=t?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.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 bh=()=>Lt.A.getLogger("esri.views.layers.2d.features.support.AttributeStore"),wh=(bh(),()=>null),vh=(0,n.A)("esri-shared-array-buffer");(0,n.A)("esri-atomics");class Sh{constructor(e,t,s){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:i,layout:r,textureOnly:n}=t;this.textureOnly=n||!1,this.pixelType=i,this.layout=r,this._resetRange(),this.size=e,this.isLocal=s,n||(this.data=this._initData(i,e))}get usedMemory(){return this.data?.byteLength??0}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const s=this.data;for(let i=0;i<this.size*this.size;i++)s[i*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){const s=this.data;for(let i=0;i<this.size*this.size;i++)s[i*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,s){const i=this.data;for(const r of s)i[r*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(e,t,s){this.data[s*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}unsetComponentTexel(e,t,s){this.data[s*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}getData(e,t){const s=xa(e);return this.data[s*this.texelSize+t]}setData(e,t,s){const i=xa(e),r=1<<t;0!==(this.layout&r)?null!=this.data&&(this.data[i*this.texelSize+t]=s,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)):bh().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(e){if(this.size=e,!this.textureOnly){const t=this._initData(this.pixelType,e),s=this.data;t.set(s),this.data=t}}toMessage(){const e=this.dirtyStart,t=this.dirtyEnd,s=this.texelSize;if(e>t)return null;this._resetRange();const i=!this.isLocal,r=this.pixelType,n=this.layout,o=this.data;return{start:e,end:t,data:i&&o.slice(e*s,(t+1)*s)||null,pixelType:r,layout:n}}_initData(e,t){const s=ArrayBuffer,r=function(e){switch(e){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 Lt.A.getLogger("esri.views.2d.engine.webgl.Utils").error(new i.A("webgl-utils",`Unable to handle type ${e}`))}}(e),n=new r(new s(t*t*4*r.BYTES_PER_ELEMENT));for(let e=0;e<n.length;e+=4)n[e+1]=255;return n}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class Ih{constructor(e){this._client=e,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=p.TB,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new xh,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const e=bi.ld.FLOAT;wh(`Creating AttributeStore ${vh?"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:e,layout:15},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:e,layout:15},{pixelType:bi.ld.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get usedMemory(){let e=0;for(const t of this._blocks)t&&(e+=t.usedMemory);return e+=this._idGenerator.usedMemory,e}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(e){return this._arcadeDependencies.has(e)}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,s,i=0){const r=(0,g.Ui)(this._schema,e);if(this.version=i,r&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStore.update`,{changed:r}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),null!=e))if(s&&(this._filters=await Promise.all(e.filters.map(e=>e?Va.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:e}):null))),"multi"!==e.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(e.bindings.map(async e=>{const s=await this._bind(t,e);this._updateReferences(s)}));else{this._attributeComputeInfo={type:"multi",keyField:e.keyField,map:new Map};for(const s in e.bindings){const i=e.bindings[s];await Promise.all(i.map(async e=>{const i=await this._bind(t,e,parseInt(s,10));this._updateReferences(i)}))}}}setHighlight(e,t){let s=null;0===e.length&&0===t.length&&(s=this._getBlock(0),s.unsetComponentAllTexels(0,(1<<p.U5)-1));for(const{displayId:t,highlightFlags:i}of e){if(null==t||-1===t)continue;s||(s=this._getBlock(0),s.unsetComponentAllTexels(0,(1<<p.U5)-1));const e=xa(t);s.setComponent(0,i,[e])}this._idsToHighlight.clear();for(const{objectId:t,highlightFlags:s}of e)this._idsToHighlight.set(t,s);for(const{objectId:e,highlightFlags:s}of t)this._idsToHighlight.set(e,s)}setData(e,t,s,i){const r=xa(e);this._ensureSizeForTexel(r),this._getBlock(t).setData(e,s,i)}getData(e,t,s){return this._getBlock(t).getData(e,s)}getHighlightFlags(e){return this._idsToHighlight.get(e)||0}unsetAttributeData(e){const t=xa(e);this._getBlock(0).setData(t,0,0)}referencesScale(){const e=this._attributeComputeInfo;if(!e)return!1;if("multi"===e.type){for(const t of e.map.values())for(const{field:e}of t.values())if(e?.hasArcadeDependency("scale"))return!0}else for(const{field:t}of e.map.values())if(t?.hasArcadeDependency("scale"))return!0;return!1}setAttributeData(e,t,s,i){const r=xa(e);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(t,i));const n=this._attributeComputeInfo;let o=null;n&&(o="multi"===n.type?n.map.get(t.readAttribute(n.keyField)):n.map,o?.size&&o.forEach((e,i)=>{const n=1*i%4,o=Math.floor(1*i/4),a=this._getBlock(o+3);let h=e.field?.read(t,s);e.valueRepresentation&&(h=function(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}(h,e.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 e=this._blocks.map(e=>null!=e?e.toMessage():null),t=this._getInitArgs();(0,n.A)("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,(0,n.A)("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,s){const i=await e.createComputedField(t),{valueRepresentation:r}=t,n=this._attributeComputeInfo;if("multi"===n.type){const e=n.map.get(s)??new Map;e.set(t.binding,{field:i,valueRepresentation:r}),n.map.set(s,e)}else n.map.set(t.binding,{field:i,valueRepresentation:r});return i}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(1),this._getBlock(2),this._getBlock(7),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>null!=e?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(null!=t)return t;wh(`Initializing AttributeBlock at index ${e}`);const s=new Sh(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=s,this._initialized=!1,s}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const e=this._size<<=1;wh("Expanding block size to",e,this._blocks);for(const t of this._blocks)t?.expand(e);return this._initialized=!1,this._size=e,0}return bh().error(new i.A("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(e){(0,Uo.QY)(this._arcadeDependencies,e)}isVisible(e){return!!(this._getBlock(0).getData(e,0)&1<<p.U5)}getFilterFlags(e,t){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(e,t)?1:0)<<i}let i=0;if(this._idsToHighlight.size){const t=e.getObjectId();i=this.getHighlightFlags(t)}return s<<p.U5|i}}class Ph{constructor(e,t,s,i){this._connection=e,this._source=t,this._requiredLevel=s,this._requiredScale=i,this._version=1,this._registry=new ta,this._proxy=new ye({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new Ih({isLocal:!1,update:e=>(0,u.oV)(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get hasClusters(){return"cluster"===this._schema?.mesh.strategy.type}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get usedMemory(){let e=0;return e+=this._attributeStore.usedMemory,this._strategy&&(e+=this._strategy.usedMemory),e}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,i)=>{t[i]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}updateRequiredLevel(e,t){this._strategy?.updateRequiredLevel(e,t),this._requiredLevel=e,this._requiredScale=t}async update(e,t,s,i,r){const o=e.processor,a=(0,m.i8)(this._schema?.storage,o.storage),h=(0,m.i8)(this._schema?.mesh.properties,o.mesh.properties),c=(0,m.i8)(this._schema?.mesh.factory,o.mesh.factory),l=(0,m.i8)(this._schema?.mesh.strategy,o.mesh.strategy),u=function(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}(this._schema?.expressionProperties,o.expressionProperties),d=u.some(e=>this._attributeStore.hasArcadeDependency(e)),p=u.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=u.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&d,_=p||f,y=h||c||l;if(!(a||y||p||d||f||i))return!1;(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:(0,g.Ui)(this._schema,o),schema:o}),this._schema=o;const x=new Na({fields:this._source.metadata.fieldsIndex,spatialReference:this._source.metadata.outSpatialReference}),b={currentUser:o.mesh.properties.currentUser};if((a||y||d)&&(await this._attributeStore.update(o.storage,x,this._source.metadata,t),this._strategy?.invalidateAttributeData(Mh(o))),!i&&!y&&!_)return!1;(l||h||_)&&await this._updateStrategy(o.mesh.strategy,r,Mh(o),b),this._updateSortKey(x,"sortKey"in o.mesh.properties?o.mesh.properties.sortKey:null);const w="dictionary"===o.mesh.factory.symbology.type?o.mesh.factory.symbology.fieldMap:null,v=new sa(x,this._proxy,s,this._registry,w);return(c||"dictionary"===o.mesh.factory.symbology.type)&&(this._factory=await _e.create(v,o.mesh.factory)),this._version=t,!0}async applyOverrideUpdate(e,t){if(!this._strategy)return;const s=this._strategy.applyOverrideUpdate(e);for await(const e of s)try{await this._process(e,t)}catch(e){}}async updateChunks(e){await this._doUpdateChunks(e),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(e){if(!this._strategy)return;const t=this._strategy.updateChunks(),s=[],i=new Map;for await(const r of t){let t=i.get(r.id);null==t&&(t=new ra({concurrency:16,process:t=>this._process(t,e)}),i.set(r.id,t));const n=t.push(r).catch(e=>(0,a.jH)(e));s.push(n)}try{await Promise.all(s)}catch(e){}(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(e,t,s,i){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new nh(this._source,this._attributeStore,s,i);break;case"binning":this._strategy=await $a.create(e,this._source,this._attributeStore,s,i);break;case"cluster":this._strategy=await th.create(this._connection,e,this._source,this._attributeStore,s,i,this._requiredLevel,this._requiredScale);break;case"track":this._strategy=await mh.create(e,this._source,this._attributeStore,s,i)}for(const e of t)this._strategy.onSubscribe(e)}async _updateSortKey(e,t){if(this._sortInfo=(0,_.pR)(this._sortInfo?.computed),null!=t){const s=t.byRenderer?null:await e.createComputedField(t);this._sortInfo={...t,computed:s}}}async _process(e,t){const s=e.subscription;if((0,n.A)("esri-2d-update-debug")){const t=s.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${e.end}] Processor._process`)}const i={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(e,i),(0,a.Te)(s.signal);const r=await this._write(e,s.tile.createArcadeEvaluationOptions(Mh(this._schema)),i,t),o=s.tile.tileInfoView.getLODInfoAt(s.tile.key);(0,a.Te)(s.signal);const{message:h,transferList:c}=r.serialize(o),l={objectIdMap:null,inner:e.createMessage(h,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){l.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)l.objectIdMap[t.getDisplayId()]=t.getObjectId()}if((0,a.Te)(s.signal),await this._connection.container.onMessage(l,{signal:s.signal,transferList:c}),this._attributeStore.sendUpdates(),(0,n.A)("esri-2d-update-debug")){const t=s.tile;console.debug(`Version[${this._version}] Tile[${t.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),i=e.subscription.tile.createArcadeEvaluationOptions(Mh(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,i,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,s,i){const r=e.subscription.tile,n=e.reader?.getCursor(),o=n?.getSize()??0,h=r.tileInfoView.tileInfo.isWrappable,c=r.tileInfoView.spatialReference.isWGS84,l=new se(r.key,this._strategy.enablePixelBuffering,h,c,o);if(!n)return l;const u=function(e,t){const s=(0,y.Q1)(e),i=[];for(const e of t.rings){const t=[];for(const i of e)t.push([(0,y.IE)(s,i[0]),(0,y.B2)(s,i[1])]);i.push(t)}return{rings:i}}(r.transform,i),d=r.createArcadeEvaluationOptions(Mh(this._schema));let p=0;for(;n.next();){++p%1e3||(await(0,a.Pl)(0),(0,a.Te)(e.subscription));const i=this._getSortKeyValue(n,t);l.entityStart(n.getDisplayId(),i);try{this._factory.write(l,this._proxy,n,d,s,r.level,u)}catch(e){}l.entityEnd()}return l}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:i,byRenderer:r}=this._sortInfo,n=r?this._factory.getSortKey(e,t):s?.read(e,t);return null==n||isNaN(n)?0:n*("asc"===i?-1:1)}}function Mh(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}class kh{static from(e){let t=0,s=0,i=0;return e.forEach(e=>{const r=e._readGeometry();r&&(s+=r.isPoint?1:r.lengths.reduce((e,t)=>e+t,0),i+=r.isPoint?1:r.lengths.length,t+=1)}),new kh(t,s,i)}constructor(e,t,s){this.featureCount=e,this.vertexCount=t,this.ringCount=s}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}}let Ch=class extends E.A{constructor(e){super(),this._connection=e,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",e=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:e})},{initial:!0}),(0,c.wB)(()=>this._strategy?.errorString||null,e=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:e}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(e){null==this._strategy&&this._resetUpdateInfo(performance.now());const t="event-handles";this.removeHandles(t),null!=e&&(this.addHandles([e.events.on("data-received",e=>this._onFeature(e)),e.events.on("message-received",e=>this._onWebSocketMessage(e)),e.events.on("features-updated",e=>this._onUpdate(e)),e.events.on("tick",()=>this._onTick())],t),this._queuedCommands.forEach(t=>t(e)),this._queuedCommands=[]),this._strategy=e}updateCustomParameters(e){null!=e&&this._callOrEnqueue(t=>t.updateCustomParameters(e))}sendMessageToSocket(e){this._callOrEnqueue(t=>t.sendMessageToSocket(e))}sendMessageToClient(e){this._callOrEnqueue(t=>t.sendMessageToClient(e))}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(e){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:e})}_onFeature(e){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}})}_onUpdate(e){this._updateInfo.client+=e}_onTick(){const e=performance.now(),t=e-this._lastTime;if(t>2500){const s=Math.round(this._updateInfo.client/(t/1e3)),i=Math.round(this._updateInfo.websocket/(t/1e3));this._resetUpdateInfo(e),this._layerView.emitEvent({name:"update-rate",event:{client:s,websocket:i}})}}_resetUpdateInfo(e){this._lastTime=e,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(e){null!=this._strategy?e(this._strategy):this._queuedCommands.push(e)}};(0,z.Cg)([(0,L.MZ)()],Ch.prototype,"_strategy",void 0),Ch=(0,z.Cg)([(0,L.$K)("esri.views.2d.layers.features.sources.StreamMessenger")],Ch);class Ah{constructor(){this._requiresInvalidation=!1}get requiresInvalidation(){return this._requiresInvalidation}requireInvalidation(){this._requiresInvalidation=!0}}class Th{constructor(e,t,s){this._context=s,this._controller=new AbortController,this.metadata=Ya.i.createFeature(e),this._schema=t}destroy(){this._controller.abort(),this.store.destroy()}get store(){return this._context.store}get _connection(){return this._context.connection}get _options(){return{signal:this._controller.signal}}get _signal(){return this._controller.signal}async applyOverride(e){this._onOverride(),await this.store.applyOverride(e)}takeOverrideUpdate(){return this.store.takeOverrideUpdate()}unsafeSetQueryHistoricMoment(e){throw new Error("InternalError: LoadStrategy does not support query info")}async queryByObjectId(e,t){throw new Error("InternalError: LoadStrategy does not support fetching")}prepareCacheUpdate(e,t){}applyCacheUpdate(){return null}}var Fh=s(13069),zh=s(28923);class Eh{constructor(e,t,s,r){this.store=e,this.queryInfo=t,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 e=Array.from(this._nextBatch);this._nextBatch.clear(),e.length>8e3&&Lt.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 t=this.queryInfo.objectIdsQueryPageSize,s=Math.ceil(8e3/t),r=Math.min(s,Math.ceil(e.length/t)),n=Array.from({length:r},(s,i)=>{const r=i*t,n=Math.min(r+t,e.length);return{num:i,query:this.queryInfo.createObjectIdsQuery(e.slice(r,n))}});try{await async function(e,t,s,r={}){const n=(await Promise.allSettled(s.map(s=>async function(e,t,s,i={}){const r=`${e.chunkPrefix??""}${s.num}`,n=await e.fetch(s.query,i,{chunkId:r}),o=new zh.j(n,s.query.inner.toJSON(),s.num,!1);o.chunkId=o.normalizedChunkId=r,(0,a.Te)(i),t.insert(o)}(e,t,s,r)))).filter(e=>"rejected"===e.status).map(e=>e.reason);if(n.length)throw new i.A("featurelayer-query","Encountered errors when downloading data",{errors:n})}({chunkPrefix:"cache."+(0,Fh.lk)(),fetch:this._fetch},this.store,n,this._options)}catch(e){}})}prepareCacheUpdate(e,t){if(t)for(const e of t)this._nextBatch.delete(e);for(const t of e)this._nextBatch.add(t)}applyCacheUpdate(){return 0===this._nextBatch.size||this._options.signal?.aborted?null:this._fetchFeatures().catch(()=>{})}}var Oh=s(11254),Rh=s(41560),Lh=s(79677);class Dh{static create(e,t,s){const i=t.queryScaleRanges,r=t.displayFilterInfo;return new Dh(function(e,t,s){const i=function(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}(s.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===s.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,returnZ:t.returnZ,returnM:t.returnM,timeReferenceUnknownClient:s.timeReferenceUnknownClient??void 0,outSpatialReference:Ee.A.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[i],where:t.definitionExpression??"1=1",outFields:t.availableFields,multipatchOption:"esriGeometryMultiPatch"===s.serviceGeometryType?"xyFootprint":null,gdbVersion:t.gdbVersion,historicMoment:t.historicMoment?new Date(t.historicMoment):null,timeExtent:t.timeExtent?Lh.A.fromJSON(t.timeExtent):null}}(e,t,s),r,i,s.subtypeField,t.customParameters,s.geometryType,e.queryMetadata)}constructor(e,t,s,i,r,n,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=s,this._subtypeField=i,this._customParameters=r,this._geometryType=n,this._queryMetadata=o}getPageSize(e){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const t=this._queryMetadata.supportsMaxRecordCountFactor?4:null,s=((e?this._queryMetadata.tileMaxRecordCount:this._queryMetadata.maxRecordCount)??this._queryMetadata.maxRecordCount??2e3)*(t??1),i=(0,n.A)("featurelayer-query-max-page-size")??8e3;return Math.min(i,s)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,s){if(!t.getSize())return null;const i=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(i.outFields??[])[0])return null;i.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),s=[];for(const i of e)t.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 e=s.chunkId.toString().replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,chunkId:e}:{chunkId:e}}return r}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new ja.A({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const s=this.createQuery(t),i=s.inner;if(this._queryScaleRanges?.length){const t=this._queryScaleRanges.filter(t=>(!t.minScale||t.minScale>=e.maxScale)&&(!t.maxScale||t.maxScale<=e.minScale)).map(e=>e.subtypeCode);if(t.length){const e=`${this._subtypeField} IN (${t})`;i.where=(0,Sa.mA)(i.where,e)}}if(this._displayFilter&&(i.where=(0,Sa.mA)(i.where,(0,Rh.Ch)(this._displayFilter,e.minScale,e.maxScale))),i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.hydratedExtent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset=e.resolution*(0,n.A)("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(i.maxAllowableOffset=e.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 t=e.id.replaceAll("/",".");s.customParameters=s.customParameters?{...s.customParameters,tileId:t}:{tileId:t}}return s}createPagedTileQuery(e,t){const s=this.getPageSize(!0);return this.createTileQuery(e,{start:s*t,num:s,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const s=this.getPageSize(!1);return this.createQuery({start:s*e,num:s,returnExceededLimitFeatures:!0,maxRecordCountFactor:4,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}var qh=s(10382),Nh=s(75321),Gh=s(80893),Bh=s(51624),Wh=s(97633),jh=s(99996),Uh=s(53655);const Vh=268435455;class Yh{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.hasZ=!1,this.hasM=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.transform=null,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}get usedMemory(){let e=0;return e+=(0,gh.Qf)(this.idFieldIndices),e+=(0,gh.Qf)(this.offsets.attributes),e+=(0,gh.Qf)(this.offsets.geometry),e+=(0,gh.Qf)(this.centroid),this.displayIds&&(e+=(0,gh.Qf)(this.displayIds)),this.groupIds&&(e+=(0,gh.Qf)(this.groupIds)),e}get stride(){return 2+Number(this.hasZ)+Number(this.hasM)}}const Hh=128e3,Xh={small:{delta:new Int32Array(128),decoded:new Int32Array(128)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(Hh),decoded:new Int32Array(Hh)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function $h(e,t){return t?e<=Xh.small64.delta.length?Xh.small64:(e<=Xh.large64.delta.length||(Xh.large64.delta=new Float64Array(Math.round(1.25*e)),Xh.large64.decoded=new Float64Array(Math.round(1.25*e))),Xh.large64):e<=Xh.small.delta.length?Xh.small:(e<=Xh.large.delta.length||(Xh.large.delta=new Int32Array(Math.round(1.25*e)),Xh.large.decoded=new Int32Array(Math.round(1.25*e))),Xh.large)}function Zh(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function Qh(e,t,s,i,r){return!!e&&0===t*r-i*s&&t*i+s*r>0}class Jh extends jh.Y{static fromBuffer(e,t,s=!1){const r=t.geometryType,n=function(e){try{const t=new Bh.A(new Uint8Array(e),new DataView(e));for(;t.next();){if(2===t.tag())return Zh(t.getMessage());t.skip()}}catch(e){throw new i.A("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}return null}(e),o=function(e,t,s){const i=e.asUnsafe(),r=i.pos(),n=new Yh;let o=0,a=0,h=null;const c=[];for(;i.next();)switch(i.tag()){case 12:h=i.processMessage(Uh.ae);break;case 9:n.exceededTransferLimit=i.getBool();break;case 10:n.hasZ=i.getBool();break;case 11:n.hasM=i.getBool();break;case 13:{const e=i.processMessage(Uh.cn);e.index=o++,c.push(e);break}case 15:{const e=i.getPackedEnd(),s=n.offsets.geometry,r=n.centroid;s.push(0);const{stride:o}=n;for(r.push(Vh),r.push(Vh);i.pos()<e&&i.next();)switch(i.tag()){case 1:{n.offsets.attributes.push(i.pos());const e=i.getLength();i.skipLen(e);break}case 2:if(t){const e=i.getPackedEnd();for(;i.pos()<e&&i.next();)switch(i.tag()){case 3:{const e=i.getPackedEnd();let t=a*o;for(;i.pos()<e;)n.centroid[t++]=i.getSInt64();break}default:i.skip()}}else{n.offsets.geometry[a]=i.pos();const e=i.getLength();n.vertexCount+=e,i.skipLen(e)}break;case 4:{const e=i.getLength(),t=i.pos()+e;for(;i.pos()<t&&i.next();)switch(i.tag()){case 3:{const e=i.getPackedEnd();let t=a*o;for(;i.pos()<e;)n.centroid[t++]=i.getSInt64();break}default:i.skip()}break}default:i.skip()}a++,n.hasFeatures=!0;break}default:i.skip()}n.fields=new aa.A(c),n.featureCount=a,n.fieldCount=o;const l=function*(e){switch(e.type){case"object-id":case"unique-id-simple":return void(yield e.fieldName);case"unique-id-composite":return void(yield*e.fieldNames)}}(s);return n.idFieldIndices=Array.from(l,e=>n.fields.get(e)?.index),n.transform=h,n.displayIds=new Uint32Array(n.featureCount),n.groupIds=new Uint16Array(n.featureCount),i.move(r),n}(n,"esriGeometryPoint"===r,t.featureIdInfo);return new Jh(n,o,t,s)}constructor(e,t,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=e,this._header=t,this._hasNext=t.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 this._header.hasZ}get hasM(){return this._header.hasM}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(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Jh(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}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 gh.qK+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[this._featureIndex*this._header.stride]}_readY(){return this._header.centroid[this._featureIndex*this._header.stride+1]}_readServerCentroid(){const e=new Sr.A([],[],this.hasZ,this.hasM),{coords:t,stride:s}=e;for(let e=this._featureIndex*s,i=e+s;e<i;++e)t.push(this._header.centroid[e]);return 268435455===t[0]?null:e}_readGeometry(e=!1){if(void 0===this._cache.geometry){let t=null;if(this._isPoints)t=this._readServerCentroid();else{const s=this._header.offsets.geometry[this._featureIndex],i=this._reader;if(0===s)return null;i.move(s);try{t=e?this._parseGeometryForDisplay(i):this._parseGeometry(i)}catch(e){return null}}return 0===t?.coords.length&&(t=null),this._cache.geometry=t,t}return this._cache.geometry}_readAttribute(e,t){const s=this._header.fields.get(e);if(null==s)return;const i=this._readAttributeAtIndex(s.index),r=this._header.fields.isDateField(s.name);return t?null==i?i:r?new Date(i):i:i}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new Wh.P(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const s=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],i=this._reader;i.move(s);const r=function(e){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}(i);return t.set(this._featureIndex,r),r}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const s=$h(t.coords.length,this._use64Bit).decoded,i=t.clone(s),{lengths:r,coords:n,stride:o}=i;let a=0;for(const e of r){let t=n[a],s=n[a+1];a+=o;for(let i=1;i<e;++i)t=n[a]+=t,s=n[a+1]+=s,a+=o}return this._cache.unquantGeometry=i,i}return this._cache.unquantGeometry}_parseGeometry(e){const t=e.asUnsafe(),s=t.getPackedEnd(),i=[],r=[];for(;t.pos()<s&&t.next();)switch(t.tag()){case 2:{const e=t.getPackedEnd();for(;t.pos()<e;)r.push(t.getUInt32());break}case 3:{const e=t.getPackedEnd();for(;t.pos()<e;)i.push(t.getSInt64());break}default:t.skip()}return new Sr.A(r,i,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const t=e.asUnsafe(),s=t.getLength(),i=t.pos()+s,r=[],n=[];let o=0,a=0,h=null,c=0;const l="esriGeometryPolygon"===this.geometryType,u="esriGeometryPolyline"===this.geometryType,d=l?3:u?2:1,p=l||u;for(;t.pos()<i&&t.next();)switch(t.tag()){case 2:{const e=t.getUInt32(),s=t.pos()+e;for(;t.pos()<s;){const e=t.getUInt32();r.push(e),o+=e}h=$h(2*o,this._use64Bit).delta;break}case 3:{t.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);(0,_.Lw)(h);for(const s of r){if(a+e*s>h.length){for(let e=0;e<s;e++)t.getSInt64(),t.getSInt64(),this.hasZ&&t.getSInt64(),this.hasM&&t.getSInt64();continue}let i=t.getSInt64(),r=t.getSInt64();this.hasZ&&t.getSInt64(),this.hasM&&t.getSInt64(),h[a++]=i,h[a++]=r;let o=1;for(let e=1;e<s;e++){const e=t.getSInt64(),s=t.getSInt64();this.hasZ&&t.getSInt64(),this.hasM&&t.getSInt64();const n=i+e,l=r+s;c+=-.5*(n-i)*(l+r),i=n,r=l,0===e&&0===s||Qh(p,h[a-2],h[a-1],e,s)?(h[a-2]+=e,h[a-1]+=s):(h[a++]=e,h[a++]=s,o+=1)}o>=d?n.push(o):a-=o*e}break}default:t.skip()}return this._cache.area=c,n.length?new Sr.A(n,h,this.hasZ,this.hasM):null!=h?this._createDeltaQuantizedExtrudedGeometry(h[0],h[1]):null}}class Kh{constructor(e,t){this.service=e,this._metadata=t}destroy(){}}class ec extends Kh{constructor(e,t,s){super(e,t),this._ports=[],this._loaded=this._load(s)}destroy(){this._loaded.finally(()=>{this._client.close(),this._client=null;for(const e of this._ports)e.close()}).catch(()=>{})}async _load(e){this._ports=await e.layerView.openMemoryPorts(),this._client=await async function(e){const t=new qh.A;return await t.open(e,{}),t}(this._ports)}async executeQuery(e,t){await this._loaded;const s=await this._client.invoke("queryFeatures",e.toJSON(),t);return Ha.K.fromFeatureSet(s,this._metadata)}}class tc extends Kh{async executeQuery(e,t){const s=await(0,Gh.kS)(this.service.source,e,t),r=!e.quantizationParameters;try{return Jh.fromBuffer(s,this._metadata,r)}catch(s){const r=await(0,Gh.LT)(this.service.source,e,"pbf",t??{}),{data:{url:n}}=await(0,Oh.A)(r.url,{responseType:"native-request-init",...r.options});throw new i.A("featurelayer:query","Failed to parse response",{url:n,error:s,query:e.toJSON()})}}}class sc extends Kh{async executeQuery(e,t){const{source:s,queryMetadata:i}=this.service;if(null!=e.quantizationParameters&&!i.supportsQuantization){const i=e.clone(),r=(0,y.VV)(i.quantizationParameters);i.quantizationParameters=null;const n=await(0,Gh.eW)(s,i,this._metadata.spatialReference,t),o=(0,Jn.q3)(n,this._metadata.featureIdInfo);return(0,Jn.jH)(r,o),Ha.K.fromOptimizedFeatureSet(o,this._metadata)}const r=await(0,Gh.eW)(s,e,this._metadata.spatialReference,t);return"esriGeometryPoint"===this._metadata.geometryType&&(r.features=r.features?.filter(e=>{if(null!=e.geometry){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0})),Ha.K.fromFeatureSet(r,this._metadata)}}class ic extends Kh{async executeQuery(e,t){if(e.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const s=e.clone(),i=(0,y.VV)(s.quantizationParameters);s.quantizationParameters=null;const r=await(0,Nh.I)(this.service.source,e,t);return(0,Jn.jH)(i,r),Ha.K.fromOptimizedFeatureSet(r,this._metadata)}const s=await(0,Nh.I)(this.service.source,e,t);return Ha.K.fromOptimizedFeatureSet(s,this._metadata)}}class rc extends Th{constructor(e,t,s){super(e.metadata,t,s),this._service=e,this._didApplyOverride=!1,this._queue=new ia.QueueProcessor({concurrency:32,process:async e=>{const t={signal:e.options?.signal,query:e.query.customParameters,useQueue:!0};return this._adapter.executeQuery(e.query.inner,t)}}),this._queryInfo=Dh.create(e,{...t.full,...t.partial},this.metadata),this._adapter=function(e,t,s){switch(e.type){case"memory":return new ec(e,t,s);case"ogc":return new ic(e,t);case"feature-service":return e.queryMetadata.supportsFormatPBF&&(0,n.A)("featurelayer-pbf")?new tc(e,t):new sc(e,t)}}(e,this.metadata,s.connection),this._lastEditDate=e.queryMetadata.lastEditDate}destroy(){super.destroy(),this._adapter.destroy()}unsafeSetQueryHistoricMoment(e){this._queryInfo.updateHistoricMoment(e)}async tryUpdate(e,t){if((0,m.i8)(this.availableFields,t.availableFields)){if(this._didApplyOverride||await this._queryLastEditDateChanged())return!1;await this._updateFields(t.availableFields)}return this._schema.partial=t,!0}async queryByObjectId(e,t){if(0===e.length)return Ha.K.empty(this.metadata);const s=this._queryInfo.createQuery({objectIds:e});return s.inner.outFields=t,this._fetch(s,null,null)}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}_onOverride(){this._didApplyOverride=!0}async _updateFields(e){this._queryInfo.updateFields(e);const t=Array.from(this.store.chunks()).map(async e=>{const t=ja.A.fromJSON(e.queryInfo.queryJSON);if(t)try{return await this._tryUpdateFields(e.reader,t,{chunkId:e.chunkId}),null}catch(e){return e}}),s=(await Promise.all(t)).filter(e=>e);if(s.length)throw new i.A("featurelayer-query","Encountered errors when downloading fields",{errors:s})}async _fetch(e,t,s){const i=await this._enqueue(e,t);return await this._tryUpdateFields(i,e.inner,s),i}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;if(!("source"in this._service))return!1;const e=this._service.source,t={...e.query,f:"json"},s=(await(0,Oh.A)(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return s!==this._lastEditDate&&(this._lastEditDate=s,!0)}async _tryUpdateFields(e,t,s){const r=this._queryInfo.createPatchFieldsQuery(t,e,s);if(!r)return;const n=await this._enqueue(r,this._options);n.getSize()===e.getSize()?e.joinAttributes(n):Lt.A.getLogger("esri.views.2d.layers.features.sources.strategies.AFetchLoadStrategy").error(new i.A("featurelayer-query",`Failed to join features. Expected a count of ${e.getSize()} features, but got ${n.getSize()}`,{query:r.inner.toJSON(),debugInfo:s}))}async _enqueue(e,t){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally(()=>{this._connection.onEvent({type:"fetchEnd",done:0===this._queue.length})})}}class nc extends rc{constructor(e,t,s){super(e,t,s),this._chunksById=new Map,this._featureCache=new Eh(this.store,this._queryInfo,this._options,this._fetch.bind(this))}prepareCacheUpdate(e,t){return this._featureCache.prepareCacheUpdate(e,t)}applyCacheUpdate(){return this._featureCache.applyCacheUpdate()}unload(e){this._removeChunks(e.tile)}_addChunk(e){const t=e.tile.id;this._chunksById.has(t)||this._chunksById.set(t,[]);const s=e.size();(s||e.first||e.end)&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] ATileLoadStrategy.addChunk [count=${s}]`),this._chunksById.get(t).push(e),this.store.insert(e))}_removeChunks(e){const t=this._chunksById.get(e.key.id)??[];for(const s of t)(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${e.key.id}] Chunk[${s.chunkId}] ATileLoadStrategy.removeChunk`),this.store.remove(s);this._chunksById.delete(e.key.id)}}var oc=s(70300);class ac extends oc.K{constructor(e,t,s,i,r,n){super(),this._reader=e,this._queryJSON=t,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(e){return this._tile.key.id===e.key.id?this.reader:null}}const hc=(0,n.A)("featurelayer-query-max-depth");class cc{constructor(e,t){this.subscription=e,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=(0,r.vE)([(0,a.u7)(e.signal,()=>this._controller.abort()),(0,a.u7)(t,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}get options(){return{signal:this._controller.signal}}}class lc extends nc{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new cc(e,this._options));const t=this._loadStates.get(e.key.id);let s;try{for await(const s of this._fetchChunkInfos(t,e.tile,0)){const{queryJSON:e,reader:i,sourceTile:r,sourceTileDepth:n,tile:o}=s,h=new ac(i,e,o,r,n,!1);(0,a.Te)(t.options),this._addChunk(h)}}catch(e){s=e}(0,a.Te)(t.options);const i=new ac(Ha.K.empty(this.metadata),null,e.tile,null,-1,!0);if(this._addChunk(i),s)throw s}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,s){let i=e.get(t.id);const r=!!i;if(i||(i=await this._fetchChunkInfo(e,t,s),e.set(t.id,i)),i.reader.exceededTransferLimit&&s<(0,n.A)("featurelayer-query-max-depth"))for(const i of t.createChildTiles())yield*this._fetchChunkInfos(e,i,s+1);else r||(yield i)}async _fetchChunkInfo(e,t,s){const i=e.subscription.tile.getQuantizationParameters(),r=this._queryInfo.createTileQuery(t,{returnExceededLimitFeatures:s===hc,quantizationParameters:i});return{reader:await this._fetch(r,e.options,{chunkId:t.id}),queryJSON:r.inner.toJSON(),tile:e.subscription.tile,sourceTile:t,sourceTileDepth:s}}}class uc extends oc.K{constructor(e,t,s,i,r){super(),this._reader=e,this._queryJSON=t,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(e){return this._tile.key.id===e.key.id?this.reader:null}}class dc{constructor(e,t){this.subscription=e,this._pages=new Set,this._controller=new AbortController,this._done=!1,this._handles=(0,r.vE)([(0,a.u7)(e.signal,()=>this._controller.abort()),(0,a.u7)(t,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}}class pc extends nc{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const e of this._loadStates.values())e.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){const t=(0,O.tE)(this._loadStates,e.key.id,()=>new dc(e,this._options));for await(const e of this._fetchPages(t))this._addChunk(e)}unload(e){super.unload(e),this._loadStates.get(e.key.id)?.destroy(),this._loadStates.delete(e.key.id)}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e))(0,a.Te)(e.options),0!==t.size()&&(yield t)}catch(e){t=e}if(t&&(0,a.zf)(t)||(yield new uc(Ha.K.empty(this.metadata),null,e.subscription.tile,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=(0,n.A)("featurelayer-query-tile-concurrency"),s=this._pageStreamAll(e),i=[];let r=!1,o=1;for(;!r;){const e=[];for(;!r&&i.length<o;){const t=s.next();if(!t.value){r=!0;break}const n=t.value;n.then(e=>{e.reader.exceededTransferLimit||(r=!0)}).catch(e=>{r=!0}).finally(()=>{i.splice(i.indexOf(n),1)}),i.push(n),e.push(n)}for(const t of e)yield t;i.length&&await Promise.race(i),o<t&&(o+=1)}}*_pageStreamAll(e){const t=Math.ceil((0,n.A)("featurelayer-query-tile-max-features")/this._queryInfo.getPageSize(!0));for(let s=0;s<t;s++)yield this._downloadPage(s,e)}async _downloadPage(e,t){(0,a.Te)(t.options);const s=t.subscription.tile,i=this._queryInfo.createPagedTileQuery(s,e),r=await this._fetch(i,t.options,{chunkId:`${s.id}-${e}`});return(0,a.Te)(t.options),new uc(r,i.inner.toJSON(),s,e,!1)}}var fc=s(27348);class _c extends rc{constructor(e,t,s){super(e,t,s)}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}async _download(){const e=this._schema.snapshotInfo.initialTolerance,t=e?new fc.A({mode:"view",originPosition:"upper-left",tolerance:e}):null;await this._downloadStreaming(t),null!=t&&await this._downloadRefresh()}async _downloadStreaming(e){try{for await(const t of this._fetchPages(e))this.store.insert(t)}catch(e){throw new i.A("featurelayer-query","Encountered error when downloading data",{error:e})}}async _downloadRefresh(){try{const e=[];for await(const t of this._fetchPages(null))e.push(t);this.store.clear();for(const t of e)this.store.insert(t);this.store.refresh()}catch(e){throw new i.A("featurelayer-query","Encountered error when downloading data",{error:e})}}async*_fetchPages(e){let t;try{for await(const t of this._concurrentPageStream(e))0!==t.size()&&(yield t)}catch(e){t=e}if(t&&(0,a.zf)(t)||(yield new zh.j(Ha.K.empty(this.metadata),null,-1,!0)),t)throw t}async*_concurrentPageStream(e){const t=(0,n.A)("featurelayer-snapshot-concurrency"),s=this._pageStreamAll(e),i=[];let r=!1,o=1;for(;!r;){const e=[];for(;!r&&i.length<o;){const t=s.next();if(!t.value){r=!0;break}const n=t.value;n.then(e=>{e.reader.exceededTransferLimit||(r=!0)}).catch(e=>{r=!0}).finally(()=>{i.splice(i.indexOf(n),1)}),i.push(n),e.push(n)}for(const t of e)yield t;i.length&&await Promise.race(i),o<t&&(o+=1)}}*_pageStreamAll(e){const t=Math.ceil(this._schema.snapshotInfo.maxFeatureCount/this._queryInfo.getPageSize(!1));for(let s=0;s<t;s++)yield this._downloadPage(s,e)}async _downloadPage(e,t){(0,a.Te)(this._options);const s=this._queryInfo.createPagedQuery(e,t),i=await this._fetch(s,this._options,{chunkId:e.toString()}),r=new zh.j(i,s.inner.toJSON(),e,!1);return(0,a.Te)(this._options),r}}var mc=s(29953),gc=s(39412);class yc extends oc.K{constructor(e,t,s,i,r,n){super(),this._metadata=e,this._reader=t,this._page=s,this._end=i,this._fileIndex=r,this._fileUrl=n,this.chunkId=`${this._fileIndex}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader??Ha.K.empty(this._metadata)}get first(){return 0===this._page}get end(){return this._end}get queryInfo(){return{type:"snapshot",chunkId:this.chunkId,page:this._page,size:this.size(),end:this.end}}get isTiled(){return!1}async updateFields(e,t,s){return this._reader?.updateFields(e,this._fileUrl,t,s)}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}var xc=s(16630);class bc extends Th{constructor(e,t,s,i){super(e.metadata,t,s),this._service=e,this._files=new Map,this._loaded=this._load(i)}destroy(){super.destroy(),this._loaded.finally(()=>{this._client.close(),this._client=null;for(const e of this._ports)e.close()}).catch(()=>{})}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(e,t){if(await this._loaded,(0,m.i8)(this.availableFields,t.availableFields)&&await this._updateFields(t.availableFields),(0,m.i8)(this._schema.partial.urls,t.urls)){for(const e of t.urls)this._files.has(e)||await this._loadFile(e);for(const e of this._files.keys())if(!t.urls.includes(e))throw new i.A("unsupported","Removing parquet files is not supported",{previous:this._schema.partial.urls,next:t.urls})}return this._schema.partial=t,!0}async load(e){return this._loaded}unload(e){}_onOverride(){}async _load(e){this._ports=await e.layerView.openMemoryPorts(),this._client=await(0,mc.N1)(this._ports,{maxNumberOfConcurrentJobs:20}),this._proxy=this._client.createInvokeProxy(),this._indexMap=await this._proxy.getIndexMap(),await this._download()}async _updateFields(e){const t=new Set(e),s=(0,R.iv)(t,new Set(this.availableFields));if(null!=this._service.metadata.fieldsIndex&&s.size){const e=Array.from(this.store.insertedChunks()).map(e=>e.updateFields(this._proxy,Array.from(s),this._options));await Promise.all(e)}}async _loadFile(e){const t=await(0,gc.N)(),s=await this._proxy.getFileId(e);this._files.set(e,s),(0,a.Te)(this._options);const i=await this._proxy.queryStream(e,{type:"snapshot",outFields:Array.from(this.availableFields),returnGeometry:!0,outSpatialReference:this.metadata.outSpatialReference.toJSON(),where:this.definitionExpression},this._options);let r=0;const n=[],o=async(n=0)=>{const h=await this._proxy.getStreamNext(e,i,this._options);if((0,a.Te)(this._options),null==h)return;const c=t.ParquetChunk.deserialize(new Uint8Array(h)),l=new xc.s(this.metadata,this._indexMap,c,s),u=new yc(this.metadata,l,r++,!1,s,e);return this.store.insert(u),o(n+1)};for(let e=0;e<8;e++)n.push(o());await Promise.all(n)}async _download(){try{await Promise.all(this._schema.partial.urls.map(e=>this._loadFile(e)));const e=new yc(this.metadata,null,-1,!0,0,"");this.store.insert(e)}catch(e){throw console.error(e),e}}}class wc extends oc.K{constructor(e,t,s,i,r,n,o){super(),this._metadata=e,this._reader=t,this._tile=s,this._fileId=i,this._fileUrl=r,this._page=n,this._end=o,this.chunkId=`${this._tile.key.id}.${this._fileId}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._fileId}.${this._page}${this.end?"e":""}`}get reader(){return this._reader??Ha.K.empty(this._metadata)}get first(){return 0===this._page}get end(){return this._end}get tile(){return this._tile}get queryInfo(){return{type:"parquet",chunkId:this.chunkId,queryJSON:null,page:this._page,size:this.size(),tileId:this._tile.id,end:this.end}}get isTiled(){return!0}async updateFields(e,t,s){return this._reader?.updateFields(e,this._fileUrl,t,s)}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}}class vc{constructor(e,t){this.subscription=e,this.chunks=[],this.ids=[],this._controller=new AbortController,this._handles=(0,r.vE)([(0,a.u7)(e.signal,()=>this._controller.abort()),(0,a.u7)(t,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get options(){return{signal:this._controller.signal}}addBinaryData(e){this.chunks.push(e)}addSourceChunkId(e){this.ids.push(e)}}class Sc extends Th{constructor(e,t,s,i){if(super(e.metadata,t,s),this._service=e,this._loadStates=new Map,this._files=new Map,this._queue=new ia.QueueProcessor({concurrency:32,process:e=>this._loadTile(e)}),!e.geometryInfo.displayOptimization)throw new Error("InternalError: ParquetTileLoadStrategy only supports XZ-enabled parquet files");this._loaded=this._load(i)}destroy(){super.destroy(),this._loaded.finally(()=>{this._client.close(),this._client=null;for(const e of this._ports)e.close()}).catch(()=>{})}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(e,t){await this._loaded;let s=!0;if((0,m.i8)(this.availableFields,t.availableFields)&&await this._updateFields(t.availableFields),(0,m.i8)(this._schema.partial.urls,t.urls)){for(const e of t.urls)this._files.has(e)||(s=!1,await this._insert(e));for(const e of this._files.keys())if(!t.urls.includes(e))throw new i.A("unsupported","Removing parquet files is not supported",{previous:this._schema.partial.urls,next:t.urls})}return this._schema.partial=t,s}async load(e){return await this._loaded,(0,O.tE)(this._loadStates,e.key.id,()=>new vc(e,this._options)),this._queue.push(e)}unload(e){const t=this._loadStates.get(e.tile.id);if(null!=t){for(const e of t.ids)this.store.removeById(e);t.destroy(),this._loadStates.delete(e.tile.id)}}async _load(e){const t=this._schema.partial.urls;this._ports=await e.layerView.openMemoryPorts(),this._client=await(0,mc.N1)(this._ports,{maxNumberOfConcurrentJobs:20}),this._proxy=this._client.createInvokeProxy(),this._indexMap=await this._proxy.getIndexMap(),await Promise.all(t.map(e=>this._insert(e)))}async _insert(e){this._files.set(e,this._files.size)}_onOverride(){}async _updateFields(e){const t=new Set(e),s=(0,R.iv)(t,new Set(this.availableFields));if(null!=this._service.metadata.fieldsIndex&&s.size){const e=Array.from(this.store.insertedChunks()).map(e=>e.updateFields(this._proxy,Array.from(s),this._options));await Promise.all(e)}}async _loadTile(e){const t=e.tile,s=e.signal,i=this._loadStates.get(t.id),r=new ia.QueueProcessor({process:async t=>{const s=await this._proxy.getFileId(t);return this._downloadFileData(e,t,s)},concurrency:2});await Promise.allSettled(Array.from(this._files.keys()).map(e=>r.push(e))),(0,a.Te)(s);const n=new wc(this.metadata,null,t,null,null,0,!0);i.addSourceChunkId(n.chunkId),this.store.insert(n)}async _downloadFileData(e,t,s){const i=await(0,gc.N)(),r=e.tile,n=e.signal,o=this._loadStates.get(r.id),h=await this._proxy.queryStream(t,{type:"tile",extent:r.extent,transform:r.normalizedTransform,outFields:Array.from(this.availableFields),returnGeometry:!0,outSpatialReference:this.metadata.outSpatialReference.toJSON(),scale:r.scale,where:this.definitionExpression},{signal:n});let c=0;const l=[],u=async(e=0)=>{const l=await this._proxy.getStreamNext(t,h,{signal:n});if((0,a.Te)(n),null==l)return;const d=i.ParquetChunk.deserialize(new Uint8Array(l)),p=new xc.s(this.metadata,this._indexMap,d,s),f=new wc(this.metadata,p,r,s,t,c++,!1);return o.addBinaryData({data:d,fileUrl:t}),o.addSourceChunkId(f.chunkId),this.store.insert(f),u(e+1)};for(let e=0;e<4;e++)l.push(u());await Promise.all(l)}}class Ic{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(0===this.size)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return 0===this.size?null:this._buffer[this._start]}peekLast(){return 0===this.size?null:this._buffer[(this._start+(this.size-1))%this.maxSize]}find(e){if(0===this.size)return null;for(const t of this._buffer)if(null!=t&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;null!=t;)e&&e(t),t=this.dequeue()}}class Pc{constructor(e,t,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=e,"unique-id-composite"===t.type)throw new i.A("stream-layer","composite uniqueIds are not supported");this.idField=t.fieldName,this.purgeInterval=n,this._useGeneratedIds=this.idField===re.DN}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const e of t.entries)this._removed.push(e)}add(e){if(this._useGeneratedIds){const t=this._nextId();e.attributes[this.idField]=t,e.objectId=t}else e.objectId=e.attributes[this.idField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return null==this._trackIdLessObservations&&(this._trackIdLessObservations=new Ic(1e5)),void this._trackIdLessObservations.enqueue(t);const s=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(s)){const e=null!=this._purgeOptions?.maxObservations?this._purgeOptions.maxObservations:1e3,t=(0,Bs.qE)(e,0,1e3);this._trackIdToObservations.set(s,new Ic(t))}const i=this._trackIdToObservations.get(s),r=i?.enqueue(t);null!=r&&(this._addOrUpdated.has(r)?this._addOrUpdated.delete(r):this._removed.push(r))}checkForUpdates(){const e=this._getToAdd(),t=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!=t)for(const e of t){const t=this.store.removeById(e);null!=t&&n.push(t)}const o=[];if(null!=e){const i=new Set(t??[]);for(const t of e)i.has(t.objectId)||(t.attributes[re.Gm]=s,t.attributes[re.Aw]=r,this.store.add(t),o.push(t))}return!(!o.length&&!n?.length||(this.store.update(o,n),0))}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(s=>e[t++]=s),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;null!=t&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField)for(const s of this._trackIdToObservations.values())if(t>e.displayCount&&s.size){const e=s.dequeue();this._removed.push(e),t--}if(null!=this._trackIdLessObservations){let s=t-e.displayCount;for(;s-- >0;){const e=this._trackIdLessObservations.dequeue();null!=e&&this._removed.push(e)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const s=60*e.age*1e3,i=this._maxAge-s;this.store.forEach(e=>{e.attributes[t]<i&&this._removed.push(e.objectId)})}_purgeByAgeReceived(e,t){if(!t.ageReceived)return;const s=e-60*t.ageReceived*1e3;this.store.forEach(e=>{e.attributes[re.Gm]<s&&this._removed.push(e.objectId)})}_purgeTracks(){this._trackIdToObservations.forEach((e,t)=>{0===e.size&&this._trackIdToObservations.delete(t)})}}var Mc=s(30624),kc=s(10107),Cc=s(64108);let Ac=class extends E.A{constructor(e){super(e)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};(0,z.Cg)([(0,kc.MZ)()],Ac.prototype,"connection",void 0),(0,z.Cg)([(0,kc.MZ)()],Ac.prototype,"connectionStatus",null),(0,z.Cg)([(0,kc.MZ)()],Ac.prototype,"errorString",null),Ac=(0,z.Cg)([(0,Cc.$)("esri.views.2d.layers.features.sources.StreamConnectionState")],Ac);class Tc{constructor(e,t){this._metadata=e,this._onUpdate=t,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return Ha.K.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(e){this._objectIdToFeature.set(e.objectId,e)}forEach(e){this._objectIdToFeature.forEach(e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),t):null}clear(){this._objectIdToFeature=new Map}update(e,t){this._onUpdate(e?.length??0)}}class Fc extends oc.K{constructor(e){super(),this._reader=e,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(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class zc extends Th{constructor(e,t,s){super(e.metadata,t,s),this._service=e,this._connectionState=new Ac,this._forceRefresh=!1,this.events=new ca.bk;const{timeInfo:i}=this.metadata,{purgeOptions:r}=t.full;this._stagingStore=new Tc(this.metadata.weakCloneWithAdditionalFields([{name:re.Aw,alias:"timeReceived",type:"esriFieldTypeDate"}]),e=>this.events.emit("features-updated",e)),this._manager=new Pc(this._stagingStore,this.metadata.featureIdInfo,i,r),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}get availableFields(){return this._schema.full.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(e,t){const s=null!=this._chunk;if(t.sourceRefreshVersion!==this._refreshVersion){if(this._refreshVersion=t.sourceRefreshVersion,!this._manager.checkForUpdates()&&s&&!this._forceRefresh)return this.events.emit("tick"),!0;this._chunk&&(this.store.remove(this._chunk),e.requireInvalidation()),this._forceRefresh=!1,this._chunk=new Fc(this._stagingStore.reader),this.store.insert(this._chunk),this.events.emit("tick")}return this._schema.partial=t,!0}async load(e){}unload(e){}disconnect(){this._streamConnection=(0,_.pR)(this._streamConnection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(null!=this._streamConnection)return;const{geometryType:e,spatialReference:t}=this.metadata,{maxReconnectionAttempts:s,maxReconnectionInterval:i,geometryDefinition:n,definitionExpression:o,customParameters:a}=this._schema.full;this._streamConnection=(0,Mc.createConnection)(this._service.source,t,this._service.outSpatialReference,e,o,n,s,i,a),this._handlesGroup=(0,r.vE)([this._streamConnection.on("data-received",e=>this._onFeature(e)),this._streamConnection.on("message-received",e=>this._onWebSocketMessage(e))]),this._connectionState.connection=this._streamConnection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._streamConnection?.updateCustomParameters(e)}sendMessageToSocket(e){this._streamConnection?.sendMessageToSocket(e)}sendMessageToClient(e){this._streamConnection?.sendMessageToClient(e)}_onOverride(){}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch(e){}}}var Ec=s(44320),Oc=s(79897);let Rc=class extends E.A{constructor(e){super(e),this.debugName="",this._updatingHandles=new Oc.U,this._idToUpdatingState=new N.A}destroy(){this._updatingHandles=(0,_.pR)(this._updatingHandles),this._idToUpdatingState.clear()}get updating(){const e=!this.destroyed&&(this._updatingHandles?.updating||Array.from(this._idToUpdatingState.values()).some(e=>e));if((0,n.A)("esri-2d-log-updating")){const t=Array.from(this._idToUpdatingState.entries()).map(([e,t])=>`-> ${e}: ${t}`).join("\n");console.log(`${this.debugName}: Updating: ${e}\n-> Handles: ${this._updatingHandles.updating}\n${t}`)}return e}addUpdateTracking(e,t){const s=(0,c.wB)(()=>t.updating,t=>this._idToUpdatingState.set(e,t),{sync:!0});this.addHandles(s)}consumePromise(e){this._updatingHandles.consumePromise(e)}addPromise(e){return this._updatingHandles.addPromise(e)}};(0,z.Cg)([(0,L.MZ)({constructOnly:!0})],Rc.prototype,"debugName",void 0),(0,z.Cg)([(0,L.MZ)({readOnly:!0})],Rc.prototype,"updating",null),Rc=(0,z.Cg)([(0,Cc.$)("esri.views.2d.layers.support.UpdateTracking2D")],Rc);class Lc{constructor(e,t,s,i){this._aggregateAdapter=e,this._subscriptions=t,this._connection=s,this._cachedObjectIds=i,this._updateTracking=new Rc({debugName:"FeatureSource"}),this.store=new Ec.I}destroy(){this._strategy?.destroy(),this._streamMessenger?.destroy(),this._updateTracking?.destroy(),this.store.destroy()}get metadata(){return this._strategy.metadata}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return kh.from(this.store)}get updateTracking(){return this._updateTracking}get usedMemory(){return this.store.usedMemory}get queryEngine(){if(!this._queryEngine){if(!this.store||!this._strategy)return null;this._queryEngine=new da.do({featureStore:this.store,fieldsIndex:this.metadata.fieldsIndex,geometryType:this.metadata.geometryType,featureIdInfo:this.metadata.featureIdInfo,hasZ:this.metadata.hasZ,hasM:this.metadata.hasM,spatialReference:this.metadata.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:this.metadata.timeInfo,definitionExpression:this._strategy?.definitionExpression,availableFields:this._strategy?.availableFields})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasQueryDisplayFilter(){if(!this._schema)return!1;switch(this._schema.type){case"feature":return null!=this._schema.strategy.full.displayFilterInfo;case"parquet":case"stream":return!1}}chunks(){return Array.from(this.store.chunks())}prepareCacheUpdate(e,t){const s=new Set,i=new Set;for(const t of e)this._cachedObjectIds.has(t)||(this._cachedObjectIds.add(t),s.add(t));for(const e of t)this._cachedObjectIds.delete(e),i.add(e);this.hasQueryDisplayFilter&&this._strategy.prepareCacheUpdate(s,i)}async applyCacheUpdate(){this.hasQueryDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this.store.cleanup()}onSubscribe(e){if(this._connection.onEvent({type:"subscribe",tile:e.tile.id}),!this._strategy)return;const t=this._strategy.load(e);t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t})),this._updateTracking.consumePromise(t)}onResume(e){this._updateTracking.consumePromise((0,a.QZ)(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}async applyOverride(e){await(this._strategy?.applyOverride(e))}takeOverrideUpdate(){return this._strategy?.takeOverrideUpdate()}async update(e,t){const s=this._schema;if(this._schema=e,this._queryEngine=(0,_.pR)(this._queryEngine),s&&s.type!==e.type)throw new Error("InternalError: Reconfiguring source types is not supported.");const i=new Ah;if(!s||(0,m.i8)(s.service,e.service)||s.strategy.type!==e.strategy.type||(0,m.i8)(e.strategy.full,s.strategy.full)||!await this._strategy.tryUpdate(i,e.strategy.partial)){await this._updateStrategyType(this._schema.service,e,t);let s=null;return"postQueryFilter"in this._schema.strategy.full&&this._schema.strategy.full.postQueryFilter&&(s=await Va.create({geometryType:this.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:this.metadata.timeInfo,fieldsIndex:this.metadata.fieldsIndex,spatialReference:this.metadata.outSpatialReference,filterJSON:this._schema.strategy.full.postQueryFilter})),await this.store.update({metadata:this.metadata,definitionExpression:this._schema.strategy.full.definitionExpression,postQueryFilter:s}),!0}return i.requiresInvalidation}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.strategy.full.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new Ch(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(na.Om.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(na.Om.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,i=await this._queryOptimizedFeatures(s);if(i.length!==s.length){const e=new Set(i.map(e=>e.objectId));for(const i of s)e.has(i)||t.commands.removeWeak.push(i)}return t.commands.updateWeak.push(...i),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e,["*"])).getCursor();for(;s.next();)t.push(s.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=this.store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(s)}async _updateStrategyType(e,t,s){const i=this._createStrategy(e,t);this._connection.onEvent({type:"updateStrategyStart",about:i.about});const r=!!this._strategy;this.store.clear(),this._strategy?.destroy(),this._strategy=i,(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${s}] FeatureSource.updateStrategy`,{strategy:i});const o=Array.from(this._subscriptions.values());if(!o.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const h=Promise.all(o.map(e=>this._strategy.load(e).then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))));this._updateTracking.consumePromise(h),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{r&&await h}catch(e){(0,a.jH)(e)}this._connection.onEvent({type:"updateStrategyEnd"}),(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${s}] FeatureSource.updateStrategyEnd`,{strategy:i})}_createStrategy(e,t){const s={connection:this._connection,store:this.store};switch(t.type){case"feature":return this._createFeatureLoadStrategy(e,t.strategy,s);case"parquet":return this._createParquetLoadStrategy(e,t.strategy,s);case"stream":return this._createStreamLoadStrategy(e,t.strategy,s)}}_createFeatureLoadStrategy(e,t,s){switch(t.type){case"drill-down":return new lc(e,t,s);case"paged-tile":return new pc(e,t,s);case"snapshot":return new _c(e,t,s)}}_createParquetLoadStrategy(e,t,s){switch(t.type){case"xz":return new Sc(e,t,s,this._connection);case"snapshot":return new bc(e,t,s,this._connection)}}_createStreamLoadStrategy(e,t,s){const i=new zc(e,t,s);return this.streamMessenger.strategy=i,i}}class Dc{constructor(e,t){this.tile=e,this.version=t,this._abortController=new AbortController}get key(){return this.tile.key}get signal(){return this._abortController.signal}abort(){this._abortController.abort()}}var qc=s(98291);class Nc{constructor(e,t){this.key=new b.A(0,0,0,0),this.bounds=(0,Y.vt)(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){const[e,t,s,i]=this.bounds;return{xmin:e,ymin:t,xmax:s,ymax:i}}get hydratedExtent(){return(0,Y.w1)(this.bounds,this.tileInfoView.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}get normalizedTransform(){return(0,y.Q1)(this.transform)}createArcadeEvaluationOptions(e){return(0,ih.N)(this.scale,e)}createChildTiles(){const e=this.key.getChildKeys(),t=qc.A.acquire();for(let s=0;s<e.length;s++)t[s]=new Nc(this.tileInfoView,e[s]);return t}getQuantizationParameters(){return fc.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.spatialReference}})}}class Gc{constructor(e){this.inner=e,this.resolver=Promise.withResolvers()}}class Bc{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._refreshRequested=!0,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const t=this._connection,s=d.A.fromJSON(e.tileInfoJSON);this._tileInfoView=new F(s),this._viewExtent=e.initialViewExtent,this._source=new Lc(this._aggregateAdapter,this._subscriptions,t,this._cachedObjectIds),this._processor=new Ph(t,this._source,e.requiredLevel,e.requiredScale),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(e){this._connection=new f(e)}get features(){const e=this._source?.queryEngine;if(!e)throw new i.A("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor?.aggregateQueryEngine;if(!e)throw new i.A("no-queryEngine","No aggregate query engine defined");return e}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}updateStationaryExtent(e,t){t&&(this._refreshRequested=!0,this._requestUpdate()),this._viewExtent=e}updateRequiredLevel(e,t){this._processor.updateRequiredLevel(e,t),this._processor.hasClusters&&this._requestUpdate()}async updateSchema(e,t){return(0,n.A)("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new Gc({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new Gc(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new Gc(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async onOverride(e){if(null!=this._updateOverridesRequest)throw new i.A("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new Gc(e);const t=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round((0,l.Lz)(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,n=e.fieldOffset??0,o=Array.from(this._subscriptions.values()),a=this._source.chunks(),h=t**2,c=3/(Math.PI*h),u=2*t,d=Math.ceil(p.CQ/u);for(const t of o){const o=t.tile,l=new Float64Array(d*d);for(const t of a){const s=t.getTileReader(o);if(!s)continue;const i=s.getCursor();for(;i.next();){let t=1;if(null!=e.field){const s=i.readAttribute(e.field);t=r?-1*+s:+s+n}const s=i.readXForDisplay()/u,o=i.readYForDisplay()/u,a=Math.floor(s),p=Math.floor(o);if(a<0||p<0||a>=d||p>=d)continue;const f=((.5+a-s)*u)**2+((.5+p-o)*u)**2;if(f>h)continue;const _=t*(c*(1-f/h)**2);l[p+a*d]+=_}}for(let e=0;e<l.length;e++)s=Math.min(s,l[e]),i=Math.max(i,l[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),n=new h.A,o=3*e.sampleSize;for(let a=0;a<o&&i.length<e.sampleSize;a++){const e=r[n.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const o=n.getIntRange(0,e.getSize()-1);e.setIndex(o);const a=e.getObjectId();s.has(a)||(s.add(a),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.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(e){const t=e.tileId;if(this._subscriptions.has(t))return;(0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new Nc(this._tileInfoView,t),i=new Dc(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&((0,n.A)("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.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 e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),this._refreshRequested&&(this._refreshRequested=!1,t=!0),t&&(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 e=await this._source.normalizeOverrides(s.inner);await this._source.applyOverride(e),(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const i=this._source.cleanup();this._processor.removeChunks(i);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e,this._viewExtent)}catch(e){(0,n.A)("esri-2d-update-debug")&&console.debug("InternalError",e)}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(this._viewExtent),(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(e){(0,a.jH)(e)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),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(e,t){(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e.source,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return(0,n.A)("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){(0,n.A)("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}},44159(e,t,s){s.d(t,{A:()=>r});var i=s(93687);class r{static{this.pool=new i.A(()=>new r(""),null,null,25,50)}static getId(e,t,s,i){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${s}/${i}`}constructor(e,t,s,i){this.set(e,t,s,i)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,s=63&this.level;return(3&this.world)<<30|t<<22|e<<8|s}acquire(e,t,s,i){this.set(e,t,s,i)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){const t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new r(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,s,i){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,s,i,r]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(s),this.col=parseFloat(i),this.world=parseFloat(r)}else this.level=+e,this.row=+t,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(e,t,s){const i=this.clone();return i.col+=e,i.row+=t,s.normalizeKey(i),i}getChildKeys(){const e=this.level+1,t=this.row<<1,s=this.col<<1,i=this.world;return[new r(e,t,s,i),new r(e,t,s+1,i),new r(e,t+1,s,i),new r(e,t+1,s+1,i)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}}}]);