@arcgis/core 5.0.0-next.49 → 5.0.0-next.50
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.
- package/applications/Components/baUtils.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0000781c850b1b4828b3.js +1 -0
- package/assets/esri/core/workers/chunks/00f044370bf3bb6b24d7.js +1 -0
- package/assets/esri/core/workers/chunks/0136cd1a5da204b6daeb.js +1 -0
- package/assets/esri/core/workers/chunks/044a0ccd89741c1ae770.js +1 -0
- package/assets/esri/core/workers/chunks/090dad5579f0148d6486.js +1 -0
- package/assets/esri/core/workers/chunks/09bd9bd37a339802907a.js +1 -0
- package/assets/esri/core/workers/chunks/0bc01d71ed1ab8c3af3c.js +1 -0
- package/assets/esri/core/workers/chunks/0d9904ba62558686c289.js +1 -0
- package/assets/esri/core/workers/chunks/0fcb40204db8ee5571c3.js +1 -0
- package/assets/esri/core/workers/chunks/1065fd655bb7cee243fd.js +1 -0
- package/assets/esri/core/workers/chunks/11ab10668632648b2ba7.js +1 -0
- package/assets/esri/core/workers/chunks/13167bdd486b41163147.js +1 -0
- package/assets/esri/core/workers/chunks/{d8db2c51b2fb42f37b2a.js → 1363345f31f4f5051132.js} +1 -1
- package/assets/esri/core/workers/chunks/13be94357dcf5afc4fcb.js +1 -0
- package/assets/esri/core/workers/chunks/{e66bcdfd75e0113d1cec.js → 13ce8e8d45779b11ee12.js} +1 -1
- package/assets/esri/core/workers/chunks/1693f19f1c37e0a2087e.js +1 -0
- package/assets/esri/core/workers/chunks/18ab5959ebf8689f8fe8.js +1 -0
- package/assets/esri/core/workers/chunks/18c4cd160a4052b05831.js +1 -0
- package/assets/esri/core/workers/chunks/1bf4b5e5402790ccb450.js +1 -0
- package/assets/esri/core/workers/chunks/1db058f91a8e17b24db6.js +1 -0
- package/assets/esri/core/workers/chunks/1dc3ab52fcde7bff0f23.js +1 -0
- package/assets/esri/core/workers/chunks/{a7cd795042ebb8585906.js → 1f0c7ab33e466a37c7f9.js} +1 -1
- package/assets/esri/core/workers/chunks/224f01b11fdba9250b1e.js +1 -0
- package/assets/esri/core/workers/chunks/{a1a7b0e7ca488c895cb7.js → 22c115ec003351c7d8ee.js} +1 -1
- package/assets/esri/core/workers/chunks/24c35a46cf8ed11b774d.js +1 -0
- package/assets/esri/core/workers/chunks/27794d48c04a5875fd22.js +1 -0
- package/assets/esri/core/workers/chunks/294acaaebfedb05fe81e.js +1 -0
- package/assets/esri/core/workers/chunks/2a66841243975cac3e3c.js +1 -0
- package/assets/esri/core/workers/chunks/2c12848e4934e9bb2bd0.js +1 -0
- package/assets/esri/core/workers/chunks/2d61b6efa17e8c5832da.js +1 -0
- package/assets/esri/core/workers/chunks/2d6fa00273a73d44297d.js +1 -0
- package/assets/esri/core/workers/chunks/2da13c2269ab90281143.js +1 -0
- package/assets/esri/core/workers/chunks/2dfaead2ec6434513d45.js +1 -0
- package/assets/esri/core/workers/chunks/2fae37f34b28a46841e3.js +1 -0
- package/assets/esri/core/workers/chunks/{3298e96d3f2e49e338d2.js → 308fb48d080e01499a26.js} +1 -1
- package/assets/esri/core/workers/chunks/30dd4a7c93b33988a270.js +1 -0
- package/assets/esri/core/workers/chunks/355c8d0eadfff9f62dfb.js +1 -0
- package/assets/esri/core/workers/chunks/35961e71f69ae1d24b9e.js +1 -0
- package/assets/esri/core/workers/chunks/36a04be40369111a633d.js +1 -0
- package/assets/esri/core/workers/chunks/36d9208895abd1ba4ff1.js +1 -0
- package/assets/esri/core/workers/chunks/395a0773ccafd1f24c4d.js +1 -0
- package/assets/esri/core/workers/chunks/{81a60dfa600b690098f9.js → 3a612f873e29348370b2.js} +1 -1
- package/assets/esri/core/workers/chunks/3b1471f908fdecec2815.js +1 -0
- package/assets/esri/core/workers/chunks/{da1e61f355fb943085dc.js → 3c66dd52ad156711a6a2.js} +1 -1
- package/assets/esri/core/workers/chunks/3dd0db77a05263000bd8.js +1 -0
- package/assets/esri/core/workers/chunks/{08c1ea29678da27136f3.js → 44fb1184eeed0636704a.js} +1 -1
- package/assets/esri/core/workers/chunks/46d430a6983b81ba7556.js +1 -0
- package/assets/esri/core/workers/chunks/472d290f8eb1c1a85724.js +1 -0
- package/assets/esri/core/workers/chunks/47338472f5a8e004a671.js +1 -0
- package/assets/esri/core/workers/chunks/48b3906ac3ec57253d90.js +1 -0
- package/assets/esri/core/workers/chunks/{2a41283bba2361afa1fd.js → 495af366ec1defd89a72.js} +1 -1
- package/assets/esri/core/workers/chunks/49b581782f63abb6dd9f.js +1 -0
- package/assets/esri/core/workers/chunks/49df576f0215618aa651.js +1 -0
- package/assets/esri/core/workers/chunks/4abe2c56aecc9e9b8e86.js +1 -0
- package/assets/esri/core/workers/chunks/4e01e509a761a9d00b52.js +1 -0
- package/assets/esri/core/workers/chunks/{9d0f0d055ec25af037e0.js → 51093e552e31344cefa5.js} +1 -1
- package/assets/esri/core/workers/chunks/521aac8a665e98e4ca78.js +1 -0
- package/assets/esri/core/workers/chunks/54666586754949bfa584.js +1 -0
- package/assets/esri/core/workers/chunks/549f4ab9e285deaf04fb.js +1 -0
- package/assets/esri/core/workers/chunks/553ca1e55e9f1359839c.js +1 -0
- package/assets/esri/core/workers/chunks/{6f3943bebe2d5f4994f7.js → 58242447b72cc60a5040.js} +1 -1
- package/assets/esri/core/workers/chunks/58419d362f24b35003c1.js +1 -0
- package/assets/esri/core/workers/chunks/5aa354854219361f722b.js +1 -0
- package/assets/esri/core/workers/chunks/{aab93e885b6c7c6aa76e.js → 5ce524e0060053f35592.js} +19 -19
- package/assets/esri/core/workers/chunks/5d244fcf5c075afccdc6.js +1 -0
- package/assets/esri/core/workers/chunks/5e9fdd4eff7189f45932.js +1 -0
- package/assets/esri/core/workers/chunks/60954ab810dbbf36e5e1.js +1 -0
- package/assets/esri/core/workers/chunks/62ed6b45482e39d67785.js +1 -0
- package/assets/esri/core/workers/chunks/63b8193ad90b2ebe6884.js +1 -0
- package/assets/esri/core/workers/chunks/63c91421a71ae3b3599e.js +1 -0
- package/assets/esri/core/workers/chunks/63cf702cde83692126be.js +1 -0
- package/assets/esri/core/workers/chunks/687d2b761dc5b5cf0c31.js +1 -0
- package/assets/esri/core/workers/chunks/6cfcfebe9a4c491e453a.js +1 -0
- package/assets/esri/core/workers/chunks/{88aa71f02f43bb069345.js → 7033fa18b7dd7bd3e49c.js} +1 -1
- package/assets/esri/core/workers/chunks/710b29729f252f11115d.js +1 -0
- package/assets/esri/core/workers/chunks/72a520802b8accfd4512.js +1 -0
- package/assets/esri/core/workers/chunks/{72fbee59d5d909615408.js → 73892ac79b24b05e6863.js} +1 -1
- package/assets/esri/core/workers/chunks/73c3ee2697265b0f7208.js +1 -0
- package/assets/esri/core/workers/chunks/73f9cbf0f919b6adc2d5.js +1 -0
- package/assets/esri/core/workers/chunks/75e9759290f0f67b2128.js +1 -0
- package/assets/esri/core/workers/chunks/7737e69da604d2521da8.js +1 -0
- package/assets/esri/core/workers/chunks/{8e8d5422f57269d8c8d2.js → 7891825d5cdca03d2db0.js} +1 -1
- package/assets/esri/core/workers/chunks/7cd0ab01933bfb2c6e43.js +1 -0
- package/assets/esri/core/workers/chunks/81c2cc77c275a5b555c0.js +1 -0
- package/assets/esri/core/workers/chunks/82ace0195b63790b22c9.js +1 -0
- package/assets/esri/core/workers/chunks/8892bf3d2367e35de001.js +1 -0
- package/assets/esri/core/workers/chunks/8a132d91077ecf849248.js +1 -0
- package/assets/esri/core/workers/chunks/8a6e50d95539b46f629c.js +1 -0
- package/assets/esri/core/workers/chunks/8d941204425571b656ec.js +1 -0
- package/assets/esri/core/workers/chunks/914746077017fa50933f.js +1 -0
- package/assets/esri/core/workers/chunks/{004c2a1a37b99a184b13.js → 91fba3bebd78cb956941.js} +1 -1
- package/assets/esri/core/workers/chunks/92ec96aa743cabc9475d.js +1 -0
- package/assets/esri/core/workers/chunks/{5b290d18de61789417f9.js → 9361834d2c3064eb41fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{44f036cc21e3a2308f69.js → 93b139be6488a1b4ba19.js} +1 -1
- package/assets/esri/core/workers/chunks/95057105f1b3bf805140.js +1 -0
- package/assets/esri/core/workers/chunks/968335b28b895e19913b.js +1 -0
- package/assets/esri/core/workers/chunks/973bf2ed34d57f299472.js +1 -0
- package/assets/esri/core/workers/chunks/9b6e2099aabf67b9f9f2.js +1 -0
- package/assets/esri/core/workers/chunks/{97b01803d0c38541aa08.js → 9c93eadbd19bef1191b4.js} +1 -1
- package/assets/esri/core/workers/chunks/a1594486177015e8a6c3.js +1 -0
- package/assets/esri/core/workers/chunks/{df458ad51be27df3d79d.js → a1f264abbd6354c333bf.js} +1 -1
- package/assets/esri/core/workers/chunks/a3407ca77b0ff62c0e75.js +1 -0
- package/assets/esri/core/workers/chunks/{8be61e13530fd0dc2fd1.js → a4f89568205d78d91cfe.js} +1 -1
- package/assets/esri/core/workers/chunks/a5e7c9517939f762c518.js +1 -0
- package/assets/esri/core/workers/chunks/a63ff3e9a9f3853d12f3.js +1 -0
- package/assets/esri/core/workers/chunks/a81a7cba815adb575c36.js +1 -0
- package/assets/esri/core/workers/chunks/{fe6fa1f2c2d54d41645e.js → a8dfd246c797f3b979f5.js} +1 -1
- package/assets/esri/core/workers/chunks/a8f7e44657083f6aa3fd.js +1 -0
- package/assets/esri/core/workers/chunks/a8fd635d1165db8616ab.js +1 -0
- package/assets/esri/core/workers/chunks/a92c1171314a68504c1b.js +1 -0
- package/assets/esri/core/workers/chunks/aa297e0931213341f51b.js +1 -0
- package/assets/esri/core/workers/chunks/aa7a1705266eec353cb6.js +1 -0
- package/assets/esri/core/workers/chunks/ab5e2f823960c33cefe4.js +1 -0
- package/assets/esri/core/workers/chunks/{f11453f24c0b728669d2.js → ac6f002cfad42e60de8f.js} +1 -1
- package/assets/esri/core/workers/chunks/b11c0e80e583f2b7c5de.js +1 -0
- package/assets/esri/core/workers/chunks/b14f9a46e583e1625a2b.js +1 -0
- package/assets/esri/core/workers/chunks/{8c271e9272e4eaf1325a.js → b1d3d2c93c189e215f67.js} +1 -1
- package/assets/esri/core/workers/chunks/b2425f6af7df6902dfc4.js +1 -0
- package/assets/esri/core/workers/chunks/b638ce18b93d3cfb9967.js +1 -0
- package/assets/esri/core/workers/chunks/b648a1e641cf5c772d67.js +1 -0
- package/assets/esri/core/workers/chunks/{1c58064ea80e6a4a4a3b.js → b907d16e82ac908bb896.js} +1 -1
- package/assets/esri/core/workers/chunks/b91c13f44f4d1bac5799.js +1 -0
- package/assets/esri/core/workers/chunks/ba7e97b1e324118b8156.js +1 -0
- package/assets/esri/core/workers/chunks/bb4aefaf9b0327dda738.js +1 -0
- package/assets/esri/core/workers/chunks/{9664d9e679abc41f6c42.js → bce81df760f5e34c01d7.js} +1 -1
- package/assets/esri/core/workers/chunks/be6a05d5375e80968877.js +1 -0
- package/assets/esri/core/workers/chunks/c02b09f16241db233103.js +1 -0
- package/assets/esri/core/workers/chunks/c09cba77ee60a3d765e2.js +1 -0
- package/assets/esri/core/workers/chunks/c0d6336c10b4081c4e32.js +1 -0
- package/assets/esri/core/workers/chunks/c27842a34e73ccb46116.js +1 -0
- package/assets/esri/core/workers/chunks/c7802c144959d60e774a.js +1 -0
- package/assets/esri/core/workers/chunks/c91201b37d1cb3875fb4.js +1 -0
- package/assets/esri/core/workers/chunks/cc4ae105e727d9211d82.js +1 -0
- package/assets/esri/core/workers/chunks/cd39a53ef74f47604977.js +1 -0
- package/assets/esri/core/workers/chunks/d22e0d733bfe821c0510.js +1 -0
- package/assets/esri/core/workers/chunks/{d7878fba02814adaf19f.js → d57577c02fb2932e8305.js} +1 -1
- package/assets/esri/core/workers/chunks/d62193323c67b379dee3.js +1 -0
- package/assets/esri/core/workers/chunks/d7a62504e00989202c45.js +1 -0
- package/assets/esri/core/workers/chunks/{adfe28c1c1619cdd3ca1.js → d8511e71c5108a0ba9eb.js} +2 -2
- package/assets/esri/core/workers/chunks/da922e861d5845ae0979.js +1 -0
- package/assets/esri/core/workers/chunks/dbe55d4731227d6e9571.js +1 -0
- package/assets/esri/core/workers/chunks/de05c59da6d67716795d.js +1 -0
- package/assets/esri/core/workers/chunks/de60421029fbcebe2950.js +1 -0
- package/assets/esri/core/workers/chunks/e00d56ae5e68267fe269.js +1 -0
- package/assets/esri/core/workers/chunks/{fecae7495e53bb05f282.js → e25be3b6b67ce6b03011.js} +1 -1
- package/assets/esri/core/workers/chunks/e2973e5626e5039209f9.js +1 -0
- package/assets/esri/core/workers/chunks/e2c7c269be93c552dc5b.js +1 -0
- package/assets/esri/core/workers/chunks/e4d593ddcbcf06010ab0.js +1 -0
- package/assets/esri/core/workers/chunks/e5ac9b048b16fef9840c.js +1 -0
- package/assets/esri/core/workers/chunks/{f7163048146ddaedfc36.js → e668ddc7332e5e560e78.js} +1 -1
- package/assets/esri/core/workers/chunks/e6bab7b739bfbb39f6cd.js +1 -0
- package/assets/esri/core/workers/chunks/{8b578ffc3a83089aa782.js → e7c08a03772f7fccd949.js} +1 -1
- package/assets/esri/core/workers/chunks/e8e4d48ab4024e17108d.js +1 -0
- package/assets/esri/core/workers/chunks/e9e0f1c355f963cbea74.js +1 -0
- package/assets/esri/core/workers/chunks/ec7e6427d99cf3148a61.js +1 -0
- package/assets/esri/core/workers/chunks/edd3cf415955309b4ca4.js +1 -0
- package/assets/esri/core/workers/chunks/ee361690b456c12c30d8.js +1 -0
- package/assets/esri/core/workers/chunks/efa95c50d1ed8e74219f.js +1 -0
- package/assets/esri/core/workers/chunks/f142c5cbdd16f1768275.js +1 -0
- package/assets/esri/core/workers/chunks/f286f13686f003c5eec5.js +1 -0
- package/assets/esri/core/workers/chunks/f379fd459a103f42d447.js +1 -0
- package/assets/esri/core/workers/chunks/{f2ba50eb29f93df885d6.js → f3d8d5fe15501220792d.js} +1 -1
- package/assets/esri/core/workers/chunks/f56906c443ce8ff68a27.js +1 -0
- package/assets/esri/core/workers/chunks/fb6670a929b7333f1764.js +1 -0
- package/assets/esri/core/workers/chunks/fbdf553253cf8f22c022.js +1 -0
- package/assets/esri/core/workers/chunks/fc10c738bae304721ab2.js +1 -0
- package/assets/esri/core/workers/chunks/ff79c2cb28db7e0a1fc4.js +1 -0
- package/assets/esri/core/workers/chunks/ffdf1cbc1e54414d0f96.js +1 -0
- package/assets/esri/themes/base/widgets/_Attribution.scss +7 -4
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Bufferer-Dw9Qi4T1.js +1 -1
- package/chunks/Distance2DCalculator-CXhBP-8I.js +1 -1
- package/chunks/Envelope.js +1 -1
- package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProject.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
- package/chunks/SpatialReference.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/pe.js +1 -1
- package/chunks/relateOperator.js +1 -1
- package/config.js +1 -1
- package/core/units.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
- package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
- package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/GeometryCursor.js +1 -1
- package/geometry/operators/containsOperator.js +1 -1
- package/geometry/operators/disjointOperator.js +1 -1
- package/geometry/operators/gx/geodeticUtils.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
- package/geometry/operators/gx/operatorGeodeticArea.js +1 -1
- package/geometry/operators/gx/operatorGeodeticDensify.js +1 -1
- package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
- package/geometry/operators/gx/operatorGeodeticLength.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorProject.js +1 -1
- package/geometry/operators/gx/operatorProximityGeodesic.js +1 -1
- package/geometry/operators/gx/operatorShapePreservingProject.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/json/projectOperator.js +1 -1
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/geographicTransformationUtils.js +1 -1
- package/geometry/operators/support/initNoPeFactory.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/support/projectionTransformation.js +1 -1
- package/geometry/operators/support/projectionZScaling.js +5 -0
- package/geometry/projection/projectPointToVector.js +1 -1
- package/geometry/projectionUtils.js +1 -1
- package/geometry/support/boundedPlane.js +1 -1
- package/geometry/support/jsonTypeUtils.js +5 -0
- package/geometry/support/jsonUtils.js +1 -1
- package/geometry/support/normalizeUtilsCommon.js +1 -1
- package/geometry/support/normalizeUtilsSync.js +1 -1
- package/geometry/support/quantizationUtils.js +1 -1
- package/geometry/support/zscale.js +1 -1
- package/interfaces.d.ts +84 -17
- package/kernel.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/data/spatialQuerySupport.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/graphics/sources/support/uploadAssets.js +1 -1
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/ControlPointsGeoreference.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/package.json +4 -4
- package/renderers/support/DictionaryLoader.js +1 -1
- package/renderers/support/pointCloud/PointSizeFixedSizeAlgorithm.js +1 -1
- package/renderers/support/pointCloud/PointSizeSplatAlgorithm.js +1 -1
- package/rest/geometryService/cut.js +1 -1
- package/rest/geometryService/difference.js +1 -1
- package/rest/geometryService/intersect.js +1 -1
- package/rest/geometryService/project.js +1 -1
- package/rest/geometryService/reshape.js +1 -1
- package/rest/geometryService/simplify.js +1 -1
- package/rest/geometryService/utils.js +1 -1
- package/rest/knowledgeGraph/DataModel.js +1 -1
- package/rest/operations/generalize.js +1 -1
- package/rest/operations/identify.js +1 -1
- package/rest/operations/offset.js +1 -1
- package/rest/operations/relation.js +1 -1
- package/rest/query/operations/queryAttributeBins.js +1 -1
- package/rest/query/operations/queryTopFeatures.js +1 -1
- package/rest/query/operations/queryUtils.js +1 -1
- package/rest/support/BaseImageMeasureResultValue.js +1 -1
- package/rest/support/BufferParameters.js +1 -1
- package/rest/support/DensifyParameters.js +1 -1
- package/rest/support/DistanceParameters.js +1 -1
- package/rest/support/FeatureSet.js +1 -1
- package/rest/support/IdentifyParameters.js +1 -1
- package/rest/support/ImageAreaParameters.js +1 -1
- package/rest/support/ImageDistanceParameters.js +1 -1
- package/rest/support/ImageGPSInfoParameters.js +1 -1
- package/rest/support/ImageHeightParameters.js +1 -1
- package/rest/support/ImageHistogramParameters.js +1 -1
- package/rest/support/ImageIdentifyParameters.js +1 -1
- package/rest/support/ImageMeasureResultAngleValue.js +1 -1
- package/rest/support/ImageMeasureResultAreaValue.js +1 -1
- package/rest/support/ImageMeasureResultLengthValue.js +1 -1
- package/rest/support/ImagePointParameters.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/rest/support/ImageToMapMultirayParameters.js +1 -1
- package/rest/support/ImageToMapParameters.js +1 -1
- package/rest/support/ImageVolumeParameters.js +1 -1
- package/rest/support/MapToImageParameters.js +1 -1
- package/rest/support/MeasureFromImageParameters.js +1 -1
- package/rest/support/ProjectParameters.js +1 -1
- package/support/modeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/support/tests/serviceMockDependencies.js +1 -1
- package/symbols/MarkerSymbol.js +1 -1
- package/symbols/PictureMarkerSymbol.js +1 -1
- package/symbols/SimpleFillSymbol.js +1 -1
- package/symbols/SimpleMarkerSymbol.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/SDFHelper.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/ShadowCast/analysisViewRegister.js +5 -0
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceController.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/analysis/support/projectionUtils.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/state/ScreenSizePerspective.js +1 -1
- package/views/3d/support/ViewSlice.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/Attribution.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
- package/views/layers/CatalogFootprintLayerView.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/support/attributionUtils.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
- package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +5 -0
- package/widgets/OrientedImageryViewer/support/NonPanoramicMediaCollection.js +5 -0
- package/widgets/OrientedImageryViewer/support/urlUtils.js +5 -0
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Swipe/SwipeViewModel.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/assets/esri/core/workers/chunks/00ff4ca88c9d291d82c3.js +0 -1
- package/assets/esri/core/workers/chunks/0271a2ca4e9b1e4fd284.js +0 -1
- package/assets/esri/core/workers/chunks/02a65563779b4c64b2cf.js +0 -1
- package/assets/esri/core/workers/chunks/02d1c48e874dfd985bc4.js +0 -1
- package/assets/esri/core/workers/chunks/05b7720ab6bf0874f27c.js +0 -1
- package/assets/esri/core/workers/chunks/061def9163a09c804b5c.js +0 -1
- package/assets/esri/core/workers/chunks/06221ebadab32111e2c6.js +0 -1
- package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +0 -1
- package/assets/esri/core/workers/chunks/06d52a570d5d44f8c86e.js +0 -1
- package/assets/esri/core/workers/chunks/0a58b57e1777a8b0ea23.js +0 -1
- package/assets/esri/core/workers/chunks/0e4d0213d568f50c231f.js +0 -1
- package/assets/esri/core/workers/chunks/103153951ba312dc5e9e.js +0 -1
- package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +0 -1
- package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +0 -1
- package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +0 -1
- package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +0 -1
- package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +0 -1
- package/assets/esri/core/workers/chunks/20e4243ea563d05a5256.js +0 -1
- package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +0 -1
- package/assets/esri/core/workers/chunks/21f37a4b8d1857369203.js +0 -1
- package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +0 -1
- package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +0 -1
- package/assets/esri/core/workers/chunks/231c0b583fa97f2ca675.js +0 -1
- package/assets/esri/core/workers/chunks/233f9eb617f3d72995b5.js +0 -1
- package/assets/esri/core/workers/chunks/2463cebf904a3c46c639.js +0 -1
- package/assets/esri/core/workers/chunks/249504f7d356be80d214.js +0 -1
- package/assets/esri/core/workers/chunks/2550d2ba935cfdf30236.js +0 -1
- package/assets/esri/core/workers/chunks/273ac1066095d63d6a6f.js +0 -1
- package/assets/esri/core/workers/chunks/28db329528def851efd7.js +0 -1
- package/assets/esri/core/workers/chunks/2de32649f8b0c6404d7c.js +0 -1
- package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +0 -1
- package/assets/esri/core/workers/chunks/30c4af16e3a2acc25589.js +0 -1
- package/assets/esri/core/workers/chunks/32d32d3c3b38a215d20d.js +0 -1
- package/assets/esri/core/workers/chunks/3386d4392f465b807b94.js +0 -1
- package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +0 -1
- package/assets/esri/core/workers/chunks/35f086a2ae0585348ae6.js +0 -1
- package/assets/esri/core/workers/chunks/37ea150dec5e491f691e.js +0 -1
- package/assets/esri/core/workers/chunks/3ac8de121a07c70bae0f.js +0 -1
- package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +0 -1
- package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +0 -1
- package/assets/esri/core/workers/chunks/40a722933af28823953b.js +0 -1
- package/assets/esri/core/workers/chunks/444026d1938c1078ca97.js +0 -1
- package/assets/esri/core/workers/chunks/44f759d723ae05bb1b19.js +0 -1
- package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +0 -1
- package/assets/esri/core/workers/chunks/48e2737182c75005fb8f.js +0 -1
- package/assets/esri/core/workers/chunks/48f805929fe6241952f5.js +0 -1
- package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +0 -1
- package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +0 -1
- package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +0 -1
- package/assets/esri/core/workers/chunks/4d933de84afb2e3b7d18.js +0 -1
- package/assets/esri/core/workers/chunks/4f0de45a0a295d66d446.js +0 -1
- package/assets/esri/core/workers/chunks/4ff771942531fb2755c4.js +0 -1
- package/assets/esri/core/workers/chunks/513a4ef960e27500f986.js +0 -1
- package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +0 -1
- package/assets/esri/core/workers/chunks/57fd5e1260269002d18a.js +0 -1
- package/assets/esri/core/workers/chunks/5b73c77587772120b209.js +0 -1
- package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +0 -1
- package/assets/esri/core/workers/chunks/61373d2fa7e7638d3395.js +0 -1
- package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +0 -1
- package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +0 -1
- package/assets/esri/core/workers/chunks/6d0fe4db6b94f3d2c53a.js +0 -1
- package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +0 -1
- package/assets/esri/core/workers/chunks/6e8925412fb90f88d688.js +0 -1
- package/assets/esri/core/workers/chunks/6e8c20ff1d28ef2fe72c.js +0 -1
- package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +0 -1
- package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +0 -1
- package/assets/esri/core/workers/chunks/755ce019c97f5d527772.js +0 -1
- package/assets/esri/core/workers/chunks/780f60210878a8286633.js +0 -1
- package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +0 -1
- package/assets/esri/core/workers/chunks/7d3c2a063598bdd015e2.js +0 -1
- package/assets/esri/core/workers/chunks/7eab0bb42f9f062522ef.js +0 -1
- package/assets/esri/core/workers/chunks/804958f3f4ff47a4eff5.js +0 -1
- package/assets/esri/core/workers/chunks/82ba4140e30f083fbc87.js +0 -1
- package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +0 -1
- package/assets/esri/core/workers/chunks/83c8e5a92d8d6193cb32.js +0 -1
- package/assets/esri/core/workers/chunks/83da9ee6544ee9d3c124.js +0 -1
- package/assets/esri/core/workers/chunks/870022661376442411e4.js +0 -1
- package/assets/esri/core/workers/chunks/897ce6fc9cefb1e14a64.js +0 -1
- package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +0 -1
- package/assets/esri/core/workers/chunks/8b75861196d1ce5cba63.js +0 -1
- package/assets/esri/core/workers/chunks/8c07396e9ea3007d6404.js +0 -1
- package/assets/esri/core/workers/chunks/8e26831f71634288f834.js +0 -1
- package/assets/esri/core/workers/chunks/8ec238b5b59ef18a1713.js +0 -1
- package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +0 -1
- package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +0 -1
- package/assets/esri/core/workers/chunks/9100330ed4b4437c819d.js +0 -1
- package/assets/esri/core/workers/chunks/933dce4d4ff8b90219c8.js +0 -1
- package/assets/esri/core/workers/chunks/934bc1028b287f8df4aa.js +0 -1
- package/assets/esri/core/workers/chunks/94dc8b0fa129f1e168c4.js +0 -1
- package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +0 -1
- package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +0 -1
- package/assets/esri/core/workers/chunks/987e19af8a525e77883f.js +0 -1
- package/assets/esri/core/workers/chunks/992e9bbdf9d3787ddb0e.js +0 -1
- package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +0 -1
- package/assets/esri/core/workers/chunks/9c0efd06c9000ccbd62d.js +0 -1
- package/assets/esri/core/workers/chunks/9f1d3c0b53bef07e39bf.js +0 -1
- package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +0 -1
- package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +0 -1
- package/assets/esri/core/workers/chunks/a59dab47a58695c639da.js +0 -1
- package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +0 -1
- package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +0 -1
- package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +0 -1
- package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +0 -1
- package/assets/esri/core/workers/chunks/a96742e678a506c461ab.js +0 -1
- package/assets/esri/core/workers/chunks/af663e81c851bcf142f1.js +0 -1
- package/assets/esri/core/workers/chunks/af8d6e6949930d0e6c7b.js +0 -1
- package/assets/esri/core/workers/chunks/b59be95949445ff5afab.js +0 -1
- package/assets/esri/core/workers/chunks/b6dec5dfdeca54bae88d.js +0 -1
- package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +0 -1
- package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +0 -1
- package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +0 -1
- package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +0 -1
- package/assets/esri/core/workers/chunks/bff814d34b38ec80c44d.js +0 -1
- package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +0 -1
- package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +0 -1
- package/assets/esri/core/workers/chunks/c5e8ff4721b15ac3c6eb.js +0 -1
- package/assets/esri/core/workers/chunks/ca61077e0a598654f33f.js +0 -1
- package/assets/esri/core/workers/chunks/ca81be5bdb88ef557bf3.js +0 -1
- package/assets/esri/core/workers/chunks/ced12ad98f8f48d0dc00.js +0 -1
- package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +0 -1
- package/assets/esri/core/workers/chunks/d561624ddb9388732b25.js +0 -1
- package/assets/esri/core/workers/chunks/d5fd6d0eaf96edfab123.js +0 -1
- package/assets/esri/core/workers/chunks/d705410c369bd03b1875.js +0 -1
- package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +0 -1
- package/assets/esri/core/workers/chunks/dc29cb16704e2e4d0a46.js +0 -1
- package/assets/esri/core/workers/chunks/dc5075b2326c79130baa.js +0 -1
- package/assets/esri/core/workers/chunks/dd105d6e0fcedee32644.js +0 -1
- package/assets/esri/core/workers/chunks/defc6b50df5018bd9e86.js +0 -1
- package/assets/esri/core/workers/chunks/e1148067ceae7d9eaaf8.js +0 -1
- package/assets/esri/core/workers/chunks/e5a6a646f27715152714.js +0 -1
- package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +0 -1
- package/assets/esri/core/workers/chunks/efc293c8bbc12156096d.js +0 -1
- package/assets/esri/core/workers/chunks/f693a4d97b2762d0e6ff.js +0 -1
- package/assets/esri/core/workers/chunks/f7f53567b0c5b35d6aea.js +0 -1
- package/assets/esri/core/workers/chunks/f92a78ce5510e0d0d0f7.js +0 -1
- package/assets/esri/core/workers/chunks/fb76b43181077c55a207.js +0 -1
- package/assets/esri/core/workers/chunks/fc61443546f21869f8ba.js +0 -1
- package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +0 -1
- package/chunks/UnitFactory.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as t}from"./SimpleGeometryCursor.js";import{a as e,c as s,o as i,p as n,g as o,G as r,f as h,h as m,t as a}from"./Geometry.js";import{E as c,P as l}from"./Envelope.js";import{Envelope2D as u}from"./Envelope2D.js";import{P as f,S as g,L as _}from"./MultiPathImpl.js";import{p as d,P as p,d as P}from"./Point2D.js";import{T}from"./Transformation2D.js";import{O as b,B as D,A as S,z as I,a3 as x,aD as F,D as C,H as N,G as y,K as w,J as E,ab as G,aE as v,aa as z}from"./UnitFactory.js";import{c as k}from"./OperatorClip.js";function q(t){const e=t.getInputSR(),s=t.getOutputSR();let i=!1;do{if(e.equals(s)){i=!1;break}if(!O(e)||!O(s)){i=!1;break}if(2===e.getCoordinateSystemType()){i=!0;break}if(2===s.getCoordinateSystemType()){i=!0;break}const n=t.getGeographicTransformations();if(null!==n&&n.count()>0){i=!0;break}}while(0);return i}class L{constructor(t,e,s,i){this.m_horizon2Env=new u,this.m_horizon2=t,this.m_sr=e,this.m_bInclusive2=s,this.m_pannableExtent=i.clone(),this.m_segIter=null,this.m_qtIter=null,null!==t?(t.queryEnvelope(this.m_horizon2Env),this.m_gcs360=i.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,this.m_pannableFactor=1,this.m_horizon2Env.width()-this.m_gcs360>0&&(this.m_pannableFactor+=Math.ceil((this.m_horizon2Env.width()-this.m_gcs360)/this.m_gcs360)),this.m_period=this.m_gcs360):(this.m_horizon2Env.setEmpty(),this.m_gcs360=Number.NaN,this.m_gcs180=Number.NaN,this.m_gcs90=Number.NaN,this.m_pannableFactor=Number.NaN,this.m_period=Number.NaN),this.m_gcsTolerance=null!=e?e.getTolerance(0):Number.NaN}isPointStartInHorizon(t,e){if(!this.m_horizon2)return!0;let s=nt(new l(t),this.m_horizon2,!0,this.m_period);do{const e=t.clone();if(e.x-=s*this.m_period,this.m_horizon2.getGeometryType()===r.enumPolygon){let t;if(t=this.m_horizon2Env.contains(e)?N(this.m_horizon2,e,0):0,this.m_bInclusive2){if(0===t)return!1}else if(1===t)return!1}else{const t=this.m_horizon2Env.contains(e);if(this.m_bInclusive2){if(!t)return!1}else if(t)return!1}}while(this.m_horizon2Env.xmin+ ++s*this.m_period<t.x);return!0}isAdjoiningLineInHorizon(t,e,s){if(!this.m_horizon2)return!0;const i=new p,n=new p;rt(t,e,this.m_gcs90,this.m_gcs180,this.m_gcs360,i,n);const h=Math.max(i.x,n.x),m=new _;m.setStart2D(i),m.setEnd2D(n);let a=nt(m,this.m_horizon2,!0,this.m_period);const c=!1;do{const t=i.clone(),e=n.clone();if(t.x-=a*this.m_period,e.x-=a*this.m_period,this.m_horizon2.getGeometryType()===r.enumPolygon){const s=new _;s.setStartXY(t),s.setEndXY(e);const i=new u,n=new u;if(s.queryEnvelope(i),n.setCoords({env2D:i}),n.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),this.m_horizon2Env.isIntersecting(n)){const t=this.m_horizon2.getImpl(),e=t.getAccelerators();if(null!==e){null!==e.getRasterizedGeometry()&&o(0)}{let i=null;if(null!==e&&(i=e.getQuadTree()),null!==i){this.m_qtIter||(this.m_qtIter=i.getIteratorForQT()),this.m_qtIter.resetIterator(s,this.m_gcsTolerance),this.m_segIter||(this.m_segIter=t.querySegmentIterator());for(let t=this.m_qtIter.next();-1!==t;t=this.m_qtIter.next()){const e=i.getElement(t);this.m_segIter.resetToVertex(e,-1);if(this.m_segIter.nextSegment().isIntersecting(s,this.m_gcsTolerance))return!1}}else for(this.m_segIter||(this.m_segIter=t.querySegmentIterator()),this.m_segIter.resetToFirstPath();this.m_segIter.nextPath();)for(;this.m_segIter.hasNextSegment();){const t=this.m_segIter.nextSegment(),e=new u;if(t.queryEnvelope(e),e.isIntersecting(n)&&t.isIntersecting(s,this.m_gcsTolerance))return!1}}}}else if(this.m_bInclusive2){const s=this.m_horizon2Env.contains(t),i=this.m_horizon2Env.contains(e);if(s&&i)return!0}else{const s=this.m_horizon2Env.clone();s.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);if(!(0===s.clipLine(t,e)))return!1}}while(this.m_horizon2Env.xmin+ ++a*this.m_period<h);return!this.m_bInclusive2||c}isEnvelopeInHorizon(t,e){if(!this.m_horizon2)return!0;const s=new c({env2D:t});let i=nt(s,this.m_horizon2,!0,this.m_period);do{const n=t.clone();n.move(-i*this.m_period,0),s.setCoords(n.xmin,n.ymin,n.xmax,n.ymax);if(!st(s,this.m_horizon2,this.m_sr,this.m_bInclusive2,e))return!1}while(this.m_horizon2Env.xmin+ ++i*this.m_period<t.xmax);return!0}}class R{constructor(t,e,s){this.m_splitLines2=null,this.m_scalars=[],this.m_splitIter=null,this.m_splitLines2=t,this.m_transform1=e,this.m_pannableExtent=s.clone(),this.m_gcs360=s.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,null!==e?(this.m_gcsTolerance=this.m_transform1.getOutputSR().getTolerance(0),this.m_halfGcsTolerance=.5*this.m_gcsTolerance,this.m_gcsToleranceSq=this.m_gcsTolerance*this.m_gcsTolerance):(this.m_gcsTolerance=Number.NaN,this.m_halfGcsTolerance=Number.NaN,this.m_gcsToleranceSq=Number.NaN)}hasSplitLines(){return null!=this.m_splitLines2}getSplitLineFactorEx(t,e,s,i,n,o){const r=new p,h=new p;rt(i,n,this.m_gcs90,this.m_gcs180,this.m_gcs360,r,h);const m=new _;for(m.setStartXY(r),m.setEndXY(h),this.m_splitIter?this.m_splitIter.resetToFirstPath():this.m_splitIter=this.m_splitLines2.getImpl().querySegmentIterator();this.m_splitIter.nextPath();)for(;this.m_splitIter.hasNextSegment();){const i=this.m_splitIter.nextSegment(),n=.5*(i.getStartX()+i.getEndX());Z(this.m_gcs180,this.m_gcs360,n,m);const r=new u;m.queryEnvelope(r),r.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);const h=new u;if(i.queryEnvelope(h),!r.isIntersecting(h))continue;this.m_scalars.length<2&&(this.m_scalars.length=2);if(1===m.intersect(i,null,this.m_scalars,null,this.m_gcsTolerance)&&(this.m_scalars[0]>0&&this.m_scalars[0]<1)){const n=ct(e,s,this.m_scalars[0]),r=Q(t.getCoord2D(n),this.m_transform1);if(i.isIntersectingPoint(r,this.m_halfGcsTolerance))return n;return this.getSplitLineFactor(t,e,s,i,o)}}return-1}getSplitLineFactor(t,e,s,i,n){let o=e,r=s;const h=.5*(i.getStartX()+i.getEndX()),m=new _,a=t.getCoord2D(o),c=t.getCoord2D(r),l=Q(a,this.m_transform1),u=Q(c,this.m_transform1);for(;o<r;){const e=new p,s=new p;rt(l,u,this.m_gcs90,this.m_gcs180,this.m_gcs360,e,s),m.setStartXY(e),m.setEndXY(s),Z(this.m_gcs180,this.m_gcs360,h,m);const n=p.sqrDistance(m.getStartXY(),m.getEndXY());if(n<=this.m_gcsToleranceSq)break;if(Number.isNaN(n))return Number.NaN;let f=ct(o,r,this.m_scalars[0]);if(o<f&&f<r||(f=.5*(r+o)),o===f||f===r)return f;const g=t.getCoord2D(f),_=Q(g,this.m_transform1),d=new p;rt(l,_,this.m_gcs90,this.m_gcs180,this.m_gcs360,e,d),m.setStartXY(e),m.setEndXY(d),Z(this.m_gcs180,this.m_gcs360,h,m);let P=m.intersect(i,null,this.m_scalars,null,this.m_halfGcsTolerance);if(0!==P){if(1===this.m_scalars[0])return f;r=f,c.setCoordsPoint2D(g),u.setCoordsPoint2D(_)}else{if(rt(_,u,this.m_gcs90,this.m_gcs180,this.m_gcs360,d,s),m.setStartXY(d),m.setEndXY(s),Z(this.m_gcs180,this.m_gcs360,h,m),P=m.intersect(i,null,this.m_scalars,null,this.m_halfGcsTolerance),0===P)return f;if(0===this.m_scalars[0])return f;o=f,a.setCoordsPoint2D(g),l.setCoordsPoint2D(_)}}return.5*(r+o)}}class M{constructor(){this.m_bPrepared=!1,this.m_bNeedsShapePreservingProject=!1,this.m_inputTransform=null,this.m_transform1=null,this.m_transform2=null,this.m_extentFrom=null,this.m_horizon1=null,this.m_horizon2=null,this.m_pannableExtentFrom=new u,this.m_pannableExtentTo=new u,this.m_pannableExtentGcsTo=new u,this.m_bClipTopBottomFrom=!1,this.m_bNeedsGeoTransform=!1,this.m_bIsPannableFrom=!1,this.m_bIsPannableTo=!1,this.m_bInclusive1=!1,this.m_bInclusive2=!1,this.m_bSrFromIsPcs=!1,this.m_bSrToIsPcs=!1,this.m_fromTolerance=Number.NaN,this.m_toTolerance=Number.NaN,this.m_gcsToTolerance=Number.NaN,this.m_aFrom=Number.NaN,this.m_mpuFrom=Number.NaN,this.m_rpuFrom=Number.NaN,this.m_rpuGcsTo=Number.NaN,this.m_aTo=Number.NaN,this.m_mpuTo=Number.NaN,this.m_stages=0}prepare(t,s,i){this.m_bPrepared&&n(""),t||e("");const r=t.getInputSR(),h=t.getOutputSR();O(r)&&O(h)||e("shape preserving project requires PCS or GCS");const m=r.getCoordinateSystemType(),a=h.getCoordinateSystemType();this.m_bSrFromIsPcs=2===m,this.m_bSrToIsPcs=2===a;let c=null,l=null,u=null,f=null;this.m_bSrFromIsPcs?(c=r,u=r.getGCS(),this.m_aFrom=at(u),this.m_mpuFrom=mt(c),this.m_rpuFrom=Number.NaN):(u=r,this.m_rpuFrom=ht(u),this.m_aFrom=Number.NaN),this.m_bSrToIsPcs?(l=h,f=h.getGCS(),this.m_aTo=at(f),this.m_mpuTo=mt(l)):(f=h,this.m_aTo=Number.NaN,this.m_mpuTo=Number.NaN),this.m_rpuGcsTo=ht(f);const g=t.getGeographicTransformations();this.m_bNeedsGeoTransform=null!==g&&g.count()>0;const _=r.equals(h);if(this.m_bNeedsShapePreservingProject=!_&&(this.m_bSrFromIsPcs||this.m_bSrToIsPcs||this.m_bNeedsGeoTransform),!this.m_bNeedsShapePreservingProject)return this.m_inputTransform=t,this.m_extentFrom=s?s.clone():null,void(this.m_bPrepared=!0);if(this.m_bIsPannableFrom=r.isPannable(),this.m_bIsPannableTo=h.isPannable(),this.m_bIsPannableFrom&&(this.m_pannableExtentFrom=r.getPannableExtent()),this.m_bIsPannableTo&&(this.m_pannableExtentTo=h.getPannableExtent()),this.m_bSrToIsPcs){this.m_pannableExtentGcsTo=f.getPannableExtent();const t=l.getCentralMeridian(),e=this.m_pannableExtentGcsTo.getCenter();e.x=t,this.m_pannableExtentGcsTo.centerAt(e)}else this.m_pannableExtentGcsTo=this.m_pannableExtentTo.clone();this.m_fromTolerance=r.getTolerance(0),this.m_toTolerance=h.getTolerance(0),this.m_gcsToTolerance=f.getTolerance(0);{const e=t.getExtendedParams(),n=e.clipWithInputHorizon,o=e.clipWithOutputHorizon;n&&this.setHorizon1(t,s,i),o&&this.setHorizon2(t,i),this.checkAndSetStages(t,i)}const d=D();d.setFlag(1073741824,!0),d.setFlag(536870912,!0);const p=S();if(p.clipWithInputHorizon=!1,p.clipWithOutputHorizon=!1,1===this.m_stages)this.m_transform1=I(!1,r,h,g,p,d);else if(2===this.m_stages){d.setFlag(2147483648,!0),this.m_transform1=I(!1,r,f,g,p,d);const t=D();this.m_transform2=I(!1,f,h,null,p,t)}else{o(null!=l),p.centralMeridianOfOutputGCS=l.getCentralMeridian(),this.m_transform1=I(!1,r,f,g,p,d);const t=D();t.setFlag(2147483648,!0),this.m_transform2=I(!1,f,h,null,p,t)}this.m_inputTransform=t,this.m_extentFrom=s?s.clone():null,this.m_bPrepared=!0}execute(t,e,s,i){this.m_bPrepared||n(""),o(!t.hasAttribute(10));return this.execute_(t,e,s,i)}checkIfNeedsReset(t,e){return o(0),!1}setHorizon1(t,e,s){const i=t.getInputSR();let n,o=null;const r=new u;if(this.m_bSrFromIsPcs){n=!0,o=i.getPCSHorizon(),o.queryEnvelope(r),this.m_bIsPannableFrom&&(o=new c({xmin:this.m_pannableExtentFrom.xmin,ymin:r.ymin,xmax:this.m_pannableExtentFrom.xmax,ymax:r.ymax}));let t=!1;null!=e&&(t=et(e,o,i,n,this.m_bIsPannableFrom,this.m_pannableExtentFrom,s)),t||(this.m_horizon1=o,this.m_bInclusive1=n)}else this.m_bClipTopBottomFrom=!0,this.m_bInclusive1=!0}setHorizon2(t,e){const s=t.getOutputSR();if(1===s.getCoordinateSystemType())return this.m_horizon2=null,void(this.m_bInclusive2=!1);let i=null;const n=new u,o=s.getGCSHorisonIsInclusive();i=s.getGCSHorizon(),i.queryEnvelope(n);const r=s.getCentralMeridian();if(this.m_bIsPannableTo){const t=new c({xmin:this.m_pannableExtentGcsTo.xmin,ymin:n.ymin,xmax:this.m_pannableExtentGcsTo.xmax,ymax:n.ymax});t.centerAt(r,0),i=t}this.m_horizon2=i,this.m_bInclusive2=o}checkAndSetStages(t,e){const s=t.getOutputSR().getGCSSplitLines();if(!this.m_horizon2&&!s)return void(this.m_stages=1);if(this.m_horizon2.getGeometryType()===r.enumEnvelope){const t=new u;this.m_horizon2.queryEnvelope(t);const e=t.width(),s=t.height();e>=d/this.m_rpuGcsTo&&s>=Math.PI/this.m_rpuGcsTo&&(this.m_horizon2=null)}if(this.m_horizon2||s){if(null!==this.m_horizon2&&!this.m_bNeedsGeoTransform&&!this.m_bSrFromIsPcs){const e=t.getOutputSR().getGCS();return t.getInputSR().equals(e)?(this.m_horizon1=this.m_horizon2,this.m_bInclusive1=this.m_bInclusive2,this.m_bClipTopBottomFrom=!1,this.m_horizon2=null,this.m_bInclusive2=!1,void(this.m_stages=1)):void(this.m_stages=2)}this.m_stages=3}else this.m_stages=1}execute_(t,e,n,o){if(!this.m_bNeedsShapePreservingProject)return(new b).execute(t,this.m_inputTransform,o);if(!t)return null;s(t),i(t);let a,c=t.getGeometryType();return h(c)?(a=W(t),c=r.enumPolyline):a=t,a.isEmpty()?a:m(c)?this.executeEx(t,e,n,o):(new b).execute(t,this.m_inputTransform,o)}executeEx(t,e,s,i){let n;t.hasNonLinearSegments()&&a(""),n=this.m_bIsPannableFrom?(new b).foldInto360Range(t,this.m_transform1.getInputSR()):t;let o,r=s;return r>0||(r=100*this.m_toTolerance),o=1===this.m_stages?this.executeGood(n,e,r,i):2===this.m_stages?this.executeBad(n,e,r,i):this.executeUgly(n,e,r,i),this.filterOverDensification(o,this.m_inputTransform.getOutputSR(),r,i)}executeGood(t,e,s,i){const n=s*s;let o,r;return o=e>0?this.getMinLengthInSrFrom(e):this.getMinLengthInSrFrom(1e-5),r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):$(t,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,Number.NaN,i),r=F(r,this.m_transform1.getOutputSR(),i),r=j(r,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,o,n,i),r=(new b).execute(r,this.m_transform1,i),r}executeBad(t,e,s,i){let n;n=e>0?e*(Math.PI/180/this.m_rpuGcsTo):Math.PI/180/this.m_rpuGcsTo*1e-5;const o=s*s;let r;return r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):t,r=(new b).execute(r,this.m_transform1,i),r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!0,Number.NaN,i),r=F(r,this.m_transform2.getOutputSR(),i),r=j(r,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,n,o,i),r=(new b).execute(r,this.m_transform2,i),r}executeUgly(t,e,s,i){const n=s*s;let o;o=e>0?this.getMinLengthInSrFrom(e):this.getMinLengthInSrFrom(1e-5);let r=null;r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):$(t,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,Number.NaN,i);let h=r;const m=new L(this.m_horizon2,this.m_transform2.getInputSR(),this.m_bInclusive2,this.m_pannableExtentGcsTo),a=this.m_transform2.getOutputSR().getGCSSplitLines(),c=new R(a,this.m_transform1,this.m_pannableExtentGcsTo);if(r=j(r,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,this.m_transform2,m,this.m_pannableExtentGcsTo,c,o,n,i),null!==r){h=null,r=(new b).execute(r,this.m_transform1,i);const t=Math.PI/180/this.m_rpuGcsTo*2;return r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,t,i),r=(new b).execute(r,this.m_transform2,i),r}let l=Number.NaN;l=s>0?s:100*this.m_toTolerance,l/=this.m_rpuGcsTo*this.m_aTo/this.m_mpuTo;const u=l*l;let f;return r=j(h,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,this.m_pannableExtentGcsTo,null,null,null,null,o,u,i),h=null,r=(new b).execute(r,this.m_transform1,i),f=e>0?e*(Math.PI/180/this.m_rpuGcsTo):Math.PI/180/this.m_rpuGcsTo*1e-5,r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,Number.NaN,i),r=F(r,this.m_transform2.getOutputSR(),i),r=j(r,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,f,n,i),r=(new b).execute(r,this.m_transform2,i),r}getMinLengthInSrFrom(t){let e;return e=this.m_bSrFromIsPcs?this.m_aFrom*(t*Math.PI/180)/this.m_mpuFrom:t*Math.PI/180*(1/this.m_rpuFrom),e}filterOverDensification(t,e,s,i){let n=X(t,s);return n.dropAttribute(10),n!==t&&n.getGeometryType()===r.enumPolygon&&(n=(new C).execute(n,e,!1,i)),n}}function X(t,e){if(t.isEmpty()||!t.hasAttribute(10))return t;const s=e*e;let i=t.getAttributeStreamRef(10),n=!1;const o=new _,r=[];let h=!1;for(let a=0,c=t.getPathCount();a<c;a++){const e=t.getPathStart(a),m=t.getPathEnd(a),c=t.isClosedPath(a);if(!(m>e))continue;{const t=c?e:m-1;0===i.read(e)&&0===i.read(t)||(n||(i=i.clone(),n=!0),i.write(e,0),i.write(t,0))}const l=c?m+1:m;let u=e;for(let a=e;a<l;a++){const c=a===m?e:a;if(0===i.read(c)){if(a-u>1){r.push({from:u,to:a});const c=new p;for(;r.length>0;){const a=r.at(-1);r.pop(),o.setStartXY(t.getXY(a.from));const l=a.to===m?e:a.to;o.setEndXY(t.getXY(l));let u=s,f=-1;for(let e=a.from+1,s=a.to;e<s;e++){const s=t.getXY(e),i=o.getClosestCoordinate(s,!1);o.queryCoord2D(i,c);const n=p.sqrDistance(c,s);u<n&&(u=n,f=e)}f>=0?(n||(i=i.clone(),n=!0),i.write(f,0),f-a.from>1&&r.push({from:a.from,to:f}),a.to-f>1&&r.push({from:f,to:a.to})):h=!0}}u=c}}}if(!h)return t;const m=A(t,i,1);return m.dropAttribute(10),m}function A(t,e,s){const i=t.createInstance(),n=new l;for(let o=0,r=t.getPathCount();o<r;o++){let r=!0,h=0,m=0;const a=t.getPathStart(o),c=t.getPathEnd(o);let l=!0;for(let u=a;u<c;u++){e.read(u)===s?(!l&&m>0&&(i.addSegmentsFromPath(t,o,h-a,m,r),m=0),l=!0):l?(l=!1,t.getPointByVal(u,n),r?(i.startPathPoint(n),r=!1):i.lineToPoint(n),h=u):m++}m>0&&i.addSegmentsFromPath(t,o,h-a,m,r)}return i}const Y=8;function H(t,e){const s=.5;for(let i=0;i<t;i++){let n=Math.ceil(i/2)/(t+1);i%2!=0&&(n=-n);const o=s+n;e[i]=o}}function O(t){if(!t)return!1;const e=t.getCoordinateSystemType();return 2===e||1===e}function j(t,e,s,i,n,o,r,h,m,a,c,l,u){const f=t.createInstance();f.addAttribute(10);const _=t.querySegmentIterator(),d=[],p=[],P=new g,T=t.getDescription().getAttributeCount()>1,b=new lt(e,s,i,n,o,r,h,a,c,l,T?p:null,d,u);for(;_.nextPath();)for(;_.hasNextSegment();){const t=_.nextSegment(),e=t.getStartXY(),s=t.getEndXY(),i=e.compare(s)>0,n=J(i,t,P);d.length=0,p.length=0;if(!b.densifySegment(_.isFirstSegmentInPath(),n))return null;i&&K(T?p:null,d),d.at(-1).setCoordsPoint2D(t.getEndXY());const o=f.getPointCount();if(T){const e=J(i,t,P);U(_.isFirstSegmentInPath(),_.isLastSegmentInPath()&&!_.isPathClosed(),t,e,p,d,f)}else B(_.isFirstSegmentInPath(),_.isLastSegmentInPath()&&!_.isPathClosed(),d,f);if(b.needsPostFiltering()){f.addAttribute(10);const t=f.getAttributeStreamRef(10);for(let e=1,s=d.length-1;e<s;e++)t.write(e+o,1)}}return f}function B(t,e,s,i){t&&i.insertPath2D(-1,null,0,0,!0);const n=i.getPathCount()-1;e?i.insertPointsFromPoints(n,-1,s,0,s.length,!0):i.insertPointsFromPoints(n,-1,s,0,s.length-1,!0)}function U(t,e,s,i,n,o,r){r.reserve(r.getPointCount()+o.length-1);const h=new l;if(s.queryStart(h),t?r.startPathPoint(h):r.lineToPoint(h),o.length>2){const t=i.calculateLength2D();for(let e=1;e<o.length-1;e++){const s=i.lengthToT(n[e]*t);i.queryCoord(s,h),h.setXY(o[e]),r.lineToPoint(h)}}e&&(s.queryEnd(h),r.lineToPoint(h))}function W(t){const e=new f({vd:t.getDescription()});return e.addSegment(t,!0),e}function Q(t,e){const s=e.getInputSR(),i=e.getOutputSR(),n=new p;2===s.getCoordinateSystemType()?(n.setCoordsPoint2D(t),G(s,0,[n],1)):n.setCoordsPoint2D(t);const o=new p;o.setCoordsPoint2D(n),v(e,[o],null,1,!1);const r=new p;return 2===i.getCoordinateSystemType()?(r.setCoordsPoint2D(o),z(i,[r],1,!1)):r.setCoordsPoint2D(o),r}function V(t,e,s,i,n,o,r,h){if(n){const n=o.width(),m=.5*n;if(i){const i=.25*n;let o=!1;const a=new p,c=new p;if(Math.abs(t.y)===i?(a.setCoords(s.x,t.y),c.setCoordsPoint2D(s),o=!0):Math.abs(s.y)===i&&(c.setCoords(t.x,s.y),a.setCoordsPoint2D(t),o=!0),Math.abs(e.y)===i&&(o||(a.setCoordsPoint2D(t),c.setCoordsPoint2D(s),o=!0),a.x=e.x),o)return ot(e,a,m,n,r),ot(e,c,m,n,h),!0}let a=0;t.x-e.x>m&&s.x-e.x>m?a-=n:e.x-t.x>m&&e.x-s.x>m&&(a+=n),Math.abs(e.x-(t.x+a))<m?(r.setCoordsPoint2D(t),ot(r,s,m,n,h),r.x+=a,h.x+=a):(r.setCoordsPoint2D(s),ot(r,t,m,n,h),r.x+=a,h.x+=a)}else r.setCoordsPoint2D(t),h.setCoordsPoint2D(s);return!1}function J(t,e,s){return t?(s.create(e.getGeometryType()),e.copyTo(s.get()),s.get().reverse(),s.get()):e}function K(t,e){e.reverse(),null!==t&&t.reverse()}function Z(t,e,s,i){const n=.5*(i.getStartX()+i.getEndX());if(n-s>t){const t=new T;t.setShiftCoords(-e,0),i.applyTransformation(t)}else if(s-n>t){const t=new T;t.setShiftCoords(e,0),i.applyTransformation(t)}}function $(t,e,s,i,n,o,r,h,m){const a=[!1];r&&tt(t,e,s,i,n,o,!0,h,a,m);let c=t;return a[0]||(c=tt(c,e,s,i,n,o,!1,h,null,m)),c=it(c,n,o,c!==t),c}function tt(t,e,s,i,n,o,h,m,a,c){if(h&&(a[0]=!1),null==s)return t;const l=new u,f=new u;s.queryEnvelope(l),t.queryEnvelope(f);const g=t.getGeometryType(),_=s.getGeometryType(),d=e.getTolerance(0);if(!n){if(h)return a[0]=st(t,s,e,i,c),null;let n;return n=i?_===r.enumEnvelope?k(t,l,d,m,c):(new y).execute(t,s,e,c):(new w).execute(t,s,e,c),n===s&&(n=s.clone()),n}const p=o.width(),P=p*Math.ceil(l.width()/p);let b=null;if(i){let o=nt(t,s,n,P),D=0;const S=new T;do{let n=null;if(_===r.enumEnvelope){const r=s.clone();if(S.setShiftCoords(o*P,0),r.applyTransformation(S),h){if(a[0]=st(t,r,e,i,c),!a[0])return null}else{const e=new u;r.queryEnvelope(e),n=k(t,e,d,m,c)}}else{const r=t.clone();if(S.setShiftCoords(-o*P,0),r.applyTransformation(S),h){if(a[0]=st(r,s,e,i,c),!a[0])return null}else n=(new y).execute(r,s,e,c),n===s&&(n=s.clone())}if(!h){if(n.isEmpty())continue;if(g===r.enumPolygon){const t=new u;if(n.queryEnvelope(t),t.width()<=d)continue}_===r.enumEnvelope&&(S.setShiftCoords(-o*P,0),n===t&&(n=n.clone()),n.applyTransformation(S)),null===b?b=n===t?n.clone():n:b.add(n,!1)}D++}while(l.xmin+ ++o*P<f.xmax);if(h)return null;null===b&&(b=t.createInstance()),g===r.enumPolygon&&D>1&&p-f.width()<=10*d&&(b=(new C).execute(b,e,!0,c))}else{let o=nt(t,s,n,P);if(b=t.clone(),0!==o){const t=new T;t.setShiftCoords(-o*P,0),b.applyTransformation(t)}do{if(h){if(a[0]=st(b,s,e,i,c),!a[0])return null}else if(b=(new w).execute(b,s,e,c),b===s&&(b=s.clone()),b.isEmpty())break;const t=new T;t.setShiftCoords(-P,0),b.applyTransformation(t)}while(l.xmin+ ++o*P<f.xmax);if(h)return null;if(!b.isEmpty()&&0!==o){const t=new T;t.setShiftCoords(o*P,0),b.applyTransformation(t)}}return b}function et(t,e,s,i,n,o,r){const h=[!1];return tt(t,s,e,i,n,o,!0,Number.NaN,h,r),h[0]}function st(t,e,s,i,n){let o;if(e.getGeometryType()===r.enumPolygon)if(i){o=E(e,t,s,64,n)}else{o=E(e,t,s,4,n)}else if(i){const s=new u,i=new u;e.queryEnvelope(s),t.queryEnvelope(i);o=s.containsEnvelope(i)}else{o=E(e,t,s,4,n)}return o}function it(t,e,s,i){let n;if(!e)return t;const o=s.getCenter().x,r=s.width(),h=.5*r,m=new u;t.queryEnvelope(m);const a=m.getCenter().x;let c=0;if(a-o>h){c=-Math.ceil((a-o-h)/r)*r}else if(o-a>h){c=Math.ceil((o-a-h)/r)*r}if(0!==c){n=i?t:t.clone();const e=new T;e.setShiftCoords(c,0),n.applyTransformation(e)}else n=t;return n}function nt(t,e,s,i){if(!s)return 0;let n=0;const o=new u;e.queryEnvelope(o);const r=new u;t.queryEnvelope(r);const h=o.xmin+i;for(;h+i+n*i>r.xmin;)n--;for(;h+n*i<r.xmin;)n++;return n}function ot(t,e,s,i,n){e.x-t.x>s?n.setCoords(e.x-i,e.y):t.x-e.x>s?n.setCoords(e.x+i,e.y):n.setCoordsPoint2D(e)}function rt(t,e,s,i,n,o,r){Math.abs(t.y)===s?(o.setCoords(e.x,t.y),r.setCoordsPoint2D(e)):Math.abs(e.y)===s?(o.setCoordsPoint2D(t),r.setCoords(t.x,e.y)):(o.setCoordsPoint2D(t),ot(o,e,i,n,r))}function ht(t){return t.getUnit().getUnitToBaseFactor()}function mt(t){return t.getUnit().getUnitToBaseFactor()}function at(t){return t.getPECoordSys().getDatum().getSpheroid().getAxis()}function ct(t,e,s){return s<=.5?t+(e-t)*s:e-(e-t)*(1-s)}class lt{checkSegment(){for(let t=0;t<this.n;t++){if(null!==this.pSplitLines2Info&&this.pSplitLines2Info.hasSplitLines()&&!this.bCheckIfNoDensificationNeededForCurve){const t=this.pSplitLines2Info.getSplitLineFactorEx(this.rectifiedSegment,this.leftFactor,this.rightFactor,this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker);if(Number.isNaN(t))return-1;if(-1!==t&&this.leftFactor<t&&t<this.rightFactor)return this.cutFactor=t,this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(Q(this.cutFromDensifiedPoint,this.transform)),this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(Q(this.cutGcsToDensifiedPoint,this.transform2)),this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint),1}if(this.cutFactor=ct(this.leftFactor,this.rightFactor,this.scalars[t]),this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(Q(this.cutFromDensifiedPoint,this.transform)),null!==this.transform2&&(this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(Q(this.cutGcsToDensifiedPoint,this.transform2))),0===t&&(this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint)),this.bIsPannableFrom&&!this.bCheckIfNoDensificationNeededForCurve&&Math.abs(this.leftFromDensifiedPoint.x-this.rightFromDensifiedPoint.x)>=.25*this.pannableExtentFrom.width())return 1;let e;if(this.bCheckIfNoDensificationNeededForCurve){const t=this.projCurveSegment.get().getClosestCoordinate(this.cutToDensifiedPoint,!1),s=this.projCurveSegment.get().getCoord2D(t);e=p.sqrDistance(this.cutToDensifiedPoint,s)}else{const s=new p,i=new p,n=V(this.leftToDensifiedPoint,this.cutToDensifiedPoint,this.rightToDensifiedPoint,this.bSrToIsGcs,this.bIsPannableTo,this.pannableExtentTo,s,i);this.line.setStartXY(s),this.line.setEndXY(i);const o=this.line.getClosestCoordinate(this.cutToDensifiedPoint,!0);if(n||t>0||Math.abs(o-this.scalars[t])<.3){const t=this.line.getCoord2D(o);e=p.sqrDistance(this.cutToDensifiedPoint,t)}else e=2*this.maxDeviationInSrToSq,this.bNeedPostFiltering=!0}if(e>this.maxDeviationInSrToSq)return this.bCheckIfNoDensificationNeededForCurve=!1,1}return 0}constructor(t,e,s,i,n,o,r,h,m,a,c,l,f){this.leftFromDensifiedPoint=new p,this.rightFromDensifiedPoint=new p,this.cutFromDensifiedPoint=new p,this.midFromDensifiedPoint=new p,this.leftToDensifiedPoint=new p,this.rightToDensifiedPoint=new p,this.cutToDensifiedPoint=new p,this.midToDensifiedPoint=new p,this.line=new _,this.leftGcsToDensifiedPoint=new p,this.rightGcsToDensifiedPoint=new p,this.cutGcsToDensifiedPoint=new p,this.midGcsToDensifiedPoint=new p,this.bSrToIsGcs=!1,this.bIsCurve=!1,this.leftFactor=0,this.rightFactor=0,this.bIsFirstInPath=!1,this.rectifiedSegment=null,this.transform=null,this.bIsPannableFrom=!1,this.pannableExtentFrom=new u,this.bIsPannableTo=!1,this.bNeedPostFiltering=!1,this.pannableExtentTo=new u,this.transform2=null,this.pHorizon2Info=null,this.pSplitLines2Info=null,this.minLengthInSrFrom=0,this.maxDeviationInSrToSq=0,this.cutFactor=0,this.midFactor=0,this.pDensifiedFactors=null,this.pDensifiedPoints=[],this.rightFromDensifiedPointsStack=[],this.rightToDensifiedPointsStack=[],this.rightGcsToDensifiedPointsStack=[],this.rightFactorsStack=[],this.projCurveSegment=new g,this.n=0,this.bCheckIfNoDensificationNeededForCurve=!1,this.scalars=P(Y-1,Number.NaN),this.progressTracker=f,this.transform=t,this.bIsPannableFrom=e,this.pannableExtentFrom.assign(s),this.bIsPannableTo=i,this.pannableExtentTo.assign(n),this.transform2=o,this.pHorizon2Info=r,this.pSplitLines2Info=h,this.minLengthInSrFrom=m,this.maxDeviationInSrToSq=a,this.pDensifiedFactors=c,this.pDensifiedPoints=l,this.progressTracker=f,this.bNeedPostFiltering=!1}needsPostFiltering(){return this.bNeedPostFiltering}densifySegment(t,e){if(this.bIsFirstInPath=t,this.rectifiedSegment=e,this.leftGcsToDensifiedPoint.setNAN(),this.rightGcsToDensifiedPoint.setNAN(),this.cutGcsToDensifiedPoint.setNAN(),this.midGcsToDensifiedPoint.setNAN(),this.bSrToIsGcs=null!=this.transform2?1===this.transform2.getOutputSR().getCoordinateSystemType():1===this.transform.getOutputSR().getCoordinateSystemType(),this.bIsCurve=this.rectifiedSegment.isCurve(),this.leftFactor=0,this.rightFactor=1,this.leftFromDensifiedPoint.assign(this.rectifiedSegment.getStartXY()),this.rightFromDensifiedPoint.assign(this.rectifiedSegment.getEndXY()),this.leftToDensifiedPoint.assign(Q(this.leftFromDensifiedPoint,this.transform)),this.rightToDensifiedPoint.assign(Q(this.rightFromDensifiedPoint,this.transform)),null!==this.transform2&&(this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.leftToDensifiedPoint),this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftToDensifiedPoint.assign(Q(this.leftGcsToDensifiedPoint,this.transform2)),this.rightToDensifiedPoint.assign(Q(this.rightGcsToDensifiedPoint,this.transform2)),this.bIsFirstInPath&&!this.pHorizon2Info.isPointStartInHorizon(this.leftGcsToDensifiedPoint,this.progressTracker)))return!1;this.rightFromDensifiedPointsStack.length=0,this.rightToDensifiedPointsStack.length=0,this.rightGcsToDensifiedPointsStack.length=0,this.rightFactorsStack.length=0,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),null!=this.transform2&&this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()),null!==this.pDensifiedPoints&&this.pDensifiedPoints.push(this.leftFromDensifiedPoint.clone()),null!==this.pDensifiedFactors&&this.pDensifiedFactors.push(this.leftFactor),this.bIsCurve?this.rectifiedSegment.getGeometryType()===r.enumBezier?this.n=Y-1:this.n=5:this.n=3,H(this.n,this.scalars);const s=this.rectifiedSegment.calculateLength2D();if(this.bCheckIfNoDensificationNeededForCurve=!1,this.bIsCurve){const t=new f({vd:this.rectifiedSegment.getDescription()});let e=(new b).execute(t,this.transform,this.progressTracker);if(null!==this.transform2){const t=new u;if(e.queryEnvelope(t),!this.pHorizon2Info.isEnvelopeInHorizon(t,this.progressTracker))return!1;e=(new b).execute(e,this.transform2,this.progressTracker)}e.getSegmentBuffer(0,this.projCurveSegment,!1),this.bCheckIfNoDensificationNeededForCurve=!0}for(;this.rightFromDensifiedPointsStack.length>0;){let t=!1;if(this.cutFactor=Number.NaN,this.midFactor=Number.NaN,this.midFromDensifiedPoint.setNAN(),this.midToDensifiedPoint.setNAN(),(this.rightFactor-this.leftFactor)*s>this.minLengthInSrFrom){const e=this.checkSegment();if(-1===e)return!1;t=0!==e}if(t)this.rightFromDensifiedPoint.setCoordsPoint2D(this.midFromDensifiedPoint),this.rightToDensifiedPoint.setCoordsPoint2D(this.midToDensifiedPoint),this.rightFactor=this.midFactor,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),null!==this.transform2&&(this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.midGcsToDensifiedPoint),this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()));else{if(null!==this.transform2&&!this.pHorizon2Info.isAdjoiningLineInHorizon(this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker))return!1;if(this.rightFromDensifiedPointsStack.pop(),this.rightToDensifiedPointsStack.pop(),this.rightFactorsStack.pop(),null!==this.transform2&&this.rightGcsToDensifiedPointsStack.pop(),null!==this.pDensifiedPoints&&this.pDensifiedPoints.push(this.rightFromDensifiedPoint.clone()),null!==this.pDensifiedFactors&&this.pDensifiedFactors.push(this.rightFactor),this.rightFromDensifiedPointsStack.length>0){this.leftFromDensifiedPoint.setCoordsPoint2D(this.rightFromDensifiedPoint),this.leftToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftFactor=this.rightFactor;const t=this.rightFromDensifiedPointsStack.at(-1),e=this.rightToDensifiedPointsStack.at(-1);if(this.rightFromDensifiedPoint.setCoordsPoint2D(t),this.rightToDensifiedPoint.setCoordsPoint2D(e),this.rightFactor=this.rightFactorsStack.at(-1),null!==this.transform2){this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.rightGcsToDensifiedPoint);const t=this.rightGcsToDensifiedPointsStack.at(-1);this.rightGcsToDensifiedPoint.setCoordsPoint2D(t)}}}}return!0}}class ut{getOperatorType(){return 10315}supportsCurves(){return!1}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,s,i,n,o){return q(s)?new ft(t,e,s,i,n,o):(new b).executeMany(t,s,o)}execute(t,e,s,i,n){if(!q(e))return(new b).execute(t,e,n);const o=new M;return o.prepare(e,null,n),o.execute(t,s,i,n)}}class ft extends t{constructor(t,s,i,n,o,r){super(),this.m_spp=null,this.m_index=-1,t||e(""),this.m_progressTracker=r,this.m_geometries=t,this.m_geometriesExtent=s?s.clone():null,this.m_transform=i,this.m_minSegmentLengthInDegrees=n,this.m_maxDeviationInSrTo=o}tock(){return!0}getRank(){return 1}next(){this.m_spp||(this.m_spp=new M,this.m_spp.prepare(this.m_transform,this.m_geometriesExtent,this.m_progressTracker));const t=this.m_geometries.next();return s(t),i(t),null!=t?(this.m_index=this.m_geometries.getGeometryID(),this.m_spp.execute(t,this.m_minSegmentLengthInDegrees,this.m_maxDeviationInSrTo,this.m_progressTracker)):null}getGeometryID(){return this.m_index}}export{ut as OperatorShapePreservingProject};
|
|
5
|
+
import{G as t}from"./SimpleGeometryCursor.js";import{a as e,c as s,o as i,p as n,g as o,G as r,f as h,h as m,t as a}from"./Geometry.js";import{E as c,P as l}from"./Envelope.js";import{Envelope2D as u}from"./Envelope2D.js";import{P as f,S as g,L as _}from"./MultiPathImpl.js";import{p as d,P as p,d as P}from"./Point2D.js";import{T}from"./Transformation2D.js";import{O as b,e as D,m as S,d as I,I as x,al as F,f as C,l as N,k as y,o as w,r as E,S as G,am as v,R as z}from"./SpatialReference.js";import{c as k}from"./OperatorClip.js";function q(t){const e=t.getInputSR(),s=t.getOutputSR();let i=!1;do{if(e.equals(s)){i=!1;break}if(!H(e)||!H(s)){i=!1;break}if(2===e.getCoordinateSystemType()){i=!0;break}if(2===s.getCoordinateSystemType()){i=!0;break}const n=t.getGeographicTransformations();if(null!==n&&n.count()>0){i=!0;break}}while(0);return i}class R{constructor(t,e,s,i){this.m_horizon2Env=new u,this.m_horizon2=t,this.m_sr=e,this.m_bInclusive2=s,this.m_pannableExtent=i.clone(),this.m_segIter=null,this.m_qtIter=null,null!==t?(t.queryEnvelope(this.m_horizon2Env),this.m_gcs360=i.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,this.m_pannableFactor=1,this.m_horizon2Env.width()-this.m_gcs360>0&&(this.m_pannableFactor+=Math.ceil((this.m_horizon2Env.width()-this.m_gcs360)/this.m_gcs360)),this.m_period=this.m_gcs360):(this.m_horizon2Env.setEmpty(),this.m_gcs360=Number.NaN,this.m_gcs180=Number.NaN,this.m_gcs90=Number.NaN,this.m_pannableFactor=Number.NaN,this.m_period=Number.NaN),this.m_gcsTolerance=null!=e?e.getTolerance(0):Number.NaN}isPointStartInHorizon(t,e){if(!this.m_horizon2)return!0;let s=nt(new l(t),this.m_horizon2,!0,this.m_period);do{const e=t.clone();if(e.x-=s*this.m_period,this.m_horizon2.getGeometryType()===r.enumPolygon){let t;if(t=this.m_horizon2Env.contains(e)?N(this.m_horizon2,e,0):0,this.m_bInclusive2){if(0===t)return!1}else if(1===t)return!1}else{const t=this.m_horizon2Env.contains(e);if(this.m_bInclusive2){if(!t)return!1}else if(t)return!1}}while(this.m_horizon2Env.xmin+ ++s*this.m_period<t.x);return!0}isAdjoiningLineInHorizon(t,e,s){if(!this.m_horizon2)return!0;const i=new p,n=new p;rt(t,e,this.m_gcs90,this.m_gcs180,this.m_gcs360,i,n);const h=Math.max(i.x,n.x),m=new _;m.setStart2D(i),m.setEnd2D(n);let a=nt(m,this.m_horizon2,!0,this.m_period);const c=!1;do{const t=i.clone(),e=n.clone();if(t.x-=a*this.m_period,e.x-=a*this.m_period,this.m_horizon2.getGeometryType()===r.enumPolygon){const s=new _;s.setStartXY(t),s.setEndXY(e);const i=new u,n=new u;if(s.queryEnvelope(i),n.setCoords({env2D:i}),n.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance),this.m_horizon2Env.isIntersecting(n)){const t=this.m_horizon2.getImpl(),e=t.getAccelerators();if(null!==e){null!==e.getRasterizedGeometry()&&o(0)}{let i=null;if(null!==e&&(i=e.getQuadTree()),null!==i){this.m_qtIter||(this.m_qtIter=i.getIteratorForQT()),this.m_qtIter.resetIterator(s,this.m_gcsTolerance),this.m_segIter||(this.m_segIter=t.querySegmentIterator());for(let t=this.m_qtIter.next();-1!==t;t=this.m_qtIter.next()){const e=i.getElement(t);this.m_segIter.resetToVertex(e,-1);if(this.m_segIter.nextSegment().isIntersecting(s,this.m_gcsTolerance))return!1}}else for(this.m_segIter||(this.m_segIter=t.querySegmentIterator()),this.m_segIter.resetToFirstPath();this.m_segIter.nextPath();)for(;this.m_segIter.hasNextSegment();){const t=this.m_segIter.nextSegment(),e=new u;if(t.queryEnvelope(e),e.isIntersecting(n)&&t.isIntersecting(s,this.m_gcsTolerance))return!1}}}}else if(this.m_bInclusive2){const s=this.m_horizon2Env.contains(t),i=this.m_horizon2Env.contains(e);if(s&&i)return!0}else{const s=this.m_horizon2Env.clone();s.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);if(!(0===s.clipLine(t,e)))return!1}}while(this.m_horizon2Env.xmin+ ++a*this.m_period<h);return!this.m_bInclusive2||c}isEnvelopeInHorizon(t,e){if(!this.m_horizon2)return!0;const s=new c({env2D:t});let i=nt(s,this.m_horizon2,!0,this.m_period);do{const n=t.clone();n.move(-i*this.m_period,0),s.setCoords(n.xmin,n.ymin,n.xmax,n.ymax);if(!st(s,this.m_horizon2,this.m_sr,this.m_bInclusive2,e))return!1}while(this.m_horizon2Env.xmin+ ++i*this.m_period<t.xmax);return!0}}class L{constructor(t,e,s){this.m_splitLines2=null,this.m_scalars=[],this.m_splitIter=null,this.m_splitLines2=t,this.m_transform1=e,this.m_pannableExtent=s.clone(),this.m_gcs360=s.width(),this.m_gcs180=.5*this.m_gcs360,this.m_gcs90=.25*this.m_gcs360,null!==e?(this.m_gcsTolerance=this.m_transform1.getOutputSR().getTolerance(0),this.m_halfGcsTolerance=.5*this.m_gcsTolerance,this.m_gcsToleranceSq=this.m_gcsTolerance*this.m_gcsTolerance):(this.m_gcsTolerance=Number.NaN,this.m_halfGcsTolerance=Number.NaN,this.m_gcsToleranceSq=Number.NaN)}hasSplitLines(){return null!=this.m_splitLines2}getSplitLineFactorEx(t,e,s,i,n,o){const r=new p,h=new p;rt(i,n,this.m_gcs90,this.m_gcs180,this.m_gcs360,r,h);const m=new _;for(m.setStartXY(r),m.setEndXY(h),this.m_splitIter?this.m_splitIter.resetToFirstPath():this.m_splitIter=this.m_splitLines2.getImpl().querySegmentIterator();this.m_splitIter.nextPath();)for(;this.m_splitIter.hasNextSegment();){const i=this.m_splitIter.nextSegment(),n=.5*(i.getStartX()+i.getEndX());Z(this.m_gcs180,this.m_gcs360,n,m);const r=new u;m.queryEnvelope(r),r.inflateCoords(this.m_gcsTolerance,this.m_gcsTolerance);const h=new u;if(i.queryEnvelope(h),!r.isIntersecting(h))continue;this.m_scalars.length<2&&(this.m_scalars.length=2);if(1===m.intersect(i,null,this.m_scalars,null,this.m_gcsTolerance)&&(this.m_scalars[0]>0&&this.m_scalars[0]<1)){const n=ct(e,s,this.m_scalars[0]),r=Q(t.getCoord2D(n),this.m_transform1);if(i.isIntersectingPoint(r,this.m_halfGcsTolerance))return n;return this.getSplitLineFactor(t,e,s,i,o)}}return-1}getSplitLineFactor(t,e,s,i,n){let o=e,r=s;const h=.5*(i.getStartX()+i.getEndX()),m=new _,a=t.getCoord2D(o),c=t.getCoord2D(r),l=Q(a,this.m_transform1),u=Q(c,this.m_transform1);for(;o<r;){const e=new p,s=new p;rt(l,u,this.m_gcs90,this.m_gcs180,this.m_gcs360,e,s),m.setStartXY(e),m.setEndXY(s),Z(this.m_gcs180,this.m_gcs360,h,m);const n=p.sqrDistance(m.getStartXY(),m.getEndXY());if(n<=this.m_gcsToleranceSq)break;if(Number.isNaN(n))return Number.NaN;let f=ct(o,r,this.m_scalars[0]);if(o<f&&f<r||(f=.5*(r+o)),o===f||f===r)return f;const g=t.getCoord2D(f),_=Q(g,this.m_transform1),d=new p;rt(l,_,this.m_gcs90,this.m_gcs180,this.m_gcs360,e,d),m.setStartXY(e),m.setEndXY(d),Z(this.m_gcs180,this.m_gcs360,h,m);let P=m.intersect(i,null,this.m_scalars,null,this.m_halfGcsTolerance);if(0!==P){if(1===this.m_scalars[0])return f;r=f,c.setCoordsPoint2D(g),u.setCoordsPoint2D(_)}else{if(rt(_,u,this.m_gcs90,this.m_gcs180,this.m_gcs360,d,s),m.setStartXY(d),m.setEndXY(s),Z(this.m_gcs180,this.m_gcs360,h,m),P=m.intersect(i,null,this.m_scalars,null,this.m_halfGcsTolerance),0===P)return f;if(0===this.m_scalars[0])return f;o=f,a.setCoordsPoint2D(g),l.setCoordsPoint2D(_)}}return.5*(r+o)}}class M{constructor(){this.m_bPrepared=!1,this.m_bNeedsShapePreservingProject=!1,this.m_inputTransform=null,this.m_transform1=null,this.m_transform2=null,this.m_extentFrom=null,this.m_horizon1=null,this.m_horizon2=null,this.m_pannableExtentFrom=new u,this.m_pannableExtentTo=new u,this.m_pannableExtentGcsTo=new u,this.m_bClipTopBottomFrom=!1,this.m_bNeedsGeoTransform=!1,this.m_bIsPannableFrom=!1,this.m_bIsPannableTo=!1,this.m_bInclusive1=!1,this.m_bInclusive2=!1,this.m_bSrFromIsPcs=!1,this.m_bSrToIsPcs=!1,this.m_fromTolerance=Number.NaN,this.m_toTolerance=Number.NaN,this.m_gcsToTolerance=Number.NaN,this.m_aFrom=Number.NaN,this.m_mpuFrom=Number.NaN,this.m_rpuFrom=Number.NaN,this.m_rpuGcsTo=Number.NaN,this.m_aTo=Number.NaN,this.m_mpuTo=Number.NaN,this.m_stages=0}prepare(t,s,i){this.m_bPrepared&&n(""),t||e("");const r=t.getInputSR(),h=t.getOutputSR();H(r)&&H(h)||e("shape preserving project requires PCS or GCS");const m=r.getCoordinateSystemType(),a=h.getCoordinateSystemType();this.m_bSrFromIsPcs=2===m,this.m_bSrToIsPcs=2===a;let c=null,l=null,u=null,f=null;this.m_bSrFromIsPcs?(c=r,u=r.getGCS(),this.m_aFrom=at(u),this.m_mpuFrom=mt(c),this.m_rpuFrom=Number.NaN):(u=r,this.m_rpuFrom=ht(u),this.m_aFrom=Number.NaN),this.m_bSrToIsPcs?(l=h,f=h.getGCS(),this.m_aTo=at(f),this.m_mpuTo=mt(l)):(f=h,this.m_aTo=Number.NaN,this.m_mpuTo=Number.NaN),this.m_rpuGcsTo=ht(f);const g=t.getGeographicTransformations();this.m_bNeedsGeoTransform=null!==g&&g.count()>0;const _=r.equals(h);if(this.m_bNeedsShapePreservingProject=!_&&(this.m_bSrFromIsPcs||this.m_bSrToIsPcs||this.m_bNeedsGeoTransform),!this.m_bNeedsShapePreservingProject)return this.m_inputTransform=t,this.m_extentFrom=s?s.clone():null,void(this.m_bPrepared=!0);if(this.m_bIsPannableFrom=r.isPannable(),this.m_bIsPannableTo=h.isPannable(),this.m_bIsPannableFrom&&(this.m_pannableExtentFrom=r.getPannableExtent()),this.m_bIsPannableTo&&(this.m_pannableExtentTo=h.getPannableExtent()),this.m_bSrToIsPcs){this.m_pannableExtentGcsTo=f.getPannableExtent();const t=l.getCentralMeridian(),e=this.m_pannableExtentGcsTo.getCenter();e.x=t,this.m_pannableExtentGcsTo.centerAt(e)}else this.m_pannableExtentGcsTo=this.m_pannableExtentTo.clone();this.m_fromTolerance=r.getTolerance(0),this.m_toTolerance=h.getTolerance(0),this.m_gcsToTolerance=f.getTolerance(0);{const e=t.getExtendedParams(),n=e.clipWithInputHorizon,o=e.clipWithOutputHorizon;n&&this.setHorizon1(t,s,i),o&&this.setHorizon2(t,i),this.checkAndSetStages(t,i)}const d=D();d.setFlag(1073741824,!0),d.setFlag(536870912,!0);const p=S();if(p.clipWithInputHorizon=!1,p.clipWithOutputHorizon=!1,1===this.m_stages)this.m_transform1=I(!1,r,h,g,p,d);else if(2===this.m_stages){d.setFlag(2147483648,!0),this.m_transform1=I(!1,r,f,g,p,d);const t=D();this.m_transform2=I(!1,f,h,null,p,t)}else{o(null!=l),p.centralMeridianOfOutputGCS=l.getCentralMeridian(),this.m_transform1=I(!1,r,f,g,p,d);const t=D();t.setFlag(2147483648,!0),this.m_transform2=I(!1,f,h,null,p,t)}this.m_inputTransform=t,this.m_extentFrom=s?s.clone():null,this.m_bPrepared=!0}execute(t,e,s,i){this.m_bPrepared||n(""),o(!t.hasAttribute(10));return this.execute_(t,e,s,i)}checkIfNeedsReset(t,e){return o(0),!1}setHorizon1(t,e,s){const i=t.getInputSR();let n,o=null;const r=new u;if(this.m_bSrFromIsPcs){n=!0,o=i.getPCSHorizon(),o.queryEnvelope(r),this.m_bIsPannableFrom&&(o=new c({xmin:this.m_pannableExtentFrom.xmin,ymin:r.ymin,xmax:this.m_pannableExtentFrom.xmax,ymax:r.ymax}));let t=!1;null!=e&&(t=et(e,o,i,n,this.m_bIsPannableFrom,this.m_pannableExtentFrom,s)),t||(this.m_horizon1=o,this.m_bInclusive1=n)}else this.m_bClipTopBottomFrom=!0,this.m_bInclusive1=!0}setHorizon2(t,e){const s=t.getOutputSR();if(1===s.getCoordinateSystemType())return this.m_horizon2=null,void(this.m_bInclusive2=!1);let i=null;const n=new u,o=s.getGCSHorisonIsInclusive();i=s.getGCSHorizon(),i.queryEnvelope(n);const r=s.getCentralMeridian();if(this.m_bIsPannableTo){const t=new c({xmin:this.m_pannableExtentGcsTo.xmin,ymin:n.ymin,xmax:this.m_pannableExtentGcsTo.xmax,ymax:n.ymax});t.centerAt(r,0),i=t}this.m_horizon2=i,this.m_bInclusive2=o}checkAndSetStages(t,e){const s=t.getOutputSR().getGCSSplitLines();if(!this.m_horizon2&&!s)return void(this.m_stages=1);if(this.m_horizon2.getGeometryType()===r.enumEnvelope){const t=new u;this.m_horizon2.queryEnvelope(t);const e=t.width(),s=t.height();e>=d/this.m_rpuGcsTo&&s>=Math.PI/this.m_rpuGcsTo&&(this.m_horizon2=null)}if(this.m_horizon2||s){if(null!==this.m_horizon2&&!this.m_bNeedsGeoTransform&&!this.m_bSrFromIsPcs){const e=t.getOutputSR().getGCS();return t.getInputSR().equals(e)?(this.m_horizon1=this.m_horizon2,this.m_bInclusive1=this.m_bInclusive2,this.m_bClipTopBottomFrom=!1,this.m_horizon2=null,this.m_bInclusive2=!1,void(this.m_stages=1)):void(this.m_stages=2)}this.m_stages=3}else this.m_stages=1}execute_(t,e,n,o){if(!this.m_bNeedsShapePreservingProject)return(new b).execute(t,this.m_inputTransform,o);if(!t)return null;s(t),i(t);let a,c=t.getGeometryType();return h(c)?(a=W(t),c=r.enumPolyline):a=t,a.isEmpty()?a:m(c)?this.executeEx(t,e,n,o):(new b).execute(t,this.m_inputTransform,o)}executeEx(t,e,s,i){let n;t.hasNonLinearSegments()&&a(""),n=this.m_bIsPannableFrom?(new b).foldInto360Range(t,this.m_transform1.getInputSR()):t;let o,r=s;return r>0||(r=100*this.m_toTolerance),o=1===this.m_stages?this.executeGood(n,e,r,i):2===this.m_stages?this.executeBad(n,e,r,i):this.executeUgly(n,e,r,i),this.filterOverDensification(o,this.m_inputTransform.getOutputSR(),r,i)}executeGood(t,e,s,i){const n=s*s;let o,r;return o=e>0?this.getMinLengthInSrFrom(e):this.getMinLengthInSrFrom(1e-5),r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):$(t,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,Number.NaN,i),r=F(r,this.m_transform1.getOutputSR(),i),r=j(r,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,o,n,i),r=(new b).execute(r,this.m_transform1,i),r}executeBad(t,e,s,i){let n;n=e>0?e*(Math.PI/180/this.m_rpuGcsTo):Math.PI/180/this.m_rpuGcsTo*1e-5;const o=s*s;let r;return r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):t,r=(new b).execute(r,this.m_transform1,i),r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!0,Number.NaN,i),r=F(r,this.m_transform2.getOutputSR(),i),r=j(r,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,n,o,i),r=(new b).execute(r,this.m_transform2,i),r}executeUgly(t,e,s,i){const n=s*s;let o;o=e>0?this.getMinLengthInSrFrom(e):this.getMinLengthInSrFrom(1e-5);let r=null;r=this.m_bClipTopBottomFrom?x(t,this.m_transform1.getInputSR()):$(t,this.m_transform1.getInputSR(),this.m_horizon1,this.m_bInclusive1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,Number.NaN,i);let h=r;const m=new R(this.m_horizon2,this.m_transform2.getInputSR(),this.m_bInclusive2,this.m_pannableExtentGcsTo),a=this.m_transform2.getOutputSR().getGCSSplitLines(),c=new L(a,this.m_transform1,this.m_pannableExtentGcsTo);if(r=j(r,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,this.m_bIsPannableTo,this.m_pannableExtentTo,this.m_transform2,m,this.m_pannableExtentGcsTo,c,o,n,i),null!==r){h=null,r=(new b).execute(r,this.m_transform1,i);const t=Math.PI/180/this.m_rpuGcsTo*2;return r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,t,i),r=(new b).execute(r,this.m_transform2,i),r}let l=Number.NaN;l=s>0?s:100*this.m_toTolerance,l/=this.m_rpuGcsTo*this.m_aTo/this.m_mpuTo;const u=l*l;let f;return r=j(h,this.m_transform1,this.m_bIsPannableFrom,this.m_pannableExtentFrom,!0,this.m_pannableExtentGcsTo,null,null,null,null,o,u,i),h=null,r=(new b).execute(r,this.m_transform1,i),f=e>0?e*(Math.PI/180/this.m_rpuGcsTo):Math.PI/180/this.m_rpuGcsTo*1e-5,r=$(r,this.m_transform2.getInputSR(),this.m_horizon2,this.m_bInclusive2,!0,this.m_pannableExtentGcsTo,!1,Number.NaN,i),r=F(r,this.m_transform2.getOutputSR(),i),r=j(r,this.m_transform2,!0,this.m_pannableExtentGcsTo,this.m_bIsPannableTo,this.m_pannableExtentTo,null,null,null,null,f,n,i),r=(new b).execute(r,this.m_transform2,i),r}getMinLengthInSrFrom(t){let e;return e=this.m_bSrFromIsPcs?this.m_aFrom*(t*Math.PI/180)/this.m_mpuFrom:t*Math.PI/180*(1/this.m_rpuFrom),e}filterOverDensification(t,e,s,i){let n=X(t,s);return n.dropAttribute(10),n!==t&&n.getGeometryType()===r.enumPolygon&&(n=(new C).execute(n,e,!1,i)),n}}function X(t,e){if(t.isEmpty()||!t.hasAttribute(10))return t;const s=e*e;let i=t.getAttributeStreamRef(10),n=!1;const o=new _,r=[];let h=!1;for(let a=0,c=t.getPathCount();a<c;a++){const e=t.getPathStart(a),m=t.getPathEnd(a),c=t.isClosedPath(a);if(!(m>e))continue;{const t=c?e:m-1;0===i.read(e)&&0===i.read(t)||(n||(i=i.clone(),n=!0),i.write(e,0),i.write(t,0))}const l=c?m+1:m;let u=e;for(let a=e;a<l;a++){const c=a===m?e:a;if(0===i.read(c)){if(a-u>1){r.push({from:u,to:a});const c=new p;for(;r.length>0;){const a=r.at(-1);r.pop(),o.setStartXY(t.getXY(a.from));const l=a.to===m?e:a.to;o.setEndXY(t.getXY(l));let u=s,f=-1;for(let e=a.from+1,s=a.to;e<s;e++){const s=t.getXY(e),i=o.getClosestCoordinate(s,!1);o.queryCoord2D(i,c);const n=p.sqrDistance(c,s);u<n&&(u=n,f=e)}f>=0?(n||(i=i.clone(),n=!0),i.write(f,0),f-a.from>1&&r.push({from:a.from,to:f}),a.to-f>1&&r.push({from:f,to:a.to})):h=!0}}u=c}}}if(!h)return t;const m=Y(t,i,1);return m.dropAttribute(10),m}function Y(t,e,s){const i=t.createInstance(),n=new l;for(let o=0,r=t.getPathCount();o<r;o++){let r=!0,h=0,m=0;const a=t.getPathStart(o),c=t.getPathEnd(o);let l=!0;for(let u=a;u<c;u++){e.read(u)===s?(!l&&m>0&&(i.addSegmentsFromPath(t,o,h-a,m,r),m=0),l=!0):l?(l=!1,t.getPointByVal(u,n),r?(i.startPathPoint(n),r=!1):i.lineToPoint(n),h=u):m++}m>0&&i.addSegmentsFromPath(t,o,h-a,m,r)}return i}const A=8;function O(t,e){const s=.5;for(let i=0;i<t;i++){let n=Math.ceil(i/2)/(t+1);i%2!=0&&(n=-n);const o=s+n;e[i]=o}}function H(t){if(!t)return!1;const e=t.getCoordinateSystemType();return 2===e||1===e}function j(t,e,s,i,n,o,r,h,m,a,c,l,u){const f=t.createInstance();f.addAttribute(10);const _=t.querySegmentIterator(),d=[],p=[],P=new g,T=t.getDescription().getAttributeCount()>1,b=new lt(e,s,i,n,o,r,h,a,c,l,T?p:null,d,u);for(;_.nextPath();)for(;_.hasNextSegment();){const t=_.nextSegment(),e=t.getStartXY(),s=t.getEndXY(),i=e.compare(s)>0,n=J(i,t,P);d.length=0,p.length=0;if(!b.densifySegment(_.isFirstSegmentInPath(),n))return null;i&&K(T?p:null,d),d.at(-1).setCoordsPoint2D(t.getEndXY());const o=f.getPointCount();if(T){const e=J(i,t,P);U(_.isFirstSegmentInPath(),_.isLastSegmentInPath()&&!_.isPathClosed(),t,e,p,d,f)}else B(_.isFirstSegmentInPath(),_.isLastSegmentInPath()&&!_.isPathClosed(),d,f);if(b.needsPostFiltering()){f.addAttribute(10);const t=f.getAttributeStreamRef(10);for(let e=1,s=d.length-1;e<s;e++)t.write(e+o,1)}}return f}function B(t,e,s,i){t&&i.insertPath2D(-1,null,0,0,!0);const n=i.getPathCount()-1;e?i.insertPointsFromPoints(n,-1,s,0,s.length,!0):i.insertPointsFromPoints(n,-1,s,0,s.length-1,!0)}function U(t,e,s,i,n,o,r){r.reserve(r.getPointCount()+o.length-1);const h=new l;if(s.queryStart(h),t?r.startPathPoint(h):r.lineToPoint(h),o.length>2){const t=i.calculateLength2D();for(let e=1;e<o.length-1;e++){const s=i.lengthToT(n[e]*t);i.queryCoord(s,h),h.setXY(o[e]),r.lineToPoint(h)}}e&&(s.queryEnd(h),r.lineToPoint(h))}function W(t){const e=new f({vd:t.getDescription()});return e.addSegment(t,!0),e}function Q(t,e){const s=e.getInputSR(),i=e.getOutputSR(),n=new p;2===s.getCoordinateSystemType()?(n.setCoordsPoint2D(t),G(s,0,[n],1)):n.setCoordsPoint2D(t);const o=new p;o.setCoordsPoint2D(n),v(e,[o],null,1,!1);const r=new p;return 2===i.getCoordinateSystemType()?(r.setCoordsPoint2D(o),z(i,[r],1,!1)):r.setCoordsPoint2D(o),r}function V(t,e,s,i,n,o,r,h){if(n){const n=o.width(),m=.5*n;if(i){const i=.25*n;let o=!1;const a=new p,c=new p;if(Math.abs(t.y)===i?(a.setCoords(s.x,t.y),c.setCoordsPoint2D(s),o=!0):Math.abs(s.y)===i&&(c.setCoords(t.x,s.y),a.setCoordsPoint2D(t),o=!0),Math.abs(e.y)===i&&(o||(a.setCoordsPoint2D(t),c.setCoordsPoint2D(s),o=!0),a.x=e.x),o)return ot(e,a,m,n,r),ot(e,c,m,n,h),!0}let a=0;t.x-e.x>m&&s.x-e.x>m?a-=n:e.x-t.x>m&&e.x-s.x>m&&(a+=n),Math.abs(e.x-(t.x+a))<m?(r.setCoordsPoint2D(t),ot(r,s,m,n,h),r.x+=a,h.x+=a):(r.setCoordsPoint2D(s),ot(r,t,m,n,h),r.x+=a,h.x+=a)}else r.setCoordsPoint2D(t),h.setCoordsPoint2D(s);return!1}function J(t,e,s){return t?(s.create(e.getGeometryType()),e.copyTo(s.get()),s.get().reverse(),s.get()):e}function K(t,e){e.reverse(),null!==t&&t.reverse()}function Z(t,e,s,i){const n=.5*(i.getStartX()+i.getEndX());if(n-s>t){const t=new T;t.setShiftCoords(-e,0),i.applyTransformation(t)}else if(s-n>t){const t=new T;t.setShiftCoords(e,0),i.applyTransformation(t)}}function $(t,e,s,i,n,o,r,h,m){const a=[!1];r&&tt(t,e,s,i,n,o,!0,h,a,m);let c=t;return a[0]||(c=tt(c,e,s,i,n,o,!1,h,null,m)),c=it(c,n,o,c!==t),c}function tt(t,e,s,i,n,o,h,m,a,c){if(h&&(a[0]=!1),null==s)return t;const l=new u,f=new u;s.queryEnvelope(l),t.queryEnvelope(f);const g=t.getGeometryType(),_=s.getGeometryType(),d=e.getTolerance(0);if(!n){if(h)return a[0]=st(t,s,e,i,c),null;let n;return n=i?_===r.enumEnvelope?k(t,l,d,m,c):(new y).execute(t,s,e,c):(new w).execute(t,s,e,c),n===s&&(n=s.clone()),n}const p=o.width(),P=p*Math.ceil(l.width()/p);let b=null;if(i){let o=nt(t,s,n,P),D=0;const S=new T;do{let n=null;if(_===r.enumEnvelope){const r=s.clone();if(S.setShiftCoords(o*P,0),r.applyTransformation(S),h){if(a[0]=st(t,r,e,i,c),!a[0])return null}else{const e=new u;r.queryEnvelope(e),n=k(t,e,d,m,c)}}else{const r=t.clone();if(S.setShiftCoords(-o*P,0),r.applyTransformation(S),h){if(a[0]=st(r,s,e,i,c),!a[0])return null}else n=(new y).execute(r,s,e,c),n===s&&(n=s.clone())}if(!h){if(n.isEmpty())continue;if(g===r.enumPolygon){const t=new u;if(n.queryEnvelope(t),t.width()<=d)continue}_===r.enumEnvelope&&(S.setShiftCoords(-o*P,0),n===t&&(n=n.clone()),n.applyTransformation(S)),null===b?b=n===t?n.clone():n:b.add(n,!1)}D++}while(l.xmin+ ++o*P<f.xmax);if(h)return null;null===b&&(b=t.createInstance()),g===r.enumPolygon&&D>1&&p-f.width()<=10*d&&(b=(new C).execute(b,e,!0,c))}else{let o=nt(t,s,n,P);if(b=t.clone(),0!==o){const t=new T;t.setShiftCoords(-o*P,0),b.applyTransformation(t)}do{if(h){if(a[0]=st(b,s,e,i,c),!a[0])return null}else if(b=(new w).execute(b,s,e,c),b===s&&(b=s.clone()),b.isEmpty())break;const t=new T;t.setShiftCoords(-P,0),b.applyTransformation(t)}while(l.xmin+ ++o*P<f.xmax);if(h)return null;if(!b.isEmpty()&&0!==o){const t=new T;t.setShiftCoords(o*P,0),b.applyTransformation(t)}}return b}function et(t,e,s,i,n,o,r){const h=[!1];return tt(t,s,e,i,n,o,!0,Number.NaN,h,r),h[0]}function st(t,e,s,i,n){let o;if(e.getGeometryType()===r.enumPolygon)if(i){o=E(e,t,s,64,n)}else{o=E(e,t,s,4,n)}else if(i){const s=new u,i=new u;e.queryEnvelope(s),t.queryEnvelope(i);o=s.containsEnvelope(i)}else{o=E(e,t,s,4,n)}return o}function it(t,e,s,i){let n;if(!e)return t;const o=s.getCenter().x,r=s.width(),h=.5*r,m=new u;t.queryEnvelope(m);const a=m.getCenter().x;let c=0;if(a-o>h){c=-Math.ceil((a-o-h)/r)*r}else if(o-a>h){c=Math.ceil((o-a-h)/r)*r}if(0!==c){n=i?t:t.clone();const e=new T;e.setShiftCoords(c,0),n.applyTransformation(e)}else n=t;return n}function nt(t,e,s,i){if(!s)return 0;let n=0;const o=new u;e.queryEnvelope(o);const r=new u;t.queryEnvelope(r);const h=o.xmin+i;for(;h+i+n*i>r.xmin;)n--;for(;h+n*i<r.xmin;)n++;return n}function ot(t,e,s,i,n){e.x-t.x>s?n.setCoords(e.x-i,e.y):t.x-e.x>s?n.setCoords(e.x+i,e.y):n.setCoordsPoint2D(e)}function rt(t,e,s,i,n,o,r){Math.abs(t.y)===s?(o.setCoords(e.x,t.y),r.setCoordsPoint2D(e)):Math.abs(e.y)===s?(o.setCoordsPoint2D(t),r.setCoords(t.x,e.y)):(o.setCoordsPoint2D(t),ot(o,e,i,n,r))}function ht(t){return t.getUnit().getUnitToBaseFactor()}function mt(t){return t.getUnit().getUnitToBaseFactor()}function at(t){return t.getPECoordSys().getDatum().getSpheroid().getAxis()}function ct(t,e,s){return s<=.5?t+(e-t)*s:e-(e-t)*(1-s)}class lt{checkSegment(){for(let t=0;t<this.n;t++){if(null!==this.pSplitLines2Info&&this.pSplitLines2Info.hasSplitLines()&&!this.bCheckIfNoDensificationNeededForCurve){const t=this.pSplitLines2Info.getSplitLineFactorEx(this.rectifiedSegment,this.leftFactor,this.rightFactor,this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker);if(Number.isNaN(t))return-1;if(-1!==t&&this.leftFactor<t&&t<this.rightFactor)return this.cutFactor=t,this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(Q(this.cutFromDensifiedPoint,this.transform)),this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(Q(this.cutGcsToDensifiedPoint,this.transform2)),this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint),1}if(this.cutFactor=ct(this.leftFactor,this.rightFactor,this.scalars[t]),this.cutFromDensifiedPoint.assign(this.rectifiedSegment.getCoord2D(this.cutFactor)),this.cutToDensifiedPoint.assign(Q(this.cutFromDensifiedPoint,this.transform)),null!==this.transform2&&(this.cutGcsToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.cutToDensifiedPoint.assign(Q(this.cutGcsToDensifiedPoint,this.transform2))),0===t&&(this.midFactor=this.cutFactor,this.midFromDensifiedPoint.setCoordsPoint2D(this.cutFromDensifiedPoint),this.midToDensifiedPoint.setCoordsPoint2D(this.cutToDensifiedPoint),this.midGcsToDensifiedPoint.setCoordsPoint2D(this.cutGcsToDensifiedPoint)),this.bIsPannableFrom&&!this.bCheckIfNoDensificationNeededForCurve&&Math.abs(this.leftFromDensifiedPoint.x-this.rightFromDensifiedPoint.x)>=.25*this.pannableExtentFrom.width())return 1;let e;if(this.bCheckIfNoDensificationNeededForCurve){const t=this.projCurveSegment.get().getClosestCoordinate(this.cutToDensifiedPoint,!1),s=this.projCurveSegment.get().getCoord2D(t);e=p.sqrDistance(this.cutToDensifiedPoint,s)}else{const s=new p,i=new p,n=V(this.leftToDensifiedPoint,this.cutToDensifiedPoint,this.rightToDensifiedPoint,this.bSrToIsGcs,this.bIsPannableTo,this.pannableExtentTo,s,i);this.line.setStartXY(s),this.line.setEndXY(i);const o=this.line.getClosestCoordinate(this.cutToDensifiedPoint,!0);if(n||t>0||Math.abs(o-this.scalars[t])<.3){const t=this.line.getCoord2D(o);e=p.sqrDistance(this.cutToDensifiedPoint,t)}else e=2*this.maxDeviationInSrToSq,this.bNeedPostFiltering=!0}if(e>this.maxDeviationInSrToSq)return this.bCheckIfNoDensificationNeededForCurve=!1,1}return 0}constructor(t,e,s,i,n,o,r,h,m,a,c,l,f){this.leftFromDensifiedPoint=new p,this.rightFromDensifiedPoint=new p,this.cutFromDensifiedPoint=new p,this.midFromDensifiedPoint=new p,this.leftToDensifiedPoint=new p,this.rightToDensifiedPoint=new p,this.cutToDensifiedPoint=new p,this.midToDensifiedPoint=new p,this.line=new _,this.leftGcsToDensifiedPoint=new p,this.rightGcsToDensifiedPoint=new p,this.cutGcsToDensifiedPoint=new p,this.midGcsToDensifiedPoint=new p,this.bSrToIsGcs=!1,this.bIsCurve=!1,this.leftFactor=0,this.rightFactor=0,this.bIsFirstInPath=!1,this.rectifiedSegment=null,this.transform=null,this.bIsPannableFrom=!1,this.pannableExtentFrom=new u,this.bIsPannableTo=!1,this.bNeedPostFiltering=!1,this.pannableExtentTo=new u,this.transform2=null,this.pHorizon2Info=null,this.pSplitLines2Info=null,this.minLengthInSrFrom=0,this.maxDeviationInSrToSq=0,this.cutFactor=0,this.midFactor=0,this.pDensifiedFactors=null,this.pDensifiedPoints=[],this.rightFromDensifiedPointsStack=[],this.rightToDensifiedPointsStack=[],this.rightGcsToDensifiedPointsStack=[],this.rightFactorsStack=[],this.projCurveSegment=new g,this.n=0,this.bCheckIfNoDensificationNeededForCurve=!1,this.scalars=P(A-1,Number.NaN),this.progressTracker=f,this.transform=t,this.bIsPannableFrom=e,this.pannableExtentFrom.assign(s),this.bIsPannableTo=i,this.pannableExtentTo.assign(n),this.transform2=o,this.pHorizon2Info=r,this.pSplitLines2Info=h,this.minLengthInSrFrom=m,this.maxDeviationInSrToSq=a,this.pDensifiedFactors=c,this.pDensifiedPoints=l,this.progressTracker=f,this.bNeedPostFiltering=!1}needsPostFiltering(){return this.bNeedPostFiltering}densifySegment(t,e){if(this.bIsFirstInPath=t,this.rectifiedSegment=e,this.leftGcsToDensifiedPoint.setNAN(),this.rightGcsToDensifiedPoint.setNAN(),this.cutGcsToDensifiedPoint.setNAN(),this.midGcsToDensifiedPoint.setNAN(),this.bSrToIsGcs=null!=this.transform2?1===this.transform2.getOutputSR().getCoordinateSystemType():1===this.transform.getOutputSR().getCoordinateSystemType(),this.bIsCurve=this.rectifiedSegment.isCurve(),this.leftFactor=0,this.rightFactor=1,this.leftFromDensifiedPoint.assign(this.rectifiedSegment.getStartXY()),this.rightFromDensifiedPoint.assign(this.rectifiedSegment.getEndXY()),this.leftToDensifiedPoint.assign(Q(this.leftFromDensifiedPoint,this.transform)),this.rightToDensifiedPoint.assign(Q(this.rightFromDensifiedPoint,this.transform)),null!==this.transform2&&(this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.leftToDensifiedPoint),this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftToDensifiedPoint.assign(Q(this.leftGcsToDensifiedPoint,this.transform2)),this.rightToDensifiedPoint.assign(Q(this.rightGcsToDensifiedPoint,this.transform2)),this.bIsFirstInPath&&!this.pHorizon2Info.isPointStartInHorizon(this.leftGcsToDensifiedPoint,this.progressTracker)))return!1;this.rightFromDensifiedPointsStack.length=0,this.rightToDensifiedPointsStack.length=0,this.rightGcsToDensifiedPointsStack.length=0,this.rightFactorsStack.length=0,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),null!=this.transform2&&this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()),null!==this.pDensifiedPoints&&this.pDensifiedPoints.push(this.leftFromDensifiedPoint.clone()),null!==this.pDensifiedFactors&&this.pDensifiedFactors.push(this.leftFactor),this.bIsCurve?this.rectifiedSegment.getGeometryType()===r.enumBezier?this.n=A-1:this.n=5:this.n=3,O(this.n,this.scalars);const s=this.rectifiedSegment.calculateLength2D();if(this.bCheckIfNoDensificationNeededForCurve=!1,this.bIsCurve){const t=new f({vd:this.rectifiedSegment.getDescription()});let e=(new b).execute(t,this.transform,this.progressTracker);if(null!==this.transform2){const t=new u;if(e.queryEnvelope(t),!this.pHorizon2Info.isEnvelopeInHorizon(t,this.progressTracker))return!1;e=(new b).execute(e,this.transform2,this.progressTracker)}e.getSegmentBuffer(0,this.projCurveSegment,!1),this.bCheckIfNoDensificationNeededForCurve=!0}for(;this.rightFromDensifiedPointsStack.length>0;){let t=!1;if(this.cutFactor=Number.NaN,this.midFactor=Number.NaN,this.midFromDensifiedPoint.setNAN(),this.midToDensifiedPoint.setNAN(),(this.rightFactor-this.leftFactor)*s>this.minLengthInSrFrom){const e=this.checkSegment();if(-1===e)return!1;t=0!==e}if(t)this.rightFromDensifiedPoint.setCoordsPoint2D(this.midFromDensifiedPoint),this.rightToDensifiedPoint.setCoordsPoint2D(this.midToDensifiedPoint),this.rightFactor=this.midFactor,this.rightFromDensifiedPointsStack.push(this.rightFromDensifiedPoint.clone()),this.rightToDensifiedPointsStack.push(this.rightToDensifiedPoint.clone()),this.rightFactorsStack.push(this.rightFactor),null!==this.transform2&&(this.rightGcsToDensifiedPoint.setCoordsPoint2D(this.midGcsToDensifiedPoint),this.rightGcsToDensifiedPointsStack.push(this.rightGcsToDensifiedPoint.clone()));else{if(null!==this.transform2&&!this.pHorizon2Info.isAdjoiningLineInHorizon(this.leftGcsToDensifiedPoint,this.rightGcsToDensifiedPoint,this.progressTracker))return!1;if(this.rightFromDensifiedPointsStack.pop(),this.rightToDensifiedPointsStack.pop(),this.rightFactorsStack.pop(),null!==this.transform2&&this.rightGcsToDensifiedPointsStack.pop(),null!==this.pDensifiedPoints&&this.pDensifiedPoints.push(this.rightFromDensifiedPoint.clone()),null!==this.pDensifiedFactors&&this.pDensifiedFactors.push(this.rightFactor),this.rightFromDensifiedPointsStack.length>0){this.leftFromDensifiedPoint.setCoordsPoint2D(this.rightFromDensifiedPoint),this.leftToDensifiedPoint.setCoordsPoint2D(this.rightToDensifiedPoint),this.leftFactor=this.rightFactor;const t=this.rightFromDensifiedPointsStack.at(-1),e=this.rightToDensifiedPointsStack.at(-1);if(this.rightFromDensifiedPoint.setCoordsPoint2D(t),this.rightToDensifiedPoint.setCoordsPoint2D(e),this.rightFactor=this.rightFactorsStack.at(-1),null!==this.transform2){this.leftGcsToDensifiedPoint.setCoordsPoint2D(this.rightGcsToDensifiedPoint);const t=this.rightGcsToDensifiedPointsStack.at(-1);this.rightGcsToDensifiedPoint.setCoordsPoint2D(t)}}}}return!0}}class ut{getOperatorType(){return 10315}supportsCurves(){return!1}accelerateGeometry(t,e,s){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,s,i,n,o){return q(s)?new ft(t,e,s,i,n,o):(new b).executeMany(t,s,o)}execute(t,e,s,i,n){if(!q(e))return(new b).execute(t,e,n);const o=new M;return o.prepare(e,null,n),o.execute(t,s,i,n)}}class ft extends t{constructor(t,s,i,n,o,r){super(),this.m_spp=null,this.m_index=-1,t||e(""),this.m_progressTracker=r,this.m_geometries=t,this.m_geometriesExtent=s?s.clone():null,this.m_transform=i,this.m_minSegmentLengthInDegrees=n,this.m_maxDeviationInSrTo=o}tock(){return!0}getRank(){return 1}next(){this.m_spp||(this.m_spp=new M,this.m_spp.prepare(this.m_transform,this.m_geometriesExtent,this.m_progressTracker));const t=this.m_geometries.next();return s(t),i(t),null!=t?(this.m_index=this.m_geometries.getGeometryID(),this.m_spp.execute(t,this.m_minSegmentLengthInDegrees,this.m_maxDeviationInSrTo,this.m_progressTracker)):null}getGeometryID(){return this.m_index}}export{ut as OperatorShapePreservingProject};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{S as e,G as r}from"./SimpleGeometryCursor.js";import{d as t,a as s,c as i}from"./Geometry.js";import{
|
|
5
|
+
import{S as e,G as r}from"./SimpleGeometryCursor.js";import{d as t,a as s,c as i}from"./Geometry.js";import{s as n,t as m}from"./SpatialReference.js";class o{getOperatorType(){return 10104}accelerateGeometry(e,r,t){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}isSimple(e,r,t,s,i){return 5===n(e,r,t,s,i)}executeMany(e,r,t,s){return new u(e,r,t,s)}execute(r,s,i,n){const m=new e([r]),o=this.executeMany(m,s,i,n).next();return o||t("null output"),o}}class u extends r{constructor(e,r,t,i){super(),e||s(""),this.m_progressTracker=i,this.m_bForceSimplify=t,this.m_index=-1,this.m_inputGeometryCursor=e,this.m_spatialReference=r}next(){const e=this.m_inputGeometryCursor.next();return e?(i(e),this.m_index=this.m_inputGeometryCursor.getGeometryID(),this.simplify(e)):null}getGeometryID(){return this.m_index}tock(){return!1}getRank(){return 1}simplify(e){e||s("");return m(e,this.m_spatialReference,this.m_bForceSimplify,this.m_progressTracker)}}export{o as O};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{n as e,r}from"./SpatialReference.js";class t extends e{getOperatorType(){return 5}execute(e,t,a,s){return r(e,t,a,8,s)}}export{t as O};
|
package/chunks/OperatorWithin.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{n as e,r}from"./SpatialReference.js";class t extends e{getOperatorType(){return 7}execute(e,t,a,s){return r(e,t,a,2,s)}}export{t as O};
|
package/chunks/Point2D.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{t,g as s,q as i,a as e}from"./Geometry.js";class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=lt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let i;if(Math.abs(this.sum)>=Math.abs(t)){const e=this.sum-s+t;i=this.compensation+e}else{const e=t-s+this.sum;i=this.compensation+e}this.sum=s,this.compensation=i}sub(t){this.add(-t)}addProduct(t,s){const i=[0],e=ut(t,s,i);this.add(e),this.add(i[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=0x00000000ffffffffn,u=0x0000ffffn,h=0x000000ffn,a=0x0fn,o=0xffff0000n,m=0xff00n,l=0xf0n,c=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],f=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function _(t){let s=0;return t&u||(s+=16,t>>=16n),t&h||(s+=8,t>>=8n),t&a||(s+=4,t>>=4n),s+c[Number(BigInt.asUintN(4,t))]}function v(t){let s=0;return t&o&&(s+=16,t>>=16n),t&m&&(s+=8,t>>=8n),t&l&&(s+=4,t>>=4n),s+f[Number(BigInt.asUintN(4,t))]+1}function b(t){let s=0;return t&r||(s=32,t>>=32n),s+_(BigInt.asUintN(32,t))}function d(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+v(t)}class x{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof x)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new x(t,s)}static constructEmpty(){return new x}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return ls(this.vmin,t)&&ls(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,i=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(i)}mergeNe(t){const s=t.vmin,i=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(i)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=Pt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return Us(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){if(this.isEmpty())return Ls();return(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*Ls()}static unit(){return N}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=Pt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new x(this.vmin,this.vmax)}}const N=new x(0,1);class p{static getNAN(){return new p(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new p(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=p.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new p(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,i=this.m_eps+t.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}addThis(t){const s=this.m_value+t,i=this.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,i=this.m_eps+t.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}subThis(t){const s=this.m_value-t,i=this.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+p.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=p.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+p.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+p.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=p.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+p.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+p.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+p.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const i=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+p.ulp(i),this.m_value=i,this}setMul(t,s){return this.m_value=t*s,this.m_eps=p.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new p(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),i=this.m_value/t.m_value;let e=(this.m_eps+Math.abs(i)*t.m_eps)/s;if(t.m_eps>.01*s){const i=t.m_eps/s;e*=1+(1+i)*i}return this.m_value=i,this.m_eps=e+p.ulp(i),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+p.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=p.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(w.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=p.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+p.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=s;const e=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(i)+.5*e*t.m_eps)*t.m_eps+p.ulp(e+n),this}static ulp(t){let s=us(t);const i=((0x7ff0000000000000n&s)>>52n)-1075n;return i>-1023n?(s=i+0x3ffn<<52n,hs(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=i;const e=Math.abs(i),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*e*t.m_eps)*t.m_eps+p.ulp(e+n),this}static st_cosAndSin(t,s,i){const e=Math.sin(t.m_value),n=Math.cos(t.m_value);i.m_value=e,s.m_value=n;const r=Math.abs(e),u=Math.abs(n),h=Math.abs(t.value());i.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+p.ulp(r+h),s.m_eps=(Math.abs(e)+.5*u*t.m_eps)*t.m_eps+p.ulp(u+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return x.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(E)}setEuler(){this.set(2.718281828459045,M())}static size(){return 1}}function y(t,s){const i=as(t),e=as(s),n=53-b(i),r=53-b(e);return(n>=0?n:0)+(r>=0?r:0)<=52}function T(t,s){const i=t+s;return i-t===s&&i-s===t}function g(t,s){const i=t-s;return t-i===s&&s+i===t}function M(){return Qs()}p.dimensions=1;const E=new p(Math.PI,.5*M()),I=new p(0,0),w=new p(1,0),D=new p(4,0);function A(t,s,i){return t.addE(s.subE(t).mulE(i))}function P(t,s,i){return s.subE(s.subE(t).mulE(w.subE(i)))}function q(t){return Math.atanh(t)}function z(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=q(t)/t;else{let i;const e=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(e/Math.log(n)+2.5)-1;t>1;t-=2)i=1/t,s=(s+i)*n;s+=1}return s}function Z(t){const s=Math.PI*Math.PI/6;let i;if(1===t)i=s;else if(t>1)i=s;else if(0===t)i=t;else if(t<0){const s=1+(t=Math.abs(t)),e=Math.log(s);i=e*e/-2-Z(t/s)}else if(t>.5){const e=1-t,n=Math.log(t)*Math.log(e);i=s-Z(e)-n}else{i=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let e=s;for(let n=s;n>0;n--,e-=1)i*=t,i+=1/(e*e);i*=t}return i}function C(t,s){const i=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=i,s+=1/t/t;return s*=t,s}return Z(i)/s}function R(t,s){return t<s?$t(t,s):$t(s,t)}function B(t,s){const i=Math.abs(t);return s>=0?i:-i}function S(t){return Math.round(t)}function k(t,s,i,e,n){n[0]=s[0]+(i[0]-s[0])*e,n[1]=s[1]+(i[1]-s[1])*e,3===t&&(n[2]=s[2]+(i[2]-s[2])*e)}function F(t,s,i,e,n){n[0]=i[0]-(i[0]-s[0])*(1-e),n[1]=i[1]-(i[1]-s[1])*(1-e),3===t&&(n[2]=i[2]-(i[2]-s[2])*(1-e))}function L(t,s,i,e,n){e<=.5?k(t,s,i,e,n):F(t,s,i,e,n)}function O(t,s,i,e,n){n[0]=s[0].addE(i[0].subE(s[0]).mulE(e)),n[1]=s[1].addE(i[1].subE(s[1]).mulE(e))}function G(t,s,i,e,n){n[0]=i[0].subE(i[0].subE(s[0]).mulE(w.subE(e))),n[1]=i[1].subE(i[1].subE(s[1]).mulE(w.subE(e)))}function Q(t,s,i){let e;return e=i<=.5?t+(s-t)*i:s-(s-t)*(1-i),e}function V(t,s,i){return t+(s-t)*i}function U(t,s,i){return s-(s-t)*(1-i)}function Y(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i))}function j(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i,e.z=t.z+(s.z-t.z)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i),e.z=s.z-(s.z-t.z)*(1-i))}function H(t){return t*t}function $(t){return t*t*t}function J(t){return 1/Math.sqrt(t)}function K(t){return t<0?-1:t>0?1:0}function W(t,s,i,e){const n=[0],r=[0],u=[0];return lt(ut(t,i,n),ut(s,e,r),u)+(n[0]+r[0]+u[0])}const X=[0],tt=[0];function st(t,s,i){return mt(ut(t,s,X),i,X[0],tt)}const it=[0],et=[0],nt=[0],rt=[0];function ut(t,s,i){const e=t*s;return ht(t,it,et),ht(s,nt,rt),i[0]=et[0]*rt[0]-(e-it[0]*nt[0]-et[0]*nt[0]-it[0]*rt[0]),e}function ht(t,s,i){const e=134217729*t;s[0]=e-(e-t),i[0]=t-s[0]}const at=[0],ot=[0];function mt(t,s,i,e){const n=lt(t,s,at),r=lt(n,i,ot);return lt(r,at[0]+ot[0],e)}function lt(t,s,i){const e=t+s;return Math.abs(t)>Math.abs(s)?i[0]=t-e+s:i[0]=s-e+t,e}function ct(t,s){return t%s}function ft(t){const s=1-t;if(0===s)return 1;let i;if(s<=.01){const t=s,e=Math.log(t);i=1+t*(.4431471805599453-.25*e+t*(.05680519270997949-.09375*e+t*(.02183137044373718-.05859375*e+t*(.011544521417308362-.042724609375*e+t*(.00714200031339596-.0336456298828125*e+t*(.004854743337164948-.027757644653320312*e+t*(.003514687963781376-.023627042770385742*e)))))))}else{if(t<.016){const s=t,i=.25,e=.046875,n=.01953125,r=.01068115234375,u=.0067291259765625,h=.004626274108886719,a=.0033752918243408203,o=.0025710230693221092;return Js()*(1-s*(i+s*(e+s*(n+s*(r+s*(u+s*(h+s*(a+s*o))))))))}i=bt(0,s,1)-t*dt(0,s,1)/3}return Us(i,1,Js())}function _t(t,i,e=Number.NaN){if(s(i>=0&&i<=1),0===i)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===i){const t=Math.round(r/Hs()),s=r-t*Hs();return n*(2*t+Math.sin(s))}const u=Js(),h=Math.floor(r/u);1&h?r=(h+1)*u-r:r-=h*u;const a=Math.sin(r),o=Number.isNaN(e)?ft(i):e;let m;if(1===a)m=o+Math.sqrt(1-i)*(r-u);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*Qs()){m=r*(1+t*i*(-1/6+t*((4-3*i)/120-(16+(45*i-60)*i)/5040*t)))}else if(i<=.01){const t=Math.sin(2*r),s=Math.sin(4*r),e=Math.sin(6*r),n=Math.sin(8*r),u=Math.sin(10*r);m=r+i*((2*-r+t)/8+i*((-3*r+2*t-.25*s)/64+i*((-20*r+15*t-3*s+e/3)/1024+i*(5*(-140*r+112*t-28*s+16/3*e-.5*n)/65536+7*i*((-63*r+52.5*t-15*s+3.75*e-.625*n+.05*u)/65536+i*(-693*r+594*t-185.625*s+1.375*e-12.375*n+1.8*u-.125*Math.sin(12*r))/1048576)))))}else{const t=a*a,s=Math.cos(r),e=s*s,n=xt(a,s,i);m=a*(bt(e,n,1)-i*t*dt(e,n,1)/3)}}if(1&h){m=o*(h+1)-m}else m+=o*h;return n*m}function vt(t,s,i=Number.NaN){if(0===t)return 0;let e=1,n=t;t<0&&(n=-n,e=-1);const r=Number.isNaN(i)?ft(s):i,u=Math.floor(n/r);1&u?n=(u+1)*r-n:n-=u*r;let h=n<=0?0:n>=r?Js():Nt(n,s,r);return 1&u?h=Js()*(u+1)-h:h+=Js()*u,e*h}function bt(t,i,e){s((0!==t?1:0)+(0!==i?1:0)+1>1);let n=t,r=i,u=e;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*u)+Math.sqrt(u*n);n=.25*(n+t),r=.25*(r+t),u=.25*(u+t);const s=(n+r+u)/3,i=(s-n)/s,e=(s-r)/s,h=(s-u)/s;if(Math.abs(i)<=.0024&&Math.abs(e)<=.0024&&Math.abs(h)<=.0024){const t=i*e-h*h,n=i*e*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function dt(t,i,e){s(0!==t||0!==i);let r=t,u=i,h=e;const a=new n(0);let o=1;for(;;){const t=.2*(r+u+3*h),s=(t-r)/t,i=(t-u)/t,e=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(i)<=.0015&&Math.abs(e)<=.0015){const n=s*i,r=e*e,u=n-r,h=n-6*r,m=h+u+u,l=9/22,c=3/26,f=h*(.25*l*h-.21428571428571427-1.5*c*e*m),_=e*(1/6*m+e*(-l*u+e*c*n));return 3*a.getResult()+o*(1+f+_)/(t*Math.sqrt(t))}const n=Math.sqrt(r),m=Math.sqrt(u),l=Math.sqrt(h),c=n*(m+l)+m*l;a.add(o/(l*(h+c))),o*=.25,r=.25*(r+c),u=.25*(u+c),h=.25*(h+c)}}function xt(t,s,i){return t<.999?1-i*H(t):1-i+i*H(s)}function Nt(t,s,i){if(0===s)return t;if(1===s)return Math.asin(t);let e=0,n=!0;if(t<.2){const i=t*t,r=t*(1+i*s*(1/6+i*((13*s-4)/120+(16-284*s+493*s*s)/5040*i))),u=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(u<Math.abs(r)*Qs())return r;e=r,n=u>.1*r}if(n){const n=1-s,r=1-t/i,u=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+Qs());e=Js()+Math.sqrt(u)*(h-Js())}let r=0;for(let u=0;u<7;u++){r=_t(e,s,i);const n=xt(Math.sin(e),Math.cos(e),s);if(e-=(r-t)/Math.sqrt(n),u>0&&Math.abs(r-t)<=4*Qs()*t)break}return e}class pt{constructor(t){for(this.values=[[1]];this.values.length<t+1;){const t=this.values.at(-1),s=Yt(t.length+1,1);for(let i=1;i<t.length;++i)s[i]=t[i-1]+t[i];this.values.push(s)}}get(t,s){return this.values[t][s]}}function yt(t,i){return s(0),0}const Tt=new pt(32);function gt(t,s){if(t<Tt.values.length)return Tt.get(t,s);const e=Math.exp(yt());return e+.01>ds()&&i("The result value of n choose k is out of range"),e+.01}function Mt(t,s){if(t.isZero())return t.clone();const i=t.clone().divThis(t);if(s<0)return i.divThis(Mt(t,-s));for(t=t.clone(),s=Math.trunc(s);1&s&&i.mulThis(t),s>>=1;)t.mulThis(t);return i}function Et(t,s){if(0===s)return[];const i=t[0].clone().mulDoubleThis(0),e=[];e.length=s;const n=s-1;for(let r=0;r<=n;++r){e[r]=i.clone();for(let s=0;s<=r;++s)e[r].addThis(t[s].clone().mulDoubleThis(gt(r,s)/gt(n,s)))}return e}function It(s,i,e,n,r){return 0===s?0===n?i:1===n?e:r:1===s?0===n?i:1===n?e:Q(i,e,n):(2===s&&t("angular interpolation"),void t(""))}function wt(s,i,e,n,r,u,h,a){if(0===s)for(let t=0;t<u;++t)n[t+r]=0===h?i[t]:1===h?e[t]:a;else if(1===s)if(0===h)Dt(n,i,r,0,u);else if(1===h)Dt(n,e,r,0,u);else for(let t=0;t<u;++t)n[t+r]=Q(i[t],e[t],h);else if(2===s)if(0===h)Dt(n,i,r,0,u);else if(1===h)Dt(n,e,r,0,u);else{let t=0;for(let s=0,a=r;s<u;++s,++a)n[a]=Q(i[s],e[s],h),t+=n[a]*n[a];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+u;++s)n[s]/=t}else{for(let t=r;t<r+u;++t)n[t]=0;n[r]=1}}else t("")}function Dt(t,s,i,e,n){if(0===n)return;let r=0,u=i,h=e;for(;r++<n;)t[u++]=s[h++]}function At(t,s,i){let e=0;for(let n=0;!e&&n<i;++n)e=t[n]-s[n];return e}function Pt(t,s){return t}function qt(t){t.sort((t,s)=>t<s?-1:t>s?1:0)}function zt(t,s){const i=t.slice(0,s);qt(i),Dt(t,i,0,0,s)}function Zt(t,s,i,e){const n=t.slice(s,s+i);n.sort(e),Dt(t,n,s,0,i)}function Ct(t,s){return t<s?-1:t>s?1:0}function Rt(t,s,i,e){return t<i?-1:t>i?1:s<e?-1:s>e?1:0}function Bt(t,s){if(t.length<2)return t.length;let i=0;for(let e=1;e<t.length;++e)s(t[e],t[i])||(i++,t[e]=Pt(t[i],t[i]=t[e]));return 1+i}function St(t,s){t[s]=t.at(-1),t.pop()}function kt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function Ft(t,s,i){t.length=s,t.fill(i)}function Lt(t,s,i){t.length=i;for(let e=0;e<i;++e)t[e]=new s}function Ot(t,s){const i=new Array(s);for(let e=0;e<s;++e)i[e]=new t;return i}function Gt(t,s,i){for(let e=0;e<i;++e)t[e].assign(s[e]);return i}function Qt(t,s){const i=t.slice(0,s);for(let e=0;e<s;++e)i[e]=i[e].clone();return i}function Vt(t){return Array.from({length:t},()=>null)}function Ut(t,s){return Array.from({length:s},()=>t())}function Yt(t,s){const i=new Array(t);return i.fill(s),i}function jt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class Ht{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function $t(t,s){return{first:t,second:s}}const Jt=Math.PI,Kt=2*Math.PI,Wt=.5*Math.PI;class Xt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Yt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,i){this.m_v[t*this.m_cc+s]=i}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const ts=new ArrayBuffer(8),ss=new Float64Array(ts),is=new BigUint64Array(ts),es=0x0fffffffffffffn,ns=0x7ff0000000000000n;function rs(){return Number.EPSILON*Fs}function us(t){return ss[0]=t,is[0]}function hs(t){return is[0]=t,ss[0]}function as(t){return us(t)&es}function os(t){return Number((us(t)&ns)>>52n)}function ms(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,i=512n,e=1n<<s+i;for(;t>=e;)s+=i,i<<=1n,e<<=i;let n=s;i>>=1n;let r=n+i;for(;i>0n;)t<1n<<r||(n=r),i>>=1n,r=n+i;return n}function ls(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function cs(t,s,i){return t===s||Math.abs(t-s)<=i||Number.isNaN(t)&&Number.isNaN(s)}function fs(t,s){return t<s?-1:t>s?1:0}function _s(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const i=Number.isNaN(t),e=Number.isNaN(s);return i<e?-1:i>e?1:0}}function vs(){return 2147483647}function bs(){return 32767}function ds(){return 2147483647}function xs(){return-2147483648}const Ns=ds(),ps=BigInt(Ns),ys=2166136261,Ts=16777619;function gs(t){let s=ys,i=t;return s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,s&Ns}const Ms=14695981039346656037n,Es=1099511628211n;function Is(t){let s=Ms,i=t;return s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,s&ps}function ws(t){return 1103515245*t+12345&2147483647}function Ds(t){let s=ys;for(let i=0,e=t.length;i<e;++i)s=(s^t.charCodeAt(i))*Ts;return s&Ns}function As(t,s){return s+2654435769+(t<<6)+(t>>2)&Ns}function Ps(t,s){return As(t,Cs(s))}function qs(t){return As(3735928559,t)}function zs(t,s){return As(t,qs(s))}function Zs(t){return gs(t)}function Cs(t){return Number(Is(t))}function Rs(t){return Xs(t)}function Bs(t){return Cs(us(Rs(t)))}function Ss(t){return ws(t)}const ks=100,Fs=100;function Ls(){return Number.EPSILON*ks}function Os(){return.38196601125010515}function Gs(){return 1.4142135623730951}function Qs(){return Number.EPSILON}function Vs(t,s,i){return t===s||t===i}function Us(t,s,i){return t>=s?t<=i?t:i:s}function Ys(t,s,i){const e=t[0];if(e>=s){if(e<=i)return!1;t[0]=i}else t[0]=s;return!0}function js(t,s){return t>=s?s:t<-s?-s:t}function Hs(){return Jt}function $s(){return Kt}function Js(){return Wt}const Ks=3*Js();function Ws(){return Ks}function Xs(t){return t+0}function ti(t){return{v:t}}class si{constructor(){this.m_rn=ti(0n),this.m_rd=ti(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const i=t.clone();return void 0!==s&&i.limitPrecisionThis(s),i}static constructDouble(t){return(new si).setDouble(t)}static constructInt64(t){return(new si).setInt64(t)}static constructRational(t,s){return(new si).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new si).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(s){if(this.setZero(),0===s)return this;if(Number.isInteger(s)&&Math.abs(s)<ds())return this.setInt32(s);const i=us(s),e=(i&si.s_em)>>52n,n=!!(i&si.s_sm),r=i&si.s_fm;if(e===si.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===e&&t("denormalized numbers not yet implemented");const u=e-1023n,h=u>=0n?u:0n,a=u<0n?-u:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+a,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&(0n===this.m_rd.v&&1===this.m_sign)}isNegativeInf(){return!this.isNAN()&&(0n===this.m_rd.v&&-1===this.m_sign)}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return s(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(si.constructDouble(t))}thisMulInt64(t){return s(0),this}thisMulInt32(t){return s(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(si.constructDouble(t))}addDoubleThis(t){return this.addThis(si.constructDouble(t))}subDoubleThis(t){return this.subThis(si.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(si.constructInt64(t))}mulDouble(t){return this.clone().mulThis(si.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(si.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(si.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&(!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&(!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())))}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=_(BigInt.asUintN(32,s))-1;let i=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,i+=32;return s&=this.m_rd.v,s>>=BigInt(i),i+=_(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(i),this.m_power+=t-i,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=Pt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(ms(this.m_rn.v));if(s>t){const i=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=i}if(s=Number(ms(this.m_rd.v)),s>t){const i=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=i}return this}hiBitIndex(){return Math.max(Number(ms(this.m_rn.v)),Number(ms(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}static lerp(t,s,i){return si.lerpLo(s,s,i)}static lerpLo(t,s,i){return s.sub(t).mulThis(i).addThis(t)}static lerpHi(t,s,i){return s.sub(t).mulThis(ii.sub(i)).addThis(t)}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,e){if(t.m_sign<0n&&i("MP_value: sqrt(-1)"),t.isZero())return t.clone();let n=52,r=2220446049250313e-31;for(;n<e;)2*n<=e?(r*=r,n*=2):(r*=2220446049250313e-31,n+=52);n+=52;const u=ms(t.m_rn.v),h=ms(t.m_rd.v);let a,o=t.m_power+Number(u-h);const m=new si;Math.abs(o)>200?(1&Math.abs(o)&&(o+=1),a=si.constructAssign(t,53).ldexpThis(-o).value(),m.setThis(t).ldexpThis(-o),s(Number.isFinite(a))):(m.setThis(t),a=m.value(),s(Number.isFinite(a)),o=0),a=Math.sqrt(a);const l=si.constructDouble(a),c=si.constructDouble(r);c.mulThis(l).ldexpThis(1);const f=r*a*2,_=l.clone(),v=new si;let b;for(let s=0;s<10;++s){_.mulThis(l),v.setThis(m).subThis(_).absThis();let t=v.value();if(b=1,t<.9)for(;t>f;)t*=t,++b;else b=4;if(v.lte(c))break;for(let s=0;s<b;s++)_.setThis(l).divThis(m).invertThis().addThis(l).ldexpThis(-1).limitPrecisionThis(n),l.setThis(_)}return l.ldexpThis(o/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let i=52,e=2220446049250313e-31;for(;i<s;)2*i<=s?(e*=e,i*=2):(e*=2220446049250313e-31,i+=52);i+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=si.constructDouble(n),u=r.clone();u.sqrThis().mulDoubleThis(3).mulDoubleThis(e),u.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let h=0;h<10;++h){const s=r.clone();s.sqrThis().mulThis(r);const e=s.clone();if(e.subThis(t),e.absThis().limitPrecisionThis(32),e.lte(u))break;e.setThis(t),e.ldexpThis(1),e.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),e.divThis(n),r.mulThis(e),r.limitPrecisionThis(i)}return r}isInTheRangeOfDouble(){return s(0),!1}sign(){return this.m_sign}cosAndSin(t,i){s(0)}pow(t){return Mt(this,t)}static nan(){return s(0),new si}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let i=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const e=s/i;let n=Number(e);if(BigInt(n)!==e)return t?-n:n;let r=s-e*i;if(r){let t=ms(i)-1023n;t>0n&&(i>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52));n+=s/Number(i)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const i=Math.min(this.m_power,t.m_power);let e,n;this.m_power>i?(e=BigInt(this.m_power-i),n=0n):(e=0n,n=BigInt(t.m_power-i));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<e,u=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+u:r-u,this.m_rd.v*=t.m_rd.v,this.m_power=i,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}si.s_sm=0x8000000000000000n,si.s_em=0x7ff0000000000000n,si.s_fm=0x000fffffffffffffn,si.s_emax=0x7ffn;const ii=si.constructInt32(1),ei=si.constructInt32(0),ni=si.constructDouble(.5);function ri(t,s){return d(t^s)}function ui(t,s){let i=os(t);const e=os(s);if(i===e){return i-=53-ri(as(t),as(s)),i}return i>e?i:e}function hi(t,s){for(let i=0,e=0,n=t.length;i<n;i+=2,e++)s[e].x=t[i],s[e].y=t[i+1]}function ai(t){const s=new Float64Array(2*t.length);for(let i=0,e=t.length;i<e;++i){const e=i<<1;s[e]=t[i].x,s[e+1]=t[i].y}return s}function oi(t){const s=Ot(mi,t.length);for(let i=0,e=t.length;i<e;++i)s[i].setCoords(t[i][0],t[i][1]);return s}class mi{static construct(t,s){return new mi(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new mi(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,i){return void 0!==i?Math.abs(this.x-t)<=i&&Math.abs(this.y-s)<=i:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return s(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,i,e){s(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,i){this.x=s.x*t+i.x,this.y=s.y*t+i.y}scaleOther(t,i){s(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){s(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,i){return s(0),{}}static average(t,s){const i=new mi;if(0===s)return i.setNAN(),i;if(1===s)return i.assign(t[0]),i;const e=new n(t[0].x),r=new n(t[0].y);for(let n=1;n<s;n++)e.add(t[n].x),r.add(t[n].y),255&n||(e.normalize(),r.normalize());return i.x=e.getResult()/s,i.y=r.getResult()/s,i}static calculateLength(t,s){const i=new n(0);for(let e=1;e<s;e++)i.add(mi.distance(t[e],t[e-1]));return i.getResult()}offset(t,s){const i=mi.distance(t,s),e=mi.construct(this.x,this.y);if(0===i)return mi.distance(e,t);const n=s.clone();n.subThis(t),e.subThis(t);return e.crossProduct(n)/i}side(t,s){return t.equals(s)?this.equals(t)?0:1:mi.orientationRobust(s,t,this)}static sqrDistance(t,s){const i=t.x-s.x,e=t.y-s.y;return i*i+e*e}static sqrDistanceCoords(t,s,i,e){const n=i-t,r=e-s;return n*n+r*r}static distance(t,s){return Math.sqrt(mi.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return s(0),0}rotateDirect(t,s){const i=this.x*t-this.y*s,e=this.x*s+this.y*t;this.x=i,this.y=e}rotateReverse(t,s){const i=this.x*t+this.y*s,e=-this.x*s+this.y*t;this.x=i,this.y=e}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new mi(this.x+t.x,this.y+t.y)}sub(t){return new mi(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new mi(-this.x,-this.y)}mul(t){return new mi(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new mi(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new mi(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),i=t-s;return i>=0?t:i<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:e("norm")}}getQuarter(){return mi.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const i=t.getQuarter(),e=s.getQuarter();return e===i?mi.orientationRobustImpl(mi.construct(0,0),s,t,!0):i<e?-1:1}static compareVectorsOrigin(t,s,i){const e=s.sub(t),n=i.sub(t),r=e.getQuarter(),u=n.getQuarter();return u===r?mi.orientationRobustImpl(t,i,s,!0):r<u?-1:1}static orientationRobust(t,s,i){return mi.orientationRobustImpl(t,s,i,!1)}static orientationRobustEx(t,s,i,e){if(t.equals(s)||i.equals(e))return 0;const n=s.x-t.x,r=s.y-t.y,u=e.x-i.x,h=e.y-i.y;{const t=mi.getQuarterCoords(n,r)-1,s=mi.getQuarterCoords(u,h)-1,i=mi.d[t][s];if(0!==i)return i}const a=n*h,o=r*u,m=4*Qs()*(Math.abs(a)+Math.abs(o)),l=a-o;if(Math.abs(l)>=m){return l<0?-1:l>0?1:0}return mi.orientationRobustExMp(t,s,i,e)}static orientationRobustExMp(t,s,i,e){const n=si.constructDouble(s.x),r=si.constructDouble(e.x);n.subThis(si.constructDouble(t.x)),r.subThis(si.constructDouble(i.x));const u=si.constructDouble(s.y),h=si.constructDouble(e.y);return u.subThis(si.constructDouble(t.y)),h.subThis(si.constructDouble(i.y)),n.mulThis(h),u.mulThis(r),n.subThis(u),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,i){const e=s.sub(t).crossProduct(i.sub(t));return e<0?-1:e>0?1:0}static orientationRobustImpl(t,s,i,e){if(s.isEqualPoint2D(t)||i.isEqualPoint2D(t)||s.isEqualPoint2D(i))return 0;const n=s.x-t.x,r=s.y-t.y,u=i.x-t.x,h=i.y-t.y;if(!e){const t=mi.getQuarterCoords(n,r)-1,s=mi.getQuarterCoords(u,h)-1,i=mi.d[t][s];if(0!==i)return i}const a=(Math.abs(n)+Math.abs(r)+Math.abs(u)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(i.x)+Math.abs(i.y))*8*M(),o=n*h-r*u;if(Math.abs(o)>a){return o<0?-1:1}if(g(s.x,t.x)&&g(i.y,t.y)&&g(s.y,t.y)&&g(i.x,t.x)&&y(n,h)&&y(r,u)){const t=n*h,s=r*u;if(g(t,s)){const i=t-s;return i<0?-1:i>0?1:0}}return mi.orientationRobustMp(t,s,i)}static orientationRobustMp(t,s,i){const e=si.constructDouble(s.x),n=si.constructDouble(i.x);{const s=si.constructDouble(t.x);e.subThis(s),n.subThis(s)}const r=si.constructDouble(i.y),u=si.constructDouble(s.y);{const s=si.constructDouble(t.y);r.subThis(s),u.subThis(s)}return e.mulThis(r),u.mulThis(n),e.subThis(u),e.LZ()?-1:e.GZ()?1:0}static inCircleRobust(t,s,i,e){const n=new p,r=new p;n.set(t.x),n.subThis(e.x),r.set(t.y),r.subThis(e.y);const u=new p,h=new p;u.set(s.x),u.subThis(e.x),h.set(s.y),h.subThis(e.y);const a=new p,o=new p;a.set(i.x),a.subThis(e.x),o.set(i.y),o.subThis(e.y);const m=n.mulE(h).subE(r.mulE(u)),l=u.mulE(o).subE(h.mulE(a)),c=n.mulE(o).subE(r.mulE(a)),f=n.mulE(n).addE(r.mulE(r)),_=u.mulE(u).addE(h.mulE(h)),v=a.mulE(a).addE(o.mulE(o)),b=f.mulE(l).subE(_.mulE(c)).addE(v.mulE(m));if(!b.isFuzzyZero()){const t=b.value();return t<0?-1:t>0?1:0}return mi.inCircleRobustMp(t,s,i,e)}static inCircleRobustMp(t,s,i,e){do{if(!g(t.x,e.x)||!g(t.y,e.y))break;if(!g(s.x,e.x)||!g(s.y,e.y))break;if(!g(i.x,e.x)||!g(i.y,e.y))break;const n=t.x-e.x,r=t.y-e.y,u=s.x-e.x,h=s.y-e.y,a=i.x-e.x,o=i.y-e.y;if(!y(n,h)||!y(r,u))break;if(!y(u,o)||!y(h,a))break;if(!y(n,o)||!y(r,a))break;if(!y(n,n)||!y(r,r))break;if(!y(u,u)||!y(h,h))break;if(!y(a,a)||!y(o,o))break;const m=n*h,l=r*u,c=u*o,f=h*a,_=n*o,v=r*a,b=n*n,d=r*r,x=u*u,N=h*h,p=a*a,M=o*o;if(!g(m,l))break;if(!g(c,f))break;if(!g(_,v))break;if(!T(b,d))break;if(!T(x,N))break;if(!T(p,M))break;const E=m-l,I=c-f,w=_-v,D=b+d,A=x+N,P=p+M;if(!y(D,I))break;if(!y(A,w))break;if(!y(P,E))break;const q=D*I,z=A*w,Z=P*E;if(!g(q,z))break;const C=q-z;if(!T(C,Z))break;const R=C+Z;return R<0?-1:R>0?1:0}while(0);const n=si.constructDouble(e.x),r=si.constructDouble(e.y),u=si.constructDouble(t.x),h=si.constructDouble(t.y);u.subThis(n),h.subThis(r);const a=si.constructDouble(s.x),o=si.constructDouble(s.y);a.subThis(n),o.subThis(r);const m=si.constructDouble(i.x),l=si.constructDouble(i.y);m.subThis(n),l.subThis(r);const c=u.mul(o).sub(h.mul(a)),f=a.mul(l).sub(o.mul(m)),_=u.mul(l).sub(h.mul(m)),v=u.mul(u).add(h.mul(h)),b=a.mul(a).add(o.mul(o)),d=m.mul(m).add(l.mul(l)),x=v.mul(f).sub(b.mul(_)).add(d.mul(c));return x.LZ()?-1:x.GZ()?1:0}static inCircleRobustMp3Point(t,s,i){const e=si.constructDouble(t.x),n=si.constructDouble(t.y),r=si.constructDouble(s.x),u=si.constructDouble(s.y),h=si.constructDouble(i.x),a=si.constructDouble(i.y),o=h.mul(h).add(a.mul(a)).sub(h.mul(e).add(a.mul(n)).add(h.mul(r)).add(a.mul(u))).add(e.mul(r).add(n.mul(u)));return o.LZ()?-1:o.GZ()?1:0}static inCircleRobust3Point(t,s,i){const e=new p(t.x),n=new p(t.y),r=new p(s.x),u=new p(s.y),h=new p(i.x),a=new p(i.y),o=h.mulE(h).addE(a.mulE(a)).subE(h.mulE(e).addE(a.mulE(n)).addE(h.mulE(r)).addE(a.mulE(u))).addE(e.mulE(r).addE(n.mulE(u)));if(!o.isFuzzyZero()){const t=o.value();return t<0?-1:t>0?1:0}return mi.inCircleRobustMp3Point(t,s,i)}static calculateCircleCenterFromThreePoints(t,s,i){if(t.equals(i)||t.equals(s)||i.equals(s))return mi.getNAN();const e=li(t,s,i);return e.isNAN()?ci(t,s,i):e}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,i,e){return s(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const i=mi.c_compare_zorder_xx[t.x<0?1:0]|mi.c_compare_zorder_yy[t.y<0?1:0],e=mi.c_compare_zorder_xx[s.x<0?1:0]|mi.c_compare_zorder_yy[s.y<0?1:0];if(i===e){let i=0,e=0;for(let n=0;n<2;++n){const r=ui(t[n],s[n]);r>i&&(i=r,e=n)}return t[e]<s[e]}return i<e}static lerp(t,s,i){const e=new mi;return Y(t,s,i,e),e}static getClosestCoordinate(t,s,i,e=!1){const n=mi.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(i))return 1;const u=mi.getNAN();u.setSub(i,t);let h=u.dotProduct(n)/r;return e||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,i,e){if(t.equals(s)||i.equals(e))return mi.getNAN();const n=s.x-t.x,r=i.x-e.x,u=s.y-t.y,h=i.y-e.y,a=n*h-r*u;if(!a)return mi.getNAN();const o=a;if(0===o)return mi.getNAN();let m=(i.x-t.x)*h-(i.y-t.y)*r;m/=o;const l=new mi;return Y(t,s,m,l),l.isFinite()?l:mi.getNAN()}toString(){return`[${this.x},${this.y}]`}}function li(t,s,i){const e=new p(s.x);e.subThis(t.x);const n=new p(s.y);n.subThis(t.y);const r=new p(i.x);r.subThis(t.x);const u=new p(i.y);u.subThis(t.y);const h=e.clone();h.mulThisE(u);let a=n.clone();if(a.mulThisE(r),h.subThisE(a),0===h.value())return mi.getNAN();h.mulThis(2);const o=e.clone();o.mulThisE(e);const m=n.clone();m.mulThisE(n);const l=o.clone();l.addThisE(m);const c=r.clone();c.mulThisE(r);const f=u.clone();f.mulThisE(u);const _=c.clone();_.addThisE(f);const v=n.clone();v.mulThisE(_),a=u.clone(),a.mulThisE(l),v.subThisE(a),v.divThisE(h);const b=e.clone();b.mulThisE(_),a=r.clone(),a.mulThisE(l),b.subThisE(a),b.divThisE(h);const d=mi.construct(t.x-v.value(),t.y+b.value()),x=t.sub(d).length(),N=s.sub(d).length(),y=i.sub(d).length(),T=1e-15*(x+Math.abs(t.x)+Math.abs(s.x)+Math.abs(i.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(i.y));return Math.abs(x-N)<=T&&Math.abs(x-y)<=T&&v.eps()<T&&b.eps()<T?d:mi.getNAN()}function ci(t,s,i){const e=si.constructDouble(s.x);e.subDoubleThis(t.x);const n=si.constructDouble(s.y);n.subDoubleThis(t.y);const r=si.constructDouble(i.x);r.subDoubleThis(t.x);const u=si.constructDouble(i.y);u.subDoubleThis(t.y);const h=e.clone();h.mulThis(u);let a=n.clone();if(a.mulThis(r),h.subThis(a),h.isZero())return mi.getNAN();h.mulDoubleThis(2);const o=e.clone();o.mulThis(e);const m=n.clone();m.mulThis(n);const l=o.clone();l.addThis(m);const c=r.clone();c.mulThis(r);const f=u.clone();f.mulThis(u);const _=c.clone();_.addThis(f);const v=n.clone();v.mulThis(_),a=u.clone(),a.mulThis(l),v.subThis(a),v.divThis(h);const b=e.clone();b.mulThis(_),a=r.clone(),a.mulThis(l),b.subThis(a),b.divThis(h);return mi.construct(t.x-v.value(),t.y+b.value())}mi.dimensions=2,mi.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],mi.c_compare_zorder_xx=[2,0],mi.c_compare_zorder_yy=[1,0];export{hi as $,As as A,Zs as B,Vt as C,Gt as D,x as E,ls as F,S as G,Qs as H,St as I,Ps as J,n as K,Y as L,si as M,Ds as N,Ss as O,mi as P,oi as Q,Ct as R,Ht as S,bs as T,I as U,Ys as V,R as W,p as X,zs as Y,rs as Z,ai as _,H as a,Bs as a0,Os as a1,qs as a2,Gs as a3,fs as a4,cs as a5,w as a6,Qt as a7,Vs as a8,wt as a9,ei as aA,ii as aB,Et as aC,Xs as aD,Rt as aE,st as aF,$ as aG,gt as aH,J as aI,xs as aJ,At as aK,Zt as aa,Xt as ab,Js as ac,It as ad,jt as ae,V as af,U as ag,zt as ah,L as ai,Hs as aj,js as ak,Ws as al,k as am,F as an,O as ao,G as ap,D as aq,ni as ar,$s as as,_t as at,vt as au,Lt as av,A as aw,P as ax,ft as ay,Jt as az,Dt as b,Pt as c,Yt as d,K as e,B as f,Ls as g,kt as h,ds as i,vs as j,Ut as k,$t as l,Ot as m,ct as n,Wt as o,Kt as p,Q as q,_s as r,Us as s,W as t,Bt as u,qt as v,Ft as w,j as x,z as y,C as z};
|
|
5
|
+
import{t,g as s,q as i,a as e}from"./Geometry.js";class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=lt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let i;if(Math.abs(this.sum)>=Math.abs(t)){const e=this.sum-s+t;i=this.compensation+e}else{const e=t-s+this.sum;i=this.compensation+e}this.sum=s,this.compensation=i}sub(t){this.add(-t)}addProduct(t,s){const i=[0],e=ut(t,s,i);this.add(e),this.add(i[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=0x00000000ffffffffn,u=0x0000ffffn,h=0x000000ffn,a=0x0fn,o=0xffff0000n,m=0xff00n,l=0xf0n,c=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],f=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function _(t){let s=0;return t&u||(s+=16,t>>=16n),t&h||(s+=8,t>>=8n),t&a||(s+=4,t>>=4n),s+c[Number(BigInt.asUintN(4,t))]}function v(t){let s=0;return t&o&&(s+=16,t>>=16n),t&m&&(s+=8,t>>=8n),t&l&&(s+=4,t>>=4n),s+f[Number(BigInt.asUintN(4,t))]+1}function b(t){let s=0;return t&r||(s=32,t>>=32n),s+_(BigInt.asUintN(32,t))}function d(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+v(t)}class x{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof x)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new x(t,s)}static constructEmpty(){return new x}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return ls(this.vmin,t)&&ls(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,i=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(i)}mergeNe(t){const s=t.vmin,i=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(i)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=Pt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return Us(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){if(this.isEmpty())return Ls();return(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*Ls()}static unit(){return N}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=Pt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new x(this.vmin,this.vmax)}}const N=new x(0,1);class p{static getNAN(){return new p(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new p(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=p.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new p(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,i=this.m_eps+t.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}addThis(t){const s=this.m_value+t,i=this.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,i=this.m_eps+t.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}subThis(t){const s=this.m_value-t,i=this.m_eps+p.ulp(s);return this.m_value=s,this.m_eps=i,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+p.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=p.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+p.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+p.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=p.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+p.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+p.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+p.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+p.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const i=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+p.ulp(i),this.m_value=i,this}setMul(t,s){return this.m_value=t*s,this.m_eps=p.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new p(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),i=this.m_value/t.m_value;let e=(this.m_eps+Math.abs(i)*t.m_eps)/s;if(t.m_eps>.01*s){const i=t.m_eps/s;e*=1+(1+i)*i}return this.m_value=i,this.m_eps=e+p.ulp(i),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+p.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=p.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(w.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=p.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+p.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=s;const e=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(i)+.5*e*t.m_eps)*t.m_eps+p.ulp(e+n),this}static ulp(t){let s=us(t);const i=((0x7ff0000000000000n&s)>>52n)-1075n;return i>-1023n?(s=i+0x3ffn<<52n,hs(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=i;const e=Math.abs(i),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*e*t.m_eps)*t.m_eps+p.ulp(e+n),this}static st_cosAndSin(t,s,i){const e=Math.sin(t.m_value),n=Math.cos(t.m_value);i.m_value=e,s.m_value=n;const r=Math.abs(e),u=Math.abs(n),h=Math.abs(t.value());i.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+p.ulp(r+h),s.m_eps=(Math.abs(e)+.5*u*t.m_eps)*t.m_eps+p.ulp(u+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return x.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(E)}setEuler(){this.set(2.718281828459045,M())}static size(){return 1}}function y(t,s){const i=as(t),e=as(s),n=53-b(i),r=53-b(e);return(n>=0?n:0)+(r>=0?r:0)<=52}function T(t,s){const i=t+s;return i-t===s&&i-s===t}function g(t,s){const i=t-s;return t-i===s&&s+i===t}function M(){return Qs()}p.dimensions=1;const E=new p(Math.PI,.5*M()),I=new p(0,0),w=new p(1,0),D=new p(4,0);function A(t,s,i){return t.addE(s.subE(t).mulE(i))}function P(t,s,i){return s.subE(s.subE(t).mulE(w.subE(i)))}function q(t){return Math.atanh(t)}function z(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=q(t)/t;else{let i;const e=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(e/Math.log(n)+2.5)-1;t>1;t-=2)i=1/t,s=(s+i)*n;s+=1}return s}function Z(t){const s=Math.PI*Math.PI/6;let i;if(1===t)i=s;else if(t>1)i=s;else if(0===t)i=t;else if(t<0){const s=1+(t=Math.abs(t)),e=Math.log(s);i=e*e/-2-Z(t/s)}else if(t>.5){const e=1-t,n=Math.log(t)*Math.log(e);i=s-Z(e)-n}else{i=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let e=s;for(let n=s;n>0;n--,e-=1)i*=t,i+=1/(e*e);i*=t}return i}function C(t,s){const i=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=i,s+=1/t/t;return s*=t,s}return Z(i)/s}function R(t,s){return t<s?$t(t,s):$t(s,t)}function B(t,s){const i=Math.abs(t);return s>=0?i:-i}function S(t){return Math.round(t)}function k(t,s,i,e,n){n[0]=s[0]+(i[0]-s[0])*e,n[1]=s[1]+(i[1]-s[1])*e,3===t&&(n[2]=s[2]+(i[2]-s[2])*e)}function F(t,s,i,e,n){n[0]=i[0]-(i[0]-s[0])*(1-e),n[1]=i[1]-(i[1]-s[1])*(1-e),3===t&&(n[2]=i[2]-(i[2]-s[2])*(1-e))}function L(t,s,i,e,n){e<=.5?k(t,s,i,e,n):F(t,s,i,e,n)}function O(t,s,i,e,n){n[0]=s[0].addE(i[0].subE(s[0]).mulE(e)),n[1]=s[1].addE(i[1].subE(s[1]).mulE(e))}function G(t,s,i,e,n){n[0]=i[0].subE(i[0].subE(s[0]).mulE(w.subE(e))),n[1]=i[1].subE(i[1].subE(s[1]).mulE(w.subE(e)))}function Q(t,s,i){let e;return e=i<=.5?t+(s-t)*i:s-(s-t)*(1-i),e}function V(t,s,i){return t+(s-t)*i}function U(t,s,i){return s-(s-t)*(1-i)}function Y(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i))}function j(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i,e.z=t.z+(s.z-t.z)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i),e.z=s.z-(s.z-t.z)*(1-i))}function H(t){return t*t}function $(t){return t*t*t}function J(t){return 1/Math.sqrt(t)}function K(t){return t<0?-1:t>0?1:0}function W(t,s,i,e){const n=[0],r=[0],u=[0];return lt(ut(t,i,n),ut(s,e,r),u)+(n[0]+r[0]+u[0])}const X=[0],tt=[0];function st(t,s,i){return mt(ut(t,s,X),i,X[0],tt)}const it=[0],et=[0],nt=[0],rt=[0];function ut(t,s,i){const e=t*s;return ht(t,it,et),ht(s,nt,rt),i[0]=et[0]*rt[0]-(e-it[0]*nt[0]-et[0]*nt[0]-it[0]*rt[0]),e}function ht(t,s,i){const e=134217729*t;s[0]=e-(e-t),i[0]=t-s[0]}const at=[0],ot=[0];function mt(t,s,i,e){const n=lt(t,s,at),r=lt(n,i,ot);return lt(r,at[0]+ot[0],e)}function lt(t,s,i){const e=t+s;return Math.abs(t)>Math.abs(s)?i[0]=t-e+s:i[0]=s-e+t,e}function ct(t,s){return t%s}function ft(t){const s=1-t;if(0===s)return 1;let i;if(s<=.01){const t=s,e=Math.log(t);i=1+t*(.4431471805599453-.25*e+t*(.05680519270997949-.09375*e+t*(.02183137044373718-.05859375*e+t*(.011544521417308362-.042724609375*e+t*(.00714200031339596-.0336456298828125*e+t*(.004854743337164948-.027757644653320312*e+t*(.003514687963781376-.023627042770385742*e)))))))}else{if(t<.016){const s=t,i=.25,e=.046875,n=.01953125,r=.01068115234375,u=.0067291259765625,h=.004626274108886719,a=.0033752918243408203,o=.0025710230693221092;return Js()*(1-s*(i+s*(e+s*(n+s*(r+s*(u+s*(h+s*(a+s*o))))))))}i=bt(0,s,1)-t*dt(0,s,1)/3}return Us(i,1,Js())}function _t(t,i,e=Number.NaN){if(s(i>=0&&i<=1),0===i)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===i){const t=Math.round(r/Hs()),s=r-t*Hs();return n*(2*t+Math.sin(s))}const u=Js(),h=Math.floor(r/u);1&h?r=(h+1)*u-r:r-=h*u;const a=Math.sin(r),o=Number.isNaN(e)?ft(i):e;let m;if(1===a)m=o+Math.sqrt(1-i)*(r-u);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*Qs()){m=r*(1+t*i*(-1/6+t*((4-3*i)/120-(16+(45*i-60)*i)/5040*t)))}else if(i<=.01){const t=Math.sin(2*r),s=Math.sin(4*r),e=Math.sin(6*r),n=Math.sin(8*r),u=Math.sin(10*r);m=r+i*((2*-r+t)/8+i*((-3*r+2*t-.25*s)/64+i*((-20*r+15*t-3*s+e/3)/1024+i*(5*(-140*r+112*t-28*s+16/3*e-.5*n)/65536+7*i*((-63*r+52.5*t-15*s+3.75*e-.625*n+.05*u)/65536+i*(-693*r+594*t-185.625*s+1.375*e-12.375*n+1.8*u-.125*Math.sin(12*r))/1048576)))))}else{const t=a*a,s=Math.cos(r),e=s*s,n=xt(a,s,i);m=a*(bt(e,n,1)-i*t*dt(e,n,1)/3)}}if(1&h){m=o*(h+1)-m}else m+=o*h;return n*m}function vt(t,s,i=Number.NaN){if(0===t)return 0;let e=1,n=t;t<0&&(n=-n,e=-1);const r=Number.isNaN(i)?ft(s):i,u=Math.floor(n/r);1&u?n=(u+1)*r-n:n-=u*r;let h=n<=0?0:n>=r?Js():Nt(n,s,r);return 1&u?h=Js()*(u+1)-h:h+=Js()*u,e*h}function bt(t,i,e){s((0!==t?1:0)+(0!==i?1:0)+1>1);let n=t,r=i,u=e;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*u)+Math.sqrt(u*n);n=.25*(n+t),r=.25*(r+t),u=.25*(u+t);const s=(n+r+u)/3,i=(s-n)/s,e=(s-r)/s,h=(s-u)/s;if(Math.abs(i)<=.0024&&Math.abs(e)<=.0024&&Math.abs(h)<=.0024){const t=i*e-h*h,n=i*e*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function dt(t,i,e){s(0!==t||0!==i);let r=t,u=i,h=e;const a=new n(0);let o=1;for(;;){const t=.2*(r+u+3*h),s=(t-r)/t,i=(t-u)/t,e=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(i)<=.0015&&Math.abs(e)<=.0015){const n=s*i,r=e*e,u=n-r,h=n-6*r,m=h+u+u,l=9/22,c=3/26,f=h*(.25*l*h-.21428571428571427-1.5*c*e*m),_=e*(1/6*m+e*(-l*u+e*c*n));return 3*a.getResult()+o*(1+f+_)/(t*Math.sqrt(t))}const n=Math.sqrt(r),m=Math.sqrt(u),l=Math.sqrt(h),c=n*(m+l)+m*l;a.add(o/(l*(h+c))),o*=.25,r=.25*(r+c),u=.25*(u+c),h=.25*(h+c)}}function xt(t,s,i){return t<.999?1-i*H(t):1-i+i*H(s)}function Nt(t,s,i){if(0===s)return t;if(1===s)return Math.asin(t);let e=0,n=!0;if(t<.2){const i=t*t,r=t*(1+i*s*(1/6+i*((13*s-4)/120+(16-284*s+493*s*s)/5040*i))),u=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(u<Math.abs(r)*Qs())return r;e=r,n=u>.1*r}if(n){const n=1-s,r=1-t/i,u=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+Qs());e=Js()+Math.sqrt(u)*(h-Js())}let r=0;for(let u=0;u<7;u++){r=_t(e,s,i);const n=xt(Math.sin(e),Math.cos(e),s);if(e-=(r-t)/Math.sqrt(n),u>0&&Math.abs(r-t)<=4*Qs()*t)break}return e}class pt{constructor(t){for(this.values=[[1]];this.values.length<t+1;){const t=this.values.at(-1),s=Yt(t.length+1,1);for(let i=1;i<t.length;++i)s[i]=t[i-1]+t[i];this.values.push(s)}}get(t,s){return this.values[t][s]}}function yt(t,i){return s(0),0}const Tt=new pt(32);function gt(t,s){if(t<Tt.values.length)return Tt.get(t,s);const e=Math.exp(yt());return e+.01>ds()&&i("The result value of n choose k is out of range"),e+.01}function Mt(t,s){if(t.isZero())return t.clone();const i=t.clone().divThis(t);if(s<0)return i.divThis(Mt(t,-s));for(t=t.clone(),s=Math.trunc(s);1&s&&i.mulThis(t),s>>=1;)t.mulThis(t);return i}function Et(t,s){if(0===s)return[];const i=t[0].clone().mulDoubleThis(0),e=[];e.length=s;const n=s-1;for(let r=0;r<=n;++r){e[r]=i.clone();for(let s=0;s<=r;++s)e[r].addThis(t[s].clone().mulDoubleThis(gt(r,s)/gt(n,s)))}return e}function It(s,i,e,n,r){return 0===s?0===n?i:1===n?e:r:1===s?0===n?i:1===n?e:Q(i,e,n):(2===s&&t("angular interpolation"),void t(""))}function wt(s,i,e,n,r,u,h,a){if(0===s)for(let t=0;t<u;++t)n[t+r]=0===h?i[t]:1===h?e[t]:a;else if(1===s)if(0===h)Dt(n,i,r,0,u);else if(1===h)Dt(n,e,r,0,u);else for(let t=0;t<u;++t)n[t+r]=Q(i[t],e[t],h);else if(2===s)if(0===h)Dt(n,i,r,0,u);else if(1===h)Dt(n,e,r,0,u);else{let t=0;for(let s=0,a=r;s<u;++s,++a)n[a]=Q(i[s],e[s],h),t+=n[a]*n[a];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+u;++s)n[s]/=t}else{for(let t=r;t<r+u;++t)n[t]=0;n[r]=1}}else t("")}function Dt(t,s,i,e,n){if(0===n)return;let r=0,u=i,h=e;for(;r++<n;)t[u++]=s[h++]}function At(t,s,i){let e=0;for(let n=0;!e&&n<i;++n)e=t[n]-s[n];return e}function Pt(t,s){return t}function qt(t){t.sort((t,s)=>t<s?-1:t>s?1:0)}function zt(t,s){const i=t.slice(0,s);qt(i),Dt(t,i,0,0,s)}function Zt(t,s,i,e){const n=t.slice(s,s+i);n.sort(e),Dt(t,n,s,0,i)}function Ct(t,s){return t<s?-1:t>s?1:0}function Rt(t,s,i,e){return t<i?-1:t>i?1:s<e?-1:s>e?1:0}function Bt(t,s){if(t.length<2)return t.length;let i=0;for(let e=1;e<t.length;++e)s(t[e],t[i])||(i++,t[e]=Pt(t[i],t[i]=t[e]));return 1+i}function St(t,s){t[s]=t.at(-1),t.pop()}function kt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function Ft(t,s,i){t.length=s,t.fill(i)}function Lt(t,s,i){t.length=i;for(let e=0;e<i;++e)t[e]=new s}function Ot(t,s){const i=new Array(s);for(let e=0;e<s;++e)i[e]=new t;return i}function Gt(t,s,i){for(let e=0;e<i;++e)t[e].assign(s[e]);return i}function Qt(t,s){const i=t.slice(0,s);for(let e=0;e<s;++e)i[e]=i[e].clone();return i}function Vt(t){return Array.from({length:t},()=>null)}function Ut(t,s){return Array.from({length:s},()=>t())}function Yt(t,s){const i=new Array(t);return i.fill(s),i}function jt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class Ht{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function $t(t,s){return{first:t,second:s}}const Jt=Math.PI,Kt=2*Math.PI,Wt=.5*Math.PI;class Xt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Yt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,i){this.m_v[t*this.m_cc+s]=i}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const ts=new ArrayBuffer(8),ss=new Float64Array(ts),is=new BigUint64Array(ts),es=0x0fffffffffffffn,ns=0x7ff0000000000000n;function rs(){return Number.EPSILON*Fs}function us(t){return ss[0]=t,is[0]}function hs(t){return is[0]=t,ss[0]}function as(t){return us(t)&es}function os(t){return Number((us(t)&ns)>>52n)}function ms(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,i=512n,e=1n<<s+i;for(;t>=e;)s+=i,i<<=1n,e<<=i;let n=s;i>>=1n;let r=n+i;for(;i>0n;)t<1n<<r||(n=r),i>>=1n,r=n+i;return n}function ls(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function cs(t,s,i){return t===s||Math.abs(t-s)<=i||Number.isNaN(t)&&Number.isNaN(s)}function fs(t,s){return t<s?-1:t>s?1:0}function _s(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const i=Number.isNaN(t),e=Number.isNaN(s);return i<e?-1:i>e?1:0}}function vs(){return 2147483647}function bs(){return 32767}function ds(){return 2147483647}function xs(){return-2147483648}const Ns=ds(),ps=BigInt(Ns),ys=2166136261,Ts=16777619;function gs(t){let s=ys,i=t;return s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,i>>=8,s=(s^255&i)*Ts,s&Ns}const Ms=14695981039346656037n,Es=1099511628211n;function Is(t){let s=Ms,i=t;return s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,i>>=8n,s=(s^0xffn&i)*Es,s&ps}function ws(t){return 1103515245*t+12345&2147483647}function Ds(t){let s=ys;for(let i=0,e=t.length;i<e;++i)s=(s^t.charCodeAt(i))*Ts;return s&Ns}function As(t,s){return s+2654435769+(t<<6)+(t>>2)&Ns}function Ps(t,s){return As(t,Cs(s))}function qs(t){return As(3735928559,t)}function zs(t,s){return As(t,qs(s))}function Zs(t){return gs(t)}function Cs(t){return Number(Is(t))}function Rs(t){return Xs(t)}function Bs(t){return Cs(us(Rs(t)))}function Ss(t){return ws(t)}const ks=100,Fs=100;function Ls(){return Number.EPSILON*ks}function Os(){return.38196601125010515}function Gs(){return 1.4142135623730951}function Qs(){return Number.EPSILON}function Vs(t,s,i){return t===s||t===i}function Us(t,s,i){return t>=s?t<=i?t:i:s}function Ys(t,s,i){const e=t[0];if(e>=s){if(e<=i)return!1;t[0]=i}else t[0]=s;return!0}function js(t,s){return t>=s?s:t<-s?-s:t}function Hs(){return Jt}function $s(){return Kt}function Js(){return Wt}const Ks=3*Js();function Ws(){return Ks}function Xs(t){return t+0}function ti(t){return{v:t}}class si{constructor(){this.m_rn=ti(0n),this.m_rd=ti(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const i=t.clone();return void 0!==s&&i.limitPrecisionThis(s),i}static constructDouble(t){return(new si).setDouble(t)}static constructInt64(t){return(new si).setInt64(t)}static constructRational(t,s){return(new si).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new si).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(s){if(this.setZero(),0===s)return this;if(Number.isInteger(s)&&Math.abs(s)<ds())return this.setInt32(s);const i=us(s),e=(i&si.s_em)>>52n,n=!!(i&si.s_sm),r=i&si.s_fm;if(e===si.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===e&&t("denormalized numbers not yet implemented");const u=e-1023n,h=u>=0n?u:0n,a=u<0n?-u:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+a,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&(0n===this.m_rd.v&&1===this.m_sign)}isNegativeInf(){return!this.isNAN()&&(0n===this.m_rd.v&&-1===this.m_sign)}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return s(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(si.constructDouble(t))}thisMulInt64(t){return s(0),this}thisMulInt32(t){return s(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(si.constructDouble(t))}addDoubleThis(t){return this.addThis(si.constructDouble(t))}subDoubleThis(t){return this.subThis(si.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(si.constructInt64(t))}mulDouble(t){return this.clone().mulThis(si.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(si.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(si.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&(!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&(!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())))}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=_(BigInt.asUintN(32,s))-1;let i=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,i+=32;return s&=this.m_rd.v,s>>=BigInt(i),i+=_(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(i),this.m_power+=t-i,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=Pt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(ms(this.m_rn.v));if(s>t){const i=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=i}if(s=Number(ms(this.m_rd.v)),s>t){const i=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=i}return this}hiBitIndex(){return Math.max(Number(ms(this.m_rn.v)),Number(ms(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}static lerp(t,s,i){return si.lerpLo(s,s,i)}static lerpLo(t,s,i){return s.sub(t).mulThis(i).addThis(t)}static lerpHi(t,s,i){return s.sub(t).mulThis(ii.sub(i)).addThis(t)}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,e){if(t.m_sign<0n&&i("MP_value: sqrt(-1)"),t.isZero())return t.clone();let n=52,r=2220446049250313e-31;for(;n<e;)2*n<=e?(r*=r,n*=2):(r*=2220446049250313e-31,n+=52);n+=52;const u=ms(t.m_rn.v),h=ms(t.m_rd.v);let a,o=t.m_power+Number(u-h);const m=new si;Math.abs(o)>200?(1&Math.abs(o)&&(o+=1),a=si.constructAssign(t,53).ldexpThis(-o).value(),m.setThis(t).ldexpThis(-o),s(Number.isFinite(a))):(m.setThis(t),a=m.value(),s(Number.isFinite(a)),o=0),a=Math.sqrt(a);const l=si.constructDouble(a),c=si.constructDouble(r);c.mulThis(l).ldexpThis(1);const f=r*a*2,_=l.clone(),v=new si;let b;for(let s=0;s<10;++s){_.mulThis(l),v.setThis(m).subThis(_).absThis();let t=v.value();if(b=1,t<.9)for(;t>f;)t*=t,++b;else b=4;if(v.lte(c))break;for(let s=0;s<b;s++)_.setThis(l).divThis(m).invertThis().addThis(l).ldexpThis(-1).limitPrecisionThis(n),l.setThis(_)}return l.ldexpThis(o/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let i=52,e=2220446049250313e-31;for(;i<s;)2*i<=s?(e*=e,i*=2):(e*=2220446049250313e-31,i+=52);i+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=si.constructDouble(n),u=r.clone();u.sqrThis().mulDoubleThis(3).mulDoubleThis(e),u.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let h=0;h<10;++h){const s=r.clone();s.sqrThis().mulThis(r);const e=s.clone();if(e.subThis(t),e.absThis().limitPrecisionThis(32),e.lte(u))break;e.setThis(t),e.ldexpThis(1),e.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),e.divThis(n),r.mulThis(e),r.limitPrecisionThis(i)}return r}isInTheRangeOfDouble(){return s(0),!1}sign(){return this.m_sign}cosAndSin(t,i){s(0)}pow(t){return Mt(this,t)}static nan(){return s(0),new si}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let i=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const e=s/i;let n=Number(e);if(BigInt(n)!==e)return t?-n:n;let r=s-e*i;if(r){let t=ms(i)-1023n;t>0n&&(i>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52));n+=s/Number(i)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const i=Math.min(this.m_power,t.m_power);let e,n;this.m_power>i?(e=BigInt(this.m_power-i),n=0n):(e=0n,n=BigInt(t.m_power-i));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<e,u=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+u:r-u,this.m_rd.v*=t.m_rd.v,this.m_power=i,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}si.s_sm=0x8000000000000000n,si.s_em=0x7ff0000000000000n,si.s_fm=0x000fffffffffffffn,si.s_emax=0x7ffn;const ii=si.constructInt32(1),ei=si.constructInt32(0),ni=si.constructDouble(.5);function ri(t,s){return d(t^s)}function ui(t,s){let i=os(t);const e=os(s);if(i===e){return i-=53-ri(as(t),as(s)),i}return i>e?i:e}function hi(t,s){for(let i=0,e=0,n=t.length;i<n;i+=2,e++)s[e].x=t[i],s[e].y=t[i+1]}function ai(t){const s=new Float64Array(2*t.length);for(let i=0,e=t.length;i<e;++i){const e=i<<1;s[e]=t[i].x,s[e+1]=t[i].y}return s}function oi(t){const s=Ot(mi,t.length);for(let i=0,e=t.length;i<e;++i)s[i].setCoords(t[i][0],t[i][1]);return s}class mi{static construct(t,s){return new mi(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new mi(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,i){return void 0!==i?Math.abs(this.x-t)<=i&&Math.abs(this.y-s)<=i:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return s(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,i,e){s(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,i){this.x=s.x*t+i.x,this.y=s.y*t+i.y}scaleOther(t,i){s(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){s(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,i){return s(0),{}}static average(t,s){const i=new mi;if(0===s)return i.setNAN(),i;if(1===s)return i.assign(t[0]),i;const e=new n(t[0].x),r=new n(t[0].y);for(let n=1;n<s;n++)e.add(t[n].x),r.add(t[n].y),255&n||(e.normalize(),r.normalize());return i.x=e.getResult()/s,i.y=r.getResult()/s,i}static calculateLength(t,s){const i=new n(0);for(let e=1;e<s;e++)i.add(mi.distance(t[e],t[e-1]));return i.getResult()}offset(t,s){const i=mi.distance(t,s),e=mi.construct(this.x,this.y);if(0===i)return mi.distance(e,t);const n=s.clone();n.subThis(t),e.subThis(t);return e.crossProduct(n)/i}side(t,s){return t.equals(s)?this.equals(t)?0:1:mi.orientationRobust(s,t,this)}static sqrDistance(t,s){const i=t.x-s.x,e=t.y-s.y;return i*i+e*e}static sqrDistanceCoords(t,s,i,e){const n=i-t,r=e-s;return n*n+r*r}static distance(t,s){return Math.sqrt(mi.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return s(0),0}rotateDirect(t,s){const i=this.x*t-this.y*s,e=this.x*s+this.y*t;this.x=i,this.y=e}rotateReverse(t,s){const i=this.x*t+this.y*s,e=-this.x*s+this.y*t;this.x=i,this.y=e}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new mi(this.x+t.x,this.y+t.y)}sub(t){return new mi(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new mi(-this.x,-this.y)}mul(t){return new mi(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new mi(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new mi(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),i=t-s;return i>=0?t:i<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:e("norm")}}getQuarter(){return mi.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const i=t.getQuarter(),e=s.getQuarter();return e===i?mi.orientationRobustImpl(mi.construct(0,0),s,t,!0):i<e?-1:1}static compareVectorsOrigin(t,s,i){const e=s.sub(t),n=i.sub(t),r=e.getQuarter(),u=n.getQuarter();return u===r?mi.orientationRobustImpl(t,i,s,!0):r<u?-1:1}static orientationRobust(t,s,i){return mi.orientationRobustImpl(t,s,i,!1)}static orientationRobustEx(t,s,i,e){if(t.equals(s)||i.equals(e))return 0;const n=s.x-t.x,r=s.y-t.y,u=e.x-i.x,h=e.y-i.y;{const t=mi.getQuarterCoords(n,r)-1,s=mi.getQuarterCoords(u,h)-1,i=mi.d[t][s];if(0!==i)return i}const a=n*h,o=r*u,m=4*Qs()*(Math.abs(a)+Math.abs(o)),l=a-o;if(Math.abs(l)>=m){return l<0?-1:l>0?1:0}return mi.orientationRobustExMp(t,s,i,e)}static orientationRobustExMp(t,s,i,e){const n=si.constructDouble(s.x),r=si.constructDouble(e.x);n.subThis(si.constructDouble(t.x)),r.subThis(si.constructDouble(i.x));const u=si.constructDouble(s.y),h=si.constructDouble(e.y);return u.subThis(si.constructDouble(t.y)),h.subThis(si.constructDouble(i.y)),n.mulThis(h),u.mulThis(r),n.subThis(u),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,i){const e=s.sub(t).crossProduct(i.sub(t));return e<0?-1:e>0?1:0}static orientationRobustImpl(t,s,i,e){if(s.isEqualPoint2D(t)||i.isEqualPoint2D(t)||s.isEqualPoint2D(i))return 0;const n=s.x-t.x,r=s.y-t.y,u=i.x-t.x,h=i.y-t.y;if(!e){const t=mi.getQuarterCoords(n,r)-1,s=mi.getQuarterCoords(u,h)-1,i=mi.d[t][s];if(0!==i)return i}const a=(Math.abs(n)+Math.abs(r)+Math.abs(u)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(i.x)+Math.abs(i.y))*8*M(),o=n*h-r*u;if(Math.abs(o)>a){return o<0?-1:1}if(g(s.x,t.x)&&g(i.y,t.y)&&g(s.y,t.y)&&g(i.x,t.x)&&y(n,h)&&y(r,u)){const t=n*h,s=r*u;if(g(t,s)){const i=t-s;return i<0?-1:i>0?1:0}}return mi.orientationRobustMp(t,s,i)}static orientationRobustMp(t,s,i){const e=si.constructDouble(s.x),n=si.constructDouble(i.x);{const s=si.constructDouble(t.x);e.subThis(s),n.subThis(s)}const r=si.constructDouble(i.y),u=si.constructDouble(s.y);{const s=si.constructDouble(t.y);r.subThis(s),u.subThis(s)}return e.mulThis(r),u.mulThis(n),e.subThis(u),e.LZ()?-1:e.GZ()?1:0}static inCircleRobust(t,s,i,e){const n=new p,r=new p;n.set(t.x),n.subThis(e.x),r.set(t.y),r.subThis(e.y);const u=new p,h=new p;u.set(s.x),u.subThis(e.x),h.set(s.y),h.subThis(e.y);const a=new p,o=new p;a.set(i.x),a.subThis(e.x),o.set(i.y),o.subThis(e.y);const m=n.mulE(h).subE(r.mulE(u)),l=u.mulE(o).subE(h.mulE(a)),c=n.mulE(o).subE(r.mulE(a)),f=n.mulE(n).addE(r.mulE(r)),_=u.mulE(u).addE(h.mulE(h)),v=a.mulE(a).addE(o.mulE(o)),b=f.mulE(l).subE(_.mulE(c)).addE(v.mulE(m));if(!b.isFuzzyZero()){const t=b.value();return t<0?-1:t>0?1:0}return mi.inCircleRobustMp(t,s,i,e)}static inCircleRobustMp(t,s,i,e){do{if(!g(t.x,e.x)||!g(t.y,e.y))break;if(!g(s.x,e.x)||!g(s.y,e.y))break;if(!g(i.x,e.x)||!g(i.y,e.y))break;const n=t.x-e.x,r=t.y-e.y,u=s.x-e.x,h=s.y-e.y,a=i.x-e.x,o=i.y-e.y;if(!y(n,h)||!y(r,u))break;if(!y(u,o)||!y(h,a))break;if(!y(n,o)||!y(r,a))break;if(!y(n,n)||!y(r,r))break;if(!y(u,u)||!y(h,h))break;if(!y(a,a)||!y(o,o))break;const m=n*h,l=r*u,c=u*o,f=h*a,_=n*o,v=r*a,b=n*n,d=r*r,x=u*u,N=h*h,p=a*a,M=o*o;if(!g(m,l))break;if(!g(c,f))break;if(!g(_,v))break;if(!T(b,d))break;if(!T(x,N))break;if(!T(p,M))break;const E=m-l,I=c-f,w=_-v,D=b+d,A=x+N,P=p+M;if(!y(D,I))break;if(!y(A,w))break;if(!y(P,E))break;const q=D*I,z=A*w,Z=P*E;if(!g(q,z))break;const C=q-z;if(!T(C,Z))break;const R=C+Z;return R<0?-1:R>0?1:0}while(0);const n=si.constructDouble(e.x),r=si.constructDouble(e.y),u=si.constructDouble(t.x),h=si.constructDouble(t.y);u.subThis(n),h.subThis(r);const a=si.constructDouble(s.x),o=si.constructDouble(s.y);a.subThis(n),o.subThis(r);const m=si.constructDouble(i.x),l=si.constructDouble(i.y);m.subThis(n),l.subThis(r);const c=u.mul(o).sub(h.mul(a)),f=a.mul(l).sub(o.mul(m)),_=u.mul(l).sub(h.mul(m)),v=u.mul(u).add(h.mul(h)),b=a.mul(a).add(o.mul(o)),d=m.mul(m).add(l.mul(l)),x=v.mul(f).sub(b.mul(_)).add(d.mul(c));return x.LZ()?-1:x.GZ()?1:0}static inCircleRobustMp3Point(t,s,i){const e=si.constructDouble(t.x),n=si.constructDouble(t.y),r=si.constructDouble(s.x),u=si.constructDouble(s.y),h=si.constructDouble(i.x),a=si.constructDouble(i.y),o=h.mul(h).add(a.mul(a)).sub(h.mul(e).add(a.mul(n)).add(h.mul(r)).add(a.mul(u))).add(e.mul(r).add(n.mul(u)));return o.LZ()?-1:o.GZ()?1:0}static inCircleRobust3Point(t,s,i){const e=new p(t.x),n=new p(t.y),r=new p(s.x),u=new p(s.y),h=new p(i.x),a=new p(i.y),o=h.mulE(h).addE(a.mulE(a)).subE(h.mulE(e).addE(a.mulE(n)).addE(h.mulE(r)).addE(a.mulE(u))).addE(e.mulE(r).addE(n.mulE(u)));if(!o.isFuzzyZero()){const t=o.value();return t<0?-1:t>0?1:0}return mi.inCircleRobustMp3Point(t,s,i)}static calculateCircleCenterFromThreePoints(t,s,i){if(t.equals(i)||t.equals(s)||i.equals(s))return mi.getNAN();const e=li(t,s,i);return e.isNAN()?ci(t,s,i):e}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,i,e){return s(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const i=mi.c_compare_zorder_xx[t.x<0?1:0]|mi.c_compare_zorder_yy[t.y<0?1:0],e=mi.c_compare_zorder_xx[s.x<0?1:0]|mi.c_compare_zorder_yy[s.y<0?1:0];if(i===e){let i=0,e=0;for(let n=0;n<2;++n){const r=ui(t[n],s[n]);r>i&&(i=r,e=n)}return t[e]<s[e]}return i<e}static lerp(t,s,i){const e=new mi;return Y(t,s,i,e),e}static getClosestCoordinate(t,s,i,e=!1){const n=mi.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(i))return 1;const u=mi.getNAN();u.setSub(i,t);let h=u.dotProduct(n)/r;return e||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,i,e){if(t.equals(s)||i.equals(e))return mi.getNAN();const n=s.x-t.x,r=i.x-e.x,u=s.y-t.y,h=i.y-e.y,a=n*h-r*u;if(!a)return mi.getNAN();const o=a;if(0===o)return mi.getNAN();let m=(i.x-t.x)*h-(i.y-t.y)*r;m/=o;const l=new mi;return Y(t,s,m,l),l.isFinite()?l:mi.getNAN()}toString(){return`[${this.x},${this.y}]`}}function li(t,s,i){const e=new p(s.x);e.subThis(t.x);const n=new p(s.y);n.subThis(t.y);const r=new p(i.x);r.subThis(t.x);const u=new p(i.y);u.subThis(t.y);const h=e.clone();h.mulThisE(u);let a=n.clone();if(a.mulThisE(r),h.subThisE(a),0===h.value())return mi.getNAN();h.mulThis(2);const o=e.clone();o.mulThisE(e);const m=n.clone();m.mulThisE(n);const l=o.clone();l.addThisE(m);const c=r.clone();c.mulThisE(r);const f=u.clone();f.mulThisE(u);const _=c.clone();_.addThisE(f);const v=n.clone();v.mulThisE(_),a=u.clone(),a.mulThisE(l),v.subThisE(a),v.divThisE(h);const b=e.clone();b.mulThisE(_),a=r.clone(),a.mulThisE(l),b.subThisE(a),b.divThisE(h);const d=mi.construct(t.x-v.value(),t.y+b.value()),x=t.sub(d).length(),N=s.sub(d).length(),y=i.sub(d).length(),T=1e-15*(x+Math.abs(t.x)+Math.abs(s.x)+Math.abs(i.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(i.y));return Math.abs(x-N)<=T&&Math.abs(x-y)<=T&&v.eps()<T&&b.eps()<T?d:mi.getNAN()}function ci(t,s,i){const e=si.constructDouble(s.x);e.subDoubleThis(t.x);const n=si.constructDouble(s.y);n.subDoubleThis(t.y);const r=si.constructDouble(i.x);r.subDoubleThis(t.x);const u=si.constructDouble(i.y);u.subDoubleThis(t.y);const h=e.clone();h.mulThis(u);let a=n.clone();if(a.mulThis(r),h.subThis(a),h.isZero())return mi.getNAN();h.mulDoubleThis(2);const o=e.clone();o.mulThis(e);const m=n.clone();m.mulThis(n);const l=o.clone();l.addThis(m);const c=r.clone();c.mulThis(r);const f=u.clone();f.mulThis(u);const _=c.clone();_.addThis(f);const v=n.clone();v.mulThis(_),a=u.clone(),a.mulThis(l),v.subThis(a),v.divThis(h);const b=e.clone();b.mulThis(_),a=r.clone(),a.mulThis(l),b.subThis(a),b.divThis(h);return mi.construct(t.x-v.value(),t.y+b.value())}mi.dimensions=2,mi.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],mi.c_compare_zorder_xx=[2,0],mi.c_compare_zorder_yy=[1,0];export{Hs as $,Gs as A,fs as B,cs as C,p as D,x as E,w as F,I as G,Qt as H,Vs as I,Qs as J,n as K,wt as L,si as M,Ss as N,Zt as O,mi as P,ls as Q,Xt as R,Ht as S,Js as T,Y as U,It as V,jt as W,V as X,U as Y,zt as Z,L as _,H as a,js as a0,Ws as a1,k as a2,F as a3,O as a4,G as a5,D as a6,ni as a7,Ct as a8,$s as a9,Ds as aA,oi as aB,bs as aC,Ys as aD,R as aE,zs as aF,rs as aG,ai as aH,hi as aI,Bs as aJ,qs as aK,_t as aa,vt as ab,Lt as ac,A as ad,P as ae,ft as af,Jt as ag,ei as ah,ii as ai,Et as aj,Xs as ak,Rt as al,st as am,$ as an,gt as ao,J as ap,Os as aq,xs as ar,At as as,As as at,Zs as au,Vt as av,Gt as aw,S as ax,St as ay,Ps as az,Dt as b,Pt as c,Yt as d,K as e,B as f,Ls as g,kt as h,ds as i,vs as j,Ut as k,$t as l,Ot as m,ct as n,Wt as o,Kt as p,Q as q,_s as r,Us as s,W as t,Bt as u,qt as v,Ft as w,j as x,z as y,C as z};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"./Envelope2D.js";import"./Geometry.js";export{P as ProjectionTransformation,
|
|
5
|
+
import"./Envelope2D.js";import"./Geometry.js";export{P as ProjectionTransformation,c as create,a as createEx,b as createFromAoi,d as createImplEx,m as makeExtendedParams,e as makeExtendedParamsInternal,q as queryTransformationList}from"./SpatialReference.js";import"./Point2D.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{P as e}from"./Point2D.js";import{f as t,G as n,a as r}from"./Geometry.js";import{Envelope2D as o}from"./Envelope2D.js";import{
|
|
5
|
+
import{P as e}from"./Point2D.js";import{f as t,G as n,a as r}from"./Geometry.js";import{Envelope2D as o}from"./Envelope2D.js";import{l as i}from"./SpatialReference.js";function s(){return g(new e,-1,Number.NaN)}function g(e,t,n){return{m_coordinate:e.clone(),m_vertexIndex:t,m_geometryIndex:0,m_distance:n,m_bRightSide:!1,isEmpty:u}}function u(){return Number.isNaN(this.m_distance)}function a(e,r,i=-1,s=-1){if(e.isEmpty())return 3;const g=e.getGeometryType();if(t(g))return c(e,r,i,s);if(g===n.enumPolygon)return f(e,r,i,s);if(g===n.enumPolyline)return m(e,r,i,s);if(g===n.enumEnvelope){const t=new o;return e.queryEnvelope(t),t.contains(r)?t.containsExclusive(r)?1:2:0}return 3}function c(t,n,o,i){if(o>=0||i>=0)return r("");if(t.isDegenerate(0))return t.getStartXY().equals(n)?2:3;if(!t.isCurve()){const r=e.orientationRobust(n,t.getStartXY(),t.getEndXY());return r<0?1:r>0?0:2}const s=t.getClosestCoordinate(n,!1),g=t.getTangent(s),u=t.getCoord2D(s),a=e.orientationRobust(n,u,u.add(g));return a<0?1:a>0?0:2}function f(e,t,n,s){(n>=0||s>=0)&&r("");const g=new o;e.queryEnvelope(g);const u=i(e,t,0);return 0===u?0:1===u?1:2}function m(t,n,o,i){(o<0&&i>=0||o>=0&&i<0)&&r("");const s=t.querySegmentIterator();if(o<0){let t=Number.MAX_VALUE,r=0;for(;s.nextPath();)for(;s.hasNextSegment();){const g=s.nextSegment(),u=g.getClosestCoordinate(n,!1),a=g.getCoord2D(u),c=e.sqrDistance(a,n);c<t?(r=1,o=s.getStartPointIndex(),i=s.getPathIndex(),t=c):c===t&&r++}if(0===r)return 3;if(1===r){s.resetToVertex(o,i);return a(s.nextSegment(),n)}}const g=h(n,s,o,i);if(-1!==g.i1&&-1===g.i2)return g.bRight1?1:0;if(-1!==g.i1&&-1!==g.i2){if(g.bRight1===g.bRight2)return g.bRight1?1:0;{s.resetToVertex(g.i1,-1);const e=s.nextSegment().getTangent(1);s.resetToVertex(g.i2,-1);const t=s.nextSegment().getTangent(0);return e.crossProduct(t)>=0?1:0}}s.resetToVertex(o,i);return a(s.nextSegment(),n)}function x(e,t,n){for(e.resetToVertex(t,n);e.hasNextSegment();){if(!e.nextSegment().isDegenerate(0))return e.getStartPointIndex()}for(e.resetToVertex(t,n);e.hasPreviousSegment();){if(!e.previousSegment().isDegenerate(0))return e.getStartPointIndex()}return-1}function S(e,t){for(e.resetToVertex(t,-1),e.nextSegment();e.hasNextSegment();){if(!e.nextSegment().isDegenerate(0))return e.getStartPointIndex()}return-1}function d(e,t){for(e.resetToVertex(t,-1);e.hasPreviousSegment();){if(!e.previousSegment().isDegenerate(0))return e.getStartPointIndex()}return-1}function h(t,n,r,o){const i={i1:-1,i2:-1,bRight1:!1,bRight2:!1};if(i.i1=x(n,r,o),-1!==i.i1){n.resetToVertex(i.i1,-1);const r=n.nextSegment(),o=r.getClosestCoordinate(t,!1),s=r.getCoord2D(o),g=e.sqrDistance(s,t);{const e=s.clone();e.subThis(r.getStartXY());const n=t.clone();n.subThis(r.getStartXY()),i.bRight1=e.crossProduct(n)<0}if(i.i2=S(n,i.i1),-1!==i.i2){n.resetToVertex(i.i2,-1);const r=n.nextSegment(),o=r.getClosestCoordinate(t,!1),s=r.getCoord2D(o);if(e.sqrDistance(s,t)>g)i.i2=-1;else{const e=s.clone();e.subThis(r.getStartXY());const n=t.clone();n.subThis(r.getStartXY()),i.bRight2=e.crossProduct(n)<0}}if(-1===i.i2&&(i.i2=d(n,i.i1),-1!==i.i2)){n.resetToVertex(i.i2,-1);const r=n.nextSegment(),o=r.getClosestCoordinate(t,!1),s=r.getCoord2D(o);if(e.sqrDistance(s,t)>g)i.i2=-1;else{const e=s.clone();e.subThis(r.getStartXY());const n=t.clone();n.subThis(r.getStartXY()),i.bRight2=e.crossProduct(n)<0;const o=i.i1;i.i1=i.i2,i.i2=o;const g=i.bRight1;i.bRight1=i.bRight2,i.bRight2=g}}}return i}export{g as a,a as c,s as m};
|