@math.gl/geospatial 5.0.0-beta.5 → 5.0.0-beta.7

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 (1201) hide show
  1. package/H3-LICENSE.TXT +201 -0
  2. package/H3-NOTICE.TXT +17 -0
  3. package/THIRD-PARTY-NOTICES.md +14 -9
  4. package/dist/elastic.cjs +3 -3
  5. package/dist/elastic.cjs.map +1 -1
  6. package/dist/elastic.d.ts +3 -3
  7. package/dist/elastic.d.ts.map +1 -1
  8. package/dist/elastic.js +3 -3
  9. package/dist/elastic.js.map +1 -1
  10. package/dist/index.cjs +1707 -192
  11. package/dist/index.cjs.map +3 -3
  12. package/dist/index.d.ts +42 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +21 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/maps/air-ocean-mesh.d.ts.map +1 -0
  17. package/dist/maps/air-ocean-mesh.js.map +1 -0
  18. package/dist/maps/albers-usa.d.ts.map +1 -0
  19. package/dist/maps/albers-usa.js.map +1 -0
  20. package/dist/maps/cap-map.d.ts.map +1 -0
  21. package/dist/maps/cap-map.js.map +1 -0
  22. package/dist/maps/elastic/data.d.ts.map +1 -0
  23. package/dist/maps/elastic/data.js.map +1 -0
  24. package/dist/maps/elastic/elasticI.d.ts.map +1 -0
  25. package/dist/maps/elastic/elasticI.js.map +1 -0
  26. package/dist/maps/elastic/elasticII.d.ts.map +1 -0
  27. package/dist/maps/elastic/elasticII.js.map +1 -0
  28. package/dist/maps/elastic/elasticIII.d.ts.map +1 -0
  29. package/dist/maps/elastic/elasticIII.js.map +1 -0
  30. package/dist/maps/elastic/geometry.d.ts.map +1 -0
  31. package/dist/maps/elastic/geometry.js.map +1 -0
  32. package/dist/maps/elastic/grid.d.ts.map +1 -0
  33. package/dist/maps/elastic/grid.js.map +1 -0
  34. package/dist/maps/elastic/map.d.ts.map +1 -0
  35. package/dist/maps/elastic/map.js +500 -0
  36. package/dist/maps/elastic/map.js.map +1 -0
  37. package/dist/maps/elastic/source-arc.d.ts.map +1 -0
  38. package/dist/maps/elastic/source-arc.js.map +1 -0
  39. package/dist/maps/geometry.cjs +1028 -0
  40. package/dist/maps/geometry.cjs.map +6 -0
  41. package/dist/maps/geometry.d.ts +12 -0
  42. package/dist/maps/geometry.d.ts.map +1 -0
  43. package/dist/maps/geometry.js +13 -0
  44. package/dist/maps/geometry.js.map +1 -0
  45. package/dist/maps/global-polygons.d.ts.map +1 -0
  46. package/dist/maps/global-polygons.js.map +1 -0
  47. package/dist/maps/gray-fuller.d.ts.map +1 -0
  48. package/dist/maps/gray-fuller.js.map +1 -0
  49. package/dist/maps/gringorten-kernel.d.ts.map +1 -0
  50. package/dist/maps/gringorten-kernel.js.map +1 -0
  51. package/dist/maps/h3-face-map.d.ts +7 -0
  52. package/dist/maps/h3-face-map.d.ts.map +1 -0
  53. package/dist/maps/h3-face-map.js +200 -0
  54. package/dist/maps/h3-face-map.js.map +1 -0
  55. package/dist/maps/healpix.d.ts.map +1 -0
  56. package/dist/maps/healpix.js.map +1 -0
  57. package/dist/maps/layout.d.ts.map +1 -0
  58. package/dist/maps/layout.js.map +1 -0
  59. package/dist/maps/map-engine.d.ts +239 -0
  60. package/dist/maps/map-engine.d.ts.map +1 -0
  61. package/dist/maps/map-engine.js +299 -0
  62. package/dist/maps/map-engine.js.map +1 -0
  63. package/dist/maps/map-layout.d.ts +119 -0
  64. package/dist/maps/map-layout.d.ts.map +1 -0
  65. package/dist/maps/map-layout.js +612 -0
  66. package/dist/maps/map-layout.js.map +1 -0
  67. package/dist/maps/map-surface-mesh.d.ts +44 -0
  68. package/dist/maps/map-surface-mesh.d.ts.map +1 -0
  69. package/dist/maps/map-surface-mesh.js +150 -0
  70. package/dist/maps/map-surface-mesh.js.map +1 -0
  71. package/dist/maps/map-transition-mesh.d.ts +51 -0
  72. package/dist/maps/map-transition-mesh.d.ts.map +1 -0
  73. package/dist/maps/map-transition-mesh.js +313 -0
  74. package/dist/maps/map-transition-mesh.js.map +1 -0
  75. package/dist/maps/map-transition.d.ts.map +1 -0
  76. package/dist/maps/map-transition.js.map +1 -0
  77. package/dist/maps/math.d.ts.map +1 -0
  78. package/dist/maps/math.js.map +1 -0
  79. package/dist/maps/mercator-map.d.ts.map +1 -0
  80. package/dist/maps/mercator-map.js +245 -0
  81. package/dist/maps/mercator-map.js.map +1 -0
  82. package/dist/maps/myriahedral/graticule.d.ts.map +1 -0
  83. package/dist/maps/myriahedral/graticule.js.map +1 -0
  84. package/dist/maps/myriahedral/mesh.d.ts.map +1 -0
  85. package/dist/maps/myriahedral/mesh.js.map +1 -0
  86. package/dist/maps/myriahedral/unfold.d.ts.map +1 -0
  87. package/dist/maps/myriahedral/unfold.js.map +1 -0
  88. package/dist/maps/myriahedral.d.ts.map +1 -0
  89. package/dist/maps/myriahedral.js.map +1 -0
  90. package/dist/maps/petroff.d.ts.map +1 -0
  91. package/dist/maps/petroff.js.map +1 -0
  92. package/dist/maps/polygon-constraints.d.ts.map +1 -0
  93. package/dist/maps/polygon-constraints.js.map +1 -0
  94. package/dist/maps/polyhedral.d.ts.map +1 -0
  95. package/dist/maps/polyhedral.js.map +1 -0
  96. package/dist/maps/prepare-features.d.ts.map +1 -0
  97. package/dist/maps/prepare-features.js.map +1 -0
  98. package/dist/maps/preset-kernels.d.ts +71 -0
  99. package/dist/maps/preset-kernels.d.ts.map +1 -0
  100. package/dist/maps/preset-kernels.js +372 -0
  101. package/dist/maps/preset-kernels.js.map +1 -0
  102. package/dist/maps/presets.cjs +7437 -0
  103. package/dist/maps/presets.cjs.map +6 -0
  104. package/dist/maps/presets.d.ts +37 -0
  105. package/dist/maps/presets.d.ts.map +1 -0
  106. package/dist/maps/presets.js +294 -0
  107. package/dist/maps/presets.js.map +1 -0
  108. package/dist/maps/projection-catalog.d.ts.map +1 -0
  109. package/dist/maps/projection-catalog.js +96 -0
  110. package/dist/maps/projection-catalog.js.map +1 -0
  111. package/dist/maps/projection-surface.d.ts +14 -0
  112. package/dist/maps/projection-surface.d.ts.map +1 -0
  113. package/dist/maps/projection-surface.js +50 -0
  114. package/dist/maps/projection-surface.js.map +1 -0
  115. package/dist/maps/quincuncial-kernel.d.ts.map +1 -0
  116. package/dist/maps/quincuncial-kernel.js.map +1 -0
  117. package/dist/maps/quincuncial-star.d.ts.map +1 -0
  118. package/dist/maps/quincuncial-star.js.map +1 -0
  119. package/dist/maps/regional-map.d.ts.map +1 -0
  120. package/dist/maps/regional-map.js.map +1 -0
  121. package/dist/maps/retroazimuthal-map.d.ts.map +1 -0
  122. package/dist/maps/retroazimuthal-map.js.map +1 -0
  123. package/dist/maps/rotated-map.d.ts +42 -0
  124. package/dist/maps/rotated-map.d.ts.map +1 -0
  125. package/dist/maps/rotated-map.js +72 -0
  126. package/dist/maps/rotated-map.js.map +1 -0
  127. package/dist/maps/snyder-mesh.d.ts.map +1 -0
  128. package/dist/maps/snyder-mesh.js.map +1 -0
  129. package/dist/maps/snyder.d.ts.map +1 -0
  130. package/dist/maps/snyder.js.map +1 -0
  131. package/dist/maps/source-arc.d.ts.map +1 -0
  132. package/dist/maps/source-arc.js.map +1 -0
  133. package/dist/maps/spherical-clip/cartesian.d.ts +8 -0
  134. package/dist/maps/spherical-clip/cartesian.d.ts.map +1 -0
  135. package/dist/maps/spherical-clip/cartesian.js.map +1 -0
  136. package/dist/maps/spherical-clip/circle.d.ts.map +1 -0
  137. package/dist/maps/spherical-clip/circle.js.map +1 -0
  138. package/dist/maps/spherical-clip/clip-buffer.d.ts.map +1 -0
  139. package/dist/maps/spherical-clip/clip-buffer.js.map +1 -0
  140. package/dist/maps/spherical-clip/clip-circle.d.ts.map +1 -0
  141. package/dist/maps/spherical-clip/clip-circle.js.map +1 -0
  142. package/dist/maps/spherical-clip/clip-index.d.ts.map +1 -0
  143. package/dist/maps/spherical-clip/clip-index.js.map +1 -0
  144. package/dist/maps/spherical-clip/clip-rejoin.d.ts.map +1 -0
  145. package/dist/maps/spherical-clip/clip-rejoin.js.map +1 -0
  146. package/dist/maps/spherical-clip/helpers.d.ts.map +1 -0
  147. package/dist/maps/spherical-clip/helpers.js.map +1 -0
  148. package/dist/maps/spherical-clip/math.d.ts +26 -0
  149. package/dist/maps/spherical-clip/math.d.ts.map +1 -0
  150. package/dist/maps/spherical-clip/math.js.map +1 -0
  151. package/dist/maps/spherical-clip/noop.d.ts.map +1 -0
  152. package/dist/maps/spherical-clip/noop.js.map +1 -0
  153. package/dist/maps/spherical-clip/pointEqual.d.ts +2 -0
  154. package/dist/maps/spherical-clip/pointEqual.d.ts.map +1 -0
  155. package/dist/maps/spherical-clip/pointEqual.js.map +1 -0
  156. package/dist/maps/spherical-clip/polygonContains.d.ts.map +1 -0
  157. package/dist/maps/spherical-clip/polygonContains.js.map +1 -0
  158. package/dist/maps/surfaces.cjs +183 -0
  159. package/dist/maps/surfaces.cjs.map +6 -0
  160. package/dist/maps/surfaces.d.ts +5 -0
  161. package/dist/maps/surfaces.d.ts.map +1 -0
  162. package/dist/maps/surfaces.js +6 -0
  163. package/dist/maps/surfaces.js.map +1 -0
  164. package/dist/maps/transitions.cjs +660 -0
  165. package/dist/maps/transitions.cjs.map +6 -0
  166. package/dist/maps/transitions.d.ts +8 -0
  167. package/dist/maps/transitions.d.ts.map +1 -0
  168. package/dist/maps/transitions.js +9 -0
  169. package/dist/maps/transitions.js.map +1 -0
  170. package/dist/maps/world-composite-kernels.d.ts.map +1 -0
  171. package/dist/maps/world-composite-kernels.js.map +1 -0
  172. package/dist/maps/world-kernels/airy.d.ts.map +1 -0
  173. package/dist/maps/world-kernels/airy.js.map +1 -0
  174. package/dist/maps/world-kernels/aitoff.d.ts.map +1 -0
  175. package/dist/maps/world-kernels/aitoff.js.map +1 -0
  176. package/dist/maps/world-kernels/armadillo.d.ts.map +1 -0
  177. package/dist/maps/world-kernels/armadillo.js.map +1 -0
  178. package/dist/maps/world-kernels/august.d.ts.map +1 -0
  179. package/dist/maps/world-kernels/august.js.map +1 -0
  180. package/dist/maps/world-kernels/baker.d.ts.map +1 -0
  181. package/dist/maps/world-kernels/baker.js.map +1 -0
  182. package/dist/maps/world-kernels/bertin.d.ts.map +1 -0
  183. package/dist/maps/world-kernels/bertin.js.map +1 -0
  184. package/dist/maps/world-kernels/boggs.d.ts.map +1 -0
  185. package/dist/maps/world-kernels/boggs.js.map +1 -0
  186. package/dist/maps/world-kernels/bonne.d.ts.map +1 -0
  187. package/dist/maps/world-kernels/bonne.js.map +1 -0
  188. package/dist/maps/world-kernels/bottomley.d.ts.map +1 -0
  189. package/dist/maps/world-kernels/bottomley.js.map +1 -0
  190. package/dist/maps/world-kernels/bromley.d.ts.map +1 -0
  191. package/dist/maps/world-kernels/bromley.js.map +1 -0
  192. package/dist/maps/world-kernels/chamberlin.d.ts.map +1 -0
  193. package/dist/maps/world-kernels/chamberlin.js.map +1 -0
  194. package/dist/maps/world-kernels/collignon.d.ts +5 -0
  195. package/dist/maps/world-kernels/collignon.d.ts.map +1 -0
  196. package/dist/maps/world-kernels/collignon.js.map +1 -0
  197. package/dist/maps/world-kernels/craig.d.ts.map +1 -0
  198. package/dist/maps/world-kernels/craig.js.map +1 -0
  199. package/dist/maps/world-kernels/craster.d.ts +5 -0
  200. package/dist/maps/world-kernels/craster.d.ts.map +1 -0
  201. package/dist/maps/world-kernels/craster.js.map +1 -0
  202. package/dist/maps/world-kernels/cylindricalEqualArea.d.ts.map +1 -0
  203. package/dist/maps/world-kernels/cylindricalEqualArea.js.map +1 -0
  204. package/dist/maps/world-kernels/cylindricalStereographic.d.ts.map +1 -0
  205. package/dist/maps/world-kernels/cylindricalStereographic.js.map +1 -0
  206. package/dist/maps/world-kernels/d3-geo-raw.d.ts.map +1 -0
  207. package/dist/maps/world-kernels/d3-geo-raw.js.map +1 -0
  208. package/dist/maps/world-kernels/eckert1.d.ts +5 -0
  209. package/dist/maps/world-kernels/eckert1.d.ts.map +1 -0
  210. package/dist/maps/world-kernels/eckert1.js.map +1 -0
  211. package/dist/maps/world-kernels/eckert2.d.ts +5 -0
  212. package/dist/maps/world-kernels/eckert2.d.ts.map +1 -0
  213. package/dist/maps/world-kernels/eckert2.js.map +1 -0
  214. package/dist/maps/world-kernels/eckert3.d.ts +5 -0
  215. package/dist/maps/world-kernels/eckert3.d.ts.map +1 -0
  216. package/dist/maps/world-kernels/eckert3.js.map +1 -0
  217. package/dist/maps/world-kernels/eckert4.d.ts +5 -0
  218. package/dist/maps/world-kernels/eckert4.d.ts.map +1 -0
  219. package/dist/maps/world-kernels/eckert4.js.map +1 -0
  220. package/dist/maps/world-kernels/eckert5.d.ts +5 -0
  221. package/dist/maps/world-kernels/eckert5.d.ts.map +1 -0
  222. package/dist/maps/world-kernels/eckert5.js.map +1 -0
  223. package/dist/maps/world-kernels/eckert6.d.ts +5 -0
  224. package/dist/maps/world-kernels/eckert6.d.ts.map +1 -0
  225. package/dist/maps/world-kernels/eckert6.js.map +1 -0
  226. package/dist/maps/world-kernels/eisenlohr.d.ts.map +1 -0
  227. package/dist/maps/world-kernels/eisenlohr.js.map +1 -0
  228. package/dist/maps/world-kernels/fahey.d.ts +5 -0
  229. package/dist/maps/world-kernels/fahey.d.ts.map +1 -0
  230. package/dist/maps/world-kernels/fahey.js.map +1 -0
  231. package/dist/maps/world-kernels/foucaut.d.ts +5 -0
  232. package/dist/maps/world-kernels/foucaut.d.ts.map +1 -0
  233. package/dist/maps/world-kernels/foucaut.js.map +1 -0
  234. package/dist/maps/world-kernels/foucautSinusoidal.d.ts.map +1 -0
  235. package/dist/maps/world-kernels/foucautSinusoidal.js.map +1 -0
  236. package/dist/maps/world-kernels/ginzburg4.d.ts.map +1 -0
  237. package/dist/maps/world-kernels/ginzburg4.js.map +1 -0
  238. package/dist/maps/world-kernels/ginzburg5.d.ts.map +1 -0
  239. package/dist/maps/world-kernels/ginzburg5.js.map +1 -0
  240. package/dist/maps/world-kernels/ginzburg6.d.ts.map +1 -0
  241. package/dist/maps/world-kernels/ginzburg6.js.map +1 -0
  242. package/dist/maps/world-kernels/ginzburg8.d.ts.map +1 -0
  243. package/dist/maps/world-kernels/ginzburg8.js.map +1 -0
  244. package/dist/maps/world-kernels/ginzburg9.d.ts.map +1 -0
  245. package/dist/maps/world-kernels/ginzburg9.js.map +1 -0
  246. package/dist/maps/world-kernels/ginzburgPolyconic.d.ts.map +1 -0
  247. package/dist/maps/world-kernels/ginzburgPolyconic.js.map +1 -0
  248. package/dist/maps/world-kernels/hammer.d.ts.map +1 -0
  249. package/dist/maps/world-kernels/hammer.js.map +1 -0
  250. package/dist/maps/world-kernels/hammerRetroazimuthal.d.ts.map +1 -0
  251. package/dist/maps/world-kernels/hammerRetroazimuthal.js.map +1 -0
  252. package/dist/maps/world-kernels/hill.d.ts.map +1 -0
  253. package/dist/maps/world-kernels/hill.js.map +1 -0
  254. package/dist/maps/world-kernels/homolosine.d.ts +5 -0
  255. package/dist/maps/world-kernels/homolosine.d.ts.map +1 -0
  256. package/dist/maps/world-kernels/homolosine.js.map +1 -0
  257. package/dist/maps/world-kernels/hufnagel.d.ts.map +1 -0
  258. package/dist/maps/world-kernels/hufnagel.js.map +1 -0
  259. package/dist/maps/world-kernels/hyperelliptical.d.ts.map +1 -0
  260. package/dist/maps/world-kernels/hyperelliptical.js.map +1 -0
  261. package/dist/maps/world-kernels/integrate.d.ts.map +1 -0
  262. package/dist/maps/world-kernels/integrate.js.map +1 -0
  263. package/dist/maps/world-kernels/kavrayskiy7.d.ts +5 -0
  264. package/dist/maps/world-kernels/kavrayskiy7.d.ts.map +1 -0
  265. package/dist/maps/world-kernels/kavrayskiy7.js.map +1 -0
  266. package/dist/maps/world-kernels/lagrange.d.ts.map +1 -0
  267. package/dist/maps/world-kernels/lagrange.js.map +1 -0
  268. package/dist/maps/world-kernels/larrivee.d.ts.map +1 -0
  269. package/dist/maps/world-kernels/larrivee.js.map +1 -0
  270. package/dist/maps/world-kernels/laskowski.d.ts.map +1 -0
  271. package/dist/maps/world-kernels/laskowski.js.map +1 -0
  272. package/dist/maps/world-kernels/littrow.d.ts.map +1 -0
  273. package/dist/maps/world-kernels/littrow.js.map +1 -0
  274. package/dist/maps/world-kernels/loximuthal.d.ts.map +1 -0
  275. package/dist/maps/world-kernels/loximuthal.js.map +1 -0
  276. package/dist/maps/world-kernels/math.d.ts +36 -0
  277. package/dist/maps/world-kernels/math.d.ts.map +1 -0
  278. package/dist/maps/world-kernels/math.js.map +1 -0
  279. package/dist/maps/world-kernels/miller.d.ts +5 -0
  280. package/dist/maps/world-kernels/miller.d.ts.map +1 -0
  281. package/dist/maps/world-kernels/miller.js.map +1 -0
  282. package/dist/maps/world-kernels/modifiedStereographic.d.ts.map +1 -0
  283. package/dist/maps/world-kernels/modifiedStereographic.js.map +1 -0
  284. package/dist/maps/world-kernels/mollweide.d.ts.map +1 -0
  285. package/dist/maps/world-kernels/mollweide.js.map +1 -0
  286. package/dist/maps/world-kernels/mtFlatPolarParabolic.d.ts.map +1 -0
  287. package/dist/maps/world-kernels/mtFlatPolarParabolic.js.map +1 -0
  288. package/dist/maps/world-kernels/mtFlatPolarQuartic.d.ts.map +1 -0
  289. package/dist/maps/world-kernels/mtFlatPolarQuartic.js.map +1 -0
  290. package/dist/maps/world-kernels/mtFlatPolarSinusoidal.d.ts.map +1 -0
  291. package/dist/maps/world-kernels/mtFlatPolarSinusoidal.js.map +1 -0
  292. package/dist/maps/world-kernels/naturalEarth2.d.ts.map +1 -0
  293. package/dist/maps/world-kernels/naturalEarth2.js.map +1 -0
  294. package/dist/maps/world-kernels/nellHammer.d.ts.map +1 -0
  295. package/dist/maps/world-kernels/nellHammer.js.map +1 -0
  296. package/dist/maps/world-kernels/newton.d.ts.map +1 -0
  297. package/dist/maps/world-kernels/newton.js.map +1 -0
  298. package/dist/maps/world-kernels/nicolosi.d.ts.map +1 -0
  299. package/dist/maps/world-kernels/nicolosi.js.map +1 -0
  300. package/dist/maps/world-kernels/patterson.d.ts.map +1 -0
  301. package/dist/maps/world-kernels/patterson.js.map +1 -0
  302. package/dist/maps/world-kernels/polyconic.d.ts.map +1 -0
  303. package/dist/maps/world-kernels/polyconic.js.map +1 -0
  304. package/dist/maps/world-kernels/rectangularPolyconic.d.ts.map +1 -0
  305. package/dist/maps/world-kernels/rectangularPolyconic.js.map +1 -0
  306. package/dist/maps/world-kernels/robinson.d.ts.map +1 -0
  307. package/dist/maps/world-kernels/robinson.js.map +1 -0
  308. package/dist/maps/world-kernels/satellite.d.ts.map +1 -0
  309. package/dist/maps/world-kernels/satellite.js.map +1 -0
  310. package/dist/maps/world-kernels/sinuMollweide.d.ts +7 -0
  311. package/dist/maps/world-kernels/sinuMollweide.d.ts.map +1 -0
  312. package/dist/maps/world-kernels/sinuMollweide.js.map +1 -0
  313. package/dist/maps/world-kernels/sinusoidal.d.ts +5 -0
  314. package/dist/maps/world-kernels/sinusoidal.d.ts.map +1 -0
  315. package/dist/maps/world-kernels/sinusoidal.js.map +1 -0
  316. package/dist/maps/world-kernels/times.d.ts.map +1 -0
  317. package/dist/maps/world-kernels/times.js.map +1 -0
  318. package/dist/maps/world-kernels/twoPointEquidistant.d.ts.map +1 -0
  319. package/dist/maps/world-kernels/twoPointEquidistant.js.map +1 -0
  320. package/dist/maps/world-kernels/vanDerGrinten.d.ts.map +1 -0
  321. package/dist/maps/world-kernels/vanDerGrinten.js.map +1 -0
  322. package/dist/maps/world-kernels/vanDerGrinten2.d.ts.map +1 -0
  323. package/dist/maps/world-kernels/vanDerGrinten2.js.map +1 -0
  324. package/dist/maps/world-kernels/vanDerGrinten3.d.ts.map +1 -0
  325. package/dist/maps/world-kernels/vanDerGrinten3.js.map +1 -0
  326. package/dist/maps/world-kernels/vanDerGrinten4.d.ts.map +1 -0
  327. package/dist/maps/world-kernels/vanDerGrinten4.js.map +1 -0
  328. package/dist/maps/world-kernels/wagner.d.ts.map +1 -0
  329. package/dist/maps/world-kernels/wagner.js.map +1 -0
  330. package/dist/maps/world-kernels/wagner4.d.ts.map +1 -0
  331. package/dist/maps/world-kernels/wagner4.js.map +1 -0
  332. package/dist/maps/world-kernels/wagner6.d.ts +5 -0
  333. package/dist/maps/world-kernels/wagner6.d.ts.map +1 -0
  334. package/dist/maps/world-kernels/wagner6.js.map +1 -0
  335. package/dist/maps/world-kernels/wiechel.d.ts.map +1 -0
  336. package/dist/maps/world-kernels/wiechel.js.map +1 -0
  337. package/dist/maps/world-kernels/winkel3.d.ts.map +1 -0
  338. package/dist/maps/world-kernels/winkel3.js.map +1 -0
  339. package/dist/maps/world-kernels.d.ts.map +1 -0
  340. package/dist/maps/world-kernels.js.map +1 -0
  341. package/dist/maps/world-map.d.ts.map +1 -0
  342. package/dist/maps/world-map.js.map +1 -0
  343. package/dist/maps.cjs +9153 -0
  344. package/dist/maps.cjs.map +6 -0
  345. package/dist/maps.d.ts +63 -0
  346. package/dist/maps.d.ts.map +1 -0
  347. package/dist/maps.js +43 -0
  348. package/dist/maps.js.map +1 -0
  349. package/dist/tasks/definitions.d.ts +1 -1
  350. package/dist/tasks/definitions.d.ts.map +1 -1
  351. package/dist/tasks/index.cjs +3707 -3294
  352. package/dist/tasks/index.cjs.map +3 -3
  353. package/dist/tasks/operations.d.ts +2 -2
  354. package/dist/tasks/operations.d.ts.map +1 -1
  355. package/dist/tasks/operations.js +10 -2
  356. package/dist/tasks/operations.js.map +1 -1
  357. package/dist/terrain/bounds-regions.d.ts +15 -0
  358. package/dist/terrain/bounds-regions.d.ts.map +1 -0
  359. package/dist/terrain/bounds-regions.js +84 -0
  360. package/dist/terrain/bounds-regions.js.map +1 -0
  361. package/dist/terrain/bounds-update.d.ts +11 -0
  362. package/dist/terrain/bounds-update.d.ts.map +1 -0
  363. package/dist/terrain/bounds-update.js +10 -0
  364. package/dist/terrain/bounds-update.js.map +1 -0
  365. package/dist/terrain/box-index.d.ts +9 -0
  366. package/dist/terrain/box-index.d.ts.map +1 -0
  367. package/dist/terrain/box-index.js +43 -0
  368. package/dist/terrain/box-index.js.map +1 -0
  369. package/dist/terrain/contour-simplify.d.ts +1 -0
  370. package/dist/terrain/contour-simplify.d.ts.map +1 -1
  371. package/dist/terrain/contour-simplify.js +5 -1
  372. package/dist/terrain/contour-simplify.js.map +1 -1
  373. package/dist/terrain/contour-topology.d.ts +30 -0
  374. package/dist/terrain/contour-topology.d.ts.map +1 -0
  375. package/dist/terrain/contour-topology.js +236 -0
  376. package/dist/terrain/contour-topology.js.map +1 -0
  377. package/dist/terrain/delatin-regions.d.ts +14 -0
  378. package/dist/terrain/delatin-regions.d.ts.map +1 -0
  379. package/dist/terrain/delatin-regions.js +15 -0
  380. package/dist/terrain/delatin-regions.js.map +1 -0
  381. package/dist/terrain/dirty-regions.d.ts +11 -0
  382. package/dist/terrain/dirty-regions.d.ts.map +1 -0
  383. package/dist/terrain/dirty-regions.js +34 -0
  384. package/dist/terrain/dirty-regions.js.map +1 -0
  385. package/dist/terrain/gradient-pyramid-regions.d.ts +15 -0
  386. package/dist/terrain/gradient-pyramid-regions.d.ts.map +1 -0
  387. package/dist/terrain/gradient-pyramid-regions.js +112 -0
  388. package/dist/terrain/gradient-pyramid-regions.js.map +1 -0
  389. package/dist/terrain/gradient-pyramid-update.d.ts +11 -0
  390. package/dist/terrain/gradient-pyramid-update.d.ts.map +1 -0
  391. package/dist/terrain/gradient-pyramid-update.js +17 -0
  392. package/dist/terrain/gradient-pyramid-update.js.map +1 -0
  393. package/dist/terrain/index.cjs +1603 -88
  394. package/dist/terrain/index.cjs.map +3 -3
  395. package/dist/terrain/index.d.ts +42 -0
  396. package/dist/terrain/index.d.ts.map +1 -1
  397. package/dist/terrain/index.js +21 -0
  398. package/dist/terrain/index.js.map +1 -1
  399. package/dist/terrain/isobands-mixed.d.ts +18 -0
  400. package/dist/terrain/isobands-mixed.d.ts.map +1 -0
  401. package/dist/terrain/isobands-mixed.js +34 -0
  402. package/dist/terrain/isobands-mixed.js.map +1 -0
  403. package/dist/terrain/isobands.d.ts +24 -0
  404. package/dist/terrain/isobands.d.ts.map +1 -0
  405. package/dist/terrain/isobands.js +281 -0
  406. package/dist/terrain/isobands.js.map +1 -0
  407. package/dist/terrain/lod-coordinate.d.ts +15 -0
  408. package/dist/terrain/lod-coordinate.d.ts.map +1 -0
  409. package/dist/terrain/lod-coordinate.js +40 -0
  410. package/dist/terrain/lod-coordinate.js.map +1 -0
  411. package/dist/terrain/lod-morph-evaluate.d.ts +8 -0
  412. package/dist/terrain/lod-morph-evaluate.d.ts.map +1 -0
  413. package/dist/terrain/lod-morph-evaluate.js +30 -0
  414. package/dist/terrain/lod-morph-evaluate.js.map +1 -0
  415. package/dist/terrain/lod-morph.d.ts +35 -0
  416. package/dist/terrain/lod-morph.d.ts.map +1 -0
  417. package/dist/terrain/lod-morph.js +87 -0
  418. package/dist/terrain/lod-morph.js.map +1 -0
  419. package/dist/terrain/martini-regions.d.ts +14 -0
  420. package/dist/terrain/martini-regions.d.ts.map +1 -0
  421. package/dist/terrain/martini-regions.js +26 -0
  422. package/dist/terrain/martini-regions.js.map +1 -0
  423. package/dist/terrain/mesh-error.d.ts.map +1 -1
  424. package/dist/terrain/mesh-error.js +9 -1
  425. package/dist/terrain/mesh-error.js.map +1 -1
  426. package/dist/terrain/mesh-regions-data.d.ts +24 -0
  427. package/dist/terrain/mesh-regions-data.d.ts.map +1 -0
  428. package/dist/terrain/mesh-regions-data.js +80 -0
  429. package/dist/terrain/mesh-regions-data.js.map +1 -0
  430. package/dist/terrain/mesh-regions.d.ts +12 -0
  431. package/dist/terrain/mesh-regions.d.ts.map +1 -0
  432. package/dist/terrain/mesh-regions.js +10 -0
  433. package/dist/terrain/mesh-regions.js.map +1 -0
  434. package/dist/terrain/mesh-update.d.ts +11 -0
  435. package/dist/terrain/mesh-update.d.ts.map +1 -0
  436. package/dist/terrain/mesh-update.js +10 -0
  437. package/dist/terrain/mesh-update.js.map +1 -0
  438. package/dist/terrain/mixed-gradient-update.d.ts +15 -0
  439. package/dist/terrain/mixed-gradient-update.d.ts.map +1 -0
  440. package/dist/terrain/mixed-gradient-update.js +24 -0
  441. package/dist/terrain/mixed-gradient-update.js.map +1 -0
  442. package/dist/terrain/mixed-halo-update.d.ts +16 -0
  443. package/dist/terrain/mixed-halo-update.d.ts.map +1 -0
  444. package/dist/terrain/mixed-halo-update.js +46 -0
  445. package/dist/terrain/mixed-halo-update.js.map +1 -0
  446. package/dist/terrain/mixed-surface.d.ts +27 -0
  447. package/dist/terrain/mixed-surface.d.ts.map +1 -0
  448. package/dist/terrain/mixed-surface.js +160 -0
  449. package/dist/terrain/mixed-surface.js.map +1 -0
  450. package/dist/terrain/mixed-vertex-halos.d.ts +32 -0
  451. package/dist/terrain/mixed-vertex-halos.d.ts.map +1 -0
  452. package/dist/terrain/mixed-vertex-halos.js +125 -0
  453. package/dist/terrain/mixed-vertex-halos.js.map +1 -0
  454. package/dist/terrain/persistent-bounds.d.ts +16 -0
  455. package/dist/terrain/persistent-bounds.d.ts.map +1 -0
  456. package/dist/terrain/persistent-bounds.js +51 -0
  457. package/dist/terrain/persistent-bounds.js.map +1 -0
  458. package/dist/terrain/persistent-gradients.d.ts +16 -0
  459. package/dist/terrain/persistent-gradients.d.ts.map +1 -0
  460. package/dist/terrain/persistent-gradients.js +69 -0
  461. package/dist/terrain/persistent-gradients.js.map +1 -0
  462. package/dist/terrain/persistent-hierarchy-data.d.ts +41 -0
  463. package/dist/terrain/persistent-hierarchy-data.d.ts.map +1 -0
  464. package/dist/terrain/persistent-hierarchy-data.js +130 -0
  465. package/dist/terrain/persistent-hierarchy-data.js.map +1 -0
  466. package/dist/terrain/sample-triangle-height.d.ts +4 -0
  467. package/dist/terrain/sample-triangle-height.d.ts.map +1 -0
  468. package/dist/terrain/sample-triangle-height.js +46 -0
  469. package/dist/terrain/sample-triangle-height.js.map +1 -0
  470. package/dist/terrain/tile-update-data.d.ts +14 -0
  471. package/dist/terrain/tile-update-data.d.ts.map +1 -0
  472. package/dist/terrain/tile-update-data.js +23 -0
  473. package/dist/terrain/tile-update-data.js.map +1 -0
  474. package/dist/turf/expressions.cjs +87 -0
  475. package/dist/turf/expressions.cjs.map +6 -0
  476. package/dist/turf/expressions.d.ts +24 -0
  477. package/dist/turf/expressions.d.ts.map +1 -0
  478. package/dist/turf/expressions.js +76 -0
  479. package/dist/turf/expressions.js.map +1 -0
  480. package/package.json +39 -12
  481. package/src/elastic.ts +3 -3
  482. package/src/index.ts +65 -0
  483. package/src/maps/elastic/map.ts +621 -0
  484. package/src/maps/geometry.ts +12 -0
  485. package/src/maps/h3-face-map.ts +251 -0
  486. package/src/maps/map-engine.ts +484 -0
  487. package/src/maps/map-layout.ts +777 -0
  488. package/src/maps/map-surface-mesh.ts +229 -0
  489. package/src/maps/map-transition-mesh.ts +421 -0
  490. package/src/maps/mercator-map.ts +298 -0
  491. package/src/maps/presets.ts +355 -0
  492. package/src/maps/projection-catalog.ts +132 -0
  493. package/src/maps/projection-surface.ts +70 -0
  494. package/src/maps/rotated-map.ts +92 -0
  495. package/src/maps/spherical-clip/cartesian.ts +43 -0
  496. package/src/maps/spherical-clip/math.ts +45 -0
  497. package/src/maps/spherical-clip/pointEqual.ts +10 -0
  498. package/src/maps/surfaces.ts +7 -0
  499. package/src/maps/transitions.ts +8 -0
  500. package/src/maps/world-kernels/collignon.ts +17 -0
  501. package/src/maps/world-kernels/craster.ts +18 -0
  502. package/src/maps/world-kernels/eckert1.ts +18 -0
  503. package/src/maps/world-kernels/eckert2.ts +17 -0
  504. package/src/maps/world-kernels/eckert3.ts +17 -0
  505. package/src/maps/world-kernels/eckert4.ts +24 -0
  506. package/src/maps/world-kernels/eckert5.ts +17 -0
  507. package/src/maps/world-kernels/eckert6.ts +22 -0
  508. package/src/maps/world-kernels/fahey.ts +19 -0
  509. package/src/maps/world-kernels/foucaut.ts +20 -0
  510. package/src/maps/world-kernels/kavrayskiy7.ts +15 -0
  511. package/src/maps/world-kernels/math.ts +98 -0
  512. package/src/maps/world-kernels/miller.ts +15 -0
  513. package/src/maps/world-kernels/sinusoidal.ts +15 -0
  514. package/src/maps/world-kernels/wagner6.ts +15 -0
  515. package/src/maps.ts +168 -0
  516. package/src/tasks/definitions.ts +1 -1
  517. package/src/tasks/operations.ts +11 -3
  518. package/src/terrain/bounds-regions.ts +106 -0
  519. package/src/terrain/bounds-update.ts +19 -0
  520. package/src/terrain/box-index.ts +47 -0
  521. package/src/terrain/contour-simplify.ts +10 -2
  522. package/src/terrain/contour-topology.ts +263 -0
  523. package/src/terrain/delatin-regions.ts +25 -0
  524. package/src/terrain/dirty-regions.ts +61 -0
  525. package/src/terrain/gradient-pyramid-regions.ts +140 -0
  526. package/src/terrain/gradient-pyramid-update.ts +25 -0
  527. package/src/terrain/index.ts +62 -0
  528. package/src/terrain/isobands-mixed.ts +49 -0
  529. package/src/terrain/isobands.ts +348 -0
  530. package/src/terrain/lod-coordinate.ts +57 -0
  531. package/src/terrain/lod-morph-evaluate.ts +36 -0
  532. package/src/terrain/lod-morph.ts +138 -0
  533. package/src/terrain/martini-regions.ts +38 -0
  534. package/src/terrain/mesh-error.ts +14 -1
  535. package/src/terrain/mesh-regions-data.ts +113 -0
  536. package/src/terrain/mesh-regions.ts +18 -0
  537. package/src/terrain/mesh-update.ts +15 -0
  538. package/src/terrain/mixed-gradient-update.ts +40 -0
  539. package/src/terrain/mixed-halo-update.ts +56 -0
  540. package/src/terrain/mixed-surface.ts +232 -0
  541. package/src/terrain/mixed-vertex-halos.ts +170 -0
  542. package/src/terrain/persistent-bounds.ts +95 -0
  543. package/src/terrain/persistent-gradients.ts +117 -0
  544. package/src/terrain/persistent-hierarchy-data.ts +196 -0
  545. package/src/terrain/sample-triangle-height.ts +50 -0
  546. package/src/terrain/tile-update-data.ts +32 -0
  547. package/src/turf/expressions.ts +97 -0
  548. package/dist/discontinuous/air-ocean-mesh.d.ts.map +0 -1
  549. package/dist/discontinuous/air-ocean-mesh.js.map +0 -1
  550. package/dist/discontinuous/albers-usa.d.ts.map +0 -1
  551. package/dist/discontinuous/albers-usa.js.map +0 -1
  552. package/dist/discontinuous/cap-map.d.ts.map +0 -1
  553. package/dist/discontinuous/cap-map.js.map +0 -1
  554. package/dist/discontinuous/elastic/data.d.ts.map +0 -1
  555. package/dist/discontinuous/elastic/data.js.map +0 -1
  556. package/dist/discontinuous/elastic/elasticI.d.ts.map +0 -1
  557. package/dist/discontinuous/elastic/elasticI.js.map +0 -1
  558. package/dist/discontinuous/elastic/elasticII.d.ts.map +0 -1
  559. package/dist/discontinuous/elastic/elasticII.js.map +0 -1
  560. package/dist/discontinuous/elastic/elasticIII.d.ts.map +0 -1
  561. package/dist/discontinuous/elastic/elasticIII.js.map +0 -1
  562. package/dist/discontinuous/elastic/geometry.d.ts.map +0 -1
  563. package/dist/discontinuous/elastic/geometry.js.map +0 -1
  564. package/dist/discontinuous/elastic/grid.d.ts.map +0 -1
  565. package/dist/discontinuous/elastic/grid.js.map +0 -1
  566. package/dist/discontinuous/elastic/map.d.ts.map +0 -1
  567. package/dist/discontinuous/elastic/map.js +0 -500
  568. package/dist/discontinuous/elastic/map.js.map +0 -1
  569. package/dist/discontinuous/elastic/source-arc.d.ts.map +0 -1
  570. package/dist/discontinuous/elastic/source-arc.js.map +0 -1
  571. package/dist/discontinuous/global-polygons.d.ts.map +0 -1
  572. package/dist/discontinuous/global-polygons.js.map +0 -1
  573. package/dist/discontinuous/gray-fuller.d.ts.map +0 -1
  574. package/dist/discontinuous/gray-fuller.js.map +0 -1
  575. package/dist/discontinuous/gringorten-kernel.d.ts.map +0 -1
  576. package/dist/discontinuous/gringorten-kernel.js.map +0 -1
  577. package/dist/discontinuous/healpix.d.ts.map +0 -1
  578. package/dist/discontinuous/healpix.js.map +0 -1
  579. package/dist/discontinuous/layout.d.ts.map +0 -1
  580. package/dist/discontinuous/layout.js.map +0 -1
  581. package/dist/discontinuous/map-engine.d.ts +0 -223
  582. package/dist/discontinuous/map-engine.d.ts.map +0 -1
  583. package/dist/discontinuous/map-engine.js +0 -408
  584. package/dist/discontinuous/map-engine.js.map +0 -1
  585. package/dist/discontinuous/map-layout.d.ts +0 -114
  586. package/dist/discontinuous/map-layout.d.ts.map +0 -1
  587. package/dist/discontinuous/map-layout.js +0 -605
  588. package/dist/discontinuous/map-layout.js.map +0 -1
  589. package/dist/discontinuous/map-transition.d.ts.map +0 -1
  590. package/dist/discontinuous/map-transition.js.map +0 -1
  591. package/dist/discontinuous/math.d.ts.map +0 -1
  592. package/dist/discontinuous/math.js.map +0 -1
  593. package/dist/discontinuous/mercator-map.d.ts.map +0 -1
  594. package/dist/discontinuous/mercator-map.js +0 -246
  595. package/dist/discontinuous/mercator-map.js.map +0 -1
  596. package/dist/discontinuous/myriahedral/graticule.d.ts.map +0 -1
  597. package/dist/discontinuous/myriahedral/graticule.js.map +0 -1
  598. package/dist/discontinuous/myriahedral/mesh.d.ts.map +0 -1
  599. package/dist/discontinuous/myriahedral/mesh.js.map +0 -1
  600. package/dist/discontinuous/myriahedral/unfold.d.ts.map +0 -1
  601. package/dist/discontinuous/myriahedral/unfold.js.map +0 -1
  602. package/dist/discontinuous/myriahedral.d.ts.map +0 -1
  603. package/dist/discontinuous/myriahedral.js.map +0 -1
  604. package/dist/discontinuous/petroff.d.ts.map +0 -1
  605. package/dist/discontinuous/petroff.js.map +0 -1
  606. package/dist/discontinuous/polygon-constraints.d.ts.map +0 -1
  607. package/dist/discontinuous/polygon-constraints.js.map +0 -1
  608. package/dist/discontinuous/polyhedral.d.ts.map +0 -1
  609. package/dist/discontinuous/polyhedral.js.map +0 -1
  610. package/dist/discontinuous/prepare-features.d.ts.map +0 -1
  611. package/dist/discontinuous/prepare-features.js.map +0 -1
  612. package/dist/discontinuous/presets.d.ts +0 -71
  613. package/dist/discontinuous/presets.d.ts.map +0 -1
  614. package/dist/discontinuous/presets.js +0 -372
  615. package/dist/discontinuous/presets.js.map +0 -1
  616. package/dist/discontinuous/projection-catalog.d.ts.map +0 -1
  617. package/dist/discontinuous/projection-catalog.js +0 -96
  618. package/dist/discontinuous/projection-catalog.js.map +0 -1
  619. package/dist/discontinuous/quincuncial-kernel.d.ts.map +0 -1
  620. package/dist/discontinuous/quincuncial-kernel.js.map +0 -1
  621. package/dist/discontinuous/quincuncial-star.d.ts.map +0 -1
  622. package/dist/discontinuous/quincuncial-star.js.map +0 -1
  623. package/dist/discontinuous/regional-map.d.ts.map +0 -1
  624. package/dist/discontinuous/regional-map.js.map +0 -1
  625. package/dist/discontinuous/retroazimuthal-map.d.ts.map +0 -1
  626. package/dist/discontinuous/retroazimuthal-map.js.map +0 -1
  627. package/dist/discontinuous/rotated-map.d.ts +0 -40
  628. package/dist/discontinuous/rotated-map.d.ts.map +0 -1
  629. package/dist/discontinuous/rotated-map.js +0 -66
  630. package/dist/discontinuous/rotated-map.js.map +0 -1
  631. package/dist/discontinuous/snyder-mesh.d.ts.map +0 -1
  632. package/dist/discontinuous/snyder-mesh.js.map +0 -1
  633. package/dist/discontinuous/snyder.d.ts.map +0 -1
  634. package/dist/discontinuous/snyder.js.map +0 -1
  635. package/dist/discontinuous/source-arc.d.ts.map +0 -1
  636. package/dist/discontinuous/source-arc.js.map +0 -1
  637. package/dist/discontinuous/spherical-clip/cartesian.d.ts +0 -8
  638. package/dist/discontinuous/spherical-clip/cartesian.d.ts.map +0 -1
  639. package/dist/discontinuous/spherical-clip/cartesian.js.map +0 -1
  640. package/dist/discontinuous/spherical-clip/circle.d.ts.map +0 -1
  641. package/dist/discontinuous/spherical-clip/circle.js.map +0 -1
  642. package/dist/discontinuous/spherical-clip/clip-buffer.d.ts.map +0 -1
  643. package/dist/discontinuous/spherical-clip/clip-buffer.js.map +0 -1
  644. package/dist/discontinuous/spherical-clip/clip-circle.d.ts.map +0 -1
  645. package/dist/discontinuous/spherical-clip/clip-circle.js.map +0 -1
  646. package/dist/discontinuous/spherical-clip/clip-index.d.ts.map +0 -1
  647. package/dist/discontinuous/spherical-clip/clip-index.js.map +0 -1
  648. package/dist/discontinuous/spherical-clip/clip-rejoin.d.ts.map +0 -1
  649. package/dist/discontinuous/spherical-clip/clip-rejoin.js.map +0 -1
  650. package/dist/discontinuous/spherical-clip/helpers.d.ts.map +0 -1
  651. package/dist/discontinuous/spherical-clip/helpers.js.map +0 -1
  652. package/dist/discontinuous/spherical-clip/math.d.ts +0 -26
  653. package/dist/discontinuous/spherical-clip/math.d.ts.map +0 -1
  654. package/dist/discontinuous/spherical-clip/math.js.map +0 -1
  655. package/dist/discontinuous/spherical-clip/noop.d.ts.map +0 -1
  656. package/dist/discontinuous/spherical-clip/noop.js.map +0 -1
  657. package/dist/discontinuous/spherical-clip/pointEqual.d.ts +0 -2
  658. package/dist/discontinuous/spherical-clip/pointEqual.d.ts.map +0 -1
  659. package/dist/discontinuous/spherical-clip/pointEqual.js.map +0 -1
  660. package/dist/discontinuous/spherical-clip/polygonContains.d.ts.map +0 -1
  661. package/dist/discontinuous/spherical-clip/polygonContains.js.map +0 -1
  662. package/dist/discontinuous/world-composite-kernels.d.ts.map +0 -1
  663. package/dist/discontinuous/world-composite-kernels.js.map +0 -1
  664. package/dist/discontinuous/world-kernels/airy.d.ts.map +0 -1
  665. package/dist/discontinuous/world-kernels/airy.js.map +0 -1
  666. package/dist/discontinuous/world-kernels/aitoff.d.ts.map +0 -1
  667. package/dist/discontinuous/world-kernels/aitoff.js.map +0 -1
  668. package/dist/discontinuous/world-kernels/armadillo.d.ts.map +0 -1
  669. package/dist/discontinuous/world-kernels/armadillo.js.map +0 -1
  670. package/dist/discontinuous/world-kernels/august.d.ts.map +0 -1
  671. package/dist/discontinuous/world-kernels/august.js.map +0 -1
  672. package/dist/discontinuous/world-kernels/baker.d.ts.map +0 -1
  673. package/dist/discontinuous/world-kernels/baker.js.map +0 -1
  674. package/dist/discontinuous/world-kernels/bertin.d.ts.map +0 -1
  675. package/dist/discontinuous/world-kernels/bertin.js.map +0 -1
  676. package/dist/discontinuous/world-kernels/boggs.d.ts.map +0 -1
  677. package/dist/discontinuous/world-kernels/boggs.js.map +0 -1
  678. package/dist/discontinuous/world-kernels/bonne.d.ts.map +0 -1
  679. package/dist/discontinuous/world-kernels/bonne.js.map +0 -1
  680. package/dist/discontinuous/world-kernels/bottomley.d.ts.map +0 -1
  681. package/dist/discontinuous/world-kernels/bottomley.js.map +0 -1
  682. package/dist/discontinuous/world-kernels/bromley.d.ts.map +0 -1
  683. package/dist/discontinuous/world-kernels/bromley.js.map +0 -1
  684. package/dist/discontinuous/world-kernels/chamberlin.d.ts.map +0 -1
  685. package/dist/discontinuous/world-kernels/chamberlin.js.map +0 -1
  686. package/dist/discontinuous/world-kernels/collignon.d.ts +0 -5
  687. package/dist/discontinuous/world-kernels/collignon.d.ts.map +0 -1
  688. package/dist/discontinuous/world-kernels/collignon.js.map +0 -1
  689. package/dist/discontinuous/world-kernels/craig.d.ts.map +0 -1
  690. package/dist/discontinuous/world-kernels/craig.js.map +0 -1
  691. package/dist/discontinuous/world-kernels/craster.d.ts +0 -5
  692. package/dist/discontinuous/world-kernels/craster.d.ts.map +0 -1
  693. package/dist/discontinuous/world-kernels/craster.js.map +0 -1
  694. package/dist/discontinuous/world-kernels/cylindricalEqualArea.d.ts.map +0 -1
  695. package/dist/discontinuous/world-kernels/cylindricalEqualArea.js.map +0 -1
  696. package/dist/discontinuous/world-kernels/cylindricalStereographic.d.ts.map +0 -1
  697. package/dist/discontinuous/world-kernels/cylindricalStereographic.js.map +0 -1
  698. package/dist/discontinuous/world-kernels/d3-geo-raw.d.ts.map +0 -1
  699. package/dist/discontinuous/world-kernels/d3-geo-raw.js.map +0 -1
  700. package/dist/discontinuous/world-kernels/eckert1.d.ts +0 -5
  701. package/dist/discontinuous/world-kernels/eckert1.d.ts.map +0 -1
  702. package/dist/discontinuous/world-kernels/eckert1.js.map +0 -1
  703. package/dist/discontinuous/world-kernels/eckert2.d.ts +0 -5
  704. package/dist/discontinuous/world-kernels/eckert2.d.ts.map +0 -1
  705. package/dist/discontinuous/world-kernels/eckert2.js.map +0 -1
  706. package/dist/discontinuous/world-kernels/eckert3.d.ts +0 -5
  707. package/dist/discontinuous/world-kernels/eckert3.d.ts.map +0 -1
  708. package/dist/discontinuous/world-kernels/eckert3.js.map +0 -1
  709. package/dist/discontinuous/world-kernels/eckert4.d.ts +0 -5
  710. package/dist/discontinuous/world-kernels/eckert4.d.ts.map +0 -1
  711. package/dist/discontinuous/world-kernels/eckert4.js.map +0 -1
  712. package/dist/discontinuous/world-kernels/eckert5.d.ts +0 -5
  713. package/dist/discontinuous/world-kernels/eckert5.d.ts.map +0 -1
  714. package/dist/discontinuous/world-kernels/eckert5.js.map +0 -1
  715. package/dist/discontinuous/world-kernels/eckert6.d.ts +0 -5
  716. package/dist/discontinuous/world-kernels/eckert6.d.ts.map +0 -1
  717. package/dist/discontinuous/world-kernels/eckert6.js.map +0 -1
  718. package/dist/discontinuous/world-kernels/eisenlohr.d.ts.map +0 -1
  719. package/dist/discontinuous/world-kernels/eisenlohr.js.map +0 -1
  720. package/dist/discontinuous/world-kernels/fahey.d.ts +0 -5
  721. package/dist/discontinuous/world-kernels/fahey.d.ts.map +0 -1
  722. package/dist/discontinuous/world-kernels/fahey.js.map +0 -1
  723. package/dist/discontinuous/world-kernels/foucaut.d.ts +0 -5
  724. package/dist/discontinuous/world-kernels/foucaut.d.ts.map +0 -1
  725. package/dist/discontinuous/world-kernels/foucaut.js.map +0 -1
  726. package/dist/discontinuous/world-kernels/foucautSinusoidal.d.ts.map +0 -1
  727. package/dist/discontinuous/world-kernels/foucautSinusoidal.js.map +0 -1
  728. package/dist/discontinuous/world-kernels/ginzburg4.d.ts.map +0 -1
  729. package/dist/discontinuous/world-kernels/ginzburg4.js.map +0 -1
  730. package/dist/discontinuous/world-kernels/ginzburg5.d.ts.map +0 -1
  731. package/dist/discontinuous/world-kernels/ginzburg5.js.map +0 -1
  732. package/dist/discontinuous/world-kernels/ginzburg6.d.ts.map +0 -1
  733. package/dist/discontinuous/world-kernels/ginzburg6.js.map +0 -1
  734. package/dist/discontinuous/world-kernels/ginzburg8.d.ts.map +0 -1
  735. package/dist/discontinuous/world-kernels/ginzburg8.js.map +0 -1
  736. package/dist/discontinuous/world-kernels/ginzburg9.d.ts.map +0 -1
  737. package/dist/discontinuous/world-kernels/ginzburg9.js.map +0 -1
  738. package/dist/discontinuous/world-kernels/ginzburgPolyconic.d.ts.map +0 -1
  739. package/dist/discontinuous/world-kernels/ginzburgPolyconic.js.map +0 -1
  740. package/dist/discontinuous/world-kernels/hammer.d.ts.map +0 -1
  741. package/dist/discontinuous/world-kernels/hammer.js.map +0 -1
  742. package/dist/discontinuous/world-kernels/hammerRetroazimuthal.d.ts.map +0 -1
  743. package/dist/discontinuous/world-kernels/hammerRetroazimuthal.js.map +0 -1
  744. package/dist/discontinuous/world-kernels/hill.d.ts.map +0 -1
  745. package/dist/discontinuous/world-kernels/hill.js.map +0 -1
  746. package/dist/discontinuous/world-kernels/homolosine.d.ts +0 -5
  747. package/dist/discontinuous/world-kernels/homolosine.d.ts.map +0 -1
  748. package/dist/discontinuous/world-kernels/homolosine.js.map +0 -1
  749. package/dist/discontinuous/world-kernels/hufnagel.d.ts.map +0 -1
  750. package/dist/discontinuous/world-kernels/hufnagel.js.map +0 -1
  751. package/dist/discontinuous/world-kernels/hyperelliptical.d.ts.map +0 -1
  752. package/dist/discontinuous/world-kernels/hyperelliptical.js.map +0 -1
  753. package/dist/discontinuous/world-kernels/integrate.d.ts.map +0 -1
  754. package/dist/discontinuous/world-kernels/integrate.js.map +0 -1
  755. package/dist/discontinuous/world-kernels/kavrayskiy7.d.ts +0 -5
  756. package/dist/discontinuous/world-kernels/kavrayskiy7.d.ts.map +0 -1
  757. package/dist/discontinuous/world-kernels/kavrayskiy7.js.map +0 -1
  758. package/dist/discontinuous/world-kernels/lagrange.d.ts.map +0 -1
  759. package/dist/discontinuous/world-kernels/lagrange.js.map +0 -1
  760. package/dist/discontinuous/world-kernels/larrivee.d.ts.map +0 -1
  761. package/dist/discontinuous/world-kernels/larrivee.js.map +0 -1
  762. package/dist/discontinuous/world-kernels/laskowski.d.ts.map +0 -1
  763. package/dist/discontinuous/world-kernels/laskowski.js.map +0 -1
  764. package/dist/discontinuous/world-kernels/littrow.d.ts.map +0 -1
  765. package/dist/discontinuous/world-kernels/littrow.js.map +0 -1
  766. package/dist/discontinuous/world-kernels/loximuthal.d.ts.map +0 -1
  767. package/dist/discontinuous/world-kernels/loximuthal.js.map +0 -1
  768. package/dist/discontinuous/world-kernels/math.d.ts +0 -36
  769. package/dist/discontinuous/world-kernels/math.d.ts.map +0 -1
  770. package/dist/discontinuous/world-kernels/math.js.map +0 -1
  771. package/dist/discontinuous/world-kernels/miller.d.ts +0 -5
  772. package/dist/discontinuous/world-kernels/miller.d.ts.map +0 -1
  773. package/dist/discontinuous/world-kernels/miller.js.map +0 -1
  774. package/dist/discontinuous/world-kernels/modifiedStereographic.d.ts.map +0 -1
  775. package/dist/discontinuous/world-kernels/modifiedStereographic.js.map +0 -1
  776. package/dist/discontinuous/world-kernels/mollweide.d.ts.map +0 -1
  777. package/dist/discontinuous/world-kernels/mollweide.js.map +0 -1
  778. package/dist/discontinuous/world-kernels/mtFlatPolarParabolic.d.ts.map +0 -1
  779. package/dist/discontinuous/world-kernels/mtFlatPolarParabolic.js.map +0 -1
  780. package/dist/discontinuous/world-kernels/mtFlatPolarQuartic.d.ts.map +0 -1
  781. package/dist/discontinuous/world-kernels/mtFlatPolarQuartic.js.map +0 -1
  782. package/dist/discontinuous/world-kernels/mtFlatPolarSinusoidal.d.ts.map +0 -1
  783. package/dist/discontinuous/world-kernels/mtFlatPolarSinusoidal.js.map +0 -1
  784. package/dist/discontinuous/world-kernels/naturalEarth2.d.ts.map +0 -1
  785. package/dist/discontinuous/world-kernels/naturalEarth2.js.map +0 -1
  786. package/dist/discontinuous/world-kernels/nellHammer.d.ts.map +0 -1
  787. package/dist/discontinuous/world-kernels/nellHammer.js.map +0 -1
  788. package/dist/discontinuous/world-kernels/newton.d.ts.map +0 -1
  789. package/dist/discontinuous/world-kernels/newton.js.map +0 -1
  790. package/dist/discontinuous/world-kernels/nicolosi.d.ts.map +0 -1
  791. package/dist/discontinuous/world-kernels/nicolosi.js.map +0 -1
  792. package/dist/discontinuous/world-kernels/patterson.d.ts.map +0 -1
  793. package/dist/discontinuous/world-kernels/patterson.js.map +0 -1
  794. package/dist/discontinuous/world-kernels/polyconic.d.ts.map +0 -1
  795. package/dist/discontinuous/world-kernels/polyconic.js.map +0 -1
  796. package/dist/discontinuous/world-kernels/rectangularPolyconic.d.ts.map +0 -1
  797. package/dist/discontinuous/world-kernels/rectangularPolyconic.js.map +0 -1
  798. package/dist/discontinuous/world-kernels/robinson.d.ts.map +0 -1
  799. package/dist/discontinuous/world-kernels/robinson.js.map +0 -1
  800. package/dist/discontinuous/world-kernels/satellite.d.ts.map +0 -1
  801. package/dist/discontinuous/world-kernels/satellite.js.map +0 -1
  802. package/dist/discontinuous/world-kernels/sinuMollweide.d.ts +0 -7
  803. package/dist/discontinuous/world-kernels/sinuMollweide.d.ts.map +0 -1
  804. package/dist/discontinuous/world-kernels/sinuMollweide.js.map +0 -1
  805. package/dist/discontinuous/world-kernels/sinusoidal.d.ts +0 -5
  806. package/dist/discontinuous/world-kernels/sinusoidal.d.ts.map +0 -1
  807. package/dist/discontinuous/world-kernels/sinusoidal.js.map +0 -1
  808. package/dist/discontinuous/world-kernels/times.d.ts.map +0 -1
  809. package/dist/discontinuous/world-kernels/times.js.map +0 -1
  810. package/dist/discontinuous/world-kernels/twoPointEquidistant.d.ts.map +0 -1
  811. package/dist/discontinuous/world-kernels/twoPointEquidistant.js.map +0 -1
  812. package/dist/discontinuous/world-kernels/vanDerGrinten.d.ts.map +0 -1
  813. package/dist/discontinuous/world-kernels/vanDerGrinten.js.map +0 -1
  814. package/dist/discontinuous/world-kernels/vanDerGrinten2.d.ts.map +0 -1
  815. package/dist/discontinuous/world-kernels/vanDerGrinten2.js.map +0 -1
  816. package/dist/discontinuous/world-kernels/vanDerGrinten3.d.ts.map +0 -1
  817. package/dist/discontinuous/world-kernels/vanDerGrinten3.js.map +0 -1
  818. package/dist/discontinuous/world-kernels/vanDerGrinten4.d.ts.map +0 -1
  819. package/dist/discontinuous/world-kernels/vanDerGrinten4.js.map +0 -1
  820. package/dist/discontinuous/world-kernels/wagner.d.ts.map +0 -1
  821. package/dist/discontinuous/world-kernels/wagner.js.map +0 -1
  822. package/dist/discontinuous/world-kernels/wagner4.d.ts.map +0 -1
  823. package/dist/discontinuous/world-kernels/wagner4.js.map +0 -1
  824. package/dist/discontinuous/world-kernels/wagner6.d.ts +0 -5
  825. package/dist/discontinuous/world-kernels/wagner6.d.ts.map +0 -1
  826. package/dist/discontinuous/world-kernels/wagner6.js.map +0 -1
  827. package/dist/discontinuous/world-kernels/wiechel.d.ts.map +0 -1
  828. package/dist/discontinuous/world-kernels/wiechel.js.map +0 -1
  829. package/dist/discontinuous/world-kernels/winkel3.d.ts.map +0 -1
  830. package/dist/discontinuous/world-kernels/winkel3.js.map +0 -1
  831. package/dist/discontinuous/world-kernels.d.ts.map +0 -1
  832. package/dist/discontinuous/world-kernels.js.map +0 -1
  833. package/dist/discontinuous/world-map.d.ts.map +0 -1
  834. package/dist/discontinuous/world-map.js.map +0 -1
  835. package/dist/discontinuous.cjs +0 -8282
  836. package/dist/discontinuous.cjs.map +0 -6
  837. package/dist/discontinuous.d.ts +0 -52
  838. package/dist/discontinuous.d.ts.map +0 -1
  839. package/dist/discontinuous.js +0 -36
  840. package/dist/discontinuous.js.map +0 -1
  841. package/src/discontinuous/elastic/map.ts +0 -621
  842. package/src/discontinuous/map-engine.ts +0 -602
  843. package/src/discontinuous/map-layout.ts +0 -768
  844. package/src/discontinuous/mercator-map.ts +0 -299
  845. package/src/discontinuous/projection-catalog.ts +0 -132
  846. package/src/discontinuous/rotated-map.ts +0 -86
  847. package/src/discontinuous/spherical-clip/cartesian.js +0 -43
  848. package/src/discontinuous/spherical-clip/math.js +0 -45
  849. package/src/discontinuous/spherical-clip/pointEqual.js +0 -10
  850. package/src/discontinuous/world-kernels/collignon.js +0 -17
  851. package/src/discontinuous/world-kernels/craster.js +0 -18
  852. package/src/discontinuous/world-kernels/eckert1.js +0 -18
  853. package/src/discontinuous/world-kernels/eckert2.js +0 -17
  854. package/src/discontinuous/world-kernels/eckert3.js +0 -17
  855. package/src/discontinuous/world-kernels/eckert4.js +0 -24
  856. package/src/discontinuous/world-kernels/eckert5.js +0 -17
  857. package/src/discontinuous/world-kernels/eckert6.js +0 -22
  858. package/src/discontinuous/world-kernels/fahey.js +0 -19
  859. package/src/discontinuous/world-kernels/foucaut.js +0 -20
  860. package/src/discontinuous/world-kernels/kavrayskiy7.js +0 -15
  861. package/src/discontinuous/world-kernels/math.js +0 -98
  862. package/src/discontinuous/world-kernels/miller.js +0 -15
  863. package/src/discontinuous/world-kernels/sinusoidal.js +0 -15
  864. package/src/discontinuous/world-kernels/wagner6.js +0 -15
  865. package/src/discontinuous.ts +0 -142
  866. /package/dist/{discontinuous → maps}/air-ocean-mesh.d.ts +0 -0
  867. /package/dist/{discontinuous → maps}/air-ocean-mesh.js +0 -0
  868. /package/dist/{discontinuous → maps}/albers-usa.d.ts +0 -0
  869. /package/dist/{discontinuous → maps}/albers-usa.js +0 -0
  870. /package/dist/{discontinuous → maps}/cap-map.d.ts +0 -0
  871. /package/dist/{discontinuous → maps}/cap-map.js +0 -0
  872. /package/dist/{discontinuous → maps}/elastic/data.d.ts +0 -0
  873. /package/dist/{discontinuous → maps}/elastic/data.js +0 -0
  874. /package/dist/{discontinuous → maps}/elastic/elasticI.d.ts +0 -0
  875. /package/dist/{discontinuous → maps}/elastic/elasticI.js +0 -0
  876. /package/dist/{discontinuous → maps}/elastic/elasticII.d.ts +0 -0
  877. /package/dist/{discontinuous → maps}/elastic/elasticII.js +0 -0
  878. /package/dist/{discontinuous → maps}/elastic/elasticIII.d.ts +0 -0
  879. /package/dist/{discontinuous → maps}/elastic/elasticIII.js +0 -0
  880. /package/dist/{discontinuous → maps}/elastic/geometry.d.ts +0 -0
  881. /package/dist/{discontinuous → maps}/elastic/geometry.js +0 -0
  882. /package/dist/{discontinuous → maps}/elastic/grid.d.ts +0 -0
  883. /package/dist/{discontinuous → maps}/elastic/grid.js +0 -0
  884. /package/dist/{discontinuous → maps}/elastic/map.d.ts +0 -0
  885. /package/dist/{discontinuous → maps}/elastic/source-arc.d.ts +0 -0
  886. /package/dist/{discontinuous → maps}/elastic/source-arc.js +0 -0
  887. /package/dist/{discontinuous → maps}/global-polygons.d.ts +0 -0
  888. /package/dist/{discontinuous → maps}/global-polygons.js +0 -0
  889. /package/dist/{discontinuous → maps}/gray-fuller.d.ts +0 -0
  890. /package/dist/{discontinuous → maps}/gray-fuller.js +0 -0
  891. /package/dist/{discontinuous → maps}/gringorten-kernel.d.ts +0 -0
  892. /package/dist/{discontinuous → maps}/gringorten-kernel.js +0 -0
  893. /package/dist/{discontinuous → maps}/healpix.d.ts +0 -0
  894. /package/dist/{discontinuous → maps}/healpix.js +0 -0
  895. /package/dist/{discontinuous → maps}/layout.d.ts +0 -0
  896. /package/dist/{discontinuous → maps}/layout.js +0 -0
  897. /package/dist/{discontinuous → maps}/map-transition.d.ts +0 -0
  898. /package/dist/{discontinuous → maps}/map-transition.js +0 -0
  899. /package/dist/{discontinuous → maps}/math.d.ts +0 -0
  900. /package/dist/{discontinuous → maps}/math.js +0 -0
  901. /package/dist/{discontinuous → maps}/mercator-map.d.ts +0 -0
  902. /package/dist/{discontinuous → maps}/myriahedral/graticule.d.ts +0 -0
  903. /package/dist/{discontinuous → maps}/myriahedral/graticule.js +0 -0
  904. /package/dist/{discontinuous → maps}/myriahedral/mesh.d.ts +0 -0
  905. /package/dist/{discontinuous → maps}/myriahedral/mesh.js +0 -0
  906. /package/dist/{discontinuous → maps}/myriahedral/unfold.d.ts +0 -0
  907. /package/dist/{discontinuous → maps}/myriahedral/unfold.js +0 -0
  908. /package/dist/{discontinuous → maps}/myriahedral.d.ts +0 -0
  909. /package/dist/{discontinuous → maps}/myriahedral.js +0 -0
  910. /package/dist/{discontinuous → maps}/petroff.d.ts +0 -0
  911. /package/dist/{discontinuous → maps}/petroff.js +0 -0
  912. /package/dist/{discontinuous → maps}/polygon-constraints.d.ts +0 -0
  913. /package/dist/{discontinuous → maps}/polygon-constraints.js +0 -0
  914. /package/dist/{discontinuous → maps}/polyhedral.d.ts +0 -0
  915. /package/dist/{discontinuous → maps}/polyhedral.js +0 -0
  916. /package/dist/{discontinuous → maps}/prepare-features.d.ts +0 -0
  917. /package/dist/{discontinuous → maps}/prepare-features.js +0 -0
  918. /package/dist/{discontinuous → maps}/projection-catalog.d.ts +0 -0
  919. /package/dist/{discontinuous → maps}/quincuncial-kernel.d.ts +0 -0
  920. /package/dist/{discontinuous → maps}/quincuncial-kernel.js +0 -0
  921. /package/dist/{discontinuous → maps}/quincuncial-star.d.ts +0 -0
  922. /package/dist/{discontinuous → maps}/quincuncial-star.js +0 -0
  923. /package/dist/{discontinuous → maps}/regional-map.d.ts +0 -0
  924. /package/dist/{discontinuous → maps}/regional-map.js +0 -0
  925. /package/dist/{discontinuous → maps}/retroazimuthal-map.d.ts +0 -0
  926. /package/dist/{discontinuous → maps}/retroazimuthal-map.js +0 -0
  927. /package/dist/{discontinuous → maps}/snyder-mesh.d.ts +0 -0
  928. /package/dist/{discontinuous → maps}/snyder-mesh.js +0 -0
  929. /package/dist/{discontinuous → maps}/snyder.d.ts +0 -0
  930. /package/dist/{discontinuous → maps}/snyder.js +0 -0
  931. /package/dist/{discontinuous → maps}/source-arc.d.ts +0 -0
  932. /package/dist/{discontinuous → maps}/source-arc.js +0 -0
  933. /package/dist/{discontinuous → maps}/spherical-clip/cartesian.js +0 -0
  934. /package/dist/{discontinuous → maps}/spherical-clip/circle.d.ts +0 -0
  935. /package/dist/{discontinuous → maps}/spherical-clip/circle.js +0 -0
  936. /package/dist/{discontinuous → maps}/spherical-clip/clip-buffer.d.ts +0 -0
  937. /package/dist/{discontinuous → maps}/spherical-clip/clip-buffer.js +0 -0
  938. /package/dist/{discontinuous → maps}/spherical-clip/clip-circle.d.ts +0 -0
  939. /package/dist/{discontinuous → maps}/spherical-clip/clip-circle.js +0 -0
  940. /package/dist/{discontinuous → maps}/spherical-clip/clip-index.d.ts +0 -0
  941. /package/dist/{discontinuous → maps}/spherical-clip/clip-index.js +0 -0
  942. /package/dist/{discontinuous → maps}/spherical-clip/clip-rejoin.d.ts +0 -0
  943. /package/dist/{discontinuous → maps}/spherical-clip/clip-rejoin.js +0 -0
  944. /package/dist/{discontinuous → maps}/spherical-clip/helpers.d.ts +0 -0
  945. /package/dist/{discontinuous → maps}/spherical-clip/helpers.js +0 -0
  946. /package/dist/{discontinuous → maps}/spherical-clip/math.js +0 -0
  947. /package/dist/{discontinuous → maps}/spherical-clip/noop.d.ts +0 -0
  948. /package/dist/{discontinuous → maps}/spherical-clip/noop.js +0 -0
  949. /package/dist/{discontinuous → maps}/spherical-clip/pointEqual.js +0 -0
  950. /package/dist/{discontinuous → maps}/spherical-clip/polygonContains.d.ts +0 -0
  951. /package/dist/{discontinuous → maps}/spherical-clip/polygonContains.js +0 -0
  952. /package/dist/{discontinuous → maps}/world-composite-kernels.d.ts +0 -0
  953. /package/dist/{discontinuous → maps}/world-composite-kernels.js +0 -0
  954. /package/dist/{discontinuous → maps}/world-kernels/airy.d.ts +0 -0
  955. /package/dist/{discontinuous → maps}/world-kernels/airy.js +0 -0
  956. /package/dist/{discontinuous → maps}/world-kernels/aitoff.d.ts +0 -0
  957. /package/dist/{discontinuous → maps}/world-kernels/aitoff.js +0 -0
  958. /package/dist/{discontinuous → maps}/world-kernels/armadillo.d.ts +0 -0
  959. /package/dist/{discontinuous → maps}/world-kernels/armadillo.js +0 -0
  960. /package/dist/{discontinuous → maps}/world-kernels/august.d.ts +0 -0
  961. /package/dist/{discontinuous → maps}/world-kernels/august.js +0 -0
  962. /package/dist/{discontinuous → maps}/world-kernels/baker.d.ts +0 -0
  963. /package/dist/{discontinuous → maps}/world-kernels/baker.js +0 -0
  964. /package/dist/{discontinuous → maps}/world-kernels/bertin.d.ts +0 -0
  965. /package/dist/{discontinuous → maps}/world-kernels/bertin.js +0 -0
  966. /package/dist/{discontinuous → maps}/world-kernels/boggs.d.ts +0 -0
  967. /package/dist/{discontinuous → maps}/world-kernels/boggs.js +0 -0
  968. /package/dist/{discontinuous → maps}/world-kernels/bonne.d.ts +0 -0
  969. /package/dist/{discontinuous → maps}/world-kernels/bonne.js +0 -0
  970. /package/dist/{discontinuous → maps}/world-kernels/bottomley.d.ts +0 -0
  971. /package/dist/{discontinuous → maps}/world-kernels/bottomley.js +0 -0
  972. /package/dist/{discontinuous → maps}/world-kernels/bromley.d.ts +0 -0
  973. /package/dist/{discontinuous → maps}/world-kernels/bromley.js +0 -0
  974. /package/dist/{discontinuous → maps}/world-kernels/chamberlin.d.ts +0 -0
  975. /package/dist/{discontinuous → maps}/world-kernels/chamberlin.js +0 -0
  976. /package/dist/{discontinuous → maps}/world-kernels/collignon.js +0 -0
  977. /package/dist/{discontinuous → maps}/world-kernels/craig.d.ts +0 -0
  978. /package/dist/{discontinuous → maps}/world-kernels/craig.js +0 -0
  979. /package/dist/{discontinuous → maps}/world-kernels/craster.js +0 -0
  980. /package/dist/{discontinuous → maps}/world-kernels/cylindricalEqualArea.d.ts +0 -0
  981. /package/dist/{discontinuous → maps}/world-kernels/cylindricalEqualArea.js +0 -0
  982. /package/dist/{discontinuous → maps}/world-kernels/cylindricalStereographic.d.ts +0 -0
  983. /package/dist/{discontinuous → maps}/world-kernels/cylindricalStereographic.js +0 -0
  984. /package/dist/{discontinuous → maps}/world-kernels/d3-geo-raw.d.ts +0 -0
  985. /package/dist/{discontinuous → maps}/world-kernels/d3-geo-raw.js +0 -0
  986. /package/dist/{discontinuous → maps}/world-kernels/eckert1.js +0 -0
  987. /package/dist/{discontinuous → maps}/world-kernels/eckert2.js +0 -0
  988. /package/dist/{discontinuous → maps}/world-kernels/eckert3.js +0 -0
  989. /package/dist/{discontinuous → maps}/world-kernels/eckert4.js +0 -0
  990. /package/dist/{discontinuous → maps}/world-kernels/eckert5.js +0 -0
  991. /package/dist/{discontinuous → maps}/world-kernels/eckert6.js +0 -0
  992. /package/dist/{discontinuous → maps}/world-kernels/eisenlohr.d.ts +0 -0
  993. /package/dist/{discontinuous → maps}/world-kernels/eisenlohr.js +0 -0
  994. /package/dist/{discontinuous → maps}/world-kernels/fahey.js +0 -0
  995. /package/dist/{discontinuous → maps}/world-kernels/foucaut.js +0 -0
  996. /package/dist/{discontinuous → maps}/world-kernels/foucautSinusoidal.d.ts +0 -0
  997. /package/dist/{discontinuous → maps}/world-kernels/foucautSinusoidal.js +0 -0
  998. /package/dist/{discontinuous → maps}/world-kernels/ginzburg4.d.ts +0 -0
  999. /package/dist/{discontinuous → maps}/world-kernels/ginzburg4.js +0 -0
  1000. /package/dist/{discontinuous → maps}/world-kernels/ginzburg5.d.ts +0 -0
  1001. /package/dist/{discontinuous → maps}/world-kernels/ginzburg5.js +0 -0
  1002. /package/dist/{discontinuous → maps}/world-kernels/ginzburg6.d.ts +0 -0
  1003. /package/dist/{discontinuous → maps}/world-kernels/ginzburg6.js +0 -0
  1004. /package/dist/{discontinuous → maps}/world-kernels/ginzburg8.d.ts +0 -0
  1005. /package/dist/{discontinuous → maps}/world-kernels/ginzburg8.js +0 -0
  1006. /package/dist/{discontinuous → maps}/world-kernels/ginzburg9.d.ts +0 -0
  1007. /package/dist/{discontinuous → maps}/world-kernels/ginzburg9.js +0 -0
  1008. /package/dist/{discontinuous → maps}/world-kernels/ginzburgPolyconic.d.ts +0 -0
  1009. /package/dist/{discontinuous → maps}/world-kernels/ginzburgPolyconic.js +0 -0
  1010. /package/dist/{discontinuous → maps}/world-kernels/hammer.d.ts +0 -0
  1011. /package/dist/{discontinuous → maps}/world-kernels/hammer.js +0 -0
  1012. /package/dist/{discontinuous → maps}/world-kernels/hammerRetroazimuthal.d.ts +0 -0
  1013. /package/dist/{discontinuous → maps}/world-kernels/hammerRetroazimuthal.js +0 -0
  1014. /package/dist/{discontinuous → maps}/world-kernels/hill.d.ts +0 -0
  1015. /package/dist/{discontinuous → maps}/world-kernels/hill.js +0 -0
  1016. /package/dist/{discontinuous → maps}/world-kernels/homolosine.js +0 -0
  1017. /package/dist/{discontinuous → maps}/world-kernels/hufnagel.d.ts +0 -0
  1018. /package/dist/{discontinuous → maps}/world-kernels/hufnagel.js +0 -0
  1019. /package/dist/{discontinuous → maps}/world-kernels/hyperelliptical.d.ts +0 -0
  1020. /package/dist/{discontinuous → maps}/world-kernels/hyperelliptical.js +0 -0
  1021. /package/dist/{discontinuous → maps}/world-kernels/integrate.d.ts +0 -0
  1022. /package/dist/{discontinuous → maps}/world-kernels/integrate.js +0 -0
  1023. /package/dist/{discontinuous → maps}/world-kernels/kavrayskiy7.js +0 -0
  1024. /package/dist/{discontinuous → maps}/world-kernels/lagrange.d.ts +0 -0
  1025. /package/dist/{discontinuous → maps}/world-kernels/lagrange.js +0 -0
  1026. /package/dist/{discontinuous → maps}/world-kernels/larrivee.d.ts +0 -0
  1027. /package/dist/{discontinuous → maps}/world-kernels/larrivee.js +0 -0
  1028. /package/dist/{discontinuous → maps}/world-kernels/laskowski.d.ts +0 -0
  1029. /package/dist/{discontinuous → maps}/world-kernels/laskowski.js +0 -0
  1030. /package/dist/{discontinuous → maps}/world-kernels/littrow.d.ts +0 -0
  1031. /package/dist/{discontinuous → maps}/world-kernels/littrow.js +0 -0
  1032. /package/dist/{discontinuous → maps}/world-kernels/loximuthal.d.ts +0 -0
  1033. /package/dist/{discontinuous → maps}/world-kernels/loximuthal.js +0 -0
  1034. /package/dist/{discontinuous → maps}/world-kernels/math.js +0 -0
  1035. /package/dist/{discontinuous → maps}/world-kernels/miller.js +0 -0
  1036. /package/dist/{discontinuous → maps}/world-kernels/modifiedStereographic.d.ts +0 -0
  1037. /package/dist/{discontinuous → maps}/world-kernels/modifiedStereographic.js +0 -0
  1038. /package/dist/{discontinuous → maps}/world-kernels/mollweide.d.ts +0 -0
  1039. /package/dist/{discontinuous → maps}/world-kernels/mollweide.js +0 -0
  1040. /package/dist/{discontinuous → maps}/world-kernels/mtFlatPolarParabolic.d.ts +0 -0
  1041. /package/dist/{discontinuous → maps}/world-kernels/mtFlatPolarParabolic.js +0 -0
  1042. /package/dist/{discontinuous → maps}/world-kernels/mtFlatPolarQuartic.d.ts +0 -0
  1043. /package/dist/{discontinuous → maps}/world-kernels/mtFlatPolarQuartic.js +0 -0
  1044. /package/dist/{discontinuous → maps}/world-kernels/mtFlatPolarSinusoidal.d.ts +0 -0
  1045. /package/dist/{discontinuous → maps}/world-kernels/mtFlatPolarSinusoidal.js +0 -0
  1046. /package/dist/{discontinuous → maps}/world-kernels/naturalEarth2.d.ts +0 -0
  1047. /package/dist/{discontinuous → maps}/world-kernels/naturalEarth2.js +0 -0
  1048. /package/dist/{discontinuous → maps}/world-kernels/nellHammer.d.ts +0 -0
  1049. /package/dist/{discontinuous → maps}/world-kernels/nellHammer.js +0 -0
  1050. /package/dist/{discontinuous → maps}/world-kernels/newton.d.ts +0 -0
  1051. /package/dist/{discontinuous → maps}/world-kernels/newton.js +0 -0
  1052. /package/dist/{discontinuous → maps}/world-kernels/nicolosi.d.ts +0 -0
  1053. /package/dist/{discontinuous → maps}/world-kernels/nicolosi.js +0 -0
  1054. /package/dist/{discontinuous → maps}/world-kernels/patterson.d.ts +0 -0
  1055. /package/dist/{discontinuous → maps}/world-kernels/patterson.js +0 -0
  1056. /package/dist/{discontinuous → maps}/world-kernels/polyconic.d.ts +0 -0
  1057. /package/dist/{discontinuous → maps}/world-kernels/polyconic.js +0 -0
  1058. /package/dist/{discontinuous → maps}/world-kernels/rectangularPolyconic.d.ts +0 -0
  1059. /package/dist/{discontinuous → maps}/world-kernels/rectangularPolyconic.js +0 -0
  1060. /package/dist/{discontinuous → maps}/world-kernels/robinson.d.ts +0 -0
  1061. /package/dist/{discontinuous → maps}/world-kernels/robinson.js +0 -0
  1062. /package/dist/{discontinuous → maps}/world-kernels/satellite.d.ts +0 -0
  1063. /package/dist/{discontinuous → maps}/world-kernels/satellite.js +0 -0
  1064. /package/dist/{discontinuous → maps}/world-kernels/sinuMollweide.js +0 -0
  1065. /package/dist/{discontinuous → maps}/world-kernels/sinusoidal.js +0 -0
  1066. /package/dist/{discontinuous → maps}/world-kernels/times.d.ts +0 -0
  1067. /package/dist/{discontinuous → maps}/world-kernels/times.js +0 -0
  1068. /package/dist/{discontinuous → maps}/world-kernels/twoPointEquidistant.d.ts +0 -0
  1069. /package/dist/{discontinuous → maps}/world-kernels/twoPointEquidistant.js +0 -0
  1070. /package/dist/{discontinuous → maps}/world-kernels/vanDerGrinten.d.ts +0 -0
  1071. /package/dist/{discontinuous → maps}/world-kernels/vanDerGrinten.js +0 -0
  1072. /package/dist/{discontinuous → maps}/world-kernels/vanDerGrinten2.d.ts +0 -0
  1073. /package/dist/{discontinuous → maps}/world-kernels/vanDerGrinten2.js +0 -0
  1074. /package/dist/{discontinuous → maps}/world-kernels/vanDerGrinten3.d.ts +0 -0
  1075. /package/dist/{discontinuous → maps}/world-kernels/vanDerGrinten3.js +0 -0
  1076. /package/dist/{discontinuous → maps}/world-kernels/vanDerGrinten4.d.ts +0 -0
  1077. /package/dist/{discontinuous → maps}/world-kernels/vanDerGrinten4.js +0 -0
  1078. /package/dist/{discontinuous → maps}/world-kernels/wagner.d.ts +0 -0
  1079. /package/dist/{discontinuous → maps}/world-kernels/wagner.js +0 -0
  1080. /package/dist/{discontinuous → maps}/world-kernels/wagner4.d.ts +0 -0
  1081. /package/dist/{discontinuous → maps}/world-kernels/wagner4.js +0 -0
  1082. /package/dist/{discontinuous → maps}/world-kernels/wagner6.js +0 -0
  1083. /package/dist/{discontinuous → maps}/world-kernels/wiechel.d.ts +0 -0
  1084. /package/dist/{discontinuous → maps}/world-kernels/wiechel.js +0 -0
  1085. /package/dist/{discontinuous → maps}/world-kernels/winkel3.d.ts +0 -0
  1086. /package/dist/{discontinuous → maps}/world-kernels/winkel3.js +0 -0
  1087. /package/dist/{discontinuous → maps}/world-kernels.d.ts +0 -0
  1088. /package/dist/{discontinuous → maps}/world-kernels.js +0 -0
  1089. /package/dist/{discontinuous → maps}/world-map.d.ts +0 -0
  1090. /package/dist/{discontinuous → maps}/world-map.js +0 -0
  1091. /package/src/{discontinuous → maps}/AIR-OCEAN-LICENSE.txt +0 -0
  1092. /package/src/{discontinuous → maps}/D3-LICENSE.txt +0 -0
  1093. /package/src/{discontinuous → maps}/PETROFF-LICENSE.txt +0 -0
  1094. /package/src/{discontinuous → maps}/PROJ-LICENSE.txt +0 -0
  1095. /package/src/{discontinuous → maps}/air-ocean-mesh.ts +0 -0
  1096. /package/src/{discontinuous → maps}/albers-usa.ts +0 -0
  1097. /package/src/{discontinuous → maps}/cap-map.ts +0 -0
  1098. /package/src/{discontinuous → maps}/elastic/UNLICENSE.txt +0 -0
  1099. /package/src/{discontinuous → maps}/elastic/data.ts +0 -0
  1100. /package/src/{discontinuous → maps}/elastic/elasticI.ts +0 -0
  1101. /package/src/{discontinuous → maps}/elastic/elasticII.ts +0 -0
  1102. /package/src/{discontinuous → maps}/elastic/elasticIII.ts +0 -0
  1103. /package/src/{discontinuous → maps}/elastic/geometry.ts +0 -0
  1104. /package/src/{discontinuous → maps}/elastic/grid.ts +0 -0
  1105. /package/src/{discontinuous → maps}/elastic/source-arc.ts +0 -0
  1106. /package/src/{discontinuous → maps}/global-polygons.ts +0 -0
  1107. /package/src/{discontinuous → maps}/gray-fuller.ts +0 -0
  1108. /package/src/{discontinuous → maps}/gringorten-kernel.ts +0 -0
  1109. /package/src/{discontinuous → maps}/healpix.ts +0 -0
  1110. /package/src/{discontinuous → maps}/layout.ts +0 -0
  1111. /package/src/{discontinuous → maps}/map-transition.ts +0 -0
  1112. /package/src/{discontinuous → maps}/math.ts +0 -0
  1113. /package/src/{discontinuous → maps}/myriahedral/graticule.ts +0 -0
  1114. /package/src/{discontinuous → maps}/myriahedral/mesh.ts +0 -0
  1115. /package/src/{discontinuous → maps}/myriahedral/unfold.ts +0 -0
  1116. /package/src/{discontinuous → maps}/myriahedral.ts +0 -0
  1117. /package/src/{discontinuous → maps}/petroff.ts +0 -0
  1118. /package/src/{discontinuous → maps}/polygon-constraints.ts +0 -0
  1119. /package/src/{discontinuous → maps}/polyhedral.ts +0 -0
  1120. /package/src/{discontinuous → maps}/prepare-features.ts +0 -0
  1121. /package/src/{discontinuous/presets.ts → maps/preset-kernels.ts} +0 -0
  1122. /package/src/{discontinuous → maps}/quincuncial-kernel.ts +0 -0
  1123. /package/src/{discontinuous → maps}/quincuncial-star.ts +0 -0
  1124. /package/src/{discontinuous → maps}/regional-map.ts +0 -0
  1125. /package/src/{discontinuous → maps}/retroazimuthal-map.ts +0 -0
  1126. /package/src/{discontinuous → maps}/snyder-mesh.ts +0 -0
  1127. /package/src/{discontinuous → maps}/snyder.ts +0 -0
  1128. /package/src/{discontinuous → maps}/source-arc.ts +0 -0
  1129. /package/src/{discontinuous → maps}/spherical-clip/D3-GEO-LICENSE.txt +0 -0
  1130. /package/src/{discontinuous → maps}/spherical-clip/circle.js +0 -0
  1131. /package/src/{discontinuous → maps}/spherical-clip/clip-buffer.js +0 -0
  1132. /package/src/{discontinuous → maps}/spherical-clip/clip-circle.js +0 -0
  1133. /package/src/{discontinuous → maps}/spherical-clip/clip-index.js +0 -0
  1134. /package/src/{discontinuous → maps}/spherical-clip/clip-rejoin.js +0 -0
  1135. /package/src/{discontinuous → maps}/spherical-clip/helpers.js +0 -0
  1136. /package/src/{discontinuous/spherical-clip/noop.js → maps/spherical-clip/noop.ts} +0 -0
  1137. /package/src/{discontinuous → maps}/spherical-clip/polygonContains.js +0 -0
  1138. /package/src/{discontinuous → maps}/world-composite-kernels.ts +0 -0
  1139. /package/src/{discontinuous → maps}/world-kernels/INTEGRATE-LICENSE.txt +0 -0
  1140. /package/src/{discontinuous → maps}/world-kernels/airy.js +0 -0
  1141. /package/src/{discontinuous → maps}/world-kernels/aitoff.js +0 -0
  1142. /package/src/{discontinuous → maps}/world-kernels/armadillo.js +0 -0
  1143. /package/src/{discontinuous → maps}/world-kernels/august.js +0 -0
  1144. /package/src/{discontinuous → maps}/world-kernels/baker.js +0 -0
  1145. /package/src/{discontinuous → maps}/world-kernels/bertin.js +0 -0
  1146. /package/src/{discontinuous → maps}/world-kernels/boggs.js +0 -0
  1147. /package/src/{discontinuous → maps}/world-kernels/bonne.js +0 -0
  1148. /package/src/{discontinuous → maps}/world-kernels/bottomley.js +0 -0
  1149. /package/src/{discontinuous → maps}/world-kernels/bromley.js +0 -0
  1150. /package/src/{discontinuous → maps}/world-kernels/chamberlin.js +0 -0
  1151. /package/src/{discontinuous → maps}/world-kernels/craig.js +0 -0
  1152. /package/src/{discontinuous → maps}/world-kernels/cylindricalEqualArea.js +0 -0
  1153. /package/src/{discontinuous → maps}/world-kernels/cylindricalStereographic.js +0 -0
  1154. /package/src/{discontinuous → maps}/world-kernels/d3-geo-raw.js +0 -0
  1155. /package/src/{discontinuous → maps}/world-kernels/eisenlohr.js +0 -0
  1156. /package/src/{discontinuous → maps}/world-kernels/foucautSinusoidal.js +0 -0
  1157. /package/src/{discontinuous → maps}/world-kernels/ginzburg4.js +0 -0
  1158. /package/src/{discontinuous → maps}/world-kernels/ginzburg5.js +0 -0
  1159. /package/src/{discontinuous → maps}/world-kernels/ginzburg6.js +0 -0
  1160. /package/src/{discontinuous → maps}/world-kernels/ginzburg8.js +0 -0
  1161. /package/src/{discontinuous → maps}/world-kernels/ginzburg9.js +0 -0
  1162. /package/src/{discontinuous → maps}/world-kernels/ginzburgPolyconic.js +0 -0
  1163. /package/src/{discontinuous → maps}/world-kernels/hammer.js +0 -0
  1164. /package/src/{discontinuous → maps}/world-kernels/hammerRetroazimuthal.js +0 -0
  1165. /package/src/{discontinuous → maps}/world-kernels/hill.js +0 -0
  1166. /package/src/{discontinuous → maps}/world-kernels/homolosine.js +0 -0
  1167. /package/src/{discontinuous → maps}/world-kernels/hufnagel.js +0 -0
  1168. /package/src/{discontinuous → maps}/world-kernels/hyperelliptical.js +0 -0
  1169. /package/src/{discontinuous → maps}/world-kernels/integrate.js +0 -0
  1170. /package/src/{discontinuous → maps}/world-kernels/lagrange.js +0 -0
  1171. /package/src/{discontinuous → maps}/world-kernels/larrivee.js +0 -0
  1172. /package/src/{discontinuous → maps}/world-kernels/laskowski.js +0 -0
  1173. /package/src/{discontinuous → maps}/world-kernels/littrow.js +0 -0
  1174. /package/src/{discontinuous → maps}/world-kernels/loximuthal.js +0 -0
  1175. /package/src/{discontinuous → maps}/world-kernels/modifiedStereographic.js +0 -0
  1176. /package/src/{discontinuous → maps}/world-kernels/mollweide.js +0 -0
  1177. /package/src/{discontinuous → maps}/world-kernels/mtFlatPolarParabolic.js +0 -0
  1178. /package/src/{discontinuous → maps}/world-kernels/mtFlatPolarQuartic.js +0 -0
  1179. /package/src/{discontinuous → maps}/world-kernels/mtFlatPolarSinusoidal.js +0 -0
  1180. /package/src/{discontinuous → maps}/world-kernels/naturalEarth2.js +0 -0
  1181. /package/src/{discontinuous → maps}/world-kernels/nellHammer.js +0 -0
  1182. /package/src/{discontinuous → maps}/world-kernels/newton.js +0 -0
  1183. /package/src/{discontinuous → maps}/world-kernels/nicolosi.js +0 -0
  1184. /package/src/{discontinuous → maps}/world-kernels/patterson.js +0 -0
  1185. /package/src/{discontinuous → maps}/world-kernels/polyconic.js +0 -0
  1186. /package/src/{discontinuous → maps}/world-kernels/rectangularPolyconic.js +0 -0
  1187. /package/src/{discontinuous → maps}/world-kernels/robinson.js +0 -0
  1188. /package/src/{discontinuous → maps}/world-kernels/satellite.js +0 -0
  1189. /package/src/{discontinuous → maps}/world-kernels/sinuMollweide.js +0 -0
  1190. /package/src/{discontinuous → maps}/world-kernels/times.js +0 -0
  1191. /package/src/{discontinuous → maps}/world-kernels/twoPointEquidistant.js +0 -0
  1192. /package/src/{discontinuous → maps}/world-kernels/vanDerGrinten.js +0 -0
  1193. /package/src/{discontinuous → maps}/world-kernels/vanDerGrinten2.js +0 -0
  1194. /package/src/{discontinuous → maps}/world-kernels/vanDerGrinten3.js +0 -0
  1195. /package/src/{discontinuous → maps}/world-kernels/vanDerGrinten4.js +0 -0
  1196. /package/src/{discontinuous → maps}/world-kernels/wagner.js +0 -0
  1197. /package/src/{discontinuous → maps}/world-kernels/wagner4.js +0 -0
  1198. /package/src/{discontinuous → maps}/world-kernels/wiechel.js +0 -0
  1199. /package/src/{discontinuous → maps}/world-kernels/winkel3.js +0 -0
  1200. /package/src/{discontinuous → maps}/world-kernels.ts +0 -0
  1201. /package/src/{discontinuous → maps}/world-map.ts +0 -0
