@baidumap/mapv-three 1.3.3 → 1.4.1

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 (273) hide show
  1. package/README.md +3 -3
  2. package/dist/assets/textures/cloud/stbn.bin +0 -0
  3. package/dist/assets/textures/weather/thunder.jpg +0 -0
  4. package/dist/assets/wasm/lanelet.js +3296 -165
  5. package/dist/assets/wasm/lanelet.wasm +0 -0
  6. package/dist/assets/workers/{BaiduVectorParser.worker-d550338e.js → BaiduVectorParser.worker-486240e8.js} +977 -930
  7. package/dist/assets/workers/{CesiumTerrainParser.worker-20119751.js → CesiumTerrainParser.worker-ba35b937.js} +1032 -954
  8. package/dist/assets/workers/{MVTParser.worker-7dc8b0e4.js → MVTParser.worker-bb80e3b4.js} +755 -699
  9. package/dist/devtool/panel.js +108 -29
  10. package/dist/mapvthree.module.js +45540 -46298
  11. package/dist/mapvthree.umd.js +13 -7
  12. package/dist/types/Internal.d.ts +2 -0
  13. package/dist/types/adapters/bmap/Icon.d.ts +18 -0
  14. package/dist/types/adapters/bmap/InfoWindow.d.ts +124 -0
  15. package/dist/types/adapters/bmap/Label.d.ts +58 -0
  16. package/dist/types/adapters/bmap/Map.d.ts +124 -0
  17. package/dist/types/adapters/bmap/Marker.d.ts +28 -0
  18. package/dist/types/adapters/bmap/Overlay.d.ts +18 -0
  19. package/dist/types/adapters/bmap/Pixel.d.ts +1 -0
  20. package/dist/types/adapters/bmap/Point.d.ts +8 -0
  21. package/dist/types/adapters/bmap/Size.d.ts +8 -0
  22. package/dist/types/adapters/bmap/index.d.ts +8 -0
  23. package/dist/types/adapters/index.d.ts +1 -0
  24. package/dist/types/index.d.ts +3 -2
  25. package/dist/types/index.open.d.ts +5 -0
  26. package/dist/types/threejs/controls/PointerLockControls.d.ts +2 -0
  27. package/dist/types/threejs/geometries/text/ScreenTextGeometry.d.ts +15 -0
  28. package/dist/types/threejs/loaders/utilities/BatchTableHierarchyExtension.d.ts +4 -4
  29. package/dist/types/threejs/loaders/utilities/FeatureTable.d.ts +1 -1
  30. package/dist/types/threejs/materials/effects/LightningBillboardMaterial.d.ts +3 -0
  31. package/dist/types/threejs/materials/effects/LightningMaterial.d.ts +9 -0
  32. package/dist/types/threejs/materials/extend/ExtendMeshStandardMaterial.d.ts +1 -0
  33. package/dist/types/threejs/materials/natural/DynamicSkyMaterial.d.ts +1 -0
  34. package/dist/types/threejs/materials/natural/StaticSkyMaterial.d.ts +1 -0
  35. package/dist/types/threejs/materials/natural/VerticalGradientSkyMaterial.d.ts +1 -0
  36. package/dist/types/threejs/materials/polygon/PolygonMaterial.d.ts +1 -0
  37. package/dist/types/threejs/materials/text/ScreenTextMaterial.d.ts +25 -0
  38. package/dist/types/threejs/objects/GeoInstancedMesh.d.ts +1 -0
  39. package/dist/types/threejs/objects/line/FatLineInternal.d.ts +4 -0
  40. package/dist/types/threejs/objects/line/Polyline.d.ts +1 -1
  41. package/dist/types/threejs/objects/point/Icon.d.ts +1 -0
  42. package/dist/types/threejs/objects/point/Label.d.ts +15 -2
  43. package/dist/types/threejs/objects/point/label/GeometryBufferBuilder.d.ts +3 -0
  44. package/dist/types/threejs/objects/point/label/TextBoxCalculator.d.ts +5 -3
  45. package/dist/types/threejs/objects/text/ScreenText.d.ts +273 -0
  46. package/dist/types/threejs/objects/text/font-atlas-manager.d.ts +10 -2
  47. package/dist/types/threejs/objects/text/utils.d.ts +1 -1
  48. package/dist/types/threemap/3dtiles/HDMap3DTiles.d.ts +26 -0
  49. package/dist/types/threemap/3dtiles/materials/Default3DTilesMaterialManager.d.ts +51 -3
  50. package/dist/types/threemap/Engine.d.ts +23 -4
  51. package/dist/types/threemap/animations/ObjectTracker.d.ts +73 -44
  52. package/dist/types/threemap/animations/PathTracker.d.ts +92 -24
  53. package/dist/types/threemap/animations/RotateTracker.d.ts +115 -21
  54. package/dist/types/threemap/animations/TrackerAbstract.d.ts +15 -11
  55. package/dist/types/threemap/controls/PointerLockControls.d.ts +8 -2
  56. package/dist/types/threemap/controls/controller/ColumbusController.d.ts +10 -0
  57. package/dist/types/threemap/controls/controller/Scene3DController.d.ts +9 -0
  58. package/dist/types/threemap/controls/editors/Editor.d.ts +3 -0
  59. package/dist/types/threemap/engine/Clock.d.ts +156 -0
  60. package/dist/types/threemap/engine/Controller.d.ts +141 -0
  61. package/dist/types/threemap/engine/Map.d.ts +34 -4
  62. package/dist/types/threemap/engine/Rendering.d.ts +15 -0
  63. package/dist/types/threemap/engine/event/EntityProxy.d.ts +1 -0
  64. package/dist/types/threemap/engine/map/BlankMap.d.ts +1 -1
  65. package/dist/types/threemap/engine/map/BlankMap3DControl.d.ts +4 -1
  66. package/dist/types/{threejs → threemap/engine/map}/controls/DraggingMovementAggregator.d.ts +3 -0
  67. package/dist/types/{threejs → threemap/engine/map}/controls/MapControl3D.d.ts +19 -2
  68. package/dist/types/{threejs → threemap/engine/map}/controls/PointerMovementAggregator.d.ts +3 -0
  69. package/dist/types/threemap/engine/map/earth/Earth.d.ts +1 -0
  70. package/dist/types/threemap/engine/rendering/Collision.d.ts +5 -0
  71. package/dist/types/threemap/engine/rendering/Label.d.ts +15 -0
  72. package/dist/types/threemap/engine/rendering/MainNew.d.ts +1 -1
  73. package/dist/types/threemap/engine/rendering/postprocessing/OpaquePostprocessings.d.ts +1 -1
  74. package/dist/types/threemap/engine/rendering/postprocessing/SkyAtmospherePass.d.ts +1 -0
  75. package/dist/types/threemap/engine/rendering/scene/DirectSceneRendering.d.ts +5 -0
  76. package/dist/types/threemap/mapView/geo/terrainData/QuantizedMeshTerrainData.d.ts +1 -1
  77. package/dist/types/threemap/mapView/grid/BaiduVectorOfflineGrid.d.ts +5 -0
  78. package/dist/types/threemap/mapView/map/MapView.d.ts +3 -0
  79. package/dist/types/threemap/mapView/parser/baidulane/ElementParser.d.ts +86 -0
  80. package/dist/types/threemap/mapView/parser/baidulane/StyleParser.d.ts +28 -0
  81. package/dist/types/threemap/mapView/parser/baidulane/constants/index.d.ts +25 -0
  82. package/dist/types/threemap/mapView/parser/baidulane/constants/types.d.ts +47 -0
  83. package/dist/types/threemap/mapView/parser/baidulane/core/GeometryBuilder.d.ts +40 -0
  84. package/dist/types/threemap/mapView/parser/baidulane/core/LayerManager.d.ts +41 -0
  85. package/dist/types/threemap/mapView/parser/baidulane/core/MaterialFactory.d.ts +71 -0
  86. package/dist/types/threemap/mapView/parser/baidulane/core/StyleManager.d.ts +50 -0
  87. package/dist/types/threemap/mapView/parser/baidulane/core/TextureManager.d.ts +65 -0
  88. package/dist/types/threemap/mapView/parser/baidulane/core/wasmManager.d.ts +18 -0
  89. package/dist/types/threemap/mapView/parser/baidulane/generators/Base.d.ts +46 -0
  90. package/dist/types/threemap/mapView/parser/baidulane/generators/Building3d.d.ts +15 -0
  91. package/dist/types/threemap/mapView/parser/baidulane/generators/FlatSymbol.d.ts +15 -0
  92. package/dist/types/threemap/mapView/parser/baidulane/generators/LabelLine.d.ts +36 -0
  93. package/dist/types/threemap/mapView/parser/baidulane/generators/Line.d.ts +15 -0
  94. package/dist/types/threemap/mapView/parser/baidulane/generators/Line3d.d.ts +15 -0
  95. package/dist/types/threemap/mapView/parser/baidulane/generators/Line3dTexture.d.ts +3 -0
  96. package/dist/types/threemap/mapView/parser/baidulane/generators/LineDash.d.ts +7 -0
  97. package/dist/types/threemap/mapView/parser/baidulane/generators/LineTexture.d.ts +7 -0
  98. package/dist/types/threemap/mapView/parser/baidulane/generators/Poi.d.ts +26 -0
  99. package/dist/types/threemap/mapView/parser/baidulane/generators/Polygon.d.ts +15 -0
  100. package/dist/types/threemap/mapView/parser/baidulane/generators/Polygon3d.d.ts +40 -0
  101. package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonExtrude.d.ts +15 -0
  102. package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonExtrudeTexture.d.ts +18 -0
  103. package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonOpacity.d.ts +7 -0
  104. package/dist/types/threemap/mapView/parser/baidulane/generators/SimplePoint.d.ts +39 -0
  105. package/dist/types/threemap/mapView/parser/baidulane/processors/Background.d.ts +11 -0
  106. package/dist/types/threemap/mapView/parser/baidulane/processors/Base.d.ts +27 -0
  107. package/dist/types/threemap/mapView/parser/baidulane/processors/BridgePier.d.ts +20 -0
  108. package/dist/types/threemap/mapView/parser/baidulane/processors/DebugLine.d.ts +16 -0
  109. package/dist/types/threemap/mapView/parser/baidulane/processors/DebugPoint.d.ts +5 -0
  110. package/dist/types/threemap/mapView/parser/baidulane/processors/DebugPolygon.d.ts +20 -0
  111. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingGradient.d.ts +16 -0
  112. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingGuide.d.ts +11 -0
  113. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingLine.d.ts +11 -0
  114. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingPoly.d.ts +15 -0
  115. package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingRoad.d.ts +13 -0
  116. package/dist/types/threemap/mapView/parser/baidulane/processors/HRegion.d.ts +11 -0
  117. package/dist/types/threemap/mapView/parser/baidulane/processors/LineName.d.ts +48 -0
  118. package/dist/types/threemap/mapView/parser/baidulane/processors/Link.d.ts +10 -0
  119. package/dist/types/threemap/mapView/parser/baidulane/processors/Poi.d.ts +7 -0
  120. package/dist/types/threemap/mapView/parser/baidulane/processors/Poly.d.ts +11 -0
  121. package/dist/types/threemap/mapView/parser/baidulane/processors/Texture.d.ts +10 -0
  122. package/dist/types/threemap/mapView/parser/baidulane/utils/color.d.ts +13 -0
  123. package/dist/types/threemap/mapView/parser/baidulane/utils/coordinate.d.ts +18 -0
  124. package/dist/types/threemap/mapView/parser/baidulane/utils/geometry.d.ts +3 -0
  125. package/dist/types/threemap/mapView/parser/baidulane/utils/icon.d.ts +8 -0
  126. package/dist/types/threemap/mapView/parser/baidulane/utils/merge.d.ts +7 -0
  127. package/dist/types/threemap/mapView/parser/baidulane/utils/tracer.d.ts +7 -0
  128. package/dist/types/{util/mapbox.d.ts → threemap/mapView/parser/mapbox/util.d.ts} +1 -1
  129. package/dist/types/threemap/mapView/surface/GroundSceneRenderer.d.ts +7 -2
  130. package/dist/types/threemap/mapView/surface/MapSurface.d.ts +2 -0
  131. package/dist/types/threemap/mapView/surface/strategy/FastTileLoaderStrategy.d.ts +16 -0
  132. package/dist/types/threemap/mapView/tileProvider/terrain/CesiumTerrainTileProvider.d.ts +3 -0
  133. package/dist/types/threemap/mapView/tileProvider/vector/BaiduLaneVectorTileProvider.d.ts +7 -0
  134. package/dist/types/threemap/mapView/tileProvider/vector/BaiduVectorTileProvider.d.ts +3 -0
  135. package/dist/types/threemap/mapView/tileProvider/vector/MapboxVectorTileProvider.d.ts +6 -10
  136. package/dist/types/threemap/mapView/utils/createGroundTileMesh.d.ts +2 -1
  137. package/dist/types/threemap/mapView/utils/projectVertices.d.ts +1 -1
  138. package/dist/types/threemap/materials/BatchBuildingMaterial.d.ts +9 -11
  139. package/dist/types/threemap/materials/RoadMarkingMaterial.d.ts +2 -11
  140. package/dist/types/threemap/materials/TerrainClassificationMaterial.d.ts +9 -7
  141. package/dist/types/threemap/natural/DynamicSky.d.ts +68 -22
  142. package/dist/types/threemap/natural/DynamicWeather.d.ts +17 -105
  143. package/dist/types/threemap/natural/EmptySky.d.ts +48 -62
  144. package/dist/types/threemap/natural/PhysicalSky.d.ts +220 -0
  145. package/dist/types/threemap/natural/Rain.d.ts +5 -2
  146. package/dist/types/threemap/natural/Snow.d.ts +5 -2
  147. package/dist/types/threemap/natural/StaticSky.d.ts +1 -0
  148. package/dist/types/threemap/natural/Thunderstorm.d.ts +46 -0
  149. package/dist/types/threemap/natural/clouds/CascadedShadowMaps.d.ts +31 -0
  150. package/dist/types/threemap/natural/clouds/CloudLayer.d.ts +19 -0
  151. package/dist/types/threemap/natural/clouds/CloudLayers.d.ts +13 -0
  152. package/dist/types/threemap/natural/clouds/CloudShape.d.ts +4 -0
  153. package/dist/types/threemap/natural/clouds/CloudShapeDetail.d.ts +4 -0
  154. package/dist/types/threemap/natural/clouds/CloudsEffect.d.ts +173 -0
  155. package/dist/types/threemap/natural/clouds/CloudsMaterial.d.ts +35 -0
  156. package/dist/types/threemap/natural/clouds/CloudsPass.d.ts +39 -0
  157. package/dist/types/threemap/natural/clouds/CloudsPostPass.d.ts +10 -0
  158. package/dist/types/threemap/natural/clouds/CloudsResolveMaterial.d.ts +13 -0
  159. package/dist/types/threemap/natural/clouds/DensityProfile.d.ts +10 -0
  160. package/dist/types/threemap/natural/clouds/LocalWeather.d.ts +4 -0
  161. package/dist/types/threemap/natural/clouds/PassBase.d.ts +7 -0
  162. package/dist/types/threemap/natural/clouds/Procedural3DTexture.d.ts +15 -0
  163. package/dist/types/threemap/natural/clouds/ProceduralTexture.d.ts +15 -0
  164. package/dist/types/threemap/natural/clouds/ShaderArrayPass.d.ts +3 -0
  165. package/dist/types/threemap/natural/clouds/ShadowMaterial.d.ts +14 -0
  166. package/dist/types/threemap/natural/clouds/ShadowPass.d.ts +31 -0
  167. package/dist/types/threemap/natural/clouds/ShadowResolveMaterial.d.ts +8 -0
  168. package/dist/types/threemap/natural/clouds/Turbulence.d.ts +4 -0
  169. package/dist/types/threemap/natural/clouds/bayer.d.ts +2 -0
  170. package/dist/types/threemap/natural/clouds/constants.d.ts +6 -0
  171. package/dist/types/threemap/natural/clouds/helpers/FrustumCorners.d.ts +10 -0
  172. package/dist/types/threemap/natural/clouds/helpers/setArrayRenderTargetLayers.d.ts +1 -0
  173. package/dist/types/threemap/natural/clouds/helpers/splitFrustum.d.ts +6 -0
  174. package/dist/types/threemap/natural/clouds/qualityPresets.d.ts +130 -0
  175. package/dist/types/threemap/natural/clouds/uniforms.d.ts +44 -0
  176. package/dist/types/threemap/natural/core/ArrayBufferLoader.d.ts +3 -0
  177. package/dist/types/threemap/natural/core/DataTextureLoader.d.ts +11 -0
  178. package/dist/types/threemap/natural/core/Ellipsoid.d.ts +17 -0
  179. package/dist/types/threemap/natural/core/Geodetic.d.ts +23 -0
  180. package/dist/types/threemap/natural/core/TypedArrayLoader.d.ts +5 -0
  181. package/dist/types/threemap/natural/core/capabilities.d.ts +1 -0
  182. package/dist/types/threemap/natural/core/celestialDirections.d.ts +5 -0
  183. package/dist/types/threemap/natural/core/decorators.d.ts +61 -0
  184. package/dist/types/threemap/natural/core/defineShorthand.d.ts +2 -0
  185. package/dist/types/threemap/natural/core/helpers/projectOnEllipsoidSurface.d.ts +1 -0
  186. package/dist/types/threemap/natural/core/math.d.ts +15 -0
  187. package/dist/types/threemap/natural/core/requestIdleCallback.d.ts +2 -0
  188. package/dist/types/threemap/natural/core/resolveIncludes.d.ts +1 -0
  189. package/dist/types/threemap/natural/core/shaders/index.d.ts +10 -0
  190. package/dist/types/threemap/natural/core/unrollLoops.d.ts +1 -0
  191. package/dist/types/threemap/natural/effects/DepthEffect.d.ts +15 -0
  192. package/dist/types/threemap/natural/effects/DitheringEffect.d.ts +6 -0
  193. package/dist/types/threemap/natural/effects/DownsampleThresholdMaterial.d.ts +14 -0
  194. package/dist/types/threemap/natural/effects/GeometryEffect.d.ts +11 -0
  195. package/dist/types/threemap/natural/effects/GeometryPass.d.ts +6 -0
  196. package/dist/types/threemap/natural/effects/LensFlareEffect.d.ts +31 -0
  197. package/dist/types/threemap/natural/effects/LensFlareFeaturesMaterial.d.ts +17 -0
  198. package/dist/types/threemap/natural/effects/NormalEffect.d.ts +16 -0
  199. package/dist/types/threemap/natural/effects/createHaldLookupTexture.d.ts +1 -0
  200. package/dist/types/threemap/natural/effects/index.d.ts +7 -0
  201. package/dist/types/threemap/natural/effects/setupMaterialsForGeometryPass.d.ts +1 -0
  202. package/dist/types/threemap/natural/sky/AerialPerspectiveEffect.d.ts +95 -0
  203. package/dist/types/threemap/natural/sky/AtmosphereMaterialBase.d.ts +40 -0
  204. package/dist/types/threemap/natural/sky/AtmosphereParameters.d.ts +32 -0
  205. package/dist/types/threemap/natural/sky/AtmospherePostPass.d.ts +10 -0
  206. package/dist/types/threemap/natural/sky/PrecomputedTexturesGenerator.d.ts +66 -0
  207. package/dist/types/threemap/natural/sky/SkyMaterial.d.ts +26 -0
  208. package/dist/types/threemap/natural/sky/constants.d.ts +14 -0
  209. package/dist/types/threemap/natural/sky/getAltitudeCorrectionOffset.d.ts +1 -0
  210. package/dist/types/threemap/overlay/Marker.d.ts +3 -0
  211. package/dist/types/threemap/services/autoComplete/AutoComplete.d.ts +1 -1
  212. package/dist/types/threemap/services/boundary/Boundary.d.ts +3 -3
  213. package/dist/types/threemap/services/common/baiduRequest.d.ts +1 -1
  214. package/dist/types/threemap/services/configs.d.ts +2 -2
  215. package/dist/types/threemap/services/district/DistrictLayer.d.ts +3 -3
  216. package/dist/types/threemap/services/geocoder/Geocoder.d.ts +5 -5
  217. package/dist/types/threemap/services/localSearch/LocalSearch.d.ts +5 -5
  218. package/dist/types/threemap/services/routeSearch/DrivingRoute.d.ts +2 -2
  219. package/dist/types/threemap/services/routeSearch/TransitRoute.d.ts +3 -3
  220. package/dist/types/threemap/video/VideoConfig.d.ts +2 -2
  221. package/dist/types/util/graphics/line.d.ts +2 -2
  222. package/dist/types/util/request.d.ts +1 -1
  223. package/package.json +6 -3
  224. /package/dist/types/{threejs → threemap/engine/map}/controls/MapControl.d.ts +0 -0
  225. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/color.d.ts +0 -0
  226. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/background.d.ts +0 -0
  227. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/fill-extrusion.d.ts +0 -0
  228. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/fill.d.ts +0 -0
  229. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/index.d.ts +0 -0
  230. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/line.d.ts +0 -0
  231. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/symbol.d.ts +0 -0
  232. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/compound_expression.d.ts +0 -0
  233. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/assertion.d.ts +0 -0
  234. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/at.d.ts +0 -0
  235. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/case.d.ts +0 -0
  236. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/coalesce.d.ts +0 -0
  237. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/coercion.d.ts +0 -0
  238. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/collator.d.ts +0 -0
  239. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/comparison.d.ts +0 -0
  240. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/format.d.ts +0 -0
  241. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/image.d.ts +0 -0
  242. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/in.d.ts +0 -0
  243. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/index.d.ts +0 -0
  244. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/index_of.d.ts +0 -0
  245. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/interpolate.d.ts +0 -0
  246. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/length.d.ts +0 -0
  247. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/let.d.ts +0 -0
  248. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/literal.d.ts +0 -0
  249. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/match.d.ts +0 -0
  250. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/number_format.d.ts +0 -0
  251. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/slice.d.ts +0 -0
  252. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/step.d.ts +0 -0
  253. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/var.d.ts +0 -0
  254. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/within.d.ts +0 -0
  255. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/evaluation_context.d.ts +0 -0
  256. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/expression.d.ts +0 -0
  257. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/index.d.ts +0 -0
  258. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/is_constant.d.ts +0 -0
  259. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/parsing_context.d.ts +0 -0
  260. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/parsing_error.d.ts +0 -0
  261. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/scope.d.ts +0 -0
  262. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/stops.d.ts +0 -0
  263. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/collator.d.ts +0 -0
  264. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/formatted.d.ts +0 -0
  265. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/resolved_image.d.ts +0 -0
  266. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types.d.ts +0 -0
  267. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/values.d.ts +0 -0
  268. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/feature_filter/index.d.ts +0 -0
  269. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/function/convert.d.ts +0 -0
  270. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/function/index.d.ts +0 -0
  271. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/sourceLayer.d.ts +0 -0
  272. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/sprite.d.ts +0 -0
  273. /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/style.d.ts +0 -0
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  /**
8
8
  * @license
9
- * Copyright 2010-2023 Three.js Authors
9
+ * Copyright 2010-2025 Three.js Authors
10
10
  * SPDX-License-Identifier: MIT
11
11
  */
12
12
  const t = 2e3, s = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
@@ -220,14 +220,14 @@ class c {
220
220
  return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this;
221
221
  }
222
222
  clamp(t2, s2) {
223
- return this.x = Math.max(t2.x, Math.min(s2.x, this.x)), this.y = Math.max(t2.y, Math.min(s2.y, this.y)), this;
223
+ return this.x = n(this.x, t2.x, s2.x), this.y = n(this.y, t2.y, s2.y), this;
224
224
  }
225
225
  clampScalar(t2, s2) {
226
- return this.x = Math.max(t2, Math.min(s2, this.x)), this.y = Math.max(t2, Math.min(s2, this.y)), this;
226
+ return this.x = n(this.x, t2, s2), this.y = n(this.y, t2, s2), this;
227
227
  }
228
228
  clampLength(t2, s2) {
229
229
  const i2 = this.length();
230
- return this.divideScalar(i2 || 1).multiplyScalar(Math.max(t2, Math.min(s2, i2)));
230
+ return this.divideScalar(i2 || 1).multiplyScalar(n(i2, t2, s2));
231
231
  }
232
232
  floor() {
233
233
  return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;
@@ -315,129 +315,218 @@ class c {
315
315
  }
316
316
  }
317
317
  class l {
318
- constructor(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
319
- l.prototype.isMatrix3 = true, this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], void 0 !== t2 && this.set(t2, s2, i2, e2, a2, n2, r2, h2, o2);
318
+ constructor(t2 = 0, s2 = 0, i2 = 0, e2 = 1) {
319
+ this.isQuaternion = true, this._x = t2, this._y = s2, this._z = i2, this._w = e2;
320
320
  }
321
- set(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
322
- const c2 = this.elements;
323
- return c2[0] = t2, c2[1] = e2, c2[2] = r2, c2[3] = s2, c2[4] = a2, c2[5] = h2, c2[6] = i2, c2[7] = n2, c2[8] = o2, this;
321
+ static slerpFlat(t2, s2, i2, e2, a2, n2, r2) {
322
+ let h2 = i2[e2 + 0], o2 = i2[e2 + 1], c2 = i2[e2 + 2], l2 = i2[e2 + 3];
323
+ const u2 = a2[n2 + 0], d2 = a2[n2 + 1], m2 = a2[n2 + 2], _2 = a2[n2 + 3];
324
+ if (0 === r2)
325
+ return t2[s2 + 0] = h2, t2[s2 + 1] = o2, t2[s2 + 2] = c2, void (t2[s2 + 3] = l2);
326
+ if (1 === r2)
327
+ return t2[s2 + 0] = u2, t2[s2 + 1] = d2, t2[s2 + 2] = m2, void (t2[s2 + 3] = _2);
328
+ if (l2 !== _2 || h2 !== u2 || o2 !== d2 || c2 !== m2) {
329
+ let t3 = 1 - r2;
330
+ const s3 = h2 * u2 + o2 * d2 + c2 * m2 + l2 * _2, i3 = s3 >= 0 ? 1 : -1, e3 = 1 - s3 * s3;
331
+ if (e3 > Number.EPSILON) {
332
+ const a4 = Math.sqrt(e3), n3 = Math.atan2(a4, s3 * i3);
333
+ t3 = Math.sin(t3 * n3) / a4, r2 = Math.sin(r2 * n3) / a4;
334
+ }
335
+ const a3 = r2 * i3;
336
+ if (h2 = h2 * t3 + u2 * a3, o2 = o2 * t3 + d2 * a3, c2 = c2 * t3 + m2 * a3, l2 = l2 * t3 + _2 * a3, t3 === 1 - r2) {
337
+ const t4 = 1 / Math.sqrt(h2 * h2 + o2 * o2 + c2 * c2 + l2 * l2);
338
+ h2 *= t4, o2 *= t4, c2 *= t4, l2 *= t4;
339
+ }
340
+ }
341
+ t2[s2] = h2, t2[s2 + 1] = o2, t2[s2 + 2] = c2, t2[s2 + 3] = l2;
324
342
  }
325
- identity() {
326
- return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
343
+ static multiplyQuaternionsFlat(t2, s2, i2, e2, a2, n2) {
344
+ const r2 = i2[e2], h2 = i2[e2 + 1], o2 = i2[e2 + 2], c2 = i2[e2 + 3], l2 = a2[n2], u2 = a2[n2 + 1], d2 = a2[n2 + 2], m2 = a2[n2 + 3];
345
+ return t2[s2] = r2 * m2 + c2 * l2 + h2 * d2 - o2 * u2, t2[s2 + 1] = h2 * m2 + c2 * u2 + o2 * l2 - r2 * d2, t2[s2 + 2] = o2 * m2 + c2 * d2 + r2 * u2 - h2 * l2, t2[s2 + 3] = c2 * m2 - r2 * l2 - h2 * u2 - o2 * d2, t2;
346
+ }
347
+ get x() {
348
+ return this._x;
349
+ }
350
+ set x(t2) {
351
+ this._x = t2, this._onChangeCallback();
352
+ }
353
+ get y() {
354
+ return this._y;
355
+ }
356
+ set y(t2) {
357
+ this._y = t2, this._onChangeCallback();
358
+ }
359
+ get z() {
360
+ return this._z;
361
+ }
362
+ set z(t2) {
363
+ this._z = t2, this._onChangeCallback();
364
+ }
365
+ get w() {
366
+ return this._w;
367
+ }
368
+ set w(t2) {
369
+ this._w = t2, this._onChangeCallback();
370
+ }
371
+ set(t2, s2, i2, e2) {
372
+ return this._x = t2, this._y = s2, this._z = i2, this._w = e2, this._onChangeCallback(), this;
373
+ }
374
+ clone() {
375
+ return new this.constructor(this._x, this._y, this._z, this._w);
327
376
  }
328
377
  copy(t2) {
329
- const s2 = this.elements, i2 = t2.elements;
330
- return s2[0] = i2[0], s2[1] = i2[1], s2[2] = i2[2], s2[3] = i2[3], s2[4] = i2[4], s2[5] = i2[5], s2[6] = i2[6], s2[7] = i2[7], s2[8] = i2[8], this;
378
+ return this._x = t2.x, this._y = t2.y, this._z = t2.z, this._w = t2.w, this._onChangeCallback(), this;
331
379
  }
332
- extractBasis(t2, s2, i2) {
333
- return t2.setFromMatrix3Column(this, 0), s2.setFromMatrix3Column(this, 1), i2.setFromMatrix3Column(this, 2), this;
380
+ setFromEuler(t2, s2 = true) {
381
+ const i2 = t2._x, e2 = t2._y, a2 = t2._z, n2 = t2._order, r2 = Math.cos, h2 = Math.sin, o2 = r2(i2 / 2), c2 = r2(e2 / 2), l2 = r2(a2 / 2), u2 = h2(i2 / 2), d2 = h2(e2 / 2), m2 = h2(a2 / 2);
382
+ switch (n2) {
383
+ case "XYZ":
384
+ this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
385
+ break;
386
+ case "YXZ":
387
+ this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
388
+ break;
389
+ case "ZXY":
390
+ this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
391
+ break;
392
+ case "ZYX":
393
+ this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
394
+ break;
395
+ case "YZX":
396
+ this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
397
+ break;
398
+ case "XZY":
399
+ this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
400
+ break;
401
+ default:
402
+ console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + n2);
403
+ }
404
+ return true === s2 && this._onChangeCallback(), this;
334
405
  }
335
- setFromMatrix4(t2) {
336
- const s2 = t2.elements;
337
- return this.set(s2[0], s2[4], s2[8], s2[1], s2[5], s2[9], s2[2], s2[6], s2[10]), this;
406
+ setFromAxisAngle(t2, s2) {
407
+ const i2 = s2 / 2, e2 = Math.sin(i2);
408
+ return this._x = t2.x * e2, this._y = t2.y * e2, this._z = t2.z * e2, this._w = Math.cos(i2), this._onChangeCallback(), this;
338
409
  }
339
- multiply(t2) {
340
- return this.multiplyMatrices(this, t2);
410
+ setFromRotationMatrix(t2) {
411
+ const s2 = t2.elements, i2 = s2[0], e2 = s2[4], a2 = s2[8], n2 = s2[1], r2 = s2[5], h2 = s2[9], o2 = s2[2], c2 = s2[6], l2 = s2[10], u2 = i2 + r2 + l2;
412
+ if (u2 > 0) {
413
+ const t3 = 0.5 / Math.sqrt(u2 + 1);
414
+ this._w = 0.25 / t3, this._x = (c2 - h2) * t3, this._y = (a2 - o2) * t3, this._z = (n2 - e2) * t3;
415
+ } else if (i2 > r2 && i2 > l2) {
416
+ const t3 = 2 * Math.sqrt(1 + i2 - r2 - l2);
417
+ this._w = (c2 - h2) / t3, this._x = 0.25 * t3, this._y = (e2 + n2) / t3, this._z = (a2 + o2) / t3;
418
+ } else if (r2 > l2) {
419
+ const t3 = 2 * Math.sqrt(1 + r2 - i2 - l2);
420
+ this._w = (a2 - o2) / t3, this._x = (e2 + n2) / t3, this._y = 0.25 * t3, this._z = (h2 + c2) / t3;
421
+ } else {
422
+ const t3 = 2 * Math.sqrt(1 + l2 - i2 - r2);
423
+ this._w = (n2 - e2) / t3, this._x = (a2 + o2) / t3, this._y = (h2 + c2) / t3, this._z = 0.25 * t3;
424
+ }
425
+ return this._onChangeCallback(), this;
341
426
  }
342
- premultiply(t2) {
343
- return this.multiplyMatrices(t2, this);
427
+ setFromUnitVectors(t2, s2) {
428
+ let i2 = t2.dot(s2) + 1;
429
+ return i2 < 1e-8 ? (i2 = 0, Math.abs(t2.x) > Math.abs(t2.z) ? (this._x = -t2.y, this._y = t2.x, this._z = 0, this._w = i2) : (this._x = 0, this._y = -t2.z, this._z = t2.y, this._w = i2)) : (this._x = t2.y * s2.z - t2.z * s2.y, this._y = t2.z * s2.x - t2.x * s2.z, this._z = t2.x * s2.y - t2.y * s2.x, this._w = i2), this.normalize();
344
430
  }
345
- multiplyMatrices(t2, s2) {
346
- const i2 = t2.elements, e2 = s2.elements, a2 = this.elements, n2 = i2[0], r2 = i2[3], h2 = i2[6], o2 = i2[1], c2 = i2[4], l2 = i2[7], u2 = i2[2], d2 = i2[5], m2 = i2[8], _2 = e2[0], f2 = e2[3], y2 = e2[6], p2 = e2[1], M2 = e2[4], g2 = e2[7], x2 = e2[2], w2 = e2[5], S2 = e2[8];
347
- return a2[0] = n2 * _2 + r2 * p2 + h2 * x2, a2[3] = n2 * f2 + r2 * M2 + h2 * w2, a2[6] = n2 * y2 + r2 * g2 + h2 * S2, a2[1] = o2 * _2 + c2 * p2 + l2 * x2, a2[4] = o2 * f2 + c2 * M2 + l2 * w2, a2[7] = o2 * y2 + c2 * g2 + l2 * S2, a2[2] = u2 * _2 + d2 * p2 + m2 * x2, a2[5] = u2 * f2 + d2 * M2 + m2 * w2, a2[8] = u2 * y2 + d2 * g2 + m2 * S2, this;
431
+ angleTo(t2) {
432
+ return 2 * Math.acos(Math.abs(n(this.dot(t2), -1, 1)));
348
433
  }
349
- multiplyScalar(t2) {
350
- const s2 = this.elements;
351
- return s2[0] *= t2, s2[3] *= t2, s2[6] *= t2, s2[1] *= t2, s2[4] *= t2, s2[7] *= t2, s2[2] *= t2, s2[5] *= t2, s2[8] *= t2, this;
434
+ rotateTowards(t2, s2) {
435
+ const i2 = this.angleTo(t2);
436
+ if (0 === i2)
437
+ return this;
438
+ const e2 = Math.min(1, s2 / i2);
439
+ return this.slerp(t2, e2), this;
352
440
  }
353
- determinant() {
354
- const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8];
355
- return s2 * n2 * c2 - s2 * r2 * o2 - i2 * a2 * c2 + i2 * r2 * h2 + e2 * a2 * o2 - e2 * n2 * h2;
441
+ identity() {
442
+ return this.set(0, 0, 0, 1);
356
443
  }
357
444
  invert() {
358
- const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8], l2 = c2 * n2 - r2 * o2, u2 = r2 * h2 - c2 * a2, d2 = o2 * a2 - n2 * h2, m2 = s2 * l2 + i2 * u2 + e2 * d2;
359
- if (0 === m2)
360
- return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
361
- const _2 = 1 / m2;
362
- return t2[0] = l2 * _2, t2[1] = (e2 * o2 - c2 * i2) * _2, t2[2] = (r2 * i2 - e2 * n2) * _2, t2[3] = u2 * _2, t2[4] = (c2 * s2 - e2 * h2) * _2, t2[5] = (e2 * a2 - r2 * s2) * _2, t2[6] = d2 * _2, t2[7] = (i2 * h2 - o2 * s2) * _2, t2[8] = (n2 * s2 - i2 * a2) * _2, this;
445
+ return this.conjugate();
363
446
  }
364
- transpose() {
365
- let t2;
366
- const s2 = this.elements;
367
- return t2 = s2[1], s2[1] = s2[3], s2[3] = t2, t2 = s2[2], s2[2] = s2[6], s2[6] = t2, t2 = s2[5], s2[5] = s2[7], s2[7] = t2, this;
447
+ conjugate() {
448
+ return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
368
449
  }
369
- getNormalMatrix(t2) {
370
- return this.setFromMatrix4(t2).invert().transpose();
450
+ dot(t2) {
451
+ return this._x * t2._x + this._y * t2._y + this._z * t2._z + this._w * t2._w;
371
452
  }
372
- transposeIntoArray(t2) {
373
- const s2 = this.elements;
374
- return t2[0] = s2[0], t2[1] = s2[3], t2[2] = s2[6], t2[3] = s2[1], t2[4] = s2[4], t2[5] = s2[7], t2[6] = s2[2], t2[7] = s2[5], t2[8] = s2[8], this;
453
+ lengthSq() {
454
+ return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
375
455
  }
376
- setUvTransform(t2, s2, i2, e2, a2, n2, r2) {
377
- const h2 = Math.cos(a2), o2 = Math.sin(a2);
378
- return this.set(i2 * h2, i2 * o2, -i2 * (h2 * n2 + o2 * r2) + n2 + t2, -e2 * o2, e2 * h2, -e2 * (-o2 * n2 + h2 * r2) + r2 + s2, 0, 0, 1), this;
456
+ length() {
457
+ return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
379
458
  }
380
- scale(t2, s2) {
381
- return this.premultiply(u.makeScale(t2, s2)), this;
459
+ normalize() {
460
+ let t2 = this.length();
461
+ return 0 === t2 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t2 = 1 / t2, this._x = this._x * t2, this._y = this._y * t2, this._z = this._z * t2, this._w = this._w * t2), this._onChangeCallback(), this;
382
462
  }
383
- rotate(t2) {
384
- return this.premultiply(u.makeRotation(-t2)), this;
463
+ multiply(t2) {
464
+ return this.multiplyQuaternions(this, t2);
385
465
  }
386
- translate(t2, s2) {
387
- return this.premultiply(u.makeTranslation(t2, s2)), this;
466
+ premultiply(t2) {
467
+ return this.multiplyQuaternions(t2, this);
388
468
  }
389
- makeTranslation(t2, s2) {
390
- return t2.isVector2 ? this.set(1, 0, t2.x, 0, 1, t2.y, 0, 0, 1) : this.set(1, 0, t2, 0, 1, s2, 0, 0, 1), this;
469
+ multiplyQuaternions(t2, s2) {
470
+ const i2 = t2._x, e2 = t2._y, a2 = t2._z, n2 = t2._w, r2 = s2._x, h2 = s2._y, o2 = s2._z, c2 = s2._w;
471
+ return this._x = i2 * c2 + n2 * r2 + e2 * o2 - a2 * h2, this._y = e2 * c2 + n2 * h2 + a2 * r2 - i2 * o2, this._z = a2 * c2 + n2 * o2 + i2 * h2 - e2 * r2, this._w = n2 * c2 - i2 * r2 - e2 * h2 - a2 * o2, this._onChangeCallback(), this;
391
472
  }
392
- makeRotation(t2) {
393
- const s2 = Math.cos(t2), i2 = Math.sin(t2);
394
- return this.set(s2, -i2, 0, i2, s2, 0, 0, 0, 1), this;
473
+ slerp(t2, s2) {
474
+ if (0 === s2)
475
+ return this;
476
+ if (1 === s2)
477
+ return this.copy(t2);
478
+ const i2 = this._x, e2 = this._y, a2 = this._z, n2 = this._w;
479
+ let r2 = n2 * t2._w + i2 * t2._x + e2 * t2._y + a2 * t2._z;
480
+ if (r2 < 0 ? (this._w = -t2._w, this._x = -t2._x, this._y = -t2._y, this._z = -t2._z, r2 = -r2) : this.copy(t2), r2 >= 1)
481
+ return this._w = n2, this._x = i2, this._y = e2, this._z = a2, this;
482
+ const h2 = 1 - r2 * r2;
483
+ if (h2 <= Number.EPSILON) {
484
+ const t3 = 1 - s2;
485
+ return this._w = t3 * n2 + s2 * this._w, this._x = t3 * i2 + s2 * this._x, this._y = t3 * e2 + s2 * this._y, this._z = t3 * a2 + s2 * this._z, this.normalize(), this;
486
+ }
487
+ const o2 = Math.sqrt(h2), c2 = Math.atan2(o2, r2), l2 = Math.sin((1 - s2) * c2) / o2, u2 = Math.sin(s2 * c2) / o2;
488
+ return this._w = n2 * l2 + this._w * u2, this._x = i2 * l2 + this._x * u2, this._y = e2 * l2 + this._y * u2, this._z = a2 * l2 + this._z * u2, this._onChangeCallback(), this;
395
489
  }
396
- makeScale(t2, s2) {
397
- return this.set(t2, 0, 0, 0, s2, 0, 0, 0, 1), this;
490
+ slerpQuaternions(t2, s2, i2) {
491
+ return this.copy(t2).slerp(s2, i2);
492
+ }
493
+ random() {
494
+ const t2 = 2 * Math.PI * Math.random(), s2 = 2 * Math.PI * Math.random(), i2 = Math.random(), e2 = Math.sqrt(1 - i2), a2 = Math.sqrt(i2);
495
+ return this.set(e2 * Math.sin(t2), e2 * Math.cos(t2), a2 * Math.sin(s2), a2 * Math.cos(s2));
398
496
  }
399
497
  equals(t2) {
400
- const s2 = this.elements, i2 = t2.elements;
401
- for (let t3 = 0; t3 < 9; t3++)
402
- if (s2[t3] !== i2[t3])
403
- return false;
404
- return true;
498
+ return t2._x === this._x && t2._y === this._y && t2._z === this._z && t2._w === this._w;
405
499
  }
406
500
  fromArray(t2, s2 = 0) {
407
- for (let i2 = 0; i2 < 9; i2++)
408
- this.elements[i2] = t2[i2 + s2];
409
- return this;
501
+ return this._x = t2[s2], this._y = t2[s2 + 1], this._z = t2[s2 + 2], this._w = t2[s2 + 3], this._onChangeCallback(), this;
410
502
  }
411
503
  toArray(t2 = [], s2 = 0) {
412
- const i2 = this.elements;
413
- return t2[s2] = i2[0], t2[s2 + 1] = i2[1], t2[s2 + 2] = i2[2], t2[s2 + 3] = i2[3], t2[s2 + 4] = i2[4], t2[s2 + 5] = i2[5], t2[s2 + 6] = i2[6], t2[s2 + 7] = i2[7], t2[s2 + 8] = i2[8], t2;
504
+ return t2[s2] = this._x, t2[s2 + 1] = this._y, t2[s2 + 2] = this._z, t2[s2 + 3] = this._w, t2;
414
505
  }
415
- clone() {
416
- return new this.constructor().fromArray(this.elements);
506
+ fromBufferAttribute(t2, s2) {
507
+ return this._x = t2.getX(s2), this._y = t2.getY(s2), this._z = t2.getZ(s2), this._w = t2.getW(s2), this._onChangeCallback(), this;
417
508
  }
418
- }
419
- const u = new l();
420
- class d {
421
- constructor(t2 = 0, s2 = 0, i2 = 0, e2 = 1) {
422
- d.prototype.isVector4 = true, this.x = t2, this.y = s2, this.z = i2, this.w = e2;
509
+ toJSON() {
510
+ return this.toArray();
423
511
  }
424
- get width() {
425
- return this.z;
512
+ _onChange(t2) {
513
+ return this._onChangeCallback = t2, this;
426
514
  }
427
- set width(t2) {
428
- this.z = t2;
515
+ _onChangeCallback() {
429
516
  }
430
- get height() {
431
- return this.w;
517
+ *[Symbol.iterator]() {
518
+ yield this._x, yield this._y, yield this._z, yield this._w;
432
519
  }
433
- set height(t2) {
434
- this.w = t2;
520
+ }
521
+ class u {
522
+ constructor(t2 = 0, s2 = 0, i2 = 0) {
523
+ u.prototype.isVector3 = true, this.x = t2, this.y = s2, this.z = i2;
435
524
  }
436
- set(t2, s2, i2, e2) {
437
- return this.x = t2, this.y = s2, this.z = i2, this.w = e2, this;
525
+ set(t2, s2, i2) {
526
+ return void 0 === i2 && (i2 = this.z), this.x = t2, this.y = s2, this.z = i2, this;
438
527
  }
439
528
  setScalar(t2) {
440
- return this.x = t2, this.y = t2, this.z = t2, this.w = t2, this;
529
+ return this.x = t2, this.y = t2, this.z = t2, this;
441
530
  }
442
531
  setX(t2) {
443
532
  return this.x = t2, this;
@@ -448,9 +537,6 @@ class d {
448
537
  setZ(t2) {
449
538
  return this.z = t2, this;
450
539
  }
451
- setW(t2) {
452
- return this.w = t2, this;
453
- }
454
540
  setComponent(t2, s2) {
455
541
  switch (t2) {
456
542
  case 0:
@@ -462,9 +548,6 @@ class d {
462
548
  case 2:
463
549
  this.z = s2;
464
550
  break;
465
- case 3:
466
- this.w = s2;
467
- break;
468
551
  default:
469
552
  throw new Error("index is out of range: " + t2);
470
553
  }
@@ -478,112 +561,125 @@ class d {
478
561
  return this.y;
479
562
  case 2:
480
563
  return this.z;
481
- case 3:
482
- return this.w;
483
564
  default:
484
565
  throw new Error("index is out of range: " + t2);
485
566
  }
486
567
  }
487
568
  clone() {
488
- return new this.constructor(this.x, this.y, this.z, this.w);
569
+ return new this.constructor(this.x, this.y, this.z);
489
570
  }
490
571
  copy(t2) {
491
- return this.x = t2.x, this.y = t2.y, this.z = t2.z, this.w = void 0 !== t2.w ? t2.w : 1, this;
572
+ return this.x = t2.x, this.y = t2.y, this.z = t2.z, this;
492
573
  }
493
574
  add(t2) {
494
- return this.x += t2.x, this.y += t2.y, this.z += t2.z, this.w += t2.w, this;
575
+ return this.x += t2.x, this.y += t2.y, this.z += t2.z, this;
495
576
  }
496
577
  addScalar(t2) {
497
- return this.x += t2, this.y += t2, this.z += t2, this.w += t2, this;
578
+ return this.x += t2, this.y += t2, this.z += t2, this;
498
579
  }
499
580
  addVectors(t2, s2) {
500
- return this.x = t2.x + s2.x, this.y = t2.y + s2.y, this.z = t2.z + s2.z, this.w = t2.w + s2.w, this;
581
+ return this.x = t2.x + s2.x, this.y = t2.y + s2.y, this.z = t2.z + s2.z, this;
501
582
  }
502
583
  addScaledVector(t2, s2) {
503
- return this.x += t2.x * s2, this.y += t2.y * s2, this.z += t2.z * s2, this.w += t2.w * s2, this;
584
+ return this.x += t2.x * s2, this.y += t2.y * s2, this.z += t2.z * s2, this;
504
585
  }
505
586
  sub(t2) {
506
- return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this.w -= t2.w, this;
587
+ return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this;
507
588
  }
508
589
  subScalar(t2) {
509
- return this.x -= t2, this.y -= t2, this.z -= t2, this.w -= t2, this;
590
+ return this.x -= t2, this.y -= t2, this.z -= t2, this;
510
591
  }
511
592
  subVectors(t2, s2) {
512
- return this.x = t2.x - s2.x, this.y = t2.y - s2.y, this.z = t2.z - s2.z, this.w = t2.w - s2.w, this;
593
+ return this.x = t2.x - s2.x, this.y = t2.y - s2.y, this.z = t2.z - s2.z, this;
513
594
  }
514
595
  multiply(t2) {
515
- return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this.w *= t2.w, this;
596
+ return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this;
516
597
  }
517
598
  multiplyScalar(t2) {
518
- return this.x *= t2, this.y *= t2, this.z *= t2, this.w *= t2, this;
599
+ return this.x *= t2, this.y *= t2, this.z *= t2, this;
600
+ }
601
+ multiplyVectors(t2, s2) {
602
+ return this.x = t2.x * s2.x, this.y = t2.y * s2.y, this.z = t2.z * s2.z, this;
603
+ }
604
+ applyEuler(t2) {
605
+ return this.applyQuaternion(m.setFromEuler(t2));
606
+ }
607
+ applyAxisAngle(t2, s2) {
608
+ return this.applyQuaternion(m.setFromAxisAngle(t2, s2));
609
+ }
610
+ applyMatrix3(t2) {
611
+ const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements;
612
+ return this.x = a2[0] * s2 + a2[3] * i2 + a2[6] * e2, this.y = a2[1] * s2 + a2[4] * i2 + a2[7] * e2, this.z = a2[2] * s2 + a2[5] * i2 + a2[8] * e2, this;
613
+ }
614
+ applyNormalMatrix(t2) {
615
+ return this.applyMatrix3(t2).normalize();
519
616
  }
520
617
  applyMatrix4(t2) {
521
- const s2 = this.x, i2 = this.y, e2 = this.z, a2 = this.w, n2 = t2.elements;
522
- return this.x = n2[0] * s2 + n2[4] * i2 + n2[8] * e2 + n2[12] * a2, this.y = n2[1] * s2 + n2[5] * i2 + n2[9] * e2 + n2[13] * a2, this.z = n2[2] * s2 + n2[6] * i2 + n2[10] * e2 + n2[14] * a2, this.w = n2[3] * s2 + n2[7] * i2 + n2[11] * e2 + n2[15] * a2, this;
618
+ const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements, n2 = 1 / (a2[3] * s2 + a2[7] * i2 + a2[11] * e2 + a2[15]);
619
+ return this.x = (a2[0] * s2 + a2[4] * i2 + a2[8] * e2 + a2[12]) * n2, this.y = (a2[1] * s2 + a2[5] * i2 + a2[9] * e2 + a2[13]) * n2, this.z = (a2[2] * s2 + a2[6] * i2 + a2[10] * e2 + a2[14]) * n2, this;
523
620
  }
524
- divideScalar(t2) {
525
- return this.multiplyScalar(1 / t2);
621
+ applyQuaternion(t2) {
622
+ const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.x, n2 = t2.y, r2 = t2.z, h2 = t2.w, o2 = 2 * (n2 * e2 - r2 * i2), c2 = 2 * (r2 * s2 - a2 * e2), l2 = 2 * (a2 * i2 - n2 * s2);
623
+ return this.x = s2 + h2 * o2 + n2 * l2 - r2 * c2, this.y = i2 + h2 * c2 + r2 * o2 - a2 * l2, this.z = e2 + h2 * l2 + a2 * c2 - n2 * o2, this;
526
624
  }
527
- setAxisAngleFromQuaternion(t2) {
528
- this.w = 2 * Math.acos(t2.w);
529
- const s2 = Math.sqrt(1 - t2.w * t2.w);
530
- return s2 < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t2.x / s2, this.y = t2.y / s2, this.z = t2.z / s2), this;
625
+ project(t2) {
626
+ return this.applyMatrix4(t2.matrixWorldInverse).applyMatrix4(t2.projectionMatrix);
531
627
  }
532
- setAxisAngleFromRotationMatrix(t2) {
533
- let s2, i2, e2, a2;
534
- const n2 = 0.01, r2 = 0.1, h2 = t2.elements, o2 = h2[0], c2 = h2[4], l2 = h2[8], u2 = h2[1], d2 = h2[5], m2 = h2[9], _2 = h2[2], f2 = h2[6], y2 = h2[10];
535
- if (Math.abs(c2 - u2) < n2 && Math.abs(l2 - _2) < n2 && Math.abs(m2 - f2) < n2) {
536
- if (Math.abs(c2 + u2) < r2 && Math.abs(l2 + _2) < r2 && Math.abs(m2 + f2) < r2 && Math.abs(o2 + d2 + y2 - 3) < r2)
537
- return this.set(1, 0, 0, 0), this;
538
- s2 = Math.PI;
539
- const t3 = (o2 + 1) / 2, h3 = (d2 + 1) / 2, p3 = (y2 + 1) / 2, M2 = (c2 + u2) / 4, g2 = (l2 + _2) / 4, x2 = (m2 + f2) / 4;
540
- return t3 > h3 && t3 > p3 ? t3 < n2 ? (i2 = 0, e2 = 0.707106781, a2 = 0.707106781) : (i2 = Math.sqrt(t3), e2 = M2 / i2, a2 = g2 / i2) : h3 > p3 ? h3 < n2 ? (i2 = 0.707106781, e2 = 0, a2 = 0.707106781) : (e2 = Math.sqrt(h3), i2 = M2 / e2, a2 = x2 / e2) : p3 < n2 ? (i2 = 0.707106781, e2 = 0.707106781, a2 = 0) : (a2 = Math.sqrt(p3), i2 = g2 / a2, e2 = x2 / a2), this.set(i2, e2, a2, s2), this;
541
- }
542
- let p2 = Math.sqrt((f2 - m2) * (f2 - m2) + (l2 - _2) * (l2 - _2) + (u2 - c2) * (u2 - c2));
543
- return Math.abs(p2) < 1e-3 && (p2 = 1), this.x = (f2 - m2) / p2, this.y = (l2 - _2) / p2, this.z = (u2 - c2) / p2, this.w = Math.acos((o2 + d2 + y2 - 1) / 2), this;
628
+ unproject(t2) {
629
+ return this.applyMatrix4(t2.projectionMatrixInverse).applyMatrix4(t2.matrixWorld);
630
+ }
631
+ transformDirection(t2) {
632
+ const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements;
633
+ return this.x = a2[0] * s2 + a2[4] * i2 + a2[8] * e2, this.y = a2[1] * s2 + a2[5] * i2 + a2[9] * e2, this.z = a2[2] * s2 + a2[6] * i2 + a2[10] * e2, this.normalize();
634
+ }
635
+ divide(t2) {
636
+ return this.x /= t2.x, this.y /= t2.y, this.z /= t2.z, this;
637
+ }
638
+ divideScalar(t2) {
639
+ return this.multiplyScalar(1 / t2);
544
640
  }
545
641
  min(t2) {
546
- return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this.w = Math.min(this.w, t2.w), this;
642
+ return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this;
547
643
  }
548
644
  max(t2) {
549
- return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this.w = Math.max(this.w, t2.w), this;
645
+ return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this;
550
646
  }
551
647
  clamp(t2, s2) {
552
- return this.x = Math.max(t2.x, Math.min(s2.x, this.x)), this.y = Math.max(t2.y, Math.min(s2.y, this.y)), this.z = Math.max(t2.z, Math.min(s2.z, this.z)), this.w = Math.max(t2.w, Math.min(s2.w, this.w)), this;
648
+ return this.x = n(this.x, t2.x, s2.x), this.y = n(this.y, t2.y, s2.y), this.z = n(this.z, t2.z, s2.z), this;
553
649
  }
554
650
  clampScalar(t2, s2) {
555
- return this.x = Math.max(t2, Math.min(s2, this.x)), this.y = Math.max(t2, Math.min(s2, this.y)), this.z = Math.max(t2, Math.min(s2, this.z)), this.w = Math.max(t2, Math.min(s2, this.w)), this;
651
+ return this.x = n(this.x, t2, s2), this.y = n(this.y, t2, s2), this.z = n(this.z, t2, s2), this;
556
652
  }
557
653
  clampLength(t2, s2) {
558
654
  const i2 = this.length();
559
- return this.divideScalar(i2 || 1).multiplyScalar(Math.max(t2, Math.min(s2, i2)));
655
+ return this.divideScalar(i2 || 1).multiplyScalar(n(i2, t2, s2));
560
656
  }
561
657
  floor() {
562
- return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;
658
+ return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
563
659
  }
564
660
  ceil() {
565
- return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;
661
+ return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
566
662
  }
567
663
  round() {
568
- return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;
664
+ return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
569
665
  }
570
666
  roundToZero() {
571
- return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;
667
+ return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
572
668
  }
573
669
  negate() {
574
- return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;
670
+ return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
575
671
  }
576
672
  dot(t2) {
577
- return this.x * t2.x + this.y * t2.y + this.z * t2.z + this.w * t2.w;
673
+ return this.x * t2.x + this.y * t2.y + this.z * t2.z;
578
674
  }
579
675
  lengthSq() {
580
- return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
676
+ return this.x * this.x + this.y * this.y + this.z * this.z;
581
677
  }
582
678
  length() {
583
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
679
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
584
680
  }
585
681
  manhattanLength() {
586
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
682
+ return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
587
683
  }
588
684
  normalize() {
589
685
  return this.divideScalar(this.length() || 1);
@@ -592,243 +688,229 @@ class d {
592
688
  return this.normalize().multiplyScalar(t2);
593
689
  }
594
690
  lerp(t2, s2) {
595
- return this.x += (t2.x - this.x) * s2, this.y += (t2.y - this.y) * s2, this.z += (t2.z - this.z) * s2, this.w += (t2.w - this.w) * s2, this;
691
+ return this.x += (t2.x - this.x) * s2, this.y += (t2.y - this.y) * s2, this.z += (t2.z - this.z) * s2, this;
596
692
  }
597
693
  lerpVectors(t2, s2, i2) {
598
- return this.x = t2.x + (s2.x - t2.x) * i2, this.y = t2.y + (s2.y - t2.y) * i2, this.z = t2.z + (s2.z - t2.z) * i2, this.w = t2.w + (s2.w - t2.w) * i2, this;
599
- }
600
- equals(t2) {
601
- return t2.x === this.x && t2.y === this.y && t2.z === this.z && t2.w === this.w;
694
+ return this.x = t2.x + (s2.x - t2.x) * i2, this.y = t2.y + (s2.y - t2.y) * i2, this.z = t2.z + (s2.z - t2.z) * i2, this;
602
695
  }
603
- fromArray(t2, s2 = 0) {
604
- return this.x = t2[s2], this.y = t2[s2 + 1], this.z = t2[s2 + 2], this.w = t2[s2 + 3], this;
696
+ cross(t2) {
697
+ return this.crossVectors(this, t2);
605
698
  }
606
- toArray(t2 = [], s2 = 0) {
607
- return t2[s2] = this.x, t2[s2 + 1] = this.y, t2[s2 + 2] = this.z, t2[s2 + 3] = this.w, t2;
699
+ crossVectors(t2, s2) {
700
+ const i2 = t2.x, e2 = t2.y, a2 = t2.z, n2 = s2.x, r2 = s2.y, h2 = s2.z;
701
+ return this.x = e2 * h2 - a2 * r2, this.y = a2 * n2 - i2 * h2, this.z = i2 * r2 - e2 * n2, this;
608
702
  }
609
- fromBufferAttribute(t2, s2) {
610
- return this.x = t2.getX(s2), this.y = t2.getY(s2), this.z = t2.getZ(s2), this.w = t2.getW(s2), this;
703
+ projectOnVector(t2) {
704
+ const s2 = t2.lengthSq();
705
+ if (0 === s2)
706
+ return this.set(0, 0, 0);
707
+ const i2 = t2.dot(this) / s2;
708
+ return this.copy(t2).multiplyScalar(i2);
611
709
  }
612
- random() {
613
- return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
710
+ projectOnPlane(t2) {
711
+ return d.copy(this).projectOnVector(t2), this.sub(d);
614
712
  }
615
- *[Symbol.iterator]() {
616
- yield this.x, yield this.y, yield this.z, yield this.w;
713
+ reflect(t2) {
714
+ return this.sub(d.copy(t2).multiplyScalar(2 * this.dot(t2)));
617
715
  }
618
- }
619
- class m {
620
- constructor(t2 = 0, s2 = 0, i2 = 0, e2 = 1) {
621
- this.isQuaternion = true, this._x = t2, this._y = s2, this._z = i2, this._w = e2;
716
+ angleTo(t2) {
717
+ const s2 = Math.sqrt(this.lengthSq() * t2.lengthSq());
718
+ if (0 === s2)
719
+ return Math.PI / 2;
720
+ const i2 = this.dot(t2) / s2;
721
+ return Math.acos(n(i2, -1, 1));
622
722
  }
623
- static slerpFlat(t2, s2, i2, e2, a2, n2, r2) {
624
- let h2 = i2[e2 + 0], o2 = i2[e2 + 1], c2 = i2[e2 + 2], l2 = i2[e2 + 3];
625
- const u2 = a2[n2 + 0], d2 = a2[n2 + 1], m2 = a2[n2 + 2], _2 = a2[n2 + 3];
626
- if (0 === r2)
627
- return t2[s2 + 0] = h2, t2[s2 + 1] = o2, t2[s2 + 2] = c2, void (t2[s2 + 3] = l2);
628
- if (1 === r2)
629
- return t2[s2 + 0] = u2, t2[s2 + 1] = d2, t2[s2 + 2] = m2, void (t2[s2 + 3] = _2);
630
- if (l2 !== _2 || h2 !== u2 || o2 !== d2 || c2 !== m2) {
631
- let t3 = 1 - r2;
632
- const s3 = h2 * u2 + o2 * d2 + c2 * m2 + l2 * _2, i3 = s3 >= 0 ? 1 : -1, e3 = 1 - s3 * s3;
633
- if (e3 > Number.EPSILON) {
634
- const a4 = Math.sqrt(e3), n3 = Math.atan2(a4, s3 * i3);
635
- t3 = Math.sin(t3 * n3) / a4, r2 = Math.sin(r2 * n3) / a4;
636
- }
637
- const a3 = r2 * i3;
638
- if (h2 = h2 * t3 + u2 * a3, o2 = o2 * t3 + d2 * a3, c2 = c2 * t3 + m2 * a3, l2 = l2 * t3 + _2 * a3, t3 === 1 - r2) {
639
- const t4 = 1 / Math.sqrt(h2 * h2 + o2 * o2 + c2 * c2 + l2 * l2);
640
- h2 *= t4, o2 *= t4, c2 *= t4, l2 *= t4;
641
- }
642
- }
643
- t2[s2] = h2, t2[s2 + 1] = o2, t2[s2 + 2] = c2, t2[s2 + 3] = l2;
723
+ distanceTo(t2) {
724
+ return Math.sqrt(this.distanceToSquared(t2));
644
725
  }
645
- static multiplyQuaternionsFlat(t2, s2, i2, e2, a2, n2) {
646
- const r2 = i2[e2], h2 = i2[e2 + 1], o2 = i2[e2 + 2], c2 = i2[e2 + 3], l2 = a2[n2], u2 = a2[n2 + 1], d2 = a2[n2 + 2], m2 = a2[n2 + 3];
647
- return t2[s2] = r2 * m2 + c2 * l2 + h2 * d2 - o2 * u2, t2[s2 + 1] = h2 * m2 + c2 * u2 + o2 * l2 - r2 * d2, t2[s2 + 2] = o2 * m2 + c2 * d2 + r2 * u2 - h2 * l2, t2[s2 + 3] = c2 * m2 - r2 * l2 - h2 * u2 - o2 * d2, t2;
726
+ distanceToSquared(t2) {
727
+ const s2 = this.x - t2.x, i2 = this.y - t2.y, e2 = this.z - t2.z;
728
+ return s2 * s2 + i2 * i2 + e2 * e2;
648
729
  }
649
- get x() {
650
- return this._x;
730
+ manhattanDistanceTo(t2) {
731
+ return Math.abs(this.x - t2.x) + Math.abs(this.y - t2.y) + Math.abs(this.z - t2.z);
651
732
  }
652
- set x(t2) {
653
- this._x = t2, this._onChangeCallback();
733
+ setFromSpherical(t2) {
734
+ return this.setFromSphericalCoords(t2.radius, t2.phi, t2.theta);
654
735
  }
655
- get y() {
656
- return this._y;
736
+ setFromSphericalCoords(t2, s2, i2) {
737
+ const e2 = Math.sin(s2) * t2;
738
+ return this.x = e2 * Math.sin(i2), this.y = Math.cos(s2) * t2, this.z = e2 * Math.cos(i2), this;
657
739
  }
658
- set y(t2) {
659
- this._y = t2, this._onChangeCallback();
740
+ setFromCylindrical(t2) {
741
+ return this.setFromCylindricalCoords(t2.radius, t2.theta, t2.y);
660
742
  }
661
- get z() {
662
- return this._z;
743
+ setFromCylindricalCoords(t2, s2, i2) {
744
+ return this.x = t2 * Math.sin(s2), this.y = i2, this.z = t2 * Math.cos(s2), this;
663
745
  }
664
- set z(t2) {
665
- this._z = t2, this._onChangeCallback();
746
+ setFromMatrixPosition(t2) {
747
+ const s2 = t2.elements;
748
+ return this.x = s2[12], this.y = s2[13], this.z = s2[14], this;
666
749
  }
667
- get w() {
668
- return this._w;
750
+ setFromMatrixScale(t2) {
751
+ const s2 = this.setFromMatrixColumn(t2, 0).length(), i2 = this.setFromMatrixColumn(t2, 1).length(), e2 = this.setFromMatrixColumn(t2, 2).length();
752
+ return this.x = s2, this.y = i2, this.z = e2, this;
669
753
  }
670
- set w(t2) {
671
- this._w = t2, this._onChangeCallback();
754
+ setFromMatrixColumn(t2, s2) {
755
+ return this.fromArray(t2.elements, 4 * s2);
672
756
  }
673
- set(t2, s2, i2, e2) {
674
- return this._x = t2, this._y = s2, this._z = i2, this._w = e2, this._onChangeCallback(), this;
757
+ setFromMatrix3Column(t2, s2) {
758
+ return this.fromArray(t2.elements, 3 * s2);
675
759
  }
676
- clone() {
677
- return new this.constructor(this._x, this._y, this._z, this._w);
760
+ setFromEuler(t2) {
761
+ return this.x = t2._x, this.y = t2._y, this.z = t2._z, this;
678
762
  }
679
- copy(t2) {
680
- return this._x = t2.x, this._y = t2.y, this._z = t2.z, this._w = t2.w, this._onChangeCallback(), this;
763
+ setFromColor(t2) {
764
+ return this.x = t2.r, this.y = t2.g, this.z = t2.b, this;
681
765
  }
682
- setFromEuler(t2, s2) {
683
- const i2 = t2._x, e2 = t2._y, a2 = t2._z, n2 = t2._order, r2 = Math.cos, h2 = Math.sin, o2 = r2(i2 / 2), c2 = r2(e2 / 2), l2 = r2(a2 / 2), u2 = h2(i2 / 2), d2 = h2(e2 / 2), m2 = h2(a2 / 2);
684
- switch (n2) {
685
- case "XYZ":
686
- this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
687
- break;
688
- case "YXZ":
689
- this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
690
- break;
691
- case "ZXY":
692
- this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
693
- break;
694
- case "ZYX":
695
- this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
696
- break;
697
- case "YZX":
698
- this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
699
- break;
700
- case "XZY":
701
- this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
702
- break;
703
- default:
704
- console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + n2);
705
- }
706
- return false !== s2 && this._onChangeCallback(), this;
766
+ equals(t2) {
767
+ return t2.x === this.x && t2.y === this.y && t2.z === this.z;
707
768
  }
708
- setFromAxisAngle(t2, s2) {
709
- const i2 = s2 / 2, e2 = Math.sin(i2);
710
- return this._x = t2.x * e2, this._y = t2.y * e2, this._z = t2.z * e2, this._w = Math.cos(i2), this._onChangeCallback(), this;
769
+ fromArray(t2, s2 = 0) {
770
+ return this.x = t2[s2], this.y = t2[s2 + 1], this.z = t2[s2 + 2], this;
711
771
  }
712
- setFromRotationMatrix(t2) {
713
- const s2 = t2.elements, i2 = s2[0], e2 = s2[4], a2 = s2[8], n2 = s2[1], r2 = s2[5], h2 = s2[9], o2 = s2[2], c2 = s2[6], l2 = s2[10], u2 = i2 + r2 + l2;
714
- if (u2 > 0) {
715
- const t3 = 0.5 / Math.sqrt(u2 + 1);
716
- this._w = 0.25 / t3, this._x = (c2 - h2) * t3, this._y = (a2 - o2) * t3, this._z = (n2 - e2) * t3;
717
- } else if (i2 > r2 && i2 > l2) {
718
- const t3 = 2 * Math.sqrt(1 + i2 - r2 - l2);
719
- this._w = (c2 - h2) / t3, this._x = 0.25 * t3, this._y = (e2 + n2) / t3, this._z = (a2 + o2) / t3;
720
- } else if (r2 > l2) {
721
- const t3 = 2 * Math.sqrt(1 + r2 - i2 - l2);
722
- this._w = (a2 - o2) / t3, this._x = (e2 + n2) / t3, this._y = 0.25 * t3, this._z = (h2 + c2) / t3;
723
- } else {
724
- const t3 = 2 * Math.sqrt(1 + l2 - i2 - r2);
725
- this._w = (n2 - e2) / t3, this._x = (a2 + o2) / t3, this._y = (h2 + c2) / t3, this._z = 0.25 * t3;
726
- }
727
- return this._onChangeCallback(), this;
772
+ toArray(t2 = [], s2 = 0) {
773
+ return t2[s2] = this.x, t2[s2 + 1] = this.y, t2[s2 + 2] = this.z, t2;
728
774
  }
729
- setFromUnitVectors(t2, s2) {
730
- let i2 = t2.dot(s2) + 1;
731
- return i2 < Number.EPSILON ? (i2 = 0, Math.abs(t2.x) > Math.abs(t2.z) ? (this._x = -t2.y, this._y = t2.x, this._z = 0, this._w = i2) : (this._x = 0, this._y = -t2.z, this._z = t2.y, this._w = i2)) : (this._x = t2.y * s2.z - t2.z * s2.y, this._y = t2.z * s2.x - t2.x * s2.z, this._z = t2.x * s2.y - t2.y * s2.x, this._w = i2), this.normalize();
775
+ fromBufferAttribute(t2, s2) {
776
+ return this.x = t2.getX(s2), this.y = t2.getY(s2), this.z = t2.getZ(s2), this;
732
777
  }
733
- angleTo(t2) {
734
- return 2 * Math.acos(Math.abs(n(this.dot(t2), -1, 1)));
778
+ random() {
779
+ return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
735
780
  }
736
- rotateTowards(t2, s2) {
737
- const i2 = this.angleTo(t2);
738
- if (0 === i2)
739
- return this;
740
- const e2 = Math.min(1, s2 / i2);
741
- return this.slerp(t2, e2), this;
781
+ randomDirection() {
782
+ const t2 = Math.random() * Math.PI * 2, s2 = 2 * Math.random() - 1, i2 = Math.sqrt(1 - s2 * s2);
783
+ return this.x = i2 * Math.cos(t2), this.y = s2, this.z = i2 * Math.sin(t2), this;
742
784
  }
743
- identity() {
744
- return this.set(0, 0, 0, 1);
785
+ *[Symbol.iterator]() {
786
+ yield this.x, yield this.y, yield this.z;
745
787
  }
746
- invert() {
747
- return this.conjugate();
788
+ }
789
+ const d = new u(), m = new l();
790
+ class _ {
791
+ constructor(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
792
+ _.prototype.isMatrix3 = true, this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], void 0 !== t2 && this.set(t2, s2, i2, e2, a2, n2, r2, h2, o2);
748
793
  }
749
- conjugate() {
750
- return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
794
+ set(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
795
+ const c2 = this.elements;
796
+ return c2[0] = t2, c2[1] = e2, c2[2] = r2, c2[3] = s2, c2[4] = a2, c2[5] = h2, c2[6] = i2, c2[7] = n2, c2[8] = o2, this;
751
797
  }
752
- dot(t2) {
753
- return this._x * t2._x + this._y * t2._y + this._z * t2._z + this._w * t2._w;
798
+ identity() {
799
+ return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
754
800
  }
755
- lengthSq() {
756
- return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
801
+ copy(t2) {
802
+ const s2 = this.elements, i2 = t2.elements;
803
+ return s2[0] = i2[0], s2[1] = i2[1], s2[2] = i2[2], s2[3] = i2[3], s2[4] = i2[4], s2[5] = i2[5], s2[6] = i2[6], s2[7] = i2[7], s2[8] = i2[8], this;
757
804
  }
758
- length() {
759
- return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
805
+ extractBasis(t2, s2, i2) {
806
+ return t2.setFromMatrix3Column(this, 0), s2.setFromMatrix3Column(this, 1), i2.setFromMatrix3Column(this, 2), this;
760
807
  }
761
- normalize() {
762
- let t2 = this.length();
763
- return 0 === t2 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t2 = 1 / t2, this._x = this._x * t2, this._y = this._y * t2, this._z = this._z * t2, this._w = this._w * t2), this._onChangeCallback(), this;
808
+ setFromMatrix4(t2) {
809
+ const s2 = t2.elements;
810
+ return this.set(s2[0], s2[4], s2[8], s2[1], s2[5], s2[9], s2[2], s2[6], s2[10]), this;
764
811
  }
765
812
  multiply(t2) {
766
- return this.multiplyQuaternions(this, t2);
813
+ return this.multiplyMatrices(this, t2);
767
814
  }
768
815
  premultiply(t2) {
769
- return this.multiplyQuaternions(t2, this);
816
+ return this.multiplyMatrices(t2, this);
770
817
  }
771
- multiplyQuaternions(t2, s2) {
772
- const i2 = t2._x, e2 = t2._y, a2 = t2._z, n2 = t2._w, r2 = s2._x, h2 = s2._y, o2 = s2._z, c2 = s2._w;
773
- return this._x = i2 * c2 + n2 * r2 + e2 * o2 - a2 * h2, this._y = e2 * c2 + n2 * h2 + a2 * r2 - i2 * o2, this._z = a2 * c2 + n2 * o2 + i2 * h2 - e2 * r2, this._w = n2 * c2 - i2 * r2 - e2 * h2 - a2 * o2, this._onChangeCallback(), this;
818
+ multiplyMatrices(t2, s2) {
819
+ const i2 = t2.elements, e2 = s2.elements, a2 = this.elements, n2 = i2[0], r2 = i2[3], h2 = i2[6], o2 = i2[1], c2 = i2[4], l2 = i2[7], u2 = i2[2], d2 = i2[5], m2 = i2[8], _2 = e2[0], f2 = e2[3], y2 = e2[6], p2 = e2[1], g2 = e2[4], M2 = e2[7], x2 = e2[2], w2 = e2[5], S2 = e2[8];
820
+ return a2[0] = n2 * _2 + r2 * p2 + h2 * x2, a2[3] = n2 * f2 + r2 * g2 + h2 * w2, a2[6] = n2 * y2 + r2 * M2 + h2 * S2, a2[1] = o2 * _2 + c2 * p2 + l2 * x2, a2[4] = o2 * f2 + c2 * g2 + l2 * w2, a2[7] = o2 * y2 + c2 * M2 + l2 * S2, a2[2] = u2 * _2 + d2 * p2 + m2 * x2, a2[5] = u2 * f2 + d2 * g2 + m2 * w2, a2[8] = u2 * y2 + d2 * M2 + m2 * S2, this;
774
821
  }
775
- slerp(t2, s2) {
776
- if (0 === s2)
777
- return this;
778
- if (1 === s2)
779
- return this.copy(t2);
780
- const i2 = this._x, e2 = this._y, a2 = this._z, n2 = this._w;
781
- let r2 = n2 * t2._w + i2 * t2._x + e2 * t2._y + a2 * t2._z;
782
- if (r2 < 0 ? (this._w = -t2._w, this._x = -t2._x, this._y = -t2._y, this._z = -t2._z, r2 = -r2) : this.copy(t2), r2 >= 1)
783
- return this._w = n2, this._x = i2, this._y = e2, this._z = a2, this;
784
- const h2 = 1 - r2 * r2;
785
- if (h2 <= Number.EPSILON) {
786
- const t3 = 1 - s2;
787
- return this._w = t3 * n2 + s2 * this._w, this._x = t3 * i2 + s2 * this._x, this._y = t3 * e2 + s2 * this._y, this._z = t3 * a2 + s2 * this._z, this.normalize(), this._onChangeCallback(), this;
788
- }
789
- const o2 = Math.sqrt(h2), c2 = Math.atan2(o2, r2), l2 = Math.sin((1 - s2) * c2) / o2, u2 = Math.sin(s2 * c2) / o2;
790
- return this._w = n2 * l2 + this._w * u2, this._x = i2 * l2 + this._x * u2, this._y = e2 * l2 + this._y * u2, this._z = a2 * l2 + this._z * u2, this._onChangeCallback(), this;
822
+ multiplyScalar(t2) {
823
+ const s2 = this.elements;
824
+ return s2[0] *= t2, s2[3] *= t2, s2[6] *= t2, s2[1] *= t2, s2[4] *= t2, s2[7] *= t2, s2[2] *= t2, s2[5] *= t2, s2[8] *= t2, this;
791
825
  }
792
- slerpQuaternions(t2, s2, i2) {
793
- return this.copy(t2).slerp(s2, i2);
826
+ determinant() {
827
+ const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8];
828
+ return s2 * n2 * c2 - s2 * r2 * o2 - i2 * a2 * c2 + i2 * r2 * h2 + e2 * a2 * o2 - e2 * n2 * h2;
794
829
  }
795
- random() {
796
- const t2 = Math.random(), s2 = Math.sqrt(1 - t2), i2 = Math.sqrt(t2), e2 = 2 * Math.PI * Math.random(), a2 = 2 * Math.PI * Math.random();
797
- return this.set(s2 * Math.cos(e2), i2 * Math.sin(a2), i2 * Math.cos(a2), s2 * Math.sin(e2));
830
+ invert() {
831
+ const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8], l2 = c2 * n2 - r2 * o2, u2 = r2 * h2 - c2 * a2, d2 = o2 * a2 - n2 * h2, m2 = s2 * l2 + i2 * u2 + e2 * d2;
832
+ if (0 === m2)
833
+ return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
834
+ const _2 = 1 / m2;
835
+ return t2[0] = l2 * _2, t2[1] = (e2 * o2 - c2 * i2) * _2, t2[2] = (r2 * i2 - e2 * n2) * _2, t2[3] = u2 * _2, t2[4] = (c2 * s2 - e2 * h2) * _2, t2[5] = (e2 * a2 - r2 * s2) * _2, t2[6] = d2 * _2, t2[7] = (i2 * h2 - o2 * s2) * _2, t2[8] = (n2 * s2 - i2 * a2) * _2, this;
836
+ }
837
+ transpose() {
838
+ let t2;
839
+ const s2 = this.elements;
840
+ return t2 = s2[1], s2[1] = s2[3], s2[3] = t2, t2 = s2[2], s2[2] = s2[6], s2[6] = t2, t2 = s2[5], s2[5] = s2[7], s2[7] = t2, this;
841
+ }
842
+ getNormalMatrix(t2) {
843
+ return this.setFromMatrix4(t2).invert().transpose();
844
+ }
845
+ transposeIntoArray(t2) {
846
+ const s2 = this.elements;
847
+ return t2[0] = s2[0], t2[1] = s2[3], t2[2] = s2[6], t2[3] = s2[1], t2[4] = s2[4], t2[5] = s2[7], t2[6] = s2[2], t2[7] = s2[5], t2[8] = s2[8], this;
848
+ }
849
+ setUvTransform(t2, s2, i2, e2, a2, n2, r2) {
850
+ const h2 = Math.cos(a2), o2 = Math.sin(a2);
851
+ return this.set(i2 * h2, i2 * o2, -i2 * (h2 * n2 + o2 * r2) + n2 + t2, -e2 * o2, e2 * h2, -e2 * (-o2 * n2 + h2 * r2) + r2 + s2, 0, 0, 1), this;
852
+ }
853
+ scale(t2, s2) {
854
+ return this.premultiply(f.makeScale(t2, s2)), this;
855
+ }
856
+ rotate(t2) {
857
+ return this.premultiply(f.makeRotation(-t2)), this;
858
+ }
859
+ translate(t2, s2) {
860
+ return this.premultiply(f.makeTranslation(t2, s2)), this;
861
+ }
862
+ makeTranslation(t2, s2) {
863
+ return t2.isVector2 ? this.set(1, 0, t2.x, 0, 1, t2.y, 0, 0, 1) : this.set(1, 0, t2, 0, 1, s2, 0, 0, 1), this;
864
+ }
865
+ makeRotation(t2) {
866
+ const s2 = Math.cos(t2), i2 = Math.sin(t2);
867
+ return this.set(s2, -i2, 0, i2, s2, 0, 0, 0, 1), this;
868
+ }
869
+ makeScale(t2, s2) {
870
+ return this.set(t2, 0, 0, 0, s2, 0, 0, 0, 1), this;
798
871
  }
799
872
  equals(t2) {
800
- return t2._x === this._x && t2._y === this._y && t2._z === this._z && t2._w === this._w;
873
+ const s2 = this.elements, i2 = t2.elements;
874
+ for (let t3 = 0; t3 < 9; t3++)
875
+ if (s2[t3] !== i2[t3])
876
+ return false;
877
+ return true;
801
878
  }
802
879
  fromArray(t2, s2 = 0) {
803
- return this._x = t2[s2], this._y = t2[s2 + 1], this._z = t2[s2 + 2], this._w = t2[s2 + 3], this._onChangeCallback(), this;
880
+ for (let i2 = 0; i2 < 9; i2++)
881
+ this.elements[i2] = t2[i2 + s2];
882
+ return this;
804
883
  }
805
884
  toArray(t2 = [], s2 = 0) {
806
- return t2[s2] = this._x, t2[s2 + 1] = this._y, t2[s2 + 2] = this._z, t2[s2 + 3] = this._w, t2;
885
+ const i2 = this.elements;
886
+ return t2[s2] = i2[0], t2[s2 + 1] = i2[1], t2[s2 + 2] = i2[2], t2[s2 + 3] = i2[3], t2[s2 + 4] = i2[4], t2[s2 + 5] = i2[5], t2[s2 + 6] = i2[6], t2[s2 + 7] = i2[7], t2[s2 + 8] = i2[8], t2;
807
887
  }
808
- fromBufferAttribute(t2, s2) {
809
- return this._x = t2.getX(s2), this._y = t2.getY(s2), this._z = t2.getZ(s2), this._w = t2.getW(s2), this;
888
+ clone() {
889
+ return new this.constructor().fromArray(this.elements);
810
890
  }
811
- toJSON() {
812
- return this.toArray();
891
+ }
892
+ const f = new _();
893
+ class y {
894
+ constructor(t2 = 0, s2 = 0, i2 = 0, e2 = 1) {
895
+ y.prototype.isVector4 = true, this.x = t2, this.y = s2, this.z = i2, this.w = e2;
813
896
  }
814
- _onChange(t2) {
815
- return this._onChangeCallback = t2, this;
897
+ get width() {
898
+ return this.z;
816
899
  }
817
- _onChangeCallback() {
900
+ set width(t2) {
901
+ this.z = t2;
818
902
  }
819
- *[Symbol.iterator]() {
820
- yield this._x, yield this._y, yield this._z, yield this._w;
903
+ get height() {
904
+ return this.w;
821
905
  }
822
- }
823
- class _ {
824
- constructor(t2 = 0, s2 = 0, i2 = 0) {
825
- _.prototype.isVector3 = true, this.x = t2, this.y = s2, this.z = i2;
906
+ set height(t2) {
907
+ this.w = t2;
826
908
  }
827
- set(t2, s2, i2) {
828
- return void 0 === i2 && (i2 = this.z), this.x = t2, this.y = s2, this.z = i2, this;
909
+ set(t2, s2, i2, e2) {
910
+ return this.x = t2, this.y = s2, this.z = i2, this.w = e2, this;
829
911
  }
830
912
  setScalar(t2) {
831
- return this.x = t2, this.y = t2, this.z = t2, this;
913
+ return this.x = t2, this.y = t2, this.z = t2, this.w = t2, this;
832
914
  }
833
915
  setX(t2) {
834
916
  return this.x = t2, this;
@@ -839,6 +921,9 @@ class _ {
839
921
  setZ(t2) {
840
922
  return this.z = t2, this;
841
923
  }
924
+ setW(t2) {
925
+ return this.w = t2, this;
926
+ }
842
927
  setComponent(t2, s2) {
843
928
  switch (t2) {
844
929
  case 0:
@@ -850,6 +935,9 @@ class _ {
850
935
  case 2:
851
936
  this.z = s2;
852
937
  break;
938
+ case 3:
939
+ this.w = s2;
940
+ break;
853
941
  default:
854
942
  throw new Error("index is out of range: " + t2);
855
943
  }
@@ -863,125 +951,119 @@ class _ {
863
951
  return this.y;
864
952
  case 2:
865
953
  return this.z;
954
+ case 3:
955
+ return this.w;
866
956
  default:
867
957
  throw new Error("index is out of range: " + t2);
868
958
  }
869
959
  }
870
960
  clone() {
871
- return new this.constructor(this.x, this.y, this.z);
961
+ return new this.constructor(this.x, this.y, this.z, this.w);
872
962
  }
873
963
  copy(t2) {
874
- return this.x = t2.x, this.y = t2.y, this.z = t2.z, this;
964
+ return this.x = t2.x, this.y = t2.y, this.z = t2.z, this.w = void 0 !== t2.w ? t2.w : 1, this;
875
965
  }
876
966
  add(t2) {
877
- return this.x += t2.x, this.y += t2.y, this.z += t2.z, this;
967
+ return this.x += t2.x, this.y += t2.y, this.z += t2.z, this.w += t2.w, this;
878
968
  }
879
969
  addScalar(t2) {
880
- return this.x += t2, this.y += t2, this.z += t2, this;
970
+ return this.x += t2, this.y += t2, this.z += t2, this.w += t2, this;
881
971
  }
882
972
  addVectors(t2, s2) {
883
- return this.x = t2.x + s2.x, this.y = t2.y + s2.y, this.z = t2.z + s2.z, this;
973
+ return this.x = t2.x + s2.x, this.y = t2.y + s2.y, this.z = t2.z + s2.z, this.w = t2.w + s2.w, this;
884
974
  }
885
975
  addScaledVector(t2, s2) {
886
- return this.x += t2.x * s2, this.y += t2.y * s2, this.z += t2.z * s2, this;
976
+ return this.x += t2.x * s2, this.y += t2.y * s2, this.z += t2.z * s2, this.w += t2.w * s2, this;
887
977
  }
888
978
  sub(t2) {
889
- return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this;
979
+ return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this.w -= t2.w, this;
890
980
  }
891
981
  subScalar(t2) {
892
- return this.x -= t2, this.y -= t2, this.z -= t2, this;
982
+ return this.x -= t2, this.y -= t2, this.z -= t2, this.w -= t2, this;
893
983
  }
894
984
  subVectors(t2, s2) {
895
- return this.x = t2.x - s2.x, this.y = t2.y - s2.y, this.z = t2.z - s2.z, this;
985
+ return this.x = t2.x - s2.x, this.y = t2.y - s2.y, this.z = t2.z - s2.z, this.w = t2.w - s2.w, this;
896
986
  }
897
987
  multiply(t2) {
898
- return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this;
988
+ return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this.w *= t2.w, this;
899
989
  }
900
990
  multiplyScalar(t2) {
901
- return this.x *= t2, this.y *= t2, this.z *= t2, this;
902
- }
903
- multiplyVectors(t2, s2) {
904
- return this.x = t2.x * s2.x, this.y = t2.y * s2.y, this.z = t2.z * s2.z, this;
905
- }
906
- applyEuler(t2) {
907
- return this.applyQuaternion(y.setFromEuler(t2));
908
- }
909
- applyAxisAngle(t2, s2) {
910
- return this.applyQuaternion(y.setFromAxisAngle(t2, s2));
911
- }
912
- applyMatrix3(t2) {
913
- const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements;
914
- return this.x = a2[0] * s2 + a2[3] * i2 + a2[6] * e2, this.y = a2[1] * s2 + a2[4] * i2 + a2[7] * e2, this.z = a2[2] * s2 + a2[5] * i2 + a2[8] * e2, this;
915
- }
916
- applyNormalMatrix(t2) {
917
- return this.applyMatrix3(t2).normalize();
991
+ return this.x *= t2, this.y *= t2, this.z *= t2, this.w *= t2, this;
918
992
  }
919
993
  applyMatrix4(t2) {
920
- const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements, n2 = 1 / (a2[3] * s2 + a2[7] * i2 + a2[11] * e2 + a2[15]);
921
- return this.x = (a2[0] * s2 + a2[4] * i2 + a2[8] * e2 + a2[12]) * n2, this.y = (a2[1] * s2 + a2[5] * i2 + a2[9] * e2 + a2[13]) * n2, this.z = (a2[2] * s2 + a2[6] * i2 + a2[10] * e2 + a2[14]) * n2, this;
922
- }
923
- applyQuaternion(t2) {
924
- const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.x, n2 = t2.y, r2 = t2.z, h2 = t2.w, o2 = 2 * (n2 * e2 - r2 * i2), c2 = 2 * (r2 * s2 - a2 * e2), l2 = 2 * (a2 * i2 - n2 * s2);
925
- return this.x = s2 + h2 * o2 + n2 * l2 - r2 * c2, this.y = i2 + h2 * c2 + r2 * o2 - a2 * l2, this.z = e2 + h2 * l2 + a2 * c2 - n2 * o2, this;
926
- }
927
- project(t2) {
928
- return this.applyMatrix4(t2.matrixWorldInverse).applyMatrix4(t2.projectionMatrix);
929
- }
930
- unproject(t2) {
931
- return this.applyMatrix4(t2.projectionMatrixInverse).applyMatrix4(t2.matrixWorld);
932
- }
933
- transformDirection(t2) {
934
- const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements;
935
- return this.x = a2[0] * s2 + a2[4] * i2 + a2[8] * e2, this.y = a2[1] * s2 + a2[5] * i2 + a2[9] * e2, this.z = a2[2] * s2 + a2[6] * i2 + a2[10] * e2, this.normalize();
994
+ const s2 = this.x, i2 = this.y, e2 = this.z, a2 = this.w, n2 = t2.elements;
995
+ return this.x = n2[0] * s2 + n2[4] * i2 + n2[8] * e2 + n2[12] * a2, this.y = n2[1] * s2 + n2[5] * i2 + n2[9] * e2 + n2[13] * a2, this.z = n2[2] * s2 + n2[6] * i2 + n2[10] * e2 + n2[14] * a2, this.w = n2[3] * s2 + n2[7] * i2 + n2[11] * e2 + n2[15] * a2, this;
936
996
  }
937
997
  divide(t2) {
938
- return this.x /= t2.x, this.y /= t2.y, this.z /= t2.z, this;
998
+ return this.x /= t2.x, this.y /= t2.y, this.z /= t2.z, this.w /= t2.w, this;
939
999
  }
940
1000
  divideScalar(t2) {
941
1001
  return this.multiplyScalar(1 / t2);
942
1002
  }
1003
+ setAxisAngleFromQuaternion(t2) {
1004
+ this.w = 2 * Math.acos(t2.w);
1005
+ const s2 = Math.sqrt(1 - t2.w * t2.w);
1006
+ return s2 < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t2.x / s2, this.y = t2.y / s2, this.z = t2.z / s2), this;
1007
+ }
1008
+ setAxisAngleFromRotationMatrix(t2) {
1009
+ let s2, i2, e2, a2;
1010
+ const n2 = 0.01, r2 = 0.1, h2 = t2.elements, o2 = h2[0], c2 = h2[4], l2 = h2[8], u2 = h2[1], d2 = h2[5], m2 = h2[9], _2 = h2[2], f2 = h2[6], y2 = h2[10];
1011
+ if (Math.abs(c2 - u2) < n2 && Math.abs(l2 - _2) < n2 && Math.abs(m2 - f2) < n2) {
1012
+ if (Math.abs(c2 + u2) < r2 && Math.abs(l2 + _2) < r2 && Math.abs(m2 + f2) < r2 && Math.abs(o2 + d2 + y2 - 3) < r2)
1013
+ return this.set(1, 0, 0, 0), this;
1014
+ s2 = Math.PI;
1015
+ const t3 = (o2 + 1) / 2, h3 = (d2 + 1) / 2, p3 = (y2 + 1) / 2, g2 = (c2 + u2) / 4, M2 = (l2 + _2) / 4, x2 = (m2 + f2) / 4;
1016
+ return t3 > h3 && t3 > p3 ? t3 < n2 ? (i2 = 0, e2 = 0.707106781, a2 = 0.707106781) : (i2 = Math.sqrt(t3), e2 = g2 / i2, a2 = M2 / i2) : h3 > p3 ? h3 < n2 ? (i2 = 0.707106781, e2 = 0, a2 = 0.707106781) : (e2 = Math.sqrt(h3), i2 = g2 / e2, a2 = x2 / e2) : p3 < n2 ? (i2 = 0.707106781, e2 = 0.707106781, a2 = 0) : (a2 = Math.sqrt(p3), i2 = M2 / a2, e2 = x2 / a2), this.set(i2, e2, a2, s2), this;
1017
+ }
1018
+ let p2 = Math.sqrt((f2 - m2) * (f2 - m2) + (l2 - _2) * (l2 - _2) + (u2 - c2) * (u2 - c2));
1019
+ return Math.abs(p2) < 1e-3 && (p2 = 1), this.x = (f2 - m2) / p2, this.y = (l2 - _2) / p2, this.z = (u2 - c2) / p2, this.w = Math.acos((o2 + d2 + y2 - 1) / 2), this;
1020
+ }
1021
+ setFromMatrixPosition(t2) {
1022
+ const s2 = t2.elements;
1023
+ return this.x = s2[12], this.y = s2[13], this.z = s2[14], this.w = s2[15], this;
1024
+ }
943
1025
  min(t2) {
944
- return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this;
1026
+ return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this.w = Math.min(this.w, t2.w), this;
945
1027
  }
946
1028
  max(t2) {
947
- return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this;
1029
+ return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this.w = Math.max(this.w, t2.w), this;
948
1030
  }
949
1031
  clamp(t2, s2) {
950
- return this.x = Math.max(t2.x, Math.min(s2.x, this.x)), this.y = Math.max(t2.y, Math.min(s2.y, this.y)), this.z = Math.max(t2.z, Math.min(s2.z, this.z)), this;
1032
+ return this.x = n(this.x, t2.x, s2.x), this.y = n(this.y, t2.y, s2.y), this.z = n(this.z, t2.z, s2.z), this.w = n(this.w, t2.w, s2.w), this;
951
1033
  }
952
1034
  clampScalar(t2, s2) {
953
- return this.x = Math.max(t2, Math.min(s2, this.x)), this.y = Math.max(t2, Math.min(s2, this.y)), this.z = Math.max(t2, Math.min(s2, this.z)), this;
1035
+ return this.x = n(this.x, t2, s2), this.y = n(this.y, t2, s2), this.z = n(this.z, t2, s2), this.w = n(this.w, t2, s2), this;
954
1036
  }
955
1037
  clampLength(t2, s2) {
956
1038
  const i2 = this.length();
957
- return this.divideScalar(i2 || 1).multiplyScalar(Math.max(t2, Math.min(s2, i2)));
1039
+ return this.divideScalar(i2 || 1).multiplyScalar(n(i2, t2, s2));
958
1040
  }
959
1041
  floor() {
960
- return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
1042
+ return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;
961
1043
  }
962
1044
  ceil() {
963
- return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
1045
+ return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;
964
1046
  }
965
1047
  round() {
966
- return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
1048
+ return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;
967
1049
  }
968
1050
  roundToZero() {
969
- return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
1051
+ return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;
970
1052
  }
971
1053
  negate() {
972
- return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
1054
+ return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;
973
1055
  }
974
1056
  dot(t2) {
975
- return this.x * t2.x + this.y * t2.y + this.z * t2.z;
1057
+ return this.x * t2.x + this.y * t2.y + this.z * t2.z + this.w * t2.w;
976
1058
  }
977
1059
  lengthSq() {
978
- return this.x * this.x + this.y * this.y + this.z * this.z;
1060
+ return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
979
1061
  }
980
1062
  length() {
981
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
1063
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
982
1064
  }
983
1065
  manhattanLength() {
984
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
1066
+ return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
985
1067
  }
986
1068
  normalize() {
987
1069
  return this.divideScalar(this.length() || 1);
@@ -990,107 +1072,32 @@ class _ {
990
1072
  return this.normalize().multiplyScalar(t2);
991
1073
  }
992
1074
  lerp(t2, s2) {
993
- return this.x += (t2.x - this.x) * s2, this.y += (t2.y - this.y) * s2, this.z += (t2.z - this.z) * s2, this;
1075
+ return this.x += (t2.x - this.x) * s2, this.y += (t2.y - this.y) * s2, this.z += (t2.z - this.z) * s2, this.w += (t2.w - this.w) * s2, this;
994
1076
  }
995
1077
  lerpVectors(t2, s2, i2) {
996
- return this.x = t2.x + (s2.x - t2.x) * i2, this.y = t2.y + (s2.y - t2.y) * i2, this.z = t2.z + (s2.z - t2.z) * i2, this;
997
- }
998
- cross(t2) {
999
- return this.crossVectors(this, t2);
1000
- }
1001
- crossVectors(t2, s2) {
1002
- const i2 = t2.x, e2 = t2.y, a2 = t2.z, n2 = s2.x, r2 = s2.y, h2 = s2.z;
1003
- return this.x = e2 * h2 - a2 * r2, this.y = a2 * n2 - i2 * h2, this.z = i2 * r2 - e2 * n2, this;
1004
- }
1005
- projectOnVector(t2) {
1006
- const s2 = t2.lengthSq();
1007
- if (0 === s2)
1008
- return this.set(0, 0, 0);
1009
- const i2 = t2.dot(this) / s2;
1010
- return this.copy(t2).multiplyScalar(i2);
1011
- }
1012
- projectOnPlane(t2) {
1013
- return f.copy(this).projectOnVector(t2), this.sub(f);
1014
- }
1015
- reflect(t2) {
1016
- return this.sub(f.copy(t2).multiplyScalar(2 * this.dot(t2)));
1017
- }
1018
- angleTo(t2) {
1019
- const s2 = Math.sqrt(this.lengthSq() * t2.lengthSq());
1020
- if (0 === s2)
1021
- return Math.PI / 2;
1022
- const i2 = this.dot(t2) / s2;
1023
- return Math.acos(n(i2, -1, 1));
1024
- }
1025
- distanceTo(t2) {
1026
- return Math.sqrt(this.distanceToSquared(t2));
1027
- }
1028
- distanceToSquared(t2) {
1029
- const s2 = this.x - t2.x, i2 = this.y - t2.y, e2 = this.z - t2.z;
1030
- return s2 * s2 + i2 * i2 + e2 * e2;
1031
- }
1032
- manhattanDistanceTo(t2) {
1033
- return Math.abs(this.x - t2.x) + Math.abs(this.y - t2.y) + Math.abs(this.z - t2.z);
1034
- }
1035
- setFromSpherical(t2) {
1036
- return this.setFromSphericalCoords(t2.radius, t2.phi, t2.theta);
1037
- }
1038
- setFromSphericalCoords(t2, s2, i2) {
1039
- const e2 = Math.sin(s2) * t2;
1040
- return this.x = e2 * Math.sin(i2), this.y = Math.cos(s2) * t2, this.z = e2 * Math.cos(i2), this;
1041
- }
1042
- setFromCylindrical(t2) {
1043
- return this.setFromCylindricalCoords(t2.radius, t2.theta, t2.y);
1044
- }
1045
- setFromCylindricalCoords(t2, s2, i2) {
1046
- return this.x = t2 * Math.sin(s2), this.y = i2, this.z = t2 * Math.cos(s2), this;
1047
- }
1048
- setFromMatrixPosition(t2) {
1049
- const s2 = t2.elements;
1050
- return this.x = s2[12], this.y = s2[13], this.z = s2[14], this;
1051
- }
1052
- setFromMatrixScale(t2) {
1053
- const s2 = this.setFromMatrixColumn(t2, 0).length(), i2 = this.setFromMatrixColumn(t2, 1).length(), e2 = this.setFromMatrixColumn(t2, 2).length();
1054
- return this.x = s2, this.y = i2, this.z = e2, this;
1055
- }
1056
- setFromMatrixColumn(t2, s2) {
1057
- return this.fromArray(t2.elements, 4 * s2);
1058
- }
1059
- setFromMatrix3Column(t2, s2) {
1060
- return this.fromArray(t2.elements, 3 * s2);
1061
- }
1062
- setFromEuler(t2) {
1063
- return this.x = t2._x, this.y = t2._y, this.z = t2._z, this;
1064
- }
1065
- setFromColor(t2) {
1066
- return this.x = t2.r, this.y = t2.g, this.z = t2.b, this;
1078
+ return this.x = t2.x + (s2.x - t2.x) * i2, this.y = t2.y + (s2.y - t2.y) * i2, this.z = t2.z + (s2.z - t2.z) * i2, this.w = t2.w + (s2.w - t2.w) * i2, this;
1067
1079
  }
1068
1080
  equals(t2) {
1069
- return t2.x === this.x && t2.y === this.y && t2.z === this.z;
1081
+ return t2.x === this.x && t2.y === this.y && t2.z === this.z && t2.w === this.w;
1070
1082
  }
1071
1083
  fromArray(t2, s2 = 0) {
1072
- return this.x = t2[s2], this.y = t2[s2 + 1], this.z = t2[s2 + 2], this;
1084
+ return this.x = t2[s2], this.y = t2[s2 + 1], this.z = t2[s2 + 2], this.w = t2[s2 + 3], this;
1073
1085
  }
1074
1086
  toArray(t2 = [], s2 = 0) {
1075
- return t2[s2] = this.x, t2[s2 + 1] = this.y, t2[s2 + 2] = this.z, t2;
1087
+ return t2[s2] = this.x, t2[s2 + 1] = this.y, t2[s2 + 2] = this.z, t2[s2 + 3] = this.w, t2;
1076
1088
  }
1077
1089
  fromBufferAttribute(t2, s2) {
1078
- return this.x = t2.getX(s2), this.y = t2.getY(s2), this.z = t2.getZ(s2), this;
1090
+ return this.x = t2.getX(s2), this.y = t2.getY(s2), this.z = t2.getZ(s2), this.w = t2.getW(s2), this;
1079
1091
  }
1080
1092
  random() {
1081
- return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
1082
- }
1083
- randomDirection() {
1084
- const t2 = 2 * (Math.random() - 0.5), s2 = Math.random() * Math.PI * 2, i2 = Math.sqrt(1 - t2 ** 2);
1085
- return this.x = i2 * Math.cos(s2), this.y = i2 * Math.sin(s2), this.z = t2, this;
1093
+ return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
1086
1094
  }
1087
1095
  *[Symbol.iterator]() {
1088
- yield this.x, yield this.y, yield this.z;
1096
+ yield this.x, yield this.y, yield this.z, yield this.w;
1089
1097
  }
1090
1098
  }
1091
- const f = new _(), y = new m();
1092
1099
  class p {
1093
- constructor(t2 = new _(1 / 0, 1 / 0, 1 / 0), s2 = new _(-1 / 0, -1 / 0, -1 / 0)) {
1100
+ constructor(t2 = new u(1 / 0, 1 / 0, 1 / 0), s2 = new u(-1 / 0, -1 / 0, -1 / 0)) {
1094
1101
  this.isBox3 = true, this.min = t2, this.max = s2;
1095
1102
  }
1096
1103
  set(t2, s2) {
@@ -1099,13 +1106,13 @@ class p {
1099
1106
  setFromArray(t2) {
1100
1107
  this.makeEmpty();
1101
1108
  for (let s2 = 0, i2 = t2.length; s2 < i2; s2 += 3)
1102
- this.expandByPoint(g.fromArray(t2, s2));
1109
+ this.expandByPoint(M.fromArray(t2, s2));
1103
1110
  return this;
1104
1111
  }
1105
1112
  setFromBufferAttribute(t2) {
1106
1113
  this.makeEmpty();
1107
1114
  for (let s2 = 0, i2 = t2.count; s2 < i2; s2++)
1108
- this.expandByPoint(g.fromBufferAttribute(t2, s2));
1115
+ this.expandByPoint(M.fromBufferAttribute(t2, s2));
1109
1116
  return this;
1110
1117
  }
1111
1118
  setFromPoints(t2) {
@@ -1115,7 +1122,7 @@ class p {
1115
1122
  return this;
1116
1123
  }
1117
1124
  setFromCenterAndSize(t2, s2) {
1118
- const i2 = g.copy(s2).multiplyScalar(0.5);
1125
+ const i2 = M.copy(s2).multiplyScalar(0.5);
1119
1126
  return this.min.copy(t2).sub(i2), this.max.copy(t2).add(i2), this;
1120
1127
  }
1121
1128
  setFromObject(t2, s2 = false) {
@@ -1155,7 +1162,7 @@ class p {
1155
1162
  const e3 = i2.getAttribute("position");
1156
1163
  if (true === s2 && void 0 !== e3 && true !== t2.isInstancedMesh)
1157
1164
  for (let s3 = 0, i3 = e3.count; s3 < i3; s3++)
1158
- true === t2.isMesh ? t2.getVertexPosition(s3, g) : g.fromBufferAttribute(e3, s3), g.applyMatrix4(t2.matrixWorld), this.expandByPoint(g);
1165
+ true === t2.isMesh ? t2.getVertexPosition(s3, M) : M.fromBufferAttribute(e3, s3), M.applyMatrix4(t2.matrixWorld), this.expandByPoint(M);
1159
1166
  else
1160
1167
  void 0 !== t2.boundingBox ? (null === t2.boundingBox && t2.computeBoundingBox(), x.copy(t2.boundingBox)) : (null === i2.boundingBox && i2.computeBoundingBox(), x.copy(i2.boundingBox)), x.applyMatrix4(t2.matrixWorld), this.union(x);
1161
1168
  }
@@ -1165,7 +1172,7 @@ class p {
1165
1172
  return this;
1166
1173
  }
1167
1174
  containsPoint(t2) {
1168
- return !(t2.x < this.min.x || t2.x > this.max.x || t2.y < this.min.y || t2.y > this.max.y || t2.z < this.min.z || t2.z > this.max.z);
1175
+ return t2.x >= this.min.x && t2.x <= this.max.x && t2.y >= this.min.y && t2.y <= this.max.y && t2.z >= this.min.z && t2.z <= this.max.z;
1169
1176
  }
1170
1177
  containsBox(t2) {
1171
1178
  return this.min.x <= t2.min.x && t2.max.x <= this.max.x && this.min.y <= t2.min.y && t2.max.y <= this.max.y && this.min.z <= t2.min.z && t2.max.z <= this.max.z;
@@ -1174,10 +1181,10 @@ class p {
1174
1181
  return s2.set((t2.x - this.min.x) / (this.max.x - this.min.x), (t2.y - this.min.y) / (this.max.y - this.min.y), (t2.z - this.min.z) / (this.max.z - this.min.z));
1175
1182
  }
1176
1183
  intersectsBox(t2) {
1177
- return !(t2.max.x < this.min.x || t2.min.x > this.max.x || t2.max.y < this.min.y || t2.min.y > this.max.y || t2.max.z < this.min.z || t2.min.z > this.max.z);
1184
+ return t2.max.x >= this.min.x && t2.min.x <= this.max.x && t2.max.y >= this.min.y && t2.min.y <= this.max.y && t2.max.z >= this.min.z && t2.min.z <= this.max.z;
1178
1185
  }
1179
1186
  intersectsSphere(t2) {
1180
- return this.clampPoint(t2.center, g), g.distanceToSquared(t2.center) <= t2.radius * t2.radius;
1187
+ return this.clampPoint(t2.center, M), M.distanceToSquared(t2.center) <= t2.radius * t2.radius;
1181
1188
  }
1182
1189
  intersectsPlane(t2) {
1183
1190
  let s2, i2;
@@ -1194,10 +1201,10 @@ class p {
1194
1201
  return s2.copy(t2).clamp(this.min, this.max);
1195
1202
  }
1196
1203
  distanceToPoint(t2) {
1197
- return this.clampPoint(t2, g).distanceTo(t2);
1204
+ return this.clampPoint(t2, M).distanceTo(t2);
1198
1205
  }
1199
1206
  getBoundingSphere(t2) {
1200
- return this.isEmpty() ? t2.makeEmpty() : (this.getCenter(t2.center), t2.radius = 0.5 * this.getSize(g).length()), t2;
1207
+ return this.isEmpty() ? t2.makeEmpty() : (this.getCenter(t2.center), t2.radius = 0.5 * this.getSize(M).length()), t2;
1201
1208
  }
1202
1209
  intersect(t2) {
1203
1210
  return this.min.max(t2.min), this.max.min(t2.max), this.isEmpty() && this.makeEmpty(), this;
@@ -1206,7 +1213,7 @@ class p {
1206
1213
  return this.min.min(t2.min), this.max.max(t2.max), this;
1207
1214
  }
1208
1215
  applyMatrix4(t2) {
1209
- return this.isEmpty() || (M[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t2), M[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t2), M[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t2), M[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t2), M[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t2), M[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t2), M[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t2), M[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t2), this.setFromPoints(M)), this;
1216
+ return this.isEmpty() || (g[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t2), g[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t2), g[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t2), g[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t2), g[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t2), g[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t2), g[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t2), g[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t2), this.setFromPoints(g)), this;
1210
1217
  }
1211
1218
  translate(t2) {
1212
1219
  return this.min.add(t2), this.max.add(t2), this;
@@ -1214,8 +1221,14 @@ class p {
1214
1221
  equals(t2) {
1215
1222
  return t2.min.equals(this.min) && t2.max.equals(this.max);
1216
1223
  }
1224
+ toJSON() {
1225
+ return { min: this.min.toArray(), max: this.max.toArray() };
1226
+ }
1227
+ fromJSON(t2) {
1228
+ return this.min.fromArray(t2.min), this.max.fromArray(t2.max), this;
1229
+ }
1217
1230
  }
1218
- const M = [new _(), new _(), new _(), new _(), new _(), new _(), new _(), new _()], g = new _(), x = new p(), w = new _(), S = new _(), E = new _(), b = new _(), P = new _(), v = new _(), A = new _(), G = new _(), C = new _(), N = new _();
1231
+ const g = [new u(), new u(), new u(), new u(), new u(), new u(), new u(), new u()], M = new u(), x = new p(), w = new u(), S = new u(), E = new u(), b = new u(), P = new u(), v = new u(), A = new u(), G = new u(), C = new u(), N = new u();
1219
1232
  function I(t2, s2, i2, e2, a2) {
1220
1233
  for (let n2 = 0, r2 = t2.length - 3; n2 <= r2; n2 += 3) {
1221
1234
  N.fromArray(t2, n2);
@@ -1225,9 +1238,9 @@ function I(t2, s2, i2, e2, a2) {
1225
1238
  }
1226
1239
  return true;
1227
1240
  }
1228
- const z = new _(), T = new _(), O = new _(), R = new _(), q = new _(), L = new _(), B = new _();
1241
+ const z = new u(), T = new u(), O = new u(), R = new u(), q = new u(), L = new u(), B = new u();
1229
1242
  class k {
1230
- constructor(t2 = new _(), s2 = new _(0, 0, -1)) {
1243
+ constructor(t2 = new u(), s2 = new u(0, 0, -1)) {
1231
1244
  this.origin = t2, this.direction = s2;
1232
1245
  }
1233
1246
  set(t2, s2) {
@@ -1286,7 +1299,7 @@ class k {
1286
1299
  return h2 < 0 ? null : r2 < 0 ? this.at(h2, s2) : this.at(r2, s2);
1287
1300
  }
1288
1301
  intersectsSphere(t2) {
1289
- return this.distanceSqToPoint(t2.center) <= t2.radius * t2.radius;
1302
+ return !(t2.radius < 0) && this.distanceSqToPoint(t2.center) <= t2.radius * t2.radius;
1290
1303
  }
1291
1304
  distanceToPlane(t2) {
1292
1305
  const s2 = t2.normal.dot(this.direction);
@@ -1411,7 +1424,7 @@ class D {
1411
1424
  }
1412
1425
  lookAt(t2, s2, i2) {
1413
1426
  const e2 = this.elements;
1414
- return Z.subVectors(t2, s2), 0 === Z.lengthSq() && (Z.z = 1), Z.normalize(), W.crossVectors(i2, Z), 0 === W.lengthSq() && (1 === Math.abs(i2.z) ? Z.x += 1e-4 : Z.z += 1e-4, Z.normalize(), W.crossVectors(i2, Z)), W.normalize(), H.crossVectors(Z, W), e2[0] = W.x, e2[4] = H.x, e2[8] = Z.x, e2[1] = W.y, e2[5] = H.y, e2[9] = Z.y, e2[2] = W.z, e2[6] = H.z, e2[10] = Z.z, this;
1427
+ return X.subVectors(t2, s2), 0 === X.lengthSq() && (X.z = 1), X.normalize(), W.crossVectors(i2, X), 0 === W.lengthSq() && (1 === Math.abs(i2.z) ? X.x += 1e-4 : X.z += 1e-4, X.normalize(), W.crossVectors(i2, X)), W.normalize(), H.crossVectors(X, W), e2[0] = W.x, e2[4] = H.x, e2[8] = X.x, e2[1] = W.y, e2[5] = H.y, e2[9] = X.y, e2[2] = W.z, e2[6] = H.z, e2[10] = X.z, this;
1415
1428
  }
1416
1429
  multiply(t2) {
1417
1430
  return this.multiplyMatrices(this, t2);
@@ -1420,8 +1433,8 @@ class D {
1420
1433
  return this.multiplyMatrices(t2, this);
1421
1434
  }
1422
1435
  multiplyMatrices(t2, s2) {
1423
- const i2 = t2.elements, e2 = s2.elements, a2 = this.elements, n2 = i2[0], r2 = i2[4], h2 = i2[8], o2 = i2[12], c2 = i2[1], l2 = i2[5], u2 = i2[9], d2 = i2[13], m2 = i2[2], _2 = i2[6], f2 = i2[10], y2 = i2[14], p2 = i2[3], M2 = i2[7], g2 = i2[11], x2 = i2[15], w2 = e2[0], S2 = e2[4], E2 = e2[8], b2 = e2[12], P2 = e2[1], v2 = e2[5], A2 = e2[9], G2 = e2[13], C2 = e2[2], N2 = e2[6], I2 = e2[10], z2 = e2[14], T2 = e2[3], O2 = e2[7], R2 = e2[11], q2 = e2[15];
1424
- return a2[0] = n2 * w2 + r2 * P2 + h2 * C2 + o2 * T2, a2[4] = n2 * S2 + r2 * v2 + h2 * N2 + o2 * O2, a2[8] = n2 * E2 + r2 * A2 + h2 * I2 + o2 * R2, a2[12] = n2 * b2 + r2 * G2 + h2 * z2 + o2 * q2, a2[1] = c2 * w2 + l2 * P2 + u2 * C2 + d2 * T2, a2[5] = c2 * S2 + l2 * v2 + u2 * N2 + d2 * O2, a2[9] = c2 * E2 + l2 * A2 + u2 * I2 + d2 * R2, a2[13] = c2 * b2 + l2 * G2 + u2 * z2 + d2 * q2, a2[2] = m2 * w2 + _2 * P2 + f2 * C2 + y2 * T2, a2[6] = m2 * S2 + _2 * v2 + f2 * N2 + y2 * O2, a2[10] = m2 * E2 + _2 * A2 + f2 * I2 + y2 * R2, a2[14] = m2 * b2 + _2 * G2 + f2 * z2 + y2 * q2, a2[3] = p2 * w2 + M2 * P2 + g2 * C2 + x2 * T2, a2[7] = p2 * S2 + M2 * v2 + g2 * N2 + x2 * O2, a2[11] = p2 * E2 + M2 * A2 + g2 * I2 + x2 * R2, a2[15] = p2 * b2 + M2 * G2 + g2 * z2 + x2 * q2, this;
1436
+ const i2 = t2.elements, e2 = s2.elements, a2 = this.elements, n2 = i2[0], r2 = i2[4], h2 = i2[8], o2 = i2[12], c2 = i2[1], l2 = i2[5], u2 = i2[9], d2 = i2[13], m2 = i2[2], _2 = i2[6], f2 = i2[10], y2 = i2[14], p2 = i2[3], g2 = i2[7], M2 = i2[11], x2 = i2[15], w2 = e2[0], S2 = e2[4], E2 = e2[8], b2 = e2[12], P2 = e2[1], v2 = e2[5], A2 = e2[9], G2 = e2[13], C2 = e2[2], N2 = e2[6], I2 = e2[10], z2 = e2[14], T2 = e2[3], O2 = e2[7], R2 = e2[11], q2 = e2[15];
1437
+ return a2[0] = n2 * w2 + r2 * P2 + h2 * C2 + o2 * T2, a2[4] = n2 * S2 + r2 * v2 + h2 * N2 + o2 * O2, a2[8] = n2 * E2 + r2 * A2 + h2 * I2 + o2 * R2, a2[12] = n2 * b2 + r2 * G2 + h2 * z2 + o2 * q2, a2[1] = c2 * w2 + l2 * P2 + u2 * C2 + d2 * T2, a2[5] = c2 * S2 + l2 * v2 + u2 * N2 + d2 * O2, a2[9] = c2 * E2 + l2 * A2 + u2 * I2 + d2 * R2, a2[13] = c2 * b2 + l2 * G2 + u2 * z2 + d2 * q2, a2[2] = m2 * w2 + _2 * P2 + f2 * C2 + y2 * T2, a2[6] = m2 * S2 + _2 * v2 + f2 * N2 + y2 * O2, a2[10] = m2 * E2 + _2 * A2 + f2 * I2 + y2 * R2, a2[14] = m2 * b2 + _2 * G2 + f2 * z2 + y2 * q2, a2[3] = p2 * w2 + g2 * P2 + M2 * C2 + x2 * T2, a2[7] = p2 * S2 + g2 * v2 + M2 * N2 + x2 * O2, a2[11] = p2 * E2 + g2 * A2 + M2 * I2 + x2 * R2, a2[15] = p2 * b2 + g2 * G2 + M2 * z2 + x2 * q2, this;
1425
1438
  }
1426
1439
  multiplyScalar(t2) {
1427
1440
  const s2 = this.elements;
@@ -1441,11 +1454,11 @@ class D {
1441
1454
  return t2.isVector3 ? (e2[12] = t2.x, e2[13] = t2.y, e2[14] = t2.z) : (e2[12] = t2, e2[13] = s2, e2[14] = i2), this;
1442
1455
  }
1443
1456
  invert() {
1444
- const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8], l2 = t2[9], u2 = t2[10], d2 = t2[11], m2 = t2[12], _2 = t2[13], f2 = t2[14], y2 = t2[15], p2 = l2 * f2 * o2 - _2 * u2 * o2 + _2 * h2 * d2 - r2 * f2 * d2 - l2 * h2 * y2 + r2 * u2 * y2, M2 = m2 * u2 * o2 - c2 * f2 * o2 - m2 * h2 * d2 + n2 * f2 * d2 + c2 * h2 * y2 - n2 * u2 * y2, g2 = c2 * _2 * o2 - m2 * l2 * o2 + m2 * r2 * d2 - n2 * _2 * d2 - c2 * r2 * y2 + n2 * l2 * y2, x2 = m2 * l2 * h2 - c2 * _2 * h2 - m2 * r2 * u2 + n2 * _2 * u2 + c2 * r2 * f2 - n2 * l2 * f2, w2 = s2 * p2 + i2 * M2 + e2 * g2 + a2 * x2;
1457
+ const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8], l2 = t2[9], u2 = t2[10], d2 = t2[11], m2 = t2[12], _2 = t2[13], f2 = t2[14], y2 = t2[15], p2 = l2 * f2 * o2 - _2 * u2 * o2 + _2 * h2 * d2 - r2 * f2 * d2 - l2 * h2 * y2 + r2 * u2 * y2, g2 = m2 * u2 * o2 - c2 * f2 * o2 - m2 * h2 * d2 + n2 * f2 * d2 + c2 * h2 * y2 - n2 * u2 * y2, M2 = c2 * _2 * o2 - m2 * l2 * o2 + m2 * r2 * d2 - n2 * _2 * d2 - c2 * r2 * y2 + n2 * l2 * y2, x2 = m2 * l2 * h2 - c2 * _2 * h2 - m2 * r2 * u2 + n2 * _2 * u2 + c2 * r2 * f2 - n2 * l2 * f2, w2 = s2 * p2 + i2 * g2 + e2 * M2 + a2 * x2;
1445
1458
  if (0 === w2)
1446
1459
  return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
1447
1460
  const S2 = 1 / w2;
1448
- return t2[0] = p2 * S2, t2[1] = (_2 * u2 * a2 - l2 * f2 * a2 - _2 * e2 * d2 + i2 * f2 * d2 + l2 * e2 * y2 - i2 * u2 * y2) * S2, t2[2] = (r2 * f2 * a2 - _2 * h2 * a2 + _2 * e2 * o2 - i2 * f2 * o2 - r2 * e2 * y2 + i2 * h2 * y2) * S2, t2[3] = (l2 * h2 * a2 - r2 * u2 * a2 - l2 * e2 * o2 + i2 * u2 * o2 + r2 * e2 * d2 - i2 * h2 * d2) * S2, t2[4] = M2 * S2, t2[5] = (c2 * f2 * a2 - m2 * u2 * a2 + m2 * e2 * d2 - s2 * f2 * d2 - c2 * e2 * y2 + s2 * u2 * y2) * S2, t2[6] = (m2 * h2 * a2 - n2 * f2 * a2 - m2 * e2 * o2 + s2 * f2 * o2 + n2 * e2 * y2 - s2 * h2 * y2) * S2, t2[7] = (n2 * u2 * a2 - c2 * h2 * a2 + c2 * e2 * o2 - s2 * u2 * o2 - n2 * e2 * d2 + s2 * h2 * d2) * S2, t2[8] = g2 * S2, t2[9] = (m2 * l2 * a2 - c2 * _2 * a2 - m2 * i2 * d2 + s2 * _2 * d2 + c2 * i2 * y2 - s2 * l2 * y2) * S2, t2[10] = (n2 * _2 * a2 - m2 * r2 * a2 + m2 * i2 * o2 - s2 * _2 * o2 - n2 * i2 * y2 + s2 * r2 * y2) * S2, t2[11] = (c2 * r2 * a2 - n2 * l2 * a2 - c2 * i2 * o2 + s2 * l2 * o2 + n2 * i2 * d2 - s2 * r2 * d2) * S2, t2[12] = x2 * S2, t2[13] = (c2 * _2 * e2 - m2 * l2 * e2 + m2 * i2 * u2 - s2 * _2 * u2 - c2 * i2 * f2 + s2 * l2 * f2) * S2, t2[14] = (m2 * r2 * e2 - n2 * _2 * e2 - m2 * i2 * h2 + s2 * _2 * h2 + n2 * i2 * f2 - s2 * r2 * f2) * S2, t2[15] = (n2 * l2 * e2 - c2 * r2 * e2 + c2 * i2 * h2 - s2 * l2 * h2 - n2 * i2 * u2 + s2 * r2 * u2) * S2, this;
1461
+ return t2[0] = p2 * S2, t2[1] = (_2 * u2 * a2 - l2 * f2 * a2 - _2 * e2 * d2 + i2 * f2 * d2 + l2 * e2 * y2 - i2 * u2 * y2) * S2, t2[2] = (r2 * f2 * a2 - _2 * h2 * a2 + _2 * e2 * o2 - i2 * f2 * o2 - r2 * e2 * y2 + i2 * h2 * y2) * S2, t2[3] = (l2 * h2 * a2 - r2 * u2 * a2 - l2 * e2 * o2 + i2 * u2 * o2 + r2 * e2 * d2 - i2 * h2 * d2) * S2, t2[4] = g2 * S2, t2[5] = (c2 * f2 * a2 - m2 * u2 * a2 + m2 * e2 * d2 - s2 * f2 * d2 - c2 * e2 * y2 + s2 * u2 * y2) * S2, t2[6] = (m2 * h2 * a2 - n2 * f2 * a2 - m2 * e2 * o2 + s2 * f2 * o2 + n2 * e2 * y2 - s2 * h2 * y2) * S2, t2[7] = (n2 * u2 * a2 - c2 * h2 * a2 + c2 * e2 * o2 - s2 * u2 * o2 - n2 * e2 * d2 + s2 * h2 * d2) * S2, t2[8] = M2 * S2, t2[9] = (m2 * l2 * a2 - c2 * _2 * a2 - m2 * i2 * d2 + s2 * _2 * d2 + c2 * i2 * y2 - s2 * l2 * y2) * S2, t2[10] = (n2 * _2 * a2 - m2 * r2 * a2 + m2 * i2 * o2 - s2 * _2 * o2 - n2 * i2 * y2 + s2 * r2 * y2) * S2, t2[11] = (c2 * r2 * a2 - n2 * l2 * a2 - c2 * i2 * o2 + s2 * l2 * o2 + n2 * i2 * d2 - s2 * r2 * d2) * S2, t2[12] = x2 * S2, t2[13] = (c2 * _2 * e2 - m2 * l2 * e2 + m2 * i2 * u2 - s2 * _2 * u2 - c2 * i2 * f2 + s2 * l2 * f2) * S2, t2[14] = (m2 * r2 * e2 - n2 * _2 * e2 - m2 * i2 * h2 + s2 * _2 * h2 + n2 * i2 * f2 - s2 * r2 * f2) * S2, t2[15] = (n2 * l2 * e2 - c2 * r2 * e2 + c2 * i2 * h2 - s2 * l2 * h2 - n2 * i2 * u2 + s2 * r2 * u2) * S2, this;
1449
1462
  }
1450
1463
  scale(t2) {
1451
1464
  const s2 = this.elements, i2 = t2.x, e2 = t2.y, a2 = t2.z;
@@ -1481,8 +1494,8 @@ class D {
1481
1494
  return this.set(1, i2, a2, 0, t2, 1, n2, 0, s2, e2, 1, 0, 0, 0, 0, 1), this;
1482
1495
  }
1483
1496
  compose(t2, s2, i2) {
1484
- const e2 = this.elements, a2 = s2._x, n2 = s2._y, r2 = s2._z, h2 = s2._w, o2 = a2 + a2, c2 = n2 + n2, l2 = r2 + r2, u2 = a2 * o2, d2 = a2 * c2, m2 = a2 * l2, _2 = n2 * c2, f2 = n2 * l2, y2 = r2 * l2, p2 = h2 * o2, M2 = h2 * c2, g2 = h2 * l2, x2 = i2.x, w2 = i2.y, S2 = i2.z;
1485
- return e2[0] = (1 - (_2 + y2)) * x2, e2[1] = (d2 + g2) * x2, e2[2] = (m2 - M2) * x2, e2[3] = 0, e2[4] = (d2 - g2) * w2, e2[5] = (1 - (u2 + y2)) * w2, e2[6] = (f2 + p2) * w2, e2[7] = 0, e2[8] = (m2 + M2) * S2, e2[9] = (f2 - p2) * S2, e2[10] = (1 - (u2 + _2)) * S2, e2[11] = 0, e2[12] = t2.x, e2[13] = t2.y, e2[14] = t2.z, e2[15] = 1, this;
1497
+ const e2 = this.elements, a2 = s2._x, n2 = s2._y, r2 = s2._z, h2 = s2._w, o2 = a2 + a2, c2 = n2 + n2, l2 = r2 + r2, u2 = a2 * o2, d2 = a2 * c2, m2 = a2 * l2, _2 = n2 * c2, f2 = n2 * l2, y2 = r2 * l2, p2 = h2 * o2, g2 = h2 * c2, M2 = h2 * l2, x2 = i2.x, w2 = i2.y, S2 = i2.z;
1498
+ return e2[0] = (1 - (_2 + y2)) * x2, e2[1] = (d2 + M2) * x2, e2[2] = (m2 - g2) * x2, e2[3] = 0, e2[4] = (d2 - M2) * w2, e2[5] = (1 - (u2 + y2)) * w2, e2[6] = (f2 + p2) * w2, e2[7] = 0, e2[8] = (m2 + g2) * S2, e2[9] = (f2 - p2) * S2, e2[10] = (1 - (u2 + _2)) * S2, e2[11] = 0, e2[12] = t2.x, e2[13] = t2.y, e2[14] = t2.z, e2[15] = 1, this;
1486
1499
  }
1487
1500
  decompose(t2, s2, i2) {
1488
1501
  const e2 = this.elements;
@@ -1492,29 +1505,33 @@ class D {
1492
1505
  const h2 = 1 / a2, o2 = 1 / n2, c2 = 1 / r2;
1493
1506
  return j.elements[0] *= h2, j.elements[1] *= h2, j.elements[2] *= h2, j.elements[4] *= o2, j.elements[5] *= o2, j.elements[6] *= o2, j.elements[8] *= c2, j.elements[9] *= c2, j.elements[10] *= c2, s2.setFromRotationMatrix(j), i2.x = a2, i2.y = n2, i2.z = r2, this;
1494
1507
  }
1495
- makePerspective(s2, i2, e2, a2, n2, r2, h2 = 2e3) {
1496
- const o2 = this.elements, c2 = 2 * n2 / (i2 - s2), l2 = 2 * n2 / (e2 - a2), u2 = (i2 + s2) / (i2 - s2), d2 = (e2 + a2) / (e2 - a2);
1497
- let m2, _2;
1498
- if (h2 === t)
1499
- m2 = -(r2 + n2) / (r2 - n2), _2 = -2 * r2 * n2 / (r2 - n2);
1508
+ makePerspective(s2, i2, e2, a2, n2, r2, h2 = 2e3, o2 = false) {
1509
+ const c2 = this.elements, l2 = 2 * n2 / (i2 - s2), u2 = 2 * n2 / (e2 - a2), d2 = (i2 + s2) / (i2 - s2), m2 = (e2 + a2) / (e2 - a2);
1510
+ let _2, f2;
1511
+ if (o2)
1512
+ _2 = n2 / (r2 - n2), f2 = r2 * n2 / (r2 - n2);
1513
+ else if (h2 === t)
1514
+ _2 = -(r2 + n2) / (r2 - n2), f2 = -2 * r2 * n2 / (r2 - n2);
1500
1515
  else {
1501
1516
  if (2001 !== h2)
1502
1517
  throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + h2);
1503
- m2 = -r2 / (r2 - n2), _2 = -r2 * n2 / (r2 - n2);
1518
+ _2 = -r2 / (r2 - n2), f2 = -r2 * n2 / (r2 - n2);
1504
1519
  }
1505
- return o2[0] = c2, o2[4] = 0, o2[8] = u2, o2[12] = 0, o2[1] = 0, o2[5] = l2, o2[9] = d2, o2[13] = 0, o2[2] = 0, o2[6] = 0, o2[10] = m2, o2[14] = _2, o2[3] = 0, o2[7] = 0, o2[11] = -1, o2[15] = 0, this;
1520
+ return c2[0] = l2, c2[4] = 0, c2[8] = d2, c2[12] = 0, c2[1] = 0, c2[5] = u2, c2[9] = m2, c2[13] = 0, c2[2] = 0, c2[6] = 0, c2[10] = _2, c2[14] = f2, c2[3] = 0, c2[7] = 0, c2[11] = -1, c2[15] = 0, this;
1506
1521
  }
1507
- makeOrthographic(s2, i2, e2, a2, n2, r2, h2 = 2e3) {
1508
- const o2 = this.elements, c2 = 1 / (i2 - s2), l2 = 1 / (e2 - a2), u2 = 1 / (r2 - n2), d2 = (i2 + s2) * c2, m2 = (e2 + a2) * l2;
1522
+ makeOrthographic(s2, i2, e2, a2, n2, r2, h2 = 2e3, o2 = false) {
1523
+ const c2 = this.elements, l2 = 2 / (i2 - s2), u2 = 2 / (e2 - a2), d2 = -(i2 + s2) / (i2 - s2), m2 = -(e2 + a2) / (e2 - a2);
1509
1524
  let _2, f2;
1510
- if (h2 === t)
1511
- _2 = (r2 + n2) * u2, f2 = -2 * u2;
1525
+ if (o2)
1526
+ _2 = 1 / (r2 - n2), f2 = r2 / (r2 - n2);
1527
+ else if (h2 === t)
1528
+ _2 = -2 / (r2 - n2), f2 = -(r2 + n2) / (r2 - n2);
1512
1529
  else {
1513
1530
  if (2001 !== h2)
1514
1531
  throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + h2);
1515
- _2 = n2 * u2, f2 = -1 * u2;
1532
+ _2 = -1 / (r2 - n2), f2 = -n2 / (r2 - n2);
1516
1533
  }
1517
- return o2[0] = 2 * c2, o2[4] = 0, o2[8] = 0, o2[12] = -d2, o2[1] = 0, o2[5] = 2 * l2, o2[9] = 0, o2[13] = -m2, o2[2] = 0, o2[6] = 0, o2[10] = f2, o2[14] = -_2, o2[3] = 0, o2[7] = 0, o2[11] = 0, o2[15] = 1, this;
1534
+ return c2[0] = l2, c2[4] = 0, c2[8] = 0, c2[12] = d2, c2[1] = 0, c2[5] = u2, c2[9] = 0, c2[13] = m2, c2[2] = 0, c2[6] = 0, c2[10] = _2, c2[14] = f2, c2[3] = 0, c2[7] = 0, c2[11] = 0, c2[15] = 1, this;
1518
1535
  }
1519
1536
  equals(t2) {
1520
1537
  const s2 = this.elements, i2 = t2.elements;
@@ -1533,9 +1550,9 @@ class D {
1533
1550
  return t2[s2] = i2[0], t2[s2 + 1] = i2[1], t2[s2 + 2] = i2[2], t2[s2 + 3] = i2[3], t2[s2 + 4] = i2[4], t2[s2 + 5] = i2[5], t2[s2 + 6] = i2[6], t2[s2 + 7] = i2[7], t2[s2 + 8] = i2[8], t2[s2 + 9] = i2[9], t2[s2 + 10] = i2[10], t2[s2 + 11] = i2[11], t2[s2 + 12] = i2[12], t2[s2 + 13] = i2[13], t2[s2 + 14] = i2[14], t2[s2 + 15] = i2[15], t2;
1534
1551
  }
1535
1552
  }
1536
- const U = new _(), j = new D(), F = new _(0, 0, 0), V = new _(1, 1, 1), W = new _(), H = new _(), Z = new _(), Q = new _(), X = new _(), Y = new l();
1553
+ const U = new u(), j = new D(), F = new u(0, 0, 0), V = new u(1, 1, 1), W = new u(), H = new u(), X = new u(), Y = new u(), Z = new u(), Q = new _();
1537
1554
  class K {
1538
- constructor(t2 = new _(1, 0, 0), s2 = 0) {
1555
+ constructor(t2 = new u(1, 0, 0), s2 = 0) {
1539
1556
  this.isPlane = true, this.normal = t2, this.constant = s2;
1540
1557
  }
1541
1558
  set(t2, s2) {
@@ -1548,7 +1565,7 @@ class K {
1548
1565
  return this.normal.copy(t2), this.constant = -s2.dot(this.normal), this;
1549
1566
  }
1550
1567
  setFromCoplanarPoints(t2, s2, i2) {
1551
- const e2 = Q.subVectors(i2, s2).cross(X.subVectors(t2, s2)).normalize();
1568
+ const e2 = Y.subVectors(i2, s2).cross(Z.subVectors(t2, s2)).normalize();
1552
1569
  return this.setFromNormalAndCoplanarPoint(e2, t2), this;
1553
1570
  }
1554
1571
  copy(t2) {
@@ -1571,7 +1588,7 @@ class K {
1571
1588
  return s2.copy(t2).addScaledVector(this.normal, -this.distanceToPoint(t2));
1572
1589
  }
1573
1590
  intersectLine(t2, s2) {
1574
- const i2 = t2.delta(Q), e2 = this.normal.dot(i2);
1591
+ const i2 = t2.delta(Y), e2 = this.normal.dot(i2);
1575
1592
  if (0 === e2)
1576
1593
  return 0 === this.distanceToPoint(t2.start) ? s2.copy(t2.start) : null;
1577
1594
  const a2 = -(t2.start.dot(this.normal) + this.constant) / e2;
@@ -1591,7 +1608,7 @@ class K {
1591
1608
  return t2.copy(this.normal).multiplyScalar(-this.constant);
1592
1609
  }
1593
1610
  applyMatrix4(t2, s2) {
1594
- const i2 = s2 || Y.getNormalMatrix(t2), e2 = this.coplanarPoint(Q).applyMatrix4(t2), a2 = this.normal.applyMatrix3(i2).normalize();
1611
+ const i2 = s2 || Q.getNormalMatrix(t2), e2 = this.coplanarPoint(Y).applyMatrix4(t2), a2 = this.normal.applyMatrix3(i2).normalize();
1595
1612
  return this.constant = -e2.dot(a2), this;
1596
1613
  }
1597
1614
  translate(t2) {
@@ -1620,7 +1637,7 @@ function tt(t2) {
1620
1637
  }
1621
1638
  this.stack = s2;
1622
1639
  }
1623
- "undefined" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: "158" } })), "undefined" != typeof window && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "158"), $.EMPTY_OBJECT = Object.freeze({}), J(Object.create) && (tt.prototype = Object.create(Error.prototype), tt.prototype.constructor = tt), tt.prototype.toString = function() {
1640
+ "undefined" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: "179" } })), "undefined" != typeof window && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "179"), $.EMPTY_OBJECT = Object.freeze({}), J(Object.create) && (tt.prototype = Object.create(Error.prototype), tt.prototype.constructor = tt), tt.prototype.toString = function() {
1624
1641
  let t2 = this.name + ": " + this.message;
1625
1642
  return J(this.stack) && (t2 += "\n" + this.stack.toString()), t2;
1626
1643
  }, tt.throwInstantiationError = function() {
@@ -1723,19 +1740,19 @@ it.fromDegrees = function(t2, s2, i2, e2, a2) {
1723
1740
  if (J(t2))
1724
1741
  return J(s2) ? (s2.west = t2.west, s2.south = t2.south, s2.east = t2.east, s2.north = t2.north, s2) : new it(t2.west, t2.south, t2.east, t2.north);
1725
1742
  }, it.southwest = function(t2, s2) {
1726
- return J(s2) ? (s2.x = t2.west, s2.y = t2.south, s2.z = 0, s2) : new _(t2.west, t2.south);
1743
+ return J(s2) ? (s2.x = t2.west, s2.y = t2.south, s2.z = 0, s2) : new u(t2.west, t2.south);
1727
1744
  }, it.northeast = function(t2, s2) {
1728
- return J(s2) ? (s2.x = t2.east, s2.y = t2.north, s2.z = 0, s2) : new _(t2.east, t2.north);
1745
+ return J(s2) ? (s2.x = t2.east, s2.y = t2.north, s2.z = 0, s2) : new u(t2.east, t2.north);
1729
1746
  }, it.southeast = function(t2, s2) {
1730
- return J(s2) ? (s2.x = t2.east, s2.y = t2.south, s2.z = 0, s2) : new _(t2.east, t2.south);
1747
+ return J(s2) ? (s2.x = t2.east, s2.y = t2.south, s2.z = 0, s2) : new u(t2.east, t2.south);
1731
1748
  }, it.northwest = function(t2, s2) {
1732
- return J(s2) ? (s2.x = t2.west, s2.y = t2.north, s2.z = 0, s2) : new _(t2.west, t2.north);
1749
+ return J(s2) ? (s2.x = t2.west, s2.y = t2.north, s2.z = 0, s2) : new u(t2.west, t2.north);
1733
1750
  }, it.center = function(t2, s2) {
1734
1751
  let i2 = t2.east;
1735
1752
  const e2 = t2.west;
1736
1753
  i2 < e2 && (i2 += st.TWO_PI);
1737
1754
  const a2 = st.negativePiToPi(0.5 * (e2 + i2)), n2 = 0.5 * (t2.south + t2.north);
1738
- return J(s2) ? (s2.x = a2, s2.y = n2, s2.z = 0, s2) : new _(a2, n2);
1755
+ return J(s2) ? (s2.x = a2, s2.y = n2, s2.z = 0, s2) : new u(a2, n2);
1739
1756
  }, it.contains = function(t2, s2) {
1740
1757
  let i2 = s2.x;
1741
1758
  const e2 = s2.y, a2 = t2.west;
@@ -1751,9 +1768,9 @@ it.fromBox = function(t2, s2, i2 = false) {
1751
1768
  let n2 = e2.x / 180 * Math.PI, r2 = e2.y / 180 * Math.PI, h2 = a2.x / 180 * Math.PI, o2 = a2.y / 180 * Math.PI;
1752
1769
  return i2 && (n2 < at && (n2 = -Math.PI), n2 > et && (n2 = Math.PI), r2 < rt && (r2 = -st.PI_OVER_TWO), r2 > nt && (r2 = st.PI_OVER_TWO), h2 > et && (h2 = Math.PI), h2 < at && (h2 = -Math.PI), o2 > nt && (o2 = st.PI_OVER_TWO), o2 < rt && (o2 = -st.PI_OVER_TWO)), J(s2) ? (s2.west = n2, s2.south = r2, s2.east = h2, s2.north = o2, s2) : new it(n2, r2, h2, o2);
1753
1770
  }, it.MAX_VALUE = Object.freeze(new it(-Math.PI, -st.PI_OVER_TWO, Math.PI, st.PI_OVER_TWO)), Object.freeze({}), Object.freeze(new D());
1754
- const ot = new _();
1755
- let ct = new _(), lt = new _();
1756
- const ut = new _(40680631590769, 40680631590769, 40408299984661445e-3), dt = new _(), mt = new _();
1771
+ const ot = new u();
1772
+ let ct = new u(), lt = new u();
1773
+ const ut = new u(40680631590769, 40680631590769, 40408299984661445e-3), dt = new u(), mt = new u();
1757
1774
  const __t = class {
1758
1775
  constructor() {
1759
1776
  __publicField(this, "COLUMN0ROW0", 0);
@@ -1777,34 +1794,34 @@ const __t = class {
1777
1794
  return t2 === s2 ? (t2.normalize(), t2) : (s2.copy(t2), s2.normalize(), s2);
1778
1795
  }
1779
1796
  static add(t2, s2, i2) {
1780
- return i2 || (i2 = new _()), i2.addVectors(t2, s2);
1797
+ return i2 || (i2 = new u()), i2.addVectors(t2, s2);
1781
1798
  }
1782
1799
  static dot(t2, s2) {
1783
1800
  return t2.dot(s2);
1784
1801
  }
1785
1802
  static cross(t2, s2, i2) {
1786
- return i2 || (i2 = new _()), i2.crossVectors(t2, s2), i2;
1803
+ return i2 || (i2 = new u()), i2.crossVectors(t2, s2), i2;
1787
1804
  }
1788
1805
  static magnitudeSquared(t2) {
1789
1806
  return t2.lengthSq();
1790
1807
  }
1791
1808
  static multiplyByScalar(t2, s2, i2) {
1792
- return i2 || (i2 = new _()), i2.copy(t2).multiplyScalar(s2), i2;
1809
+ return i2 || (i2 = new u()), i2.copy(t2).multiplyScalar(s2), i2;
1793
1810
  }
1794
1811
  static divideByScalar(t2, s2, i2) {
1795
- return i2 || (i2 = new _()), i2.x = t2.x / s2, i2.y = t2.y / s2, i2.z = t2.z / s2, i2;
1812
+ return i2 || (i2 = new u()), i2.x = t2.x / s2, i2.y = t2.y / s2, i2.z = t2.z / s2, i2;
1796
1813
  }
1797
1814
  static subtract(t2, s2, i2) {
1798
- return i2 || (i2 = new _()), i2.subVectors(t2, s2), i2;
1815
+ return i2 || (i2 = new u()), i2.subVectors(t2, s2), i2;
1799
1816
  }
1800
1817
  static distance(t2, s2) {
1801
1818
  return t2.distanceTo(s2);
1802
1819
  }
1803
1820
  static negate(t2, s2) {
1804
- return s2 || (s2 = new _()), s2.copy(t2), s2.negate(), s2;
1821
+ return s2 || (s2 = new u()), s2.copy(t2), s2.negate(), s2;
1805
1822
  }
1806
1823
  static multiplyComponents(t2, s2, i2) {
1807
- return i2 || (i2 = new _()), i2.multiplyVectors(t2, s2), i2;
1824
+ return i2 || (i2 = new u()), i2.multiplyVectors(t2, s2), i2;
1808
1825
  }
1809
1826
  static magnitude(t2) {
1810
1827
  return t2.length();
@@ -1813,17 +1830,17 @@ const __t = class {
1813
1830
  return t2 === s2 || J(t2) && J(s2) && st.equalsEpsilon(t2.x, s2.x, i2, e2) && st.equalsEpsilon(t2.y, s2.y, i2, e2) && st.equalsEpsilon(t2.z, s2.z, i2, e2);
1814
1831
  }
1815
1832
  static fromCartesian4(t2, s2) {
1816
- return s2 || (s2 = new _()), s2.set(t2.x, t2.y, t2.z), s2;
1833
+ return s2 || (s2 = new u()), s2.set(t2.x, t2.y, t2.z), s2;
1817
1834
  }
1818
1835
  static fromElements(t2, s2, i2, e2) {
1819
- return e2 || (e2 = new _()), e2.set(t2, s2, i2), e2;
1836
+ return e2 || (e2 = new u()), e2.set(t2, s2, i2), e2;
1820
1837
  }
1821
1838
  static fromRadians(t2, s2, i2, e2, a2) {
1822
1839
  i2 = $(i2, 0);
1823
1840
  const n2 = J(e2) ? e2.radiiSquared : ut, r2 = Math.cos(s2);
1824
1841
  ct.x = r2 * Math.cos(t2), ct.y = r2 * Math.sin(t2), ct.z = Math.sin(s2), ct = __t.normalize(ct, ct), __t.multiplyComponents(n2, ct, lt);
1825
1842
  const h2 = Math.sqrt(__t.dot(ct, lt));
1826
- return lt = __t.divideByScalar(lt, h2, lt), ct = __t.multiplyByScalar(ct, i2, ct), J(a2) || (a2 = new _()), __t.add(lt, ct, a2);
1843
+ return lt = __t.divideByScalar(lt, h2, lt), ct = __t.multiplyByScalar(ct, i2, ct), J(a2) || (a2 = new u()), __t.add(lt, ct, a2);
1827
1844
  }
1828
1845
  static angleBetween(t2, s2) {
1829
1846
  __t.normalize(t2, dt), __t.normalize(s2, mt);
@@ -1835,10 +1852,10 @@ const __t = class {
1835
1852
  }
1836
1853
  };
1837
1854
  let _t = __t;
1838
- __publicField(_t, "ZERO", Object.freeze(new _()));
1839
- __publicField(_t, "UNIT_X", Object.freeze(new _(1, 0, 0)));
1840
- __publicField(_t, "UNIT_Y", Object.freeze(new _(0, 1, 0)));
1841
- __publicField(_t, "UNIT_Z", Object.freeze(new _(0, 0, 1)));
1855
+ __publicField(_t, "ZERO", Object.freeze(new u()));
1856
+ __publicField(_t, "UNIT_X", Object.freeze(new u(1, 0, 0)));
1857
+ __publicField(_t, "UNIT_Y", Object.freeze(new u(0, 1, 0)));
1858
+ __publicField(_t, "UNIT_Z", Object.freeze(new u(0, 0, 1)));
1842
1859
  __publicField(_t, "abs", function(t2, s2) {
1843
1860
  return s2.x = Math.abs(t2.x), s2.y = Math.abs(t2.y), s2.z = Math.abs(t2.z), s2;
1844
1861
  });
@@ -1879,8 +1896,8 @@ const ft = { clipTriangleAtAxisAlignedThreshold: function(t2, s2, i2, e2, a2, n2
1879
1896
  throw new tt("x3 is required.");
1880
1897
  if (!ht(h2))
1881
1898
  throw new tt("y3 is required.");
1882
- const c2 = i2 - r2, l2 = r2 - a2, u2 = n2 - h2, d2 = e2 - h2, m2 = 1 / (u2 * c2 + l2 * d2), f2 = s2 - h2, y2 = t2 - r2, p2 = (u2 * y2 + l2 * f2) * m2, M2 = (-d2 * y2 + c2 * f2) * m2, g2 = 1 - p2 - M2;
1883
- return ht(o2) ? (o2.x = p2, o2.y = M2, o2.z = g2, o2) : new _(p2, M2, g2);
1899
+ const c2 = i2 - r2, l2 = r2 - a2, d2 = n2 - h2, m2 = e2 - h2, _2 = 1 / (d2 * c2 + l2 * m2), f2 = s2 - h2, y2 = t2 - r2, p2 = (d2 * y2 + l2 * f2) * _2, g2 = (-m2 * y2 + c2 * f2) * _2, M2 = 1 - p2 - g2;
1900
+ return ht(o2) ? (o2.x = p2, o2.y = g2, o2.z = M2, o2) : new u(p2, g2, M2);
1884
1901
  }, computeLineSegmentLineSegmentIntersection: function(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
1885
1902
  const l2 = (h2 - n2) * (i2 - t2) - (r2 - a2) * (e2 - s2);
1886
1903
  if (0 === l2)
@@ -1932,9 +1949,9 @@ const ft = { clipTriangleAtAxisAlignedThreshold: function(t2, s2, i2, e2, a2, n2
1932
1949
  throw new tt("array must be a Uint8Array, Uint16Array, or Uint32Array.");
1933
1950
  } };
1934
1951
  var pt = Object.freeze(yt);
1935
- const Mt = "EPSG:4326", gt = "EPSG:3857", xt = "EPSG:4978", wt = "BD:MERCATOR", St = "SCREEN_PIXEL", Et = new p(new _(-180, -90, -100), new _(180, 90, 100));
1952
+ const gt = "EPSG:4326", Mt = "EPSG:3857", xt = "EPSG:4978", wt = "BD:MERCATOR", St = "SCREEN_PIXEL", Et = new p(new u(-180, -90, -100), new u(180, 90, 100));
1936
1953
  Et.isDefault = true, Object.freeze(Et), Object.freeze(Et.min), Object.freeze(Et.max);
1937
- const bt = new _(), Pt = new _(), vt = 1, At = 2, Gt = 3;
1954
+ const bt = new u(), Pt = new u(), vt = 1, At = 2, Gt = 3;
1938
1955
  class Ct {
1939
1956
  constructor() {
1940
1957
  __publicField(this, "isProjection", true);
@@ -1958,10 +1975,10 @@ class Ct {
1958
1975
  return s2;
1959
1976
  }
1960
1977
  getGeodeticSurfaceNormal(t2, s2) {
1961
- return s2 || (s2 = new _()), s2.set(0, 0, 1), s2;
1978
+ return s2 || (s2 = new u()), s2.set(0, 0, 1), s2;
1962
1979
  }
1963
1980
  getProjectedSurfaceNormal(t2, s2) {
1964
- return s2 || (s2 = new _()), s2.set(0, 0, 1), s2;
1981
+ return s2 || (s2 = new u()), s2.set(0, 0, 1), s2;
1965
1982
  }
1966
1983
  projectedBoxToGeoBox(t2, s2, i2 = true) {
1967
1984
  return s2 || (s2 = new p()), this.unprojectCoordinate(t2.min, s2.min, i2), this.unprojectCoordinate(t2.max, s2.max, i2), s2;
@@ -2002,7 +2019,7 @@ const Lt = [0, 0], Bt = [0, 0];
2002
2019
  class kt extends Ct {
2003
2020
  constructor() {
2004
2021
  super(...arguments);
2005
- __publicField(this, "name", gt);
2022
+ __publicField(this, "name", Mt);
2006
2023
  __publicField(this, "isAxisAligned", true);
2007
2024
  }
2008
2025
  projectCoordinate(t2, s2, i2 = false) {
@@ -2012,39 +2029,39 @@ class kt extends Ct {
2012
2029
  const n2 = s3 || [0, 0];
2013
2030
  return n2[0] = Tt * a2 * zt, n2[1] = Tt * Math.log(Math.tan(0.25 * Math.PI + 0.5 * t3[1] * zt)), i3 ? (n2[0] = It(t3[0], n2[0], 180, Ot), n2[1] = It(t3[1], n2[1], qt, Ot)) : (n2[0] > Ot && (n2[0] = Ot), n2[0] < -20037508 && (n2[0] = -20037508), n2[1] > Ot && (n2[1] = Ot), n2[1] < -20037508 && (n2[1] = -20037508)), n2;
2014
2031
  }(Bt, Lt, i2);
2015
- return s2 || (s2 = new _()), s2.x = e2[0], s2.y = e2[1], s2.z = t2.z, s2;
2032
+ return s2 || (s2 = new u()), s2.x = e2[0], s2.y = e2[1], s2.z = t2.z, s2;
2016
2033
  }
2017
2034
  unprojectCoordinate(t2, s2, i2 = false) {
2018
2035
  const e2 = function(t3, s3, i3 = false) {
2019
2036
  const e3 = s3 || [0, 0];
2020
2037
  return e3[0] = t3[0] * Rt / Tt, e3[1] = (0.5 * Math.PI - 2 * Math.atan(Math.exp(-t3[1] / Tt))) * Rt, i3 && (e3[0] = Nt(t3[0], e3[0], 180, Ot), e3[1] = Nt(t3[1], e3[1], qt, Ot)), e3;
2021
2038
  }([t2.x, t2.y], Lt, i2);
2022
- return s2 || (s2 = new _()), s2.x = e2[0], s2.y = e2[1], s2.z = t2.z, s2;
2039
+ return s2 || (s2 = new u()), s2.x = e2[0], s2.y = e2[1], s2.z = t2.z, s2;
2023
2040
  }
2024
2041
  }
2025
- const Dt = new _(), Ut = new _();
2042
+ const Dt = new u(), Ut = new u();
2026
2043
  function jt(t2, s2, i2, e2, a2) {
2027
- const n2 = t2.x, r2 = t2.y, h2 = t2.z, o2 = s2.x, c2 = s2.y, l2 = s2.z, u2 = n2 * n2 * o2 * o2, d2 = r2 * r2 * c2 * c2, m2 = h2 * h2 * l2 * l2, f2 = u2 + d2 + m2, y2 = Math.sqrt(1 / f2), p2 = Dt.copy(t2).multiplyScalar(y2);
2044
+ const n2 = t2.x, r2 = t2.y, h2 = t2.z, o2 = s2.x, c2 = s2.y, l2 = s2.z, d2 = n2 * n2 * o2 * o2, m2 = r2 * r2 * c2 * c2, _2 = h2 * h2 * l2 * l2, f2 = d2 + m2 + _2, y2 = Math.sqrt(1 / f2), p2 = Dt.copy(t2).multiplyScalar(y2);
2028
2045
  if (f2 < e2)
2029
- return a2 || (a2 = new _()), isFinite(y2) ? a2.copy(p2) : void 0;
2030
- const M2 = i2.x, g2 = i2.y, x2 = i2.z, w2 = Ut;
2031
- w2.x = p2.x * M2 * 2, w2.y = p2.y * g2 * 2, w2.z = p2.z * x2 * 2;
2046
+ return a2 || (a2 = new u()), isFinite(y2) ? a2.copy(p2) : void 0;
2047
+ const g2 = i2.x, M2 = i2.y, x2 = i2.z, w2 = Ut;
2048
+ w2.x = p2.x * g2 * 2, w2.y = p2.y * M2 * 2, w2.z = p2.z * x2 * 2;
2032
2049
  let S2, E2, b2, P2, v2, A2, G2, C2, N2, I2, z2, T2 = (1 - y2) * t2.length() / (0.5 * w2.length()), O2 = 0;
2033
2050
  do {
2034
- T2 -= O2, b2 = 1 / (1 + T2 * M2), P2 = 1 / (1 + T2 * g2), v2 = 1 / (1 + T2 * x2), A2 = b2 * b2, G2 = P2 * P2, C2 = v2 * v2, N2 = A2 * b2, I2 = G2 * P2, z2 = C2 * v2, S2 = u2 * A2 + d2 * G2 + m2 * C2 - 1, E2 = u2 * N2 * M2 + d2 * I2 * g2 + m2 * z2 * x2, O2 = S2 / (-2 * E2);
2051
+ T2 -= O2, b2 = 1 / (1 + T2 * g2), P2 = 1 / (1 + T2 * M2), v2 = 1 / (1 + T2 * x2), A2 = b2 * b2, G2 = P2 * P2, C2 = v2 * v2, N2 = A2 * b2, I2 = G2 * P2, z2 = C2 * v2, S2 = d2 * A2 + m2 * G2 + _2 * C2 - 1, E2 = d2 * N2 * g2 + m2 * I2 * M2 + _2 * z2 * x2, O2 = S2 / (-2 * E2);
2035
2052
  } while (Math.abs(S2) > 1e-12);
2036
- return a2 ? (a2.x = n2 * b2, a2.y = r2 * P2, a2.z = h2 * v2, a2) : new _(n2 * b2, r2 * P2, h2 * v2);
2053
+ return a2 ? (a2.x = n2 * b2, a2.y = r2 * P2, a2.z = h2 * v2, a2) : new u(n2 * b2, r2 * P2, h2 * v2);
2037
2054
  }
2038
- const Ft = new _(), Vt = new _();
2055
+ const Ft = new u(), Vt = new u();
2039
2056
  class Wt {
2040
2057
  constructor(t2, s2, i2) {
2041
- this._radii = new _(t2, s2, i2), this._radiiSquared = new _(t2 * t2, s2 * s2, i2 * i2), this._radiiToTheFourth = new _(t2 * t2 * t2 * t2, s2 * s2 * s2 * s2, i2 * i2 * i2 * i2), this._oneOverRadii = new _(0 === t2 ? 0 : 1 / t2, 0 === s2 ? 0 : 1 / s2, 0 === i2 ? 0 : 1 / i2), this._oneOverRadiiSquared = new _(0 === t2 ? 0 : 1 / (t2 * t2), 0 === s2 ? 0 : 1 / (s2 * s2), 0 === i2 ? 0 : 1 / (i2 * i2)), this._minimumRadius = Math.min(t2, s2, i2), this._maximumRadius = Math.max(t2, s2, i2), this._centerToleranceSquared = 0.1, 0 !== this._radiiSquared.z && (this._squaredXOverSquaredZ = this._radiiSquared.x / this._radiiSquared.z);
2058
+ this._radii = new u(t2, s2, i2), this._radiiSquared = new u(t2 * t2, s2 * s2, i2 * i2), this._radiiToTheFourth = new u(t2 * t2 * t2 * t2, s2 * s2 * s2 * s2, i2 * i2 * i2 * i2), this._oneOverRadii = new u(0 === t2 ? 0 : 1 / t2, 0 === s2 ? 0 : 1 / s2, 0 === i2 ? 0 : 1 / i2), this._oneOverRadiiSquared = new u(0 === t2 ? 0 : 1 / (t2 * t2), 0 === s2 ? 0 : 1 / (s2 * s2), 0 === i2 ? 0 : 1 / (i2 * i2)), this._minimumRadius = Math.min(t2, s2, i2), this._maximumRadius = Math.max(t2, s2, i2), this._centerToleranceSquared = 0.1, 0 !== this._radiiSquared.z && (this._squaredXOverSquaredZ = this._radiiSquared.x / this._radiiSquared.z);
2042
2059
  }
2043
2060
  static fromCartesian3(t2) {
2044
2061
  return new Wt(t2.x, t2.y, t2.z);
2045
2062
  }
2046
2063
  geodeticSurfaceNormalCartographic(t2, s2) {
2047
- s2 || (s2 = new _());
2064
+ s2 || (s2 = new u());
2048
2065
  const i2 = t2.x, e2 = t2.y, a2 = Math.cos(e2), n2 = a2 * Math.cos(i2), r2 = a2 * Math.sin(i2), h2 = Math.sin(e2);
2049
2066
  return s2.set(n2, r2, h2), s2.normalize(), s2;
2050
2067
  }
@@ -2053,7 +2070,7 @@ class Wt {
2053
2070
  }
2054
2071
  cartographicToCartesian(t2, s2) {
2055
2072
  const i2 = this.geodeticSurfaceNormalCartographic(t2);
2056
- s2 || (s2 = new _()), s2.multiplyVectors(this._radiiSquared, i2);
2073
+ s2 || (s2 = new u()), s2.multiplyVectors(this._radiiSquared, i2);
2057
2074
  const e2 = Math.sqrt(i2.clone().dot(s2));
2058
2075
  return s2.divideScalar(e2), i2.multiplyScalar(t2.z), s2.add(i2), s2;
2059
2076
  }
@@ -2066,7 +2083,7 @@ class Wt {
2066
2083
  return jt(t2, this._oneOverRadii, this._oneOverRadiiSquared, this._centerToleranceSquared, s2);
2067
2084
  }
2068
2085
  scaleToGeocentricSurface(t2, s2) {
2069
- s2 || (s2 = new _());
2086
+ s2 || (s2 = new u());
2070
2087
  const i2 = t2.x, e2 = t2.y, a2 = t2.z, n2 = this._oneOverRadiiSquared, r2 = 1 / Math.sqrt(i2 * i2 * n2.x + e2 * e2 * n2.y + a2 * a2 * n2.z);
2071
2088
  return s2.copy(t2).multiplyScalar(r2);
2072
2089
  }
@@ -2077,15 +2094,15 @@ class Wt {
2077
2094
  const e2 = this.geodeticSurfaceNormal(i2), a2 = t2.clone();
2078
2095
  a2.sub(i2);
2079
2096
  const n2 = Math.atan2(e2.y, e2.x), r2 = Math.asin(e2.z), h2 = Math.sign(a2.dot(t2)) * a2.length();
2080
- return s2 || (s2 = new _()), s2.set(n2, r2, h2), s2;
2097
+ return s2 || (s2 = new u()), s2.set(n2, r2, h2), s2;
2081
2098
  }
2082
2099
  geodeticSurfaceNormal(t2, s2) {
2083
- return J(s2) || (s2 = new _()), s2.multiplyVectors(t2, this._oneOverRadiiSquared), s2.normalize(), s2;
2100
+ return J(s2) || (s2 = new u()), s2.multiplyVectors(t2, this._oneOverRadiiSquared), s2.normalize(), s2;
2084
2101
  }
2085
2102
  getSurfaceNormalIntersectionWithZAxis(t2, s2, i2) {
2086
2103
  s2 = $(s2, 0);
2087
2104
  const e2 = this._squaredXOverSquaredZ;
2088
- if (J(i2) || (i2 = new _()), i2.x = 0, i2.y = 0, i2.z = t2.z * (1 - e2), !(Math.abs(i2.z) >= this._radii.z - s2))
2105
+ if (J(i2) || (i2 = new u()), i2.x = 0, i2.y = 0, i2.z = t2.z * (1 - e2), !(Math.abs(i2.z) >= this._radii.z - s2))
2089
2106
  return i2;
2090
2107
  }
2091
2108
  transformPositionToScaledSpace(t2, s2) {
@@ -2122,67 +2139,67 @@ class Wt {
2122
2139
  Wt.WGS84 = Object.freeze(new Wt(6378137, 6378137, 6356752314245179e-9));
2123
2140
  class Ht {
2124
2141
  static fromQuaternion(t2, s2) {
2125
- const i2 = t2.x * t2.x, e2 = t2.x * t2.y, a2 = t2.x * t2.z, n2 = t2.x * t2.w, r2 = t2.y * t2.y, h2 = t2.y * t2.z, o2 = t2.y * t2.w, c2 = t2.z * t2.z, u2 = t2.z * t2.w, d2 = t2.w * t2.w, m2 = i2 - r2 - c2 + d2, _2 = 2 * (e2 - u2), f2 = 2 * (a2 + o2), y2 = 2 * (e2 + u2), p2 = -i2 + r2 - c2 + d2, M2 = 2 * (h2 - n2), g2 = 2 * (a2 - o2), x2 = 2 * (h2 + n2), w2 = -i2 - r2 + c2 + d2;
2126
- return s2 || (s2 = new l()), s2.set(m2, _2, f2, y2, p2, M2, g2, x2, w2), s2;
2142
+ const i2 = t2.x * t2.x, e2 = t2.x * t2.y, a2 = t2.x * t2.z, n2 = t2.x * t2.w, r2 = t2.y * t2.y, h2 = t2.y * t2.z, o2 = t2.y * t2.w, c2 = t2.z * t2.z, l2 = t2.z * t2.w, u2 = t2.w * t2.w, d2 = i2 - r2 - c2 + u2, m2 = 2 * (e2 - l2), f2 = 2 * (a2 + o2), y2 = 2 * (e2 + l2), p2 = -i2 + r2 - c2 + u2, g2 = 2 * (h2 - n2), M2 = 2 * (a2 - o2), x2 = 2 * (h2 + n2), w2 = -i2 - r2 + c2 + u2;
2143
+ return s2 || (s2 = new _()), s2.set(d2, m2, f2, y2, p2, g2, M2, x2, w2), s2;
2127
2144
  }
2128
2145
  static getColumn(t2, s2, i2) {
2129
2146
  const e2 = t2.elements, a2 = 3 * s2, n2 = e2[a2], r2 = e2[a2 + 1], h2 = e2[a2 + 2];
2130
2147
  return i2.x = n2, i2.y = r2, i2.z = h2, i2;
2131
2148
  }
2132
2149
  static multiplyByVector(t2, s2, i2) {
2133
- return i2 || (i2 = new _()), i2.copy(s2), i2.applyMatrix3(t2), i2;
2150
+ return i2 || (i2 = new u()), i2.copy(s2), i2.applyMatrix3(t2), i2;
2134
2151
  }
2135
2152
  static multiplyByScale(t2, s2, i2) {
2136
- i2 || (i2 = new l());
2153
+ i2 || (i2 = new _());
2137
2154
  const e2 = i2.elements, a2 = t2.elements;
2138
2155
  return e2[0] = a2[0] * s2.x, e2[1] = a2[1] * s2.x, e2[2] = a2[2] * s2.x, e2[3] = a2[3] * s2.y, e2[4] = a2[4] * s2.y, e2[5] = a2[5] * s2.y, e2[6] = a2[6] * s2.z, e2[7] = a2[7] * s2.z, e2[8] = a2[8] * s2.z, i2;
2139
2156
  }
2140
2157
  static transpose(t2, s2) {
2141
- return s2 || (s2 = new l()), s2.copy(t2).transpose(), s2;
2158
+ return s2 || (s2 = new _()), s2.copy(t2).transpose(), s2;
2142
2159
  }
2143
2160
  static fromScale(t2, s2) {
2144
- s2 || (s2 = new l());
2161
+ s2 || (s2 = new _());
2145
2162
  const i2 = s2.elements;
2146
2163
  return i2[0] = t2.x, i2[1] = 0, i2[2] = 0, i2[3] = 0, i2[4] = t2.y, i2[5] = 0, i2[6] = 0, i2[7] = 0, i2[8] = t2.z, s2;
2147
2164
  }
2148
2165
  static multiply(t2, s2, i2) {
2149
- i2 || (i2 = new l());
2150
- const e2 = t2.elements, a2 = s2.elements, n2 = i2.elements, r2 = e2[0], h2 = e2[3], o2 = e2[6], c2 = e2[1], u2 = e2[4], d2 = e2[7], m2 = e2[2], _2 = e2[5], f2 = e2[8], y2 = a2[0], p2 = a2[3], M2 = a2[6], g2 = a2[1], x2 = a2[4], w2 = a2[7], S2 = a2[2], E2 = a2[5], b2 = a2[8];
2151
- return n2[0] = r2 * y2 + h2 * g2 + o2 * S2, n2[3] = r2 * p2 + h2 * x2 + o2 * E2, n2[6] = r2 * M2 + h2 * w2 + o2 * b2, n2[1] = c2 * y2 + u2 * g2 + d2 * S2, n2[4] = c2 * p2 + u2 * x2 + d2 * E2, n2[7] = c2 * M2 + u2 * w2 + d2 * b2, n2[2] = m2 * y2 + _2 * g2 + f2 * S2, n2[5] = m2 * p2 + _2 * x2 + f2 * E2, n2[8] = m2 * M2 + _2 * w2 + f2 * b2, i2;
2166
+ i2 || (i2 = new _());
2167
+ const e2 = t2.elements, a2 = s2.elements, n2 = i2.elements, r2 = e2[0], h2 = e2[3], o2 = e2[6], c2 = e2[1], l2 = e2[4], u2 = e2[7], d2 = e2[2], m2 = e2[5], f2 = e2[8], y2 = a2[0], p2 = a2[3], g2 = a2[6], M2 = a2[1], x2 = a2[4], w2 = a2[7], S2 = a2[2], E2 = a2[5], b2 = a2[8];
2168
+ return n2[0] = r2 * y2 + h2 * M2 + o2 * S2, n2[3] = r2 * p2 + h2 * x2 + o2 * E2, n2[6] = r2 * g2 + h2 * w2 + o2 * b2, n2[1] = c2 * y2 + l2 * M2 + u2 * S2, n2[4] = c2 * p2 + l2 * x2 + u2 * E2, n2[7] = c2 * g2 + l2 * w2 + u2 * b2, n2[2] = d2 * y2 + m2 * M2 + f2 * S2, n2[5] = d2 * p2 + m2 * x2 + f2 * E2, n2[8] = d2 * g2 + m2 * w2 + f2 * b2, i2;
2152
2169
  }
2153
2170
  static clone(t2, s2) {
2154
2171
  if (J(t2))
2155
- return J(s2) ? (s2.clone(t2), s2) : new l(t2[0], t2[3], t2[6], t2[1], t2[4], t2[7], t2[2], t2[5], t2[8]);
2172
+ return J(s2) ? (s2.clone(t2), s2) : new _(t2[0], t2[3], t2[6], t2[1], t2[4], t2[7], t2[2], t2[5], t2[8]);
2156
2173
  }
2157
2174
  static setColumn(t2, s2, i2, e2) {
2158
2175
  const a2 = (e2 = Ht.clone(t2, e2)).elements, n2 = 3 * s2;
2159
2176
  return a2[n2] = i2.x, a2[n2 + 1] = i2.y, a2[n2 + 2] = i2.z, e2;
2160
2177
  }
2161
2178
  }
2162
- Ht.ZERO = l.ZERO = Object.freeze(new l(0, 0, 0, 0, 0, 0, 0, 0, 0)), Ht.COLUMN0ROW0 = 0, Ht.COLUMN0ROW1 = 1, Ht.COLUMN0ROW2 = 2, Ht.COLUMN1ROW0 = 3, Ht.COLUMN1ROW1 = 4, Ht.COLUMN1ROW2 = 5, Ht.COLUMN2ROW0 = 6, Ht.COLUMN2ROW1 = 7, Ht.COLUMN2ROW2 = 8;
2163
- const Zt = new _(), Qt = new _(), Xt = new _(), Yt = new _(1 / 6378137, 1 / 6378137, 1 / 6356752314245179e-9), Kt = new _(1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661445e-3), Jt = st.EPSILON1;
2179
+ Ht.ZERO = _.ZERO = Object.freeze(new _(0, 0, 0, 0, 0, 0, 0, 0, 0)), Ht.COLUMN0ROW0 = 0, Ht.COLUMN0ROW1 = 1, Ht.COLUMN0ROW2 = 2, Ht.COLUMN1ROW0 = 3, Ht.COLUMN1ROW1 = 4, Ht.COLUMN1ROW2 = 5, Ht.COLUMN2ROW0 = 6, Ht.COLUMN2ROW1 = 7, Ht.COLUMN2ROW2 = 8;
2180
+ const Xt = new u(), Yt = new u(), Zt = new u(), Qt = new u(1 / 6378137, 1 / 6378137, 1 / 6356752314245179e-9), Kt = new u(1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661445e-3), Jt = st.EPSILON1;
2164
2181
  const _$t = class {
2165
2182
  static fromRadians(t2, s2, i2, e2) {
2166
- return i2 = $(i2, 0), J(e2) ? (e2.x = t2, e2.y = s2, e2.z = i2, e2) : new _(t2, s2, i2);
2183
+ return i2 = $(i2, 0), J(e2) ? (e2.x = t2, e2.y = s2, e2.z = i2, e2) : new u(t2, s2, i2);
2167
2184
  }
2168
2185
  static fromDegrees(t2, s2, i2, e2) {
2169
2186
  return t2 = st.toRadians(t2), s2 = st.toRadians(s2), _$t.fromRadians(t2, s2, i2, e2);
2170
2187
  }
2171
2188
  static fromCartesian(t2, s2, i2) {
2172
- const e2 = J(s2) ? s2.oneOverRadii : Yt, a2 = J(s2) ? s2.oneOverRadiiSquared : Kt, n2 = jt(t2, e2, a2, J(s2) ? s2._centerToleranceSquared : Jt, Qt);
2189
+ const e2 = J(s2) ? s2.oneOverRadii : Qt, a2 = J(s2) ? s2.oneOverRadiiSquared : Kt, n2 = jt(t2, e2, a2, J(s2) ? s2._centerToleranceSquared : Jt, Yt);
2173
2190
  if (!J(n2))
2174
2191
  return;
2175
- let r2 = _t.multiplyComponents(n2, a2, Zt);
2192
+ let r2 = _t.multiplyComponents(n2, a2, Xt);
2176
2193
  r2 = _t.normalize(r2, r2);
2177
- const h2 = _t.subtract(t2, n2, Xt), o2 = Math.atan2(r2.y, r2.x), c2 = Math.asin(r2.z), l2 = st.sign(_t.dot(h2, t2)) * _t.magnitude(h2);
2178
- return J(i2) ? (i2.x = o2, i2.y = c2, i2.z = l2, i2) : new _(o2, c2, l2);
2194
+ const h2 = _t.subtract(t2, n2, Zt), o2 = Math.atan2(r2.y, r2.x), c2 = Math.asin(r2.z), l2 = st.sign(_t.dot(h2, t2)) * _t.magnitude(h2);
2195
+ return J(i2) ? (i2.x = o2, i2.y = c2, i2.z = l2, i2) : new u(o2, c2, l2);
2179
2196
  }
2180
2197
  static toCartesian(t2, s2, i2) {
2181
2198
  return _t.fromRadians(t2.x, t2.y, t2.z, s2, i2);
2182
2199
  }
2183
2200
  static clone(t2, s2) {
2184
2201
  if (J(t2))
2185
- return J(s2) ? (s2.x = t2.x, s2.y = t2.y, s2.z = t2.z, s2) : new _(t2.x, t2.y, t2.z);
2202
+ return J(s2) ? (s2.x = t2.x, s2.y = t2.y, s2.z = t2.z, s2) : new u(t2.x, t2.y, t2.z);
2186
2203
  }
2187
2204
  static equals(t2, s2) {
2188
2205
  return t2 === s2 || J(t2) && J(s2) && t2.x === s2.x && t2.y === s2.y && t2.z === s2.z;
@@ -2193,12 +2210,12 @@ const _$t = class {
2193
2210
  };
2194
2211
  let $t = _$t;
2195
2212
  __publicField($t, "fromRadians", function(t2, s2, i2, e2) {
2196
- return i2 = $(i2, 0), J(e2) ? (e2.x = t2, e2.y = s2, e2.z = i2, e2) : new _(t2, s2, i2);
2213
+ return i2 = $(i2, 0), J(e2) ? (e2.x = t2, e2.y = s2, e2.z = i2, e2) : new u(t2, s2, i2);
2197
2214
  });
2198
2215
  __publicField($t, "fromDegrees", function(t2, s2, i2, e2) {
2199
2216
  return t2 = st.toRadians(t2), s2 = st.toRadians(s2), _$t.fromRadians(t2, s2, i2, e2);
2200
2217
  });
2201
- __publicField($t, "ZERO", Object.freeze(new _(0, 0, 0)));
2218
+ __publicField($t, "ZERO", Object.freeze(new u(0, 0, 0)));
2202
2219
  const ts = new c(), ss = new c();
2203
2220
  const _is = class {
2204
2221
  static clone(t2, s2) {
@@ -2241,13 +2258,13 @@ const _is = class {
2241
2258
  let is = _is;
2242
2259
  __publicField(is, "ZERO", new c());
2243
2260
  is.fromCartesian3 = is.clone, is.fromCartesian4 = is.clone;
2244
- let es = new m(), as = new m(), ns = new m(), rs = new m(), hs = new _();
2261
+ let es = new l(), as = new l(), ns = new l(), rs = new l(), hs = new u();
2245
2262
  class os {
2246
2263
  static fromAxisAngle(t2, s2, i2) {
2247
- return i2 || (i2 = new m()), hs.copy(t2), hs.normalize(), i2.setFromAxisAngle(hs, s2), i2;
2264
+ return i2 || (i2 = new l()), hs.copy(t2), hs.normalize(), i2.setFromAxisAngle(hs, s2), i2;
2248
2265
  }
2249
2266
  static multiply(t2, s2, i2) {
2250
- return i2 || (i2 = new m()), i2.multiplyQuaternions(t2, s2), i2;
2267
+ return i2 || (i2 = new l()), i2.multiplyQuaternions(t2, s2), i2;
2251
2268
  }
2252
2269
  static fromHeadingPitchRoll(t2, s2) {
2253
2270
  return rs = os.fromAxisAngle(_t.UNIT_X, t2.roll, es), ns = os.fromAxisAngle(_t.UNIT_Y, -t2.pitch, s2), s2 = os.multiply(ns, rs, ns), as = os.fromAxisAngle(_t.UNIT_Z, -t2.heading, es), os.multiply(as, s2, s2);
@@ -2279,7 +2296,7 @@ class cs {
2279
2296
  return t2.equals(s2);
2280
2297
  }
2281
2298
  static multiplyByVector(t2, s2, i2) {
2282
- return i2 || (i2 = new d()), i2.copy(s2), i2.applyMatrix4(t2), i2;
2299
+ return i2 || (i2 = new y()), i2.copy(s2), i2.applyMatrix4(t2), i2;
2283
2300
  }
2284
2301
  static getColumn(t2, s2, i2) {
2285
2302
  const e2 = t2.elements, a2 = 4 * s2, n2 = e2[a2], r2 = e2[a2 + 1], h2 = e2[a2 + 2], o2 = e2[a2 + 3];
@@ -2287,19 +2304,19 @@ class cs {
2287
2304
  }
2288
2305
  static fromTranslationQuaternionRotationScale(t2, s2, i2, e2) {
2289
2306
  e2 || (e2 = new D());
2290
- const a2 = i2.x, n2 = i2.y, r2 = i2.z, h2 = s2.x * s2.x, o2 = s2.x * s2.y, c2 = s2.x * s2.z, l2 = s2.x * s2.w, u2 = s2.y * s2.y, d2 = s2.y * s2.z, m2 = s2.y * s2.w, _2 = s2.z * s2.z, f2 = s2.z * s2.w, y2 = s2.w * s2.w, p2 = h2 - u2 - _2 + y2, M2 = 2 * (o2 - f2), g2 = 2 * (c2 + m2), x2 = 2 * (o2 + f2), w2 = -h2 + u2 - _2 + y2, S2 = 2 * (d2 - l2), E2 = 2 * (c2 - m2), b2 = 2 * (d2 + l2), P2 = -h2 - u2 + _2 + y2, v2 = e2.elements;
2291
- return v2[0] = p2 * a2, v2[1] = x2 * a2, v2[2] = E2 * a2, v2[3] = 0, v2[4] = M2 * n2, v2[5] = w2 * n2, v2[6] = b2 * n2, v2[7] = 0, v2[8] = g2 * r2, v2[9] = S2 * r2, v2[10] = P2 * r2, v2[11] = 0, v2[12] = t2.x, v2[13] = t2.y, v2[14] = t2.z, v2[15] = 1, e2;
2307
+ const a2 = i2.x, n2 = i2.y, r2 = i2.z, h2 = s2.x * s2.x, o2 = s2.x * s2.y, c2 = s2.x * s2.z, l2 = s2.x * s2.w, u2 = s2.y * s2.y, d2 = s2.y * s2.z, m2 = s2.y * s2.w, _2 = s2.z * s2.z, f2 = s2.z * s2.w, y2 = s2.w * s2.w, p2 = h2 - u2 - _2 + y2, g2 = 2 * (o2 - f2), M2 = 2 * (c2 + m2), x2 = 2 * (o2 + f2), w2 = -h2 + u2 - _2 + y2, S2 = 2 * (d2 - l2), E2 = 2 * (c2 - m2), b2 = 2 * (d2 + l2), P2 = -h2 - u2 + _2 + y2, v2 = e2.elements;
2308
+ return v2[0] = p2 * a2, v2[1] = x2 * a2, v2[2] = E2 * a2, v2[3] = 0, v2[4] = g2 * n2, v2[5] = w2 * n2, v2[6] = b2 * n2, v2[7] = 0, v2[8] = M2 * r2, v2[9] = S2 * r2, v2[10] = P2 * r2, v2[11] = 0, v2[12] = t2.x, v2[13] = t2.y, v2[14] = t2.z, v2[15] = 1, e2;
2292
2309
  }
2293
2310
  }
2294
2311
  __publicField(cs, "IDENTITY", Object.freeze(new D()));
2295
2312
  cs.ZERO = Object.freeze(new D(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
2296
- const ls = {}, us = new m(), ds = new _(1, 1, 1), ms = new D(), _s = { up: { south: "east", north: "west", west: "south", east: "north" }, down: { south: "west", north: "east", west: "north", east: "south" }, south: { up: "west", down: "east", west: "down", east: "up" }, north: { up: "east", down: "west", west: "up", east: "down" }, west: { up: "north", down: "south", north: "down", south: "up" }, east: { up: "south", down: "north", north: "up", south: "down" } };
2297
- let fs = { north: [-1, 0, 0], east: [0, 1, 0], up: [0, 0, 1], south: [1, 0, 0], west: [0, -1, 0], down: [0, 0, -1] }, ys = {}, ps = { east: new _(), north: new _(), up: new _(), west: new _(), south: new _(), down: new _() }, Ms = new _(), gs = new _(), xs = new _();
2298
- const ws = (t2) => void 0 !== t2, Ss = new _(), Es = new _(), bs = new _(), Ps = function(t2, s2, i2 = 0, e2) {
2299
- const a2 = new _(40680631590769, 40680631590769, 40408299984661445e-3), n2 = Math.cos(s2);
2313
+ const ls = {}, us = new l(), ds = new u(1, 1, 1), ms = new D(), _s = { up: { south: "east", north: "west", west: "south", east: "north" }, down: { south: "west", north: "east", west: "north", east: "south" }, south: { up: "west", down: "east", west: "down", east: "up" }, north: { up: "east", down: "west", west: "up", east: "down" }, west: { up: "north", down: "south", north: "down", south: "up" }, east: { up: "south", down: "north", north: "up", south: "down" } };
2314
+ let fs = { north: [-1, 0, 0], east: [0, 1, 0], up: [0, 0, 1], south: [1, 0, 0], west: [0, -1, 0], down: [0, 0, -1] }, ys = {}, ps = { east: new u(), north: new u(), up: new u(), west: new u(), south: new u(), down: new u() }, gs = new u(), Ms = new u(), xs = new u();
2315
+ const ws = (t2) => void 0 !== t2, Ss = new u(), Es = new u(), bs = new u(), Ps = function(t2, s2, i2 = 0, e2) {
2316
+ const a2 = new u(40680631590769, 40680631590769, 40408299984661445e-3), n2 = Math.cos(s2);
2300
2317
  Es.x = n2 * Math.cos(t2), Es.y = n2 * Math.sin(t2), Es.z = Math.sin(s2), Es.normalize(), bs.multiplyVectors(a2, Es);
2301
2318
  const r2 = Math.sqrt(Es.dot(bs));
2302
- return bs.divideScalar(r2), Es.multiplyScalar(i2), ws(e2) || (e2 = new _()), e2.addVectors(bs, Es);
2319
+ return bs.divideScalar(r2), Es.multiplyScalar(i2), ws(e2) || (e2 = new u()), e2.addVectors(bs, Es);
2303
2320
  };
2304
2321
  function vs(t2, s2) {
2305
2322
  this.start = $(t2, 0), this.stop = $(s2, 0);
@@ -2312,18 +2329,18 @@ ls.lnglatToEcef = (t2, s2, i2 = 0, e2) => Ps(t2 * Math.PI / 180, s2 * Math.PI /
2312
2329
  if (!ws(i3))
2313
2330
  throw new Error("origin is required.");
2314
2331
  if (ws(n2) || (n2 = new D()), i3.equals(Ss))
2315
- Ms.fromArray(fs[t2]), gs.fromArray(fs[s2]), xs.fromArray(fs[e2]);
2332
+ gs.fromArray(fs[t2]), Ms.fromArray(fs[s2]), xs.fromArray(fs[e2]);
2316
2333
  else if (Math.abs(i3.x) < 1e-14 && Math.abs(i3.y) < 1e-14) {
2317
2334
  let a4 = 0 === (r2 = +(r2 = i3.z)) ? r2 : r2 > 0 ? 1 : -1;
2318
- Ms.fromArray(fs[t2]), "east" !== t2 && "west" !== t2 && Ms.multiplyScalar(a4), gs.fromArray(fs[s2]), "east" !== s2 && "west" !== s2 && gs.multiplyScalar(a4), xs.fromArray(fs[e2]), "east" !== e2 && "west" !== e2 && xs.multiplyScalar(a4);
2335
+ gs.fromArray(fs[t2]), "east" !== t2 && "west" !== t2 && gs.multiplyScalar(a4), Ms.fromArray(fs[s2]), "east" !== s2 && "west" !== s2 && Ms.multiplyScalar(a4), xs.fromArray(fs[e2]), "east" !== e2 && "west" !== e2 && xs.multiplyScalar(a4);
2319
2336
  } else {
2320
2337
  (a3 = a3 || Wt.WGS84).geodeticSurfaceNormal(i3, ps.up);
2321
2338
  let n3 = ps.up, r3 = ps.east;
2322
- r3.x = -i3.y, r3.y = i3.x, r3.z = 0, ps.east.copy(r3).normalize(), ps.north.crossVectors(n3, r3), ps.down.copy(ps.up).multiplyScalar(-1), ps.west.copy(ps.east).multiplyScalar(-1), ps.south.copy(ps.north).multiplyScalar(-1), Ms = ps[t2], gs = ps[s2], xs = ps[e2];
2339
+ r3.x = -i3.y, r3.y = i3.x, r3.z = 0, ps.east.copy(r3).normalize(), ps.north.crossVectors(n3, r3), ps.down.copy(ps.up).multiplyScalar(-1), ps.west.copy(ps.east).multiplyScalar(-1), ps.south.copy(ps.north).multiplyScalar(-1), gs = ps[t2], Ms = ps[s2], xs = ps[e2];
2323
2340
  }
2324
2341
  var r2;
2325
2342
  const h2 = n2.elements;
2326
- return h2[0] = Ms.x, h2[1] = Ms.y, h2[2] = Ms.z, h2[3] = 0, h2[4] = gs.x, h2[5] = gs.y, h2[6] = gs.z, h2[7] = 0, h2[8] = xs.x, h2[9] = xs.y, h2[10] = xs.z, h2[11] = 0, h2[12] = i3.x, h2[13] = i3.y, h2[14] = i3.z, h2[15] = 1, n2;
2343
+ return h2[0] = gs.x, h2[1] = gs.y, h2[2] = gs.z, h2[3] = 0, h2[4] = Ms.x, h2[5] = Ms.y, h2[6] = Ms.z, h2[7] = 0, h2[8] = xs.x, h2[9] = xs.y, h2[10] = xs.z, h2[11] = 0, h2[12] = i3.x, h2[13] = i3.y, h2[14] = i3.z, h2[15] = 1, n2;
2327
2344
  }, ys[a2] = i2), i2;
2328
2345
  }, ls.eastNorthUpToFixedFrame = ls.localFrameToFixedFrameGenerator("east", "north"), ls.headingPitchRollToFixedFrame = function(t2, s2, i2, e2, a2) {
2329
2346
  e2 = e2 || ls.eastNorthUpToFixedFrame;
@@ -2378,10 +2395,10 @@ var Cs = {};
2378
2395
  function Ns(t2, s2, i2, e2) {
2379
2396
  var a2, n2, r2 = t2, h2 = s2 / 3, o2 = i2 / 3, c2 = e2, l2 = r2 * o2, u2 = h2 * c2, d2 = h2 * h2, m2 = o2 * o2, _2 = r2 * o2 - d2, f2 = r2 * c2 - h2 * o2, y2 = h2 * c2 - m2, p2 = 4 * _2 * y2 - f2 * f2;
2380
2397
  if (p2 < 0) {
2381
- var M2, g2, x2;
2382
- d2 * u2 >= l2 * m2 ? (M2 = r2, g2 = _2, x2 = -2 * h2 * _2 + r2 * f2) : (M2 = c2, g2 = y2, x2 = -c2 * f2 + 2 * o2 * y2);
2383
- var w2 = -(x2 < 0 ? -1 : 1) * Math.abs(M2) * Math.sqrt(-p2), S2 = (n2 = -x2 + w2) / 2, E2 = S2 < 0 ? -Math.pow(-S2, 1 / 3) : Math.pow(S2, 1 / 3), b2 = n2 === w2 ? -E2 : -g2 / E2;
2384
- return a2 = g2 <= 0 ? E2 + b2 : -x2 / (E2 * E2 + b2 * b2 + g2), d2 * u2 >= l2 * m2 ? [(a2 - h2) / r2] : [-c2 / (a2 + o2)];
2398
+ var g2, M2, x2;
2399
+ d2 * u2 >= l2 * m2 ? (g2 = r2, M2 = _2, x2 = -2 * h2 * _2 + r2 * f2) : (g2 = c2, M2 = y2, x2 = -c2 * f2 + 2 * o2 * y2);
2400
+ var w2 = -(x2 < 0 ? -1 : 1) * Math.abs(g2) * Math.sqrt(-p2), S2 = (n2 = -x2 + w2) / 2, E2 = S2 < 0 ? -Math.pow(-S2, 1 / 3) : Math.pow(S2, 1 / 3), b2 = n2 === w2 ? -E2 : -M2 / E2;
2401
+ return a2 = M2 <= 0 ? E2 + b2 : -x2 / (E2 * E2 + b2 * b2 + M2), d2 * u2 >= l2 * m2 ? [(a2 - h2) / r2] : [-c2 / (a2 + o2)];
2385
2402
  }
2386
2403
  var P2 = _2, v2 = -2 * h2 * _2 + r2 * f2, A2 = y2, G2 = -c2 * f2 + 2 * o2 * y2, C2 = Math.sqrt(p2), N2 = Math.sqrt(3) / 2, I2 = Math.abs(Math.atan2(r2 * C2, -v2) / 3);
2387
2404
  a2 = 2 * Math.sqrt(-P2);
@@ -2447,7 +2464,7 @@ function zs(t2, s2, i2, e2) {
2447
2464
  return [];
2448
2465
  }
2449
2466
  if (l2 > 0) {
2450
- var p2 = Math.sqrt(l2), M2 = (n2 + l2 - r2 / p2) / 2, g2 = (n2 + l2 + r2 / p2) / 2, x2 = As.computeRealRoots(1, p2, M2), w2 = As.computeRealRoots(1, -p2, g2);
2467
+ var p2 = Math.sqrt(l2), g2 = (n2 + l2 - r2 / p2) / 2, M2 = (n2 + l2 + r2 / p2) / 2, x2 = As.computeRealRoots(1, p2, g2), w2 = As.computeRealRoots(1, -p2, M2);
2451
2468
  return 0 !== x2.length ? (x2[0] += c2, x2[1] += c2, 0 !== w2.length ? (w2[0] += c2, w2[1] += c2, x2[1] <= w2[0] ? [x2[0], x2[1], w2[0], w2[1]] : w2[1] <= x2[0] ? [w2[0], w2[1], x2[0], x2[1]] : x2[0] >= w2[0] && x2[1] <= w2[1] ? [w2[0], x2[0], x2[1], w2[1]] : w2[0] >= x2[0] && w2[1] <= x2[1] ? [x2[0], w2[0], w2[1], x2[1]] : x2[0] > w2[0] && x2[0] < w2[1] ? [w2[0], x2[0], w2[1], x2[1]] : [x2[0], w2[0], x2[1], w2[1]]) : x2) : 0 !== w2.length ? (w2[0] += c2, w2[1] += c2, w2) : [];
2452
2469
  }
2453
2470
  }
@@ -2456,15 +2473,15 @@ function zs(t2, s2, i2, e2) {
2456
2473
  function Ts(t2, s2, i2, e2) {
2457
2474
  var a2 = t2 * t2, n2 = -2 * s2, r2 = i2 * t2 + s2 * s2 - 4 * e2, h2 = a2 * e2 - i2 * s2 * t2 + i2 * i2, o2 = Cs.computeRealRoots(1, n2, r2, h2);
2458
2475
  if (o2.length > 0) {
2459
- var c2, l2, u2, d2, m2, _2, f2 = o2[0], y2 = s2 - f2, p2 = y2 * y2, M2 = t2 / 2, g2 = y2 / 2, x2 = p2 - 4 * e2, w2 = p2 + 4 * Math.abs(e2), S2 = a2 - 4 * f2, E2 = a2 + 4 * Math.abs(f2);
2476
+ var c2, l2, u2, d2, m2, _2, f2 = o2[0], y2 = s2 - f2, p2 = y2 * y2, g2 = t2 / 2, M2 = y2 / 2, x2 = p2 - 4 * e2, w2 = p2 + 4 * Math.abs(e2), S2 = a2 - 4 * f2, E2 = a2 + 4 * Math.abs(f2);
2460
2477
  if (f2 < 0 || x2 * E2 < S2 * w2) {
2461
2478
  var b2 = Math.sqrt(S2);
2462
- c2 = b2 / 2, l2 = 0 === b2 ? 0 : (t2 * g2 - i2) / b2;
2479
+ c2 = b2 / 2, l2 = 0 === b2 ? 0 : (t2 * M2 - i2) / b2;
2463
2480
  } else {
2464
2481
  var P2 = Math.sqrt(x2);
2465
- c2 = 0 === P2 ? 0 : (t2 * g2 - i2) / P2, l2 = P2 / 2;
2482
+ c2 = 0 === P2 ? 0 : (t2 * M2 - i2) / P2, l2 = P2 / 2;
2466
2483
  }
2467
- 0 === M2 && 0 === c2 ? (u2 = 0, d2 = 0) : st.sign(M2) === st.sign(c2) ? d2 = f2 / (u2 = M2 + c2) : u2 = f2 / (d2 = M2 - c2), 0 === g2 && 0 === l2 ? (m2 = 0, _2 = 0) : st.sign(g2) === st.sign(l2) ? _2 = e2 / (m2 = g2 + l2) : m2 = e2 / (_2 = g2 - l2);
2484
+ 0 === g2 && 0 === c2 ? (u2 = 0, d2 = 0) : st.sign(g2) === st.sign(c2) ? d2 = f2 / (u2 = g2 + c2) : u2 = f2 / (d2 = g2 - c2), 0 === M2 && 0 === l2 ? (m2 = 0, _2 = 0) : st.sign(M2) === st.sign(l2) ? _2 = e2 / (m2 = M2 + l2) : m2 = e2 / (_2 = M2 - l2);
2468
2485
  var v2 = As.computeRealRoots(1, u2, m2), A2 = As.computeRealRoots(1, d2, _2);
2469
2486
  if (0 !== v2.length)
2470
2487
  return 0 !== A2.length ? v2[1] <= A2[0] ? [v2[0], v2[1], A2[0], A2[1]] : A2[1] <= v2[0] ? [A2[0], A2[1], v2[0], v2[1]] : v2[0] >= A2[0] && v2[1] <= A2[1] ? [A2[0], v2[0], v2[1], A2[1]] : A2[0] >= v2[0] && A2[1] <= v2[1] ? [v2[0], A2[0], A2[1], v2[1]] : v2[0] > A2[0] && v2[0] < A2[1] ? [A2[0], v2[0], A2[1], v2[1]] : [v2[0], A2[0], v2[1], A2[1]] : v2;
@@ -2528,14 +2545,14 @@ var Os = { rayPlane: function(t2, s2, i2) {
2528
2545
  throw new tt("ray is required.");
2529
2546
  if (!J(s2))
2530
2547
  throw new tt("plane is required.");
2531
- J(i2) || (i2 = new _());
2548
+ J(i2) || (i2 = new u());
2532
2549
  var e2 = t2.origin, a2 = t2.direction, n2 = s2.normal, r2 = _t.dot(n2, a2);
2533
2550
  if (!(Math.abs(r2) < st.EPSILON15)) {
2534
2551
  var h2 = (-s2.constant - _t.dot(n2, e2)) / r2;
2535
2552
  if (!(h2 < 0))
2536
2553
  return i2 = _t.multiplyByScalar(a2, h2, i2), _t.add(e2, i2, i2);
2537
2554
  }
2538
- } }, Rs = new _(), qs = new _(), Ls = new _(), Bs = new _(), ks = new _();
2555
+ } }, Rs = new u(), qs = new u(), Ls = new u(), Bs = new u(), ks = new u();
2539
2556
  Os.rayTriangleParametric = function(t2, s2, i2, e2, a2) {
2540
2557
  if (!J(t2))
2541
2558
  throw new tt("ray is required.");
@@ -2569,7 +2586,7 @@ Os.rayTriangleParametric = function(t2, s2, i2, e2, a2) {
2569
2586
  }, Os.rayTriangle = function(t2, s2, i2, e2, a2, n2) {
2570
2587
  var r2 = Os.rayTriangleParametric(t2, s2, i2, e2, a2);
2571
2588
  if (J(r2) && !(r2 < 0))
2572
- return J(n2) || (n2 = new _()), _t.multiplyByScalar(t2.direction, r2, n2), _t.add(t2.origin, n2, n2);
2589
+ return J(n2) || (n2 = new u()), _t.multiplyByScalar(t2.direction, r2, n2), _t.add(t2.origin, n2, n2);
2573
2590
  };
2574
2591
  var Ds = new k();
2575
2592
  Os.lineSegmentTriangle = function(t2, s2, i2, e2, a2, n2, r2) {
@@ -2587,7 +2604,7 @@ Os.lineSegmentTriangle = function(t2, s2, i2, e2, a2, n2, r2) {
2587
2604
  _t.clone(t2, h2.origin), _t.subtract(s2, t2, h2.direction), _t.normalize(h2.direction, h2.direction);
2588
2605
  var o2 = Os.rayTriangleParametric(h2, i2, e2, a2, n2);
2589
2606
  if (!(!J(o2) || o2 < 0 || o2 > _t.distance(t2, s2)))
2590
- return J(r2) || (r2 = new _()), _t.multiplyByScalar(h2.direction, o2, r2), _t.add(h2.origin, r2, r2);
2607
+ return J(r2) || (r2 = new u()), _t.multiplyByScalar(h2.direction, o2, r2), _t.add(h2.origin, r2, r2);
2591
2608
  };
2592
2609
  var Us = { root0: 0, root1: 0 };
2593
2610
  function js(t2, s2, i2) {
@@ -2629,7 +2646,7 @@ Os.lineSegmentSphere = function(t2, s2, i2, e2) {
2629
2646
  if (_t.normalize(n2, n2), !(!J(e2 = js(a2, i2, e2)) || e2.stop < 0 || e2.start > r2))
2630
2647
  return e2.start = Math.max(e2.start, 0), e2.stop = Math.min(e2.stop, r2), e2;
2631
2648
  };
2632
- var Vs = new _(), Ws = new _();
2649
+ var Vs = new u(), Ws = new u();
2633
2650
  function Hs(t2, s2, i2) {
2634
2651
  var e2 = t2 + s2;
2635
2652
  return st.sign(t2) !== st.sign(s2) && Math.abs(e2 / Math.max(Math.abs(t2), Math.abs(s2))) < i2 ? 0 : e2;
@@ -2656,7 +2673,7 @@ Os.rayEllipsoid = function(t2, s2) {
2656
2673
  }
2657
2674
  return l2 < 1 ? (i2 = l2 - 1, n2 = u2 * u2 - (a2 = (e2 = _t.magnitudeSquared(c2)) * i2), new vs(0, (r2 = -u2 + Math.sqrt(n2)) / e2)) : u2 < 0 ? new vs(0, -u2 / (e2 = _t.magnitudeSquared(c2))) : void 0;
2658
2675
  };
2659
- var Zs = new _(), Qs = new _(), Xs = new _(), Ys = new _(), Ks = new _(), Js = new l(), $s = new l(), ti = new l(), si = new l(), ii = new l(), ei = new l(), ai = new l(), ni = new _(), ri = new _(), hi = new _();
2676
+ var Xs = new u(), Ys = new u(), Zs = new u(), Qs = new u(), Ks = new u(), Js = new _(), $s = new _(), ti = new _(), si = new _(), ii = new _(), ei = new _(), ai = new _(), ni = new u(), ri = new u(), hi = new u();
2660
2677
  Os.grazingAltitudeLocation = function(t2, s2) {
2661
2678
  if (!J(t2))
2662
2679
  throw new tt("ray is required.");
@@ -2664,49 +2681,49 @@ Os.grazingAltitudeLocation = function(t2, s2) {
2664
2681
  throw new tt("ellipsoid is required.");
2665
2682
  var i2 = t2.origin, e2 = t2.direction;
2666
2683
  if (!_t.equals(i2, _t.ZERO)) {
2667
- var a2 = s2.geodeticSurfaceNormal(i2, Zs);
2684
+ var a2 = s2.geodeticSurfaceNormal(i2, Xs);
2668
2685
  if (_t.dot(e2, a2) >= 0)
2669
2686
  return i2;
2670
2687
  }
2671
- var n2 = J(this.rayEllipsoid(t2, s2)), r2 = s2.transformPositionToScaledSpace(e2, Zs), h2 = _t.normalize(r2, r2), o2 = _t.mostOrthogonalAxis(r2, Ys), c2 = _t.normalize(_t.cross(o2, h2, Qs), Qs), l2 = _t.normalize(_t.cross(h2, c2, Xs), Xs), u2 = Js;
2672
- u2[0] = h2.x, u2[1] = h2.y, u2[2] = h2.z, u2[3] = c2.x, u2[4] = c2.y, u2[5] = c2.z, u2[6] = l2.x, u2[7] = l2.y, u2[8] = l2.z;
2673
- var d2 = Ht.transpose(u2, $s), m2 = Ht.fromScale(s2.radii, ti), f2 = Ht.fromScale(s2.oneOverRadii, si), y2 = ii;
2688
+ var n2 = J(this.rayEllipsoid(t2, s2)), r2 = s2.transformPositionToScaledSpace(e2, Xs), h2 = _t.normalize(r2, r2), o2 = _t.mostOrthogonalAxis(r2, Qs), c2 = _t.normalize(_t.cross(o2, h2, Ys), Ys), l2 = _t.normalize(_t.cross(h2, c2, Zs), Zs), d2 = Js;
2689
+ d2[0] = h2.x, d2[1] = h2.y, d2[2] = h2.z, d2[3] = c2.x, d2[4] = c2.y, d2[5] = c2.z, d2[6] = l2.x, d2[7] = l2.y, d2[8] = l2.z;
2690
+ var m2 = Ht.transpose(d2, $s), _2 = Ht.fromScale(s2.radii, ti), f2 = Ht.fromScale(s2.oneOverRadii, si), y2 = ii;
2674
2691
  y2[0] = 0, y2[1] = -e2.z, y2[2] = e2.y, y2[3] = e2.z, y2[4] = 0, y2[5] = -e2.x, y2[6] = -e2.y, y2[7] = e2.x, y2[8] = 0;
2675
- var p2, M2, g2 = Ht.multiply(Ht.multiply(d2, f2, ei), y2, ei), x2 = Ht.multiply(Ht.multiply(g2, m2, ai), u2, ai), w2 = Ht.multiplyByVector(g2, i2, Ks), S2 = function(t3, s3, i3, e3, a3) {
2676
- var n3, r3 = e3 * e3, h3 = a3 * a3, o3 = (t3[Ht.COLUMN1ROW1] - t3[Ht.COLUMN2ROW2]) * h3, c3 = a3 * (e3 * Hs(t3[Ht.COLUMN1ROW0], t3[Ht.COLUMN0ROW1], st.EPSILON15) + s3.y), l3 = t3[Ht.COLUMN0ROW0] * r3 + t3[Ht.COLUMN2ROW2] * h3 + e3 * s3.x + i3, u3 = h3 * Hs(t3[Ht.COLUMN2ROW1], t3[Ht.COLUMN1ROW2], st.EPSILON15), d3 = a3 * (e3 * Hs(t3[Ht.COLUMN2ROW0], t3[Ht.COLUMN0ROW2]) + s3.z), m3 = [];
2677
- if (0 === d3 && 0 === u3) {
2692
+ var p2, g2, M2 = Ht.multiply(Ht.multiply(m2, f2, ei), y2, ei), x2 = Ht.multiply(Ht.multiply(M2, _2, ai), d2, ai), w2 = Ht.multiplyByVector(M2, i2, Ks), S2 = function(t3, s3, i3, e3, a3) {
2693
+ var n3, r3 = e3 * e3, h3 = a3 * a3, o3 = (t3[Ht.COLUMN1ROW1] - t3[Ht.COLUMN2ROW2]) * h3, c3 = a3 * (e3 * Hs(t3[Ht.COLUMN1ROW0], t3[Ht.COLUMN0ROW1], st.EPSILON15) + s3.y), l3 = t3[Ht.COLUMN0ROW0] * r3 + t3[Ht.COLUMN2ROW2] * h3 + e3 * s3.x + i3, d3 = h3 * Hs(t3[Ht.COLUMN2ROW1], t3[Ht.COLUMN1ROW2], st.EPSILON15), m3 = a3 * (e3 * Hs(t3[Ht.COLUMN2ROW0], t3[Ht.COLUMN0ROW2]) + s3.z), _3 = [];
2694
+ if (0 === m3 && 0 === d3) {
2678
2695
  if (0 === (n3 = As.computeRealRoots(o3, c3, l3)).length)
2679
- return m3;
2696
+ return _3;
2680
2697
  var f3 = n3[0], y3 = Math.sqrt(Math.max(1 - f3 * f3, 0));
2681
- if (m3.push(new _(e3, a3 * f3, a3 * -y3)), m3.push(new _(e3, a3 * f3, a3 * y3)), 2 === n3.length) {
2682
- var p3 = n3[1], M3 = Math.sqrt(Math.max(1 - p3 * p3, 0));
2683
- m3.push(new _(e3, a3 * p3, a3 * -M3)), m3.push(new _(e3, a3 * p3, a3 * M3));
2698
+ if (_3.push(new u(e3, a3 * f3, a3 * -y3)), _3.push(new u(e3, a3 * f3, a3 * y3)), 2 === n3.length) {
2699
+ var p3 = n3[1], g3 = Math.sqrt(Math.max(1 - p3 * p3, 0));
2700
+ _3.push(new u(e3, a3 * p3, a3 * -g3)), _3.push(new u(e3, a3 * p3, a3 * g3));
2684
2701
  }
2685
- return m3;
2702
+ return _3;
2686
2703
  }
2687
- var g3 = d3 * d3, x3 = u3 * u3, w3 = d3 * u3, S3 = o3 * o3 + x3, E3 = 2 * (c3 * o3 + w3), b3 = 2 * l3 * o3 + c3 * c3 - x3 + g3, P3 = 2 * (l3 * c3 - w3), v3 = l3 * l3 - g3;
2704
+ var M3 = m3 * m3, x3 = d3 * d3, w3 = m3 * d3, S3 = o3 * o3 + x3, E3 = 2 * (c3 * o3 + w3), b3 = 2 * l3 * o3 + c3 * c3 - x3 + M3, P3 = 2 * (l3 * c3 - w3), v3 = l3 * l3 - M3;
2688
2705
  if (0 === S3 && 0 === E3 && 0 === b3 && 0 === P3)
2689
- return m3;
2706
+ return _3;
2690
2707
  var A3 = (n3 = Is.computeRealRoots(S3, E3, b3, P3, v3)).length;
2691
2708
  if (0 === A3)
2692
- return m3;
2709
+ return _3;
2693
2710
  for (var G3 = 0; G3 < A3; ++G3) {
2694
- var C3 = n3[G3], N2 = C3 * C3, I2 = Math.max(1 - N2, 0), z2 = Math.sqrt(I2), T2 = (st.sign(o3) === st.sign(l3) ? Hs(o3 * N2 + l3, c3 * C3, st.EPSILON12) : st.sign(l3) === st.sign(c3 * C3) ? Hs(o3 * N2, c3 * C3 + l3, st.EPSILON12) : Hs(o3 * N2 + c3 * C3, l3, st.EPSILON12)) * Hs(u3 * C3, d3, st.EPSILON15);
2695
- T2 < 0 ? m3.push(new _(e3, a3 * C3, a3 * z2)) : T2 > 0 ? m3.push(new _(e3, a3 * C3, a3 * -z2)) : 0 !== z2 ? (m3.push(new _(e3, a3 * C3, a3 * -z2)), m3.push(new _(e3, a3 * C3, a3 * z2)), ++G3) : m3.push(new _(e3, a3 * C3, a3 * z2));
2711
+ var C3 = n3[G3], N2 = C3 * C3, I2 = Math.max(1 - N2, 0), z2 = Math.sqrt(I2), T2 = (st.sign(o3) === st.sign(l3) ? Hs(o3 * N2 + l3, c3 * C3, st.EPSILON12) : st.sign(l3) === st.sign(c3 * C3) ? Hs(o3 * N2, c3 * C3 + l3, st.EPSILON12) : Hs(o3 * N2 + c3 * C3, l3, st.EPSILON12)) * Hs(d3 * C3, m3, st.EPSILON15);
2712
+ T2 < 0 ? _3.push(new u(e3, a3 * C3, a3 * z2)) : T2 > 0 ? _3.push(new u(e3, a3 * C3, a3 * -z2)) : 0 !== z2 ? (_3.push(new u(e3, a3 * C3, a3 * -z2)), _3.push(new u(e3, a3 * C3, a3 * z2)), ++G3) : _3.push(new u(e3, a3 * C3, a3 * z2));
2696
2713
  }
2697
- return m3;
2698
- }(x2, _t.negate(w2, Zs), 0, 0, 1), E2 = S2.length;
2714
+ return _3;
2715
+ }(x2, _t.negate(w2, Xs), 0, 0, 1), E2 = S2.length;
2699
2716
  if (E2 > 0) {
2700
2717
  for (var b2 = _t.clone(_t.ZERO, ri), P2 = Number.NEGATIVE_INFINITY, v2 = 0; v2 < E2; ++v2) {
2701
- p2 = Ht.multiplyByVector(m2, Ht.multiplyByVector(u2, S2[v2], ni), ni);
2702
- var A2 = _t.normalize(_t.subtract(p2, i2, Ys), Ys), G2 = _t.dot(A2, e2);
2718
+ p2 = Ht.multiplyByVector(_2, Ht.multiplyByVector(d2, S2[v2], ni), ni);
2719
+ var A2 = _t.normalize(_t.subtract(p2, i2, Qs), Qs), G2 = _t.dot(A2, e2);
2703
2720
  G2 > P2 && (P2 = G2, b2 = _t.clone(p2, b2));
2704
2721
  }
2705
2722
  var C2 = s2.cartesianToCartographic(b2, hi);
2706
- return P2 = st.clamp(P2, 0, 1), M2 = _t.magnitude(_t.subtract(b2, i2, Ys)) * Math.sqrt(1 - P2 * P2), M2 = n2 ? -M2 : M2, C2.z = M2, s2.cartographicToCartesian(C2, new _());
2723
+ return P2 = st.clamp(P2, 0, 1), g2 = _t.magnitude(_t.subtract(b2, i2, Qs)) * Math.sqrt(1 - P2 * P2), g2 = n2 ? -g2 : g2, C2.z = g2, s2.cartographicToCartesian(C2, new u());
2707
2724
  }
2708
2725
  };
2709
- var oi = new _();
2726
+ var oi = new u();
2710
2727
  Os.lineSegmentPlane = function(t2, s2, i2, e2) {
2711
2728
  if (!J(t2))
2712
2729
  throw new tt("endPoint0 is required.");
@@ -2714,7 +2731,7 @@ Os.lineSegmentPlane = function(t2, s2, i2, e2) {
2714
2731
  throw new tt("endPoint1 is required.");
2715
2732
  if (!J(i2))
2716
2733
  throw new tt("plane is required.");
2717
- J(e2) || (e2 = new _());
2734
+ J(e2) || (e2 = new u());
2718
2735
  var a2 = _t.subtract(s2, t2, oi), n2 = i2.normal, r2 = _t.dot(n2, a2);
2719
2736
  if (!(Math.abs(r2) < st.EPSILON6)) {
2720
2737
  var h2 = _t.dot(n2, t2), o2 = -(i2.constant + h2) / r2;
@@ -2724,15 +2741,15 @@ Os.lineSegmentPlane = function(t2, s2, i2, e2) {
2724
2741
  }, Os.trianglePlaneIntersection = function(t2, s2, i2, e2) {
2725
2742
  if (!(J(t2) && J(s2) && J(i2) && J(e2)))
2726
2743
  throw new tt("p0, p1, p2, and plane are required.");
2727
- var a2, n2, r2 = e2.normal, h2 = e2.constant, o2 = _t.dot(r2, t2) + h2 < 0, c2 = _t.dot(r2, s2) + h2 < 0, l2 = _t.dot(r2, i2) + h2 < 0, u2 = 0;
2728
- if (u2 += o2 ? 1 : 0, u2 += c2 ? 1 : 0, 1 !== (u2 += l2 ? 1 : 0) && 2 !== u2 || (a2 = new _(), n2 = new _()), 1 === u2) {
2744
+ var a2, n2, r2 = e2.normal, h2 = e2.constant, o2 = _t.dot(r2, t2) + h2 < 0, c2 = _t.dot(r2, s2) + h2 < 0, l2 = _t.dot(r2, i2) + h2 < 0, d2 = 0;
2745
+ if (d2 += o2 ? 1 : 0, d2 += c2 ? 1 : 0, 1 !== (d2 += l2 ? 1 : 0) && 2 !== d2 || (a2 = new u(), n2 = new u()), 1 === d2) {
2729
2746
  if (o2)
2730
2747
  return Os.lineSegmentPlane(t2, s2, e2, a2), Os.lineSegmentPlane(t2, i2, e2, n2), { positions: [t2, s2, i2, a2, n2], indices: [0, 3, 4, 1, 2, 4, 1, 4, 3] };
2731
2748
  if (c2)
2732
2749
  return Os.lineSegmentPlane(s2, i2, e2, a2), Os.lineSegmentPlane(s2, t2, e2, n2), { positions: [t2, s2, i2, a2, n2], indices: [1, 3, 4, 2, 0, 4, 2, 4, 3] };
2733
2750
  if (l2)
2734
2751
  return Os.lineSegmentPlane(i2, t2, e2, a2), Os.lineSegmentPlane(i2, s2, e2, n2), { positions: [t2, s2, i2, a2, n2], indices: [2, 3, 4, 0, 1, 4, 0, 4, 3] };
2735
- } else if (2 === u2) {
2752
+ } else if (2 === d2) {
2736
2753
  if (!o2)
2737
2754
  return Os.lineSegmentPlane(s2, t2, e2, a2), Os.lineSegmentPlane(i2, t2, e2, n2), { positions: [t2, s2, i2, a2, n2], indices: [1, 2, 4, 1, 4, 3, 0, 3, 4] };
2738
2755
  if (!c2)
@@ -2743,13 +2760,13 @@ Os.lineSegmentPlane = function(t2, s2, i2, e2) {
2743
2760
  };
2744
2761
  class ci {
2745
2762
  static clone(t2, s2) {
2746
- return s2 || (s2 = new d()), s2.copy(t2), s2;
2763
+ return s2 || (s2 = new y()), s2.copy(t2), s2;
2747
2764
  }
2748
2765
  static fromElements(t2, s2, i2, e2, a2) {
2749
- return a2 || (a2 = new d()), a2.set(t2, s2, i2, e2), a2;
2766
+ return a2 || (a2 = new y()), a2.set(t2, s2, i2, e2), a2;
2750
2767
  }
2751
2768
  static lerp(t2, s2, i2, e2) {
2752
- return e2 || (e2 = new d()), e2.lerpVectors(t2, s2, i2), e2;
2769
+ return e2 || (e2 = new y()), e2.lerpVectors(t2, s2, i2), e2;
2753
2770
  }
2754
2771
  static equals(t2, s2) {
2755
2772
  return t2.equals(s2);
@@ -2758,21 +2775,21 @@ class ci {
2758
2775
  return t2 === s2 ? (t2.normalize(), t2) : (s2.copy(t2), s2.normalize(), s2);
2759
2776
  }
2760
2777
  static add(t2, s2, i2) {
2761
- return i2 || (i2 = new d()), i2.addVectors(t2, s2);
2778
+ return i2 || (i2 = new y()), i2.addVectors(t2, s2);
2762
2779
  }
2763
2780
  static multiplyByScalar(t2, s2, i2) {
2764
- return i2 || (i2 = new d()), i2.copy(t2).multiplyScalar(s2), i2;
2781
+ return i2 || (i2 = new y()), i2.copy(t2).multiplyScalar(s2), i2;
2765
2782
  }
2766
2783
  static subtract(t2, s2, i2) {
2767
- return i2 || (i2 = new d()), i2.subVectors(t2, s2), i2;
2784
+ return i2 || (i2 = new y()), i2.subVectors(t2, s2), i2;
2768
2785
  }
2769
2786
  static distance(t2, s2) {
2770
2787
  return t2.distanceTo(s2);
2771
2788
  }
2772
2789
  }
2773
- __publicField(ci, "ZERO", new d(0, 0, 0, 0));
2774
- __publicField(ci, "UNIT_W", Object.freeze(new d(0, 0, 0, 1)));
2775
- const li = new _(), ui = new _(), di = new D(), mi = new d(0, 0, 0, 0), _i = new _();
2790
+ __publicField(ci, "ZERO", new y(0, 0, 0, 0));
2791
+ __publicField(ci, "UNIT_W", Object.freeze(new y(0, 0, 0, 1)));
2792
+ const li = new u(), ui = new u(), di = new D(), mi = new y(0, 0, 0, 0), _i = new u();
2776
2793
  class fi {
2777
2794
  static fromPointNormal(t2, s2, i2) {
2778
2795
  return i2 || (i2 = new K()), i2.setFromNormalAndCoplanarPoint(s2, t2), i2;
@@ -2787,7 +2804,7 @@ class fi {
2787
2804
  return _t.dot(t2.normal, s2) + t2.constant;
2788
2805
  }
2789
2806
  static projectPointOntoPlane(t2, s2, i2) {
2790
- J(i2) || (i2 = new _());
2807
+ J(i2) || (i2 = new u());
2791
2808
  const e2 = fi.getPointDistance(t2, s2), a2 = _t.multiplyByScalar(t2.normal, e2, ui);
2792
2809
  return _t.subtract(s2, a2, i2);
2793
2810
  }
@@ -2806,8 +2823,8 @@ class fi {
2806
2823
  }
2807
2824
  }
2808
2825
  K.ORIGIN_XY_PLANE = Object.freeze(new fi(_t.UNIT_Z, 0)), K.ORIGIN_YZ_PLANE = Object.freeze(new fi(_t.UNIT_X, 0)), K.ORIGIN_ZX_PLANE = Object.freeze(new fi(_t.UNIT_Y, 0));
2809
- const yi = new d(0, 0, 0, 0), pi = new k(), Mi = new _();
2810
- class gi {
2826
+ const yi = new y(0, 0, 0, 0), pi = new k(), gi = new u();
2827
+ class Mi {
2811
2828
  constructor(t2, s2) {
2812
2829
  if (!J(t2 = (s2 = $(s2, Wt.WGS84)).scaleToGeodeticSurface(t2)))
2813
2830
  throw new tt("origin must not be at the center of the ellipsoid.");
@@ -2819,19 +2836,19 @@ class gi {
2819
2836
  static fromPoints(t2, s2) {
2820
2837
  let i2 = t2[0].x, e2 = t2[0].y, a2 = t2[0].z, n2 = t2[0].x, r2 = t2[0].y, h2 = t2[0].z;
2821
2838
  for (let s3 = 0; s3 < t2.length; s3++) {
2822
- const o3 = t2[s3], c3 = o3.x, l3 = o3.y, u3 = o3.z;
2823
- i2 = Math.min(c3, i2), n2 = Math.max(c3, n2), e2 = Math.min(l3, e2), r2 = Math.max(l3, r2), a2 = Math.min(u3, a2), h2 = Math.max(u3, h2);
2839
+ const o3 = t2[s3], c3 = o3.x, l3 = o3.y, u2 = o3.z;
2840
+ i2 = Math.min(c3, i2), n2 = Math.max(c3, n2), e2 = Math.min(l3, e2), r2 = Math.max(l3, r2), a2 = Math.min(u2, a2), h2 = Math.max(u2, h2);
2824
2841
  }
2825
- const o2 = new _(i2, e2, a2), c2 = new _(n2, r2, h2), l2 = new p(o2, c2);
2826
- let u2 = new _();
2827
- return u2 = l2.getCenter(u2), new gi(u2, s2);
2842
+ const o2 = new u(i2, e2, a2), c2 = new u(n2, r2, h2), l2 = new p(o2, c2);
2843
+ let d2 = new u();
2844
+ return d2 = l2.getCenter(d2), new Mi(d2, s2);
2828
2845
  }
2829
2846
  projectPointToNearestOnPlane(t2, s2) {
2830
2847
  J(s2) || (s2 = new is());
2831
2848
  const i2 = pi;
2832
2849
  i2.origin = t2, _t.clone(this._plane.normal, i2.direction);
2833
- let e2 = Os.rayPlane(i2, this._plane, Mi);
2834
- if (J(e2) || (_t.negate(i2.direction, i2.direction), e2 = Os.rayPlane(i2, this._plane, Mi)), J(e2)) {
2850
+ let e2 = Os.rayPlane(i2, this._plane, gi);
2851
+ if (J(e2) || (_t.negate(i2.direction, i2.direction), e2 = Os.rayPlane(i2, this._plane, gi)), J(e2)) {
2835
2852
  const t3 = _t.subtract(e2, this._origin, e2), i3 = _t.dot(this._xAxis, t3), a2 = _t.dot(this._yAxis, t3);
2836
2853
  return J(s2) ? (s2.x = i3, s2.y = a2, s2) : new c(i3, a2);
2837
2854
  }
@@ -2849,8 +2866,8 @@ class gi {
2849
2866
  projectPointOntoPlane(t2, s2) {
2850
2867
  const i2 = pi;
2851
2868
  i2.origin = t2, _t.normalize(t2, i2.direction);
2852
- let e2 = Os.rayPlane(i2, this._plane, Mi);
2853
- if (J(e2) || (_t.negate(i2.direction, i2.direction), e2 = Os.rayPlane(i2, this._plane, Mi)), J(e2)) {
2869
+ let e2 = Os.rayPlane(i2, this._plane, gi);
2870
+ if (J(e2) || (_t.negate(i2.direction, i2.direction), e2 = Os.rayPlane(i2, this._plane, gi)), J(e2)) {
2854
2871
  const t3 = _t.subtract(e2, this._origin, e2), i3 = _t.dot(this._xAxis, t3), a2 = _t.dot(this._yAxis, t3);
2855
2872
  return J(s2) ? (s2.x = i3, s2.y = a2, s2) : new c(i3, a2);
2856
2873
  }
@@ -2877,7 +2894,7 @@ class gi {
2877
2894
  var xi = Object.freeze({ OUTSIDE: -1, INTERSECTING: 0, INSIDE: 1 });
2878
2895
  class wi {
2879
2896
  constructor(t2, s2) {
2880
- this.isOrientedBoundingBox = true, this.center = _t.clone($(t2, _t.ZERO), new _()), this.halfAxes = Ht.clone($(s2, Ht.ZERO));
2897
+ this.isOrientedBoundingBox = true, this.center = _t.clone($(t2, _t.ZERO), new u()), this.halfAxes = Ht.clone($(s2, Ht.ZERO));
2881
2898
  }
2882
2899
  intersectPlane(t2) {
2883
2900
  return wi.intersectPlane(this, t2);
@@ -2892,14 +2909,14 @@ class wi {
2892
2909
  return J(t2) ? (t2.copy(this.center), t2) : this.center.clone();
2893
2910
  }
2894
2911
  intersectsObb(t2) {
2895
- const s2 = this.center, i2 = t2.center, e2 = this.halfAxes, a2 = t2.halfAxes, n2 = new _().subVectors(i2, s2), r2 = new _(e2.elements[0], e2.elements[1], e2.elements[2]), h2 = new _(e2.elements[3], e2.elements[4], e2.elements[5]), o2 = new _(e2.elements[6], e2.elements[7], e2.elements[8]), c2 = new _(a2.elements[0], a2.elements[1], a2.elements[2]), l2 = new _(a2.elements[3], a2.elements[4], a2.elements[5]), u2 = new _(a2.elements[6], a2.elements[7], a2.elements[8]), d2 = r2.length(), m2 = h2.length(), f2 = o2.length();
2912
+ const s2 = this.center, i2 = t2.center, e2 = this.halfAxes, a2 = t2.halfAxes, n2 = new u().subVectors(i2, s2), r2 = new u(e2.elements[0], e2.elements[1], e2.elements[2]), h2 = new u(e2.elements[3], e2.elements[4], e2.elements[5]), o2 = new u(e2.elements[6], e2.elements[7], e2.elements[8]), c2 = new u(a2.elements[0], a2.elements[1], a2.elements[2]), l2 = new u(a2.elements[3], a2.elements[4], a2.elements[5]), d2 = new u(a2.elements[6], a2.elements[7], a2.elements[8]), m2 = r2.length(), _2 = h2.length(), f2 = o2.length();
2896
2913
  r2.normalize(), h2.normalize(), o2.normalize();
2897
- const y2 = c2.length(), p2 = l2.length(), M2 = u2.length();
2898
- let g2, x2, w2;
2899
- return c2.normalize(), l2.normalize(), u2.normalize(), g2 = d2, x2 = y2 * Math.abs(r2.dot(c2)) + p2 * Math.abs(r2.dot(l2)) + M2 * Math.abs(r2.dot(u2)), w2 = Math.abs(n2.dot(r2)), !(w2 > g2 + x2) && (g2 = m2, x2 = y2 * Math.abs(h2.dot(c2)) + p2 * Math.abs(h2.dot(l2)) + M2 * Math.abs(h2.dot(u2)), w2 = Math.abs(n2.dot(h2)), !(w2 > g2 + x2) && (g2 = f2, x2 = y2 * Math.abs(o2.dot(c2)) + p2 * Math.abs(o2.dot(l2)) + M2 * Math.abs(o2.dot(u2)), w2 = Math.abs(n2.dot(o2)), !(w2 > g2 + x2) && (g2 = d2 * Math.abs(c2.dot(r2)) + m2 * Math.abs(c2.dot(h2)) + f2 * Math.abs(c2.dot(o2)), x2 = y2, w2 = Math.abs(n2.dot(c2)), !(w2 > g2 + x2) && (g2 = d2 * Math.abs(l2.dot(r2)) + m2 * Math.abs(l2.dot(h2)) + f2 * Math.abs(l2.dot(o2)), x2 = p2, w2 = Math.abs(n2.dot(l2)), !(w2 > g2 + x2) && (g2 = d2 * Math.abs(u2.dot(r2)) + m2 * Math.abs(u2.dot(h2)) + f2 * Math.abs(u2.dot(o2)), x2 = M2, w2 = Math.abs(n2.dot(u2)), !(w2 > g2 + x2))))));
2914
+ const y2 = c2.length(), p2 = l2.length(), g2 = d2.length();
2915
+ let M2, x2, w2;
2916
+ return c2.normalize(), l2.normalize(), d2.normalize(), M2 = m2, x2 = y2 * Math.abs(r2.dot(c2)) + p2 * Math.abs(r2.dot(l2)) + g2 * Math.abs(r2.dot(d2)), w2 = Math.abs(n2.dot(r2)), !(w2 > M2 + x2) && (M2 = _2, x2 = y2 * Math.abs(h2.dot(c2)) + p2 * Math.abs(h2.dot(l2)) + g2 * Math.abs(h2.dot(d2)), w2 = Math.abs(n2.dot(h2)), !(w2 > M2 + x2) && (M2 = f2, x2 = y2 * Math.abs(o2.dot(c2)) + p2 * Math.abs(o2.dot(l2)) + g2 * Math.abs(o2.dot(d2)), w2 = Math.abs(n2.dot(o2)), !(w2 > M2 + x2) && (M2 = m2 * Math.abs(c2.dot(r2)) + _2 * Math.abs(c2.dot(h2)) + f2 * Math.abs(c2.dot(o2)), x2 = y2, w2 = Math.abs(n2.dot(c2)), !(w2 > M2 + x2) && (M2 = m2 * Math.abs(l2.dot(r2)) + _2 * Math.abs(l2.dot(h2)) + f2 * Math.abs(l2.dot(o2)), x2 = p2, w2 = Math.abs(n2.dot(l2)), !(w2 > M2 + x2) && (M2 = m2 * Math.abs(d2.dot(r2)) + _2 * Math.abs(d2.dot(h2)) + f2 * Math.abs(d2.dot(o2)), x2 = g2, w2 = Math.abs(n2.dot(d2)), !(w2 > M2 + x2))))));
2900
2917
  }
2901
2918
  }
2902
- const Si = new _(), Ei = new _();
2919
+ const Si = new u(), Ei = new u();
2903
2920
  function bi(t2, s2, i2, e2, a2, n2, r2, h2, o2, c2, l2) {
2904
2921
  if (!(J(a2) && J(n2) && J(r2) && J(h2) && J(o2) && J(c2)))
2905
2922
  throw new tt("all extents (minimum/maximum X/Y/Z) are required.");
@@ -2913,7 +2930,7 @@ function bi(t2, s2, i2, e2, a2, n2, r2, h2, o2, c2, l2) {
2913
2930
  const _2 = l2.center;
2914
2931
  return d2 = Ht.multiplyByVector(u2, d2, d2), _t.add(t2, d2, _2), Ht.multiplyByScale(u2, m2, u2), l2;
2915
2932
  }
2916
- const Pi = new _(), vi = new _(), Ai = new _(), Gi = new _(), Ci = new _(), Ni = new _(), Ii = new _(), zi = new _(), Ti = new _(), Oi = new _(), Ri = new _(), qi = new _(), Li = new c(), Bi = new c(), ki = new c(), Di = new c(), Ui = new c(), ji = new _(), Fi = new _(), Vi = new _(), Wi = new _(), Hi = new c(), Zi = new _(), Qi = new _(), Xi = new _(), Yi = new K(new _(1, 0, 0), 0);
2933
+ const Pi = new u(), vi = new u(), Ai = new u(), Gi = new u(), Ci = new u(), Ni = new u(), Ii = new u(), zi = new u(), Ti = new u(), Oi = new u(), Ri = new u(), qi = new u(), Li = new c(), Bi = new c(), ki = new c(), Di = new c(), Ui = new c(), ji = new u(), Fi = new u(), Vi = new u(), Wi = new u(), Hi = new c(), Xi = new u(), Yi = new u(), Zi = new u(), Qi = new K(new u(1, 0, 0), 0);
2917
2934
  wi.fromRectangle = function(t2, s2, i2, e2, a2) {
2918
2935
  if (!J(t2))
2919
2936
  throw new tt("rectangle is required");
@@ -2925,25 +2942,25 @@ wi.fromRectangle = function(t2, s2, i2, e2, a2) {
2925
2942
  throw new tt("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");
2926
2943
  let n2, r2, h2, o2, c2, l2, u2;
2927
2944
  if (s2 = $(s2, 0), i2 = $(i2, 0), e2 = $(e2, Wt.WGS84), t2.width <= st.PI) {
2928
- const d3 = it.center(t2, Pi), m3 = e2.cartographicToCartesian(d3, vi), _3 = new gi(m3, e2);
2945
+ const d3 = it.center(t2, Pi), m3 = e2.cartographicToCartesian(d3, vi), _3 = new Mi(m3, e2);
2929
2946
  u2 = _3.plane;
2930
- const f3 = d3.x, y3 = t2.south < 0 && t2.north > 0 ? 0 : d3.y, p3 = $t.fromRadians(f3, t2.north, i2, Ai), M3 = $t.fromRadians(t2.west, t2.north, i2, Gi), g3 = $t.fromRadians(t2.west, y3, i2, Ci), x3 = $t.fromRadians(t2.west, t2.south, i2, Ni), w3 = $t.fromRadians(f3, t2.south, i2, Ii), S2 = e2.cartographicToCartesian(p3, zi);
2931
- let E2 = e2.cartographicToCartesian(M3, Ti);
2932
- const b2 = e2.cartographicToCartesian(g3, Oi);
2947
+ const f3 = d3.x, y3 = t2.south < 0 && t2.north > 0 ? 0 : d3.y, p3 = $t.fromRadians(f3, t2.north, i2, Ai), g3 = $t.fromRadians(t2.west, t2.north, i2, Gi), M3 = $t.fromRadians(t2.west, y3, i2, Ci), x3 = $t.fromRadians(t2.west, t2.south, i2, Ni), w3 = $t.fromRadians(f3, t2.south, i2, Ii), S2 = e2.cartographicToCartesian(p3, zi);
2948
+ let E2 = e2.cartographicToCartesian(g3, Ti);
2949
+ const b2 = e2.cartographicToCartesian(M3, Oi);
2933
2950
  let P2 = e2.cartographicToCartesian(x3, Ri);
2934
2951
  const v2 = e2.cartographicToCartesian(w3, qi), A2 = _3.projectPointToNearestOnPlane(S2, Li), G2 = _3.projectPointToNearestOnPlane(E2, Bi), C2 = _3.projectPointToNearestOnPlane(b2, ki), N2 = _3.projectPointToNearestOnPlane(P2, Di), I2 = _3.projectPointToNearestOnPlane(v2, Ui);
2935
- return n2 = Math.min(G2.x, C2.x, N2.x), r2 = -n2, o2 = Math.max(G2.y, A2.y), h2 = Math.min(N2.y, I2.y), M3.z = x3.z = s2, E2 = e2.cartographicToCartesian(M3, Ti), P2 = e2.cartographicToCartesian(x3, Ri), c2 = Math.min(fi.getPointDistance(u2, E2), fi.getPointDistance(u2, P2)), l2 = i2, bi(_3.origin, _3.xAxis, _3.yAxis, _3.zAxis, n2, r2, h2, o2, c2, l2, a2);
2952
+ return n2 = Math.min(G2.x, C2.x, N2.x), r2 = -n2, o2 = Math.max(G2.y, A2.y), h2 = Math.min(N2.y, I2.y), g3.z = x3.z = s2, E2 = e2.cartographicToCartesian(g3, Ti), P2 = e2.cartographicToCartesian(x3, Ri), c2 = Math.min(fi.getPointDistance(u2, E2), fi.getPointDistance(u2, P2)), l2 = i2, bi(_3.origin, _3.xAxis, _3.yAxis, _3.zAxis, n2, r2, h2, o2, c2, l2, a2);
2936
2953
  }
2937
2954
  const d2 = t2.south > 0, m2 = t2.north < 0, _2 = d2 ? t2.south : m2 ? t2.north : 0, f2 = it.center(t2, Pi).x, y2 = _t.fromRadians(f2, _2, i2, e2, ji);
2938
2955
  y2.z = 0;
2939
- const p2 = Math.abs(y2.x) < st.EPSILON10 && Math.abs(y2.y) < st.EPSILON10 ? _t.UNIT_X : _t.normalize(y2, Fi), M2 = _t.UNIT_Z, g2 = _t.cross(p2, M2, Vi);
2940
- u2 = fi.fromPointNormal(y2, p2, Yi);
2956
+ const p2 = Math.abs(y2.x) < st.EPSILON10 && Math.abs(y2.y) < st.EPSILON10 ? _t.UNIT_X : _t.normalize(y2, Fi), g2 = _t.UNIT_Z, M2 = _t.cross(p2, g2, Vi);
2957
+ u2 = fi.fromPointNormal(y2, p2, Qi);
2941
2958
  const x2 = _t.fromRadians(f2 + st.PI_OVER_TWO, _2, i2, e2, Wi);
2942
- r2 = _t.dot(fi.projectPointOntoPlane(u2, x2, Hi), g2), n2 = -r2, o2 = _t.fromRadians(0, t2.north, m2 ? s2 : i2, e2, Zi).z, h2 = _t.fromRadians(0, t2.south, d2 ? s2 : i2, e2, Qi).z;
2943
- const w2 = _t.fromRadians(t2.east, _2, i2, e2, Xi);
2944
- return c2 = fi.getPointDistance(u2, w2), l2 = 0, bi(y2, g2, M2, p2, n2, r2, h2, o2, c2, l2, a2);
2959
+ r2 = _t.dot(fi.projectPointOntoPlane(u2, x2, Hi), M2), n2 = -r2, o2 = _t.fromRadians(0, t2.north, m2 ? s2 : i2, e2, Xi).z, h2 = _t.fromRadians(0, t2.south, d2 ? s2 : i2, e2, Yi).z;
2960
+ const w2 = _t.fromRadians(t2.east, _2, i2, e2, Zi);
2961
+ return c2 = fi.getPointDistance(u2, w2), l2 = 0, bi(y2, M2, g2, p2, n2, r2, h2, o2, c2, l2, a2);
2945
2962
  };
2946
- const Ki = new _(), Ji = new _(), $i = new _(), te = new _(), se = new _(), ie = new _();
2963
+ const Ki = new u(), Ji = new u(), $i = new u(), te = new u(), se = new u(), ie = new u();
2947
2964
  wi.distanceSquaredTo = function(t2, s2) {
2948
2965
  if (!J(t2))
2949
2966
  throw new tt("box is required.");
@@ -2967,8 +2984,8 @@ wi.distanceSquaredTo = function(t2, s2) {
2967
2984
  3 === m2 && (a2 = _t.UNIT_X, n2 = _t.UNIT_Y, r2 = _t.UNIT_Z);
2968
2985
  const p2 = ie;
2969
2986
  p2.x = _t.dot(i2, a2), p2.y = _t.dot(i2, n2), p2.z = _t.dot(i2, r2);
2970
- let M2, g2 = 0;
2971
- return p2.x < -h2 ? (M2 = p2.x + h2, g2 += M2 * M2) : p2.x > h2 && (M2 = p2.x - h2, g2 += M2 * M2), p2.y < -o2 ? (M2 = p2.y + o2, g2 += M2 * M2) : p2.y > o2 && (M2 = p2.y - o2, g2 += M2 * M2), p2.z < -c2 ? (M2 = p2.z + c2, g2 += M2 * M2) : p2.z > c2 && (M2 = p2.z - c2, g2 += M2 * M2), g2;
2987
+ let g2, M2 = 0;
2988
+ return p2.x < -h2 ? (g2 = p2.x + h2, M2 += g2 * g2) : p2.x > h2 && (g2 = p2.x - h2, M2 += g2 * g2), p2.y < -o2 ? (g2 = p2.y + o2, M2 += g2 * g2) : p2.y > o2 && (g2 = p2.y - o2, M2 += g2 * g2), p2.z < -c2 ? (g2 = p2.z + c2, M2 += g2 * g2) : p2.z > c2 && (g2 = p2.z - c2, M2 += g2 * g2), M2;
2972
2989
  }, wi.intersectPlane = function(t2, s2) {
2973
2990
  if (!J(t2))
2974
2991
  throw new tt("box is required.");
@@ -2977,9 +2994,9 @@ wi.distanceSquaredTo = function(t2, s2) {
2977
2994
  const i2 = t2.center, e2 = s2.normal, a2 = t2.halfAxes, n2 = e2.x, r2 = e2.y, h2 = e2.z, o2 = a2.elements, c2 = Math.abs(n2 * o2[Ht.COLUMN0ROW0] + r2 * o2[Ht.COLUMN0ROW1] + h2 * o2[Ht.COLUMN0ROW2]) + Math.abs(n2 * o2[Ht.COLUMN1ROW0] + r2 * o2[Ht.COLUMN1ROW1] + h2 * o2[Ht.COLUMN1ROW2]) + Math.abs(n2 * o2[Ht.COLUMN2ROW0] + r2 * o2[Ht.COLUMN2ROW1] + h2 * o2[Ht.COLUMN2ROW2]), l2 = _t.dot(e2.clone(), i2) + s2.constant;
2978
2995
  return l2 <= -c2 ? xi.OUTSIDE : l2 >= c2 ? xi.INSIDE : xi.INTERSECTING;
2979
2996
  };
2980
- const ee = new _(), ae = new _(), ne = new _();
2997
+ const ee = new u(), ae = new u(), ne = new u();
2981
2998
  wi.computeCorners = function(t2, s2) {
2982
- J(s2) || (s2 = [new _(), new _(), new _(), new _(), new _(), new _(), new _(), new _()]);
2999
+ J(s2) || (s2 = [new u(), new u(), new u(), new u(), new u(), new u(), new u(), new u()]);
2983
3000
  const i2 = t2.center, e2 = t2.halfAxes, a2 = Ht.getColumn(e2, 0, ee), n2 = Ht.getColumn(e2, 1, ae), r2 = Ht.getColumn(e2, 2, ne);
2984
3001
  return _t.clone(i2, s2[0]), _t.subtract(s2[0], a2, s2[0]), _t.subtract(s2[0], n2, s2[0]), _t.subtract(s2[0], r2, s2[0]), _t.clone(i2, s2[1]), _t.subtract(s2[1], a2, s2[1]), _t.subtract(s2[1], n2, s2[1]), _t.add(s2[1], r2, s2[1]), _t.clone(i2, s2[2]), _t.subtract(s2[2], a2, s2[2]), _t.add(s2[2], n2, s2[2]), _t.subtract(s2[2], r2, s2[2]), _t.clone(i2, s2[3]), _t.subtract(s2[3], a2, s2[3]), _t.add(s2[3], n2, s2[3]), _t.add(s2[3], r2, s2[3]), _t.clone(i2, s2[4]), _t.add(s2[4], a2, s2[4]), _t.subtract(s2[4], n2, s2[4]), _t.subtract(s2[4], r2, s2[4]), _t.clone(i2, s2[5]), _t.add(s2[5], a2, s2[5]), _t.subtract(s2[5], n2, s2[5]), _t.add(s2[5], r2, s2[5]), _t.clone(i2, s2[6]), _t.add(s2[6], a2, s2[6]), _t.add(s2[6], n2, s2[6]), _t.subtract(s2[6], r2, s2[6]), _t.clone(i2, s2[7]), _t.add(s2[7], a2, s2[7]), _t.add(s2[7], n2, s2[7]), _t.add(s2[7], r2, s2[7]), s2;
2985
3002
  }, wi.fromGeoBoundingBox = function(t2, s2) {
@@ -3000,11 +3017,11 @@ class re extends Ct {
3000
3017
  return Wt.WGS84.cartesianToCartographicDegree(t2, s2);
3001
3018
  }
3002
3019
  getGeodeticSurfaceNormal(t2, s2) {
3003
- s2 || (s2 = new _());
3020
+ s2 || (s2 = new u());
3004
3021
  return Wt.WGS84.geodeticSurfaceNormalCartographic(t2, s2);
3005
3022
  }
3006
3023
  getProjectedSurfaceNormal(t2, s2) {
3007
- s2 || (s2 = new _());
3024
+ s2 || (s2 = new u());
3008
3025
  return Wt.WGS84.geodeticSurfaceNormal(t2, s2);
3009
3026
  }
3010
3027
  geoBoxToProjectedBox(t2, s2) {
@@ -3073,26 +3090,21 @@ oe(ce.prototype, { equals: function(t2) {
3073
3090
  if (t2.lng > 180 || t2.lng < -180 || t2.lat > 90 || t2.lat < -90)
3074
3091
  return t2;
3075
3092
  let s2, i2;
3076
- if (t2.lng = this.getLoop(t2.lng, -180, 180), t2.lat = this.getRange(t2.lat, -74, 74), s2 = new ce(t2.lng, t2.lat), window.BMAPGL_84) {
3077
- var e2 = {}, a2 = 6378137;
3078
- e2.lng = s2.lng * Math.PI / 180 * a2;
3079
- var n2 = s2.lat * Math.PI / 180;
3080
- return e2.lat = 31890685e-1 * Math.log((1 + Math.sin(n2)) / (1 - Math.sin(n2))), new ce(Number(e2.lng), Number(e2.lat));
3081
- }
3082
- for (var r2 = 0; r2 < this.LLBAND.length; r2++)
3083
- if (s2.lat >= this.LLBAND[r2]) {
3084
- i2 = this.LL2MC[r2];
3093
+ t2.lng = this.getLoop(t2.lng, -180, 180), t2.lat = this.getRange(t2.lat, -74, 74), s2 = new ce(t2.lng, t2.lat);
3094
+ for (var e2 = 0; e2 < this.LLBAND.length; e2++)
3095
+ if (s2.lat >= this.LLBAND[e2]) {
3096
+ i2 = this.LL2MC[e2];
3085
3097
  break;
3086
3098
  }
3087
3099
  if (!i2) {
3088
- for (r2 = 0; r2 < this.LLBAND.length; r2++)
3089
- if (s2.lat <= -this.LLBAND[r2]) {
3090
- i2 = this.LL2MC[r2];
3100
+ for (e2 = 0; e2 < this.LLBAND.length; e2++)
3101
+ if (s2.lat <= -this.LLBAND[e2]) {
3102
+ i2 = this.LL2MC[e2];
3091
3103
  break;
3092
3104
  }
3093
3105
  }
3094
- let h2 = this.convertor(t2, i2);
3095
- return t2 = new ce(Number(h2.lng), Number(h2.lat));
3106
+ let a2 = this.convertor(t2, i2);
3107
+ return t2 = new ce(Number(a2.lng), Number(a2.lat));
3096
3108
  }, convertor: function(t2, s2) {
3097
3109
  if (!t2 || !s2)
3098
3110
  return;
@@ -3136,20 +3148,20 @@ oe(ce.prototype, { equals: function(t2) {
3136
3148
  }, getZoomUnits: function(t2) {
3137
3149
  return Math.pow(2, 18 - t2);
3138
3150
  } });
3139
- const ue = 2003772636e-2, de = 1247410417e-2, me = new _();
3151
+ const ue = 2003772636e-2, de = 1247410417e-2, me = new u();
3140
3152
  class _e extends Ct {
3141
3153
  constructor() {
3142
3154
  super(...arguments);
3143
3155
  __publicField(this, "name", wt);
3144
3156
  __publicField(this, "isAxisAligned", true);
3145
3157
  __publicField(this, "unprojectCoordinate", (t2, s2, i2) => {
3146
- s2 || (s2 = new _()), me.copy(t2), t2.x < -ue && (me.x = -ue), t2.x > ue && (me.x = ue), t2.y < -de && (me.y = -de), t2.y > de && (me.y = de);
3158
+ s2 || (s2 = new u()), me.copy(t2), t2.x < -ue && (me.x = -ue), t2.x > ue && (me.x = ue), t2.y < -de && (me.y = -de), t2.y > de && (me.y = de);
3147
3159
  const e2 = he.convertMC2LL({ lng: me.x, lat: me.y });
3148
3160
  return s2.set(Number(e2.lng), Number(e2.lat), me.z), i2 && (s2.x = Nt(t2.x, s2.x, 180, ue), s2.y = Nt(t2.y, s2.y, 74, de)), s2;
3149
3161
  });
3150
3162
  }
3151
3163
  projectCoordinate(t2, s2, i2 = false) {
3152
- s2 || (s2 = new _()), me.copy(t2), t2.x < -180 && (me.x = -180), t2.x > 180 && (me.x = 180), t2.y < -74 && (me.y = -74), t2.y > 74 && (me.y = 74);
3164
+ s2 || (s2 = new u()), me.copy(t2), t2.x < -180 && (me.x = -180), t2.x > 180 && (me.x = 180), t2.y < -74 && (me.y = -74), t2.y > 74 && (me.y = 74);
3153
3165
  const e2 = he.convertLL2MC({ lng: me.x, lat: me.y });
3154
3166
  return s2.set(Number(e2.lng), Number(e2.lat), me.z), i2 && (s2.x = It(t2.x, s2.x, 180, ue), s2.y = It(t2.y, s2.y, 74, de)), s2;
3155
3167
  }
@@ -3158,15 +3170,15 @@ const fe = 6378137 * Math.PI / 180;
3158
3170
  class ye extends Ct {
3159
3171
  constructor() {
3160
3172
  super(...arguments);
3161
- __publicField(this, "name", Mt);
3173
+ __publicField(this, "name", gt);
3162
3174
  __publicField(this, "isGeo", true);
3163
3175
  __publicField(this, "isAxisAligned", true);
3164
3176
  }
3165
3177
  projectCoordinate(t2, s2) {
3166
- return s2 || (s2 = new _()), s2.x = t2.x * fe, s2.y = t2.y * fe, s2.z = t2.z, s2;
3178
+ return s2 || (s2 = new u()), s2.x = t2.x * fe, s2.y = t2.y * fe, s2.z = t2.z, s2;
3167
3179
  }
3168
3180
  unprojectCoordinate(t2, s2) {
3169
- return s2 || (s2 = new _()), s2.x = t2.x / fe, s2.y = t2.y / fe, s2.z = t2.z, s2;
3181
+ return s2 || (s2 = new u()), s2.x = t2.x / fe, s2.y = t2.y / fe, s2.z = t2.z, s2;
3170
3182
  }
3171
3183
  }
3172
3184
  class pe extends Ct {
@@ -3176,22 +3188,22 @@ class pe extends Ct {
3176
3188
  __publicField(this, "isAxisAligned", true);
3177
3189
  }
3178
3190
  projectCoordinate(t2, s2) {
3179
- return s2 || (s2 = new _()), s2.x = t2.x, s2.y = -t2.y, s2.z = t2.z, s2;
3191
+ return s2 || (s2 = new u()), s2.x = t2.x, s2.y = -t2.y, s2.z = t2.z, s2;
3180
3192
  }
3181
3193
  unprojectCoordinate(t2, s2) {
3182
- return s2 || (s2 = new _()), s2.x = t2.x, s2.y = -t2.y, s2.z = t2.z, s2;
3194
+ return s2 || (s2 = new u()), s2.x = t2.x, s2.y = -t2.y, s2.z = t2.z, s2;
3183
3195
  }
3184
3196
  }
3185
3197
  "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
3186
- var Me = { exports: {} };
3187
- Me.exports = function() {
3198
+ var ge = { exports: {} };
3199
+ ge.exports = function() {
3188
3200
  function t2(t3) {
3189
3201
  t3("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), t3("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), t3("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
3190
3202
  for (var s3 = 1; s3 <= 60; ++s3)
3191
3203
  t3("EPSG:" + (32600 + s3), "+proj=utm +zone=" + s3 + " +datum=WGS84 +units=m"), t3("EPSG:" + (32700 + s3), "+proj=utm +zone=" + s3 + " +south +datum=WGS84 +units=m");
3192
3204
  t3.WGS84 = t3["EPSG:4326"], t3["EPSG:3785"] = t3["EPSG:3857"], t3.GOOGLE = t3["EPSG:3857"], t3["EPSG:900913"] = t3["EPSG:3857"], t3["EPSG:102113"] = t3["EPSG:3857"];
3193
3205
  }
3194
- var s2 = 1, i2 = 2, e2 = 3, a2 = 4, n2 = 5, r2 = 6378137, h2 = 6356752314e-3, o2 = 0.0066943799901413165, c2 = 484813681109536e-20, l2 = Math.PI / 2, u2 = 0.16666666666666666, d2 = 0.04722222222222222, m2 = 0.022156084656084655, _2 = 1e-10, f2 = 0.017453292519943295, y2 = 57.29577951308232, p2 = Math.PI / 4, M2 = 2 * Math.PI, g2 = 3.14159265359, x2 = { greenwich: 0, lisbon: -9.131906111111, paris: 2.337229166667, bogota: -74.080916666667, madrid: -3.687938888889, rome: 12.452333333333, bern: 7.439583333333, jakarta: 106.807719444444, ferro: -17.666666666667, brussels: 4.367975, stockholm: 18.058277777778, athens: 23.7163375, oslo: 10.722916666667 }, w2 = { mm: { to_meter: 1e-3 }, cm: { to_meter: 0.01 }, ft: { to_meter: 0.3048 }, "us-ft": { to_meter: 1200 / 3937 }, fath: { to_meter: 1.8288 }, kmi: { to_meter: 1852 }, "us-ch": { to_meter: 20.1168402336805 }, "us-mi": { to_meter: 1609.34721869444 }, km: { to_meter: 1e3 }, "ind-ft": { to_meter: 0.30479841 }, "ind-yd": { to_meter: 0.91439523 }, mi: { to_meter: 1609.344 }, yd: { to_meter: 0.9144 }, ch: { to_meter: 20.1168 }, link: { to_meter: 0.201168 }, dm: { to_meter: 0.1 }, in: { to_meter: 0.0254 }, "ind-ch": { to_meter: 20.11669506 }, "us-in": { to_meter: 0.025400050800101 }, "us-yd": { to_meter: 0.914401828803658 } }, S2 = /[\s_\-\/\(\)]/g;
3206
+ var s2 = 1, i2 = 2, e2 = 3, a2 = 4, n2 = 5, r2 = 6378137, h2 = 6356752314e-3, o2 = 0.0066943799901413165, c2 = 484813681109536e-20, l2 = Math.PI / 2, u2 = 0.16666666666666666, d2 = 0.04722222222222222, m2 = 0.022156084656084655, _2 = 1e-10, f2 = 0.017453292519943295, y2 = 57.29577951308232, p2 = Math.PI / 4, g2 = 2 * Math.PI, M2 = 3.14159265359, x2 = { greenwich: 0, lisbon: -9.131906111111, paris: 2.337229166667, bogota: -74.080916666667, madrid: -3.687938888889, rome: 12.452333333333, bern: 7.439583333333, jakarta: 106.807719444444, ferro: -17.666666666667, brussels: 4.367975, stockholm: 18.058277777778, athens: 23.7163375, oslo: 10.722916666667 }, w2 = { mm: { to_meter: 1e-3 }, cm: { to_meter: 0.01 }, ft: { to_meter: 0.3048 }, "us-ft": { to_meter: 1200 / 3937 }, fath: { to_meter: 1.8288 }, kmi: { to_meter: 1852 }, "us-ch": { to_meter: 20.1168402336805 }, "us-mi": { to_meter: 1609.34721869444 }, km: { to_meter: 1e3 }, "ind-ft": { to_meter: 0.30479841 }, "ind-yd": { to_meter: 0.91439523 }, mi: { to_meter: 1609.344 }, yd: { to_meter: 0.9144 }, ch: { to_meter: 20.1168 }, link: { to_meter: 0.201168 }, dm: { to_meter: 0.1 }, in: { to_meter: 0.0254 }, "ind-ch": { to_meter: 20.11669506 }, "us-in": { to_meter: 0.025400050800101 }, "us-yd": { to_meter: 0.914401828803658 } }, S2 = /[\s_\-\/\(\)]/g;
3195
3207
  function E2(t3, s3) {
3196
3208
  if (t3[s3])
3197
3209
  return t3[s3];
@@ -3560,22 +3572,22 @@ Me.exports = function() {
3560
3572
  throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
3561
3573
  };
3562
3574
  var H2 = 0.017453292519943295;
3563
- function Z2(t3) {
3575
+ function X2(t3) {
3564
3576
  return t3 * H2;
3565
3577
  }
3566
- function Q2(t3) {
3578
+ function Y2(t3) {
3567
3579
  const s3 = (t3.projName || "").toLowerCase().replace(/_/g, " ");
3568
- t3.long0 || !t3.longc || "albers conic equal area" !== s3 && "lambert azimuthal equal area" !== s3 || (t3.long0 = t3.longc), t3.lat_ts || !t3.lat1 || "stereographic south pole" !== s3 && "polar stereographic (variant b)" !== s3 ? t3.lat_ts || !t3.lat0 || "polar stereographic" !== s3 && "polar stereographic (variant a)" !== s3 || (t3.lat_ts = t3.lat0, t3.lat0 = Z2(t3.lat0 > 0 ? 90 : -90), delete t3.lat1) : (t3.lat0 = Z2(t3.lat1 > 0 ? 90 : -90), t3.lat_ts = t3.lat1, delete t3.lat1);
3580
+ t3.long0 || !t3.longc || "albers conic equal area" !== s3 && "lambert azimuthal equal area" !== s3 || (t3.long0 = t3.longc), t3.lat_ts || !t3.lat1 || "stereographic south pole" !== s3 && "polar stereographic (variant b)" !== s3 ? t3.lat_ts || !t3.lat0 || "polar stereographic" !== s3 && "polar stereographic (variant a)" !== s3 || (t3.lat_ts = t3.lat0, t3.lat0 = X2(t3.lat0 > 0 ? 90 : -90), delete t3.lat1) : (t3.lat0 = X2(t3.lat1 > 0 ? 90 : -90), t3.lat_ts = t3.lat1, delete t3.lat1);
3569
3581
  }
3570
- function X2(t3) {
3582
+ function Z2(t3) {
3571
3583
  let s3 = { units: null, to_meter: void 0 };
3572
3584
  return "string" == typeof t3 ? (s3.units = t3.toLowerCase(), "metre" === s3.units && (s3.units = "meter"), "meter" === s3.units && (s3.to_meter = 1)) : (t3 == null ? void 0 : t3.name) && (s3.units = t3.name.toLowerCase(), "metre" === s3.units && (s3.units = "meter"), s3.to_meter = t3.conversion_factor), s3;
3573
3585
  }
3574
- function Y2(t3) {
3586
+ function Q2(t3) {
3575
3587
  return "object" == typeof t3 ? t3.value * t3.unit.conversion_factor : t3;
3576
3588
  }
3577
3589
  function K2(t3, s3) {
3578
- t3.ellipsoid.radius ? (s3.a = t3.ellipsoid.radius, s3.rf = 0) : (s3.a = Y2(t3.ellipsoid.semi_major_axis), void 0 !== t3.ellipsoid.inverse_flattening ? s3.rf = t3.ellipsoid.inverse_flattening : void 0 !== t3.ellipsoid.semi_major_axis && void 0 !== t3.ellipsoid.semi_minor_axis && (s3.rf = s3.a / (s3.a - Y2(t3.ellipsoid.semi_minor_axis))));
3590
+ t3.ellipsoid.radius ? (s3.a = t3.ellipsoid.radius, s3.rf = 0) : (s3.a = Q2(t3.ellipsoid.semi_major_axis), void 0 !== t3.ellipsoid.inverse_flattening ? s3.rf = t3.ellipsoid.inverse_flattening : void 0 !== t3.ellipsoid.semi_major_axis && void 0 !== t3.ellipsoid.semi_minor_axis && (s3.rf = s3.a / (s3.a - Q2(t3.ellipsoid.semi_minor_axis))));
3579
3591
  }
3580
3592
  function J2(t3, s3 = {}) {
3581
3593
  var _a2;
@@ -3616,10 +3628,10 @@ Me.exports = function() {
3616
3628
  return "s";
3617
3629
  throw new Error(`Unknown axis direction: ${s4}`);
3618
3630
  }).join("") + "u", e3.unit) {
3619
- const { units: t4, to_meter: i4 } = X2(e3.unit);
3631
+ const { units: t4, to_meter: i4 } = Z2(e3.unit);
3620
3632
  s3.units = t4, s3.to_meter = i4;
3621
3633
  } else if ((_c = e3.axis[0]) == null ? void 0 : _c.unit) {
3622
- const { units: t4, to_meter: i4 } = X2(e3.axis[0].unit);
3634
+ const { units: t4, to_meter: i4 } = Z2(e3.axis[0].unit);
3623
3635
  s3.units = t4, s3.to_meter = i4;
3624
3636
  }
3625
3637
  }
@@ -3639,7 +3651,7 @@ Me.exports = function() {
3639
3651
  case "base_crs":
3640
3652
  J2(e3, s3), s3.datumCode = e3.id ? e3.id.authority + "_" + e3.id.code : e3.name;
3641
3653
  }
3642
- }), void 0 !== s3.latitude_of_false_origin && (s3.lat0 = s3.latitude_of_false_origin), void 0 !== s3.longitude_of_false_origin && (s3.long0 = s3.longitude_of_false_origin), void 0 !== s3.latitude_of_standard_parallel && (s3.lat0 = s3.latitude_of_standard_parallel, s3.lat1 = s3.latitude_of_standard_parallel), void 0 !== s3.latitude_of_1st_standard_parallel && (s3.lat1 = s3.latitude_of_1st_standard_parallel), void 0 !== s3.latitude_of_2nd_standard_parallel && (s3.lat2 = s3.latitude_of_2nd_standard_parallel), void 0 !== s3.latitude_of_projection_centre && (s3.lat0 = s3.latitude_of_projection_centre), void 0 !== s3.longitude_of_projection_centre && (s3.longc = s3.longitude_of_projection_centre), void 0 !== s3.easting_at_false_origin && (s3.x0 = s3.easting_at_false_origin), void 0 !== s3.northing_at_false_origin && (s3.y0 = s3.northing_at_false_origin), void 0 !== s3.latitude_of_natural_origin && (s3.lat0 = s3.latitude_of_natural_origin), void 0 !== s3.longitude_of_natural_origin && (s3.long0 = s3.longitude_of_natural_origin), void 0 !== s3.longitude_of_origin && (s3.long0 = s3.longitude_of_origin), void 0 !== s3.false_easting && (s3.x0 = s3.false_easting), s3.easting_at_projection_centre && (s3.x0 = s3.easting_at_projection_centre), void 0 !== s3.false_northing && (s3.y0 = s3.false_northing), s3.northing_at_projection_centre && (s3.y0 = s3.northing_at_projection_centre), void 0 !== s3.standard_parallel_1 && (s3.lat1 = s3.standard_parallel_1), void 0 !== s3.standard_parallel_2 && (s3.lat2 = s3.standard_parallel_2), void 0 !== s3.scale_factor_at_natural_origin && (s3.k0 = s3.scale_factor_at_natural_origin), void 0 !== s3.scale_factor_at_projection_centre && (s3.k0 = s3.scale_factor_at_projection_centre), void 0 !== s3.scale_factor_on_pseudo_standard_parallel && (s3.k0 = s3.scale_factor_on_pseudo_standard_parallel), void 0 !== s3.azimuth && (s3.alpha = s3.azimuth), void 0 !== s3.azimuth_at_projection_centre && (s3.alpha = s3.azimuth_at_projection_centre), s3.angle_from_rectified_to_skew_grid && (s3.rectified_grid_angle = s3.angle_from_rectified_to_skew_grid), Q2(s3), s3) : t3;
3654
+ }), void 0 !== s3.latitude_of_false_origin && (s3.lat0 = s3.latitude_of_false_origin), void 0 !== s3.longitude_of_false_origin && (s3.long0 = s3.longitude_of_false_origin), void 0 !== s3.latitude_of_standard_parallel && (s3.lat0 = s3.latitude_of_standard_parallel, s3.lat1 = s3.latitude_of_standard_parallel), void 0 !== s3.latitude_of_1st_standard_parallel && (s3.lat1 = s3.latitude_of_1st_standard_parallel), void 0 !== s3.latitude_of_2nd_standard_parallel && (s3.lat2 = s3.latitude_of_2nd_standard_parallel), void 0 !== s3.latitude_of_projection_centre && (s3.lat0 = s3.latitude_of_projection_centre), void 0 !== s3.longitude_of_projection_centre && (s3.longc = s3.longitude_of_projection_centre), void 0 !== s3.easting_at_false_origin && (s3.x0 = s3.easting_at_false_origin), void 0 !== s3.northing_at_false_origin && (s3.y0 = s3.northing_at_false_origin), void 0 !== s3.latitude_of_natural_origin && (s3.lat0 = s3.latitude_of_natural_origin), void 0 !== s3.longitude_of_natural_origin && (s3.long0 = s3.longitude_of_natural_origin), void 0 !== s3.longitude_of_origin && (s3.long0 = s3.longitude_of_origin), void 0 !== s3.false_easting && (s3.x0 = s3.false_easting), s3.easting_at_projection_centre && (s3.x0 = s3.easting_at_projection_centre), void 0 !== s3.false_northing && (s3.y0 = s3.false_northing), s3.northing_at_projection_centre && (s3.y0 = s3.northing_at_projection_centre), void 0 !== s3.standard_parallel_1 && (s3.lat1 = s3.standard_parallel_1), void 0 !== s3.standard_parallel_2 && (s3.lat2 = s3.standard_parallel_2), void 0 !== s3.scale_factor_at_natural_origin && (s3.k0 = s3.scale_factor_at_natural_origin), void 0 !== s3.scale_factor_at_projection_centre && (s3.k0 = s3.scale_factor_at_projection_centre), void 0 !== s3.scale_factor_on_pseudo_standard_parallel && (s3.k0 = s3.scale_factor_on_pseudo_standard_parallel), void 0 !== s3.azimuth && (s3.alpha = s3.azimuth), void 0 !== s3.azimuth_at_projection_centre && (s3.alpha = s3.azimuth_at_projection_centre), s3.angle_from_rectified_to_skew_grid && (s3.rectified_grid_angle = s3.angle_from_rectified_to_skew_grid), Y2(s3), s3) : t3;
3643
3655
  }
3644
3656
  var $2 = ["PROJECTEDCRS", "PROJCRS", "GEOGCS", "GEOCCS", "PROJCS", "LOCAL_CS", "GEODCRS", "GEODETICCRS", "GEODETICDATUM", "ENGCRS", "ENGINEERINGCRS"];
3645
3657
  function tt2(t3, s3) {
@@ -3669,9 +3681,9 @@ Me.exports = function() {
3669
3681
  function h3(s4) {
3670
3682
  return s4 * (t3.to_meter || 1);
3671
3683
  }
3672
- "GEOGCS" === t3.type && (r3 = t3), r3 && (r3.DATUM ? t3.datumCode = r3.DATUM.name.toLowerCase() : t3.datumCode = r3.name.toLowerCase(), "d_" === t3.datumCode.slice(0, 2) && (t3.datumCode = t3.datumCode.slice(2)), "new_zealand_1949" === t3.datumCode && (t3.datumCode = "nzgd49"), "wgs_1984" !== t3.datumCode && "world_geodetic_system_1984" !== t3.datumCode || ("Mercator_Auxiliary_Sphere" === t3.PROJECTION && (t3.sphere = true), t3.datumCode = "wgs84"), "belge_1972" === t3.datumCode && (t3.datumCode = "rnb72"), r3.DATUM && r3.DATUM.SPHEROID && (t3.ellps = r3.DATUM.SPHEROID.name.replace("_19", "").replace(/[Cc]larke\_18/, "clrk"), "international" === t3.ellps.toLowerCase().slice(0, 13) && (t3.ellps = "intl"), t3.a = r3.DATUM.SPHEROID.a, t3.rf = parseFloat(r3.DATUM.SPHEROID.rf, 10)), r3.DATUM && r3.DATUM.TOWGS84 && (t3.datum_params = r3.DATUM.TOWGS84), ~t3.datumCode.indexOf("osgb_1936") && (t3.datumCode = "osgb36"), ~t3.datumCode.indexOf("osni_1952") && (t3.datumCode = "osni52"), (~t3.datumCode.indexOf("tm65") || ~t3.datumCode.indexOf("geodetic_datum_of_1965")) && (t3.datumCode = "ire65"), "ch1903+" === t3.datumCode && (t3.datumCode = "ch1903"), ~t3.datumCode.indexOf("israel") && (t3.datumCode = "isr93")), t3.b && !isFinite(t3.b) && (t3.b = t3.a), t3.rectified_grid_angle && (t3.rectified_grid_angle = Z2(t3.rectified_grid_angle)), [["standard_parallel_1", "Standard_Parallel_1"], ["standard_parallel_1", "Latitude of 1st standard parallel"], ["standard_parallel_2", "Standard_Parallel_2"], ["standard_parallel_2", "Latitude of 2nd standard parallel"], ["false_easting", "False_Easting"], ["false_easting", "False easting"], ["false-easting", "Easting at false origin"], ["false_northing", "False_Northing"], ["false_northing", "False northing"], ["false_northing", "Northing at false origin"], ["central_meridian", "Central_Meridian"], ["central_meridian", "Longitude of natural origin"], ["central_meridian", "Longitude of false origin"], ["latitude_of_origin", "Latitude_Of_Origin"], ["latitude_of_origin", "Central_Parallel"], ["latitude_of_origin", "Latitude of natural origin"], ["latitude_of_origin", "Latitude of false origin"], ["scale_factor", "Scale_Factor"], ["k0", "scale_factor"], ["latitude_of_center", "Latitude_Of_Center"], ["latitude_of_center", "Latitude_of_center"], ["lat0", "latitude_of_center", Z2], ["longitude_of_center", "Longitude_Of_Center"], ["longitude_of_center", "Longitude_of_center"], ["longc", "longitude_of_center", Z2], ["x0", "false_easting", h3], ["y0", "false_northing", h3], ["long0", "central_meridian", Z2], ["lat0", "latitude_of_origin", Z2], ["lat0", "standard_parallel_1", Z2], ["lat1", "standard_parallel_1", Z2], ["lat2", "standard_parallel_2", Z2], ["azimuth", "Azimuth"], ["alpha", "azimuth", Z2], ["srsCode", "name"]].forEach(function(s4) {
3684
+ "GEOGCS" === t3.type && (r3 = t3), r3 && (r3.DATUM ? t3.datumCode = r3.DATUM.name.toLowerCase() : t3.datumCode = r3.name.toLowerCase(), "d_" === t3.datumCode.slice(0, 2) && (t3.datumCode = t3.datumCode.slice(2)), "new_zealand_1949" === t3.datumCode && (t3.datumCode = "nzgd49"), "wgs_1984" !== t3.datumCode && "world_geodetic_system_1984" !== t3.datumCode || ("Mercator_Auxiliary_Sphere" === t3.PROJECTION && (t3.sphere = true), t3.datumCode = "wgs84"), "belge_1972" === t3.datumCode && (t3.datumCode = "rnb72"), r3.DATUM && r3.DATUM.SPHEROID && (t3.ellps = r3.DATUM.SPHEROID.name.replace("_19", "").replace(/[Cc]larke\_18/, "clrk"), "international" === t3.ellps.toLowerCase().slice(0, 13) && (t3.ellps = "intl"), t3.a = r3.DATUM.SPHEROID.a, t3.rf = parseFloat(r3.DATUM.SPHEROID.rf, 10)), r3.DATUM && r3.DATUM.TOWGS84 && (t3.datum_params = r3.DATUM.TOWGS84), ~t3.datumCode.indexOf("osgb_1936") && (t3.datumCode = "osgb36"), ~t3.datumCode.indexOf("osni_1952") && (t3.datumCode = "osni52"), (~t3.datumCode.indexOf("tm65") || ~t3.datumCode.indexOf("geodetic_datum_of_1965")) && (t3.datumCode = "ire65"), "ch1903+" === t3.datumCode && (t3.datumCode = "ch1903"), ~t3.datumCode.indexOf("israel") && (t3.datumCode = "isr93")), t3.b && !isFinite(t3.b) && (t3.b = t3.a), t3.rectified_grid_angle && (t3.rectified_grid_angle = X2(t3.rectified_grid_angle)), [["standard_parallel_1", "Standard_Parallel_1"], ["standard_parallel_1", "Latitude of 1st standard parallel"], ["standard_parallel_2", "Standard_Parallel_2"], ["standard_parallel_2", "Latitude of 2nd standard parallel"], ["false_easting", "False_Easting"], ["false_easting", "False easting"], ["false-easting", "Easting at false origin"], ["false_northing", "False_Northing"], ["false_northing", "False northing"], ["false_northing", "Northing at false origin"], ["central_meridian", "Central_Meridian"], ["central_meridian", "Longitude of natural origin"], ["central_meridian", "Longitude of false origin"], ["latitude_of_origin", "Latitude_Of_Origin"], ["latitude_of_origin", "Central_Parallel"], ["latitude_of_origin", "Latitude of natural origin"], ["latitude_of_origin", "Latitude of false origin"], ["scale_factor", "Scale_Factor"], ["k0", "scale_factor"], ["latitude_of_center", "Latitude_Of_Center"], ["latitude_of_center", "Latitude_of_center"], ["lat0", "latitude_of_center", X2], ["longitude_of_center", "Longitude_Of_Center"], ["longitude_of_center", "Longitude_of_center"], ["longc", "longitude_of_center", X2], ["x0", "false_easting", h3], ["y0", "false_northing", h3], ["long0", "central_meridian", X2], ["lat0", "latitude_of_origin", X2], ["lat0", "standard_parallel_1", X2], ["lat1", "standard_parallel_1", X2], ["lat2", "standard_parallel_2", X2], ["azimuth", "Azimuth"], ["alpha", "azimuth", X2], ["srsCode", "name"]].forEach(function(s4) {
3673
3685
  return tt2(t3, s4);
3674
- }), Q2(t3);
3686
+ }), Y2(t3);
3675
3687
  }
3676
3688
  function et2(t3) {
3677
3689
  if ("object" == typeof t3)
@@ -3757,19 +3769,19 @@ Me.exports = function() {
3757
3769
  return t3 < 0 ? -1 : 1;
3758
3770
  }
3759
3771
  function yt2(t3) {
3760
- return Math.abs(t3) <= g2 ? t3 : t3 - ft2(t3) * M2;
3772
+ return Math.abs(t3) <= M2 ? t3 : t3 - ft2(t3) * g2;
3761
3773
  }
3762
3774
  function pt2(t3, s3, i3) {
3763
3775
  var e3 = t3 * i3, a3 = 0.5 * t3;
3764
3776
  return e3 = Math.pow((1 - e3) / (1 + e3), a3), Math.tan(0.5 * (l2 - s3)) / e3;
3765
3777
  }
3766
- function Mt2(t3, s3) {
3778
+ function gt2(t3, s3) {
3767
3779
  for (var i3, e3, a3 = 0.5 * t3, n3 = l2 - 2 * Math.atan(s3), r3 = 0; r3 <= 15; r3++)
3768
3780
  if (i3 = t3 * Math.sin(n3), n3 += e3 = l2 - 2 * Math.atan(s3 * Math.pow((1 - i3) / (1 + i3), a3)) - n3, Math.abs(e3) <= 1e-10)
3769
3781
  return n3;
3770
3782
  return -9999;
3771
3783
  }
3772
- function gt2() {
3784
+ function Mt2() {
3773
3785
  var t3 = this.b / this.a;
3774
3786
  this.es = 1 - t3 * t3, "x0" in this || (this.x0 = 0), "y0" in this || (this.y0 = 0), this.e = Math.sqrt(this.es), this.lat_ts ? this.sphere ? this.k0 = Math.cos(this.lat_ts) : this.k0 = _t2(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) : this.k0 || (this.k ? this.k0 = this.k : this.k0 = 1);
3775
3787
  }
@@ -3793,7 +3805,7 @@ Me.exports = function() {
3793
3805
  i3 = l2 - 2 * Math.atan(Math.exp(-a3 / (this.a * this.k0)));
3794
3806
  else {
3795
3807
  var n3 = Math.exp(-a3 / (this.a * this.k0));
3796
- if (-9999 === (i3 = Mt2(this.e, n3)))
3808
+ if (-9999 === (i3 = gt2(this.e, n3)))
3797
3809
  return null;
3798
3810
  }
3799
3811
  return s3 = yt2(this.long0 + e3 / (this.a * this.k0)), t3.x = s3, t3.y = i3, t3;
@@ -3803,7 +3815,7 @@ Me.exports = function() {
3803
3815
  function Et2(t3) {
3804
3816
  return t3;
3805
3817
  }
3806
- var bt2 = [{ init: gt2, forward: xt2, inverse: wt2, names: ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "Mercator_Variant_A", "merc"] }, { init: St2, forward: Et2, inverse: Et2, names: ["longlat", "identity"] }], Pt2 = {}, vt2 = [];
3818
+ var bt2 = [{ init: Mt2, forward: xt2, inverse: wt2, names: ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "Mercator_Variant_A", "merc"] }, { init: St2, forward: Et2, inverse: Et2, names: ["longlat", "identity"] }], Pt2 = {}, vt2 = [];
3807
3819
  function At2(t3, s3) {
3808
3820
  var i3 = vt2.length;
3809
3821
  return t3.names ? (vt2[i3] = t3, t3.names.forEach(function(t4) {
@@ -3851,7 +3863,7 @@ Me.exports = function() {
3851
3863
  function jt2(t3, s3, i3) {
3852
3864
  var e3 = true;
3853
3865
  void 0 !== i3 && false === i3.includeErrorFields && (e3 = false);
3854
- var a3 = new DataView(s3), n3 = Qt2(a3), r3 = Xt2(a3, n3), h3 = { header: r3, subgrids: Kt2(a3, r3, n3, e3) };
3866
+ var a3 = new DataView(s3), n3 = Yt2(a3), r3 = Zt2(a3, n3), h3 = { header: r3, subgrids: Kt2(a3, r3, n3, e3) };
3855
3867
  return Dt2[t3] = h3, h3;
3856
3868
  }
3857
3869
  async function Ft2(t3, s3) {
@@ -3860,7 +3872,7 @@ Me.exports = function() {
3860
3872
  for (let t4 = h3[1] - 1; t4 >= 0; t4--)
3861
3873
  for (let s4 = h3[0] - 1; s4 >= 0; s4--) {
3862
3874
  var f3 = t4 * h3[0] + s4;
3863
- _3.push([-Zt2(m3[f3]), Zt2(d3[f3])]);
3875
+ _3.push([-Xt2(m3[f3]), Xt2(d3[f3])]);
3864
3876
  }
3865
3877
  i3.push({ del: c3, lim: h3, ll: [-l3, u3], cvs: _3 });
3866
3878
  }
@@ -3879,23 +3891,23 @@ Me.exports = function() {
3879
3891
  function Ht2(t3) {
3880
3892
  return t3 * Math.PI / 180;
3881
3893
  }
3882
- function Zt2(t3) {
3894
+ function Xt2(t3) {
3883
3895
  return t3 / 3600 * Math.PI / 180;
3884
3896
  }
3885
- function Qt2(t3) {
3897
+ function Yt2(t3) {
3886
3898
  var s3 = t3.getInt32(8, false);
3887
3899
  return 11 !== s3 && (11 !== (s3 = t3.getInt32(8, true)) && console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"), true);
3888
3900
  }
3889
- function Xt2(t3, s3) {
3890
- return { nFields: t3.getInt32(8, s3), nSubgridFields: t3.getInt32(24, s3), nSubgrids: t3.getInt32(40, s3), shiftType: Yt2(t3, 56, 64).trim(), fromSemiMajorAxis: t3.getFloat64(120, s3), fromSemiMinorAxis: t3.getFloat64(136, s3), toSemiMajorAxis: t3.getFloat64(152, s3), toSemiMinorAxis: t3.getFloat64(168, s3) };
3901
+ function Zt2(t3, s3) {
3902
+ return { nFields: t3.getInt32(8, s3), nSubgridFields: t3.getInt32(24, s3), nSubgrids: t3.getInt32(40, s3), shiftType: Qt2(t3, 56, 64).trim(), fromSemiMajorAxis: t3.getFloat64(120, s3), fromSemiMinorAxis: t3.getFloat64(136, s3), toSemiMajorAxis: t3.getFloat64(152, s3), toSemiMinorAxis: t3.getFloat64(168, s3) };
3891
3903
  }
3892
- function Yt2(t3, s3, i3) {
3904
+ function Qt2(t3, s3, i3) {
3893
3905
  return String.fromCharCode.apply(null, new Uint8Array(t3.buffer.slice(s3, i3)));
3894
3906
  }
3895
3907
  function Kt2(t3, s3, i3, e3) {
3896
3908
  for (var a3 = 176, n3 = [], r3 = 0; r3 < s3.nSubgrids; r3++) {
3897
3909
  var h3 = $t2(t3, a3, i3), o3 = ts2(t3, a3, h3, i3, e3), c3 = Math.round(1 + (h3.upperLongitude - h3.lowerLongitude) / h3.longitudeInterval), l3 = Math.round(1 + (h3.upperLatitude - h3.lowerLatitude) / h3.latitudeInterval);
3898
- n3.push({ ll: [Zt2(h3.lowerLongitude), Zt2(h3.lowerLatitude)], del: [Zt2(h3.longitudeInterval), Zt2(h3.latitudeInterval)], lim: [c3, l3], count: h3.gridNodeCount, cvs: Jt2(o3) });
3910
+ n3.push({ ll: [Xt2(h3.lowerLongitude), Xt2(h3.lowerLatitude)], del: [Xt2(h3.longitudeInterval), Xt2(h3.latitudeInterval)], lim: [c3, l3], count: h3.gridNodeCount, cvs: Jt2(o3) });
3899
3911
  var u3 = 16;
3900
3912
  false === e3 && (u3 = 8), a3 += 176 + h3.gridNodeCount * u3;
3901
3913
  }
@@ -3903,11 +3915,11 @@ Me.exports = function() {
3903
3915
  }
3904
3916
  function Jt2(t3) {
3905
3917
  return t3.map(function(t4) {
3906
- return [Zt2(t4.longitudeShift), Zt2(t4.latitudeShift)];
3918
+ return [Xt2(t4.longitudeShift), Xt2(t4.latitudeShift)];
3907
3919
  });
3908
3920
  }
3909
3921
  function $t2(t3, s3, i3) {
3910
- return { name: Yt2(t3, s3 + 8, s3 + 16).trim(), parent: Yt2(t3, s3 + 24, s3 + 24 + 8).trim(), lowerLatitude: t3.getFloat64(s3 + 72, i3), upperLatitude: t3.getFloat64(s3 + 88, i3), lowerLongitude: t3.getFloat64(s3 + 104, i3), upperLongitude: t3.getFloat64(s3 + 120, i3), latitudeInterval: t3.getFloat64(s3 + 136, i3), longitudeInterval: t3.getFloat64(s3 + 152, i3), gridNodeCount: t3.getInt32(s3 + 168, i3) };
3922
+ return { name: Qt2(t3, s3 + 8, s3 + 16).trim(), parent: Qt2(t3, s3 + 24, s3 + 24 + 8).trim(), lowerLatitude: t3.getFloat64(s3 + 72, i3), upperLatitude: t3.getFloat64(s3 + 88, i3), lowerLongitude: t3.getFloat64(s3 + 104, i3), upperLongitude: t3.getFloat64(s3 + 120, i3), latitudeInterval: t3.getFloat64(s3 + 136, i3), longitudeInterval: t3.getFloat64(s3 + 152, i3), gridNodeCount: t3.getInt32(s3 + 168, i3) };
3911
3923
  }
3912
3924
  function ts2(t3, s3, i3, e3, a3) {
3913
3925
  var n3 = s3 + 176, r3 = 16;
@@ -3959,17 +3971,17 @@ Me.exports = function() {
3959
3971
  return h3 > Math.PI && (h3 -= 2 * Math.PI), a3 = Math.sin(o3), r3 = Math.cos(o3), n3 = a3 * a3, { x: ((e3 = i3 / Math.sqrt(1 - s3 * n3)) + c3) * r3 * Math.cos(h3), y: (e3 + c3) * r3 * Math.sin(h3), z: (e3 * (1 - s3) + c3) * a3 };
3960
3972
  }
3961
3973
  function as2(t3, s3, i3, e3) {
3962
- var a3, n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3, p3, M3, g3 = 1e-12, x3 = g3 * g3, w3 = 30, S3 = t3.x, E3 = t3.y, b3 = t3.z ? t3.z : 0;
3963
- if (a3 = Math.sqrt(S3 * S3 + E3 * E3), n3 = Math.sqrt(S3 * S3 + E3 * E3 + b3 * b3), a3 / i3 < g3) {
3964
- if (p3 = 0, n3 / i3 < g3)
3965
- return M3 = -e3, { x: t3.x, y: t3.y, z: t3.z };
3974
+ var a3, n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3, p3, g3, M3 = 1e-12, x3 = M3 * M3, w3 = 30, S3 = t3.x, E3 = t3.y, b3 = t3.z ? t3.z : 0;
3975
+ if (a3 = Math.sqrt(S3 * S3 + E3 * E3), n3 = Math.sqrt(S3 * S3 + E3 * E3 + b3 * b3), a3 / i3 < M3) {
3976
+ if (p3 = 0, n3 / i3 < M3)
3977
+ return g3 = -e3, { x: t3.x, y: t3.y, z: t3.z };
3966
3978
  } else
3967
3979
  p3 = Math.atan2(E3, S3);
3968
3980
  r3 = b3 / n3, u3 = (h3 = a3 / n3) * (1 - s3) * (o3 = 1 / Math.sqrt(1 - s3 * (2 - s3) * h3 * h3)), d3 = r3 * o3, y3 = 0;
3969
3981
  do {
3970
- y3++, c3 = s3 * (l3 = i3 / Math.sqrt(1 - s3 * d3 * d3)) / (l3 + (M3 = a3 * u3 + b3 * d3 - l3 * (1 - s3 * d3 * d3))), f3 = (_3 = r3 * (o3 = 1 / Math.sqrt(1 - c3 * (2 - c3) * h3 * h3))) * u3 - (m3 = h3 * (1 - c3) * o3) * d3, u3 = m3, d3 = _3;
3982
+ y3++, c3 = s3 * (l3 = i3 / Math.sqrt(1 - s3 * d3 * d3)) / (l3 + (g3 = a3 * u3 + b3 * d3 - l3 * (1 - s3 * d3 * d3))), f3 = (_3 = r3 * (o3 = 1 / Math.sqrt(1 - c3 * (2 - c3) * h3 * h3))) * u3 - (m3 = h3 * (1 - c3) * o3) * d3, u3 = m3, d3 = _3;
3971
3983
  } while (f3 * f3 > x3 && y3 < w3);
3972
- return { x: p3, y: Math.atan(_3 / Math.abs(m3)), z: M3 };
3984
+ return { x: p3, y: Math.atan(_3 / Math.abs(m3)), z: g3 };
3973
3985
  }
3974
3986
  function ns2(t3, e3, a3) {
3975
3987
  if (e3 === s2)
@@ -4121,8 +4133,8 @@ Me.exports = function() {
4121
4133
  return s3.from_greenwich && (i3 = { x: i3.x - s3.from_greenwich, y: i3.y, z: i3.z || 0 }), "longlat" === s3.projName ? i3 = { x: i3.x * y2, y: i3.y * y2, z: i3.z || 0 } : (i3 = s3.forward(i3), s3.to_meter && (i3 = { x: i3.x / s3.to_meter, y: i3.y / s3.to_meter, z: i3.z || 0 })), e3 && "enu" !== s3.axis ? ds2(s3, true, i3) : (i3 && !n3 && delete i3.z, i3);
4122
4134
  }
4123
4135
  ss2.projections = It2, ss2.projections.start();
4124
- var Ms2 = ss2("WGS84");
4125
- function gs2(t3, s3, i3, e3) {
4136
+ var gs2 = ss2("WGS84");
4137
+ function Ms2(t3, s3, i3, e3) {
4126
4138
  var a3, n3, r3;
4127
4139
  return Array.isArray(i3) ? (a3 = ps2(t3, s3, i3, e3) || { x: NaN, y: NaN }, i3.length > 2 ? void 0 !== t3.name && "geocent" === t3.name || void 0 !== s3.name && "geocent" === s3.name ? "number" == typeof a3.z ? [a3.x, a3.y, a3.z].concat(i3.slice(3)) : [a3.x, a3.y, i3[2]].concat(i3.slice(3)) : [a3.x, a3.y].concat(i3.slice(2)) : [a3.x, a3.y]) : (n3 = ps2(t3, s3, i3, e3), 2 === (r3 = Object.keys(i3)).length || r3.forEach(function(e4) {
4128
4140
  if (void 0 !== t3.name && "geocent" === t3.name || void 0 !== s3.name && "geocent" === s3.name) {
@@ -4139,10 +4151,10 @@ Me.exports = function() {
4139
4151
  function ws2(t3, s3, i3) {
4140
4152
  t3 = xs2(t3);
4141
4153
  var e3, a3 = false;
4142
- return void 0 === s3 ? (s3 = t3, t3 = Ms2, a3 = true) : (void 0 !== s3.x || Array.isArray(s3)) && (i3 = s3, s3 = t3, t3 = Ms2, a3 = true), s3 = xs2(s3), i3 ? gs2(t3, s3, i3) : (e3 = { forward: function(i4, e4) {
4143
- return gs2(t3, s3, i4, e4);
4154
+ return void 0 === s3 ? (s3 = t3, t3 = gs2, a3 = true) : (void 0 !== s3.x || Array.isArray(s3)) && (i3 = s3, s3 = t3, t3 = gs2, a3 = true), s3 = xs2(s3), i3 ? Ms2(t3, s3, i3) : (e3 = { forward: function(i4, e4) {
4155
+ return Ms2(t3, s3, i4, e4);
4144
4156
  }, inverse: function(i4, e4) {
4145
- return gs2(s3, t3, i4, e4);
4157
+ return Ms2(s3, t3, i4, e4);
4146
4158
  } }, a3 && (e3.oProj = s3), e3);
4147
4159
  }
4148
4160
  var Ss2 = 6, Es2 = "AJSAJS", bs2 = "AFAFAF", Ps2 = 65, vs2 = 73, As2 = 79, Gs2 = 86, Cs2 = 90, Ns2 = { forward: Is2, inverse: zs2, toPoint: Ts2 };
@@ -4173,8 +4185,8 @@ Me.exports = function() {
4173
4185
  var s3 = t3.northing, i3 = t3.easting, e3 = t3.zoneLetter, a3 = t3.zoneNumber;
4174
4186
  if (a3 < 0 || a3 > 60)
4175
4187
  return null;
4176
- var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3 = 0.9996, f3 = 6378137, y3 = 669438e-8, p3 = (1 - Math.sqrt(1 - y3)) / (1 + Math.sqrt(1 - y3)), M3 = i3 - 5e5, g3 = s3;
4177
- e3 < "N" && (g3 -= 1e7), u3 = 6 * (a3 - 1) - 180 + 3, n3 = y3 / (1 - y3), m3 = (d3 = g3 / _3 / (f3 * (1 - y3 / 4 - 3 * y3 * y3 / 64 - 5 * y3 * y3 * y3 / 256))) + (3 * p3 / 2 - 27 * p3 * p3 * p3 / 32) * Math.sin(2 * d3) + (21 * p3 * p3 / 16 - 55 * p3 * p3 * p3 * p3 / 32) * Math.sin(4 * d3) + 151 * p3 * p3 * p3 / 96 * Math.sin(6 * d3), r3 = f3 / Math.sqrt(1 - y3 * Math.sin(m3) * Math.sin(m3)), h3 = Math.tan(m3) * Math.tan(m3), o3 = n3 * Math.cos(m3) * Math.cos(m3), c3 = f3 * (1 - y3) / Math.pow(1 - y3 * Math.sin(m3) * Math.sin(m3), 1.5), l3 = M3 / (r3 * _3);
4188
+ var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3 = 0.9996, f3 = 6378137, y3 = 669438e-8, p3 = (1 - Math.sqrt(1 - y3)) / (1 + Math.sqrt(1 - y3)), g3 = i3 - 5e5, M3 = s3;
4189
+ e3 < "N" && (M3 -= 1e7), u3 = 6 * (a3 - 1) - 180 + 3, n3 = y3 / (1 - y3), m3 = (d3 = M3 / _3 / (f3 * (1 - y3 / 4 - 3 * y3 * y3 / 64 - 5 * y3 * y3 * y3 / 256))) + (3 * p3 / 2 - 27 * p3 * p3 * p3 / 32) * Math.sin(2 * d3) + (21 * p3 * p3 / 16 - 55 * p3 * p3 * p3 * p3 / 32) * Math.sin(4 * d3) + 151 * p3 * p3 * p3 / 96 * Math.sin(6 * d3), r3 = f3 / Math.sqrt(1 - y3 * Math.sin(m3) * Math.sin(m3)), h3 = Math.tan(m3) * Math.tan(m3), o3 = n3 * Math.cos(m3) * Math.cos(m3), c3 = f3 * (1 - y3) / Math.pow(1 - y3 * Math.sin(m3) * Math.sin(m3), 1.5), l3 = g3 / (r3 * _3);
4178
4190
  var x3 = m3 - r3 * Math.tan(m3) / c3 * (l3 * l3 / 2 - (5 + 3 * h3 + 10 * o3 - 4 * o3 * o3 - 9 * n3) * l3 * l3 * l3 * l3 / 24 + (61 + 90 * h3 + 298 * o3 + 45 * h3 * h3 - 252 * n3 - 3 * o3 * o3) * l3 * l3 * l3 * l3 * l3 * l3 / 720);
4179
4191
  x3 = Rs2(x3);
4180
4192
  var w3, S3 = (l3 - (1 + 2 * h3 + o3) * l3 * l3 * l3 / 6 + (5 - 2 * o3 + 28 * h3 - 3 * o3 * o3 + 8 * n3 + 24 * h3 * h3) * l3 * l3 * l3 * l3 * l3 / 120) / Math.cos(m3);
@@ -4322,9 +4334,9 @@ Me.exports = function() {
4322
4334
  return s3;
4323
4335
  throw "Invalid zone letter: " + t3;
4324
4336
  }
4325
- function Zs2(t3, s3, i3) {
4326
- if (!(this instanceof Zs2))
4327
- return new Zs2(t3, s3, i3);
4337
+ function Xs2(t3, s3, i3) {
4338
+ if (!(this instanceof Xs2))
4339
+ return new Xs2(t3, s3, i3);
4328
4340
  if (Array.isArray(t3))
4329
4341
  this.x = t3[0], this.y = t3[1], this.z = t3[2] || 0;
4330
4342
  else if ("object" == typeof t3)
@@ -4336,15 +4348,15 @@ Me.exports = function() {
4336
4348
  this.x = t3, this.y = s3, this.z = i3 || 0;
4337
4349
  console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");
4338
4350
  }
4339
- Zs2.fromMGRS = function(t3) {
4340
- return new Zs2(Ts2(t3));
4341
- }, Zs2.prototype.toMGRS = function(t3) {
4351
+ Xs2.fromMGRS = function(t3) {
4352
+ return new Xs2(Ts2(t3));
4353
+ }, Xs2.prototype.toMGRS = function(t3) {
4342
4354
  return Is2([this.x, this.y], t3);
4343
4355
  };
4344
- var Qs2 = 1, Xs2 = 0.25, Ys2 = 0.046875, Ks2 = 0.01953125, Js2 = 0.01068115234375, $s2 = 0.75, ti2 = 0.46875, si2 = 0.013020833333333334, ii2 = 0.007120768229166667, ei2 = 0.3645833333333333, ai2 = 0.005696614583333333, ni2 = 0.3076171875;
4356
+ var Ys2 = 1, Zs2 = 0.25, Qs2 = 0.046875, Ks2 = 0.01953125, Js2 = 0.01068115234375, $s2 = 0.75, ti2 = 0.46875, si2 = 0.013020833333333334, ii2 = 0.007120768229166667, ei2 = 0.3645833333333333, ai2 = 0.005696614583333333, ni2 = 0.3076171875;
4345
4357
  function ri2(t3) {
4346
4358
  var s3 = [];
4347
- s3[0] = Qs2 - t3 * (Xs2 + t3 * (Ys2 + t3 * (Ks2 + t3 * Js2))), s3[1] = t3 * ($s2 - t3 * (Ys2 + t3 * (Ks2 + t3 * Js2)));
4359
+ s3[0] = Ys2 - t3 * (Zs2 + t3 * (Qs2 + t3 * (Ks2 + t3 * Js2))), s3[1] = t3 * ($s2 - t3 * (Qs2 + t3 * (Ks2 + t3 * Js2)));
4348
4360
  var i3 = t3 * t3;
4349
4361
  return s3[2] = i3 * (ti2 - t3 * (si2 + t3 * ii2)), i3 *= t3, s3[3] = i3 * (ei2 - t3 * ai2), s3[4] = i3 * t3 * ni2, s3;
4350
4362
  }
@@ -4371,11 +4383,11 @@ Me.exports = function() {
4371
4383
  var p3 = hi2(n3, h3, o3, this.en);
4372
4384
  i3 = this.a * (this.k0 * c3 * (1 + l3 / 6 * (1 - f3 + u3 + l3 / 20 * (5 - 18 * f3 + y3 + 14 * u3 - 58 * f3 * u3 + l3 / 42 * (61 + 179 * y3 - y3 * f3 - 479 * f3))))) + this.x0, e3 = this.a * (this.k0 * (p3 - this.ml0 + h3 * r3 * c3 / 2 * (1 + l3 / 12 * (5 - f3 + 9 * u3 + 4 * d3 + l3 / 30 * (61 + y3 - 58 * f3 + 270 * u3 - 330 * f3 * u3 + l3 / 56 * (1385 + 543 * y3 - y3 * f3 - 3111 * f3)))))) + this.y0;
4373
4385
  } else {
4374
- var M3 = o3 * Math.sin(r3);
4375
- if (Math.abs(Math.abs(M3) - 1) < _2)
4386
+ var g3 = o3 * Math.sin(r3);
4387
+ if (Math.abs(Math.abs(g3) - 1) < _2)
4376
4388
  return 93;
4377
- if (i3 = 0.5 * this.a * this.k0 * Math.log((1 + M3) / (1 - M3)) + this.x0, e3 = o3 * Math.cos(r3) / Math.sqrt(1 - Math.pow(M3, 2)), (M3 = Math.abs(e3)) >= 1) {
4378
- if (M3 - 1 > _2)
4389
+ if (i3 = 0.5 * this.a * this.k0 * Math.log((1 + g3) / (1 - g3)) + this.x0, e3 = o3 * Math.cos(r3) / Math.sqrt(1 - Math.pow(g3, 2)), (g3 = Math.abs(e3)) >= 1) {
4390
+ if (g3 - 1 > _2)
4379
4391
  return 93;
4380
4392
  e3 = 0;
4381
4393
  } else
@@ -4395,8 +4407,8 @@ Me.exports = function() {
4395
4407
  } else
4396
4408
  e3 = l2 * ft2(r3), a3 = 0;
4397
4409
  else {
4398
- var M3 = Math.exp(n3 / this.k0), g3 = 0.5 * (M3 - 1 / M3), x3 = this.lat0 + r3 / this.k0, w3 = Math.cos(x3);
4399
- s3 = Math.sqrt((1 - Math.pow(w3, 2)) / (1 + Math.pow(g3, 2))), e3 = Math.asin(s3), r3 < 0 && (e3 = -e3), a3 = 0 === g3 && 0 === w3 ? 0 : yt2(Math.atan2(g3, w3) + this.long0);
4410
+ var g3 = Math.exp(n3 / this.k0), M3 = 0.5 * (g3 - 1 / g3), x3 = this.lat0 + r3 / this.k0, w3 = Math.cos(x3);
4411
+ s3 = Math.sqrt((1 - Math.pow(w3, 2)) / (1 + Math.pow(M3, 2))), e3 = Math.asin(s3), r3 < 0 && (e3 = -e3), a3 = 0 === M3 && 0 === w3 ? 0 : yt2(Math.atan2(M3, w3) + this.long0);
4400
4412
  }
4401
4413
  return t3.x = a3, t3.y = e3, t3;
4402
4414
  }
@@ -4418,12 +4430,12 @@ Me.exports = function() {
4418
4430
  var s3 = Math.abs(t3);
4419
4431
  return s3 = yi2(s3 * (1 + s3 / (fi2(1, s3) + 1))), t3 < 0 ? -s3 : s3;
4420
4432
  }
4421
- function Mi2(t3, s3) {
4433
+ function gi2(t3, s3) {
4422
4434
  for (var i3, e3 = 2 * Math.cos(2 * s3), a3 = t3.length - 1, n3 = t3[a3], r3 = 0; --a3 >= 0; )
4423
4435
  i3 = e3 * n3 - r3 + t3[a3], r3 = n3, n3 = i3;
4424
4436
  return s3 + i3 * Math.sin(2 * s3);
4425
4437
  }
4426
- function gi2(t3, s3) {
4438
+ function Mi2(t3, s3) {
4427
4439
  for (var i3, e3 = 2 * Math.cos(s3), a3 = t3.length - 1, n3 = t3[a3], r3 = 0; --a3 >= 0; )
4428
4440
  i3 = e3 * n3 - r3 + t3[a3], r3 = n3, n3 = i3;
4429
4441
  return Math.sin(s3) * i3;
@@ -4443,12 +4455,12 @@ Me.exports = function() {
4443
4455
  this.approx && (mi2.init.apply(this), this.forward = mi2.forward, this.inverse = mi2.inverse), this.x0 = void 0 !== this.x0 ? this.x0 : 0, this.y0 = void 0 !== this.y0 ? this.y0 : 0, this.long0 = void 0 !== this.long0 ? this.long0 : 0, this.lat0 = void 0 !== this.lat0 ? this.lat0 : 0, this.cgb = [], this.cbg = [], this.utg = [], this.gtu = [];
4444
4456
  var t3 = this.es / (1 + Math.sqrt(1 - this.es)), s3 = t3 / (2 - t3), i3 = s3;
4445
4457
  this.cgb[0] = s3 * (2 + s3 * (-2 / 3 + s3 * (s3 * (116 / 45 + s3 * (26 / 45 + s3 * (-2854 / 675))) - 2))), this.cbg[0] = s3 * (s3 * (2 / 3 + s3 * (4 / 3 + s3 * (-82 / 45 + s3 * (32 / 45 + s3 * (4642 / 4725))))) - 2), i3 *= s3, this.cgb[1] = i3 * (7 / 3 + s3 * (s3 * (-227 / 45 + s3 * (2704 / 315 + s3 * (2323 / 945))) - 1.6)), this.cbg[1] = i3 * (5 / 3 + s3 * (-16 / 15 + s3 * (-13 / 9 + s3 * (904 / 315 + s3 * (-1522 / 945))))), i3 *= s3, this.cgb[2] = i3 * (56 / 15 + s3 * (-136 / 35 + s3 * (-1262 / 105 + s3 * (73814 / 2835)))), this.cbg[2] = i3 * (-26 / 15 + s3 * (34 / 21 + s3 * (1.6 + s3 * (-12686 / 2835)))), i3 *= s3, this.cgb[3] = i3 * (4279 / 630 + s3 * (-332 / 35 + s3 * (-399572 / 14175))), this.cbg[3] = i3 * (1237 / 630 + s3 * (s3 * (-24832 / 14175) - 2.4)), i3 *= s3, this.cgb[4] = i3 * (4174 / 315 + s3 * (-144838 / 6237)), this.cbg[4] = i3 * (-734 / 315 + s3 * (109598 / 31185)), i3 *= s3, this.cgb[5] = i3 * (601676 / 22275), this.cbg[5] = i3 * (444337 / 155925), i3 = Math.pow(s3, 2), this.Qn = this.k0 / (1 + s3) * (1 + i3 * (1 / 4 + i3 * (1 / 64 + i3 / 256))), this.utg[0] = s3 * (s3 * (2 / 3 + s3 * (-37 / 96 + s3 * (1 / 360 + s3 * (81 / 512 + s3 * (-96199 / 604800))))) - 0.5), this.gtu[0] = s3 * (0.5 + s3 * (-2 / 3 + s3 * (5 / 16 + s3 * (41 / 180 + s3 * (-127 / 288 + s3 * (7891 / 37800)))))), this.utg[1] = i3 * (-1 / 48 + s3 * (-1 / 15 + s3 * (437 / 1440 + s3 * (-46 / 105 + s3 * (1118711 / 3870720))))), this.gtu[1] = i3 * (13 / 48 + s3 * (s3 * (557 / 1440 + s3 * (281 / 630 + s3 * (-1983433 / 1935360))) - 0.6)), i3 *= s3, this.utg[2] = i3 * (-17 / 480 + s3 * (37 / 840 + s3 * (209 / 4480 + s3 * (-5569 / 90720)))), this.gtu[2] = i3 * (61 / 240 + s3 * (-103 / 140 + s3 * (15061 / 26880 + s3 * (167603 / 181440)))), i3 *= s3, this.utg[3] = i3 * (-4397 / 161280 + s3 * (11 / 504 + s3 * (830251 / 7257600))), this.gtu[3] = i3 * (49561 / 161280 + s3 * (-179 / 168 + s3 * (6601661 / 7257600))), i3 *= s3, this.utg[4] = i3 * (-4583 / 161280 + s3 * (108847 / 3991680)), this.gtu[4] = i3 * (34729 / 80640 + s3 * (-3418889 / 1995840)), i3 *= s3, this.utg[5] = i3 * (-20648693 / 638668800), this.gtu[5] = 0.6650675310896665 * i3;
4446
- var e3 = Mi2(this.cbg, this.lat0);
4447
- this.Zb = -this.Qn * (e3 + gi2(this.gtu, 2 * e3));
4458
+ var e3 = gi2(this.cbg, this.lat0);
4459
+ this.Zb = -this.Qn * (e3 + Mi2(this.gtu, 2 * e3));
4448
4460
  }
4449
4461
  function Ei2(t3) {
4450
4462
  var s3 = yt2(t3.x - this.long0), i3 = t3.y;
4451
- i3 = Mi2(this.cbg, i3);
4463
+ i3 = gi2(this.cbg, i3);
4452
4464
  var e3 = Math.sin(i3), a3 = Math.cos(i3), n3 = Math.sin(s3), r3 = Math.cos(s3);
4453
4465
  i3 = Math.atan2(e3, r3 * a3), s3 = Math.atan2(n3 * a3, fi2(e3, a3 * r3)), s3 = pi2(Math.tan(s3));
4454
4466
  var h3, o3, c3 = wi2(this.gtu, 2 * i3, 2 * s3);
@@ -4460,7 +4472,7 @@ Me.exports = function() {
4460
4472
  var n3 = wi2(this.utg, 2 * a3, 2 * e3);
4461
4473
  a3 += n3[0], e3 += n3[1], e3 = Math.atan(_i2(e3));
4462
4474
  var r3 = Math.sin(a3), h3 = Math.cos(a3), o3 = Math.sin(e3), c3 = Math.cos(e3);
4463
- a3 = Math.atan2(r3 * c3, fi2(o3, c3 * h3)), s3 = yt2((e3 = Math.atan2(o3, c3 * h3)) + this.long0), i3 = Mi2(this.cgb, a3);
4475
+ a3 = Math.atan2(r3 * c3, fi2(o3, c3 * h3)), s3 = yt2((e3 = Math.atan2(o3, c3 * h3)) + this.long0), i3 = gi2(this.cgb, a3);
4464
4476
  } else
4465
4477
  s3 = 1 / 0, i3 = 1 / 0;
4466
4478
  return t3.x = s3, t3.y = i3, t3;
@@ -4538,9 +4550,9 @@ Me.exports = function() {
4538
4550
  if (Math.abs(this.coslat0) <= _2) {
4539
4551
  if (r3 <= _2)
4540
4552
  return i3 = this.lat0, s3 = this.long0, t3.x = s3, t3.y = i3, t3;
4541
- t3.x *= this.con, t3.y *= this.con, e3 = r3 * this.cons / (2 * this.a * this.k0), i3 = this.con * Mt2(this.e, e3), s3 = this.con * yt2(this.con * this.long0 + Math.atan2(t3.x, -1 * t3.y));
4553
+ t3.x *= this.con, t3.y *= this.con, e3 = r3 * this.cons / (2 * this.a * this.k0), i3 = this.con * gt2(this.e, e3), s3 = this.con * yt2(this.con * this.long0 + Math.atan2(t3.x, -1 * t3.y));
4542
4554
  } else
4543
- a3 = 2 * Math.atan(r3 * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), s3 = this.long0, r3 <= _2 ? n3 = this.X0 : (n3 = Math.asin(Math.cos(a3) * this.sinX0 + t3.y * Math.sin(a3) * this.cosX0 / r3), s3 = yt2(this.long0 + Math.atan2(t3.x * Math.sin(a3), r3 * this.cosX0 * Math.cos(a3) - t3.y * this.sinX0 * Math.sin(a3)))), i3 = -1 * Mt2(this.e, Math.tan(0.5 * (l2 + n3)));
4555
+ a3 = 2 * Math.atan(r3 * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), s3 = this.long0, r3 <= _2 ? n3 = this.X0 : (n3 = Math.asin(Math.cos(a3) * this.sinX0 + t3.y * Math.sin(a3) * this.cosX0 / r3), s3 = yt2(this.long0 + Math.atan2(t3.x * Math.sin(a3), r3 * this.cosX0 * Math.cos(a3) - t3.y * this.sinX0 * Math.sin(a3)))), i3 = -1 * gt2(this.e, Math.tan(0.5 * (l2 + n3)));
4544
4556
  return t3.x = s3, t3.y = i3, t3;
4545
4557
  }
4546
4558
  var Fi2 = { init: Di2, forward: Ui2, inverse: ji2, names: ["stere", "Stereographic_South_Pole", "Polar_Stereographic_variant_A", "Polar_Stereographic_variant_B", "Polar_Stereographic"], ssfn_: ki2 };
@@ -4564,30 +4576,30 @@ Me.exports = function() {
4564
4576
  }
4565
4577
  return t3.x = h3, t3.y = c3, t3;
4566
4578
  }
4567
- var Zi2 = { init: Vi2, forward: Wi2, inverse: Hi2, names: ["somerc"] }, Qi2 = 1e-7;
4568
- function Xi2(t3) {
4579
+ var Xi2 = { init: Vi2, forward: Wi2, inverse: Hi2, names: ["somerc"] }, Yi2 = 1e-7;
4580
+ function Zi2(t3) {
4569
4581
  var s3 = ["Hotine_Oblique_Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"], i3 = "object" == typeof t3.projName ? Object.keys(t3.projName)[0] : t3.projName;
4570
4582
  return "no_uoff" in t3 || "no_off" in t3 || -1 !== s3.indexOf(i3) || -1 !== s3.indexOf(Gt2(i3));
4571
4583
  }
4572
- function Yi2() {
4573
- var t3, s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3 = 0, m3 = 0, f3 = 0, y3 = 0, g3 = 0, x3 = 0, w3 = 0;
4574
- this.no_off = Xi2(this), this.no_rot = "no_rot" in this;
4584
+ function Qi2() {
4585
+ var t3, s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3 = 0, m3 = 0, f3 = 0, y3 = 0, M3 = 0, x3 = 0, w3 = 0;
4586
+ this.no_off = Zi2(this), this.no_rot = "no_rot" in this;
4575
4587
  var S3 = false;
4576
4588
  "alpha" in this && (S3 = true);
4577
4589
  var E3 = false;
4578
4590
  if ("rectified_grid_angle" in this && (E3 = true), S3 && (w3 = this.alpha), E3 && (d3 = this.rectified_grid_angle), S3 || E3)
4579
4591
  m3 = this.longc;
4580
- else if (f3 = this.long1, g3 = this.lat1, y3 = this.long2, x3 = this.lat2, Math.abs(g3 - x3) <= Qi2 || (t3 = Math.abs(g3)) <= Qi2 || Math.abs(t3 - l2) <= Qi2 || Math.abs(Math.abs(this.lat0) - l2) <= Qi2 || Math.abs(Math.abs(x3) - l2) <= Qi2)
4592
+ else if (f3 = this.long1, M3 = this.lat1, y3 = this.long2, x3 = this.lat2, Math.abs(M3 - x3) <= Yi2 || (t3 = Math.abs(M3)) <= Yi2 || Math.abs(t3 - l2) <= Yi2 || Math.abs(Math.abs(this.lat0) - l2) <= Yi2 || Math.abs(Math.abs(x3) - l2) <= Yi2)
4581
4593
  throw new Error();
4582
4594
  var b3 = 1 - this.es;
4583
- s3 = Math.sqrt(b3), Math.abs(this.lat0) > _2 ? (h3 = Math.sin(this.lat0), i3 = Math.cos(this.lat0), t3 = 1 - this.es * h3 * h3, this.B = i3 * i3, this.B = Math.sqrt(1 + this.es * this.B * this.B / b3), this.A = this.B * this.k0 * s3 / t3, (a3 = (e3 = this.B * s3 / (i3 * Math.sqrt(t3))) * e3 - 1) <= 0 ? a3 = 0 : (a3 = Math.sqrt(a3), this.lat0 < 0 && (a3 = -a3)), this.E = a3 += e3, this.E *= Math.pow(pt2(this.e, this.lat0, h3), this.B)) : (this.B = 1 / s3, this.A = this.k0, this.E = e3 = a3 = 1), S3 || E3 ? (S3 ? (u3 = Math.asin(Math.sin(w3) / e3), E3 || (d3 = w3)) : (u3 = d3, w3 = Math.asin(e3 * Math.sin(u3))), this.lam0 = m3 - Math.asin(0.5 * (a3 - 1 / a3) * Math.tan(u3)) / this.B) : (n3 = Math.pow(pt2(this.e, g3, Math.sin(g3)), this.B), r3 = Math.pow(pt2(this.e, x3, Math.sin(x3)), this.B), a3 = this.E / n3, o3 = (r3 - n3) / (r3 + n3), c3 = ((c3 = this.E * this.E) - r3 * n3) / (c3 + r3 * n3), (t3 = f3 - y3) < -Math.pi ? y3 -= M2 : t3 > Math.pi && (y3 += M2), this.lam0 = yt2(0.5 * (f3 + y3) - Math.atan(c3 * Math.tan(0.5 * this.B * (f3 - y3)) / o3) / this.B), u3 = Math.atan(2 * Math.sin(this.B * yt2(f3 - this.lam0)) / (a3 - 1 / a3)), d3 = w3 = Math.asin(e3 * Math.sin(u3))), this.singam = Math.sin(u3), this.cosgam = Math.cos(u3), this.sinrot = Math.sin(d3), this.cosrot = Math.cos(d3), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(e3 * e3 - 1) / Math.cos(w3))), this.lat0 < 0 && (this.u_0 = -this.u_0)), a3 = 0.5 * u3, this.v_pole_n = this.ArB * Math.log(Math.tan(p2 - a3)), this.v_pole_s = this.ArB * Math.log(Math.tan(p2 + a3));
4595
+ s3 = Math.sqrt(b3), Math.abs(this.lat0) > _2 ? (h3 = Math.sin(this.lat0), i3 = Math.cos(this.lat0), t3 = 1 - this.es * h3 * h3, this.B = i3 * i3, this.B = Math.sqrt(1 + this.es * this.B * this.B / b3), this.A = this.B * this.k0 * s3 / t3, (a3 = (e3 = this.B * s3 / (i3 * Math.sqrt(t3))) * e3 - 1) <= 0 ? a3 = 0 : (a3 = Math.sqrt(a3), this.lat0 < 0 && (a3 = -a3)), this.E = a3 += e3, this.E *= Math.pow(pt2(this.e, this.lat0, h3), this.B)) : (this.B = 1 / s3, this.A = this.k0, this.E = e3 = a3 = 1), S3 || E3 ? (S3 ? (u3 = Math.asin(Math.sin(w3) / e3), E3 || (d3 = w3)) : (u3 = d3, w3 = Math.asin(e3 * Math.sin(u3))), this.lam0 = m3 - Math.asin(0.5 * (a3 - 1 / a3) * Math.tan(u3)) / this.B) : (n3 = Math.pow(pt2(this.e, M3, Math.sin(M3)), this.B), r3 = Math.pow(pt2(this.e, x3, Math.sin(x3)), this.B), a3 = this.E / n3, o3 = (r3 - n3) / (r3 + n3), c3 = ((c3 = this.E * this.E) - r3 * n3) / (c3 + r3 * n3), (t3 = f3 - y3) < -Math.pi ? y3 -= g2 : t3 > Math.pi && (y3 += g2), this.lam0 = yt2(0.5 * (f3 + y3) - Math.atan(c3 * Math.tan(0.5 * this.B * (f3 - y3)) / o3) / this.B), u3 = Math.atan(2 * Math.sin(this.B * yt2(f3 - this.lam0)) / (a3 - 1 / a3)), d3 = w3 = Math.asin(e3 * Math.sin(u3))), this.singam = Math.sin(u3), this.cosgam = Math.cos(u3), this.sinrot = Math.sin(d3), this.cosrot = Math.cos(d3), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(e3 * e3 - 1) / Math.cos(w3))), this.lat0 < 0 && (this.u_0 = -this.u_0)), a3 = 0.5 * u3, this.v_pole_n = this.ArB * Math.log(Math.tan(p2 - a3)), this.v_pole_s = this.ArB * Math.log(Math.tan(p2 + a3));
4584
4596
  }
4585
4597
  function Ki2(t3) {
4586
4598
  var s3, i3, e3, a3, n3, r3, h3, o3, c3 = {};
4587
4599
  if (t3.x = t3.x - this.lam0, Math.abs(Math.abs(t3.y) - l2) > _2) {
4588
4600
  if (s3 = 0.5 * ((n3 = this.E / Math.pow(pt2(this.e, t3.y, Math.sin(t3.y)), this.B)) - (r3 = 1 / n3)), i3 = 0.5 * (n3 + r3), a3 = Math.sin(this.B * t3.x), e3 = (s3 * this.singam - a3 * this.cosgam) / i3, Math.abs(Math.abs(e3) - 1) < _2)
4589
4601
  throw new Error();
4590
- o3 = 0.5 * this.ArB * Math.log((1 - e3) / (1 + e3)), r3 = Math.cos(this.B * t3.x), h3 = Math.abs(r3) < Qi2 ? this.A * t3.x : this.ArB * Math.atan2(s3 * this.cosgam + a3 * this.singam, r3);
4602
+ o3 = 0.5 * this.ArB * Math.log((1 - e3) / (1 + e3)), r3 = Math.cos(this.B * t3.x), h3 = Math.abs(r3) < Yi2 ? this.A * t3.x : this.ArB * Math.atan2(s3 * this.cosgam + a3 * this.singam, r3);
4591
4603
  } else
4592
4604
  o3 = t3.y > 0 ? this.v_pole_n : this.v_pole_s, h3 = this.ArB * t3.y;
4593
4605
  return this.no_rot ? (c3.x = h3, c3.y = o3) : (h3 -= this.u_0, c3.x = o3 * this.cosrot + h3 * this.sinrot, c3.y = h3 * this.cosrot - o3 * this.sinrot), c3.x = this.a * c3.x + this.x0, c3.y = this.a * c3.y + this.y0, c3;
@@ -4597,13 +4609,13 @@ Me.exports = function() {
4597
4609
  if (t3.x = (t3.x - this.x0) * (1 / this.a), t3.y = (t3.y - this.y0) * (1 / this.a), this.no_rot ? (i3 = t3.y, s3 = t3.x) : (i3 = t3.x * this.cosrot - t3.y * this.sinrot, s3 = t3.y * this.cosrot + t3.x * this.sinrot + this.u_0), a3 = 0.5 * ((e3 = Math.exp(-this.BrA * i3)) - 1 / e3), n3 = 0.5 * (e3 + 1 / e3), h3 = ((r3 = Math.sin(this.BrA * s3)) * this.cosgam + a3 * this.singam) / n3, Math.abs(Math.abs(h3) - 1) < _2)
4598
4610
  o3.x = 0, o3.y = h3 < 0 ? -l2 : l2;
4599
4611
  else {
4600
- if (o3.y = this.E / Math.sqrt((1 + h3) / (1 - h3)), o3.y = Mt2(this.e, Math.pow(o3.y, 1 / this.B)), o3.y === 1 / 0)
4612
+ if (o3.y = this.E / Math.sqrt((1 + h3) / (1 - h3)), o3.y = gt2(this.e, Math.pow(o3.y, 1 / this.B)), o3.y === 1 / 0)
4601
4613
  throw new Error();
4602
4614
  o3.x = -this.rB * Math.atan2(a3 * this.cosgam - r3 * this.singam, Math.cos(this.BrA * s3));
4603
4615
  }
4604
4616
  return o3.x += this.lam0, o3;
4605
4617
  }
4606
- var $i2 = { init: Yi2, forward: Ki2, inverse: Ji2, names: ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Variant_B", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"] };
4618
+ var $i2 = { init: Qi2, forward: Ki2, inverse: Ji2, names: ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Variant_B", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"] };
4607
4619
  function te2() {
4608
4620
  if (this.lat2 || (this.lat2 = this.lat1), this.k0 || (this.k0 = 1), this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, !(Math.abs(this.lat1 + this.lat2) < _2)) {
4609
4621
  var t3 = this.b / this.a;
@@ -4631,7 +4643,7 @@ Me.exports = function() {
4631
4643
  this.ns > 0 ? (s3 = Math.sqrt(r3 * r3 + h3 * h3), i3 = 1) : (s3 = -Math.sqrt(r3 * r3 + h3 * h3), i3 = -1);
4632
4644
  var o3 = 0;
4633
4645
  if (0 !== s3 && (o3 = Math.atan2(i3 * r3, i3 * h3)), 0 !== s3 || this.ns > 0) {
4634
- if (i3 = 1 / this.ns, e3 = Math.pow(s3 / (this.a * this.f0), i3), -9999 === (a3 = Mt2(this.e, e3)))
4646
+ if (i3 = 1 / this.ns, e3 = Math.pow(s3 / (this.a * this.f0), i3), -9999 === (a3 = gt2(this.e, e3)))
4635
4647
  return null;
4636
4648
  } else
4637
4649
  a3 = -l2;
@@ -4698,7 +4710,7 @@ Me.exports = function() {
4698
4710
  }
4699
4711
  return t3.x = s3 + this.x0, t3.y = i3 + this.y0, t3;
4700
4712
  }
4701
- function Me2(t3) {
4713
+ function ge2(t3) {
4702
4714
  t3.x -= this.x0, t3.y -= this.y0;
4703
4715
  var s3, i3, e3 = t3.x / this.a, a3 = t3.y / this.a;
4704
4716
  if (this.sphere) {
@@ -4713,7 +4725,7 @@ Me.exports = function() {
4713
4725
  }
4714
4726
  return t3.x = yt2(i3 + this.long0), t3.y = _e2(s3), t3;
4715
4727
  }
4716
- var ge2 = { init: ye2, forward: pe2, inverse: Me2, names: ["Cassini", "Cassini_Soldner", "cass"] };
4728
+ var Me2 = { init: ye2, forward: pe2, inverse: ge2, names: ["Cassini", "Cassini_Soldner", "cass"] };
4717
4729
  function xe2(t3, s3) {
4718
4730
  var i3;
4719
4731
  return t3 > 1e-7 ? (1 - t3 * t3) * (s3 / (1 - (i3 = t3 * s3) * i3) - 0.5 / t3 * Math.log((1 - i3) / (1 + i3))) : 2 * s3;
@@ -4858,7 +4870,7 @@ Me.exports = function() {
4858
4870
  return t3.x = (t3.x - this.x0) / this.a, t3.y = (t3.y - this.y0) / this.a, t3.x /= this.k0, t3.y /= this.k0, (s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y)) ? (a3 = Math.atan2(s3, this.rc), i3 = Math.sin(a3), r3 = Te2((e3 = Math.cos(a3)) * this.sin_p14 + t3.y * i3 * this.cos_p14 / s3), n3 = Math.atan2(t3.x * i3, s3 * this.cos_p14 * e3 - t3.y * this.sin_p14 * i3), n3 = yt2(this.long0 + n3)) : (r3 = this.phic0, n3 = 0), t3.x = n3, t3.y = r3, t3;
4859
4871
  }
4860
4872
  var je2 = { init: ke2, forward: De2, inverse: Ue2, names: ["gnom"] };
4861
- function Fe(t3, s3) {
4873
+ function Fe2(t3, s3) {
4862
4874
  var i3 = 1 - (1 - t3 * t3) / (2 * t3) * Math.log((1 - t3) / (1 + t3));
4863
4875
  if (Math.abs(Math.abs(s3) - i3) < 1e-6)
4864
4876
  return s3 < 0 ? -1 * l2 : l2;
@@ -4867,10 +4879,10 @@ Me.exports = function() {
4867
4879
  return h3;
4868
4880
  return NaN;
4869
4881
  }
4870
- function Ve() {
4882
+ function Ve2() {
4871
4883
  this.sphere || (this.k0 = _t2(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)));
4872
4884
  }
4873
- function We(t3) {
4885
+ function We2(t3) {
4874
4886
  var s3, i3, e3 = t3.x, a3 = t3.y, n3 = yt2(e3 - this.long0);
4875
4887
  if (this.sphere)
4876
4888
  s3 = this.x0 + this.a * n3 * Math.cos(this.lat_ts), i3 = this.y0 + this.a * Math.sin(a3) / Math.cos(this.lat_ts);
@@ -4880,24 +4892,24 @@ Me.exports = function() {
4880
4892
  }
4881
4893
  return t3.x = s3, t3.y = i3, t3;
4882
4894
  }
4883
- function He(t3) {
4895
+ function He2(t3) {
4884
4896
  var s3, i3;
4885
- return t3.x -= this.x0, t3.y -= this.y0, this.sphere ? (s3 = yt2(this.long0 + t3.x / this.a / Math.cos(this.lat_ts)), i3 = Math.asin(t3.y / this.a * Math.cos(this.lat_ts))) : (i3 = Fe(this.e, 2 * t3.y * this.k0 / this.a), s3 = yt2(this.long0 + t3.x / (this.a * this.k0))), t3.x = s3, t3.y = i3, t3;
4897
+ return t3.x -= this.x0, t3.y -= this.y0, this.sphere ? (s3 = yt2(this.long0 + t3.x / this.a / Math.cos(this.lat_ts)), i3 = Math.asin(t3.y / this.a * Math.cos(this.lat_ts))) : (i3 = Fe2(this.e, 2 * t3.y * this.k0 / this.a), s3 = yt2(this.long0 + t3.x / (this.a * this.k0))), t3.x = s3, t3.y = i3, t3;
4886
4898
  }
4887
- var Ze = { init: Ve, forward: We, inverse: He, names: ["cea"] };
4888
- function Qe() {
4899
+ var Xe2 = { init: Ve2, forward: We2, inverse: He2, names: ["cea"] };
4900
+ function Ye2() {
4889
4901
  this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Equidistant Cylindrical (Plate Carre)", this.rc = Math.cos(this.lat_ts);
4890
4902
  }
4891
- function Xe(t3) {
4903
+ function Ze2(t3) {
4892
4904
  var s3 = t3.x, i3 = t3.y, e3 = yt2(s3 - this.long0), a3 = _e2(i3 - this.lat0);
4893
4905
  return t3.x = this.x0 + this.a * e3 * this.rc, t3.y = this.y0 + this.a * a3, t3;
4894
4906
  }
4895
- function Ye(t3) {
4907
+ function Qe2(t3) {
4896
4908
  var s3 = t3.x, i3 = t3.y;
4897
4909
  return t3.x = yt2(this.long0 + (s3 - this.x0) / (this.a * this.rc)), t3.y = _e2(this.lat0 + (i3 - this.y0) / this.a), t3;
4898
4910
  }
4899
- var Ke = { init: Qe, forward: Xe, inverse: Ye, names: ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"] }, Je = 20;
4900
- function $e() {
4911
+ var Ke2 = { init: Ye2, forward: Ze2, inverse: Qe2, names: ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"] }, Je2 = 20;
4912
+ function $e2() {
4901
4913
  this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = ce2(this.es), this.e1 = le2(this.es), this.e2 = ue2(this.es), this.e3 = de2(this.es), this.ml0 = this.a * oe2(this.e0, this.e1, this.e2, this.e3, this.lat0);
4902
4914
  }
4903
4915
  function ta(t3) {
@@ -4919,7 +4931,7 @@ Me.exports = function() {
4919
4931
  s3 = yt2(e3 / this.a + this.long0), i3 = 0;
4920
4932
  else {
4921
4933
  var l3;
4922
- for (r3 = this.lat0 + a3 / this.a, h3 = e3 * e3 / this.a / this.a + r3 * r3, o3 = r3, n3 = Je; n3; --n3)
4934
+ for (r3 = this.lat0 + a3 / this.a, h3 = e3 * e3 / this.a / this.a + r3 * r3, o3 = r3, n3 = Je2; n3; --n3)
4923
4935
  if (o3 += c3 = -1 * (r3 * (o3 * (l3 = Math.tan(o3)) + 1) - o3 - 0.5 * (o3 * o3 + h3) * l3) / ((o3 - r3) / l3 - 1), Math.abs(c3) <= _2) {
4924
4936
  i3 = o3;
4925
4937
  break;
@@ -4930,7 +4942,7 @@ Me.exports = function() {
4930
4942
  i3 = 0, s3 = yt2(this.long0 + e3 / this.a);
4931
4943
  else {
4932
4944
  var u3, d3, m3, f3, y3;
4933
- for (r3 = (this.ml0 + a3) / this.a, h3 = e3 * e3 / this.a / this.a + r3 * r3, o3 = r3, n3 = Je; n3; --n3)
4945
+ for (r3 = (this.ml0 + a3) / this.a, h3 = e3 * e3 / this.a / this.a + r3 * r3, o3 = r3, n3 = Je2; n3; --n3)
4934
4946
  if (y3 = this.e * Math.sin(o3), u3 = Math.sqrt(1 - y3 * y3) * Math.tan(o3), d3 = this.a * oe2(this.e0, this.e1, this.e2, this.e3, o3), m3 = this.e0 - 2 * this.e1 * Math.cos(2 * o3) + 4 * this.e2 * Math.cos(4 * o3) - 6 * this.e3 * Math.cos(6 * o3), o3 -= c3 = (r3 * (u3 * (f3 = d3 / this.a) + 1) - f3 - 0.5 * u3 * (f3 * f3 + h3)) / (this.es * Math.sin(2 * o3) * (f3 * f3 + h3 - 2 * r3 * f3) / (4 * u3) + (r3 - f3) * (u3 * m3 - 2 / Math.sin(2 * o3)) - m3), Math.abs(c3) <= _2) {
4935
4947
  i3 = o3;
4936
4948
  break;
@@ -4939,7 +4951,7 @@ Me.exports = function() {
4939
4951
  }
4940
4952
  return t3.x = s3, t3.y = i3, t3;
4941
4953
  }
4942
- var ia = { init: $e, forward: ta, inverse: sa, names: ["Polyconic", "American_Polyconic", "poly"] };
4954
+ var ia = { init: $e2, forward: ta, inverse: sa, names: ["Polyconic", "American_Polyconic", "poly"] };
4943
4955
  function ea() {
4944
4956
  this.A = [], this.A[1] = 0.6399175073, this.A[2] = -0.1358797613, this.A[3] = 0.063294409, this.A[4] = -0.02526853, this.A[5] = 0.0117879, this.A[6] = -55161e-7, this.A[7] = 26906e-7, this.A[8] = -1333e-6, this.A[9] = 67e-5, this.A[10] = -34e-5, this.B_re = [], this.B_im = [], this.B_re[1] = 0.7557853228, this.B_im[1] = 0, this.B_re[2] = 0.249204646, this.B_im[2] = 3371507e-9, this.B_re[3] = -1541739e-9, this.B_im[3] = 0.04105856, this.B_re[4] = -0.10162907, this.B_im[4] = 0.01727609, this.B_re[5] = -0.26623489, this.B_im[5] = -0.36249218, this.B_re[6] = -0.6870983, this.B_im[6] = -1.1651967, this.C_re = [], this.C_im = [], this.C_re[1] = 1.3231270439, this.C_im[1] = 0, this.C_re[2] = -0.577245789, this.C_im[2] = -7809598e-9, this.C_re[3] = 0.508307513, this.C_im[3] = -0.112208952, this.C_re[4] = -0.15094762, this.C_im[4] = 0.18200602, this.C_re[5] = 1.01418179, this.C_im[5] = 1.64497696, this.C_re[6] = 1.9660549, this.C_im[6] = 2.5127645, this.D = [], this.D[1] = 1.5627014243, this.D[2] = 0.5185406398, this.D[3] = -0.03333098, this.D[4] = -0.1052906, this.D[5] = -0.0368594, this.D[6] = 7317e-6, this.D[7] = 0.0122, this.D[8] = 394e-5, this.D[9] = -13e-4;
4945
4957
  }
@@ -4957,15 +4969,15 @@ Me.exports = function() {
4957
4969
  for (s3 = 1; s3 <= 6; s3++)
4958
4970
  i3 = l3 * r3 + o3 * h3, o3 = o3 * r3 - l3 * h3, l3 = i3, u3 = u3 + this.C_re[s3] * o3 - this.C_im[s3] * l3, d3 = d3 + this.C_im[s3] * o3 + this.C_re[s3] * l3;
4959
4971
  for (var m3 = 0; m3 < this.iterations; m3++) {
4960
- var _3, f3 = u3, y3 = d3, p3 = r3, M3 = h3;
4972
+ var _3, f3 = u3, y3 = d3, p3 = r3, g3 = h3;
4961
4973
  for (s3 = 2; s3 <= 6; s3++)
4962
- _3 = y3 * u3 + f3 * d3, f3 = f3 * u3 - y3 * d3, y3 = _3, p3 += (s3 - 1) * (this.B_re[s3] * f3 - this.B_im[s3] * y3), M3 += (s3 - 1) * (this.B_im[s3] * f3 + this.B_re[s3] * y3);
4974
+ _3 = y3 * u3 + f3 * d3, f3 = f3 * u3 - y3 * d3, y3 = _3, p3 += (s3 - 1) * (this.B_re[s3] * f3 - this.B_im[s3] * y3), g3 += (s3 - 1) * (this.B_im[s3] * f3 + this.B_re[s3] * y3);
4963
4975
  f3 = 1, y3 = 0;
4964
- var g3 = this.B_re[1], x3 = this.B_im[1];
4976
+ var M3 = this.B_re[1], x3 = this.B_im[1];
4965
4977
  for (s3 = 2; s3 <= 6; s3++)
4966
- _3 = y3 * u3 + f3 * d3, f3 = f3 * u3 - y3 * d3, y3 = _3, g3 += s3 * (this.B_re[s3] * f3 - this.B_im[s3] * y3), x3 += s3 * (this.B_im[s3] * f3 + this.B_re[s3] * y3);
4967
- var w3 = g3 * g3 + x3 * x3;
4968
- u3 = (p3 * g3 + M3 * x3) / w3, d3 = (M3 * g3 - p3 * x3) / w3;
4978
+ _3 = y3 * u3 + f3 * d3, f3 = f3 * u3 - y3 * d3, y3 = _3, M3 += s3 * (this.B_re[s3] * f3 - this.B_im[s3] * y3), x3 += s3 * (this.B_im[s3] * f3 + this.B_re[s3] * y3);
4979
+ var w3 = M3 * M3 + x3 * x3;
4980
+ u3 = (p3 * M3 + g3 * x3) / w3, d3 = (g3 * M3 - p3 * x3) / w3;
4969
4981
  }
4970
4982
  var S3 = u3, E3 = d3, b3 = 1, P3 = 0;
4971
4983
  for (s3 = 1; s3 <= 9; s3++)
@@ -5024,7 +5036,7 @@ Me.exports = function() {
5024
5036
  var h3 = 0.900316316158 * this.a * e3 * Math.cos(a3) + this.x0, o3 = 1.4142135623731 * this.a * Math.sin(a3) + this.y0;
5025
5037
  return t3.x = h3, t3.y = o3, t3;
5026
5038
  }
5027
- function Ma(t3) {
5039
+ function ga(t3) {
5028
5040
  var s3, i3;
5029
5041
  t3.x -= this.x0, t3.y -= this.y0, i3 = t3.y / (1.4142135623731 * this.a), Math.abs(i3) > 0.999999999999 && (i3 = 0.999999999999), s3 = Math.asin(i3);
5030
5042
  var e3 = yt2(this.long0 + t3.x / (0.900316316158 * this.a * Math.cos(s3)));
@@ -5032,7 +5044,7 @@ Me.exports = function() {
5032
5044
  var a3 = Math.asin(i3);
5033
5045
  return t3.x = e3, t3.y = a3, t3;
5034
5046
  }
5035
- var ga = { init: ya, forward: pa, inverse: Ma, names: ["Mollweide", "moll"] };
5047
+ var Ma = { init: ya, forward: pa, inverse: ga, names: ["Mollweide", "moll"] };
5036
5048
  function xa() {
5037
5049
  Math.abs(this.lat1 + this.lat2) < _2 || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = ce2(this.es), this.e1 = le2(this.es), this.e2 = ue2(this.es), this.e3 = de2(this.es), this.sinphi = Math.sin(this.lat1), this.cosphi = Math.cos(this.lat1), this.ms1 = _t2(this.e, this.sinphi, this.cosphi), this.ml1 = oe2(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < _2 ? this.ns = this.sinphi : (this.sinphi = Math.sin(this.lat2), this.cosphi = Math.cos(this.lat2), this.ms2 = _t2(this.e, this.sinphi, this.cosphi), this.ml2 = oe2(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = oe2(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
5038
5050
  }
@@ -5064,8 +5076,8 @@ Me.exports = function() {
5064
5076
  (Math.abs(n3) <= _2 || Math.abs(Math.abs(a3) - l2) <= _2) && (s3 = this.x0, i3 = a3 >= 0 ? this.y0 + Math.PI * this.R * Math.tan(0.5 * r3) : this.y0 + Math.PI * this.R * -Math.tan(0.5 * r3));
5065
5077
  var h3 = 0.5 * Math.abs(Math.PI / n3 - n3 / Math.PI), o3 = h3 * h3, c3 = Math.sin(r3), u3 = Math.cos(r3), d3 = u3 / (c3 + u3 - 1), m3 = d3 * d3, f3 = d3 * (2 / c3 - 1), y3 = f3 * f3, p3 = Math.PI * this.R * (h3 * (d3 - y3) + Math.sqrt(o3 * (d3 - y3) * (d3 - y3) - (y3 + o3) * (m3 - y3))) / (y3 + o3);
5066
5078
  n3 < 0 && (p3 = -p3), s3 = this.x0 + p3;
5067
- var M3 = o3 + d3;
5068
- return p3 = Math.PI * this.R * (f3 * M3 - h3 * Math.sqrt((y3 + o3) * (o3 + 1) - M3 * M3)) / (y3 + o3), i3 = a3 >= 0 ? this.y0 + p3 : this.y0 - p3, t3.x = s3, t3.y = i3, t3;
5079
+ var g3 = o3 + d3;
5080
+ return p3 = Math.PI * this.R * (f3 * g3 - h3 * Math.sqrt((y3 + o3) * (o3 + 1) - g3 * g3)) / (y3 + o3), i3 = a3 >= 0 ? this.y0 + p3 : this.y0 - p3, t3.x = s3, t3.y = i3, t3;
5069
5081
  }
5070
5082
  function va(t3) {
5071
5083
  var s3, i3, e3, a3, n3, r3, h3, o3, c3, l3, u3, d3;
@@ -5174,7 +5186,7 @@ Me.exports = function() {
5174
5186
  this._s = s4.remainder(this._s, t5), this.Add(0);
5175
5187
  };
5176
5188
  }(a3.Accumulator, a3.Math), a3.Geodesic = {}, a3.GeodesicLine = {}, a3.PolygonArea = {}, function(t4, s4, i4, e4, a4) {
5177
- var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3 = 6, p3 = y3, M3 = y3, g3 = y3, x3 = g3, w3 = 20, S3 = w3 + e4.digits + 10, E3 = e4.epsilon, b3 = 200 * E3, P3 = Math.sqrt(E3), v3 = E3, A3 = 1e3 * P3, G3 = 0, C3 = 31, N3 = 32640;
5189
+ var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3 = 6, p3 = y3, g3 = y3, M3 = y3, x3 = M3, w3 = 20, S3 = w3 + e4.digits + 10, E3 = e4.epsilon, b3 = 200 * E3, P3 = Math.sqrt(E3), v3 = E3, A3 = 1e3 * P3, G3 = 0, C3 = 31, N3 = 32640;
5178
5190
  t4.tiny_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON), t4.nC1_ = y3, t4.nC1p_ = y3, t4.nC2_ = y3, t4.nC3_ = y3, t4.nC4_ = y3, n3 = t4.nC3_ * (t4.nC3_ - 1) / 2, r3 = t4.nC4_ * (t4.nC4_ + 1) / 2, t4.CAP_C1 = 1, t4.CAP_C1p = 2, t4.CAP_C2 = 4, t4.CAP_C3 = 8, t4.CAP_C4 = 16, t4.NONE = 0, t4.ARC = 64, t4.LATITUDE = 128 | G3, t4.LONGITUDE = 256 | t4.CAP_C3, t4.AZIMUTH = 512 | G3, t4.DISTANCE = 1024 | t4.CAP_C1, t4.STANDARD = t4.LATITUDE | t4.LONGITUDE | t4.AZIMUTH | t4.DISTANCE, t4.DISTANCE_IN = 2048 | t4.CAP_C1 | t4.CAP_C1p, t4.REDUCEDLENGTH = 4096 | t4.CAP_C1 | t4.CAP_C2, t4.GEODESICSCALE = 8192 | t4.CAP_C1 | t4.CAP_C2, t4.AREA = 16384 | t4.CAP_C4, t4.ALL = N3 | C3, t4.LONG_UNROLL = 32768, t4.OUT_MASK = N3 | t4.LONG_UNROLL, t4.SinCosSeries = function(t5, s5, i5, e5) {
5179
5191
  var a5 = e5.length, n4 = a5 - (t5 ? 1 : 0), r4 = 2 * (i5 - s5) * (i5 + s5), h4 = 1 & n4 ? e5[--a5] : 0, o4 = 0;
5180
5192
  for (n4 = Math.floor(n4 / 2); n4--; )
@@ -5195,7 +5207,7 @@ Me.exports = function() {
5195
5207
  for (a5 = 1; a5 <= t4.nC1p_; ++a5)
5196
5208
  n4 = Math.floor((t4.nC1p_ - a5) / 2), i5[a5] = h4 * e4.polyval(n4, l3, o4, r4) / l3[o4 + n4 + 1], o4 += n4 + 2, h4 *= s5;
5197
5209
  }, u3 = [-11, -28, -192, 0, 256], t4.A2m1f = function(t5) {
5198
- var s5 = Math.floor(M3 / 2);
5210
+ var s5 = Math.floor(g3 / 2);
5199
5211
  return (e4.polyval(s5, u3, 0, e4.sq(t5)) / u3[s5 + 1] - t5) / (1 + t5);
5200
5212
  }, d3 = [1, 2, 16, 32, 35, 64, 384, 2048, 15, 80, 768, 7, 35, 512, 63, 1280, 77, 2048], t4.C2f = function(s5, i5) {
5201
5213
  var a5, n4, r4 = e4.sq(s5), h4 = s5, o4 = 0;
@@ -5209,8 +5221,8 @@ Me.exports = function() {
5209
5221
  this._A3x = new Array(x3), this._C3x = new Array(n3), this._C4x = new Array(r3), this.A3coeff(), this.C3coeff(), this.C4coeff();
5210
5222
  }, m3 = [-3, 128, -2, -3, 64, -1, -3, -1, 16, 3, -1, -2, 8, 1, -1, 2, 1, 1], t4.Geodesic.prototype.A3coeff = function() {
5211
5223
  var t5, s5, i5 = 0, a5 = 0;
5212
- for (t5 = g3 - 1; t5 >= 0; --t5)
5213
- s5 = Math.min(g3 - t5 - 1, t5), this._A3x[a5++] = e4.polyval(s5, m3, i5, this._n) / m3[i5 + s5 + 1], i5 += s5 + 2;
5224
+ for (t5 = M3 - 1; t5 >= 0; --t5)
5225
+ s5 = Math.min(M3 - t5 - 1, t5), this._A3x[a5++] = e4.polyval(s5, m3, i5, this._n) / m3[i5 + s5 + 1], i5 += s5 + 2;
5214
5226
  }, _3 = [3, 128, 2, 5, 128, -1, 3, 3, 64, -1, 0, 1, 8, -1, 1, 4, 5, 256, 1, 3, 128, -3, -2, 3, 64, 1, -3, 2, 32, 7, 512, -10, 9, 384, 5, -9, 5, 192, 7, 512, -14, 7, 512, 21, 2560], t4.Geodesic.prototype.C3coeff = function() {
5215
5227
  var s5, i5, a5, n4 = 0, r4 = 0;
5216
5228
  for (s5 = 1; s5 < t4.nC3_; ++s5)
@@ -5232,37 +5244,37 @@ Me.exports = function() {
5232
5244
  for (a5 = 0; a5 < t4.nC4_; ++a5)
5233
5245
  n4 = t4.nC4_ - a5 - 1, i5[a5] = r4 * e4.polyval(n4, this._C4x, h4, s5), h4 += n4 + 1, r4 *= s5;
5234
5246
  }, t4.Geodesic.prototype.Lengths = function(s5, i5, e5, a5, n4, r4, h4, o4, c4, l4, u4, d4, m4) {
5235
- var _4, f4, y4, p4, M4 = {}, g4 = 0, x4 = 0, w4 = 0, S4 = 0;
5236
- if ((u4 &= t4.OUT_MASK) & (t4.DISTANCE | t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (w4 = t4.A1m1f(s5), t4.C1f(s5, d4), u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (S4 = t4.A2m1f(s5), t4.C2f(s5, m4), g4 = w4 - S4, S4 = 1 + S4), w4 = 1 + w4), u4 & t4.DISTANCE)
5237
- _4 = t4.SinCosSeries(true, r4, h4, d4) - t4.SinCosSeries(true, e5, a5, d4), M4.s12b = w4 * (i5 + _4), u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (x4 = g4 * i5 + (w4 * _4 - S4 * (t4.SinCosSeries(true, r4, h4, m4) - t4.SinCosSeries(true, e5, a5, m4))));
5247
+ var _4, f4, y4, p4, g4 = {}, M4 = 0, x4 = 0, w4 = 0, S4 = 0;
5248
+ if ((u4 &= t4.OUT_MASK) & (t4.DISTANCE | t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (w4 = t4.A1m1f(s5), t4.C1f(s5, d4), u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (S4 = t4.A2m1f(s5), t4.C2f(s5, m4), M4 = w4 - S4, S4 = 1 + S4), w4 = 1 + w4), u4 & t4.DISTANCE)
5249
+ _4 = t4.SinCosSeries(true, r4, h4, d4) - t4.SinCosSeries(true, e5, a5, d4), g4.s12b = w4 * (i5 + _4), u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (x4 = M4 * i5 + (w4 * _4 - S4 * (t4.SinCosSeries(true, r4, h4, m4) - t4.SinCosSeries(true, e5, a5, m4))));
5238
5250
  else if (u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE)) {
5239
5251
  for (f4 = 1; f4 <= t4.nC2_; ++f4)
5240
5252
  m4[f4] = w4 * d4[f4] - S4 * m4[f4];
5241
- x4 = g4 * i5 + (t4.SinCosSeries(true, r4, h4, m4) - t4.SinCosSeries(true, e5, a5, m4));
5253
+ x4 = M4 * i5 + (t4.SinCosSeries(true, r4, h4, m4) - t4.SinCosSeries(true, e5, a5, m4));
5242
5254
  }
5243
- return u4 & t4.REDUCEDLENGTH && (M4.m0 = g4, M4.m12b = o4 * (a5 * r4) - n4 * (e5 * h4) - a5 * h4 * x4), u4 & t4.GEODESICSCALE && (y4 = a5 * h4 + e5 * r4, p4 = this._ep2 * (c4 - l4) * (c4 + l4) / (n4 + o4), M4.M12 = y4 + (p4 * r4 - h4 * x4) * e5 / n4, M4.M21 = y4 - (p4 * e5 - a5 * x4) * r4 / o4), M4;
5255
+ return u4 & t4.REDUCEDLENGTH && (g4.m0 = M4, g4.m12b = o4 * (a5 * r4) - n4 * (e5 * h4) - a5 * h4 * x4), u4 & t4.GEODESICSCALE && (y4 = a5 * h4 + e5 * r4, p4 = this._ep2 * (c4 - l4) * (c4 + l4) / (n4 + o4), g4.M12 = y4 + (p4 * r4 - h4 * x4) * e5 / n4, g4.M21 = y4 - (p4 * e5 - a5 * x4) * r4 / o4), g4;
5244
5256
  }, t4.Geodesic.prototype.InverseStart = function(s5, i5, a5, n4, r4, o4, c4, l4, u4, d4, m4) {
5245
- var _4, f4, y4, p4, M4, g4, x4, w4, S4, E4, P4, v4, G4, C4, N4, I3, z3, T3, O3, R3, q3 = {}, L3 = n4 * i5 - r4 * s5, B3 = r4 * i5 + n4 * s5;
5246
- return q3.sig12 = -1, _4 = n4 * i5, _4 += r4 * s5, (f4 = B3 >= 0 && L3 < 0.5 && r4 * c4 < 0.5) ? (p4 = e4.sq(s5 + n4), p4 /= p4 + e4.sq(i5 + r4), q3.dnm = Math.sqrt(1 + this._ep2 * p4), y4 = c4 / (this._f1 * q3.dnm), M4 = Math.sin(y4), g4 = Math.cos(y4)) : (M4 = l4, g4 = u4), q3.salp1 = r4 * M4, q3.calp1 = g4 >= 0 ? L3 + r4 * s5 * e4.sq(M4) / (1 + g4) : _4 - r4 * s5 * e4.sq(M4) / (1 - g4), w4 = e4.hypot(q3.salp1, q3.calp1), S4 = s5 * n4 + i5 * r4 * g4, f4 && w4 < this._etol2 ? (q3.salp2 = i5 * M4, q3.calp2 = L3 - i5 * n4 * (g4 >= 0 ? e4.sq(M4) / (1 + g4) : 1 - g4), x4 = e4.hypot(q3.salp2, q3.calp2), q3.salp2 /= x4, q3.calp2 /= x4, q3.sig12 = Math.atan2(w4, S4)) : Math.abs(this._n) > 0.1 || S4 >= 0 || w4 >= 6 * Math.abs(this._n) * Math.PI * e4.sq(i5) || (R3 = Math.atan2(-l4, -u4), this.f >= 0 ? (C4 = (G4 = e4.sq(s5) * this._ep2) / (2 * (1 + Math.sqrt(1 + G4)) + G4), E4 = R3 / (v4 = this.f * i5 * this.A3f(C4) * Math.PI), P4 = _4 / (v4 * i5)) : (N4 = r4 * i5 - n4 * s5, I3 = Math.atan2(_4, N4), P4 = c4 / (v4 = ((E4 = (z3 = this.Lengths(this._n, Math.PI + I3, s5, -i5, a5, n4, r4, o4, i5, r4, t4.REDUCEDLENGTH, d4, m4)).m12b / (i5 * r4 * z3.m0 * Math.PI) - 1) < -0.01 ? _4 / E4 : -this.f * e4.sq(i5) * Math.PI) / i5)), P4 > -b3 && E4 > -1 - A3 ? this.f >= 0 ? (q3.salp1 = Math.min(1, -E4), q3.calp1 = -Math.sqrt(1 - e4.sq(q3.salp1))) : (q3.calp1 = Math.max(E4 > -b3 ? 0 : -1, E4), q3.salp1 = Math.sqrt(1 - e4.sq(q3.calp1))) : (T3 = h3(E4, P4), O3 = v4 * (this.f >= 0 ? -E4 * T3 / (1 + T3) : -P4 * (1 + T3) / T3), M4 = Math.sin(O3), g4 = -Math.cos(O3), q3.salp1 = r4 * M4, q3.calp1 = _4 - r4 * s5 * e4.sq(M4) / (1 - g4))), q3.salp1 <= 0 ? (q3.salp1 = 1, q3.calp1 = 0) : (x4 = e4.hypot(q3.salp1, q3.calp1), q3.salp1 /= x4, q3.calp1 /= x4), q3;
5257
+ var _4, f4, y4, p4, g4, M4, x4, w4, S4, E4, P4, v4, G4, C4, N4, I3, z3, T3, O3, R3, q3 = {}, L3 = n4 * i5 - r4 * s5, B3 = r4 * i5 + n4 * s5;
5258
+ return q3.sig12 = -1, _4 = n4 * i5, _4 += r4 * s5, (f4 = B3 >= 0 && L3 < 0.5 && r4 * c4 < 0.5) ? (p4 = e4.sq(s5 + n4), p4 /= p4 + e4.sq(i5 + r4), q3.dnm = Math.sqrt(1 + this._ep2 * p4), y4 = c4 / (this._f1 * q3.dnm), g4 = Math.sin(y4), M4 = Math.cos(y4)) : (g4 = l4, M4 = u4), q3.salp1 = r4 * g4, q3.calp1 = M4 >= 0 ? L3 + r4 * s5 * e4.sq(g4) / (1 + M4) : _4 - r4 * s5 * e4.sq(g4) / (1 - M4), w4 = e4.hypot(q3.salp1, q3.calp1), S4 = s5 * n4 + i5 * r4 * M4, f4 && w4 < this._etol2 ? (q3.salp2 = i5 * g4, q3.calp2 = L3 - i5 * n4 * (M4 >= 0 ? e4.sq(g4) / (1 + M4) : 1 - M4), x4 = e4.hypot(q3.salp2, q3.calp2), q3.salp2 /= x4, q3.calp2 /= x4, q3.sig12 = Math.atan2(w4, S4)) : Math.abs(this._n) > 0.1 || S4 >= 0 || w4 >= 6 * Math.abs(this._n) * Math.PI * e4.sq(i5) || (R3 = Math.atan2(-l4, -u4), this.f >= 0 ? (C4 = (G4 = e4.sq(s5) * this._ep2) / (2 * (1 + Math.sqrt(1 + G4)) + G4), E4 = R3 / (v4 = this.f * i5 * this.A3f(C4) * Math.PI), P4 = _4 / (v4 * i5)) : (N4 = r4 * i5 - n4 * s5, I3 = Math.atan2(_4, N4), P4 = c4 / (v4 = ((E4 = (z3 = this.Lengths(this._n, Math.PI + I3, s5, -i5, a5, n4, r4, o4, i5, r4, t4.REDUCEDLENGTH, d4, m4)).m12b / (i5 * r4 * z3.m0 * Math.PI) - 1) < -0.01 ? _4 / E4 : -this.f * e4.sq(i5) * Math.PI) / i5)), P4 > -b3 && E4 > -1 - A3 ? this.f >= 0 ? (q3.salp1 = Math.min(1, -E4), q3.calp1 = -Math.sqrt(1 - e4.sq(q3.salp1))) : (q3.calp1 = Math.max(E4 > -b3 ? 0 : -1, E4), q3.salp1 = Math.sqrt(1 - e4.sq(q3.calp1))) : (T3 = h3(E4, P4), O3 = v4 * (this.f >= 0 ? -E4 * T3 / (1 + T3) : -P4 * (1 + T3) / T3), g4 = Math.sin(O3), M4 = -Math.cos(O3), q3.salp1 = r4 * g4, q3.calp1 = _4 - r4 * s5 * e4.sq(g4) / (1 - M4))), q3.salp1 <= 0 ? (q3.salp1 = 1, q3.calp1 = 0) : (x4 = e4.hypot(q3.salp1, q3.calp1), q3.salp1 /= x4, q3.calp1 /= x4), q3;
5247
5259
  }, t4.Geodesic.prototype.Lambda12 = function(s5, i5, a5, n4, r4, h4, o4, c4, l4, u4, d4, m4, _4, f4) {
5248
- var y4, p4, M4, g4, x4, w4, S4, E4, b4, P4, v4, A4, G4, C4 = {};
5249
- return 0 === s5 && 0 === c4 && (c4 = -t4.tiny_), p4 = o4 * i5, M4 = e4.hypot(c4, o4 * s5), C4.ssig1 = s5, g4 = p4 * s5, C4.csig1 = x4 = c4 * i5, y4 = e4.hypot(C4.ssig1, C4.csig1), C4.ssig1 /= y4, C4.csig1 /= y4, C4.salp2 = r4 !== i5 ? p4 / r4 : o4, C4.calp2 = r4 !== i5 || Math.abs(n4) !== -s5 ? Math.sqrt(e4.sq(c4 * i5) + (i5 < -s5 ? (r4 - i5) * (i5 + r4) : (s5 - n4) * (s5 + n4))) / r4 : Math.abs(c4), C4.ssig2 = n4, w4 = p4 * n4, C4.csig2 = S4 = C4.calp2 * r4, y4 = e4.hypot(C4.ssig2, C4.csig2), C4.ssig2 /= y4, C4.csig2 /= y4, C4.sig12 = Math.atan2(Math.max(0, C4.csig1 * C4.ssig2 - C4.ssig1 * C4.csig2), C4.csig1 * C4.csig2 + C4.ssig1 * C4.ssig2), E4 = Math.max(0, x4 * w4 - g4 * S4), b4 = x4 * S4 + g4 * w4, v4 = Math.atan2(E4 * u4 - b4 * l4, b4 * u4 + E4 * l4), A4 = e4.sq(M4) * this._ep2, C4.eps = A4 / (2 * (1 + Math.sqrt(1 + A4)) + A4), this.C3f(C4.eps, f4), P4 = t4.SinCosSeries(true, C4.ssig2, C4.csig2, f4) - t4.SinCosSeries(true, C4.ssig1, C4.csig1, f4), C4.domg12 = -this.f * this.A3f(C4.eps) * p4 * (C4.sig12 + P4), C4.lam12 = v4 + C4.domg12, d4 && (0 === C4.calp2 ? C4.dlam12 = -2 * this._f1 * a5 / s5 : (G4 = this.Lengths(C4.eps, C4.sig12, C4.ssig1, C4.csig1, a5, C4.ssig2, C4.csig2, h4, i5, r4, t4.REDUCEDLENGTH, m4, _4), C4.dlam12 = G4.m12b, C4.dlam12 *= this._f1 / (C4.calp2 * r4))), C4;
5260
+ var y4, p4, g4, M4, x4, w4, S4, E4, b4, P4, v4, A4, G4, C4 = {};
5261
+ return 0 === s5 && 0 === c4 && (c4 = -t4.tiny_), p4 = o4 * i5, g4 = e4.hypot(c4, o4 * s5), C4.ssig1 = s5, M4 = p4 * s5, C4.csig1 = x4 = c4 * i5, y4 = e4.hypot(C4.ssig1, C4.csig1), C4.ssig1 /= y4, C4.csig1 /= y4, C4.salp2 = r4 !== i5 ? p4 / r4 : o4, C4.calp2 = r4 !== i5 || Math.abs(n4) !== -s5 ? Math.sqrt(e4.sq(c4 * i5) + (i5 < -s5 ? (r4 - i5) * (i5 + r4) : (s5 - n4) * (s5 + n4))) / r4 : Math.abs(c4), C4.ssig2 = n4, w4 = p4 * n4, C4.csig2 = S4 = C4.calp2 * r4, y4 = e4.hypot(C4.ssig2, C4.csig2), C4.ssig2 /= y4, C4.csig2 /= y4, C4.sig12 = Math.atan2(Math.max(0, C4.csig1 * C4.ssig2 - C4.ssig1 * C4.csig2), C4.csig1 * C4.csig2 + C4.ssig1 * C4.ssig2), E4 = Math.max(0, x4 * w4 - M4 * S4), b4 = x4 * S4 + M4 * w4, v4 = Math.atan2(E4 * u4 - b4 * l4, b4 * u4 + E4 * l4), A4 = e4.sq(g4) * this._ep2, C4.eps = A4 / (2 * (1 + Math.sqrt(1 + A4)) + A4), this.C3f(C4.eps, f4), P4 = t4.SinCosSeries(true, C4.ssig2, C4.csig2, f4) - t4.SinCosSeries(true, C4.ssig1, C4.csig1, f4), C4.domg12 = -this.f * this.A3f(C4.eps) * p4 * (C4.sig12 + P4), C4.lam12 = v4 + C4.domg12, d4 && (0 === C4.calp2 ? C4.dlam12 = -2 * this._f1 * a5 / s5 : (G4 = this.Lengths(C4.eps, C4.sig12, C4.ssig1, C4.csig1, a5, C4.ssig2, C4.csig2, h4, i5, r4, t4.REDUCEDLENGTH, m4, _4), C4.dlam12 = G4.m12b, C4.dlam12 *= this._f1 / (C4.calp2 * r4))), C4;
5250
5262
  }, t4.Geodesic.prototype.Inverse = function(s5, i5, a5, n4, r4) {
5251
5263
  var h4, o4;
5252
5264
  return r4 || (r4 = t4.STANDARD), r4 === t4.LONG_UNROLL && (r4 |= t4.STANDARD), r4 &= t4.OUT_MASK, o4 = (h4 = this.InverseInt(s5, i5, a5, n4, r4)).vals, r4 & t4.AZIMUTH && (o4.azi1 = e4.atan2d(h4.salp1, h4.calp1), o4.azi2 = e4.atan2d(h4.salp2, h4.calp2)), o4;
5253
5265
  }, t4.Geodesic.prototype.InverseInt = function(s5, i5, a5, n4, r4) {
5254
- var h4, o4, c4, l4, u4, d4, m4, _4, f4, y4, p4, M4, g4, x4, b4, P4, A4, G4, C4, N4, I3, z3, T3, O3, R3, q3, L3, B3, k3, D3, U3, j3, F3, V3, W3, H3, Z3, Q3, X3, Y3, K3, J3, $3, tt3, st3, it3, et3, at3, nt3, rt3, ht3, ot3, ct3, lt3, ut3, dt3, mt3, _t3, ft3, yt3, pt3, Mt3, gt3, xt3, wt3, St3 = {};
5255
- if (St3.lat1 = s5 = e4.LatFix(s5), St3.lat2 = a5 = e4.LatFix(a5), s5 = e4.AngRound(s5), a5 = e4.AngRound(a5), o4 = (h4 = e4.AngDiff(i5, n4)).e, h4 = h4.d, r4 & t4.LONG_UNROLL ? (St3.lon1 = i5, St3.lon2 = i5 + h4 + o4) : (St3.lon1 = e4.AngNormalize(i5), St3.lon2 = e4.AngNormalize(n4)), o4 *= c4 = e4.copysign(1, h4), b4 = (h4 *= c4) * e4.degree, P4 = (l4 = e4.sincosde(h4, o4)).s, A4 = l4.c, o4 = 180 - h4 - o4, (u4 = Math.abs(s5) < Math.abs(a5) || isNaN(a5) ? -1 : 1) < 0 && (c4 *= -1, [a5, s5] = [s5, a5]), s5 *= d4 = e4.copysign(1, -s5), a5 *= d4, l4 = e4.sincosd(s5), m4 = this._f1 * l4.s, _4 = l4.c, m4 /= l4 = e4.hypot(m4, _4), _4 /= l4, _4 = Math.max(t4.tiny_, _4), l4 = e4.sincosd(a5), f4 = this._f1 * l4.s, y4 = l4.c, f4 /= l4 = e4.hypot(f4, y4), y4 /= l4, y4 = Math.max(t4.tiny_, y4), _4 < -m4 ? y4 === _4 && (f4 = e4.copysign(m4, f4)) : Math.abs(f4) === -m4 && (y4 = _4), g4 = Math.sqrt(1 + this._ep2 * e4.sq(m4)), x4 = Math.sqrt(1 + this._ep2 * e4.sq(f4)), T3 = new Array(t4.nC1_ + 1), O3 = new Array(t4.nC2_ + 1), R3 = new Array(t4.nC3_), (q3 = -90 === s5 || 0 === P4) && (N4 = P4, z3 = 0, B3 = m4, k3 = (C4 = A4) * _4, D3 = f4, U3 = (I3 = 1) * y4, G4 = Math.atan2(Math.max(0, k3 * D3 - B3 * U3), k3 * U3 + B3 * D3), p4 = (L3 = this.Lengths(this._n, G4, B3, k3, g4, D3, U3, x4, _4, y4, r4 | t4.DISTANCE | t4.REDUCEDLENGTH, T3, O3)).s12b, M4 = L3.m12b, r4 & t4.GEODESICSCALE && (St3.M12 = L3.M12, St3.M21 = L3.M21), G4 < 1 || M4 >= 0 ? ((G4 < 3 * t4.tiny_ || G4 < E3 && (p4 < 0 || M4 < 0)) && (G4 = M4 = p4 = 0), M4 *= this._b, p4 *= this._b, St3.a12 = G4 / e4.degree) : q3 = false), mt3 = 2, !q3 && 0 === m4 && (this.f <= 0 || o4 >= 180 * this.f))
5256
- C4 = I3 = 0, N4 = z3 = 1, p4 = this.a * b4, G4 = F3 = b4 / this._f1, M4 = this._b * Math.sin(G4), r4 & t4.GEODESICSCALE && (St3.M12 = St3.M21 = Math.cos(G4)), St3.a12 = h4 / this._f1;
5266
+ var h4, o4, c4, l4, u4, d4, m4, _4, f4, y4, p4, g4, M4, x4, b4, P4, A4, G4, C4, N4, I3, z3, T3, O3, R3, q3, L3, B3, k3, D3, U3, j3, F3, V3, W3, H3, X3, Y3, Z3, Q3, K3, J3, $3, tt3, st3, it3, et3, at3, nt3, rt3, ht3, ot3, ct3, lt3, ut3, dt3, mt3, _t3, ft3, yt3, pt3, gt3, Mt3, xt3, wt3, St3 = {};
5267
+ if (St3.lat1 = s5 = e4.LatFix(s5), St3.lat2 = a5 = e4.LatFix(a5), s5 = e4.AngRound(s5), a5 = e4.AngRound(a5), o4 = (h4 = e4.AngDiff(i5, n4)).e, h4 = h4.d, r4 & t4.LONG_UNROLL ? (St3.lon1 = i5, St3.lon2 = i5 + h4 + o4) : (St3.lon1 = e4.AngNormalize(i5), St3.lon2 = e4.AngNormalize(n4)), o4 *= c4 = e4.copysign(1, h4), b4 = (h4 *= c4) * e4.degree, P4 = (l4 = e4.sincosde(h4, o4)).s, A4 = l4.c, o4 = 180 - h4 - o4, (u4 = Math.abs(s5) < Math.abs(a5) || isNaN(a5) ? -1 : 1) < 0 && (c4 *= -1, [a5, s5] = [s5, a5]), s5 *= d4 = e4.copysign(1, -s5), a5 *= d4, l4 = e4.sincosd(s5), m4 = this._f1 * l4.s, _4 = l4.c, m4 /= l4 = e4.hypot(m4, _4), _4 /= l4, _4 = Math.max(t4.tiny_, _4), l4 = e4.sincosd(a5), f4 = this._f1 * l4.s, y4 = l4.c, f4 /= l4 = e4.hypot(f4, y4), y4 /= l4, y4 = Math.max(t4.tiny_, y4), _4 < -m4 ? y4 === _4 && (f4 = e4.copysign(m4, f4)) : Math.abs(f4) === -m4 && (y4 = _4), M4 = Math.sqrt(1 + this._ep2 * e4.sq(m4)), x4 = Math.sqrt(1 + this._ep2 * e4.sq(f4)), T3 = new Array(t4.nC1_ + 1), O3 = new Array(t4.nC2_ + 1), R3 = new Array(t4.nC3_), (q3 = -90 === s5 || 0 === P4) && (N4 = P4, z3 = 0, B3 = m4, k3 = (C4 = A4) * _4, D3 = f4, U3 = (I3 = 1) * y4, G4 = Math.atan2(Math.max(0, k3 * D3 - B3 * U3), k3 * U3 + B3 * D3), p4 = (L3 = this.Lengths(this._n, G4, B3, k3, M4, D3, U3, x4, _4, y4, r4 | t4.DISTANCE | t4.REDUCEDLENGTH, T3, O3)).s12b, g4 = L3.m12b, r4 & t4.GEODESICSCALE && (St3.M12 = L3.M12, St3.M21 = L3.M21), G4 < 1 || g4 >= 0 ? ((G4 < 3 * t4.tiny_ || G4 < E3 && (p4 < 0 || g4 < 0)) && (G4 = g4 = p4 = 0), g4 *= this._b, p4 *= this._b, St3.a12 = G4 / e4.degree) : q3 = false), mt3 = 2, !q3 && 0 === m4 && (this.f <= 0 || o4 >= 180 * this.f))
5268
+ C4 = I3 = 0, N4 = z3 = 1, p4 = this.a * b4, G4 = F3 = b4 / this._f1, g4 = this._b * Math.sin(G4), r4 & t4.GEODESICSCALE && (St3.M12 = St3.M21 = Math.cos(G4)), St3.a12 = h4 / this._f1;
5257
5269
  else if (!q3)
5258
- if (G4 = (L3 = this.InverseStart(m4, _4, g4, f4, y4, x4, b4, P4, A4, T3, O3)).sig12, N4 = L3.salp1, C4 = L3.calp1, G4 >= 0)
5259
- z3 = L3.salp2, I3 = L3.calp2, V3 = L3.dnm, p4 = G4 * this._b * V3, M4 = e4.sq(V3) * this._b * Math.sin(G4 / V3), r4 & t4.GEODESICSCALE && (St3.M12 = St3.M21 = Math.cos(G4 / V3)), St3.a12 = G4 / e4.degree, F3 = b4 / (this._f1 * V3);
5270
+ if (G4 = (L3 = this.InverseStart(m4, _4, M4, f4, y4, x4, b4, P4, A4, T3, O3)).sig12, N4 = L3.salp1, C4 = L3.calp1, G4 >= 0)
5271
+ z3 = L3.salp2, I3 = L3.calp2, V3 = L3.dnm, p4 = G4 * this._b * V3, g4 = e4.sq(V3) * this._b * Math.sin(G4 / V3), r4 & t4.GEODESICSCALE && (St3.M12 = St3.M21 = Math.cos(G4 / V3)), St3.a12 = G4 / e4.degree, F3 = b4 / (this._f1 * V3);
5260
5272
  else {
5261
- for (W3 = 0, H3 = t4.tiny_, Z3 = 1, Q3 = t4.tiny_, X3 = -1, Y3 = false, K3 = false; J3 = (L3 = this.Lambda12(m4, _4, g4, f4, y4, x4, N4, C4, P4, A4, W3 < w3, T3, O3, R3)).lam12, z3 = L3.salp2, I3 = L3.calp2, G4 = L3.sig12, B3 = L3.ssig1, k3 = L3.csig1, D3 = L3.ssig2, U3 = L3.csig2, j3 = L3.eps, ft3 = L3.domg12, $3 = L3.dlam12, !K3 && Math.abs(J3) >= (Y3 ? 8 : 1) * E3 && W3 != S3; ++W3)
5262
- J3 > 0 && (W3 < w3 || C4 / N4 > X3 / Q3) ? (Q3 = N4, X3 = C4) : J3 < 0 && (W3 < w3 || C4 / N4 < Z3 / H3) && (H3 = N4, Z3 = C4), W3 < w3 && $3 > 0 && (tt3 = -J3 / $3, Math.abs(tt3) < Math.PI && (st3 = Math.sin(tt3), (et3 = N4 * (it3 = Math.cos(tt3)) + C4 * st3) > 0)) ? (C4 = C4 * it3 - N4 * st3, N4 = et3, N4 /= l4 = e4.hypot(N4, C4), C4 /= l4, Y3 = Math.abs(J3) <= 16 * E3) : (N4 = (H3 + Q3) / 2, C4 = (Z3 + X3) / 2, N4 /= l4 = e4.hypot(N4, C4), C4 /= l4, Y3 = false, K3 = Math.abs(H3 - N4) + (Z3 - C4) < v3 || Math.abs(N4 - Q3) + (C4 - X3) < v3);
5263
- at3 = r4 | (r4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) ? t4.DISTANCE : t4.NONE), p4 = (L3 = this.Lengths(j3, G4, B3, k3, g4, D3, U3, x4, _4, y4, at3, T3, O3)).s12b, M4 = L3.m12b, r4 & t4.GEODESICSCALE && (St3.M12 = L3.M12, St3.M21 = L3.M21), M4 *= this._b, p4 *= this._b, St3.a12 = G4 / e4.degree, r4 & t4.AREA && (xt3 = Math.sin(ft3), mt3 = P4 * (wt3 = Math.cos(ft3)) - A4 * xt3, _t3 = A4 * wt3 + P4 * xt3);
5273
+ for (W3 = 0, H3 = t4.tiny_, X3 = 1, Y3 = t4.tiny_, Z3 = -1, Q3 = false, K3 = false; J3 = (L3 = this.Lambda12(m4, _4, M4, f4, y4, x4, N4, C4, P4, A4, W3 < w3, T3, O3, R3)).lam12, z3 = L3.salp2, I3 = L3.calp2, G4 = L3.sig12, B3 = L3.ssig1, k3 = L3.csig1, D3 = L3.ssig2, U3 = L3.csig2, j3 = L3.eps, ft3 = L3.domg12, $3 = L3.dlam12, !K3 && Math.abs(J3) >= (Q3 ? 8 : 1) * E3 && W3 != S3; ++W3)
5274
+ J3 > 0 && (W3 < w3 || C4 / N4 > Z3 / Y3) ? (Y3 = N4, Z3 = C4) : J3 < 0 && (W3 < w3 || C4 / N4 < X3 / H3) && (H3 = N4, X3 = C4), W3 < w3 && $3 > 0 && (tt3 = -J3 / $3, Math.abs(tt3) < Math.PI && (st3 = Math.sin(tt3), (et3 = N4 * (it3 = Math.cos(tt3)) + C4 * st3) > 0)) ? (C4 = C4 * it3 - N4 * st3, N4 = et3, N4 /= l4 = e4.hypot(N4, C4), C4 /= l4, Q3 = Math.abs(J3) <= 16 * E3) : (N4 = (H3 + Y3) / 2, C4 = (X3 + Z3) / 2, N4 /= l4 = e4.hypot(N4, C4), C4 /= l4, Q3 = false, K3 = Math.abs(H3 - N4) + (X3 - C4) < v3 || Math.abs(N4 - Y3) + (C4 - Z3) < v3);
5275
+ at3 = r4 | (r4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) ? t4.DISTANCE : t4.NONE), p4 = (L3 = this.Lengths(j3, G4, B3, k3, M4, D3, U3, x4, _4, y4, at3, T3, O3)).s12b, g4 = L3.m12b, r4 & t4.GEODESICSCALE && (St3.M12 = L3.M12, St3.M21 = L3.M21), g4 *= this._b, p4 *= this._b, St3.a12 = G4 / e4.degree, r4 & t4.AREA && (xt3 = Math.sin(ft3), mt3 = P4 * (wt3 = Math.cos(ft3)) - A4 * xt3, _t3 = A4 * wt3 + P4 * xt3);
5264
5276
  }
5265
- return r4 & t4.DISTANCE && (St3.s12 = 0 + p4), r4 & t4.REDUCEDLENGTH && (St3.m12 = 0 + M4), r4 & t4.AREA && (nt3 = N4 * _4, 0 !== (rt3 = e4.hypot(C4, N4 * m4)) && 0 !== nt3 ? (B3 = m4, k3 = C4 * _4, D3 = f4, U3 = I3 * y4, j3 = (ot3 = e4.sq(rt3) * this._ep2) / (2 * (1 + Math.sqrt(1 + ot3)) + ot3), ct3 = e4.sq(this.a) * rt3 * nt3 * this._e2, B3 /= l4 = e4.hypot(B3, k3), k3 /= l4, D3 /= l4 = e4.hypot(D3, U3), U3 /= l4, lt3 = new Array(t4.nC4_), this.C4f(j3, lt3), ut3 = t4.SinCosSeries(false, B3, k3, lt3), dt3 = t4.SinCosSeries(false, D3, U3, lt3), St3.S12 = ct3 * (dt3 - ut3)) : St3.S12 = 0, q3 || 2 != mt3 || (mt3 = Math.sin(F3), _t3 = Math.cos(F3)), !q3 && _t3 > -0.7071 && f4 - m4 < 1.75 ? (ft3 = 1 + _t3, yt3 = 1 + _4, pt3 = 1 + y4, ht3 = 2 * Math.atan2(mt3 * (m4 * pt3 + f4 * yt3), ft3 * (m4 * f4 + yt3 * pt3))) : (gt3 = I3 * C4 + z3 * N4, 0 === (Mt3 = z3 * C4 - I3 * N4) && gt3 < 0 && (Mt3 = t4.tiny_ * C4, gt3 = -1), ht3 = Math.atan2(Mt3, gt3)), St3.S12 += this._c2 * ht3, St3.S12 *= u4 * c4 * d4, St3.S12 += 0), u4 < 0 && ([z3, N4] = [N4, z3], [I3, C4] = [C4, I3], r4 & t4.GEODESICSCALE && ([St3.M21, St3.M12] = [St3.M12, St3.M21])), { vals: St3, salp1: N4 *= u4 * c4, calp1: C4 *= u4 * d4, salp2: z3 *= u4 * c4, calp2: I3 *= u4 * d4 };
5277
+ return r4 & t4.DISTANCE && (St3.s12 = 0 + p4), r4 & t4.REDUCEDLENGTH && (St3.m12 = 0 + g4), r4 & t4.AREA && (nt3 = N4 * _4, 0 !== (rt3 = e4.hypot(C4, N4 * m4)) && 0 !== nt3 ? (B3 = m4, k3 = C4 * _4, D3 = f4, U3 = I3 * y4, j3 = (ot3 = e4.sq(rt3) * this._ep2) / (2 * (1 + Math.sqrt(1 + ot3)) + ot3), ct3 = e4.sq(this.a) * rt3 * nt3 * this._e2, B3 /= l4 = e4.hypot(B3, k3), k3 /= l4, D3 /= l4 = e4.hypot(D3, U3), U3 /= l4, lt3 = new Array(t4.nC4_), this.C4f(j3, lt3), ut3 = t4.SinCosSeries(false, B3, k3, lt3), dt3 = t4.SinCosSeries(false, D3, U3, lt3), St3.S12 = ct3 * (dt3 - ut3)) : St3.S12 = 0, q3 || 2 != mt3 || (mt3 = Math.sin(F3), _t3 = Math.cos(F3)), !q3 && _t3 > -0.7071 && f4 - m4 < 1.75 ? (ft3 = 1 + _t3, yt3 = 1 + _4, pt3 = 1 + y4, ht3 = 2 * Math.atan2(mt3 * (m4 * pt3 + f4 * yt3), ft3 * (m4 * f4 + yt3 * pt3))) : (Mt3 = I3 * C4 + z3 * N4, 0 === (gt3 = z3 * C4 - I3 * N4) && Mt3 < 0 && (gt3 = t4.tiny_ * C4, Mt3 = -1), ht3 = Math.atan2(gt3, Mt3)), St3.S12 += this._c2 * ht3, St3.S12 *= u4 * c4 * d4, St3.S12 += 0), u4 < 0 && ([z3, N4] = [N4, z3], [I3, C4] = [C4, I3], r4 & t4.GEODESICSCALE && ([St3.M21, St3.M12] = [St3.M12, St3.M21])), { vals: St3, salp1: N4 *= u4 * c4, calp1: C4 *= u4 * d4, salp2: z3 *= u4 * c4, calp2: I3 *= u4 * d4 };
5266
5278
  }, t4.Geodesic.prototype.GenDirect = function(i5, e5, a5, n4, r4, h4) {
5267
5279
  return h4 ? h4 === t4.LONG_UNROLL && (h4 |= t4.STANDARD) : h4 = t4.STANDARD, n4 || (h4 |= t4.DISTANCE_IN), new s4.GeodesicLine(this, i5, e5, a5, h4).GenPosition(n4, r4, h4);
5268
5280
  }, t4.Geodesic.prototype.Direct = function(t5, s5, i5, e5, a5) {
@@ -5289,8 +5301,8 @@ Me.exports = function() {
5289
5301
  var c3, l3, u3, d3, m3, _3;
5290
5302
  r3 || (r3 = t4.STANDARD | t4.DISTANCE_IN), this.a = s5.a, this.f = s5.f, this._b = s5._b, this._c2 = s5._c2, this._f1 = s5._f1, this.caps = r3 | t4.LATITUDE | t4.AZIMUTH | t4.LONG_UNROLL, this.lat1 = i4.LatFix(e4), this.lon1 = a4, void 0 === h3 || void 0 === o3 ? (this.azi1 = i4.AngNormalize(n3), c3 = i4.sincosd(i4.AngRound(this.azi1)), this.salp1 = c3.s, this.calp1 = c3.c) : (this.azi1 = n3, this.salp1 = h3, this.calp1 = o3), c3 = i4.sincosd(i4.AngRound(this.lat1)), u3 = this._f1 * c3.s, l3 = c3.c, u3 /= c3 = i4.hypot(u3, l3), l3 /= c3, l3 = Math.max(t4.tiny_, l3), this._dn1 = Math.sqrt(1 + s5._ep2 * i4.sq(u3)), this._salp0 = this.salp1 * l3, this._calp0 = i4.hypot(this.calp1, this.salp1 * u3), this._ssig1 = u3, this._somg1 = this._salp0 * u3, this._csig1 = this._comg1 = 0 !== u3 || 0 !== this.calp1 ? l3 * this.calp1 : 1, c3 = i4.hypot(this._ssig1, this._csig1), this._ssig1 /= c3, this._csig1 /= c3, this._k2 = i4.sq(this._calp0) * s5._ep2, d3 = this._k2 / (2 * (1 + Math.sqrt(1 + this._k2)) + this._k2), this.caps & t4.CAP_C1 && (this._A1m1 = t4.A1m1f(d3), this._C1a = new Array(t4.nC1_ + 1), t4.C1f(d3, this._C1a), this._B11 = t4.SinCosSeries(true, this._ssig1, this._csig1, this._C1a), m3 = Math.sin(this._B11), _3 = Math.cos(this._B11), this._stau1 = this._ssig1 * _3 + this._csig1 * m3, this._ctau1 = this._csig1 * _3 - this._ssig1 * m3), this.caps & t4.CAP_C1p && (this._C1pa = new Array(t4.nC1p_ + 1), t4.C1pf(d3, this._C1pa)), this.caps & t4.CAP_C2 && (this._A2m1 = t4.A2m1f(d3), this._C2a = new Array(t4.nC2_ + 1), t4.C2f(d3, this._C2a), this._B21 = t4.SinCosSeries(true, this._ssig1, this._csig1, this._C2a)), this.caps & t4.CAP_C3 && (this._C3a = new Array(t4.nC3_), s5.C3f(d3, this._C3a), this._A3c = -this.f * this._salp0 * s5.A3f(d3), this._B31 = t4.SinCosSeries(true, this._ssig1, this._csig1, this._C3a)), this.caps & t4.CAP_C4 && (this._C4a = new Array(t4.nC4_), s5.C4f(d3, this._C4a), this._A4 = i4.sq(this.a) * this._calp0 * this._salp0 * s5._e2, this._B41 = t4.SinCosSeries(false, this._ssig1, this._csig1, this._C4a)), this.a13 = this.s13 = NaN;
5291
5303
  }, s4.GeodesicLine.prototype.GenPosition = function(s5, e4, a4) {
5292
- var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3, p3, M3, g3, x3, w3, S3, E3, b3, P3, v3, A3, G3, C3, N3, I3 = {};
5293
- return a4 ? a4 === t4.LONG_UNROLL && (a4 |= t4.STANDARD) : a4 = t4.STANDARD, a4 &= this.caps & t4.OUT_MASK, I3.lat1 = this.lat1, I3.azi1 = this.azi1, I3.lon1 = a4 & t4.LONG_UNROLL ? this.lon1 : i4.AngNormalize(this.lon1), s5 ? I3.a12 = e4 : I3.s12 = e4, s5 || this.caps & t4.DISTANCE_IN & t4.OUT_MASK ? (o3 = 0, c3 = 0, s5 ? (n3 = e4 * i4.degree, r3 = (A3 = i4.sincosd(e4)).s, h3 = A3.c) : (d3 = e4 / (this._b * (1 + this._A1m1)), m3 = Math.sin(d3), _3 = Math.cos(d3), n3 = d3 - ((o3 = -t4.SinCosSeries(true, this._stau1 * _3 + this._ctau1 * m3, this._ctau1 * _3 - this._stau1 * m3, this._C1pa)) - this._B11), r3 = Math.sin(n3), h3 = Math.cos(n3), Math.abs(this.f) > 0.01 && (l3 = this._ssig1 * h3 + this._csig1 * r3, u3 = this._csig1 * h3 - this._ssig1 * r3, o3 = t4.SinCosSeries(true, l3, u3, this._C1a), n3 -= ((1 + this._A1m1) * (n3 + (o3 - this._B11)) - e4 / this._b) / Math.sqrt(1 + this._k2 * i4.sq(l3)), r3 = Math.sin(n3), h3 = Math.cos(n3))), l3 = this._ssig1 * h3 + this._csig1 * r3, u3 = this._csig1 * h3 - this._ssig1 * r3, E3 = Math.sqrt(1 + this._k2 * i4.sq(l3)), a4 & (t4.DISTANCE | t4.REDUCEDLENGTH | t4.GEODESICSCALE) && ((s5 || Math.abs(this.f) > 0.01) && (o3 = t4.SinCosSeries(true, l3, u3, this._C1a)), c3 = (1 + this._A1m1) * (o3 - this._B11)), p3 = this._calp0 * l3, 0 === (M3 = i4.hypot(this._salp0, this._calp0 * u3)) && (M3 = u3 = t4.tiny_), w3 = this._salp0, S3 = this._calp0 * u3, s5 && a4 & t4.DISTANCE && (I3.s12 = this._b * ((1 + this._A1m1) * n3 + c3)), a4 & t4.LONGITUDE && (g3 = this._salp0 * l3, x3 = u3, y3 = i4.copysign(1, this._salp0), f3 = ((a4 & t4.LONG_UNROLL ? y3 * (n3 - (Math.atan2(l3, u3) - Math.atan2(this._ssig1, this._csig1)) + (Math.atan2(y3 * g3, x3) - Math.atan2(y3 * this._somg1, this._comg1))) : Math.atan2(g3 * this._comg1 - x3 * this._somg1, x3 * this._comg1 + g3 * this._somg1)) + this._A3c * (n3 + (t4.SinCosSeries(true, l3, u3, this._C3a) - this._B31))) / i4.degree, I3.lon2 = a4 & t4.LONG_UNROLL ? this.lon1 + f3 : i4.AngNormalize(i4.AngNormalize(this.lon1) + i4.AngNormalize(f3))), a4 & t4.LATITUDE && (I3.lat2 = i4.atan2d(p3, this._f1 * M3)), a4 & t4.AZIMUTH && (I3.azi2 = i4.atan2d(w3, S3)), a4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (b3 = t4.SinCosSeries(true, l3, u3, this._C2a), P3 = (1 + this._A2m1) * (b3 - this._B21), v3 = (this._A1m1 - this._A2m1) * n3 + (c3 - P3), a4 & t4.REDUCEDLENGTH && (I3.m12 = this._b * (E3 * (this._csig1 * l3) - this._dn1 * (this._ssig1 * u3) - this._csig1 * u3 * v3)), a4 & t4.GEODESICSCALE && (A3 = this._k2 * (l3 - this._ssig1) * (l3 + this._ssig1) / (this._dn1 + E3), I3.M12 = h3 + (A3 * l3 - u3 * v3) * this._ssig1 / this._dn1, I3.M21 = h3 - (A3 * this._ssig1 - this._csig1 * v3) * l3 / E3)), a4 & t4.AREA && (G3 = t4.SinCosSeries(false, l3, u3, this._C4a), 0 === this._calp0 || 0 === this._salp0 ? (C3 = w3 * this.calp1 - S3 * this.salp1, N3 = S3 * this.calp1 + w3 * this.salp1) : (C3 = this._calp0 * this._salp0 * (h3 <= 0 ? this._csig1 * (1 - h3) + r3 * this._ssig1 : r3 * (this._csig1 * r3 / (1 + h3) + this._ssig1)), N3 = i4.sq(this._salp0) + i4.sq(this._calp0) * this._csig1 * u3), I3.S12 = this._c2 * Math.atan2(C3, N3) + this._A4 * (G3 - this._B41)), s5 || (I3.a12 = n3 / i4.degree), I3) : (I3.a12 = NaN, I3);
5304
+ var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3, p3, g3, M3, x3, w3, S3, E3, b3, P3, v3, A3, G3, C3, N3, I3 = {};
5305
+ return a4 ? a4 === t4.LONG_UNROLL && (a4 |= t4.STANDARD) : a4 = t4.STANDARD, a4 &= this.caps & t4.OUT_MASK, I3.lat1 = this.lat1, I3.azi1 = this.azi1, I3.lon1 = a4 & t4.LONG_UNROLL ? this.lon1 : i4.AngNormalize(this.lon1), s5 ? I3.a12 = e4 : I3.s12 = e4, s5 || this.caps & t4.DISTANCE_IN & t4.OUT_MASK ? (o3 = 0, c3 = 0, s5 ? (n3 = e4 * i4.degree, r3 = (A3 = i4.sincosd(e4)).s, h3 = A3.c) : (d3 = e4 / (this._b * (1 + this._A1m1)), m3 = Math.sin(d3), _3 = Math.cos(d3), n3 = d3 - ((o3 = -t4.SinCosSeries(true, this._stau1 * _3 + this._ctau1 * m3, this._ctau1 * _3 - this._stau1 * m3, this._C1pa)) - this._B11), r3 = Math.sin(n3), h3 = Math.cos(n3), Math.abs(this.f) > 0.01 && (l3 = this._ssig1 * h3 + this._csig1 * r3, u3 = this._csig1 * h3 - this._ssig1 * r3, o3 = t4.SinCosSeries(true, l3, u3, this._C1a), n3 -= ((1 + this._A1m1) * (n3 + (o3 - this._B11)) - e4 / this._b) / Math.sqrt(1 + this._k2 * i4.sq(l3)), r3 = Math.sin(n3), h3 = Math.cos(n3))), l3 = this._ssig1 * h3 + this._csig1 * r3, u3 = this._csig1 * h3 - this._ssig1 * r3, E3 = Math.sqrt(1 + this._k2 * i4.sq(l3)), a4 & (t4.DISTANCE | t4.REDUCEDLENGTH | t4.GEODESICSCALE) && ((s5 || Math.abs(this.f) > 0.01) && (o3 = t4.SinCosSeries(true, l3, u3, this._C1a)), c3 = (1 + this._A1m1) * (o3 - this._B11)), p3 = this._calp0 * l3, 0 === (g3 = i4.hypot(this._salp0, this._calp0 * u3)) && (g3 = u3 = t4.tiny_), w3 = this._salp0, S3 = this._calp0 * u3, s5 && a4 & t4.DISTANCE && (I3.s12 = this._b * ((1 + this._A1m1) * n3 + c3)), a4 & t4.LONGITUDE && (M3 = this._salp0 * l3, x3 = u3, y3 = i4.copysign(1, this._salp0), f3 = ((a4 & t4.LONG_UNROLL ? y3 * (n3 - (Math.atan2(l3, u3) - Math.atan2(this._ssig1, this._csig1)) + (Math.atan2(y3 * M3, x3) - Math.atan2(y3 * this._somg1, this._comg1))) : Math.atan2(M3 * this._comg1 - x3 * this._somg1, x3 * this._comg1 + M3 * this._somg1)) + this._A3c * (n3 + (t4.SinCosSeries(true, l3, u3, this._C3a) - this._B31))) / i4.degree, I3.lon2 = a4 & t4.LONG_UNROLL ? this.lon1 + f3 : i4.AngNormalize(i4.AngNormalize(this.lon1) + i4.AngNormalize(f3))), a4 & t4.LATITUDE && (I3.lat2 = i4.atan2d(p3, this._f1 * g3)), a4 & t4.AZIMUTH && (I3.azi2 = i4.atan2d(w3, S3)), a4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (b3 = t4.SinCosSeries(true, l3, u3, this._C2a), P3 = (1 + this._A2m1) * (b3 - this._B21), v3 = (this._A1m1 - this._A2m1) * n3 + (c3 - P3), a4 & t4.REDUCEDLENGTH && (I3.m12 = this._b * (E3 * (this._csig1 * l3) - this._dn1 * (this._ssig1 * u3) - this._csig1 * u3 * v3)), a4 & t4.GEODESICSCALE && (A3 = this._k2 * (l3 - this._ssig1) * (l3 + this._ssig1) / (this._dn1 + E3), I3.M12 = h3 + (A3 * l3 - u3 * v3) * this._ssig1 / this._dn1, I3.M21 = h3 - (A3 * this._ssig1 - this._csig1 * v3) * l3 / E3)), a4 & t4.AREA && (G3 = t4.SinCosSeries(false, l3, u3, this._C4a), 0 === this._calp0 || 0 === this._salp0 ? (C3 = w3 * this.calp1 - S3 * this.salp1, N3 = S3 * this.calp1 + w3 * this.salp1) : (C3 = this._calp0 * this._salp0 * (h3 <= 0 ? this._csig1 * (1 - h3) + r3 * this._ssig1 : r3 * (this._csig1 * r3 / (1 + h3) + this._ssig1)), N3 = i4.sq(this._salp0) + i4.sq(this._calp0) * this._csig1 * u3), I3.S12 = this._c2 * Math.atan2(C3, N3) + this._A4 * (G3 - this._B41)), s5 || (I3.a12 = n3 / i4.degree), I3) : (I3.a12 = NaN, I3);
5294
5306
  }, s4.GeodesicLine.prototype.Position = function(t5, s5) {
5295
5307
  return this.GenPosition(false, t5, s5);
5296
5308
  }, s4.GeodesicLine.prototype.ArcPosition = function(t5, s5) {
@@ -5347,17 +5359,17 @@ Me.exports = function() {
5347
5359
  this.sin_p12 = Math.sin(this.lat0), this.cos_p12 = Math.cos(this.lat0), this.g = new Ia.Geodesic.Geodesic(this.a, this.es / (1 + Math.sqrt(1 - this.es)));
5348
5360
  }
5349
5361
  function Ta(t3) {
5350
- var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, y3, p3, M3, g3 = t3.x, x3 = t3.y, w3 = Math.sin(t3.y), S3 = Math.cos(t3.y), E3 = yt2(g3 - this.long0);
5351
- return this.sphere ? Math.abs(this.sin_p12 - 1) <= _2 ? (t3.x = this.x0 + this.a * (l2 - x3) * Math.sin(E3), t3.y = this.y0 - this.a * (l2 - x3) * Math.cos(E3), t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (t3.x = this.x0 + this.a * (l2 + x3) * Math.sin(E3), t3.y = this.y0 + this.a * (l2 + x3) * Math.cos(E3), t3) : (c3 = this.sin_p12 * w3 + this.cos_p12 * S3 * Math.cos(E3), o3 = (h3 = Math.acos(c3)) ? h3 / Math.sin(h3) : 1, t3.x = this.x0 + this.a * o3 * S3 * Math.sin(E3), t3.y = this.y0 + this.a * o3 * (this.cos_p12 * w3 - this.sin_p12 * S3 * Math.cos(E3)), t3) : (s3 = ce2(this.es), i3 = le2(this.es), e3 = ue2(this.es), a3 = de2(this.es), Math.abs(this.sin_p12 - 1) <= _2 ? (n3 = this.a * oe2(s3, i3, e3, a3, l2), r3 = this.a * oe2(s3, i3, e3, a3, x3), t3.x = this.x0 + (n3 - r3) * Math.sin(E3), t3.y = this.y0 - (n3 - r3) * Math.cos(E3), t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (n3 = this.a * oe2(s3, i3, e3, a3, l2), r3 = this.a * oe2(s3, i3, e3, a3, x3), t3.x = this.x0 + (n3 + r3) * Math.sin(E3), t3.y = this.y0 + (n3 + r3) * Math.cos(E3), t3) : Math.abs(g3) < _2 && Math.abs(x3 - this.lat0) < _2 ? (t3.x = t3.y = 0, t3) : (u3 = this.lat0 / f2, d3 = this.long0 / f2, m3 = x3 / f2, y3 = g3 / f2, M3 = (p3 = this.g.Inverse(u3, d3, m3, y3, this.g.AZIMUTH)).azi1 * f2, t3.x = p3.s12 * Math.sin(M3), t3.y = p3.s12 * Math.cos(M3), t3));
5362
+ var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, y3, p3, g3, M3 = t3.x, x3 = t3.y, w3 = Math.sin(t3.y), S3 = Math.cos(t3.y), E3 = yt2(M3 - this.long0);
5363
+ return this.sphere ? Math.abs(this.sin_p12 - 1) <= _2 ? (t3.x = this.x0 + this.a * (l2 - x3) * Math.sin(E3), t3.y = this.y0 - this.a * (l2 - x3) * Math.cos(E3), t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (t3.x = this.x0 + this.a * (l2 + x3) * Math.sin(E3), t3.y = this.y0 + this.a * (l2 + x3) * Math.cos(E3), t3) : (c3 = this.sin_p12 * w3 + this.cos_p12 * S3 * Math.cos(E3), o3 = (h3 = Math.acos(c3)) ? h3 / Math.sin(h3) : 1, t3.x = this.x0 + this.a * o3 * S3 * Math.sin(E3), t3.y = this.y0 + this.a * o3 * (this.cos_p12 * w3 - this.sin_p12 * S3 * Math.cos(E3)), t3) : (s3 = ce2(this.es), i3 = le2(this.es), e3 = ue2(this.es), a3 = de2(this.es), Math.abs(this.sin_p12 - 1) <= _2 ? (n3 = this.a * oe2(s3, i3, e3, a3, l2), r3 = this.a * oe2(s3, i3, e3, a3, x3), t3.x = this.x0 + (n3 - r3) * Math.sin(E3), t3.y = this.y0 - (n3 - r3) * Math.cos(E3), t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (n3 = this.a * oe2(s3, i3, e3, a3, l2), r3 = this.a * oe2(s3, i3, e3, a3, x3), t3.x = this.x0 + (n3 + r3) * Math.sin(E3), t3.y = this.y0 + (n3 + r3) * Math.cos(E3), t3) : Math.abs(M3) < _2 && Math.abs(x3 - this.lat0) < _2 ? (t3.x = t3.y = 0, t3) : (u3 = this.lat0 / f2, d3 = this.long0 / f2, m3 = x3 / f2, y3 = M3 / f2, g3 = (p3 = this.g.Inverse(u3, d3, m3, y3, this.g.AZIMUTH)).azi1 * f2, t3.x = p3.s12 * Math.sin(g3), t3.y = p3.s12 * Math.cos(g3), t3));
5352
5364
  }
5353
5365
  function Oa(t3) {
5354
- var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, y3, p3, M3, g3, x3;
5366
+ var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, y3, p3, g3, M3, x3;
5355
5367
  if (t3.x -= this.x0, t3.y -= this.y0, this.sphere) {
5356
5368
  if ((s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y)) > 2 * l2 * this.a)
5357
5369
  return;
5358
5370
  return i3 = s3 / this.a, e3 = Math.sin(i3), a3 = Math.cos(i3), n3 = this.long0, Math.abs(s3) <= _2 ? r3 = this.lat0 : (r3 = Te2(a3 * this.sin_p12 + t3.y * e3 * this.cos_p12 / s3), h3 = Math.abs(this.lat0) - l2, n3 = Math.abs(h3) <= _2 ? this.lat0 >= 0 ? yt2(this.long0 + Math.atan2(t3.x, -t3.y)) : yt2(this.long0 - Math.atan2(-t3.x, t3.y)) : yt2(this.long0 + Math.atan2(t3.x * e3, s3 * this.cos_p12 * a3 - t3.y * this.sin_p12 * e3))), t3.x = n3, t3.y = r3, t3;
5359
5371
  }
5360
- return o3 = ce2(this.es), c3 = le2(this.es), u3 = ue2(this.es), d3 = de2(this.es), Math.abs(this.sin_p12 - 1) <= _2 ? (r3 = fe2(((m3 = this.a * oe2(o3, c3, u3, d3, l2)) - (s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y))) / this.a, o3, c3, u3, d3), n3 = yt2(this.long0 + Math.atan2(t3.x, -1 * t3.y)), t3.x = n3, t3.y = r3, t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (m3 = this.a * oe2(o3, c3, u3, d3, l2), r3 = fe2(((s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y)) - m3) / this.a, o3, c3, u3, d3), n3 = yt2(this.long0 + Math.atan2(t3.x, t3.y)), t3.x = n3, t3.y = r3, t3) : (y3 = this.lat0 / f2, p3 = this.long0 / f2, M3 = Math.atan2(t3.x, t3.y) / f2, g3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y), x3 = this.g.Direct(y3, p3, M3, g3, this.g.STANDARD), t3.x = x3.lon2 * f2, t3.y = x3.lat2 * f2, t3);
5372
+ return o3 = ce2(this.es), c3 = le2(this.es), u3 = ue2(this.es), d3 = de2(this.es), Math.abs(this.sin_p12 - 1) <= _2 ? (r3 = fe2(((m3 = this.a * oe2(o3, c3, u3, d3, l2)) - (s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y))) / this.a, o3, c3, u3, d3), n3 = yt2(this.long0 + Math.atan2(t3.x, -1 * t3.y)), t3.x = n3, t3.y = r3, t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (m3 = this.a * oe2(o3, c3, u3, d3, l2), r3 = fe2(((s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y)) - m3) / this.a, o3, c3, u3, d3), n3 = yt2(this.long0 + Math.atan2(t3.x, t3.y)), t3.x = n3, t3.y = r3, t3) : (y3 = this.lat0 / f2, p3 = this.long0 / f2, g3 = Math.atan2(t3.x, t3.y) / f2, M3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y), x3 = this.g.Direct(y3, p3, g3, M3, this.g.STANDARD), t3.x = x3.lon2 * f2, t3.y = x3.lat2 * f2, t3);
5361
5373
  }
5362
5374
  var Ra = { init: za, forward: Ta, inverse: Oa, names: ["Azimuthal_Equidistant", "aeqd"] };
5363
5375
  function qa() {
@@ -5378,36 +5390,36 @@ Me.exports = function() {
5378
5390
  function Fa(t3) {
5379
5391
  var s3, i3, e3, a3, n3, r3, h3 = { x: 0, y: 0 }, o3 = { value: 0 };
5380
5392
  if (t3.x -= this.long0, s3 = 0 !== this.es ? Math.atan(this.one_minus_f_squared * Math.tan(t3.y)) : t3.y, i3 = t3.x, this.face === Da.TOP)
5381
- a3 = l2 - s3, i3 >= p2 && i3 <= l2 + p2 ? (o3.value = Ua.AREA_0, e3 = i3 - l2) : i3 > l2 + p2 || i3 <= -(l2 + p2) ? (o3.value = Ua.AREA_1, e3 = i3 > 0 ? i3 - g2 : i3 + g2) : i3 > -(l2 + p2) && i3 <= -p2 ? (o3.value = Ua.AREA_2, e3 = i3 + l2) : (o3.value = Ua.AREA_3, e3 = i3);
5393
+ a3 = l2 - s3, i3 >= p2 && i3 <= l2 + p2 ? (o3.value = Ua.AREA_0, e3 = i3 - l2) : i3 > l2 + p2 || i3 <= -(l2 + p2) ? (o3.value = Ua.AREA_1, e3 = i3 > 0 ? i3 - M2 : i3 + M2) : i3 > -(l2 + p2) && i3 <= -p2 ? (o3.value = Ua.AREA_2, e3 = i3 + l2) : (o3.value = Ua.AREA_3, e3 = i3);
5382
5394
  else if (this.face === Da.BOTTOM)
5383
- a3 = l2 + s3, i3 >= p2 && i3 <= l2 + p2 ? (o3.value = Ua.AREA_0, e3 = -i3 + l2) : i3 < p2 && i3 >= -p2 ? (o3.value = Ua.AREA_1, e3 = -i3) : i3 < -p2 && i3 >= -(l2 + p2) ? (o3.value = Ua.AREA_2, e3 = -i3 - l2) : (o3.value = Ua.AREA_3, e3 = i3 > 0 ? -i3 + g2 : -i3 - g2);
5395
+ a3 = l2 + s3, i3 >= p2 && i3 <= l2 + p2 ? (o3.value = Ua.AREA_0, e3 = -i3 + l2) : i3 < p2 && i3 >= -p2 ? (o3.value = Ua.AREA_1, e3 = -i3) : i3 < -p2 && i3 >= -(l2 + p2) ? (o3.value = Ua.AREA_2, e3 = -i3 - l2) : (o3.value = Ua.AREA_3, e3 = i3 > 0 ? -i3 + M2 : -i3 - M2);
5384
5396
  else {
5385
5397
  var c3, u3, d3, m3, _3, f3;
5386
5398
  this.face === Da.RIGHT ? i3 = Ha(i3, +l2) : this.face === Da.BACK ? i3 = Ha(i3, 3.14159265359) : this.face === Da.LEFT && (i3 = Ha(i3, -l2)), m3 = Math.sin(s3), _3 = Math.cos(s3), f3 = Math.sin(i3), c3 = _3 * Math.cos(i3), u3 = _3 * f3, d3 = m3, this.face === Da.FRONT ? e3 = Wa(a3 = Math.acos(c3), d3, u3, o3) : this.face === Da.RIGHT ? e3 = Wa(a3 = Math.acos(u3), d3, -c3, o3) : this.face === Da.BACK ? e3 = Wa(a3 = Math.acos(-c3), d3, -u3, o3) : this.face === Da.LEFT ? e3 = Wa(a3 = Math.acos(-u3), d3, c3, o3) : (a3 = e3 = 0, o3.value = Ua.AREA_0);
5387
5399
  }
5388
- return r3 = Math.atan(12 / g2 * (e3 + Math.acos(Math.sin(e3) * Math.cos(p2)) - l2)), n3 = Math.sqrt((1 - Math.cos(a3)) / (Math.cos(r3) * Math.cos(r3)) / (1 - Math.cos(Math.atan(1 / Math.cos(e3))))), o3.value === Ua.AREA_1 ? r3 += l2 : o3.value === Ua.AREA_2 ? r3 += g2 : o3.value === Ua.AREA_3 && (r3 += 1.5 * g2), h3.x = n3 * Math.cos(r3), h3.y = n3 * Math.sin(r3), h3.x = h3.x * this.a + this.x0, h3.y = h3.y * this.a + this.y0, t3.x = h3.x, t3.y = h3.y, t3;
5400
+ return r3 = Math.atan(12 / M2 * (e3 + Math.acos(Math.sin(e3) * Math.cos(p2)) - l2)), n3 = Math.sqrt((1 - Math.cos(a3)) / (Math.cos(r3) * Math.cos(r3)) / (1 - Math.cos(Math.atan(1 / Math.cos(e3))))), o3.value === Ua.AREA_1 ? r3 += l2 : o3.value === Ua.AREA_2 ? r3 += M2 : o3.value === Ua.AREA_3 && (r3 += 1.5 * M2), h3.x = n3 * Math.cos(r3), h3.y = n3 * Math.sin(r3), h3.x = h3.x * this.a + this.x0, h3.y = h3.y * this.a + this.y0, t3.x = h3.x, t3.y = h3.y, t3;
5389
5401
  }
5390
5402
  function Va(t3) {
5391
5403
  var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, _3 = { lam: 0, phi: 0 }, f3 = { value: 0 };
5392
- if (t3.x = (t3.x - this.x0) / this.a, t3.y = (t3.y - this.y0) / this.a, i3 = Math.atan(Math.sqrt(t3.x * t3.x + t3.y * t3.y)), s3 = Math.atan2(t3.y, t3.x), t3.x >= 0 && t3.x >= Math.abs(t3.y) ? f3.value = Ua.AREA_0 : t3.y >= 0 && t3.y >= Math.abs(t3.x) ? (f3.value = Ua.AREA_1, s3 -= l2) : t3.x < 0 && -t3.x >= Math.abs(t3.y) ? (f3.value = Ua.AREA_2, s3 = s3 < 0 ? s3 + g2 : s3 - g2) : (f3.value = Ua.AREA_3, s3 += l2), c3 = g2 / 12 * Math.tan(s3), n3 = Math.sin(c3) / (Math.cos(c3) - 1 / Math.sqrt(2)), r3 = Math.atan(n3), (h3 = 1 - (e3 = Math.cos(s3)) * e3 * (a3 = Math.tan(i3)) * a3 * (1 - Math.cos(Math.atan(1 / Math.cos(r3))))) < -1 ? h3 = -1 : h3 > 1 && (h3 = 1), this.face === Da.TOP)
5393
- o3 = Math.acos(h3), _3.phi = l2 - o3, f3.value === Ua.AREA_0 ? _3.lam = r3 + l2 : f3.value === Ua.AREA_1 ? _3.lam = r3 < 0 ? r3 + g2 : r3 - g2 : f3.value === Ua.AREA_2 ? _3.lam = r3 - l2 : _3.lam = r3;
5404
+ if (t3.x = (t3.x - this.x0) / this.a, t3.y = (t3.y - this.y0) / this.a, i3 = Math.atan(Math.sqrt(t3.x * t3.x + t3.y * t3.y)), s3 = Math.atan2(t3.y, t3.x), t3.x >= 0 && t3.x >= Math.abs(t3.y) ? f3.value = Ua.AREA_0 : t3.y >= 0 && t3.y >= Math.abs(t3.x) ? (f3.value = Ua.AREA_1, s3 -= l2) : t3.x < 0 && -t3.x >= Math.abs(t3.y) ? (f3.value = Ua.AREA_2, s3 = s3 < 0 ? s3 + M2 : s3 - M2) : (f3.value = Ua.AREA_3, s3 += l2), c3 = M2 / 12 * Math.tan(s3), n3 = Math.sin(c3) / (Math.cos(c3) - 1 / Math.sqrt(2)), r3 = Math.atan(n3), (h3 = 1 - (e3 = Math.cos(s3)) * e3 * (a3 = Math.tan(i3)) * a3 * (1 - Math.cos(Math.atan(1 / Math.cos(r3))))) < -1 ? h3 = -1 : h3 > 1 && (h3 = 1), this.face === Da.TOP)
5405
+ o3 = Math.acos(h3), _3.phi = l2 - o3, f3.value === Ua.AREA_0 ? _3.lam = r3 + l2 : f3.value === Ua.AREA_1 ? _3.lam = r3 < 0 ? r3 + M2 : r3 - M2 : f3.value === Ua.AREA_2 ? _3.lam = r3 - l2 : _3.lam = r3;
5394
5406
  else if (this.face === Da.BOTTOM)
5395
- o3 = Math.acos(h3), _3.phi = o3 - l2, f3.value === Ua.AREA_0 ? _3.lam = -r3 + l2 : f3.value === Ua.AREA_1 ? _3.lam = -r3 : f3.value === Ua.AREA_2 ? _3.lam = -r3 - l2 : _3.lam = r3 < 0 ? -r3 - g2 : -r3 + g2;
5407
+ o3 = Math.acos(h3), _3.phi = o3 - l2, f3.value === Ua.AREA_0 ? _3.lam = -r3 + l2 : f3.value === Ua.AREA_1 ? _3.lam = -r3 : f3.value === Ua.AREA_2 ? _3.lam = -r3 - l2 : _3.lam = r3 < 0 ? -r3 - M2 : -r3 + M2;
5396
5408
  else {
5397
- var y3, p3, M3;
5398
- c3 = (y3 = h3) * y3, p3 = (c3 += (M3 = c3 >= 1 ? 0 : Math.sqrt(1 - c3) * Math.sin(r3)) * M3) >= 1 ? 0 : Math.sqrt(1 - c3), f3.value === Ua.AREA_1 ? (c3 = p3, p3 = -M3, M3 = c3) : f3.value === Ua.AREA_2 ? (p3 = -p3, M3 = -M3) : f3.value === Ua.AREA_3 && (c3 = p3, p3 = M3, M3 = -c3), this.face === Da.RIGHT ? (c3 = y3, y3 = -p3, p3 = c3) : this.face === Da.BACK ? (y3 = -y3, p3 = -p3) : this.face === Da.LEFT && (c3 = y3, y3 = p3, p3 = -c3), _3.phi = Math.acos(-M3) - l2, _3.lam = Math.atan2(p3, y3), this.face === Da.RIGHT ? _3.lam = Ha(_3.lam, -l2) : this.face === Da.BACK ? _3.lam = Ha(_3.lam, -3.14159265359) : this.face === Da.LEFT && (_3.lam = Ha(_3.lam, +l2));
5409
+ var y3, p3, g3;
5410
+ c3 = (y3 = h3) * y3, p3 = (c3 += (g3 = c3 >= 1 ? 0 : Math.sqrt(1 - c3) * Math.sin(r3)) * g3) >= 1 ? 0 : Math.sqrt(1 - c3), f3.value === Ua.AREA_1 ? (c3 = p3, p3 = -g3, g3 = c3) : f3.value === Ua.AREA_2 ? (p3 = -p3, g3 = -g3) : f3.value === Ua.AREA_3 && (c3 = p3, p3 = g3, g3 = -c3), this.face === Da.RIGHT ? (c3 = y3, y3 = -p3, p3 = c3) : this.face === Da.BACK ? (y3 = -y3, p3 = -p3) : this.face === Da.LEFT && (c3 = y3, y3 = p3, p3 = -c3), _3.phi = Math.acos(-g3) - l2, _3.lam = Math.atan2(p3, y3), this.face === Da.RIGHT ? _3.lam = Ha(_3.lam, -l2) : this.face === Da.BACK ? _3.lam = Ha(_3.lam, -3.14159265359) : this.face === Da.LEFT && (_3.lam = Ha(_3.lam, +l2));
5399
5411
  }
5400
5412
  return 0 !== this.es && (u3 = _3.phi < 0 ? 1 : 0, d3 = Math.tan(_3.phi), m3 = this.b / Math.sqrt(d3 * d3 + this.one_minus_f_squared), _3.phi = Math.atan(Math.sqrt(this.a * this.a - m3 * m3) / (this.one_minus_f * m3)), u3 && (_3.phi = -_3.phi)), _3.lam += this.long0, t3.x = _3.lam, t3.y = _3.phi, t3;
5401
5413
  }
5402
5414
  function Wa(t3, s3, i3, e3) {
5403
5415
  var a3;
5404
- return t3 < _2 ? (e3.value = Ua.AREA_0, a3 = 0) : (a3 = Math.atan2(s3, i3), Math.abs(a3) <= p2 ? e3.value = Ua.AREA_0 : a3 > p2 && a3 <= l2 + p2 ? (e3.value = Ua.AREA_1, a3 -= l2) : a3 > l2 + p2 || a3 <= -(l2 + p2) ? (e3.value = Ua.AREA_2, a3 = a3 >= 0 ? a3 - g2 : a3 + g2) : (e3.value = Ua.AREA_3, a3 += l2)), a3;
5416
+ return t3 < _2 ? (e3.value = Ua.AREA_0, a3 = 0) : (a3 = Math.atan2(s3, i3), Math.abs(a3) <= p2 ? e3.value = Ua.AREA_0 : a3 > p2 && a3 <= l2 + p2 ? (e3.value = Ua.AREA_1, a3 -= l2) : a3 > l2 + p2 || a3 <= -(l2 + p2) ? (e3.value = Ua.AREA_2, a3 = a3 >= 0 ? a3 - M2 : a3 + M2) : (e3.value = Ua.AREA_3, a3 += l2)), a3;
5405
5417
  }
5406
5418
  function Ha(t3, s3) {
5407
5419
  var i3 = t3 + s3;
5408
- return i3 < -3.14159265359 ? i3 += M2 : i3 > 3.14159265359 && (i3 -= M2), i3;
5420
+ return i3 < -3.14159265359 ? i3 += g2 : i3 > 3.14159265359 && (i3 -= g2), i3;
5409
5421
  }
5410
- var Za = { init: ja, forward: Fa, inverse: Va, names: ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"] }, Qa = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], Xa = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], Ya = 0.8487, Ka = 1.3523, Ja = y2 / 5, $a = 1 / Ja, tn = 18, sn = function(t3, s3) {
5422
+ var Xa = { init: ja, forward: Fa, inverse: Va, names: ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"] }, Ya = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], Za = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], Qa = 0.8487, Ka = 1.3523, Ja = y2 / 5, $a = 1 / Ja, tn = 18, sn = function(t3, s3) {
5411
5423
  return t3[0] + s3 * (t3[1] + s3 * (t3[2] + s3 * t3[3]));
5412
5424
  }, en = function(t3, s3) {
5413
5425
  return t3[1] + s3 * (2 * t3[2] + 3 * s3 * t3[3]);
@@ -5426,27 +5438,27 @@ Me.exports = function() {
5426
5438
  function rn(t3) {
5427
5439
  var s3 = yt2(t3.x - this.long0), i3 = Math.abs(t3.y), e3 = Math.floor(i3 * Ja);
5428
5440
  e3 < 0 ? e3 = 0 : e3 >= tn && (e3 = tn - 1), i3 = y2 * (i3 - $a * e3);
5429
- var a3 = { x: sn(Qa[e3], i3) * s3, y: sn(Xa[e3], i3) };
5430
- return t3.y < 0 && (a3.y = -a3.y), a3.x = a3.x * this.a * Ya + this.x0, a3.y = a3.y * this.a * Ka + this.y0, a3;
5441
+ var a3 = { x: sn(Ya[e3], i3) * s3, y: sn(Za[e3], i3) };
5442
+ return t3.y < 0 && (a3.y = -a3.y), a3.x = a3.x * this.a * Qa + this.x0, a3.y = a3.y * this.a * Ka + this.y0, a3;
5431
5443
  }
5432
5444
  function hn(t3) {
5433
- var s3 = { x: (t3.x - this.x0) / (this.a * Ya), y: Math.abs(t3.y - this.y0) / (this.a * Ka) };
5445
+ var s3 = { x: (t3.x - this.x0) / (this.a * Qa), y: Math.abs(t3.y - this.y0) / (this.a * Ka) };
5434
5446
  if (s3.y >= 1)
5435
- s3.x /= Qa[tn][0], s3.y = t3.y < 0 ? -l2 : l2;
5447
+ s3.x /= Ya[tn][0], s3.y = t3.y < 0 ? -l2 : l2;
5436
5448
  else {
5437
5449
  var i3 = Math.floor(s3.y * tn);
5438
5450
  for (i3 < 0 ? i3 = 0 : i3 >= tn && (i3 = tn - 1); ; )
5439
- if (Xa[i3][0] > s3.y)
5451
+ if (Za[i3][0] > s3.y)
5440
5452
  --i3;
5441
5453
  else {
5442
- if (!(Xa[i3 + 1][0] <= s3.y))
5454
+ if (!(Za[i3 + 1][0] <= s3.y))
5443
5455
  break;
5444
5456
  ++i3;
5445
5457
  }
5446
- var e3 = Xa[i3], a3 = 5 * (s3.y - e3[0]) / (Xa[i3 + 1][0] - e3[0]);
5458
+ var e3 = Za[i3], a3 = 5 * (s3.y - e3[0]) / (Za[i3 + 1][0] - e3[0]);
5447
5459
  a3 = an(function(t4) {
5448
5460
  return (sn(e3, t4) - s3.y) / en(e3, t4);
5449
- }, a3, _2, 100), s3.x /= sn(Qa[i3], a3), s3.y = (5 * i3 + a3) * f2, t3.y < 0 && (s3.y = -s3.y);
5461
+ }, a3, _2, 100), s3.x /= sn(Ya[i3], a3), s3.y = (5 * i3 + a3) * f2, t3.y < 0 && (s3.y = -s3.y);
5450
5462
  }
5451
5463
  return s3.x = yt2(s3.x + this.long0), s3;
5452
5464
  }
@@ -5534,8 +5546,8 @@ Me.exports = function() {
5534
5546
  }
5535
5547
  return t3.x = a3.x + this.long0, t3.y = a3.y, t3;
5536
5548
  }
5537
- var Mn = { init: fn, forward: yn, inverse: pn, names: ["Tilted_Perspective", "tpers"] };
5538
- function gn() {
5549
+ var gn = { init: fn, forward: yn, inverse: pn, names: ["Tilted_Perspective", "tpers"] };
5550
+ function Mn() {
5539
5551
  if (this.flip_axis = "x" === this.sweep ? 1 : 0, this.h = Number(this.h), this.radius_g_1 = this.h / this.a, this.radius_g_1 <= 0 || this.radius_g_1 > 1e10)
5540
5552
  throw new Error();
5541
5553
  if (this.radius_g = 1 + this.radius_g_1, this.C = this.radius_g * this.radius_g - 1, 0 !== this.es) {
@@ -5572,7 +5584,7 @@ Me.exports = function() {
5572
5584
  }
5573
5585
  return t3.x = t3.x + this.long0, t3;
5574
5586
  }
5575
- var Sn = { init: gn, forward: xn, inverse: wn, names: ["Geostationary Satellite View", "Geostationary_Satellite", "geos"] }, En = 1.340264, bn = -0.081106, Pn = 893e-6, vn = 3796e-6, An = Math.sqrt(3) / 2;
5587
+ var Sn = { init: Mn, forward: xn, inverse: wn, names: ["Geostationary Satellite View", "Geostationary_Satellite", "geos"] }, En = 1.340264, bn = -0.081106, Pn = 893e-6, vn = 3796e-6, An = Math.sqrt(3) / 2;
5576
5588
  function Gn() {
5577
5589
  this.es = 0, this.long0 = void 0 !== this.long0 ? this.long0 : 0;
5578
5590
  }
@@ -5623,23 +5635,23 @@ Me.exports = function() {
5623
5635
  }
5624
5636
  var Bn = { init: Tn, names: ["bonne", "Bonne (Werner lat_1=90)"] };
5625
5637
  function kn(t3) {
5626
- t3.Proj.projections.add(mi2), t3.Proj.projections.add(Pi2), t3.Proj.projections.add(Gi2), t3.Proj.projections.add(Bi2), t3.Proj.projections.add(Fi2), t3.Proj.projections.add(Zi2), t3.Proj.projections.add($i2), t3.Proj.projections.add(ee2), t3.Proj.projections.add(he2), t3.Proj.projections.add(ge2), t3.Proj.projections.add(ze2), t3.Proj.projections.add(Be2), t3.Proj.projections.add(je2), t3.Proj.projections.add(Ze), t3.Proj.projections.add(Ke), t3.Proj.projections.add(ia), t3.Proj.projections.add(ra), t3.Proj.projections.add(la), t3.Proj.projections.add(fa), t3.Proj.projections.add(ga), t3.Proj.projections.add(Ea), t3.Proj.projections.add(Ga), t3.Proj.projections.add(Ra), t3.Proj.projections.add(ka), t3.Proj.projections.add(Za), t3.Proj.projections.add(on), t3.Proj.projections.add(dn), t3.Proj.projections.add(Mn), t3.Proj.projections.add(Sn), t3.Proj.projections.add(In), t3.Proj.projections.add(Bn);
5638
+ t3.Proj.projections.add(mi2), t3.Proj.projections.add(Pi2), t3.Proj.projections.add(Gi2), t3.Proj.projections.add(Bi2), t3.Proj.projections.add(Fi2), t3.Proj.projections.add(Xi2), t3.Proj.projections.add($i2), t3.Proj.projections.add(ee2), t3.Proj.projections.add(he2), t3.Proj.projections.add(Me2), t3.Proj.projections.add(ze2), t3.Proj.projections.add(Be2), t3.Proj.projections.add(je2), t3.Proj.projections.add(Xe2), t3.Proj.projections.add(Ke2), t3.Proj.projections.add(ia), t3.Proj.projections.add(ra), t3.Proj.projections.add(la), t3.Proj.projections.add(fa), t3.Proj.projections.add(Ma), t3.Proj.projections.add(Ea), t3.Proj.projections.add(Ga), t3.Proj.projections.add(Ra), t3.Proj.projections.add(ka), t3.Proj.projections.add(Xa), t3.Proj.projections.add(on), t3.Proj.projections.add(dn), t3.Proj.projections.add(gn), t3.Proj.projections.add(Sn), t3.Proj.projections.add(In), t3.Proj.projections.add(Bn);
5627
5639
  }
5628
- return ws2.defaultDatum = "WGS84", ws2.Proj = ss2, ws2.WGS84 = new ws2.Proj("WGS84"), ws2.Point = Zs2, ws2.toPoint = ms2, ws2.defs = at2, ws2.nadgrid = Ut2, ws2.transform = ps2, ws2.mgrs = Ns2, ws2.version = "2.17.0", kn(ws2), ws2;
5640
+ return ws2.defaultDatum = "WGS84", ws2.Proj = ss2, ws2.WGS84 = new ws2.Proj("WGS84"), ws2.Point = Xs2, ws2.toPoint = ms2, ws2.defs = at2, ws2.nadgrid = Ut2, ws2.transform = ps2, ws2.mgrs = Ns2, ws2.version = "2.17.0", kn(ws2), ws2;
5629
5641
  }();
5630
- var ge = Me.exports;
5642
+ var Me = ge.exports;
5631
5643
  let xe = 1;
5632
5644
  const we = new Array(2);
5633
5645
  class Se extends Ct {
5634
5646
  constructor(t2, s2, i2) {
5635
- super(), t2 || (t2 = "custom_" + xe++), this._name = t2, this._parameters = s2, ge.defs(this._name) || ge.defs(this._name, s2), i2 && i2.isBox3 && (this._geoBoundingBox = i2);
5647
+ super(), t2 || (t2 = "custom_" + xe++), this._name = t2, this._parameters = s2, Me.defs(this._name) || Me.defs(this._name, s2), i2 && i2.isBox3 && (this._geoBoundingBox = i2);
5636
5648
  }
5637
5649
  projectCoordinate(t2, s2, i2) {
5638
5650
  we[0] = t2.x, we[1] = t2.y;
5639
5651
  const e2 = this.geoBoundingBox;
5640
5652
  we[0] < e2.min.x && (we[0] = e2.min.x), we[0] > e2.max.x && (we[0] = e2.max.x), we[1] < e2.min.y && (we[1] = e2.min.y), we[1] > e2.max.y && (we[1] = e2.max.y);
5641
- const a2 = ge("EPSG:4326", this.name, we);
5642
- if (s2 || (s2 = new _()), i2) {
5653
+ const a2 = Me("EPSG:4326", this.name, we);
5654
+ if (s2 || (s2 = new u()), i2) {
5643
5655
  const i3 = this.projectedBoundingBox;
5644
5656
  s2.x = It(t2.x, a2[0], e2.max.x, i3.max.x), s2.y = It(t2.y, a2[1], e2.max.y, i3.max.y);
5645
5657
  } else
@@ -5649,8 +5661,8 @@ class Se extends Ct {
5649
5661
  unprojectCoordinate(t2, s2, i2) {
5650
5662
  const e2 = this.projectedBoundingBox;
5651
5663
  we[0] = t2.x, we[1] = t2.y, we[0] < e2.min.x && (we[0] = e2.min.x), we[0] > e2.max.x && (we[0] = e2.max.x), we[1] < e2.min.y && (we[1] = e2.min.y), we[1] > e2.max.y && (we[1] = e2.max.y);
5652
- const a2 = ge(this.name, "EPSG:4326", we);
5653
- if (s2 || (s2 = new _()), i2) {
5664
+ const a2 = Me(this.name, "EPSG:4326", we);
5665
+ if (s2 || (s2 = new u()), i2) {
5654
5666
  const i3 = this.geoBoundingBox;
5655
5667
  s2.x = Nt(t2.x, a2[0], i3.max.x, e2.max.x), s2.y = Nt(t2.y, a2[1], i3.max.y, e2.max.y);
5656
5668
  } else
@@ -5671,9 +5683,9 @@ for (let t2 = 0; t2 < 11; t2++) {
5671
5683
  be[`EPSG:${4491 + t2}`] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=${e2} +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 3, 3, 0], [i2 + 3, 54, 0]] }, be[`EPSG:${4502 + t2}`] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 3, 3, 0], [i2 + 3, 54, 0]] }, s2 = 25 + 2 * t2, i2 = 3 * s2, e2 = 1e6 * s2 + 5e5, be["EPSG:" + (4513 + 2 * t2)] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=${e2} +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 1.5, 3, 0], [i2 + 1.5, 54, 0]] }, be["EPSG:" + (4534 + 2 * t2)] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 1.5, 3, 0], [i2 + 1.5, 54, 0]] }, s2 = 25 + 2 * t2 + 1, t2 < 10 && (i2 = 3 * s2, e2 = 1e6 * s2 + 5e5, be["EPSG:" + (4513 + 2 * t2 + 1)] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=${e2} +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 1.5, 3, 0], [i2 + 1.5, 54, 0]] }, be["EPSG:" + (4534 + 2 * t2 + 1)] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 1.5, 3, 0], [i2 + 1.5, 54, 0]] });
5672
5684
  }
5673
5685
  const Pe = (t2) => {
5674
- if (t2 = ((t3) => "EPSG:900913" === (t3 = t3.toUpperCase().trim()) ? gt : "GLOBE" === t3 || "ECEF" === t3 ? xt : t3)(t2), !Ee[t2])
5686
+ if (t2 = ((t3) => "EPSG:900913" === (t3 = t3.toUpperCase().trim()) ? Mt : "GLOBE" === t3 || "ECEF" === t3 ? xt : t3)(t2), !Ee[t2])
5675
5687
  switch (t2) {
5676
- case gt:
5688
+ case Mt:
5677
5689
  Ee[t2] = new kt();
5678
5690
  break;
5679
5691
  case xt:
@@ -5682,7 +5694,7 @@ const Pe = (t2) => {
5682
5694
  case wt:
5683
5695
  Ee[t2] = new _e();
5684
5696
  break;
5685
- case Mt:
5697
+ case gt:
5686
5698
  Ee[t2] = new ye();
5687
5699
  break;
5688
5700
  case St:
@@ -5695,7 +5707,7 @@ const Pe = (t2) => {
5695
5707
  let e2 = null;
5696
5708
  if (i2.geoBoundingBox) {
5697
5709
  const t3 = i2.geoBoundingBox;
5698
- e2 = new p(new _(t3[0][0], t3[0][1], t3[0][2] || 0), new _(t3[1][0], t3[1][1], t3[1][2] || 0));
5710
+ e2 = new p(new u(t3[0][0], t3[0][1], t3[0][2] || 0), new u(t3[1][0], t3[1][1], t3[1][2] || 0));
5699
5711
  }
5700
5712
  s2 = new Se(t2, i2.parameters, e2), i2.projectBoundingBoxMethod && (s2.projectBoundingBoxMethod = i2.projectBoundingBoxMethod);
5701
5713
  }
@@ -5705,12 +5717,23 @@ const Pe = (t2) => {
5705
5717
  }
5706
5718
  return Ee[t2];
5707
5719
  };
5708
- class ve {
5720
+ let ve = new c();
5721
+ function Ae(t2, s2, i2 = new c()) {
5722
+ const e2 = t2.lengthSq();
5723
+ if (Math.abs(e2 - 1) > 1e-6)
5724
+ throw new Error("vector must be normalized.");
5725
+ if (i2.x = t2.x / (Math.abs(t2.x) + Math.abs(t2.y) + Math.abs(t2.z)), i2.y = t2.y / (Math.abs(t2.x) + Math.abs(t2.y) + Math.abs(t2.z)), t2.z < 0) {
5726
+ const t3 = i2.x, s3 = i2.y;
5727
+ i2.x = (1 - Math.abs(s3)) * (t3 >= 0 ? 1 : -1), i2.y = (1 - Math.abs(t3)) * (s3 >= 0 ? 1 : -1);
5728
+ }
5729
+ return i2.x = Math.round((0.5 * i2.x + 0.5) * s2), i2.y = Math.round((0.5 * i2.y + 0.5) * s2), i2;
5730
+ }
5731
+ class Ge {
5709
5732
  constructor() {
5710
5733
  this.vertexBuffer = void 0, this.index = void 0, this.first = void 0, this.second = void 0, this.ratio = void 0;
5711
5734
  }
5712
5735
  clone(t2) {
5713
- return ht(t2) || (t2 = new ve()), t2.uBuffer = this.uBuffer, t2.vBuffer = this.vBuffer, t2.heightBuffer = this.heightBuffer, t2.normalBuffer = this.normalBuffer, t2.index = this.index, t2.first = this.first, t2.second = this.second, t2.ratio = this.ratio, t2;
5736
+ return ht(t2) || (t2 = new Ge()), t2.uBuffer = this.uBuffer, t2.vBuffer = this.vBuffer, t2.heightBuffer = this.heightBuffer, t2.normalBuffer = this.normalBuffer, t2.index = this.index, t2.first = this.first, t2.second = this.second, t2.ratio = this.ratio, t2;
5714
5737
  }
5715
5738
  initializeIndexed(t2, s2, i2, e2, a2) {
5716
5739
  this.uBuffer = t2, this.vBuffer = s2, this.heightBuffer = i2, this.normalBuffer = e2, this.index = a2, this.first = void 0, this.second = void 0, this.ratio = void 0;
@@ -5734,9 +5757,24 @@ class ve {
5734
5757
  getKey() {
5735
5758
  return this.isIndexed() ? this.index : JSON.stringify({ first: this.first.getKey(), second: this.second.getKey(), ratio: this.ratio });
5736
5759
  }
5760
+ getNormalX() {
5761
+ return ht(this.index) ? this.normalBuffer[2 * this.index] : (ve = Te(this, ve), ve.x);
5762
+ }
5763
+ getNormalY() {
5764
+ return ht(this.index) ? this.normalBuffer[2 * this.index + 1] : (ve = Te(this, ve), ve.y);
5765
+ }
5737
5766
  }
5738
- const Ae = [];
5739
- Ae.push(new ve()), Ae.push(new ve()), Ae.push(new ve()), Ae.push(new ve()), self.addEventListener("message", (t2) => {
5767
+ let Ce = -1;
5768
+ const Ne = [new u(), new u()], Ie = [new u(), new u()], ze = new u();
5769
+ function Te(t2, s2) {
5770
+ ++Ce;
5771
+ let i2 = Ne[Ce], e2 = Ie[Ce];
5772
+ return i2.copy(Ke(t2.first.getNormalX(), t2.first.getNormalY())), e2.copy(Ke(t2.second.getNormalX(), t2.second.getNormalY())), ze.lerpVectors(i2, e2, t2.ratio), ze.normalize(), function(t3, s3) {
5773
+ Ae(t3, 255, s3);
5774
+ }(ze, s2), --Ce, s2;
5775
+ }
5776
+ const Oe = new c(), Re = [];
5777
+ Re.push(new Ge()), Re.push(new Ge()), Re.push(new Ge()), Re.push(new Ge()), self.addEventListener("message", (t2) => {
5740
5778
  const s2 = t2.data, { type: i2 } = s2;
5741
5779
  "createTerrainMesh" === i2 ? self.createVerticesFromQuantizedTerrainMesh(s2) : "upsampleTerrainData" === i2 ? self.upsampleQuantizedTerrainMesh(s2) : console.log(s2);
5742
5780
  }), self.calculateUvFromPositions = (t2) => {
@@ -5751,110 +5789,150 @@ Ae.push(new ve()), Ae.push(new ve()), Ae.push(new ve()), Ae.push(new ve()), self
5751
5789
  t2[i2] = s2 - e2, 0 === e2 && ++s2;
5752
5790
  }
5753
5791
  };
5754
- const Ge = 32767, Ce = 16383, Ne = [], Ie = [], ze = [], Te = [], Oe = [], Re = [], qe = [], Le = new c(), Be = new _(), ke = new _(), De = new _(), Ue = new _();
5755
- function je(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
5792
+ const qe = 32767, Le = 16383, Be = [], ke = [], De = [], Ue = [], je = [], Fe = [], Ve = [], We = new c(), He = new u(), Xe = new u(), Ye = new u();
5793
+ new u(0, 0, 0);
5794
+ const Ze = new c();
5795
+ self.upsampleQuantizedTerrainMesh = (t2) => {
5796
+ const s2 = t2.isEastChild, i2 = t2.isNorthChild, e2 = t2.hasVertexNormals, a2 = s2 ? Le : 0, n2 = s2 ? qe : Le, r2 = i2 ? Le : 0, h2 = i2 ? qe : Le, c2 = De, l2 = Ue, u2 = je, d2 = Fe, m2 = Ve;
5797
+ c2.length = 0, l2.length = 0, u2.length = 0, d2.length = 0, m2.length = 0;
5798
+ const _2 = {}, f2 = t2.vertices;
5799
+ let y2 = t2.indices;
5800
+ y2 = y2.subarray(0, t2.indexCountWithoutSkirts);
5801
+ let p2 = 0;
5802
+ const g2 = t2.vertexCountWithoutSkirts, M2 = t2.minimumHeight, x2 = t2.maximumHeight, w2 = new Array(g2), S2 = new Array(g2), E2 = new Array(g2), b2 = e2 ? new Array(2 * g2) : void 0;
5803
+ let P2, v2, A2, G2, C2, N2 = 6;
5804
+ for (e2 && (N2 += 3), v2 = 0, A2 = 0; v2 < g2; ++v2, A2 += 2) {
5805
+ const t3 = self.decodeTextureCoordinates(f2, v2, N2, We);
5806
+ if (P2 = self.decodeHeight(f2, v2, N2), G2 = o.clamp(t3.x * qe | 0, 0, qe), C2 = o.clamp(t3.y * qe | 0, 0, qe), E2[v2] = o.clamp((P2 - M2) / (x2 - M2) * qe | 0, 0, qe), G2 < 20 && (G2 = 0), C2 < 20 && (C2 = 0), qe - G2 < 20 && (G2 = qe), qe - C2 < 20 && (C2 = qe), w2[v2] = G2, S2[v2] = C2, e2) {
5807
+ const t4 = self.getOctEncodedNormal(f2, v2, N2, 6, Ze);
5808
+ b2[A2] = t4.x, b2[A2 + 1] = t4.y;
5809
+ }
5810
+ (s2 && G2 >= Le || !s2 && G2 <= Le) && (i2 && C2 >= Le || !i2 && C2 <= Le) && (_2[v2] = p2, c2.push(G2), l2.push(C2), u2.push(E2[v2]), e2 && (d2.push(b2[A2]), d2.push(b2[A2 + 1])), ++p2);
5811
+ }
5812
+ const I2 = [];
5813
+ I2.push(new Ge()), I2.push(new Ge()), I2.push(new Ge());
5814
+ const z2 = [];
5815
+ let T2, O2;
5816
+ for (z2.push(new Ge()), z2.push(new Ge()), z2.push(new Ge()), v2 = 0; v2 < y2.length; v2 += 3) {
5817
+ const t3 = y2[v2], a3 = y2[v2 + 1], n3 = y2[v2 + 2], r3 = w2[t3], h3 = w2[a3], o2 = w2[n3];
5818
+ I2[0].initializeIndexed(w2, S2, E2, b2, t3), I2[1].initializeIndexed(w2, S2, E2, b2, a3), I2[2].initializeIndexed(w2, S2, E2, b2, n3);
5819
+ const f3 = ft.clipTriangleAtAxisAlignedThreshold(Le, s2, r3, h3, o2, Be);
5820
+ T2 = 0, T2 >= f3.length || (T2 = z2[0].initializeFromClipResult(f3, T2, I2), T2 >= f3.length || (T2 = z2[1].initializeFromClipResult(f3, T2, I2), T2 >= f3.length || (T2 = z2[2].initializeFromClipResult(f3, T2, I2), O2 = ft.clipTriangleAtAxisAlignedThreshold(Le, i2, z2[0].getV(), z2[1].getV(), z2[2].getV(), ke), $e(c2, l2, u2, d2, m2, _2, O2, z2, e2), T2 < f3.length && (z2[2].clone(z2[1]), z2[2].initializeFromClipResult(f3, T2, I2), O2 = ft.clipTriangleAtAxisAlignedThreshold(Le, i2, z2[0].getV(), z2[1].getV(), z2[2].getV(), ke), $e(c2, l2, u2, d2, m2, _2, O2, z2, e2)))));
5821
+ }
5822
+ const R2 = s2 ? -32767 : 0, q2 = i2 ? -32767 : 0, L2 = [], B2 = [], k2 = [], D2 = [];
5823
+ let U2 = Number.MAX_VALUE, j2 = -U2;
5824
+ const F2 = it.clone(t2.childRectangle);
5825
+ for (F2.east, F2.west, v2 = 0; v2 < c2.length; v2++)
5826
+ G2 = Math.round(c2[v2]), G2 <= a2 ? (L2.push(v2), G2 = 0) : G2 >= n2 ? (k2.push(v2), G2 = qe) : G2 = 2 * G2 + R2, c2[v2] = G2, C2 = Math.round(l2[v2]), C2 <= r2 ? (B2.push(v2), C2 = 0) : C2 >= h2 ? (D2.push(v2), C2 = qe) : C2 = 2 * C2 + q2, l2[v2] = C2, P2 = o.lerp(M2, x2, u2[v2] / qe), U2 = Math.min(U2, P2), j2 = Math.max(j2, P2), u2[v2] = P2;
5827
+ const V2 = j2 - U2, W2 = new Uint16Array(c2.length + l2.length + u2.length);
5828
+ for (v2 = 0; v2 < c2.length; ++v2)
5829
+ W2[v2] = c2[v2];
5830
+ let H2 = c2.length;
5831
+ for (v2 = 0; v2 < l2.length; ++v2)
5832
+ W2[H2 + v2] = l2[v2];
5833
+ for (H2 += l2.length, v2 = 0; v2 < u2.length; ++v2) {
5834
+ const t3 = qe * (u2[v2] - U2) / V2;
5835
+ W2[H2 + v2] = t3;
5836
+ }
5837
+ const X2 = pt.createTypedArray(c2.length, m2), Y2 = { vertices: W2.buffer, indices: X2.buffer, minimumHeight: U2, maximumHeight: j2, westIndices: L2, southIndices: B2, eastIndices: k2, northIndices: D2 }, Z2 = new Uint8Array(d2), Q2 = [W2.buffer, X2.buffer];
5838
+ e2 && (Y2.encodedNormals = Z2, Q2.push(Z2.buffer));
5839
+ const K2 = t2.type;
5840
+ self.postMessage({ type: "terrainDataUpsampled", tileKey: K2 + "-" + t2.tileKey, content: Y2 }, Q2);
5841
+ }, self.decodeTextureCoordinates = (t2, s2, i2, e2) => (e2 || (e2 = new c()), s2 *= i2, e2.x = t2[s2 + 4], e2.y = t2[s2 + 5], e2), self.decodeHeight = (t2, s2, i2) => t2[(s2 *= i2) + 3], self.createVerticesFromQuantizedTerrainMesh = (t2) => {
5842
+ const s2 = Pe(t2.sourceProjectionName), i2 = Pe(t2.targetProjectionName), e2 = t2.octEncodedNormals, a2 = ht(e2), n2 = t2.tileKey, r2 = t2.tileCenter, h2 = t2.quantizedVertices, l2 = h2.length / 3, d2 = t2.westIndices.length + t2.eastIndices.length + t2.southIndices.length + t2.northIndices.length, m2 = it.clone(t2.rectangle), _2 = m2.west, f2 = m2.south, y2 = m2.east, p2 = m2.north, g2 = t2.minimumHeight, M2 = t2.maximumHeight, x2 = h2.subarray(0, l2), w2 = h2.subarray(l2, 2 * l2), S2 = h2.subarray(2 * l2, 3 * l2), E2 = new Array(l2), b2 = new Array(l2), P2 = new Array(l2), v2 = He;
5843
+ v2.x = Number.POSITIVE_INFINITY, v2.y = Number.POSITIVE_INFINITY, v2.z = Number.POSITIVE_INFINITY;
5844
+ const A2 = Xe;
5845
+ A2.x = Number.NEGATIVE_INFINITY, A2.y = Number.NEGATIVE_INFINITY, A2.z = Number.NEGATIVE_INFINITY;
5846
+ let G2 = Number.POSITIVE_INFINITY, C2 = Number.NEGATIVE_INFINITY, N2 = Number.POSITIVE_INFINITY, I2 = Number.NEGATIVE_INFINITY;
5847
+ for (let t3 = 0; t3 < l2; t3++) {
5848
+ const s3 = x2[t3], e3 = w2[t3], a3 = s3 / qe, n3 = e3 / qe, r3 = o.lerp(g2, M2, S2[t3] / qe);
5849
+ Ye.x = o.lerp(_2, y2, a3), Ye.y = o.lerp(f2, p2, n3), Ye.z = r3, G2 = Math.min(Ye.x, G2), C2 = Math.max(Ye.x, C2), N2 = Math.min(Ye.y, N2), I2 = Math.max(Ye.y, I2), Ye.x = o.radToDeg(Ye.x), Ye.y = o.radToDeg(Ye.y);
5850
+ let h3 = i2.projectCoordinate(Ye, new u());
5851
+ E2[t3] = new c(a3, n3), b2[t3] = r3, P2[t3] = h3;
5852
+ }
5853
+ const z2 = t2.westIndices.slice().sort((t3, s3) => E2[t3].y - E2[s3].y), T2 = t2.eastIndices.slice().sort((t3, s3) => E2[s3].y - E2[t3].y), O2 = t2.southIndices.slice().sort((t3, s3) => E2[s3].x - E2[t3].x), R2 = t2.northIndices.slice().sort((t3, s3) => E2[t3].x - E2[s3].x), q2 = 637e4 / (2 << t2.level) / 2, L2 = Math.max(0, 2 * (d2 - 4)), B2 = t2.indices.length + 3 * L2, k2 = pt.createTypedArray(l2 + L2, B2);
5854
+ k2.set(t2.indices, 0);
5855
+ const D2 = 1e-4, U2 = (C2 - G2) * D2, j2 = (I2 - N2) * D2, F2 = -U2, V2 = U2, W2 = j2, H2 = -j2;
5856
+ let X2 = 6;
5857
+ a2 && (X2 += 3);
5858
+ let Y2 = 0;
5859
+ const Z2 = new Float32Array(l2 * X2 + d2 * X2);
5860
+ for (let t3 = 0, s3 = l2; t3 < s3; t3++) {
5861
+ if (a2) {
5862
+ const s4 = 2 * t3;
5863
+ Oe.x = e2[s4], Oe.y = e2[s4 + 1];
5864
+ }
5865
+ Y2 = self.encode(Z2, Y2, r2, P2[t3], E2[t3], b2[t3], Oe, a2);
5866
+ }
5867
+ let Q2 = t2.indices.length, K2 = P2.length, J2 = self.addSkirt(Z2, K2, k2, r2, Y2, E2, b2, z2, q2, Q2, F2, 0, m2, s2, i2, e2, a2);
5868
+ Q2 = J2.offset, Y2 = J2.bufferIndex, K2 += z2.length, J2 = self.addSkirt(Z2, K2, k2, r2, Y2, E2, b2, O2, q2, Q2, 0, H2, m2, s2, i2, e2, a2), Q2 = J2.offset, Y2 = J2.bufferIndex, K2 += O2.length, J2 = self.addSkirt(Z2, K2, k2, r2, Y2, E2, b2, T2, q2, Q2, V2, 0, m2, s2, i2, e2, a2), Q2 = J2.offset, Y2 = J2.bufferIndex, K2 += T2.length, self.addSkirt(Z2, K2, k2, r2, Y2, E2, b2, R2, q2, Q2, 0, W2, m2, s2, i2, e2, a2);
5869
+ const $2 = { vertices: Z2, bufferIndex: Y2, indexCountWithoutSkirts: t2.indices.length, indices: k2, westIndicesSouthToNorth: z2, southIndicesEastToWest: O2, eastIndicesNorthToSouth: T2, northIndicesWestToEast: R2, minimumHeight: g2, maximumHeight: M2 }, tt2 = [Z2.buffer, k2.buffer], st2 = t2.type;
5870
+ self.postMessage({ type: "terrainMeshCreated", tileKey: st2 + "-" + n2, content: $2 }, tt2);
5871
+ };
5872
+ const Qe = new u();
5873
+ function Ke(t2, s2, i2 = 255) {
5874
+ let e2 = t2 / i2 * 2 - 1, a2 = s2 / i2 * 2 - 1, n2 = 1 - Math.abs(e2) - Math.abs(a2);
5875
+ const r2 = Qe.set(e2, a2, n2);
5876
+ if (n2 < 0) {
5877
+ const t3 = e2, s3 = a2;
5878
+ r2.x = (1 - Math.abs(s3)) * (t3 >= 0 ? 1 : -1), r2.y = (1 - Math.abs(t3)) * (s3 >= 0 ? 1 : -1);
5879
+ }
5880
+ return r2;
5881
+ }
5882
+ self.encode = (t2, s2, i2, e2, a2, n2, r2, h2) => {
5883
+ const o2 = a2.x, c2 = a2.y;
5884
+ if (_t.subtract(e2, i2, ze), t2[s2++] = ze.x, t2[s2++] = ze.y, t2[s2++] = ze.z, t2[s2++] = n2, t2[s2++] = o2, t2[s2++] = c2, h2) {
5885
+ const i3 = Ke(r2.x, r2.y);
5886
+ t2[s2++] = i3.x, t2[s2++] = i3.y, t2[s2++] = i3.z;
5887
+ }
5888
+ return s2;
5889
+ };
5890
+ const Je = new u();
5891
+ function $e(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
5756
5892
  if (0 === r2.length)
5757
5893
  return;
5758
5894
  let c2 = 0, l2 = 0;
5759
5895
  for (; l2 < r2.length; )
5760
- l2 = Ae[c2++].initializeFromClipResult(r2, l2, h2);
5761
- for (let e3 = 0; e3 < c2; ++e3) {
5762
- const a3 = Ae[e3];
5763
- if (a3.isIndexed())
5764
- a3.newIndex = n2[a3.index], a3.uBuffer = t2, a3.vBuffer = s2, a3.heightBuffer = i2;
5896
+ l2 = Re[c2++].initializeFromClipResult(r2, l2, h2);
5897
+ for (let a3 = 0; a3 < c2; ++a3) {
5898
+ const r3 = Re[a3];
5899
+ if (r3.isIndexed())
5900
+ r3.newIndex = n2[r3.index], r3.uBuffer = t2, r3.vBuffer = s2, r3.heightBuffer = i2, o2 && (r3.normalBuffer = e2);
5765
5901
  else {
5766
- const e4 = a3.getKey();
5767
- if (ht(n2[e4]))
5768
- a3.newIndex = n2[e4];
5902
+ const a4 = r3.getKey();
5903
+ if (ht(n2[a4]))
5904
+ r3.newIndex = n2[a4];
5769
5905
  else {
5770
- const r3 = t2.length;
5771
- t2.push(a3.getU()), s2.push(a3.getV()), i2.push(a3.getH()), a3.newIndex = r3, n2[e4] = r3;
5906
+ const h3 = t2.length;
5907
+ t2.push(r3.getU()), s2.push(r3.getV()), i2.push(r3.getH()), o2 && (e2.push(r3.getNormalX()), e2.push(r3.getNormalY())), r3.newIndex = h3, n2[a4] = h3;
5772
5908
  }
5773
5909
  }
5774
5910
  }
5775
- 3 === c2 ? (a2.push(Ae[0].newIndex), a2.push(Ae[1].newIndex), a2.push(Ae[2].newIndex)) : 4 === c2 && (a2.push(Ae[0].newIndex), a2.push(Ae[1].newIndex), a2.push(Ae[2].newIndex), a2.push(Ae[0].newIndex), a2.push(Ae[2].newIndex), a2.push(Ae[3].newIndex));
5911
+ 3 === c2 ? (a2.push(Re[0].newIndex), a2.push(Re[1].newIndex), a2.push(Re[2].newIndex)) : 4 === c2 && (a2.push(Re[0].newIndex), a2.push(Re[1].newIndex), a2.push(Re[2].newIndex), a2.push(Re[0].newIndex), a2.push(Re[2].newIndex), a2.push(Re[3].newIndex));
5776
5912
  }
5777
- new _(0, 0, 0), self.upsampleQuantizedTerrainMesh = (t2) => {
5778
- const s2 = t2.isEastChild, i2 = t2.isNorthChild, e2 = s2 ? Ce : 0, a2 = s2 ? Ge : Ce, n2 = i2 ? Ce : 0, r2 = i2 ? Ge : Ce, h2 = ze, c2 = Te, l2 = Oe, u2 = Re, d2 = qe;
5779
- h2.length = 0, c2.length = 0, l2.length = 0, u2.length = 0, d2.length = 0;
5780
- const m2 = {}, _2 = t2.vertices;
5781
- let f2 = t2.indices;
5782
- f2 = f2.subarray(0, t2.indexCountWithoutSkirts);
5783
- let y2 = 0;
5784
- const p2 = t2.vertexCountWithoutSkirts, M2 = t2.minimumHeight, g2 = t2.maximumHeight, x2 = new Array(p2), w2 = new Array(p2), S2 = new Array(p2), E2 = void 0;
5785
- let b2, P2, v2, A2, G2;
5786
- for (P2 = 0, v2 = 0; P2 < p2; ++P2, v2 += 2) {
5787
- const t3 = self.decodeTextureCoordinates(_2, P2, Le);
5788
- b2 = self.decodeHeight(_2, P2), A2 = o.clamp(t3.x * Ge | 0, 0, Ge), G2 = o.clamp(t3.y * Ge | 0, 0, Ge), S2[P2] = o.clamp((b2 - M2) / (g2 - M2) * Ge | 0, 0, Ge), A2 < 20 && (A2 = 0), G2 < 20 && (G2 = 0), Ge - A2 < 20 && (A2 = Ge), Ge - G2 < 20 && (G2 = Ge), x2[P2] = A2, w2[P2] = G2, (s2 && A2 >= Ce || !s2 && A2 <= Ce) && (i2 && G2 >= Ce || !i2 && G2 <= Ce) && (m2[P2] = y2, h2.push(A2), c2.push(G2), l2.push(S2[P2]), ++y2);
5789
- }
5790
- const C2 = [];
5791
- C2.push(new ve()), C2.push(new ve()), C2.push(new ve());
5792
- const N2 = [];
5793
- let I2, z2;
5794
- for (N2.push(new ve()), N2.push(new ve()), N2.push(new ve()), P2 = 0; P2 < f2.length; P2 += 3) {
5795
- const t3 = f2[P2], e3 = f2[P2 + 1], a3 = f2[P2 + 2], n3 = x2[t3], r3 = x2[e3], o2 = x2[a3];
5796
- C2[0].initializeIndexed(x2, w2, S2, E2, t3), C2[1].initializeIndexed(x2, w2, S2, E2, e3), C2[2].initializeIndexed(x2, w2, S2, E2, a3);
5797
- const _3 = ft.clipTriangleAtAxisAlignedThreshold(Ce, s2, n3, r3, o2, Ne);
5798
- I2 = 0, I2 >= _3.length || (I2 = N2[0].initializeFromClipResult(_3, I2, C2), I2 >= _3.length || (I2 = N2[1].initializeFromClipResult(_3, I2, C2), I2 >= _3.length || (I2 = N2[2].initializeFromClipResult(_3, I2, C2), z2 = ft.clipTriangleAtAxisAlignedThreshold(Ce, i2, N2[0].getV(), N2[1].getV(), N2[2].getV(), Ie), je(h2, c2, l2, u2, d2, m2, z2, N2, false), I2 < _3.length && (N2[2].clone(N2[1]), N2[2].initializeFromClipResult(_3, I2, C2), z2 = ft.clipTriangleAtAxisAlignedThreshold(Ce, i2, N2[0].getV(), N2[1].getV(), N2[2].getV(), Ie), je(h2, c2, l2, u2, d2, m2, z2, N2, false)))));
5799
- }
5800
- const T2 = s2 ? -32767 : 0, O2 = i2 ? -32767 : 0, R2 = [], q2 = [], L2 = [], B2 = [];
5801
- let k2 = Number.MAX_VALUE, D2 = -k2;
5802
- const U2 = it.clone(t2.childRectangle);
5803
- for (U2.east, U2.west, P2 = 0; P2 < h2.length; P2++)
5804
- A2 = Math.round(h2[P2]), A2 <= e2 ? (R2.push(P2), A2 = 0) : A2 >= a2 ? (L2.push(P2), A2 = Ge) : A2 = 2 * A2 + T2, h2[P2] = A2, G2 = Math.round(c2[P2]), G2 <= n2 ? (q2.push(P2), G2 = 0) : G2 >= r2 ? (B2.push(P2), G2 = Ge) : G2 = 2 * G2 + O2, c2[P2] = G2, b2 = o.lerp(M2, g2, l2[P2] / Ge), k2 = Math.min(k2, b2), D2 = Math.max(D2, b2), l2[P2] = b2;
5805
- const j2 = D2 - k2, F2 = new Uint16Array(h2.length + c2.length + l2.length);
5806
- for (P2 = 0; P2 < h2.length; ++P2)
5807
- F2[P2] = h2[P2];
5808
- let V2 = h2.length;
5809
- for (P2 = 0; P2 < c2.length; ++P2)
5810
- F2[V2 + P2] = c2[P2];
5811
- for (V2 += c2.length, P2 = 0; P2 < l2.length; ++P2) {
5812
- const t3 = Ge * (l2[P2] - k2) / j2;
5813
- F2[V2 + P2] = t3;
5814
- }
5815
- const W2 = pt.createTypedArray(h2.length, d2), H2 = { vertices: F2.buffer, indices: W2.buffer, minimumHeight: k2, maximumHeight: D2, westIndices: R2, southIndices: q2, eastIndices: L2, northIndices: B2 }, Z2 = [F2.buffer, W2.buffer], Q2 = t2.type;
5816
- self.postMessage({ type: "terrainDataUpsampled", tileKey: Q2 + "-" + t2.tileKey, content: H2 }, Z2);
5817
- }, self.decodeTextureCoordinates = (t2, s2, i2) => (i2 || (i2 = new c()), s2 *= 6, i2.x = t2[s2 + 4], i2.y = t2[s2 + 5], i2), self.decodeHeight = (t2, s2) => t2[(s2 *= 6) + 3], self.createVerticesFromQuantizedTerrainMesh = (t2) => {
5818
- const s2 = Pe(t2.sourceProjectionName), i2 = Pe(t2.targetProjectionName), e2 = t2.tileKey, a2 = t2.tileCenter, n2 = t2.quantizedVertices, r2 = n2.length / 3, h2 = t2.westIndices.length + t2.eastIndices.length + t2.southIndices.length + t2.northIndices.length, l2 = it.clone(t2.rectangle), u2 = l2.west, d2 = l2.south, m2 = l2.east, f2 = l2.north, y2 = t2.minimumHeight, p2 = t2.maximumHeight, M2 = n2.subarray(0, r2), g2 = n2.subarray(r2, 2 * r2), x2 = n2.subarray(2 * r2, 3 * r2), w2 = new Array(r2), S2 = new Array(r2), E2 = new Array(r2), b2 = Be;
5819
- b2.x = Number.POSITIVE_INFINITY, b2.y = Number.POSITIVE_INFINITY, b2.z = Number.POSITIVE_INFINITY;
5820
- const P2 = ke;
5821
- P2.x = Number.NEGATIVE_INFINITY, P2.y = Number.NEGATIVE_INFINITY, P2.z = Number.NEGATIVE_INFINITY;
5822
- let v2 = Number.POSITIVE_INFINITY, A2 = Number.NEGATIVE_INFINITY, G2 = Number.POSITIVE_INFINITY, C2 = Number.NEGATIVE_INFINITY;
5823
- for (let t3 = 0; t3 < r2; t3++) {
5824
- const s3 = M2[t3], e3 = g2[t3], a3 = s3 / Ge, n3 = e3 / Ge, r3 = o.lerp(y2, p2, x2[t3] / Ge);
5825
- De.x = o.lerp(u2, m2, a3), De.y = o.lerp(d2, f2, n3), De.z = r3, v2 = Math.min(De.x, v2), A2 = Math.max(De.x, A2), G2 = Math.min(De.y, G2), C2 = Math.max(De.y, C2), De.x = o.radToDeg(De.x), De.y = o.radToDeg(De.y);
5826
- let h3 = i2.projectCoordinate(De, new _());
5827
- w2[t3] = new c(a3, n3), S2[t3] = r3, E2[t3] = h3;
5828
- }
5829
- const N2 = t2.westIndices.slice().sort((t3, s3) => w2[t3].y - w2[s3].y), I2 = t2.eastIndices.slice().sort((t3, s3) => w2[s3].y - w2[t3].y), z2 = t2.southIndices.slice().sort((t3, s3) => w2[s3].x - w2[t3].x), T2 = t2.northIndices.slice().sort((t3, s3) => w2[t3].x - w2[s3].x), O2 = 637e4 / (2 << t2.level) / 2, R2 = Math.max(0, 2 * (h2 - 4)), q2 = t2.indices.length + 3 * R2, L2 = pt.createTypedArray(r2 + R2, q2);
5830
- L2.set(t2.indices, 0);
5831
- const B2 = 1e-4, k2 = (A2 - v2) * B2, D2 = (C2 - G2) * B2, U2 = -k2, j2 = k2, F2 = D2, V2 = -D2;
5832
- let W2 = 0;
5833
- const H2 = new Float32Array(6 * r2 + 6 * h2);
5834
- for (let t3 = 0, s3 = r2; t3 < s3; t3++)
5835
- W2 = self.encode(H2, W2, a2, E2[t3], w2[t3], S2[t3]);
5836
- let Z2 = t2.indices.length, Q2 = E2.length, X2 = self.addSkirt(H2, Q2, L2, a2, W2, w2, S2, N2, O2, Z2, U2, 0, l2, s2, i2);
5837
- Z2 = X2.offset, W2 = X2.bufferIndex, Q2 += N2.length, X2 = self.addSkirt(H2, Q2, L2, a2, W2, w2, S2, z2, O2, Z2, 0, V2, l2, s2, i2), Z2 = X2.offset, W2 = X2.bufferIndex, Q2 += z2.length, X2 = self.addSkirt(H2, Q2, L2, a2, W2, w2, S2, I2, O2, Z2, j2, 0, l2, s2, i2), Z2 = X2.offset, W2 = X2.bufferIndex, Q2 += I2.length, self.addSkirt(H2, Q2, L2, a2, W2, w2, S2, T2, O2, Z2, 0, F2, l2, s2, i2);
5838
- const Y2 = { vertices: H2, bufferIndex: W2, indexCountWithoutSkirts: t2.indices.length, indices: L2, westIndicesSouthToNorth: N2, southIndicesEastToWest: z2, eastIndicesNorthToSouth: I2, northIndicesWestToEast: T2, minimumHeight: y2, maximumHeight: p2 }, K2 = [H2.buffer, L2.buffer], J2 = t2.type;
5839
- self.postMessage({ type: "terrainMeshCreated", tileKey: J2 + "-" + e2, content: Y2 }, K2);
5840
- }, self.encode = (t2, s2, i2, e2, a2, n2) => {
5841
- const r2 = a2.x, h2 = a2.y;
5842
- return _t.subtract(e2, i2, Ue), t2[s2++] = Ue.x, t2[s2++] = Ue.y, t2[s2++] = Ue.z, t2[s2++] = n2, t2[s2++] = r2, t2[s2++] = h2, s2;
5843
- }, self.addSkirt = (t2, s2, i2, e2, a2, n2, r2, h2, c2, l2, u2, d2, m2, _2, f2) => {
5844
- const y2 = m2.north, p2 = m2.south;
5845
- let M2 = m2.east;
5846
- const g2 = m2.west;
5847
- M2 < g2 && (M2 += st.TWO_PI);
5848
- const x2 = h2.length;
5849
- let w2 = h2[0];
5850
- for (let m3 = 0; m3 < x2; m3++) {
5851
- const _3 = h2[m3], x3 = r2[_3], S2 = n2[_3];
5852
- De.x = o.radToDeg(o.lerp(g2, M2, S2.x) + u2), De.y = o.radToDeg(o.lerp(p2, y2, S2.y) + d2), De.z = x3 - 2 * c2;
5853
- const E2 = f2.projectCoordinate(De, Ue);
5854
- if (a2 = self.encode(t2, a2, e2, E2, S2, De.z), 0 === m3)
5913
+ self.getOctEncodedNormal = (t2, s2, i2, e2, a2) => {
5914
+ ht(a2) || (a2 = new c());
5915
+ const n2 = s2 * i2 + e2, r2 = t2[n2], h2 = t2[n2 + 1], o2 = t2[n2 + 2];
5916
+ return Ae(Je.set(r2, h2, o2).normalize(), 255, a2);
5917
+ }, self.addSkirt = (t2, s2, i2, e2, a2, n2, r2, h2, c2, l2, u2, d2, m2, _2, f2, y2, p2) => {
5918
+ const g2 = m2.north, M2 = m2.south;
5919
+ let x2 = m2.east;
5920
+ const w2 = m2.west;
5921
+ x2 < w2 && (x2 += st.TWO_PI);
5922
+ const S2 = h2.length;
5923
+ let E2 = h2[0];
5924
+ for (let m3 = 0; m3 < S2; m3++) {
5925
+ const _3 = h2[m3], S3 = r2[_3], b2 = n2[_3];
5926
+ if (p2) {
5927
+ const t3 = 2 * _3;
5928
+ Oe.x = y2[t3], Oe.y = y2[t3 + 1];
5929
+ }
5930
+ Ye.x = o.radToDeg(o.lerp(w2, x2, b2.x) + u2), Ye.y = o.radToDeg(o.lerp(M2, g2, b2.y) + d2), Ye.z = S3 - 2 * c2;
5931
+ const P2 = f2.projectCoordinate(Ye, ze);
5932
+ if (a2 = self.encode(t2, a2, e2, P2, b2, Ye.z, Oe, p2), 0 === m3)
5855
5933
  continue;
5856
- const b2 = w2, P2 = s2 + m3 - 1, v2 = _3, A2 = s2 + m3;
5857
- i2[l2++] = b2, i2[l2++] = v2, i2[l2++] = P2, i2[l2++] = P2, i2[l2++] = v2, i2[l2++] = A2, w2 = _3;
5934
+ const v2 = E2, A2 = s2 + m3 - 1, G2 = _3, C2 = s2 + m3;
5935
+ i2[l2++] = v2, i2[l2++] = G2, i2[l2++] = A2, i2[l2++] = A2, i2[l2++] = G2, i2[l2++] = C2, E2 = _3;
5858
5936
  }
5859
5937
  return { offset: l2, bufferIndex: a2 };
5860
5938
  };