@arcgis/core 5.2.0-next.15 → 5.2.0-next.17

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 (892) hide show
  1. package/applications/Urban/editingSessionUtils.js +1 -1
  2. package/arcade/featureSetUtils.js +1 -1
  3. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  4. package/arcade/featureset/sources/FeatureLayerParquet.js +2 -0
  5. package/arcade/featureset/support/FeatureSet.js +1 -1
  6. package/arcade/featureset/support/shared.js +1 -1
  7. package/arcade.d.ts +2 -1
  8. package/arcgisGlobal.d.ts +6 -1
  9. package/assets/esri/core/t9n/Units_ar.json +1 -1
  10. package/assets/esri/core/t9n/Units_bg.json +1 -1
  11. package/assets/esri/core/t9n/Units_bs.json +1 -1
  12. package/assets/esri/core/t9n/Units_ca.json +1 -1
  13. package/assets/esri/core/t9n/Units_cs.json +1 -1
  14. package/assets/esri/core/t9n/Units_da.json +1 -1
  15. package/assets/esri/core/t9n/Units_de.json +1 -1
  16. package/assets/esri/core/t9n/Units_el.json +1 -1
  17. package/assets/esri/core/t9n/Units_es.json +1 -1
  18. package/assets/esri/core/t9n/Units_et.json +1 -1
  19. package/assets/esri/core/t9n/Units_fi.json +1 -1
  20. package/assets/esri/core/t9n/Units_fr.json +1 -1
  21. package/assets/esri/core/t9n/Units_he.json +1 -1
  22. package/assets/esri/core/t9n/Units_hr.json +1 -1
  23. package/assets/esri/core/t9n/Units_hu.json +1 -1
  24. package/assets/esri/core/t9n/Units_id.json +1 -1
  25. package/assets/esri/core/t9n/Units_it.json +1 -1
  26. package/assets/esri/core/t9n/Units_ja.json +1 -1
  27. package/assets/esri/core/t9n/Units_ko.json +1 -1
  28. package/assets/esri/core/t9n/Units_lt.json +1 -1
  29. package/assets/esri/core/t9n/Units_lv.json +1 -1
  30. package/assets/esri/core/t9n/Units_nl.json +1 -1
  31. package/assets/esri/core/t9n/Units_no.json +1 -1
  32. package/assets/esri/core/t9n/Units_pl.json +1 -1
  33. package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
  34. package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
  35. package/assets/esri/core/t9n/Units_ro.json +1 -1
  36. package/assets/esri/core/t9n/Units_ru.json +1 -1
  37. package/assets/esri/core/t9n/Units_sk.json +1 -1
  38. package/assets/esri/core/t9n/Units_sl.json +1 -1
  39. package/assets/esri/core/t9n/Units_sr.json +1 -1
  40. package/assets/esri/core/t9n/Units_sv.json +1 -1
  41. package/assets/esri/core/t9n/Units_th.json +1 -1
  42. package/assets/esri/core/t9n/Units_tr.json +1 -1
  43. package/assets/esri/core/t9n/Units_uk.json +1 -1
  44. package/assets/esri/core/t9n/Units_vi.json +1 -1
  45. package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
  46. package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
  47. package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
  48. package/assets/esri/core/workers/RemoteClient.js +1 -1
  49. package/assets/esri/core/workers/chunks/007485862ce95928717a.js +1 -0
  50. package/assets/esri/core/workers/chunks/00bcb04934972179b9ca.js +1 -0
  51. package/assets/esri/core/workers/chunks/{d9d4754062758789f186.js → 05016e5a1de384994001.js} +2 -2
  52. package/assets/esri/core/workers/chunks/05b6b2c0b76afb100e33.js +1 -0
  53. package/assets/esri/core/workers/chunks/{8927fb4aa68f7e541a39.js → 05d597dd117766beadd8.js} +1 -1
  54. package/assets/esri/core/workers/chunks/073ee52705ea326fecfb.js +1 -0
  55. package/assets/esri/core/workers/chunks/0a52373c4ba652e0ee0f.js +1 -0
  56. package/assets/esri/core/workers/chunks/0b522e05668bef729b1b.js +1 -0
  57. package/assets/esri/core/workers/chunks/0d42322362e76f674d94.js +2 -0
  58. package/assets/esri/core/workers/chunks/{a442534ac0956a68b769.js → 0e81b6aa64d5491870b2.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{81e3bd1a0634ddc2b833.js → 0f10d7d592c36ee2d1ea.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{3526ab3b1f87c24ae6f8.js → 0fb685f385e91d0f0601.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{cdf6ad970dc1893dac58.js → 110135b0562a3b5708b9.js} +1 -1
  62. package/assets/esri/core/workers/chunks/11d1af758e2140095b10.js +1 -0
  63. package/assets/esri/core/workers/chunks/122892f365f5327d290c.js +1 -0
  64. package/assets/esri/core/workers/chunks/1305690054214a9cf48d.js +1 -0
  65. package/assets/esri/core/workers/chunks/168c15cf462f9abcbdd2.js +1 -0
  66. package/assets/esri/core/workers/chunks/169bfafec4d59be2beb0.js +1 -0
  67. package/assets/esri/core/workers/chunks/1d2609ce6220b5af5526.js +1 -0
  68. package/assets/esri/core/workers/chunks/1e109a521ca8772fdf04.js +1 -0
  69. package/assets/esri/core/workers/chunks/1ea840b7ac1ffaa0c389.js +1 -0
  70. package/assets/esri/core/workers/chunks/1f48438b3055afeb710f.js +1 -0
  71. package/assets/esri/core/workers/chunks/2353fbc1ff4481dcfb1f.js +1 -0
  72. package/assets/esri/core/workers/chunks/2509da565e5a2b43ac7f.js +1 -0
  73. package/assets/esri/core/workers/chunks/255c8e937e7a123ebb04.js +1 -0
  74. package/assets/esri/core/workers/chunks/256cc116e3be4feee593.js +1 -0
  75. package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +1 -0
  76. package/assets/esri/core/workers/chunks/29e6f4b19c3da9129439.js +1 -0
  77. package/assets/esri/core/workers/chunks/{45b560ca01fb566ba560.js → 2a8d791aef3123e6a3c4.js} +1 -1
  78. package/assets/esri/core/workers/chunks/2baee42e1797a709fe4b.js +1 -0
  79. package/assets/esri/core/workers/chunks/2c017eae434254610c8e.js +1 -0
  80. package/assets/esri/core/workers/chunks/2d7a4b669804d0c5029b.js +1 -0
  81. package/assets/esri/core/workers/chunks/2f40193d1b2e534c5226.js +1 -0
  82. package/assets/esri/core/workers/chunks/303e723e829ea7088d43.js +1 -0
  83. package/assets/esri/core/workers/chunks/31c4128b23968575feca.js +1 -0
  84. package/assets/esri/core/workers/chunks/35533c8ef541f7643497.js +2 -0
  85. package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +1 -0
  86. package/assets/esri/core/workers/chunks/36913f0f944a9eb82cd3.js +1 -0
  87. package/assets/esri/core/workers/chunks/3a35779cae6a11cde51b.js +1 -0
  88. package/assets/esri/core/workers/chunks/3a526e1d18490b99332f.js +1 -0
  89. package/assets/esri/core/workers/chunks/{cc62e5095e328bed3e01.js → 3aa0a34d2b7dbf2e2c66.js} +1 -1
  90. package/assets/esri/core/workers/chunks/3d4ad7c728e02aa90551.js +1 -0
  91. package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +1 -0
  92. package/assets/esri/core/workers/chunks/436d51b9f1b1b5abc4bc.js +1 -0
  93. package/assets/esri/core/workers/chunks/43ef6dee2e1d9ed7885e.js +1 -0
  94. package/assets/esri/core/workers/chunks/442424200e7475e9a08f.js +1 -0
  95. package/assets/esri/core/workers/chunks/4b96aa2dc5b88846bb53.js +1 -0
  96. package/assets/esri/core/workers/chunks/4ea325c829d3b82854b1.js +1 -0
  97. package/assets/esri/core/workers/chunks/50c88e2545380800381f.js +1 -0
  98. package/assets/esri/core/workers/chunks/51a53011478e0cf96e0b.js +1 -0
  99. package/assets/esri/core/workers/chunks/51a8a47aac1d8d22ba9d.js +1 -0
  100. package/assets/esri/core/workers/chunks/5481af25fd46914498df.js +1 -0
  101. package/assets/esri/core/workers/chunks/54f54623532f633dc0e2.js +1 -0
  102. package/assets/esri/core/workers/chunks/{bfd1aef8ac795e1ce227.js → 57a6572d440d2c62432b.js} +1 -1
  103. package/assets/esri/core/workers/chunks/5809e70a8e57e9b05959.js +1 -0
  104. package/assets/esri/core/workers/chunks/589b31cc5c663a288942.js +1 -0
  105. package/assets/esri/core/workers/chunks/58ce4bcfb15f378b1b9f.js +1 -0
  106. package/assets/esri/core/workers/chunks/58e0e50b6c3abaa4798f.js +1 -0
  107. package/assets/esri/core/workers/chunks/595bc41ff36c77324d01.js +261 -0
  108. package/assets/esri/core/workers/chunks/599bd80379423c99799d.js +1 -0
  109. package/assets/esri/core/workers/chunks/5bf01e0eff8a78b65e9e.js +1 -0
  110. package/assets/esri/core/workers/chunks/5dfeefee96659832398a.js +1 -0
  111. package/assets/esri/core/workers/chunks/{011a4d4201696fa10408.js → 5ea1113b7bdcf94b2822.js} +1 -1
  112. package/assets/esri/core/workers/chunks/5fab14c5f1febebb75f1.js +1 -0
  113. package/assets/esri/core/workers/chunks/60d4a3f770bb1e01cd10.js +1 -0
  114. package/assets/esri/core/workers/chunks/63858dfcff1177e597e7.js +1 -0
  115. package/assets/esri/core/workers/chunks/6849282c4a5cd733779d.js +1 -0
  116. package/assets/esri/core/workers/chunks/686c1a1b794ebe1a0341.js +1 -0
  117. package/assets/esri/core/workers/chunks/6a21a22b08f968fa8d60.js +1 -0
  118. package/assets/esri/core/workers/chunks/{11c3b1e8ca21ad62fdd1.js → 6db5ee9c589265b23b60.js} +1 -1
  119. package/assets/esri/core/workers/chunks/6dc60afb0c39bbb001a3.js +1 -0
  120. package/assets/esri/core/workers/chunks/{5bfae465872760e7af6d.js → 6f240fe78b299e6c4fcc.js} +1 -1
  121. package/assets/esri/core/workers/chunks/70cb825bb37f1977d2ab.js +1 -0
  122. package/assets/esri/core/workers/chunks/71a593fa116770e58832.js +1 -0
  123. package/assets/esri/core/workers/chunks/71f09e34d56c9fe5c307.js +1 -0
  124. package/assets/esri/core/workers/chunks/{72cfb186e50537bcdd19.js → 75915f81caaf9e5345a9.js} +1 -1
  125. package/assets/esri/core/workers/chunks/7832d94f35b79e27ee51.js +1 -0
  126. package/assets/esri/core/workers/chunks/8104ac2eee69d79ada86.js +1 -0
  127. package/assets/esri/core/workers/chunks/818a481ce579f519de1c.js +1 -0
  128. package/assets/esri/core/workers/chunks/831455798b177678720c.js +1 -0
  129. package/assets/esri/core/workers/chunks/83ce38342796bd6d73ce.js +1 -0
  130. package/assets/esri/core/workers/chunks/84a0bb53fcbd99b5aa0c.js +1 -0
  131. package/assets/esri/core/workers/chunks/87b86375f8557418dbe6.js +1 -0
  132. package/assets/esri/core/workers/chunks/8817d25c7f4cf0e6c6bd.js +1 -0
  133. package/assets/esri/core/workers/chunks/{0b55fc5050e718371e05.js → 888af532ad48fd86f285.js} +1 -1
  134. package/assets/esri/core/workers/chunks/{9331969046f2b277d620.js → 8a39dd585742960d3ca2.js} +1 -1
  135. package/assets/esri/core/workers/chunks/8ade399db21938822a7c.js +1 -0
  136. package/assets/esri/core/workers/chunks/8c62e2dabd1f1e13d244.js +1 -0
  137. package/assets/esri/core/workers/chunks/909e88c27d80777b047c.js +1 -0
  138. package/assets/esri/core/workers/chunks/91c5205d1274c7f190d5.js +1 -0
  139. package/assets/esri/core/workers/chunks/91c543443cd6768ad6ff.js +1 -0
  140. package/assets/esri/core/workers/chunks/9230ad807020fc2bbf8e.js +1 -0
  141. package/assets/esri/core/workers/chunks/92458803531fdfe1557a.js +1 -0
  142. package/assets/esri/core/workers/chunks/{976ab2be6c244768c08a.js → 940ebb13618d38c6b459.js} +1 -1
  143. package/assets/esri/core/workers/chunks/987594539981483a7c5e.js +1 -0
  144. package/assets/esri/core/workers/chunks/99c002015c2127e6cbfc.js +2 -0
  145. package/assets/esri/core/workers/chunks/9d59cc5c0a63a4e41d99.js +1 -0
  146. package/assets/esri/core/workers/chunks/{91c0de3950991d81b7f2.js → 9de673a04c70bd47047e.js} +1 -1
  147. package/assets/esri/core/workers/chunks/a195f569eada3a8736be.js +1 -0
  148. package/assets/esri/core/workers/chunks/a32651777e4f07df5b6a.js +1 -0
  149. package/assets/esri/core/workers/chunks/a3393780655152102c45.js +1 -0
  150. package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +1 -0
  151. package/assets/esri/core/workers/chunks/{52175ff9e8c2c136f90a.js → a3ecde3794a7db3cf283.js} +1 -1
  152. package/assets/esri/core/workers/chunks/a59a1fdcd37a875f179b.js +1 -0
  153. package/assets/esri/core/workers/chunks/a844c4e031e77db11478.js +1 -0
  154. package/assets/esri/core/workers/chunks/a99ce2f12c8204ee542a.js +1 -0
  155. package/assets/esri/core/workers/chunks/aba7a053015a9738d8a0.js +1 -0
  156. package/assets/esri/core/workers/chunks/{c8460bdf60aca749ed05.js → ac16016964be3b684e98.js} +1 -1
  157. package/assets/esri/core/workers/chunks/adce59e4111bae4225f7.js +1 -0
  158. package/assets/esri/core/workers/chunks/aeeee92b86554962711e.js +1 -0
  159. package/assets/esri/core/workers/chunks/af3b060fdfa3b6174340.js +1 -0
  160. package/assets/esri/core/workers/chunks/b0e4af49fc968b0a910f.js +1 -0
  161. package/assets/esri/core/workers/chunks/b289c46ce2dc04d32e81.js +1 -0
  162. package/assets/esri/core/workers/chunks/{c983e5ce0ff952b65d7f.js → b2b342b06d502fc61ea5.js} +1 -1
  163. package/assets/esri/core/workers/chunks/b466af9019f10420115e.js +1 -0
  164. package/assets/esri/core/workers/chunks/{67ebde34377f98d17cda.js → b5571e93bc136dac8ee1.js} +1 -1
  165. package/assets/esri/core/workers/chunks/ba1c4a8794ac55942e35.js +1 -0
  166. package/assets/esri/core/workers/chunks/bb9232d9f63ec0c32447.js +1 -0
  167. package/assets/esri/core/workers/chunks/bbcad2fde838819ffc7b.js +1 -0
  168. package/assets/esri/core/workers/chunks/bd260798b8de09a1eeb2.js +1 -0
  169. package/assets/esri/core/workers/chunks/{44d0ca9d4c5f1722688c.js → bf67e0f6064fb9d94ac8.js} +1 -1
  170. package/assets/esri/core/workers/chunks/bf9eca7dd107bdb06614.js +1 -0
  171. package/assets/esri/core/workers/chunks/c030a974a63155f450e9.js +1 -0
  172. package/assets/esri/core/workers/chunks/c0b7b9d115dccb2924ff.js +1 -0
  173. package/assets/esri/core/workers/chunks/c2db773201adca204f95.js +1 -0
  174. package/assets/esri/core/workers/chunks/c318e6dbb8651433038f.js +2 -0
  175. package/assets/esri/core/workers/chunks/c4a2ec2e5897300163ac.js +1 -0
  176. package/assets/esri/core/workers/chunks/c63b315c6b76b4860fc5.js +1 -0
  177. package/assets/esri/core/workers/chunks/c8091e8fd7ca43a4490a.js +1 -0
  178. package/assets/esri/core/workers/chunks/{2413b383b7f2bdcd4ced.js → c8672a54c98d472aa24d.js} +1 -1
  179. package/assets/esri/core/workers/chunks/cbe8adc100582e746a8c.js +1 -0
  180. package/assets/esri/core/workers/chunks/d0321dd4b5b2d863eecd.js +1 -0
  181. package/assets/esri/core/workers/chunks/d523af1db620b5381c99.js +1 -0
  182. package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +1 -0
  183. package/assets/esri/core/workers/chunks/d670e134348954ce465d.js +1 -0
  184. package/assets/esri/core/workers/chunks/{886ae23a1d8fa21e531f.js → d750e4abeb777caa8c36.js} +1 -1
  185. package/assets/esri/core/workers/chunks/{bd36c57dd0cd28dee55f.js → d7acbc2ddff4cee8a465.js} +1 -1
  186. package/assets/esri/core/workers/chunks/{cb8c4d8334fab9bd9a04.js → d90bc34d97bb21c29c40.js} +1 -1
  187. package/assets/esri/core/workers/chunks/d9fcc63df008f687848a.js +1 -0
  188. package/assets/esri/core/workers/chunks/db96a0c66578b2d1b715.js +1 -0
  189. package/assets/esri/core/workers/chunks/{6a1b6f8c868f8edce1d7.js → dd3b0070081eaf805d95.js} +1 -1
  190. package/assets/esri/core/workers/chunks/dd5dddf7e422216d3806.js +1 -0
  191. package/assets/esri/core/workers/chunks/de83c177f8a1234a5b2e.js +1 -0
  192. package/assets/esri/core/workers/chunks/{07ca020796c57cefda62.js → dfb19701b488089874fd.js} +1 -1
  193. package/assets/esri/core/workers/chunks/e2f33945d838183a2192.js +1 -0
  194. package/assets/esri/core/workers/chunks/e3ea4b7217df16592def.js +1 -0
  195. package/assets/esri/core/workers/chunks/{d97c0c18202b8c578f8c.js → e5471373f89fd7cb9844.js} +1 -1
  196. package/assets/esri/core/workers/chunks/e65d291bab13f7f5323b.js +1 -0
  197. package/assets/esri/core/workers/chunks/e95ee94027c1934086d8.js +1 -0
  198. package/assets/esri/core/workers/chunks/ecbf84a1f42e6188faab.js +1 -0
  199. package/assets/esri/core/workers/chunks/efaa1d05705f6b450e8f.js +1 -0
  200. package/assets/esri/core/workers/chunks/efaf998d18479a0380ae.js +1 -0
  201. package/assets/esri/core/workers/chunks/f0573db9a3d3e1499a7e.js +1 -0
  202. package/assets/esri/core/workers/chunks/f07722efd7fa2b75d4dd.js +1 -0
  203. package/assets/esri/core/workers/chunks/{520e0e5307eef27becc6.js → f0924613f818dd165ad9.js} +1 -1
  204. package/assets/esri/core/workers/chunks/{8b0a01ebc86ab226f01f.js → f23351a04643c464be84.js} +1 -1
  205. package/assets/esri/core/workers/chunks/f3d331da3c61af5c5a2f.js +1 -0
  206. package/assets/esri/core/workers/chunks/f3fe865506fd7428eb6d.js +1 -0
  207. package/assets/esri/core/workers/chunks/{3d20c86f1fe877bf884b.js → f59b76fde2cbd17f64b3.js} +1 -1
  208. package/assets/esri/core/workers/chunks/f6afc597eaf2afa9a4a0.js +1 -0
  209. package/assets/esri/core/workers/chunks/{ed2a1c371dfc5d4a744e.js → f7f820483e45c05ab9e4.js} +2 -2
  210. package/assets/esri/core/workers/chunks/f8cfd0045d06aa24beec.js +1 -0
  211. package/assets/esri/core/workers/chunks/f98bb3885bfc7f18f26c.js +1 -0
  212. package/assets/esri/core/workers/chunks/f9b44ff9bb4f7a88ab56.js +1 -0
  213. package/assets/esri/core/workers/chunks/{b102beeeb7a919f68b51.js → fb81705cec1be2431876.js} +1 -1
  214. package/assets/esri/core/workers/chunks/fd53ef66176ae164e221.js +1 -0
  215. package/assets/esri/core/workers/chunks/fd956a58787020d610af.js +1 -0
  216. package/assets/esri/core/workers/chunks/fdec3a2e100688c42e41.js +1 -0
  217. package/assets/esri/core/workers/chunks/fe6385115d76e16e8da0.js +1 -0
  218. package/assets/esri/core/workers/chunks/fedbeb488d5d7c07c7dc.js +1 -0
  219. package/assets/esri/core/workers/chunks/{d9695794cfaa014a55b1.js → ff00ac01f0baaecaa890.js} +1 -1
  220. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  221. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +62 -90
  222. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +0 -2
  223. package/assets/esri/themes/dark/main.css +1 -1
  224. package/assets/esri/themes/light/main.css +1 -1
  225. package/assets/esri/themes/light/view.css +1 -1
  226. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  227. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
  228. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
  229. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
  230. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
  231. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
  232. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
  233. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
  234. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
  235. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
  236. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
  237. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
  238. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
  239. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
  240. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
  241. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
  242. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
  243. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
  244. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
  245. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
  246. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
  247. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
  248. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
  249. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
  250. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
  251. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
  252. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
  253. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
  254. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
  255. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
  256. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
  257. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
  258. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
  259. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
  260. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
  261. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
  262. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
  263. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
  264. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
  265. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ar.json +1 -1
  266. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bg.json +1 -1
  267. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_bs.json +1 -1
  268. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ca.json +1 -1
  269. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_cs.json +1 -1
  270. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_da.json +1 -1
  271. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_de.json +1 -1
  272. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_el.json +1 -1
  273. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_es.json +1 -1
  274. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_et.json +1 -1
  275. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fi.json +1 -1
  276. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_fr.json +1 -1
  277. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_he.json +1 -1
  278. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hr.json +1 -1
  279. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_hu.json +1 -1
  280. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_id.json +1 -1
  281. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_it.json +1 -1
  282. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ja.json +1 -1
  283. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ko.json +1 -1
  284. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lt.json +1 -1
  285. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_lv.json +1 -1
  286. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_nl.json +1 -1
  287. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_no.json +1 -1
  288. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pl.json +1 -1
  289. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-BR.json +1 -1
  290. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_pt-PT.json +1 -1
  291. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ro.json +1 -1
  292. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_ru.json +1 -1
  293. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sk.json +1 -1
  294. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sl.json +1 -1
  295. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sr.json +1 -1
  296. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_sv.json +1 -1
  297. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_th.json +1 -1
  298. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_tr.json +1 -1
  299. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_uk.json +1 -1
  300. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_vi.json +1 -1
  301. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-CN.json +1 -1
  302. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-HK.json +1 -1
  303. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_zh-TW.json +1 -1
  304. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  305. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  306. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  307. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  308. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  309. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  310. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  311. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  312. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  313. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  314. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  315. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  316. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  317. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  318. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  319. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  320. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  321. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  322. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  323. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  324. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  325. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  326. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  327. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  328. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  329. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  330. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  331. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  332. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  333. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  334. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  335. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  336. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  337. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  338. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  339. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  340. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  341. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  342. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  343. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  344. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  345. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  346. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  347. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  348. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  349. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  350. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  351. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  352. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  353. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  354. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  355. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  356. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  357. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  358. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  359. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  360. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  361. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  362. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  363. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  364. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  365. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  366. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  367. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  368. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  369. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  370. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  371. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  372. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  373. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  374. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  375. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  376. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  377. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  378. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  379. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  380. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  381. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  382. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  383. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  384. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  385. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  386. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  387. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  388. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  389. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  390. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  391. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  392. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  393. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  394. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  395. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  396. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  397. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  398. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  399. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  400. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  401. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  402. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  403. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  404. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  405. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  406. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  407. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  408. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  409. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  410. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  411. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  412. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  413. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  414. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  415. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  416. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  417. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  418. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  419. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  420. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  421. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ar.json +1 -1
  422. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_bg.json +1 -1
  423. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_bs.json +1 -1
  424. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ca.json +1 -1
  425. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_cs.json +1 -1
  426. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_da.json +1 -1
  427. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_de.json +1 -1
  428. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_el.json +1 -1
  429. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_es.json +1 -1
  430. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_et.json +1 -1
  431. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fi.json +1 -1
  432. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_fr.json +1 -1
  433. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_he.json +1 -1
  434. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_hr.json +1 -1
  435. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_hu.json +1 -1
  436. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_id.json +1 -1
  437. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_it.json +1 -1
  438. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ja.json +1 -1
  439. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ko.json +1 -1
  440. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_lt.json +1 -1
  441. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_lv.json +1 -1
  442. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_nl.json +1 -1
  443. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_no.json +1 -1
  444. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pl.json +1 -1
  445. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pt-BR.json +1 -1
  446. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_pt-PT.json +1 -1
  447. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ro.json +1 -1
  448. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_ru.json +1 -1
  449. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sk.json +1 -1
  450. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sl.json +1 -1
  451. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sr.json +1 -1
  452. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_sv.json +1 -1
  453. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_th.json +1 -1
  454. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_tr.json +1 -1
  455. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_uk.json +1 -1
  456. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_vi.json +1 -1
  457. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-CN.json +1 -1
  458. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-HK.json +1 -1
  459. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer_zh-TW.json +1 -1
  460. package/chunks/Bufferer-CclWhXVb.js +2 -0
  461. package/chunks/Distance2DCalculator-DjIp2uQi.js +2 -0
  462. package/chunks/Envelope.js +1 -1
  463. package/chunks/Envelope2D.js +1 -1
  464. package/chunks/GaussianSplatComposition.glsl.js +1 -1
  465. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +2 -0
  466. package/chunks/GeodeticUtils.js +1 -1
  467. package/chunks/Geometry.js +1 -1
  468. package/chunks/{GeometryCleaner-BEJM7I4l.js → GeometryCleaner-CIE8Wfmb.js} +1 -1
  469. package/chunks/GlowComposition.glsl.js +1 -1
  470. package/chunks/MultiPathImpl.js +1 -1
  471. package/chunks/OITBlend.glsl.js +1 -1
  472. package/chunks/OITDimOpaque.glsl.js +1 -1
  473. package/chunks/OperatorClip.js +1 -1
  474. package/chunks/OperatorCrosses.js +1 -1
  475. package/chunks/OperatorCut.js +1 -1
  476. package/chunks/OperatorDefinitions.js +1 -1
  477. package/chunks/OperatorDensify.js +1 -1
  478. package/chunks/OperatorGeneralize.js +1 -1
  479. package/chunks/OperatorGeodesicBuffer.js +1 -1
  480. package/chunks/OperatorGeodeticArea.js +1 -1
  481. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  482. package/chunks/OperatorGeodeticDistance.js +1 -1
  483. package/chunks/OperatorGeodeticLength.js +1 -1
  484. package/chunks/OperatorGraphicBuffer.js +2 -0
  485. package/chunks/OperatorIntegrate.js +1 -1
  486. package/chunks/OperatorIntersects.js +1 -1
  487. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  488. package/chunks/OperatorOverlaps.js +1 -1
  489. package/chunks/OperatorProximity.js +1 -1
  490. package/chunks/OperatorProximityGeodesic.js +1 -1
  491. package/chunks/OperatorShapePreservingLength.js +1 -1
  492. package/chunks/OperatorShapePreservingProject.js +1 -1
  493. package/chunks/OperatorSimplifyOGC.js +1 -1
  494. package/chunks/OperatorTouches.js +1 -1
  495. package/chunks/OperatorWithin.js +1 -1
  496. package/chunks/Point2D.js +1 -1
  497. package/chunks/ProjectionTransformation.js +1 -1
  498. package/chunks/{SideCalculator2D-BNwb5gvz.js → SideCalculator2D-DX0718xq.js} +1 -1
  499. package/chunks/SimpleGeometryCursor.js +1 -1
  500. package/chunks/SpatialReference.js +1 -1
  501. package/chunks/Transformation2D.js +1 -1
  502. package/chunks/centroidOperator.js +1 -1
  503. package/chunks/containsOperator.js +1 -1
  504. package/chunks/disjointOperator.js +1 -1
  505. package/chunks/distanceOperator.js +1 -1
  506. package/chunks/equalsOperator.js +1 -1
  507. package/chunks/languageUtils.js +1 -1
  508. package/config.js +1 -1
  509. package/core/has.js +1 -1
  510. package/core/screenUtils.js +1 -1
  511. package/editing/types.d.ts +22 -2
  512. package/form/elements/UtilityNetworkAssociationsElement.d.ts +0 -1
  513. package/geometry/Mesh.d.ts +1 -1
  514. package/geometry/operators/extendOperator.js +1 -1
  515. package/geometry/operators/gx/operatorAffineTransform.js +1 -1
  516. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  517. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  518. package/geometry/operators/gx/operatorBoundary.js +1 -1
  519. package/geometry/operators/gx/operatorBuffer.js +1 -1
  520. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  521. package/geometry/operators/gx/operatorDifference.js +1 -1
  522. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  523. package/geometry/operators/gx/operatorIntersection.js +1 -1
  524. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  525. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  526. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  527. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  528. package/geometry/operators/gx/operatorOffset.js +1 -1
  529. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  530. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  531. package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
  532. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  533. package/geometry/operators/gx/operatorUnion.js +1 -1
  534. package/geometry/operators/isNearOperator.js +1 -1
  535. package/geometry/operators/json/containsOperator.js +1 -1
  536. package/geometry/operators/json/disjointOperator.js +1 -1
  537. package/geometry/operators/reshapeOperator.js +1 -1
  538. package/geometry/operators/support/apiConverter.js +1 -1
  539. package/geometry/operators/support/initNoPeFactory.js +1 -1
  540. package/geometry/operators/support/jsonConverter.js +1 -1
  541. package/geometry/support/aaBoundingRect.js +1 -1
  542. package/graphic/AnnotationFeatureGraphicOrigin.d.ts +5 -2
  543. package/graphic/AnnotationFeatureGraphicOrigin.js +1 -1
  544. package/graphic/DimensionFeatureGraphicOrigin.js +1 -1
  545. package/graphic/graphicOrigins.js +1 -1
  546. package/graphic/isAnnotationFeatureGraphicOrigin.d.ts +29 -0
  547. package/graphic/isAnnotationFeatureGraphicOrigin.js +2 -0
  548. package/graphic/isDimensionFeatureGraphicOrigin.d.ts +29 -0
  549. package/graphic/isDimensionFeatureGraphicOrigin.js +2 -0
  550. package/interfaces.d.ts +3 -3
  551. package/kernel.js +1 -1
  552. package/layers/AnnotationFeatureLayer.d.ts +73 -0
  553. package/layers/AnnotationFeatureLayer.js +1 -1
  554. package/layers/FeatureLayer.d.ts +7 -4
  555. package/layers/FeatureLayer.js +1 -1
  556. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  557. package/layers/ParquetLayer.js +1 -1
  558. package/layers/SubtypeGroupLayer.d.ts +7 -4
  559. package/layers/SubtypeGroupLayer.js +1 -1
  560. package/layers/graphics/applyEditsUtils.js +1 -1
  561. package/layers/graphics/data/QueryEngine.js +1 -1
  562. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  563. package/layers/graphics/sources/MemorySource.js +1 -1
  564. package/layers/graphics/sources/ParquetSource.js +1 -1
  565. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  566. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  567. package/layers/orientedImagery/transformations/utils.js +1 -1
  568. package/layers/support/{AnnotationSublayer.d.ts → AnnotationFeatureSublayer.d.ts} +12 -12
  569. package/layers/support/AnnotationFeatureSublayer.js +2 -0
  570. package/layers/support/EditingCapabilities.js +1 -1
  571. package/layers/support/ParquetPortalItemData.js +1 -1
  572. package/layers/support/SubtypeSublayer.d.ts +7 -4
  573. package/layers/support/SubtypeSublayer.js +1 -1
  574. package/layers/support/featureLayerUtils.js +1 -1
  575. package/networks/CircuitManager.d.ts +247 -1
  576. package/networks/UnitIdentifierManager.d.ts +40 -3
  577. package/networks/UtilityNetwork.d.ts +0 -11
  578. package/networks/UtilityNetwork.js +1 -1
  579. package/networks/support/Circuit.d.ts +0 -1
  580. package/networks/support/CircuitLocation.d.ts +0 -1
  581. package/networks/support/CircuitPath.d.ts +0 -1
  582. package/networks/support/CircuitPathConnectivityElement.d.ts +0 -1
  583. package/networks/support/CircuitSection.d.ts +0 -1
  584. package/networks/support/NamedTraceConfiguration.d.ts +1 -7
  585. package/networks/support/Subcircuit.d.ts +0 -1
  586. package/networks/support/UNTraceConfiguration.d.ts +0 -4
  587. package/networks/support/jsonTypes.d.ts +1 -1
  588. package/networks/support/typeUtils.d.ts +10 -1
  589. package/networks/support/typeUtils.js +1 -1
  590. package/package.json +3 -3
  591. package/popup/Feature.d.ts +57 -6
  592. package/popup/Features.d.ts +86 -7
  593. package/popup/content/UtilityNetworkAssociationsContent.d.ts +0 -1
  594. package/popup/support/UtilityNetworkAssociationType.d.ts +0 -1
  595. package/rest/networks/circuits/support/CircuitTraceResult.d.ts +0 -1
  596. package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +0 -1
  597. package/rest/networks/support/TelecomNetworkElement.d.ts +0 -1
  598. package/rest/networks/support/TraceLocation.d.ts +1 -11
  599. package/rest/networks/support/TraceParameters.d.ts +1 -7
  600. package/rest/networks/support/TraceResult.d.ts +0 -2
  601. package/rest/networks/support/TraverseAssociationsParameters.d.ts +69 -0
  602. package/rest/networks/support/TraverseAssociationsParameters.js +2 -0
  603. package/rest/networks/support/TraverseAssociationsResult.d.ts +39 -0
  604. package/rest/networks/support/TraverseAssociationsResult.js +2 -0
  605. package/rest/networks/traverseAssociations.d.ts +21 -0
  606. package/rest/networks/traverseAssociations.js +2 -0
  607. package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +0 -1
  608. package/rest/print.js +1 -1
  609. package/rest/query/operations/query.js +1 -1
  610. package/smartMapping/renderers/location.js +1 -1
  611. package/smartMapping/renderers/opacity.js +1 -1
  612. package/smartMapping/renderers/predominance.js +1 -1
  613. package/smartMapping/renderers/support/regenerateUtils.js +1 -1
  614. package/smartMapping/renderers/support/rendererUtils.d.ts +3 -1
  615. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  616. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  617. package/support/revision.js +1 -1
  618. package/symbols/WebStyleSymbol.js +1 -1
  619. package/symbols/cim/effects/EffectOffset.js +1 -1
  620. package/symbols/support/symbolUtils.js +1 -1
  621. package/symbols/support/webStyleSymbolCache.js +2 -0
  622. package/third-party-notices.txt +0 -32
  623. package/undoredo/support/ApplySet.js +1 -1
  624. package/undoredo/support/ApplySetItem.js +1 -1
  625. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  626. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  627. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  628. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  629. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  630. package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +1 -1
  631. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
  632. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  633. package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
  634. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  635. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  636. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  637. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  638. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  639. package/views/2d/layers/support/annodime/annotationGraphic.js +1 -1
  640. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  641. package/views/2d/layers/support/annodime/utils.js +1 -1
  642. package/views/2d/support/hitTestUtils.js +1 -1
  643. package/views/2d/unitBezier.js +1 -1
  644. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +2 -0
  645. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  646. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
  647. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +2 -0
  648. package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +1 -1
  649. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  650. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  651. package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +1 -1
  652. package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
  653. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  654. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  655. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  656. package/views/3d/layers/graphics/SymbolComplexity.js +1 -1
  657. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  658. package/views/3d/support/QualityProfile.js +1 -1
  659. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  660. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  661. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +14 -6
  662. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +2 -1
  663. package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +1 -1
  664. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  665. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  666. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  667. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  668. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  669. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  670. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  671. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  672. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  673. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +6 -7
  674. package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +1 -1
  675. package/views/LinkChartView.d.ts +3 -1
  676. package/views/View2D.d.ts +3 -1
  677. package/views/draw/DrawTool.js +1 -1
  678. package/views/draw/support/editingSessionUtils.js +1 -1
  679. package/views/interactive/snapping/SnappingManager.js +1 -1
  680. package/views/interactive/snapping/candidates/dehydrated/{DehydratedVertexSnappingCandidate.js → DehydratedFeatureSnappingCandidate.js} +1 -1
  681. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +10 -3
  682. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  683. package/widgets/BatchAttributeForm/attachmentUtils.d.ts +9 -0
  684. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  685. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  686. package/widgets/BatchAttributeForm/css.js +1 -1
  687. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +3 -3
  688. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  689. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  690. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  691. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  692. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  693. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  694. package/widgets/BatchAttributeForm/inputs/support/attachmentValidationCriteriaState.d.ts +1 -1
  695. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  696. package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
  697. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  698. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  699. package/widgets/BatchAttributeForm/types.d.ts +92 -7
  700. package/widgets/BatchAttributeForm.js +1 -1
  701. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  702. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  703. package/widgets/Editor/EditorViewModel.d.ts +1 -1
  704. package/widgets/Editor/EditorViewModel.js +1 -1
  705. package/widgets/Editor/Edits.js +1 -1
  706. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  707. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  708. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  709. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  710. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  711. package/widgets/Editor/UpdateWorkflow.js +1 -1
  712. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  713. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  714. package/widgets/Editor/support/EditorItem.js +1 -1
  715. package/widgets/Editor/support/SketchController.js +1 -1
  716. package/widgets/Editor/support/attachmentUtils.js +2 -0
  717. package/widgets/Editor/workflowUtils.js +1 -1
  718. package/widgets/Editor.js +1 -1
  719. package/widgets/Feature/FeatureViewModel.d.ts +0 -1
  720. package/widgets/FeatureForm/UtilityNetworkAssociationInput.d.ts +0 -1
  721. package/widgets/Features/FeaturesViewModel.d.ts +0 -1
  722. package/widgets/Features/FeaturesViewModel.js +1 -1
  723. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  724. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  725. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  726. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  727. package/widgets/OrientedImageryViewer.js +1 -1
  728. package/widgets/Popup.js +1 -1
  729. package/widgets/Sketch/SketchViewModel.d.ts +10 -1
  730. package/widgets/Sketch/SketchViewModel.js +1 -1
  731. package/widgets/Sketch.js +1 -1
  732. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +3 -2
  733. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  734. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  735. package/assets/components/assets/icon/orientedImageryFullSuperimpose16.json +0 -1
  736. package/assets/components/assets/icon/orientedImageryFullSuperimpose24.json +0 -1
  737. package/assets/components/assets/icon/orientedImageryFullSuperimpose32.json +0 -1
  738. package/assets/components/assets/icon/orientedImageryHalfSuperimpose16.json +0 -1
  739. package/assets/components/assets/icon/orientedImageryHalfSuperimpose24.json +0 -1
  740. package/assets/components/assets/icon/orientedImageryHalfSuperimpose32.json +0 -1
  741. package/assets/components/assets/icon/orientedImagerySceneOnly16.json +0 -1
  742. package/assets/components/assets/icon/orientedImagerySceneOnly24.json +0 -1
  743. package/assets/components/assets/icon/orientedImagerySceneOnly32.json +0 -1
  744. package/assets/components/assets/icon/parquetFeatureLayer16.json +0 -1
  745. package/assets/components/assets/icon/parquetFeatureLayer24.json +0 -1
  746. package/assets/components/assets/icon/parquetFeatureLayer32.json +0 -1
  747. package/assets/esri/core/workers/chunks/013708f40f811158d42c.js +0 -1
  748. package/assets/esri/core/workers/chunks/01ba5319cac3e0f14205.js +0 -1
  749. package/assets/esri/core/workers/chunks/03354e9256b2f77fd4f2.js +0 -1
  750. package/assets/esri/core/workers/chunks/0436fe89adc78696251c.js +0 -1
  751. package/assets/esri/core/workers/chunks/079b412d07d02504f1db.js +0 -1
  752. package/assets/esri/core/workers/chunks/0826d36dfbfa28442b70.js +0 -1
  753. package/assets/esri/core/workers/chunks/0bf72e9d0a6deceeb406.js +0 -1
  754. package/assets/esri/core/workers/chunks/0ded58ccb83f624f1460.js +0 -1
  755. package/assets/esri/core/workers/chunks/0ecc1bc1686844cdd60e.js +0 -1
  756. package/assets/esri/core/workers/chunks/152f1c08197955224ad3.js +0 -1
  757. package/assets/esri/core/workers/chunks/174cc2e69e5b5a13d880.js +0 -1
  758. package/assets/esri/core/workers/chunks/181e948d076a9a7aae8a.js +0 -1
  759. package/assets/esri/core/workers/chunks/18e7784f13a57a75585a.js +0 -1
  760. package/assets/esri/core/workers/chunks/1c8436b27a3d3cde5cfc.js +0 -1
  761. package/assets/esri/core/workers/chunks/1d81e667a580c5cdeda1.js +0 -262
  762. package/assets/esri/core/workers/chunks/1dacc0b64bd27ce2de3a.js +0 -1
  763. package/assets/esri/core/workers/chunks/1eeb1edca0ad5db6917c.js +0 -1
  764. package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +0 -1
  765. package/assets/esri/core/workers/chunks/1f289aa69dd6b6be534a.js +0 -1
  766. package/assets/esri/core/workers/chunks/27c6def22c2b0791ce9e.js +0 -1
  767. package/assets/esri/core/workers/chunks/2bc4aff77c830061e16e.js +0 -1
  768. package/assets/esri/core/workers/chunks/2c3fc2805f6de0963789.js +0 -1
  769. package/assets/esri/core/workers/chunks/2d2895f1fdf44d212a4d.js +0 -1
  770. package/assets/esri/core/workers/chunks/2e6382d50bf012064eae.js +0 -1
  771. package/assets/esri/core/workers/chunks/3248001d9dfb9153699e.js +0 -1
  772. package/assets/esri/core/workers/chunks/33b4f5dfe1a16b59b010.js +0 -1
  773. package/assets/esri/core/workers/chunks/36dac6ab51d9dbdd091d.js +0 -1
  774. package/assets/esri/core/workers/chunks/36dd3ad3ef2fbfc15cbd.js +0 -1
  775. package/assets/esri/core/workers/chunks/39974d1e5d3820ef1680.js +0 -1
  776. package/assets/esri/core/workers/chunks/3dc6e9494af16f7b8009.js +0 -1
  777. package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +0 -1
  778. package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +0 -1
  779. package/assets/esri/core/workers/chunks/42e5e00610f281ca8ffa.js +0 -1
  780. package/assets/esri/core/workers/chunks/4301cb9670fa7c907460.js +0 -1
  781. package/assets/esri/core/workers/chunks/493a0981e90a5799fb5b.js +0 -1
  782. package/assets/esri/core/workers/chunks/4c54cb80c4dc9bbbd395.js +0 -1
  783. package/assets/esri/core/workers/chunks/4cc78493805671708a9b.js +0 -1
  784. package/assets/esri/core/workers/chunks/4e4419282c4bf7ee4678.js +0 -1
  785. package/assets/esri/core/workers/chunks/4e788fc6cb2ea936f676.js +0 -1
  786. package/assets/esri/core/workers/chunks/4efef5fa8bf23aaf34cd.js +0 -1
  787. package/assets/esri/core/workers/chunks/5100b5a6a506c704dfaf.js +0 -1
  788. package/assets/esri/core/workers/chunks/5121768c70f1e03b685c.js +0 -1
  789. package/assets/esri/core/workers/chunks/52afd43bbe23e358efb5.js +0 -1
  790. package/assets/esri/core/workers/chunks/52f354bf80ee5ab0379a.js +0 -1
  791. package/assets/esri/core/workers/chunks/5359ff9492383c5bd9b1.js +0 -1
  792. package/assets/esri/core/workers/chunks/54d7f07e3348ddb6d9a2.js +0 -1
  793. package/assets/esri/core/workers/chunks/57b7e5fde972d3ad7884.js +0 -1
  794. package/assets/esri/core/workers/chunks/597aa39cdb5366ef9a74.js +0 -1
  795. package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +0 -1
  796. package/assets/esri/core/workers/chunks/5cb1b950249d651f3837.js +0 -1
  797. package/assets/esri/core/workers/chunks/5cb274e5759f7ca0d4ed.js +0 -1
  798. package/assets/esri/core/workers/chunks/5d8924fdcdb473d261cd.js +0 -1
  799. package/assets/esri/core/workers/chunks/62de9e83331fb10aac6a.js +0 -2
  800. package/assets/esri/core/workers/chunks/62e77e3c5ca9b4887923.js +0 -2
  801. package/assets/esri/core/workers/chunks/64114a7d2da162987958.js +0 -1
  802. package/assets/esri/core/workers/chunks/641cddee377599916de2.js +0 -2
  803. package/assets/esri/core/workers/chunks/65520a443e3811255bea.js +0 -1
  804. package/assets/esri/core/workers/chunks/65f02eca694cc1c9f5a7.js +0 -1
  805. package/assets/esri/core/workers/chunks/6821462e5c1e9c76010a.js +0 -1
  806. package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +0 -1
  807. package/assets/esri/core/workers/chunks/6f5a82388a5eb5fcf1b7.js +0 -1
  808. package/assets/esri/core/workers/chunks/6f5d61f734ec40dafabb.js +0 -1
  809. package/assets/esri/core/workers/chunks/737de87bfb9b5f5a9c6c.js +0 -1
  810. package/assets/esri/core/workers/chunks/7748743d4be047094d67.js +0 -1
  811. package/assets/esri/core/workers/chunks/78c53aeb0a408ab3c80c.js +0 -1
  812. package/assets/esri/core/workers/chunks/79f2d4b3af5776ec2045.js +0 -1
  813. package/assets/esri/core/workers/chunks/7a8ed08cd173963b3112.js +0 -1
  814. package/assets/esri/core/workers/chunks/7b5c1030a7cf0f382cc4.js +0 -1
  815. package/assets/esri/core/workers/chunks/7cadb872b9ca96eedca5.js +0 -1
  816. package/assets/esri/core/workers/chunks/7cee81c5aa1e6b7d2452.js +0 -1
  817. package/assets/esri/core/workers/chunks/7ed3d6c72f23c628df3b.js +0 -1
  818. package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +0 -1
  819. package/assets/esri/core/workers/chunks/8351012ceb466f01b8fd.js +0 -1
  820. package/assets/esri/core/workers/chunks/859bc873e7af911a518f.js +0 -1
  821. package/assets/esri/core/workers/chunks/8e99f937fd36cf2cd05f.js +0 -1
  822. package/assets/esri/core/workers/chunks/93bd56396b8cd020f965.js +0 -1
  823. package/assets/esri/core/workers/chunks/94fac056e14caed09682.js +0 -1
  824. package/assets/esri/core/workers/chunks/957f7b8de4aecb6f644e.js +0 -1
  825. package/assets/esri/core/workers/chunks/97d2bdbea39cbcf8fd0f.js +0 -1
  826. package/assets/esri/core/workers/chunks/99101789035f1787c630.js +0 -1
  827. package/assets/esri/core/workers/chunks/9c6d34bb666f630d511f.js +0 -1
  828. package/assets/esri/core/workers/chunks/a0208e35b217808777c4.js +0 -1
  829. package/assets/esri/core/workers/chunks/a320998f18922a35899f.js +0 -1
  830. package/assets/esri/core/workers/chunks/a4e9a17dacbb52444d75.js +0 -1
  831. package/assets/esri/core/workers/chunks/a4f3bcfabd4ad127abf2.js +0 -1
  832. package/assets/esri/core/workers/chunks/a5abba59e738c3240c22.js +0 -1
  833. package/assets/esri/core/workers/chunks/a63bba226de6c5e464b0.js +0 -1
  834. package/assets/esri/core/workers/chunks/a9f29ff36a7ae5bae686.js +0 -1
  835. package/assets/esri/core/workers/chunks/aae0049c2c3e15a813e8.js +0 -1
  836. package/assets/esri/core/workers/chunks/adc32f6b45ea3026fc34.js +0 -1
  837. package/assets/esri/core/workers/chunks/af8ef6701631ed5e5b80.js +0 -1
  838. package/assets/esri/core/workers/chunks/b045bffb4f2eb9203183.js +0 -1
  839. package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +0 -1
  840. package/assets/esri/core/workers/chunks/b666027b9022fa346a79.js +0 -1
  841. package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +0 -1
  842. package/assets/esri/core/workers/chunks/b803e7b0d489bb628d72.js +0 -1
  843. package/assets/esri/core/workers/chunks/bb24972603fb35dd8dcf.js +0 -1
  844. package/assets/esri/core/workers/chunks/bcc097271f5cdf0a97a7.js +0 -1
  845. package/assets/esri/core/workers/chunks/c0cbc50e5afd68bd485c.js +0 -1
  846. package/assets/esri/core/workers/chunks/c2cd80b712f29e8cbb8d.js +0 -1
  847. package/assets/esri/core/workers/chunks/c3ff2ff0a86a9143d7a5.js +0 -1
  848. package/assets/esri/core/workers/chunks/c6d0b4875b6b8d6bc25a.js +0 -1
  849. package/assets/esri/core/workers/chunks/c9a4601073e1a3eee9d0.js +0 -1
  850. package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +0 -1
  851. package/assets/esri/core/workers/chunks/cf8ce21dc649021e97f6.js +0 -1
  852. package/assets/esri/core/workers/chunks/d78b7cac322755e87eb8.js +0 -1
  853. package/assets/esri/core/workers/chunks/dddb57ff637643ccfc87.js +0 -1
  854. package/assets/esri/core/workers/chunks/df18b0a653b328d8d052.js +0 -1
  855. package/assets/esri/core/workers/chunks/e1bf87077541da6853c6.js +0 -1
  856. package/assets/esri/core/workers/chunks/e3b713a590cce6245ee2.js +0 -1
  857. package/assets/esri/core/workers/chunks/e4406baf206b9e4c7e4f.js +0 -1
  858. package/assets/esri/core/workers/chunks/e499252cb52f7aed49a0.js +0 -1
  859. package/assets/esri/core/workers/chunks/e4e2f479c0c45ae1b2c3.js +0 -1
  860. package/assets/esri/core/workers/chunks/e5f8c73349407c25956b.js +0 -1
  861. package/assets/esri/core/workers/chunks/e656fd5ecf9ac059a87b.js +0 -1
  862. package/assets/esri/core/workers/chunks/e92698f50089484c4901.js +0 -1
  863. package/assets/esri/core/workers/chunks/e9c5c295b6bf10e942a4.js +0 -1
  864. package/assets/esri/core/workers/chunks/eb91dc957c328674e119.js +0 -1
  865. package/assets/esri/core/workers/chunks/ed3d16a5b4084ef61f8a.js +0 -1
  866. package/assets/esri/core/workers/chunks/edcde00495727d506c46.js +0 -1
  867. package/assets/esri/core/workers/chunks/efb4aa5886730ea377bd.js +0 -1
  868. package/assets/esri/core/workers/chunks/f0832b413612c77a62ca.js +0 -1
  869. package/assets/esri/core/workers/chunks/f116331c6eca937aac8e.js +0 -1
  870. package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +0 -1
  871. package/assets/esri/core/workers/chunks/f334bf192dff5af10a70.js +0 -1
  872. package/assets/esri/core/workers/chunks/f518835b2dc89a48cfb1.js +0 -1
  873. package/assets/esri/core/workers/chunks/f5731ad4cfbbf1cc569a.js +0 -2
  874. package/assets/esri/core/workers/chunks/f76b1fc36f5606cac2c8.js +0 -1
  875. package/assets/esri/core/workers/chunks/f7fca88d120d45bb782a.js +0 -1
  876. package/assets/esri/core/workers/chunks/f819854098d63fe4ccdb.js +0 -1
  877. package/assets/esri/core/workers/chunks/f98118127469449ca145.js +0 -1
  878. package/assets/esri/core/workers/chunks/f9e22cf59e2e2782d70f.js +0 -1
  879. package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +0 -1
  880. package/assets/esri/core/workers/chunks/fbe7dae0b4bf2d172487.js +0 -1
  881. package/assets/esri/core/workers/chunks/fea3b6bef761ef78630e.js +0 -1
  882. package/chunks/Bufferer-Dw9Qi4T1.js +0 -2
  883. package/chunks/Distance2DCalculator-CXhBP-8I.js +0 -2
  884. package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +0 -2
  885. package/layers/support/AnnotationSublayer.js +0 -2
  886. package/views/3d/analysis/LineOfSight/LineOfSightPlacementTool.js +0 -2
  887. /package/assets/esri/core/workers/chunks/{d9d4754062758789f186.js.LICENSE.txt → 05016e5a1de384994001.js.LICENSE.txt} +0 -0
  888. /package/assets/esri/core/workers/chunks/{62e77e3c5ca9b4887923.js.LICENSE.txt → 0d42322362e76f674d94.js.LICENSE.txt} +0 -0
  889. /package/assets/esri/core/workers/chunks/{62de9e83331fb10aac6a.js.LICENSE.txt → 35533c8ef541f7643497.js.LICENSE.txt} +0 -0
  890. /package/assets/esri/core/workers/chunks/{641cddee377599916de2.js.LICENSE.txt → 99c002015c2127e6cbfc.js.LICENSE.txt} +0 -0
  891. /package/assets/esri/core/workers/chunks/{f5731ad4cfbbf1cc569a.js.LICENSE.txt → c318e6dbb8651433038f.js.LICENSE.txt} +0 -0
  892. /package/chunks/{Centroid-DZi-eb9F.js → Centroid-CA-TwbbN.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{Q as t,d as e,a as s,G as i,x as n,E as r,c as h,P as o,i as a,b as m,A as _,B as l,j as u,m as d,w as c}from"./Point2D.js";import{Envelope2D as p}from"./Envelope2D.js";import{g,a as f,r as v,G as y,t as x,u as E,d as b,q as N,i as D,h as I}from"./Geometry.js";const C=[0,0,Number.NaN,0,0,0,0,0,-1,-1,0,0,0,0],T=[2,1,1,1,3,1,2,3,2,4,1,1,2,1],R=[1,1,1,0,2,1,1,1,0,0,0,0,0,1],A=[1,1,1,2,0,0,0,0,2,2,4,2,2,1],q=[4,8,4,8,1],w=25;function B(){return e(w,Number.NaN)}let z=class s{getAttributeCount(){return this.m_attributeCount}getSemantics(t){return this.m_indexToSemantics[t]}getSemanticsBitArray(){return this.m_semanticsBitArray}getAttributeIndex(t){return this.m_semanticsToIndexMap[t]}static getInterpolation(t){return R[t]}static getPersistence(t){return A[t]}static getPersistenceSize(t){return q[t]}static getPersistenceSizeFromSemantics(t){return s.getPersistenceSize(s.getPersistence(t))*s.getComponentCount(t)}static getComponentCount(t){return T[t]}static maxComponentCount(){return 4}static isInteger(t){return 2===t||3===t||4===t}static isIntegerSemantics(t){return s.isInteger(s.getPersistence(t))}static isTexture(t){return 5===t||6===t||7===t}hasAttribute(t){return!!(this.m_semanticsBitArray&1<<t)}hasAttributesFrom(t){return(this.m_semanticsBitArray&t.m_semanticsBitArray)===t.m_semanticsBitArray}hasZ(){return this.hasAttribute(1)}hasM(){return this.hasAttribute(2)}hasID(){return this.hasAttribute(3)}getTotalComponentCount(){return this.m_totalComponentCount}static getDefaultValue(t){return C[t]}static isDefaultValue(e,s){return t(C[e],s)}equals(t){return this===t}getDefaultPointAttributes(){return this.m_defaultPointAttributes}getPointAttributeOffset(t){return this.m_pointAttributeOffsets[t]}constructor(t){this.m_semanticsBitArray=t,this.m_attributeCount=0,this.m_totalComponentCount=0,this.m_semanticsToIndexMap=new Int32Array(14),this.m_indexToSemantics=new Int32Array(14),this.m_pointAttributeOffsets=new Int32Array(14),this.m_defaultPointAttributes=e(w,Number.NaN),this.m_semanticsToIndexMap.fill(-1),this.m_indexToSemantics.fill(-1);let i=0,n=1,r=14;for(;i<r;i++)t&n&&(this.m_semanticsToIndexMap[i]=this.m_attributeCount,this.m_indexToSemantics[this.m_attributeCount]=i,this.m_attributeCount++,this.m_totalComponentCount+=s.getComponentCount(i)),n<<=1;let h=0;for(i=0,r=this.getAttributeCount();i<r;i++){const t=this.getSemantics(i),e=s.getComponentCount(t),n=s.getDefaultValue(t);this.m_pointAttributeOffsets[i]=h;for(let s=0;s<e;s++)this.m_defaultPointAttributes[h]=n,h++}}};var L=z;function S(){return e(14,0)}class F{static getInstance(){return F.s_thisInstance}constructor(){this.m_map=new Map,this.m_vd2D=new L(1),this.m_map.set(1,this.m_vd2D),this.m_vd3D=new L(3),this.m_map.set(3,this.m_vd2D)}GetVD2D(){return this.m_vd2D}GetVD3D(){return this.m_vd3D}FindOrAdd(t){if(1===t)return this.GetVD2D();if(3===t)return this.GetVD3D();const e=this.m_map.get(t);if(e)return e;const s=new L(t);return this.m_map.set(t,s),s}}function P(t){return F.getInstance().FindOrAdd(t)}function H(t,e){if(!t||!e)return e||t;const s=t.getSemanticsBitArray()|e.getSemanticsBitArray();return(s&t.getSemanticsBitArray())===s?t:(s&e.getSemanticsBitArray())===s?e:P(s)}function V(t,e){const s=t.getSemanticsBitArray()|1<<e;return(s&t.getSemanticsBitArray())===s?t:P(s)}function k(t,e){const s=(t.getSemanticsBitArray()|1<<e)-(1<<e);return s===t.getSemanticsBitArray()?t:P(s)}function M(){return F.getInstance().GetVD2D()}function O(){return F.getInstance().GetVD3D()}function Y(t,e,s){if(s.fill(-1),null!==t&&null!==e)for(let i=0,n=t.getAttributeCount();i<n;i++)s[i]=e.getAttributeIndex(t.getSemantics(i))}F.s_thisInstance=new F;class X{static construct(t,e,s){return new X(t,e,s)}constructor(t,e,s){void 0!==t?(this.x=t,this.y=e,this.z=s):this.x=this.y=this.z=Number.NaN}get 0(){return this.x}get 1(){return this.y}get 2(){return this.z}set 0(t){this.x=t}set 1(t){this.y=t}set 2(t){this.z=t}clone(){return new X(this.x,this.y,this.z)}assign(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}setCoords(t,e,s){return this.x=t,this.y=e,this.z=s,this}setCoordsPoint2DZ(t,e){return this.setCoords(t.x,t.y,e)}setCoordsPoint3D(t){this.x=t.x,this.y=t.y,this.z=t.z}setZero(){this.x=0,this.y=0,this.z=0}setNormalized(t){this.assign(t),this.normalizeThis()}normalizeThis(){const t=this.length();return t?(this.x/=t,this.y/=t,this.z/=t):(this.x=1,this.y=0,this.z=0),this}getUnitVector(){const t=new X;return t.setNormalized(this),t}sqrLength(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthXY(){return g(0),0}static sqrDistance(t,e){return s(t.x-e.x)+s(t.y-e.y)+s(t.z-e.z)}static sqrDistanceCoords(t,e,i,n,r,h){return s(t-n)+s(e-r)+s(i-h)}static distance(t,e){return Math.sqrt(X.sqrDistance(t,e))}isEqual(t,e){return void 0===e&&(e=0),Math.abs(this.x-t.x)<=e&&Math.abs(this.y-t.y)<=e&&i(this.z,t.z,e)}static compareByLength(t,e,s,i){return g(0),0}isEqualCoords(t,e,s,i){return g(0),this.x===t&&this.y===e&&this.z===s}isEqualsTols(t,e,s){return g(0),!1}isEqualCoordsTols(t,e,s,i,n){return g(0),!1}static st_isEqual(t,e,s,i){return g(0),!1}equals(t,e){return this.isEqual(t,e)}equalsTols(t,e,s){return g(0),!1}divThis(t){return this.x/=t,this.y/=t,this.z/=t,this}subThis(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}setSub(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}sub(t){return X.construct(this.x-t.x,this.y-t.y,this.z-t.z)}addThis(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}add(t){return this.clone().addThis(t)}setAdd(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}mul(t){return X.construct(this.x*t,this.y*t,this.z*t)}dotProduct(t){return this.x*t.x+this.y*t.y+this.z*t.z}crossProductVector(t){const e=this.y*t.z-t.y*this.z,s=t.x*this.z-this.x*t.z,i=this.x*t.y-t.x*this.y;return new X(e,s,i)}setCrossProductVector(t,e){const s=t.y*e.z-e.y*t.z,i=e.x*t.z-t.x*e.z,n=t.x*e.y-e.x*t.y;return this.x=s,this.y=i,this.z=n,this}setScaled(t,e){return this.x=t*e.x,this.y=t*e.y,this.z=t*e.z,this}scaleThis(t){return this.x*=t,this.y*=t,this.z*=t,this}scaleZThis(t){return this.z*=t,this}setNAN(){return g(0),this}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)||Number.isNaN(this.z)}static getNAN(){return X.construct(Number.NaN,Number.NaN,Number.NaN)}isFinite(){return g(0),!1}isZero(){return 0===this.x&&0===this.y&&0===this.z}norm(t){return g(0),0}sqrDistanceFromCenterToSpheroidSurface(t,e){return g(0),0}distanceFromCenterToSpheroidSurface(t,e){return Math.sqrt(this.sqrDistanceFromCenterToSpheroidSurface(t,e))}static getClosestCoordinate(t,e,s,i=!1){return g(0),0}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:this.z<t.z?-1:this.z>t.z?1:0}compareXYZ(t){return g(0),0}negateThis(){this.x=-this.x,this.y=-this.y,this.z=-this.z}static averageFast(t,e){return g(0),{}}static average(t,e){return g(0),{}}static size(){return X.dimensions}static lerp(t,e,s){const i=new X;return n(t,e,s,i),i}static slerp(t,e,s){return g(0),{}}static compareVectors(t,e){return g(0),0}static selectRightHandedBasisFromNormal(t,e,s){const i=t.getUnitVector(),n=i.createAPerpendicular(),r=new X;r.setCrossProductVector(i,n),r.normalizeThis(),e.setCoordsPoint3D(n),s.setCoordsPoint3D(r)}createAPerpendicular(){const t=[this.crossProductVector(new X(0,0,1)),this.crossProductVector(new X(1,0,0)),this.crossProductVector(new X(0,1,0))],e=[t[0].sqrLength(),t[1].sqrLength(),t[2].sqrLength()],s=t[e.reduce((t,s,i)=>e[t]>e[i]?t:i,0)];return s.normalizeThis(),s}calculateAngle(t){return g(0),0}static crossDotSign(t,e,s){return g(0),0}static isBisectorRobust(t,e,s){return g(0),0}static compareZOrder(t,e){return g(0),!1}}X.dimensions=3;class G{static constructEmpty(){return new G(Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN)}constructor(t,e,s,i,n,r){this.m_EnvelopeType=3,this.xmin=t,this.ymin=e,this.zmin=s,this.xmax=i,this.ymax=n,this.zmax=r,this.normalize()}inflate(t){this.inflateCoords(t,t,t)}inflateCoords(t,e,s){g(0)}getEnvelope2D(){return new p(this.xmin,this.ymin,this.xmax,this.ymax)}getEnvelopeZs(){return new r(this.zmin,this.zmax)}setEmptyZ(){this.zmin=Number.NaN,this.zmax=Number.NaN}normalize(){let t=!1;this.xmin<=this.xmax||(this.xmax=h(this.xmin,this.xmin=this.xmax),t=!0),this.ymin<=this.ymax||(this.ymax=h(this.ymin,this.ymin=this.ymax),t=!0),!t||this.xmin<=this.xmax&&this.ymin<=this.ymax?this.zmin<=this.zmax||(this.zmax=h(this.zmin,this.zmin=this.zmax),this.zmin<=this.zmax||this.setEmptyZ()):this.setEmpty()}isEmpty(){return Number.isNaN(this.xmin)||Number.isNaN(this.ymin)||Number.isNaN(this.xmax)||Number.isNaN(this.ymax)}isEmptyZ(){return Number.isNaN(this.zmin)||Number.isNaN(this.zmax)}setEmpty(){this.xmin=Number.NaN,this.ymin=Number.NaN,this.zmin=Number.NaN,this.xmax=Number.NaN,this.ymax=Number.NaN,this.zmax=Number.NaN}mergeEnv3D(t){t.isEmpty()||(this.mergeCoords(t.xmin,t.ymin,t.zmin),this.mergeCoords(t.xmax,t.ymax,t.zmax))}mergeNe(t){this.mergeNeCoords(t.x,t.y,t.z)}mergeNeCoords(t,e,s){this.xmin>t?this.xmin=t:this.xmax<t&&(this.xmax=t),this.ymin>e?this.ymin=e:this.ymax<e&&(this.ymax=e),this.zmin>s?this.zmin=s:this.zmax<s&&(this.zmax=s)}mergeCoords(t,e,s){this.isEmpty()?(this.xmin=t,this.xmax=t,this.ymin=e,this.ymax=e,this.zmin=s,this.zmax=s):(this.isEmptyZ()&&(this.zmin=s,this.zmax=s),this.mergeNeCoords(t,e,s))}setCoords(t,e,s,i,n,r){this.xmin=t,this.ymin=e,this.zmin=s,this.xmax=i,this.ymax=n,this.zmax=r,this.normalize()}sqrDistanceEnvelope3DAndPoints(t,e,s,i=1){return g(0),0}sqrMaxDistance(t,e=1){return g(0),0}}const U=-559038737;var Z=z;function Q(t,e,s){switch(t){case 0:return new it(e,s);case 1:return new nt(e,s);case 2:return new st(e,s);case 3:throw new Error("64 bit int attribute stream not implemented");case 4:return new et(e,s);default:f("")}}function j(t,e){const s=Z.getComponentCount(t);return Q(Z.getPersistence(t),e*s,Z.getDefaultValue(t))}function W(t,e){const s=Z.getComponentCount(t);return Q(Z.getPersistence(t),e*s)}function J(t,e){return new st(t,e)}function K(t,e){return new et(t,e)}function $(t,e){return new nt(t,e)}class tt{size(){return this.m_size}checkResize(t,e){t>this.m_size&&this.resize(t,e)}resize(t,e){if((t=Math.trunc(t))===this.m_size)return;const s=!!e||Number.isNaN(e);if(t<this.m_a.length)this.m_a.length>tt.s_resizeMin&&1.25*t<this.m_a.length&&(this.m_a=this.m_a.slice(0,t)),s&&t>this.m_size&&this.m_a.fill(e,this.m_size,t);else if(t>=this.m_a.length){const i=1.25*t,n=new this.m_a.constructor(i);n.set(this.m_a),this.m_a=n,s&&this.m_a.fill(e,this.m_size,t)}this.m_size=t}resizeRounded(t,e){return this.resize(t,e)}reserve(t){}read(t){return this.m_a[t]}readAsDbl(t){return this.read(t)}write(t,e){this.m_a[t]=e}writeAsDbl(t,e){this.write(t,e)}setRange(t,e,s){(e<0||s<0||s+e>this.size())&&f(),this.m_a.fill(t,e,e+s)}add(t){this.resize(this.m_size+1),this.m_a[this.m_size-1]=t}addArray(t,e){const s=this.m_size;void 0===e?(this.resize(this.m_size+t.length),this.m_a.set(t,s)):(this.resize(this.m_size+e),this.m_a.set(t.slice(0,e),s))}getArray(){return this.m_a}equals(t,e,s,i){if(this.getPersistence()!==t.getPersistence())return!1;return rt(this,t,e,s,i)}insertRange(t,e,s,i){const n=this.m_size;this.checkResize(Math.max(0,i)+s),this.m_a.copyWithin(t+s,t,i>=0?i:n),this.m_a.fill(e,t,t+s)}readRange(t,e){return this.m_a.slice(t,t+e)}insertRangeFromStream(t,e,s,i,n,r,h){g(this.getPersistence()===e.getPersistence());const o=e,a=this.m_size;i&&this.checkResize(Math.max(0,h)+i),this.m_a.copyWithin(t+i,t,h>=0?h:a),this.m_a.set(o.readRange(s,i),t),n||this.reverseRange(t,i,r)}writeRange(t,e,s,i,n,r){g(this.getPersistence()===s.getPersistence());const h=s;if((t<0||e<0||i<0)&&f(),h.size()<i+e&&f(),0===e)return;this.size()<e+t&&this.resize(e+t);const o=h.m_a.subarray(i,i+e);ht(this.m_a,t,e,o)}insertAttributes(t,e,s,i){const n=Z.getComponentCount(s);this.m_a.copyWithin(t+n,t,i>=0?i:this.m_size);for(let r=0;r<n;r++)this.m_a[t+r]=e.getAttributeAsDbl(s,r)}insertAttributesFromPoints(t,e,s,i,n){g(Z.getPersistence(i)===this.getPersistence());const r=Z.getComponentCount(i),h=this.m_size;if(this.checkResize(Math.max(0,n)+r*s),this.m_a.copyWithin(t+r*s,t,n>=0?n:h),0===i){const i=new o;for(let n=t,r=0;r<s;r++,n+=2)e[r].queryXY(i),this.m_a[n]=i.x,this.m_a[n+1]=i.y}else if(1===r)for(let o=t,a=0;a<s;a++,o++)this.m_a[o]=e[a].getAttributeAsDbl(i,0);else for(let o=t,a=0;a<s;a++,o+=r)for(let t=0;t<r;t++)this.m_a[o+t]=e[a].getAttributeAsDbl(i,t)}eraseRange(t,e,s){this.m_size<t+e&&f(),this.m_a.copyWithin(t,t+e),this.m_size-=e}reverseRange(t,e,s){if((s<1||e%s!==0)&&f(),this.m_a.subarray(t,t+e).reverse(),s>1)for(let i=t,n=t+e;i<n;i+=s){let t=i,e=i+s-1;for(;t<e;){const s=this.m_a[t];this.m_a[t]=this.m_a[e],this.m_a[e]=s,t++,e--}}}rotate(t,e,s){(e<t||e>s||t>s)&&v("rotate"),e!==t&&e!==s&&(this.reverseRange(t,e-t,1),this.reverseRange(e,s-e,1),this.reverseRange(t,s-t,1))}sort(t,e,s){this.m_a.subarray(t,e).sort(s)}constructor(t){if(t.move)this.m_a=t.move.m_a,this.m_size=t.move.m_size,t.move.m_a=t.move.m_a.slice(0,0),t.move.m_size=0;else if(t.fromArray)this.m_a=t.fromArray,this.m_size=t.size??t.fromArray.length;else if(t.copy)this.m_size=t.copy.m_size,t.maxSize&&(this.m_size=Math.min(t.maxSize,this.m_size)),this.m_a=t.copy.m_a.slice(0,this.m_size);else{const e=Math.max(t.size,tt.s_constructMin);this.m_a=new t.ctor(e),(t.defaultValue||Number.isNaN(t.defaultValue))&&this.m_a.fill(t.defaultValue),this.m_size=t.size}}}tt.s_constructMin=2,tt.s_resizeMin=30;class et extends tt{setBits(t,e){this.m_a[t]|=e}clearBits(t,e){this.m_a[t]&=~e}getPersistence(){return 4}clone(){return new et({ctor:Int8Array,copy:this})}restrictedClone(t){return new et({ctor:Int8Array,copy:this,maxSize:t})}constructor(t,e){super("number"==typeof t?{ctor:Int8Array,size:t,defaultValue:e}:t)}}class st extends tt{getPersistence(){return 2}clone(){return new st({ctor:Int32Array,copy:this})}restrictedClone(t){return new st({ctor:Int32Array,copy:this,maxSize:t})}write(t,e){g(e<=a()),super.write(t,e)}constructor(t,e){super("number"==typeof t?{ctor:Int32Array,size:t,defaultValue:e}:t)}}class it extends tt{getPersistence(){return 0}clone(){return new it({ctor:Float32Array,copy:this})}restrictedClone(t){return new it({ctor:Float32Array,copy:this,maxSize:t})}constructor(t,e){super("number"==typeof t?{ctor:Float32Array,size:t,defaultValue:e}:t)}}class nt extends tt{getPersistence(){return 1}applyTransformation(t,e,s){(1&e||e+2*s>this.size())&&f();const i=0===e?this.m_a:this.m_a.subarray(e);t.transformInterleavedPoints(i,s,i)}readPoint2D(t){const e=this.m_a[t],s=this.m_a[t+1];return new o(e,s)}queryPoint2D(t,e){return e.x=this.m_a[t],e.y=this.m_a[t+1],e}writePoint2D(t,e){this.write(t,e.x),this.write(t+1,e.y)}insert(t,e,s){this.checkResize(s+2),this.m_a.copyWithin(t+2,t,s),this.m_a[t]=e.x,this.m_a[t+1]=e.y}insertRangeFromPoints(t,e,s,i,n,r){const h=this.m_size;if(this.checkResize(Math.max(r,0)+2*i),this.m_a.copyWithin(t+2*i,t,r>=0?r:h),n)for(let o=s,a=t,m=0;m<i;++m,++o){const t=e[o];this.m_a[a++]=t.x,this.m_a[a++]=t.y}else for(let o=s+i-1,a=t,m=0;m<i;++m,--o){const t=e[o];this.m_a[a++]=t.x,this.m_a[a++]=t.y}}queryRange(t,e,s,i,n){if((t<0||e<0)&&f(),!i&&(n<=0||e%n!==0)&&f(),0===e)return;if(1===e)return void(s[0]=this.m_a[t]);const r=this.m_a.subarray(t,t+e);s.set(r)}writeRangeFromArray(t,e,s,i,n){if((t<0||e<0)&&f(),0===e)return;if(1===e)return void(this.m_a[t]=s[0]);let r=s;e<s.length&&(r=s.subarray(0,e)),this.m_a.set(r,t)}clone(){return new nt({ctor:Float64Array,copy:this})}restrictedClone(t){return new nt({ctor:Float64Array,copy:this,maxSize:t})}constructor(t,e){super("number"==typeof t?{ctor:Float64Array,size:t,defaultValue:e}:t)}}function rt(t,e,s,n,r){if(t.getPersistence()!==e.getPersistence())return!1;const h=t.getPersistence()<=1,o=t.size(),a=e.size();if(n>o||n>a)return!1;if(r)if(h){for(let m=s;m<n;m++)if(!i(t.read(m),e.read(m),r))return!1}else for(let i=s;i<n;i++){let s=t.read(i)-e.read(i);if(s<0&&(s=-s),s>r)return!1}else for(let i=s;i<n;i++){const s=t.read(i),n=e.read(i);if(s!==n){if(h&&Number.isNaN(s)&&Number.isNaN(n))continue;return!1}}return!0}function ht(t,e,s,i,n,r){if((e<0||s<0)&&f(),0===s)return;if(1===s)return void(t[e]=i[0]);let h=i;s<i.length&&(h=i.subarray(0,s)),t.set(h,e)}const ot={partCount:0,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:0,segmentCountBezier:0};class at{constructor(){this.m_minValue=-1,this.m_maxValue=-1,this.m_dy=Number.NaN,this.m_buckets=new st(0),this.m_bucketedIndices=new st(0)}static sortEx(t,e,s,i,n=32){if(s-e<=n)return void i.userSort(e,s,t);(new at).sort(t,e,s,i,n)}sort(t,e,s,i,n=32){if(s-e<=n)return void i.userSort(e,s,t);let r=!0,h=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let m=e;m<s;m++){const e=i.getValue(t.read(m));e<h&&(h=e),e>o&&(o=e)}if(this.reset(s-e,h,o,s-e)){for(let r=e;r<s;r++){const s=t.read(r),n=i.getValue(s),h=this.getBucket(n);this.m_buckets.write(h,this.m_buckets.read(h)+1),this.m_bucketedIndices.write(r-e,s)}let n=this.m_buckets.read(0);this.m_buckets.write(0,0);for(let t=1,e=this.m_buckets.size();t<e;t++){const e=this.m_buckets.read(t);this.m_buckets.write(t,n),n+=e}for(let r=e;r<s;r++){const s=this.m_bucketedIndices.read(r-e),n=i.getValue(s),h=this.getBucket(n),o=this.m_buckets.read(h);t.write(o+e,s),this.m_buckets.write(h,o+1)}r=!1}if(r)return void i.userSort(e,s,t);let a=0;for(let m=0,_=this.m_buckets.size();m<_;m++){const s=a;a=this.m_buckets.read(m),a>s&&i.userSort(e+s,e+a,t)}this.m_buckets.size()>100&&(this.m_buckets.resize(0),this.m_bucketedIndices.resize(0))}reset(t,e,s,i){if(t<2||s===e)return!1;const n=Math.min(at.c_maxBuckets,t);return this.m_buckets.resize(n),this.m_buckets.setRange(0,0,this.m_buckets.size()),this.m_minValue=e,this.m_maxValue=s,this.m_bucketedIndices.resize(i),this.m_dy=(s-e)/(n-1),!0}getBucket(t){return Math.trunc((t-this.m_minValue)/this.m_dy)}getBucketCount(){return this.m_buckets.size()}}at.c_maxBuckets=65536;class mt{capacity(){return this.capacity_}constructor(t){this.m_buffer=new Int32Array(0),this.m_firstFree=-1,this.m_last=0,this.size_=0,this.capacity_=0,this.stride=t}size(){return this.size_}deleteElement(t){t<this.m_last?(this.m_buffer[t*this.stride]=this.m_firstFree,this.m_firstFree=t):this.m_last--,this.size_--}getField(t,e){return this.m_buffer[t*this.stride+e]}setField(t,e,s){this.m_buffer[t*this.stride+e]=s}elementToIndex(t){return t}newElement(){let t=this.m_firstFree;if(-1===t){if(this.m_last===this.capacity_){let t=0!==this.capacity_?Math.trunc(3*(this.capacity_+1)/2):1;if(t>Number.MAX_SAFE_INTEGER&&(t=Number.MAX_SAFE_INTEGER),t===this.capacity_)throw new Error("index out of bounds");this.grow_(t)}t=this.m_last,this.m_last++}else this.m_firstFree=this.m_buffer[t*this.stride];this.size_++;for(let e=t*this.stride;e<t*this.stride+this.stride;e++)this.m_buffer[e]=-1;return t}newElementPset(t){let e=this.m_firstFree;if(-1===e){if(this.m_last===this.capacity_){let t=0!==this.capacity_?Math.trunc(3*(this.capacity_+1)/2):1;if(t>Number.MAX_SAFE_INTEGER&&(t=Number.MAX_SAFE_INTEGER),t===this.capacity_)throw new Error("index out of bounds");this.grow_(t)}e=this.m_last,this.m_last++}else this.m_firstFree=this.m_buffer[e*this.stride];this.size_++;const s=e*this.stride;for(let i=0;i<t.length;i++)this.m_buffer[s+i]=t[i];return e}deleteAll(t){this.m_firstFree=-1,this.m_last=0,this.size_=0,t&&(this.m_buffer=new Int32Array(0),this.capacity_=0)}setCapacity(t){t>this.capacity_&&this.grow_(t)}swap(t,e){const s=t*this.stride,i=e*this.stride;for(let n=0;n<this.stride;n++){const t=this.m_buffer[i+n];this.m_buffer[i+n]=this.m_buffer[s+n],this.m_buffer[s+n]=t}}swapField(t,e,s){const i=this.m_buffer[this.stride*e+s];this.m_buffer[this.stride*e+s]=this.m_buffer[this.stride*t+s],this.m_buffer[this.stride*t+s]=i}static impossibleIndex2(){return-2}static impossibleIndex3(){return-3}static isValidElement(t){return t>=0}grow_(t){null==this.m_buffer&&(this.m_buffer=new Int32Array(0));const e=this.stride*t,s=new Int32Array(e);s.set(this.m_buffer,0),this.m_buffer=s,this.capacity_=t}}function _t(t,e){return{element:t,box:e.clone()}}class lt{constructor(t,e,s){this.m_extent=new p,this.m_dataExtent=new p,this.m_childExtents=[new p,new p,new p,new p],this.m_elementNodes=new mt(4),this.m_data=[],this.m_freeData=[],this.m_root=-1,this.m_height=8,void 0===s&&(s=!1),this.m_quadTreeNodes=new mt(s?11:10),this.m_bStoreDuplicates=s,this.reset_(t,e)}reset(t,e){this.m_quadTreeNodes.deleteAll(!1),this.m_elementNodes.deleteAll(!1),this.m_data.length=0,this.m_freeData.length=0,this.reset_(t,e)}insert(t,e){if(-1===this.m_root&&this.createRoot_(),this.m_bStoreDuplicates){const s=this.insertDuplicates_(t,e,0,this.m_extent,this.m_root,!1,-1);return-1!==s&&(this.m_dataExtent.isEmpty()?this.m_dataExtent.setCoords({env2D:e}):this.m_dataExtent.mergeEnvelope2D(e)),s}const s=this.insert_(t,e,0,this.m_extent,this.m_root,!1,-1);return-1!==s&&(this.m_dataExtent.isEmpty()?this.m_dataExtent.setCoords({env2D:e}):this.m_dataExtent.mergeEnvelope2D(e)),s}insertEx(t,e,s){if(-1===this.m_root&&this.createRoot_(),this.m_bStoreDuplicates){const s=this.insertDuplicates_(t,e,0,this.m_extent,this.m_root,!1,-1);return-1!==s&&(this.m_dataExtent.isEmpty()?this.m_dataExtent.setCoords({env2D:e}):this.m_dataExtent.mergeEnvelope2D(e)),s}let i;i=-1===s?this.m_root:this.getQuad_(s);const n=this.getHeight(i),r=this.getExtent(i),h=this.insert_(t,e,n,r,i,!1,-1);return-1!==h&&(this.m_dataExtent.isEmpty()?this.m_dataExtent.setCoords({env2D:e}):this.m_dataExtent.mergeEnvelope2D(e)),h}removeElement(t){g(0)}getElement(t){return this.getElementValue_(this.getData_(t))}getElementAtIndex(t){return g(0),0}getElementExtent(t){const e=this.getData_(t);return this.getBoundingBoxValue_(e).clone()}getElementExtentAtIndex(t){return g(0),{}}getDataExtent(){return this.m_dataExtent.clone()}getQuadTreeExtent(){return g(0),{}}getHeight(t){return this.m_quadTreeNodes.getField(t,6)>>lt.m_heightBitShift}getMaxHeight(){return this.m_height}getExtent(t){const e=new p;if(e.setCoords({env2D:this.m_extent}),t===this.m_root)return e;const s=[];let i=t;do{s.push(this.getQuadrant_(i)),i=this.getParent_(i)}while(i!==this.m_root);const n=s.length;for(let r=0;r<n;r++){const t=s.at(-1);s.pop(),0===t?(e.xmin=.5*(e.xmin+e.xmax),e.ymin=.5*(e.ymin+e.ymax)):1===t?(e.xmax=.5*(e.xmin+e.xmax),e.ymin=.5*(e.ymin+e.ymax)):2===t?(e.xmax=.5*(e.xmin+e.xmax),e.ymax=.5*(e.ymin+e.ymax)):(e.xmin=.5*(e.xmin+e.xmax),e.ymax=.5*(e.ymin+e.ymax))}return e}getQuad(t){return this.getQuad_(t)}getElementCount(){return-1===this.m_root?0:this.getSubTreeElementCount_(this.m_root)}getSubTreeElementCount(t){return this.getSubTreeElementCount_(t)}getContainedSubTreeElementCount(t){return this.m_bStoreDuplicates?this.getContainedSubTreeElementCount_(t):this.getSubTreeElementCount_(t)}getIntersectionCount(t,e,s){if(-1===this.m_root)return 0;const i=new p;i.setCoords({env2D:t}),i.inflateCoords(e,e);const n=[],r=[];n.push(this.m_root),r.push(this.m_extent.clone());const h=d(p,4);let o=0;for(;n.length>0;){let t=!1;const e=n.at(-1),a=r.at(-1);if(n.pop(),r.pop(),i.containsEnvelope(a)){if(o+=this.getSubTreeElementCount(e),s>0&&o>=s)return s}else if(i.isIntersecting(a)){for(let t=this.getFirstElement_(e);-1!==t;t=this.getNextElement_(t)){const e=this.getData_(t);if(this.getBoundingBoxValue_(e).isIntersecting(i)&&(o++,s>0&&o>=s))return s}t=this.getHeight(e)+1<=this.m_height}if(t){lt.setChildExtents_(a,h);for(let t=0;t<4;t++){const s=this.getChild_(e,t);if(-1!==s&&this.getSubTreeElementCount_(s)>0){i.isIntersecting(h[t])&&(n.push(s),r.push(h[t].clone()))}}}}return o}hasData(t,e){return this.getIntersectionCount(t,e,1)>=1}getIterator(t,e){return new ut(this,t,e)}getIteratorForQT(){return new ut(this)}getSortedIterator(t,e){return new dt(this.getIterator(t,e))}getSortedIteratorForQT(){return new dt(this.getIteratorForQT())}visitLeavesNearest(t,e,s,i){g(0)}reset_(t,e){(e<0||e>127)&&f("invalid height"),this.m_height=e,this.m_extent.setCoords({env2D:t}),this.m_dataExtent.setEmpty(),this.m_root=-1}insert_(t,e,s,i,n,r,h){if(!i.containsEnvelope(e))return 0===s?-1:this.insert_(t,e,0,this.m_extent,this.m_root,r,h);if(!r)for(let _=n;-1!==_;_=this.getParent_(_))this.setSubTreeElementCount_(_,this.getSubTreeElementCount_(_)+1);const o=new p;o.setCoords({env2D:i});let a,m=n;for(a=s;a<this.m_height&&this.canPushDown_(m);a++){lt.setChildExtents_(o,this.m_childExtents);let t=!1;for(let s=0;s<4;s++)if(this.m_childExtents[s].containsEnvelope(e)){t=!0;let e=this.getChild_(m,s);-1===e&&(e=this.createChild_(m,s)),this.setSubTreeElementCount_(e,this.getSubTreeElementCount_(e)+1),m=e,o.setCoords({env2D:this.m_childExtents[s]});break}if(!t)break}return this.insertAtQuad_(t,e,a,o,m,r,n,h,-1)}insertDuplicates_(t,e,s,i,n,r,h){if(!r){if(!i.containsEnvelope(e))return-1;this.setSubTreeElementCount_(n,this.getSubTreeElementCount_(n)+1),this.setContainedSubTreeElementCount_(n,this.getContainedSubTreeElementCount_(n)+1)}const o=Math.max(e.width(),e.height());let a=-1;const m=[],_=[],l=[];m.push(n),_.push(i.clone()),l.push(s);const u=d(p,4);for(;m.length>0;){let s=!1;const i=m.at(-1),d=_.at(-1),c=l.at(-1);if(m.pop(),_.pop(),l.pop(),c+1<this.m_height&&this.canPushDown_(i)){o<=Math.max(d.width(),d.height())/2&&(s=!0)}if(s){lt.setChildExtents_(d,u);let t=!1;for(let s=0;s<4;s++)if(t=u[s].containsEnvelope(e),t){let t=this.getChild_(i,s);-1===t&&(t=this.createChild_(i,s)),m.push(t),_.push(u[s].clone()),l.push(c+1),this.setSubTreeElementCount_(t,this.getSubTreeElementCount_(t)+1),this.setContainedSubTreeElementCount_(t,this.getContainedSubTreeElementCount_(t)+1);break}if(!t)for(let s=0;s<4;s++){if(u[s].isIntersecting(e)){let t=this.getChild_(i,s);-1===t&&(t=this.createChild_(i,s)),m.push(t),_.push(u[s].clone()),l.push(c+1),this.setSubTreeElementCount_(t,this.getSubTreeElementCount_(t)+1)}}}else a=this.insertAtQuad_(t,e,c,d,i,r,n,h,a),r=!1}return 0}insertAtQuad_(t,e,s,i,n,r,h,o,a){this.getFirstElement_(n);const m=this.getLastElement_(n);let _=-1;if(r){if(n===h)return o;this.disconnectElementHandle_(o),_=o}else-1===a?(_=this.createElement_(),this.setDataValues_(this.getData_(_),t,e)):_=this.createElementFromDuplicate_(a);return this.setQuad_(_,n),-1!==m?(this.setPrevElement_(_,m),this.setNextElement_(m,_)):this.setFirstElement_(n,_),this.setLastElement_(n,_),this.setLocalElementCount_(n,this.getLocalElementCount_(n)+1),this.canFlush_(n)&&this.flush_(s,i,n),_}static setChildExtents_(t,e){const s=.5*(t.xmin+t.xmax),i=.5*(t.ymin+t.ymax);e[0].setCoords({xmin:s,ymin:i,xmax:t.xmax,ymax:t.ymax}),e[1].setCoords({xmin:t.xmin,ymin:i,xmax:s,ymax:t.ymax}),e[2].setCoords({xmin:t.xmin,ymin:t.ymin,xmax:s,ymax:i}),e[3].setCoords({xmin:s,ymin:t.ymin,xmax:t.xmax,ymax:i})}disconnectElementHandle_(t){const e=this.getQuad_(t),s=this.getFirstElement_(e),i=this.getLastElement_(e),n=this.getPrevElement_(t),r=this.getNextElement_(t);s===t?(-1!==r?this.setPrevElement_(r,-1):this.setLastElement_(e,-1),this.setFirstElement_(e,r)):i===t?(this.setNextElement_(n,-1),this.setLastElement_(e,n)):(this.setPrevElement_(r,n),this.setNextElement_(n,r)),this.setPrevElement_(t,-1),this.setNextElement_(t,-1),this.setLocalElementCount_(e,this.getLocalElementCount_(e)-1)}canFlush_(t){return this.getLocalElementCount_(t)===lt.m_flushingCount&&!this.hasChildren_(t)}flush_(t,e,s){let i;const n=new p;let r=this.getFirstElement_(s),h=-1,o=-1;do{o=this.getData_(r),i=this.getElementValue_(o),n.setCoords({env2D:this.getBoundingBoxValue_(o)}),h=this.getNextElement_(r),this.m_bStoreDuplicates?this.insertDuplicates_(i,n,t,e,s,!0,r):this.insert_(i,n,t,e,s,!0,r),r=h}while(-1!==r)}canPushDown_(t){return this.getLocalElementCount_(t)>=lt.m_flushingCount||this.hasChildren_(t)}hasChildren_(t){return-1!==this.getChild_(t,0)||-1!==this.getChild_(t,1)||-1!==this.getChild_(t,2)||-1!==this.getChild_(t,3)}createChild_(t,e){const s=this.m_quadTreeNodes.newElement();return this.setChild_(t,e,s),this.setSubTreeElementCount_(s,0),this.setLocalElementCount_(s,0),this.setParent_(s,t),this.setHeightAndQuadrant_(s,this.getHeight_(t)+1,e),this.m_bStoreDuplicates&&this.setContainedSubTreeElementCount_(s,0),s}createRoot_(){this.m_root=this.m_quadTreeNodes.newElement(),this.setSubTreeElementCount_(this.m_root,0),this.setLocalElementCount_(this.m_root,0),this.setHeightAndQuadrant_(this.m_root,0,0),this.m_bStoreDuplicates&&this.setContainedSubTreeElementCount_(this.m_root,0)}createElement_(){const t=this.m_elementNodes.newElement();let e;return this.m_freeData.length>0?(e=this.m_freeData.at(-1),this.m_freeData.pop()):(e=this.m_data.length,this.m_data.length=e+1),this.setData_(t,e),t}createElementFromDuplicate_(t){const e=this.m_elementNodes.newElement(),s=this.getData_(t);return this.setData_(e,s),e}freeElementAndBoxNode_(t){g(0)}getChild_(t,e){return this.m_quadTreeNodes.getField(t,e)}setChild_(t,e,s){this.m_quadTreeNodes.setField(t,e,s)}getFirstElement_(t){return this.m_quadTreeNodes.getField(t,4)}setFirstElement_(t,e){this.m_quadTreeNodes.setField(t,4,e)}getLastElement_(t){return this.m_quadTreeNodes.getField(t,5)}setLastElement_(t,e){this.m_quadTreeNodes.setField(t,5,e)}getQuadrant_(t){return this.m_quadTreeNodes.getField(t,6)&lt.m_quadrantMask}getHeight_(t){return this.m_quadTreeNodes.getField(t,6)>>lt.m_heightBitShift}setHeightAndQuadrant_(t,e,s){const i=e<<lt.m_heightBitShift|s;this.m_quadTreeNodes.setField(t,6,i)}getLocalElementCount_(t){return this.m_quadTreeNodes.getField(t,7)}setLocalElementCount_(t,e){this.m_quadTreeNodes.setField(t,7,e)}getSubTreeElementCount_(t){return this.m_quadTreeNodes.getField(t,8)}setSubTreeElementCount_(t,e){this.m_quadTreeNodes.setField(t,8,e)}getParent_(t){return this.m_quadTreeNodes.getField(t,9)}setParent_(t,e){this.m_quadTreeNodes.setField(t,9,e)}getContainedSubTreeElementCount_(t){return this.m_quadTreeNodes.getField(t,10)}setContainedSubTreeElementCount_(t,e){this.m_quadTreeNodes.setField(t,10,e)}getData_(t){return this.m_elementNodes.getField(t,0)}setData_(t,e){this.m_elementNodes.setField(t,0,e)}getPrevElement_(t){return this.m_elementNodes.getField(t,1)}getNextElement_(t){return this.m_elementNodes.getField(t,2)}setPrevElement_(t,e){this.m_elementNodes.setField(t,1,e)}setNextElement_(t,e){this.m_elementNodes.setField(t,2,e)}getQuad_(t){return this.m_elementNodes.getField(t,3)}setQuad_(t,e){this.m_elementNodes.setField(t,3,e)}getElementValue_(t){return this.m_data[t].element}getBoundingBoxValue_(t){return this.m_data[t].box}setDataValues_(t,e,s){this.m_data[t]=_t(e,s)}}lt.m_quadrantMask=3,lt.m_heightBitShift=2,lt.m_flushingCount=5;class ut{constructor(t,e,s){this.m_bLinear=!1,this.m_queryStart=new o,this.m_queryEnd=new o,this.m_queryBox=new p,this.m_tolerance=0,this.m_currentElementHandle=-1,this.m_nextElementHandle=-1,this.m_quadsStack=[],this.m_extentsStack=[],this.m_childExtents=[new p,new p,new p,new p],this.m_quadTree=t,e&&this.resetIterator(e,s)}resetIterator(t,e){if(void 0===e&&(e=0),t instanceof p)return this.m_quadsStack.length=0,this.m_extentsStack.length=0,this.m_currentElementHandle=-1,this.m_queryBox.setCoords({env2D:t}),this.m_queryBox.inflateCoords(e,e),this.m_tolerance=Number.NaN,void(-1!==this.m_quadTree.m_root&&this.m_queryBox.isIntersecting(this.m_quadTree.m_extent)?(this.m_quadsStack.push(this.m_quadTree.m_root),this.m_extentsStack.push(this.m_quadTree.m_extent.clone()),this.m_nextElementHandle=this.m_quadTree.getFirstElement_(this.m_quadTree.m_root),this.m_bLinear=!1):this.m_nextElementHandle=-1);if(this.m_quadsStack.length=0,this.m_extentsStack.length=0,this.m_currentElementHandle=-1,t.queryLooseEnvelope(this.m_queryBox),this.m_queryBox.inflateCoords(e,e),-1!==this.m_quadTree.m_root&&this.m_queryBox.isIntersecting(this.m_quadTree.m_extent)){const s=t.getGeometryType();if(this.m_bLinear=s===y.enumLine,this.m_bLinear){const s=t;this.m_queryStart.assign(s.getStartXY()),this.m_queryEnd.assign(s.getEndXY()),this.m_tolerance=e}else this.m_tolerance=Number.NaN;this.m_quadsStack.push(this.m_quadTree.m_root),this.m_extentsStack.push(this.m_quadTree.m_extent.clone()),this.m_nextElementHandle=this.m_quadTree.getFirstElement_(this.m_quadTree.m_root)}else this.m_nextElementHandle=-1}next(){if(0===this.m_quadsStack.length)return-1;this.m_currentElementHandle=this.m_nextElementHandle;const t=new o,e=new o,s=new p;let i=!1;for(;!i;){for(;-1!==this.m_currentElementHandle;){const n=this.m_quadTree.getData_(this.m_currentElementHandle);if(s.setCoords({env2D:this.m_quadTree.getBoundingBoxValue_(n)}),s.isIntersecting(this.m_queryBox)){if(!this.m_bLinear){i=!0;break}if(t.setCoordsPoint2D(this.m_queryStart),e.setCoordsPoint2D(this.m_queryEnd),s.inflateCoords(this.m_tolerance,this.m_tolerance),s.clipLine(t,e)>0){i=!0;break}}this.m_currentElementHandle=this.m_quadTree.getNextElement_(this.m_currentElementHandle)}if(-1===this.m_currentElementHandle){const s=this.m_quadsStack.at(-1),i=this.m_extentsStack.at(-1);lt.setChildExtents_(i,this.m_childExtents),this.m_quadsStack.pop(),this.m_extentsStack.pop();for(let n=0;n<4;n++){const i=this.m_quadTree.getChild_(s,n);if(-1!==i&&this.m_quadTree.getSubTreeElementCount(i)>0&&this.m_childExtents[n].isIntersecting(this.m_queryBox))if(this.m_bLinear){t.setCoordsPoint2D(this.m_queryStart),e.setCoordsPoint2D(this.m_queryEnd);const s=new p;s.setCoords({env2D:this.m_childExtents[n]}),s.inflateCoords(this.m_tolerance,this.m_tolerance),s.clipLine(t,e)>0&&(this.m_quadsStack.push(i),this.m_extentsStack.push(this.m_childExtents[n].clone()))}else this.m_quadsStack.push(i),this.m_extentsStack.push(this.m_childExtents[n].clone())}if(0===this.m_quadsStack.length)return-1;this.m_currentElementHandle=this.m_quadTree.getFirstElement_(this.m_quadsStack.at(-1))}}return this.m_nextElementHandle=this.m_quadTree.getNextElement_(this.m_currentElementHandle),this.m_currentElementHandle}clone(){return g(0),{}}}class dt{constructor(t){this.m_bucketSort=new at,this.m_sortedHandles=new st(0),this.m_index=-1,this.m_quadTreeIteratorImpl=t}resetIterator(t,e){this.m_quadTreeIteratorImpl.resetIterator(t,e),this.m_sortedHandles.resize(0),this.m_index=-1}next(){if(-1===this.m_index){let t=-1;for(;-1!==(t=this.m_quadTreeIteratorImpl.next());)this.m_sortedHandles.add(t);const e=this,s={userSort(t,s,i){i.sort(t,s,(t,s)=>e.m_quadTreeIteratorImpl.m_quadTree.getElement(t)-e.m_quadTreeIteratorImpl.m_quadTree.getElement(s))},getValue:t=>e.m_quadTreeIteratorImpl.m_quadTree.getElement(t)};this.m_bucketSort.sort(this.m_sortedHandles,0,this.m_sortedHandles.size(),s)}return this.m_index===this.m_sortedHandles.size()-1?-1:(this.m_index++,this.m_sortedHandles.read(this.m_index))}clone(){return g(0),{}}}class ct{constructor(t=!1){this.m_bNotifyOnActions=t}onDelete(t){}onSet(t){}onEndSearch(t){}onAddUniqueElementFailed(t){}onDeleteImpl(t,e){this.m_bNotifyOnActions&&this.onDelete(t.getElement(e))}onSetImpl(t,e){this.m_bNotifyOnActions&&this.onSet(t.getElement(e))}onAddUniqueElementFailedImpl(t){this.m_bNotifyOnActions&&this.onAddUniqueElementFailed(t)}onEndSearchImpl(t){this.m_bNotifyOnActions&&this.onEndSearch(t)}}class pt{static st_nullNode(){return-1}constructor(){this.m_defaultTreap=-1,this.m_random=124234251,this.m_comparator=null,this.m_treapData=new mt(7),this.m_treapCount=0,this.m_maxDepthEver=0,this.m_bBalancing=!0}setComparator(t){this.m_comparator=t}getComparator(){return this.m_comparator}disableBalancing(){this.m_bBalancing=!1}enableBalancing(){this.m_bBalancing||(g(this.m_treapCount<=1),this.rebalance(-1),this.m_bBalancing=!0)}isAutoBalancing(){return this.m_bBalancing}rebalance(t){if(this.m_bBalancing)return;if(-1===t&&(t=this.m_defaultTreap),0===this.size(t))return;const e=[];for(let s=this.getFirst(t);-1!==s;s=this.getNext(s))e.push(s),this.setParent_(s,-1),this.setRight_(s,-1),this.setLeft_(s,-1);this.setRoot_(-1,t),this.setFirst_(-1,t),this.setLast_(-1,t),this.setSize_(0,t),this.m_bBalancing=!0;for(const s of e)this.addBiggestElement_(s,t);this.m_bBalancing=!1}setCapacity(t){this.m_treapData.setCapacity(t)}createTreap(t){const e=this.m_treapData.newElement();return this.setSize_(0,e),this.setTreapData_(t,e),this.m_treapCount++,e}deleteTreap(t){this.m_treapData.deleteElement(t),this.m_treapCount--}addElement(t,e=-1){return-1===e&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),e=this.m_defaultTreap),this.addElement_(t,0,e)}addUniqueElement(t,e=-1){return-1===e&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),e=this.m_defaultTreap),this.addElement_(t,1,e)}addBiggestElement(t,e=-1){-1===e&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),e=this.m_defaultTreap);const s=this.newNode_(t);return this.addBiggestElement_(s,e),s}addElementAtPosition(t,e,s,i,n,r=-1){if(-1===r&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),r=this.m_defaultTreap),this.getRoot_(r)===pt.st_nullNode()){const t=this.newNode_(s);return this.setRoot_(t,r),this.addToList_(-1,t,r),t}let h,o,a,m,_;if(n?(h=e!==pt.st_nullNode()?this.m_comparator.compare(this,s,e):-1,o=t!==pt.st_nullNode()?this.m_comparator.compare(this,s,t):1):(h=-1,o=1),i&&(0===h||0===o)){this.m_comparator.onAddUniqueElementFailedImpl(s);const i=0===h?e:t;return this.setDuplicateElement_(i,r),-1}_=e!==pt.st_nullNode()&&t!==pt.st_nullNode()?this.m_random>l(this.m_random)>>1:e!==pt.st_nullNode(),_?(m=h,a=e):(m=o,a=t);let u=-1,d=-1,c=!0;for(;;){if(m<0){const t=this.getLeft(a);if(t===pt.st_nullNode()){d=a,u=this.newNode_(s),this.setLeft_(a,u),this.setParent_(u,a);break}a=t}else{const t=this.getRight(a);if(t===pt.st_nullNode()){d=this.getNext(a),u=this.newNode_(s),this.setRight_(a,u),this.setParent_(u,a);break}a=t}c&&(m*=-1,c=!1)}return this.bubbleUp_(u),this.getParent(u)===pt.st_nullNode()&&this.setRoot_(u,r),this.addToList_(d,u,r),u}replaceElementAtPosition(t,e,s,i,n=-1){if(i){const i=this.getNext(t);let r=-1;i!==pt.st_nullNode()&&(r=this.m_comparator.compare(this,e,i));const h=this.getPrev(t);let o=-1;if(h!==pt.st_nullNode()&&(o=this.m_comparator.compare(this,e,h)),s&&(0===r||0===o)){this.m_comparator.onAddUniqueElementFailedImpl(e);const t=0===r?i:h;return n===pt.st_nullNode()&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),n=this.m_defaultTreap),this.setDuplicateElement_(t,n),-1}}return this.setElement_(t,e),t}getDuplicateElement(t=-1){return-1===t?this.getDuplicateElement_(this.m_defaultTreap):this.getDuplicateElement_(t)}deleteNode(t,e=-1){this.m_comparator&&this.m_comparator.onDeleteImpl(this,t),-1===e&&(e=this.m_defaultTreap),this.m_bBalancing?this.deleteNode_(t,e):this.unbalancedDelete_(t,e)}search(t,e=-1){let s=this.getRoot(e);for(;s!==pt.st_nullNode();){const e=this.m_comparator.compare(this,t,s);if(!e)return s;s=e<0?this.getLeft(s):this.getRight(s)}return this.m_comparator.onEndSearchImpl(t),pt.st_nullNode()}searchLowerBound(t,e=-1){let s=this.getRoot(e),i=-1;for(;s!==pt.st_nullNode();){const e=t.compare(this,s);if(!e)return s;e<0?s=this.getLeft(s):(i=s,s=this.getRight(s))}return i}searchUpperBound(t,e=-1){let s=this.getRoot(e),i=-1;for(;s!==pt.st_nullNode();){const e=t.compare(this,s);if(!e)return s;e<0?(i=s,s=this.getLeft(s)):s=this.getRight(s)}return i}getElement(t){return this.m_treapData.getField(t,3)}getLeft(t){return this.m_treapData.getField(t,0)}getRight(t){return this.m_treapData.getField(t,1)}getParent(t){return this.m_treapData.getField(t,2)}getNext(t){return this.m_treapData.getField(t,6)}getPrev(t){return this.m_treapData.getField(t,5)}getFirst(t=-1){return-1===t?this.getFirst_(this.m_defaultTreap):this.getFirst_(t)}getLast(t=-1){return-1===t?this.getLast_(this.m_defaultTreap):this.getLast_(t)}getTreapData(t=-1){return-1===t?this.getTreapData_(this.m_defaultTreap):this.getTreapData_(t)}setElement(t,e){null!==this.m_comparator&&this.m_comparator.onSetImpl(this,t),this.setElement_(t,e)}getRoot(t=-1){return-1===t?this.getRoot_(this.m_defaultTreap):this.getRoot_(t)}clear(){this.m_treapData.deleteAll(!1),this.m_defaultTreap=pt.st_nullNode(),this.m_treapCount=0,this.m_maxDepthEver=0}addToList_(t,e,s){let i;-1!==t?(i=this.getPrev(t),this.setPrev_(t,e)):i=this.getLast_(s),this.setPrev_(e,i),-1!==i&&this.setNext_(i,e),this.setNext_(e,t),t===this.getFirst_(s)&&this.setFirst_(e,s),-1===t&&this.setLast_(e,s),this.setSize_(this.getSize_(s)+1,s)}size(t=-1){return-1===t?this.getSize_(this.m_defaultTreap):this.getSize_(t)}getMaxDepth(t=-1){return this.getMaxDepthHelper_(this.getRoot(t))}getMaxDepthEver(){return this.m_maxDepthEver}static st_isValidNode(t){return mt.isValidElement(t)}dbgCheck_(t){}getPriority_(t){return this.m_treapData.getField(t,4)}bubbleDown_(t){let e=this.getLeft(t),s=this.getRight(t);const i=this.getPriority_(t);for(;e!==pt.st_nullNode()||s!==pt.st_nullNode();){const n=e!==pt.st_nullNode()?this.getPriority_(e):u(),r=s!==pt.st_nullNode()?this.getPriority_(s):u();if(i<=Math.min(n,r))return;n<=r?this.rotateRight_(e):this.rotateLeft_(t),e=this.getLeft(t),s=this.getRight(t)}}bubbleUp_(t){if(!this.m_bBalancing)return;const e=this.getPriority_(t);let s=this.getParent(t);for(;s!==pt.st_nullNode()&&this.getPriority_(s)>e;)this.getLeft(s)===t?this.rotateRight_(t):this.rotateLeft_(s),s=this.getParent(t)}rotateLeft_(t){const e=t,s=this.getRight(t);let i;this.setParent_(s,this.getParent(e)),this.setParent_(e,s),i=this.getLeft(s),this.setRight_(e,i),i!==pt.st_nullNode()&&this.setParent_(i,e),this.setLeft_(s,e),i=this.getParent(s),i!==pt.st_nullNode()&&(this.getLeft(i)===e?this.setLeft_(i,s):this.setRight_(i,s))}rotateRight_(t){const e=this.getParent(t),s=t;let i;this.setParent_(s,this.getParent(e)),this.setParent_(e,s),i=this.getRight(s),this.setLeft_(e,i),i!==pt.st_nullNode()&&this.setParent_(i,e),this.setRight_(s,e),i=this.getParent(s),i!==pt.st_nullNode()&&(this.getLeft(i)===e?this.setLeft_(i,s):this.setRight_(i,s))}setParent_(t,e){this.m_treapData.setField(t,2,e)}setLeft_(t,e){this.m_treapData.setField(t,0,e)}setRight_(t,e){this.m_treapData.setField(t,1,e)}setPriority_(t,e){this.m_treapData.setField(t,4,e)}setPrev_(t,e){this.m_treapData.setField(t,5,e)}setNext_(t,e){this.m_treapData.setField(t,6,e)}setRoot_(t,e){this.m_treapData.setField(e,0,t)}setFirst_(t,e){this.m_treapData.setField(e,1,t)}setLast_(t,e){this.m_treapData.setField(e,2,t)}setDuplicateElement_(t,e){this.m_treapData.setField(e,3,t)}setSize_(t,e){this.m_treapData.setField(e,4,t)}setTreapData_(t,e){this.m_treapData.setField(e,5,t)}getRoot_(t){return-1===t?pt.st_nullNode():this.m_treapData.getField(t,0)}getFirst_(t){return-1===t?pt.st_nullNode():this.m_treapData.getField(t,1)}getLast_(t){return-1===t?pt.st_nullNode():this.m_treapData.getField(t,2)}getDuplicateElement_(t){return-1===t?pt.st_nullNode():this.m_treapData.getField(t,3)}getSize_(t){return-1===t?0:this.m_treapData.getField(t,4)}getTreapData_(t){return this.m_treapData.getField(t,5)}newNode_(t){const e=this.m_treapData.newElement();return this.setPriority_(e,this.generatePriority_()),this.setElement_(e,t),e}freeNode_(t,e){t!==pt.st_nullNode()&&this.m_treapData.deleteElement(t)}generatePriority_(){return this.m_random=l(this.m_random),this.m_random&u()>>1}maxPriority(){return g(0),0}getMaxDepthHelper_(t){return t===pt.st_nullNode()?0:1+Math.max(this.getMaxDepthHelper_(this.getLeft(t)),this.getMaxDepthHelper_(this.getRight(t)))}addElement_(t,e,s){if(this.getRoot(s)===pt.st_nullNode()){const e=this.newNode_(t);return this.setRoot_(e,s),this.addToList_(-1,e,s),this.m_maxDepthEver=Math.max(this.m_maxDepthEver,1),e}let i=this.getRoot_(s),n=-1,r=-1,h=1;for(;;){const o=-1===e?1:this.m_comparator.compare(this,t,i);if(o<0){const e=this.getLeft(i);if(e===pt.st_nullNode()){r=i,n=this.newNode_(t),this.setLeft_(i,n),this.setParent_(n,i);break}i=e}else{if(1===e&&0===o)return this.m_comparator.onAddUniqueElementFailedImpl(t),this.setDuplicateElement_(i,s),-1;const h=this.getRight(i);if(h===pt.st_nullNode()){r=this.getNext(i),n=this.newNode_(t),this.setRight_(i,n),this.setParent_(n,i);break}i=h}h++}return this.bubbleUp_(n),this.getParent(n)===pt.st_nullNode()&&this.setRoot_(n,s),this.addToList_(r,n,s),this.m_maxDepthEver=Math.max(h,this.m_maxDepthEver),n}removeFromList_(t,e){const s=this.getPrev(t),i=this.getNext(t);-1!==s?this.setNext_(s,i):this.setFirst_(i,e),-1!==i?this.setPrev_(i,s):this.setLast_(s,e),this.setSize_(this.getSize_(e)-1,e)}unbalancedDelete_(t,e){this.removeFromList_(t,e);let s=this.getLeft(t),i=this.getRight(t),n=this.getParent(t),r=t;if(-1!==s&&-1!==i){let h;this.m_random=l(this.m_random),h=this.m_random>u()>>1?this.getNext(t):this.getPrev(t);const o=this.getParent(h)===t;this.m_treapData.swapField(t,h,0),this.m_treapData.swapField(t,h,1),this.m_treapData.swapField(t,h,2),-1!==n?this.getLeft(n)===t?this.setLeft_(n,h):this.setRight_(n,h):this.setRoot_(h,e),o?(s===h?(this.setLeft_(h,t),this.setParent_(i,h)):i===h&&(this.setRight_(h,t),this.setParent_(s,h)),this.setParent_(t,h),n=h):(this.setParent_(s,h),this.setParent_(i,h),n=this.getParent(t),r=h),s=this.getLeft(t),i=this.getRight(t),-1!==s&&this.setParent_(s,t),-1!==i&&this.setParent_(i,t)}const h=-1!==s?s:i;-1===n?this.setRoot_(h,e):this.getLeft(n)===r?this.setLeft_(n,h):this.setRight_(n,h),-1!==h&&this.setParent_(h,n),this.freeNode_(t,e)}deleteNode_(t,e){this.setPriority_(t,u());let s=pt.st_nullNode(),i=pt.st_nullNode();const n=this.getRoot_(e),r=n===t;if(r&&(s=this.getLeft(n),i=this.getRight(n),s===pt.st_nullNode()&&i===pt.st_nullNode()))return this.removeFromList_(n,e),this.freeNode_(n,e),void this.setRoot_(pt.st_nullNode(),e);this.bubbleDown_(t);const h=this.getParent(t);h!==pt.st_nullNode()&&(this.getLeft(h)===t?this.setLeft_(h,pt.st_nullNode()):this.setRight_(h,pt.st_nullNode())),this.removeFromList_(t,e),this.freeNode_(t,e),r&&this.setRoot_(s===pt.st_nullNode()||this.getParent(s)!==pt.st_nullNode()?i:s,e)}setElement_(t,e){this.m_treapData.setField(t,3,e)}addBiggestElement_(t,e){if(this.getRoot_(e)===pt.st_nullNode())return this.setRoot_(t,e),void this.addToList_(-1,t,e);const s=this.getLast_(e);this.setRight_(s,t),this.setParent_(t,s),this.bubbleUp_(t),this.getParent(t)===pt.st_nullNode()&&this.setRoot_(t,e),this.addToList_(-1,t,e)}}class gt{constructor(t){this.m_lists=new mt(6),this.m_listOfLists=gt.st_nullNode(),void 0===t?(this.m_listNodes=new mt(3),this.m_bStoreListIndexWithNode=!1):(this.m_listNodes=new mt(t?4:3),this.m_bStoreListIndexWithNode=t)}freeNode_(t){this.m_listNodes.deleteElement(t)}newNode_(){return this.m_listNodes.newElement()}freeList_(t){g(0)}newList_(){return this.m_lists.newElement()}setPrev_(t,e){this.m_listNodes.setField(t,1,e)}setNext_(t,e){this.m_listNodes.setField(t,2,e)}setData_(t,e){g(0)}setList_(t,e){return this.m_listNodes.setField(t,3,e)}setListSize_(t,e){this.m_lists.setField(t,4,e)}setNextList_(t,e){g(0)}setPrevList_(t,e){this.m_lists.setField(t,2,e)}createList(t){const e=this.newList_();return this.m_lists.setField(e,3,this.m_listOfLists),this.m_lists.setField(e,4,0),this.m_lists.setField(e,5,t),this.m_listOfLists!==gt.st_nullNode()&&this.setPrevList_(this.m_listOfLists,e),this.m_listOfLists=e,e}deleteList(t){this.clear(t);const e=this.m_lists.getField(t,2),s=this.m_lists.getField(t,3);return e!==gt.st_nullNode()?this.setNextList_(e,s):this.m_listOfLists=s,s!==gt.st_nullNode()&&this.setPrevList_(s,e),this.freeList_(t),s}reserveLists(t){g(0)}getListData(t){return this.m_lists.getField(t,5)}getList(t){return g(0),0}setListData(t,e){this.m_lists.setField(t,5,e)}addElement(t,e){return this.insertElement(t,-1,e)}insertElement(t,e,s){const i=this.newNode_();let n=-1;e!==gt.st_nullNode()&&(n=this.getPrev(e),this.setPrev_(e,i)),this.setNext_(i,e),n!==gt.st_nullNode()&&this.setNext_(n,i);if(e===this.m_lists.getField(t,0)&&this.m_lists.setField(t,0,i),e===gt.st_nullNode()){const e=this.m_lists.getField(t,1);this.setPrev_(i,e),-1!==e&&this.setNext_(e,i),this.m_lists.setField(t,1,i)}return this.setData(i,s),this.setListSize_(t,this.getListSize(t)+1),this.m_bStoreListIndexWithNode&&this.setList_(i,t),i}deleteElement(t,e){const s=this.getPrev(e),i=this.getNext(e);return s!==gt.st_nullNode()?this.setNext_(s,i):this.m_lists.setField(t,0,i),i!==gt.st_nullNode()?this.setPrev_(i,s):this.m_lists.setField(t,1,s),this.freeNode_(e),this.setListSize_(t,this.getListSize(t)-1),i}reserveNodes(t){this.m_listNodes.setCapacity(t)}getData(t){return this.m_listNodes.getField(t,0)}getElement(t){return this.getData(t)}setData(t,e){this.m_listNodes.setField(t,0,e)}getNext(t){return this.m_listNodes.getField(t,2)}getPrev(t){return this.m_listNodes.getField(t,1)}getFirst(t){return this.m_lists.getField(t,0)}getLast(t){return this.m_lists.getField(t,1)}static st_nullNode(){return-1}clear(t){if(void 0!==t){let e=this.getLast(t);for(;e!==gt.st_nullNode();){const t=e;e=this.getPrev(t),this.freeNode_(t)}return this.m_lists.setField(t,0,-1),this.m_lists.setField(t,1,-1),void this.setListSize_(t,0)}for(let e=this.getFirstList();-1!==e;)e=this.deleteList(e)}isEmpty(t){return g(0),!1}getNodeCount(){return this.m_listNodes.size()}getListCount(){return this.m_lists.size()}getListSize(t){return this.m_lists.getField(t,4)}getFirstList(){return this.m_listOfLists}getNextList(t){return this.m_lists.getField(t,3)}}class ft extends ct{constructor(t){super(),this.m_intervalTree=t}compare(t,e,s){const i=t.getElement(s),n=this.m_intervalTree.getValue_(e),r=this.m_intervalTree.getValue_(i);return n<r?-1:n===r?vt.isLeft_(e)&&vt.isRight_(i)?-1:vt.isLeft_(i)&&vt.isRight_(e)?1:0:1}}class vt{constructor(t){this.m_bEnvelopesRef=!1,this.m_intervals=[],this.m_envelopesRef=null,this.m_intervalNodes=new mt(3),this.m_intervalHandles=[],this.m_endIndicesUnique=[],this.m_cCount=-1,this.m_root=-1,this.m_bSortIntervals=!1,this.m_bConstructing=!1,this.m_bConstructionEnded=!1,this.m_bOfflineDynamic=t,this.m_tertiaryNodes=new mt(this.m_bOfflineDynamic?5:4),this.m_secondaryTreaps=new pt,this.m_secondaryTreaps.setComparator(new ft(this)),this.m_secondaryLists=new gt}addEnvelopesRef(t){this.reset_(!0,!0),this.m_bEnvelopesRef=!0,this.m_envelopesRef=t,this.m_bConstructing=!1,this.m_bConstructionEnded=!0,this.m_bOfflineDynamic||(this.insertIntervalsStatic_(),this.m_cCount=this.m_envelopesRef.length)}startConstruction(){this.reset_(!0,!1)}addInterval(t){this.m_bConstructing||N(""),this.m_intervals.push(t.clone())}addIntervalCoords(t,e){g(0)}endConstruction(){this.m_bConstructing||N(""),this.m_bConstructing=!1,this.m_bConstructionEnded=!0,this.m_bOfflineDynamic||(this.insertIntervalsStatic_(),this.m_cCount=this.m_intervals.length)}insert(t){if(this.m_bOfflineDynamic&&this.m_bConstructionEnded||N(""),-1===this.m_root){const t=this.m_bEnvelopesRef?this.m_envelopesRef.length:this.m_intervals.length;if(this.m_bSortIntervals){const e=new st(0);this.querySortedEndPointIndices_(e),this.m_endIndicesUnique.length=0,this.querySortedDuplicatesRemoved_(e),this.m_intervalHandles.length=t,this.m_intervalHandles.fill(-1),this.m_bSortIntervals=!1}else this.m_intervalHandles.fill(-1,0,t);this.m_root=this.createRoot_()}const e=this.insertIntervalEnd_(t<<1,this.m_root),s=this.getSecondaryFromInterval_(e),i=this.m_secondaryTreaps.addElement(1+(t<<1),s);this.setRightEnd_(e,i),this.m_intervalHandles[t]=e,this.m_cCount++}remove(t){this.m_bOfflineDynamic&&this.m_bConstructionEnded||N("");const e=this.m_intervalHandles[t];let s;-1===e&&f("the interval does not exist in the interval tree"),this.m_intervalHandles[t]=-1,this.m_cCount--;let i=this.getSecondaryFromInterval_(e),n=-1;n=this.m_secondaryTreaps.getTreapData(i),this.m_secondaryTreaps.deleteNode(this.getLeftEnd_(e),i),this.m_secondaryTreaps.deleteNode(this.getRightEnd_(e),i),s=this.m_secondaryTreaps.size(i),0===s&&(this.m_secondaryTreaps.deleteTreap(i),this.setSecondaryToTertiary_(n,-1)),this.m_intervalNodes.deleteElement(e);let r=this.getPptr_(n),h=this.getLptr_(n),o=this.getRptr_(n);for(;!(s>0||n===this.m_root||-1!==h&&-1!==o);)n===this.getLptr_(r)?-1!==h?(this.setLptr_(r,h),this.setPptr_(h,r),this.setLptr_(n,-1),this.setPptr_(n,-1)):-1!==o?(this.setLptr_(r,o),this.setPptr_(o,r),this.setRptr_(n,-1),this.setPptr_(n,-1)):(this.setLptr_(r,-1),this.setPptr_(n,-1)):-1!==h?(this.setRptr_(r,h),this.setPptr_(h,r),this.setLptr_(n,-1),this.setPptr_(n,-1)):-1!==o?(this.setRptr_(r,o),this.setPptr_(o,r),this.setRptr_(n,-1),this.setPptr_(n,-1)):(this.setRptr_(r,-1),this.setPptr_(n,-1)),this.m_tertiaryNodes.deleteElement(n),n=r,i=this.getSecondaryFromTertiary_(n),s=-1!==i?this.m_secondaryTreaps.size(i):0,h=this.getLptr_(n),o=this.getRptr_(n),r=this.getPptr_(n)}size(){return this.m_cCount}getIteratorQuery(t,e){return t instanceof r?new yt(this,t,e):(g(0),{})}getIterator(){return new yt(this)}querySortedEndPointIndices_(t){const e=this.m_bEnvelopesRef?this.m_envelopesRef.length:this.m_intervals.length;for(let s=0;s<2*e;s++)t.add(s);this.sortEndIndices_(t,0,2*e)}querySortedDuplicatesRemoved_(t){let e=Number.NaN;for(let s=0;s<t.size();s++){const i=t.read(s),n=this.getValue_(i);n!==e&&(this.m_endIndicesUnique.push(i),e=n)}}insertIntervalsStatic_(){const t=this.m_bEnvelopesRef?this.m_envelopesRef.length:this.m_intervals.length,s=new st(0);this.querySortedEndPointIndices_(s),this.m_endIndicesUnique.length=0,this.querySortedDuplicatesRemoved_(s),this.m_intervalNodes.setCapacity(t),this.m_secondaryLists.reserveNodes(2*t);const i=e(t,-1);this.m_root=this.createRoot_();for(let e=0;e<s.size();e++){const t=s.read(e);let n=i[t>>1];if(-1!==n){const e=this.getSecondaryFromInterval_(n);this.setRightEnd_(n,this.m_secondaryLists.addElement(e,t))}else n=this.insertIntervalEnd_(t,this.m_root),i[t>>1]=n}}createRoot_(){const t=this.calculateDiscriminantIndex1_(0,this.m_endIndicesUnique.length-1);return this.createTertiaryNode_(t)}insertIntervalEnd_(t,e){let s=-1,i=e,n=-1,r=-1,h=0,o=this.m_endIndicesUnique.length-1,a=0;const m=t>>1;let _=Number.NaN,l=Number.NaN,u=!0;const d=this.getMin_(m),c=this.getMax_(m);let p=-1;for(;u;){a=h+(o-h>>1),p=this.calculateDiscriminantIndex1_(h,o);const e=this.getDiscriminantFromIndex1_(p);if(c<e){if(-1!==i)if(p===this.getDiscriminantIndex1_(i))s=i,_=e,i=this.getLptr_(i),l=-1!==i?this.getDiscriminant_(i):Number.NaN;else if(l>e){const t=this.createTertiaryNode_(p);e<_?this.setLptr_(s,t):this.setRptr_(s,t),this.setRptr_(t,i),this.m_bOfflineDynamic&&(this.setPptr_(t,s),this.setPptr_(i,t)),s=t,_=e,i=-1,l=Number.NaN}o=a;continue}if(d>e){if(-1!==i)if(p===this.getDiscriminantIndex1_(i))s=i,_=e,i=this.getRptr_(i),l=-1!==i?this.getDiscriminant_(i):Number.NaN;else if(l<e){const t=this.createTertiaryNode_(p);e<_?this.setLptr_(s,t):this.setRptr_(s,t),this.setLptr_(t,i),this.m_bOfflineDynamic&&(this.setPptr_(t,s),this.setPptr_(i,t)),s=t,_=e,i=-1,l=Number.NaN}h=a+1;continue}let m=-1;m=-1===i||p!==this.getDiscriminantIndex1_(i)?this.createTertiaryNode_(p):i,n=this.getSecondaryFromTertiary_(m),-1===n&&(n=this.createSecondary_(m),this.setSecondaryToTertiary_(m,n));const g=this.addEndIndex_(n,t);r=this.createIntervalNode_(),this.setSecondaryToInterval_(r,n),this.setLeftEnd_(r,g),-1!==i&&p===this.getDiscriminantIndex1_(i)||(e<_?this.setLptr_(s,m):this.setRptr_(s,m),this.m_bOfflineDynamic&&this.setPptr_(m,s),-1!==i&&(l<e?this.setLptr_(m,i):this.setRptr_(m,i),this.m_bOfflineDynamic&&this.setPptr_(i,m))),u=!1;break}return r}createTertiaryNode_(t){const e=this.m_tertiaryNodes.newElement();return this.setDiscriminantIndex1_(e,t),e}createSecondary_(t){return this.m_bOfflineDynamic?this.m_secondaryTreaps.createTreap(t):this.m_secondaryLists.createList(t)}createIntervalNode_(){return this.m_intervalNodes.newElement()}reset(){this.m_bOfflineDynamic&&this.m_bConstructionEnded||N(""),this.reset_(!1,this.m_bEnvelopesRef)}reset_(t,e){t?(this.m_bEnvelopesRef=!1,this.m_envelopesRef=null,this.m_bSortIntervals=!0,this.m_bConstructing=!0,this.m_bConstructionEnded=!1,this.m_endIndicesUnique.length=0,e?(this.m_intervals.length=0,this.m_bEnvelopesRef=!0):this.m_intervals.length=0):this.m_bSortIntervals=!1,this.m_bOfflineDynamic?this.m_secondaryTreaps.clear():this.m_secondaryLists.clear(),this.m_intervalNodes.deleteAll(!1),this.m_tertiaryNodes.deleteAll(!1),this.m_root=-1,this.m_cCount=0}getDiscriminant_(t){const e=this.getDiscriminantIndex1_(t);return this.getDiscriminantFromIndex1_(e)}getDiscriminantFromIndex1_(t){if(-1===t)return Number.NaN;if(t>0){const e=t-2,s=this.m_endIndicesUnique[e],i=this.m_endIndicesUnique[e+1];return.5*(this.getValue_(s)+this.getValue_(i))}const e=-t-2,s=this.m_endIndicesUnique[e];return this.getValue_(s)}calculateDiscriminantIndex1_(t,e){let s;if(t<e){s=t+(e-t>>1)+2}else s=-(t+2);return s}setDiscriminantIndex1_(t,e){this.m_tertiaryNodes.setField(t,0,e)}setSecondaryToTertiary_(t,e){this.m_tertiaryNodes.setField(t,1,e)}setLptr_(t,e){this.m_tertiaryNodes.setField(t,2,e)}setRptr_(t,e){this.m_tertiaryNodes.setField(t,3,e)}setPptr_(t,e){this.m_tertiaryNodes.setField(t,4,e)}setSecondaryToInterval_(t,e){this.m_intervalNodes.setField(t,0,e)}addEndIndex_(t,e){let s=-1;return s=this.m_bOfflineDynamic?this.m_secondaryTreaps.addElement(e,t):this.m_secondaryLists.addElement(t,e),s}setLeftEnd_(t,e){this.m_intervalNodes.setField(t,1,e)}setRightEnd_(t,e){this.m_intervalNodes.setField(t,2,e)}getFirst_(t){return this.m_bOfflineDynamic?this.m_secondaryTreaps.getFirst(t):this.m_secondaryLists.getFirst(t)}getLast_(t){return this.m_bOfflineDynamic?this.m_secondaryTreaps.getLast(t):this.m_secondaryLists.getLast(t)}static isLeft_(t){return!(1&t)}static isRight_(t){return!(1&~t)}getDiscriminantIndex1_(t){return this.m_tertiaryNodes.getField(t,0)}getSecondaryFromTertiary_(t){return this.m_tertiaryNodes.getField(t,1)}getLptr_(t){return this.m_tertiaryNodes.getField(t,2)}getRptr_(t){return this.m_tertiaryNodes.getField(t,3)}getPptr_(t){return this.m_tertiaryNodes.getField(t,4)}getSecondaryFromInterval_(t){return this.m_intervalNodes.getField(t,0)}getLeftEnd_(t){return this.m_intervalNodes.getField(t,1)}getRightEnd_(t){return this.m_intervalNodes.getField(t,2)}getMin_(t){return this.m_bEnvelopesRef?this.m_envelopesRef[t].xmin:this.m_intervals[t].vmin}getMax_(t){return this.m_bEnvelopesRef?this.m_envelopesRef[t].xmax:this.m_intervals[t].vmax}sortEndIndices_(t,e,s){const i=this,n={userSort(t,e,s){i.sortEndIndicesHelper_(s,t,e)},getValue:t=>i.getValue_(t)};(new at).sort(t,e,s,n)}sortEndIndicesHelper_(t,e,s){t.sort(e,s,(t,e)=>{const s=this.getValue_(t),i=this.getValue_(e);return s<i||s===i&&vt.isLeft_(t)&&vt.isRight_(e)?-1:1})}getValue_(t){if(!this.m_bEnvelopesRef){const e=this.m_intervals[t>>1];return vt.isLeft_(t)?e.vmin:e.vmax}const e=this.m_envelopesRef[t>>1];return vt.isLeft_(t)?e.xmin:e.xmax}}class yt{constructor(t,e,s){this.m_query=r.constructEmpty(),this.m_tertiaryHandle=-1,this.m_nextTertiaryHandle=-1,this.m_forkedHandle=-1,this.m_currentEndHandle=-1,this.m_nextEndHandle=-1,this.m_tertiaryStack=[],this.m_functionIndex=0,this.m_intervalTree=t,this.m_functionStack=new Array(2),this.m_functionStack[0]=this.nullFunc_,this.m_functionStack[1]=this.nullFunc_,void 0!==e&&this.resetIterator(e,s)}nullFunc_(){return b("should not be called"),!1}resetIterator(t,e){if("number"==typeof t){const s=new r;s.setCoords(t,t),this.resetIterator(s,e)}else void 0===e&&(e=0),this.m_query.vmin=t.vmin-e,this.m_query.vmax=t.vmax+e,this.m_tertiaryStack.length=0,this.m_functionIndex=0,this.m_functionStack[0]=this.initialize_}next(){if(this.m_intervalTree.m_bConstructionEnded||N(""),this.m_functionIndex<0)return-1;for(;this.m_fi=this.m_functionStack[this.m_functionIndex],this.m_fi(););return-1!==this.m_currentEndHandle?this.getCurrentEndIndex_()>>1:-1}initialize_(){return this.m_tertiaryHandle=-1,this.m_nextTertiaryHandle=-1,this.m_forkedHandle=-1,this.m_currentEndHandle=-1,this.m_intervalTree.m_tertiaryNodes.size()>0?(this.m_functionStack[0]=this.pIn_,this.m_nextTertiaryHandle=this.m_intervalTree.m_root,!0):(this.m_functionIndex=-1,!1)}pIn_(){if(this.m_tertiaryHandle=this.m_nextTertiaryHandle,-1===this.m_tertiaryHandle)return this.m_functionIndex=-1,this.m_currentEndHandle=-1,!1;const t=this.m_intervalTree.getDiscriminant_(this.m_tertiaryHandle);if(this.m_query.vmax<t){const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getLptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(t),this.m_functionStack[++this.m_functionIndex]=this.left_),!0}if(t<this.m_query.vmin){const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getRptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getLast_(t),this.m_functionStack[++this.m_functionIndex]=this.right_),!0}this.m_functionStack[this.m_functionIndex]=this.pL_,this.m_forkedHandle=this.m_tertiaryHandle;const e=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getLptr_(this.m_tertiaryHandle),-1!==e&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(e),this.m_functionStack[++this.m_functionIndex]=this.all_),!0}pL_(){if(this.m_tertiaryHandle=this.m_nextTertiaryHandle,-1===this.m_tertiaryHandle)return this.m_functionStack[this.m_functionIndex]=this.pR_,this.m_nextTertiaryHandle=this.m_intervalTree.getRptr_(this.m_forkedHandle),!0;if(this.m_intervalTree.getDiscriminant_(this.m_tertiaryHandle)<this.m_query.vmin){const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getRptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getLast_(t),this.m_functionStack[++this.m_functionIndex]=this.right_),!0}const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);this.m_nextTertiaryHandle=this.m_intervalTree.getLptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(t),this.m_functionStack[++this.m_functionIndex]=this.all_);const e=this.m_intervalTree.getRptr_(this.m_tertiaryHandle);return-1!==e&&this.m_tertiaryStack.push(e),!0}pR_(){if(this.m_tertiaryHandle=this.m_nextTertiaryHandle,-1===this.m_tertiaryHandle)return this.m_functionStack[this.m_functionIndex]=this.pT_,!0;const t=this.m_intervalTree.getDiscriminant_(this.m_tertiaryHandle);if(this.m_query.vmax<t){const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getLptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(t),this.m_functionStack[++this.m_functionIndex]=this.left_),!0}const e=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);this.m_nextTertiaryHandle=this.m_intervalTree.getRptr_(this.m_tertiaryHandle),-1!==e&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(e),this.m_functionStack[++this.m_functionIndex]=this.all_);const s=this.m_intervalTree.getLptr_(this.m_tertiaryHandle);return-1!==s&&this.m_tertiaryStack.push(s),!0}pT_(){if(0===this.m_tertiaryStack.length)return this.m_functionIndex=-1,this.m_currentEndHandle=-1,!1;this.m_tertiaryHandle=this.m_tertiaryStack.at(-1),this.m_tertiaryStack.pop();const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(t),this.m_functionStack[++this.m_functionIndex]=this.all_),-1!==this.m_intervalTree.getLptr_(this.m_tertiaryHandle)&&this.m_tertiaryStack.push(this.m_intervalTree.getLptr_(this.m_tertiaryHandle)),-1!==this.m_intervalTree.getRptr_(this.m_tertiaryHandle)&&this.m_tertiaryStack.push(this.m_intervalTree.getRptr_(this.m_tertiaryHandle)),!0}left_(){return this.m_currentEndHandle=this.m_nextEndHandle,-1!==this.m_currentEndHandle&&vt.isLeft_(this.getCurrentEndIndex_())&&this.m_intervalTree.getValue_(this.getCurrentEndIndex_())<=this.m_query.vmax?(this.m_nextEndHandle=this.getNext_(),!1):(this.m_functionIndex--,!0)}right_(){return this.m_currentEndHandle=this.m_nextEndHandle,-1!==this.m_currentEndHandle&&vt.isRight_(this.getCurrentEndIndex_())&&this.m_intervalTree.getValue_(this.getCurrentEndIndex_())>=this.m_query.vmin?(this.m_nextEndHandle=this.getPrev_(),!1):(this.m_functionIndex--,!0)}all_(){return this.m_currentEndHandle=this.m_nextEndHandle,-1!==this.m_currentEndHandle&&vt.isLeft_(this.getCurrentEndIndex_())?(this.m_nextEndHandle=this.getNext_(),!1):(this.m_functionIndex--,!0)}getNext_(){return this.m_intervalTree.m_bOfflineDynamic?this.m_intervalTree.m_secondaryTreaps.getNext(this.m_currentEndHandle):this.m_intervalTree.m_secondaryLists.getNext(this.m_currentEndHandle)}getPrev_(){return this.m_intervalTree.m_bOfflineDynamic?this.m_intervalTree.m_secondaryTreaps.getPrev(this.m_currentEndHandle):this.m_intervalTree.m_secondaryLists.getPrev(this.m_currentEndHandle)}getCurrentEndIndex_(){return this.m_intervalTree.m_bOfflineDynamic?this.m_intervalTree.m_secondaryTreaps.getElement(this.m_currentEndHandle):this.m_intervalTree.m_secondaryLists.getData(this.m_currentEndHandle)}}class xt{constructor(){this.m_tolerance=0,this.m_sweepIndexRed=-1,this.m_sweepIndexBlue=-1,this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_intervalTreeRed=null,this.m_intervalTreeBlue=null,this.m_iteratorRed=null,this.m_iteratorBlue=null,this.m_envelopesRed=[],this.m_envelopesBlue=[],this.m_elementsRed=[],this.m_elementsBlue=[],this.m_sortedEndIndicesRed=new st(0),this.m_sortedEndIndicesBlue=new st(0),this.m_queuedListRed=-1,this.m_queuedListBlue=-1,this.m_queuedEnvelopes=new gt,this.m_queuedIndicesRed=[],this.m_queuedIndicesBlue=[],this.m_bAddRed=!1,this.m_bAddBlue=!1,this.m_bAddRedRed=!1,this.m_bDone=!0,this.m_function=this.nullFunc_,this.reset_()}startConstruction(){this.reset_(),this.m_bAddRedRed=!0,this.m_elementsRed.length=0,this.m_envelopesRed.length=0}addEnvelope(t,e){this.m_bAddRedRed||N(""),this.m_elementsRed.push(t),this.m_envelopesRed.push(new p(e))}endConstruction(){this.m_bAddRedRed||N(""),this.m_bAddRedRed=!1,this.m_envelopesRed.length>0&&(this.m_function=this.initialize_,this.m_bDone=!1)}startRedConstruction(){this.reset_(),this.m_bAddRed=!0,this.m_elementsRed.length=0,this.m_envelopesRed.length=0}addRedEnvelope(t,e){this.m_bAddRed||N(""),this.m_elementsRed.push(t),this.m_envelopesRed.push(e.clone())}endRedConstruction(){this.m_bAddRed||N(""),this.m_bAddRed=!1,this.m_envelopesRed.length>0&&this.m_envelopesBlue.length>0&&(this.m_function===this.nullFunc_||this.m_function===this.initializeBlue_?this.m_function=this.initializeRedBlue_:this.m_function!==this.initializeRedBlue_&&(this.m_function=this.initializeRed_),this.m_bDone=!1)}startBlueConstruction(){this.reset_(),this.m_bAddBlue=!0,this.m_elementsBlue.length=0,this.m_envelopesBlue.length=0}addBlueEnvelope(t,e){this.m_bAddBlue||N(""),this.m_elementsBlue.push(t),this.m_envelopesBlue.push(e.clone())}endBlueConstruction(){this.m_bAddBlue||N(""),this.m_bAddBlue=!1,this.m_envelopesRed.length>0&&this.m_envelopesBlue.length>0&&(this.m_function===this.nullFunc_||this.m_function===this.initializeRed_?this.m_function=this.initializeRedBlue_:this.m_function!==this.initializeRedBlue_&&(this.m_function=this.initializeBlue_),this.m_bDone=!1)}next(){if(this.m_bDone)return!1;for(;this.m_function(););return!this.m_bDone}getHandleA(){return this.m_envelopeHandleA}getHandleB(){return this.m_envelopeHandleB}setTolerance(t){this.m_tolerance=t}getElement(t){return this.m_elementsRed[t]}getRedEnvelope(t){return this.m_envelopesRed[t]}getBlueEnvelope(t){return this.m_envelopesBlue[t]}getRedElement(t){return this.m_elementsRed[t]}getBlueElement(t){return this.m_elementsBlue[t]}isTop_(t){return!(1&~t)}isBottom_(t){return!(1&t)}reset_(){this.m_bAddRed=!1,this.m_bAddBlue=!1,this.m_bAddRedRed=!1,this.m_sweepIndexRed=-1,this.m_sweepIndexBlue=-1,this.m_queuedListRed=-1,this.m_queuedListBlue=-1,this.m_bDone=!0}initialize_(){if(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_envelopesRed.length<10)return this.m_sweepIndexRed=this.m_envelopesRed.length,this.m_function=this.sweepBruteForce_,!0;this.m_intervalTreeRed||(this.m_intervalTreeRed=new vt(!0)),this.m_intervalTreeRed.addEnvelopesRef(this.m_envelopesRed),null===this.m_iteratorRed&&(this.m_iteratorRed=this.m_intervalTreeRed.getIterator()),this.m_sortedEndIndicesRed.resize(0);for(let t=0;t<2*this.m_envelopesRed.length;t++)this.m_sortedEndIndicesRed.add(t);return this.sortYEndIndices_(this.m_sortedEndIndicesRed,0,2*this.m_envelopesRed.length,!0),this.m_sweepIndexRed=2*this.m_envelopesRed.length,this.m_function=this.sweep_,!0}initializeRed_(){if(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_envelopesRed.length<10||this.m_envelopesBlue.length<10)return this.m_sweepIndexRed=this.m_envelopesRed.length,this.m_function=this.sweepRedBlueBruteForce_,!0;this.m_intervalTreeRed||(this.m_intervalTreeRed=new vt(!0)),this.m_intervalTreeRed.addEnvelopesRef(this.m_envelopesRed),null===this.m_iteratorRed&&(this.m_iteratorRed=this.m_intervalTreeRed.getIterator()),this.m_sortedEndIndicesRed.resize(0);for(let t=0;t<2*this.m_envelopesRed.length;t++)this.m_sortedEndIndicesRed.add(t);return this.sortYEndIndices_(this.m_sortedEndIndicesRed,0,this.m_sortedEndIndicesRed.size(),!0),this.m_sweepIndexRed=this.m_sortedEndIndicesRed.size(),-1!==this.m_queuedListRed&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListRed),this.m_queuedIndicesRed.length=0,this.m_queuedListRed=-1),this.m_function=this.sweepRedBlue_,this.resetBlue_()}initializeBlue_(){if(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_envelopesRed.length<10||this.m_envelopesBlue.length<10)return this.m_sweepIndexRed=this.m_envelopesRed.length,this.m_function=this.sweepRedBlueBruteForce_,!0;this.m_intervalTreeBlue||(this.m_intervalTreeBlue=new vt(!0)),this.m_intervalTreeBlue.addEnvelopesRef(this.m_envelopesBlue),null==this.m_iteratorBlue&&(this.m_iteratorBlue=this.m_intervalTreeBlue.getIterator()),this.m_sortedEndIndicesBlue.resize(0);for(let t=0;t<2*this.m_envelopesBlue.length;t++)this.m_sortedEndIndicesBlue.add(t);return this.sortYEndIndices_(this.m_sortedEndIndicesBlue,0,this.m_sortedEndIndicesBlue.size(),!1),this.m_sweepIndexBlue=this.m_sortedEndIndicesBlue.size(),-1!==this.m_queuedListBlue&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListBlue),this.m_queuedIndicesBlue.length=0,this.m_queuedListBlue=-1),this.m_function=this.sweepRedBlue_,this.resetRed_()}initializeRedBlue_(){if(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_envelopesRed.length<10||this.m_envelopesBlue.length<10)return this.m_sweepIndexRed=this.m_envelopesRed.length,this.m_function=this.sweepRedBlueBruteForce_,!0;this.m_intervalTreeRed||(this.m_intervalTreeRed=new vt(!0)),this.m_intervalTreeBlue||(this.m_intervalTreeBlue=new vt(!0)),this.m_intervalTreeRed.addEnvelopesRef(this.m_envelopesRed),this.m_intervalTreeBlue.addEnvelopesRef(this.m_envelopesBlue),null===this.m_iteratorRed&&(this.m_iteratorRed=this.m_intervalTreeRed.getIterator()),null===this.m_iteratorBlue&&(this.m_iteratorBlue=this.m_intervalTreeBlue.getIterator()),this.m_sortedEndIndicesRed.resize(0),this.m_sortedEndIndicesBlue.resize(0);for(let t=0;t<2*this.m_envelopesRed.length;t++)this.m_sortedEndIndicesRed.add(t);for(let t=0;t<2*this.m_envelopesBlue.length;t++)this.m_sortedEndIndicesBlue.add(t);return this.sortYEndIndices_(this.m_sortedEndIndicesRed,0,this.m_sortedEndIndicesRed.size(),!0),this.sortYEndIndices_(this.m_sortedEndIndicesBlue,0,this.m_sortedEndIndicesBlue.size(),!1),this.m_sweepIndexRed=this.m_sortedEndIndicesRed.size(),this.m_sweepIndexBlue=this.m_sortedEndIndicesBlue.size(),-1!==this.m_queuedListRed&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListRed),this.m_queuedIndicesRed.length=0,this.m_queuedListRed=-1),-1!==this.m_queuedListBlue&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListBlue),this.m_queuedIndicesBlue.length=0,this.m_queuedListBlue=-1),this.m_function=this.sweepRedBlue_,!0}sweep_(){const t=this.m_sortedEndIndicesRed.read(--this.m_sweepIndexRed),e=t>>1;if(this.isBottom_(t))return this.m_intervalTreeRed.remove(e),0!==this.m_sweepIndexRed||(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1);const s=r.construct(this.m_envelopesRed[e].xmin,this.m_envelopesRed[e].xmax);return this.m_iteratorRed.resetIterator(s,this.m_tolerance),this.m_envelopeHandleA=e,this.m_function=this.iterate_,!0}sweepBruteForce_(){return-1===--this.m_sweepIndexRed?(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1):(this.m_envelopeHandleA=this.m_sweepIndexRed,this.m_sweepIndexBlue=this.m_sweepIndexRed,this.m_function=this.iterateBruteForce_,!0)}sweepRedBlueBruteForce_(){return-1===--this.m_sweepIndexRed?(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1):(this.m_envelopeHandleA=this.m_sweepIndexRed,this.m_sweepIndexBlue=this.m_envelopesBlue.length,this.m_function=this.iterateRedBlueBruteForce_,!0)}sweepRedBlue_(){const t=this.m_sortedEndIndicesRed.read(this.m_sweepIndexRed-1),e=this.m_sortedEndIndicesBlue.read(this.m_sweepIndexBlue-1),s=this.getAdjustedValue_(t,!0),i=this.getAdjustedValue_(e,!1);return s>i?this.sweepRed_():s<i?this.sweepBlue_():this.isTop_(t)?this.sweepRed_():this.isTop_(e)?this.sweepBlue_():this.sweepRed_()}sweepRed_(){const t=this.m_sortedEndIndicesRed.read(--this.m_sweepIndexRed),e=t>>1;if(this.isBottom_(t))return-1!==this.m_queuedListRed&&-1!==this.m_queuedIndicesRed[e]?(this.m_queuedEnvelopes.deleteElement(this.m_queuedListRed,this.m_queuedIndicesRed[e]),this.m_queuedIndicesRed[e]=-1):this.m_intervalTreeRed.remove(e),0!==this.m_sweepIndexRed||(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1);if(-1!==this.m_queuedListBlue&&this.m_queuedEnvelopes.getListSize(this.m_queuedListBlue)>0){let t=this.m_queuedEnvelopes.getFirst(this.m_queuedListBlue);for(;-1!==t;){const e=this.m_queuedEnvelopes.getData(t);this.m_intervalTreeBlue.insert(e),this.m_queuedIndicesBlue[e]=-1;const s=this.m_queuedEnvelopes.getNext(t);this.m_queuedEnvelopes.deleteElement(this.m_queuedListBlue,t),t=s}}if(this.m_intervalTreeBlue.size()>0){const t=r.construct(this.m_envelopesRed[e].xmin,this.m_envelopesRed[e].xmax);this.m_iteratorBlue.resetIterator(t,this.m_tolerance),this.m_envelopeHandleA=e,this.m_function=this.iterateBlue_}else-1===this.m_queuedListRed&&(c(this.m_queuedIndicesRed,this.m_envelopesRed.length,-1),this.m_queuedListRed=this.m_queuedEnvelopes.createList(1)),this.m_queuedIndicesRed[e]=this.m_queuedEnvelopes.addElement(this.m_queuedListRed,e),this.m_function=this.sweepRedBlue_;return!0}sweepBlue_(){const t=this.m_sortedEndIndicesBlue.read(--this.m_sweepIndexBlue),e=t>>1;if(this.isBottom_(t))return-1!==this.m_queuedListBlue&&-1!==this.m_queuedIndicesBlue[e]?(this.m_queuedEnvelopes.deleteElement(this.m_queuedListBlue,this.m_queuedIndicesBlue[e]),this.m_queuedIndicesBlue[e]=-1):this.m_intervalTreeBlue.remove(e),0!==this.m_sweepIndexBlue||(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1);if(-1!==this.m_queuedListRed&&this.m_queuedEnvelopes.getListSize(this.m_queuedListRed)>0){let t=this.m_queuedEnvelopes.getFirst(this.m_queuedListRed);for(;-1!==t;){const e=this.m_queuedEnvelopes.getData(t);this.m_intervalTreeRed.insert(e),this.m_queuedIndicesRed[e]=-1;const s=this.m_queuedEnvelopes.getNext(t);this.m_queuedEnvelopes.deleteElement(this.m_queuedListRed,t),t=s}}if(this.m_intervalTreeRed.size()>0){const t=r.construct(this.m_envelopesBlue[e].xmin,this.m_envelopesBlue[e].xmax);this.m_iteratorRed.resetIterator(t,this.m_tolerance),this.m_envelopeHandleB=e,this.m_function=this.iterateRed_}else-1===this.m_queuedListBlue&&(c(this.m_queuedIndicesBlue,this.m_envelopesBlue.length,-1),this.m_queuedListBlue=this.m_queuedEnvelopes.createList(0)),this.m_queuedIndicesBlue[e]=this.m_queuedEnvelopes.addElement(this.m_queuedListBlue,e),this.m_function=this.sweepRedBlue_;return!0}iterate_(){if(this.m_envelopeHandleB=this.m_iteratorRed.next(),-1!==this.m_envelopeHandleB)return!1;const t=this.m_sortedEndIndicesRed.read(this.m_sweepIndexRed)>>1;return this.m_intervalTreeRed.insert(t),this.m_function=this.sweep_,!0}iterateRed_(){if(this.m_envelopeHandleA=this.m_iteratorRed.next(),-1!==this.m_envelopeHandleA)return!1;this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1;const t=this.m_sortedEndIndicesBlue.read(this.m_sweepIndexBlue)>>1;return this.m_intervalTreeBlue.insert(t),this.m_function=this.sweepRedBlue_,!0}iterateBlue_(){if(this.m_envelopeHandleB=this.m_iteratorBlue.next(),-1!==this.m_envelopeHandleB)return!1;const t=this.m_sortedEndIndicesRed.read(this.m_sweepIndexRed)>>1;return this.m_intervalTreeRed.insert(t),this.m_function=this.sweepRedBlue_,!0}iterateBruteForce_(){if(-1===--this.m_sweepIndexBlue)return this.m_function=this.sweepBruteForce_,!0;const t=this.m_envelopesRed[this.m_sweepIndexRed].clone(),e=this.m_envelopesRed[this.m_sweepIndexBlue];return t.inflateCoords(this.m_tolerance,this.m_tolerance),!t.isIntersecting(e)||(this.m_envelopeHandleB=this.m_sweepIndexBlue,!1)}iterateRedBlueBruteForce_(){if(-1===--this.m_sweepIndexBlue)return this.m_function=this.sweepRedBlueBruteForce_,!0;const t=this.m_envelopesRed[this.m_sweepIndexRed].clone(),e=this.m_envelopesBlue[this.m_sweepIndexBlue];return t.inflateCoords(this.m_tolerance,this.m_tolerance),!t.isIntersecting(e)||(this.m_envelopeHandleB=this.m_sweepIndexBlue,!1)}resetRed_(){return this.m_sweepIndexRed=this.m_sortedEndIndicesRed.size(),this.m_intervalTreeRed.size()>0&&this.m_intervalTreeRed.reset(),-1!==this.m_queuedListRed&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListRed),this.m_queuedIndicesRed.length=0,this.m_queuedListRed=-1),this.m_bDone=!1,!0}resetBlue_(){return this.m_sweepIndexBlue=this.m_sortedEndIndicesBlue.size(),this.m_intervalTreeBlue.size()>0&&this.m_intervalTreeBlue.reset(),-1!==this.m_queuedListBlue&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListBlue),this.m_queuedIndicesBlue.length=0,this.m_queuedListBlue=-1),this.m_bDone=!1,!0}nullFunc_(){return b("should not be called"),!1}sortYEndIndices_(t,e,s,i){const n=this,r={userSort(t,e,s){n.sortYEndIndicesHelper_(s,t,e,i)},getValue:t=>n.getAdjustedValue_(t,i)};(new at).sort(t,e,s,r)}sortYEndIndicesHelper_(t,e,s,i){t.sort(e,s,(t,e)=>{const s=this.getAdjustedValue_(t,i),n=this.getAdjustedValue_(e,i);return s<n||s===n&&this.isBottom_(t)&&this.isTop_(e)?-1:1})}getAdjustedValue_(t,e){const s=.5*this.m_tolerance;if(e){const e=this.m_envelopesRed[t>>1];return this.isBottom_(t)?e.ymin-s:e.ymax+s}const i=this.m_envelopesBlue[t>>1];return this.isBottom_(t)?i.ymin-s:i.ymax+s}}var Et=z;class bt{constructor(t,e){this.tolerance=void 0!==t?t:Number.NaN,this.resolution=void 0!==e?e:Number.NaN}add(t){return new bt(this.tolerance+t,this.resolution)}scale(t){return new bt(this.tolerance*t,this.resolution*t)}total(){return this.tolerance+this.resolution}}function Nt(t,e,i,n,r){const h=n*n,o=t.sub(e),a=i.sub(e),m=o.sqrLength(),_=a.sqrLength();if(m<=h||_<=h)return!0;const l=s(o.crossProduct(a));if(l<=h*m||l<=h*_){return o.dotProduct(a)>=0}return!1}function Dt(t,e,s){return i=>0===s?(i+t)*e:1*(i-t*e)/e}function It(t,e){const s=new p;return t.queryLooseEnvelope(s),s.mergeEnvelope2D(e),s}function Ct(t,e){const s=p.constructEmpty();t.queryLooseEnvelope(s);const i=p.constructEmpty();return e.queryLooseEnvelope(i),s.mergeEnvelope2D(i),s}function Tt(t,e){return(Number.isFinite(t)||Number.isNaN(t))&&(Number.isFinite(e)||Number.isNaN(e))}function Rt(t,e){return Number.isFinite(t)&&Number.isFinite(e)}function At(t,e,s){const i=p.constructEmpty();i.setFromPoints(t,e);return Ft(0,null,i.calculateToleranceFromEnvelope(),s,!1)}function qt(t,e,s){return Ft(0,t,e.calculateToleranceFromEnvelope(),s,!1)}function wt(t,e,s){return Ft(1,t,e.calculateToleranceFromEnvelope(),s,!1)}function Bt(t,e,s){return wt(t,e.queryInterval(1,0),s)}function zt(t,e,s){const i=p.constructEmpty();return e.queryEnvelope(i),qt(t,i,s)}function Lt(t,e,s=!1){return Ft(0,t,e.calculateToleranceFromEnvelope(),s,!0).total()}function St(t,e,s){const i=p.constructEmpty();return e.queryEnvelope(i),Lt(t,i,s)}function Ft(t,e,s,i,n){const r=new bt(0,0);if(null!==e&&(r.tolerance=e.getTolerance(t),(!n||i)&&null!==e)){const s=e.getResolution(t);r.resolution=s,i&&(r.resolution*=2)}i&&(s*=4,r.tolerance*=1.01,r.resolution*=1.01);return r.total()<s?new bt(s,0):r}function Pt(t){return Math.sqrt(2)*(2*t.tolerance+t.resolution)}function Ht(t){return Math.sqrt(2)*(t.tolerance+t.resolution)}function Vt(t){return t>=3}function kt(t,e){const s=[0];return t.getImpl().getIsSimple(e,s)>=3}function Mt(t,e){t.getImpl().setIsSimple(3,e)}function Ot(t,e,n,r){if(s(e.x-t.x)+s(e.y-t.y)<=n*n){const s=t.z,n=e.z;return i(s,n,r)}return!1}function Yt(t){return t>=4}function Xt(t,e){return t===y.enumPolygon?Vt(e):e>=1}function Gt(t,e,s){const i=p.constructEmpty(),n=p.constructEmpty();t.queryLooseEnvelope(i),e.queryLooseEnvelope(n),i.inflateCoords(s,s),n.inflateCoords(s,s);const r=p.constructEmpty();r.setCoords({env2D:i}),r.intersect(n);const h=t.querySegmentIterator(),o=e.querySegmentIterator(),a=p.constructEmpty(),m=p.constructEmpty(),_=new xt;_.setTolerance(s);let l=!1;for(_.startRedConstruction();h.nextPath();)for(;h.hasNextSegment();){h.nextSegment().queryLooseEnvelope(a),a.isIntersecting(r)&&(l=!0,_.addRedEnvelope(h.getStartPointIndex(),a))}if(_.endRedConstruction(),!l)return null;let u=!1;for(_.startBlueConstruction();o.nextPath();)for(;o.hasNextSegment();){o.nextSegment().queryLooseEnvelope(m),m.isIntersecting(r)&&(u=!0,_.addBlueEnvelope(o.getStartPointIndex(),m))}return _.endBlueConstruction(),u?_:null}function Ut(t,e,s,i,n){t.getGeometryType(),e.getGeometryType();const r=p.constructEmpty(),h=p.constructEmpty();t.queryLooseEnvelope(r),e.queryLooseEnvelope(h),r.inflateCoords(s,s),h.inflateCoords(s,s);const o=p.constructEmpty();o.setCoords({env2D:r}),o.intersect(h);const a=new xt;a.setTolerance(s);let m=!1;a.startRedConstruction();for(let l=0,u=t.getPathCount();l<u;l++)t.queryLoosePathEnvelope(l,r),r.isIntersecting(o)&&(m=!0,a.addRedEnvelope(l,r));if(a.endRedConstruction(),!m)return null;let _=!1;a.startBlueConstruction();for(let l=0,u=e.getPathCount();l<u;l++)e.queryLoosePathEnvelope(l,h),h.isIntersecting(o)&&(_=!0,a.addBlueEnvelope(l,h));return a.endBlueConstruction(),_?a:null}function Zt(t,e,s){const i=p.constructEmpty(),n=p.constructEmpty();t.queryLooseEnvelope(i),e.queryEnvelope(n),i.inflateCoords(s,s),n.inflateCoords(s,s);const r=p.constructEmpty();r.setCoords({env2D:i}),r.intersect(n);const h=t.querySegmentIterator(),o=new xt;o.setTolerance(s);let a=!1;for(o.startRedConstruction();h.nextPath();)for(;h.hasNextSegment();){h.nextSegment().queryLooseEnvelope(i),i.isIntersecting(r)&&(a=!0,o.addRedEnvelope(h.getStartPointIndex(),i))}if(o.endRedConstruction(),!a)return null;let m=!1;o.startBlueConstruction();for(let _=0,l=e.getPointCount();_<l;_++){const t=e.getXY(_);r.contains(t)&&(m=!0,o.addBlueEnvelope(_,p.construct(t.x,t.y,t.x,t.y)))}return o.endBlueConstruction(),m?o:null}function Qt(t,e,s){const i=p.constructEmpty(),n=p.constructEmpty();t.queryEnvelope(i),e.queryEnvelope(n),i.inflateCoords(s,s),n.inflateCoords(s,s);const r=p.constructEmpty();r.setCoords({env2D:i}),r.intersect(n);const h=new xt;h.setTolerance(s);let a=!1;h.startRedConstruction();const m=new o;for(let o=0,u=t.getPointCount();o<u;o++)t.queryXY(o,m),r.contains(m)&&(a=!0,h.addRedEnvelope(o,p.construct(m.x,m.y,m.x,m.y)));if(h.endRedConstruction(),!a)return null;let _=!1;h.startBlueConstruction();const l=new o;for(let o=0,u=e.getPointCount();o<u;o++)e.queryXY(o,l),r.contains(l)&&(_=!0,h.addBlueEnvelope(o,p.construct(l.x,l.y,l.x,l.y)));return h.endBlueConstruction(),_?h:null}function jt(t){const e=new p;return t.queryLooseEnvelope(e),e.inflateCoords(1,1),Wt(t,e)}function Wt(t,e,s){const i=new p;if(t.queryLooseEnvelope(i),i.isEmpty())return null;t.getGeometryType();const n=new lt(i,8);let r=-1;const h=new p;let o=!1;do{for(let s=0,a=t.getPathCount();s<a;s++)if(t.queryLoosePathEnvelope(s,h),h.isIntersecting(e)){if(r=n.insertEx(s,h,r),-1===r){o&&b("build_quad_tree_for_paths"),i.assign(t.calculateEnvelope2D(!1)),o=!0,n.reset(i,8);break}o=!1}}while(o);return n}function Jt(t,e){if(!e){const e=new p;t.queryLooseEnvelope(e);const s=new lt(e,8);let i=-1;const n=new p,r=t.querySegmentIterator();let h=!1;for(;r.nextPath();)for(;r.hasNextSegment();){const o=r.nextSegment(),a=r.getStartPointIndex();if(o.queryLooseEnvelope(n),i=s.insertEx(a,n,i),-1===i){h&&b(""),e.assign(t.calculateEnvelope2D(!1)),h=!0,s.reset(e,8),r.resetToFirstPath();break}}return s}const s=new p;t.queryLooseEnvelope(s);const i=new lt(s,8);let n=-1;const r=new p,h=t.querySegmentIterator();let o=!1;for(;h.nextPath();)for(;h.hasNextSegment();){const a=h.nextSegment(),m=h.getStartPointIndex();if(a.queryLooseEnvelope(r),r.isIntersecting(e)&&(n=i.insertEx(m,r,n),-1===n)){o&&b(""),s.assign(t.calculateEnvelope2D(!1)),o=!0,i.reset(s,8),h.resetToFirstPath();break}}return i}function Kt(t,e){if(e){const s=new lt(e,8),i=new o,n=new p;let r=!1;for(let h=0;h<t.getPointCount();h++){if(i.setCoordsPoint2D(t.getXY(h)),!e.contains(i))continue;n.setCoords({pt:i});-1!==s.insert(h,n)||(r&&b(""),r=!0,s.reset(t.calculateEnvelope2D(),8),h=-1)}return s}return x("no-extent version not yet impl"),null}function $t(t,e,s,i,n){let r=!1;const h=n.vmin,o=n.vmax;for(let a=s;a<e;a+=i){const e=t.read(a);e<h?(r=!0,t.write(a,h)):e>o&&(r=!0,t.write(a,o))}return r}function te(t,e,s,i){if(!t.hasAttribute(s))return!1;const n=t.getGeometryType();if(n===y.enumGeometryCollection){const n=t,r=n.getGeometryCount();let h=0;for(let t=0;t<r;++t){h|=te(n.getGeometry(t),e,s,i)?1:0}return!!h}if(D(n)){const n=t,r=Et.getPersistence(s),h=Et.getComponentCount(s),o=n.getPointCount();if(1===r){const t=$t(n.getAttributeStreamRef(s),o*h,i,h,e);return t&&n.notifyModified(),t}if(2===r){const t=$t(n.getAttributeStreamRef(s),o*h,i,h,e);return t&&n.notifyModified(),t}b("snap_coordinate not implemented")}if(n===y.enumEnvelope){const n=t,r=n.queryInterval(s,i);let h=!1;return r.vmin<e.vmin&&(h=!0,r.vmin=e.vmin),r.vmax>e.vmax&&(h=!0,r.vmax=e.vmax),h&&n.setIntervalEnvelope(s,i,r),h}if(n===y.enumPoint){const n=t;let r=n.getAttributeAsDbl(s,i),h=!1;return r<e.vmin&&(h=!0,r=e.vmin),r>e.vmax&&(h=!0,r=e.vmax),h&&n.setAttributeBasic(s,i,r),h}if(I(n)){const n=t;let r=n.getStartAttributeAsDbl(s,i),h=!1;return r<e.vmin&&(h=!0,r=e.vmin),r>e.vmax&&(h=!0,r=e.vmax),h&&n.setStartAttribute(s,i,r),r=n.getEndAttributeAsDbl(s,i),r<e.vmin&&(h=!0,r=e.vmin),r>e.vmax&&(h=!0,r=e.vmax),h&&n.setEndAttribute(s,i,r),h}b("snap_coordinate not implemented")}var ee=z;class se{constructor(t){if(this.m_description=null,this.x=Number.NaN,this.y=Number.NaN,this.m_attribs=null,t){if(!t.copy)return t.move?(this.m_description=t.move.m_description,t.move.m_description=null,this.m_attribs=t.move.m_attribs,t.move.m_attribs=null,this.x=t.move.x,void(this.y=t.move.y)):t.vd?(this.m_description=t.vd,void(t.attribBuffer?(this.m_attribs=t.attribBuffer,t.initDefaultValues&&this.setDefaultAttributeValues()):this.ensureAttributes())):t.pt?(this.m_description=M(),void this.setXY(t.pt)):void("x"in t&&("z"in t?(this.m_description=O(),this.ensureAttributes(),this.setXYZ(new X(t.x,t.y,t.z))):(this.m_description=M(),this.setXYCoords(t.x,t.y))));t.copy.copyTo(this)}else this.m_description=M()}assignCopy(t){return this.m_attribs=null,t.copyTo(this),this}assignMove(t){return this.m_attribs=null,t.copyTo(this),t.setEmpty(),this}getXY(){return new o(this.x,this.y)}queryXY(t){t.x=this.x,t.y=this.y}setXY(t){this.x=t.x,this.y=t.y}setXYCoords(t,e){this.x=t,this.y=e}getXYZ(){const t=new X;return t.x=this.x,t.y=this.y,t.z=this.getZ(),t}setXYZ(t){this.addAttribute(1),this.x=t.x,this.y=t.y,this.m_attribs[0]=t.z}getX(){return this.x}setX(t){this.x=t}getY(){return this.y}setY(t){this.y=t}getZ(){return this.m_description.hasZ()?this.m_attribs[0]:ee.getDefaultValue(1)}setZ(t){this.addAttribute(1),this.m_attribs[0]=t}getM(){return this.getAttributeAsDbl(2,0)}setM(t){this.addAttribute(2),this.m_description.hasZ()?this.m_attribs[1]=t:this.m_attribs[0]=t}getID(){return this.getAttributeAsInt(3,0)}setID(t){this.setAttributeBasic(3,0,t)}isEqualXY(t,e){return void 0===e&&(e=0),Math.abs(t.x-this.x)<=e&&Math.abs(t.y-this.y)<=e}isEqualXYCoords(t,e,s){return void 0===s&&(s=0),Math.abs(t-this.x)<=s&&Math.abs(e-this.y)<=s}getAttributeAsDbl(t,e){if(0===t){if(0===e)return this.x;if(1===e)return this.y;v("")}const s=ee.getComponentCount(t);(e<0||e>=s)&&v("");const i=this.m_description.getAttributeIndex(t);return i>=0?this.m_attribs[this.m_description.getPointAttributeOffset(i)-2+e]:ee.getDefaultValue(t)}getAttributeAsInt(t,e){return Math.trunc(this.getAttributeAsDbl(t,e))}setAttributeBasic(t,e,s){if(0===t)return void(0===e?this.x=s:1===e?this.y=s:v(""));const i=ee.getComponentCount(t);(e<0||e>=i)&&v("");let n=this.m_description.getAttributeIndex(t);n<0&&(this.addAttribute(t),n=this.m_description.getAttributeIndex(t)),this.m_attribs[this.m_description.getPointAttributeOffset(n)-2+e]=s}copyAttributesFrom(t,e){if(this===t)return;const s=t.getDescription();for(let i=e&&s.hasZ()?2:1,n=s.getAttributeCount();i<n;++i){const e=s.getSemantics(i),n=ee.getComponentCount(e);for(let s=0;s<n;++s){const i=t.getAttributeAsDbl(e,s);this.setAttributeBasic(e,s,i)}}}getAttributeArray(){return this.m_attribs}getDescription(){return this.m_description}assignVertexDescription(t){this.m_description!==t&&this.assignVertexDescriptionImpl(t)}mergeVertexDescription(t){this.m_description!==t&&(this.m_description.hasAttributesFrom(t)||this.mergeVertexDescriptionImpl(t))}hasAttribute(t){return this.m_description.hasAttribute(t)}addAttribute(t){if(this.m_description.hasAttribute(t))return;const e=V(this.m_description,t);this.assignVertexDescription(e)}dropAttribute(t){if(!this.m_description.hasAttribute(t))return;const e=k(this.m_description,t);this.assignVertexDescription(e)}dropAllAttributes(){const t=M();t!==this.m_description&&this.assignVertexDescription(t)}getGeometryType(){return y.enumPoint}getDimension(){return 0}queryEnvelope(t){if(t instanceof he)return t.setEmpty(),t.assignVertexDescription(this.m_description),void t.merge(this);if(t instanceof G){if(this.isEmpty())return void t.setEmpty();const e=this.getXYZ();return t.xmin=e.x,t.ymin=e.y,t.zmin=e.z,t.xmax=e.x,t.ymax=e.y,void(t.zmax=e.z)}this.isEmpty()?t.setEmpty():(t.xmin=this.x,t.ymin=this.y,t.xmax=this.x,t.ymax=this.y)}queryLooseEnvelope(t){this.queryEnvelope(t)}queryInterval(t,e){const s=new r;if(this.isEmpty())return s.setEmpty(),s;const i=this.getAttributeAsDbl(t,e);return s.vmin=i,s.vmax=i,s}applyTransformation(t){if(!this.isEmpty()){if(1===t.m_TransformationType){const e=this.getXY();return t.transformInPlace(e),void this.setXY(e)}x("3d not impl")}}transformAttribute(t,e,s,i,n){if(this.isEmpty())return;this.addAttribute(t);const r=this.getAttributeAsDbl(t,e),h=Dt(s,i,n);this.setAttributeBasic(t,e,h(r))}createInstance(){return new se({vd:this.m_description})}copyTo(t){if(this===t)return;t.getGeometryType()!==y.enumPoint&&f();const e=t;e.x=this.x,e.y=this.y,this.m_attribs?(e.assignVertexDescription(this.m_description),e.m_attribs=this.m_attribs.slice()):(e.releaseAttributes(),e.assignVertexDescription(this.m_description))}isEmpty(){return Number.isNaN(this.x)||Number.isNaN(this.y)}setEmpty(){this.m_description||(this.m_description=M(),this.releaseAttributes()),this.x=Number.NaN,this.y=Number.NaN,this.m_attribs&&m(this.m_attribs,this.m_description.getDefaultPointAttributes(),0,2,this.m_description.getTotalComponentCount()-2)}calculateArea2D(){return 0}calculateLength2D(){return 0}calculateLength3D(t){return 0}equals(t,e){if(t===this)return!0;if(t.getGeometryType()!==y.enumPoint)return!1;const s=t;if(this.m_description!==s.m_description)return!1;if(this.isEmpty()!==s.isEmpty())return!1;if(this.isEmpty())return!0;if(void 0===e&&(e=0),Math.abs(this.x-s.x)>e)return!1;if(Math.abs(this.y-s.y)>e)return!1;for(let n=0,r=this.m_description.getTotalComponentCount()-2;n<r;n++)if(!i(this.m_attribs[n],s.m_attribs[n],e))return!1;return!0}getBoundary(){return null}clone(){const t=new se({vd:this.m_description});return this.copyTo(t),t}swap(t){if(this===t)return;t.getGeometryType()!==y.enumPoint&&f("wrong geometry type");const e=t;e.m_description=h(this.m_description,this.m_description=e.m_description),e.x=h(this.x,this.x=e.x),e.y=h(this.y,this.y=e.y),e.m_attribs=h(this.m_attribs,this.m_attribs=e.m_attribs)}replaceNaNs(t,e){if(this.addAttribute(t),this.isEmpty())return;const s=ee.getComponentCount(t);for(let i=0;i<s;i++){const s=this.getAttributeAsDbl(t,i);Number.isNaN(s)&&this.setAttributeBasic(t,i,e)}}lerp(t,e,s){if(t.getDescription()!==e.getDescription()&&f("Point.lerp"),this.assignVertexDescription(t.getDescription()),t.isEmpty()||e.isEmpty())return this.setEmpty(),this;this.ensureAttributes();const i=B();t.queryValues(i,i.length);const n=B();e.queryValues(n,n.length);const r=B();let h=i,o=n;const a=r;let m=0;for(let l=0,u=this.m_description.getAttributeCount();l<u;l++){const t=this.m_description.getSemantics(l),e=ee.getInterpolation(t),i=ee.getComponentCount(t),n=ee.getDefaultValue(t);_(e,h,o,a,m,i,s,n),h=h.slice(i),o=o.slice(i),m+=i}return this.setValues(r,m),this}static lerp(t,e,s,i){i.lerp(t,e,s)}setDefaultAttributeValues(){const t=this.m_description.getTotalComponentCount()-2;t>0&&(this.m_attribs?m(this.m_attribs,this.m_description.getDefaultPointAttributes(),0,2,t):this.m_attribs=this.m_description.getDefaultPointAttributes().slice(2))}static sqrDistance2D(t,e){return o.sqrDistanceCoords(t.x,t.y,e.x,e.y)}getImpl(){return this}mergeVertexDescriptionImpl(t){const e=H(this.getDescription(),t);this.assignVertexDescription(e)}releaseAttributes(){this.m_attribs=null}assignVertexDescriptionImpl(t){this.m_description||(this.m_description=M());const e=S();Y(t,this.m_description,e);let s=null;t.getTotalComponentCount()-2>0&&(s=t.getDefaultPointAttributes().slice(2));for(let i=1,n=t.getAttributeCount();i<n;i++){const n=e[i];if(-1!==n){const e=this.m_description.getPointAttributeOffset(n)-2,r=t.getPointAttributeOffset(i)-2,h=ee.getComponentCount(t.getSemantics(i));for(let t=0;t<h;t++)s[r+t]=this.m_attribs[e+t]}}this.m_attribs=s,this.m_description=t}ensureAttributes(){this.m_description.getTotalComponentCount()-2>0&&null===this.m_attribs&&(this.m_attribs=this.m_description.getDefaultPointAttributes().slice(2))}queryValues(t,e){const s=this.m_description.getTotalComponentCount();g(s<=e),t[0]=this.x,t[1]=this.y,m(t,this.m_attribs,2,0,s-2)}copyCommonAttributesTo(t){t.x=this.x,t.y=this.y;const e=t.getDescription();if(e===this.m_description)this.m_attribs&&m(t.m_attribs,this.m_attribs,0,0,this.m_description.getTotalComponentCount()-2);else{let s=0;for(let i=1,n=e.getAttributeCount();i<n;i++){const n=e.getSemantics(i);let r=ee.getComponentCount(n);if(this.m_description.hasAttribute(n)){let e=this.m_description.getPointAttributeOffset(this.m_description.getAttributeIndex(n))-2;for(;0!==r;)t.m_attribs[s++]=this.m_attribs[e++],r--}else{const e=ee.getDefaultValue(n);for(;0!==r;)t.m_attribs[s++]=e,r--}}}}setValues(t,e){const s=this.m_description.getTotalComponentCount();g(s<=e),this.x=t[0],this.y=t[1],m(this.m_attribs,t,0,2,s-2)}dbgDefaultAttribs(){}toFlatGeometry(){const t=Float64Array.of(this.getX(),this.getY(),this.getZ(),this.getM());return{type:"point",vertexCount:1,vertexXY:t.subarray(0,2),vertexZ:this.hasAttribute(1)?t.subarray(2,3):void 0,vertexM:this.hasAttribute(2)?t.subarray(3,4):void 0,...ot}}}se.type=y.enumPoint;var ie=z;function ne(t,e){return e*(t.getTotalComponentCount()-2)}class re{constructor(t){if(this.m_attributes=null,t)if(void 0!==t.xmin)this.m_envelope2D=new p(t.xmin,t.ymin,t.xmax,t.ymax);else if(void 0!==t.env2D)this.m_envelope2D=new p(t.env2D);else if(t.move)this.m_envelope2D=new p(t.move.m_envelope2D),this.m_attributes=t.move.m_attributes,t.move.m_attributes=null;else{if(!t.moveEnv)throw new Error("unrecognized EnvelopeData constructor options");{const e=t.moveEnv.accessEnvelopeData();this.m_envelope2D=new p(e.m_envelope2D),this.m_attributes=e.m_attributes,e.m_attributes=null}}else this.m_envelope2D=p.constructEmpty()}ensureAttributes(t){const s=t.getTotalComponentCount()-2;!this.m_attributes&&s&&(this.m_attributes=e(2*s,Number.NaN),this.m_attributes.fill(Number.NaN))}copyTo(t,s){const i=s,n=t.getTotalComponentCount()-2;if(i.m_description!==t&&(i.releaseAttributes_(),i.m_description=t,n&&(i.m_data.m_attributes=e(2*n,Number.NaN))),n){g(this.m_attributes&&i.m_data.m_attributes);const t=2*n;m(i.m_data.m_attributes,this.m_attributes,0,0,t)}i.m_data.m_envelope2D=new p(this.m_envelope2D)}copyToIfNotNull(t,e){e.m_envelope2D=new p(this.m_envelope2D),e.releaseAttributes();t.getTotalComponentCount()-2&&this.m_attributes&&(e.m_attributes=this.m_attributes.slice())}releaseAttributes(){this.m_attributes=null}isEmpty(){return this.m_envelope2D.isEmpty()}transformAttribute(t,e,s,i,n){g(0)}queryInterval(t,e,s,i){if(this.isEmpty())return void i.setEmpty();if(0===e)return void(0===s?this.m_envelope2D.queryIntervalX(i):1===s?this.m_envelope2D.queryIntervalY(i):v(""));const n=ie.getComponentCount(e);(s<0||s>=n)&&v("");const r=t.getAttributeIndex(e);if(r>=0)return i.vmin=this.m_attributes[ne(t,0)+t.getPointAttributeOffset(r)-2+s],void(i.vmax=this.m_attributes[ne(t,1)+t.getPointAttributeOffset(r)-2+s]);{const t=ie.getDefaultValue(e);return void i.setCoords(t,t)}}queryEnvelope3D(t,e){const s=new r;this.queryInterval(t,1,0,s),e.setCoords(this.m_envelope2D.xmin,this.m_envelope2D.ymin,s.vmin,this.m_envelope2D.xmax,this.m_envelope2D.ymax,s.vmax)}setEmpty(t){this.m_envelope2D.setEmpty();const s=t.getTotalComponentCount()-2;s&&(this.m_attributes?this.dbgAssertSize(s):this.m_attributes=e(2*s,Number.NaN),this.m_attributes.fill(Number.NaN))}dbgAssertSize(t){}}let he=class t{constructor(t){if(this.m_EnvelopeType=4,this.m_description=M(),void 0===t)this.m_data=new re;else if(void 0!==t.vd)this.m_description=t.vd,this.m_data=new re,this.ensureAttributes_();else if(t?.env2D)this.m_data=new re({env2D:t.env2D});else if(void 0!==t.xmin)this.m_data=new re({xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax});else if(t.copy)this.m_data=new re,t.copy.copyTo(this);else if(t.move)this.m_description=t.move.m_description,t.move.m_description=null,this.m_data=new re({move:t.move.m_data});else{if(!t.centerPoint)throw new Error("unrecognized Envelope constructor options");this.m_description=t.centerPoint.getDescription(),this.m_data=new re,this.ensureAttributes_(),this.setFromPoint(t.centerPoint,t.width,t.height)}}accessEnvelopeData(){return this.m_description=null,this.m_data}assignMove(t){return this===t||(this.m_description=t.m_description,t.m_description=null,this.m_data=new re({move:t.m_data})),this}assignCopy(t){return this===t||t.copyTo(this),this}transformAttribute(t,e,s,i,n){g(0)}setAttributeBasic(t,e,s){if(this.addAttribute(t),this.m_data.isEmpty())return;const i=this.queryInterval(t,e);i.vmin=s,i.vmax=s,this.setIntervalEnvelope(t,e,i)}mergeVertexDescriptionImpl(t){const e=H(this.getDescription(),t);this.assignVertexDescription(e)}asEnvelope2D(){return new p(this.m_data.m_envelope2D)}assignVertexDescription(t){this.m_description!==t&&this.assignVertexDescriptionImpl(t)}getGeometryType(){return y.enumEnvelope}getDimension(){return 2}getXMin(){return this.m_data.m_envelope2D.xmin}getYMin(){return this.m_data.m_envelope2D.ymin}getXMax(){return this.m_data.m_envelope2D.xmax}getYMax(){return this.m_data.m_envelope2D.ymax}width(){return this.m_data.isEmpty()?Number.NaN:this.m_data.m_envelope2D.width()}height(){return this.m_data.isEmpty()?Number.NaN:this.m_data.m_envelope2D.height()}getCenterXY(){return this.m_data.isEmpty()?new o:this.m_data.m_envelope2D.getCenter()}getCenter(t){if(t.assignVertexDescription(this.m_description),this.m_data.isEmpty())return void t.setEmpty();const e=this.m_description.getAttributeCount();for(let s=1;s<e;s++){const e=this.m_description.getSemantics(s),i=ie.getComponentCount(e);for(let s=0;s<i;s++){const i=.5*(this.getAttributeAsDblImpl(0,e,s)+this.getAttributeAsDblImpl(1,e,s));t.setAttributeBasic(e,s,i)}}t.setXY(this.m_data.m_envelope2D.getCenter())}setCoords(t,e,s,i){this.m_data.m_envelope2D.setCoords({xmin:t,ymin:e,xmax:s,ymax:i})}setEnvelope(t){if(t instanceof p)this.m_data.m_envelope2D=new p(t),this.m_data.m_envelope2D.normalize();else{this.addAttribute(1),this.m_data.m_envelope2D=t.getEnvelope2D(),this.m_data.m_envelope2D.normalize();const e=r.constructEmpty();e.setCoords(t.zmin,t.zmax),this.setInterval(1,0,e.vmin,e.vmax)}}merge(e){if(e instanceof p)return e.isValid()||f(""),void this.m_data.m_envelope2D.mergeEnvelope2D(e);if(e instanceof t){if(e.m_data.isEmpty())return;const t=e.getDescription();this.mergeVertexDescription(t),this.m_data.m_envelope2D.mergeEnvelope2D(e.m_data.m_envelope2D);for(let s=1,i=t.getAttributeCount();s<i;s++){const i=t.getSemantics(s),n=ie.getComponentCount(i);for(let t=0;t<n;t++){const s=e.queryInterval(i,t),n=this.queryInterval(i,t);n.merge(s),this.setIntervalEnvelope(i,t,n)}}return}if(e instanceof se){const t=e;if(t.isEmpty())return;const s=t.getDescription();if(this.mergeVertexDescription(s),this.m_data.isEmpty())return void this.setFromPoint(t);this.m_data.m_envelope2D.merge(t.getXY());for(let e=1,i=s.getAttributeCount();e<i;e++){const i=s.getSemantics(e),n=ie.getComponentCount(i);for(let e=0;e<n;e++){const s=t.getAttributeAsDbl(i,e),n=this.queryInterval(i,e);n.mergeCoordinate(s),this.setIntervalEnvelope(i,e,n)}}return}x("unrecognized type for envelope.merge")}intersect(t){if(!this.m_data.m_envelope2D.intersect(t.m_data.m_envelope2D))return this.setEmpty(),!1;const e=t.getDescription();this.mergeVertexDescription(e);for(let s=1,i=this.m_description.getAttributeCount();s<i;s++){const e=this.m_description.getSemantics(s),i=ie.getComponentCount(e);for(let s=0;s<i;s++){const i=t.queryInterval(e,s),n=this.queryInterval(e,s);n.intersect(i),this.setIntervalEnvelope(e,s,n)}}return!0}intersectCommonAttributes(t){if(!this.m_data.m_envelope2D.intersect(t.m_data.m_envelope2D))return this.setEmpty(),!1;const e=t.getDescription();for(let s=1,i=this.m_description.getAttributeCount();s<i;s++){const i=this.m_description.getSemantics(s);if(!e.hasAttribute(i))continue;const n=ie.getComponentCount(i);for(let e=0;e<n;e++){const s=t.queryInterval(i,e),n=this.queryInterval(i,e);n.intersect(s),this.setIntervalEnvelope(i,e,n)}}return!0}move(t,e){this.m_data.m_envelope2D.move(t,e)}centerAt(t,e){this.m_data.m_envelope2D.centerAtCoords(t,e)}centerAtPoint(t){this.m_data.m_envelope2D.centerAt(t)}reaspect(t,e){this.m_data.m_envelope2D.reaspect(t,e)}inflateCoords(t,e){this.m_data.m_envelope2D.inflateCoords(t,e)}containsCoords(t,e){return this.m_data.m_envelope2D.containsCoords(t,e)}contains(t){return this.m_data.m_envelope2D.contains(t)}containsPoint(t){return!t.isEmpty()&&this.m_data.m_envelope2D.contains(t.getXY())}containsEnvelope(t){return this.m_data.m_envelope2D.containsEnvelope(t.m_data.m_envelope2D)}setIntervalEnvelope(t,e,s){if(this.addAttribute(t),this.m_data.isEmpty())return;const i=new r(s);if(i.normalize(),0===t){if(i.isEmpty())return void this.setEmpty();0===e?(this.m_data.m_envelope2D.xmin=i.vmin,this.m_data.m_envelope2D.xmax=i.vmax):1===e?(this.m_data.m_envelope2D.ymin=i.vmin,this.m_data.m_envelope2D.ymax=i.vmax):v("")}else this.setAttributeAsDblImpl(0,t,e,i.vmin),this.setAttributeAsDblImpl(1,t,e,i.vmax)}setInterval(t,e,s,i){this.setIntervalEnvelope(t,e,new r(s,i))}queryInterval(t,e){const s=new r;return this.m_data.queryInterval(this.m_description,t,e,s),s}queryEnvelope(t){2!==t.m_EnvelopeType?3!==t.m_EnvelopeType?4!==t.m_EnvelopeType?x("unrecognized type for queryEnveloper"):this.copyTo(t):this.m_data.queryEnvelope3D(this.m_description,t):t.setCoords({env2D:this.m_data.m_envelope2D})}applyTransformation(t){1!==t.m_TransformationType?g(0):t.transformEnvInPlace(this.m_data.m_envelope2D)}createInstance(){return new t({vd:this.m_description})}copyTo(t){t!==this&&this.m_data.copyTo(this.m_description,t)}isEmpty(){return this.m_data.isEmpty()}setEmpty(){this.m_description||(this.m_description=M()),this.m_data.setEmpty(this.m_description)}calculateArea2D(){return this.m_data.m_envelope2D.getArea()}calculateLength2D(){return this.m_data.m_envelope2D.getLength()}calculateLength3D(t){return g(0),0}equals(t,e){if(t===this)return!0;const s=t;if(this.m_description!==s.m_description)return!1;if(this.m_data.isEmpty()!==s.m_data.isEmpty())return!1;if(this.m_data.isEmpty())return!0;if(void 0===e&&(e=0),Math.abs(this.m_data.m_envelope2D.xmin-s.m_data.m_envelope2D.xmin)>e)return!1;if(Math.abs(this.m_data.m_envelope2D.ymin-s.m_data.m_envelope2D.ymin)>e)return!1;if(Math.abs(this.m_data.m_envelope2D.xmax-s.m_data.m_envelope2D.xmax)>e)return!1;if(Math.abs(this.m_data.m_envelope2D.ymax-s.m_data.m_envelope2D.ymax)>e)return!1;for(let n=0,r=2*(this.m_description.getTotalComponentCount()-2);n<r;n++)if(!i(this.m_data.m_attributes[n],s.m_data.m_attributes[n],e))return!1;return!0}getBoundary(){return x("getBoundary not available in this context. Use the boundary operator with an envelope parameter"),null}clone(){return new t({copy:this})}swap(t){if(this===t)return;t.getGeometryType()!==y.enumEnvelope&&f("wrong geometry type");const e=t;e.m_description=h(this.m_description,this.m_description=e.m_description),e.m_data.m_envelope2D=h(this.m_data.m_envelope2D,this.m_data.m_envelope2D=e.m_data.m_envelope2D),e.m_data.m_attributes=h(this.m_data.m_attributes,this.m_data.m_attributes=e.m_data.m_attributes)}queryCoordinates(t){this.m_data.isEmpty()&&f(""),this.m_data.m_envelope2D.queryCorners(t)}queryCornerByVal(t,e){(t<0||t>3)&&v(""),e.assignVertexDescription(this.m_description);const s=this.getDescription().getAttributeCount();for(let i=1;i<s;i++){const s=this.m_description.getSemantics(i),n=ie.getComponentCount(s);for(let i=0;i<n;i++)e.setAttributeBasic(s,i,this.getAttributeAsDblImpl(t%2,s,i))}e.setXY(this.m_data.m_envelope2D.queryCorner(t))}queryCorner(t,e){e.assign(this.m_data.m_envelope2D.queryCorner(t))}getDescription(){return this.m_description}mergeVertexDescription(t){this.m_description!==t&&(this.m_description&&this.m_description.hasAttributesFrom(t)||this.mergeVertexDescriptionImpl(t))}hasAttribute(t){return this.m_description.hasAttribute(t)}addAttribute(t){if(this.m_description.hasAttribute(t))return;const e=V(this.m_description,t);this.assignVertexDescription(e)}dropAttribute(t){if(!this.m_description.hasAttribute(t))return;const e=k(this.m_description,t);this.assignVertexDescription(e)}dropAllAttributes(){const t=M();t!==this.m_description&&this.assignVertexDescription(t)}queryLooseEnvelope(t){this.queryEnvelope(t)}replaceNaNs(t,e){if(this.addAttribute(t),this.m_data.isEmpty())return;const s=ie.getComponentCount(t);for(let i=0;i<s;i++){const s=this.queryInterval(t,i);s.isEmpty()&&(s.vmin=e,s.vmax=e,this.setIntervalEnvelope(t,i,s))}}getImpl(){return this}setFromPoint(t,e,s){this.m_data.m_envelope2D.setCoords({center:t.getXY(),width:e??0,height:s??0});const i=t.getDescription();for(let n=1,r=i.getAttributeCount();n<r;n++){const e=i.getSemantics(n),s=ie.getComponentCount(e);for(let i=0;i<s;i++){const s=t.getAttributeAsDbl(e,i);this.setInterval(e,i,s,s)}}}assignVertexDescriptionImpl(t){const s=S();Y(t,this.m_description,s);let i=null;const n=t.getTotalComponentCount()-2,r=this.m_description?this.m_description.getTotalComponentCount()-2:0;n>0&&(i=e(2*n,Number.NaN));for(let e=1;e<t.getAttributeCount();e++){const h=s[e];if(-1!==h){const s=t.getPointAttributeOffset(e)-2,o=ie.getComponentCount(t.getSemantics(e)),a=this.m_description.getPointAttributeOffset(h)-2;m(i,this.m_data.m_attributes,s,a,o),m(i,this.m_data.m_attributes,n+s,r+a,o)}}this.releaseAttributes_(),this.m_data.m_attributes=i,this.m_description=t}getAttributeAsDblImpl(t,e,s){if(this.m_data.isEmpty()&&E(""),0===e)return t?s?this.m_data.m_envelope2D.ymax:this.m_data.m_envelope2D.xmax:s?this.m_data.m_envelope2D.ymin:this.m_data.m_envelope2D.xmin;s>=ie.getComponentCount(e)&&v("");const i=this.m_description.getAttributeIndex(e);return i>=0?this.m_data.m_attributes[ne(this.m_description,t)+this.m_description.getPointAttributeOffset(i)-2+s]:z.getDefaultValue(e)}setAttributeAsDblImpl(t,e,s,i){0===e&&(t?1===s?this.m_data.m_envelope2D.ymax=i:0===s?this.m_data.m_envelope2D.xmax=i:v(""):1===s?this.m_data.m_envelope2D.ymin=i:0===s?this.m_data.m_envelope2D.xmin=i:v(""));const n=ie.getComponentCount(e);(s<0||s>=n)&&v(""),this.addAttribute(e);const r=this.m_description.getAttributeIndex(e);this.m_data.m_attributes[ne(this.m_description,t)+this.m_description.getPointAttributeOffset(r)-2+s]=i}releaseAttributes_(){this.m_data.releaseAttributes()}ensureAttributes_(){this.m_data.ensureAttributes(this.m_description)}};he.type=y.enumEnvelope;const oe=Object.freeze(Object.defineProperty({__proto__:null,Envelope:he,EnvelopeData:re},Symbol.toStringTag,{value:"Module"}));export{Gt as $,nt as A,at as B,bt as C,J as D,he as E,K as F,$ as G,Jt as H,jt as I,At as J,Tt as K,Rt as L,Q as M,St as N,w as O,se as P,Xt as Q,gt as R,mt as S,pt as T,Ht as U,z as V,Bt as W,Ot as X,Vt as Y,wt as Z,Kt as _,st as a,Zt as a0,Qt as a1,Ut as a2,xt as a3,Nt as a4,te as a5,ct as a6,U as a7,oe as a8,et as b,qt as c,Lt as d,zt as e,Pt as f,Ct as g,It as h,Yt as i,kt as j,X as k,M as l,re as m,H as n,V as o,G as p,B as q,k as r,Mt as s,S as t,Y as u,j as v,W as w,Dt as x,ot as y,O as z};
2
+ import{R as t,d as e,a as s,H as i,y as n,E as r,c as o,P as a,i as h,b as m,B as _,C as l,j as u,m as d,x as c}from"./Point2D.js";import{g as p,a as g,r as f,G as v,t as y,u as x,d as b,q as E,i as N,m as D}from"./Geometry.js";import{Envelope2D as I}from"./Envelope2D.js";const C=[0,0,Number.NaN,0,0,0,0,0,-1,-1,0,0,0,0],T=[2,1,1,1,3,1,2,3,2,4,1,1,2,1],R=[1,1,1,0,2,1,1,1,0,0,0,0,0,1],A=[1,1,1,2,0,0,0,0,2,2,4,2,2,1],q=[4,8,4,8,1],w=25;function B(){return e(w,Number.NaN)}let z=class s{getAttributeCount(){return this.m_attributeCount}getSemantics(t){return this.m_indexToSemantics[t]}getSemanticsBitArray(){return this.m_semanticsBitArray}getAttributeIndex(t){return this.m_semanticsToIndexMap[t]}static getInterpolation(t){return R[t]}static getPersistence(t){return A[t]}static getPersistenceSize(t){return q[t]}static getPersistenceSizeFromSemantics(t){return s.getPersistenceSize(s.getPersistence(t))*s.getComponentCount(t)}static getComponentCount(t){return T[t]}static maxComponentCount(){return 4}static isInteger(t){return 2===t||3===t||4===t}static isIntegerSemantics(t){return s.isInteger(s.getPersistence(t))}static isTexture(t){return 5===t||6===t||7===t}hasAttribute(t){return!!(this.m_semanticsBitArray&1<<t)}hasAttributesFrom(t){return(this.m_semanticsBitArray&t.m_semanticsBitArray)===t.m_semanticsBitArray}hasZ(){return this.hasAttribute(1)}hasM(){return this.hasAttribute(2)}hasID(){return this.hasAttribute(3)}getTotalComponentCount(){return this.m_totalComponentCount}static getDefaultValue(t){return C[t]}static isDefaultValue(e,s){return t(C[e],s)}equals(t){return this===t}getDefaultPointAttributes(){return this.m_defaultPointAttributes}getPointAttributeOffset(t){return this.m_pointAttributeOffsets[t]}constructor(t){this.m_semanticsBitArray=t,this.m_attributeCount=0,this.m_totalComponentCount=0,this.m_semanticsToIndexMap=new Int32Array(14),this.m_indexToSemantics=new Int32Array(14),this.m_pointAttributeOffsets=new Int32Array(14),this.m_defaultPointAttributes=e(w,Number.NaN),this.m_semanticsToIndexMap.fill(-1),this.m_indexToSemantics.fill(-1);let i=0,n=1,r=14;for(;i<r;i++)t&n&&(this.m_semanticsToIndexMap[i]=this.m_attributeCount,this.m_indexToSemantics[this.m_attributeCount]=i,this.m_attributeCount++,this.m_totalComponentCount+=s.getComponentCount(i)),n<<=1;let o=0;for(i=0,r=this.getAttributeCount();i<r;i++){const t=this.getSemantics(i),e=s.getComponentCount(t),n=s.getDefaultValue(t);this.m_pointAttributeOffsets[i]=o;for(let s=0;s<e;s++)this.m_defaultPointAttributes[o]=n,o++}}m_semanticsBitArray;m_attributeCount;m_totalComponentCount;m_semanticsToIndexMap;m_indexToSemantics;m_pointAttributeOffsets;m_defaultPointAttributes};var L=z;function S(){return e(14,0)}class F{m_map;m_vd2D;m_vd3D;static s_thisInstance;static{F.s_thisInstance=new F}static getInstance(){return F.s_thisInstance}constructor(){this.m_map=new Map,this.m_vd2D=new L(1),this.m_map.set(1,this.m_vd2D),this.m_vd3D=new L(3),this.m_map.set(3,this.m_vd2D)}GetVD2D(){return this.m_vd2D}GetVD3D(){return this.m_vd3D}FindOrAdd(t){if(1===t)return this.GetVD2D();if(3===t)return this.GetVD3D();const e=this.m_map.get(t);if(e)return e;const s=new L(t);return this.m_map.set(t,s),s}}function P(t){return F.getInstance().FindOrAdd(t)}function H(t,e){if(!t||!e)return e||t;const s=t.getSemanticsBitArray()|e.getSemanticsBitArray();return(s&t.getSemanticsBitArray())===s?t:(s&e.getSemanticsBitArray())===s?e:P(s)}function V(t,e){const s=t.getSemanticsBitArray()|1<<e;return(s&t.getSemanticsBitArray())===s?t:P(s)}function k(t,e){const s=(t.getSemanticsBitArray()|1<<e)-(1<<e);return s===t.getSemanticsBitArray()?t:P(s)}function M(){return F.getInstance().GetVD2D()}function O(){return F.getInstance().GetVD3D()}function Y(t,e,s){if(s.fill(-1),null!==t&&null!==e)for(let i=0,n=t.getAttributeCount();i<n;i++)s[i]=e.getAttributeIndex(t.getSemantics(i))}class X{x;y;z;static construct(t,e,s){return new X(t,e,s)}constructor(t,e,s){void 0!==t?(this.x=t,this.y=e,this.z=s):this.x=this.y=this.z=Number.NaN}get 0(){return this.x}get 1(){return this.y}get 2(){return this.z}set 0(t){this.x=t}set 1(t){this.y=t}set 2(t){this.z=t}clone(){return new X(this.x,this.y,this.z)}assign(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}setCoords(t,e,s){return this.x=t,this.y=e,this.z=s,this}setCoordsPoint2DZ(t,e){return this.setCoords(t.x,t.y,e)}setCoordsPoint3D(t){this.x=t.x,this.y=t.y,this.z=t.z}setZero(){this.x=0,this.y=0,this.z=0}setNormalized(t){this.assign(t),this.normalizeThis()}normalizeThis(){const t=this.length();return t?(this.x/=t,this.y/=t,this.z/=t):(this.x=1,this.y=0,this.z=0),this}getUnitVector(){const t=new X;return t.setNormalized(this),t}sqrLength(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}lengthXY(){return p(0),0}static sqrDistance(t,e){return s(t.x-e.x)+s(t.y-e.y)+s(t.z-e.z)}static sqrDistanceCoords(t,e,i,n,r,o){return s(t-n)+s(e-r)+s(i-o)}static distance(t,e){return Math.sqrt(X.sqrDistance(t,e))}isEqual(t,e){return void 0===e&&(e=0),Math.abs(this.x-t.x)<=e&&Math.abs(this.y-t.y)<=e&&i(this.z,t.z,e)}static compareByLength(t,e,s,i){return p(0),0}isEqualCoords(t,e,s,i){return p(0),this.x===t&&this.y===e&&this.z===s}isEqualsTols(t,e,s){return p(0),!1}isEqualCoordsTols(t,e,s,i,n){return p(0),!1}static st_isEqual(t,e,s,i){return p(0),!1}equals(t,e){return this.isEqual(t,e)}equalsTols(t,e,s){return p(0),!1}divThis(t){return this.x/=t,this.y/=t,this.z/=t,this}subThis(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}setSub(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}sub(t){return X.construct(this.x-t.x,this.y-t.y,this.z-t.z)}addThis(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}add(t){return this.clone().addThis(t)}setAdd(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}mul(t){return X.construct(this.x*t,this.y*t,this.z*t)}dotProduct(t){return this.x*t.x+this.y*t.y+this.z*t.z}crossProductVector(t){const e=this.y*t.z-t.y*this.z,s=t.x*this.z-this.x*t.z,i=this.x*t.y-t.x*this.y;return new X(e,s,i)}setCrossProductVector(t,e){const s=t.y*e.z-e.y*t.z,i=e.x*t.z-t.x*e.z,n=t.x*e.y-e.x*t.y;return this.x=s,this.y=i,this.z=n,this}setScaled(t,e){return this.x=t*e.x,this.y=t*e.y,this.z=t*e.z,this}scaleThis(t){return this.x*=t,this.y*=t,this.z*=t,this}scaleZThis(t){return this.z*=t,this}setNAN(){return p(0),this}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)||Number.isNaN(this.z)}static getNAN(){return X.construct(Number.NaN,Number.NaN,Number.NaN)}isFinite(){return p(0),!1}isZero(){return 0===this.x&&0===this.y&&0===this.z}norm(t){return p(0),0}sqrDistanceFromCenterToSpheroidSurface(t,e){return p(0),0}distanceFromCenterToSpheroidSurface(t,e){return Math.sqrt(this.sqrDistanceFromCenterToSpheroidSurface(t,e))}static getClosestCoordinate(t,e,s,i=!1){return p(0),0}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:this.z<t.z?-1:this.z>t.z?1:0}compareXYZ(t){return p(0),0}negateThis(){this.x=-this.x,this.y=-this.y,this.z=-this.z}static averageFast(t,e){return p(0),{}}static average(t,e){return p(0),{}}static dimensions=3;static size(){return X.dimensions}static lerp(t,e,s){const i=new X;return n(t,e,s,i),i}static slerp(t,e,s){return p(0),{}}static compareVectors(t,e){return p(0),0}static selectRightHandedBasisFromNormal(t,e,s){const i=t.getUnitVector(),n=i.createAPerpendicular(),r=new X;r.setCrossProductVector(i,n),r.normalizeThis(),e.setCoordsPoint3D(n),s.setCoordsPoint3D(r)}createAPerpendicular(){const t=[this.crossProductVector(new X(0,0,1)),this.crossProductVector(new X(1,0,0)),this.crossProductVector(new X(0,1,0))],e=[t[0].sqrLength(),t[1].sqrLength(),t[2].sqrLength()],s=t[e.reduce((t,s,i)=>e[t]>e[i]?t:i,0)];return s.normalizeThis(),s}calculateAngle(t){return p(0),0}static crossDotSign(t,e,s){return p(0),0}static isBisectorRobust(t,e,s){return p(0),0}static compareZOrder(t,e){return p(0),!1}}class G{m_EnvelopeType=3;xmin;ymin;zmin;xmax;ymax;zmax;static constructEmpty(){return new G(Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN)}constructor(t,e,s,i,n,r){this.xmin=t,this.ymin=e,this.zmin=s,this.xmax=i,this.ymax=n,this.zmax=r,this.normalize()}inflate(t){this.inflateCoords(t,t,t)}inflateCoords(t,e,s){p(0)}getEnvelope2D(){return new I(this.xmin,this.ymin,this.xmax,this.ymax)}getEnvelopeZs(){return new r(this.zmin,this.zmax)}setEmptyZ(){this.zmin=Number.NaN,this.zmax=Number.NaN}normalize(){let t=!1;this.xmin<=this.xmax||(this.xmax=o(this.xmin,this.xmin=this.xmax),t=!0),this.ymin<=this.ymax||(this.ymax=o(this.ymin,this.ymin=this.ymax),t=!0),!t||this.xmin<=this.xmax&&this.ymin<=this.ymax?this.zmin<=this.zmax||(this.zmax=o(this.zmin,this.zmin=this.zmax),this.zmin<=this.zmax||this.setEmptyZ()):this.setEmpty()}isEmpty(){return Number.isNaN(this.xmin)||Number.isNaN(this.ymin)||Number.isNaN(this.xmax)||Number.isNaN(this.ymax)}isEmptyZ(){return Number.isNaN(this.zmin)||Number.isNaN(this.zmax)}setEmpty(){this.xmin=Number.NaN,this.ymin=Number.NaN,this.zmin=Number.NaN,this.xmax=Number.NaN,this.ymax=Number.NaN,this.zmax=Number.NaN}mergeEnv3D(t){t.isEmpty()||(this.mergeCoords(t.xmin,t.ymin,t.zmin),this.mergeCoords(t.xmax,t.ymax,t.zmax))}mergeNe(t){this.mergeNeCoords(t.x,t.y,t.z)}mergeNeCoords(t,e,s){this.xmin>t?this.xmin=t:this.xmax<t&&(this.xmax=t),this.ymin>e?this.ymin=e:this.ymax<e&&(this.ymax=e),this.zmin>s?this.zmin=s:this.zmax<s&&(this.zmax=s)}mergeCoords(t,e,s){this.isEmpty()?(this.xmin=t,this.xmax=t,this.ymin=e,this.ymax=e,this.zmin=s,this.zmax=s):(this.isEmptyZ()&&(this.zmin=s,this.zmax=s),this.mergeNeCoords(t,e,s))}setCoords(t,e,s,i,n,r){this.xmin=t,this.ymin=e,this.zmin=s,this.xmax=i,this.ymax=n,this.zmax=r,this.normalize()}sqrDistanceEnvelope3DAndPoints(t,e,s,i=1){return p(0),0}sqrMaxDistance(t,e=1){return p(0),0}}const U=-559038737;var Z=z;function Q(t,e,s){switch(t){case 0:return new it(e,s);case 1:return new nt(e,s);case 2:return new st(e,s);case 3:throw new Error("64 bit int attribute stream not implemented");case 4:return new et(e,s);default:g("")}}function j(t,e){const s=Z.getComponentCount(t);return Q(Z.getPersistence(t),e*s,Z.getDefaultValue(t))}function W(t,e){const s=Z.getComponentCount(t);return Q(Z.getPersistence(t),e*s)}function J(t,e){return new st(t,e)}function K(t,e){return new et(t,e)}function $(t,e){return new nt(t,e)}class tt{static s_constructMin=2;static s_resizeMin=30;size(){return this.m_size}checkResize(t,e){t>this.m_size&&this.resize(t,e)}resize(t,e){if((t=Math.trunc(t))===this.m_size)return;const s=!!e||Number.isNaN(e);if(t<this.m_a.length)this.m_a.length>tt.s_resizeMin&&1.25*t<this.m_a.length&&(this.m_a=this.m_a.slice(0,t)),s&&t>this.m_size&&this.m_a.fill(e,this.m_size,t);else if(t>=this.m_a.length){const i=1.25*t,n=new this.m_a.constructor(i);n.set(this.m_a),this.m_a=n,s&&this.m_a.fill(e,this.m_size,t)}this.m_size=t}resizeRounded(t,e){return this.resize(t,e)}reserve(t){}read(t){return this.m_a[t]}readAsDbl(t){return this.read(t)}write(t,e){this.m_a[t]=e}writeAsDbl(t,e){this.write(t,e)}setRange(t,e,s){(e<0||s<0||s+e>this.size())&&g(),this.m_a.fill(t,e,e+s)}add(t){this.resize(this.m_size+1),this.m_a[this.m_size-1]=t}addArray(t,e){const s=this.m_size;void 0===e?(this.resize(this.m_size+t.length),this.m_a.set(t,s)):(this.resize(this.m_size+e),this.m_a.set(t.slice(0,e),s))}getArray(){return this.m_a}equals(t,e,s,i){if(this.getPersistence()!==t.getPersistence())return!1;return rt(this,t,e,s,i)}insertRange(t,e,s,i){const n=this.m_size;this.checkResize(Math.max(0,i)+s),this.m_a.copyWithin(t+s,t,i>=0?i:n),this.m_a.fill(e,t,t+s)}readRange(t,e){return this.m_a.slice(t,t+e)}insertRangeFromStream(t,e,s,i,n,r,o){p(this.getPersistence()===e.getPersistence());const a=e,h=this.m_size;i&&this.checkResize(Math.max(0,o)+i),this.m_a.copyWithin(t+i,t,o>=0?o:h),this.m_a.set(a.readRange(s,i),t),n||this.reverseRange(t,i,r)}writeRange(t,e,s,i,n,r){p(this.getPersistence()===s.getPersistence());const o=s;if((t<0||e<0||i<0)&&g(),o.size()<i+e&&g(),0===e)return;this.size()<e+t&&this.resize(e+t);const a=o.m_a.subarray(i,i+e);ot(this.m_a,t,e,a)}insertAttributes(t,e,s,i){const n=Z.getComponentCount(s);this.m_a.copyWithin(t+n,t,i>=0?i:this.m_size);for(let r=0;r<n;r++)this.m_a[t+r]=e.getAttributeAsDbl(s,r)}insertAttributesFromPoints(t,e,s,i,n){p(Z.getPersistence(i)===this.getPersistence());const r=Z.getComponentCount(i),o=this.m_size;if(this.checkResize(Math.max(0,n)+r*s),this.m_a.copyWithin(t+r*s,t,n>=0?n:o),0===i){const i=new a;for(let n=t,r=0;r<s;r++,n+=2)e[r].queryXY(i),this.m_a[n]=i.x,this.m_a[n+1]=i.y}else if(1===r)for(let a=t,h=0;h<s;h++,a++)this.m_a[a]=e[h].getAttributeAsDbl(i,0);else for(let a=t,h=0;h<s;h++,a+=r)for(let t=0;t<r;t++)this.m_a[a+t]=e[h].getAttributeAsDbl(i,t)}eraseRange(t,e,s){this.m_size<t+e&&g(),this.m_a.copyWithin(t,t+e),this.m_size-=e}reverseRange(t,e,s){if((s<1||e%s!==0)&&g(),this.m_a.subarray(t,t+e).reverse(),s>1)for(let i=t,n=t+e;i<n;i+=s){let t=i,e=i+s-1;for(;t<e;){const s=this.m_a[t];this.m_a[t]=this.m_a[e],this.m_a[e]=s,t++,e--}}}rotate(t,e,s){(e<t||e>s||t>s)&&f("rotate"),e!==t&&e!==s&&(this.reverseRange(t,e-t,1),this.reverseRange(e,s-e,1),this.reverseRange(t,s-t,1))}sort(t,e,s){this.m_a.subarray(t,e).sort(s)}constructor(t){if(t.move)this.m_a=t.move.m_a,this.m_size=t.move.m_size,t.move.m_a=t.move.m_a.slice(0,0),t.move.m_size=0;else if(t.fromArray)this.m_a=t.fromArray,this.m_size=t.size??t.fromArray.length;else if(t.copy)this.m_size=t.copy.m_size,t.maxSize&&(this.m_size=Math.min(t.maxSize,this.m_size)),this.m_a=t.copy.m_a.slice(0,this.m_size);else{const e=Math.max(t.size,tt.s_constructMin);this.m_a=new t.ctor(e),(t.defaultValue||Number.isNaN(t.defaultValue))&&this.m_a.fill(t.defaultValue),this.m_size=t.size}}m_a;m_size}class et extends tt{setBits(t,e){this.m_a[t]|=e}clearBits(t,e){this.m_a[t]&=~e}getPersistence(){return 4}clone(){return new et({ctor:Int8Array,copy:this})}restrictedClone(t){return new et({ctor:Int8Array,copy:this,maxSize:t})}constructor(t,e){super("number"==typeof t?{ctor:Int8Array,size:t,defaultValue:e}:t)}}class st extends tt{getPersistence(){return 2}clone(){return new st({ctor:Int32Array,copy:this})}restrictedClone(t){return new st({ctor:Int32Array,copy:this,maxSize:t})}write(t,e){p(e<=h()),super.write(t,e)}constructor(t,e){super("number"==typeof t?{ctor:Int32Array,size:t,defaultValue:e}:t)}}class it extends tt{getPersistence(){return 0}clone(){return new it({ctor:Float32Array,copy:this})}restrictedClone(t){return new it({ctor:Float32Array,copy:this,maxSize:t})}constructor(t,e){super("number"==typeof t?{ctor:Float32Array,size:t,defaultValue:e}:t)}}class nt extends tt{getPersistence(){return 1}applyTransformation(t,e,s){(1&e||e+2*s>this.size())&&g();const i=0===e?this.m_a:this.m_a.subarray(e);t.transformInterleavedPoints(i,s,i)}readPoint2D(t){const e=this.m_a[t],s=this.m_a[t+1];return new a(e,s)}queryPoint2D(t,e){return e.x=this.m_a[t],e.y=this.m_a[t+1],e}writePoint2D(t,e){this.write(t,e.x),this.write(t+1,e.y)}insert(t,e,s){this.checkResize(s+2),this.m_a.copyWithin(t+2,t,s),this.m_a[t]=e.x,this.m_a[t+1]=e.y}insertRangeFromPoints(t,e,s,i,n,r){const o=this.m_size;if(this.checkResize(Math.max(r,0)+2*i),this.m_a.copyWithin(t+2*i,t,r>=0?r:o),n)for(let a=s,h=t,m=0;m<i;++m,++a){const t=e[a];this.m_a[h++]=t.x,this.m_a[h++]=t.y}else for(let a=s+i-1,h=t,m=0;m<i;++m,--a){const t=e[a];this.m_a[h++]=t.x,this.m_a[h++]=t.y}}queryRange(t,e,s,i,n){if((t<0||e<0)&&g(),!i&&(n<=0||e%n!==0)&&g(),0===e)return;if(1===e)return void(s[0]=this.m_a[t]);const r=this.m_a.subarray(t,t+e);s.set(r)}writeRangeFromArray(t,e,s,i,n){if((t<0||e<0)&&g(),0===e)return;if(1===e)return void(this.m_a[t]=s[0]);let r=s;e<s.length&&(r=s.subarray(0,e)),this.m_a.set(r,t)}clone(){return new nt({ctor:Float64Array,copy:this})}restrictedClone(t){return new nt({ctor:Float64Array,copy:this,maxSize:t})}constructor(t,e){super("number"==typeof t?{ctor:Float64Array,size:t,defaultValue:e}:t)}}function rt(t,e,s,n,r){if(t.getPersistence()!==e.getPersistence())return!1;const o=t.getPersistence()<=1,a=t.size(),h=e.size();if(n>a||n>h)return!1;if(r)if(o){for(let m=s;m<n;m++)if(!i(t.read(m),e.read(m),r))return!1}else for(let i=s;i<n;i++){let s=t.read(i)-e.read(i);if(s<0&&(s=-s),s>r)return!1}else for(let i=s;i<n;i++){const s=t.read(i),n=e.read(i);if(s!==n){if(o&&Number.isNaN(s)&&Number.isNaN(n))continue;return!1}}return!0}function ot(t,e,s,i,n,r){if((e<0||s<0)&&g(),0===s)return;if(1===s)return void(t[e]=i[0]);let o=i;s<i.length&&(o=i.subarray(0,s)),t.set(o,e)}const at={partCount:0,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:0,segmentCountBezier:0};class ht{m_buckets;m_bucketedIndices;static c_maxBuckets=65536;m_minValue=-1;m_maxValue=-1;m_dy=Number.NaN;constructor(){this.m_buckets=new st(0),this.m_bucketedIndices=new st(0)}static sortEx(t,e,s,i,n=32){if(s-e<=n)return void i.userSort(e,s,t);(new ht).sort(t,e,s,i,n)}sort(t,e,s,i,n=32){if(s-e<=n)return void i.userSort(e,s,t);let r=!0,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let m=e;m<s;m++){const e=i.getValue(t.read(m));e<o&&(o=e),e>a&&(a=e)}if(this.reset(s-e,o,a,s-e)){for(let r=e;r<s;r++){const s=t.read(r),n=i.getValue(s),o=this.getBucket(n);this.m_buckets.write(o,this.m_buckets.read(o)+1),this.m_bucketedIndices.write(r-e,s)}let n=this.m_buckets.read(0);this.m_buckets.write(0,0);for(let t=1,e=this.m_buckets.size();t<e;t++){const e=this.m_buckets.read(t);this.m_buckets.write(t,n),n+=e}for(let r=e;r<s;r++){const s=this.m_bucketedIndices.read(r-e),n=i.getValue(s),o=this.getBucket(n),a=this.m_buckets.read(o);t.write(a+e,s),this.m_buckets.write(o,a+1)}r=!1}if(r)return void i.userSort(e,s,t);let h=0;for(let m=0,_=this.m_buckets.size();m<_;m++){const s=h;h=this.m_buckets.read(m),h>s&&i.userSort(e+s,e+h,t)}this.m_buckets.size()>100&&(this.m_buckets.resize(0),this.m_bucketedIndices.resize(0))}reset(t,e,s,i){if(t<2||s===e)return!1;const n=Math.min(ht.c_maxBuckets,t);return this.m_buckets.resize(n),this.m_buckets.setRange(0,0,this.m_buckets.size()),this.m_minValue=e,this.m_maxValue=s,this.m_bucketedIndices.resize(i),this.m_dy=(s-e)/(n-1),!0}getBucket(t){return Math.trunc((t-this.m_minValue)/this.m_dy)}getBucketCount(){return this.m_buckets.size()}}class mt{m_buffer=new Int32Array(0);m_firstFree=-1;m_last=0;size_=0;capacity_=0;stride;capacity(){return this.capacity_}constructor(t){this.stride=t}size(){return this.size_}deleteElement(t){t<this.m_last?(this.m_buffer[t*this.stride]=this.m_firstFree,this.m_firstFree=t):this.m_last--,this.size_--}getField(t,e){return this.m_buffer[t*this.stride+e]}setField(t,e,s){this.m_buffer[t*this.stride+e]=s}elementToIndex(t){return t}newElement(){let t=this.m_firstFree;if(-1===t){if(this.m_last===this.capacity_){let t=0!==this.capacity_?Math.trunc(3*(this.capacity_+1)/2):1;if(t>Number.MAX_SAFE_INTEGER&&(t=Number.MAX_SAFE_INTEGER),t===this.capacity_)throw new Error("index out of bounds");this.grow_(t)}t=this.m_last,this.m_last++}else this.m_firstFree=this.m_buffer[t*this.stride];this.size_++;for(let e=t*this.stride;e<t*this.stride+this.stride;e++)this.m_buffer[e]=-1;return t}newElementPset(t){let e=this.m_firstFree;if(-1===e){if(this.m_last===this.capacity_){let t=0!==this.capacity_?Math.trunc(3*(this.capacity_+1)/2):1;if(t>Number.MAX_SAFE_INTEGER&&(t=Number.MAX_SAFE_INTEGER),t===this.capacity_)throw new Error("index out of bounds");this.grow_(t)}e=this.m_last,this.m_last++}else this.m_firstFree=this.m_buffer[e*this.stride];this.size_++;const s=e*this.stride;for(let i=0;i<t.length;i++)this.m_buffer[s+i]=t[i];return e}deleteAll(t){this.m_firstFree=-1,this.m_last=0,this.size_=0,t&&(this.m_buffer=new Int32Array(0),this.capacity_=0)}setCapacity(t){t>this.capacity_&&this.grow_(t)}swap(t,e){const s=t*this.stride,i=e*this.stride;for(let n=0;n<this.stride;n++){const t=this.m_buffer[i+n];this.m_buffer[i+n]=this.m_buffer[s+n],this.m_buffer[s+n]=t}}swapField(t,e,s){const i=this.m_buffer[this.stride*e+s];this.m_buffer[this.stride*e+s]=this.m_buffer[this.stride*t+s],this.m_buffer[this.stride*t+s]=i}static impossibleIndex2(){return-2}static impossibleIndex3(){return-3}static isValidElement(t){return t>=0}grow_(t){null==this.m_buffer&&(this.m_buffer=new Int32Array(0));const e=this.stride*t,s=new Int32Array(e);s.set(this.m_buffer,0),this.m_buffer=s,this.capacity_=t}}function _t(t,e){return{element:t,box:e.clone()}}class lt{m_extent=new I;m_dataExtent=new I;m_childExtents=[new I,new I,new I,new I];m_quadTreeNodes;m_elementNodes=new mt(4);m_data=[];m_freeData=[];m_root=-1;m_height=8;m_bStoreDuplicates;static m_quadrantMask=3;static m_heightBitShift=2;static m_flushingCount=5;constructor(t,e,s){void 0===s&&(s=!1),this.m_quadTreeNodes=new mt(s?11:10),this.m_bStoreDuplicates=s,this.reset_(t,e)}reset(t,e){this.m_quadTreeNodes.deleteAll(!1),this.m_elementNodes.deleteAll(!1),this.m_data.length=0,this.m_freeData.length=0,this.reset_(t,e)}insert(t,e){if(-1===this.m_root&&this.createRoot_(),this.m_bStoreDuplicates){const s=this.insertDuplicates_(t,e,0,this.m_extent,this.m_root,!1,-1);return-1!==s&&(this.m_dataExtent.isEmpty()?this.m_dataExtent.setCoords({env2D:e}):this.m_dataExtent.mergeEnvelope2D(e)),s}const s=this.insert_(t,e,0,this.m_extent,this.m_root,!1,-1);return-1!==s&&(this.m_dataExtent.isEmpty()?this.m_dataExtent.setCoords({env2D:e}):this.m_dataExtent.mergeEnvelope2D(e)),s}insertEx(t,e,s){if(-1===this.m_root&&this.createRoot_(),this.m_bStoreDuplicates){const s=this.insertDuplicates_(t,e,0,this.m_extent,this.m_root,!1,-1);return-1!==s&&(this.m_dataExtent.isEmpty()?this.m_dataExtent.setCoords({env2D:e}):this.m_dataExtent.mergeEnvelope2D(e)),s}let i;i=-1===s?this.m_root:this.getQuad_(s);const n=this.getHeight(i),r=this.getExtent(i),o=this.insert_(t,e,n,r,i,!1,-1);return-1!==o&&(this.m_dataExtent.isEmpty()?this.m_dataExtent.setCoords({env2D:e}):this.m_dataExtent.mergeEnvelope2D(e)),o}removeElement(t){p(0)}getElement(t){return this.getElementValue_(this.getData_(t))}getElementAtIndex(t){return p(0),0}getElementExtent(t){const e=this.getData_(t);return this.getBoundingBoxValue_(e).clone()}getElementExtentAtIndex(t){return p(0),{}}getDataExtent(){return this.m_dataExtent.clone()}getQuadTreeExtent(){return p(0),{}}getHeight(t){return this.m_quadTreeNodes.getField(t,6)>>lt.m_heightBitShift}getMaxHeight(){return this.m_height}getExtent(t){const e=new I;if(e.setCoords({env2D:this.m_extent}),t===this.m_root)return e;const s=[];let i=t;do{s.push(this.getQuadrant_(i)),i=this.getParent_(i)}while(i!==this.m_root);const n=s.length;for(let r=0;r<n;r++){const t=s.at(-1);s.pop(),0===t?(e.xmin=.5*(e.xmin+e.xmax),e.ymin=.5*(e.ymin+e.ymax)):1===t?(e.xmax=.5*(e.xmin+e.xmax),e.ymin=.5*(e.ymin+e.ymax)):2===t?(e.xmax=.5*(e.xmin+e.xmax),e.ymax=.5*(e.ymin+e.ymax)):(e.xmin=.5*(e.xmin+e.xmax),e.ymax=.5*(e.ymin+e.ymax))}return e}getQuad(t){return this.getQuad_(t)}getElementCount(){return-1===this.m_root?0:this.getSubTreeElementCount_(this.m_root)}getSubTreeElementCount(t){return this.getSubTreeElementCount_(t)}getContainedSubTreeElementCount(t){return this.m_bStoreDuplicates?this.getContainedSubTreeElementCount_(t):this.getSubTreeElementCount_(t)}getIntersectionCount(t,e,s){if(-1===this.m_root)return 0;const i=new I;i.setCoords({env2D:t}),i.inflateCoords(e,e);const n=[],r=[];n.push(this.m_root),r.push(this.m_extent.clone());const o=d(I,4);let a=0;for(;n.length>0;){let t=!1;const e=n.at(-1),h=r.at(-1);if(n.pop(),r.pop(),i.containsEnvelope(h)){if(a+=this.getSubTreeElementCount(e),s>0&&a>=s)return s}else if(i.isIntersecting(h)){for(let t=this.getFirstElement_(e);-1!==t;t=this.getNextElement_(t)){const e=this.getData_(t);if(this.getBoundingBoxValue_(e).isIntersecting(i)&&(a++,s>0&&a>=s))return s}t=this.getHeight(e)+1<=this.m_height}if(t){lt.setChildExtents_(h,o);for(let t=0;t<4;t++){const s=this.getChild_(e,t);if(-1!==s&&this.getSubTreeElementCount_(s)>0){i.isIntersecting(o[t])&&(n.push(s),r.push(o[t].clone()))}}}}return a}hasData(t,e){return this.getIntersectionCount(t,e,1)>=1}getIterator(t,e){return new ut(this,t,e)}getIteratorForQT(){return new ut(this)}getSortedIterator(t,e){return new dt(this.getIterator(t,e))}getSortedIteratorForQT(){return new dt(this.getIteratorForQT())}visitLeavesNearest(t,e,s,i){p(0)}reset_(t,e){(e<0||e>127)&&g("invalid height"),this.m_height=e,this.m_extent.setCoords({env2D:t}),this.m_dataExtent.setEmpty(),this.m_root=-1}insert_(t,e,s,i,n,r,o){if(!i.containsEnvelope(e))return 0===s?-1:this.insert_(t,e,0,this.m_extent,this.m_root,r,o);if(!r)for(let _=n;-1!==_;_=this.getParent_(_))this.setSubTreeElementCount_(_,this.getSubTreeElementCount_(_)+1);const a=new I;a.setCoords({env2D:i});let h,m=n;for(h=s;h<this.m_height&&this.canPushDown_(m);h++){lt.setChildExtents_(a,this.m_childExtents);let t=!1;for(let s=0;s<4;s++)if(this.m_childExtents[s].containsEnvelope(e)){t=!0;let e=this.getChild_(m,s);-1===e&&(e=this.createChild_(m,s)),this.setSubTreeElementCount_(e,this.getSubTreeElementCount_(e)+1),m=e,a.setCoords({env2D:this.m_childExtents[s]});break}if(!t)break}return this.insertAtQuad_(t,e,h,a,m,r,n,o,-1)}insertDuplicates_(t,e,s,i,n,r,o){if(!r){if(!i.containsEnvelope(e))return-1;this.setSubTreeElementCount_(n,this.getSubTreeElementCount_(n)+1),this.setContainedSubTreeElementCount_(n,this.getContainedSubTreeElementCount_(n)+1)}const a=Math.max(e.width(),e.height());let h=-1;const m=[],_=[],l=[];m.push(n),_.push(i.clone()),l.push(s);const u=d(I,4);for(;m.length>0;){let s=!1;const i=m.at(-1),d=_.at(-1),c=l.at(-1);if(m.pop(),_.pop(),l.pop(),c+1<this.m_height&&this.canPushDown_(i)){a<=Math.max(d.width(),d.height())/2&&(s=!0)}if(s){lt.setChildExtents_(d,u);let t=!1;for(let s=0;s<4;s++)if(t=u[s].containsEnvelope(e),t){let t=this.getChild_(i,s);-1===t&&(t=this.createChild_(i,s)),m.push(t),_.push(u[s].clone()),l.push(c+1),this.setSubTreeElementCount_(t,this.getSubTreeElementCount_(t)+1),this.setContainedSubTreeElementCount_(t,this.getContainedSubTreeElementCount_(t)+1);break}if(!t)for(let s=0;s<4;s++){if(u[s].isIntersecting(e)){let t=this.getChild_(i,s);-1===t&&(t=this.createChild_(i,s)),m.push(t),_.push(u[s].clone()),l.push(c+1),this.setSubTreeElementCount_(t,this.getSubTreeElementCount_(t)+1)}}}else h=this.insertAtQuad_(t,e,c,d,i,r,n,o,h),r=!1}return 0}insertAtQuad_(t,e,s,i,n,r,o,a,h){this.getFirstElement_(n);const m=this.getLastElement_(n);let _=-1;if(r){if(n===o)return a;this.disconnectElementHandle_(a),_=a}else-1===h?(_=this.createElement_(),this.setDataValues_(this.getData_(_),t,e)):_=this.createElementFromDuplicate_(h);return this.setQuad_(_,n),-1!==m?(this.setPrevElement_(_,m),this.setNextElement_(m,_)):this.setFirstElement_(n,_),this.setLastElement_(n,_),this.setLocalElementCount_(n,this.getLocalElementCount_(n)+1),this.canFlush_(n)&&this.flush_(s,i,n),_}static setChildExtents_(t,e){const s=.5*(t.xmin+t.xmax),i=.5*(t.ymin+t.ymax);e[0].setCoords({xmin:s,ymin:i,xmax:t.xmax,ymax:t.ymax}),e[1].setCoords({xmin:t.xmin,ymin:i,xmax:s,ymax:t.ymax}),e[2].setCoords({xmin:t.xmin,ymin:t.ymin,xmax:s,ymax:i}),e[3].setCoords({xmin:s,ymin:t.ymin,xmax:t.xmax,ymax:i})}disconnectElementHandle_(t){const e=this.getQuad_(t),s=this.getFirstElement_(e),i=this.getLastElement_(e),n=this.getPrevElement_(t),r=this.getNextElement_(t);s===t?(-1!==r?this.setPrevElement_(r,-1):this.setLastElement_(e,-1),this.setFirstElement_(e,r)):i===t?(this.setNextElement_(n,-1),this.setLastElement_(e,n)):(this.setPrevElement_(r,n),this.setNextElement_(n,r)),this.setPrevElement_(t,-1),this.setNextElement_(t,-1),this.setLocalElementCount_(e,this.getLocalElementCount_(e)-1)}canFlush_(t){return this.getLocalElementCount_(t)===lt.m_flushingCount&&!this.hasChildren_(t)}flush_(t,e,s){let i;const n=new I;let r=this.getFirstElement_(s),o=-1,a=-1;do{a=this.getData_(r),i=this.getElementValue_(a),n.setCoords({env2D:this.getBoundingBoxValue_(a)}),o=this.getNextElement_(r),this.m_bStoreDuplicates?this.insertDuplicates_(i,n,t,e,s,!0,r):this.insert_(i,n,t,e,s,!0,r),r=o}while(-1!==r)}canPushDown_(t){return this.getLocalElementCount_(t)>=lt.m_flushingCount||this.hasChildren_(t)}hasChildren_(t){return-1!==this.getChild_(t,0)||-1!==this.getChild_(t,1)||-1!==this.getChild_(t,2)||-1!==this.getChild_(t,3)}createChild_(t,e){const s=this.m_quadTreeNodes.newElement();return this.setChild_(t,e,s),this.setSubTreeElementCount_(s,0),this.setLocalElementCount_(s,0),this.setParent_(s,t),this.setHeightAndQuadrant_(s,this.getHeight_(t)+1,e),this.m_bStoreDuplicates&&this.setContainedSubTreeElementCount_(s,0),s}createRoot_(){this.m_root=this.m_quadTreeNodes.newElement(),this.setSubTreeElementCount_(this.m_root,0),this.setLocalElementCount_(this.m_root,0),this.setHeightAndQuadrant_(this.m_root,0,0),this.m_bStoreDuplicates&&this.setContainedSubTreeElementCount_(this.m_root,0)}createElement_(){const t=this.m_elementNodes.newElement();let e;return this.m_freeData.length>0?(e=this.m_freeData.at(-1),this.m_freeData.pop()):(e=this.m_data.length,this.m_data.length=e+1),this.setData_(t,e),t}createElementFromDuplicate_(t){const e=this.m_elementNodes.newElement(),s=this.getData_(t);return this.setData_(e,s),e}freeElementAndBoxNode_(t){p(0)}getChild_(t,e){return this.m_quadTreeNodes.getField(t,e)}setChild_(t,e,s){this.m_quadTreeNodes.setField(t,e,s)}getFirstElement_(t){return this.m_quadTreeNodes.getField(t,4)}setFirstElement_(t,e){this.m_quadTreeNodes.setField(t,4,e)}getLastElement_(t){return this.m_quadTreeNodes.getField(t,5)}setLastElement_(t,e){this.m_quadTreeNodes.setField(t,5,e)}getQuadrant_(t){return this.m_quadTreeNodes.getField(t,6)&lt.m_quadrantMask}getHeight_(t){return this.m_quadTreeNodes.getField(t,6)>>lt.m_heightBitShift}setHeightAndQuadrant_(t,e,s){const i=e<<lt.m_heightBitShift|s;this.m_quadTreeNodes.setField(t,6,i)}getLocalElementCount_(t){return this.m_quadTreeNodes.getField(t,7)}setLocalElementCount_(t,e){this.m_quadTreeNodes.setField(t,7,e)}getSubTreeElementCount_(t){return this.m_quadTreeNodes.getField(t,8)}setSubTreeElementCount_(t,e){this.m_quadTreeNodes.setField(t,8,e)}getParent_(t){return this.m_quadTreeNodes.getField(t,9)}setParent_(t,e){this.m_quadTreeNodes.setField(t,9,e)}getContainedSubTreeElementCount_(t){return this.m_quadTreeNodes.getField(t,10)}setContainedSubTreeElementCount_(t,e){this.m_quadTreeNodes.setField(t,10,e)}getData_(t){return this.m_elementNodes.getField(t,0)}setData_(t,e){this.m_elementNodes.setField(t,0,e)}getPrevElement_(t){return this.m_elementNodes.getField(t,1)}getNextElement_(t){return this.m_elementNodes.getField(t,2)}setPrevElement_(t,e){this.m_elementNodes.setField(t,1,e)}setNextElement_(t,e){this.m_elementNodes.setField(t,2,e)}getQuad_(t){return this.m_elementNodes.getField(t,3)}setQuad_(t,e){this.m_elementNodes.setField(t,3,e)}getElementValue_(t){return this.m_data[t].element}getBoundingBoxValue_(t){return this.m_data[t].box}setDataValues_(t,e,s){this.m_data[t]=_t(e,s)}}class ut{m_bLinear=!1;m_queryStart=new a;m_queryEnd=new a;m_queryBox=new I;m_tolerance=0;m_currentElementHandle=-1;m_nextElementHandle=-1;m_quadTree;m_quadsStack=[];m_extentsStack=[];m_childExtents=[new I,new I,new I,new I];constructor(t,e,s){this.m_quadTree=t,e&&this.resetIterator(e,s)}resetIterator(t,e){if(void 0===e&&(e=0),t instanceof I)return this.m_quadsStack.length=0,this.m_extentsStack.length=0,this.m_currentElementHandle=-1,this.m_queryBox.setCoords({env2D:t}),this.m_queryBox.inflateCoords(e,e),this.m_tolerance=Number.NaN,void(-1!==this.m_quadTree.m_root&&this.m_queryBox.isIntersecting(this.m_quadTree.m_extent)?(this.m_quadsStack.push(this.m_quadTree.m_root),this.m_extentsStack.push(this.m_quadTree.m_extent.clone()),this.m_nextElementHandle=this.m_quadTree.getFirstElement_(this.m_quadTree.m_root),this.m_bLinear=!1):this.m_nextElementHandle=-1);if(this.m_quadsStack.length=0,this.m_extentsStack.length=0,this.m_currentElementHandle=-1,t.queryLooseEnvelope(this.m_queryBox),this.m_queryBox.inflateCoords(e,e),-1!==this.m_quadTree.m_root&&this.m_queryBox.isIntersecting(this.m_quadTree.m_extent)){const s=t.getGeometryType();if(this.m_bLinear=s===v.enumLine,this.m_bLinear){const s=t;this.m_queryStart.assign(s.getStartXY()),this.m_queryEnd.assign(s.getEndXY()),this.m_tolerance=e}else this.m_tolerance=Number.NaN;this.m_quadsStack.push(this.m_quadTree.m_root),this.m_extentsStack.push(this.m_quadTree.m_extent.clone()),this.m_nextElementHandle=this.m_quadTree.getFirstElement_(this.m_quadTree.m_root)}else this.m_nextElementHandle=-1}next(){if(0===this.m_quadsStack.length)return-1;this.m_currentElementHandle=this.m_nextElementHandle;const t=new a,e=new a,s=new I;let i=!1;for(;!i;){for(;-1!==this.m_currentElementHandle;){const n=this.m_quadTree.getData_(this.m_currentElementHandle);if(s.setCoords({env2D:this.m_quadTree.getBoundingBoxValue_(n)}),s.isIntersecting(this.m_queryBox)){if(!this.m_bLinear){i=!0;break}if(t.setCoordsPoint2D(this.m_queryStart),e.setCoordsPoint2D(this.m_queryEnd),s.inflateCoords(this.m_tolerance,this.m_tolerance),s.clipLine(t,e)>0){i=!0;break}}this.m_currentElementHandle=this.m_quadTree.getNextElement_(this.m_currentElementHandle)}if(-1===this.m_currentElementHandle){const s=this.m_quadsStack.at(-1),i=this.m_extentsStack.at(-1);lt.setChildExtents_(i,this.m_childExtents),this.m_quadsStack.pop(),this.m_extentsStack.pop();for(let n=0;n<4;n++){const i=this.m_quadTree.getChild_(s,n);if(-1!==i&&this.m_quadTree.getSubTreeElementCount(i)>0&&this.m_childExtents[n].isIntersecting(this.m_queryBox))if(this.m_bLinear){t.setCoordsPoint2D(this.m_queryStart),e.setCoordsPoint2D(this.m_queryEnd);const s=new I;s.setCoords({env2D:this.m_childExtents[n]}),s.inflateCoords(this.m_tolerance,this.m_tolerance),s.clipLine(t,e)>0&&(this.m_quadsStack.push(i),this.m_extentsStack.push(this.m_childExtents[n].clone()))}else this.m_quadsStack.push(i),this.m_extentsStack.push(this.m_childExtents[n].clone())}if(0===this.m_quadsStack.length)return-1;this.m_currentElementHandle=this.m_quadTree.getFirstElement_(this.m_quadsStack.at(-1))}}return this.m_nextElementHandle=this.m_quadTree.getNextElement_(this.m_currentElementHandle),this.m_currentElementHandle}clone(){return p(0),{}}}class dt{m_bucketSort=new ht;m_sortedHandles=new st(0);m_quadTreeIteratorImpl;m_index=-1;constructor(t){this.m_quadTreeIteratorImpl=t}resetIterator(t,e){this.m_quadTreeIteratorImpl.resetIterator(t,e),this.m_sortedHandles.resize(0),this.m_index=-1}next(){if(-1===this.m_index){let t=-1;for(;-1!==(t=this.m_quadTreeIteratorImpl.next());)this.m_sortedHandles.add(t);const e=this,s={userSort(t,s,i){i.sort(t,s,(t,s)=>e.m_quadTreeIteratorImpl.m_quadTree.getElement(t)-e.m_quadTreeIteratorImpl.m_quadTree.getElement(s))},getValue:t=>e.m_quadTreeIteratorImpl.m_quadTree.getElement(t)};this.m_bucketSort.sort(this.m_sortedHandles,0,this.m_sortedHandles.size(),s)}return this.m_index===this.m_sortedHandles.size()-1?-1:(this.m_index++,this.m_sortedHandles.read(this.m_index))}clone(){return p(0),{}}}class ct{constructor(t=!1){this.m_bNotifyOnActions=t}onDelete(t){}onSet(t){}onEndSearch(t){}onAddUniqueElementFailed(t){}m_bNotifyOnActions;onDeleteImpl(t,e){this.m_bNotifyOnActions&&this.onDelete(t.getElement(e))}onSetImpl(t,e){this.m_bNotifyOnActions&&this.onSet(t.getElement(e))}onAddUniqueElementFailedImpl(t){this.m_bNotifyOnActions&&this.onAddUniqueElementFailed(t)}onEndSearchImpl(t){this.m_bNotifyOnActions&&this.onEndSearch(t)}}class pt{static st_nullNode(){return-1}constructor(){}setComparator(t){this.m_comparator=t}getComparator(){return this.m_comparator}disableBalancing(){this.m_bBalancing=!1}enableBalancing(){this.m_bBalancing||(p(this.m_treapCount<=1),this.rebalance(-1),this.m_bBalancing=!0)}isAutoBalancing(){return this.m_bBalancing}rebalance(t){if(this.m_bBalancing)return;if(-1===t&&(t=this.m_defaultTreap),0===this.size(t))return;const e=[];for(let s=this.getFirst(t);-1!==s;s=this.getNext(s))e.push(s),this.setParent_(s,-1),this.setRight_(s,-1),this.setLeft_(s,-1);this.setRoot_(-1,t),this.setFirst_(-1,t),this.setLast_(-1,t),this.setSize_(0,t),this.m_bBalancing=!0;for(const s of e)this.addBiggestElement_(s,t);this.m_bBalancing=!1}setCapacity(t){this.m_treapData.setCapacity(t)}createTreap(t){const e=this.m_treapData.newElement();return this.setSize_(0,e),this.setTreapData_(t,e),this.m_treapCount++,e}deleteTreap(t){this.m_treapData.deleteElement(t),this.m_treapCount--}addElement(t,e=-1){return-1===e&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),e=this.m_defaultTreap),this.addElement_(t,0,e)}addUniqueElement(t,e=-1){return-1===e&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),e=this.m_defaultTreap),this.addElement_(t,1,e)}addBiggestElement(t,e=-1){-1===e&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),e=this.m_defaultTreap);const s=this.newNode_(t);return this.addBiggestElement_(s,e),s}addElementAtPosition(t,e,s,i,n,r=-1){if(-1===r&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),r=this.m_defaultTreap),this.getRoot_(r)===pt.st_nullNode()){const t=this.newNode_(s);return this.setRoot_(t,r),this.addToList_(-1,t,r),t}let o,a,h,m,_;if(n?(o=e!==pt.st_nullNode()?this.m_comparator.compare(this,s,e):-1,a=t!==pt.st_nullNode()?this.m_comparator.compare(this,s,t):1):(o=-1,a=1),i&&(0===o||0===a)){this.m_comparator.onAddUniqueElementFailedImpl(s);const i=0===o?e:t;return this.setDuplicateElement_(i,r),-1}_=e!==pt.st_nullNode()&&t!==pt.st_nullNode()?this.m_random>l(this.m_random)>>1:e!==pt.st_nullNode(),_?(m=o,h=e):(m=a,h=t);let u=-1,d=-1,c=!0;for(;;){if(m<0){const t=this.getLeft(h);if(t===pt.st_nullNode()){d=h,u=this.newNode_(s),this.setLeft_(h,u),this.setParent_(u,h);break}h=t}else{const t=this.getRight(h);if(t===pt.st_nullNode()){d=this.getNext(h),u=this.newNode_(s),this.setRight_(h,u),this.setParent_(u,h);break}h=t}c&&(m*=-1,c=!1)}return this.bubbleUp_(u),this.getParent(u)===pt.st_nullNode()&&this.setRoot_(u,r),this.addToList_(d,u,r),u}replaceElementAtPosition(t,e,s,i,n=-1){if(i){const i=this.getNext(t);let r=-1;i!==pt.st_nullNode()&&(r=this.m_comparator.compare(this,e,i));const o=this.getPrev(t);let a=-1;if(o!==pt.st_nullNode()&&(a=this.m_comparator.compare(this,e,o)),s&&(0===r||0===a)){this.m_comparator.onAddUniqueElementFailedImpl(e);const t=0===r?i:o;return n===pt.st_nullNode()&&(this.m_defaultTreap===pt.st_nullNode()&&(this.m_defaultTreap=this.createTreap(-1)),n=this.m_defaultTreap),this.setDuplicateElement_(t,n),-1}}return this.setElement_(t,e),t}getDuplicateElement(t=-1){return-1===t?this.getDuplicateElement_(this.m_defaultTreap):this.getDuplicateElement_(t)}deleteNode(t,e=-1){this.m_comparator&&this.m_comparator.onDeleteImpl(this,t),-1===e&&(e=this.m_defaultTreap),this.m_bBalancing?this.deleteNode_(t,e):this.unbalancedDelete_(t,e)}search(t,e=-1){let s=this.getRoot(e);for(;s!==pt.st_nullNode();){const e=this.m_comparator.compare(this,t,s);if(!e)return s;s=e<0?this.getLeft(s):this.getRight(s)}return this.m_comparator.onEndSearchImpl(t),pt.st_nullNode()}searchLowerBound(t,e=-1){let s=this.getRoot(e),i=-1;for(;s!==pt.st_nullNode();){const e=t.compare(this,s);if(!e)return s;e<0?s=this.getLeft(s):(i=s,s=this.getRight(s))}return i}searchUpperBound(t,e=-1){let s=this.getRoot(e),i=-1;for(;s!==pt.st_nullNode();){const e=t.compare(this,s);if(!e)return s;e<0?(i=s,s=this.getLeft(s)):s=this.getRight(s)}return i}getElement(t){return this.m_treapData.getField(t,3)}getLeft(t){return this.m_treapData.getField(t,0)}getRight(t){return this.m_treapData.getField(t,1)}getParent(t){return this.m_treapData.getField(t,2)}getNext(t){return this.m_treapData.getField(t,6)}getPrev(t){return this.m_treapData.getField(t,5)}getFirst(t=-1){return-1===t?this.getFirst_(this.m_defaultTreap):this.getFirst_(t)}getLast(t=-1){return-1===t?this.getLast_(this.m_defaultTreap):this.getLast_(t)}getTreapData(t=-1){return-1===t?this.getTreapData_(this.m_defaultTreap):this.getTreapData_(t)}setElement(t,e){null!==this.m_comparator&&this.m_comparator.onSetImpl(this,t),this.setElement_(t,e)}getRoot(t=-1){return-1===t?this.getRoot_(this.m_defaultTreap):this.getRoot_(t)}clear(){this.m_treapData.deleteAll(!1),this.m_defaultTreap=pt.st_nullNode(),this.m_treapCount=0,this.m_maxDepthEver=0}addToList_(t,e,s){let i;-1!==t?(i=this.getPrev(t),this.setPrev_(t,e)):i=this.getLast_(s),this.setPrev_(e,i),-1!==i&&this.setNext_(i,e),this.setNext_(e,t),t===this.getFirst_(s)&&this.setFirst_(e,s),-1===t&&this.setLast_(e,s),this.setSize_(this.getSize_(s)+1,s)}size(t=-1){return-1===t?this.getSize_(this.m_defaultTreap):this.getSize_(t)}getMaxDepth(t=-1){return this.getMaxDepthHelper_(this.getRoot(t))}getMaxDepthEver(){return this.m_maxDepthEver}static st_isValidNode(t){return mt.isValidElement(t)}m_defaultTreap=-1;m_random=124234251;m_comparator=null;m_treapData=new mt(7);m_treapCount=0;m_maxDepthEver=0;m_bBalancing=!0;dbgCheck_(t){}getPriority_(t){return this.m_treapData.getField(t,4)}bubbleDown_(t){let e=this.getLeft(t),s=this.getRight(t);const i=this.getPriority_(t);for(;e!==pt.st_nullNode()||s!==pt.st_nullNode();){const n=e!==pt.st_nullNode()?this.getPriority_(e):u(),r=s!==pt.st_nullNode()?this.getPriority_(s):u();if(i<=Math.min(n,r))return;n<=r?this.rotateRight_(e):this.rotateLeft_(t),e=this.getLeft(t),s=this.getRight(t)}}bubbleUp_(t){if(!this.m_bBalancing)return;const e=this.getPriority_(t);let s=this.getParent(t);for(;s!==pt.st_nullNode()&&this.getPriority_(s)>e;)this.getLeft(s)===t?this.rotateRight_(t):this.rotateLeft_(s),s=this.getParent(t)}rotateLeft_(t){const e=t,s=this.getRight(t);let i;this.setParent_(s,this.getParent(e)),this.setParent_(e,s),i=this.getLeft(s),this.setRight_(e,i),i!==pt.st_nullNode()&&this.setParent_(i,e),this.setLeft_(s,e),i=this.getParent(s),i!==pt.st_nullNode()&&(this.getLeft(i)===e?this.setLeft_(i,s):this.setRight_(i,s))}rotateRight_(t){const e=this.getParent(t),s=t;let i;this.setParent_(s,this.getParent(e)),this.setParent_(e,s),i=this.getRight(s),this.setLeft_(e,i),i!==pt.st_nullNode()&&this.setParent_(i,e),this.setRight_(s,e),i=this.getParent(s),i!==pt.st_nullNode()&&(this.getLeft(i)===e?this.setLeft_(i,s):this.setRight_(i,s))}setParent_(t,e){this.m_treapData.setField(t,2,e)}setLeft_(t,e){this.m_treapData.setField(t,0,e)}setRight_(t,e){this.m_treapData.setField(t,1,e)}setPriority_(t,e){this.m_treapData.setField(t,4,e)}setPrev_(t,e){this.m_treapData.setField(t,5,e)}setNext_(t,e){this.m_treapData.setField(t,6,e)}setRoot_(t,e){this.m_treapData.setField(e,0,t)}setFirst_(t,e){this.m_treapData.setField(e,1,t)}setLast_(t,e){this.m_treapData.setField(e,2,t)}setDuplicateElement_(t,e){this.m_treapData.setField(e,3,t)}setSize_(t,e){this.m_treapData.setField(e,4,t)}setTreapData_(t,e){this.m_treapData.setField(e,5,t)}getRoot_(t){return-1===t?pt.st_nullNode():this.m_treapData.getField(t,0)}getFirst_(t){return-1===t?pt.st_nullNode():this.m_treapData.getField(t,1)}getLast_(t){return-1===t?pt.st_nullNode():this.m_treapData.getField(t,2)}getDuplicateElement_(t){return-1===t?pt.st_nullNode():this.m_treapData.getField(t,3)}getSize_(t){return-1===t?0:this.m_treapData.getField(t,4)}getTreapData_(t){return this.m_treapData.getField(t,5)}newNode_(t){const e=this.m_treapData.newElement();return this.setPriority_(e,this.generatePriority_()),this.setElement_(e,t),e}freeNode_(t,e){t!==pt.st_nullNode()&&this.m_treapData.deleteElement(t)}generatePriority_(){return this.m_random=l(this.m_random),this.m_random&u()>>1}maxPriority(){return p(0),0}getMaxDepthHelper_(t){return t===pt.st_nullNode()?0:1+Math.max(this.getMaxDepthHelper_(this.getLeft(t)),this.getMaxDepthHelper_(this.getRight(t)))}addElement_(t,e,s){if(this.getRoot(s)===pt.st_nullNode()){const e=this.newNode_(t);return this.setRoot_(e,s),this.addToList_(-1,e,s),this.m_maxDepthEver=Math.max(this.m_maxDepthEver,1),e}let i=this.getRoot_(s),n=-1,r=-1,o=1;for(;;){const a=-1===e?1:this.m_comparator.compare(this,t,i);if(a<0){const e=this.getLeft(i);if(e===pt.st_nullNode()){r=i,n=this.newNode_(t),this.setLeft_(i,n),this.setParent_(n,i);break}i=e}else{if(1===e&&0===a)return this.m_comparator.onAddUniqueElementFailedImpl(t),this.setDuplicateElement_(i,s),-1;const o=this.getRight(i);if(o===pt.st_nullNode()){r=this.getNext(i),n=this.newNode_(t),this.setRight_(i,n),this.setParent_(n,i);break}i=o}o++}return this.bubbleUp_(n),this.getParent(n)===pt.st_nullNode()&&this.setRoot_(n,s),this.addToList_(r,n,s),this.m_maxDepthEver=Math.max(o,this.m_maxDepthEver),n}removeFromList_(t,e){const s=this.getPrev(t),i=this.getNext(t);-1!==s?this.setNext_(s,i):this.setFirst_(i,e),-1!==i?this.setPrev_(i,s):this.setLast_(s,e),this.setSize_(this.getSize_(e)-1,e)}unbalancedDelete_(t,e){this.removeFromList_(t,e);let s=this.getLeft(t),i=this.getRight(t),n=this.getParent(t),r=t;if(-1!==s&&-1!==i){let o;this.m_random=l(this.m_random),o=this.m_random>u()>>1?this.getNext(t):this.getPrev(t);const a=this.getParent(o)===t;this.m_treapData.swapField(t,o,0),this.m_treapData.swapField(t,o,1),this.m_treapData.swapField(t,o,2),-1!==n?this.getLeft(n)===t?this.setLeft_(n,o):this.setRight_(n,o):this.setRoot_(o,e),a?(s===o?(this.setLeft_(o,t),this.setParent_(i,o)):i===o&&(this.setRight_(o,t),this.setParent_(s,o)),this.setParent_(t,o),n=o):(this.setParent_(s,o),this.setParent_(i,o),n=this.getParent(t),r=o),s=this.getLeft(t),i=this.getRight(t),-1!==s&&this.setParent_(s,t),-1!==i&&this.setParent_(i,t)}const o=-1!==s?s:i;-1===n?this.setRoot_(o,e):this.getLeft(n)===r?this.setLeft_(n,o):this.setRight_(n,o),-1!==o&&this.setParent_(o,n),this.freeNode_(t,e)}deleteNode_(t,e){this.setPriority_(t,u());let s=pt.st_nullNode(),i=pt.st_nullNode();const n=this.getRoot_(e),r=n===t;if(r&&(s=this.getLeft(n),i=this.getRight(n),s===pt.st_nullNode()&&i===pt.st_nullNode()))return this.removeFromList_(n,e),this.freeNode_(n,e),void this.setRoot_(pt.st_nullNode(),e);this.bubbleDown_(t);const o=this.getParent(t);o!==pt.st_nullNode()&&(this.getLeft(o)===t?this.setLeft_(o,pt.st_nullNode()):this.setRight_(o,pt.st_nullNode())),this.removeFromList_(t,e),this.freeNode_(t,e),r&&this.setRoot_(s===pt.st_nullNode()||this.getParent(s)!==pt.st_nullNode()?i:s,e)}setElement_(t,e){this.m_treapData.setField(t,3,e)}addBiggestElement_(t,e){if(this.getRoot_(e)===pt.st_nullNode())return this.setRoot_(t,e),void this.addToList_(-1,t,e);const s=this.getLast_(e);this.setRight_(s,t),this.setParent_(t,s),this.bubbleUp_(t),this.getParent(t)===pt.st_nullNode()&&this.setRoot_(t,e),this.addToList_(-1,t,e)}}class gt{m_listNodes;m_lists;m_listOfLists;m_bStoreListIndexWithNode;constructor(t){this.m_lists=new mt(6),this.m_listOfLists=gt.st_nullNode(),void 0===t?(this.m_listNodes=new mt(3),this.m_bStoreListIndexWithNode=!1):(this.m_listNodes=new mt(t?4:3),this.m_bStoreListIndexWithNode=t)}freeNode_(t){this.m_listNodes.deleteElement(t)}newNode_(){return this.m_listNodes.newElement()}freeList_(t){p(0)}newList_(){return this.m_lists.newElement()}setPrev_(t,e){this.m_listNodes.setField(t,1,e)}setNext_(t,e){this.m_listNodes.setField(t,2,e)}setData_(t,e){p(0)}setList_(t,e){return this.m_listNodes.setField(t,3,e)}setListSize_(t,e){this.m_lists.setField(t,4,e)}setNextList_(t,e){p(0)}setPrevList_(t,e){this.m_lists.setField(t,2,e)}createList(t){const e=this.newList_();return this.m_lists.setField(e,3,this.m_listOfLists),this.m_lists.setField(e,4,0),this.m_lists.setField(e,5,t),this.m_listOfLists!==gt.st_nullNode()&&this.setPrevList_(this.m_listOfLists,e),this.m_listOfLists=e,e}deleteList(t){this.clear(t);const e=this.m_lists.getField(t,2),s=this.m_lists.getField(t,3);return e!==gt.st_nullNode()?this.setNextList_(e,s):this.m_listOfLists=s,s!==gt.st_nullNode()&&this.setPrevList_(s,e),this.freeList_(t),s}reserveLists(t){p(0)}getListData(t){return this.m_lists.getField(t,5)}getList(t){return p(0),0}setListData(t,e){this.m_lists.setField(t,5,e)}addElement(t,e){return this.insertElement(t,-1,e)}insertElement(t,e,s){const i=this.newNode_();let n=-1;e!==gt.st_nullNode()&&(n=this.getPrev(e),this.setPrev_(e,i)),this.setNext_(i,e),n!==gt.st_nullNode()&&this.setNext_(n,i);if(e===this.m_lists.getField(t,0)&&this.m_lists.setField(t,0,i),e===gt.st_nullNode()){const e=this.m_lists.getField(t,1);this.setPrev_(i,e),-1!==e&&this.setNext_(e,i),this.m_lists.setField(t,1,i)}return this.setData(i,s),this.setListSize_(t,this.getListSize(t)+1),this.m_bStoreListIndexWithNode&&this.setList_(i,t),i}deleteElement(t,e){const s=this.getPrev(e),i=this.getNext(e);return s!==gt.st_nullNode()?this.setNext_(s,i):this.m_lists.setField(t,0,i),i!==gt.st_nullNode()?this.setPrev_(i,s):this.m_lists.setField(t,1,s),this.freeNode_(e),this.setListSize_(t,this.getListSize(t)-1),i}reserveNodes(t){this.m_listNodes.setCapacity(t)}getData(t){return this.m_listNodes.getField(t,0)}getElement(t){return this.getData(t)}setData(t,e){this.m_listNodes.setField(t,0,e)}getNext(t){return this.m_listNodes.getField(t,2)}getPrev(t){return this.m_listNodes.getField(t,1)}getFirst(t){return this.m_lists.getField(t,0)}getLast(t){return this.m_lists.getField(t,1)}static st_nullNode(){return-1}clear(t){if(void 0!==t){let e=this.getLast(t);for(;e!==gt.st_nullNode();){const t=e;e=this.getPrev(t),this.freeNode_(t)}return this.m_lists.setField(t,0,-1),this.m_lists.setField(t,1,-1),void this.setListSize_(t,0)}for(let e=this.getFirstList();-1!==e;)e=this.deleteList(e)}isEmpty(t){return p(0),!1}getNodeCount(){return this.m_listNodes.size()}getListCount(){return this.m_lists.size()}getListSize(t){return this.m_lists.getField(t,4)}getFirstList(){return this.m_listOfLists}getNextList(t){return this.m_lists.getField(t,3)}}class ft extends ct{m_intervalTree;constructor(t){super(),this.m_intervalTree=t}compare(t,e,s){const i=t.getElement(s),n=this.m_intervalTree.getValue_(e),r=this.m_intervalTree.getValue_(i);return n<r?-1:n===r?vt.isLeft_(e)&&vt.isRight_(i)?-1:vt.isLeft_(i)&&vt.isRight_(e)?1:0:1}}class vt{m_bEnvelopesRef=!1;m_bOfflineDynamic;m_intervals=[];m_envelopesRef=null;m_tertiaryNodes;m_intervalNodes=new mt(3);m_intervalHandles=[];m_secondaryLists;m_secondaryTreaps;m_endIndicesUnique=[];m_cCount=-1;m_root=-1;m_bSortIntervals=!1;m_bConstructing=!1;m_bConstructionEnded=!1;constructor(t){this.m_bOfflineDynamic=t,this.m_tertiaryNodes=new mt(this.m_bOfflineDynamic?5:4),this.m_secondaryTreaps=new pt,this.m_secondaryTreaps.setComparator(new ft(this)),this.m_secondaryLists=new gt}addEnvelopesRef(t){this.reset_(!0,!0),this.m_bEnvelopesRef=!0,this.m_envelopesRef=t,this.m_bConstructing=!1,this.m_bConstructionEnded=!0,this.m_bOfflineDynamic||(this.insertIntervalsStatic_(),this.m_cCount=this.m_envelopesRef.length)}startConstruction(){this.reset_(!0,!1)}addInterval(t){this.m_bConstructing||E(""),this.m_intervals.push(t.clone())}addIntervalCoords(t,e){p(0)}endConstruction(){this.m_bConstructing||E(""),this.m_bConstructing=!1,this.m_bConstructionEnded=!0,this.m_bOfflineDynamic||(this.insertIntervalsStatic_(),this.m_cCount=this.m_intervals.length)}insert(t){if(this.m_bOfflineDynamic&&this.m_bConstructionEnded||E(""),-1===this.m_root){const t=this.m_bEnvelopesRef?this.m_envelopesRef.length:this.m_intervals.length;if(this.m_bSortIntervals){const e=new st(0);this.querySortedEndPointIndices_(e),this.m_endIndicesUnique.length=0,this.querySortedDuplicatesRemoved_(e),this.m_intervalHandles.length=t,this.m_intervalHandles.fill(-1),this.m_bSortIntervals=!1}else this.m_intervalHandles.fill(-1,0,t);this.m_root=this.createRoot_()}const e=this.insertIntervalEnd_(t<<1,this.m_root),s=this.getSecondaryFromInterval_(e),i=this.m_secondaryTreaps.addElement(1+(t<<1),s);this.setRightEnd_(e,i),this.m_intervalHandles[t]=e,this.m_cCount++}remove(t){this.m_bOfflineDynamic&&this.m_bConstructionEnded||E("");const e=this.m_intervalHandles[t];let s;-1===e&&g("the interval does not exist in the interval tree"),this.m_intervalHandles[t]=-1,this.m_cCount--;let i=this.getSecondaryFromInterval_(e),n=-1;n=this.m_secondaryTreaps.getTreapData(i),this.m_secondaryTreaps.deleteNode(this.getLeftEnd_(e),i),this.m_secondaryTreaps.deleteNode(this.getRightEnd_(e),i),s=this.m_secondaryTreaps.size(i),0===s&&(this.m_secondaryTreaps.deleteTreap(i),this.setSecondaryToTertiary_(n,-1)),this.m_intervalNodes.deleteElement(e);let r=this.getPptr_(n),o=this.getLptr_(n),a=this.getRptr_(n);for(;!(s>0||n===this.m_root||-1!==o&&-1!==a);)n===this.getLptr_(r)?-1!==o?(this.setLptr_(r,o),this.setPptr_(o,r),this.setLptr_(n,-1),this.setPptr_(n,-1)):-1!==a?(this.setLptr_(r,a),this.setPptr_(a,r),this.setRptr_(n,-1),this.setPptr_(n,-1)):(this.setLptr_(r,-1),this.setPptr_(n,-1)):-1!==o?(this.setRptr_(r,o),this.setPptr_(o,r),this.setLptr_(n,-1),this.setPptr_(n,-1)):-1!==a?(this.setRptr_(r,a),this.setPptr_(a,r),this.setRptr_(n,-1),this.setPptr_(n,-1)):(this.setRptr_(r,-1),this.setPptr_(n,-1)),this.m_tertiaryNodes.deleteElement(n),n=r,i=this.getSecondaryFromTertiary_(n),s=-1!==i?this.m_secondaryTreaps.size(i):0,o=this.getLptr_(n),a=this.getRptr_(n),r=this.getPptr_(n)}size(){return this.m_cCount}getIteratorQuery(t,e){return t instanceof r?new yt(this,t,e):(p(0),{})}getIterator(){return new yt(this)}querySortedEndPointIndices_(t){const e=this.m_bEnvelopesRef?this.m_envelopesRef.length:this.m_intervals.length;for(let s=0;s<2*e;s++)t.add(s);this.sortEndIndices_(t,0,2*e)}querySortedDuplicatesRemoved_(t){let e=Number.NaN;for(let s=0;s<t.size();s++){const i=t.read(s),n=this.getValue_(i);n!==e&&(this.m_endIndicesUnique.push(i),e=n)}}insertIntervalsStatic_(){const t=this.m_bEnvelopesRef?this.m_envelopesRef.length:this.m_intervals.length,s=new st(0);this.querySortedEndPointIndices_(s),this.m_endIndicesUnique.length=0,this.querySortedDuplicatesRemoved_(s),this.m_intervalNodes.setCapacity(t),this.m_secondaryLists.reserveNodes(2*t);const i=e(t,-1);this.m_root=this.createRoot_();for(let e=0;e<s.size();e++){const t=s.read(e);let n=i[t>>1];if(-1!==n){const e=this.getSecondaryFromInterval_(n);this.setRightEnd_(n,this.m_secondaryLists.addElement(e,t))}else n=this.insertIntervalEnd_(t,this.m_root),i[t>>1]=n}}createRoot_(){const t=this.calculateDiscriminantIndex1_(0,this.m_endIndicesUnique.length-1);return this.createTertiaryNode_(t)}insertIntervalEnd_(t,e){let s=-1,i=e,n=-1,r=-1,o=0,a=this.m_endIndicesUnique.length-1,h=0;const m=t>>1;let _=Number.NaN,l=Number.NaN,u=!0;const d=this.getMin_(m),c=this.getMax_(m);let p=-1;for(;u;){h=o+(a-o>>1),p=this.calculateDiscriminantIndex1_(o,a);const e=this.getDiscriminantFromIndex1_(p);if(c<e){if(-1!==i)if(p===this.getDiscriminantIndex1_(i))s=i,_=e,i=this.getLptr_(i),l=-1!==i?this.getDiscriminant_(i):Number.NaN;else if(l>e){const t=this.createTertiaryNode_(p);e<_?this.setLptr_(s,t):this.setRptr_(s,t),this.setRptr_(t,i),this.m_bOfflineDynamic&&(this.setPptr_(t,s),this.setPptr_(i,t)),s=t,_=e,i=-1,l=Number.NaN}a=h;continue}if(d>e){if(-1!==i)if(p===this.getDiscriminantIndex1_(i))s=i,_=e,i=this.getRptr_(i),l=-1!==i?this.getDiscriminant_(i):Number.NaN;else if(l<e){const t=this.createTertiaryNode_(p);e<_?this.setLptr_(s,t):this.setRptr_(s,t),this.setLptr_(t,i),this.m_bOfflineDynamic&&(this.setPptr_(t,s),this.setPptr_(i,t)),s=t,_=e,i=-1,l=Number.NaN}o=h+1;continue}let m=-1;m=-1===i||p!==this.getDiscriminantIndex1_(i)?this.createTertiaryNode_(p):i,n=this.getSecondaryFromTertiary_(m),-1===n&&(n=this.createSecondary_(m),this.setSecondaryToTertiary_(m,n));const g=this.addEndIndex_(n,t);r=this.createIntervalNode_(),this.setSecondaryToInterval_(r,n),this.setLeftEnd_(r,g),-1!==i&&p===this.getDiscriminantIndex1_(i)||(e<_?this.setLptr_(s,m):this.setRptr_(s,m),this.m_bOfflineDynamic&&this.setPptr_(m,s),-1!==i&&(l<e?this.setLptr_(m,i):this.setRptr_(m,i),this.m_bOfflineDynamic&&this.setPptr_(i,m))),u=!1;break}return r}createTertiaryNode_(t){const e=this.m_tertiaryNodes.newElement();return this.setDiscriminantIndex1_(e,t),e}createSecondary_(t){return this.m_bOfflineDynamic?this.m_secondaryTreaps.createTreap(t):this.m_secondaryLists.createList(t)}createIntervalNode_(){return this.m_intervalNodes.newElement()}reset(){this.m_bOfflineDynamic&&this.m_bConstructionEnded||E(""),this.reset_(!1,this.m_bEnvelopesRef)}reset_(t,e){t?(this.m_bEnvelopesRef=!1,this.m_envelopesRef=null,this.m_bSortIntervals=!0,this.m_bConstructing=!0,this.m_bConstructionEnded=!1,this.m_endIndicesUnique.length=0,e?(this.m_intervals.length=0,this.m_bEnvelopesRef=!0):this.m_intervals.length=0):this.m_bSortIntervals=!1,this.m_bOfflineDynamic?this.m_secondaryTreaps.clear():this.m_secondaryLists.clear(),this.m_intervalNodes.deleteAll(!1),this.m_tertiaryNodes.deleteAll(!1),this.m_root=-1,this.m_cCount=0}getDiscriminant_(t){const e=this.getDiscriminantIndex1_(t);return this.getDiscriminantFromIndex1_(e)}getDiscriminantFromIndex1_(t){if(-1===t)return Number.NaN;if(t>0){const e=t-2,s=this.m_endIndicesUnique[e],i=this.m_endIndicesUnique[e+1];return.5*(this.getValue_(s)+this.getValue_(i))}const e=-t-2,s=this.m_endIndicesUnique[e];return this.getValue_(s)}calculateDiscriminantIndex1_(t,e){let s;if(t<e){s=t+(e-t>>1)+2}else s=-(t+2);return s}setDiscriminantIndex1_(t,e){this.m_tertiaryNodes.setField(t,0,e)}setSecondaryToTertiary_(t,e){this.m_tertiaryNodes.setField(t,1,e)}setLptr_(t,e){this.m_tertiaryNodes.setField(t,2,e)}setRptr_(t,e){this.m_tertiaryNodes.setField(t,3,e)}setPptr_(t,e){this.m_tertiaryNodes.setField(t,4,e)}setSecondaryToInterval_(t,e){this.m_intervalNodes.setField(t,0,e)}addEndIndex_(t,e){let s=-1;return s=this.m_bOfflineDynamic?this.m_secondaryTreaps.addElement(e,t):this.m_secondaryLists.addElement(t,e),s}setLeftEnd_(t,e){this.m_intervalNodes.setField(t,1,e)}setRightEnd_(t,e){this.m_intervalNodes.setField(t,2,e)}getFirst_(t){return this.m_bOfflineDynamic?this.m_secondaryTreaps.getFirst(t):this.m_secondaryLists.getFirst(t)}getLast_(t){return this.m_bOfflineDynamic?this.m_secondaryTreaps.getLast(t):this.m_secondaryLists.getLast(t)}static isLeft_(t){return!(1&t)}static isRight_(t){return!(1&~t)}getDiscriminantIndex1_(t){return this.m_tertiaryNodes.getField(t,0)}getSecondaryFromTertiary_(t){return this.m_tertiaryNodes.getField(t,1)}getLptr_(t){return this.m_tertiaryNodes.getField(t,2)}getRptr_(t){return this.m_tertiaryNodes.getField(t,3)}getPptr_(t){return this.m_tertiaryNodes.getField(t,4)}getSecondaryFromInterval_(t){return this.m_intervalNodes.getField(t,0)}getLeftEnd_(t){return this.m_intervalNodes.getField(t,1)}getRightEnd_(t){return this.m_intervalNodes.getField(t,2)}getMin_(t){return this.m_bEnvelopesRef?this.m_envelopesRef[t].xmin:this.m_intervals[t].vmin}getMax_(t){return this.m_bEnvelopesRef?this.m_envelopesRef[t].xmax:this.m_intervals[t].vmax}sortEndIndices_(t,e,s){const i=this,n={userSort(t,e,s){i.sortEndIndicesHelper_(s,t,e)},getValue:t=>i.getValue_(t)};(new ht).sort(t,e,s,n)}sortEndIndicesHelper_(t,e,s){t.sort(e,s,(t,e)=>{const s=this.getValue_(t),i=this.getValue_(e);return s<i||s===i&&vt.isLeft_(t)&&vt.isRight_(e)?-1:1})}getValue_(t){if(!this.m_bEnvelopesRef){const e=this.m_intervals[t>>1];return vt.isLeft_(t)?e.vmin:e.vmax}const e=this.m_envelopesRef[t>>1];return vt.isLeft_(t)?e.xmin:e.xmax}}class yt{m_intervalTree;m_query=r.constructEmpty();m_tertiaryHandle=-1;m_nextTertiaryHandle=-1;m_forkedHandle=-1;m_currentEndHandle=-1;m_nextEndHandle=-1;m_tertiaryStack=[];m_functionIndex=0;m_functionStack;m_fi;constructor(t,e,s){this.m_intervalTree=t,this.m_functionStack=new Array(2),this.m_functionStack[0]=this.nullFunc_,this.m_functionStack[1]=this.nullFunc_,void 0!==e&&this.resetIterator(e,s)}nullFunc_(){return b("should not be called"),!1}resetIterator(t,e){if("number"==typeof t){const s=new r;s.setCoords(t,t),this.resetIterator(s,e)}else void 0===e&&(e=0),this.m_query.vmin=t.vmin-e,this.m_query.vmax=t.vmax+e,this.m_tertiaryStack.length=0,this.m_functionIndex=0,this.m_functionStack[0]=this.initialize_}next(){if(this.m_intervalTree.m_bConstructionEnded||E(""),this.m_functionIndex<0)return-1;for(;this.m_fi=this.m_functionStack[this.m_functionIndex],this.m_fi(););return-1!==this.m_currentEndHandle?this.getCurrentEndIndex_()>>1:-1}initialize_(){return this.m_tertiaryHandle=-1,this.m_nextTertiaryHandle=-1,this.m_forkedHandle=-1,this.m_currentEndHandle=-1,this.m_intervalTree.m_tertiaryNodes.size()>0?(this.m_functionStack[0]=this.pIn_,this.m_nextTertiaryHandle=this.m_intervalTree.m_root,!0):(this.m_functionIndex=-1,!1)}pIn_(){if(this.m_tertiaryHandle=this.m_nextTertiaryHandle,-1===this.m_tertiaryHandle)return this.m_functionIndex=-1,this.m_currentEndHandle=-1,!1;const t=this.m_intervalTree.getDiscriminant_(this.m_tertiaryHandle);if(this.m_query.vmax<t){const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getLptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(t),this.m_functionStack[++this.m_functionIndex]=this.left_),!0}if(t<this.m_query.vmin){const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getRptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getLast_(t),this.m_functionStack[++this.m_functionIndex]=this.right_),!0}this.m_functionStack[this.m_functionIndex]=this.pL_,this.m_forkedHandle=this.m_tertiaryHandle;const e=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getLptr_(this.m_tertiaryHandle),-1!==e&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(e),this.m_functionStack[++this.m_functionIndex]=this.all_),!0}pL_(){if(this.m_tertiaryHandle=this.m_nextTertiaryHandle,-1===this.m_tertiaryHandle)return this.m_functionStack[this.m_functionIndex]=this.pR_,this.m_nextTertiaryHandle=this.m_intervalTree.getRptr_(this.m_forkedHandle),!0;if(this.m_intervalTree.getDiscriminant_(this.m_tertiaryHandle)<this.m_query.vmin){const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getRptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getLast_(t),this.m_functionStack[++this.m_functionIndex]=this.right_),!0}const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);this.m_nextTertiaryHandle=this.m_intervalTree.getLptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(t),this.m_functionStack[++this.m_functionIndex]=this.all_);const e=this.m_intervalTree.getRptr_(this.m_tertiaryHandle);return-1!==e&&this.m_tertiaryStack.push(e),!0}pR_(){if(this.m_tertiaryHandle=this.m_nextTertiaryHandle,-1===this.m_tertiaryHandle)return this.m_functionStack[this.m_functionIndex]=this.pT_,!0;const t=this.m_intervalTree.getDiscriminant_(this.m_tertiaryHandle);if(this.m_query.vmax<t){const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return this.m_nextTertiaryHandle=this.m_intervalTree.getLptr_(this.m_tertiaryHandle),-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(t),this.m_functionStack[++this.m_functionIndex]=this.left_),!0}const e=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);this.m_nextTertiaryHandle=this.m_intervalTree.getRptr_(this.m_tertiaryHandle),-1!==e&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(e),this.m_functionStack[++this.m_functionIndex]=this.all_);const s=this.m_intervalTree.getLptr_(this.m_tertiaryHandle);return-1!==s&&this.m_tertiaryStack.push(s),!0}pT_(){if(0===this.m_tertiaryStack.length)return this.m_functionIndex=-1,this.m_currentEndHandle=-1,!1;this.m_tertiaryHandle=this.m_tertiaryStack.at(-1),this.m_tertiaryStack.pop();const t=this.m_intervalTree.getSecondaryFromTertiary_(this.m_tertiaryHandle);return-1!==t&&(this.m_nextEndHandle=this.m_intervalTree.getFirst_(t),this.m_functionStack[++this.m_functionIndex]=this.all_),-1!==this.m_intervalTree.getLptr_(this.m_tertiaryHandle)&&this.m_tertiaryStack.push(this.m_intervalTree.getLptr_(this.m_tertiaryHandle)),-1!==this.m_intervalTree.getRptr_(this.m_tertiaryHandle)&&this.m_tertiaryStack.push(this.m_intervalTree.getRptr_(this.m_tertiaryHandle)),!0}left_(){return this.m_currentEndHandle=this.m_nextEndHandle,-1!==this.m_currentEndHandle&&vt.isLeft_(this.getCurrentEndIndex_())&&this.m_intervalTree.getValue_(this.getCurrentEndIndex_())<=this.m_query.vmax?(this.m_nextEndHandle=this.getNext_(),!1):(this.m_functionIndex--,!0)}right_(){return this.m_currentEndHandle=this.m_nextEndHandle,-1!==this.m_currentEndHandle&&vt.isRight_(this.getCurrentEndIndex_())&&this.m_intervalTree.getValue_(this.getCurrentEndIndex_())>=this.m_query.vmin?(this.m_nextEndHandle=this.getPrev_(),!1):(this.m_functionIndex--,!0)}all_(){return this.m_currentEndHandle=this.m_nextEndHandle,-1!==this.m_currentEndHandle&&vt.isLeft_(this.getCurrentEndIndex_())?(this.m_nextEndHandle=this.getNext_(),!1):(this.m_functionIndex--,!0)}getNext_(){return this.m_intervalTree.m_bOfflineDynamic?this.m_intervalTree.m_secondaryTreaps.getNext(this.m_currentEndHandle):this.m_intervalTree.m_secondaryLists.getNext(this.m_currentEndHandle)}getPrev_(){return this.m_intervalTree.m_bOfflineDynamic?this.m_intervalTree.m_secondaryTreaps.getPrev(this.m_currentEndHandle):this.m_intervalTree.m_secondaryLists.getPrev(this.m_currentEndHandle)}getCurrentEndIndex_(){return this.m_intervalTree.m_bOfflineDynamic?this.m_intervalTree.m_secondaryTreaps.getElement(this.m_currentEndHandle):this.m_intervalTree.m_secondaryLists.getData(this.m_currentEndHandle)}}class xt{m_tolerance=0;m_sweepIndexRed=-1;m_sweepIndexBlue=-1;m_envelopeHandleA=-1;m_envelopeHandleB=-1;m_intervalTreeRed=null;m_intervalTreeBlue=null;m_iteratorRed=null;m_iteratorBlue=null;m_envelopesRed=[];m_envelopesBlue=[];m_elementsRed=[];m_elementsBlue=[];m_sortedEndIndicesRed=new st(0);m_sortedEndIndicesBlue=new st(0);m_queuedListRed=-1;m_queuedListBlue=-1;m_queuedEnvelopes=new gt;m_queuedIndicesRed=[];m_queuedIndicesBlue=[];m_bAddRed=!1;m_bAddBlue=!1;m_bAddRedRed=!1;m_bDone=!0;m_function;constructor(){this.m_function=this.nullFunc_,this.reset_()}startConstruction(){this.reset_(),this.m_bAddRedRed=!0,this.m_elementsRed.length=0,this.m_envelopesRed.length=0}addEnvelope(t,e){this.m_bAddRedRed||E(""),this.m_elementsRed.push(t),this.m_envelopesRed.push(new I(e))}endConstruction(){this.m_bAddRedRed||E(""),this.m_bAddRedRed=!1,this.m_envelopesRed.length>0&&(this.m_function=this.initialize_,this.m_bDone=!1)}startRedConstruction(){this.reset_(),this.m_bAddRed=!0,this.m_elementsRed.length=0,this.m_envelopesRed.length=0}addRedEnvelope(t,e){this.m_bAddRed||E(""),this.m_elementsRed.push(t),this.m_envelopesRed.push(e.clone())}endRedConstruction(){this.m_bAddRed||E(""),this.m_bAddRed=!1,this.m_envelopesRed.length>0&&this.m_envelopesBlue.length>0&&(this.m_function===this.nullFunc_||this.m_function===this.initializeBlue_?this.m_function=this.initializeRedBlue_:this.m_function!==this.initializeRedBlue_&&(this.m_function=this.initializeRed_),this.m_bDone=!1)}startBlueConstruction(){this.reset_(),this.m_bAddBlue=!0,this.m_elementsBlue.length=0,this.m_envelopesBlue.length=0}addBlueEnvelope(t,e){this.m_bAddBlue||E(""),this.m_elementsBlue.push(t),this.m_envelopesBlue.push(e.clone())}endBlueConstruction(){this.m_bAddBlue||E(""),this.m_bAddBlue=!1,this.m_envelopesRed.length>0&&this.m_envelopesBlue.length>0&&(this.m_function===this.nullFunc_||this.m_function===this.initializeRed_?this.m_function=this.initializeRedBlue_:this.m_function!==this.initializeRedBlue_&&(this.m_function=this.initializeBlue_),this.m_bDone=!1)}next(){if(this.m_bDone)return!1;for(;this.m_function(););return!this.m_bDone}getHandleA(){return this.m_envelopeHandleA}getHandleB(){return this.m_envelopeHandleB}setTolerance(t){this.m_tolerance=t}getElement(t){return this.m_elementsRed[t]}getRedEnvelope(t){return this.m_envelopesRed[t]}getBlueEnvelope(t){return this.m_envelopesBlue[t]}getRedElement(t){return this.m_elementsRed[t]}getBlueElement(t){return this.m_elementsBlue[t]}isTop_(t){return!(1&~t)}isBottom_(t){return!(1&t)}reset_(){this.m_bAddRed=!1,this.m_bAddBlue=!1,this.m_bAddRedRed=!1,this.m_sweepIndexRed=-1,this.m_sweepIndexBlue=-1,this.m_queuedListRed=-1,this.m_queuedListBlue=-1,this.m_bDone=!0}initialize_(){if(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_envelopesRed.length<10)return this.m_sweepIndexRed=this.m_envelopesRed.length,this.m_function=this.sweepBruteForce_,!0;this.m_intervalTreeRed||(this.m_intervalTreeRed=new vt(!0)),this.m_intervalTreeRed.addEnvelopesRef(this.m_envelopesRed),null===this.m_iteratorRed&&(this.m_iteratorRed=this.m_intervalTreeRed.getIterator()),this.m_sortedEndIndicesRed.resize(0);for(let t=0;t<2*this.m_envelopesRed.length;t++)this.m_sortedEndIndicesRed.add(t);return this.sortYEndIndices_(this.m_sortedEndIndicesRed,0,2*this.m_envelopesRed.length,!0),this.m_sweepIndexRed=2*this.m_envelopesRed.length,this.m_function=this.sweep_,!0}initializeRed_(){if(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_envelopesRed.length<10||this.m_envelopesBlue.length<10)return this.m_sweepIndexRed=this.m_envelopesRed.length,this.m_function=this.sweepRedBlueBruteForce_,!0;this.m_intervalTreeRed||(this.m_intervalTreeRed=new vt(!0)),this.m_intervalTreeRed.addEnvelopesRef(this.m_envelopesRed),null===this.m_iteratorRed&&(this.m_iteratorRed=this.m_intervalTreeRed.getIterator()),this.m_sortedEndIndicesRed.resize(0);for(let t=0;t<2*this.m_envelopesRed.length;t++)this.m_sortedEndIndicesRed.add(t);return this.sortYEndIndices_(this.m_sortedEndIndicesRed,0,this.m_sortedEndIndicesRed.size(),!0),this.m_sweepIndexRed=this.m_sortedEndIndicesRed.size(),-1!==this.m_queuedListRed&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListRed),this.m_queuedIndicesRed.length=0,this.m_queuedListRed=-1),this.m_function=this.sweepRedBlue_,this.resetBlue_()}initializeBlue_(){if(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_envelopesRed.length<10||this.m_envelopesBlue.length<10)return this.m_sweepIndexRed=this.m_envelopesRed.length,this.m_function=this.sweepRedBlueBruteForce_,!0;this.m_intervalTreeBlue||(this.m_intervalTreeBlue=new vt(!0)),this.m_intervalTreeBlue.addEnvelopesRef(this.m_envelopesBlue),null==this.m_iteratorBlue&&(this.m_iteratorBlue=this.m_intervalTreeBlue.getIterator()),this.m_sortedEndIndicesBlue.resize(0);for(let t=0;t<2*this.m_envelopesBlue.length;t++)this.m_sortedEndIndicesBlue.add(t);return this.sortYEndIndices_(this.m_sortedEndIndicesBlue,0,this.m_sortedEndIndicesBlue.size(),!1),this.m_sweepIndexBlue=this.m_sortedEndIndicesBlue.size(),-1!==this.m_queuedListBlue&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListBlue),this.m_queuedIndicesBlue.length=0,this.m_queuedListBlue=-1),this.m_function=this.sweepRedBlue_,this.resetRed_()}initializeRedBlue_(){if(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_envelopesRed.length<10||this.m_envelopesBlue.length<10)return this.m_sweepIndexRed=this.m_envelopesRed.length,this.m_function=this.sweepRedBlueBruteForce_,!0;this.m_intervalTreeRed||(this.m_intervalTreeRed=new vt(!0)),this.m_intervalTreeBlue||(this.m_intervalTreeBlue=new vt(!0)),this.m_intervalTreeRed.addEnvelopesRef(this.m_envelopesRed),this.m_intervalTreeBlue.addEnvelopesRef(this.m_envelopesBlue),null===this.m_iteratorRed&&(this.m_iteratorRed=this.m_intervalTreeRed.getIterator()),null===this.m_iteratorBlue&&(this.m_iteratorBlue=this.m_intervalTreeBlue.getIterator()),this.m_sortedEndIndicesRed.resize(0),this.m_sortedEndIndicesBlue.resize(0);for(let t=0;t<2*this.m_envelopesRed.length;t++)this.m_sortedEndIndicesRed.add(t);for(let t=0;t<2*this.m_envelopesBlue.length;t++)this.m_sortedEndIndicesBlue.add(t);return this.sortYEndIndices_(this.m_sortedEndIndicesRed,0,this.m_sortedEndIndicesRed.size(),!0),this.sortYEndIndices_(this.m_sortedEndIndicesBlue,0,this.m_sortedEndIndicesBlue.size(),!1),this.m_sweepIndexRed=this.m_sortedEndIndicesRed.size(),this.m_sweepIndexBlue=this.m_sortedEndIndicesBlue.size(),-1!==this.m_queuedListRed&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListRed),this.m_queuedIndicesRed.length=0,this.m_queuedListRed=-1),-1!==this.m_queuedListBlue&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListBlue),this.m_queuedIndicesBlue.length=0,this.m_queuedListBlue=-1),this.m_function=this.sweepRedBlue_,!0}sweep_(){const t=this.m_sortedEndIndicesRed.read(--this.m_sweepIndexRed),e=t>>1;if(this.isBottom_(t))return this.m_intervalTreeRed.remove(e),0!==this.m_sweepIndexRed||(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1);const s=r.construct(this.m_envelopesRed[e].xmin,this.m_envelopesRed[e].xmax);return this.m_iteratorRed.resetIterator(s,this.m_tolerance),this.m_envelopeHandleA=e,this.m_function=this.iterate_,!0}sweepBruteForce_(){return-1===--this.m_sweepIndexRed?(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1):(this.m_envelopeHandleA=this.m_sweepIndexRed,this.m_sweepIndexBlue=this.m_sweepIndexRed,this.m_function=this.iterateBruteForce_,!0)}sweepRedBlueBruteForce_(){return-1===--this.m_sweepIndexRed?(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1):(this.m_envelopeHandleA=this.m_sweepIndexRed,this.m_sweepIndexBlue=this.m_envelopesBlue.length,this.m_function=this.iterateRedBlueBruteForce_,!0)}sweepRedBlue_(){const t=this.m_sortedEndIndicesRed.read(this.m_sweepIndexRed-1),e=this.m_sortedEndIndicesBlue.read(this.m_sweepIndexBlue-1),s=this.getAdjustedValue_(t,!0),i=this.getAdjustedValue_(e,!1);return s>i?this.sweepRed_():s<i?this.sweepBlue_():this.isTop_(t)?this.sweepRed_():this.isTop_(e)?this.sweepBlue_():this.sweepRed_()}sweepRed_(){const t=this.m_sortedEndIndicesRed.read(--this.m_sweepIndexRed),e=t>>1;if(this.isBottom_(t))return-1!==this.m_queuedListRed&&-1!==this.m_queuedIndicesRed[e]?(this.m_queuedEnvelopes.deleteElement(this.m_queuedListRed,this.m_queuedIndicesRed[e]),this.m_queuedIndicesRed[e]=-1):this.m_intervalTreeRed.remove(e),0!==this.m_sweepIndexRed||(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1);if(-1!==this.m_queuedListBlue&&this.m_queuedEnvelopes.getListSize(this.m_queuedListBlue)>0){let t=this.m_queuedEnvelopes.getFirst(this.m_queuedListBlue);for(;-1!==t;){const e=this.m_queuedEnvelopes.getData(t);this.m_intervalTreeBlue.insert(e),this.m_queuedIndicesBlue[e]=-1;const s=this.m_queuedEnvelopes.getNext(t);this.m_queuedEnvelopes.deleteElement(this.m_queuedListBlue,t),t=s}}if(this.m_intervalTreeBlue.size()>0){const t=r.construct(this.m_envelopesRed[e].xmin,this.m_envelopesRed[e].xmax);this.m_iteratorBlue.resetIterator(t,this.m_tolerance),this.m_envelopeHandleA=e,this.m_function=this.iterateBlue_}else-1===this.m_queuedListRed&&(c(this.m_queuedIndicesRed,this.m_envelopesRed.length,-1),this.m_queuedListRed=this.m_queuedEnvelopes.createList(1)),this.m_queuedIndicesRed[e]=this.m_queuedEnvelopes.addElement(this.m_queuedListRed,e),this.m_function=this.sweepRedBlue_;return!0}sweepBlue_(){const t=this.m_sortedEndIndicesBlue.read(--this.m_sweepIndexBlue),e=t>>1;if(this.isBottom_(t))return-1!==this.m_queuedListBlue&&-1!==this.m_queuedIndicesBlue[e]?(this.m_queuedEnvelopes.deleteElement(this.m_queuedListBlue,this.m_queuedIndicesBlue[e]),this.m_queuedIndicesBlue[e]=-1):this.m_intervalTreeBlue.remove(e),0!==this.m_sweepIndexBlue||(this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1,this.m_bDone=!0,!1);if(-1!==this.m_queuedListRed&&this.m_queuedEnvelopes.getListSize(this.m_queuedListRed)>0){let t=this.m_queuedEnvelopes.getFirst(this.m_queuedListRed);for(;-1!==t;){const e=this.m_queuedEnvelopes.getData(t);this.m_intervalTreeRed.insert(e),this.m_queuedIndicesRed[e]=-1;const s=this.m_queuedEnvelopes.getNext(t);this.m_queuedEnvelopes.deleteElement(this.m_queuedListRed,t),t=s}}if(this.m_intervalTreeRed.size()>0){const t=r.construct(this.m_envelopesBlue[e].xmin,this.m_envelopesBlue[e].xmax);this.m_iteratorRed.resetIterator(t,this.m_tolerance),this.m_envelopeHandleB=e,this.m_function=this.iterateRed_}else-1===this.m_queuedListBlue&&(c(this.m_queuedIndicesBlue,this.m_envelopesBlue.length,-1),this.m_queuedListBlue=this.m_queuedEnvelopes.createList(0)),this.m_queuedIndicesBlue[e]=this.m_queuedEnvelopes.addElement(this.m_queuedListBlue,e),this.m_function=this.sweepRedBlue_;return!0}iterate_(){if(this.m_envelopeHandleB=this.m_iteratorRed.next(),-1!==this.m_envelopeHandleB)return!1;const t=this.m_sortedEndIndicesRed.read(this.m_sweepIndexRed)>>1;return this.m_intervalTreeRed.insert(t),this.m_function=this.sweep_,!0}iterateRed_(){if(this.m_envelopeHandleA=this.m_iteratorRed.next(),-1!==this.m_envelopeHandleA)return!1;this.m_envelopeHandleA=-1,this.m_envelopeHandleB=-1;const t=this.m_sortedEndIndicesBlue.read(this.m_sweepIndexBlue)>>1;return this.m_intervalTreeBlue.insert(t),this.m_function=this.sweepRedBlue_,!0}iterateBlue_(){if(this.m_envelopeHandleB=this.m_iteratorBlue.next(),-1!==this.m_envelopeHandleB)return!1;const t=this.m_sortedEndIndicesRed.read(this.m_sweepIndexRed)>>1;return this.m_intervalTreeRed.insert(t),this.m_function=this.sweepRedBlue_,!0}iterateBruteForce_(){if(-1===--this.m_sweepIndexBlue)return this.m_function=this.sweepBruteForce_,!0;const t=this.m_envelopesRed[this.m_sweepIndexRed].clone(),e=this.m_envelopesRed[this.m_sweepIndexBlue];return t.inflateCoords(this.m_tolerance,this.m_tolerance),!t.isIntersecting(e)||(this.m_envelopeHandleB=this.m_sweepIndexBlue,!1)}iterateRedBlueBruteForce_(){if(-1===--this.m_sweepIndexBlue)return this.m_function=this.sweepRedBlueBruteForce_,!0;const t=this.m_envelopesRed[this.m_sweepIndexRed].clone(),e=this.m_envelopesBlue[this.m_sweepIndexBlue];return t.inflateCoords(this.m_tolerance,this.m_tolerance),!t.isIntersecting(e)||(this.m_envelopeHandleB=this.m_sweepIndexBlue,!1)}resetRed_(){return this.m_sweepIndexRed=this.m_sortedEndIndicesRed.size(),this.m_intervalTreeRed.size()>0&&this.m_intervalTreeRed.reset(),-1!==this.m_queuedListRed&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListRed),this.m_queuedIndicesRed.length=0,this.m_queuedListRed=-1),this.m_bDone=!1,!0}resetBlue_(){return this.m_sweepIndexBlue=this.m_sortedEndIndicesBlue.size(),this.m_intervalTreeBlue.size()>0&&this.m_intervalTreeBlue.reset(),-1!==this.m_queuedListBlue&&(this.m_queuedEnvelopes.deleteList(this.m_queuedListBlue),this.m_queuedIndicesBlue.length=0,this.m_queuedListBlue=-1),this.m_bDone=!1,!0}nullFunc_(){return b("should not be called"),!1}sortYEndIndices_(t,e,s,i){const n=this,r={userSort(t,e,s){n.sortYEndIndicesHelper_(s,t,e,i)},getValue:t=>n.getAdjustedValue_(t,i)};(new ht).sort(t,e,s,r)}sortYEndIndicesHelper_(t,e,s,i){t.sort(e,s,(t,e)=>{const s=this.getAdjustedValue_(t,i),n=this.getAdjustedValue_(e,i);return s<n||s===n&&this.isBottom_(t)&&this.isTop_(e)?-1:1})}getAdjustedValue_(t,e){const s=.5*this.m_tolerance;if(e){const e=this.m_envelopesRed[t>>1];return this.isBottom_(t)?e.ymin-s:e.ymax+s}const i=this.m_envelopesBlue[t>>1];return this.isBottom_(t)?i.ymin-s:i.ymax+s}}var bt=z;class Et{tolerance;resolution;constructor(t,e){this.tolerance=void 0!==t?t:Number.NaN,this.resolution=void 0!==e?e:Number.NaN}add(t){return new Et(this.tolerance+t,this.resolution)}scale(t){return new Et(this.tolerance*t,this.resolution*t)}total(){return this.tolerance+this.resolution}}function Nt(t,e,i,n,r){const o=n*n,a=t.sub(e),h=i.sub(e),m=a.sqrLength(),_=h.sqrLength();if(m<=o||_<=o)return!0;const l=s(a.crossProduct(h));if(l<=o*m||l<=o*_){return a.dotProduct(h)>=0}return!1}function Dt(t,e,s){return i=>0===s?(i+t)*e:1*(i-t*e)/e}function It(t,e){const s=new I;return t.queryLooseEnvelope(s),s.mergeEnvelope2D(e),s}function Ct(t,e){const s=I.constructEmpty();t.queryLooseEnvelope(s);const i=I.constructEmpty();return e.queryLooseEnvelope(i),s.mergeEnvelope2D(i),s}function Tt(t,e){return(Number.isFinite(t)||Number.isNaN(t))&&(Number.isFinite(e)||Number.isNaN(e))}function Rt(t,e){return Number.isFinite(t)&&Number.isFinite(e)}function At(t,e,s){const i=I.constructEmpty();i.setFromPoints(t,e);return Ft(0,null,i.calculateToleranceFromEnvelope(),s,!1)}function qt(t,e,s){return Ft(0,t,e.calculateToleranceFromEnvelope(),s,!1)}function wt(t,e,s){return Ft(1,t,e.calculateToleranceFromEnvelope(),s,!1)}function Bt(t,e,s){return wt(t,e.queryInterval(1,0),s)}function zt(t,e,s){const i=I.constructEmpty();return e.queryEnvelope(i),qt(t,i,s)}function Lt(t,e,s=!1){return Ft(0,t,e.calculateToleranceFromEnvelope(),s,!0).total()}function St(t,e,s){const i=I.constructEmpty();return e.queryEnvelope(i),Lt(t,i,s)}function Ft(t,e,s,i,n){const r=new Et(0,0);if(null!==e&&(r.tolerance=e.getTolerance(t),(!n||i)&&null!==e)){const s=e.getResolution(t);r.resolution=s,i&&(r.resolution*=2)}i&&(s*=4,r.tolerance*=1.01,r.resolution*=1.01);return r.total()<s?new Et(s,0):r}function Pt(t){return Math.sqrt(2)*(2*t.tolerance+t.resolution)}function Ht(t){return Math.sqrt(2)*(t.tolerance+t.resolution)}function Vt(t){return t>=3}function kt(t,e){const s=[0];return t.getImpl().getIsSimple(e,s)>=3}function Mt(t,e){t.getImpl().setIsSimple(3,e)}function Ot(t,e,n,r){if(s(e.x-t.x)+s(e.y-t.y)<=n*n){const s=t.z,n=e.z;return i(s,n,r)}return!1}function Yt(t){return t>=4}function Xt(t,e){return t===v.enumPolygon?Vt(e):e>=1}function Gt(t,e,s){const i=I.constructEmpty(),n=I.constructEmpty();t.queryLooseEnvelope(i),e.queryLooseEnvelope(n),i.inflateCoords(s,s),n.inflateCoords(s,s);const r=I.constructEmpty();r.setCoords({env2D:i}),r.intersect(n);const o=t.querySegmentIterator(),a=e.querySegmentIterator(),h=I.constructEmpty(),m=I.constructEmpty(),_=new xt;_.setTolerance(s);let l=!1;for(_.startRedConstruction();o.nextPath();)for(;o.hasNextSegment();){o.nextSegment().queryLooseEnvelope(h),h.isIntersecting(r)&&(l=!0,_.addRedEnvelope(o.getStartPointIndex(),h))}if(_.endRedConstruction(),!l)return null;let u=!1;for(_.startBlueConstruction();a.nextPath();)for(;a.hasNextSegment();){a.nextSegment().queryLooseEnvelope(m),m.isIntersecting(r)&&(u=!0,_.addBlueEnvelope(a.getStartPointIndex(),m))}return _.endBlueConstruction(),u?_:null}function Ut(t,e,s,i,n){t.getGeometryType(),e.getGeometryType();const r=I.constructEmpty(),o=I.constructEmpty();t.queryLooseEnvelope(r),e.queryLooseEnvelope(o),r.inflateCoords(s,s),o.inflateCoords(s,s);const a=I.constructEmpty();a.setCoords({env2D:r}),a.intersect(o);const h=new xt;h.setTolerance(s);let m=!1;h.startRedConstruction();for(let l=0,u=t.getPathCount();l<u;l++)t.queryLoosePathEnvelope(l,r),r.isIntersecting(a)&&(m=!0,h.addRedEnvelope(l,r));if(h.endRedConstruction(),!m)return null;let _=!1;h.startBlueConstruction();for(let l=0,u=e.getPathCount();l<u;l++)e.queryLoosePathEnvelope(l,o),o.isIntersecting(a)&&(_=!0,h.addBlueEnvelope(l,o));return h.endBlueConstruction(),_?h:null}function Zt(t,e,s){const i=I.constructEmpty(),n=I.constructEmpty();t.queryLooseEnvelope(i),e.queryEnvelope(n),i.inflateCoords(s,s),n.inflateCoords(s,s);const r=I.constructEmpty();r.setCoords({env2D:i}),r.intersect(n);const o=t.querySegmentIterator(),a=new xt;a.setTolerance(s);let h=!1;for(a.startRedConstruction();o.nextPath();)for(;o.hasNextSegment();){o.nextSegment().queryLooseEnvelope(i),i.isIntersecting(r)&&(h=!0,a.addRedEnvelope(o.getStartPointIndex(),i))}if(a.endRedConstruction(),!h)return null;let m=!1;a.startBlueConstruction();for(let _=0,l=e.getPointCount();_<l;_++){const t=e.getXY(_);r.contains(t)&&(m=!0,a.addBlueEnvelope(_,I.construct(t.x,t.y,t.x,t.y)))}return a.endBlueConstruction(),m?a:null}function Qt(t,e,s){const i=I.constructEmpty(),n=I.constructEmpty();t.queryEnvelope(i),e.queryEnvelope(n),i.inflateCoords(s,s),n.inflateCoords(s,s);const r=I.constructEmpty();r.setCoords({env2D:i}),r.intersect(n);const o=new xt;o.setTolerance(s);let h=!1;o.startRedConstruction();const m=new a;for(let a=0,u=t.getPointCount();a<u;a++)t.queryXY(a,m),r.contains(m)&&(h=!0,o.addRedEnvelope(a,I.construct(m.x,m.y,m.x,m.y)));if(o.endRedConstruction(),!h)return null;let _=!1;o.startBlueConstruction();const l=new a;for(let a=0,u=e.getPointCount();a<u;a++)e.queryXY(a,l),r.contains(l)&&(_=!0,o.addBlueEnvelope(a,I.construct(l.x,l.y,l.x,l.y)));return o.endBlueConstruction(),_?o:null}function jt(t){const e=new I;return t.queryLooseEnvelope(e),e.inflateCoords(1,1),Wt(t,e)}function Wt(t,e,s){const i=new I;if(t.queryLooseEnvelope(i),i.isEmpty())return null;t.getGeometryType();const n=new lt(i,8);let r=-1;const o=new I;let a=!1;do{for(let s=0,h=t.getPathCount();s<h;s++)if(t.queryLoosePathEnvelope(s,o),o.isIntersecting(e)){if(r=n.insertEx(s,o,r),-1===r){a&&b("build_quad_tree_for_paths"),i.assign(t.calculateEnvelope2D(!1)),a=!0,n.reset(i,8);break}a=!1}}while(a);return n}function Jt(t,e){if(!e){const e=new I;t.queryLooseEnvelope(e);const s=new lt(e,8);let i=-1;const n=new I,r=t.querySegmentIterator();let o=!1;for(;r.nextPath();)for(;r.hasNextSegment();){const a=r.nextSegment(),h=r.getStartPointIndex();if(a.queryLooseEnvelope(n),i=s.insertEx(h,n,i),-1===i){o&&b(""),e.assign(t.calculateEnvelope2D(!1)),o=!0,s.reset(e,8),r.resetToFirstPath();break}}return s}const s=new I;t.queryLooseEnvelope(s);const i=new lt(s,8);let n=-1;const r=new I,o=t.querySegmentIterator();let a=!1;for(;o.nextPath();)for(;o.hasNextSegment();){const h=o.nextSegment(),m=o.getStartPointIndex();if(h.queryLooseEnvelope(r),r.isIntersecting(e)&&(n=i.insertEx(m,r,n),-1===n)){a&&b(""),s.assign(t.calculateEnvelope2D(!1)),a=!0,i.reset(s,8),o.resetToFirstPath();break}}return i}function Kt(t,e){if(e){const s=new lt(e,8),i=new a,n=new I;let r=!1;for(let o=0;o<t.getPointCount();o++){if(i.setCoordsPoint2D(t.getXY(o)),!e.contains(i))continue;n.setCoords({pt:i});-1!==s.insert(o,n)||(r&&b(""),r=!0,s.reset(t.calculateEnvelope2D(),8),o=-1)}return s}return y("no-extent version not yet impl"),null}function $t(t,e,s,i,n){let r=!1;const o=n.vmin,a=n.vmax;for(let h=s;h<e;h+=i){const e=t.read(h);e<o?(r=!0,t.write(h,o)):e>a&&(r=!0,t.write(h,a))}return r}function te(t,e,s,i){if(!t.hasAttribute(s))return!1;const n=t.getGeometryType();if(n===v.enumGeometryCollection){const n=t,r=n.getGeometryCount();let o=0;for(let t=0;t<r;++t){o|=te(n.getGeometry(t),e,s,i)?1:0}return!!o}if(N(n)){const n=t,r=bt.getPersistence(s),o=bt.getComponentCount(s),a=n.getPointCount();if(1===r){const t=$t(n.getAttributeStreamRef(s),a*o,i,o,e);return t&&n.notifyModified(),t}if(2===r){const t=$t(n.getAttributeStreamRef(s),a*o,i,o,e);return t&&n.notifyModified(),t}b("snap_coordinate not implemented")}if(n===v.enumEnvelope){const n=t,r=n.queryInterval(s,i);let o=!1;return r.vmin<e.vmin&&(o=!0,r.vmin=e.vmin),r.vmax>e.vmax&&(o=!0,r.vmax=e.vmax),o&&n.setIntervalEnvelope(s,i,r),o}if(n===v.enumPoint){const n=t;let r=n.getAttributeAsDbl(s,i),o=!1;return r<e.vmin&&(o=!0,r=e.vmin),r>e.vmax&&(o=!0,r=e.vmax),o&&n.setAttributeBasic(s,i,r),o}if(D(n)){const n=t;let r=n.getStartAttributeAsDbl(s,i),o=!1;return r<e.vmin&&(o=!0,r=e.vmin),r>e.vmax&&(o=!0,r=e.vmax),o&&n.setStartAttribute(s,i,r),r=n.getEndAttributeAsDbl(s,i),r<e.vmin&&(o=!0,r=e.vmin),r>e.vmax&&(o=!0,r=e.vmax),o&&n.setEndAttribute(s,i,r),o}b("snap_coordinate not implemented")}var ee=z;class se{static type=v.enumPoint;m_description=null;x=Number.NaN;y=Number.NaN;m_attribs=null;constructor(t){if(t){if(!t.copy)return t.move?(this.m_description=t.move.m_description,t.move.m_description=null,this.m_attribs=t.move.m_attribs,t.move.m_attribs=null,this.x=t.move.x,void(this.y=t.move.y)):t.vd?(this.m_description=t.vd,void(t.attribBuffer?(this.m_attribs=t.attribBuffer,t.initDefaultValues&&this.setDefaultAttributeValues()):this.ensureAttributes())):t.pt?(this.m_description=M(),void this.setXY(t.pt)):void("x"in t&&("z"in t?(this.m_description=O(),this.ensureAttributes(),this.setXYZ(new X(t.x,t.y,t.z))):(this.m_description=M(),this.setXYCoords(t.x,t.y))));t.copy.copyTo(this)}else this.m_description=M()}assignCopy(t){return this.m_attribs=null,t.copyTo(this),this}assignMove(t){return this.m_attribs=null,t.copyTo(this),t.setEmpty(),this}getXY(){return new a(this.x,this.y)}queryXY(t){t.x=this.x,t.y=this.y}setXY(t){this.x=t.x,this.y=t.y}setXYCoords(t,e){this.x=t,this.y=e}getXYZ(){const t=new X;return t.x=this.x,t.y=this.y,t.z=this.getZ(),t}setXYZ(t){this.addAttribute(1),this.x=t.x,this.y=t.y,this.m_attribs[0]=t.z}getX(){return this.x}setX(t){this.x=t}getY(){return this.y}setY(t){this.y=t}getZ(){return this.m_description.hasZ()?this.m_attribs[0]:ee.getDefaultValue(1)}setZ(t){this.addAttribute(1),this.m_attribs[0]=t}getM(){return this.getAttributeAsDbl(2,0)}setM(t){this.addAttribute(2),this.m_description.hasZ()?this.m_attribs[1]=t:this.m_attribs[0]=t}getID(){return this.getAttributeAsInt(3,0)}setID(t){this.setAttributeBasic(3,0,t)}isEqualXY(t,e){return void 0===e&&(e=0),Math.abs(t.x-this.x)<=e&&Math.abs(t.y-this.y)<=e}isEqualXYCoords(t,e,s){return void 0===s&&(s=0),Math.abs(t-this.x)<=s&&Math.abs(e-this.y)<=s}getAttributeAsDbl(t,e){if(0===t){if(0===e)return this.x;if(1===e)return this.y;f("")}const s=ee.getComponentCount(t);(e<0||e>=s)&&f("");const i=this.m_description.getAttributeIndex(t);return i>=0?this.m_attribs[this.m_description.getPointAttributeOffset(i)-2+e]:ee.getDefaultValue(t)}getAttributeAsInt(t,e){return Math.trunc(this.getAttributeAsDbl(t,e))}setAttributeBasic(t,e,s){if(0===t)return void(0===e?this.x=s:1===e?this.y=s:f(""));const i=ee.getComponentCount(t);(e<0||e>=i)&&f("");let n=this.m_description.getAttributeIndex(t);n<0&&(this.addAttribute(t),n=this.m_description.getAttributeIndex(t)),this.m_attribs[this.m_description.getPointAttributeOffset(n)-2+e]=s}copyAttributesFrom(t,e){if(this===t)return;const s=t.getDescription();for(let i=e&&s.hasZ()?2:1,n=s.getAttributeCount();i<n;++i){const e=s.getSemantics(i),n=ee.getComponentCount(e);for(let s=0;s<n;++s){const i=t.getAttributeAsDbl(e,s);this.setAttributeBasic(e,s,i)}}}getAttributeArray(){return this.m_attribs}getDescription(){return this.m_description}assignVertexDescription(t){this.m_description!==t&&this.assignVertexDescriptionImpl(t)}mergeVertexDescription(t){this.m_description!==t&&(this.m_description.hasAttributesFrom(t)||this.mergeVertexDescriptionImpl(t))}hasAttribute(t){return this.m_description.hasAttribute(t)}addAttribute(t){if(this.m_description.hasAttribute(t))return;const e=V(this.m_description,t);this.assignVertexDescription(e)}dropAttribute(t){if(!this.m_description.hasAttribute(t))return;const e=k(this.m_description,t);this.assignVertexDescription(e)}dropAllAttributes(){const t=M();t!==this.m_description&&this.assignVertexDescription(t)}getGeometryType(){return v.enumPoint}getDimension(){return 0}queryEnvelope(t){if(t instanceof oe)return t.setEmpty(),t.assignVertexDescription(this.m_description),void t.merge(this);if(t instanceof G){if(this.isEmpty())return void t.setEmpty();const e=this.getXYZ();return t.xmin=e.x,t.ymin=e.y,t.zmin=e.z,t.xmax=e.x,t.ymax=e.y,void(t.zmax=e.z)}this.isEmpty()?t.setEmpty():(t.xmin=this.x,t.ymin=this.y,t.xmax=this.x,t.ymax=this.y)}queryLooseEnvelope(t){this.queryEnvelope(t)}queryInterval(t,e){const s=new r;if(this.isEmpty())return s.setEmpty(),s;const i=this.getAttributeAsDbl(t,e);return s.vmin=i,s.vmax=i,s}applyTransformation(t){if(!this.isEmpty()){if(1===t.m_TransformationType){const e=this.getXY();return t.transformInPlace(e),void this.setXY(e)}y("3d not impl")}}transformAttribute(t,e,s,i,n){if(this.isEmpty())return;this.addAttribute(t);const r=this.getAttributeAsDbl(t,e),o=Dt(s,i,n);this.setAttributeBasic(t,e,o(r))}createInstance(){return new se({vd:this.m_description})}copyTo(t){if(this===t)return;t.getGeometryType()!==v.enumPoint&&g();const e=t;e.x=this.x,e.y=this.y,this.m_attribs?(e.assignVertexDescription(this.m_description),e.m_attribs=this.m_attribs.slice()):(e.releaseAttributes(),e.assignVertexDescription(this.m_description))}isEmpty(){return Number.isNaN(this.x)||Number.isNaN(this.y)}setEmpty(){this.m_description||(this.m_description=M(),this.releaseAttributes()),this.x=Number.NaN,this.y=Number.NaN,this.m_attribs&&m(this.m_attribs,this.m_description.getDefaultPointAttributes(),0,2,this.m_description.getTotalComponentCount()-2)}calculateArea2D(){return 0}calculateLength2D(){return 0}calculateLength3D(t){return 0}equals(t,e){if(t===this)return!0;if(t.getGeometryType()!==v.enumPoint)return!1;const s=t;if(this.m_description!==s.m_description)return!1;if(this.isEmpty()!==s.isEmpty())return!1;if(this.isEmpty())return!0;if(void 0===e&&(e=0),Math.abs(this.x-s.x)>e)return!1;if(Math.abs(this.y-s.y)>e)return!1;for(let n=0,r=this.m_description.getTotalComponentCount()-2;n<r;n++)if(!i(this.m_attribs[n],s.m_attribs[n],e))return!1;return!0}getBoundary(){return null}clone(){const t=new se({vd:this.m_description});return this.copyTo(t),t}swap(t){if(this===t)return;t.getGeometryType()!==v.enumPoint&&g("wrong geometry type");const e=t;e.m_description=o(this.m_description,this.m_description=e.m_description),e.x=o(this.x,this.x=e.x),e.y=o(this.y,this.y=e.y),e.m_attribs=o(this.m_attribs,this.m_attribs=e.m_attribs)}replaceNaNs(t,e){if(this.addAttribute(t),this.isEmpty())return;const s=ee.getComponentCount(t);for(let i=0;i<s;i++){const s=this.getAttributeAsDbl(t,i);Number.isNaN(s)&&this.setAttributeBasic(t,i,e)}}lerp(t,e,s){if(t.getDescription()!==e.getDescription()&&g("Point.lerp"),this.assignVertexDescription(t.getDescription()),t.isEmpty()||e.isEmpty())return this.setEmpty(),this;this.ensureAttributes();const i=B();t.queryValues(i,i.length);const n=B();e.queryValues(n,n.length);const r=B();let o=i,a=n;const h=r;let m=0;for(let l=0,u=this.m_description.getAttributeCount();l<u;l++){const t=this.m_description.getSemantics(l),e=ee.getInterpolation(t),i=ee.getComponentCount(t),n=ee.getDefaultValue(t);_(e,o,a,h,m,i,s,n),o=o.slice(i),a=a.slice(i),m+=i}return this.setValues(r,m),this}static lerp(t,e,s,i){i.lerp(t,e,s)}setDefaultAttributeValues(){const t=this.m_description.getTotalComponentCount()-2;t>0&&(this.m_attribs?m(this.m_attribs,this.m_description.getDefaultPointAttributes(),0,2,t):this.m_attribs=this.m_description.getDefaultPointAttributes().slice(2))}static sqrDistance2D(t,e){return a.sqrDistanceCoords(t.x,t.y,e.x,e.y)}getImpl(){return this}mergeVertexDescriptionImpl(t){const e=H(this.getDescription(),t);this.assignVertexDescription(e)}releaseAttributes(){this.m_attribs=null}assignVertexDescriptionImpl(t){this.m_description||(this.m_description=M());const e=S();Y(t,this.m_description,e);let s=null;t.getTotalComponentCount()-2>0&&(s=t.getDefaultPointAttributes().slice(2));for(let i=1,n=t.getAttributeCount();i<n;i++){const n=e[i];if(-1!==n){const e=this.m_description.getPointAttributeOffset(n)-2,r=t.getPointAttributeOffset(i)-2,o=ee.getComponentCount(t.getSemantics(i));for(let t=0;t<o;t++)s[r+t]=this.m_attribs[e+t]}}this.m_attribs=s,this.m_description=t}ensureAttributes(){this.m_description.getTotalComponentCount()-2>0&&null===this.m_attribs&&(this.m_attribs=this.m_description.getDefaultPointAttributes().slice(2))}queryValues(t,e){const s=this.m_description.getTotalComponentCount();p(s<=e),t[0]=this.x,t[1]=this.y,m(t,this.m_attribs,2,0,s-2)}copyCommonAttributesTo(t){t.x=this.x,t.y=this.y;const e=t.getDescription();if(e===this.m_description)this.m_attribs&&m(t.m_attribs,this.m_attribs,0,0,this.m_description.getTotalComponentCount()-2);else{let s=0;for(let i=1,n=e.getAttributeCount();i<n;i++){const n=e.getSemantics(i);let r=ee.getComponentCount(n);if(this.m_description.hasAttribute(n)){let e=this.m_description.getPointAttributeOffset(this.m_description.getAttributeIndex(n))-2;for(;0!==r;)t.m_attribs[s++]=this.m_attribs[e++],r--}else{const e=ee.getDefaultValue(n);for(;0!==r;)t.m_attribs[s++]=e,r--}}}}setValues(t,e){const s=this.m_description.getTotalComponentCount();p(s<=e),this.x=t[0],this.y=t[1],m(this.m_attribs,t,0,2,s-2)}dbgDefaultAttribs(){}toFlatGeometry(){const t=Float64Array.of(this.getX(),this.getY(),this.getZ(),this.getM());return{type:"point",vertexCount:1,vertexXY:t.subarray(0,2),vertexZ:this.hasAttribute(1)?t.subarray(2,3):void 0,vertexM:this.hasAttribute(2)?t.subarray(3,4):void 0,...at}}}var ie=z;function ne(t,e){return e*(t.getTotalComponentCount()-2)}class re{m_envelope2D;m_attributes;constructor(t){if(this.m_attributes=null,t)if(void 0!==t.xmin)this.m_envelope2D=new I(t.xmin,t.ymin,t.xmax,t.ymax);else if(void 0!==t.env2D)this.m_envelope2D=new I(t.env2D);else if(t.move)this.m_envelope2D=new I(t.move.m_envelope2D),this.m_attributes=t.move.m_attributes,t.move.m_attributes=null;else{if(!t.moveEnv)throw new Error("unrecognized EnvelopeData constructor options");{const e=t.moveEnv.accessEnvelopeData();this.m_envelope2D=new I(e.m_envelope2D),this.m_attributes=e.m_attributes,e.m_attributes=null}}else this.m_envelope2D=I.constructEmpty()}ensureAttributes(t){const s=t.getTotalComponentCount()-2;!this.m_attributes&&s&&(this.m_attributes=e(2*s,Number.NaN),this.m_attributes.fill(Number.NaN))}copyTo(t,s){const i=s,n=t.getTotalComponentCount()-2;if(i.m_description!==t&&(i.releaseAttributes_(),i.m_description=t,n&&(i.m_data.m_attributes=e(2*n,Number.NaN))),n){p(this.m_attributes&&i.m_data.m_attributes);const t=2*n;m(i.m_data.m_attributes,this.m_attributes,0,0,t)}i.m_data.m_envelope2D=new I(this.m_envelope2D)}copyToIfNotNull(t,e){e.m_envelope2D=new I(this.m_envelope2D),e.releaseAttributes();t.getTotalComponentCount()-2&&this.m_attributes&&(e.m_attributes=this.m_attributes.slice())}releaseAttributes(){this.m_attributes=null}isEmpty(){return this.m_envelope2D.isEmpty()}transformAttribute(t,e,s,i,n){p(0)}queryInterval(t,e,s,i){if(this.isEmpty())return void i.setEmpty();if(0===e)return void(0===s?this.m_envelope2D.queryIntervalX(i):1===s?this.m_envelope2D.queryIntervalY(i):f(""));const n=ie.getComponentCount(e);(s<0||s>=n)&&f("");const r=t.getAttributeIndex(e);if(r>=0)return i.vmin=this.m_attributes[ne(t,0)+t.getPointAttributeOffset(r)-2+s],void(i.vmax=this.m_attributes[ne(t,1)+t.getPointAttributeOffset(r)-2+s]);{const t=ie.getDefaultValue(e);return void i.setCoords(t,t)}}queryEnvelope3D(t,e){const s=new r;this.queryInterval(t,1,0,s),e.setCoords(this.m_envelope2D.xmin,this.m_envelope2D.ymin,s.vmin,this.m_envelope2D.xmax,this.m_envelope2D.ymax,s.vmax)}setEmpty(t){this.m_envelope2D.setEmpty();const s=t.getTotalComponentCount()-2;s&&(this.m_attributes?this.dbgAssertSize(s):this.m_attributes=e(2*s,Number.NaN),this.m_attributes.fill(Number.NaN))}dbgAssertSize(t){}}let oe=class t{static type=v.enumEnvelope;m_EnvelopeType=4;m_description;m_data;constructor(t){if(this.m_description=M(),void 0===t)this.m_data=new re;else if(void 0!==t.vd)this.m_description=t.vd,this.m_data=new re,this.ensureAttributes_();else if(t?.env2D)this.m_data=new re({env2D:t.env2D});else if(void 0!==t.xmin)this.m_data=new re({xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax});else if(t.copy)this.m_data=new re,t.copy.copyTo(this);else if(t.move)this.m_description=t.move.m_description,t.move.m_description=null,this.m_data=new re({move:t.move.m_data});else{if(!t.centerPoint)throw new Error("unrecognized Envelope constructor options");this.m_description=t.centerPoint.getDescription(),this.m_data=new re,this.ensureAttributes_(),this.setFromPoint(t.centerPoint,t.width,t.height)}}accessEnvelopeData(){return this.m_description=null,this.m_data}assignMove(t){return this===t||(this.m_description=t.m_description,t.m_description=null,this.m_data=new re({move:t.m_data})),this}assignCopy(t){return this===t||t.copyTo(this),this}transformAttribute(t,e,s,i,n){p(0)}setAttributeBasic(t,e,s){if(this.addAttribute(t),this.m_data.isEmpty())return;const i=this.queryInterval(t,e);i.vmin=s,i.vmax=s,this.setIntervalEnvelope(t,e,i)}mergeVertexDescriptionImpl(t){const e=H(this.getDescription(),t);this.assignVertexDescription(e)}asEnvelope2D(){return new I(this.m_data.m_envelope2D)}assignVertexDescription(t){this.m_description!==t&&this.assignVertexDescriptionImpl(t)}getGeometryType(){return v.enumEnvelope}getDimension(){return 2}getXMin(){return this.m_data.m_envelope2D.xmin}getYMin(){return this.m_data.m_envelope2D.ymin}getXMax(){return this.m_data.m_envelope2D.xmax}getYMax(){return this.m_data.m_envelope2D.ymax}width(){return this.m_data.isEmpty()?Number.NaN:this.m_data.m_envelope2D.width()}height(){return this.m_data.isEmpty()?Number.NaN:this.m_data.m_envelope2D.height()}getCenterXY(){return this.m_data.isEmpty()?new a:this.m_data.m_envelope2D.getCenter()}getCenter(t){if(t.assignVertexDescription(this.m_description),this.m_data.isEmpty())return void t.setEmpty();const e=this.m_description.getAttributeCount();for(let s=1;s<e;s++){const e=this.m_description.getSemantics(s),i=ie.getComponentCount(e);for(let s=0;s<i;s++){const i=.5*(this.getAttributeAsDblImpl(0,e,s)+this.getAttributeAsDblImpl(1,e,s));t.setAttributeBasic(e,s,i)}}t.setXY(this.m_data.m_envelope2D.getCenter())}setCoords(t,e,s,i){this.m_data.m_envelope2D.setCoords({xmin:t,ymin:e,xmax:s,ymax:i})}setEnvelope(t){if(t instanceof I)this.m_data.m_envelope2D=new I(t),this.m_data.m_envelope2D.normalize();else{this.addAttribute(1),this.m_data.m_envelope2D=t.getEnvelope2D(),this.m_data.m_envelope2D.normalize();const e=r.constructEmpty();e.setCoords(t.zmin,t.zmax),this.setInterval(1,0,e.vmin,e.vmax)}}merge(e){if(e instanceof I)return e.isValid()||g(""),void this.m_data.m_envelope2D.mergeEnvelope2D(e);if(e instanceof t){if(e.m_data.isEmpty())return;const t=e.getDescription();this.mergeVertexDescription(t),this.m_data.m_envelope2D.mergeEnvelope2D(e.m_data.m_envelope2D);for(let s=1,i=t.getAttributeCount();s<i;s++){const i=t.getSemantics(s),n=ie.getComponentCount(i);for(let t=0;t<n;t++){const s=e.queryInterval(i,t),n=this.queryInterval(i,t);n.merge(s),this.setIntervalEnvelope(i,t,n)}}return}if(e instanceof se){const t=e;if(t.isEmpty())return;const s=t.getDescription();if(this.mergeVertexDescription(s),this.m_data.isEmpty())return void this.setFromPoint(t);this.m_data.m_envelope2D.merge(t.getXY());for(let e=1,i=s.getAttributeCount();e<i;e++){const i=s.getSemantics(e),n=ie.getComponentCount(i);for(let e=0;e<n;e++){const s=t.getAttributeAsDbl(i,e),n=this.queryInterval(i,e);n.mergeCoordinate(s),this.setIntervalEnvelope(i,e,n)}}return}y("unrecognized type for envelope.merge")}intersect(t){if(!this.m_data.m_envelope2D.intersect(t.m_data.m_envelope2D))return this.setEmpty(),!1;const e=t.getDescription();this.mergeVertexDescription(e);for(let s=1,i=this.m_description.getAttributeCount();s<i;s++){const e=this.m_description.getSemantics(s),i=ie.getComponentCount(e);for(let s=0;s<i;s++){const i=t.queryInterval(e,s),n=this.queryInterval(e,s);n.intersect(i),this.setIntervalEnvelope(e,s,n)}}return!0}intersectCommonAttributes(t){if(!this.m_data.m_envelope2D.intersect(t.m_data.m_envelope2D))return this.setEmpty(),!1;const e=t.getDescription();for(let s=1,i=this.m_description.getAttributeCount();s<i;s++){const i=this.m_description.getSemantics(s);if(!e.hasAttribute(i))continue;const n=ie.getComponentCount(i);for(let e=0;e<n;e++){const s=t.queryInterval(i,e),n=this.queryInterval(i,e);n.intersect(s),this.setIntervalEnvelope(i,e,n)}}return!0}move(t,e){this.m_data.m_envelope2D.move(t,e)}centerAt(t,e){this.m_data.m_envelope2D.centerAtCoords(t,e)}centerAtPoint(t){this.m_data.m_envelope2D.centerAt(t)}reaspect(t,e){this.m_data.m_envelope2D.reaspect(t,e)}inflateCoords(t,e){this.m_data.m_envelope2D.inflateCoords(t,e)}containsCoords(t,e){return this.m_data.m_envelope2D.containsCoords(t,e)}contains(t){return this.m_data.m_envelope2D.contains(t)}containsPoint(t){return!t.isEmpty()&&this.m_data.m_envelope2D.contains(t.getXY())}containsEnvelope(t){return this.m_data.m_envelope2D.containsEnvelope(t.m_data.m_envelope2D)}setIntervalEnvelope(t,e,s){if(this.addAttribute(t),this.m_data.isEmpty())return;const i=new r(s);if(i.normalize(),0===t){if(i.isEmpty())return void this.setEmpty();0===e?(this.m_data.m_envelope2D.xmin=i.vmin,this.m_data.m_envelope2D.xmax=i.vmax):1===e?(this.m_data.m_envelope2D.ymin=i.vmin,this.m_data.m_envelope2D.ymax=i.vmax):f("")}else this.setAttributeAsDblImpl(0,t,e,i.vmin),this.setAttributeAsDblImpl(1,t,e,i.vmax)}setInterval(t,e,s,i){this.setIntervalEnvelope(t,e,new r(s,i))}queryInterval(t,e){const s=new r;return this.m_data.queryInterval(this.m_description,t,e,s),s}queryEnvelope(t){2!==t.m_EnvelopeType?3!==t.m_EnvelopeType?4!==t.m_EnvelopeType?y("unrecognized type for queryEnveloper"):this.copyTo(t):this.m_data.queryEnvelope3D(this.m_description,t):t.setCoords({env2D:this.m_data.m_envelope2D})}applyTransformation(t){1!==t.m_TransformationType?p(0):t.transformEnvInPlace(this.m_data.m_envelope2D)}createInstance(){return new t({vd:this.m_description})}copyTo(t){t!==this&&this.m_data.copyTo(this.m_description,t)}isEmpty(){return this.m_data.isEmpty()}setEmpty(){this.m_description||(this.m_description=M()),this.m_data.setEmpty(this.m_description)}calculateArea2D(){return this.m_data.m_envelope2D.getArea()}calculateLength2D(){return this.m_data.m_envelope2D.getLength()}calculateLength3D(t){return p(0),0}equals(t,e){if(t===this)return!0;const s=t;if(this.m_description!==s.m_description)return!1;if(this.m_data.isEmpty()!==s.m_data.isEmpty())return!1;if(this.m_data.isEmpty())return!0;if(void 0===e&&(e=0),Math.abs(this.m_data.m_envelope2D.xmin-s.m_data.m_envelope2D.xmin)>e)return!1;if(Math.abs(this.m_data.m_envelope2D.ymin-s.m_data.m_envelope2D.ymin)>e)return!1;if(Math.abs(this.m_data.m_envelope2D.xmax-s.m_data.m_envelope2D.xmax)>e)return!1;if(Math.abs(this.m_data.m_envelope2D.ymax-s.m_data.m_envelope2D.ymax)>e)return!1;for(let n=0,r=2*(this.m_description.getTotalComponentCount()-2);n<r;n++)if(!i(this.m_data.m_attributes[n],s.m_data.m_attributes[n],e))return!1;return!0}getBoundary(){return y("getBoundary not available in this context. Use the boundary operator with an envelope parameter"),null}clone(){return new t({copy:this})}swap(t){if(this===t)return;t.getGeometryType()!==v.enumEnvelope&&g("wrong geometry type");const e=t;e.m_description=o(this.m_description,this.m_description=e.m_description),e.m_data.m_envelope2D=o(this.m_data.m_envelope2D,this.m_data.m_envelope2D=e.m_data.m_envelope2D),e.m_data.m_attributes=o(this.m_data.m_attributes,this.m_data.m_attributes=e.m_data.m_attributes)}queryCoordinates(t){this.m_data.isEmpty()&&g(""),this.m_data.m_envelope2D.queryCorners(t)}queryCornerByVal(t,e){(t<0||t>3)&&f(""),e.assignVertexDescription(this.m_description);const s=this.getDescription().getAttributeCount();for(let i=1;i<s;i++){const s=this.m_description.getSemantics(i),n=ie.getComponentCount(s);for(let i=0;i<n;i++)e.setAttributeBasic(s,i,this.getAttributeAsDblImpl(t%2,s,i))}e.setXY(this.m_data.m_envelope2D.queryCorner(t))}queryCorner(t,e){e.assign(this.m_data.m_envelope2D.queryCorner(t))}getDescription(){return this.m_description}mergeVertexDescription(t){this.m_description!==t&&(this.m_description&&this.m_description.hasAttributesFrom(t)||this.mergeVertexDescriptionImpl(t))}hasAttribute(t){return this.m_description.hasAttribute(t)}addAttribute(t){if(this.m_description.hasAttribute(t))return;const e=V(this.m_description,t);this.assignVertexDescription(e)}dropAttribute(t){if(!this.m_description.hasAttribute(t))return;const e=k(this.m_description,t);this.assignVertexDescription(e)}dropAllAttributes(){const t=M();t!==this.m_description&&this.assignVertexDescription(t)}queryLooseEnvelope(t){this.queryEnvelope(t)}replaceNaNs(t,e){if(this.addAttribute(t),this.m_data.isEmpty())return;const s=ie.getComponentCount(t);for(let i=0;i<s;i++){const s=this.queryInterval(t,i);s.isEmpty()&&(s.vmin=e,s.vmax=e,this.setIntervalEnvelope(t,i,s))}}getImpl(){return this}setFromPoint(t,e,s){this.m_data.m_envelope2D.setCoords({center:t.getXY(),width:e??0,height:s??0});const i=t.getDescription();for(let n=1,r=i.getAttributeCount();n<r;n++){const e=i.getSemantics(n),s=ie.getComponentCount(e);for(let i=0;i<s;i++){const s=t.getAttributeAsDbl(e,i);this.setInterval(e,i,s,s)}}}assignVertexDescriptionImpl(t){const s=S();Y(t,this.m_description,s);let i=null;const n=t.getTotalComponentCount()-2,r=this.m_description?this.m_description.getTotalComponentCount()-2:0;n>0&&(i=e(2*n,Number.NaN));for(let e=1;e<t.getAttributeCount();e++){const o=s[e];if(-1!==o){const s=t.getPointAttributeOffset(e)-2,a=ie.getComponentCount(t.getSemantics(e)),h=this.m_description.getPointAttributeOffset(o)-2;m(i,this.m_data.m_attributes,s,h,a),m(i,this.m_data.m_attributes,n+s,r+h,a)}}this.releaseAttributes_(),this.m_data.m_attributes=i,this.m_description=t}getAttributeAsDblImpl(t,e,s){if(this.m_data.isEmpty()&&x(""),0===e)return t?s?this.m_data.m_envelope2D.ymax:this.m_data.m_envelope2D.xmax:s?this.m_data.m_envelope2D.ymin:this.m_data.m_envelope2D.xmin;s>=ie.getComponentCount(e)&&f("");const i=this.m_description.getAttributeIndex(e);return i>=0?this.m_data.m_attributes[ne(this.m_description,t)+this.m_description.getPointAttributeOffset(i)-2+s]:z.getDefaultValue(e)}setAttributeAsDblImpl(t,e,s,i){0===e&&(t?1===s?this.m_data.m_envelope2D.ymax=i:0===s?this.m_data.m_envelope2D.xmax=i:f(""):1===s?this.m_data.m_envelope2D.ymin=i:0===s?this.m_data.m_envelope2D.xmin=i:f(""));const n=ie.getComponentCount(e);(s<0||s>=n)&&f(""),this.addAttribute(e);const r=this.m_description.getAttributeIndex(e);this.m_data.m_attributes[ne(this.m_description,t)+this.m_description.getPointAttributeOffset(r)-2+s]=i}releaseAttributes_(){this.m_data.releaseAttributes()}ensureAttributes_(){this.m_data.ensureAttributes(this.m_description)}};const ae=Object.freeze(Object.defineProperty({__proto__:null,Envelope:oe,EnvelopeData:re},Symbol.toStringTag,{value:"Module"}));export{Gt as $,nt as A,ht as B,Et as C,J as D,oe as E,K as F,$ as G,Jt as H,jt as I,At as J,Tt as K,Rt as L,Q as M,St as N,w as O,se as P,Xt as Q,gt as R,mt as S,pt as T,Ht as U,z as V,Bt as W,Ot as X,Vt as Y,wt as Z,Kt as _,st as a,Zt as a0,Qt as a1,Ut as a2,xt as a3,Nt as a4,te as a5,ct as a6,U as a7,ae as a8,et as b,qt as c,Lt as d,zt as e,Pt as f,Ct as g,It as h,Yt as i,kt as j,X as k,M as l,re as m,H as n,V as o,G as p,B as q,k as r,Mt as s,S as t,Y as u,j as v,W as w,Dt as x,at as y,O as z};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{t as i,a as t}from"./Geometry.js";import{P as s,m,s as h,g as x}from"./Point2D.js";class n{static construct(i,t,s,m){return new n(i,t,s,m)}constructor(i,t,s,m){this.m_EnvelopeType=2,void 0===i?(this.xmin=Number.NaN,this.ymin=Number.NaN,this.xmax=Number.NaN,this.ymax=Number.NaN):"number"==typeof i?(this.xmin=i,this.ymin=t,this.xmax=s,this.ymax=m):(this.xmin=i.xmin,this.ymin=i.ymin,this.xmax=i.xmax,this.ymax=i.ymax),this.normalize()}static constructEmpty(){return new n(Number.NaN,Number.NaN,Number.NaN,Number.NaN)}clone(){return new n(this)}assign(i){return this.xmin=i.xmin,this.xmax=i.xmax,this.ymin=i.ymin,this.ymax=i.ymax,this}width(){return this.xmax-this.xmin}height(){return this.ymax-this.ymin}maxDimension(){return Math.max(this.width(),this.height())}minDimension(){return Math.min(this.width(),this.height())}sqrDiagonal(){const i=this.width(),t=this.height();return i*i+t*t}diagonal(){return Math.sqrt(this.sqrDiagonal())}getCenterX(){return.5*(this.xmin+this.xmax)}getCenterY(){return.5*(this.ymin+this.ymax)}getCenter(){return s.construct(this.getCenterX(),this.getCenterY())}queryCenter(i){i.x=.5*(this.xmin+this.xmax),i.y=.5*(this.ymin+this.ymax)}setEmpty(){this.xmin=Number.NaN,this.ymin=Number.NaN,this.xmax=Number.NaN,this.ymax=Number.NaN}setInfinite(){this.xmin=Number.NEGATIVE_INFINITY,this.xmax=Number.POSITIVE_INFINITY,this.ymin=Number.NEGATIVE_INFINITY,this.ymax=Number.POSITIVE_INFINITY}isDegenerate(i){return!this.isEmpty()&&(this.width()<=i||this.height()<=i)}isZero(){return!(this.isEmpty()||this.width()&&this.height())}isEmpty(){return Number.isNaN(this.xmin)||Number.isNaN(this.ymin)||Number.isNaN(this.xmax)||Number.isNaN(this.ymax)}mergeNeCoords(i,t){this.xmin>i?this.xmin=i:this.xmax<i&&(this.xmax=i),this.ymin>t?this.ymin=t:this.ymax<t&&(this.ymax=t)}mergeNe(i){this.mergeNeCoords(i.x,i.y)}mergeCoords(i,t){this.isEmpty()?(this.xmin=i,this.ymin=t,this.xmax=i,this.ymax=t):(this.xmin>i?this.xmin=i:this.xmax<i&&(this.xmax=i),this.ymin>t?this.ymin=t:this.ymax<t&&(this.ymax=t))}merge(i){this.mergeCoords(i.x,i.y)}mergeEnvelope2D(i){i.isEmpty()||(this.mergeCoords(i.xmin,i.ymin),this.mergeNeCoords(i.xmax,i.ymax))}mergePoints(i,t){for(let s=0;s<t;){if(!this.isEmpty()){for(let m=s;m<t;m++)this.mergeNe(i[m]);break}this.setCoords(i[s]),s++}}mergePointsInterleaved(i,t,s){for(let m=2*t,h=m+2*s;m<h;m+=2)this.mergeCoords(i.read(m),i.read(m+1))}inflateCoords(i,t){this.isEmpty()||(this.xmin-=i,this.xmax+=i,this.ymin-=t,this.ymax+=t,(this.xmin>this.xmax||this.ymin>this.ymax)&&this.setEmpty())}getInflatedCoords(i,t){const s=this.clone();return s.inflateCoords(i,t),s}inflate(i){this.inflateCoords(i,i)}getInflated(i){const t=this.clone();return t.inflateCoords(i,i),t}zoom(i,t){this.isEmpty()||this.setCoords({center:this.getCenter(),width:i*this.width(),height:t*this.height()})}scale(i){i<0&&this.setEmpty(),this.xmin*=i,this.xmax*=i,this.ymin*=i,this.ymax*=i}equals(i,t){return!(!this.isEmpty()||!i.isEmpty())||(t?Math.abs(this.xmin-i.xmin)<=t&&Math.abs(this.ymin-i.ymin)<=t&&Math.abs(this.xmax-i.xmax)<=t&&Math.abs(this.ymax-i.ymax)<=t:this.xmin===i.xmin&&this.ymin===i.ymin&&this.xmax===i.xmax&&this.ymax===i.ymax)}setCoords(t){void 0!==t.xmin?(this.xmin=t.xmin,this.xmax=t.xmax,this.ymin=t.ymin,this.ymax=t.ymax):void 0!==t.x?(this.xmin=t.x,this.xmax=t.x,this.ymin=t.y,this.ymax=t.y):void 0!==t.pt1?(this.xmin=t.pt1.x,this.ymin=t.pt1.y,this.xmax=t.pt2.x,this.ymax=t.pt2.y,this.normalize()):void 0!==t.env2D?(this.xmin=t.env2D.xmin,this.xmax=t.env2D.xmax,this.ymin=t.env2D.ymin,this.ymax=t.env2D.ymax,this.normalize()):void 0!==t.pt?(this.xmin=t.pt.x,this.xmax=t.pt.x,this.ymin=t.pt.y,this.ymax=t.pt.y):void 0!==t.center?(this.xmin=t.center.x-.5*t.width,this.xmax=this.xmin+t.width,this.ymin=t.center.y-.5*t.height,this.ymax=this.ymin+t.height,this.normalize()):i("unrecognized input type for setCoords"),this.normalize()}queryIntervalX(i){this.isEmpty()?i.setEmpty():i.setCoords(this.xmin,this.xmax)}queryIntervalY(i){this.isEmpty()?i.setEmpty():i.setCoords(this.ymin,this.ymax)}setFromPoints(i,t){if(0===t)return void this.setEmpty();if(Array.isArray(i)){const s=i;this.setCoords(s[0]);for(let i=1;i<t;){if(!this.isEmpty()){for(let m=i;m<t;m++)this.mergeNe(s[m]);return}this.setCoords(s[i]),i++}return}const s=i;this.setCoords({x:s[0],y:s[1]});for(let m=1,h=2*t;m<h;m+=2){if(!this.isEmpty()){for(let i=m,h=2*t;i<h;i+=2)this.mergeNeCoords(s[i],s[i+1]);return}this.setCoords({x:s[m],y:s[m+1]}),m+=2}}normalize(){let i=!1;this.xmin<=this.xmax||([this.xmin,this.xmax]=[this.xmax,this.xmin],i=!0),this.ymin<=this.ymax||([this.ymin,this.ymax]=[this.ymax,this.ymin],i=!0),!i||this.xmin<=this.xmax&&this.ymin<=this.ymax||this.setEmpty()}isValid(){return this.isEmpty()||this.xmin<=this.xmax&&this.ymin<=this.ymax}getLowerLeft(){return new s(this.xmin,this.ymin)}getLowerRight(){return new s(this.xmax,this.ymin)}getUpperLeft(){return new s(this.xmin,this.ymax)}getUpperRight(){return new s(this.xmax,this.ymax)}move(i,t){this.isEmpty()||(this.xmin+=i,this.ymin+=t,this.xmax+=i,this.ymax+=t)}centerAtCoords(i,t){this.move(i-this.getCenterX(),t-this.getCenterY())}centerAt(i){this.centerAtCoords(i.x,i.y)}containsCoords(i,t){return i>=this.xmin&&i<=this.xmax&&t>=this.ymin&&t<=this.ymax}contains(i){return this.containsCoords(i.x,i.y)}containsEnvelope(i){return i.xmin>=this.xmin&&i.xmax<=this.xmax&&i.ymin>=this.ymin&&i.ymax<=this.ymax}containsExclusiveCoords(i,t){return i>this.xmin&&i<this.xmax&&t>this.ymin&&t<this.ymax}containsExclusive(i){return this.containsExclusiveCoords(i.x,i.y)}containsExclusiveEnvelope(i){return i.xmin>this.xmin&&i.xmax<this.xmax&&i.ymin>this.ymin&&i.ymax<this.ymax}isIntersecting(i){return(this.xmin<=i.xmin?this.xmax>=i.xmin:i.xmax>=this.xmin)&&(this.ymin<=i.ymin?this.ymax>=i.ymin:i.ymax>=this.ymin)}isIntersectingNe(i){return(this.xmin<=i.xmin?this.xmax>=i.xmin:i.xmax>=this.xmin)&&(this.ymin<=i.ymin?this.ymax>=i.ymin:i.ymax>=this.ymin)}intersect(i){if(this.isEmpty())return!1;if(i.isEmpty())return this.setEmpty(),!1;i.xmin>this.xmin&&(this.xmin=i.xmin),i.xmax<this.xmax&&(this.xmax=i.xmax),i.ymin>this.ymin&&(this.ymin=i.ymin),i.ymax<this.ymax&&(this.ymax=i.ymax);const t=this.xmin<=this.xmax&&this.ymin<=this.ymax;return t||this.setEmpty(),t}queryCorner(i){switch(3&i){case 0:return new s(this.xmin,this.ymin);case 1:return new s(this.xmin,this.ymax);case 2:return new s(this.xmax,this.ymax);default:return new s(this.xmax,this.ymin)}}queryCorners(i){i[0].setCoords(this.xmin,this.ymin),i[1].setCoords(this.xmin,this.ymax),i[2].setCoords(this.xmax,this.ymax),i[3].setCoords(this.xmax,this.ymin)}queryCornersReversed(i){i[0].setCoords(this.xmin,this.ymin),i[1].setCoords(this.xmax,this.ymin),i[2].setCoords(this.xmax,this.ymax),i[3].setCoords(this.xmin,this.ymax)}reaspect(i,t){if(this.isEmpty())return;const s=i/t,m=.5*this.width(),h=.5*this.height()*s;if(m<=h){const i=this.getCenterX();this.xmin=i-h,this.xmax=i+h}else{const i=m/s,t=this.getCenterY();this.ymin=t-i,this.ymax=t+i}this.normalize()}getArea(){return this.isEmpty()?0:this.width()*this.height()}getLength(){return this.isEmpty()?0:2*(this.width()+this.height())}clipCode(i){return(i.x<this.xmin?1:0)|(i.x>this.xmax?1:0)<<1|(i.y<this.ymin?1:0)<<2|(i.y>this.ymax?1:0)<<3}clipLine(i,t){let s=this.clipCode(i),m=this.clipCode(t);if(s&m)return 0;if(!(s|m))return 4;const h=(s?1:0)|(m?2:0);do{const h=t.x-i.x,x=t.y-i.y;if(Math.abs(h)>Math.abs(x)?s&n.XMASK?(s&n.XLESSXMIN?(i.y+=x*(this.xmin-i.x)/h,i.x=this.xmin):(i.y+=x*(this.xmax-i.x)/h,i.x=this.xmax),s=this.clipCode(i)):m&n.XMASK?(m&n.XLESSXMIN?(t.y+=x*(this.xmin-t.x)/h,t.x=this.xmin):(t.y+=x*(this.xmax-t.x)/h,t.x=this.xmax),m=this.clipCode(t)):s?(s&n.YLESSYMIN?(i.x+=h*(this.ymin-i.y)/x,i.y=this.ymin):(i.x+=h*(this.ymax-i.y)/x,i.y=this.ymax),s=this.clipCode(i)):(m&n.YLESSYMIN?(t.x+=h*(this.ymin-t.y)/x,t.y=this.ymin):(t.x+=h*(this.ymax-t.y)/x,t.y=this.ymax),m=this.clipCode(t)):s&n.YMASK?(s&n.YLESSYMIN?(i.x+=h*(this.ymin-i.y)/x,i.y=this.ymin):(i.x+=h*(this.ymax-i.y)/x,i.y=this.ymax),s=this.clipCode(i)):m&n.YMASK?(m&n.YLESSYMIN?(t.x+=h*(this.ymin-t.y)/x,t.y=this.ymin):(t.x+=h*(this.ymax-t.y)/x,t.y=this.ymax),m=this.clipCode(t)):s?(s&n.XLESSXMIN?(i.y+=x*(this.xmin-i.x)/h,i.x=this.xmin):(i.y+=x*(this.xmax-i.x)/h,i.x=this.xmax),s=this.clipCode(i)):(m&n.XLESSXMIN?(t.y+=x*(this.xmin-t.x)/h,t.x=this.xmin):(t.y+=x*(this.xmax-t.x)/h,t.x=this.xmax),m=this.clipCode(t)),s&m)return 0}while(s|m);return h}distanceFromEnvelope(i){return Math.sqrt(this.sqrDistanceEnvelope(i,null,null))}distance(i){return Math.sqrt(this.sqrDistance(i))}sqrDistanceEnvelope(i,t,s){if(!t&&!s){if(this.isEmpty()||i.isEmpty())return Number.NaN;let t,s=0,m=0;return t=this.xmin-i.xmax,t>s&&(s=t),t=this.ymin-i.ymax,t>m&&(m=t),t=i.xmin-this.xmax,t>s&&(s=t),t=i.ymin-this.ymax,t>m&&(m=t),s*s+m*m}if(this.isEmpty()||i.isEmpty())return t&&t.setNAN(),s&&s.setNAN(),Number.NaN;let m,h=0,x=0;const n=Math.max(this.xmin,i.xmin),e=Math.max(this.ymin,i.ymin);return t&&t.setCoords(n,e),s&&s.setCoords(n,e),m=this.xmin-i.xmax,m>h&&(h=m,t&&(t.x=this.xmin),s&&(s.x=i.xmax)),m=this.ymin-i.ymax,m>x&&(x=m,t&&(t.y=this.ymin),s&&(s.y=i.ymax)),m=i.xmin-this.xmax,m>h&&(h=m,t&&(t.x=this.xmax),s&&(s.x=i.xmin)),m=i.ymin-this.ymax,m>x&&(x=m,t&&(t.y=this.ymax),s&&(s.y=i.ymin)),h*h+x*x}sqrDistance(i,t){if(void 0===t){if(this.isEmpty()||i.isNAN())return Number.NaN;let t,s=0,m=0;return t=this.xmin-i.x,t>s&&(s=t),t=this.ymin-i.y,t>m&&(m=t),t=i.x-this.xmax,t>s&&(s=t),t=i.y-this.ymax,t>m&&(m=t),s*s+m*m}if(this.isEmpty()||i.isNAN())return t.setNAN(),Number.NaN;t.assign(i);let s,m=0,h=0;return s=this.xmin-i.x,s>m&&(m=s,t.x=this.xmin),s=this.ymin-i.y,s>h&&(h=s,t.y=this.ymin),s=i.x-this.xmax,s>m&&(m=s,t.x=this.xmax),s=i.y-this.ymax,s>h&&(h=s,t.y=this.ymax),m*m+h*h}sqrMaxMinDistanceEnvelope(i){if(this.isEmpty()||i.isEmpty())return Number.NaN;let t=Number.MAX_VALUE;{const m=s.sqrDistanceCoords(this.xmin,this.ymin,i.xmax,i.ymin),h=s.sqrDistanceCoords(this.xmin,this.ymin,i.xmax,i.ymax),x=s.sqrDistanceCoords(this.xmin,this.ymax,i.xmax,i.ymin),n=s.sqrDistanceCoords(this.xmin,this.ymax,i.xmax,i.ymax),e=Math.max(m,h),a=Math.max(x,n),r=Math.max(e,a);t=Math.min(r,t)}{const m=s.sqrDistanceCoords(this.xmin,this.ymin,i.xmin,i.ymax),h=s.sqrDistanceCoords(this.xmin,this.ymin,i.xmax,i.ymax),x=s.sqrDistanceCoords(this.xmax,this.ymin,i.xmin,i.ymax),n=s.sqrDistanceCoords(this.xmax,this.ymin,i.xmax,i.ymax),e=Math.max(m,h),a=Math.max(x,n),r=Math.max(e,a);t=Math.min(r,t)}{const m=s.sqrDistanceCoords(this.xmax,this.ymin,i.xmin,i.ymin),h=s.sqrDistanceCoords(this.xmax,this.ymin,i.xmin,i.ymax),x=s.sqrDistanceCoords(this.xmax,this.ymax,i.xmin,i.ymin),n=s.sqrDistanceCoords(this.xmax,this.ymax,i.xmin,i.ymax),e=Math.max(m,h),a=Math.max(x,n),r=Math.max(e,a);t=Math.min(r,t)}{const m=s.sqrDistanceCoords(this.xmin,this.ymax,i.xmin,i.ymin),h=s.sqrDistanceCoords(this.xmin,this.ymax,i.xmax,i.ymin),x=s.sqrDistanceCoords(this.xmax,this.ymax,i.xmin,i.ymin),n=s.sqrDistanceCoords(this.xmax,this.ymax,i.xmax,i.ymin),e=Math.max(m,h),a=Math.max(x,n),r=Math.max(e,a);t=Math.min(r,t)}return t}sqrMaxDistanceEnvelope(i){if(this.isEmpty()||i.isEmpty())return Number.NaN;let t=0;const h=m(s,4);this.queryCorners(h);const x=m(s,4);i.queryCorners(x);for(let m=0;m<4;m++)for(let i=0;i<4;i++){const n=s.sqrDistance(h[m],x[i]);n>t&&(t=n)}return t}sqrMaxMinDistance(i){const t=s.sqrDistance(i,this.getLowerLeft()),m=s.sqrDistance(i,this.getUpperLeft()),h=s.sqrDistance(i,this.getLowerRight()),x=s.sqrDistance(i,this.getUpperRight());let n,e=Math.max(t,m);return n=Math.max(t,h),e>n&&(e=n),n=Math.max(m,x),e>n&&(e=n),n=Math.max(h,x),e>n&&(e=n),e}sqrMinDistance(i){if(this.contains(i))return 0;return this.sqrDistance(i)}sqrMaxDistance(i){let t=s.sqrDistance(i,this.getLowerLeft());return t=Math.max(s.sqrDistance(i,this.getUpperLeft()),t),t=Math.max(s.sqrDistance(i,this.getUpperRight()),t),t=Math.max(s.sqrDistance(i,this.getLowerRight()),t),t}snapToBoundary(i){if(i.isNAN())return!1;if(this.isEmpty())return i.setNAN(),!0;let t=!0;if(i.x<this.xmin?i.x=this.xmin:i.x>this.xmax?i.x=this.xmax:t=!1,i.y<this.ymin?i.y=this.ymin:i.y>this.ymax?i.y=this.ymax:t=!1,t)return!0;if(i.x===this.xmin||i.x===this.xmax||i.y===this.ymin||i.y===this.ymax)return!1;const s=this.xmax-i.x,m=i.x-this.xmin,h=this.ymax-i.y,x=i.y-this.ymin;return Math.max(s,m)>Math.max(h,x)?i.y=x<h?this.ymin:this.ymax:i.x=m<s?this.xmin:this.xmax,!0}snapClip(i){const t=h(i.x,this.xmin,this.xmax),m=h(i.y,this.ymin,this.ymax);return s.construct(t,m)}boundaryDistance(i){if(this.isEmpty()||i.isNAN())return Number.NaN;if(i.x===this.xmin)return i.y-this.ymin;const t=this.ymax-this.ymin,m=this.xmax-this.xmin;if(i.y===this.ymax)return t+i.x-this.xmin;if(i.x===this.xmax)return t+m+this.ymax-i.y;if(i.y===this.ymin)return 2*t+m+this.xmax-i.x;const h=new s;return h.setCoordsPoint2D(i),this.snapToBoundary(h),this.boundaryDistance(h)}envelopeSide(i){if(this.isEmpty())return-1;let t=this.boundaryDistance(i);const s=this.ymax-this.ymin,m=this.xmax-this.xmin;return t<s?0:(t-=s)<m?1:t-m<s?2:3}querySide(i,s){switch(i){case 0:s.constructFromCoords(this.xmin,this.ymin,this.xmin,this.ymax);break;case 1:s.constructFromCoords(this.xmin,this.ymax,this.xmax,this.ymax);break;case 2:s.constructFromCoords(this.xmax,this.ymax,this.xmax,this.ymin);break;case 3:s.constructFromCoords(this.xmax,this.ymin,this.xmin,this.ymin);break;default:t("query_side")}return s}isPointOnBoundary(i,t){return Math.abs(i.x-this.xmin)<=t||Math.abs(i.x-this.xmax)<=t||Math.abs(i.y-this.ymin)<=t||Math.abs(i.y-this.ymax)<=t}calculateToleranceFromEnvelope(){if(this.isEmpty())return x();return(Math.abs(this.xmin)+Math.abs(this.xmax)+Math.abs(this.ymin)+Math.abs(this.ymax)+1)*x()}toString(){return`[${this.xmin}, ${this.ymin}, ${this.xmax}, ${this.ymax}]`}}n.XLESSXMIN=1,n.YLESSYMIN=4,n.XMASK=3,n.YMASK=12;export{n as Envelope2D};
2
+ import{t as i,a as t}from"./Geometry.js";import{P as s,m,s as h,g as x}from"./Point2D.js";class n{m_EnvelopeType=2;xmin;ymin;xmax;ymax;static construct(i,t,s,m){return new n(i,t,s,m)}constructor(i,t,s,m){void 0===i?(this.xmin=Number.NaN,this.ymin=Number.NaN,this.xmax=Number.NaN,this.ymax=Number.NaN):"number"==typeof i?(this.xmin=i,this.ymin=t,this.xmax=s,this.ymax=m):(this.xmin=i.xmin,this.ymin=i.ymin,this.xmax=i.xmax,this.ymax=i.ymax),this.normalize()}static constructEmpty(){return new n(Number.NaN,Number.NaN,Number.NaN,Number.NaN)}clone(){return new n(this)}assign(i){return this.xmin=i.xmin,this.xmax=i.xmax,this.ymin=i.ymin,this.ymax=i.ymax,this}width(){return this.xmax-this.xmin}height(){return this.ymax-this.ymin}maxDimension(){return Math.max(this.width(),this.height())}minDimension(){return Math.min(this.width(),this.height())}sqrDiagonal(){const i=this.width(),t=this.height();return i*i+t*t}diagonal(){return Math.sqrt(this.sqrDiagonal())}getCenterX(){return.5*(this.xmin+this.xmax)}getCenterY(){return.5*(this.ymin+this.ymax)}getCenter(){return s.construct(this.getCenterX(),this.getCenterY())}queryCenter(i){i.x=.5*(this.xmin+this.xmax),i.y=.5*(this.ymin+this.ymax)}setEmpty(){this.xmin=Number.NaN,this.ymin=Number.NaN,this.xmax=Number.NaN,this.ymax=Number.NaN}setInfinite(){this.xmin=Number.NEGATIVE_INFINITY,this.xmax=Number.POSITIVE_INFINITY,this.ymin=Number.NEGATIVE_INFINITY,this.ymax=Number.POSITIVE_INFINITY}isDegenerate(i){return!this.isEmpty()&&(this.width()<=i||this.height()<=i)}isZero(){return!(this.isEmpty()||this.width()&&this.height())}isEmpty(){return Number.isNaN(this.xmin)||Number.isNaN(this.ymin)||Number.isNaN(this.xmax)||Number.isNaN(this.ymax)}mergeNeCoords(i,t){this.xmin>i?this.xmin=i:this.xmax<i&&(this.xmax=i),this.ymin>t?this.ymin=t:this.ymax<t&&(this.ymax=t)}mergeNe(i){this.mergeNeCoords(i.x,i.y)}mergeCoords(i,t){this.isEmpty()?(this.xmin=i,this.ymin=t,this.xmax=i,this.ymax=t):(this.xmin>i?this.xmin=i:this.xmax<i&&(this.xmax=i),this.ymin>t?this.ymin=t:this.ymax<t&&(this.ymax=t))}merge(i){this.mergeCoords(i.x,i.y)}mergeEnvelope2D(i){i.isEmpty()||(this.mergeCoords(i.xmin,i.ymin),this.mergeNeCoords(i.xmax,i.ymax))}mergePoints(i,t){for(let s=0;s<t;){if(!this.isEmpty()){for(let m=s;m<t;m++)this.mergeNe(i[m]);break}this.setCoords(i[s]),s++}}mergePointsInterleaved(i,t,s){for(let m=2*t,h=m+2*s;m<h;m+=2)this.mergeCoords(i.read(m),i.read(m+1))}inflateCoords(i,t){this.isEmpty()||(this.xmin-=i,this.xmax+=i,this.ymin-=t,this.ymax+=t,(this.xmin>this.xmax||this.ymin>this.ymax)&&this.setEmpty())}getInflatedCoords(i,t){const s=this.clone();return s.inflateCoords(i,t),s}inflate(i){this.inflateCoords(i,i)}getInflated(i){const t=this.clone();return t.inflateCoords(i,i),t}zoom(i,t){this.isEmpty()||this.setCoords({center:this.getCenter(),width:i*this.width(),height:t*this.height()})}scale(i){i<0&&this.setEmpty(),this.xmin*=i,this.xmax*=i,this.ymin*=i,this.ymax*=i}equals(i,t){return!(!this.isEmpty()||!i.isEmpty())||(t?Math.abs(this.xmin-i.xmin)<=t&&Math.abs(this.ymin-i.ymin)<=t&&Math.abs(this.xmax-i.xmax)<=t&&Math.abs(this.ymax-i.ymax)<=t:this.xmin===i.xmin&&this.ymin===i.ymin&&this.xmax===i.xmax&&this.ymax===i.ymax)}setCoords(t){void 0!==t.xmin?(this.xmin=t.xmin,this.xmax=t.xmax,this.ymin=t.ymin,this.ymax=t.ymax):void 0!==t.x?(this.xmin=t.x,this.xmax=t.x,this.ymin=t.y,this.ymax=t.y):void 0!==t.pt1?(this.xmin=t.pt1.x,this.ymin=t.pt1.y,this.xmax=t.pt2.x,this.ymax=t.pt2.y,this.normalize()):void 0!==t.env2D?(this.xmin=t.env2D.xmin,this.xmax=t.env2D.xmax,this.ymin=t.env2D.ymin,this.ymax=t.env2D.ymax,this.normalize()):void 0!==t.pt?(this.xmin=t.pt.x,this.xmax=t.pt.x,this.ymin=t.pt.y,this.ymax=t.pt.y):void 0!==t.center?(this.xmin=t.center.x-.5*t.width,this.xmax=this.xmin+t.width,this.ymin=t.center.y-.5*t.height,this.ymax=this.ymin+t.height,this.normalize()):i("unrecognized input type for setCoords"),this.normalize()}queryIntervalX(i){this.isEmpty()?i.setEmpty():i.setCoords(this.xmin,this.xmax)}queryIntervalY(i){this.isEmpty()?i.setEmpty():i.setCoords(this.ymin,this.ymax)}setFromPoints(i,t){if(0===t)return void this.setEmpty();if(Array.isArray(i)){const s=i;this.setCoords(s[0]);for(let i=1;i<t;){if(!this.isEmpty()){for(let m=i;m<t;m++)this.mergeNe(s[m]);return}this.setCoords(s[i]),i++}return}const s=i;this.setCoords({x:s[0],y:s[1]});for(let m=1,h=2*t;m<h;m+=2){if(!this.isEmpty()){for(let i=m,h=2*t;i<h;i+=2)this.mergeNeCoords(s[i],s[i+1]);return}this.setCoords({x:s[m],y:s[m+1]}),m+=2}}normalize(){let i=!1;this.xmin<=this.xmax||([this.xmin,this.xmax]=[this.xmax,this.xmin],i=!0),this.ymin<=this.ymax||([this.ymin,this.ymax]=[this.ymax,this.ymin],i=!0),!i||this.xmin<=this.xmax&&this.ymin<=this.ymax||this.setEmpty()}isValid(){return this.isEmpty()||this.xmin<=this.xmax&&this.ymin<=this.ymax}getLowerLeft(){return new s(this.xmin,this.ymin)}getLowerRight(){return new s(this.xmax,this.ymin)}getUpperLeft(){return new s(this.xmin,this.ymax)}getUpperRight(){return new s(this.xmax,this.ymax)}move(i,t){this.isEmpty()||(this.xmin+=i,this.ymin+=t,this.xmax+=i,this.ymax+=t)}centerAtCoords(i,t){this.move(i-this.getCenterX(),t-this.getCenterY())}centerAt(i){this.centerAtCoords(i.x,i.y)}containsCoords(i,t){return i>=this.xmin&&i<=this.xmax&&t>=this.ymin&&t<=this.ymax}contains(i){return this.containsCoords(i.x,i.y)}containsEnvelope(i){return i.xmin>=this.xmin&&i.xmax<=this.xmax&&i.ymin>=this.ymin&&i.ymax<=this.ymax}containsExclusiveCoords(i,t){return i>this.xmin&&i<this.xmax&&t>this.ymin&&t<this.ymax}containsExclusive(i){return this.containsExclusiveCoords(i.x,i.y)}containsExclusiveEnvelope(i){return i.xmin>this.xmin&&i.xmax<this.xmax&&i.ymin>this.ymin&&i.ymax<this.ymax}isIntersecting(i){return(this.xmin<=i.xmin?this.xmax>=i.xmin:i.xmax>=this.xmin)&&(this.ymin<=i.ymin?this.ymax>=i.ymin:i.ymax>=this.ymin)}isIntersectingNe(i){return(this.xmin<=i.xmin?this.xmax>=i.xmin:i.xmax>=this.xmin)&&(this.ymin<=i.ymin?this.ymax>=i.ymin:i.ymax>=this.ymin)}intersect(i){if(this.isEmpty())return!1;if(i.isEmpty())return this.setEmpty(),!1;i.xmin>this.xmin&&(this.xmin=i.xmin),i.xmax<this.xmax&&(this.xmax=i.xmax),i.ymin>this.ymin&&(this.ymin=i.ymin),i.ymax<this.ymax&&(this.ymax=i.ymax);const t=this.xmin<=this.xmax&&this.ymin<=this.ymax;return t||this.setEmpty(),t}queryCorner(i){switch(3&i){case 0:return new s(this.xmin,this.ymin);case 1:return new s(this.xmin,this.ymax);case 2:return new s(this.xmax,this.ymax);default:return new s(this.xmax,this.ymin)}}queryCorners(i){i[0].setCoords(this.xmin,this.ymin),i[1].setCoords(this.xmin,this.ymax),i[2].setCoords(this.xmax,this.ymax),i[3].setCoords(this.xmax,this.ymin)}queryCornersReversed(i){i[0].setCoords(this.xmin,this.ymin),i[1].setCoords(this.xmax,this.ymin),i[2].setCoords(this.xmax,this.ymax),i[3].setCoords(this.xmin,this.ymax)}reaspect(i,t){if(this.isEmpty())return;const s=i/t,m=.5*this.width(),h=.5*this.height()*s;if(m<=h){const i=this.getCenterX();this.xmin=i-h,this.xmax=i+h}else{const i=m/s,t=this.getCenterY();this.ymin=t-i,this.ymax=t+i}this.normalize()}getArea(){return this.isEmpty()?0:this.width()*this.height()}getLength(){return this.isEmpty()?0:2*(this.width()+this.height())}clipCode(i){return(i.x<this.xmin?1:0)|(i.x>this.xmax?1:0)<<1|(i.y<this.ymin?1:0)<<2|(i.y>this.ymax?1:0)<<3}static XLESSXMIN=1;static YLESSYMIN=4;static XMASK=3;static YMASK=12;clipLine(i,t){let s=this.clipCode(i),m=this.clipCode(t);if(s&m)return 0;if(!(s|m))return 4;const h=(s?1:0)|(m?2:0);do{const h=t.x-i.x,x=t.y-i.y;if(Math.abs(h)>Math.abs(x)?s&n.XMASK?(s&n.XLESSXMIN?(i.y+=x*(this.xmin-i.x)/h,i.x=this.xmin):(i.y+=x*(this.xmax-i.x)/h,i.x=this.xmax),s=this.clipCode(i)):m&n.XMASK?(m&n.XLESSXMIN?(t.y+=x*(this.xmin-t.x)/h,t.x=this.xmin):(t.y+=x*(this.xmax-t.x)/h,t.x=this.xmax),m=this.clipCode(t)):s?(s&n.YLESSYMIN?(i.x+=h*(this.ymin-i.y)/x,i.y=this.ymin):(i.x+=h*(this.ymax-i.y)/x,i.y=this.ymax),s=this.clipCode(i)):(m&n.YLESSYMIN?(t.x+=h*(this.ymin-t.y)/x,t.y=this.ymin):(t.x+=h*(this.ymax-t.y)/x,t.y=this.ymax),m=this.clipCode(t)):s&n.YMASK?(s&n.YLESSYMIN?(i.x+=h*(this.ymin-i.y)/x,i.y=this.ymin):(i.x+=h*(this.ymax-i.y)/x,i.y=this.ymax),s=this.clipCode(i)):m&n.YMASK?(m&n.YLESSYMIN?(t.x+=h*(this.ymin-t.y)/x,t.y=this.ymin):(t.x+=h*(this.ymax-t.y)/x,t.y=this.ymax),m=this.clipCode(t)):s?(s&n.XLESSXMIN?(i.y+=x*(this.xmin-i.x)/h,i.x=this.xmin):(i.y+=x*(this.xmax-i.x)/h,i.x=this.xmax),s=this.clipCode(i)):(m&n.XLESSXMIN?(t.y+=x*(this.xmin-t.x)/h,t.x=this.xmin):(t.y+=x*(this.xmax-t.x)/h,t.x=this.xmax),m=this.clipCode(t)),s&m)return 0}while(s|m);return h}distanceFromEnvelope(i){return Math.sqrt(this.sqrDistanceEnvelope(i,null,null))}distance(i){return Math.sqrt(this.sqrDistance(i))}sqrDistanceEnvelope(i,t,s){if(!t&&!s){if(this.isEmpty()||i.isEmpty())return Number.NaN;let t,s=0,m=0;return t=this.xmin-i.xmax,t>s&&(s=t),t=this.ymin-i.ymax,t>m&&(m=t),t=i.xmin-this.xmax,t>s&&(s=t),t=i.ymin-this.ymax,t>m&&(m=t),s*s+m*m}if(this.isEmpty()||i.isEmpty())return t&&t.setNAN(),s&&s.setNAN(),Number.NaN;let m,h=0,x=0;const n=Math.max(this.xmin,i.xmin),e=Math.max(this.ymin,i.ymin);return t&&t.setCoords(n,e),s&&s.setCoords(n,e),m=this.xmin-i.xmax,m>h&&(h=m,t&&(t.x=this.xmin),s&&(s.x=i.xmax)),m=this.ymin-i.ymax,m>x&&(x=m,t&&(t.y=this.ymin),s&&(s.y=i.ymax)),m=i.xmin-this.xmax,m>h&&(h=m,t&&(t.x=this.xmax),s&&(s.x=i.xmin)),m=i.ymin-this.ymax,m>x&&(x=m,t&&(t.y=this.ymax),s&&(s.y=i.ymin)),h*h+x*x}sqrDistance(i,t){if(void 0===t){if(this.isEmpty()||i.isNAN())return Number.NaN;let t,s=0,m=0;return t=this.xmin-i.x,t>s&&(s=t),t=this.ymin-i.y,t>m&&(m=t),t=i.x-this.xmax,t>s&&(s=t),t=i.y-this.ymax,t>m&&(m=t),s*s+m*m}if(this.isEmpty()||i.isNAN())return t.setNAN(),Number.NaN;t.assign(i);let s,m=0,h=0;return s=this.xmin-i.x,s>m&&(m=s,t.x=this.xmin),s=this.ymin-i.y,s>h&&(h=s,t.y=this.ymin),s=i.x-this.xmax,s>m&&(m=s,t.x=this.xmax),s=i.y-this.ymax,s>h&&(h=s,t.y=this.ymax),m*m+h*h}sqrMaxMinDistanceEnvelope(i){if(this.isEmpty()||i.isEmpty())return Number.NaN;let t=Number.MAX_VALUE;{const m=s.sqrDistanceCoords(this.xmin,this.ymin,i.xmax,i.ymin),h=s.sqrDistanceCoords(this.xmin,this.ymin,i.xmax,i.ymax),x=s.sqrDistanceCoords(this.xmin,this.ymax,i.xmax,i.ymin),n=s.sqrDistanceCoords(this.xmin,this.ymax,i.xmax,i.ymax),e=Math.max(m,h),a=Math.max(x,n),r=Math.max(e,a);t=Math.min(r,t)}{const m=s.sqrDistanceCoords(this.xmin,this.ymin,i.xmin,i.ymax),h=s.sqrDistanceCoords(this.xmin,this.ymin,i.xmax,i.ymax),x=s.sqrDistanceCoords(this.xmax,this.ymin,i.xmin,i.ymax),n=s.sqrDistanceCoords(this.xmax,this.ymin,i.xmax,i.ymax),e=Math.max(m,h),a=Math.max(x,n),r=Math.max(e,a);t=Math.min(r,t)}{const m=s.sqrDistanceCoords(this.xmax,this.ymin,i.xmin,i.ymin),h=s.sqrDistanceCoords(this.xmax,this.ymin,i.xmin,i.ymax),x=s.sqrDistanceCoords(this.xmax,this.ymax,i.xmin,i.ymin),n=s.sqrDistanceCoords(this.xmax,this.ymax,i.xmin,i.ymax),e=Math.max(m,h),a=Math.max(x,n),r=Math.max(e,a);t=Math.min(r,t)}{const m=s.sqrDistanceCoords(this.xmin,this.ymax,i.xmin,i.ymin),h=s.sqrDistanceCoords(this.xmin,this.ymax,i.xmax,i.ymin),x=s.sqrDistanceCoords(this.xmax,this.ymax,i.xmin,i.ymin),n=s.sqrDistanceCoords(this.xmax,this.ymax,i.xmax,i.ymin),e=Math.max(m,h),a=Math.max(x,n),r=Math.max(e,a);t=Math.min(r,t)}return t}sqrMaxDistanceEnvelope(i){if(this.isEmpty()||i.isEmpty())return Number.NaN;let t=0;const h=m(s,4);this.queryCorners(h);const x=m(s,4);i.queryCorners(x);for(let m=0;m<4;m++)for(let i=0;i<4;i++){const n=s.sqrDistance(h[m],x[i]);n>t&&(t=n)}return t}sqrMaxMinDistance(i){const t=s.sqrDistance(i,this.getLowerLeft()),m=s.sqrDistance(i,this.getUpperLeft()),h=s.sqrDistance(i,this.getLowerRight()),x=s.sqrDistance(i,this.getUpperRight());let n,e=Math.max(t,m);return n=Math.max(t,h),e>n&&(e=n),n=Math.max(m,x),e>n&&(e=n),n=Math.max(h,x),e>n&&(e=n),e}sqrMinDistance(i){if(this.contains(i))return 0;return this.sqrDistance(i)}sqrMaxDistance(i){let t=s.sqrDistance(i,this.getLowerLeft());return t=Math.max(s.sqrDistance(i,this.getUpperLeft()),t),t=Math.max(s.sqrDistance(i,this.getUpperRight()),t),t=Math.max(s.sqrDistance(i,this.getLowerRight()),t),t}snapToBoundary(i){if(i.isNAN())return!1;if(this.isEmpty())return i.setNAN(),!0;let t=!0;if(i.x<this.xmin?i.x=this.xmin:i.x>this.xmax?i.x=this.xmax:t=!1,i.y<this.ymin?i.y=this.ymin:i.y>this.ymax?i.y=this.ymax:t=!1,t)return!0;if(i.x===this.xmin||i.x===this.xmax||i.y===this.ymin||i.y===this.ymax)return!1;const s=this.xmax-i.x,m=i.x-this.xmin,h=this.ymax-i.y,x=i.y-this.ymin;return Math.max(s,m)>Math.max(h,x)?i.y=x<h?this.ymin:this.ymax:i.x=m<s?this.xmin:this.xmax,!0}snapClip(i){const t=h(i.x,this.xmin,this.xmax),m=h(i.y,this.ymin,this.ymax);return s.construct(t,m)}boundaryDistance(i){if(this.isEmpty()||i.isNAN())return Number.NaN;if(i.x===this.xmin)return i.y-this.ymin;const t=this.ymax-this.ymin,m=this.xmax-this.xmin;if(i.y===this.ymax)return t+i.x-this.xmin;if(i.x===this.xmax)return t+m+this.ymax-i.y;if(i.y===this.ymin)return 2*t+m+this.xmax-i.x;const h=new s;return h.setCoordsPoint2D(i),this.snapToBoundary(h),this.boundaryDistance(h)}envelopeSide(i){if(this.isEmpty())return-1;let t=this.boundaryDistance(i);const s=this.ymax-this.ymin,m=this.xmax-this.xmin;return t<s?0:(t-=s)<m?1:t-m<s?2:3}querySide(i,s){switch(i){case 0:s.constructFromCoords(this.xmin,this.ymin,this.xmin,this.ymax);break;case 1:s.constructFromCoords(this.xmin,this.ymax,this.xmax,this.ymax);break;case 2:s.constructFromCoords(this.xmax,this.ymax,this.xmax,this.ymin);break;case 3:s.constructFromCoords(this.xmax,this.ymin,this.xmin,this.ymin);break;default:t("query_side")}return s}isPointOnBoundary(i,t){return Math.abs(i.x-this.xmin)<=t||Math.abs(i.x-this.xmax)<=t||Math.abs(i.y-this.ymin)<=t||Math.abs(i.y-this.ymax)<=t}calculateToleranceFromEnvelope(){if(this.isEmpty())return x();return(Math.abs(this.xmin)+Math.abs(this.xmax)+Math.abs(this.ymin)+Math.abs(this.ymax)+1)*x()}toString(){return`[${this.xmin}, ${this.ymin}, ${this.xmax}, ${this.ymax}]`}}export{n as Envelope2D};