@@ -10,9 +10,9 @@ var __export = (target, all) => {
10
10
  };
11
11
  var __copyProps = (to, from, except, desc) => {
12
12
  if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ for (let key2 of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key2) && key2 !== except)
15
+ __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
16
16
  }
17
17
  return to;
18
18
  };
@@ -35,23 +35,31 @@ __export(index_exports, {
35
35
  HeightFieldMinMax: () => HeightFieldMinMax,
36
36
  TERRAIN_BUFFER_VERSION: () => TERRAIN_BUFFER_VERSION,
37
37
  TerrainContourBoundaryAxis: () => TerrainContourBoundaryAxis,
38
+ TerrainMorphStatus: () => TerrainMorphStatus,
38
39
  TerrainProfileViewStatus: () => TerrainProfileViewStatus,
39
40
  TerrainSampleStatus: () => TerrainSampleStatus,
40
41
  TerrainSurface: () => TerrainSurface,
41
42
  TerrainVertexHaloStatus: () => TerrainVertexHaloStatus,
42
43
  TiledHeightField: () => TiledHeightField,
44
+ coordinateTerrainLodMorphs: () => coordinateTerrainLodMorphs,
43
45
  createDelatinTerrainMesh: () => createDelatinTerrainMesh,
44
46
  createMartiniTerrainMesh: () => createMartiniTerrainMesh,
45
47
  createTerrainContours: () => createTerrainContours,
46
48
  createTerrainFilteredPyramid: () => createTerrainFilteredPyramid,
47
49
  createTerrainGradientGrid: () => createTerrainGradientGrid,
48
50
  createTerrainGradientPyramid: () => createTerrainGradientPyramid,
51
+ createTerrainIsobands: () => createTerrainIsobands,
52
+ createTerrainLodMorph: () => createTerrainLodMorph,
49
53
  createTerrainMesh: () => createTerrainMesh,
54
+ createTerrainMixedIsobands: () => createTerrainMixedIsobands,
55
+ createTerrainMixedVertexTileHalos: () => createTerrainMixedVertexTileHalos,
50
56
  createTerrainSkirt: () => createTerrainSkirt,
51
57
  createTerrainSlopeAspectGrid: () => createTerrainSlopeAspectGrid,
52
58
  createTerrainSurface: () => createTerrainSurface,
53
59
  createTerrainVertexTileHalos: () => createTerrainVertexTileHalos,
54
60
  diagnoseTerrainContourBoundaries: () => diagnoseTerrainContourBoundaries,
61
+ evaluateTerrainLodMorph: () => evaluateTerrainLodMorph,
62
+ getTerrainHierarchyNode: () => getTerrainHierarchyNode,
55
63
  getTerrainMeshEdge: () => getTerrainMeshEdge,
56
64
  getTerrainProfileHorizon: () => getTerrainProfileHorizon,
57
65
  getTerrainProfileViewshed: () => getTerrainProfileViewshed,
@@ -64,10 +72,23 @@ __export(index_exports, {
64
72
  reconcileTerrainVertexTiles: () => reconcileTerrainVertexTiles,
65
73
  sampleTerrainProfile: () => sampleTerrainProfile,
66
74
  simplifyTerrainContourPaths: () => simplifyTerrainContourPaths,
75
+ simplifyTerrainContourPathsTopology: () => simplifyTerrainContourPathsTopology,
67
76
  stitchTerrainContourTiles: () => stitchTerrainContourTiles,
68
77
  stitchTerrainContours: () => stitchTerrainContours,
69
78
  stitchTerrainMeshEdges: () => stitchTerrainMeshEdges,
70
79
  unpackTerrainHeightField: () => unpackTerrainHeightField,
80
+ updateTerrainBounds: () => updateTerrainBounds,
81
+ updateTerrainBoundsRegions: () => updateTerrainBoundsRegions,
82
+ updateTerrainDelatinMeshRegions: () => updateTerrainDelatinMeshRegions,
83
+ updateTerrainGradientPyramidRegions: () => updateTerrainGradientPyramidRegions,
84
+ updateTerrainGradientPyramids: () => updateTerrainGradientPyramids,
85
+ updateTerrainMartiniMeshRegions: () => updateTerrainMartiniMeshRegions,
86
+ updateTerrainMeshRegions: () => updateTerrainMeshRegions,
87
+ updateTerrainMeshes: () => updateTerrainMeshes,
88
+ updateTerrainMixedGradientGrids: () => updateTerrainMixedGradientGrids,
89
+ updateTerrainMixedVertexTileHalos: () => updateTerrainMixedVertexTileHalos,
90
+ updateTerrainPersistentBounds: () => updateTerrainPersistentBounds,
91
+ updateTerrainPersistentGradients: () => updateTerrainPersistentGradients,
71
92
  updateTerrainVertexTileHalos: () => updateTerrainVertexTileHalos,
72
93
  weldTerrainContourTiles: () => weldTerrainContourTiles,
73
94
  weldTerrainMixedContourTiles: () => weldTerrainMixedContourTiles
@@ -358,19 +379,19 @@ function validateBatch(positions, output) {
358
379
  }
359
380
  const count = positions.length / 2;
360
381
  const buffers = [positions];
361
- for (const [key, size] of [
382
+ for (const [key2, size] of [
362
383
  ["heights", 1],
363
384
  ["statuses", 1],
364
385
  ["gradients", 2],
365
386
  ["normals", 3],
366
387
  ["gradientStatuses", 1]
367
388
  ]) {
368
- const buffer = output[key];
369
- if (buffer === void 0 && key !== "heights" && key !== "statuses")
389
+ const buffer = output[key2];
390
+ if (buffer === void 0 && key2 !== "heights" && key2 !== "statuses")
370
391
  continue;
371
- const byte = key === "statuses" || key === "gradientStatuses";
392
+ const byte = key2 === "statuses" || key2 === "gradientStatuses";
372
393
  if ((byte ? !(buffer instanceof Uint8Array) : !isTerrainArray(buffer)) || buffer.length < count * size) {
373
- throw new Error(`Terrain batch ${key} has an invalid type or insufficient length`);
394
+ throw new Error(`Terrain batch ${key2} has an invalid type or insufficient length`);
374
395
  }
375
396
  for (const other of buffers) {
376
397
  if (buffer.buffer === other.buffer && buffer.byteOffset < other.byteOffset + other.byteLength && other.byteOffset < buffer.byteOffset + buffer.byteLength) {
@@ -405,9 +426,9 @@ function createTerrainSkirt(mesh, options) {
405
426
  if (!Number.isFinite(area) || area <= 0)
406
427
  throw new Error("Terrain skirt requires upward nondegenerate XY triangles");
407
428
  for (let j = 0; j < 3; j++) {
408
- const u = ids[j], v = ids[(j + 1) % 3], key = edgeKey(u, v), prior = boundary.get(key);
429
+ const u = ids[j], v = ids[(j + 1) % 3], key2 = edgeKey(u, v), prior = boundary.get(key2);
409
430
  if (!prior)
410
- boundary.set(key, { a: u, b: v, count: 1 });
431
+ boundary.set(key2, { a: u, b: v, count: 1 });
411
432
  else {
412
433
  if (prior.count !== 1 || prior.a !== v || prior.b !== u)
413
434
  throw new Error("Terrain skirt mesh has nonmanifold or inconsistent edges");
@@ -420,10 +441,10 @@ function createTerrainSkirt(mesh, options) {
420
441
  selected = [];
421
442
  const used = /* @__PURE__ */ new Set();
422
443
  for (let i = 0; i < edges.length; i += 2) {
423
- const key = edgeKey(edges[i], edges[i + 1]), edge = boundary.get(key);
424
- if (!edge || edge.count !== 1 || used.has(key))
444
+ const key2 = edgeKey(edges[i], edges[i + 1]), edge = boundary.get(key2);
445
+ if (!edge || edge.count !== 1 || used.has(key2))
425
446
  throw new Error("Terrain skirt selection must contain unique boundary edges");
426
- used.add(key);
447
+ used.add(key2);
427
448
  selected.push(edge);
428
449
  }
429
450
  } else
@@ -708,10 +729,10 @@ var TiledHeightField = class _TiledHeightField {
708
729
  throw new Error("Terrain requires unique matrix identifiers");
709
730
  for (const tile of props.tiles) {
710
731
  const matrix = this.validateTileId(tile);
711
- const key = tileKey(tile.matrixId, tile.column, tile.row);
712
- if (this.tiles.has(key))
732
+ const key2 = tileKey(tile.matrixId, tile.column, tile.row);
733
+ if (this.tiles.has(key2))
713
734
  throw new Error("Duplicate terrain tile");
714
- this.tiles.set(key, copyTileData(tile, matrix));
735
+ this.tiles.set(key2, copyTileData(tile, matrix));
715
736
  }
716
737
  for (const tile of props.tiles)
717
738
  this.buildHalo(this.getMatrix(tile.matrixId), tile.column, tile.row, props.diagonal);
@@ -740,10 +761,10 @@ var TiledHeightField = class _TiledHeightField {
740
761
  const touched = /* @__PURE__ */ new Map();
741
762
  for (const tile of [...update.tiles ?? [], ...update.remove ?? []]) {
742
763
  this.validateTileId(tile);
743
- const key = tileKey(tile.matrixId, tile.column, tile.row);
744
- if (touched.has(key))
764
+ const key2 = tileKey(tile.matrixId, tile.column, tile.row);
765
+ if (touched.has(key2))
745
766
  throw new Error("Terrain update contains duplicate or conflicting tile identifiers");
746
- touched.set(key, tile);
767
+ touched.set(key2, tile);
747
768
  }
748
769
  for (const tile of update.tiles ?? [])
749
770
  replacements.set(tileKey(tile.matrixId, tile.column, tile.row), copyTileData(tile, this.getMatrix(tile.matrixId)));
@@ -754,18 +775,18 @@ var TiledHeightField = class _TiledHeightField {
754
775
  diagonal: this.diagonal,
755
776
  heightReference: this.heightReference
756
777
  });
757
- for (const [key, tile] of this.tiles)
758
- next.tiles.set(key, tile);
759
- for (const [key, halo] of this.halos)
760
- next.halos.set(key, halo);
778
+ for (const [key2, tile] of this.tiles)
779
+ next.tiles.set(key2, tile);
780
+ for (const [key2, halo] of this.halos)
781
+ next.halos.set(key2, halo);
761
782
  const affected = /* @__PURE__ */ new Map();
762
- for (const [key, tile] of touched) {
763
- if (replacements.has(key))
764
- next.tiles.set(key, replacements.get(key));
783
+ for (const [key2, tile] of touched) {
784
+ if (replacements.has(key2))
785
+ next.tiles.set(key2, replacements.get(key2));
765
786
  else {
766
- if (!next.tiles.delete(key))
787
+ if (!next.tiles.delete(key2))
767
788
  continue;
768
- next.halos.delete(key);
789
+ next.halos.delete(key2);
769
790
  }
770
791
  for (let row = tile.row - 1; row <= tile.row + 1; row++)
771
792
  for (let column = tile.column - 1; column <= tile.column + 1; column++) {
@@ -778,11 +799,11 @@ var TiledHeightField = class _TiledHeightField {
778
799
  }
779
800
  }
780
801
  const changes = [];
781
- for (const [key, tile] of affected) {
782
- if (next.tiles.has(key)) {
802
+ for (const [key2, tile] of affected) {
803
+ if (next.tiles.has(key2)) {
783
804
  next.buildHalo(next.getMatrix(tile.matrixId), tile.column, tile.row, this.diagonal);
784
805
  changes.push({ ...tile, resident: true });
785
- } else if (this.tiles.has(key))
806
+ } else if (this.tiles.has(key2))
786
807
  changes.push(tile);
787
808
  }
788
809
  next.changes = freezeChanges(changes);
@@ -1505,10 +1526,10 @@ function buildTopology(indices, validity) {
1505
1526
  if (!validity[triangle])
1506
1527
  continue;
1507
1528
  const a = indices[i], b = indices[triangle * 3 + (i % 3 + 1) % 3];
1508
- const key = a < b ? `${a}/${b}` : `${b}/${a}`;
1509
- const opposite = edges.get(key);
1529
+ const key2 = a < b ? `${a}/${b}` : `${b}/${a}`;
1530
+ const opposite = edges.get(key2);
1510
1531
  if (opposite === void 0)
1511
- edges.set(key, i);
1532
+ edges.set(key2, i);
1512
1533
  else {
1513
1534
  if (halfedges[opposite] !== -1)
1514
1535
  throw new Error("Nonmanifold terrain edge");
@@ -1678,7 +1699,8 @@ function measureTerrainMeshError(field, mesh, options = {}) {
1678
1699
  const x = mesh.gridCoordinates[i * 2] + shift, y = mesh.gridCoordinates[i * 2 + 1] + shift;
1679
1700
  for (let axis = 0; axis < 2; axis++) {
1680
1701
  const expected = field.origin[axis] - mesh.origin[axis] + x * field.columnStep[axis] + y * field.rowStep[axis];
1681
- if (!Number.isFinite(expected) || mesh.positions[i * 3 + axis] !== expected)
1702
+ const tolerance = Math.min(16 * Number.EPSILON * (Math.abs(field.origin[axis] - mesh.origin[axis]) + Math.abs(x * field.columnStep[axis]) + Math.abs(y * field.rowStep[axis])), 1e-9 * Math.max(Math.abs(field.columnStep[axis]), Math.abs(field.rowStep[axis])));
1703
+ if (!Number.isFinite(expected) || Math.abs(mesh.positions[i * 3 + axis] - expected) > tolerance)
1682
1704
  throw new Error("Terrain mesh XY does not match the source grid frame");
1683
1705
  }
1684
1706
  }
@@ -1713,9 +1735,9 @@ function measureTerrainMeshError(field, mesh, options = {}) {
1713
1735
  throw new Error("Terrain mesh sample-test budget exceeded");
1714
1736
  const dx = baseX + (column + shift) * columnX + (row + shift) * rowX - px;
1715
1737
  const dy = baseY + (column + shift) * columnY + (row + shift) * rowY - py;
1716
- const sign = Math.sign(xyArea), area = Math.abs(xyArea);
1717
- const nu = (dx * vy - dy * vx) * sign;
1718
- const nv = (ux * dy - uy * dx) * sign;
1738
+ const sign2 = Math.sign(xyArea), area = Math.abs(xyArea);
1739
+ const nu = (dx * vy - dy * vx) * sign2;
1740
+ const nv = (ux * dy - uy * dx) * sign2;
1719
1741
  const tolerance = 16 * Number.EPSILON * (Math.abs(dx * vy) + Math.abs(dy * vx) + Math.abs(ux * dy) + Math.abs(uy * dx) + area);
1720
1742
  if (nu < -tolerance || nv < -tolerance || nu + nv > area + tolerance)
1721
1743
  continue;
@@ -2424,8 +2446,8 @@ function createTerrainContours(field, levels, options = {}) {
2424
2446
  const exact = height(a) === level ? a : height(b) === level ? b : void 0;
2425
2447
  return exact === void 0 ? { a, b, key: `e${a}/${b}` } : { a: exact, b: exact, key: `v${exact}` };
2426
2448
  };
2427
- const vertex = ({ a, b, key }) => {
2428
- const existing = vertices.get(key);
2449
+ const vertex = ({ a, b, key: key2 }) => {
2450
+ const existing = vertices.get(key2);
2429
2451
  if (existing !== void 0)
2430
2452
  return existing;
2431
2453
  if (positions.length / 3 >= maxVertices)
@@ -2452,7 +2474,7 @@ function createTerrainContours(field, levels, options = {}) {
2452
2474
  const index = positions.length / 3;
2453
2475
  positions.push(px, py, pz);
2454
2476
  coordinates.push(x, y);
2455
- vertices.set(key, index);
2477
+ vertices.set(key2, index);
2456
2478
  return index;
2457
2479
  };
2458
2480
  const triangle = (a, b, c) => {
@@ -2469,14 +2491,14 @@ function createTerrainContours(field, levels, options = {}) {
2469
2491
  if (hits.length !== 2 || hits[0].key === hits[1].key)
2470
2492
  return;
2471
2493
  const va = vertex(hits[0]), vb = vertex(hits[1]);
2472
- const key = va < vb ? `${va}/${vb}` : `${vb}/${va}`;
2473
- if (edges.has(key))
2494
+ const key2 = va < vb ? `${va}/${vb}` : `${vb}/${va}`;
2495
+ if (edges.has(key2))
2474
2496
  return;
2475
2497
  if (segments.length / 2 >= maxSegments)
2476
2498
  throw new Error("Terrain contour segment capacity exceeded");
2477
2499
  if (positions[3 * va] === positions[3 * vb] && positions[3 * va + 1] === positions[3 * vb + 1])
2478
2500
  throw new Error("Terrain contour segment collapses; use a local origin");
2479
- edges.add(key);
2501
+ edges.add(key2);
2480
2502
  segments.push(va, vb);
2481
2503
  levelIndices.push(levelIndex);
2482
2504
  };
@@ -2563,10 +2585,10 @@ function stitchTerrainContours(contours, options = {}) {
2563
2585
  validateContourVertex(contours, b, level, assignments);
2564
2586
  if (a === b || contours.positions[3 * a] === contours.positions[3 * b] && contours.positions[3 * a + 1] === contours.positions[3 * b + 1])
2565
2587
  throw new Error("Degenerate terrain contour segment");
2566
- const key = a < b ? `${a}/${b}` : `${b}/${a}`;
2567
- if (unique.has(key))
2588
+ const key2 = a < b ? `${a}/${b}` : `${b}/${a}`;
2589
+ if (unique.has(key2))
2568
2590
  throw new Error("Duplicate terrain contour segment");
2569
- unique.add(key);
2591
+ unique.add(key2);
2570
2592
  degrees[a]++;
2571
2593
  degrees[b]++;
2572
2594
  }
@@ -2754,10 +2776,10 @@ function diagnoseTerrainContourBoundaries(contours, options) {
2754
2776
  validateContourVertex(contours, b, level, assignments);
2755
2777
  if (a === b || contours.positions[3 * a] === contours.positions[3 * b] && contours.positions[3 * a + 1] === contours.positions[3 * b + 1])
2756
2778
  throw new Error("Degenerate terrain contour segment");
2757
- const key = a < b ? `${a}/${b}` : `${b}/${a}`;
2758
- if (seen.has(key))
2779
+ const key2 = a < b ? `${a}/${b}` : `${b}/${a}`;
2780
+ if (seen.has(key2))
2759
2781
  throw new Error("Duplicate terrain contour segment");
2760
- seen.add(key);
2782
+ seen.add(key2);
2761
2783
  degrees[a]++;
2762
2784
  degrees[b]++;
2763
2785
  }
@@ -2893,6 +2915,10 @@ function simplifyTerrainContourPaths(paths, options) {
2893
2915
  uses[vertex]++;
2894
2916
  }
2895
2917
  }
2918
+ const protectedIds = new Set(options.protectedVertexIndices);
2919
+ for (const id of protectedIds)
2920
+ if (id >= count)
2921
+ throw new Error("Invalid protected contour vertex");
2896
2922
  const keep = new Uint8Array(paths.indices.length);
2897
2923
  let distanceTests = 0, maxDeviation = 0;
2898
2924
  for (let p = 0; p < pathCount; p++) {
@@ -2903,7 +2929,7 @@ function simplifyTerrainContourPaths(paths, options) {
2903
2929
  keep[start + Math.floor(2 * (end - start) / 3)] = 1;
2904
2930
  }
2905
2931
  for (let i = start; i <= end; i++)
2906
- if (uses[paths.indices[i]] > 1)
2932
+ if (uses[paths.indices[i]] > 1 || protectedIds.has(paths.indices[i]))
2907
2933
  keep[i] = 1;
2908
2934
  const stack = [];
2909
2935
  let previous = start;
@@ -3124,9 +3150,9 @@ function compareTerrainSlopes(a, ad, b, bd) {
3124
3150
  const bytes = new DataView(new ArrayBuffer(8));
3125
3151
  const parts = (value) => {
3126
3152
  bytes.setFloat64(0, Math.abs(value));
3127
- const bits = bytes.getBigUint64(0);
3128
- const exponent = Number(bits >> 52n & 0x7ffn);
3129
- const fraction = bits & 0xfffffffffffffn;
3153
+ const bits2 = bytes.getBigUint64(0);
3154
+ const exponent = Number(bits2 >> 52n & 0x7ffn);
3155
+ const fraction = bits2 & 0xfffffffffffffn;
3130
3156
  return exponent ? [fraction | 0x10000000000000n, exponent - 1075] : [fraction, -1074];
3131
3157
  };
3132
3158
  const [am, ae] = parts(a), [bdm, bde] = parts(bd);
@@ -3243,10 +3269,10 @@ function reconcileTerrainVertexTiles(tiles, options) {
3243
3269
  const shared = /* @__PURE__ */ new Map();
3244
3270
  const result = [];
3245
3271
  for (const tile of sorted) {
3246
- const key = `${tile.column},${tile.row}`;
3247
- if (!Number.isSafeInteger(tile.column) || !Number.isSafeInteger(tile.row) || seen.has(key))
3272
+ const key2 = `${tile.column},${tile.row}`;
3273
+ if (!Number.isSafeInteger(tile.column) || !Number.isSafeInteger(tile.row) || seen.has(key2))
3248
3274
  throw new Error("Invalid or duplicate vertex tile address");
3249
- seen.add(key);
3275
+ seen.add(key2);
3250
3276
  const x = tile.column * (width - 1), y = tile.row * (height - 1);
3251
3277
  if (![x, y, x + width - 1, y + height - 1].every(Number.isSafeInteger))
3252
3278
  throw new Error("Vertex tile lattice overflow");
@@ -3397,20 +3423,20 @@ function getTerrainVertexHaloAffectedTiles(resident, changed, options) {
3397
3423
  if (!Number.isSafeInteger(limit) || limit < 0 || resident.length > limit || changed.length > limit || !Number.isSafeInteger(options.width) || options.width < 2 || !Number.isSafeInteger(options.height) || options.height < 2)
3398
3424
  throw new Error("Invalid vertex halo tile capacity");
3399
3425
  const addresses = /* @__PURE__ */ new Map();
3400
- const key = (tile) => {
3426
+ const key2 = (tile) => {
3401
3427
  if (!Number.isSafeInteger(tile.column) || !Number.isSafeInteger(tile.row))
3402
3428
  throw new Error("Invalid vertex tile address");
3403
3429
  return `${tile.column},${tile.row}`;
3404
3430
  };
3405
3431
  for (const tile of resident) {
3406
- const id = key(tile);
3432
+ const id = key2(tile);
3407
3433
  if (addresses.has(id))
3408
3434
  throw new Error("Duplicate resident vertex tile address");
3409
3435
  addresses.set(id, { column: tile.column, row: tile.row });
3410
3436
  }
3411
3437
  const affected = /* @__PURE__ */ new Map();
3412
3438
  for (const tile of changed) {
3413
- key(tile);
3439
+ key2(tile);
3414
3440
  const rx = options.width === 2 ? 2 : 1, ry = options.height === 2 ? 2 : 1;
3415
3441
  for (let x = -rx; x <= rx; x++)
3416
3442
  for (let y = -ry; y <= ry; y++) {
@@ -3437,26 +3463,26 @@ function updateTerrainVertexTileHalos(previous, resident, changed, options) {
3437
3463
  const equalPair = (a, b) => a[0] === b[0] && a[1] === b[1];
3438
3464
  if (prior.width !== options.width || prior.height !== options.height || !equalPair(prior.origin ?? [0, 0], options.origin ?? [0, 0]) || !equalPair(prior.columnStep ?? [1, 0], options.columnStep ?? [1, 0]) || !equalPair(prior.rowStep ?? [0, 1], options.rowStep ?? [0, 1]) || (prior.heightReference ?? "unknown") !== (options.heightReference ?? "unknown") || (prior.maxHeightDifference ?? 0) !== (options.maxHeightDifference ?? 0))
3439
3465
  throw new Error("Vertex tile options changed; rebuild the full snapshot");
3440
- const key = (t) => `${t.column},${t.row}`;
3466
+ const key2 = (t) => `${t.column},${t.row}`;
3441
3467
  const affected = getTerrainVertexHaloAffectedTiles(resident, changed, options);
3442
3468
  getTerrainVertexHaloAffectedTiles(previous, [], options);
3443
- const previousMap = new Map(previous.map((tile) => [key(tile), tile]));
3444
- const currentKeys = new Set(resident.map(key));
3445
- const changedKeys = new Set(changed.map(key));
3469
+ const previousMap = new Map(previous.map((tile) => [key2(tile), tile]));
3470
+ const currentKeys = new Set(resident.map(key2));
3471
+ const changedKeys = new Set(changed.map(key2));
3446
3472
  for (const tile of resident) {
3447
- if (!previousMap.has(key(tile)) && !changedKeys.has(key(tile)))
3473
+ if (!previousMap.has(key2(tile)) && !changedKeys.has(key2(tile)))
3448
3474
  throw new Error("Unreported vertex tile arrival");
3449
3475
  }
3450
3476
  const removed = [];
3451
3477
  for (const tile of previous) {
3452
- if (!currentKeys.has(key(tile))) {
3453
- if (!changedKeys.has(key(tile)))
3478
+ if (!currentKeys.has(key2(tile))) {
3479
+ if (!changedKeys.has(key2(tile)))
3454
3480
  throw new Error("Unreported vertex tile eviction");
3455
3481
  removed.push({ column: tile.column, row: tile.row });
3456
3482
  }
3457
3483
  }
3458
3484
  removed.sort((a, b) => a.column - b.column || a.row - b.row);
3459
- const affectedKeys = new Set(affected.map(key));
3485
+ const affectedKeys = new Set(affected.map(key2));
3460
3486
  const rx = options.width === 2 ? 2 : 1;
3461
3487
  const ry = options.height === 2 ? 2 : 1;
3462
3488
  const needed = /* @__PURE__ */ new Set();
@@ -3467,12 +3493,12 @@ function updateTerrainVertexTileHalos(previous, resident, changed, options) {
3467
3493
  if (Number.isSafeInteger(column) && Number.isSafeInteger(row))
3468
3494
  needed.add(`${column},${row}`);
3469
3495
  }
3470
- const source = resident.filter((tile) => needed.has(key(tile)));
3496
+ const source = resident.filter((tile) => needed.has(key2(tile)));
3471
3497
  const rebuilt = createTerrainVertexTileHalos(source, options).tiles;
3472
- const results = new Map(previous.filter((tile) => currentKeys.has(key(tile)) && !affectedKeys.has(key(tile))).map((tile) => [key(tile), tile]));
3498
+ const results = new Map(previous.filter((tile) => currentKeys.has(key2(tile)) && !affectedKeys.has(key2(tile))).map((tile) => [key2(tile), tile]));
3473
3499
  for (const tile of rebuilt)
3474
- if (affectedKeys.has(key(tile)))
3475
- results.set(key(tile), tile);
3500
+ if (affectedKeys.has(key2(tile)))
3501
+ results.set(key2(tile), tile);
3476
3502
  if (results.size !== resident.length)
3477
3503
  throw new Error("Incomplete vertex halo update");
3478
3504
  return {
@@ -3583,9 +3609,9 @@ function stitchTerrainMeshEdges(a, edgeA, b, edgeB, options = {}) {
3583
3609
  let direction = 0;
3584
3610
  for (let i = 0; i < mesh.indices.length; i += 3)
3585
3611
  for (let j = 0; j < 3; j++) {
3586
- const u = mesh.indices[i + j], v = mesh.indices[i + (j + 1) % 3], key = pair(u, v);
3587
- if (pairs.has(key)) {
3588
- pairs.set(key, pairs.get(key) + 1);
3612
+ const u = mesh.indices[i + j], v = mesh.indices[i + (j + 1) % 3], key2 = pair(u, v);
3613
+ if (pairs.has(key2)) {
3614
+ pairs.set(key2, pairs.get(key2) + 1);
3589
3615
  const nextDirection = Math.sign(mesh.gridCoordinates[2 * v + 1 - axis] - mesh.gridCoordinates[2 * u + 1 - axis]);
3590
3616
  if (direction && direction !== nextDirection)
3591
3617
  throw new Error("Inconsistent stitching boundary orientation");
@@ -3824,19 +3850,19 @@ function weldTerrainMixedContourTiles(tiles, options = {}) {
3824
3850
  throw new Error("Mixed contour frame overflow");
3825
3851
  const onEdge = x === 0 || y === 0 || x === tile.width - 1 || y === tile.height - 1;
3826
3852
  const xi = Math.floor(sx), yi = Math.floor(sy);
3827
- const key = `${level}/${tile.column + xi}/${sx - xi}/${tile.row + yi}/${sy - yi}`;
3853
+ const key2 = `${level}/${tile.column + xi}/${sx - xi}/${tile.row + yi}/${sy - yi}`;
3828
3854
  if (onEdge) {
3829
3855
  const rounded = `${level}/${gx}/${gy}`;
3830
3856
  const identity = roundedBoundary.get(rounded);
3831
- if (identity !== void 0 && identity !== key)
3857
+ if (identity !== void 0 && identity !== key2)
3832
3858
  throw new Error("Mixed contour lattice loses precision");
3833
- roundedBoundary.set(rounded, key);
3859
+ roundedBoundary.set(rounded, key2);
3834
3860
  }
3835
- if (onEdge && local.has(key))
3861
+ if (onEdge && local.has(key2))
3836
3862
  throw new Error("Duplicate mixed contour boundary vertex");
3837
3863
  if (onEdge)
3838
- local.add(key);
3839
- let id = onEdge ? shared.get(key) : void 0;
3864
+ local.add(key2);
3865
+ let id = onEdge ? shared.get(key2) : void 0;
3840
3866
  if (id !== void 0) {
3841
3867
  if (Math.hypot(px - positions[3 * id], py - positions[3 * id + 1]) > tolerance)
3842
3868
  throw new Error("Mixed contour boundary positions disagree");
@@ -3848,7 +3874,7 @@ function weldTerrainMixedContourTiles(tiles, options = {}) {
3848
3874
  grid.push(gx, gy);
3849
3875
  vertexLevels.push(level);
3850
3876
  if (onEdge) {
3851
- shared.set(key, id);
3877
+ shared.set(key2, id);
3852
3878
  boundary.add(id);
3853
3879
  }
3854
3880
  }
@@ -3860,10 +3886,10 @@ function weldTerrainMixedContourTiles(tiles, options = {}) {
3860
3886
  const level = data.levelIndices[i], a = vertex(data.segments[2 * i], level), b = vertex(data.segments[2 * i + 1], level);
3861
3887
  if (a === b || positions[3 * a] === positions[3 * b] && positions[3 * a + 1] === positions[3 * b + 1])
3862
3888
  throw new Error("Degenerate mixed contour segment");
3863
- const key = a < b ? `${a}/${b}` : `${b}/${a}`;
3864
- if (localEdges.has(key))
3889
+ const key2 = a < b ? `${a}/${b}` : `${b}/${a}`;
3890
+ if (localEdges.has(key2))
3865
3891
  throw new Error("Duplicate mixed contour segment");
3866
- localEdges.add(key);
3892
+ localEdges.add(key2);
3867
3893
  const box = bounds[ti];
3868
3894
  const seam = grid[2 * a] === grid[2 * b] && (grid[2 * a] === box[0] || grid[2 * a] === box[2]) || grid[2 * a + 1] === grid[2 * b + 1] && (grid[2 * a + 1] === box[1] || grid[2 * a + 1] === box[3]);
3869
3895
  edges.push({ a, b, level, tile: ti, seam });
@@ -3890,8 +3916,8 @@ function weldTerrainMixedContourTiles(tiles, options = {}) {
3890
3916
  }
3891
3917
  cuts.sort((u, v) => grid[2 * u + axis] - grid[2 * v + axis]);
3892
3918
  for (let i = 1; i < cuts.length; i++) {
3893
- const u = cuts[i - 1], v = cuts[i], key = u < v ? `${u}/${v}` : `${v}/${u}`;
3894
- const prior = emitted.get(key);
3919
+ const u = cuts[i - 1], v = cuts[i], key2 = u < v ? `${u}/${v}` : `${v}/${u}`;
3920
+ const prior = emitted.get(key2);
3895
3921
  if (prior !== void 0) {
3896
3922
  if (prior === edge.tile)
3897
3923
  throw new Error("Overlapping mixed contour segments within tile");
@@ -3899,7 +3925,7 @@ function weldTerrainMixedContourTiles(tiles, options = {}) {
3899
3925
  }
3900
3926
  if (levels.length >= limits.maxSegments)
3901
3927
  throw new Error("Mixed contour output segment capacity exceeded");
3902
- emitted.set(key, edge.tile);
3928
+ emitted.set(key2, edge.tile);
3903
3929
  segments.push(u, v);
3904
3930
  levels.push(level);
3905
3931
  }
@@ -3914,4 +3940,1493 @@ function weldTerrainMixedContourTiles(tiles, options = {}) {
3914
3940
  heightReference: first.heightReference
3915
3941
  };
3916
3942
  }
3943
+
3944
+ // dist/terrain/sample-triangle-height.js
3945
+ function sampleTerrainTriangleHeight(field, x, y) {
3946
+ if (Number.isInteger(x) && Number.isInteger(y))
3947
+ return field.getHeight(x, y);
3948
+ const column = Math.min(Math.floor(x), field.width - 2);
3949
+ const row = Math.min(Math.floor(y), field.height - 2);
3950
+ const u = x - column, v = y - row;
3951
+ let a, b, c, d;
3952
+ if (field.diagonal === "00-11") {
3953
+ if (v <= u) {
3954
+ a = 1 - u;
3955
+ b = u - v;
3956
+ c = 0;
3957
+ d = v;
3958
+ } else {
3959
+ a = 1 - v;
3960
+ b = 0;
3961
+ c = v - u;
3962
+ d = u;
3963
+ }
3964
+ } else if (u + v <= 1) {
3965
+ a = 1 - u - v;
3966
+ b = u;
3967
+ c = v;
3968
+ d = 0;
3969
+ } else {
3970
+ a = 0;
3971
+ b = 1 - v;
3972
+ c = 1 - u;
3973
+ d = u + v - 1;
3974
+ }
3975
+ const za = a ? field.getHeight(column, row) : 0;
3976
+ const zb = b ? field.getHeight(column + 1, row) : 0;
3977
+ const zc = c ? field.getHeight(column, row + 1) : 0;
3978
+ const zd = d ? field.getHeight(column + 1, row + 1) : 0;
3979
+ if (za === void 0 || zb === void 0 || zc === void 0 || zd === void 0)
3980
+ return void 0;
3981
+ const height = a * za + b * zb + c * zc + d * zd;
3982
+ if (!Number.isFinite(height))
3983
+ throw new Error("Terrain triangle numeric sampling failure");
3984
+ return height;
3985
+ }
3986
+
3987
+ // dist/terrain/mixed-vertex-halos.js
3988
+ function createTerrainMixedVertexTileHalos(tiles, options = {}) {
3989
+ return buildMixedVertexTileHalos(tiles, options);
3990
+ }
3991
+ function buildMixedVertexTileHalos(tiles, options = {}, targets) {
3992
+ const maxSamples = options.maxSamples ?? 4e6, maxTests = options.maxTileTests ?? 1e7;
3993
+ if (![maxSamples, maxTests].every((v) => Number.isSafeInteger(v) && v >= 0))
3994
+ throw new Error("Invalid mixed halo capacity");
3995
+ let count = 0;
3996
+ const addresses = /* @__PURE__ */ new Set();
3997
+ let frame;
3998
+ const sources = [...tiles].sort((a, b) => a.spacing - b.spacing || a.column - b.column || a.row - b.row).map((tile) => {
3999
+ if (![tile.column, tile.row, tile.spacing].every(Number.isSafeInteger) || tile.spacing < 1 || 2 ** Math.round(Math.log2(tile.spacing)) !== tile.spacing)
4000
+ throw new Error("Invalid mixed halo lattice");
4001
+ const key2 = `${tile.spacing}/${tile.column}/${tile.row}`;
4002
+ if (addresses.has(key2))
4003
+ throw new Error("Duplicate mixed halo tile");
4004
+ addresses.add(key2);
4005
+ count += (tile.field.width + 2) * (tile.field.height + 2);
4006
+ if (!Number.isSafeInteger(count) || count > maxSamples)
4007
+ throw new Error("Mixed halo sample capacity exceeded");
4008
+ const field = new HeightField(tile.field);
4009
+ if (field.registration !== "vertex")
4010
+ throw new Error("Mixed halos require vertex registration");
4011
+ const column = field.columnStep.map((v) => v / tile.spacing);
4012
+ const row = field.rowStep.map((v) => v / tile.spacing);
4013
+ const origin = field.origin.map((v, axis) => v - tile.column * column[axis] - tile.row * row[axis]);
4014
+ const scale = field.origin.map((v, i) => Math.max(1, Math.abs(v), Math.abs(tile.column * column[i]), Math.abs(tile.row * row[i])));
4015
+ if (!origin.every(Number.isFinite))
4016
+ throw new Error("Mixed halo coordinate overflow");
4017
+ if (frame && (frame.reference !== field.heightReference || column.some((v, i) => v !== frame.column[i]) || row.some((v, i) => v !== frame.row[i]) || origin.some((v, i) => Math.abs(v - frame.origin[i]) > Math.min(16 * Number.EPSILON * Math.max(scale[i], frame.scale[i]), 1e-9 * Math.max(Math.abs(column[i]), Math.abs(row[i]))))))
4018
+ throw new Error("Mixed halo frames or height references differ");
4019
+ frame ?? (frame = { origin, column, row, reference: field.heightReference, scale });
4020
+ return { ...tile, source: field };
4021
+ });
4022
+ for (const axis of ["column", "row"]) {
4023
+ let min = Infinity, max = -Infinity;
4024
+ for (const tile of sources) {
4025
+ const size = axis === "column" ? tile.source.width : tile.source.height;
4026
+ const low = tile[axis] - tile.spacing, high = tile[axis] + size * tile.spacing;
4027
+ if (![low, high].every(Number.isSafeInteger))
4028
+ throw new Error("Mixed halo lattice overflow");
4029
+ min = Math.min(min, low);
4030
+ max = Math.max(max, high);
4031
+ }
4032
+ if (sources.length && !Number.isSafeInteger(max - min))
4033
+ throw new Error("Mixed halo lattice span overflow");
4034
+ }
4035
+ let tests = 0;
4036
+ return {
4037
+ tiles: sources.filter((tile) => !targets || targets.has(`${tile.spacing}/${tile.column}/${tile.row}`)).map((tile) => {
4038
+ const source = tile.source, width = source.width + 2, height = source.height + 2;
4039
+ const heights = new Float64Array(width * height), validity = new Uint8Array(heights.length), statuses = new Uint8Array(heights.length);
4040
+ for (let y = 0; y < height; y++)
4041
+ for (let x = 0; x < width; x++) {
4042
+ const gx = tile.column + (x - 1) * tile.spacing, gy = tile.row + (y - 1) * tile.spacing;
4043
+ if (![gx, gy].every(Number.isSafeInteger))
4044
+ throw new Error("Mixed halo lattice overflow");
4045
+ for (const candidate of sources) {
4046
+ if (++tests > maxTests)
4047
+ throw new Error("Mixed halo tile-test budget exceeded");
4048
+ const cx = (gx - candidate.column) / candidate.spacing, cy = (gy - candidate.row) / candidate.spacing;
4049
+ const f = candidate.source;
4050
+ if (cx < 0 || cy < 0 || cx > f.width - 1 || cy > f.height - 1)
4051
+ continue;
4052
+ const value = sampleTerrainTriangleHeight(f, cx, cy);
4053
+ const i = y * width + x;
4054
+ statuses[i] = value === void 0 ? 1 : 2;
4055
+ if (value !== void 0) {
4056
+ heights[i] = value;
4057
+ validity[i] = 1;
4058
+ }
4059
+ break;
4060
+ }
4061
+ }
4062
+ const origin = [
4063
+ source.origin[0] - source.columnStep[0] - source.rowStep[0],
4064
+ source.origin[1] - source.columnStep[1] - source.rowStep[1]
4065
+ ];
4066
+ if (!origin.every(Number.isFinite))
4067
+ throw new Error("Mixed halo coordinate overflow");
4068
+ return {
4069
+ column: tile.column,
4070
+ row: tile.row,
4071
+ spacing: tile.spacing,
4072
+ statuses,
4073
+ field: {
4074
+ ...tile.field,
4075
+ width,
4076
+ height,
4077
+ heights,
4078
+ validity,
4079
+ offset: 0,
4080
+ stride: width,
4081
+ origin,
4082
+ columnStep: [...source.columnStep],
4083
+ rowStep: [...source.rowStep]
4084
+ }
4085
+ };
4086
+ })
4087
+ };
4088
+ }
4089
+
4090
+ // dist/terrain/mixed-halo-update.js
4091
+ var key = (t) => `${t.spacing}/${t.column}/${t.row}`;
4092
+ function updateTerrainMixedVertexTileHalos(previous, resident, options = {}) {
4093
+ const budget = options.maxDependencyTests ?? 1e7;
4094
+ if (!Number.isSafeInteger(budget) || budget < 0)
4095
+ throw new Error("Invalid mixed halo dependency budget");
4096
+ const old = new Map(previous == null ? void 0 : previous.sources.map((t) => [key(t), t]));
4097
+ const current = new Map(resident.map((t) => [key(t), t]));
4098
+ const changed = [...old.values()].filter((t) => current.get(key(t)) !== t).concat(resident.filter((t) => old.get(key(t)) !== t));
4099
+ const cached = new Map(previous == null ? void 0 : previous.tiles.map((t) => [key(t), t]));
4100
+ const targets = /* @__PURE__ */ new Set();
4101
+ let tests = 0;
4102
+ for (const tile of resident) {
4103
+ if (!cached.has(key(tile)))
4104
+ targets.add(key(tile));
4105
+ for (const source of changed) {
4106
+ if (++tests > budget)
4107
+ throw new Error("Mixed halo dependency budget exceeded");
4108
+ if (tile.column - tile.spacing <= source.column + (source.field.width - 1) * source.spacing && tile.column + tile.field.width * tile.spacing >= source.column && tile.row - tile.spacing <= source.row + (source.field.height - 1) * source.spacing && tile.row + tile.field.height * tile.spacing >= source.row)
4109
+ targets.add(key(tile));
4110
+ }
4111
+ }
4112
+ const built = buildMixedVertexTileHalos(resident, options, targets).tiles;
4113
+ for (const tile of built)
4114
+ cached.set(key(tile), tile);
4115
+ const tiles = resident.map((t) => cached.get(key(t))).sort((a, b) => a.spacing - b.spacing || a.column - b.column || a.row - b.row);
4116
+ return {
4117
+ sources: resident.slice(),
4118
+ tiles,
4119
+ rebuilt: built.map(key),
4120
+ removed: [...old.keys()].filter((k) => !current.has(k)).sort()
4121
+ };
4122
+ }
4123
+
4124
+ // dist/terrain/mixed-gradient-update.js
4125
+ function updateTerrainMixedGradientGrids(previous, halos, options = {}) {
4126
+ const method = options.method ?? "horn";
4127
+ if (method !== "horn" && method !== "zevenbergen-thorne")
4128
+ throw new Error("Unknown terrain gradient method");
4129
+ const limit = options.maxSamples ?? 4e6;
4130
+ const count = halos.tiles.reduce((n, t) => n + t.field.width * t.field.height, 0);
4131
+ if (!Number.isSafeInteger(limit) || limit < 0 || !Number.isSafeInteger(count) || count > limit)
4132
+ throw new Error("Mixed gradient sample capacity exceeded");
4133
+ const cache = new Map((previous == null ? void 0 : previous.method) === method ? previous.tiles.map((t) => [t.halo, t]) : []);
4134
+ return {
4135
+ method,
4136
+ tiles: halos.tiles.map((halo) => cache.get(halo) ?? {
4137
+ halo,
4138
+ grid: createTerrainGradientGrid(new HeightField(halo.field), { method, maxSamples: limit })
4139
+ })
4140
+ };
4141
+ }
4142
+
4143
+ // dist/terrain/box-index.js
4144
+ var overlaps = (a, b) => a.minX <= b.maxX && b.minX <= a.maxX && a.minY <= b.maxY && b.minY <= a.maxY;
4145
+ function createTerrainBoxIndex(boxes) {
4146
+ const build = (ids) => {
4147
+ const box = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };
4148
+ for (const id of ids) {
4149
+ const b = boxes[id];
4150
+ box.minX = Math.min(box.minX, b.minX);
4151
+ box.minY = Math.min(box.minY, b.minY);
4152
+ box.maxX = Math.max(box.maxX, b.maxX);
4153
+ box.maxY = Math.max(box.maxY, b.maxY);
4154
+ }
4155
+ if (ids.length <= 8)
4156
+ return { ...box, ids };
4157
+ const axis = box.maxX - box.minX >= box.maxY - box.minY ? "X" : "Y";
4158
+ ids.sort((a, b) => boxes[a][`min${axis}`] / 2 + boxes[a][`max${axis}`] / 2 - (boxes[b][`min${axis}`] / 2 + boxes[b][`max${axis}`] / 2) || a - b);
4159
+ const mid = ids.length >>> 1;
4160
+ return { ...box, left: build(ids.slice(0, mid)), right: build(ids.slice(mid)) };
4161
+ };
4162
+ const root = build(boxes.map((_, i) => i));
4163
+ return (query, charge) => {
4164
+ const found = [], stack = [root];
4165
+ while (stack.length) {
4166
+ charge();
4167
+ const node = stack.pop();
4168
+ if (!overlaps(node, query))
4169
+ continue;
4170
+ if (node.ids) {
4171
+ for (const id of node.ids) {
4172
+ charge();
4173
+ if (overlaps(boxes[id], query))
4174
+ found.push(id);
4175
+ }
4176
+ } else
4177
+ stack.push(node.right, node.left);
4178
+ }
4179
+ return found.sort((a, b) => a - b);
4180
+ };
4181
+ }
4182
+
4183
+ // dist/terrain/contour-topology.js
4184
+ var bits = new DataView(new ArrayBuffer(8));
4185
+ function integer(x) {
4186
+ bits.setFloat64(0, x);
4187
+ const high = bits.getUint32(0), low = bits.getUint32(4);
4188
+ const exponent = high >>> 20 & 2047;
4189
+ const mantissa = BigInt(high & 1048575) << 32n | BigInt(low);
4190
+ const value = exponent ? (1n << 52n | mantissa) << BigInt(exponent - 1) : mantissa;
4191
+ return high >>> 31 ? -value : value;
4192
+ }
4193
+ var orientation = (a, b, c) => (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
4194
+ var sign = (v) => v < 0n ? -1 : v > 0n ? 1 : 0;
4195
+ var between = (a, b, p) => p >= (a < b ? a : b) && p <= (a > b ? a : b);
4196
+ var on = (a, b, p) => orientation(a, b, p) === 0n && between(a.x, b.x, p.x) && between(a.y, b.y, p.y);
4197
+ function intersects(a, b, c, d) {
4198
+ return on(a, b, c) || on(a, b, d) || on(c, d, a) || on(c, d, b) || sign(orientation(a, b, c)) * sign(orientation(a, b, d)) < 0 && sign(orientation(c, d, a)) * sign(orientation(c, d, b)) < 0;
4199
+ }
4200
+ function simplifyTerrainContourPathsTopology(paths, options) {
4201
+ if (options.rejection !== void 0 && options.rejection !== "batch" && options.rejection !== "path")
4202
+ throw new Error("Invalid contour rejection policy");
4203
+ const candidate = simplifyTerrainContourPaths(paths, options);
4204
+ const budget = options.maxTopologyTests ?? 1e6;
4205
+ if (!Number.isSafeInteger(budget) || budget < 0)
4206
+ throw new Error("Invalid contour topology budget");
4207
+ let topologyTests = 0;
4208
+ const charge = () => {
4209
+ if (++topologyTests > budget)
4210
+ throw new Error("Contour topology work budget exceeded");
4211
+ };
4212
+ const points = new Array(paths.positions.length / 3);
4213
+ for (const i of new Set(paths.indices))
4214
+ points[i] = { x: integer(paths.positions[3 * i]), y: integer(paths.positions[3 * i + 1]) };
4215
+ const edges = [];
4216
+ for (let p = 0; p < paths.closed.length; p++)
4217
+ for (let i = paths.offsets[p]; i + 1 < paths.offsets[p + 1]; i++)
4218
+ edges.push({ a: paths.indices[i], b: paths.indices[i + 1], p, i });
4219
+ const box = (a, b) => ({
4220
+ minX: Math.min(paths.positions[3 * a], paths.positions[3 * b]),
4221
+ maxX: Math.max(paths.positions[3 * a], paths.positions[3 * b]),
4222
+ minY: Math.min(paths.positions[3 * a + 1], paths.positions[3 * b + 1]),
4223
+ maxY: Math.max(paths.positions[3 * a + 1], paths.positions[3 * b + 1])
4224
+ });
4225
+ const edgeBoxes = edges.map((e) => box(e.a, e.b)), edgeIndex = createTerrainBoxIndex(edgeBoxes);
4226
+ const vertexIds = [...new Set(paths.indices)], vertexIndex = createTerrainBoxIndex(vertexIds.map((v) => box(v, v)));
4227
+ for (let i = 0; i < edges.length; i++)
4228
+ for (const j of edgeIndex(edgeBoxes[i], charge)) {
4229
+ if (j <= i)
4230
+ continue;
4231
+ charge();
4232
+ const a = edges[i], b = edges[j];
4233
+ const common = [a.a, a.b].filter((v) => v === b.a || v === b.b);
4234
+ if (common.length === 1) {
4235
+ const v = common[0], x = a.a === v ? a.b : a.a, y = b.a === v ? b.b : b.a;
4236
+ if (on(points[v], points[x], points[y]) || on(points[v], points[y], points[x]))
4237
+ throw new Error("Overlapping contour edges");
4238
+ } else if (intersects(points[a.a], points[a.b], points[b.a], points[b.b]))
4239
+ throw new Error("Contour input has crossings or unshared touches");
4240
+ }
4241
+ let rejected = false;
4242
+ const rejectedPaths = /* @__PURE__ */ new Set();
4243
+ for (let p = 0; p < paths.closed.length; p++) {
4244
+ let start = paths.offsets[p];
4245
+ for (let k = candidate.offsets[p] + 1; k < candidate.offsets[p + 1]; k++) {
4246
+ const endId = candidate.sourceVertexIndices[candidate.indices[k]];
4247
+ let end = start + 1;
4248
+ while (paths.indices[end] !== endId)
4249
+ end++;
4250
+ if (end > start + 1) {
4251
+ const a = paths.indices[start], b = paths.indices[end];
4252
+ const pa = points[a], pb = points[b];
4253
+ const axis = pa.x !== pb.x ? "x" : "y";
4254
+ const direction = sign(pb[axis] - pa[axis]);
4255
+ let straight = true;
4256
+ for (let i = start + 1; i <= end; i++) {
4257
+ charge();
4258
+ const q = points[paths.indices[i]], prior = points[paths.indices[i - 1]];
4259
+ if (!on(pa, pb, q) || sign(q[axis] - prior[axis]) !== direction)
4260
+ straight = false;
4261
+ }
4262
+ const interior = new Set(Array.from(paths.indices.subarray(start + 1, end)));
4263
+ let unsafe = false;
4264
+ for (const edgeId of edgeIndex(box(a, b), charge)) {
4265
+ const edge = edges[edgeId];
4266
+ if (edge.p === p && edge.i >= start && edge.i < end) {
4267
+ if (straight)
4268
+ continue;
4269
+ charge();
4270
+ const others2 = [edge.a, edge.b].filter((v) => v !== a && v !== b);
4271
+ if (others2.some((v) => on(points[a], points[b], points[v])) || others2.length === 2 && intersects(points[a], points[b], points[edge.a], points[edge.b]))
4272
+ unsafe = true;
4273
+ continue;
4274
+ }
4275
+ charge();
4276
+ const others = [edge.a, edge.b].filter((v) => v !== a && v !== b);
4277
+ if (others.some((v) => on(points[a], points[b], points[v])) || others.length === 2 && intersects(points[a], points[b], points[edge.a], points[edge.b]))
4278
+ unsafe = true;
4279
+ }
4280
+ const swept = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };
4281
+ for (let i = start; i <= end; i++) {
4282
+ const v = paths.indices[i];
4283
+ swept.minX = Math.min(swept.minX, paths.positions[3 * v]);
4284
+ swept.maxX = Math.max(swept.maxX, paths.positions[3 * v]);
4285
+ swept.minY = Math.min(swept.minY, paths.positions[3 * v + 1]);
4286
+ swept.maxY = Math.max(swept.maxY, paths.positions[3 * v + 1]);
4287
+ }
4288
+ for (const vertexId of vertexIndex(swept, charge)) {
4289
+ const vertex = vertexIds[vertexId];
4290
+ if (vertex === a || vertex === b || interior.has(vertex))
4291
+ continue;
4292
+ let inside = false;
4293
+ for (let i = start, j = end; i <= end; j = i++) {
4294
+ charge();
4295
+ const u = points[paths.indices[i]], v = points[paths.indices[j]], q = points[vertex];
4296
+ if (on(u, v, q)) {
4297
+ unsafe = true;
4298
+ break;
4299
+ }
4300
+ if (u.y > q.y !== v.y > q.y && orientation(u, v, q) > 0n === v.y > u.y)
4301
+ inside = !inside;
4302
+ }
4303
+ if (inside)
4304
+ unsafe = true;
4305
+ }
4306
+ if (unsafe) {
4307
+ rejected = true;
4308
+ rejectedPaths.add(p);
4309
+ }
4310
+ }
4311
+ start = end;
4312
+ }
4313
+ }
4314
+ const outputEdges = [];
4315
+ for (let p = 0; p < candidate.closed.length; p++)
4316
+ for (let i = candidate.offsets[p]; i + 1 < candidate.offsets[p + 1]; i++)
4317
+ outputEdges.push({
4318
+ p,
4319
+ a: candidate.sourceVertexIndices[candidate.indices[i]],
4320
+ b: candidate.sourceVertexIndices[candidate.indices[i + 1]]
4321
+ });
4322
+ const outputBoxes = outputEdges.map((e) => box(e.a, e.b)), outputIndex = createTerrainBoxIndex(outputBoxes);
4323
+ for (let i = 0; i < outputEdges.length; i++)
4324
+ for (const j of outputIndex(outputBoxes[i], charge)) {
4325
+ if (j <= i)
4326
+ continue;
4327
+ charge();
4328
+ const a = outputEdges[i], b = outputEdges[j];
4329
+ const common = [a.a, a.b].filter((v) => v === b.a || v === b.b);
4330
+ if (common.length === 1) {
4331
+ const v = common[0], x = a.a === v ? a.b : a.a, y = b.a === v ? b.b : b.a;
4332
+ if (on(points[v], points[x], points[y]) || on(points[v], points[y], points[x])) {
4333
+ rejected = true;
4334
+ rejectedPaths.add(a.p);
4335
+ rejectedPaths.add(b.p);
4336
+ }
4337
+ } else if (intersects(points[a.a], points[a.b], points[b.a], points[b.b])) {
4338
+ rejected = true;
4339
+ rejectedPaths.add(a.p);
4340
+ rejectedPaths.add(b.p);
4341
+ }
4342
+ }
4343
+ if (rejected && options.rejection === "path") {
4344
+ const indices = [], offsets = [0];
4345
+ for (let p = 0; p < paths.closed.length; p++) {
4346
+ if (rejectedPaths.has(p))
4347
+ for (let i = paths.offsets[p]; i < paths.offsets[p + 1]; i++)
4348
+ indices.push(paths.indices[i]);
4349
+ else
4350
+ for (let i = candidate.offsets[p]; i < candidate.offsets[p + 1]; i++)
4351
+ indices.push(candidate.sourceVertexIndices[candidate.indices[i]]);
4352
+ offsets.push(indices.length);
4353
+ }
4354
+ return {
4355
+ ...paths,
4356
+ positions: paths.positions.slice(),
4357
+ gridCoordinates: paths.gridCoordinates.slice(),
4358
+ indices: Uint32Array.from(indices),
4359
+ offsets: Uint32Array.from(offsets),
4360
+ closed: paths.closed.slice(),
4361
+ levelIndices: paths.levelIndices.slice(),
4362
+ levels: paths.levels.slice(),
4363
+ origin: Object.freeze([...paths.origin]),
4364
+ sourceVertexIndices: Uint32Array.from({ length: points.length }, (_, i) => i),
4365
+ maxDeviation: candidate.maxDeviation,
4366
+ requestedMaxError: options.maxError,
4367
+ distanceTests: candidate.distanceTests,
4368
+ topologyTests,
4369
+ rejected: true
4370
+ };
4371
+ }
4372
+ if (!rejected)
4373
+ return { ...candidate, topologyTests, rejected: false };
4374
+ return {
4375
+ ...paths,
4376
+ positions: paths.positions.slice(),
4377
+ gridCoordinates: paths.gridCoordinates.slice(),
4378
+ indices: paths.indices.slice(),
4379
+ offsets: paths.offsets.slice(),
4380
+ levelIndices: paths.levelIndices.slice(),
4381
+ closed: paths.closed.slice(),
4382
+ levels: paths.levels.slice(),
4383
+ origin: Object.freeze([...paths.origin]),
4384
+ sourceVertexIndices: Uint32Array.from({ length: points.length }, (_, i) => i),
4385
+ maxDeviation: 0,
4386
+ requestedMaxError: options.maxError,
4387
+ distanceTests: candidate.distanceTests,
4388
+ topologyTests,
4389
+ rejected: true
4390
+ };
4391
+ }
4392
+
4393
+ // dist/terrain/isobands.js
4394
+ function createTerrainIsobands(fields, levels, options = {}) {
4395
+ const maxLevels = options.maxLevels ?? 256;
4396
+ if (!Number.isSafeInteger(maxLevels) || maxLevels < 2 || levels.length > maxLevels)
4397
+ throw new Error("Isoband level capacity exceeded");
4398
+ if (levels.length < 2 || levels.some((v, i) => !Number.isFinite(v) || i > 0 && v <= levels[i - 1]))
4399
+ throw new Error("Invalid isoband levels");
4400
+ const maxTriangles = options.maxTriangles ?? 2e6, maxVertices = options.maxVertices ?? 2e6, maxEdges = options.maxEdges ?? 6 * maxTriangles, maxTests = options.maxTests ?? 32 * maxTriangles;
4401
+ if (![maxTriangles, maxVertices, maxEdges, maxTests].every((n) => Number.isSafeInteger(n) && n >= 0))
4402
+ throw new Error("Invalid isoband capacity");
4403
+ const count = fields.reduce((n, f) => n + 2 * (f.width - 1) * (f.height - 1), 0);
4404
+ if (!Number.isSafeInteger(count) || count > maxTriangles)
4405
+ throw new Error("Isoband triangle capacity exceeded");
4406
+ const originals = /* @__PURE__ */ new Map(), vertices = /* @__PURE__ */ new Map();
4407
+ const frame = fields[0];
4408
+ for (const f of fields)
4409
+ if (f.heightReference !== frame.heightReference)
4410
+ throw new Error("Isoband height references differ");
4411
+ let tests = 0, edgeCount = 0;
4412
+ const charge = () => {
4413
+ if (++tests > maxTests)
4414
+ throw new Error("Isoband work budget exceeded");
4415
+ };
4416
+ const rectangles = fields.map((f) => {
4417
+ if (f.registration !== frame.registration || f.columnStep.some((v, i) => v !== frame.columnStep[i]) || f.rowStep.some((v, i) => v !== frame.rowStep[i]))
4418
+ throw new Error("Isoband tiles require a conforming common frame");
4419
+ const dx = f.origin[0] - frame.origin[0], dy = f.origin[1] - frame.origin[1];
4420
+ const determinant = frame.columnStep[0] * frame.rowStep[1] - frame.columnStep[1] * frame.rowStep[0];
4421
+ const x = Math.round((dx * frame.rowStep[1] - dy * frame.rowStep[0]) / determinant), y = Math.round((dy * frame.columnStep[0] - dx * frame.columnStep[1]) / determinant);
4422
+ if (!Number.isSafeInteger(x) || !Number.isSafeInteger(y))
4423
+ throw new Error("Isoband tiles require integral lattice origins");
4424
+ for (let axis = 0; axis < 2; axis++) {
4425
+ const a = x * frame.columnStep[axis], b = y * frame.rowStep[axis];
4426
+ const expected = frame.origin[axis] + a + b;
4427
+ const tolerance = Math.min(16 * Number.EPSILON * Math.max(1, Math.abs(f.origin[axis]), Math.abs(frame.origin[axis]), Math.abs(a), Math.abs(b)), 1e-9 * Math.max(Math.abs(frame.columnStep[axis]), Math.abs(frame.rowStep[axis])));
4428
+ if (!Number.isFinite(expected) || Math.abs(f.origin[axis] - expected) > tolerance)
4429
+ throw new Error("Isoband tiles require integral lattice origins");
4430
+ }
4431
+ return { x, y, right: x + f.width - 1, top: y + f.height - 1 };
4432
+ });
4433
+ const rectangleBoxes = rectangles.map((r) => ({ minX: r.x, minY: r.y, maxX: r.right, maxY: r.top })), rectangleIndex = createTerrainBoxIndex(rectangleBoxes);
4434
+ const rangeIndex = createTerrainBoxIndex(fields.map((f) => {
4435
+ var _a, _b;
4436
+ return {
4437
+ minX: ((_a = f.heightRange) == null ? void 0 : _a[0]) ?? Infinity,
4438
+ maxX: ((_b = f.heightRange) == null ? void 0 : _b[1]) ?? -Infinity,
4439
+ minY: 0,
4440
+ maxY: 0
4441
+ };
4442
+ }));
4443
+ for (let i = 0; i < rectangles.length; i++)
4444
+ for (const j of rectangleIndex(rectangleBoxes[i], charge)) {
4445
+ if (j <= i)
4446
+ continue;
4447
+ charge();
4448
+ const a = rectangles[i], b = rectangles[j];
4449
+ if (a.x < b.right && b.x < a.right && a.y < b.top && b.y < a.top)
4450
+ throw new Error("Overlapping isoband tiles");
4451
+ for (let y = Math.max(a.y, b.y); y <= Math.min(a.top, b.top); y++)
4452
+ for (let x = Math.max(a.x, b.x); x <= Math.min(a.right, b.right); x++) {
4453
+ charge();
4454
+ const u = fields[i].getHeight(x - a.x, y - a.y), v = fields[j].getHeight(x - b.x, y - b.y);
4455
+ if (u !== void 0 && v !== void 0 && u !== v)
4456
+ throw new Error("Isoband shared heights differ");
4457
+ }
4458
+ }
4459
+ const rings = [], bands = [];
4460
+ const register = (v) => {
4461
+ if (!vertices.has(v.key)) {
4462
+ if (vertices.size >= maxVertices)
4463
+ throw new Error("Isoband vertex capacity exceeded");
4464
+ vertices.set(v.key, v);
4465
+ }
4466
+ return vertices.get(v.key);
4467
+ };
4468
+ const clip = (poly, level, above) => {
4469
+ const out = [];
4470
+ for (let i = 0; i < poly.length; i++) {
4471
+ charge();
4472
+ const a = poly[i], b = poly[(i + 1) % poly.length], ia = above ? a.z >= level : a.z <= level, ib = above ? b.z >= level : b.z <= level;
4473
+ if (ia)
4474
+ out.push(a);
4475
+ if (ia !== ib) {
4476
+ if (a.z === level) {
4477
+ out.push(a);
4478
+ continue;
4479
+ }
4480
+ if (b.z === level) {
4481
+ out.push(b);
4482
+ continue;
4483
+ }
4484
+ const support = [.../* @__PURE__ */ new Set([...a.support, ...b.support])].sort();
4485
+ if (support.length !== 2)
4486
+ throw new Error("Invalid isoband intersection support");
4487
+ const u = originals.get(support[0]), v = originals.get(support[1]);
4488
+ const scale = Math.max(Math.abs(u.z), Math.abs(v.z), Math.abs(level), 1);
4489
+ const t = (level / scale - u.z / scale) / (v.z / scale - u.z / scale);
4490
+ const point = {
4491
+ x: u.x * (1 - t) + v.x * t,
4492
+ y: u.y * (1 - t) + v.y * t,
4493
+ z: level,
4494
+ key: `e:${support.join("|")}:${level}`,
4495
+ support
4496
+ };
4497
+ if (![point.x, point.y, t].every(Number.isFinite))
4498
+ throw new Error("Isoband arithmetic overflow");
4499
+ out.push(register(point));
4500
+ }
4501
+ }
4502
+ return out.filter((v, i) => v.key !== out[(i + 1) % out.length].key);
4503
+ };
4504
+ for (let band = 0; band + 1 < levels.length; band++) {
4505
+ const edges = /* @__PURE__ */ new Map();
4506
+ for (const fieldId of rangeIndex({ minX: levels[band], maxX: levels[band + 1], minY: 0, maxY: 0 }, charge))
4507
+ for (let y = 0; y < fields[fieldId].height - 1; y++)
4508
+ for (let x = 0; x < fields[fieldId].width - 1; x++) {
4509
+ const f = fields[fieldId];
4510
+ const nodes = [
4511
+ [x, y],
4512
+ [x + 1, y],
4513
+ [x, y + 1],
4514
+ [x + 1, y + 1]
4515
+ ].map(([c, r]) => {
4516
+ const z = f.getHeight(c, r);
4517
+ if (z === void 0)
4518
+ return void 0;
4519
+ const shift = f.registration === "cell" ? 0.5 : 0;
4520
+ const px = frame.origin[0] + (rectangles[fieldId].x + c + shift) * frame.columnStep[0] + (rectangles[fieldId].y + r + shift) * frame.rowStep[0], py = frame.origin[1] + (rectangles[fieldId].x + c + shift) * frame.columnStep[1] + (rectangles[fieldId].y + r + shift) * frame.rowStep[1];
4521
+ if (![px, py].every(Number.isFinite))
4522
+ throw new Error("Isoband coordinate overflow");
4523
+ const key2 = `v:${px},${py}`, v = { x: px, y: py, z, key: key2, support: [key2] };
4524
+ const old = originals.get(key2);
4525
+ if (old && old.z !== z)
4526
+ throw new Error("Isoband shared heights differ");
4527
+ originals.set(key2, v);
4528
+ return v;
4529
+ });
4530
+ for (const ids of f.diagonal === "00-11" ? [
4531
+ [0, 1, 3],
4532
+ [0, 3, 2]
4533
+ ] : [
4534
+ [0, 1, 2],
4535
+ [1, 3, 2]
4536
+ ]) {
4537
+ charge();
4538
+ if (ids.some((i) => !nodes[i]))
4539
+ continue;
4540
+ let poly = ids.map((i) => nodes[i]);
4541
+ if (poly.every((v) => v.z === levels[band + 1]) && band + 2 < levels.length)
4542
+ continue;
4543
+ if ((poly[1].x - poly[0].x) * (poly[2].y - poly[0].y) - (poly[1].y - poly[0].y) * (poly[2].x - poly[0].x) < 0)
4544
+ poly.reverse();
4545
+ poly = clip(clip(poly, levels[band], true), levels[band + 1], false);
4546
+ if (poly.length < 3)
4547
+ continue;
4548
+ const area2 = poly.reduce((n, a, i) => {
4549
+ const b = poly[(i + 1) % poly.length], o = poly[0];
4550
+ return n + (a.x - o.x) * (b.y - o.y) - (b.x - o.x) * (a.y - o.y);
4551
+ }, 0);
4552
+ if (!Number.isFinite(area2))
4553
+ throw new Error("Isoband area arithmetic overflow");
4554
+ if (area2 === 0)
4555
+ continue;
4556
+ for (let i = 0; i < poly.length; i++) {
4557
+ const a = register(poly[i]), b = register(poly[(i + 1) % poly.length]);
4558
+ if (++edgeCount > maxEdges)
4559
+ throw new Error("Isoband edge capacity exceeded");
4560
+ const key2 = `${a.key}>${b.key}`, reverse = `${b.key}>${a.key}`;
4561
+ if (edges.has(reverse))
4562
+ edges.delete(reverse);
4563
+ else {
4564
+ if (edges.has(key2))
4565
+ throw new Error("Overlapping isoband tiles");
4566
+ edges.set(key2, { a, b });
4567
+ }
4568
+ }
4569
+ }
4570
+ }
4571
+ const outgoing = /* @__PURE__ */ new Map();
4572
+ for (const [key2, e] of edges) {
4573
+ if (!outgoing.has(e.a.key))
4574
+ outgoing.set(e.a.key, /* @__PURE__ */ new Set());
4575
+ outgoing.get(e.a.key).add(key2);
4576
+ }
4577
+ while (edges.size) {
4578
+ const first = edges.values().next().value, ring = [];
4579
+ let edge = first;
4580
+ for (; ; ) {
4581
+ charge();
4582
+ ring.push(edge.a);
4583
+ edges.delete(`${edge.a.key}>${edge.b.key}`);
4584
+ outgoing.get(edge.a.key).delete(`${edge.a.key}>${edge.b.key}`);
4585
+ if (edge.b.key === first.a.key)
4586
+ break;
4587
+ const choices = [...outgoing.get(edge.b.key) ?? []].map((k) => edges.get(k));
4588
+ if (!choices.length)
4589
+ throw new Error("Open isoband boundary");
4590
+ const angle = (e) => Math.atan2((edge.b.x - edge.a.x) * (e.b.y - e.a.y) - (edge.b.y - edge.a.y) * (e.b.x - e.a.x), (edge.b.x - edge.a.x) * (e.b.x - e.a.x) + (edge.b.y - edge.a.y) * (e.b.y - e.a.y));
4591
+ choices.sort((a, b) => angle(b) - angle(a) || a.b.key.localeCompare(b.b.key));
4592
+ edge = choices[0];
4593
+ }
4594
+ rings.push(ring);
4595
+ bands.push(band);
4596
+ }
4597
+ }
4598
+ const area = (ring) => ring.reduce((n, a, i) => {
4599
+ const b = ring[(i + 1) % ring.length], o = ring[0];
4600
+ return n + (a.x - o.x) * (b.y - o.y) - (b.x - o.x) * (a.y - o.y);
4601
+ }, 0);
4602
+ const areas = rings.map(area), parents = new Int32Array(rings.length).fill(-1);
4603
+ const ringBoxes = rings.map((r) => r.reduce((b, v) => ({
4604
+ minX: Math.min(b.minX, v.x),
4605
+ minY: Math.min(b.minY, v.y),
4606
+ maxX: Math.max(b.maxX, v.x),
4607
+ maxY: Math.max(b.maxY, v.y)
4608
+ }), { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity }));
4609
+ const ringIndex = createTerrainBoxIndex(ringBoxes);
4610
+ for (let i = 0; i < rings.length; i++)
4611
+ if (areas[i] < 0) {
4612
+ let best = Infinity;
4613
+ const q = rings[i][0];
4614
+ for (const j of ringIndex({ minX: q.x, maxX: q.x, minY: q.y, maxY: q.y }, charge))
4615
+ if (bands[j] === bands[i] && areas[j] > 0) {
4616
+ let inside = false;
4617
+ const ring = rings[j];
4618
+ for (let k = 0, l = ring.length - 1; k < ring.length; l = k++) {
4619
+ charge();
4620
+ const a = ring[k], b = ring[l];
4621
+ if (a.y > q.y !== b.y > q.y && q.x < (b.x - a.x) * (q.y - a.y) / (b.y - a.y) + a.x)
4622
+ inside = !inside;
4623
+ }
4624
+ if (inside && areas[j] < best) {
4625
+ parents[i] = j;
4626
+ best = areas[j];
4627
+ }
4628
+ }
4629
+ if (parents[i] < 0)
4630
+ throw new Error("Uncontained isoband hole");
4631
+ }
4632
+ const used = /* @__PURE__ */ new Map(), positions = [], indices = [], offsets = [0];
4633
+ for (const ring of rings) {
4634
+ for (const v of [...ring, ring[0]]) {
4635
+ if (!used.has(v.key)) {
4636
+ used.set(v.key, used.size);
4637
+ positions.push(v.x, v.y);
4638
+ }
4639
+ indices.push(used.get(v.key));
4640
+ }
4641
+ offsets.push(indices.length);
4642
+ }
4643
+ return {
4644
+ positions: Float64Array.from(positions),
4645
+ indices: Uint32Array.from(indices),
4646
+ offsets: Uint32Array.from(offsets),
4647
+ bandIndices: Uint32Array.from(bands),
4648
+ parents,
4649
+ levels: Float64Array.from(levels),
4650
+ heightReference: (frame == null ? void 0 : frame.heightReference) ?? "unknown"
4651
+ };
4652
+ }
4653
+
4654
+ // dist/terrain/tile-update-data.js
4655
+ function updateTerrainTileData(previous, resident, create, maxSamples = 4e6) {
4656
+ if (!Number.isSafeInteger(maxSamples) || maxSamples < 0)
4657
+ throw new Error("Invalid terrain update sample capacity");
4658
+ let count = 0;
4659
+ const ids = /* @__PURE__ */ new Set();
4660
+ for (const tile of resident) {
4661
+ if (typeof tile.id !== "string" || ids.has(tile.id))
4662
+ throw new Error("Invalid or duplicate terrain update tile");
4663
+ ids.add(tile.id);
4664
+ count += tile.field.width * tile.field.height;
4665
+ if (!Number.isSafeInteger(count) || count > maxSamples)
4666
+ throw new Error("Terrain update sample capacity exceeded");
4667
+ }
4668
+ const cached = new Map(previous == null ? void 0 : previous.map((t) => [t.source.id, t]));
4669
+ return resident.map((source) => {
4670
+ const old = cached.get(source.id);
4671
+ return (old == null ? void 0 : old.source.field) === source.field ? { source, data: old.data } : { source, data: create(source.field) };
4672
+ });
4673
+ }
4674
+
4675
+ // dist/terrain/mesh-update.js
4676
+ function updateTerrainMeshes(previous, resident, options = {}) {
4677
+ return updateTerrainTileData(previous, resident, createTerrainMesh, options.maxSamples);
4678
+ }
4679
+
4680
+ // dist/terrain/bounds-update.js
4681
+ function updateTerrainBounds(previous, resident, options = {}) {
4682
+ return updateTerrainTileData(previous, resident, (f) => new HeightFieldMinMax(f), options.maxSamples);
4683
+ }
4684
+
4685
+ // dist/terrain/gradient-pyramid-update.js
4686
+ function updateTerrainGradientPyramids(previous, gradients, options = {}) {
4687
+ const limit = options.maxSamples ?? 4e6;
4688
+ const count = gradients.tiles.reduce((n, t) => n + t.grid.width * t.grid.height, 0);
4689
+ if (!Number.isSafeInteger(limit) || limit < 0 || !Number.isSafeInteger(count) || count > limit)
4690
+ throw new Error("Gradient pyramid update sample capacity exceeded");
4691
+ const cached = new Map(previous == null ? void 0 : previous.map((t) => [t.source.grid, t.data]));
4692
+ return gradients.tiles.map((source) => ({
4693
+ source,
4694
+ data: cached.get(source.grid) ?? createTerrainGradientPyramid(source.grid, { maxSamples: limit })
4695
+ }));
4696
+ }
4697
+
4698
+ // dist/terrain/dirty-regions.js
4699
+ function validateTerrainDirtyWindows(windows, width, height, maxWindows = 1e5) {
4700
+ if (windows.length > maxWindows)
4701
+ throw new Error("Terrain dirty window capacity exceeded");
4702
+ for (const w of windows)
4703
+ if (![w.minColumn, w.minRow, w.maxColumn, w.maxRow].every(Number.isSafeInteger) || w.minColumn < 0 || w.minRow < 0 || w.maxColumn >= width || w.maxRow >= height || w.minColumn > w.maxColumn || w.minRow > w.maxRow)
4704
+ throw new Error("Invalid terrain dirty sample window");
4705
+ }
4706
+ function sameTerrainFrame(a, b) {
4707
+ return a.width === b.width && a.height === b.height && a.registration === b.registration && a.diagonal === b.diagonal && a.heightReference === b.heightReference && a.origin.every((v, i) => v === b.origin[i]) && a.columnStep.every((v, i) => v === b.columnStep[i]) && a.rowStep.every((v, i) => v === b.rowStep[i]);
4708
+ }
4709
+ function terrainDirtyIndices(windows, width, height, expand, charge) {
4710
+ const ids = /* @__PURE__ */ new Set();
4711
+ for (const w of windows)
4712
+ for (let y = Math.max(0, w.minRow - expand); y <= Math.min(height - 1, w.maxRow + expand); y++)
4713
+ for (let x = Math.max(0, w.minColumn - expand); x <= Math.min(width - 1, w.maxColumn + expand); x++) {
4714
+ charge();
4715
+ ids.add(y * width + x);
4716
+ }
4717
+ return ids;
4718
+ }
4719
+
4720
+ // dist/terrain/mesh-regions-data.js
4721
+ function updateMeshRegions(previous, field, dirty, options, configuration, create) {
4722
+ const cells = options.cellsPerRegion ?? 32, limit = options.maxSamples ?? 4e6, budget = options.maxTests ?? 1e7;
4723
+ if (![cells, limit, budget].every(Number.isSafeInteger) || cells < 1 || limit < 0 || budget < 0)
4724
+ throw new Error("Invalid terrain mesh region capacity");
4725
+ validateTerrainDirtyWindows(dirty, field.width, field.height);
4726
+ let count = 0, tests = 0;
4727
+ const regions = [], rebuilt = [];
4728
+ const reusable = previous && sameTerrainFrame(previous.field, field) && previous.cellsPerRegion === cells && previous.configuration === configuration;
4729
+ const cache = new Map(previous == null ? void 0 : previous.regions.map((r) => [`${r.column},${r.row}`, r]));
4730
+ for (let row = 0; row < field.height - 1; row += cells)
4731
+ for (let column = 0; column < field.width - 1; column += cells) {
4732
+ const width = Math.min(cells, field.width - 1 - column) + 1, height = Math.min(cells, field.height - 1 - row) + 1;
4733
+ count += width * height;
4734
+ if (!Number.isSafeInteger(count) || count > limit)
4735
+ throw new Error("Terrain mesh region sample capacity exceeded");
4736
+ let affected = !reusable;
4737
+ for (const w of reusable ? dirty : []) {
4738
+ if (++tests > budget)
4739
+ throw new Error("Terrain mesh region work budget exceeded");
4740
+ if (w.minColumn <= column + width - 1 && w.maxColumn >= column && w.minRow <= row + height - 1 && w.maxRow >= row)
4741
+ affected = true;
4742
+ }
4743
+ const old = cache.get(`${column},${row}`);
4744
+ if (!affected && old) {
4745
+ regions.push(old);
4746
+ continue;
4747
+ }
4748
+ const heights = Float64Array.from({ length: width * height }, (_, i) => field.getHeight(column + i % width, row + Math.floor(i / width)) ?? NaN);
4749
+ const source = new HeightField({
4750
+ width,
4751
+ height,
4752
+ heights,
4753
+ origin: [
4754
+ column * field.columnStep[0] + row * field.rowStep[0],
4755
+ column * field.columnStep[1] + row * field.rowStep[1]
4756
+ ],
4757
+ columnStep: field.columnStep,
4758
+ rowStep: field.rowStep,
4759
+ registration: field.registration,
4760
+ diagonal: field.diagonal,
4761
+ heightReference: field.heightReference
4762
+ });
4763
+ rebuilt.push(regions.length);
4764
+ let data = create(source);
4765
+ if (data) {
4766
+ const mesh = data;
4767
+ const positions = mesh.positions.map((value, i) => {
4768
+ const axis = i % 3;
4769
+ if (axis === 2)
4770
+ return value;
4771
+ const vertex = Math.floor(i / 3), shift = field.registration === "cell" ? 0.5 : 0;
4772
+ const c = column + mesh.gridCoordinates[2 * vertex] + shift, r = row + mesh.gridCoordinates[2 * vertex + 1] + shift;
4773
+ const coordinate = c * field.columnStep[axis] + r * field.rowStep[axis];
4774
+ if (!Number.isFinite(coordinate))
4775
+ throw new Error("Terrain region coordinate overflow");
4776
+ return coordinate;
4777
+ });
4778
+ data = { ...mesh, origin: [0, 0, 0], positions };
4779
+ }
4780
+ regions.push({ column, row, field: source, data });
4781
+ }
4782
+ return {
4783
+ field,
4784
+ origin: [field.origin[0], field.origin[1], 0],
4785
+ cellsPerRegion: cells,
4786
+ configuration,
4787
+ regions,
4788
+ rebuilt: Uint32Array.from(rebuilt)
4789
+ };
4790
+ }
4791
+
4792
+ // dist/terrain/mesh-regions.js
4793
+ function updateTerrainMeshRegions(previous, field, dirty, options = {}) {
4794
+ return updateMeshRegions(previous, field, dirty, options, "regular", createTerrainMesh);
4795
+ }
4796
+
4797
+ // dist/terrain/martini-regions.js
4798
+ function updateTerrainMartiniMeshRegions(previous, field, dirty, options) {
4799
+ const cells = options.cellsPerRegion ?? 32;
4800
+ if (!Number.isSafeInteger(cells) || cells < 1 || cells > 32768 || (cells & cells - 1) !== 0 || (field.width - 1) % cells || (field.height - 1) % cells || !Number.isFinite(options.maxError) || options.maxError < 0)
4801
+ throw new Error("Invalid MARTINI region dimensions or error");
4802
+ return updateMeshRegions(previous, field, dirty, options, `martini:${options.maxError}`, (f) => f.validCount !== f.width * f.height ? null : createMartiniTerrainMesh(f, {
4803
+ maxError: options.maxError,
4804
+ fullEdges: ["minColumn", "maxColumn", "minRow", "maxRow"]
4805
+ }));
4806
+ }
4807
+
4808
+ // dist/terrain/delatin-regions.js
4809
+ function updateTerrainDelatinMeshRegions(previous, field, dirty, options) {
4810
+ if (!Number.isFinite(options.maxError) || options.maxError < 0)
4811
+ throw new Error("Invalid Delatin region error");
4812
+ return updateMeshRegions(previous, field, dirty, options, `delatin:${options.maxError}`, (f) => f.validCount !== f.width * f.height ? null : createDelatinTerrainMesh(f, { maxError: options.maxError }));
4813
+ }
4814
+
4815
+ // dist/terrain/bounds-regions.js
4816
+ function updateTerrainBoundsRegions(previous, field, dirty, options = {}) {
4817
+ const limit = options.maxSamples ?? 4e6, budget = options.maxTests ?? 1e7;
4818
+ if (![limit, budget].every(Number.isSafeInteger) || limit < 0 || budget < 0 || field.width * field.height > limit)
4819
+ throw new Error("Invalid bounds region capacity");
4820
+ validateTerrainDirtyWindows(dirty, field.width, field.height);
4821
+ if (!previous || !sameTerrainFrame(previous.field, field)) {
4822
+ const bounds = new HeightFieldMinMax(field), levels2 = Array.from({ length: bounds.levelCount }, (_, i) => bounds.copyLevel(i));
4823
+ return { field, levels: levels2, updatedCounts: Uint32Array.from(levels2, (l) => l.width * l.height) };
4824
+ }
4825
+ let tests = 0;
4826
+ const charge = () => {
4827
+ if (++tests > budget)
4828
+ throw new Error("Bounds region work budget exceeded");
4829
+ };
4830
+ let ids = terrainDirtyIndices(dirty, field.width - 1, field.height - 1, 1, charge);
4831
+ const counts = [], levels = previous.levels.slice();
4832
+ for (let l = 0; l < levels.length; l++) {
4833
+ counts.push(ids.size);
4834
+ if (!ids.size)
4835
+ continue;
4836
+ const old = levels[l], next = {
4837
+ ...old,
4838
+ minimums: old.minimums.slice(),
4839
+ maximums: old.maximums.slice(),
4840
+ populatedCellCounts: old.populatedCellCounts.slice(),
4841
+ completeCellCounts: old.completeCellCounts.slice()
4842
+ };
4843
+ const parents = /* @__PURE__ */ new Set();
4844
+ for (const id of ids) {
4845
+ charge();
4846
+ const x = id % next.width, y = Math.floor(id / next.width);
4847
+ let min = Infinity, max = -Infinity, populated = 0, complete = 0;
4848
+ if (l === 0) {
4849
+ let valid = 0;
4850
+ for (let dy = 0; dy < 2; dy++)
4851
+ for (let dx = 0; dx < 2; dx++) {
4852
+ const h = field.getHeight(x + dx, y + dy);
4853
+ if (h !== void 0) {
4854
+ valid++;
4855
+ min = Math.min(min, h);
4856
+ max = Math.max(max, h);
4857
+ }
4858
+ }
4859
+ populated = valid ? 1 : 0;
4860
+ complete = valid === 4 ? 1 : 0;
4861
+ } else {
4862
+ const child = levels[l - 1];
4863
+ for (let dy = 0; dy < 2; dy++)
4864
+ for (let dx = 0; dx < 2; dx++) {
4865
+ const cx = x * 2 + dx, cy = y * 2 + dy;
4866
+ if (cx >= child.width || cy >= child.height)
4867
+ continue;
4868
+ const i = cy * child.width + cx;
4869
+ if (child.populatedCellCounts[i]) {
4870
+ min = Math.min(min, child.minimums[i]);
4871
+ max = Math.max(max, child.maximums[i]);
4872
+ }
4873
+ populated += child.populatedCellCounts[i];
4874
+ complete += child.completeCellCounts[i];
4875
+ }
4876
+ }
4877
+ next.minimums[id] = populated ? min : 0;
4878
+ next.maximums[id] = populated ? max : 0;
4879
+ next.populatedCellCounts[id] = populated;
4880
+ next.completeCellCounts[id] = complete;
4881
+ parents.add(Math.floor(y / 2) * Math.ceil(next.width / 2) + Math.floor(x / 2));
4882
+ }
4883
+ levels[l] = next;
4884
+ ids = parents;
4885
+ }
4886
+ return { field, levels, updatedCounts: Uint32Array.from(counts) };
4887
+ }
4888
+
4889
+ // dist/terrain/gradient-pyramid-regions.js
4890
+ function updateTerrainGradientPyramidRegions(previous, grid, dirty, options = {}) {
4891
+ const limit = options.maxSamples ?? 4e6, budget = options.maxTests ?? 1e7;
4892
+ if (![limit, budget].every(Number.isSafeInteger) || limit < 0 || budget < 0 || !Number.isSafeInteger(grid.width) || grid.width < 1 || !Number.isSafeInteger(grid.height) || grid.height < 1 || grid.width * grid.height > limit)
4893
+ throw new Error("Invalid gradient region capacity");
4894
+ if (grid.method !== "horn" && grid.method !== "zevenbergen-thorne" || grid.registration !== "vertex" && grid.registration !== "cell" || typeof grid.heightReference !== "string" || ![grid.origin, grid.columnStep, grid.rowStep].every((v) => v.length === 2 && v.every(Number.isFinite)))
4895
+ throw new Error("Invalid gradient region metadata");
4896
+ validateTerrainDirtyWindows(dirty, grid.width, grid.height);
4897
+ const old = previous == null ? void 0 : previous.source;
4898
+ if (!old || old.width !== grid.width || old.height !== grid.height || old.method !== grid.method || old.registration !== grid.registration || old.heightReference !== grid.heightReference || !old.origin.every((v, i) => v === grid.origin[i]) || !old.columnStep.every((v, i) => v === grid.columnStep[i]) || !old.rowStep.every((v, i) => v === grid.rowStep[i])) {
4899
+ const pyramid = createTerrainGradientPyramid(grid, { maxSamples: limit });
4900
+ return {
4901
+ source: grid,
4902
+ pyramid,
4903
+ updatedCounts: Uint32Array.from(pyramid.levels, (l) => l.width * l.height)
4904
+ };
4905
+ }
4906
+ if (!(grid.gradients instanceof Float64Array) || grid.gradients.length !== 2 * grid.width * grid.height || !(grid.statuses instanceof Uint8Array) || grid.statuses.length !== grid.width * grid.height)
4907
+ throw new Error("Invalid gradient region buffers");
4908
+ const levels = previous.pyramid.levels.slice();
4909
+ let tests = 0;
4910
+ const charge = () => {
4911
+ if (++tests > budget)
4912
+ throw new Error("Gradient region work budget exceeded");
4913
+ };
4914
+ let ids = terrainDirtyIndices(dirty, grid.width, grid.height, 0, charge);
4915
+ const counts = [];
4916
+ for (let l = 0; l < levels.length; l++) {
4917
+ counts.push(ids.size);
4918
+ if (!ids.size)
4919
+ continue;
4920
+ const oldLevel = levels[l], next = {
4921
+ ...oldLevel,
4922
+ gradients: oldLevel.gradients.slice(),
4923
+ validCounts: oldLevel.validCounts.slice(),
4924
+ sampleCounts: oldLevel.sampleCounts
4925
+ };
4926
+ const parents = /* @__PURE__ */ new Set();
4927
+ for (const id of ids) {
4928
+ charge();
4929
+ const x = id % next.width, y = Math.floor(id / next.width);
4930
+ next.validCounts[id] = 0;
4931
+ next.gradients[2 * id] = next.gradients[2 * id + 1] = 0;
4932
+ if (l === 0) {
4933
+ if (grid.statuses[id] > 6)
4934
+ throw new Error("Invalid terrain gradient status");
4935
+ if (grid.statuses[id] === 0) {
4936
+ if (!Number.isFinite(grid.gradients[2 * id]) || !Number.isFinite(grid.gradients[2 * id + 1]))
4937
+ throw new Error("Invalid terrain gradient value");
4938
+ next.validCounts[id] = 1;
4939
+ next.gradients[2 * id] = grid.gradients[2 * id];
4940
+ next.gradients[2 * id + 1] = grid.gradients[2 * id + 1];
4941
+ }
4942
+ } else {
4943
+ const child = levels[l - 1];
4944
+ for (let dy = 0; dy < 2; dy++)
4945
+ for (let dx = 0; dx < 2; dx++) {
4946
+ const cx = x * 2 + dx, cy = y * 2 + dy;
4947
+ if (cx >= child.width || cy >= child.height)
4948
+ continue;
4949
+ const i = cy * child.width + cx, n = child.validCounts[i], count = next.validCounts[id];
4950
+ if (n) {
4951
+ const total = count + n;
4952
+ for (let axis = 0; axis < 2; axis++) {
4953
+ const a = next.gradients[2 * id + axis], b = child.gradients[2 * i + axis];
4954
+ next.gradients[2 * id + axis] = count ? a * (count / total) + b * (n / total) : b;
4955
+ }
4956
+ next.validCounts[id] = total;
4957
+ }
4958
+ }
4959
+ }
4960
+ parents.add(Math.floor(y / 2) * Math.ceil(next.width / 2) + Math.floor(x / 2));
4961
+ }
4962
+ levels[l] = next;
4963
+ ids = parents;
4964
+ }
4965
+ return {
4966
+ source: grid,
4967
+ pyramid: { ...previous.pyramid, levels },
4968
+ updatedCounts: Uint32Array.from(counts)
4969
+ };
4970
+ }
4971
+
4972
+ // dist/terrain/persistent-hierarchy-data.js
4973
+ function getTerrainHierarchyNode(level, column, row) {
4974
+ if (!Number.isSafeInteger(level.width) || level.width < 1 || !Number.isSafeInteger(level.height) || level.height < 1 || !Number.isSafeInteger(level.nodesPerBlock) || level.nodesPerBlock < 1 || !Array.isArray(level.blocks))
4975
+ throw new Error("Invalid persistent hierarchy level");
4976
+ if (!Number.isSafeInteger(column) || !Number.isSafeInteger(row) || column < 0 || row < 0 || column >= level.width || row >= level.height)
4977
+ throw new Error("Invalid persistent hierarchy node");
4978
+ const id = row * level.width + column, block = level.blocks[Math.floor(id / level.nodesPerBlock)], i = block ? 2 * (id - block.offset) : -1;
4979
+ const expectedOffset = Math.floor(id / level.nodesPerBlock) * level.nodesPerBlock;
4980
+ if (!block || block.offset !== expectedOffset || block.count !== Math.min(level.nodesPerBlock, level.width * level.height - expectedOffset) || !(block.values instanceof Float64Array) || !(block.counts instanceof Uint32Array) || block.values.length !== 2 * block.count || block.counts.length !== 2 * block.count)
4981
+ throw new Error("Invalid persistent hierarchy block");
4982
+ return {
4983
+ values: [block.values[i], block.values[i + 1]],
4984
+ counts: [block.counts[i], block.counts[i + 1]]
4985
+ };
4986
+ }
4987
+ function packTerrainHierarchyLevel(width, height, blockSize, values, counts, nodesPerBlock) {
4988
+ if (values.length !== 2 * width * height || counts.length !== values.length || !values.every(Number.isFinite))
4989
+ throw new Error("Invalid persistent hierarchy buffers");
4990
+ const blocks = [];
4991
+ for (let offset = 0; offset < width * height; offset += nodesPerBlock) {
4992
+ const count = Math.min(nodesPerBlock, width * height - offset);
4993
+ blocks.push({
4994
+ offset,
4995
+ count,
4996
+ values: values.slice(2 * offset, 2 * (offset + count)),
4997
+ counts: counts.slice(2 * offset, 2 * (offset + count))
4998
+ });
4999
+ }
5000
+ return { width, height, blockSize, nodesPerBlock, blocks };
5001
+ }
5002
+ function persistentHierarchyOptions(options, count) {
5003
+ const nodesPerBlock = options.nodesPerBlock ?? 256, maxSamples = options.maxSamples ?? 4e6, maxTests = options.maxTests ?? 1e7;
5004
+ if (![nodesPerBlock, maxSamples, maxTests, count].every(Number.isSafeInteger) || nodesPerBlock < 1 || maxSamples < 0 || maxTests < 0 || count < 1 || count > maxSamples)
5005
+ throw new Error("Invalid persistent terrain hierarchy capacity");
5006
+ let tests = 0;
5007
+ return {
5008
+ nodesPerBlock,
5009
+ maxSamples,
5010
+ charge: () => {
5011
+ if (++tests > maxTests)
5012
+ throw new Error("Persistent hierarchy work budget exceeded");
5013
+ }
5014
+ };
5015
+ }
5016
+ function updatePersistentHierarchy(previous, ids, mode, base, charge) {
5017
+ const levels = previous.slice(), updatedNodes = [];
5018
+ let copiedBlocks = 0, copiedBytes = 0;
5019
+ for (let l = 0; l < levels.length; l++) {
5020
+ updatedNodes.push(ids.size);
5021
+ if (!ids.size)
5022
+ continue;
5023
+ const old = levels[l], blocks = old.blocks.slice(), cloned = /* @__PURE__ */ new Set(), parents = /* @__PURE__ */ new Set();
5024
+ const node = (level, x, y) => getTerrainHierarchyNode(level, x, y);
5025
+ for (const id of ids) {
5026
+ charge();
5027
+ const x = id % old.width, y = Math.floor(id / old.width);
5028
+ let value;
5029
+ if (l === 0)
5030
+ value = base(x, y);
5031
+ else {
5032
+ const child = levels[l - 1];
5033
+ let a = mode === "bounds" ? Infinity : 0, b = mode === "bounds" ? -Infinity : 0, c = 0, d = 0;
5034
+ for (let dy = 0; dy < 2; dy++)
5035
+ for (let dx = 0; dx < 2; dx++) {
5036
+ const cx = x * 2 + dx, cy = y * 2 + dy;
5037
+ if (cx >= child.width || cy >= child.height)
5038
+ continue;
5039
+ const v = node(child, cx, cy), n = v.counts[0];
5040
+ d += v.counts[1];
5041
+ if (n) {
5042
+ if (mode === "bounds") {
5043
+ a = Math.min(a, v.values[0]);
5044
+ b = Math.max(b, v.values[1]);
5045
+ } else {
5046
+ const total = c + n;
5047
+ a = c ? a * (c / total) + v.values[0] * (n / total) : v.values[0];
5048
+ b = c ? b * (c / total) + v.values[1] * (n / total) : v.values[1];
5049
+ }
5050
+ c += n;
5051
+ }
5052
+ }
5053
+ if (c && (!Number.isFinite(a) || !Number.isFinite(b)))
5054
+ throw new Error("Persistent hierarchy arithmetic overflow");
5055
+ value = { values: c ? [a, b] : [0, 0], counts: [c, d] };
5056
+ }
5057
+ const blockId = Math.floor(id / old.nodesPerBlock);
5058
+ if (!cloned.has(blockId)) {
5059
+ const source = blocks[blockId];
5060
+ blocks[blockId] = { ...source, values: source.values.slice(), counts: source.counts.slice() };
5061
+ cloned.add(blockId);
5062
+ copiedBlocks++;
5063
+ copiedBytes += blocks[blockId].values.byteLength + blocks[blockId].counts.byteLength;
5064
+ }
5065
+ const block = blocks[blockId], i = 2 * (id - block.offset);
5066
+ block.values[i] = value.values[0];
5067
+ block.values[i + 1] = value.values[1];
5068
+ block.counts[i] = value.counts[0];
5069
+ block.counts[i + 1] = value.counts[1];
5070
+ parents.add(Math.floor(y / 2) * Math.ceil(old.width / 2) + Math.floor(x / 2));
5071
+ }
5072
+ levels[l] = { ...old, blocks };
5073
+ ids = parents;
5074
+ }
5075
+ return { levels, stats: { copiedBlocks, copiedBytes, updatedNodes: Uint32Array.from(updatedNodes) } };
5076
+ }
5077
+
5078
+ // dist/terrain/persistent-bounds.js
5079
+ function updateTerrainPersistentBounds(previous, field, dirty, options = {}) {
5080
+ const { nodesPerBlock, charge } = persistentHierarchyOptions(options, field.width * field.height);
5081
+ validateTerrainDirtyWindows(dirty, field.width, field.height);
5082
+ if (!previous || !sameTerrainFrame(previous.field, field) || previous.levels[0].nodesPerBlock !== nodesPerBlock) {
5083
+ const bounds = new HeightFieldMinMax(field), levels = Array.from({ length: bounds.levelCount }, (_, i) => {
5084
+ const l = bounds.copyLevel(i), values = new Float64Array(2 * l.width * l.height), counts = new Uint32Array(values.length);
5085
+ for (let j = 0; j < l.width * l.height; j++) {
5086
+ values[2 * j] = l.minimums[j];
5087
+ values[2 * j + 1] = l.maximums[j];
5088
+ counts[2 * j] = l.populatedCellCounts[j];
5089
+ counts[2 * j + 1] = l.completeCellCounts[j];
5090
+ }
5091
+ return packTerrainHierarchyLevel(l.width, l.height, l.blockSize, values, counts, nodesPerBlock);
5092
+ });
5093
+ return {
5094
+ field,
5095
+ levels,
5096
+ stats: {
5097
+ copiedBlocks: levels.reduce((n, l) => n + l.blocks.length, 0),
5098
+ copiedBytes: levels.reduce((n, l) => n + l.blocks.reduce((s, b) => s + b.values.byteLength + b.counts.byteLength, 0), 0),
5099
+ updatedNodes: Uint32Array.from(levels, (l) => l.width * l.height)
5100
+ }
5101
+ };
5102
+ }
5103
+ const ids = terrainDirtyIndices(dirty, field.width - 1, field.height - 1, 1, charge);
5104
+ const result = updatePersistentHierarchy(previous.levels, ids, "bounds", (x, y) => {
5105
+ let min = Infinity, max = -Infinity, n = 0;
5106
+ for (let dy = 0; dy < 2; dy++)
5107
+ for (let dx = 0; dx < 2; dx++) {
5108
+ const z = field.getHeight(x + dx, y + dy);
5109
+ if (z !== void 0) {
5110
+ min = Math.min(min, z);
5111
+ max = Math.max(max, z);
5112
+ n++;
5113
+ }
5114
+ }
5115
+ return { values: n ? [min, max] : [0, 0], counts: [n ? 1 : 0, n === 4 ? 1 : 0] };
5116
+ }, charge);
5117
+ return { field, ...result };
5118
+ }
5119
+
5120
+ // dist/terrain/persistent-gradients.js
5121
+ function updateTerrainPersistentGradients(previous, grid, dirty, options = {}) {
5122
+ const { nodesPerBlock, maxSamples, charge } = persistentHierarchyOptions(options, grid.width * grid.height);
5123
+ if (!Number.isSafeInteger(grid.width) || grid.width < 1 || !Number.isSafeInteger(grid.height) || grid.height < 1 || !(grid.gradients instanceof Float64Array) || grid.gradients.length !== 2 * grid.width * grid.height || !(grid.statuses instanceof Uint8Array) || grid.statuses.length !== grid.width * grid.height || grid.method !== "horn" && grid.method !== "zevenbergen-thorne" || grid.registration !== "vertex" && grid.registration !== "cell" || typeof grid.heightReference !== "string" || ![grid.origin, grid.columnStep, grid.rowStep].every((v) => v.length === 2 && v.every(Number.isFinite)))
5124
+ throw new Error("Invalid persistent gradient grid");
5125
+ validateTerrainDirtyWindows(dirty, grid.width, grid.height);
5126
+ const old = previous == null ? void 0 : previous.source;
5127
+ if (!old || old.width !== grid.width || old.height !== grid.height || old.method !== grid.method || old.registration !== grid.registration || old.heightReference !== grid.heightReference || !old.origin.every((v, i) => v === grid.origin[i]) || !old.columnStep.every((v, i) => v === grid.columnStep[i]) || !old.rowStep.every((v, i) => v === grid.rowStep[i]) || previous.levels[0].nodesPerBlock !== nodesPerBlock) {
5128
+ const pyramid = createTerrainGradientPyramid(grid, { maxSamples }), levels = pyramid.levels.map((l) => {
5129
+ const counts = new Uint32Array(2 * l.width * l.height);
5130
+ for (let i = 0; i < l.width * l.height; i++) {
5131
+ counts[2 * i] = l.validCounts[i];
5132
+ counts[2 * i + 1] = l.sampleCounts[i];
5133
+ }
5134
+ return packTerrainHierarchyLevel(l.width, l.height, l.blockSize, l.gradients, counts, nodesPerBlock);
5135
+ });
5136
+ return {
5137
+ source: grid,
5138
+ levels,
5139
+ stats: {
5140
+ copiedBlocks: levels.reduce((n, l) => n + l.blocks.length, 0),
5141
+ copiedBytes: levels.reduce((n, l) => n + l.blocks.reduce((s, b) => s + b.values.byteLength + b.counts.byteLength, 0), 0),
5142
+ updatedNodes: Uint32Array.from(levels, (l) => l.width * l.height)
5143
+ }
5144
+ };
5145
+ }
5146
+ const ids = terrainDirtyIndices(dirty, grid.width, grid.height, 0, charge);
5147
+ const result = updatePersistentHierarchy(previous.levels, ids, "gradient", (x, y) => {
5148
+ const i = y * grid.width + x, s = grid.statuses[i];
5149
+ if (s > 6)
5150
+ throw new Error("Invalid terrain gradient status");
5151
+ if (s === 0 && (!Number.isFinite(grid.gradients[2 * i]) || !Number.isFinite(grid.gradients[2 * i + 1])))
5152
+ throw new Error("Invalid terrain gradient value");
5153
+ return {
5154
+ values: s === 0 ? [grid.gradients[2 * i], grid.gradients[2 * i + 1]] : [0, 0],
5155
+ counts: [s === 0 ? 1 : 0, 1]
5156
+ };
5157
+ }, charge);
5158
+ return { source: grid, ...result };
5159
+ }
5160
+
5161
+ // dist/terrain/lod-morph.js
5162
+ var TerrainMorphStatus = {
5163
+ VALID: 0,
5164
+ FINE_NO_DATA: 1,
5165
+ COARSE_NO_DATA: 2,
5166
+ OUTSIDE_COARSE: 3
5167
+ };
5168
+ function createTerrainLodMorph(fine, coarse, options) {
5169
+ const { ratio } = options, offset = options.coarseOrigin ?? [0, 0], limit = options.maxSamples ?? 4e6, count = fine.width * fine.height;
5170
+ if (!Number.isSafeInteger(ratio) || ratio < 2 || 2 ** Math.round(Math.log2(ratio)) !== ratio || offset.length !== 2 || !offset.every(Number.isSafeInteger) || !Number.isSafeInteger(limit) || limit < 0 || count > limit)
5171
+ throw new Error("Invalid terrain LOD ratio, origin or sample capacity");
5172
+ if (fine.registration !== "vertex" || coarse.registration !== "vertex" || fine.diagonal !== coarse.diagonal || fine.heightReference !== coarse.heightReference)
5173
+ throw new Error("Incompatible terrain LOD registration, diagonal or height reference");
5174
+ for (let axis = 0; axis < 2; axis++) {
5175
+ if (fine.columnStep[axis] * ratio !== coarse.columnStep[axis] || fine.rowStep[axis] * ratio !== coarse.rowStep[axis])
5176
+ throw new Error("Terrain LOD steps differ");
5177
+ const a = offset[0] * fine.columnStep[axis], b = offset[1] * fine.rowStep[axis], expected = fine.origin[axis] + a + b;
5178
+ const tolerance = Math.min(16 * Number.EPSILON * Math.max(1, Math.abs(fine.origin[axis]), Math.abs(coarse.origin[axis]), Math.abs(a), Math.abs(b)), 1e-9 * Math.max(Math.abs(fine.columnStep[axis]), Math.abs(fine.rowStep[axis])));
5179
+ if (!Number.isFinite(expected) || Math.abs(coarse.origin[axis] - expected) > tolerance)
5180
+ throw new Error("Terrain LOD origins differ");
5181
+ }
5182
+ const fineHeights = new Float64Array(count), coarseHeights = new Float64Array(count), deltas = new Float64Array(count), statuses = new Uint8Array(count), coarseCoordinates = new Float64Array(2 * count);
5183
+ let maxNodalDisplacement = 0;
5184
+ for (let y = 0; y < fine.height; y++)
5185
+ for (let x = 0; x < fine.width; x++) {
5186
+ const i = y * fine.width + x, u = (x - offset[0]) / ratio, v = (y - offset[1]) / ratio;
5187
+ if (!Number.isSafeInteger(x - offset[0]) || !Number.isSafeInteger(y - offset[1]))
5188
+ throw new Error("Terrain LOD lattice overflow");
5189
+ coarseCoordinates[2 * i] = u;
5190
+ coarseCoordinates[2 * i + 1] = v;
5191
+ const source = fine.getHeight(x, y);
5192
+ if (source === void 0) {
5193
+ statuses[i] = TerrainMorphStatus.FINE_NO_DATA;
5194
+ continue;
5195
+ }
5196
+ fineHeights[i] = source;
5197
+ if (u < 0 || v < 0 || u > coarse.width - 1 || v > coarse.height - 1) {
5198
+ statuses[i] = TerrainMorphStatus.OUTSIDE_COARSE;
5199
+ continue;
5200
+ }
5201
+ const target = sampleTerrainTriangleHeight(coarse, u, v);
5202
+ if (target === void 0) {
5203
+ statuses[i] = TerrainMorphStatus.COARSE_NO_DATA;
5204
+ continue;
5205
+ }
5206
+ const delta = target - source;
5207
+ if (!Number.isFinite(delta))
5208
+ throw new Error("Terrain LOD displacement overflow");
5209
+ coarseHeights[i] = target;
5210
+ deltas[i] = delta;
5211
+ maxNodalDisplacement = Math.max(maxNodalDisplacement, Math.abs(delta));
5212
+ }
5213
+ return {
5214
+ width: fine.width,
5215
+ height: fine.height,
5216
+ origin: [...fine.origin],
5217
+ columnStep: [...fine.columnStep],
5218
+ rowStep: [...fine.rowStep],
5219
+ heightReference: fine.heightReference,
5220
+ fineHeights,
5221
+ coarseHeights,
5222
+ deltas,
5223
+ statuses,
5224
+ coarseCoordinates,
5225
+ maxNodalDisplacement,
5226
+ ratio,
5227
+ coarseOrigin: [...offset],
5228
+ diagonal: fine.diagonal
5229
+ };
5230
+ }
5231
+
5232
+ // dist/terrain/lod-morph-evaluate.js
5233
+ function evaluateTerrainLodMorph(morph, factor) {
5234
+ const count = morph.width * morph.height;
5235
+ if (!Number.isFinite(factor) || factor < 0 || factor > 1 || !Number.isSafeInteger(count) || count < 1 || morph.fineHeights.length !== count || morph.coarseHeights.length !== count || morph.statuses.length !== count)
5236
+ throw new Error("Invalid terrain morph evaluation");
5237
+ const heights = new Float64Array(count), validity = new Uint8Array(count);
5238
+ for (let i = 0; i < count; i++) {
5239
+ if (morph.statuses[i] > 3)
5240
+ throw new Error("Invalid terrain morph status");
5241
+ if (morph.statuses[i] !== 0)
5242
+ continue;
5243
+ const a = morph.fineHeights[i], b = morph.coarseHeights[i];
5244
+ if (!Number.isFinite(a) || !Number.isFinite(b))
5245
+ throw new Error("Invalid terrain morph height");
5246
+ heights[i] = factor === 0 ? a : factor === 1 ? b : a * (1 - factor) + b * factor;
5247
+ if (!Number.isFinite(heights[i]))
5248
+ throw new Error("Terrain morph arithmetic overflow");
5249
+ validity[i] = 1;
5250
+ }
5251
+ return { heights, validity };
5252
+ }
5253
+
5254
+ // dist/terrain/mixed-surface.js
5255
+ function reconcileMixedSurface(tiles, options = {}) {
5256
+ const limit = options.maxSamples ?? 4e6, budget = options.maxTests ?? 2e7, adjustment = options.maxHeightAdjustment ?? 0;
5257
+ if (![limit, budget].every(Number.isSafeInteger) || limit < 0 || budget < 0 || Number.isNaN(adjustment) || adjustment < 0)
5258
+ throw new Error("Invalid mixed surface capacity or adjustment");
5259
+ let count = 0, tests = 0, maxHeightAdjustment = 0, sharedSamples = 0;
5260
+ const charge = () => {
5261
+ if (++tests > budget)
5262
+ throw new Error("Mixed surface work budget exceeded");
5263
+ };
5264
+ const seen = /* @__PURE__ */ new Set();
5265
+ const sorted = [...tiles].sort((a, b) => b.spacing - a.spacing || a.column - b.column || a.row - b.row);
5266
+ const sources = sorted.map((t) => {
5267
+ if (![t.column, t.row, t.spacing].every(Number.isSafeInteger) || t.spacing < 1 || 2 ** Math.round(Math.log2(t.spacing)) !== t.spacing)
5268
+ throw new Error("Invalid mixed surface lattice");
5269
+ const key2 = `${t.spacing}/${t.column}/${t.row}`;
5270
+ if (seen.has(key2))
5271
+ throw new Error("Duplicate mixed surface tile");
5272
+ seen.add(key2);
5273
+ const width = (t.field.width - 1) * t.spacing + 1, height = (t.field.height - 1) * t.spacing + 1;
5274
+ count += width * height;
5275
+ if (![width, height, count, t.column + width - 1, t.row + height - 1].every(Number.isSafeInteger) || width < 2 || height < 2 || count > limit)
5276
+ throw new Error("Mixed surface sample capacity or lattice overflow");
5277
+ const field = new HeightField(t.field);
5278
+ if (field.registration !== "vertex")
5279
+ throw new Error("Mixed surfaces require vertex registration");
5280
+ return { ...t, field, width, height };
5281
+ });
5282
+ const first = sources[0];
5283
+ const columnStep = (first == null ? void 0 : first.field.columnStep.map((v) => v / first.spacing)) ?? [1, 0], rowStep = (first == null ? void 0 : first.field.rowStep.map((v) => v / first.spacing)) ?? [0, 1];
5284
+ const origin = (first == null ? void 0 : first.field.origin.map((v, i) => v - first.column * columnStep[i] - first.row * rowStep[i])) ?? [0, 0];
5285
+ if (!origin.every(Number.isFinite))
5286
+ throw new Error("Mixed surface frame overflow");
5287
+ for (const t of sources)
5288
+ for (let axis = 0; axis < 2; axis++) {
5289
+ const expected = origin[axis] + t.column * columnStep[axis] + t.row * rowStep[axis];
5290
+ const tolerance = Math.min(32 * Number.EPSILON * Math.max(1, Math.abs(t.field.origin[axis]), Math.abs(origin[axis]), Math.abs(t.column * columnStep[axis]), Math.abs(t.row * rowStep[axis])), 1e-9 * Math.max(Math.abs(columnStep[axis]), Math.abs(rowStep[axis])));
5291
+ if (t.field.diagonal !== first.field.diagonal || t.field.heightReference !== first.field.heightReference || t.field.columnStep[axis] / t.spacing !== columnStep[axis] || t.field.rowStep[axis] / t.spacing !== rowStep[axis] || !Number.isFinite(expected) || Math.abs(t.field.origin[axis] - expected) > tolerance)
5292
+ throw new Error("Mixed surface frames, diagonals or height references differ");
5293
+ }
5294
+ for (const axis of ["column", "row"]) {
5295
+ let min = Infinity, max = -Infinity;
5296
+ for (const t of sources) {
5297
+ min = Math.min(min, t[axis]);
5298
+ max = Math.max(max, t[axis] + (axis === "column" ? t.width : t.height) - 1);
5299
+ }
5300
+ if (sources.length && !Number.isSafeInteger(max - min))
5301
+ throw new Error("Mixed surface lattice span overflow");
5302
+ }
5303
+ const boxes = sources.map((t) => ({
5304
+ minX: t.column,
5305
+ minY: t.row,
5306
+ maxX: t.column + t.width - 1,
5307
+ maxY: t.row + t.height - 1
5308
+ })), index = createTerrainBoxIndex(boxes);
5309
+ const neighbors = boxes.map((box, i) => index(box, charge).filter((j) => {
5310
+ if (i !== j && box.minX < boxes[j].maxX && boxes[j].minX < box.maxX && box.minY < boxes[j].maxY && boxes[j].minY < box.maxY)
5311
+ throw new Error("Overlapping mixed surface interiors");
5312
+ return j !== i;
5313
+ }));
5314
+ const fields = sources.map((t, i) => {
5315
+ const heights = new Float64Array(t.width * t.height), validity = new Uint8Array(heights.length);
5316
+ for (let y = 0; y < t.height; y++)
5317
+ for (let x = 0; x < t.width; x++) {
5318
+ charge();
5319
+ const gx = t.column + x, gy = t.row + y, local = sampleTerrainTriangleHeight(t.field, x / t.spacing, y / t.spacing);
5320
+ let owner = i, shared = false, missing = local === void 0;
5321
+ if (x === 0 || y === 0 || x === t.width - 1 || y === t.height - 1)
5322
+ for (const j of neighbors[i]) {
5323
+ charge();
5324
+ const b = boxes[j];
5325
+ if (gx >= b.minX && gx <= b.maxX && gy >= b.minY && gy <= b.maxY) {
5326
+ shared = true;
5327
+ const neighbor = sources[j];
5328
+ if (sampleTerrainTriangleHeight(neighbor.field, (gx - neighbor.column) / neighbor.spacing, (gy - neighbor.row) / neighbor.spacing) === void 0)
5329
+ missing = true;
5330
+ owner = Math.min(owner, j);
5331
+ }
5332
+ }
5333
+ const source = sources[owner], value = missing ? void 0 : owner === i ? local : sampleTerrainTriangleHeight(source.field, (gx - source.column) / source.spacing, (gy - source.row) / source.spacing);
5334
+ if (shared)
5335
+ sharedSamples++;
5336
+ if (local !== void 0 && value !== void 0) {
5337
+ const delta = Math.abs(value - local);
5338
+ if (!Number.isFinite(delta) || delta > adjustment)
5339
+ throw new Error("Mixed surface height adjustment exceeded");
5340
+ maxHeightAdjustment = Math.max(maxHeightAdjustment, delta);
5341
+ }
5342
+ if (value !== void 0) {
5343
+ const id = y * t.width + x;
5344
+ heights[id] = value;
5345
+ validity[id] = 1;
5346
+ }
5347
+ }
5348
+ const props = {
5349
+ width: t.width,
5350
+ height: t.height,
5351
+ heights,
5352
+ validity,
5353
+ origin: [
5354
+ origin[0] + t.column * columnStep[0] + t.row * rowStep[0],
5355
+ origin[1] + t.column * columnStep[1] + t.row * rowStep[1]
5356
+ ],
5357
+ columnStep: [...columnStep],
5358
+ rowStep: [...rowStep],
5359
+ registration: "vertex",
5360
+ diagonal: t.field.diagonal,
5361
+ heightReference: t.field.heightReference
5362
+ };
5363
+ return {
5364
+ column: t.column,
5365
+ row: t.row,
5366
+ spacing: 1,
5367
+ sourceSpacing: t.spacing,
5368
+ field: props
5369
+ };
5370
+ });
5371
+ return {
5372
+ origin,
5373
+ columnStep,
5374
+ rowStep,
5375
+ tiles: fields,
5376
+ maxHeightAdjustment,
5377
+ sharedSamples,
5378
+ tests
5379
+ };
5380
+ }
5381
+
5382
+ // dist/terrain/lod-coordinate.js
5383
+ function coordinateTerrainLodMorphs(tiles, options = {}) {
5384
+ const limit = options.maxSamples ?? 4e6;
5385
+ if (!Number.isSafeInteger(limit) || limit < 0)
5386
+ throw new Error("Invalid coordinated morph sample capacity");
5387
+ let count = 0;
5388
+ for (const t of tiles) {
5389
+ count += t.morph.width * t.morph.height;
5390
+ if (!Number.isSafeInteger(count) || count > limit)
5391
+ throw new Error("Coordinated morph sample capacity exceeded");
5392
+ }
5393
+ return reconcileMixedSurface(tiles.map((t) => {
5394
+ const evaluated = evaluateTerrainLodMorph(t.morph, t.factor);
5395
+ return {
5396
+ column: t.column,
5397
+ row: t.row,
5398
+ spacing: t.spacing,
5399
+ field: {
5400
+ ...evaluated,
5401
+ width: t.morph.width,
5402
+ height: t.morph.height,
5403
+ origin: t.morph.origin,
5404
+ columnStep: t.morph.columnStep,
5405
+ rowStep: t.morph.rowStep,
5406
+ registration: "vertex",
5407
+ diagonal: t.morph.diagonal,
5408
+ heightReference: t.morph.heightReference
5409
+ }
5410
+ };
5411
+ }), { ...options, maxHeightAdjustment: options.maxHeightAdjustment ?? Infinity });
5412
+ }
5413
+
5414
+ // dist/terrain/isobands-mixed.js
5415
+ function createTerrainMixedIsobands(tiles, levels, options = {}) {
5416
+ const maxLevels = options.maxLevels ?? 256;
5417
+ if (!Number.isSafeInteger(maxLevels) || maxLevels < 2 || levels.length < 2 || levels.length > maxLevels || levels.some((v, i) => !Number.isFinite(v) || i > 0 && v <= levels[i - 1]))
5418
+ throw new Error("Invalid mixed isoband levels or capacity");
5419
+ const triangles = tiles.reduce((n, t) => n + 2 * (t.field.width - 1) * (t.field.height - 1) * t.spacing * t.spacing, 0);
5420
+ const maxTriangles = options.maxTriangles ?? 2e6;
5421
+ if (!Number.isSafeInteger(triangles) || !Number.isSafeInteger(maxTriangles) || maxTriangles < 0 || triangles > maxTriangles)
5422
+ throw new Error("Mixed isoband triangle capacity exceeded");
5423
+ const maxTests = options.maxTests ?? 2e7;
5424
+ const surface = reconcileMixedSurface(tiles, { ...options, maxTests });
5425
+ const bands = createTerrainIsobands(surface.tiles.map((t) => new HeightField(t.field)), levels, { ...options, maxTests: maxTests - surface.tests });
5426
+ return {
5427
+ ...bands,
5428
+ maxHeightAdjustment: surface.maxHeightAdjustment,
5429
+ sharedSamples: surface.sharedSamples
5430
+ };
5431
+ }
3917
5432
  //# sourceMappingURL=index.cjs.map