@vcmap/ui 5.0.0-rc.10
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/LICENSE.md +21 -0
- package/README.md +182 -0
- package/build/.eslintrc +6 -0
- package/build/build.js +162 -0
- package/build/buildCesium.js +19 -0
- package/build/buildHelpers.js +212 -0
- package/build/buildPreview.js +23 -0
- package/build/commonViteConfig.js +39 -0
- package/build/determineHost.js +46 -0
- package/build/generateOLLib.js +196 -0
- package/build/getPluginProxies.js +29 -0
- package/build/info/api-plugin.js +11 -0
- package/build/info/conf.json +21 -0
- package/build/info/define-plugin.js +31 -0
- package/build/info/package.json +3 -0
- package/build/info/publish.js +190 -0
- package/build/info/virtual-plugin.js +15 -0
- package/build/staging/Dockerfile +2 -0
- package/config/aerowest.config.json +388 -0
- package/config/base.config.json +991 -0
- package/config/berlin.config.json +510 -0
- package/config/dev.config.json +44 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/assets/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/assets/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/assets/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/assets/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/assets/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/assets/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/assets/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/assets/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/assets/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/pin.svg +1 -0
- package/dist/assets/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/assets/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/assets/cesium/Assets/approximateTerrainHeights.json +1 -0
- package/dist/assets/cesium/Workers/ArcType-fc72c06c.js +1 -0
- package/dist/assets/cesium/Workers/AttributeCompression-80665726.js +1 -0
- package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-a655a4bc.js +1 -0
- package/dist/assets/cesium/Workers/BoundingRectangle-c3b79029.js +1 -0
- package/dist/assets/cesium/Workers/BoxGeometry-f8f9c981.js +1 -0
- package/dist/assets/cesium/Workers/Color-de06a177.js +1 -0
- package/dist/assets/cesium/Workers/ComponentDatatype-a15c9a19.js +1 -0
- package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-48cdc26d.js +1 -0
- package/dist/assets/cesium/Workers/CorridorGeometryLibrary-ddc027d3.js +1 -0
- package/dist/assets/cesium/Workers/CylinderGeometry-82a8cbe6.js +1 -0
- package/dist/assets/cesium/Workers/CylinderGeometryLibrary-76cda53e.js +1 -0
- package/dist/assets/cesium/Workers/EllipseGeometry-32d55454.js +1 -0
- package/dist/assets/cesium/Workers/EllipseGeometryLibrary-b2ae188a.js +1 -0
- package/dist/assets/cesium/Workers/EllipseOutlineGeometry-f05a5a27.js +1 -0
- package/dist/assets/cesium/Workers/EllipsoidGeodesic-19e75e11.js +1 -0
- package/dist/assets/cesium/Workers/EllipsoidGeometry-7c99fc81.js +1 -0
- package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-21c243df.js +1 -0
- package/dist/assets/cesium/Workers/EllipsoidRhumbLine-6145377b.js +1 -0
- package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +1 -0
- package/dist/assets/cesium/Workers/EncodedCartesian3-d9f5c4a4.js +1 -0
- package/dist/assets/cesium/Workers/FrustumGeometry-17776af8.js +1 -0
- package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +1 -0
- package/dist/assets/cesium/Workers/GeometryAttributes-32b29525.js +1 -0
- package/dist/assets/cesium/Workers/GeometryInstance-4fbf16ba.js +1 -0
- package/dist/assets/cesium/Workers/GeometryOffsetAttribute-8c5e10db.js +1 -0
- package/dist/assets/cesium/Workers/GeometryPipeline-309fad76.js +1 -0
- package/dist/assets/cesium/Workers/IndexDatatype-f1dcdf35.js +1 -0
- package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +1 -0
- package/dist/assets/cesium/Workers/Matrix2-47e98d76.js +1 -0
- package/dist/assets/cesium/Workers/OrientedBoundingBox-fcb5b750.js +1 -0
- package/dist/assets/cesium/Workers/Plane-3f01019d.js +1 -0
- package/dist/assets/cesium/Workers/PolygonGeometryLibrary-0b29eb16.js +1 -0
- package/dist/assets/cesium/Workers/PolygonPipeline-a934c4dd.js +1 -0
- package/dist/assets/cesium/Workers/PolylinePipeline-8095c9bc.js +1 -0
- package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-67d12fff.js +1 -0
- package/dist/assets/cesium/Workers/PrimitivePipeline-980e44c5.js +1 -0
- package/dist/assets/cesium/Workers/RectangleGeometryLibrary-621c6de8.js +1 -0
- package/dist/assets/cesium/Workers/RuntimeError-8952249c.js +1 -0
- package/dist/assets/cesium/Workers/TerrainEncoding-f96552d5.js +1 -0
- package/dist/assets/cesium/Workers/Transforms-c8cb8f43.js +39 -0
- package/dist/assets/cesium/Workers/VertexFormat-a0b706b0.js +1 -0
- package/dist/assets/cesium/Workers/WallGeometryLibrary-c03d8479.js +1 -0
- package/dist/assets/cesium/Workers/WebGLConstants-508b9636.js +1 -0
- package/dist/assets/cesium/Workers/WebMercatorProjection-79b3214e.js +1 -0
- package/dist/assets/cesium/Workers/_commonjsHelpers-3aae1032-26891ab7.js +1 -0
- package/dist/assets/cesium/Workers/_rollup_plugin_ignore_empty_module_placeholder-57d574d0.js +1 -0
- package/dist/assets/cesium/Workers/arrayRemoveDuplicates-dc2f4046.js +1 -0
- package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +6 -0
- package/dist/assets/cesium/Workers/combine-3c023bda.js +1 -0
- package/dist/assets/cesium/Workers/combineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createBoxGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createCircleGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createCorridorGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createCylinderGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createEllipseGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createFrustumGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createPlaneGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createPolygonGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createPolylineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createRectangleGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createSphereGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +1 -0
- package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +1 -0
- package/dist/assets/cesium/Workers/createVectorTileGeometries.js +1 -0
- package/dist/assets/cesium/Workers/createVectorTilePoints.js +1 -0
- package/dist/assets/cesium/Workers/createVectorTilePolygons.js +1 -0
- package/dist/assets/cesium/Workers/createVectorTilePolylines.js +1 -0
- package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -0
- package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +3 -0
- package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -0
- package/dist/assets/cesium/Workers/createWallGeometry.js +1 -0
- package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +1 -0
- package/dist/assets/cesium/Workers/decodeDraco.js +1 -0
- package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +1 -0
- package/dist/assets/cesium/Workers/defaultValue-81eec7ed.js +1 -0
- package/dist/assets/cesium/Workers/transcodeKTX2.js +1 -0
- package/dist/assets/cesium/Workers/transferTypedArrayTest.js +1 -0
- package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +1 -0
- package/dist/assets/cesium.eb5667.js +9105 -0
- package/dist/assets/cesium.js +1 -0
- package/dist/assets/core.216494.js +4 -0
- package/dist/assets/core.js +1 -0
- package/dist/assets/index.4ccd4433.js +1 -0
- package/dist/assets/ol.ef03b1.js +311 -0
- package/dist/assets/ol.js +1 -0
- package/dist/assets/ui.99a1a7.css +1 -0
- package/dist/assets/ui.99a1a7.js +70 -0
- package/dist/assets/ui.js +1 -0
- package/dist/assets/vue-composition-api.c5aca1.js +14 -0
- package/dist/assets/vue-composition-api.js +2 -0
- package/dist/assets/vue.762edd.js +9 -0
- package/dist/assets/vue.js +1 -0
- package/dist/assets/vuetify.401a29.css +5 -0
- package/dist/assets/vuetify.401a29.js +148 -0
- package/dist/assets/vuetify.js +2 -0
- package/dist/index.html +82 -0
- package/index.js +108 -0
- package/lib/cesium.js +1 -0
- package/lib/core.js +1 -0
- package/lib/ol.js +1 -0
- package/lib/olLib.js +844 -0
- package/lib/ui.js +1 -0
- package/lib/vue-composition-api.js +2 -0
- package/lib/vue.js +1 -0
- package/lib/vuetify.js +2 -0
- package/map.config.json +35 -0
- package/package.json +126 -0
- package/plugins/@vcmap/pluginExample/config.json +6 -0
- package/plugins/@vcmap/pluginExample/index.js +209 -0
- package/plugins/@vcmap/pluginExample/package.json +7 -0
- package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +374 -0
- package/plugins/@vcmap/pluginExample/validation.js +30 -0
- package/plugins/@vcmap/project-selector/ContextsListComponent.vue +62 -0
- package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +81 -0
- package/plugins/@vcmap/project-selector/README.md +29 -0
- package/plugins/@vcmap/project-selector/config.json +15 -0
- package/plugins/@vcmap/project-selector/de.json +7 -0
- package/plugins/@vcmap/project-selector/en.json +7 -0
- package/plugins/@vcmap/project-selector/index.js +259 -0
- package/plugins/@vcmap/project-selector/package.json +14 -0
- package/plugins/@vcmap/theme-changer/README.md +21 -0
- package/plugins/@vcmap/theme-changer/ThemeChangerComponent.vue +92 -0
- package/plugins/@vcmap/theme-changer/config.json +69 -0
- package/plugins/@vcmap/theme-changer/index.js +102 -0
- package/plugins/@vcmap/theme-changer/package.json +12 -0
- package/plugins/buttonExamples/ButtonExamples.vue +190 -0
- package/plugins/buttonExamples/index.js +41 -0
- package/plugins/categoryTest/Categories.vue +145 -0
- package/plugins/categoryTest/Category.vue +114 -0
- package/plugins/categoryTest/ItemEditor.vue +13 -0
- package/plugins/categoryTest/index.js +41 -0
- package/plugins/example/index.js +75 -0
- package/plugins/example/mySuperComponent.vue +127 -0
- package/plugins/package.json +5 -0
- package/plugins/test/allIconsComponent.vue +34 -0
- package/plugins/test/editor.vue +63 -0
- package/plugins/test/emptyComponent.vue +13 -0
- package/plugins/test/index.js +116 -0
- package/plugins/test/myCustomHeader.vue +19 -0
- package/plugins/test/toolbox-data.js +129 -0
- package/plugins/test/vcsContent.vue +23 -0
- package/plugins/test/windowManagerExample.vue +144 -0
- package/src/actions/actionHelper.js +262 -0
- package/src/actions/stateRefAction.js +59 -0
- package/src/actions/styleSelector.vue +90 -0
- package/src/application/Navbar.vue +143 -0
- package/src/application/VcsApp.vue +202 -0
- package/src/application/VcsMap.vue +38 -0
- package/src/application/VcsSettings.vue +85 -0
- package/src/application/vcsAppWrapper.vue +29 -0
- package/src/assets/logo-mobile.svg +9 -0
- package/src/assets/logo.svg +26 -0
- package/src/components/buttons/VcsActionButtonList.vue +99 -0
- package/src/components/buttons/VcsButton.vue +201 -0
- package/src/components/form-inputs-controls/VcsCheckbox.vue +74 -0
- package/src/components/form-inputs-controls/VcsColorPicker.vue +81 -0
- package/src/components/form-inputs-controls/VcsFormSection.vue +46 -0
- package/src/components/form-inputs-controls/VcsLabel.vue +38 -0
- package/src/components/form-inputs-controls/VcsSelect.vue +97 -0
- package/src/components/form-inputs-controls/VcsTextArea.vue +130 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +129 -0
- package/src/components/form-output/VcsFormattedNumber.vue +103 -0
- package/src/components/lists/VcsActionList.vue +100 -0
- package/src/components/lists/VcsTreeview.vue +104 -0
- package/src/components/lists/VcsTreeviewLeaf.vue +91 -0
- package/src/components/lists/VcsTreeviewSearchbar.vue +157 -0
- package/src/components/notification/VcsBadge.vue +27 -0
- package/src/components/notification/VcsTooltip.vue +154 -0
- package/src/components/notification/validation.js +19 -0
- package/src/contentTree/LayerTree.vue +39 -0
- package/src/contentTree/contentTreeCollection.js +315 -0
- package/src/contentTree/contentTreeItem.js +457 -0
- package/src/contentTree/groupContentTreeItem.js +67 -0
- package/src/contentTree/layerContentTreeItem.js +235 -0
- package/src/contentTree/layerGroupContentTreeItem.js +154 -0
- package/src/contentTree/nodeContentTreeItem.js +37 -0
- package/src/contentTree/obliqueCollectionContentTreeItem.js +155 -0
- package/src/contentTree/subContentTreeItem.js +42 -0
- package/src/contentTree/vcsObjectContentTreeItem.js +98 -0
- package/src/contentTree/viewPointContentTreeItem.js +107 -0
- package/src/i18n/de.js +55 -0
- package/src/i18n/en.js +55 -0
- package/src/i18n/i18nCollection.js +138 -0
- package/src/icons/+all.js +359 -0
- package/src/icons/2DAreaIcon.vue +21 -0
- package/src/icons/2DDistanceIcon.vue +18 -0
- package/src/icons/3DAreaIcon.vue +21 -0
- package/src/icons/3DDistanceIcon.vue +18 -0
- package/src/icons/3DHeightIcon.vue +18 -0
- package/src/icons/AngleIcon.vue +8 -0
- package/src/icons/AssociationsIcon.vue +34 -0
- package/src/icons/AxisIcon.vue +10 -0
- package/src/icons/BoundingBoxIcon.vue +15 -0
- package/src/icons/CheckboxCheckedIcon.vue +16 -0
- package/src/icons/CheckboxIcon.vue +23 -0
- package/src/icons/CheckboxIndeterminateIcon.vue +24 -0
- package/src/icons/CircleIcon.vue +10 -0
- package/src/icons/ColorSwatchIcon.vue +17 -0
- package/src/icons/CommentIcon.vue +19 -0
- package/src/icons/CompassIcon.vue +8 -0
- package/src/icons/ComponentsIcon.vue +7 -0
- package/src/icons/ConeIcon.vue +11 -0
- package/src/icons/DimensionsHouseIcon.vue +14 -0
- package/src/icons/ElevationProfileIcon.vue +111 -0
- package/src/icons/ExportAreaIcon.vue +7 -0
- package/src/icons/ExportFlightIcon.vue +7 -0
- package/src/icons/ExportIcon.vue +8 -0
- package/src/icons/ExternalLinkIcon.vue +10 -0
- package/src/icons/EyeIcon.vue +7 -0
- package/src/icons/FastForwardIcon.vue +7 -0
- package/src/icons/FilterIcon.vue +8 -0
- package/src/icons/GlobeNatureIcon.vue +14 -0
- package/src/icons/HealthCareIndustriesIcon.vue +118 -0
- package/src/icons/HelpIcon.vue +7 -0
- package/src/icons/HomePointIcon.vue +8 -0
- package/src/icons/HospitalsIcon.vue +237 -0
- package/src/icons/HouseIcon.vue +25 -0
- package/src/icons/ImportIcon.vue +8 -0
- package/src/icons/InfoIcon.vue +10 -0
- package/src/icons/KebabIcon.vue +36 -0
- package/src/icons/LabelIcon.vue +7 -0
- package/src/icons/LayersIcon.vue +26 -0
- package/src/icons/LegendIcon.vue +65 -0
- package/src/icons/LineIcon.vue +7 -0
- package/src/icons/LinkIcon.vue +7 -0
- package/src/icons/MapIcon.vue +8 -0
- package/src/icons/MenuIcon.vue +34 -0
- package/src/icons/MinusIcon.vue +8 -0
- package/src/icons/ObjectAttributeIcon.vue +18 -0
- package/src/icons/ObjectSelectIcon.vue +8 -0
- package/src/icons/ObliqueViewIcon.vue +13 -0
- package/src/icons/PdfIcon.vue +10 -0
- package/src/icons/PedestrianIcon.vue +8 -0
- package/src/icons/PenIcon.vue +14 -0
- package/src/icons/PlayCircleIcon.vue +10 -0
- package/src/icons/PlusIcon.vue +9 -0
- package/src/icons/PoiIcon.vue +7 -0
- package/src/icons/PointSelectIcon.vue +7 -0
- package/src/icons/PolygonIcon.vue +38 -0
- package/src/icons/PresentationModeIcon.vue +7 -0
- package/src/icons/ProgressIcon.vue +24 -0
- package/src/icons/QueryIcon.vue +15 -0
- package/src/icons/RectangleIcon.vue +9 -0
- package/src/icons/ReturnIcon.vue +7 -0
- package/src/icons/RewindIcon.vue +6 -0
- package/src/icons/SearchIcon.vue +8 -0
- package/src/icons/ShadowIcon.vue +9 -0
- package/src/icons/ShapesIcon.vue +28 -0
- package/src/icons/ShareIcon.vue +22 -0
- package/src/icons/SimpleCircleFilledIcon.vue +15 -0
- package/src/icons/SimpleCircleHalfFilledIcon.vue +12 -0
- package/src/icons/SimpleCircleOutlinedIcon.vue +15 -0
- package/src/icons/SkipNextIcon.vue +7 -0
- package/src/icons/SkipPreviousIcon.vue +9 -0
- package/src/icons/SplitViewIcon.vue +19 -0
- package/src/icons/TextStyleIcon.vue +14 -0
- package/src/icons/ThreeDimensionsIcon.vue +7 -0
- package/src/icons/ToolsIcon.vue +35 -0
- package/src/icons/TouchIcon.vue +8 -0
- package/src/icons/TrashCanIcon.vue +7 -0
- package/src/icons/TriangleIcon.vue +15 -0
- package/src/icons/TwoDimensionsIcon.vue +8 -0
- package/src/icons/UploadIcon.vue +14 -0
- package/src/icons/VideoRecorderIcon.vue +14 -0
- package/src/icons/WalkingIcon.vue +7 -0
- package/src/icons/WallIcon.vue +14 -0
- package/src/init.js +38 -0
- package/src/manager/buttonManager.js +156 -0
- package/src/manager/navbarManager.js +81 -0
- package/src/manager/toolbox/ToolboxGroupComponent.vue +128 -0
- package/src/manager/toolbox/ToolboxManager.vue +157 -0
- package/src/manager/toolbox/toolboxManager.js +204 -0
- package/src/manager/window/WindowComponent.vue +140 -0
- package/src/manager/window/WindowComponentHeader.vue +53 -0
- package/src/manager/window/WindowManager.vue +126 -0
- package/src/manager/window/windowManager.js +435 -0
- package/src/navigation/mapNavCompass.vue +161 -0
- package/src/navigation/mapNavigation.vue +207 -0
- package/src/navigation/obliqueRotation.vue +48 -0
- package/src/navigation/orientationToolsButton.vue +52 -0
- package/src/navigation/overviewMap.js +615 -0
- package/src/navigation/overviewMapClickedInteraction.js +38 -0
- package/src/navigation/tiltSlider.vue +96 -0
- package/src/navigation/vcsCompass.vue +144 -0
- package/src/navigation/vcsZoomButton.vue +27 -0
- package/src/pluginHelper.js +106 -0
- package/src/setup.js +11 -0
- package/src/styles/_theming.scss +25 -0
- package/src/styles/_typography.scss +42 -0
- package/src/styles/main.scss +12 -0
- package/src/styles/utils/_all.scss +12 -0
- package/src/styles/utils/_border.scss +7 -0
- package/src/styles/utils/_cursor.scss +15 -0
- package/src/styles/utils/_display.scss +3 -0
- package/src/styles/utils/_fade-in.scss +8 -0
- package/src/styles/utils/_position.scss +38 -0
- package/src/styles/utils/_size.scss +79 -0
- package/src/styles/utils/_slide-in.scss +26 -0
- package/src/styles/utils/_spacing.scss +11 -0
- package/src/styles/utils/_text.scss +30 -0
- package/src/styles/utils/_transform.scss +11 -0
- package/src/styles/utils/_transition.scss +11 -0
- package/src/styles/utils/_z-index.scss +15 -0
- package/src/styles/variables.scss +70 -0
- package/src/styles/vcsFont.scss +5 -0
- package/src/styles/vcsGrid.scss +4 -0
- package/src/vcsUiApp.js +259 -0
- package/src/vuePlugins/i18n.js +69 -0
- package/src/vuePlugins/vuetify.js +54 -0
- package/start.js +3 -0
@@ -0,0 +1,311 @@
|
|
1
|
+
var fI=Object.defineProperty,pI=Object.defineProperties;var gI=Object.getOwnPropertyDescriptors;var Pu=Object.getOwnPropertySymbols;var C_=Object.prototype.hasOwnProperty,L_=Object.prototype.propertyIsEnumerable;var I_=(n,e,t)=>e in n?fI(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,wl=(n,e)=>{for(var t in e||(e={}))C_.call(e,t)&&I_(n,t,e[t]);if(Pu)for(var t of Pu(e))L_.call(e,t)&&I_(n,t,e[t]);return n},El=(n,e)=>pI(n,gI(e));var Tl=(n,e)=>{var t={};for(var i in n)C_.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&Pu)for(var i of Pu(n))e.indexOf(i)<0&&L_.call(n,i)&&(t[i]=n[i]);return t};function he(){return function(){throw new Error("Unimplemented abstract method.")}()}let mI=0;function se(n){return n.ol_uid||(n.ol_uid=String(++mI))}const Ou="latest";class yI extends Error{constructor(e){const i="Assertion failed. See https://openlayers.org/en/"+Ou+"/doc/errors/#"+e+" for details.";super(i),this.code=e,this.name="AssertionError",this.message=i}}var Mu=yI;class _I{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function A_(n){n.stopPropagation()}function xI(n){n.preventDefault()}var Mt=_I,Vr={PROPERTYCHANGE:"propertychange"};class vI{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}var Us=vI;function P_(n,e,t){let i,r;const s=t||cr;let o=0,a=n.length,c=!1;for(;o<a;)i=o+(a-o>>1),r=+s(n[i],e),r<0?o=i+1:(a=i,c=!r);return c?o:~o}function cr(n,e){return n>e?1:n<e?-1:0}function Ge(n,e){return n.indexOf(e)>=0}function bl(n,e,t){const i=n.length;if(n[0]<=e)return 0;if(e<=n[i-1])return i-1;{let r;if(t>0){for(r=1;r<i;++r)if(n[r]<e)return r-1}else if(t<0){for(r=1;r<i;++r)if(n[r]<=e)return r}else for(r=1;r<i;++r){if(n[r]==e)return r;if(n[r]<e)return typeof t=="function"?t(e,n[r-1],n[r])>0?r-1:r:n[r-1]-e<e-n[r]?r-1:r}return i-1}}function O_(n,e,t){for(;e<t;){const i=n[e];n[e]=n[t],n[t]=i,++e,--t}}function Xe(n,e){const t=Array.isArray(e)?e:[e],i=t.length;for(let r=0;r<i;r++)n[n.length]=t[r]}function wI(n,e){const t=n.indexOf(e),i=t>-1;return i&&n.splice(t,1),i}function zs(n,e){const t=n.length>>>0;let i;for(let r=0;r<t;r++)if(i=n[r],e(i,r,n))return i;return null}function Gi(n,e){const t=n.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function EI(n,e){const t=n.length,i=Array(n.length);let r;for(r=0;r<t;r++)i[r]={index:r,value:n[r]};for(i.sort(function(s,o){return e(s.value,o.value)||s.index-o.index}),r=0;r<n.length;r++)n[r]=i[r].value}function Fu(n,e){let t;return!n.every(function(r,s){return t=s,!e(r,s,n)})?t:-1}function M_(n,e,t){const i=e||cr;return n.every(function(r,s){if(s===0)return!0;const o=i(n[s-1],r);return!(o>0||t&&o===0)})}function Mn(){return!0}function Yr(){return!1}function Xr(){}function F_(n){let e=!1,t,i,r;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==r||!Gi(s,i))&&(e=!0,r=this,i=s,t=n.apply(this,arguments)),t}}function N_(n){function e(){let t;try{t=n()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}return e()}const J=typeof Object.assign=="function"?Object.assign:function(n,e){if(n==null)throw new TypeError("Cannot convert undefined or null to object");const t=Object(n);for(let i=1,r=arguments.length;i<r;++i){const s=arguments[i];if(s!=null)for(const o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t};function Zr(n){for(const e in n)delete n[e]}const Nu=typeof Object.values=="function"?Object.values:function(n){const e=[];for(const t in n)e.push(n[t]);return e};function xi(n){let e;for(e in n)return!1;return!e}class TI extends Us{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const i=this.listeners_||(this.listeners_={}),r=i[e]||(i[e]=[]);r.indexOf(t)===-1&&r.push(t)}dispatchEvent(e){const t=typeof e=="string",i=t?e:e.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=t?new Mt(e):e;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let c;for(let l=0,u=r.length;l<u;++l)if("handleEvent"in r[l]?c=r[l].handleEvent(s):c=r[l].call(this,s),c===!1||s.propagationStopped){c=!1;break}if(--o[i]===0){let l=a[i];for(delete a[i];l--;)this.removeEventListener(i,Xr);delete o[i]}return c}disposeInternal(){this.listeners_&&Zr(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){const i=this.listeners_&&this.listeners_[e];if(i){const r=i.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[r]=Xr,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}}var Wr=TI,ne={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function pe(n,e,t,i,r){if(i&&i!==n&&(t=t.bind(i)),r){const o=t;t=function(){n.removeEventListener(e,t),o.apply(this,arguments)}}const s={target:n,type:e,listener:t};return n.addEventListener(e,t),s}function Bs(n,e,t,i){return pe(n,e,t,i,!0)}function je(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Zr(n))}class ku extends Wr{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ne.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const i=e.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=pe(this,e[s],t);return r}else return pe(this,e,t)}onceInternal(e,t){let i;if(Array.isArray(e)){const r=e.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=Bs(this,e[s],t)}else i=Bs(this,e,t);return t.ol_key=i,i}unInternal(e,t){const i=t.ol_key;if(i)$u(i);else if(Array.isArray(e))for(let r=0,s=e.length;r<s;++r)this.removeEventListener(e[r],t);else this.removeEventListener(e,t)}}ku.prototype.on,ku.prototype.once,ku.prototype.un;function $u(n){if(Array.isArray(n))for(let e=0,t=n.length;e<t;++e)je(n[e]);else je(n)}var Du=ku;class np extends Mt{constructor(e,t,i){super(e),this.key=t,this.oldValue=i}}class bI extends Du{constructor(e){super(),this.on,this.once,this.un,se(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&J({},this.values_)||{}}hasProperties(){return!!this.values_}notify(e,t){let i;i=`change:${e}`,this.hasListener(i)&&this.dispatchEvent(new np(i,e,t)),i=Vr.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new np(i,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,i){const r=this.values_||(this.values_={});if(i)r[e]=t;else{const s=r[e];r[e]=t,s!==t&&this.notify(e,s)}}setProperties(e,t){for(const i in e)this.set(i,e[i],t)}applyProperties(e){!e.values_||J(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const i=this.values_[e];delete this.values_[e],xi(this.values_)&&(this.values_=null),t||this.notify(e,i)}}}var Fn=bI,wt={ADD:"add",REMOVE:"remove"};const k_={LENGTH:"length"};class Sl extends Mt{constructor(e,t,i){super(e),this.element=t,this.index=i}}class SI extends Fn{constructor(e,t){super(),this.on,this.once,this.un;const i=t||{};if(this.unique_=!!i.unique,this.array_=e||[],this.unique_)for(let r=0,s=this.array_.length;r<s;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,i=e.length;t<i;++t)this.push(e[t]);return this}forEach(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)e(t[i],i,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(k_.LENGTH)}insertAt(e,t){this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new Sl(wt.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)if(t[i]===e)return this.removeAt(i)}removeAt(e){const t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new Sl(wt.REMOVE,t,e)),t}setAt(e,t){const i=this.getLength();if(e<i){this.unique_&&this.assertUnique_(t,e);const r=this.array_[e];this.array_[e]=t,this.dispatchEvent(new Sl(wt.REMOVE,r,e)),this.dispatchEvent(new Sl(wt.ADD,t,e))}else{for(let r=i;r<e;++r)this.insertAt(r,void 0);this.insertAt(e,t)}}updateLength_(){this.set(k_.LENGTH,this.array_.length)}assertUnique_(e,t){for(let i=0,r=this.array_.length;i<r;++i)if(this.array_[i]===e&&i!==t)throw new Mu(58)}}var At=SI,W={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function ip(n){return Math.pow(n,3)}function Hr(n){return 1-ip(1-n)}function Gu(n){return 3*n*n-2*n*n*n}function $_(n){return n}function RI(n){return n<.5?Gu(2*n):1-Gu(2*(n-.5))}class II extends Wr{constructor(e,t,i){super();const r=i||{};this.tileCoord=e,this.state=t,this.interimTile=null,this.key="",this.transition_=r.transition===void 0?250:r.transition,this.transitionStarts_={},this.interpolate=!!r.interpolate}changed(){this.dispatchEvent(ne.CHANGE)}release(){}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let e=this.interimTile;do{if(e.getState()==W.LOADED)return this.transition_=0,e;e=e.interimTile}while(e);return this}refreshInterimChain(){if(!this.interimTile)return;let e=this.interimTile,t=this;do{if(e.getState()==W.LOADED){e.interimTile=null;break}else e.getState()==W.LOADING?t=e:e.getState()==W.IDLE?t.interimTile=e.interimTile:t=e;e=t.interimTile}while(e)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==W.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}load(){he()}getAlpha(e,t){if(!this.transition_)return 1;let i=this.transitionStarts_[e];if(!i)i=t,this.transitionStarts_[e]=i;else if(i===-1)return 1;const r=t-i+1e3/60;return r>=this.transition_?1:ip(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}}var Kr=II;class CI extends Kr{constructor(e){const t=W.IDLE;super(e.tileCoord,t,{transition:e.transition,interpolate:e.interpolate}),this.loader_=e.loader,this.data_=null,this.error_=null}getData(){return this.data_}getError(){return this.error_}load(){this.state=W.LOADING,this.changed();const e=this;this.loader_().then(function(t){e.data_=t,e.state=W.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=W.ERROR,e.changed()})}}var rp=CI;function ce(n,e){if(!n)throw new Mu(e)}class Ky extends Fn{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const t=e;this.setGeometry(t)}else{const t=e;this.setProperties(t)}}clone(){const e=new Ky(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const t=this.getGeometry();t&&e.setGeometry(t.clone());const i=this.getStyle();return i&&e.setStyle(i),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(je(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=pe(e,ne.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?D_(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function D_(n){if(typeof n=="function")return n;{let e;return Array.isArray(n)?e=n:(ce(typeof n.getZIndex=="function",41),e=[n]),function(){return e}}}var it=Ky,H={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},R={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};const vi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},LI={9001:vi.METERS,9002:vi.FEET,9003:vi.USFEET,9101:vi.RADIANS,9102:vi.DEGREES};function sp(n){return LI[n]}const on={};on[vi.RADIANS]=6370997/(2*Math.PI),on[vi.DEGREES]=2*Math.PI*6370997/360,on[vi.FEET]=.3048,on[vi.METERS]=1,on[vi.USFEET]=1200/3937;var gn=vi;const Ho=typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"?navigator.userAgent.toLowerCase():"",G_=Ho.indexOf("firefox")!==-1,AI=Ho.indexOf("safari")!==-1&&Ho.indexOf("chrom")==-1,U_=Ho.indexOf("webkit")!==-1&&Ho.indexOf("edge")==-1,op=Ho.indexOf("macintosh")!==-1,Uu=typeof devicePixelRatio!="undefined"?devicePixelRatio:1,Rl=typeof WorkerGlobalScope!="undefined"&&typeof OffscreenCanvas!="undefined"&&self instanceof WorkerGlobalScope,z_=typeof Image!="undefined"&&Image.prototype.decode,ap=function(){let n=!1;try{const e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n}(),lp=new Array(6);function dt(){return[1,0,0,1,0,0]}function Ko(n){return qo(n,1,0,0,1,0,0)}function js(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],c=e[0],l=e[1],u=e[2],h=e[3],d=e[4],f=e[5];return n[0]=t*c+r*l,n[1]=i*c+s*l,n[2]=t*u+r*h,n[3]=i*u+s*h,n[4]=t*d+r*f+o,n[5]=i*d+s*f+a,n}function qo(n,e,t,i,r,s,o){return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n[4]=s,n[5]=o,n}function B_(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function Je(n,e){const t=e[0],i=e[1];return e[0]=n[0]*t+n[2]*i+n[4],e[1]=n[1]*t+n[3]*i+n[5],e}function j_(n,e){const t=Math.cos(e),i=Math.sin(e);return js(n,qo(lp,t,i,-i,t,0,0))}function Jo(n,e,t){return js(n,qo(lp,e,0,0,t,0,0))}function V_(n,e,t){return qo(n,e,0,0,t,0,0)}function Y_(n,e,t){return js(n,qo(lp,1,0,0,1,e,t))}function Ht(n,e,t,i,r,s,o,a){const c=Math.sin(s),l=Math.cos(s);return n[0]=i*l,n[1]=r*c,n[2]=-i*c,n[3]=r*l,n[4]=o*i*l-a*i*c+e,n[5]=o*r*c+a*r*l+t,n}function PI(n,e,t,i,r,s,o){return Il(Ht(dt(),n,e,t,i,r,s,o))}function OI(n){return Vs(n,n)}function Vs(n,e){const t=X_(e);ce(t!==0,32);const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],c=e[5];return n[0]=o/t,n[1]=-r/t,n[2]=-s/t,n[3]=i/t,n[4]=(s*c-o*a)/t,n[5]=-(i*c-r*a)/t,n}function X_(n){return n[0]*n[3]-n[1]*n[2]}let Z_;function Il(n){const e="matrix("+n.join(", ")+")";if(Rl)return e;const t=Z_||(Z_=document.createElement("div"));return t.style.transform=e,t.style.transform}var Qo={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},Dt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function yt(n){const e=Kt();for(let t=0,i=n.length;t<i;++t)Xs(e,n[t]);return e}function MI(n,e,t){const i=Math.min.apply(null,n),r=Math.min.apply(null,e),s=Math.max.apply(null,n),o=Math.max.apply(null,e);return $n(i,r,s,o,t)}function Nn(n,e,t){return t?(t[0]=n[0]-e,t[1]=n[1]-e,t[2]=n[2]+e,t[3]=n[3]+e,t):[n[0]-e,n[1]-e,n[2]+e,n[3]+e]}function cp(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function qr(n,e,t){let i,r;return e<n[0]?i=n[0]-e:n[2]<e?i=e-n[2]:i=0,t<n[1]?r=n[1]-t:n[3]<t?r=t-n[3]:r=0,i*i+r*r}function kn(n,e){return zu(n,e[0],e[1])}function Gt(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function zu(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function Bu(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1];let c=Dt.UNKNOWN;return o<t?c=c|Dt.LEFT:o>r&&(c=c|Dt.RIGHT),a<i?c=c|Dt.BELOW:a>s&&(c=c|Dt.ABOVE),c===Dt.UNKNOWN&&(c=Dt.INTERSECTING),c}function Kt(){return[1/0,1/0,-1/0,-1/0]}function $n(n,e,t,i,r){return r?(r[0]=n,r[1]=e,r[2]=t,r[3]=i,r):[n,e,t,i]}function Jr(n){return $n(1/0,1/0,-1/0,-1/0,n)}function Ys(n,e){const t=n[0],i=n[1];return $n(t,i,t,i,e)}function FI(n,e){const t=Jr(e);return hp(t,n)}function ju(n,e,t,i,r){const s=Jr(r);return dp(s,n,e,t,i)}function NI(n,e){const t=Jr(e);return H_(t,n)}function Kn(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function W_(n,e,t){return Math.abs(n[0]-e[0])<t&&Math.abs(n[2]-e[2])<t&&Math.abs(n[1]-e[1])<t&&Math.abs(n[3]-e[3])<t}function up(n,e){return e[0]<n[0]&&(n[0]=e[0]),e[2]>n[2]&&(n[2]=e[2]),e[1]<n[1]&&(n[1]=e[1]),e[3]>n[3]&&(n[3]=e[3]),n}function Xs(n,e){e[0]<n[0]&&(n[0]=e[0]),e[0]>n[2]&&(n[2]=e[0]),e[1]<n[1]&&(n[1]=e[1]),e[1]>n[3]&&(n[3]=e[1])}function hp(n,e){for(let t=0,i=e.length;t<i;++t)Xs(n,e[t]);return n}function dp(n,e,t,i,r){for(;t<i;t+=r)K_(n,e[t],e[t+1]);return n}function H_(n,e){for(let t=0,i=e.length;t<i;++t)hp(n,e[t]);return n}function K_(n,e,t){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}function Vu(n,e){let t;return t=e(Zs(n)),t||(t=e(Ws(n)),t)||(t=e(ta(n)),t)||(t=e(si(n)),t)?t:!1}function ea(n){let e=0;return Qr(n)||(e=be(n)*ot(n)),e}function Zs(n){return[n[0],n[1]]}function Ws(n){return[n[2],n[1]]}function Ut(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function q_(n,e){let t;return e===Qo.BOTTOM_LEFT?t=Zs(n):e===Qo.BOTTOM_RIGHT?t=Ws(n):e===Qo.TOP_LEFT?t=si(n):e===Qo.TOP_RIGHT?t=ta(n):ce(!1,13),t}function kI(n,e){const t=Math.min(n[0],e[0]),i=Math.min(n[1],e[1]),r=Math.max(n[2],e[2]),s=Math.max(n[3],e[3]);return(r-t)*(s-i)}function Hs(n,e,t,i,r){const s=e*i[0]/2,o=e*i[1]/2,a=Math.cos(t),c=Math.sin(t),l=s*a,u=s*c,h=o*a,d=o*c,f=n[0],p=n[1],m=f-l+d,g=f-l-d,y=f+l-d,_=f+l+d,v=p-u-h,x=p-u+h,w=p+u+h,E=p+u-h;return $n(Math.min(m,g,y,_),Math.min(v,x,w,E),Math.max(m,g,y,_),Math.max(v,x,w,E),r)}function ot(n){return n[3]-n[1]}function $I(n,e){const t=an(n,e);return ea(t)}function an(n,e,t){const i=t||Kt();return at(n,e)?(n[0]>e[0]?i[0]=n[0]:i[0]=e[0],n[1]>e[1]?i[1]=n[1]:i[1]=e[1],n[2]<e[2]?i[2]=n[2]:i[2]=e[2],n[3]<e[3]?i[3]=n[3]:i[3]=e[3]):Jr(i),i}function DI(n){return be(n)+ot(n)}function GI(n){return[n[2]-n[0],n[3]-n[1]]}function si(n){return[n[0],n[3]]}function ta(n){return[n[2],n[3]]}function be(n){return n[2]-n[0]}function at(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function Qr(n){return n[2]<n[0]||n[3]<n[1]}function J_(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function Cl(n,e){const t=(n[2]-n[0])/2*(e-1),i=(n[3]-n[1])/2*(e-1);n[0]-=t,n[2]+=t,n[1]-=i,n[3]+=i}function Q_(n,e,t){let i=!1;const r=Bu(n,e),s=Bu(n,t);if(r===Dt.INTERSECTING||s===Dt.INTERSECTING)i=!0;else{const o=n[0],a=n[1],c=n[2],l=n[3],u=e[0],h=e[1],d=t[0],f=t[1],p=(f-h)/(d-u);let m,g;!!(s&Dt.ABOVE)&&!(r&Dt.ABOVE)&&(m=d-(f-l)/p,i=m>=o&&m<=c),!i&&!!(s&Dt.RIGHT)&&!(r&Dt.RIGHT)&&(g=f-(d-c)*p,i=g>=a&&g<=l),!i&&!!(s&Dt.BELOW)&&!(r&Dt.BELOW)&&(m=d-(f-a)/p,i=m>=o&&m<=c),!i&&!!(s&Dt.LEFT)&&!(r&Dt.LEFT)&&(g=f-(d-o)*p,i=g>=a&&g<=l)}return i}function Ks(n,e,t,i){let r=[];if(i>1){const a=n[2]-n[0],c=n[3]-n[1];for(let l=0;l<i;++l)r.push(n[0]+a*l/i,n[1],n[2],n[1]+c*l/i,n[2]-a*l/i,n[3],n[0],n[3]-c*l/i)}else r=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]];e(r,r,2);const s=[],o=[];for(let a=0,c=r.length;a<c;a+=2)s.push(r[a]),o.push(r[a+1]);return MI(s,o,t)}function fp(n,e){const t=e.getExtent(),i=Ut(n);if(e.canWrapX()&&(i[0]<t[0]||i[0]>=t[2])){const r=be(t),o=Math.floor((i[0]-t[0])/r)*r;n[0]-=o,n[2]-=o}return n}class UI{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||on[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}var qs=UI;function we(n,e,t){return Math.min(Math.max(n,e),t)}const ex=function(){let n;return"cosh"in Math?n=Math.cosh:n=function(e){const t=Math.exp(e);return(t+1/t)/2},n}(),pp=function(){let n;return"log2"in Math?n=Math.log2:n=function(e){return Math.log(e)*Math.LOG2E},n}();function gp(n,e,t,i,r,s){const o=r-t,a=s-i;if(o!==0||a!==0){const c=((n-t)*o+(e-i)*a)/(o*o+a*a);c>1?(t=r,i=s):c>0&&(t+=o*c,i+=a*c)}return ur(n,e,t,i)}function ur(n,e,t,i){const r=t-n,s=i-e;return r*r+s*s}function tx(n){const e=n.length;for(let i=0;i<e;i++){let r=i,s=Math.abs(n[i][i]);for(let a=i+1;a<e;a++){const c=Math.abs(n[a][i]);c>s&&(s=c,r=a)}if(s===0)return null;const o=n[r];n[r]=n[i],n[i]=o;for(let a=i+1;a<e;a++){const c=-n[a][i]/n[i][i];for(let l=i;l<e+1;l++)i==l?n[a][l]=0:n[a][l]+=c*n[i][l]}}const t=new Array(e);for(let i=e-1;i>=0;i--){t[i]=n[i][e]/n[i][i];for(let r=i-1;r>=0;r--)n[r][e]-=n[r][i]*t[i]}return t}function Ll(n){return n*180/Math.PI}function zt(n){return n*Math.PI/180}function oi(n,e){const t=n%e;return t*e<0?t+e:t}function Ui(n,e,t){return n+t*(e-n)}function Yu(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function mp(n,e){return Math.round(Yu(n,e))}function Js(n,e){return Math.floor(Yu(n,e))}function hr(n,e){return Math.ceil(Yu(n,e))}const na=6378137,Qs=Math.PI*na,nx=[-Qs,-Qs,Qs,Qs],ix=[-180,-85,180,85],Al=na*Math.log(Math.tan(Math.PI/2));class ia extends qs{constructor(e){super({code:e,units:gn.METERS,extent:nx,global:!0,worldExtent:ix,getPointResolution:function(t,i){return t/ex(i[1]/na)}})}}const yp=[new ia("EPSG:3857"),new ia("EPSG:102100"),new ia("EPSG:102113"),new ia("EPSG:900913"),new ia("http://www.opengis.net/def/crs/EPSG/0/3857"),new ia("http://www.opengis.net/gml/srs/epsg.xml#3857")];function rx(n,e,t){const i=n.length,r=t>1?t:2;let s=e;s===void 0&&(r>2?s=n.slice():s=new Array(i));for(let o=0;o<i;o+=r){s[o]=Qs*n[o]/180;let a=na*Math.log(Math.tan(Math.PI*(+n[o+1]+90)/360));a>Al?a=Al:a<-Al&&(a=-Al),s[o+1]=a}return s}function sx(n,e,t){const i=n.length,r=t>1?t:2;let s=e;s===void 0&&(r>2?s=n.slice():s=new Array(i));for(let o=0;o<i;o+=r)s[o]=180*n[o]/Qs,s[o+1]=360*Math.atan(Math.exp(n[o+1]/na))/Math.PI-90;return s}const ox=6378137,_p=[-180,-90,180,90],ax=Math.PI*ox/180;class eo extends qs{constructor(e,t){super({code:e,units:gn.DEGREES,extent:_p,axisOrientation:t,global:!0,metersPerUnit:ax,worldExtent:_p})}}const xp=[new eo("CRS:84"),new eo("EPSG:4326","neu"),new eo("urn:ogc:def:crs:OGC:1.3:CRS84"),new eo("urn:ogc:def:crs:OGC:2:84"),new eo("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new eo("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new eo("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Xu={};function lx(){Xu={}}function cx(n){return Xu[n]||Xu[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function ux(n,e){Xu[n]=e}let wi={};function hx(){wi={}}function to(n,e,t){const i=n.getCode(),r=e.getCode();i in wi||(wi[i]={}),wi[i][r]=t}function zI(n,e){const t=n.getCode(),i=e.getCode(),r=wi[t][i];return delete wi[t][i],xi(wi[t])&&delete wi[t],r}function vp(n,e){let t;return n in wi&&e in wi[n]&&(t=wi[n][e]),t}function es(n,e,t){const i=t!==void 0?n.toFixed(t):""+n;let r=i.indexOf(".");return r=r===-1?i.length:r,r>e?i:new Array(1+e-r).join("0")+i}function wp(n,e){const t=(""+n).split("."),i=(""+e).split(".");for(let r=0;r<Math.max(t.length,i.length);r++){const s=parseInt(t[r]||"0",10),o=parseInt(i[r]||"0",10);if(s>o)return 1;if(o>s)return-1}return 0}function Ep(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function dx(n,e){const t=e.getRadius(),i=e.getCenter(),r=i[0],s=i[1],o=n[0],a=n[1];let c=o-r;const l=a-s;c===0&&l===0&&(c=1);const u=Math.sqrt(c*c+l*l),h=r+t*c/u,d=s+t*l/u;return[h,d]}function Pl(n,e){const t=n[0],i=n[1],r=e[0],s=e[1],o=r[0],a=r[1],c=s[0],l=s[1],u=c-o,h=l-a,d=u===0&&h===0?0:(u*(t-o)+h*(i-a))/(u*u+h*h||0);let f,p;return d<=0?(f=o,p=a):d>=1?(f=c,p=l):(f=o+d*u,p=a+d*h),[f,p]}function BI(n){return function(e){return px(e,n)}}function Ol(n,e,t){const i=oi(e+180,360)-180,r=Math.abs(3600*i),s=t||0,o=Math.pow(10,s);let a=Math.floor(r/3600),c=Math.floor((r-a*3600)/60),l=r-a*3600-c*60;return l=Math.ceil(l*o)/o,l>=60&&(l=0,c+=1),c>=60&&(c=0,a+=1),a+"\xB0 "+es(c,2)+"\u2032 "+es(l,2,s)+"\u2033"+(i==0?"":" "+n.charAt(i<0?1:0))}function fx(n,e,t){return n?e.replace("{x}",n[0].toFixed(t)).replace("{y}",n[1].toFixed(t)):""}function ai(n,e){let t=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=e[i]){t=!1;break}return t}function Zu(n,e){const t=Math.cos(e),i=Math.sin(e),r=n[0]*t-n[1]*i,s=n[1]*t+n[0]*i;return n[0]=r,n[1]=s,n}function Tp(n,e){return n[0]*=e,n[1]*=e,n}function Dn(n,e){const t=n[0]-e[0],i=n[1]-e[1];return t*t+i*i}function Ml(n,e){return Math.sqrt(Dn(n,e))}function Fl(n,e){return Dn(n,Pl(n,e))}function jI(n,e){return n?Ol("NS",n[1],e)+" "+Ol("EW",n[0],e):""}function px(n,e){return fx(n,"{x}, {y}",e)}function Wu(n,e){if(e.canWrapX()){const t=be(e.getExtent()),i=bp(n,e,t);i&&(n[0]-=i*t)}return n}function bp(n,e,t){const i=e.getExtent();let r=0;if(e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])){const s=t||be(i);r=Math.floor((n[0]-i[0])/s)}return r}const Nl=63710088e-1;function Hu(n,e,t){const i=t||Nl,r=zt(n[1]),s=zt(e[1]),o=(s-r)/2,a=zt(e[0]-n[0])/2,c=Math.sin(o)*Math.sin(o)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(s);return 2*i*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))}function Sp(n,e){let t=0;for(let i=0,r=n.length;i<r-1;++i)t+=Hu(n[i],n[i+1],e);return t}function gx(n,e){const t=e||{},i=t.radius||Nl,r=t.projection||"EPSG:3857",s=n.getType();s!==R.GEOMETRY_COLLECTION&&(n=n.clone().transform(r,"EPSG:4326"));let o=0,a,c,l,u,h,d;switch(s){case R.POINT:case R.MULTI_POINT:break;case R.LINE_STRING:case R.LINEAR_RING:{a=n.getCoordinates(),o=Sp(a,i);break}case R.MULTI_LINE_STRING:case R.POLYGON:{for(a=n.getCoordinates(),l=0,u=a.length;l<u;++l)o+=Sp(a[l],i);break}case R.MULTI_POLYGON:{for(a=n.getCoordinates(),l=0,u=a.length;l<u;++l)for(c=a[l],h=0,d=c.length;h<d;++h)o+=Sp(c[h],i);break}case R.GEOMETRY_COLLECTION:{const f=n.getGeometries();for(l=0,u=f.length;l<u;++l)o+=gx(f[l],e);break}default:throw new Error("Unsupported geometry type: "+s)}return o}function Ku(n,e){let t=0;const i=n.length;let r=n[i-1][0],s=n[i-1][1];for(let o=0;o<i;o++){const a=n[o][0],c=n[o][1];t+=zt(a-r)*(2+Math.sin(zt(s))+Math.sin(zt(c))),r=a,s=c}return t*e*e/2}function mx(n,e){const t=e||{},i=t.radius||Nl,r=t.projection||"EPSG:3857",s=n.getType();s!==R.GEOMETRY_COLLECTION&&(n=n.clone().transform(r,"EPSG:4326"));let o=0,a,c,l,u,h,d;switch(s){case R.POINT:case R.MULTI_POINT:case R.LINE_STRING:case R.MULTI_LINE_STRING:case R.LINEAR_RING:break;case R.POLYGON:{for(a=n.getCoordinates(),o=Math.abs(Ku(a[0],i)),l=1,u=a.length;l<u;++l)o-=Math.abs(Ku(a[l],i));break}case R.MULTI_POLYGON:{for(a=n.getCoordinates(),l=0,u=a.length;l<u;++l)for(c=a[l],o+=Math.abs(Ku(c[0],i)),h=1,d=c.length;h<d;++h)o-=Math.abs(Ku(c[h],i));break}case R.GEOMETRY_COLLECTION:{const f=n.getGeometries();for(l=0,u=f.length;l<u;++l)o+=mx(f[l],e);break}default:throw new Error("Unsupported geometry type: "+s)}return o}function yx(n,e,t,i){const r=i||Nl,s=zt(n[1]),o=zt(n[0]),a=e/r,c=Math.asin(Math.sin(s)*Math.cos(a)+Math.cos(s)*Math.sin(a)*Math.cos(t)),l=o+Math.atan2(Math.sin(t)*Math.sin(a)*Math.cos(s),Math.cos(a)-Math.sin(s)*Math.sin(c));return[Ll(l),Ll(c)]}let Rp=!0;function Ip(n){Rp=!(n===void 0?!0:n)}function qu(n,e,t){let i;if(e!==void 0){for(let r=0,s=n.length;r<s;++r)e[r]=n[r];i=e}else i=n.slice();return i}function kl(n,e,t){if(e!==void 0&&n!==e){for(let i=0,r=n.length;i<r;++i)e[i]=n[i];n=e}return n}function Cp(n){ux(n.getCode(),n),to(n,n,qu)}function _x(n){n.forEach(Cp)}function re(n){return typeof n=="string"?cx(n):n||null}function $l(n,e,t,i){n=re(n);let r;const s=n.getPointResolutionFunc();if(s){if(r=s(e,t),i&&i!==n.getUnits()){const o=n.getMetersPerUnit();o&&(r=r*o/on[i])}}else{const o=n.getUnits();if(o==gn.DEGREES&&!i||i==gn.DEGREES)r=e;else{const a=qn(n,re("EPSG:4326"));if(a===kl&&o!==gn.DEGREES)r=e*n.getMetersPerUnit();else{let l=[t[0]-e/2,t[1],t[0]+e/2,t[1],t[0],t[1]-e/2,t[0],t[1]+e/2];l=a(l,l,2);const u=Hu(l.slice(0,2),l.slice(2,4)),h=Hu(l.slice(4,6),l.slice(6,8));r=(u+h)/2}const c=i?on[i]:n.getMetersPerUnit();c!==void 0&&(r/=c)}}return r}function Ju(n){_x(n),n.forEach(function(e){n.forEach(function(t){e!==t&&to(e,t,qu)})})}function xx(n,e,t,i){n.forEach(function(r){e.forEach(function(s){to(r,s,t),to(s,r,i)})})}function VI(){lx(),hx()}function Qu(n,e){return n?typeof n=="string"?re(n):n:re(e)}function Lp(n){return function(e,t,i){const r=e.length,s=i!==void 0?i:2,o=t!==void 0?t:new Array(r);for(let a=0;a<r;a+=s){const c=n([e[a],e[a+1]]);o[a]=c[0],o[a+1]=c[1];for(let l=s-1;l>=2;--l)o[a+l]=e[a+l]}return o}}function vx(n,e,t,i){const r=re(n),s=re(e);to(r,s,Lp(t)),to(s,r,Lp(i))}function Ap(n,e){return Ip(),ts(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function YI(n,e){const t=ts(n,e!==void 0?e:"EPSG:3857","EPSG:4326"),i=t[0];return(i<-180||i>180)&&(t[0]=oi(i+180,360)-180),t}function Gn(n,e){if(n===e)return!0;const t=n.getUnits()===e.getUnits();return(n.getCode()===e.getCode()||qn(n,e)===qu)&&t}function qn(n,e){const t=n.getCode(),i=e.getCode();let r=vp(t,i);return r||(r=kl),r}function Ei(n,e){const t=re(n),i=re(e);return qn(t,i)}function ts(n,e,t){return Ei(e,t)(n,void 0,n.length)}function ra(n,e,t,i){const r=Ei(e,t);return Ks(n,r,void 0,i)}function XI(n,e,t){return qn(e,t)(n)}let wn=null;function wx(n){wn=re(n)}function ZI(){wn=null}function En(){return wn}function WI(){wx("EPSG:4326")}function dr(n,e){return wn?ts(n,e,wn):n}function rt(n,e){return wn?ts(n,wn,e):(Rp&&!ai(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Rp=!1,console.warn("Call useGeographic() ol/proj once to work with [longitude, latitude] coordinates.")),n)}function ns(n,e){return wn?ra(n,e,wn):n}function Un(n,e){return wn?ra(n,wn,e):n}function Ex(n,e){if(!wn)return n;const t=re(e).getUnits(),i=wn.getUnits();return t&&i?n*on[t]/on[i]:n}function Tx(n,e){if(!wn)return n;const t=re(e).getUnits(),i=wn.getUnits();return t&&i?n*on[i]/on[t]:n}function Pp(n,e,t){return function(i){let r=i[0],s=i[1],o,a;if(n.canWrapX()){const c=n.getExtent(),l=be(c);a=bp(i,n,l),a&&(r=r-a*l),r=we(r,c[0],c[2]),s=we(s,c[1],c[3]),o=t([r,s])}else o=t(i);return a&&e.canWrapX()&&(o[0]+=a*be(e.getExtent())),o}}function bx(){Ju(yp),Ju(xp),xx(xp,yp,rx,sx)}bx();function fr(n,e,t,i,r,s){const o=s||[];let a=0;for(let c=e;c<t;c+=i){const l=n[c],u=n[c+1];o[a++]=r[0]*l+r[2]*u+r[4],o[a++]=r[1]*l+r[3]*u+r[5]}return s&&o.length!=a&&(o.length=a),o}function eh(n,e,t,i,r,s,o){const a=o||[],c=Math.cos(r),l=Math.sin(r),u=s[0],h=s[1];let d=0;for(let f=e;f<t;f+=i){const p=n[f]-u,m=n[f+1]-h;a[d++]=u+p*c-m*l,a[d++]=h+p*l+m*c;for(let g=f+2;g<f+i;++g)a[d++]=n[g]}return o&&a.length!=d&&(a.length=d),a}function Sx(n,e,t,i,r,s,o,a){const c=a||[],l=o[0],u=o[1];let h=0;for(let d=e;d<t;d+=i){const f=n[d]-l,p=n[d+1]-u;c[h++]=l+r*f,c[h++]=u+s*p;for(let m=d+2;m<d+i;++m)c[h++]=n[m]}return a&&c.length!=h&&(c.length=h),c}function Op(n,e,t,i,r,s,o){const a=o||[];let c=0;for(let l=e;l<t;l+=i){a[c++]=n[l]+r,a[c++]=n[l+1]+s;for(let u=l+2;u<l+i;++u)a[c++]=n[u]}return o&&a.length!=c&&(a.length=c),a}const Rx=dt();class HI extends Fn{constructor(){super(),this.extent_=Kt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=F_(function(e,t,i){if(!i)return this.getSimplifiedGeometry(t);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return he()}closestPointXY(e,t,i,r){return he()}containsXY(e,t){const i=this.getClosestPoint([e,t]);return i[0]===e&&i[1]===t}getClosestPoint(e,t){const i=t||[NaN,NaN];return this.closestPointXY(e[0],e[1],i,1/0),i}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return he()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Jr(t),this.extentRevision_=this.getRevision()}return J_(this.extent_,e)}rotate(e,t){he()}scale(e,t,i){he()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return he()}getType(){return he()}applyTransform(e){he()}intersectsExtent(e){return he()}translate(e,t){he()}transform(e,t){const i=re(e),r=i.getUnits()==gn.TILE_PIXELS?function(s,o,a){const c=i.getExtent(),l=i.getWorldExtent(),u=ot(l)/ot(c);return Ht(Rx,l[0],l[3],u,-u,0,0,0),fr(s,0,s.length,a,Rx,o),Ei(i,t)(s,o,a)}:Ei(i,t);return this.applyTransform(r),this}}var Mp=HI;class KI extends Mp{constructor(){super(),this.layout=H.XY,this.stride=2,this.flatCoordinates=null}computeExtent(e){return ju(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return he()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=th(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){he()}setLayout(e,t,i){let r;if(e)r=th(e);else{for(let s=0;s<i;++s)if(t.length===0){this.layout=H.XY,this.stride=2;return}else t=t[0];r=t.length,e=qI(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();eh(i,0,i.length,r,e,t,i),this.changed()}}scale(e,t,i){let r=t;r===void 0&&(r=e);let s=i;s||(s=Ut(this.getExtent()));const o=this.getFlatCoordinates();if(o){const a=this.getStride();Sx(o,0,o.length,a,e,r,s,o),this.changed()}}translate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Op(i,0,i.length,r,e,t,i),this.changed()}}}function qI(n){let e;return n==2?e=H.XY:n==3?e=H.XYZ:n==4&&(e=H.XYZM),e}function th(n){let e;return n==H.XY?e=2:n==H.XYZ||n==H.XYM?e=3:n==H.XYZM&&(e=4),e}function Ix(n,e,t){const i=n.getFlatCoordinates();if(i){const r=n.getStride();return fr(i,0,i.length,r,e,t)}else return null}var Ti=KI;function Cx(n,e,t,i,r,s,o){const a=n[e],c=n[e+1],l=n[t]-a,u=n[t+1]-c;let h;if(l===0&&u===0)h=e;else{const d=((r-a)*l+(s-c)*u)/(l*l+u*u);if(d>1)h=t;else if(d>0){for(let f=0;f<i;++f)o[f]=Ui(n[e+f],n[t+f],d);o.length=i;return}else h=e}for(let d=0;d<i;++d)o[d]=n[h+d];o.length=i}function nh(n,e,t,i,r){let s=n[e],o=n[e+1];for(e+=i;e<t;e+=i){const a=n[e],c=n[e+1],l=ur(s,o,a,c);l>r&&(r=l),s=a,o=c}return r}function ih(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=nh(n,e,a,i,r),e=a}return r}function Lx(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=ih(n,e,a,i,r),e=a[a.length-1]}return r}function rh(n,e,t,i,r,s,o,a,c,l,u){if(e==t)return l;let h,d;if(r===0)if(d=ur(o,a,n[e],n[e+1]),d<l){for(h=0;h<i;++h)c[h]=n[e+h];return c.length=i,d}else return l;const f=u||[NaN,NaN];let p=e+i;for(;p<t;)if(Cx(n,p-i,p,i,o,a,f),d=ur(o,a,f[0],f[1]),d<l){for(l=d,h=0;h<i;++h)c[h]=f[h];c.length=i,p+=i}else p+=i*Math.max((Math.sqrt(d)-Math.sqrt(l))/r|0,1);if(s&&(Cx(n,t-i,e,i,o,a,f),d=ur(o,a,f[0],f[1]),d<l)){for(l=d,h=0;h<i;++h)c[h]=f[h];c.length=i}return l}function sh(n,e,t,i,r,s,o,a,c,l,u){const h=u||[NaN,NaN];for(let d=0,f=t.length;d<f;++d){const p=t[d];l=rh(n,e,p,i,r,s,o,a,c,l,h),e=p}return l}function Ax(n,e,t,i,r,s,o,a,c,l,u){const h=u||[NaN,NaN];for(let d=0,f=t.length;d<f;++d){const p=t[d];l=sh(n,e,p,i,r,s,o,a,c,l,h),e=p[p.length-1]}return l}function Fp(n,e,t,i){for(let r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function sa(n,e,t,i){for(let r=0,s=t.length;r<s;++r){const o=t[r];for(let a=0;a<i;++a)n[e++]=o[a]}return e}function oh(n,e,t,i,r){const s=r||[];let o=0;for(let a=0,c=t.length;a<c;++a){const l=sa(n,e,t[a],i);s[o++]=l,e=l}return s.length=o,s}function Px(n,e,t,i,r){const s=r||[];let o=0;for(let a=0,c=t.length;a<c;++a){const l=oh(n,e,t[a],i,s[o]);s[o++]=l,e=l[l.length-1]}return s.length=o,s}function JI(n,e,t,i,r,s,o){const a=o!==void 0?o:[];return s||(t=Ox(n,e,t,i,r,a,0),n=a,e=0,i=2),a.length=Dl(n,e,t,i,r,a,0),a}function Dl(n,e,t,i,r,s,o){const a=(t-e)/i;if(a<3){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}const c=new Array(a);c[0]=1,c[a-1]=1;const l=[e,t-i];let u=0;for(;l.length>0;){const h=l.pop(),d=l.pop();let f=0;const p=n[d],m=n[d+1],g=n[h],y=n[h+1];for(let _=d+i;_<h;_+=i){const v=n[_],x=n[_+1],w=gp(v,x,p,m,g,y);w>f&&(u=_,f=w)}f>r&&(c[(u-e)/i]=1,d+i<u&&l.push(d,u),u+i<h&&l.push(u,h))}for(let h=0;h<a;++h)c[h]&&(s[o++]=n[e+h*i],s[o++]=n[e+h*i+1]);return o}function Np(n,e,t,i,r,s,o,a){for(let c=0,l=t.length;c<l;++c){const u=t[c];o=Dl(n,e,u,i,r,s,o),a.push(o),e=u}return o}function QI(n,e,t,i,r,s,o,a){for(let c=0,l=t.length;c<l;++c){const u=t[c],h=[];o=Np(n,e,u,i,r,s,o,h),a.push(h),e=u[u.length-1]}return o}function Ox(n,e,t,i,r,s,o){if(t<=e+i){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}let a=n[e],c=n[e+1];s[o++]=a,s[o++]=c;let l=a,u=c;for(e+=i;e<t;e+=i)l=n[e],u=n[e+1],ur(a,c,l,u)>r&&(s[o++]=l,s[o++]=u,a=l,c=u);return(l!=a||u!=c)&&(s[o++]=l,s[o++]=u),o}function is(n,e){return e*Math.round(n/e)}function Mx(n,e,t,i,r,s,o){if(e==t)return o;let a=is(n[e],r),c=is(n[e+1],r);e+=i,s[o++]=a,s[o++]=c;let l,u;do if(l=is(n[e],r),u=is(n[e+1],r),e+=i,e==t)return s[o++]=l,s[o++]=u,o;while(l==a&&u==c);for(;e<t;){const h=is(n[e],r),d=is(n[e+1],r);if(e+=i,h==l&&d==u)continue;const f=l-a,p=u-c,m=h-a,g=d-c;if(f*g==p*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(p<0&&g<p||p==g||p>0&&g>p)){l=h,u=d;continue}s[o++]=l,s[o++]=u,a=l,c=u,l=h,u=d}return s[o++]=l,s[o++]=u,o}function kp(n,e,t,i,r,s,o,a){for(let c=0,l=t.length;c<l;++c){const u=t[c];o=Mx(n,e,u,i,r,s,o),a.push(o),e=u}return o}function Fx(n,e,t,i,r,s,o,a){for(let c=0,l=t.length;c<l;++c){const u=t[c],h=[];o=kp(n,e,u,i,r,s,o,h),a.push(h),e=u[u.length-1]}return o}function zi(n,e,t,i,r){const s=r!==void 0?r:[];let o=0;for(let a=e;a<t;a+=i)s[o++]=n.slice(a,a+i);return s.length=o,s}function oa(n,e,t,i,r){const s=r!==void 0?r:[];let o=0;for(let a=0,c=t.length;a<c;++a){const l=t[a];s[o++]=zi(n,e,l,i,s[o]),e=l}return s.length=o,s}function ah(n,e,t,i,r){const s=r!==void 0?r:[];let o=0;for(let a=0,c=t.length;a<c;++a){const l=t[a];s[o++]=oa(n,e,l,i,s[o]),e=l[l.length-1]}return s.length=o,s}function lh(n,e,t,i){let r=0,s=n[t-i],o=n[t-i+1];for(;e<t;e+=i){const a=n[e],c=n[e+1];r+=o*a-s*c,s=a,o=c}return r/2}function $p(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=lh(n,e,a,i),e=a}return r}function Nx(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=$p(n,e,a,i),e=a[a.length-1]}return r}class Cf extends Ti{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new Cf(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,i,r){return r<qr(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(nh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),rh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))}getArea(){return lh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return zi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=Dl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new Cf(t,H.XY)}getType(){return R.LINEAR_RING}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=sa(this.flatCoordinates,0,e,this.stride),this.changed()}}var aa=Cf;class qy extends Ti{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new qy(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=ur(e,t,s[0],s[1]);if(o<r){const a=this.stride;for(let c=0;c<a;++c)i[c]=s[c];return i.length=a,o}else return r}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(e){return Ys(this.flatCoordinates,e)}getType(){return R.POINT}intersectsExtent(e){return zu(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Fp(this.flatCoordinates,0,e,this.stride),this.changed()}}var ft=qy;function kx(n,e,t,i,r){return!Vu(r,function(o){return!rs(n,e,t,i,o[0],o[1])})}function rs(n,e,t,i,r,s){let o=0,a=n[t-i],c=n[t-i+1];for(;e<t;e+=i){const l=n[e],u=n[e+1];c<=s?u>s&&(l-a)*(s-c)-(r-a)*(u-c)>0&&o++:u<=s&&(l-a)*(s-c)-(r-a)*(u-c)<0&&o--,a=l,c=u}return o!==0}function ch(n,e,t,i,r,s){if(t.length===0||!rs(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;o<a;++o)if(rs(n,t[o-1],t[o],i,r,s))return!1;return!0}function $x(n,e,t,i,r,s){if(t.length===0)return!1;for(let o=0,a=t.length;o<a;++o){const c=t[o];if(ch(n,e,c,i,r,s))return!0;e=c[c.length-1]}return!1}function uh(n,e,t,i,r,s,o){let a,c,l,u,h,d,f;const p=r[s+1],m=[];for(let _=0,v=t.length;_<v;++_){const x=t[_];for(u=n[x-i],d=n[x-i+1],a=e;a<x;a+=i)h=n[a],f=n[a+1],(p<=d&&f<=p||d<=p&&p<=f)&&(l=(p-d)/(f-d)*(h-u)+u,m.push(l)),u=h,d=f}let g=NaN,y=-1/0;for(m.sort(cr),u=m[0],a=1,c=m.length;a<c;++a){h=m[a];const _=Math.abs(h-u);_>y&&(l=(u+h)/2,ch(n,e,t,i,l,p)&&(g=l,y=_)),u=h}return isNaN(g)&&(g=r[s]),o?(o.push(g,p,y),o):[g,p,y]}function Dp(n,e,t,i,r){let s=[];for(let o=0,a=t.length;o<a;++o){const c=t[o];s=uh(n,e,c,i,r,2*o,s),e=c[c.length-1]}return s}function Gp(n,e,t,i,r){let s;for(e+=i;e<t;e+=i)if(s=r(n.slice(e-i,e),n.slice(e,e+i)),s)return s;return!1}function Gl(n,e,t,i,r){const s=dp(Kt(),n,e,t,i);return at(r,s)?Gt(r,s)||s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Gp(n,e,t,i,function(o,a){return Q_(r,o,a)}):!1}function Dx(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){if(Gl(n,e,t[s],i,r))return!0;e=t[s]}return!1}function Gx(n,e,t,i,r){return!!(Gl(n,e,t,i,r)||rs(n,e,t,i,r[0],r[1])||rs(n,e,t,i,r[0],r[3])||rs(n,e,t,i,r[2],r[1])||rs(n,e,t,i,r[2],r[3]))}function Up(n,e,t,i,r){if(!Gx(n,e,t[0],i,r))return!1;if(t.length===1)return!0;for(let s=1,o=t.length;s<o;++s)if(kx(n,t[s-1],t[s],i,r)&&!Gl(n,t[s-1],t[s],i,r))return!1;return!0}function Ux(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(Up(n,e,a,i,r))return!0;e=a[a.length-1]}return!1}function zx(n,e,t,i){for(;e<t-i;){for(let r=0;r<i;++r){const s=n[e+r];n[e+r]=n[t-i+r],n[t-i+r]=s}e+=i,t-=i}}function Ul(n,e,t,i){let r=0,s=n[t-i],o=n[t-i+1];for(;e<t;e+=i){const a=n[e],c=n[e+1];r+=(a-s)*(c+o),s=a,o=c}return r===0?void 0:r>0}function zp(n,e,t,i,r){const s=r!==void 0?r:!1;for(let o=0,a=t.length;o<a;++o){const c=t[o],l=Ul(n,e,c,i);if(o===0){if(s&&l||!s&&!l)return!1}else if(s&&!l||!s&&l)return!1;e=c}return!0}function Bx(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(!zp(n,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}function hh(n,e,t,i,r){const s=r!==void 0?r:!1;for(let o=0,a=t.length;o<a;++o){const c=t[o],l=Ul(n,e,c,i);(o===0?s&&l||!s&&!l:s&&!l||!s&&l)&&zx(n,e,c,i),e=c}return e}function Bp(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s)e=hh(n,e,t[s],i,r);return e}function jp(n,e){const t=[];let i=0,r=0;for(let s=0,o=e.length;s<o;++s){const a=e[s];if(!Ul(n,i,a,2))t.push(e.slice(r,s+1));else{if(t.length===0)continue;t[t.length-1].push(e[r])}r=s+1,i=a}return t}class Bo extends Ti{constructor(e,t,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&i?(this.setFlatCoordinates(t,e),this.ends_=i):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?Xe(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Bo(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<qr(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ih(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sh(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return ch(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return $p(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),hh(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,oa(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=Ut(this.getExtent());this.flatInteriorPoint_=uh(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new ft(this.getFlatInteriorPoint(),H.XYM)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new aa(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const c=i[o],l=new aa(t.slice(s,c),e);r.push(l),s=c}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;zp(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=hh(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=kp(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i),new Bo(t,H.XY,i)}getType(){return R.POLYGON}intersectsExtent(e){return Up(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=oh(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}var Bt=Bo;function jx(n,e,t,i){const r=t||32,s=[];for(let o=0;o<r;++o)Xe(s,yx(n,e,2*Math.PI*o/r,i));return s.push(s[0],s[1]),new Bo(s,H.XY,[s.length])}function no(n){const e=n[0],t=n[1],i=n[2],r=n[3],s=[e,t,e,r,i,r,i,t,e,t];return new Bo(s,H.XY,[s.length])}function zl(n,e,t){const i=e||32,r=n.getStride(),s=n.getLayout(),o=n.getCenter(),a=r*(i+1),c=new Array(a);for(let h=0;h<a;h+=r){c[h]=0,c[h+1]=0;for(let d=2;d<r;d++)c[h+d]=o[d]}const l=[c.length],u=new Bo(c,s,l);return Vp(u,o,n.getRadius(),t),u}function Vp(n,e,t,i){const r=n.getFlatCoordinates(),s=n.getStride(),o=r.length/s-1,a=i||0;for(let c=0;c<=o;++c){const l=c*s,u=a+oi(c,o)*2*Math.PI/o;r[l]=e[0]+t*Math.cos(u),r[l+1]=e[1]+t*Math.sin(u)}n.changed()}const Et={ACCURACY:"accuracy",ACCURACY_GEOMETRY:"accuracyGeometry",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",PROJECTION:"projection",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"};class eC extends Mt{constructor(e){super(ne.ERROR),this.code=e.code,this.message=e.message}}class tC extends Fn{constructor(e){super(),this.on,this.once,this.un;const t=e||{};this.position_=null,this.transform_=kl,this.watchId_=void 0,this.addChangeListener(Et.PROJECTION,this.handleProjectionChanged_),this.addChangeListener(Et.TRACKING,this.handleTrackingChanged_),t.projection!==void 0&&this.setProjection(t.projection),t.trackingOptions!==void 0&&this.setTrackingOptions(t.trackingOptions),this.setTracking(t.tracking!==void 0?t.tracking:!1)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const e=this.getProjection();e&&(this.transform_=qn(re("EPSG:4326"),e),this.position_&&this.set(Et.POSITION,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const e=this.getTracking();e&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(e){const t=e.coords;this.set(Et.ACCURACY,t.accuracy),this.set(Et.ALTITUDE,t.altitude===null?void 0:t.altitude),this.set(Et.ALTITUDE_ACCURACY,t.altitudeAccuracy===null?void 0:t.altitudeAccuracy),this.set(Et.HEADING,t.heading===null?void 0:zt(t.heading)),this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];const i=this.transform_(this.position_);this.set(Et.POSITION,i),this.set(Et.SPEED,t.speed===null?void 0:t.speed);const r=jx(this.position_,t.accuracy);r.applyTransform(this.transform_),this.set(Et.ACCURACY_GEOMETRY,r),this.changed()}positionError_(e){this.dispatchEvent(new eC(e))}getAccuracy(){return this.get(Et.ACCURACY)}getAccuracyGeometry(){return this.get(Et.ACCURACY_GEOMETRY)||null}getAltitude(){return this.get(Et.ALTITUDE)}getAltitudeAccuracy(){return this.get(Et.ALTITUDE_ACCURACY)}getHeading(){return this.get(Et.HEADING)}getPosition(){return this.get(Et.POSITION)}getProjection(){return this.get(Et.PROJECTION)}getSpeed(){return this.get(Et.SPEED)}getTracking(){return this.get(Et.TRACKING)}getTrackingOptions(){return this.get(Et.TRACKING_OPTIONS)}setProjection(e){this.set(Et.PROJECTION,re(e))}setTracking(e){this.set(Et.TRACKING,e)}setTrackingOptions(e){this.set(Et.TRACKING_OPTIONS,e)}}var Vx=tC;class nC extends Wr{constructor(e,t,i,r){super(),this.extent=e,this.pixelRatio_=i,this.resolution=t,this.state=r}changed(){this.dispatchEvent(ne.CHANGE)}getExtent(){return this.extent}getImage(){return he()}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){he()}}var Bl=nC,me={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class iC extends Bl{constructor(e,t,i,r,s,o){super(e,t,i,me.IDLE),this.src_=r,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.state=me.IDLE,this.imageLoadFunction_=o}getImage(){return this.image_}handleImageError_(){this.state=me.ERROR,this.unlistenImage_(),this.changed()}handleImageLoad_(){this.resolution===void 0&&(this.resolution=ot(this.extent)/this.image_.height),this.state=me.LOADED,this.unlistenImage_(),this.changed()}load(){(this.state==me.IDLE||this.state==me.ERROR)&&(this.state=me.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=dh(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}setImage(e){this.image_=e,this.resolution=ot(this.extent)/this.image_.height}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function dh(n,e,t){const i=n;let r=!0,s=!1,o=!1;const a=[Bs(i,ne.LOAD,function(){o=!0,s||e()})];return i.src&&z_?(s=!0,i.decode().then(function(){r&&e()}).catch(function(c){r&&(o?e():t())})):a.push(Bs(i,ne.ERROR,t)),function(){r=!1,a.forEach(je)}}var la=iC;class rC extends Bl{constructor(e,t,i,r,s){const o=s!==void 0?me.IDLE:me.LOADED;super(e,t,i,o),this.loader_=s!==void 0?s:null,this.canvas_=r,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=me.ERROR):this.state=me.LOADED,this.changed()}load(){this.state==me.IDLE&&(this.state=me.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}var jl=rC;function St(n,e,t,i){let r;return t&&t.length?r=t.shift():Rl?r=new OffscreenCanvas(n||300,e||300):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}function Yx(n){let e=n.offsetWidth;const t=getComputedStyle(n);return e+=parseInt(t.marginLeft,10)+parseInt(t.marginRight,10),e}function Xx(n){let e=n.offsetHeight;const t=getComputedStyle(n);return e+=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),e}function io(n,e){const t=e.parentNode;t&&t.replaceChild(n,e)}function Vl(n){return n&&n.parentNode?n.parentNode.removeChild(n):null}function Yp(n){for(;n.lastChild;)n.removeChild(n.lastChild)}function Zx(n,e){const t=n.childNodes;for(let i=0;;++i){const r=t[i],s=e[i];if(!r&&!s)break;if(r!==s){if(!r){n.appendChild(s);continue}if(!s){n.removeChild(r),--i;continue}n.insertBefore(s,r)}}}class sC extends Kr{constructor(e,t,i,r,s,o){super(e,t,o),this.crossOrigin_=r,this.src_=i,this.key=i,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(e){this.image_=e,this.state=W.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=W.ERROR,this.unlistenImage_(),this.image_=oC(),this.changed()}handleImageLoad_(){const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=W.LOADED:this.state=W.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==W.ERROR&&(this.state=W.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==W.IDLE&&(this.state=W.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=dh(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function oC(){const n=St(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}var ro=sC;class aC{constructor(e,t,i){this.decay_=e,this.minVelocity_=t,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let i=t-3;for(;i>0&&this.points_[i+2]>e;)i-=3;const r=this.points_[t+2]-this.points_[i+2];if(r<1e3/60)return!1;const s=this.points_[t]-this.points_[i],o=this.points_[t+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}var Xp=aC;const Wx=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Hx=/^([a-z]*)$|^hsla?\(.*\)$/i;function Zp(n){return typeof n=="string"?n:Kp(n)}function Kx(n){const e=document.createElement("div");if(e.style.color=n,e.style.color!==""){document.body.appendChild(e);const t=getComputedStyle(e).color;return document.body.removeChild(e),t}else return""}const Wp=function(){const e={};let t=0;return function(i){let r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){let s=0;for(const o in e)(s++&3)===0&&(delete e[o],--t)}r=lC(i),e[i]=r,++t}return r}}();function so(n){return Array.isArray(n)?n:Wp(n)}function lC(n){let e,t,i,r,s;if(Hx.exec(n)&&(n=Kx(n)),Wx.exec(n)){const o=n.length-1;let a;o<=4?a=1:a=2;const c=o===4||o===8;e=parseInt(n.substr(1+0*a,a),16),t=parseInt(n.substr(1+1*a,a),16),i=parseInt(n.substr(1+2*a,a),16),c?r=parseInt(n.substr(1+3*a,a),16):r=255,a==1&&(e=(e<<4)+e,t=(t<<4)+t,i=(i<<4)+i,c&&(r=(r<<4)+r)),s=[e,t,i,r/255]}else n.indexOf("rgba(")==0?(s=n.slice(5,-1).split(",").map(Number),Hp(s)):n.indexOf("rgb(")==0?(s=n.slice(4,-1).split(",").map(Number),s.push(1),Hp(s)):ce(!1,14);return s}function Hp(n){return n[0]=we(n[0]+.5|0,0,255),n[1]=we(n[1]+.5|0,0,255),n[2]=we(n[2]+.5|0,0,255),n[3]=we(n[3],0,1),n}function Kp(n){let e=n[0];e!=(e|0)&&(e=e+.5|0);let t=n[1];t!=(t|0)&&(t=t+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const r=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+e+","+t+","+i+","+r+")"}function qx(n){return Hx.test(n)&&(n=Kx(n)),Wx.test(n)||n.indexOf("rgba(")===0||n.indexOf("rgb(")===0}class Jx{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const t in this.cache_){const i=this.cache_[t];(e++&3)===0&&!i.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}}get(e,t,i){const r=Qx(e,t,i);return r in this.cache_?this.cache_[r]:null}set(e,t,i,r){const s=Qx(e,t,i);this.cache_[s]=r,++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function Qx(n,e,t){const i=t?Zp(t):"null";return e+":"+n+":"+i}var cC=Jx;const Yl=new Jx;var We={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};class uC extends Fn{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const t=J({},e);typeof e.properties=="object"&&(delete t.properties,J(t,e.properties)),t[We.OPACITY]=e.opacity!==void 0?e.opacity:1,ce(typeof t[We.OPACITY]=="number",64),t[We.VISIBLE]=e.visible!==void 0?e.visible:!0,t[We.Z_INDEX]=e.zIndex,t[We.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[We.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[We.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[We.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=t.className!==void 0?t.className:"ol-layer",delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const t=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return t.opacity=we(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=i===void 0&&!t.managed?1/0:i,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return he()}getLayerStatesArray(e){return he()}getExtent(){return this.get(We.EXTENT)}getMaxResolution(){return this.get(We.MAX_RESOLUTION)}getMinResolution(){return this.get(We.MIN_RESOLUTION)}getMinZoom(){return this.get(We.MIN_ZOOM)}getMaxZoom(){return this.get(We.MAX_ZOOM)}getOpacity(){return this.get(We.OPACITY)}getSourceState(){return he()}getVisible(){return this.get(We.VISIBLE)}getZIndex(){return this.get(We.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(We.EXTENT,e)}setMaxResolution(e){this.set(We.MAX_RESOLUTION,e)}setMinResolution(e){this.set(We.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(We.MAX_ZOOM,e)}setMinZoom(e){this.set(We.MIN_ZOOM,e)}setOpacity(e){ce(typeof e=="number",64),this.set(We.OPACITY,e)}setVisible(e){this.set(We.VISIBLE,e)}setZIndex(e){this.set(We.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}var qp=uC,Tn={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},Fe={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};class hC extends qp{constructor(e){const t=J({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(We.SOURCE,this.handleSourcePropertyChange_);const i=e.source?e.source:null;this.setSource(i)}getLayersArray(e){const t=e||[];return t.push(this),t}getLayerStatesArray(e){const t=e||[];return t.push(this.getLayerState()),t}getSource(){return this.get(We.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const e=this.getSource();return e?e.getState():Fe.UNDEFINED}handleSourceChange_(){this.changed()}handleSourcePropertyChange_(){this.sourceChangeKey_&&(je(this.sourceChangeKey_),this.sourceChangeKey_=null);const e=this.getSource();e&&(this.sourceChangeKey_=pe(e,ne.CHANGE,this.handleSourceChange_,this)),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):new Promise(t=>t([]))}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}render(e,t){const i=this.getRenderer();if(i.prepareFrame(e))return this.rendered=!0,i.renderFrame(e,t)}unrender(){this.rendered=!1}setMapInternal(e){e||this.unrender(),this.set(We.MAP,e)}getMapInternal(){return this.get(We.MAP)}setMap(e){this.mapPrecomposeKey_&&(je(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(je(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=pe(e,Tn.PRECOMPOSE,function(t){const r=t.frameState.layerStatesArray,s=this.getLayerState(!1);ce(!r.some(function(o){return o.layer===s.layer}),67),r.push(s)},this),this.mapRenderKey_=pe(this,ne.CHANGE,e.render,e),this.changed())}setSource(e){this.set(We.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function Xl(n,e){if(!n.visible)return!1;const t=e.resolution;if(t<n.minResolution||t>=n.maxResolution)return!1;const i=e.zoom;return i>n.minZoom&&i<=n.maxZoom}var oo=hC;class dC extends Us{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){he()}calculateMatrices2D(e){const t=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Ht(i,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),Vs(r,i)}forEachFeatureAtCoordinate(e,t,i,r,s,o,a,c){let l;const u=t.viewState;function h(x,w,E,T){return s.call(o,w,x?E:null,T)}const d=u.projection,f=Wu(e.slice(),d),p=[[0,0]];if(d.canWrapX()&&r){const x=d.getExtent(),w=be(x);p.push([-w,0],[w,0])}const m=t.layerStatesArray,g=m.length,y=[],_=[];for(let x=0;x<p.length;x++)for(let w=g-1;w>=0;--w){const E=m[w],T=E.layer;if(T.hasRenderer()&&Xl(E,u)&&a.call(c,T)){const b=T.getRenderer(),S=T.getSource();if(b&&S){const A=S.getWrapX()?f:e,I=h.bind(null,E.managed);_[0]=A[0]+p[x][0],_[1]=A[1]+p[x][1],l=b.forEachFeatureAtCoordinate(_,t,i,I,y)}if(l)return l}}if(y.length===0)return;const v=1/y.length;return y.forEach((x,w)=>x.distanceSq+=w*v),y.sort((x,w)=>x.distanceSq-w.distanceSq),y.some(x=>l=x.callback(x.feature,x.layer,x.geometry)),l}forEachLayerAtPixel(e,t,i,r,s){return he()}hasFeatureAtCoordinate(e,t,i,r,s,o){return this.forEachFeatureAtCoordinate(e,t,i,r,Mn,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){he()}scheduleExpireIconCache(e){Yl.canExpireCache()&&e.postRenderFunctions.push(fC)}}function fC(n,e){Yl.expire()}var e1=dC;class pC extends Mt{constructor(e,t,i,r){super(e),this.inversePixelTransform=t,this.frameState=i,this.context=r}}var ca=pC;const Zl="ol-hidden",t1="ol-selectable",bi="ol-unselectable",Jp="ol-unsupported",ss="ol-control",Wl="ol-collapsed",gC=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),n1=["style","variant","weight","size","lineHeight","family"],Qp=function(n){const e=n.match(gC);if(!e)return null;const t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,r=n1.length;i<r;++i){const s=e[i+1];s!==void 0&&(t[n1[i]]=s)}return t.families=t.family.split(/,\s?/),t};function eg(n){return n===1?"":String(Math.round(n*100)/100)}const tg="10px sans-serif",Bi="#000",Hl="round",ua=[],ha=0,ao="round",da=10,fa="#000",pa="center",Kl="middle",os=[0,0,0,0],ga=1,ji=new Fn,fh=new Wr;fh.setSize=function(){console.warn("labelCache is deprecated.")};let ma=null,ng;const ph={},i1=function(){const e="32px ",t=["monospace","serif"],i=t.length,r="wmytzilWMYTZIL@#/&?$%10\uF013";let s,o;function a(l,u,h){let d=!0;for(let f=0;f<i;++f){const p=t[f];if(o=ql(l+" "+u+" "+e+p,r),h!=p){const m=ql(l+" "+u+" "+e+h+","+p,r);d=d&&m!=o}}return!!d}function c(){let l=!0;const u=ji.getKeys();for(let h=0,d=u.length;h<d;++h){const f=u[h];ji.get(f)<100&&(a.apply(this,f.split(`
|
2
|
+
`))?(Zr(ph),ma=null,ng=void 0,ji.set(f,100)):(ji.set(f,ji.get(f)+1,!0),l=!1))}l&&(clearInterval(s),s=void 0)}return function(l){const u=Qp(l);if(!u)return;const h=u.families;for(let d=0,f=h.length;d<f;++d){const p=h[d],m=u.style+`
|
3
|
+
`+u.weight+`
|
4
|
+
`+p;ji.get(m)===void 0&&(ji.set(m,100,!0),a(u.style,u.weight,p)||(ji.set(m,0,!0),s===void 0&&(s=setInterval(c,32))))}}}(),r1=function(){let n;return function(e){let t=ph[e];if(t==null){if(Rl){const i=Qp(e),r=s1(e,"\u017Dg");t=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=e,document.body.appendChild(n),t=n.offsetHeight,document.body.removeChild(n);ph[e]=t}return t}}();function s1(n,e){return ma||(ma=St(1,1)),n!=ng&&(ma.font=n,ng=ma.font),ma.measureText(e)}function ql(n,e){return s1(n,e).width}function ig(n,e,t){if(e in t)return t[e];const i=ql(n,e);return t[e]=i,i}function o1(n,e){const t=[],i=[],r=[];let s=0,o=0,a=0,c=0;for(let l=0,u=e.length;l<=u;l+=2){const h=e[l];if(h===`
|
5
|
+
`||l===u){s=Math.max(s,o),r.push(o),o=0,a+=c;continue}const d=e[l+1]||n.font,f=ql(d,h);t.push(f),o+=f;const p=r1(d);i.push(p),c=Math.max(c,p)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function mC(n,e,t,i){e!==0&&(n.translate(t,i),n.rotate(e),n.translate(-t,-i))}function a1(n,e,t,i,r,s,o,a,c,l,u){n.save(),t!==1&&(n.globalAlpha*=t),e&&n.setTransform.apply(n,e),i.contextInstructions?(n.translate(c,l),n.scale(u[0],u[1]),yC(i,n)):u[0]<0||u[1]<0?(n.translate(c,l),n.scale(u[0],u[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,c,l,o*u[0],a*u[1]),n.restore()}function yC(n,e){const t=n.contextInstructions;for(let i=0,r=t.length;i<r;i+=2)Array.isArray(t[i+1])?e[t[i]].apply(e,t[i+1]):e[t[i]]=t[i+1]}class _C extends e1{constructor(e){super(e),this.fontChangeListenerKey_=pe(ji,Vr.PROPERTYCHANGE,e.redrawText.bind(e)),this.element_=document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=bi+" ol-layers";const i=e.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){const i=this.getMap();if(i.hasListener(e)){const r=new ca(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){je(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Tn.PRECOMPOSE,e);const t=e.layerStatesArray.sort(function(o,a){return o.zIndex-a.zIndex}),i=e.viewState;this.children_.length=0;const r=[];let s=null;for(let o=0,a=t.length;o<a;++o){const c=t[o];e.layerIndex=o;const l=c.layer,u=l.getSourceState();if(!Xl(c,i)||u!=Fe.READY&&u!=Fe.UNDEFINED){l.unrender();continue}const h=l.render(e,s);!h||(h!==s&&(this.children_.push(h),s=h),"getDeclutter"in l&&r.push(l))}for(let o=r.length-1;o>=0;--o)r[o].renderDeclutter(e);Zx(this.element_,this.children_),this.dispatchRenderEvent(Tn.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}forEachLayerAtPixel(e,t,i,r,s){const o=t.viewState,a=t.layerStatesArray,c=a.length;for(let l=c-1;l>=0;--l){const u=a[l],h=u.layer;if(h.hasRenderer()&&Xl(u,o)&&s(h)){const f=h.getRenderer().getDataAtPixel(e,t,i);if(f){const p=r(h,f);if(p)return p}}}}}var rg=_C;class pr extends Mt{constructor(e,t){super(e),this.layer=t}}const sg={LAYERS:"layers"};class Jy extends qp{constructor(e){const t=e||{},i=J({},t);delete i.layers;let r=t.layers;super(i),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(sg.LAYERS,this.handleLayersChanged_),r?Array.isArray(r)?r=new At(r.slice(),{unique:!0}):ce(typeof r.getArray=="function",43):r=new At(void 0,{unique:!0}),this.setLayers(r)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(je),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(pe(e,wt.ADD,this.handleLayersAdd_,this),pe(e,wt.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(je);Zr(this.listenerKeys_);const t=e.getArray();for(let i=0,r=t.length;i<r;i++){const s=t[i];this.registerLayerListeners_(s),this.dispatchEvent(new pr("addlayer",s))}this.changed()}registerLayerListeners_(e){const t=[pe(e,Vr.PROPERTYCHANGE,this.handleLayerChange_,this),pe(e,ne.CHANGE,this.handleLayerChange_,this)];e instanceof Jy&&t.push(pe(e,"addlayer",this.handleLayerGroupAdd_,this),pe(e,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[se(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new pr("addlayer",e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new pr("removelayer",e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new pr("addlayer",t)),this.changed()}handleLayersRemove_(e){const t=e.element,i=se(t);this.listenerKeys_[i].forEach(je),delete this.listenerKeys_[i],this.dispatchEvent(new pr("removelayer",t)),this.changed()}getLayers(){return this.get(sg.LAYERS)}setLayers(e){const t=this.getLayers();if(t){const i=t.getArray();for(let r=0,s=i.length;r<s;++r)this.dispatchEvent(new pr("removelayer",i[r]))}this.set(sg.LAYERS,e)}getLayersArray(e){const t=e!==void 0?e:[];return this.getLayers().forEach(function(i){i.getLayersArray(t)}),t}getLayerStatesArray(e){const t=e!==void 0?e:[],i=t.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(t)});const r=this.getLayerState();let s=r.zIndex;!e&&r.zIndex===void 0&&(s=0);for(let o=i,a=t.length;o<a;o++){const c=t[o];c.opacity*=r.opacity,c.visible=c.visible&&r.visible,c.maxResolution=Math.min(c.maxResolution,r.maxResolution),c.minResolution=Math.max(c.minResolution,r.minResolution),c.minZoom=Math.max(c.minZoom,r.minZoom),c.maxZoom=Math.min(c.maxZoom,r.maxZoom),r.extent!==void 0&&(c.extent!==void 0?c.extent=an(c.extent,r.extent):c.extent=r.extent),c.zIndex===void 0&&(c.zIndex=s)}return t}getSourceState(){return Fe.READY}}var Jl=Jy;class xC extends Mt{constructor(e,t,i){super(e),this.map=t,this.frameState=i!==void 0?i:null}}var ya=xC;class vC extends ya{constructor(e,t,i,r,s){super(e,t,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0?r:!1}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}var Si=vC,Re={SINGLECLICK:"singleclick",CLICK:ne.CLICK,DBLCLICK:ne.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ri={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"};class wC extends Wr{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;const i=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=pe(i,Ri.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=pe(i,Ri.POINTERMOVE,this.relayEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(ne.TOUCHMOVE,this.boundHandleTouchMove_,ap?{passive:!1}:!1)}emulateClick_(e){let t=new Si(Re.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new Si(Re.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;const i=new Si(Re.SINGLECLICK,this.map_,e);this.dispatchEvent(i)}.bind(this),250)}updateActivePointers_(e){const t=e;t.type==Re.POINTERUP||t.type==Re.POINTERCANCEL?delete this.trackedTouches_[t.pointerId]:t.type==Re.POINTERDOWN&&(this.trackedTouches_[t.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length}handlePointerUp_(e){this.updateActivePointers_(e);const t=new Si(Re.POINTERUP,this.map_,e);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_===0&&(this.dragListenerKeys_.forEach(je),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_===0,this.updateActivePointers_(e);const t=new Si(Re.POINTERDOWN,this.map_,e);this.dispatchEvent(t),this.down_={};for(const i in e){const r=e[i];this.down_[i]=typeof r=="function"?Xr:r}if(this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(pe(i,Re.POINTERMOVE,this.handlePointerMove_,this),pe(i,Re.POINTERUP,this.handlePointerUp_,this),pe(this.element_,Re.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(pe(this.element_.getRootNode(),Re.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.dragging_=!0;const t=new Si(Re.POINTERDRAG,this.map_,e,this.dragging_);this.dispatchEvent(t)}}relayEvent_(e){this.originalPointerMoveEvent_=e;const t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Si(e.type,this.map_,e,t))}handleTouchMove_(e){const t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(je(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ne.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(je(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(je),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}var og=wC,lo={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend"},Rt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};const Ql=1/0;class EC{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Zr(this.queuedElements_)}dequeue(){const e=this.elements_,t=this.priorities_,i=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));const r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(e){ce(!(this.keyFunction_(e)in this.queuedElements_),31);const t=this.priorityFunction_(e);return t!=Ql?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const t=this.elements_,i=this.priorities_,r=t.length,s=t[e],o=i[e],a=e;for(;e<r>>1;){const c=this.getLeftChildIndex_(e),l=this.getRightChildIndex_(e),u=l<r&&i[l]<i[c]?l:c;t[e]=t[u],i[e]=i[u],e=u}t[e]=s,i[e]=o,this.siftDown_(a,e)}siftDown_(e,t){const i=this.elements_,r=this.priorities_,s=i[t],o=r[t];for(;t>e;){const a=this.getParentIndex_(t);if(r[a]>o)i[t]=i[a],r[t]=r[a],t=a;else break}i[t]=s,r[t]=o}reprioritize(){const e=this.priorityFunction_,t=this.elements_,i=this.priorities_;let r=0;const s=t.length;let o,a,c;for(a=0;a<s;++a)o=t[a],c=e(o),c==Ql?delete this.queuedElements_[this.keyFunction_(o)]:(i[r]=c,t[r++]=o);t.length=r,i.length=r,this.heapify_()}}var l1=EC;class TC extends l1{constructor(e,t){super(function(i){return e.apply(null,i)},function(i){return i[0].getKey()}),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){const t=super.enqueue(e);return t&&e[0].addEventListener(ne.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,i=t.getState();if(i===W.LOADED||i===W.ERROR||i===W.EMPTY){t.removeEventListener(ne.CHANGE,this.boundHandleTileChange_);const r=t.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let i=0,r,s,o;for(;this.tilesLoading_<e&&i<t&&this.getCount()>0;)s=this.dequeue()[0],o=s.getKey(),r=s.getState(),r===W.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++i,s.load())}}var gh=TC;function c1(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return Ql;const s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}var lt={ANIMATING:0,INTERACTING:1},zn={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};const u1=42,co=256;function ag(n,e,t){return function(i,r,s,o,a){if(!i)return;if(!r&&!e)return i;const c=e?0:s[0]*r,l=e?0:s[1]*r,u=a?a[0]:0,h=a?a[1]:0;let d=n[0]+c/2+u,f=n[2]-c/2+u,p=n[1]+l/2+h,m=n[3]-l/2+h;d>f&&(d=(f+d)/2,f=d),p>m&&(p=(m+p)/2,m=p);let g=we(i[0],d,f),y=we(i[1],p,m);if(o&&t&&r){const _=30*r;g+=-_*Math.log(1+Math.max(0,d-i[0])/_)+_*Math.log(1+Math.max(0,i[0]-f)/_),y+=-_*Math.log(1+Math.max(0,p-i[1])/_)+_*Math.log(1+Math.max(0,i[1]-m)/_)}return[g,y]}}function h1(n){return n}function lg(n,e,t,i){const r=be(e)/t[0],s=ot(e)/t[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function cg(n,e,t){let i=Math.min(n,e);const r=50;return i*=Math.log(1+r*Math.max(0,n/e-1))/r+1,t&&(i=Math.max(i,t),i/=Math.log(1+r*Math.max(0,t/n-1))/r+1),we(i,t/2,e*2)}function d1(n,e,t,i){return function(r,s,o,a){if(r!==void 0){const c=n[0],l=n[n.length-1],u=t?lg(c,t,o,i):c;if(a)return(e!==void 0?e:!0)?cg(r,u,l):we(r,l,u);const h=Math.min(u,r),d=Math.floor(bl(n,h,s));return n[d]>u&&d<n.length-1?n[d+1]:n[d]}else return}}function f1(n,e,t,i,r,s){return function(o,a,c,l){if(o!==void 0){const u=r?lg(e,r,c,s):e,h=t!==void 0?t:0;if(l)return(i!==void 0?i:!0)?cg(o,u,h):we(o,h,u);const d=1e-9,f=Math.ceil(Math.log(e/u)/Math.log(n)-d),p=-a*(.5-d)+.5,m=Math.min(u,o),g=Math.floor(Math.log(e/m)/Math.log(n)+p),y=Math.max(f,g),_=e/Math.pow(n,y);return we(_,h,u)}else return}}function ug(n,e,t,i,r){return function(s,o,a,c){if(s!==void 0){const l=i?lg(n,i,a,r):n;return!(t!==void 0?t:!0)||!c?we(s,e,l):cg(s,l,e)}else return}}function mh(n){if(n!==void 0)return 0}function hg(n){if(n!==void 0)return n}function p1(n){const e=2*Math.PI/n;return function(t,i){if(i)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t}}function g1(n){const e=n||zt(5);return function(t,i){if(i)return t;if(t!==void 0)return Math.abs(t)<=e?0:t}}const dg=0;class bC extends Fn{constructor(e){super(),this.on,this.once,this.un;const t=J({},e);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Qu(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.center&&(t.center=rt(t.center,this.projection_)),t.extent&&(t.extent=Un(t.extent,this.projection_)),t.projection&&Ip(),this.applyOptions_(t)}applyOptions_(e){const t=J({},e);for(const a in zn)delete t[a];this.setProperties(t,!0);const i=y1(e);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=i.minZoom;const r=m1(e),s=i.constraint,o=_1(e);this.constraints_={center:r,resolution:s,rotation:o},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;const i=this.getCenter();if(i){const r=e||[0,0,0,0];t=t||[0,0,0,0];const s=this.getResolution(),o=s/2*(r[3]-t[3]+t[1]-r[1]),a=s/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(e){const t=this.getProperties();return t.resolution!==void 0?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),J({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const t=new Array(arguments.length);for(let i=0;i<t.length;++i){let r=arguments[i];r.center&&(r=J({},r),r.center=rt(r.center,this.getProjection())),r.anchor&&(r=J({},r),r.anchor=rt(r.anchor,this.getProjection())),t[i]=r}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,i;t>1&&typeof arguments[t-1]=="function"&&(i=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){const u=arguments[r];u.center&&this.setCenterInternal(u.center),u.zoom!==void 0?this.setZoom(u.zoom):u.resolution&&this.setResolution(u.resolution),u.rotation!==void 0&&this.setRotation(u.rotation)}if(r===t){i&&yh(i,!0);return}let s=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,c=this.targetRotation_;const l=[];for(;r<t;++r){const u=arguments[r],h={start:s,complete:!1,anchor:u.anchor,duration:u.duration!==void 0?u.duration:1e3,easing:u.easing||Gu,callback:i};if(u.center&&(h.sourceCenter=o,h.targetCenter=u.center.slice(),o=h.targetCenter),u.zoom!==void 0?(h.sourceResolution=a,h.targetResolution=this.getResolutionForZoom(u.zoom),a=h.targetResolution):u.resolution&&(h.sourceResolution=a,h.targetResolution=u.resolution,a=h.targetResolution),u.rotation!==void 0){h.sourceRotation=c;const d=oi(u.rotation-c+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=c+d,c=h.targetRotation}x1(h)?h.complete=!0:s+=h.duration,l.push(h)}this.animations_.push(l),this.setHint(lt.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[lt.ANIMATING]>0}getInteracting(){return this.hints_[lt.INTERACTING]>0}cancelAnimations(){this.setHint(lt.ANIMATING,-this.hints_[lt.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t<i;++t){const r=this.animations_[t];if(r[0].callback&&yh(r[0].callback,!1),!e)for(let s=0,o=r.length;s<o;++s){const a=r[s];if(!a.complete){e=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const e=Date.now();let t=!1;for(let i=this.animations_.length-1;i>=0;--i){const r=this.animations_[i];let s=!0;for(let o=0,a=r.length;o<a;++o){const c=r[o];if(c.complete)continue;const l=e-c.start;let u=c.duration>0?l/c.duration:1;u>=1?(c.complete=!0,u=1):s=!1;const h=c.easing(u);if(c.sourceCenter){const d=c.sourceCenter[0],f=c.sourceCenter[1],p=c.targetCenter[0],m=c.targetCenter[1];this.nextCenter_=c.targetCenter;const g=d+h*(p-d),y=f+h*(m-f);this.targetCenter_=[g,y]}if(c.sourceResolution&&c.targetResolution){const d=h===1?c.targetResolution:c.sourceResolution+h*(c.targetResolution-c.sourceResolution);if(c.anchor){const f=this.getViewportSize_(this.getRotation()),p=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(p,c.anchor)}this.nextResolution_=c.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(c.sourceRotation!==void 0&&c.targetRotation!==void 0){const d=h===1?oi(c.targetRotation+Math.PI,2*Math.PI)-Math.PI:c.sourceRotation+h*(c.targetRotation-c.sourceRotation);if(c.anchor){const f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,c.anchor)}this.nextRotation_=c.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),t=!0,!c.complete)break}if(s){this.animations_[i]=null,this.setHint(lt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&yh(o,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let i;const r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-t[0],r[1]-t[1]],Zu(i,e-this.getRotation()),Ep(i,t)),i}calculateCenterZoom(e,t){let i;const r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){const o=t[0]-e*(t[0]-r[0])/s,a=t[1]-e*(t[1]-r[1])/s;i=[o,a]}return i}getViewportSize_(e){const t=this.viewportSize_;if(e){const i=t[0],r=t[1];return[Math.abs(i*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e))]}else return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&dr(e,this.getProjection())}getCenterInternal(){return this.get(zn.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const t=this.calculateExtentInternal(e);return ns(t,this.getProjection())}calculateExtentInternal(e){const t=e||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();ce(i,1);const r=this.getResolution();ce(r!==void 0,2);const s=this.getRotation();return ce(s!==void 0,3),Hs(i,r,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(zn.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(Un(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){const i=t||this.getViewportSizeMinusPadding_(),r=be(e)/i[0],s=ot(e)/i[1];return Math.max(r,s)}getResolutionForValueFunction(e){const t=e||2,i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/Math.log(t);return function(o){return i/Math.pow(t,o*s)}}getRotation(){return this.get(zn.ROTATION)}getValueForResolutionFunction(e){const t=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/t;return function(o){return Math.log(i/o)/t/s}}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e);const i=this.padding_;return i&&(t=[t[0]-i[1]-i[3],t[1]-i[0]-i[2]]),t}getState(){const e=this.getProjection(),t=this.getResolution(),i=this.getRotation();let r=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();r=fg(r,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],t,i)}return{center:r.slice(0),projection:e!==void 0?e:null,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getZoom(){let e;const t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,i,r;if(this.resolutions_){const s=bl(this.resolutions_,e,1);t=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(i/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const t=we(Math.floor(e),0,this.resolutions_.length-2),i=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/Math.pow(i,we(e-t,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let i;if(ce(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function",24),Array.isArray(e)){ce(!Qr(e),25);const r=Un(e,this.getProjection());i=no(r)}else if(e.getType()===R.CIRCLE){const r=Un(e.getExtent(),this.getProjection());i=no(r),i.rotate(this.getRotation(),Ut(r))}else{const r=En();r?i=e.clone().transform(r,this.getProjection()):i=e}this.fitInternal(i,t)}rotatedExtentForGeometry(e){const t=this.getRotation(),i=Math.cos(t),r=Math.sin(-t),s=e.getFlatCoordinates(),o=e.getStride();let a=1/0,c=1/0,l=-1/0,u=-1/0;for(let h=0,d=s.length;h<d;h+=o){const f=s[h]*i-s[h+1]*r,p=s[h]*r+s[h+1]*i;a=Math.min(a,f),c=Math.min(c,p),l=Math.max(l,f),u=Math.max(u,p)}return[a,c,l,u]}fitInternal(e,t){const i=t||{};let r=i.size;r||(r=this.getViewportSizeMinusPadding_());const s=i.padding!==void 0?i.padding:[0,0,0,0],o=i.nearest!==void 0?i.nearest:!1;let a;i.minResolution!==void 0?a=i.minResolution:i.maxZoom!==void 0?a=this.getResolutionForZoom(i.maxZoom):a=0;const c=this.rotatedExtentForGeometry(e);let l=this.getResolutionForExtentInternal(c,[r[0]-s[1]-s[3],r[1]-s[0]-s[2]]);l=isNaN(l)?a:Math.max(l,a),l=this.getConstrainedResolution(l,o?0:1);const u=this.getRotation(),h=Math.sin(u),d=Math.cos(u),f=Ut(c);f[0]+=(s[1]-s[3])/2*l,f[1]+=(s[0]-s[2])/2*l;const p=f[0]*d-f[1]*h,m=f[1]*d+f[0]*h,g=this.getConstrainedCenter([p,m],l),y=i.callback?i.callback:Xr;i.duration!==void 0?this.animateInternal({resolution:l,center:g,duration:i.duration,easing:i.easing},y):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),yh(y,!0))}centerOn(e,t,i){this.centerOnInternal(rt(e,this.getProjection()),t,i)}centerOnInternal(e,t,i){this.setCenterInternal(fg(e,t,i,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,i,r){let s;const o=this.padding_;if(o&&e){const a=this.getViewportSizeMinusPadding_(-i),c=fg(e,r,[a[0]/2+o[3],a[1]/2+o[0]],t,i);s=[e[0]-c[0],e[1]-c[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){const t=dr(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){const t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){const i=t&&rt(t,this.getProjection());this.adjustResolutionInternal(e,i)}adjustResolutionInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),s=this.constraints_.resolution(this.targetResolution_*e,0,r,i);t&&(this.targetCenter_=this.calculateCenterZoom(s,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(Math.pow(this.zoomFactor_,-e),t)}adjustRotation(e,t){t&&(t=rt(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,i);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&rt(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){const i=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,i),s=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,s,i),a=this.constraints_.center(this.targetCenter_,o,s,i,this.calculateCenterShift(this.targetCenter_,o,r,s));this.get(zn.ROTATION)!==r&&this.set(zn.ROTATION,r),this.get(zn.RESOLUTION)!==o&&(this.set(zn.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(zn.CENTER)||!ai(this.get(zn.CENTER),a))&&this.set(zn.CENTER,a),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,i){const r=e!==void 0?e:200,s=t||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),c=this.constraints_.resolution(this.targetResolution_,s,a),l=this.constraints_.center(this.targetCenter_,c,a,!1,this.calculateCenterShift(this.targetCenter_,c,o,a));if(r===0&&!this.cancelAnchor_){this.targetResolution_=c,this.targetRotation_=o,this.targetCenter_=l,this.applyTargetState_();return}const u=i||(r===0?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,(this.getResolution()!==c||this.getRotation()!==o||!this.getCenterInternal()||!ai(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:c,duration:r,easing:Hr,anchor:u}))}beginInteraction(){this.resolveConstraints(0),this.setHint(lt.INTERACTING,1)}endInteraction(e,t,i){const r=i&&rt(i,this.getProjection());this.endInteractionInternal(e,t,r)}endInteractionInternal(e,t,i){this.setHint(lt.INTERACTING,-1),this.resolveConstraints(e,t,i)}getConstrainedCenter(e,t){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),i)}getConstrainedZoom(e,t){const i=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(i,t))}getConstrainedResolution(e,t){const i=t||0,r=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,i,r)}}function yh(n,e){setTimeout(function(){n(e)},0)}function m1(n){if(n.extent!==void 0){const t=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return ag(n.extent,n.constrainOnlyCenter,t)}const e=Qu(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,ag(t,!1,!1)}return h1}function y1(n){let e,t,i,o=n.minZoom!==void 0?n.minZoom:dg,a=n.maxZoom!==void 0?n.maxZoom:28;const c=n.zoomFactor!==void 0?n.zoomFactor:2,l=n.multiWorld!==void 0?n.multiWorld:!1,u=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,h=n.showFullExtent!==void 0?n.showFullExtent:!1,d=Qu(n.projection,"EPSG:3857"),f=d.getExtent();let p=n.constrainOnlyCenter,m=n.extent;if(!l&&!m&&d.isGlobal()&&(p=!1,m=f),n.resolutions!==void 0){const g=n.resolutions;t=g[o],i=g[a]!==void 0?g[a]:g[g.length-1],n.constrainResolution?e=d1(g,u,!p&&m,h):e=ug(t,i,u,!p&&m,h)}else{const y=(f?Math.max(be(f),ot(f)):360*on[gn.DEGREES]/d.getMetersPerUnit())/co/Math.pow(2,dg),_=y/Math.pow(2,28-dg);t=n.maxResolution,t!==void 0?o=0:t=y/Math.pow(c,o),i=n.minResolution,i===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?i=t/Math.pow(c,a):i=y/Math.pow(c,a):i=_),a=o+Math.floor(Math.log(t/i)/Math.log(c)),i=t/Math.pow(c,a-o),n.constrainResolution?e=f1(c,t,i,u,!p&&m,h):e=ug(t,i,u,!p&&m,h)}return{constraint:e,maxResolution:t,minResolution:i,minZoom:o,zoomFactor:c}}function _1(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const t=n.constrainRotation;return t===void 0||t===!0?g1():t===!1?hg:typeof t=="number"?p1(t):hg}else return mh}function x1(n){return!(n.sourceCenter&&n.targetCenter&&!ai(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function fg(n,e,t,i,r){const s=Math.cos(-r);let o=Math.sin(-r),a=n[0]*s-n[1]*o,c=n[1]*s+n[0]*o;a+=(e[0]/2-t[0])*i,c+=(t[1]-e[1]/2)*i,o=-o;const l=a*s-c*o,u=c*s+a*o;return[l,u]}var Vi=bC;function pg(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]+2*e,t[1]=n[1]+2*e,t}function gg(n){return n[0]>0&&n[1]>0}function _h(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]*e+.5|0,t[1]=n[1]*e+.5|0,t}function pt(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}function v1(n){if(n instanceof oo){n.setMapInternal(null);return}n instanceof Jl&&n.getLayers().forEach(v1)}function w1(n,e){if(n instanceof oo){n.setMapInternal(e);return}if(n instanceof Jl){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i)w1(t[i],e)}}class SC extends Fn{constructor(e){super(),this.on,this.once,this.un;const t=RC(e);this.renderComplete_,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading!==void 0?e.maxTilesLoading:16,this.pixelRatio_=e.pixelRatio!==void 0?e.pixelRatio:Uu,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(this),this.coordinateToPixelTransform_=dt(),this.pixelToCoordinateTransform_=dt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.controls=t.controls||new At,this.interactions=t.interactions||new At,this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new gh(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Rt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Rt.VIEW,this.handleViewChanged_),this.addChangeListener(Rt.SIZE,this.handleSizeChanged_),this.addChangeListener(Rt.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const i=this;e.view&&!(e.view instanceof Vi)&&e.view.then(function(r){i.setView(new Vi(r))}),this.controls.addEventListener(wt.ADD,function(r){r.element.setMap(this)}.bind(this)),this.controls.addEventListener(wt.REMOVE,function(r){r.element.setMap(null)}.bind(this)),this.interactions.addEventListener(wt.ADD,function(r){r.element.setMap(this)}.bind(this)),this.interactions.addEventListener(wt.REMOVE,function(r){r.element.setMap(null)}.bind(this)),this.overlays_.addEventListener(wt.ADD,function(r){this.addOverlayInternal_(r.element)}.bind(this)),this.overlays_.addEventListener(wt.REMOVE,function(r){const o=r.element.getId();o!==void 0&&delete this.overlayIdIndex_[o.toString()],r.element.setMap(null)}.bind(this)),this.controls.forEach(function(r){r.setMap(this)}.bind(this)),this.interactions.forEach(function(r){r.setMap(this)}.bind(this)),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}createRenderer(){throw new Error("Use a map type that has a createRenderer method")}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){w1(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,i){if(!this.frameState_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:Mn,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,t,null,o,null)}getFeaturesAtPixel(e,t){const i=[];return this.forEachFeatureAtPixel(e,function(r){i.push(r)},t),i}getAllLayers(){const e=[];function t(i){i.forEach(function(r){r instanceof Jl?t(r.getLayers()):e.push(r)})}return t(this.getLayers()),e}forEachLayerAtPixel(e,t,i){if(!this.frameState_)return;const r=i||{},s=r.hitTolerance!==void 0?r.hitTolerance:0,o=r.layerFilter||Mn;return this.renderer_.forEachLayerAtPixel(e,this.frameState_,s,t,o)}hasFeatureAtPixel(e,t){if(!this.frameState_)return!1;const i=this.getCoordinateFromPixelInternal(e);t=t!==void 0?t:{};const r=t.layerFilter!==void 0?t.layerFilter:Mn,s=t.hitTolerance!==void 0?t.hitTolerance:0,o=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const t=this.viewport_.getBoundingClientRect(),i="changedTouches"in e?e.changedTouches[0]:e;return[i.clientX-t.left,i.clientY-t.top]}getTarget(){return this.get(Rt.TARGET)}getTargetElement(){const e=this.getTarget();return e!==void 0?typeof e=="string"?document.getElementById(e):e:null}getCoordinateFromPixel(e){return dr(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?Je(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const t=this.overlayIdIndex_[e.toString()];return t!==void 0?t:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Rt.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof At){t.setLayers(e);return}const i=t.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t<i;++t){const r=e[t].layer;if(!r.getRenderer().ready)return!0;const s=r.getSource();if(s&&s.loading)return!0}return!1}getPixelFromCoordinate(e){const t=rt(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?Je(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Rt.SIZE)}getView(){return this.get(Rt.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,i,r){return c1(this.frameState_,e,t,i,r)}handleBrowserEvent(e,t){const i=t||e.type,r=new Si(i,this,e);this.handleMapBrowserEvent(r)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,i=t.type;if(i===Ri.POINTERDOWN||i===ne.WHEEL||i===ne.KEYDOWN){const r=this.getOwnerDocument(),s=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=t.target;if(this.overlayContainerStopEvent_.contains(o)||!(s===r?r.documentElement:s).contains(o))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){const r=this.getInteractions().getArray().slice();for(let s=r.length-1;s>=0;s--){const o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let r=this.maxTilesLoading_,s=r;if(e){const o=e.viewHints;if(o[lt.ANIMATING]||o[lt.INTERACTING]){const a=Date.now()-e.time>8;r=a?0:8,s=a?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,s))}e&&this.hasListener(Tn.RENDERCOMPLETE)&&!e.animate&&this.renderComplete_&&this.renderer_.dispatchRenderEvent(Tn.RENDERCOMPLETE,e);const i=this.postRenderFunctions_;for(let r=0,s=i.length;r<s;++r)i[r](this,e);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let t=0,i=this.targetChangeHandlerKeys_.length;t<i;++t)je(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(ne.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(ne.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Vl(this.viewport_)}const e=this.getTargetElement();if(!e)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new og(this,this.moveTolerance_);for(const r in Re)this.mapBrowserEventHandler_.addEventListener(Re[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(ne.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(ne.WHEEL,this.boundHandleBrowserEvent_,ap?{passive:!1}:!1);const t=this.getOwnerDocument().defaultView,i=this.keyboardEventTarget_?this.keyboardEventTarget_:e;this.targetChangeHandlerKeys_=[pe(i,ne.KEYDOWN,this.handleBrowserEvent,this),pe(i,ne.KEYPRESS,this.handleBrowserEvent,this),pe(t,ne.RESIZE,this.updateSize,this)]}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(je(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(je(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=pe(e,Vr.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=pe(e,ne.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(je),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new pr("addlayer",e)),this.layerGroupPropertyListenerKeys_=[pe(e,Vr.PROPERTYCHANGE,this.render,this),pe(e,ne.CHANGE,this.render,this),pe(e,"addlayer",this.handleLayerAdd_,this),pe(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t<i;++t){const r=e[t].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){v1(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){const t=this.getSize(),i=this.getView(),r=this.frameState_;let s=null;if(t!==void 0&&gg(t)&&i&&i.isDef()){const o=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Hs(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:se(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const c=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=Hs(a.nextCenter,a.nextResolution,c,t)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),r&&(!this.previousExtent_||!Qr(this.previousExtent_)&&!Kn(s.extent,this.previousExtent_))&&(this.dispatchEvent(new ya(lo.MOVESTART,this,r)),this.previousExtent_=Jr(this.previousExtent_)),this.previousExtent_&&!s.viewHints[lt.ANIMATING]&&!s.viewHints[lt.INTERACTING]&&!Kn(s.extent,this.previousExtent_)&&(this.dispatchEvent(new ya(lo.MOVEEND,this,s)),cp(s.extent,this.previousExtent_))),this.dispatchEvent(new ya(lo.POSTRENDER,this,s)),this.renderComplete_=!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const t=this.getLayerGroup();t&&this.handleLayerRemove_(new pr("removelayer",t)),this.set(Rt.LAYERGROUP,e)}setSize(e){this.set(Rt.SIZE,e)}setTarget(e){this.set(Rt.TARGET,e)}setView(e){if(!e||e instanceof Vi){this.set(Rt.VIEW,e);return}this.set(Rt.VIEW,new Vi);const t=this;e.then(function(i){t.setView(new Vi(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){const i=getComputedStyle(e),r=e.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),s=e.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);!isNaN(r)&&!isNaN(s)&&(t=[r,s],!gg(t)&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0."))}this.setSize(t),this.updateViewportSize_()}updateViewportSize_(){const e=this.getView();if(e){let t;const i=getComputedStyle(this.viewport_);i.width&&i.height&&(t=[parseInt(i.width,10),parseInt(i.height,10)]),e.setViewportSize(t)}}}function RC(n){let e=null;n.keyboardEventTarget!==void 0&&(e=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);const t={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Jl({layers:n.layers});t[Rt.LAYERGROUP]=i,t[Rt.TARGET]=n.target,t[Rt.VIEW]=n.view instanceof Vi?n.view:new Vi;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new At(n.controls.slice()):(ce(typeof n.controls.getArray=="function",47),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new At(n.interactions.slice()):(ce(typeof n.interactions.getArray=="function",48),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new At(n.overlays.slice()):(ce(typeof n.overlays.getArray=="function",49),o=n.overlays):o=new At,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}var xh=SC;class IC extends Fn{constructor(e){super();const t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents="auto"),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){Vl(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&Vl(this.element);for(let t=0,i=this.listenerKeys.length;t<i;++t)je(this.listenerKeys[t]);this.listenerKeys.length=0,this.map_=e,e&&((this.target_?this.target_:e.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Xr&&this.listenerKeys.push(pe(e,lo.POSTRENDER,this.render,this)),e.render())}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}var Yi=IC;class CC extends Yi{constructor(e){const t=e||{};super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1);const i=t.className!==void 0?t.className:"ol-attribution",r=t.tipLabel!==void 0?t.tipLabel:"Attributions",s=t.expandClassName!==void 0?t.expandClassName:i+"-expand",o=t.collapseLabel!==void 0?t.collapseLabel:"\u203A",a=t.collapseClassName!==void 0?t.collapseClassName:i+"-collapse";typeof o=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=o,this.collapseLabel_.className=a):this.collapseLabel_=o;const c=t.label!==void 0?t.label:"i";typeof c=="string"?(this.label_=document.createElement("span"),this.label_.textContent=c,this.label_.className=s):this.label_=c;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=r,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(ne.CLICK,this.handleClick_.bind(this),!1);const u=i+" "+bi+" "+ss+(this.collapsed_&&this.collapsible_?" "+Wl:"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=u,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){const t={},i=[];let r=!0;const s=e.layerStatesArray;for(let o=0,a=s.length;o<a;++o){const c=s[o];if(!Xl(c,e.viewState))continue;const l=c.layer.getSource();if(!l)continue;const u=l.getAttributions();if(!u)continue;const h=u(e);if(!!h)if(r=r&&l.getAttributionsCollapsible()!==!1,Array.isArray(h))for(let d=0,f=h.length;d<f;++d)h[d]in t||(i.push(h[d]),t[h[d]]=!0);else h in t||(i.push(h),t[h]=!0)}return this.overrideCollapsible_||this.setCollapsible(r),i}updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=this.collectSourceAttributions_(e),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Gi(t,this.renderedAttributions_)){Yp(this.ulElement_);for(let r=0,s=t.length;r<s;++r){const o=document.createElement("li");o.innerHTML=t[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Wl),this.collapsed_?io(this.collapseLabel_,this.label_):io(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}}var E1=CC;class LC extends Yi{constructor(e){const t=e||{};super({element:document.createElement("div"),render:t.render,target:t.target});const i=t.className!==void 0?t.className:"ol-rotate",r=t.label!==void 0?t.label:"\u21E7",s=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof r=="string"?(this.label_=document.createElement("span"),this.label_.className=s,this.label_.textContent=r):(this.label_=r,this.label_.classList.add(s));const o=t.tipLabel?t.tipLabel:"Reset rotation",a=document.createElement("button");a.className=i+"-reset",a.setAttribute("type","button"),a.title=o,a.appendChild(this.label_),a.addEventListener(ne.CLICK,this.handleClick_.bind(this),!1);const c=i+" "+bi+" "+ss,l=this.element;l.className=c,l.appendChild(a),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=t.duration!==void 0?t.duration:250,this.autoHide_=t.autoHide!==void 0?t.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Zl)}handleClick_(e){e.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const i=t.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?t.animate({rotation:0,duration:this.duration_,easing:Hr}):t.setRotation(0))}render(e){const t=e.frameState;if(!t)return;const i=t.viewState.rotation;if(i!=this.rotation_){const r="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains(Zl);!s&&i===0?this.element.classList.add(Zl):s&&i!==0&&this.element.classList.remove(Zl)}this.label_.style.transform=r}this.rotation_=i}}var T1=LC;class AC extends Yi{constructor(e){const t=e||{};super({element:document.createElement("div"),target:t.target});const i=t.className!==void 0?t.className:"ol-zoom",r=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:i+"-in",o=t.zoomOutClassName!==void 0?t.zoomOutClassName:i+"-out",a=t.zoomInLabel!==void 0?t.zoomInLabel:"+",c=t.zoomOutLabel!==void 0?t.zoomOutLabel:"\u2013",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",u=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=l,h.appendChild(typeof a=="string"?document.createTextNode(a):a),h.addEventListener(ne.CLICK,this.handleClick_.bind(this,r),!1);const d=document.createElement("button");d.className=o,d.setAttribute("type","button"),d.title=u,d.appendChild(typeof c=="string"?document.createTextNode(c):c),d.addEventListener(ne.CLICK,this.handleClick_.bind(this,-r),!1);const f=i+" "+bi+" "+ss,p=this.element;p.className=f,p.appendChild(h),p.appendChild(d),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const r=i.getZoom();if(r!==void 0){const s=i.getConstrainedZoom(r+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Hr})):i.setZoom(s)}}}var b1=AC;const S1=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],R1={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"};class PC extends Yi{constructor(e){const t=e||{};super({element:document.createElement("div"),target:t.target}),this.on,this.once,this.un,this.cssClassName_=t.className!==void 0?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=t.activeClassName!==void 0?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=t.inactiveClassName!==void 0?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const i=t.label!==void 0?t.label:"\u2922";this.labelNode_=typeof i=="string"?document.createTextNode(i):i;const r=t.labelActive!==void 0?t.labelActive:"\xD7";this.labelActiveNode_=typeof r=="string"?document.createTextNode(r):r,this.button_=document.createElement("button");const s=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_.setAttribute("type","button"),this.button_.title=s,this.button_.appendChild(this.labelNode_),this.button_.addEventListener(ne.CLICK,this.handleClick_.bind(this),!1),this.element.className=`${this.cssClassName_} ${bi} ${ss}`,this.element.appendChild(this.button_),this.keys_=t.keys!==void 0?t.keys:!1,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this)}handleClick_(e){e.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const e=this.getMap();if(!e)return;const t=e.getOwnerDocument();if(!!I1(t))if(C1(t))MC(t);else{let i;this.source_?i=typeof this.source_=="string"?t.getElementById(this.source_):this.source_:i=e.getTargetElement(),this.keys_?OC(i):L1(i)}}handleFullScreenChange_(){const e=this.getMap();if(!e)return;const t=this.isInFullscreen_;this.isInFullscreen_=C1(e.getOwnerDocument()),t!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(io(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(R1.ENTERFULLSCREEN)):(io(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(R1.LEAVEFULLSCREEN)),e.updateSize())}setClassName_(e,t){const i=this.activeClassName_,r=this.inactiveClassName_,s=t?i:r;e.classList.remove(...i),e.classList.remove(...r),e.classList.add(...s)}setMap(e){const t=this.getMap();t&&t.removeChangeListener(Rt.TARGET,this.boundHandleMapTargetChange_),super.setMap(e),this.handleMapTargetChange_(),e&&e.addChangeListener(Rt.TARGET,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const e=this.documentListeners_;for(let i=0,r=e.length;i<r;++i)je(e[i]);e.length=0;const t=this.getMap();if(t){const i=t.getOwnerDocument();I1(i)?this.element.classList.remove(Jp):this.element.classList.add(Jp);for(let r=0,s=S1.length;r<s;++r)e.push(pe(i,S1[r],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}}function I1(n){const e=n.body;return!!(e.webkitRequestFullscreen||e.msRequestFullscreen&&n.msFullscreenEnabled||e.requestFullscreen&&n.fullscreenEnabled)}function C1(n){return!!(n.webkitIsFullScreen||n.msFullscreenElement||n.fullscreenElement)}function L1(n){n.requestFullscreen?n.requestFullscreen():n.msRequestFullscreen?n.msRequestFullscreen():n.webkitRequestFullscreen&&n.webkitRequestFullscreen()}function OC(n){n.webkitRequestFullscreen?n.webkitRequestFullscreen():L1(n)}function MC(n){n.exitFullscreen?n.exitFullscreen():n.msExitFullscreen?n.msExitFullscreen():n.webkitExitFullscreen&&n.webkitExitFullscreen()}var FC=PC;const mg="projection",A1="coordinateFormat";class NC extends Yi{constructor(e){const t=e||{},i=document.createElement("div");i.className=t.className!==void 0?t.className:"ol-mouse-position",super({element:i,render:t.render,target:t.target}),this.on,this.once,this.un,this.addChangeListener(mg,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection);let r=!0,s=" ";"undefinedHTML"in t?(t.undefinedHTML!==void 0&&(s=t.undefinedHTML),r=!!s):"placeholder"in t&&(t.placeholder===!1?r=!1:s=String(t.placeholder)),this.placeholder_=s,this.renderOnMouseOut_=r,this.renderedHTML_=i.innerHTML,this.mapProjection_=null,this.transform_=null}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(A1)}getProjection(){return this.get(mg)}handleMouseMove(e){const t=this.getMap();this.updateHTML_(t.getEventPixel(e))}handleMouseOut(e){this.updateHTML_(null)}setMap(e){if(super.setMap(e),e){const t=e.getViewport();this.listenerKeys.push(pe(t,Ri.POINTERMOVE,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(pe(t,Ri.POINTEROUT,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(e){this.set(A1,e)}setProjection(e){this.set(mg,re(e))}updateHTML_(e){let t=this.placeholder_;if(e&&this.mapProjection_){if(!this.transform_){const s=this.getProjection();s?this.transform_=qn(this.mapProjection_,s):this.transform_=kl}const r=this.getMap().getCoordinateFromPixelInternal(e);if(r){const s=En();s&&(this.transform_=qn(this.mapProjection_,s)),this.transform_(r,r);const o=this.getCoordinateFormat();o?t=o(r):t=r.toString()}}(!this.renderedHTML_||t!==this.renderedHTML_)&&(this.element.innerHTML=t,this.renderedHTML_=t)}render(e){const t=e.frameState;t?this.mapProjection_!=t.viewState.projection&&(this.mapProjection_=t.viewState.projection,this.transform_=null):this.mapProjection_=null}}var kC=NC,bn={BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right",CENTER_LEFT:"center-left",CENTER_CENTER:"center-center",CENTER_RIGHT:"center-right",TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right"};const mn={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class $C extends Fn{constructor(e){super(),this.on,this.once,this.un,this.options=e,this.id=e.id,this.insertFirst=e.insertFirst!==void 0?e.insertFirst:!0,this.stopEvent=e.stopEvent!==void 0?e.stopEvent:!0,this.element=document.createElement("div"),this.element.className=e.className!==void 0?e.className:"ol-overlay-container "+t1,this.element.style.position="absolute",this.element.style.pointerEvents="auto";let t=e.autoPan;t&&typeof t!="object"&&(t={animation:e.autoPanAnimation,margin:e.autoPanMargin}),this.autoPan=t||!1,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(mn.ELEMENT,this.handleElementChanged),this.addChangeListener(mn.MAP,this.handleMapChanged),this.addChangeListener(mn.OFFSET,this.handleOffsetChanged),this.addChangeListener(mn.POSITION,this.handlePositionChanged),this.addChangeListener(mn.POSITIONING,this.handlePositioningChanged),e.element!==void 0&&this.setElement(e.element),this.setOffset(e.offset!==void 0?e.offset:[0,0]),this.setPositioning(e.positioning!==void 0?e.positioning:bn.TOP_LEFT),e.position!==void 0&&this.setPosition(e.position)}getElement(){return this.get(mn.ELEMENT)}getId(){return this.id}getMap(){return this.get(mn.MAP)||null}getOffset(){return this.get(mn.OFFSET)}getPosition(){return this.get(mn.POSITION)}getPositioning(){return this.get(mn.POSITIONING)}handleElementChanged(){Yp(this.element);const e=this.getElement();e&&this.element.appendChild(e)}handleMapChanged(){this.mapPostrenderListenerKey&&(Vl(this.element),je(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const e=this.getMap();if(e){this.mapPostrenderListenerKey=pe(e,lo.POSTRENDER,this.render,this),this.updatePixelPosition();const t=this.stopEvent?e.getOverlayContainerStopEvent():e.getOverlayContainer();this.insertFirst?t.insertBefore(this.element,t.childNodes[0]||null):t.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(e){this.set(mn.ELEMENT,e)}setMap(e){this.set(mn.MAP,e)}setOffset(e){this.set(mn.OFFSET,e)}setPosition(e){this.set(mn.POSITION,e)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(e){const t=this.getMap();if(!t||!t.getTargetElement()||!this.get(mn.POSITION))return;const i=this.getRect(t.getTargetElement(),t.getSize()),r=this.getElement(),s=this.getRect(r,[Yx(r),Xx(r)]),o=e||{},a=o.margin===void 0?20:o.margin;if(!Gt(i,s)){const c=s[0]-i[0],l=i[2]-s[2],u=s[1]-i[1],h=i[3]-s[3],d=[0,0];if(c<0?d[0]=c-a:l<0&&(d[0]=Math.abs(l)+a),u<0?d[1]=u-a:h<0&&(d[1]=Math.abs(h)+a),d[0]!==0||d[1]!==0){const f=t.getView().getCenterInternal(),p=t.getPixelFromCoordinateInternal(f);if(!p)return;const m=[p[0]+d[0],p[1]+d[1]],g=o.animation||{};t.getView().animateInternal({center:t.getCoordinateFromPixelInternal(m),duration:g.duration,easing:g.easing})}}}getRect(e,t){const i=e.getBoundingClientRect(),r=i.left+window.pageXOffset,s=i.top+window.pageYOffset;return[r,s,r+t[0],s+t[1]]}setPositioning(e){this.set(mn.POSITIONING,e)}setVisible(e){this.rendered.visible!==e&&(this.element.style.display=e?"":"none",this.rendered.visible=e)}updatePixelPosition(){const e=this.getMap(),t=this.getPosition();if(!e||!e.isRendered()||!t){this.setVisible(!1);return}const i=e.getPixelFromCoordinate(t),r=e.getSize();this.updateRenderedPosition(i,r)}updateRenderedPosition(e,t){const i=this.element.style,r=this.getOffset(),s=this.getPositioning();this.setVisible(!0);const o=Math.round(e[0]+r[0])+"px",a=Math.round(e[1]+r[1])+"px";let c="0%",l="0%";s==bn.BOTTOM_RIGHT||s==bn.CENTER_RIGHT||s==bn.TOP_RIGHT?c="-100%":(s==bn.BOTTOM_CENTER||s==bn.CENTER_CENTER||s==bn.TOP_CENTER)&&(c="-50%"),s==bn.BOTTOM_LEFT||s==bn.BOTTOM_CENTER||s==bn.BOTTOM_RIGHT?l="-100%":(s==bn.CENTER_LEFT||s==bn.CENTER_CENTER||s==bn.CENTER_RIGHT)&&(l="-50%");const u=`translate(${c}, ${l}) translate(${o}, ${a})`;this.rendered.transform_!=u&&(this.rendered.transform_=u,i.transform=u,i.msTransform=u)}getOptions(){return this.options}}var yg=$C;const _g=.75,vh=.1;class DC extends xh{createRenderer(){return new rg(this)}}class GC extends Yi{constructor(e){const t=e||{};super({element:document.createElement("div"),render:t.render,target:t.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=t.rotateWithView!==void 0?t.rotateWithView:!1,this.viewExtent_=void 0;const i=t.className!==void 0?t.className:"ol-overviewmap",r=t.tipLabel!==void 0?t.tipLabel:"Overview map",s=t.collapseLabel!==void 0?t.collapseLabel:"\u2039";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s):this.collapseLabel_=s;const o=t.label!==void 0?t.label:"\u203A";typeof o=="string"?(this.label_=document.createElement("span"),this.label_.textContent=o):this.label_=o;const a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,c=document.createElement("button");c.setAttribute("type","button"),c.title=r,c.appendChild(a),c.addEventListener(ne.CLICK,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=t.view,this.ovmap_=new DC({view:t.view});const l=this.ovmap_;t.layers&&t.layers.forEach(function(v){l.addLayer(v)});const u=document.createElement("div");u.className="ol-overviewmap-box",u.style.boxSizing="border-box",this.boxOverlay_=new yg({position:[0,0],positioning:bn.CENTER_CENTER,element:u}),this.ovmap_.addOverlay(this.boxOverlay_);const h=i+" "+bi+" "+ss+(this.collapsed_&&this.collapsible_?" "+Wl:"")+(this.collapsible_?"":" ol-uncollapsible"),d=this.element;d.className=h,d.appendChild(this.ovmapDiv_),d.appendChild(c);const f=this,p=this.boxOverlay_,m=this.boxOverlay_.getElement(),g=function(v){return{clientX:v.clientX,clientY:v.clientY}},y=function(v){const x=g(v),w=l.getEventCoordinateInternal(x);p.setPosition(w)},_=function(v){const x=l.getEventCoordinateInternal(v);f.getMap().getView().setCenterInternal(x),window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",_)};m.addEventListener("mousedown",function(){window.addEventListener("mousemove",y),window.addEventListener("mouseup",_)})}setMap(e){const t=this.getMap();if(e!==t){if(t){const i=t.getView();i&&this.unbindView_(i),this.ovmap_.setTarget(null)}if(super.setMap(e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(pe(e,Vr.PROPERTYCHANGE,this.handleMapPropertyChange_,this));const i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(e){if(e.key===Rt.VIEW){const t=e.oldValue;t&&this.unbindView_(t);const i=this.getMap().getView();this.bindView_(i)}else!this.ovmap_.isRendered()&&(e.key===Rt.TARGET||e.key===Rt.SIZE)&&this.ovmap_.updateSize()}bindView_(e){if(!this.view_){const t=new Vi({projection:e.getProjection()});this.ovmap_.setView(t)}e.addChangeListener(zn.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()}unbindView_(e){e.removeChangeListener(zn.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),s=e.getView().calculateExtentInternal(i);if(this.viewExtent_&&Kn(s,this.viewExtent_))return;this.viewExtent_=s;const o=t.getSize(),c=t.getView().calculateExtentInternal(o),l=t.getPixelFromCoordinateInternal(si(s)),u=t.getPixelFromCoordinateInternal(Ws(s)),h=Math.abs(l[0]-u[0]),d=Math.abs(l[1]-u[1]),f=o[0],p=o[1];h<f*vh||d<p*vh||h>f*_g||d>p*_g?this.resetExtent_():Gt(c,s)||this.recenter_()}resetExtent_(){const e=this.getMap(),t=this.ovmap_,i=e.getSize(),s=e.getView().calculateExtentInternal(i),o=t.getView(),a=Math.log(_g/vh)/Math.LN2,c=1/(Math.pow(2,a/2)*vh);Cl(s,c),o.fitInternal(no(s))}recenter_(){const e=this.getMap(),t=this.ovmap_,i=e.getView();t.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const e=this.getMap(),t=this.ovmap_;if(!e.isRendered()||!t.isRendered())return;const i=e.getSize(),r=e.getView(),s=t.getView(),o=this.rotateWithView_?0:-r.getRotation(),a=this.boxOverlay_,c=this.boxOverlay_.getElement(),l=r.getCenterInternal(),u=r.getResolution(),h=s.getResolution(),d=i[0]*u/h,f=i[1]*u/h;if(a.setPosition(l),c){c.style.width=d+"px",c.style.height=f+"px";const p="rotate("+o+"rad)";c.style.transform=p}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=Bs(this.ovmap_,lo.POSTRENDER,function(e){delete this.ovmapPostrenderKey_,this.updateBox_()},this))}handleClick_(e){e.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(Wl),this.collapsed_?io(this.collapseLabel_,this.label_):io(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const e=this.ovmap_;if(!this.collapsed_){if(e.isRendered()){this.viewExtent_=void 0,e.render();return}e.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),!e&&this.collapsed_&&this.handleToggle_())}setCollapsed(e){!this.collapsible_||this.collapsed_===e||this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(e){this.rotateWithView_!==e&&(this.rotateWithView_=e,this.getMap().getView().getRotation()!==0&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(e){this.validateExtent_(),this.updateBox_()}}var UC=GC;const xg="units",as={DEGREES:"degrees",IMPERIAL:"imperial",NAUTICAL:"nautical",METRIC:"metric",US:"us"},zC=[1,2,5],vg=25.4/.28;class BC extends Yi{constructor(e){const t=e||{},i=t.className!==void 0?t.className:t.bar?"ol-scale-bar":"ol-scale-line";super({element:document.createElement("div"),render:t.render,target:t.target}),this.on,this.once,this.un,this.innerElement_=document.createElement("div"),this.innerElement_.className=i+"-inner",this.element.className=i+" "+bi,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=t.minWidth!==void 0?t.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(xg,this.handleUnitsChanged_),this.setUnits(t.units||as.METRIC),this.scaleBar_=t.bar||!1,this.scaleBarSteps_=t.steps||4,this.scaleBarText_=t.text||!1,this.dpi_=t.dpi||void 0}getUnits(){return this.get(xg)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(xg,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=e.center,i=e.projection,r=this.getUnits(),s=r==as.DEGREES?gn.DEGREES:gn.METERS;let o=$l(i,e.resolution,t,s);const a=this.minWidth_*(this.dpi_||vg)/vg;let c=a*o,l="";if(r==as.DEGREES){const m=on[gn.DEGREES];c*=m,c<m/60?(l="\u2033",o*=3600):c<m?(l="\u2032",o*=60):l="\xB0"}else r==as.IMPERIAL?c<.9144?(l="in",o/=.0254):c<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):r==as.NAUTICAL?(o/=1852,l="nm"):r==as.METRIC?c<.001?(l="\u03BCm",o*=1e6):c<1?(l="mm",o*=1e3):c<1e3?l="m":(l="km",o/=1e3):r==as.US?c<.9144?(l="in",o*=39.37):c<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):ce(!1,33);let u=3*Math.floor(Math.log(a*o)/Math.log(10)),h,d,f;for(;;){f=Math.floor(u/3);const m=Math.pow(10,f);if(h=zC[(u%3+3)%3]*m,d=Math.round(h/o),isNaN(d)){this.element.style.display="none",this.renderedVisible_=!1;return}else if(d>=a)break;++u}let p;this.scaleBar_?p=this.createScaleBar(d,h,l):p=h.toFixed(f<0?-f:0)+" "+l,this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),this.renderedWidth_!=d&&(this.innerElement_.style.width=d+"px",this.renderedWidth_=d),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,t,i){const r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),s=[],o=e/this.scaleBarSteps_;let a="#ffffff";for(let u=0;u<this.scaleBarSteps_;u++)u===0&&s.push(this.createMarker("absolute",u)),s.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"></div>'+this.createMarker("relative",u)+(u%2===0||this.scaleBarSteps_===2?this.createStepText(u,e,!1,t,i):"")+"</div>"),u===this.scaleBarSteps_-1&&s.push(this.createStepText(u+1,e,!0,t,i)),a==="#ffffff"?a="#000000":a="#ffffff";let c;return this.scaleBarText_?c='<div class="ol-scale-text" style="width: '+e+'px;">'+r+"</div>":c="",'<div style="display: flex;">'+c+s.join("")+"</div>"}createMarker(e,t){const i=e==="absolute"?3:-10;return'<div class="ol-scale-step-marker" style="position: '+e+";top: "+i+'px;"></div>'}createStepText(e,t,i,r,s){const a=(e===0?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+s),c=e===0?-3:t/this.scaleBarSteps_*-1,l=e===0?0:t/this.scaleBarSteps_*2;return'<div class="ol-scale-step-text" style="margin-left: '+c+"px;text-align: "+(e===0?"left":"center")+"; min-width: "+l+"px;left: "+(i?t+"px":"unset")+';">'+a+"</div>"}getScaleForResolution(){const e=$l(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,gn.METERS),t=this.dpi_||vg,i=1e3/25.4;return parseFloat(e.toString())*i*t}render(e){const t=e.frameState;t?this.viewState_=t.viewState:this.viewState_=null,this.updateElement_()}}var jC=BC;const ec={VERTICAL:0,HORIZONTAL:1};class VC extends Yi{constructor(e){const t=e||{};super({element:document.createElement("div"),render:t.render}),this.dragListenerKeys_=[],this.currentResolution_=void 0,this.direction_=ec.VERTICAL,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.startX_,this.startY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=t.duration!==void 0?t.duration:200;const i=t.className!==void 0?t.className:"ol-zoomslider",r=document.createElement("button");r.setAttribute("type","button"),r.className=i+"-thumb "+bi;const s=this.element;s.className=i+" "+bi+" "+ss,s.appendChild(r),s.addEventListener(Ri.POINTERDOWN,this.handleDraggerStart_.bind(this),!1),s.addEventListener(Ri.POINTERMOVE,this.handleDraggerDrag_.bind(this),!1),s.addEventListener(Ri.POINTERUP,this.handleDraggerEnd_.bind(this),!1),s.addEventListener(ne.CLICK,this.handleContainerClick_.bind(this),!1),r.addEventListener(ne.CLICK,A_,!1)}setMap(e){super.setMap(e),e&&e.render()}initSlider_(){const e=this.element;let t=e.offsetWidth,i=e.offsetHeight;if(t===0&&i===0)return this.sliderInitialized_=!1;const r=getComputedStyle(e);t-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),i-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);const s=e.firstElementChild,o=getComputedStyle(s),a=s.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),c=s.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.thumbSize_=[a,c],t>i?(this.direction_=ec.HORIZONTAL,this.widthLimit_=t-a):(this.direction_=ec.VERTICAL,this.heightLimit_=i-c),this.sliderInitialized_=!0}handleContainerClick_(e){const t=this.getMap().getView(),i=this.getRelativePosition_(e.offsetX-this.thumbSize_[0]/2,e.offsetY-this.thumbSize_[1]/2),r=this.getResolutionForPosition_(i),s=t.getConstrainedZoom(t.getZoomForResolution(r));t.animateInternal({zoom:s,duration:this.duration_,easing:Hr})}handleDraggerStart_(e){if(!this.dragging_&&e.target===this.element.firstElementChild){const t=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=e.clientX-parseFloat(t.style.left),this.startY_=e.clientY-parseFloat(t.style.top),this.dragging_=!0,this.dragListenerKeys_.length===0){const i=this.handleDraggerDrag_,r=this.handleDraggerEnd_,s=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(pe(s,Ri.POINTERMOVE,i,this),pe(s,Ri.POINTERUP,r,this))}}}handleDraggerDrag_(e){if(this.dragging_){const t=e.clientX-this.startX_,i=e.clientY-this.startY_,r=this.getRelativePosition_(t,i);this.currentResolution_=this.getResolutionForPosition_(r),this.getMap().getView().setResolution(this.currentResolution_)}}handleDraggerEnd_(e){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(je),this.dragListenerKeys_.length=0)}setThumbPosition_(e){const t=this.getPositionForResolution_(e),i=this.element.firstElementChild;this.direction_==ec.HORIZONTAL?i.style.left=this.widthLimit_*t+"px":i.style.top=this.heightLimit_*t+"px"}getRelativePosition_(e,t){let i;return this.direction_===ec.HORIZONTAL?i=e/this.widthLimit_:i=t/this.heightLimit_,we(i,0,1)}getResolutionForPosition_(e){return this.getMap().getView().getResolutionForValueFunction()(1-e)}getPositionForResolution_(e){const t=this.getMap().getView().getValueForResolutionFunction();return we(1-t(e),0,1)}render(e){if(!e.frameState||!this.sliderInitialized_&&!this.initSlider_())return;const t=e.frameState.viewState.resolution;this.currentResolution_=t,this.setThumbPosition_(t)}}var YC=VC;class XC extends Yi{constructor(e){const t=e||{};super({element:document.createElement("div"),target:t.target}),this.extent=t.extent?t.extent:null;const i=t.className!==void 0?t.className:"ol-zoom-extent",r=t.label!==void 0?t.label:"E",s=t.tipLabel!==void 0?t.tipLabel:"Fit to extent",o=document.createElement("button");o.setAttribute("type","button"),o.title=s,o.appendChild(typeof r=="string"?document.createTextNode(r):r),o.addEventListener(ne.CLICK,this.handleClick_.bind(this),!1);const a=i+" "+bi+" "+ss,c=this.element;c.className=a,c.appendChild(o)}handleClick_(e){e.preventDefault(),this.handleZoomToExtent()}handleZoomToExtent(){const t=this.getMap().getView(),i=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(no(i))}}var ZC=XC;function P1(n){const e=n||{},t=new At;return(e.zoom!==void 0?e.zoom:!0)&&t.push(new b1(e.zoomOptions)),(e.rotate!==void 0?e.rotate:!0)&&t.push(new T1(e.rotateOptions)),(e.attribution!==void 0?e.attribution:!0)&&t.push(new E1(e.attributionOptions)),t}var tc={ACTIVE:"active"};class WC extends Fn{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(tc.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(tc.ACTIVE,e)}setMap(e){this.map_=e}}function O1(n,e,t){const i=n.getCenterInternal();if(i){const r=[i[0]+e[0],i[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:$_,center:n.getConstrainedCenter(r)})}}function wh(n,e,t,i){const r=n.getZoom();if(r===void 0)return;const s=n.getConstrainedZoom(r+e),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:i!==void 0?i:250,easing:Hr})}var ls=WC;class HC extends ls{constructor(e){super();const t=e||{};this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(e){let t=!1;if(e.type==Re.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();wh(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}var M1=HC;class KC extends ls{constructor(e){const t=e||{};super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==Re.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==Re.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==Re.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==Re.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){if(qC(e)){const t=e.originalEvent,i=t.pointerId.toString();e.type==Re.POINTERUP?delete this.trackedPointers_[i]:e.type==Re.POINTERDOWN?this.trackedPointers_[i]=t:i in this.trackedPointers_&&(this.trackedPointers_[i]=t),this.targetPointers=Nu(this.trackedPointers_)}}}function Eh(n){const e=n.length;let t=0,i=0;for(let r=0;r<e;r++)t+=n[r].clientX,i+=n[r].clientY;return[t/e,i/e]}function qC(n){const e=n.type;return e===Re.POINTERDOWN||e===Re.POINTERDRAG||e===Re.POINTERUP}var li=KC;function Th(n){const e=arguments;return function(t){let i=!0;for(let r=0,s=e.length;r<s&&(i=i&&e[r](t),!!i);++r);return i}}const F1=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},N1=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},k1=function(n){const e=n.map.getTargetElement(),t=n.map.getOwnerDocument().activeElement;return e.contains(t)},wg=function(n){return n.map.getTargetElement().hasAttribute("tabindex")?k1(n):!0},_a=Mn,JC=function(n){return n.type==Re.CLICK},Eg=function(n){const e=n.originalEvent;return e.button==0&&!(U_&&op&&e.ctrlKey)},Tg=Yr,QC=function(n){return n.type=="pointermove"},bg=function(n){return n.type==Re.SINGLECLICK},e2=function(n){return n.type==Re.DBLCLICK},bh=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},t2=function(n){const e=n.originalEvent;return!e.altKey&&(op?e.metaKey:e.ctrlKey)&&!e.shiftKey},nc=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Sg=function(n){const t=n.originalEvent.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"},uo=function(n){const e=n.originalEvent;return ce(e!==void 0,56),e.pointerType=="mouse"},n2=function(n){const e=n.originalEvent;return ce(e!==void 0,56),e.pointerType==="touch"},i2=function(n){const e=n.originalEvent;return ce(e!==void 0,56),e.pointerType==="pen"},Rg=function(n){const e=n.originalEvent;return ce(e!==void 0,56),e.isPrimary&&e.button===0};class r2 extends li{constructor(e){super({stopDown:Yr});const t=e||{};this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const i=t.condition?t.condition:Th(bh,Rg);this.condition_=t.onFocusOnly?Th(wg,i):i,this.noKinetic_=!1}handleDragEvent(e){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());const t=this.targetPointers,i=Eh(t);if(t.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){const r=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],o=e.map.getView();Tp(r,o.getResolution()),Zu(r,o.getRotation()),o.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=t.length,e.originalEvent.preventDefault()}handleUpEvent(e){const t=e.map,i=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const r=this.kinetic_.getDistance(),s=this.kinetic_.getAngle(),o=i.getCenterInternal(),a=t.getPixelFromCoordinateInternal(o),c=t.getCoordinateFromPixelInternal([a[0]-r*Math.cos(s),a[1]-r*Math.sin(s)]);i.animateInternal({center:i.getConstrainedCenter(c),duration:500,easing:Hr})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}else return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1}}var $1=r2;class s2 extends li{constructor(e){const t=e||{};super({stopDown:Yr}),this.condition_=t.condition?t.condition:N1,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(e){if(!uo(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===mh)return;const r=t.getSize(),s=e.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return uo(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return uo(e)&&Eg(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}var D1=s2;class o2 extends Us{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,t=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(e[0],t[0])+i,r.top=Math.min(e[1],t[1])+i,r.width=Math.abs(t[0]-e[0])+i,r.height=Math.abs(t[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){const e=this.startPixel_,t=this.endPixel_,r=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Bt([r])}getGeometry(){return this.geometry_}}var G1=o2;const Sh={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Rh extends Mt{constructor(e,t,i){super(e),this.coordinate=t,this.mapBrowserEvent=i}}class a2 extends li{constructor(e){super(),this.on,this.once,this.un;const t=e||{};this.box_=new G1(t.className||"ol-dragbox"),this.minArea_=t.minArea!==void 0?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:Eg,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,i){const r=i[0]-t[0],s=i[1]-t[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new Rh(Sh.BOXDRAG,e.coordinate,e))}handleUpEvent(e){this.box_.setMap(null);const t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new Rh(t?Sh.BOXEND:Sh.BOXCANCEL,e.coordinate,e)),!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Rh(Sh.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}}var U1=a2;class l2 extends U1{constructor(e){const t=e||{},i=t.condition?t.condition:nc;super({condition:i,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(e){const i=this.getMap().getView();let r=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:Hr})}}var z1=l2,cs={LEFT:37,UP:38,RIGHT:39,DOWN:40};class c2 extends ls{constructor(e){super();const t=e||{};this.defaultCondition_=function(i){return bh(i)&&Sg(i)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(e){let t=!1;if(e.type==ne.KEYDOWN){const i=e.originalEvent,r=i.keyCode;if(this.condition_(e)&&(r==cs.DOWN||r==cs.LEFT||r==cs.RIGHT||r==cs.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let c=0,l=0;r==cs.DOWN?l=-a:r==cs.LEFT?c=-a:r==cs.RIGHT?c=a:l=a;const u=[c,l];Zu(u,o.getRotation()),O1(o,u,this.duration_),i.preventDefault(),t=!0}}return!t}}var B1=c2;class u2 extends ls{constructor(e){super();const t=e||{};this.condition_=t.condition?t.condition:Sg,this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(e){let t=!1;if(e.type==ne.KEYDOWN||e.type==ne.KEYPRESS){const i=e.originalEvent,r=i.charCode;if(this.condition_(e)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){const s=e.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_,a=s.getView();wh(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}var j1=u2;const Ih={TRACKPAD:"trackpad",WHEEL:"wheel"};class h2 extends ls{constructor(e){const t=e||{};super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const i=t.condition?t.condition:_a;this.condition_=t.onFocusOnly?Th(wg,i):i,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(e){if(!this.condition_(e)||e.type!==ne.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.coordinate);let s;if(e.type==ne.WHEEL&&(s=r.deltaY,G_&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=Uu),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?Ih.TRACKPAD:Ih.WHEEL);const a=i.getView();if(this.mode_===Ih.TRACKPAD&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=s;const c=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let i=-we(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),wh(t,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}var V1=h2;class d2 extends li{constructor(e){const t=e||{},i=t;i.stopDown||(i.stopDown=Yr),super(i),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(e){let t=0;const i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){const u=s-this.lastAngle_;this.rotationDelta_+=u,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=u}this.lastAngle_=s;const o=e.map,a=o.getView();if(a.getConstraints().rotation===mh)return;const c=o.getViewport().getBoundingClientRect(),l=Eh(this.targetPointers);l[0]-=c.left,l[1]-=c.top,this.anchor_=o.getCoordinateFromPixelInternal(l),this.rotating_&&(o.render(),a.adjustRotationInternal(t,this.anchor_))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}else return!1}}var Y1=d2;class f2 extends li{constructor(e){const t=e||{},i=t;i.stopDown||(i.stopDown=Yr),super(i),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1;const i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(t=this.lastDistance_/a),this.lastDistance_=a;const c=e.map,l=c.getView();t!=1&&(this.lastScaleDelta_=t);const u=c.getViewport().getBoundingClientRect(),h=Eh(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=c.getCoordinateFromPixelInternal(h),c.render(),l.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}else return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}else return!1}}var X1=f2,Bn={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"};const p2={ADD_FEATURES:"addfeatures"};class Z1 extends Mt{constructor(e,t,i,r){super(e),this.features=i,this.file=t,this.projection=r}}class g2 extends ls{constructor(e){const t=e||{};super({handleEvent:Mn}),this.on,this.once,this.un,this.readAsBuffer_=!1,this.formats_=[];const i=t.formatConstructors?t.formatConstructors:[];for(let r=0,s=i.length;r<s;++r){let o=i[r];typeof o=="function"&&(o=new o),this.formats_.push(o),this.readAsBuffer_=this.readAsBuffer_||o.getType()===Bn.ARRAY_BUFFER}this.projection_=t.projection?re(t.projection):null,this.dropListenKeys_=null,this.source_=t.source||null,this.target=t.target?t.target:null}handleResult_(e,t){const i=t.target.result,r=this.getMap();let s=this.projection_;s||(s=r.getView().getProjection());let o;const a=this.formats_;for(let c=0,l=a.length;c<l;++c){const u=a[c];let h=i;this.readAsBuffer_&&u.getType()!==Bn.ARRAY_BUFFER&&(o===void 0&&(o=new TextDecoder().decode(i)),h=o);const d=this.tryReadFeatures_(u,h,{featureProjection:s});if(d&&d.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(d)),this.dispatchEvent(new Z1(p2.ADD_FEATURES,e,d,s));break}}}registerListeners_(){const e=this.getMap();if(e){const t=this.target?this.target:e.getViewport();this.dropListenKeys_=[pe(t,ne.DROP,this.handleDrop,this),pe(t,ne.DRAGENTER,this.handleStop,this),pe(t,ne.DRAGOVER,this.handleStop,this),pe(t,ne.DROP,this.handleStop,this)]}}setActive(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),super.setActive(e)}setMap(e){this.unregisterListeners_(),super.setMap(e),this.getActive()&&this.registerListeners_()}tryReadFeatures_(e,t,i){try{return e.readFeatures(t,i)}catch{return null}}unregisterListeners_(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(je),this.dropListenKeys_=null)}handleDrop(e){const t=e.dataTransfer.files;for(let i=0,r=t.length;i<r;++i){const s=t.item(i),o=new FileReader;o.addEventListener(ne.LOAD,this.handleResult_.bind(this,s)),this.readAsBuffer_?o.readAsArrayBuffer(s):o.readAsText(s)}}handleStop(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy"}}var m2=g2;class y2 extends li{constructor(e){const t=e||{};super(t),this.condition_=t.condition?t.condition:nc,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=t.duration!==void 0?t.duration:400}handleDragEvent(e){if(!uo(e))return;const t=e.map,i=t.getSize(),r=e.pixel,s=r[0]-i[0]/2,o=i[1]/2-r[1],a=Math.atan2(o,s),c=Math.sqrt(s*s+o*o),l=t.getView();if(this.lastAngle_!==void 0){const u=this.lastAngle_-a;l.adjustRotationInternal(u)}this.lastAngle_=a,this.lastMagnitude_!==void 0&&l.adjustResolutionInternal(this.lastMagnitude_/c),this.lastMagnitude_!==void 0&&(this.lastScaleDelta_=this.lastMagnitude_/c),this.lastMagnitude_=c}handleUpEvent(e){if(!uo(e))return!0;const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1}handleDownEvent(e){return uo(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}}var _2=y2;class Lf extends Ti{constructor(e,t,i){if(super(),i!==void 0&&t===void 0)this.setFlatCoordinates(i,e);else{const r=t||0;this.setCenterAndRadius(e,r,i)}}clone(){const e=new Lf(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=e-s[0],a=t-s[1],c=o*o+a*a;if(c<r){if(c===0)for(let l=0;l<this.stride;++l)i[l]=s[l];else{const l=this.getRadius()/Math.sqrt(c);i[0]=s[0]+l*o,i[1]=s[1]+l*a;for(let u=2;u<this.stride;++u)i[u]=s[u]}return i.length=this.stride,c}else return r}containsXY(e,t){const i=this.flatCoordinates,r=e-i[0],s=t-i[1];return r*r+s*s<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){const t=this.flatCoordinates,i=t[this.stride]-t[0];return $n(t[0]-i,t[1]-i,t[0]+i,t[1]+i,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return R.CIRCLE}intersectsExtent(e){const t=this.getExtent();if(at(e,t)){const i=this.getCenter();return e[0]<=i[0]&&e[2]>=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:Vu(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+i;for(let s=1;s<t;++s)r[t+s]=e[s];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,i){this.setLayout(i,e,0),this.flatCoordinates||(this.flatCoordinates=[]);const r=this.flatCoordinates;let s=Fp(r,0,e,this.stride);r[s++]=r[0]+t;for(let o=1,a=this.stride;o<a;++o)r[s++]=r[o];r.length=s,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){const i=this.getCenter(),r=this.getStride();this.setCenter(eh(i,0,i.length,r,e,t,i)),this.changed()}translate(e,t){const i=this.getCenter(),r=this.getStride();this.setCenter(Op(i,0,i.length,r,e,t,i)),this.changed()}}Lf.prototype.transform;var Ig=Lf;function ic(n,e,t,i,r,s,o){let a,c;const l=(t-e)/i;if(l===1)a=e;else if(l===2)a=e,c=r;else if(l!==0){let d=n[e],f=n[e+1],p=0;const m=[0];for(let _=e+i;_<t;_+=i){const v=n[_],x=n[_+1];p+=Math.sqrt((v-d)*(v-d)+(x-f)*(x-f)),m.push(p),d=v,f=x}const g=r*p,y=P_(m,g);y<0?(c=(g-m[-y-2])/(m[-y-1]-m[-y-2]),a=e+(-y-2)*i):a=e+y*i}const u=o>1?o:2,h=s||new Array(u);for(let d=0;d<u;++d)h[d]=a===void 0?NaN:c===void 0?n[a+d]:Ui(n[a+d],n[a+i+d],c);return h}function Ch(n,e,t,i,r,s){if(t==e)return null;let o;if(r<n[e+i-1])return s?(o=n.slice(e,e+i),o[i-1]=r,o):null;if(n[t-1]<r)return s?(o=n.slice(t-i,t),o[i-1]=r,o):null;if(r==n[e+i-1])return n.slice(e,e+i);let a=e/i,c=t/i;for(;a<c;){const d=a+c>>1;r<n[(d+1)*i-1]?c=d:a=d+1}const l=n[a*i-1];if(r==l)return n.slice((a-1)*i,(a-1)*i+i);const u=n[(a+1)*i-1],h=(r-l)/(u-l);o=[];for(let d=0;d<i-1;++d)o.push(Ui(n[(a-1)*i+d],n[a*i+d],h));return o.push(r),o}function W1(n,e,t,i,r,s,o){if(o)return Ch(n,e,t[t.length-1],i,r,s);let a;if(r<n[i-1])return s?(a=n.slice(0,i),a[i-1]=r,a):null;if(n[n.length-1]<r)return s?(a=n.slice(n.length-i),a[i-1]=r,a):null;for(let c=0,l=t.length;c<l;++c){const u=t[c];if(e!=u){if(r<n[e+i-1])return null;if(r<=n[u-1])return Ch(n,e,u,i,r,!1);e=u}}return null}function Lh(n,e,t,i){let r=n[e],s=n[e+1],o=0;for(let a=e+i;a<t;a+=i){const c=n[a],l=n[a+1];o+=Math.sqrt((c-r)*(c-r)+(l-s)*(l-s)),r=c,s=l}return o}function x2(n,e,t,i){let r=Lh(n,e,t,i);const s=n[t-i]-n[e],o=n[t-i+1]-n[e+1];return r+=Math.sqrt(s*s+o*o),r}class Af extends Ti{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){this.flatCoordinates?Xe(this.flatCoordinates,e):this.flatCoordinates=e.slice(),this.changed()}clone(){const e=new Af(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<qr(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(nh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),rh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))}forEachSegment(e){return Gp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){if(this.layout!=H.XYM&&this.layout!=H.XYZM)return null;const i=t!==void 0?t:!1;return Ch(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)}getCoordinates(){return zi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return ic(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return Lh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const t=[];return t.length=Dl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new Af(t,H.XY)}getType(){return R.LINE_STRING}intersectsExtent(e){return Gl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=sa(this.flatCoordinates,0,e,this.stride),this.changed()}}var Tt=Af;class Pf extends Ti{constructor(e,t,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&i)this.setFlatCoordinates(t,e),this.ends_=i;else{let r=this.getLayout();const s=e,o=[],a=[];for(let c=0,l=s.length;c<l;++c){const u=s[c];c===0&&(r=u.getLayout()),Xe(o,u.getFlatCoordinates()),a.push(o.length)}this.setFlatCoordinates(r,o),this.ends_=a}}appendLineString(e){this.flatCoordinates?Xe(this.flatCoordinates,e.getFlatCoordinates().slice()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Pf(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<qr(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ih(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),sh(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))}getCoordinateAtM(e,t,i){if(this.layout!=H.XYM&&this.layout!=H.XYZM||this.flatCoordinates.length===0)return null;const r=t!==void 0?t:!1,s=i!==void 0?i:!1;return W1(this.flatCoordinates,0,this.ends_,this.stride,e,r,s)}getCoordinates(){return oa(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new Tt(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[];let s=0;for(let o=0,a=t.length;o<a;++o){const c=t[o],l=new Tt(e.slice(s,c),i);r.push(l),s=c}return r}getFlatMidpoints(){const e=[],t=this.flatCoordinates;let i=0;const r=this.ends_,s=this.stride;for(let o=0,a=r.length;o<a;++o){const c=r[o],l=ic(t,i,c,s,.5);Xe(e,l),i=c}return e}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Np(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,i),new Pf(t,H.XY,i)}getType(){return R.MULTI_LINE_STRING}intersectsExtent(e){return Dx(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=oh(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}var jn=Pf;class Qy extends Ti{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){this.flatCoordinates?Xe(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()}clone(){const e=new Qy(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<qr(this.getExtent(),e,t))return r;const s=this.flatCoordinates,o=this.stride;for(let a=0,c=s.length;a<c;a+=o){const l=ur(e,t,s[a],s[a+1]);if(l<r){r=l;for(let u=0;u<o;++u)i[u]=s[a+u];i.length=o}}return r}getCoordinates(){return zi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return e<0||t<=e?null:new ft(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,t=this.layout,i=this.stride,r=[];for(let s=0,o=e.length;s<o;s+=i){const a=new ft(e.slice(s,s+i),t);r.push(a)}return r}getType(){return R.MULTI_POINT}intersectsExtent(e){const t=this.flatCoordinates,i=this.stride;for(let r=0,s=t.length;r<s;r+=i){const o=t[r],a=t[r+1];if(zu(e,o,a))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=sa(this.flatCoordinates,0,e,this.stride),this.changed()}}var ci=Qy;function Cg(n,e,t,i){const r=[];let s=Kt();for(let o=0,a=t.length;o<a;++o){const c=t[o];s=ju(n,e,c[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=c[c.length-1]}return r}class Of extends Ti{constructor(e,t,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(e[0])){let r=this.getLayout();const s=e,o=[],a=[];for(let c=0,l=s.length;c<l;++c){const u=s[c];c===0&&(r=u.getLayout());const h=o.length,d=u.getEnds();for(let f=0,p=d.length;f<p;++f)d[f]+=h;Xe(o,u.getFlatCoordinates()),a.push(d)}t=r,e=o,i=a}t!==void 0&&i?(this.setFlatCoordinates(t,e),this.endss_=i):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;Xe(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let r=0,s=t.length;r<s;++r)t[r]+=i}this.endss_.push(t),this.changed()}clone(){const e=this.endss_.length,t=new Array(e);for(let r=0;r<e;++r)t[r]=this.endss_[r].slice();const i=new Of(this.flatCoordinates.slice(),this.layout,t);return i.applyProperties(this),i}closestPointXY(e,t,i,r){return r<qr(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Lx(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ax(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return $x(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return Nx(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),Bp(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,ah(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=Cg(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Dp(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new ci(this.getFlatInteriorPoints().slice(),H.XYM)}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Bx(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Bp(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Fx(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,i),new Of(t,H.XY,i)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{const s=this.endss_[e-1];t=s[s.length-1]}const i=this.endss_[e].slice(),r=i[i.length-1];if(t!==0)for(let s=0,o=i.length;s<o;++s)i[s]-=t;return new Bt(this.flatCoordinates.slice(t,r),this.layout,i)}getPolygons(){const e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const c=i[o].slice(),l=c[c.length-1];if(s!==0)for(let h=0,d=c.length;h<d;++h)c[h]-=s;const u=new Bt(t.slice(s,l),e,c);r.push(u),s=l}return r}getType(){return R.MULTI_POLYGON}intersectsExtent(e){return Ux(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Px(this.flatCoordinates,0,e,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const r=i[i.length-1];this.flatCoordinates.length=r.length===0?0:r[r.length-1]}this.changed()}}var ui=Of;function v2(n,e,t,i,r){H1(n,e,t||0,i||n.length-1,r||w2)}function H1(n,e,t,i,r){for(;i>t;){if(i-t>600){var s=i-t+1,o=e-t+1,a=Math.log(s),c=.5*Math.exp(2*a/3),l=.5*Math.sqrt(a*c*(s-c)/s)*(o-s/2<0?-1:1),u=Math.max(t,Math.floor(e-o*c/s+l)),h=Math.min(i,Math.floor(e+(s-o)*c/s+l));H1(n,e,u,h,r)}var d=n[e],f=t,p=i;for(rc(n,t,e),r(n[i],d)>0&&rc(n,t,i);f<p;){for(rc(n,f,p),f++,p--;r(n[f],d)<0;)f++;for(;r(n[p],d)>0;)p--}r(n[t],d)===0?rc(n,t,p):(p++,rc(n,p,i)),p<=e&&(t=p+1),e<=p&&(i=p-1)}}function rc(n,e,t){var i=n[e];n[e]=n[t],n[t]=i}function w2(n,e){return n<e?-1:n>e?1:0}class Lg{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!Ph(e,t))return i;const r=this.toBBox,s=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],c=t.leaf?r(a):a;Ph(e,c)&&(t.leaf?i.push(a):Pg(e,c)?this._all(a,i):s.push(a))}t=s.pop()}return i}collides(e){let t=this.data;if(!Ph(e,t))return!1;const i=[];for(;t;){for(let r=0;r<t.children.length;r++){const s=t.children[r],o=t.leaf?this.toBBox(s):s;if(Ph(e,o)){if(t.leaf||Pg(e,o))return!0;i.push(s)}}t=i.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let i=0;i<e.length;i++)this.insert(e[i]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const i=this.data;this.data=t,t=i}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=va([]),this}remove(e,t){if(!e)return this;let i=this.data;const r=this.toBBox(e),s=[],o=[];let a,c,l;for(;i||s.length;){if(i||(i=s.pop(),c=s[s.length-1],a=o.pop(),l=!0),i.leaf){const u=E2(e,i.children,t);if(u!==-1)return i.children.splice(u,1),s.push(i),this._condense(s),this}!l&&!i.leaf&&Pg(i,r)?(s.push(i),o.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],l=!1):i=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const i=[];for(;e;)e.leaf?t.push(...e.children):i.push(...e.children),e=i.pop();return t}_build(e,t,i,r){const s=i-t+1;let o=this._maxEntries,a;if(s<=o)return a=va(e.slice(t,i+1)),xa(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=va([]),a.leaf=!1,a.height=r;const c=Math.ceil(s/o),l=c*Math.ceil(Math.sqrt(o));K1(e,t,i,l,this.compareMinX);for(let u=t;u<=i;u+=l){const h=Math.min(u+l-1,i);K1(e,u,h,c,this.compareMinY);for(let d=u;d<=h;d+=c){const f=Math.min(d+c-1,h);a.children.push(this._build(e,d,f,r-1))}}return xa(a,this.toBBox),a}_chooseSubtree(e,t,i,r){for(;r.push(t),!(t.leaf||r.length-1===i);){let s=1/0,o=1/0,a;for(let c=0;c<t.children.length;c++){const l=t.children[c],u=Ag(l),h=S2(e,l)-u;h<o?(o=h,s=u<s?u:s,a=l):h===o&&u<s&&(s=u,a=l)}t=a||t.children[0]}return t}_insert(e,t,i){const r=i?e:this.toBBox(e),s=[],o=this._chooseSubtree(r,this.data,t,s);for(o.children.push(e),oc(o,r);t>=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(r,s,t)}_split(e,t){const i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);const o=this._chooseSplitIndex(i,s,r),a=va(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,xa(i,this.toBBox),xa(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=va([e,t]),this.data.height=e.height+1,this.data.leaf=!1,xa(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let r,s=1/0,o=1/0;for(let a=t;a<=i-t;a++){const c=sc(e,0,a,this.toBBox),l=sc(e,a,i,this.toBBox),u=R2(c,l),h=Ag(c)+Ag(l);u<s?(s=u,r=a,o=h<o?h:o):u===s&&h<o&&(o=h,r=a)}return r||i-t}_chooseSplitAxis(e,t,i){const r=e.leaf?this.compareMinX:T2,s=e.leaf?this.compareMinY:b2,o=this._allDistMargin(e,t,i,r),a=this._allDistMargin(e,t,i,s);o<a&&e.children.sort(r)}_allDistMargin(e,t,i,r){e.children.sort(r);const s=this.toBBox,o=sc(e,0,t,s),a=sc(e,i-t,i,s);let c=Ah(o)+Ah(a);for(let l=t;l<i-t;l++){const u=e.children[l];oc(o,e.leaf?s(u):u),c+=Ah(o)}for(let l=i-t-1;l>=t;l--){const u=e.children[l];oc(a,e.leaf?s(u):u),c+=Ah(a)}return c}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)oc(t[r],e)}_condense(e){for(let t=e.length-1,i;t>=0;t--)e[t].children.length===0?t>0?(i=e[t-1].children,i.splice(i.indexOf(e[t]),1)):this.clear():xa(e[t],this.toBBox)}}function E2(n,e,t){if(!t)return e.indexOf(n);for(let i=0;i<e.length;i++)if(t(n,e[i]))return i;return-1}function xa(n,e){sc(n,0,n.children.length,e,n)}function sc(n,e,t,i,r){r||(r=va(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<t;s++){const o=n.children[s];oc(r,n.leaf?i(o):o)}return r}function oc(n,e){return n.minX=Math.min(n.minX,e.minX),n.minY=Math.min(n.minY,e.minY),n.maxX=Math.max(n.maxX,e.maxX),n.maxY=Math.max(n.maxY,e.maxY),n}function T2(n,e){return n.minX-e.minX}function b2(n,e){return n.minY-e.minY}function Ag(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Ah(n){return n.maxX-n.minX+(n.maxY-n.minY)}function S2(n,e){return(Math.max(e.maxX,n.maxX)-Math.min(e.minX,n.minX))*(Math.max(e.maxY,n.maxY)-Math.min(e.minY,n.minY))}function R2(n,e){const t=Math.max(n.minX,e.minX),i=Math.max(n.minY,e.minY),r=Math.min(n.maxX,e.maxX),s=Math.min(n.maxY,e.maxY);return Math.max(0,r-t)*Math.max(0,s-i)}function Pg(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function Ph(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function va(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function K1(n,e,t,i,r){const s=[e,t];for(;s.length;){if(t=s.pop(),e=s.pop(),t-e<=i)continue;const o=e+Math.ceil((t-e)/i/2)*i;v2(n,o,e,t,r),s.push(e,o,o,t)}}class e_{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=pt(e.scale),this.displacement_=e.displacement}clone(){const e=this.getScale();return new e_({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getAnchor(){return he()}getImage(e){return he()}getHitDetectionImage(){return he()}getPixelRatio(e){return 1}getImageState(){return he()}getImageSize(){return he()}getOrigin(){return he()}getSize(){return he()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=pt(e)}listenImageChange(e){he()}load(){he()}unlistenImageChange(e){he()}}var Og=e_;function Ii(n){return Array.isArray(n)?Kp(n):n}class t_ extends Og{constructor(e){const t=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:1,rotateWithView:t,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0]}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius_=e.radius!==void 0?e.radius:e.radius1,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const e=this.getScale(),t=new t_({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t}getAnchor(){const e=this.size_;if(!e)return null;const t=this.getDisplacement();return[e[0]/2-t[0],e[1]/2+t[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.canvas_[e];if(!t){const i=this.renderOptions_,r=St(i.size*e,i.size*e);this.draw_(i,r,e),t=r.canvas,this.canvas_[e]=t}return t}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return me.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,i){if(t===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return t;let r=this.radius_,s=this.radius2_===void 0?r:this.radius2_;if(r<s){const E=r;r=s,s=E}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,c=s*Math.sin(a),l=Math.sqrt(s*s-c*c),u=r-l,h=Math.sqrt(c*c+u*u),d=h/c;if(e==="miter"&&d<=i)return d*t;const f=t/2/d,p=t/2*(u/h),g=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e==="bevel")return g*2;const y=r*Math.sin(a),_=Math.sqrt(r*r-y*y),v=s-_,w=Math.sqrt(y*y+v*v)/y;if(w<=i){const E=w*t/2-s-r;return 2*Math.max(g,E)}return g*2}createRenderOptions(){let e=ao,t=0,i=null,r=0,s,o=0;this.stroke_&&(s=this.stroke_.getColor(),s===null&&(s=fa),s=Ii(s),o=this.stroke_.getWidth(),o===void 0&&(o=ga),i=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),e=this.stroke_.getLineJoin(),e===void 0&&(e=ao),t=this.stroke_.getMiterLimit(),t===void 0&&(t=da));const a=this.calculateLineJoinSize_(e,o,t),c=Math.max(this.radius_,this.radius2_||0),l=Math.ceil(2*c+a);return{strokeStyle:s,strokeWidth:o,size:l,lineDash:i,lineDashOffset:r,lineJoin:e,miterLimit:t}}render(){this.renderOptions_=this.createRenderOptions();const e=this.renderOptions_.size;this.canvas_={},this.size_=[e,e]}draw_(e,t,i){if(t.scale(i,i),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let r=this.fill_.getColor();r===null&&(r=Bi),t.fillStyle=Ii(r),t.fill()}this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,t.setLineDash&&e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){if(this.fill_){let t=this.fill_.getColor(),i=0;if(typeof t=="string"&&(t=so(t)),t===null?i=1:Array.isArray(t)&&(i=t.length===4?t[3]:1),i===0){const r=St(e.size,e.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(e,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(e){let t=this.points_;const i=this.radius_;if(t===1/0)e.arc(0,0,i,0,2*Math.PI);else{const r=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(t*=2);const s=this.angle_-Math.PI/2,o=2*Math.PI/t;for(let a=0;a<t;a++){const c=s+a*o,l=a%2===0?i:r;e.lineTo(l*Math.cos(c),l*Math.sin(c))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=Bi,t.fill(),this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}}var q1=t_;class n_ extends q1{constructor(e){const t=e||{};super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0]})}clone(){const e=this.getScale(),t=new n_({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t}setRadius(e){this.radius_=e,this.render()}}var Oh=n_;class i_{constructor(e){const t=e||{};this.color_=t.color!==void 0?t.color:null}clone(){const e=this.getColor();return new i_({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){this.color_=e}}var Vn=i_;class r_{constructor(e){const t=e||{};this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const e=this.getColor();return new r_({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}var Sn=r_;class Ms{constructor(e){const t=e||{};this.geometry_=null,this.geometryFunction_=ev,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new Ms({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=ev,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function J1(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(ce(typeof n.getZIndex=="function",41),t=[n]),e=function(){return t}}return e}let Mg=null;function Q1(n,e){if(!Mg){const t=new Vn({color:"rgba(255,255,255,0.4)"}),i=new Sn({color:"#3399CC",width:1.25});Mg=[new Ms({image:new Oh({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return Mg}function wa(){const n={},e=[255,255,255,1],t=[0,153,255,1],i=3;return n[R.POLYGON]=[new Ms({fill:new Vn({color:[255,255,255,.5]})})],n[R.MULTI_POLYGON]=n[R.POLYGON],n[R.LINE_STRING]=[new Ms({stroke:new Sn({color:e,width:i+2})}),new Ms({stroke:new Sn({color:t,width:i})})],n[R.MULTI_LINE_STRING]=n[R.LINE_STRING],n[R.CIRCLE]=n[R.POLYGON].concat(n[R.LINE_STRING]),n[R.POINT]=[new Ms({image:new Oh({radius:i*2,fill:new Vn({color:t}),stroke:new Sn({color:e,width:i/2})}),zIndex:1/0})],n[R.MULTI_POINT]=n[R.POINT],n[R.GEOMETRY_COLLECTION]=n[R.POLYGON].concat(n[R.LINE_STRING],n[R.POINT]),n}function ev(n){return n.getGeometry()}var yn=Ms;const tv={RENDER_ORDER:"renderOrder"};class I2 extends oo{constructor(e){const t=e||{},i=J({},t);delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,super(i),this.declutter_=t.declutter!==void 0?t.declutter:!1,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(tv.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e){e.declutterTree||(e.declutterTree=new Lg(9)),this.getRenderer().renderDeclutter(e)}setRenderOrder(e){this.set(tv.RENDER_ORDER,e)}setStyle(e){this.style_=e!==void 0?e:Q1,this.styleFunction_=e===null?void 0:J1(this.style_),this.changed()}}var Ea=I2;const ac={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},lc=[ac.FILL],gr=[ac.STROKE],us=[ac.BEGIN_PATH],Fg=[ac.CLOSE_PATH];var _e=ac;class C2{drawCustom(e,t,i,r){}drawGeometry(e){}setStyle(e){}drawCircle(e,t){}drawFeature(e,t){}drawGeometryCollection(e,t){}drawLineString(e,t){}drawMultiLineString(e,t){}drawMultiPoint(e,t){}drawMultiPolygon(e,t){}drawPoint(e,t){}drawPolygon(e,t){}drawText(e,t){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}}var Ng=C2;class L2 extends Ng{constructor(e,t,i,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){const t=this.pixelRatio;return t==1?e:e.map(function(i){return i*t})}appendFlatPointCoordinates(e,t){const i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates;let o=s.length;for(let a=0,c=e.length;a<c;a+=t)r[0]=e[a],r[1]=e[a+1],kn(i,r)&&(s[o++]=r[0],s[o++]=r[1]);return o}appendFlatLineCoordinates(e,t,i,r,s,o){const a=this.coordinates;let c=a.length;const l=this.getBufferedMaxExtent();o&&(t+=r);let u=e[t],h=e[t+1];const d=this.tmpCoordinate_;let f=!0,p,m,g;for(p=t+r;p<i;p+=r)d[0]=e[p],d[1]=e[p+1],g=Bu(l,d),g!==m?(f&&(a[c++]=u,a[c++]=h,f=!1),a[c++]=d[0],a[c++]=d[1]):g===Dt.INTERSECTING?(a[c++]=d[0],a[c++]=d[1],f=!1):f=!0,u=d[0],h=d[1],m=g;return(s&&f||p===t+r)&&(a[c++]=u,a[c++]=h),c}drawCustomCoordinates_(e,t,i,r,s){for(let o=0,a=i.length;o<a;++o){const c=i[o],l=this.appendFlatLineCoordinates(e,t,c,r,!1,!1);s.push(l),t=c}return t}drawCustom(e,t,i,r){this.beginGeometry(e,t);const s=e.getType(),o=e.getStride(),a=this.coordinates.length;let c,l,u,h,d;switch(s){case R.MULTI_POLYGON:c=e.getOrientedFlatCoordinates(),h=[];const f=e.getEndss();d=0;for(let p=0,m=f.length;p<m;++p){const g=[];d=this.drawCustomCoordinates_(c,d,f[p],o,g),h.push(g)}this.instructions.push([_e.CUSTOM,a,h,e,i,ah]),this.hitDetectionInstructions.push([_e.CUSTOM,a,h,e,r||i,ah]);break;case R.POLYGON:case R.MULTI_LINE_STRING:u=[],c=s==R.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),d=this.drawCustomCoordinates_(c,0,e.getEnds(),o,u),this.instructions.push([_e.CUSTOM,a,u,e,i,oa]),this.hitDetectionInstructions.push([_e.CUSTOM,a,u,e,r||i,oa]);break;case R.LINE_STRING:case R.CIRCLE:c=e.getFlatCoordinates(),l=this.appendFlatLineCoordinates(c,0,c.length,o,!1,!1),this.instructions.push([_e.CUSTOM,a,l,e,i,zi]),this.hitDetectionInstructions.push([_e.CUSTOM,a,l,e,r||i,zi]);break;case R.MULTI_POINT:c=e.getFlatCoordinates(),l=this.appendFlatPointCoordinates(c,o),l>a&&(this.instructions.push([_e.CUSTOM,a,l,e,i,zi]),this.hitDetectionInstructions.push([_e.CUSTOM,a,l,e,r||i,zi]));break;case R.POINT:c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),l=this.coordinates.length,this.instructions.push([_e.CUSTOM,a,l,e,i]),this.hitDetectionInstructions.push([_e.CUSTOM,a,l,e,r||i]);break}this.endGeometry(t)}beginGeometry(e,t){this.beginGeometryInstruction1_=[_e.BEGIN_GEOMETRY,t,0,e],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[_e.BEGIN_GEOMETRY,t,0,e],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const e=this.hitDetectionInstructions;e.reverse();let t;const i=e.length;let r,s,o=-1;for(t=0;t<i;++t)r=e[t],s=r[0],s==_e.END_GEOMETRY?o=t:s==_e.BEGIN_GEOMETRY&&(r[2]=t,O_(this.hitDetectionInstructions,o,t),o=-1)}setFillStrokeStyle(e,t){const i=this.state;if(e){const r=e.getColor();i.fillStyle=Ii(r||Bi)}else i.fillStyle=void 0;if(t){const r=t.getColor();i.strokeStyle=Ii(r||fa);const s=t.getLineCap();i.lineCap=s!==void 0?s:Hl;const o=t.getLineDash();i.lineDash=o?o.slice():ua;const a=t.getLineDashOffset();i.lineDashOffset=a||ha;const c=t.getLineJoin();i.lineJoin=c!==void 0?c:ao;const l=t.getWidth();i.lineWidth=l!==void 0?l:ga;const u=t.getMiterLimit();i.miterLimit=u!==void 0?u:da,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(e){const t=e.fillStyle,i=[_e.SET_FILL_STYLE,t];return typeof t!="string"&&i.push(!0),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[_e.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){const i=e.fillStyle;(typeof i!="string"||e.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(t.call(this,e)),e.currentFillStyle=i)}updateStrokeStyle(e,t){const i=e.strokeStyle,r=e.lineCap,s=e.lineDash,o=e.lineDashOffset,a=e.lineJoin,c=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||s!=e.currentLineDash&&!Gi(e.currentLineDash,s)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=c||e.currentMiterLimit!=l)&&(i!==void 0&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=s,e.currentLineDashOffset=o,e.currentLineJoin=a,e.currentLineWidth=c,e.currentMiterLimit=l)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const t=[_e.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=cp(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;Nn(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}var Ta=L2;class A2 extends Ta{constructor(e,t,i,r){super(e,t,i,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t){if(!this.image_)return;this.beginGeometry(e,t);const i=e.getFlatCoordinates(),r=e.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([_e.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([_e.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t){if(!this.image_)return;this.beginGeometry(e,t);const i=e.getFlatCoordinates(),r=e.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([_e.DRAW_IMAGE,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([_e.DRAW_IMAGE,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(t)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,t){const i=e.getAnchor(),r=e.getSize(),s=e.getHitDetectionImage(),o=e.getImage(this.pixelRatio),a=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=s,this.image_=o,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=t}}var nv=A2;class P2 extends Ta{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinates_(e,t,i,r){const s=this.coordinates.length,o=this.appendFlatLineCoordinates(e,t,i,r,!1,!1),a=[_e.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i}drawLineString(e,t){const i=this.state,r=i.strokeStyle,s=i.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([_e.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ua,ha],us);const o=e.getFlatCoordinates(),a=e.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(gr),this.endGeometry(t)}drawMultiLineString(e,t){const i=this.state,r=i.strokeStyle,s=i.lineWidth;if(r===void 0||s===void 0)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([_e.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],us);const o=e.getEnds(),a=e.getFlatCoordinates(),c=e.getStride();let l=0;for(let u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(a,l,o[u],c);this.hitDetectionInstructions.push(gr),this.endGeometry(t)}finish(){const e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(gr),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(gr),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(us)}}var iv=P2;class O2 extends Ta{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinatess_(e,t,i,r){const s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,c=i.length;this.instructions.push(us),this.hitDetectionInstructions.push(us);for(let l=0;l<c;++l){const u=i[l],h=this.coordinates.length,d=this.appendFlatLineCoordinates(e,t,u,r,!0,!a),f=[_e.MOVE_TO_LINE_TO,h,d];this.instructions.push(f),this.hitDetectionInstructions.push(f),a&&(this.instructions.push(Fg),this.hitDetectionInstructions.push(Fg)),t=u}return o&&(this.instructions.push(lc),this.hitDetectionInstructions.push(lc)),a&&(this.instructions.push(gr),this.hitDetectionInstructions.push(gr)),t}drawCircle(e,t){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([_e.SET_FILL_STYLE,Bi]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([_e.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const o=e.getFlatCoordinates(),a=e.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);const l=[_e.CIRCLE,c];this.instructions.push(us,l),this.hitDetectionInstructions.push(us,l),i.fillStyle!==void 0&&(this.instructions.push(lc),this.hitDetectionInstructions.push(lc)),i.strokeStyle!==void 0&&(this.instructions.push(gr),this.hitDetectionInstructions.push(gr)),this.endGeometry(t)}drawPolygon(e,t){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([_e.SET_FILL_STYLE,Bi]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([_e.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const o=e.getEnds(),a=e.getOrientedFlatCoordinates(),c=e.getStride();this.drawFlatCoordinatess_(a,0,o,c),this.endGeometry(t)}drawMultiPolygon(e,t){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(r===void 0&&s===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),i.fillStyle!==void 0&&this.hitDetectionInstructions.push([_e.SET_FILL_STYLE,Bi]),i.strokeStyle!==void 0&&this.hitDetectionInstructions.push([_e.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const o=e.getEndss(),a=e.getOrientedFlatCoordinates(),c=e.getStride();let l=0;for(let u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(a,l,o[u],c);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const e=this.tolerance;if(e!==0){const t=this.coordinates;for(let i=0,r=t.length;i<r;++i)t[i]=is(t[i],e)}return super.finish()}setFillStrokeStyles_(){const e=this.state;e.fillStyle!==void 0&&this.updateFillStyle(e,this.createFill),e.strokeStyle!==void 0&&this.updateStrokeStyle(e,this.applyStroke)}}var kg=O2,$g={POINT:"point",LINE:"line"};function rv(n,e,t,i,r){let s=t,o=t,a=0,c=0,l=t,u,h,d,f,p,m,g,y,_,v;for(h=t;h<i;h+=r){const x=e[h],w=e[h+1];p!==void 0&&(_=x-p,v=w-m,f=Math.sqrt(_*_+v*v),g!==void 0&&(c+=d,u=Math.acos((g*_+y*v)/(d*f)),u>n&&(c>a&&(a=c,s=l,o=h),c=0,l=h-r)),d=f,g=_,y=v),p=x,m=w}return c+=f,c>a?[l,h]:[s,o]}const cc={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class M2 extends Ta{constructor(e,t,i,r){super(e,t,i,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t){const i=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(this.text_===""||!s||!i&&!r)return;const o=this.coordinates;let a=o.length;const c=e.getType();let l=null,u=e.getStride();if(s.placement===$g.LINE&&(c==R.LINE_STRING||c==R.MULTI_LINE_STRING||c==R.POLYGON||c==R.MULTI_POLYGON)){if(!at(this.getBufferedMaxExtent(),e.getExtent()))return;let h;if(l=e.getFlatCoordinates(),c==R.LINE_STRING)h=[l.length];else if(c==R.MULTI_LINE_STRING)h=e.getEnds();else if(c==R.POLYGON)h=e.getEnds().slice(0,1);else if(c==R.MULTI_POLYGON){const m=e.getEndss();h=[];for(let g=0,y=m.length;g<y;++g)h.push(m[g][0])}this.beginGeometry(e,t);const d=s.textAlign;let f=0,p;for(let m=0,g=h.length;m<g;++m){if(d==null){const _=rv(s.maxAngle,l,f,h[m],u);f=_[0],p=_[1]}else p=h[m];for(let _=f;_<p;_+=u)o.push(l[_],l[_+1]);const y=o.length;f=h[m],this.drawChars_(a,y),a=y}this.endGeometry(t)}else{let h=s.overflow?null:[];switch(c){case R.POINT:case R.MULTI_POINT:l=e.getFlatCoordinates();break;case R.LINE_STRING:l=e.getFlatMidpoint();break;case R.CIRCLE:l=e.getCenter();break;case R.MULTI_LINE_STRING:l=e.getFlatMidpoints(),u=2;break;case R.POLYGON:l=e.getFlatInteriorPoint(),s.overflow||h.push(l[2]/this.resolution),u=3;break;case R.MULTI_POLYGON:const g=e.getFlatInteriorPoints();l=[];for(let y=0,_=g.length;y<_;y+=3)s.overflow||h.push(g[y+2]/this.resolution),l.push(g[y],g[y+1]);if(l.length===0)return;u=2;break}const d=this.appendFlatPointCoordinates(l,u);if(d===a)return;if(h&&(d-a)/2!==l.length/u){let g=a/2;h=h.filter((y,_)=>{const v=o[(g+_)*2]===l[_*u]&&o[(g+_)*2+1]===l[_*u+1];return v||--g,v})}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,t);let f=s.padding;if(f!=os&&(s.scale[0]<0||s.scale[1]<0)){let g=s.padding[0],y=s.padding[1],_=s.padding[2],v=s.padding[3];s.scale[0]<0&&(y=-y,v=-v),s.scale[1]<0&&(g=-g,_=-_),f=[g,y,_,v]}const p=this.pixelRatio;this.instructions.push([_e.DRAW_IMAGE,a,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,f==os?os:f.map(function(g){return g*p}),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);const m=1/p;this.hitDetectionInstructions.push([_e.DRAW_IMAGE,a,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterImageWithText_,f,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(t)}}saveTextStates_(){const e=this.textStrokeState_,t=this.textState_,i=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:t.font,textAlign:t.textAlign||pa,textBaseline:t.textBaseline||Kl,scale:t.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(e,t){const i=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const c=this.pixelRatio,l=cc[r.textBaseline],u=this.textOffsetY_*c,h=this.text_,d=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([_e.DRAW_CHARS,e,t,l,r.overflow,a,r.maxAngle,c,u,s,d*c,h,o,1]),this.hitDetectionInstructions.push([_e.DRAW_CHARS,e,t,l,r.overflow,a,r.maxAngle,1,u,s,d,h,o,1/c])}setTextStyle(e,t){let i,r,s;if(!e)this.text_="";else{const o=e.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=Ii(o.getColor()||Bi)):(r=null,this.textFillState_=r);const a=e.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const p=a.getLineDash(),m=a.getLineDashOffset(),g=a.getWidth(),y=a.getMiterLimit();s.lineCap=a.getLineCap()||Hl,s.lineDash=p?p.slice():ua,s.lineDashOffset=m===void 0?ha:m,s.lineJoin=a.getLineJoin()||ao,s.lineWidth=g===void 0?ga:g,s.miterLimit=y===void 0?da:y,s.strokeStyle=Ii(a.getColor()||fa)}i=this.textState_;const c=e.getFont()||tg;i1(c);const l=e.getScaleArray();i.overflow=e.getOverflow(),i.font=c,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.textBaseline=e.getTextBaseline()||Kl,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||os,i.scale=l===void 0?[1,1]:l;const u=e.getOffsetX(),h=e.getOffsetY(),d=e.getRotateWithView(),f=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=u===void 0?0:u,this.textOffsetY_=h===void 0?0:h,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:se(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=r?typeof r.fillStyle=="string"?r.fillStyle:"|"+se(r.fillStyle):""}this.declutterImageWithText_=t}}var sv=M2;const F2={Circle:kg,Default:Ta,Image:nv,LineString:iv,Polygon:kg,Text:sv};class N2{constructor(e,t,i,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}finish(){const e={};for(const t in this.buildersByZIndex_){e[t]=e[t]||{};const i=this.buildersByZIndex_[t];for(const r in i){const s=i[r].finish();e[t][r]=s}}return e}getBuilder(e,t){const i=e!==void 0?e.toString():"0";let r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);let s=r[t];if(s===void 0){const o=F2[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s}}var uc=N2;class k2 extends Du{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.declutterExecutorGroup=null}getFeatures(e){return he()}getData(e){return null}prepareFrame(e){return he()}renderFrame(e,t){return he()}loadedTileCallback(e,t,i){e[t]||(e[t]={}),e[t][i.tileCoord.toString()]=i}createLoadedTileFinder(e,t,i){return function(r,s){const o=this.loadedTileCallback.bind(this,i,r);return e.forEachLoadedTile(t,r,s,o)}.bind(this)}forEachFeatureAtCoordinate(e,t,i,r,s){}getDataAtPixel(e,t,i){return null}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){e.target.getState()===me.LOADED&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=me.LOADED&&t!=me.ERROR&&e.addEventListener(ne.CHANGE,this.boundHandleImageChange_),t==me.IDLE&&(e.load(),t=e.getState()),t==me.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e.getVisible()&&e.getSourceState()==Fe.READY&&e.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}var Dg=k2;let hc=null;function $2(){const n=document.createElement("canvas");n.width=1,n.height=1,hc=n.getContext("2d")}class D2 extends Dg{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=dt(),this.pixelTransform=dt(),this.inversePixelTransform=dt(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(e,t,i){hc||$2(),hc.clearRect(0,0,1,1);let r;try{hc.drawImage(e,t,i,1,1,0,0,1,1),r=hc.getImageData(0,0,1,1).data}catch{return null}return r}getBackground(e){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(e.viewState.resolution)),i||void 0}useContainer(e,t,i,r){const s=this.getLayer().getClassName();let o,a;if(e&&e.className===s&&e.style.opacity===""&&i===1&&(!r||e.style.backgroundColor&&Gi(so(e.style.backgroundColor),so(r)))){const c=e.firstElementChild;c instanceof HTMLCanvasElement&&(a=c.getContext("2d"))}if(a&&a.canvas.style.transform===t?(this.container=e,this.context=a,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){o=document.createElement("div"),o.className=s;let c=o.style;c.position="absolute",c.width="100%",c.height="100%",r&&(c.backgroundColor=r),a=St();const l=a.canvas;o.appendChild(l),c=l.style,c.position="absolute",c.left="0",c.transformOrigin="top left",this.container=o,this.context=a}}clipUnrotated(e,t,i){const r=si(i),s=ta(i),o=Ws(i),a=Zs(i);Je(t.coordinateToPixelTransform,r),Je(t.coordinateToPixelTransform,s),Je(t.coordinateToPixelTransform,o),Je(t.coordinateToPixelTransform,a);const c=this.inversePixelTransform;Je(c,r),Je(c,s),Je(c,o),Je(c,a),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(s[0]),Math.round(s[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.clip()}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){const s=new ca(e,this.inversePixelTransform,i,t);r.dispatchEvent(s)}}preRender(e,t){this.frameState=t,this.dispatchRenderEvent_(Tn.PRERENDER,e,t)}postRender(e,t){this.dispatchRenderEvent_(Tn.POSTRENDER,e,t)}getRenderTransform(e,t,i,r,s,o,a){const c=s/2,l=o/2,u=r/t,h=-u,d=-e[0]+a,f=-e[1];return Ht(this.tempTransform,c,l,u,h,-i,d,f)}getDataAtPixel(e,t,i){const r=Je(this.inversePixelTransform,e.slice()),s=this.context,a=this.getLayer().getExtent();if(a){const d=Je(t.pixelToCoordinateTransform,e.slice());if(!kn(a,d))return null}const c=Math.round(r[0]),l=Math.round(r[1]);let u=this.pixelContext_;if(!u){const d=document.createElement("canvas");d.width=1,d.height=1,u=d.getContext("2d"),this.pixelContext_=u}u.clearRect(0,0,1,1);let h;try{u.drawImage(s.canvas,c,l,1,1,0,0,1,1),h=u.getImageData(0,0,1,1).data}catch(d){return d.name==="SecurityError"?(this.pixelContext_=null,new Uint8Array):h}return h[3]===0?null:h}disposeInternal(){delete this.frameState,super.disposeInternal()}}var Mh=D2,Ne={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"};function ov(n,e,t,i,r,s,o,a,c,l,u,h){let d=n[e],f=n[e+1],p=0,m=0,g=0,y=0;function _(){p=d,m=f,e+=i,d=n[e],f=n[e+1],y+=g,g=Math.sqrt((d-p)*(d-p)+(f-m)*(f-m))}do _();while(e<t-i&&y+g<s);let v=g===0?0:(s-y)/g;const x=Ui(p,d,v),w=Ui(m,f,v),E=e-i,T=y,b=s+a*c(l,r,u);for(;e<t-i&&y+g<b;)_();v=g===0?0:(b-y)/g;const S=Ui(p,d,v),A=Ui(m,f,v);let I;if(h){const P=[x,w,S,A];eh(P,0,4,2,h,P,P),I=P[0]>P[2]}else I=x>S;const N=Math.PI,M=[],B=E+i===e;e=E,g=0,y=T,d=n[e],f=n[e+1];let O;if(B){_(),O=Math.atan2(f-m,d-p),I&&(O+=O>0?-N:N);const P=(S+x)/2,G=(A+w)/2;return M[0]=[P,G,(b-s)/2,O,r],M}for(let P=0,G=r.length;P<G;){_();let U=Math.atan2(f-m,d-p);if(I&&(U+=U>0?-N:N),O!==void 0){let z=U-O;if(z+=z>N?-2*N:z<-N?2*N:0,Math.abs(z)>o)return null}O=U;const D=P;let k=0;for(;P<G;++P){const z=I?G-P-1:P,X=a*c(l,r[z],u);if(e+i<t&&y+g<s+k+X/2)break;k+=X}if(P===D)continue;const $=I?r.substring(G-D,G-P):r.substring(D,P);v=g===0?0:(s+k/2-y)/g;const F=Ui(p,d,v),te=Ui(m,f,v);M.push([F,te,k/2,U,$]),s+=k}return M}const ba=Kt(),hs=[],mr=[],yr=[],ds=[];function av(n){return n[3].declutterBox}const G2=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function lv(n,e){return(e==="start"||e==="end")&&!G2.test(n)&&(e=e==="start"?"left":"right"),cc[e]}function U2(n,e,t){return t>0&&n.push(`
|
6
|
+
`,""),n.push(e,""),n}class z2{constructor(e,t,i,r){this.overlaps=i,this.pixelRatio=t,this.resolution=e,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=dt(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}createLabel(e,t,i,r){const s=e+t+i+r;if(this.labels_[s])return this.labels_[s];const o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,c=this.textStates[t],l=this.pixelRatio,u=[c.scale[0]*l,c.scale[1]*l],h=Array.isArray(e),d=lv(h?e[0]:e,c.textAlign||pa),f=r&&o.lineWidth?o.lineWidth:0,p=h?e:e.split(`
|
7
|
+
`).reduce(U2,[]),{width:m,height:g,widths:y,heights:_,lineWidths:v}=o1(c,p),x=m+f,w=[],E=(x+2)*u[0],T=(g+f)*u[1],b={width:E<0?Math.floor(E):Math.ceil(E),height:T<0?Math.floor(T):Math.ceil(T),contextInstructions:w};(u[0]!=1||u[1]!=1)&&w.push("scale",u),r&&(w.push("strokeStyle",o.strokeStyle),w.push("lineWidth",f),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(Rl?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[o.lineDash]),w.push("lineDashOffset",o.lineDashOffset))),i&&w.push("fillStyle",a.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");const S=.5-d;let A=d*x+S*f;const I=[],N=[];let M=0,B=0,O=0,P=0,G;for(let U=0,D=p.length;U<D;U+=2){const k=p[U];if(k===`
|
8
|
+
`){B+=M,M=0,A=d*x+S*f,++P;continue}const $=p[U+1]||c.font;$!==G&&(r&&I.push("font",$),i&&N.push("font",$),G=$),M=Math.max(M,_[O]);const F=[k,A+S*y[O]+d*(y[O]-v[P]),.5*(f+M)+B];A+=y[O],r&&I.push("strokeText",F),i&&N.push("fillText",F),++O}return Array.prototype.push.apply(w,I),Array.prototype.push.apply(w,N),this.labels_[s]=b,b}replayTextBackground_(e,t,i,r,s,o,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,s),e.lineTo.apply(e,t),o&&(this.alignFill_=o[2],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())}calculateImageOrLabelDimensions_(e,t,i,r,s,o,a,c,l,u,h,d,f,p,m,g){a*=d[0],c*=d[1];let y=i-a,_=r-c;const v=s+l>e?e-l:s,x=o+u>t?t-u:o,w=p[3]+v*d[0]+p[1],E=p[0]+x*d[1]+p[2],T=y-p[3],b=_-p[0];(m||h!==0)&&(hs[0]=T,ds[0]=T,hs[1]=b,mr[1]=b,mr[0]=T+w,yr[0]=mr[0],yr[1]=b+E,ds[1]=yr[1]);let S;return h!==0?(S=Ht(dt(),i,r,1,1,h,-i,-r),Je(S,hs),Je(S,mr),Je(S,yr),Je(S,ds),$n(Math.min(hs[0],mr[0],yr[0],ds[0]),Math.min(hs[1],mr[1],yr[1],ds[1]),Math.max(hs[0],mr[0],yr[0],ds[0]),Math.max(hs[1],mr[1],yr[1],ds[1]),ba)):$n(Math.min(T,T+w),Math.min(b,b+E),Math.max(T,T+w),Math.max(b,b+E),ba),f&&(y=Math.round(y),_=Math.round(_)),{drawImageX:y,drawImageY:_,drawImageW:v,drawImageH:x,originX:l,originY:u,declutterBox:{minX:ba[0],minY:ba[1],maxX:ba[2],maxY:ba[3],value:g},canvasTransform:S,scale:d}}replayImageOrLabel_(e,t,i,r,s,o,a){const c=!!(o||a),l=r.declutterBox,u=e.canvas,h=a?a[2]*r.scale[0]/2:0;return l.minX-h<=u.width/t&&l.maxX+h>=0&&l.minY-h<=u.height/t&&l.maxY+h>=0&&(c&&this.replayTextBackground_(e,hs,mr,yr,ds,o,a),a1(e,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){if(this.alignFill_){const t=Je(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;e.save(),e.translate(t[0]%i,t[1]%i),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.setLineDash&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))}drawLabelWithPointPlacement_(e,t,i,r){const s=this.textStates[t],o=this.createLabel(e,t,r,i),a=this.strokeStates[i],c=this.pixelRatio,l=lv(Array.isArray(e)?e[0]:e,s.textAlign||pa),u=cc[s.textBaseline||Kl],h=a&&a.lineWidth?a.lineWidth:0,d=o.width/c-2*s.scale[0],f=l*d+2*(.5-l)*h,p=u*o.height/c+2*(.5-u)*h;return{label:o,anchorX:f,anchorY:p}}execute_(e,t,i,r,s,o,a,c){let l;this.pixelCoordinates_&&Gi(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=fr(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),B_(this.renderedTransform_,i));let u=0;const h=r.length;let d=0,f,p,m,g,y,_,v,x,w,E,T,b,S=0,A=0,I=null,N=null;const M=this.coordinateCache_,B=this.viewRotation_,O=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,P={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:B},G=this.instructions!=r||this.overlaps?0:200;let U,D,k,$;for(;u<h;){const F=r[u];switch(F[0]){case _e.BEGIN_GEOMETRY:U=F[1],$=F[3],U.getGeometry()?a!==void 0&&!at(a,$.getExtent())?u=F[2]+1:++u:u=F[2];break;case _e.BEGIN_PATH:S>G&&(this.fill_(e),S=0),A>G&&(e.stroke(),A=0),!S&&!A&&(e.beginPath(),g=NaN,y=NaN),++u;break;case _e.CIRCLE:d=F[1];const z=l[d],X=l[d+1],K=l[d+2],le=l[d+3],ae=K-z,Y=le-X,Pe=Math.sqrt(ae*ae+Y*Y);e.moveTo(z+Pe,X),e.arc(z,X,Pe,0,2*Math.PI,!0),++u;break;case _e.CLOSE_PATH:e.closePath(),++u;break;case _e.CUSTOM:d=F[1],f=F[2];const Oe=F[3],Se=F[4],mt=F.length==6?F[5]:void 0;P.geometry=Oe,P.feature=U,u in M||(M[u]=[]);const De=M[u];mt?mt(l,d,f,2,De):(De[0]=l[d],De[1]=l[d+1],De.length=2),Se(De,P),++u;break;case _e.DRAW_IMAGE:d=F[1],f=F[2],x=F[3],p=F[4],m=F[5];let Be=F[6];const nt=F[7],Qt=F[8],en=F[9],ee=F[10];let tn=F[11];const nn=F[12];let Xt=F[13];const bt=F[14];if(!x&&F.length>=19){w=F[18],E=F[19],T=F[20],b=F[21];const Wt=this.drawLabelWithPointPlacement_(w,E,T,b);x=Wt.label,F[3]=x;const Wn=F[22];p=(Wt.anchorX-Wn)*this.pixelRatio,F[4]=p;const Pn=F[23];m=(Wt.anchorY-Pn)*this.pixelRatio,F[5]=m,Be=x.height,F[6]=Be,Xt=x.width,F[13]=Xt}let An;F.length>24&&(An=F[24]);let Zt,$i,yi;F.length>16?(Zt=F[15],$i=F[16],yi=F[17]):(Zt=os,$i=!1,yi=!1),ee&&O?tn+=B:!ee&&!O&&(tn-=B);let ar=0;for(;d<f;d+=2){if(An&&An[ar++]<Xt/this.pixelRatio)continue;const Wt=this.calculateImageOrLabelDimensions_(x.width,x.height,l[d],l[d+1],Xt,Be,p,m,Qt,en,tn,nn,s,Zt,$i||yi,U),Wn=[e,t,x,Wt,nt,$i?I:null,yi?N:null];let Pn,Hn;if(c&&bt){const rn=f-d;if(!bt[rn]){bt[rn]=Wn;continue}if(Pn=bt[rn],delete bt[rn],Hn=av(Pn),c.collides(Hn))continue}c&&c.collides(Wt.declutterBox)||(Pn&&(c&&c.insert(Hn),this.replayImageOrLabel_.apply(this,Pn)),c&&c.insert(Wt.declutterBox),this.replayImageOrLabel_.apply(this,Wn))}++u;break;case _e.DRAW_CHARS:const ti=F[1],ht=F[2],$t=F[3],Vo=F[4];b=F[5];const fn=F[6],Yo=F[7],Ns=F[8];T=F[9];const ks=F[10];w=F[11],E=F[12];const ml=[F[13],F[13]],ni=this.textStates[E],Di=ni.font,$s=[ni.scale[0]*Yo,ni.scale[1]*Yo];let ii;Di in this.widths_?ii=this.widths_[Di]:(ii={},this.widths_[Di]=ii);const Gr=Lh(l,ti,ht,2),Ds=Math.abs($s[0])*ig(Di,w,ii);if(Vo||Ds<=Gr){const Wt=this.textStates[E].textAlign,Wn=(Gr-Ds)*cc[Wt],Pn=ov(l,ti,ht,2,w,Wn,fn,Math.abs($s[0]),ig,Di,ii,O?0:this.viewRotation_);e:if(Pn){const Hn=[];let rn,Ur,zr,pn,On;if(T)for(rn=0,Ur=Pn.length;rn<Ur;++rn){On=Pn[rn],zr=On[4],pn=this.createLabel(zr,E,"",T),p=On[2]+($s[0]<0?-ks:ks),m=$t*pn.height+(.5-$t)*2*ks*$s[1]/$s[0]-Ns;const _i=this.calculateImageOrLabelDimensions_(pn.width,pn.height,On[0],On[1],pn.width,pn.height,p,m,0,0,On[3],ml,!1,os,!1,U);if(c&&c.collides(_i.declutterBox))break e;Hn.push([e,t,pn,_i,1,null,null])}if(b)for(rn=0,Ur=Pn.length;rn<Ur;++rn){On=Pn[rn],zr=On[4],pn=this.createLabel(zr,E,b,""),p=On[2],m=$t*pn.height-Ns;const _i=this.calculateImageOrLabelDimensions_(pn.width,pn.height,On[0],On[1],pn.width,pn.height,p,m,0,0,On[3],ml,!1,os,!1,U);if(c&&c.collides(_i.declutterBox))break e;Hn.push([e,t,pn,_i,1,null,null])}c&&c.load(Hn.map(av));for(let _i=0,Vf=Hn.length;_i<Vf;++_i)this.replayImageOrLabel_.apply(this,Hn[_i])}}++u;break;case _e.END_GEOMETRY:if(o!==void 0){U=F[1];const Wt=o(U,$);if(Wt)return Wt}++u;break;case _e.FILL:G?S++:this.fill_(e),++u;break;case _e.MOVE_TO_LINE_TO:for(d=F[1],f=F[2],D=l[d],k=l[d+1],_=D+.5|0,v=k+.5|0,(_!==g||v!==y)&&(e.moveTo(D,k),g=_,y=v),d+=2;d<f;d+=2)D=l[d],k=l[d+1],_=D+.5|0,v=k+.5|0,(d==f-2||_!==g||v!==y)&&(e.lineTo(D,k),g=_,y=v);++u;break;case _e.SET_FILL_STYLE:I=F,this.alignFill_=F[2],S&&(this.fill_(e),S=0,A&&(e.stroke(),A=0)),e.fillStyle=F[1],++u;break;case _e.SET_STROKE_STYLE:N=F,A&&(e.stroke(),A=0),this.setStrokeStyle_(e,F),++u;break;case _e.STROKE:G?A++:e.stroke(),++u;break;default:++u;break}}S&&this.fill_(e),A&&e.stroke()}execute(e,t,i,r,s,o){this.viewRotation_=r,this.execute_(e,t,i,this.instructions,s,void 0,void 0,o)}executeHitDetection(e,t,i,r,s){return this.viewRotation_=i,this.execute_(e,1,t,this.hitDetectionInstructions,!0,r,s)}}var cv=z2;const Gg=[Ne.POLYGON,Ne.CIRCLE,Ne.LINE_STRING,Ne.IMAGE,Ne.TEXT,Ne.DEFAULT];class B2{constructor(e,t,i,r,s,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=t,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=dt(),this.createExecutors_(s)}clip(e,t){const i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()}createExecutors_(e){for(const t in e){let i=this.executorsByZIndex_[t];i===void 0&&(i={},this.executorsByZIndex_[t]=i);const r=e[t];for(const s in r){const o=r[s];i[s]=new cv(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}}hasExecutors(e){for(const t in this.executorsByZIndex_){const i=this.executorsByZIndex_[t];for(let r=0,s=e.length;r<s;++r)if(e[r]in i)return!0}return!1}forEachFeatureAtCoordinate(e,t,i,r,s,o){r=Math.round(r);const a=r*2+1,c=Ht(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=St(a,a));const u=this.hitDetectionContext_;u.canvas.width!==a||u.canvas.height!==a?(u.canvas.width=a,u.canvas.height=a):l||u.clearRect(0,0,a,a);let h;this.renderBuffer_!==void 0&&(h=Kt(),Xs(h,e),Nn(h,t*(this.renderBuffer_+r),h));const d=uv(r);let f;function p(w,E){const T=u.getImageData(0,0,a,a).data;for(let b=0,S=d.length;b<S;b++)if(T[d[b]]>0){if(!o||f!==Ne.IMAGE&&f!==Ne.TEXT||o.indexOf(w)!==-1){const A=(d[b]-3)/4,I=r-A%a,N=r-(A/a|0),M=s(w,E,I*I+N*N);if(M)return M}u.clearRect(0,0,a,a);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(cr);let g,y,_,v,x;for(g=m.length-1;g>=0;--g){const w=m[g].toString();for(_=this.executorsByZIndex_[w],y=Gg.length-1;y>=0;--y)if(f=Gg[y],v=_[f],v!==void 0&&(x=v.executeHitDetection(u,c,i,p,h),x))return x}}getClipCoords(e){const t=this.maxExtent_;if(!t)return null;const i=t[0],r=t[1],s=t[2],o=t[3],a=[i,r,i,o,s,o,s,r];return fr(a,0,8,2,e,a),a}isEmpty(){return xi(this.executorsByZIndex_)}execute(e,t,i,r,s,o,a){const c=Object.keys(this.executorsByZIndex_).map(Number);c.sort(cr),this.maxExtent_&&(e.save(),this.clip(e,i));const l=o||Gg;let u,h,d,f,p,m;for(a&&c.reverse(),u=0,h=c.length;u<h;++u){const g=c[u].toString();for(p=this.executorsByZIndex_[g],d=0,f=l.length;d<f;++d){const y=l[d];m=p[y],m!==void 0&&m.execute(e,t,i,r,s,a)}}this.maxExtent_&&e.restore()}}const Ug={};function uv(n){if(Ug[n]!==void 0)return Ug[n];const e=n*2+1,t=n*n,i=new Array(t+1);for(let s=0;s<=n;++s)for(let o=0;o<=n;++o){const a=s*s+o*o;if(a>t)break;let c=i[a];c||(c=[],i[a]=c),c.push(((n+s)*e+(n+o))*4+3),s>0&&c.push(((n-s)*e+(n+o))*4+3),o>0&&(c.push(((n+s)*e+(n-o))*4+3),s>0&&c.push(((n-s)*e+(n-o))*4+3))}const r=[];for(let s=0,o=i.length;s<o;++s)i[s]&&r.push(...i[s]);return Ug[n]=r,r}var dc=B2;class j2 extends Ng{constructor(e,t,i,r,s,o,a){super(),this.context_=e,this.pixelRatio_=t,this.extent_=i,this.transform_=r,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=dt()}drawImages_(e,t,i,r){if(!this.image_)return;const s=fr(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,c=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=c*this.imageOpacity_);let l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(let u=0,h=s.length;u<h;u+=2){const d=s[u]-this.imageAnchorX_,f=s[u+1]-this.imageAnchorY_;if(l!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const p=d+this.imageAnchorX_,m=f+this.imageAnchorY_;Ht(a,p,m,1,1,l,-p,-m),o.setTransform.apply(o,a),o.translate(p,m),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,f,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=c)}drawText_(e,t,i,r){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const s=fr(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);t<i;t+=r){const c=s[t]+this.textOffsetX_,l=s[t+1]+this.textOffsetY_;if(a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1){const u=Ht(this.tmpLocalTransform_,c,l,1,1,a,-c,-l);o.setTransform.apply(o,u),o.translate(c,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,c,l),this.textFillState_&&o.fillText(this.text_,c,l)}}moveToLineTo_(e,t,i,r,s){const o=this.context_,a=fr(e,t,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let c=a.length;s&&(c-=2);for(let l=2;l<c;l+=2)o.lineTo(a[l],a[l+1]);return s&&o.closePath(),i}drawRings_(e,t,i,r){for(let s=0,o=i.length;s<o;++s)t=this.moveToLineTo_(e,t,i[s],r,!0);return t}drawCircle(e){if(!!at(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=Ix(e,this.transform_,this.pixelCoordinates_),i=t[2]-t[0],r=t[3]-t[1],s=Math.sqrt(i*i+r*r),o=this.context_;o.beginPath(),o.arc(t[0],t[1],s,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case R.POINT:this.drawPoint(e);break;case R.LINE_STRING:this.drawLineString(e);break;case R.POLYGON:this.drawPolygon(e);break;case R.MULTI_POINT:this.drawMultiPoint(e);break;case R.MULTI_LINE_STRING:this.drawMultiLineString(e);break;case R.MULTI_POLYGON:this.drawMultiPolygon(e);break;case R.GEOMETRY_COLLECTION:this.drawGeometryCollection(e);break;case R.CIRCLE:this.drawCircle(e);break}}drawFeature(e,t){const i=t.getGeometryFunction()(e);!i||!at(this.extent_,i.getExtent())||(this.setStyle(t),this.drawGeometry(i))}drawGeometryCollection(e){const t=e.getGeometriesArray();for(let i=0,r=t.length;i<r;++i)this.drawGeometry(t[i])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!at(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(i,0,i.length,e.getStride(),!1),t.stroke()}if(this.text_!==""){const t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getExtent();if(!!at(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,r=e.getFlatCoordinates();let s=0;const o=e.getEnds(),a=e.getStride();i.beginPath();for(let c=0,l=o.length;c<l;++c)s=this.moveToLineTo_(r,s,o[c],a,!1);i.stroke()}if(this.text_!==""){const i=e.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!at(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!at(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getOrientedFlatCoordinates();let r=0;const s=e.getEndss(),o=e.getStride();t.beginPath();for(let a=0,c=s.length;a<c;++a){const l=s[a];r=this.drawRings_(i,r,l,o)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){const t=this.context_,i=this.contextFillState_;i?i.fillStyle!=e.fillStyle&&(i.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){const t=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=e.lineCap&&(i.lineCap=e.lineCap,t.lineCap=e.lineCap),t.setLineDash&&(Gi(i.lineDash,e.lineDash)||t.setLineDash(i.lineDash=e.lineDash),i.lineDashOffset!=e.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset)),i.lineJoin!=e.lineJoin&&(i.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),i.lineWidth!=e.lineWidth&&(i.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),i.miterLimit!=e.miterLimit&&(i.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),i.strokeStyle!=e.strokeStyle&&(i.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){const t=this.context_,i=this.contextTextState_,r=e.textAlign?e.textAlign:pa;i?(i.font!=e.font&&(i.font=e.font,t.font=e.font),i.textAlign!=r&&(i.textAlign=r,t.textAlign=r),i.textBaseline!=e.textBaseline&&(i.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(!e)this.fillState_=null;else{const i=e.getColor();this.fillState_={fillStyle:Ii(i||Bi)}}if(!t)this.strokeState_=null;else{const i=t.getColor(),r=t.getLineCap(),s=t.getLineDash(),o=t.getLineDashOffset(),a=t.getLineJoin(),c=t.getWidth(),l=t.getMiterLimit(),u=s||ua;this.strokeState_={lineCap:r!==void 0?r:Hl,lineDash:this.pixelRatio_===1?u:u.map(h=>h*this.pixelRatio_),lineDashOffset:(o||ha)*this.pixelRatio_,lineJoin:a!==void 0?a:ao,lineWidth:(c!==void 0?c:ga)*this.pixelRatio_,miterLimit:l!==void 0?l:da,strokeStyle:Ii(i||fa)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}const i=e.getAnchor(),r=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[1]*this.pixelRatio_,this.imageHeight_=t[1]*this.pixelRatio_,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation(),this.imageScale_=e.getScaleArray(),this.imageWidth_=t[0]*this.pixelRatio_}setTextStyle(e){if(!e)this.text_="";else{const t=e.getFill();if(!t)this.textFillState_=null;else{const f=t.getColor();this.textFillState_={fillStyle:Ii(f||Bi)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const f=i.getColor(),p=i.getLineCap(),m=i.getLineDash(),g=i.getLineDashOffset(),y=i.getLineJoin(),_=i.getWidth(),v=i.getMiterLimit();this.textStrokeState_={lineCap:p!==void 0?p:Hl,lineDash:m||ua,lineDashOffset:g||ha,lineJoin:y!==void 0?y:ao,lineWidth:_!==void 0?_:ga,miterLimit:v!==void 0?v:da,strokeStyle:Ii(f||fa)}}const r=e.getFont(),s=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),c=e.getRotation(),l=e.getScaleArray(),u=e.getText(),h=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r!==void 0?r:tg,textAlign:h!==void 0?h:pa,textBaseline:d!==void 0?d:Kl},this.text_=u!==void 0?Array.isArray(u)?u.reduce((f,p,m)=>f+=m%2?" ":p,""):u:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=c!==void 0?c:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}}}var Fh=j2,_n={FRACTION:"fraction",PIXELS:"pixels"},Ft={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};let fc=null;class hv extends Wr{constructor(e,t,i,r,s,o){super(),this.hitDetectionImage_=null,this.image_=e||new Image,r!==null&&(this.image_.crossOrigin=r),this.canvas_={},this.color_=o,this.unlisten_=null,this.imageState_=s,this.size_=i,this.src_=t,this.tainted_}isTainted_(){if(this.tainted_===void 0&&this.imageState_===me.LOADED){fc||(fc=St(1,1)),fc.drawImage(this.image_,0,0);try{fc.getImageData(0,0,1,1),this.tainted_=!1}catch{fc=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(ne.CHANGE)}handleImageError_(){this.imageState_=me.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=me.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()}getImage(e){return this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],t=this.size_[1],i=St(e,t);i.fillRect(0,0,e,t),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_==me.IDLE){this.imageState_=me.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=dh(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==me.LOADED)return;const t=document.createElement("canvas");this.canvas_[e]=t,t.width=Math.ceil(this.image_.width*e),t.height=Math.ceil(this.image_.height*e);const i=t.getContext("2d");if(i.scale(e,e),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=Zp(this.color_),i.fillRect(0,0,t.width/e,t.height/e),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{const r=i.getImageData(0,0,t.width,t.height),s=r.data,o=this.color_[0]/255,a=this.color_[1]/255,c=this.color_[2]/255,l=this.color_[3];for(let u=0,h=s.length;u<h;u+=4)s[u]*=o,s[u+1]*=a,s[u+2]*=c,s[u+3]*=l;i.putImageData(r,0,0)}}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function dv(n,e,t,i,r,s){let o=Yl.get(e,i,s);return o||(o=new hv(n,e,t,i,r,s),Yl.set(e,i,s,o)),o}var V2=hv;class s_ extends Og{constructor(e){const t=e||{},i=t.opacity!==void 0?t.opacity:1,r=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,o=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:i,rotation:r,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:o}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:Ft.TOP_LEFT,this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:_n.FRACTION,this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:_n.FRACTION,this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const a=t.img!==void 0?t.img:null;this.imgSize_=t.imgSize;let c=t.src;ce(!(c!==void 0&&a),4),ce(!a||a&&this.imgSize_,5),(c===void 0||c.length===0)&&a&&(c=a.src||se(a)),ce(c!==void 0&&c.length>0,6);const l=t.src!==void 0?me.IDLE:me.LOADED;this.color_=t.color!==void 0?so(t.color):null,this.iconImage_=dv(a,c,this.imgSize_!==void 0?this.imgSize_:null,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:Ft.TOP_LEFT,this.origin_=null,this.size_=t.size!==void 0?t.size:null}clone(){const e=this.getScale();return new s_({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(e)?e.slice():e,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const i=this.getSize();if(this.anchorXUnits_==_n.FRACTION||this.anchorYUnits_==_n.FRACTION){if(!i)return null;e=this.anchor_.slice(),this.anchorXUnits_==_n.FRACTION&&(e[0]*=i[0]),this.anchorYUnits_==_n.FRACTION&&(e[1]*=i[1])}if(this.anchorOrigin_!=Ft.TOP_LEFT){if(!i)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==Ft.TOP_RIGHT||this.anchorOrigin_==Ft.BOTTOM_RIGHT)&&(e[0]=-e[0]+i[0]),(this.anchorOrigin_==Ft.BOTTOM_LEFT||this.anchorOrigin_==Ft.BOTTOM_RIGHT)&&(e[1]=-e[1]+i[1])}this.normalizedAnchor_=e}const t=this.getDisplacement();return[e[0]-t[0],e[1]+t[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!=Ft.TOP_LEFT){const t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),(this.offsetOrigin_==Ft.TOP_RIGHT||this.offsetOrigin_==Ft.BOTTOM_RIGHT)&&(e[0]=i[0]-t[0]-e[0]),(this.offsetOrigin_==Ft.BOTTOM_LEFT||this.offsetOrigin_==Ft.BOTTOM_RIGHT)&&(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}listenImageChange(e){this.iconImage_.addEventListener(ne.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(ne.CHANGE,e)}}var pc=s_;const Y2="#333";class o_{constructor(e){const t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=pt(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new Vn({color:Y2}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:$g.POINT,this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding}clone(){const e=this.getScale();return new o_({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRotateWithView(e){this.rotateWithView_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=pt(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}var Sa=o_;const Yn=.5;function zg(n,e,t,i,r,s,o){const a=n[0]*Yn,c=n[1]*Yn,l=St(a,c);l.imageSmoothingEnabled=!1;const u=l.canvas,h=new Fh(l,Yn,r,null,o),d=t.length,f=Math.floor((256*256*256-1)/d),p={};for(let g=1;g<=d;++g){const y=t[g-1],_=y.getStyleFunction()||i;if(!i)continue;let v=_(y,s);if(!v)continue;Array.isArray(v)||(v=[v]);const x=g*f,w="#"+("000000"+x.toString(16)).slice(-6);for(let E=0,T=v.length;E<T;++E){const b=v[E],S=b.getGeometryFunction()(y);if(!S||!at(r,S.getExtent()))continue;const A=b.clone(),I=A.getFill();I&&I.setColor(w);const N=A.getStroke();N&&(N.setColor(w),N.setLineDash(null)),A.setText(void 0);const M=b.getImage();if(M&&M.getOpacity()!==0){const P=M.getImageSize();if(!P)continue;const G=St(P[0],P[1],void 0,{alpha:!1}),U=G.canvas;G.fillStyle=w,G.fillRect(0,0,U.width,U.height),A.setImage(new pc({img:U,imgSize:P,anchor:M.getAnchor(),anchorXUnits:_n.PIXELS,anchorYUnits:_n.PIXELS,offset:M.getOrigin(),opacity:1,size:M.getSize(),scale:M.getScale(),rotation:M.getRotation(),rotateWithView:M.getRotateWithView()}))}const B=A.getZIndex()||0;let O=p[B];O||(O={},p[B]=O,O[R.POLYGON]=[],O[R.CIRCLE]=[],O[R.LINE_STRING]=[],O[R.POINT]=[]),O[S.getType().replace("Multi","")].push(S,A)}}const m=Object.keys(p).map(Number).sort(cr);for(let g=0,y=m.length;g<y;++g){const _=p[m[g]];for(const v in _){const x=_[v];for(let w=0,E=x.length;w<E;w+=2){h.setStyle(x[w+1]);for(let T=0,b=e.length;T<b;++T)h.setTransform(e[T]),h.drawGeometry(x[w])}}}return l.getImageData(0,0,u.width,u.height)}function Bg(n,e,t){const i=[];if(t){const r=Math.floor(Math.round(n[0])*Yn),s=Math.floor(Math.round(n[1])*Yn),o=(we(r,0,t.width-1)+we(s,0,t.height-1)*t.width)*4,a=t.data[o],c=t.data[o+1],u=t.data[o+2]+256*(c+256*a),h=Math.floor((256*256*256-1)/e.length);u&&u%h===0&&i.push(e[u/h-1])}return i}const X2=.5,fv={Point:Q2,LineString:K2,Polygon:tL,MultiPoint:eL,MultiLineString:q2,MultiPolygon:J2,GeometryCollection:H2,Circle:Z2};function pv(n,e){return parseInt(se(n),10)-parseInt(se(e),10)}function Nh(n,e){const t=kh(n,e);return t*t}function kh(n,e){return X2*n/e}function Z2(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const c=n.getBuilder(t.getZIndex(),Ne.CIRCLE);c.setFillStrokeStyle(s,o),c.drawCircle(e,i)}const a=t.getText();if(a&&a.getText()){const c=(r||n).getBuilder(t.getZIndex(),Ne.TEXT);c.setTextStyle(a),c.drawText(e,i)}}function gc(n,e,t,i,r,s,o){let a=!1;const c=t.getImage();if(c){let l=c.getImageState();l==me.LOADED||l==me.ERROR?c.unlistenImageChange(r):(l==me.IDLE&&c.load(),l=c.getImageState(),c.listenImageChange(r),a=!0)}return W2(n,e,t,i,s,o),a}function W2(n,e,t,i,r,s){const o=t.getGeometryFunction()(e);if(!o)return;const a=o.simplifyTransformed(i,r);t.getRenderer()?gv(n,a,t,e):fv[a.getType()](n,a,t,e,s)}function gv(n,e,t,i){if(e.getType()==R.GEOMETRY_COLLECTION){const s=e.getGeometries();for(let o=0,a=s.length;o<a;++o)gv(n,s[o],t,i);return}n.getBuilder(t.getZIndex(),Ne.DEFAULT).drawCustom(e,i,t.getRenderer(),t.getHitDetectionRenderer())}function H2(n,e,t,i,r){const s=e.getGeometriesArray();let o,a;for(o=0,a=s.length;o<a;++o)fv[s[o].getType()](n,s[o],t,i,r)}function K2(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),Ne.LINE_STRING);a.setFillStrokeStyle(null,s),a.drawLineString(e,i)}const o=t.getText();if(o&&o.getText()){const a=(r||n).getBuilder(t.getZIndex(),Ne.TEXT);a.setTextStyle(o),a.drawText(e,i)}}function q2(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),Ne.LINE_STRING);a.setFillStrokeStyle(null,s),a.drawMultiLineString(e,i)}const o=t.getText();if(o&&o.getText()){const a=(r||n).getBuilder(t.getZIndex(),Ne.TEXT);a.setTextStyle(o),a.drawText(e,i)}}function J2(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(o||s){const c=n.getBuilder(t.getZIndex(),Ne.POLYGON);c.setFillStrokeStyle(s,o),c.drawMultiPolygon(e,i)}const a=t.getText();if(a&&a.getText()){const c=(r||n).getBuilder(t.getZIndex(),Ne.TEXT);c.setTextStyle(a),c.drawText(e,i)}}function Q2(n,e,t,i,r){const s=t.getImage(),o=t.getText();let a;if(r&&(n=r,a=s&&o&&o.getText()?{}:void 0),s){if(s.getImageState()!=me.LOADED)return;const c=n.getBuilder(t.getZIndex(),Ne.IMAGE);c.setImageStyle(s,a),c.drawPoint(e,i)}if(o&&o.getText()){const c=n.getBuilder(t.getZIndex(),Ne.TEXT);c.setTextStyle(o,a),c.drawText(e,i)}}function eL(n,e,t,i,r){const s=t.getImage(),o=t.getText();let a;if(r&&(n=r,a=s&&o&&o.getText()?{}:void 0),s){if(s.getImageState()!=me.LOADED)return;const c=n.getBuilder(t.getZIndex(),Ne.IMAGE);c.setImageStyle(s,a),c.drawMultiPoint(e,i)}if(o&&o.getText()){const c=(r||n).getBuilder(t.getZIndex(),Ne.TEXT);c.setTextStyle(o,a),c.drawText(e,i)}}function tL(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const c=n.getBuilder(t.getZIndex(),Ne.POLYGON);c.setFillStrokeStyle(s,o),c.drawPolygon(e,i)}const a=t.getText();if(a&&a.getText()){const c=(r||n).getBuilder(t.getZIndex(),Ne.TEXT);c.setTextStyle(a),c.drawText(e,i)}}class nL extends Mh{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.dirty_=!1,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Kt(),this.wrappedRenderedExtent_=Kt(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0}renderWorlds(e,t,i){const r=t.extent,s=t.viewState,o=s.center,a=s.resolution,c=s.projection,l=s.rotation,u=c.getExtent(),h=this.getLayer().getSource(),d=t.pixelRatio,f=t.viewHints,p=!(f[lt.ANIMATING]||f[lt.INTERACTING]),m=this.context,g=Math.round(t.size[0]*d),y=Math.round(t.size[1]*d),_=h.getWrapX()&&c.canWrapX(),v=_?be(u):null,x=_?Math.ceil((r[2]-u[2])/v)+1:1;let w=_?Math.floor((r[0]-u[0])/v):0;do{const E=this.getRenderTransform(o,a,l,d,g,y,w*v);e.execute(m,1,E,l,p,void 0,i)}while(++w<x)}renderDeclutter(e){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,e,e.declutterTree)}renderFrame(e,t){const i=e.pixelRatio,r=e.layerStatesArray[e.layerIndex];V_(this.pixelTransform,1/i,1/i),Vs(this.inversePixelTransform,this.pixelTransform);const s=Il(this.pixelTransform);this.useContainer(t,s,r.opacity,this.getBackground(e));const o=this.context,a=o.canvas,c=this.replayGroup_,l=this.declutterExecutorGroup;if((!c||c.isEmpty())&&(!l||l.isEmpty()))return null;const u=Math.round(e.size[0]*i),h=Math.round(e.size[1]*i);a.width!=u||a.height!=h?(a.width=u,a.height=h,a.style.transform!==s&&(a.style.transform=s)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,e);const d=e.viewState,f=d.projection;let p=!1,m=!0;if(r.extent&&this.clipping){const _=Un(r.extent,f);m=at(_,e.extent),p=m&&!Gt(_,e.extent),p&&this.clipUnrotated(o,e,_)}m&&this.renderWorlds(c,e),p&&o.restore(),this.postRender(o,e);const g=eg(r.opacity),y=this.container;return g!==y.style.opacity&&(y.style.opacity=g),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(e){return new Promise(function(t){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=[this.context.canvas.width,this.context.canvas.height];Je(this.pixelTransform,i);const r=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,c=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=i[0]*Yn,d=i[1]*Yn;u.push(this.getRenderTransform(r,s,o,Yn,h,d,0).slice());const f=l.getSource(),p=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!Gt(p,c)){let m=c[0];const g=be(p);let y=0,_;for(;m<p[0];)--y,_=g*y,u.push(this.getRenderTransform(r,s,o,Yn,h,d,_).slice()),m+=g;for(y=0,m=c[2];m>p[2];)++y,_=g*y,u.push(this.getRenderTransform(r,s,o,Yn,h,d,_).slice()),m-=g}this.hitDetectionImageData_=zg(i,u,this.renderedFeatures_,l.getStyleFunction(),c,s,o)}t(Bg(e,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))}forEachFeatureAtCoordinate(e,t,i,r,s){if(!this.replayGroup_)return;const o=t.viewState.resolution,a=t.viewState.rotation,c=this.getLayer(),l={},u=function(f,p,m){const g=se(f),y=l[g];if(y){if(y!==!0&&m<y.distanceSq){if(m===0)return l[g]=!0,s.splice(s.lastIndexOf(y),1),r(f,c,p);y.geometry=p,y.distanceSq=m}}else{if(m===0)return l[g]=!0,r(f,c,p);s.push(l[g]={feature:f,layer:c,geometry:p,distanceSq:m,callback:r})}};let h;const d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some(f=>h=f.forEachFeatureAtCoordinate(e,o,a,i,u,f===this.declutterExecutorGroup&&t.declutterTree?t.declutterTree.all().map(p=>p.value):null)),h}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){const t=this.getLayer(),i=t.getSource();if(!i)return!1;const r=e.viewHints[lt.ANIMATING],s=e.viewHints[lt.INTERACTING],o=t.getUpdateWhileAnimating(),a=t.getUpdateWhileInteracting();if(!this.dirty_&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const c=e.extent,l=e.viewState,u=l.projection,h=l.resolution,d=e.pixelRatio,f=t.getRevision(),p=t.getRenderBuffer();let m=t.getRenderOrder();m===void 0&&(m=pv);const g=l.center.slice(),y=Nn(c,p*h),_=y.slice(),v=[y.slice()],x=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Gt(x,e.extent)){const O=be(x),P=Math.max(be(y)/2,O);y[0]=x[0]-P,y[2]=x[2]+P,Wu(g,u);const G=fp(v[0],u);G[0]<x[0]&&G[2]<x[2]?v.push([G[0]+O,G[1],G[2]+O,G[3]]):G[0]>x[0]&&G[2]>x[2]&&v.push([G[0]-O,G[1],G[2]-O,G[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&Gt(this.wrappedRenderedExtent_,y))return Gi(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;const w=new uc(kh(h,d),y,h,d);let E;this.getLayer().getDeclutter()&&(E=new uc(kh(h,d),y,h,d));const T=En();let b;if(T){for(let O=0,P=v.length;O<P;++O){const G=v[O],U=ns(G,u);i.loadFeatures(U,Ex(h,u),T)}b=qn(T,u)}else for(let O=0,P=v.length;O<P;++O)i.loadFeatures(v[O],h,u);const S=Nh(h,d),A=function(O){let P;const G=O.getStyleFunction()||t.getStyleFunction();if(G&&(P=G(O,h)),P){const U=this.renderFeature(O,S,P,w,b,E);this.dirty_=this.dirty_||U}}.bind(this),I=ns(y,u),N=i.getFeaturesInExtent(I);m&&N.sort(m);for(let O=0,P=N.length;O<P;++O)A(N[O]);this.renderedFeatures_=N;const M=w.finish(),B=new dc(y,h,d,i.getOverlaps(),M,t.getRenderBuffer());return E&&(this.declutterExecutorGroup=new dc(y,h,d,i.getOverlaps(),E.finish(),t.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=f,this.renderedRenderOrder_=m,this.renderedExtent_=_,this.wrappedRenderedExtent_=y,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=B,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,i,r,s,o){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let c=0,l=i.length;c<l;++c)a=gc(r,e,i[c],t,this.boundHandleStyleImageChange_,s,o)||a;else a=gc(r,e,i,t,this.boundHandleStyleImageChange_,s,o);return a}}var jg=nL;class iL extends Ea{constructor(e){super(e)}createRenderer(){return new jg(this)}}var fs=iL;class rL{constructor(e){this.rbush_=new Lg(e),this.items_={}}insert(e,t){const i={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(i),this.items_[se(t)]=i}load(e,t){const i=new Array(t.length);for(let r=0,s=t.length;r<s;r++){const o=e[r],a=t[r],c={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};i[r]=c,this.items_[se(a)]=c}this.rbush_.load(i)}remove(e){const t=se(e),i=this.items_[t];return delete this.items_[t],this.rbush_.remove(i)!==null}update(e,t){const i=this.items_[se(t)],r=[i.minX,i.minY,i.maxX,i.maxY];Kn(r,e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(t){return t.value})}getInExtent(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(r){return r.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let i;for(let r=0,s=e.length;r<s;r++)if(i=t(e[r]),i)return i;return i}isEmpty(){return xi(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const t=this.rbush_.toJSON();return $n(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const t in e.items_)this.items_[t]=e.items_[t]}}var mc=rL;class sL extends Fn{constructor(e){super(),this.projection=re(e.projection),this.attributions_=mv(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible!==void 0?e.attributionsCollapsible:!0,this.loading=!1,this.state_=e.state!==void 0?e.state:Fe.READY,this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const t=this;this.viewPromise_=new Promise(function(i,r){t.viewResolver=i,t.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(){return he()}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=mv(e),this.changed()}setState(e){this.state_=e,this.changed()}}function mv(n){return n?Array.isArray(n)?function(e){return n}:typeof n=="function"?n:function(e){return[n]}:null}var Ra=sL,Nt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function yv(n,e){return[[-1/0,-1/0,1/0,1/0]]}function oL(n,e){return[n]}function aL(n){return function(e,t,i){const r=n.getZForResolution(Tx(t,i)),s=n.getTileRangeForExtentAndZ(Un(e,i),r),o=[],a=[r,0,0];for(a[1]=s.minX;a[1]<=s.maxX;++a[1])for(a[2]=s.minY;a[2]<=s.maxY;++a[2])o.push(ns(n.getTileCoordExtent(a),i));return o}}let _v=!1;function Vg(n,e,t,i,r,s,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(t,i,r):n,!0),e.getType()==Bn.ARRAY_BUFFER&&(a.responseType="arraybuffer"),a.withCredentials=_v,a.onload=function(c){if(!a.status||a.status>=200&&a.status<300){const l=e.getType();let u;l==Bn.JSON||l==Bn.TEXT?u=a.responseText:l==Bn.XML?(u=a.responseXML,u||(u=new DOMParser().parseFromString(a.responseText,"application/xml"))):l==Bn.ARRAY_BUFFER&&(u=a.response),u?s(e.readFeatures(u,{extent:t,featureProjection:r}),e.readProjection(u)):o()}else o()},a.onerror=o,a.send()}function Yg(n,e){return function(t,i,r,s,o){const a=this;Vg(n,e,t,i,r,function(c,l){a.addFeatures(c),s!==void 0&&s(c)},o||Xr)}}function lL(n){_v=n}class _r extends Mt{constructor(e,t,i){super(e),this.feature=t,this.features=i}}class cL extends Ra{constructor(e){const t=e||{};super({attributions:t.attributions,interpolate:!0,projection:void 0,state:Fe.READY,wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Xr,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(ce(this.format_,7),this.loader_=Yg(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:yv;const i=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=i?new mc:null,this.loadedExtentsRtree_=new mc,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let r,s;Array.isArray(t.features)?s=t.features:t.features&&(r=t.features,s=r.getArray()),!i&&r===void 0&&(r=new At(s)),s!==void 0&&this.addFeaturesInternal(s),r!==void 0&&this.bindFeaturesCollection_(r)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const t=se(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);const i=e.getGeometry();if(i){const r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new _r(Nt.ADDFEATURE,e))}setupChangeEvents_(e,t){this.featureChangeKeys_[e]=[pe(t,ne.CHANGE,this.handleFeatureChange_,this),pe(t,Vr.PROPERTYCHANGE,this.handleFeatureChange_,this)]}addToIndex_(e,t){let i=!0;const r=t.getId();return r!==void 0&&(r.toString()in this.idIndex_?i=!1:this.idIndex_[r.toString()]=t),i&&(ce(!(e in this.uidIndex_),30),this.uidIndex_[e]=t),i}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const t=[],i=[],r=[];for(let s=0,o=e.length;s<o;s++){const a=e[s],c=se(a);this.addToIndex_(c,a)&&i.push(a)}for(let s=0,o=i.length;s<o;s++){const a=i[s],c=se(a);this.setupChangeEvents_(c,a);const l=a.getGeometry();if(l){const u=l.getExtent();t.push(u),r.push(a)}else this.nullGeometryFeatures_[c]=a}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(Nt.ADDFEATURE))for(let s=0,o=i.length;s<o;s++)this.dispatchEvent(new _r(Nt.ADDFEATURE,i[s]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(Nt.ADDFEATURE,function(i){t||(t=!0,e.push(i.feature),t=!1)}),this.addEventListener(Nt.REMOVEFEATURE,function(i){t||(t=!0,e.remove(i.feature),t=!1)}),e.addEventListener(wt.ADD,function(i){t||(t=!0,this.addFeature(i.element),t=!1)}.bind(this)),e.addEventListener(wt.REMOVE,function(i){t||(t=!0,this.removeFeature(i.element),t=!1)}.bind(this)),this.featuresCollection_=e}clear(e){if(e){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(je);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const i=function(r){this.removeFeatureInternal(r)}.bind(this);this.featuresRtree_.forEach(i);for(const r in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const t=new _r(Nt.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(r){if(r.getGeometry().intersectsCoordinate(e))return t(r)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(i){if(i.getGeometry().intersectsExtent(e)){const s=t(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),xi(this.nullGeometryFeatures_)||Xe(e,Nu(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const t=[];return this.forEachFeatureAtCoordinateDirect(e,function(i){t.push(i)}),t}getFeaturesInExtent(e){return this.featuresRtree_?this.featuresRtree_.getInExtent(e):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){const i=e[0],r=e[1];let s=null;const o=[NaN,NaN];let a=1/0;const c=[-1/0,-1/0,1/0,1/0],l=t||Mn;return this.featuresRtree_.forEachInExtent(c,function(u){if(l(u)){const h=u.getGeometry(),d=a;if(a=h.closestPointXY(i,r,o,a),a<d){s=u;const f=Math.sqrt(a);c[0]=i-f,c[1]=r-f,c[2]=i+f,c[3]=r+f}}}),s}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){const t=this.idIndex_[e.toString()];return t!==void 0?t:null}getFeatureByUid(e){const t=this.uidIndex_[e];return t!==void 0?t:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const t=e.target,i=se(t),r=t.getGeometry();if(!r)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[i]=t);else{const o=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,t)):this.featuresRtree_&&this.featuresRtree_.update(o,t)}const s=t.getId();if(s!==void 0){const o=s.toString();this.idIndex_[o]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[o]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[i]=t;this.changed(),this.dispatchEvent(new _r(Nt.CHANGEFEATURE,t))}hasFeature(e){const t=e.getId();return t!==void 0?t in this.idIndex_:se(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&xi(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,t,i){const r=this.loadedExtentsRtree_,s=this.strategy_(e,t,i);for(let o=0,a=s.length;o<a;++o){const c=s[o];r.forEachInExtent(c,function(u){return Gt(u.extent,c)})||(++this.loadingExtentsCount_,this.dispatchEvent(new _r(Nt.FEATURESLOADSTART)),this.loader_.call(this,c,t,i,function(u){--this.loadingExtentsCount_,this.dispatchEvent(new _r(Nt.FEATURESLOADEND,void 0,u))}.bind(this),function(){--this.loadingExtentsCount_,this.dispatchEvent(new _r(Nt.FEATURESLOADERROR))}.bind(this)),r.insert(c,{extent:c.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const t=this.loadedExtentsRtree_;let i;t.forEachInExtent(e,function(r){if(Kn(r.extent,e))return i=r,!0}),i&&t.remove(i)}removeFeature(e){if(!e)return;const t=se(e);t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const t=se(e),i=this.featureChangeKeys_[t];if(!i)return;i.forEach(je),delete this.featureChangeKeys_[t];const r=e.getId();return r!==void 0&&delete this.idIndex_[r.toString()],delete this.uidIndex_[t],this.dispatchEvent(new _r(Nt.REMOVEFEATURE,e)),e}removeFromIdIndex_(e){let t=!1;for(const i in this.idIndex_)if(this.idIndex_[i]===e){delete this.idIndex_[i],t=!0;break}return t}setLoader(e){this.loader_=e}setUrl(e){ce(this.format_,7),this.url_=e,this.setLoader(Yg(e,this.format_))}}var ho=cL;const Ze={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",CIRCLE:"Circle"},$h={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class yc extends Mt{constructor(e,t){super(e),this.feature=t}}class uL extends li{constructor(e){const t=e;t.stopDown||(t.stopDown=Yr),super(t),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=pL(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_===Ze.POLYGON?3:2,this.maxPoints_=this.mode_===Ze.CIRCLE?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:Mn;let i=e.geometryFunction;if(!i){const r=this.mode_;if(r===Ze.CIRCLE)i=function(s,o,a){const c=o||new Ig([NaN,NaN]),l=rt(s[0],a),u=Dn(l,rt(s[s.length-1],a));c.setCenterAndRadius(l,Math.sqrt(u));const h=En();return h&&c.transform(a,h),c};else{let s;r===Ze.POINT?s=ft:r===Ze.LINE_STRING?s=Tt:r===Ze.POLYGON&&(s=Bt),i=function(o,a,c){return a?r===Ze.POLYGON?o[0].length?a.setCoordinates([o[0].concat([o[0][0]])]):a.setCoordinates([]):a.setCoordinates(o):a=new s(o),a}}}this.geometryFunction_=i,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new fs({source:new ho({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:hL(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:bh,this.freehandCondition_,e.freehand?this.freehandCondition_=_a:this.freehandCondition_=e.freehandCondition?e.freehandCondition:nc,this.addChangeListener(tc.ACTIVE,this.updateState_)}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===ne.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Ze.POINT&&this.freehandCondition_(e);let t=e.type===Re.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===Re.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===Re.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===Re.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===Re.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===Re.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===Re.DBLCLICK&&(i=!1),super.handleEvent(e)&&i}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Si(Re.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0)if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e),this.shouldHandle_){const i=!this.finishCoordinate_;i&&this.startDrawing_(e.coordinate),!i&&this.freehand_?this.finishDrawing():!this.freehand_&&(!i||this.mode_===Ze.POINT)&&(this.atFinish_(e.pixel)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing();return!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const t=this.downPx_,i=e.pixel,r=t[0]-i[0],s=t[1]-i[1],o=r*r+s*s;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(e.coordinate):this.createOrUpdateSketchPoint_(e.coordinate.slice())}atFinish_(e){let t=!1;if(this.sketchFeature_){let i=!1,r=[this.finishCoordinate_];const s=this.mode_;if(s===Ze.POINT)t=!0;else if(s===Ze.CIRCLE)t=this.sketchCoords_.length===2;else if(s===Ze.LINE_STRING)i=this.sketchCoords_.length>this.minPoints_;else if(s===Ze.POLYGON){const o=this.sketchCoords_;i=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(i){const o=this.getMap();for(let a=0,c=r.length;a<c;a++){const l=r[a],u=o.getPixelFromCoordinate(l),h=e[0]-u[0],d=e[1]-u[1],f=this.freehand_?1:this.snapTolerance_;if(t=Math.sqrt(h*h+d*d)<=f,t){this.finishCoordinate_=l;break}}}}return t}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new it(new ft(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new it);const t=e.getLinearRing(0);let i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),i.changed()):(i=new Tt(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(i))}startDrawing_(e){const t=this.getMap().getView().getProjection();this.finishCoordinate_=e,this.mode_===Ze.POINT?this.sketchCoords_=e.slice():this.mode_===Ze.POLYGON?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new it(new Tt(this.sketchLineCoords_)));const i=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new it,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new yc($h.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const t=this.getMap(),i=this.sketchFeature_.getGeometry(),r=t.getView().getProjection();let s,o;this.mode_===Ze.POINT?o=this.sketchCoords_:this.mode_===Ze.POLYGON?(s=this.sketchCoords_[0],o=s[s.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(s=this.sketchCoords_,o=s[s.length-1]),o[0]=e[0],o[1]=e[1],this.geometryFunction_(this.sketchCoords_,i,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),i.getType()===R.POLYGON&&this.mode_!==Ze.POLYGON?this.createOrUpdateCustomSketchLine_(i):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();let r,s;const o=this.mode_;o===Ze.LINE_STRING||o===Ze.CIRCLE?(this.finishCoordinate_=e.slice(),s=this.sketchCoords_,s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),this.geometryFunction_(s,t,i)):o===Ze.POLYGON&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),r&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,t,i)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r&&this.finishDrawing()}removeLastPoint(){if(!this.sketchFeature_)return;const e=this.sketchFeature_.getGeometry(),t=this.getMap().getView().getProjection();let i;const r=this.mode_;if(r===Ze.LINE_STRING||r===Ze.CIRCLE){if(i=this.sketchCoords_,i.splice(-2,1),i.length>=2){this.finishCoordinate_=i[i.length-2].slice();const s=this.finishCoordinate_.slice();i[i.length-1]=s,this.createOrUpdateSketchPoint_(s)}this.geometryFunction_(i,e,t),e.getType()===R.POLYGON&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===Ze.POLYGON){i=this.sketchCoords_[0],i.splice(-2,1);const s=this.sketchLine_.getGeometry();if(i.length>=2){const o=i[i.length-2].slice();i[i.length-1]=o,this.createOrUpdateSketchPoint_(o)}s.setCoordinates(i),this.geometryFunction_(this.sketchCoords_,e,t)}i.length===1&&this.abortDrawing(),this.updateSketchFeatures_()}finishDrawing(){const e=this.abortDrawing_();if(!e)return;let t=this.sketchCoords_;const i=e.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===Ze.LINE_STRING?(t.pop(),this.geometryFunction_(t,i,r)):this.mode_===Ze.POLYGON&&(t[0].pop(),this.geometryFunction_(t,i,r),t=i.getCoordinates()),this.type_===R.MULTI_POINT?e.setGeometry(new ci([t])):this.type_===R.MULTI_LINE_STRING?e.setGeometry(new jn([t])):this.type_===R.MULTI_POLYGON&&e.setGeometry(new ui([t])),this.dispatchEvent(new yc($h.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e)}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new yc($h.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(e[0]);let r;if(t===Ze.LINE_STRING||t===Ze.CIRCLE)r=this.sketchCoords_;else if(t===Ze.POLYGON)r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&r.shift(),r.pop();for(let o=0;o<e.length;o++)this.addToDrawing_(e[o]);const s=e[e.length-1];this.addToDrawing_(s),this.modifyDrawing_(s)}extend(e){const i=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=i.getCoordinates();const r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new it(new ft(r)),this.updateSketchFeatures_(),this.dispatchEvent(new yc($h.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){const e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}}function hL(){const n=wa();return function(e,t){return n[e.getGeometry().getType()]}}function dL(n,e){return function(t,i,r){const s=rt(t[0],r),o=rt(t[t.length-1],r),a=Math.sqrt(Dn(s,o)),c=i||zl(new Ig(s),n);let l=e;if(!e&&e!==0){const h=o[0]-s[0],d=o[1]-s[1];l=Math.atan2(d,h)}Vp(c,s,a,l);const u=En();return u&&c.transform(r,u),c}}function fL(){return function(n,e,t){const i=yt([n[0],n[n.length-1]].map(function(a){return rt(a,t)})),r=[[Zs(i),Ws(i),ta(i),si(i),Zs(i)]];let s=e;s?s.setCoordinates(r):s=new Bt(r);const o=En();return o&&s.transform(t,o),s}}function pL(n){switch(n){case R.POINT:case R.MULTI_POINT:return Ze.POINT;case R.LINE_STRING:case R.MULTI_LINE_STRING:return Ze.LINE_STRING;case R.POLYGON:case R.MULTI_POLYGON:return Ze.POLYGON;case R.CIRCLE:return Ze.CIRCLE;default:throw new Error("Invalid type: "+n)}}var gL=uL;const mL={EXTENTCHANGED:"extentchanged"};class xv extends Mt{constructor(e){super(mL.EXTENTCHANGED),this.extent=e}}class yL extends li{constructor(e){const t=e||{};super(t),this.on,this.once,this.un,this.condition_=t.condition?t.condition:_a,this.extent_=null,this.pointerHandler_=null,this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.snappedToVertex_=!1,this.extentFeature_=null,this.vertexFeature_=null,e||(e={}),this.extentOverlay_=new fs({source:new ho({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:_L(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.vertexOverlay_=new fs({source:new ho({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:xL(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&this.setExtent(e.extent)}snapToVertex_(e,t){const i=t.getCoordinateFromPixelInternal(e),r=function(o,a){return Fl(i,o)-Fl(i,a)},s=this.getExtentInternal();if(s){const o=vL(s);o.sort(r);const a=o[0];let c=Pl(i,a);const l=t.getPixelFromCoordinateInternal(c);if(Ml(e,l)<=this.pixelTolerance_){const u=t.getPixelFromCoordinateInternal(a[0]),h=t.getPixelFromCoordinateInternal(a[1]),d=Dn(l,u),f=Dn(l,h),p=Math.sqrt(Math.min(d,f));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(c=d>f?a[1]:a[0]),c}}return null}handlePointerMove_(e){const t=e.pixel,i=e.map;let r=this.snapToVertex_(t,i);r||(r=i.getCoordinateFromPixelInternal(t)),this.createOrUpdatePointerFeature_(r)}createOrUpdateExtentFeature_(e){let t=this.extentFeature_;return t?e?t.setGeometry(no(e)):t.setGeometry(void 0):(e?t=new it(no(e)):t=new it({}),this.extentFeature_=t,this.extentOverlay_.getSource().addFeature(t)),t}createOrUpdatePointerFeature_(e){let t=this.vertexFeature_;return t?t.getGeometry().setCoordinates(e):(t=new it(new ft(e)),this.vertexFeature_=t,this.vertexOverlay_.getSource().addFeature(t)),t}handleEvent(e){return!e.originalEvent||!this.condition_(e)?!0:(e.type==Re.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),super.handleEvent(e),!1)}handleDownEvent(e){const t=e.pixel,i=e.map,r=this.getExtentInternal();let s=this.snapToVertex_(t,i);const o=function(a){let c=null,l=null;return a[0]==r[0]?c=r[2]:a[0]==r[2]&&(c=r[0]),a[1]==r[1]?l=r[3]:a[1]==r[3]&&(l=r[1]),c!==null&&l!==null?[c,l]:null};if(s&&r){const a=s[0]==r[0]||s[0]==r[2]?s[0]:null,c=s[1]==r[1]||s[1]==r[3]?s[1]:null;a!==null&&c!==null?this.pointerHandler_=vv(o(s)):a!==null?this.pointerHandler_=wv(o([a,r[1]]),o([a,r[3]])):c!==null&&(this.pointerHandler_=wv(o([r[0],c]),o([r[2],c])))}else s=i.getCoordinateFromPixelInternal(t),this.setExtent([s[0],s[1],s[0],s[1]]),this.pointerHandler_=vv(s);return!0}handleDragEvent(e){if(this.pointerHandler_){const t=e.coordinate;this.setExtent(this.pointerHandler_(t)),this.createOrUpdatePointerFeature_(t)}}handleUpEvent(e){this.pointerHandler_=null;const t=this.getExtentInternal();return(!t||ea(t)===0)&&this.setExtent(null),!1}setMap(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),super.setMap(e)}getExtent(){return ns(this.getExtentInternal(),this.getMap().getView().getProjection())}getExtentInternal(){return this.extent_}setExtent(e){this.extent_=e||null,this.createOrUpdateExtentFeature_(e),this.dispatchEvent(new xv(this.extent_))}}function _L(){const n=wa();return function(e,t){return n[R.POLYGON]}}function xL(){const n=wa();return function(e,t){return n[R.POINT]}}function vv(n){return function(e){return yt([n,e])}}function wv(n,e){return n[0]==e[0]?function(t){return yt([n,[t[0],e[1]]])}:n[1]==e[1]?function(t){return yt([n,[e[0],t[1]]])}:null}function vL(n){return[[[n[0],n[1]],[n[0],n[3]]],[[n[0],n[3]],[n[2],n[3]]],[[n[2],n[3]],[n[2],n[1]]],[[n[2],n[1]],[n[0],n[1]]]]}var wL=yL;const Ev=0,_c=1,Tv=[0,0,0,0],Ia=[],Xg={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};class Dh extends Mt{constructor(e,t,i){super(e),this.features=t,this.mapBrowserEvent=i}}class EL extends li{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:Rg,this.defaultDeleteCondition_=function(i){return F1(i)&&bg(i)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:_a,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new mc,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new fs({source:new ho({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:bL(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new At(this.source_.getFeatures()),this.source_.addEventListener(Nt.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Nt.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(wt.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(wt.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}addFeature_(e){const t=e.getGeometry();if(t){const r=this.SEGMENT_WRITERS_[t.getType()];r&&r(e,t)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),e.addEventListener(ne.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new At;const i=this.featuresBeingModified_.getArray();for(let r=0,s=t.length;r<s;++r){const o=t[r];for(let a=0,c=o.length;a<c;++a){const l=o[a].feature;l&&i.indexOf(l)===-1&&this.featuresBeingModified_.push(l)}}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new Dh(Xg.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(ne.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(e){const t=this.rBush_,i=[];t.forEach(function(r){e===r.feature&&i.push(r)});for(let r=i.length-1;r>=0;--r){const s=i[r];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===s&&this.dragSegments_.splice(o,1);t.remove(s)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){const t=e.element;this.removeFeature_(t)}writePointGeometry_(e,t){const i=t.getCoordinates(),r={feature:e,geometry:t,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length-1;r<s;++r){const o=i.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:o};this.rBush_.insert(yt(o),a)}}writeMultiLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,c=o.length-1;a<c;++a){const l=o.slice(a,a+2),u={feature:e,geometry:t,depth:[r],index:a,segment:l};this.rBush_.insert(yt(l),u)}}}writePolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,c=o.length-1;a<c;++a){const l=o.slice(a,a+2),u={feature:e,geometry:t,depth:[r],index:a,segment:l};this.rBush_.insert(yt(l),u)}}}writeMultiPolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,c=o.length;a<c;++a){const l=o[a];for(let u=0,h=l.length-1;u<h;++u){const d=l.slice(u,u+2),f={feature:e,geometry:t,depth:[a,r],index:u,segment:d};this.rBush_.insert(yt(d),f)}}}}writeCircleGeometry_(e,t){const i=t.getCenter(),r={feature:e,geometry:t,index:Ev,segment:[i,i]},s={feature:e,geometry:t,index:_c,segment:[i,i]},o=[r,s];r.featureSegments=o,s.featureSegments=o,this.rBush_.insert(Ys(i),r);let a=t;const c=En();if(c&&this.getMap()){const l=this.getMap().getView().getProjection();a=a.clone().transform(c,l),a=zl(a).transform(l,c)}this.rBush_.insert(a.getExtent(),s)}writeGeometryCollectionGeometry_(e,t){const i=t.getGeometriesArray();for(let r=0;r<i.length;++r){const s=i[r];this.SEGMENT_WRITERS_[s.getType()](e,s)}}createOrUpdateVertexFeature_(e,t,i){let r=this.vertexFeature_;return r?r.getGeometry().setCoordinates(e):(r=new it(new ft(e)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r)),r.set("features",t),r.set("geometries",i),r}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==Re.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(e.type!=Re.SINGLECLICK||!this.ignoreNextSingleClick_?t=this.removePoint():t=!0),e.type==Re.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_);const t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],i=[],r=[];for(let s=0,o=this.dragSegments_.length;s<o;++s){const a=this.dragSegments_[s],c=a[0],l=c.feature;i.indexOf(l)===-1&&i.push(l);const u=c.geometry;r.indexOf(u)===-1&&r.push(u);const h=c.depth;let d;const f=c.segment,p=a[1];for(;t.length<u.getStride();)t.push(f[p][t.length]);switch(u.getType()){case R.POINT:d=t,f[0]=t,f[1]=t;break;case R.MULTI_POINT:d=u.getCoordinates(),d[c.index]=t,f[0]=t,f[1]=t;break;case R.LINE_STRING:d=u.getCoordinates(),d[c.index+p]=t,f[p]=t;break;case R.MULTI_LINE_STRING:d=u.getCoordinates(),d[h[0]][c.index+p]=t,f[p]=t;break;case R.POLYGON:d=u.getCoordinates(),d[h[0]][c.index+p]=t,f[p]=t;break;case R.MULTI_POLYGON:d=u.getCoordinates(),d[h[1]][h[0]][c.index+p]=t,f[p]=t;break;case R.CIRCLE:if(f[0]=t,f[1]=t,c.index===Ev)this.changingFeature_=!0,u.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0;const m=e.map.getView().getProjection();let g=Ml(rt(u.getCenter(),m),rt(t,m));const y=En();if(y){const _=u.clone().transform(y,m);_.setRadius(g),g=_.transform(m,y).getRadius()}u.setRadius(g),this.changingFeature_=!1}break}d&&this.setGeometryCoordinates_(u,d)}this.createOrUpdateVertexFeature_(t,i,r)}handleDownEvent(e){if(!this.condition_(e))return!1;const t=e.coordinate;this.handlePointerAtPixel_(e.pixel,e.map,t),this.dragSegments_.length=0,this.featuresBeingModified_=null;const i=this.vertexFeature_;if(i){const r=e.map.getView().getProjection(),s=[],o=i.getGeometry().getCoordinates(),a=yt([o]),c=this.rBush_.getInExtent(a),l={};c.sort(TL);for(let u=0,h=c.length;u<h;++u){const d=c[u],f=d.segment;let p=se(d.geometry);const m=d.depth;if(m&&(p+="-"+m.join("-")),l[p]||(l[p]=new Array(2)),d.geometry.getType()===R.CIRCLE&&d.index===_c){const g=Sv(t,d,r);ai(g,o)&&!l[p][0]&&(this.dragSegments_.push([d,0]),l[p][0]=d);continue}if(ai(f[0],o)&&!l[p][0]){this.dragSegments_.push([d,0]),l[p][0]=d;continue}if(ai(f[1],o)&&!l[p][1]){if((d.geometry.getType()===R.LINE_STRING||d.geometry.getType()===R.MULTI_LINE_STRING)&&l[p][0]&&l[p][0].index===0)continue;this.dragSegments_.push([d,1]),l[p][1]=d;continue}se(f)in this.vertexSegments_&&!l[p][0]&&!l[p][1]&&this.insertVertexCondition_(e)&&s.push(d)}s.length&&this.willModifyFeatures_(e,[s]);for(let u=s.length-1;u>=0;--u)this.insertVertex_(s[u],o)}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const i=this.dragSegments_[t][0],r=i.geometry;if(r.getType()===R.CIRCLE){const s=r.getCenter(),o=i.featureSegments[0],a=i.featureSegments[1];o.segment[0]=s,o.segment[1]=s,a.segment[0]=s,a.segment[1]=s,this.rBush_.update(Ys(s),o);let c=r;const l=En();if(l){const u=e.map.getView().getProjection();c=c.clone().transform(l,u),c=zl(c).transform(u,l)}this.rBush_.update(c.getExtent(),a)}else this.rBush_.update(yt(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Dh(Xg.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.pixel,e.map,e.coordinate)}handlePointerAtPixel_(e,t,i){const r=i||t.getCoordinateFromPixel(e),s=t.getView().getProjection(),o=function(l,u){return bv(r,l,s)-bv(r,u,s)};let a,c;if(this.hitDetection_){const l=typeof this.hitDetection_=="object"?u=>u===this.hitDetection_:void 0;t.forEachFeatureAtPixel(e,(u,h,d)=>{if(d=d||u.getGeometry(),d.getType()===R.POINT&&Ge(this.features_.getArray(),u)){c=d;const f=d.getFlatCoordinates().slice(0,2);a=[{feature:u,geometry:d,segment:[f,f]}]}return!0},{layerFilter:l})}if(!a){const l=Un(Ys(r,Tv),s),u=t.getView().getResolution()*this.pixelTolerance_,h=ns(Nn(l,u,Tv),s);a=this.rBush_.getInExtent(h)}if(a&&a.length>0){const l=a.sort(o)[0],u=l.segment;let h=Sv(r,l,s);const d=t.getPixelFromCoordinate(h);let f=Ml(e,d);if(c||f<=this.pixelTolerance_){const p={};if(p[se(u)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-r[0],this.delta_[1]=h[1]-r[1]),l.geometry.getType()===R.CIRCLE&&l.index===_c)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[l.feature],[l.geometry]);else{const m=t.getPixelFromCoordinate(u[0]),g=t.getPixelFromCoordinate(u[1]),y=Dn(d,m),_=Dn(d,g);f=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(h=y>_?u[1]:u[0]),this.createOrUpdateVertexFeature_(h,[l.feature],[l.geometry]);const v={};v[se(l.geometry)]=!0;for(let x=1,w=a.length;x<w;++x){const E=a[x].segment;if(ai(u[0],E[0])&&ai(u[1],E[1])||ai(u[0],E[1])&&ai(u[1],E[0])){const T=se(a[x].geometry);T in v||(v[T]=!0,p[se(E)]=!0)}else break}}this.vertexSegments_=p;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(e,t){const i=e.segment,r=e.feature,s=e.geometry,o=e.depth,a=e.index;let c;for(;t.length<s.getStride();)t.push(0);switch(s.getType()){case R.MULTI_LINE_STRING:c=s.getCoordinates(),c[o[0]].splice(a+1,0,t);break;case R.POLYGON:c=s.getCoordinates(),c[o[0]].splice(a+1,0,t);break;case R.MULTI_POLYGON:c=s.getCoordinates(),c[o[1]][o[0]].splice(a+1,0,t);break;case R.LINE_STRING:c=s.getCoordinates(),c.splice(a+1,0,t);break;default:return}this.setGeometryCoordinates_(s,c);const l=this.rBush_;l.remove(e),this.updateSegmentIndices_(s,a,o,1);const u={segment:[i[0],t],feature:r,geometry:s,depth:o,index:a};l.insert(yt(u.segment),u),this.dragSegments_.push([u,1]);const h={segment:[t,i[1]],feature:r,geometry:s,depth:o,index:a+1};l.insert(yt(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0}removePoint(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Re.POINTERDRAG){const e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_);const t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new Dh(Xg.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){const e=this.dragSegments_,t={};let i=!1,r,s,o,a,c,l,u,h,d,f,p;for(c=e.length-1;c>=0;--c)o=e[c],f=o[0],p=se(f.feature),f.depth&&(p+="-"+f.depth.join("-")),p in t||(t[p]={}),o[1]===0?(t[p].right=f,t[p].index=f.index):o[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(d=t[p].right,u=t[p].left,l=t[p].index,h=l-1,u!==void 0?f=u:f=d,h<0&&(h=0),a=f.geometry,s=a.getCoordinates(),r=s,i=!1,a.getType()){case R.MULTI_LINE_STRING:s[f.depth[0]].length>2&&(s[f.depth[0]].splice(l,1),i=!0);break;case R.LINE_STRING:s.length>2&&(s.splice(l,1),i=!0);break;case R.MULTI_POLYGON:r=r[f.depth[1]];case R.POLYGON:r=r[f.depth[0]],r.length>4&&(l==r.length-1&&(l=0),r.splice(l,1),i=!0,l===0&&(r.pop(),r.push(r[0]),h=r.length-1));break}if(i){this.setGeometryCoordinates_(a,s);const m=[];if(u!==void 0&&(this.rBush_.remove(u),m.push(u.segment[0])),d!==void 0&&(this.rBush_.remove(d),m.push(d.segment[1])),u!==void 0&&d!==void 0){const g={depth:f.depth,feature:f.feature,geometry:f.geometry,index:h,segment:m};this.rBush_.insert(yt(g.segment),g)}this.updateSegmentIndices_(a,l,f.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return i}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,i,r){this.rBush_.forEachInExtent(e.getExtent(),function(s){s.geometry===e&&(i===void 0||s.depth===void 0||Gi(s.depth,i))&&s.index>t&&(s.index+=r)})}}function TL(n,e){return n.index-e.index}function bv(n,e,t){const i=e.geometry;if(i.getType()===R.CIRCLE){let s=i;if(e.index===_c){const o=En();o&&(s=s.clone().transform(o,t));const a=Dn(s.getCenter(),rt(n,t)),c=Math.sqrt(a)-s.getRadius();return c*c}}const r=rt(n,t);return Ia[0]=rt(e.segment[0],t),Ia[1]=rt(e.segment[1],t),Fl(r,Ia)}function Sv(n,e,t){const i=e.geometry;if(i.getType()===R.CIRCLE&&e.index===_c){let s=i;const o=En();return o&&(s=s.clone().transform(o,t)),dr(s.getClosestPoint(rt(n,t)),t)}const r=rt(n,t);return Ia[0]=rt(e.segment[0],t),Ia[1]=rt(e.segment[1],t),dr(Pl(r,Ia),t)}function bL(){const n=wa();return function(e,t){return n[R.POINT]}}var SL=EL;const RL={SELECT:"select"};class Rv extends Mt{constructor(e,t,i,r){super(e),this.selected=t,this.deselected=i,this.mapBrowserEvent=r}}const Gh={};class a_ extends ls{constructor(e){super(),this.on,this.once,this.un;const t=e||{};this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=t.condition?t.condition:bg,this.addCondition_=t.addCondition?t.addCondition:Tg,this.removeCondition_=t.removeCondition?t.removeCondition:Tg,this.toggleCondition_=t.toggleCondition?t.toggleCondition:nc,this.multi_=t.multi?t.multi:!1,this.filter_=t.filter?t.filter:Mn,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=t.style!==void 0?t.style:IL(),this.features_=t.features||new At;let i;if(t.layers)if(typeof t.layers=="function")i=t.layers;else{const r=t.layers;i=function(s){return Ge(r,s)}}else i=Mn;this.layerFilter_=i,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(e,t){this.featureLayerAssociation_[se(e)]=t}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(e){return this.featureLayerAssociation_[se(e)]}setHitTolerance(e){this.hitTolerance_=e}setMap(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(e),e?(this.features_.addEventListener(wt.ADD,this.boundAddFeature_),this.features_.addEventListener(wt.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(wt.ADD,this.boundAddFeature_),this.features_.removeEventListener(wt.REMOVE,this.boundRemoveFeature_))}addFeature_(e){const t=e.element;if(this.style_&&this.applySelectedStyle_(t),!this.getLayer(t)){const i=this.getMap().getAllLayers().find(function(r){if(r instanceof fs&&r.getSource()&&r.getSource().hasFeature(t))return r});i&&this.addFeatureLayerAssociation_(t,i)}}removeFeature_(e){const t=e.element;this.style_&&this.restorePreviousStyle_(t)}getStyle(){return this.style_}applySelectedStyle_(e){const t=se(e);t in Gh||(Gh[t]=e.getStyle()),e.setStyle(this.style_)}restorePreviousStyle_(e){const t=this.getMap().getInteractions().getArray();for(let r=t.length-1;r>=0;--r){const s=t[r];if(s!==this&&s instanceof a_&&s.getStyle()&&s.getFeatures().getArray().lastIndexOf(e)!==-1){e.setStyle(s.getStyle());return}}const i=se(e);e.setStyle(Gh[i]),delete Gh[i]}removeFeatureLayerAssociation_(e){delete this.featureLayerAssociation_[se(e)]}handleEvent(e){if(!this.condition_(e))return!0;const t=this.addCondition_(e),i=this.removeCondition_(e),r=this.toggleCondition_(e),s=!t&&!i&&!r,o=e.map,a=this.getFeatures(),c=[],l=[];if(s){Zr(this.featureLayerAssociation_),o.forEachFeatureAtPixel(e.pixel,function(u,h){if(this.filter_(u,h))return this.addFeatureLayerAssociation_(u,h),l.push(u),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let u=a.getLength()-1;u>=0;--u){const h=a.item(u),d=l.indexOf(h);d>-1?l.splice(d,1):(a.remove(h),c.push(h))}l.length!==0&&a.extend(l)}else{o.forEachFeatureAtPixel(e.pixel,function(u,h){if(this.filter_(u,h))return(t||r)&&!Ge(a.getArray(),u)?(this.addFeatureLayerAssociation_(u,h),l.push(u)):(i||r)&&Ge(a.getArray(),u)&&(c.push(u),this.removeFeatureLayerAssociation_(u)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let u=c.length-1;u>=0;--u)a.remove(c[u]);a.extend(l)}return(l.length>0||c.length>0)&&this.dispatchEvent(new Rv(RL.SELECT,l,c,e)),!0}}function IL(){const n=wa();return Xe(n[R.POLYGON],n[R.LINE_STRING]),Xe(n[R.GEOMETRY_COLLECTION],n[R.LINE_STRING]),function(e){return e.getGeometry()?n[e.getGeometry().getType()]:null}}var CL=a_;function Iv(n){if(n.feature)return n.feature;if(n.element)return n.element}const Ca=[];class LL extends li{constructor(e){const t=e||{},i=t;i.handleDownEvent||(i.handleDownEvent=Mn),i.stopDown||(i.stopDown=Yr),super(i),this.source_=t.source?t.source:null,this.vertex_=t.vertex!==void 0?t.vertex:!0,this.edge_=t.edge!==void 0?t.edge:!0,this.features_=t.features?t.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.rBush_=new mc,this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this)}}addFeature(e,t){const i=t!==void 0?t:!0,r=se(e),s=e.getGeometry();if(s){const o=this.SEGMENT_WRITERS_[s.getType()];o&&(this.indexedFeaturesExtents_[r]=s.getExtent(Kt()),o(e,s))}i&&(this.featureChangeListenerKeys_[r]=pe(e,ne.CHANGE,this.handleFeatureChange_,this))}forEachFeatureAdd_(e){this.addFeature(e)}forEachFeatureRemove_(e){this.removeFeature(e)}getFeatures_(){let e;return this.features_?e=this.features_:this.source_&&(e=this.source_.getFeatures()),e}handleEvent(e){const t=this.snapTo(e.pixel,e.coordinate,e.map);return t.snapped&&(e.coordinate=t.vertex.slice(0,2),e.pixel=t.vertexPixel),super.handleEvent(e)}handleFeatureAdd_(e){const t=Iv(e);this.addFeature(t)}handleFeatureRemove_(e){const t=Iv(e);this.removeFeature(t)}handleFeatureChange_(e){const t=e.target;if(this.handlingDownUpSequence){const i=se(t);i in this.pendingFeatures_||(this.pendingFeatures_[i]=t)}else this.updateFeature_(t)}handleUpEvent(e){const t=Nu(this.pendingFeatures_);return t.length&&(t.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1}removeFeature(e,t){const i=t!==void 0?t:!0,r=se(e),s=this.indexedFeaturesExtents_[r];if(s){const o=this.rBush_,a=[];o.forEachInExtent(s,function(c){e===c.feature&&a.push(c)});for(let c=a.length-1;c>=0;--c)o.remove(a[c])}i&&(je(this.featureChangeListenerKeys_[r]),delete this.featureChangeListenerKeys_[r])}setMap(e){const t=this.getMap(),i=this.featuresListenerKeys_,r=this.getFeatures_();t&&(i.forEach(je),i.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),super.setMap(e),e&&(this.features_?i.push(pe(this.features_,wt.ADD,this.handleFeatureAdd_,this),pe(this.features_,wt.REMOVE,this.handleFeatureRemove_,this)):this.source_&&i.push(pe(this.source_,Nt.ADDFEATURE,this.handleFeatureAdd_,this),pe(this.source_,Nt.REMOVEFEATURE,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))}snapTo(e,t,i){const r=i.getCoordinateFromPixel([e[0]-this.pixelTolerance_,e[1]+this.pixelTolerance_]),s=i.getCoordinateFromPixel([e[0]+this.pixelTolerance_,e[1]-this.pixelTolerance_]),o=yt([r,s]);let a=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(a=a.filter(function(g){return g.feature.getGeometry().getType()!==R.CIRCLE}));let c=!1,l=null,u=null;if(a.length===0)return{snapped:c,vertex:l,vertexPixel:u};const h=i.getView().getProjection(),d=rt(t,h);let f,p=1/0;for(let g=0;g<a.length;++g){const y=a[g];Ca[0]=rt(y.segment[0],h),Ca[1]=rt(y.segment[1],h);const _=Fl(d,Ca);_<p&&(f=y,p=_)}const m=f.segment;if(this.vertex_&&!this.edge_){const g=i.getPixelFromCoordinate(m[0]),y=i.getPixelFromCoordinate(m[1]),_=Dn(e,g),v=Dn(e,y);Math.sqrt(Math.min(_,v))<=this.pixelTolerance_&&(c=!0,l=_>v?m[1]:m[0],u=i.getPixelFromCoordinate(l))}else if(this.edge_){const g=f.feature.getGeometry().getType()===R.CIRCLE;if(g){let y=f.feature.getGeometry();const _=En();_&&(y=y.clone().transform(_,h)),l=dr(dx(d,y),h)}else Ca[0]=rt(m[0],h),Ca[1]=rt(m[1],h),l=dr(Pl(d,Ca),h);if(u=i.getPixelFromCoordinate(l),Ml(e,u)<=this.pixelTolerance_&&(c=!0,this.vertex_&&!g)){const y=i.getPixelFromCoordinate(m[0]),_=i.getPixelFromCoordinate(m[1]),v=Dn(u,y),x=Dn(u,_);Math.sqrt(Math.min(v,x))<=this.pixelTolerance_&&(l=v>x?m[1]:m[0],u=i.getPixelFromCoordinate(l))}}return c&&(u=[Math.round(u[0]),Math.round(u[1])]),{snapped:c,vertex:l,vertexPixel:u}}updateFeature_(e){this.removeFeature(e,!1),this.addFeature(e,!1)}writeCircleGeometry_(e,t){const i=this.getMap().getView().getProjection();let r=t;const s=En();s&&(r=r.clone().transform(s,i));const o=zl(r);s&&o.transform(i,s);const a=o.getCoordinates()[0];for(let c=0,l=a.length-1;c<l;++c){const u=a.slice(c,c+2),h={feature:e,segment:u};this.rBush_.insert(yt(u),h)}}writeGeometryCollectionGeometry_(e,t){const i=t.getGeometriesArray();for(let r=0;r<i.length;++r){const s=this.SEGMENT_WRITERS_[i[r].getType()];s&&s(e,i[r])}}writeLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length-1;r<s;++r){const o=i.slice(r,r+2),a={feature:e,segment:o};this.rBush_.insert(yt(o),a)}}writeMultiLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,c=o.length-1;a<c;++a){const l=o.slice(a,a+2),u={feature:e,segment:l};this.rBush_.insert(yt(l),u)}}}writeMultiPointGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r],a={feature:e,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}}writeMultiPolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,c=o.length;a<c;++a){const l=o[a];for(let u=0,h=l.length-1;u<h;++u){const d=l.slice(u,u+2),f={feature:e,segment:d};this.rBush_.insert(yt(d),f)}}}}writePointGeometry_(e,t){const i=t.getCoordinates(),r={feature:e,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)}writePolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,c=o.length-1;a<c;++a){const l=o.slice(a,a+2),u={feature:e,segment:l};this.rBush_.insert(yt(l),u)}}}}var AL=LL;const Zg={TRANSLATESTART:"translatestart",TRANSLATING:"translating",TRANSLATEEND:"translateend"};class Uh extends Mt{constructor(e,t,i,r,s){super(e),this.features=t,this.coordinate=i,this.startCoordinate=r,this.mapBrowserEvent=s}}class PL extends li{constructor(e){const t=e||{};super(t),this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=t.features!==void 0?t.features:null;let i;if(t.layers&&!this.features_)if(typeof t.layers=="function")i=t.layers;else{const r=t.layers;i=function(s){return Ge(r,s)}}else i=Mn;this.layerFilter_=i,this.filter_=t.filter&&!this.features_?t.filter:Mn,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.condition_=t.condition?t.condition:_a,this.lastFeature_=null,this.addChangeListener(tc.ACTIVE,this.handleActiveChanged_)}handleDownEvent(e){if(!e.originalEvent||!this.condition_(e))return!1;if(this.lastFeature_=this.featuresAtPixel_(e.pixel,e.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=e.coordinate,this.lastCoordinate_=e.coordinate,this.handleMoveEvent(e);const t=this.features_||new At([this.lastFeature_]);return this.dispatchEvent(new Uh(Zg.TRANSLATESTART,t,e.coordinate,this.startCoordinate_,e)),!0}return!1}handleUpEvent(e){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(e);const t=this.features_||new At([this.lastFeature_]);return this.dispatchEvent(new Uh(Zg.TRANSLATEEND,t,e.coordinate,this.startCoordinate_,e)),this.startCoordinate_=null,!0}return!1}handleDragEvent(e){if(this.lastCoordinate_){const t=e.coordinate,i=t[0]-this.lastCoordinate_[0],r=t[1]-this.lastCoordinate_[1],s=this.features_||new At([this.lastFeature_]);s.forEach(function(o){const a=o.getGeometry();a.translate(i,r),o.setGeometry(a)}),this.lastCoordinate_=t,this.dispatchEvent(new Uh(Zg.TRANSLATING,s,t,this.startCoordinate_,e))}}handleMoveEvent(e){const t=e.map.getViewport();this.featuresAtPixel_(e.pixel,e.map)?(t.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),t.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):t.classList.remove("ol-grab","ol-grabbing")}featuresAtPixel_(e,t){return t.forEachFeatureAtPixel(e,function(i,r){if(this.filter_(i,r)&&(!this.features_||Ge(this.features_.getArray(),i)))return i}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(e){this.hitTolerance_=e}setMap(e){const t=this.getMap();super.setMap(e),this.updateState_(t)}handleActiveChanged_(){this.updateState_(null)}updateState_(e){let t=this.getMap();const i=this.getActive();(!t||!i)&&(t=t||e,t&&t.getViewport().classList.remove("ol-grab","ol-grabbing"))}}var OL=PL;function Cv(n){const e=n||{},t=new At,i=new Xp(-.005,.05,100);return(e.altShiftDragRotate!==void 0?e.altShiftDragRotate:!0)&&t.push(new D1),(e.doubleClickZoom!==void 0?e.doubleClickZoom:!0)&&t.push(new M1({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan!==void 0?e.dragPan:!0)&&t.push(new $1({onFocusOnly:e.onFocusOnly,kinetic:i})),(e.pinchRotate!==void 0?e.pinchRotate:!0)&&t.push(new Y1),(e.pinchZoom!==void 0?e.pinchZoom:!0)&&t.push(new X1({duration:e.zoomDuration})),(e.keyboard!==void 0?e.keyboard:!0)&&(t.push(new B1),t.push(new j1({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom!==void 0?e.mouseWheelZoom:!0)&&t.push(new V1({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom!==void 0?e.shiftDragZoom:!0)&&t.push(new z1({duration:e.zoomDuration})),t}class ML extends xh{constructor(e){e=J({},e),e.controls||(e.controls=P1()),e.interactions||(e.interactions=Cv({onFocusOnly:!0})),super(e)}createRenderer(){return new rg(this)}}var Lv=ML;class FL{constructor(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){const i=this.entries_[e];return ce(i!==void 0,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const t=this.entries_[e];return ce(t!==void 0,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.key_;return e}getValues(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){ce(!(e in this.entries_),16);const i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}var zh=FL;function La(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function Xi(n,e,t){return n+"/"+e+"/"+t}function Aa(n){return Xi(n[0],n[1],n[2])}function Av(n){const[e,t,i]=n.substring(n.lastIndexOf("/")+1,n.length).split(",").map(Number);return Xi(e,t,i)}function Wg(n){return n.split("/").map(Number)}function Bh(n){return(n[1]<<n[0])+n[2]}function Pv(n,e){const t=n[0],i=n[1],r=n[2];if(e.getMinZoom()>t||t>e.getMaxZoom())return!1;const s=e.getFullTileRange(t);return s?s.containsXY(i,r):!0}class NL extends zh{expireCache(e){for(;this.canExpireCache()&&!(this.peekLast().getKey()in e);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const e=this.peekFirstKey(),i=Wg(e)[0];this.forEach(function(r){r.tileCoord[0]!==i&&(this.remove(Aa(r.tileCoord)),r.release())}.bind(this))}}var xc=NL;class Ov{constructor(e,t,i,r){this.minX=e,this.maxX=t,this.minY=i,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function fo(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new Ov(n,e,t,i)}var vc=Ov;const Mv=[];class kL extends Kr{constructor(e,t,i,r){super(e,t,{transition:0}),this.context_={},this.executorGroups={},this.declutterExecutorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=r.bind(void 0,this),this.wrappedTileCoord=i}getContext(e){const t=se(e);return t in this.context_||(this.context_[t]=St(1,1,Mv)),this.context_[t]}hasContext(e){return se(e)in this.context_}getImage(e){return this.hasContext(e)?this.getContext(e).canvas:null}getReplayState(e){const t=se(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){for(const e in this.context_)Mv.push(this.context_[e].canvas),delete this.context_[e];super.release()}}var Hg=kL;class $L extends Kr{constructor(e,t,i,r,s,o){super(e,t,o),this.extent=null,this.format_=r,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=s,this.url_=i,this.key=i}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==W.IDLE&&(this.setState(W.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(W.ERROR)}setFeatures(e){this.features_=e,this.setState(W.LOADED)}setLoader(e){this.loader_=e}}var Kg=$L;class DL{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}getReadOptions(e,t){let i;if(t){let r=t.dataProjection?re(t.dataProjection):this.readProjection(e);t.extent&&r&&r.getUnits()===gn.TILE_PIXELS&&(r=re(r),r.setWorldExtent(t.extent)),i={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(i)}adaptOptions(e){return J({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)}getType(){return he()}readFeature(e,t){return he()}readFeatures(e,t){return he()}readGeometry(e,t){return he()}readProjection(e){return he()}writeFeature(e,t){return he()}writeFeatures(e,t){return he()}writeGeometry(e,t){return he()}}var Pa=DL;function ct(n,e,t){const i=t?re(t.featureProjection):null,r=t?re(t.dataProjection):null;let s;if(i&&r&&!Gn(i,r)?s=(e?n.clone():n).transform(e?i:r,e?r:i):s=n,e&&t&&t.decimals!==void 0){const o=Math.pow(10,t.decimals),a=function(c){for(let l=0,u=c.length;l<u;++l)c[l]=Math.round(c[l]*o)/o;return c};s===n&&(s=n.clone()),s.applyTransform(a)}return s}function jh(n,e){const t=e?re(e.featureProjection):null,i=e?re(e.dataProjection):null;return t&&i&&!Gn(t,i)?ra(n,i,t):n}class GL extends Pa{constructor(){super()}getType(){return Bn.JSON}readFeature(e,t){return this.readFeatureFromObject(Vh(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(Vh(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return he()}readFeaturesFromObject(e,t){return he()}readGeometry(e,t){return this.readGeometryFromObject(Vh(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return he()}readProjection(e){return this.readProjectionFromObject(Vh(e))}readProjectionFromObject(e){return he()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return he()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return he()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return he()}}function Vh(n){if(typeof n=="string"){const e=JSON.parse(n);return e||null}else return n!==null?n:null}var Yh=GL;const po={};po[R.POINT]=BL,po[R.LINE_STRING]=jL,po[R.POLYGON]=ZL,po[R.MULTI_POINT]=YL,po[R.MULTI_LINE_STRING]=VL,po[R.MULTI_POLYGON]=XL;const go={};go[R.POINT]=WL,go[R.LINE_STRING]=HL,go[R.POLYGON]=KL,go[R.MULTI_POINT]=JL,go[R.MULTI_LINE_STRING]=qL,go[R.MULTI_POLYGON]=QL;class UL extends Yh{constructor(e){const t=e||{};super(),this.geometryName_=t.geometryName}readFeatureFromObject(e,t,i){const r=e,s=Fv(r.geometry,t),o=new it;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(s),r.attributes){o.setProperties(r.attributes,!0);const a=r.attributes[i];a!==void 0&&o.setId(a)}return o}readFeaturesFromObject(e,t){const i=t||{};if(e.features){const r=e,s=[],o=r.features;for(let a=0,c=o.length;a<c;++a)s.push(this.readFeatureFromObject(o[a],i,e.objectIdFieldName));return s}else return[this.readFeatureFromObject(e,i)]}readGeometryFromObject(e,t){return Fv(e,t)}readProjectionFromObject(e){if(e.spatialReference&&e.spatialReference.wkid!==void 0){const i=e.spatialReference.wkid;return re("EPSG:"+i)}else return null}writeGeometryObject(e,t){return Nv(e,this.adaptOptions(t))}writeFeatureObject(e,t){t=this.adaptOptions(t);const i={};if(!e.hasProperties())return i.attributes={},i;const r=e.getProperties(),s=e.getGeometry();if(s){i.geometry=Nv(s,t);const o=t&&(t.dataProjection||t.featureProjection);o&&(i.geometry.spatialReference={wkid:Number(re(o).getCode().split(":").pop())}),delete r[e.getGeometryName()]}return xi(r)?i.attributes={}:i.attributes=r,i}writeFeaturesObject(e,t){t=this.adaptOptions(t);const i=[];for(let r=0,s=e.length;r<s;++r)i.push(this.writeFeatureObject(e[r],t));return{features:i}}}function Fv(n,e){if(!n)return null;let t;if(typeof n.x=="number"&&typeof n.y=="number")t=R.POINT;else if(n.points)t=R.MULTI_POINT;else if(n.paths)n.paths.length===1?t=R.LINE_STRING:t=R.MULTI_LINE_STRING;else if(n.rings){const r=n,s=Oa(r),o=zL(r.rings,s);o.length===1?(t=R.POLYGON,n=J({},n,{rings:o[0]})):(t=R.MULTI_POLYGON,n=J({},n,{rings:o}))}const i=po[t];return ct(i(n),!1,e)}function zL(n,e){const t=[],i=[],r=[];let s,o;for(s=0,o=n.length;s<o;++s)t.length=0,sa(t,0,n[s],e.length),Ul(t,0,t.length,e.length)?i.push([n[s]]):r.push(n[s]);for(;r.length;){const a=r.shift();let c=!1;for(s=i.length-1;s>=0;s--){const l=i[s][0];if(Gt(new aa(l).getExtent(),new aa(a).getExtent())){i[s].push(a),c=!0;break}}c||i.push([a.reverse()])}return i}function BL(n){let e;return n.m!==void 0&&n.z!==void 0?e=new ft([n.x,n.y,n.z,n.m],H.XYZM):n.z!==void 0?e=new ft([n.x,n.y,n.z],H.XYZ):n.m!==void 0?e=new ft([n.x,n.y,n.m],H.XYM):e=new ft([n.x,n.y]),e}function jL(n){const e=Oa(n);return new Tt(n.paths[0],e)}function VL(n){const e=Oa(n);return new jn(n.paths,e)}function Oa(n){let e=H.XY;return n.hasZ===!0&&n.hasM===!0?e=H.XYZM:n.hasZ===!0?e=H.XYZ:n.hasM===!0&&(e=H.XYM),e}function YL(n){const e=Oa(n);return new ci(n.points,e)}function XL(n){const e=Oa(n);return new ui(n.rings,e)}function ZL(n){const e=Oa(n);return new Bt(n.rings,e)}function WL(n,e){const t=n.getCoordinates();let i;const r=n.getLayout();return r===H.XYZ?i={x:t[0],y:t[1],z:t[2]}:r===H.XYM?i={x:t[0],y:t[1],m:t[2]}:r===H.XYZM?i={x:t[0],y:t[1],z:t[2],m:t[3]}:r===H.XY?i={x:t[0],y:t[1]}:ce(!1,34),i}function wc(n){const e=n.getLayout();return{hasZ:e===H.XYZ||e===H.XYZM,hasM:e===H.XYM||e===H.XYZM}}function HL(n,e){const t=wc(n);return{hasZ:t.hasZ,hasM:t.hasM,paths:[n.getCoordinates()]}}function KL(n,e){const t=wc(n);return{hasZ:t.hasZ,hasM:t.hasM,rings:n.getCoordinates(!1)}}function qL(n,e){const t=wc(n);return{hasZ:t.hasZ,hasM:t.hasM,paths:n.getCoordinates()}}function JL(n,e){const t=wc(n);return{hasZ:t.hasZ,hasM:t.hasM,points:n.getCoordinates()}}function QL(n,e){const t=wc(n),i=n.getCoordinates(!1),r=[];for(let s=0;s<i.length;s++)for(let o=i[s].length-1;o>=0;o--)r.push(i[s][o]);return{hasZ:t.hasZ,hasM:t.hasM,rings:r}}function Nv(n,e){return go[n.getType()](ct(n,!0,e),e)}var eA=UL;const ps="http://www.w3.org/2001/XMLSchema-instance";function xe(n,e){return mo().createElementNS(n,e)}function xn(n,e){return qg(n,e,[]).join("")}function qg(n,e,t){if(n.nodeType==Node.CDATA_SECTION_NODE||n.nodeType==Node.TEXT_NODE)e?t.push(String(n.nodeValue).replace(/(\r\n|\r|\n)/g,"")):t.push(n.nodeValue);else{let i;for(i=n.firstChild;i;i=i.nextSibling)qg(i,e,t)}return t}function Ci(n){return"documentElement"in n}function kv(n,e,t){return n.getAttributeNS(e,t)||""}function Li(n){return new DOMParser().parseFromString(n,"application/xml")}function Jg(n,e){return function(t,i){const r=n.call(e!==void 0?e:this,t,i);if(r!==void 0){const s=i[i.length-1];Xe(s,r)}}}function ue(n,e){return function(t,i){const r=n.call(e!==void 0?e:this,t,i);r!==void 0&&i[i.length-1].push(r)}}function ge(n,e){return function(t,i){const r=n.call(e!==void 0?e:this,t,i);r!==void 0&&(i[i.length-1]=r)}}function ut(n,e,t){return function(i,r){const s=n.call(t!==void 0?t:this,i,r);if(s!==void 0){const o=r[r.length-1],a=e!==void 0?e:i.localName;let c;a in o?c=o[a]:(c=[],o[a]=c),c.push(s)}}}function C(n,e,t){return function(i,r){const s=n.call(t!==void 0?t:this,i,r);if(s!==void 0){const o=r[r.length-1],a=e!==void 0?e:i.localName;o[a]=s}}}function L(n,e){return function(t,i,r){n.call(e!==void 0?e:this,t,i,r),r[r.length-1].node.appendChild(t)}}function Qg(n,e){let t,i;return function(r,s,o){if(t===void 0){t={};const a={};a[r.localName]=n,t[r.namespaceURI]=a,i=_t(r.localName)}em(t,i,s,o)}}function _t(n,e){const t=n;return function(i,r,s){const a=r[r.length-1].node;let c=t;c===void 0&&(c=s);const l=e!==void 0?e:a.namespaceURI;return xe(l,c)}}const jt=_t();function Rn(n,e){const t=e.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=n[e[r]];return i}function j(n,e,t){const i=t!==void 0?t:{};let r,s;for(r=0,s=n.length;r<s;++r)i[n[r]]=e;return i}function In(n,e,t,i){let r;for(r=e.firstElementChild;r;r=r.nextElementSibling){const s=n[r.namespaceURI];if(s!==void 0){const o=s[r.localName];o!==void 0&&o.call(i,r,t)}}}function V(n,e,t,i,r){return i.push(n),In(e,t,i,r),i.pop()}function em(n,e,t,i,r,s){const o=(r!==void 0?r:t).length;let a,c;for(let l=0;l<o;++l)a=t[l],a!==void 0&&(c=e.call(s!==void 0?s:this,a,i,r!==void 0?r[l]:void 0),c!==void 0&&n[c.namespaceURI][c.localName].call(s,c,a,i))}function ve(n,e,t,i,r,s,o){return r.push(n),em(e,t,i,r,s,o),r.pop()}let Xh;function tA(n){Xh=n}function $v(){return Xh===void 0&&typeof XMLSerializer!="undefined"&&(Xh=new XMLSerializer),Xh}let Zh;function nA(n){Zh=n}function mo(){return Zh===void 0&&typeof document!="undefined"&&(Zh=document.implementation.createDocument("","",null)),Zh}class iA extends Pa{constructor(){super(),this.xmlSerializer_=$v()}getType(){return Bn.XML}readFeature(e,t){if(e)if(typeof e=="string"){const i=Li(e);return this.readFeatureFromDocument(i,t)}else return Ci(e)?this.readFeatureFromDocument(e,t):this.readFeatureFromNode(e,t);else return null}readFeatureFromDocument(e,t){const i=this.readFeaturesFromDocument(e,t);return i.length>0?i[0]:null}readFeatureFromNode(e,t){return null}readFeatures(e,t){if(e)if(typeof e=="string"){const i=Li(e);return this.readFeaturesFromDocument(i,t)}else return Ci(e)?this.readFeaturesFromDocument(e,t):this.readFeaturesFromNode(e,t);else return[]}readFeaturesFromDocument(e,t){const i=[];for(let r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&Xe(i,this.readFeaturesFromNode(r,t));return i}readFeaturesFromNode(e,t){return he()}readGeometry(e,t){if(e)if(typeof e=="string"){const i=Li(e);return this.readGeometryFromDocument(i,t)}else return Ci(e)?this.readGeometryFromDocument(e,t):this.readGeometryFromNode(e,t);else return null}readGeometryFromDocument(e,t){return null}readGeometryFromNode(e,t){return null}readProjection(e){if(e)if(typeof e=="string"){const t=Li(e);return this.readProjectionFromDocument(t)}else return Ci(e)?this.readProjectionFromDocument(e):this.readProjectionFromNode(e);else return null}readProjectionFromDocument(e){return this.dataProjection}readProjectionFromNode(e){return this.dataProjection}writeFeature(e,t){const i=this.writeFeatureNode(e,t);return this.xmlSerializer_.serializeToString(i)}writeFeatureNode(e,t){return null}writeFeatures(e,t){const i=this.writeFeaturesNode(e,t);return this.xmlSerializer_.serializeToString(i)}writeFeaturesNode(e,t){return null}writeGeometry(e,t){const i=this.writeGeometryNode(e,t);return this.xmlSerializer_.serializeToString(i)}writeGeometryNode(e,t){return null}}var yo=iA;const Zi="http://www.opengis.net/gml",rA=/^[\s\xa0]*$/;class It extends yo{constructor(e){super();const t=e||{};this.featureType=t.featureType,this.featureNS=t.featureNS,this.srsName=t.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:ue(this.readFeaturesInternal),featureMembers:ge(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(e,t){const i=e.localName;let r=null;if(i=="FeatureCollection")r=V([],this.FEATURE_COLLECTION_PARSERS,e,t,this);else if(i=="featureMembers"||i=="featureMember"||i=="member"){const s=t[0];let o=s.featureType,a=s.featureNS;const c="p",l="p0";if(!o&&e.childNodes){o=[],a={};for(let d=0,f=e.childNodes.length;d<f;++d){const p=e.childNodes[d];if(p.nodeType===1){const m=p.nodeName.split(":").pop();if(o.indexOf(m)===-1){let g="",y=0;const _=p.namespaceURI;for(const v in a){if(a[v]===_){g=v;break}++y}g||(g=c+y,a[g]=_),o.push(g+":"+m)}}}i!="featureMember"&&(s.featureType=o,s.featureNS=a)}if(typeof a=="string"){const d=a;a={},a[l]=d}const u={},h=Array.isArray(o)?o:[o];for(const d in a){const f={};for(let p=0,m=h.length;p<m;++p)(h[p].indexOf(":")===-1?l:h[p].split(":")[0])===d&&(f[h[p].split(":").pop()]=i=="featureMembers"?ue(this.readFeatureElement,this):ge(this.readFeatureElement,this));u[a[d]]=f}i=="featureMember"||i=="member"?r=V(void 0,u,e,t):r=V([],u,e,t)}return r===null&&(r=[]),r}readGeometryElement(e,t){const i=t[0];i.srsName=e.firstElementChild.getAttribute("srsName"),i.srsDimension=e.firstElementChild.getAttribute("srsDimension");const r=V(null,this.GEOMETRY_PARSERS,e,t,this);if(r)return Array.isArray(r)?jh(r,i):ct(r,!1,i)}readFeatureElementInternal(e,t,i){let r;const s={};for(let o=e.firstElementChild;o;o=o.nextElementSibling){let a;const c=o.localName;o.childNodes.length===0||o.childNodes.length===1&&(o.firstChild.nodeType===3||o.firstChild.nodeType===4)?(a=xn(o,!1),rA.test(a)&&(a=void 0)):(i&&(a=this.readGeometryElement(o,t)),a?c!=="boundedBy"&&(r=c):a=this.readFeatureElementInternal(o,t,!1)),s[c]?(s[c]instanceof Array||(s[c]=[s[c]]),s[c].push(a)):s[c]=a;const l=o.attributes.length;if(l>0){s[c]={_content_:s[c]};for(let u=0;u<l;u++){const h=o.attributes[u].name;s[c][h]=o.attributes[u].value}}}if(i){const o=new it(s);r&&o.setGeometryName(r);const a=e.getAttribute("fid")||kv(e,this.namespace,"id");return a&&o.setId(a),o}else return s}readFeatureElement(e,t){return this.readFeatureElementInternal(e,t,!0)}readPoint(e,t){const i=this.readFlatCoordinatesFromNode(e,t);if(i)return new ft(i,H.XYZ)}readMultiPoint(e,t){const i=V([],this.MULTIPOINT_PARSERS,e,t,this);if(i)return new ci(i)}readMultiLineString(e,t){const i=V([],this.MULTILINESTRING_PARSERS,e,t,this);if(i)return new jn(i)}readMultiPolygon(e,t){const i=V([],this.MULTIPOLYGON_PARSERS,e,t,this);if(i)return new ui(i)}pointMemberParser(e,t){In(this.POINTMEMBER_PARSERS,e,t,this)}lineStringMemberParser(e,t){In(this.LINESTRINGMEMBER_PARSERS,e,t,this)}polygonMemberParser(e,t){In(this.POLYGONMEMBER_PARSERS,e,t,this)}readLineString(e,t){const i=this.readFlatCoordinatesFromNode(e,t);if(i)return new Tt(i,H.XYZ)}readFlatLinearRing(e,t){const i=V(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,t,this);if(i)return i}readLinearRing(e,t){const i=this.readFlatCoordinatesFromNode(e,t);if(i)return new aa(i,H.XYZ)}readPolygon(e,t){const i=V([null],this.FLAT_LINEAR_RINGS_PARSERS,e,t,this);if(i&&i[0]){const r=i[0],s=[r.length];let o,a;for(o=1,a=i.length;o<a;++o)Xe(r,i[o]),s.push(r.length);return new Bt(r,H.XYZ,s)}else return}readFlatCoordinatesFromNode(e,t){return V(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,t,this)}readGeometryFromNode(e,t){const i=this.readGeometryElement(e,[this.getReadOptions(e,t||{})]);return i||null}readFeaturesFromNode(e,t){const i={featureType:this.featureType,featureNS:this.featureNS};return t&&J(i,this.getReadOptions(e,t)),this.readFeaturesInternal(e,[i])||[]}readProjectionFromNode(e){return re(this.srsName?this.srsName:e.firstElementChild.getAttribute("srsName"))}}It.prototype.namespace=Zi,It.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},It.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},It.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},It.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:ue(It.prototype.pointMemberParser),pointMembers:ue(It.prototype.pointMemberParser)}},It.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:ue(It.prototype.lineStringMemberParser),lineStringMembers:ue(It.prototype.lineStringMemberParser)}},It.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:ue(It.prototype.polygonMemberParser),polygonMembers:ue(It.prototype.polygonMemberParser)}},It.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:ue(It.prototype.readFlatCoordinatesFromNode)}},It.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:ue(It.prototype.readLineString)}},It.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:ue(It.prototype.readPolygon)}},It.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:ge(It.prototype.readFlatLinearRing)}};var ke=It;function xr(n){const e=xn(n,!1);return gs(e)}function gs(n){const e=/^\s*(true|1)|(false|0)\s*$/.exec(n);if(e)return e[1]!==void 0||!1}function Wh(n){const e=xn(n,!1),t=Date.parse(e);return isNaN(t)?void 0:t/1e3}function Ve(n){const e=xn(n,!1);return Wi(e)}function Wi(n){const e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(n);if(e)return parseFloat(e[1])}function Ct(n){const e=xn(n,!1);return Hi(e)}function Hi(n){const e=/^\s*(\d+)\s*$/.exec(n);if(e)return parseInt(e[1],10)}function Z(n){return xn(n,!1).trim()}function _o(n,e){ye(n,e?"1":"0")}function Dv(n,e){n.appendChild(mo().createCDATASection(e))}function Gv(n,e){const t=new Date(e*1e3),i=t.getUTCFullYear()+"-"+es(t.getUTCMonth()+1,2)+"-"+es(t.getUTCDate(),2)+"T"+es(t.getUTCHours(),2)+":"+es(t.getUTCMinutes(),2)+":"+es(t.getUTCSeconds(),2)+"Z";n.appendChild(mo().createTextNode(i))}function Cn(n,e){const t=e.toPrecision();n.appendChild(mo().createTextNode(t))}function Ec(n,e){const t=e.toString();n.appendChild(mo().createTextNode(t))}function ye(n,e){n.appendChild(mo().createTextNode(e))}const sA=Zi+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",oA={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class Ue extends ke{constructor(e){const t=e||{};super(t),this.FEATURE_COLLECTION_PARSERS[Zi].featureMember=ue(this.readFeaturesInternal),this.schemaLocation=t.schemaLocation?t.schemaLocation:sA}readFlatCoordinates(e,t){const i=xn(e,!1).replace(/^\s*|\s*$/g,""),s=t[0].srsName;let o="enu";if(s){const l=re(s);l&&(o=l.getAxisOrientation())}const a=i.trim().split(/\s+/),c=[];for(let l=0,u=a.length;l<u;l++){const h=a[l].split(/,+/),d=parseFloat(h[0]),f=parseFloat(h[1]),p=h.length===3?parseFloat(h[2]):0;o.substr(0,2)==="en"?c.push(d,f,p):c.push(f,d,p)}return c}readBox(e,t){const i=V([null],this.BOX_PARSERS_,e,t,this);return $n(i[1][0],i[1][1],i[1][3],i[1][4])}innerBoundaryIsParser(e,t){const i=V(void 0,this.RING_PARSERS,e,t,this);i&&t[t.length-1].push(i)}outerBoundaryIsParser(e,t){const i=V(void 0,this.RING_PARSERS,e,t,this);if(i){const r=t[t.length-1];r[0]=i}}GEOMETRY_NODE_FACTORY_(e,t,i){const r=t[t.length-1],s=r.multiSurface,o=r.surface,a=r.multiCurve;let c;return Array.isArray(e)?c="Envelope":(c=e.getType(),c==="MultiPolygon"&&s===!0?c="MultiSurface":c==="Polygon"&&o===!0?c="Surface":c==="MultiLineString"&&a===!0&&(c="MultiCurve")),xe("http://www.opengis.net/gml",c)}writeFeatureElement(e,t,i){const r=t.getId();r&&e.setAttribute("fid",r);const s=i[i.length-1],o=s.featureNS,a=t.getGeometryName();s.serializers||(s.serializers={},s.serializers[o]={});const c=[],l=[];if(t.hasProperties()){const h=t.getProperties();for(const d in h){const f=h[d];f!==null&&(c.push(d),l.push(f),d==a||typeof f.getSimplifiedGeometry=="function"?d in s.serializers[o]||(s.serializers[o][d]=L(this.writeGeometryElement,this)):d in s.serializers[o]||(s.serializers[o][d]=L(ye)))}}const u=J({},s);u.node=e,ve(u,s.serializers,_t(void 0,o),l,i,c)}writeCurveOrLineString(e,t,i){const s=i[i.length-1].srsName;if(e.nodeName!=="LineStringSegment"&&s&&e.setAttribute("srsName",s),e.nodeName==="LineString"||e.nodeName==="LineStringSegment"){const o=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(o),this.writeCoordinates_(o,t,i)}else if(e.nodeName==="Curve"){const o=xe(e.namespaceURI,"segments");e.appendChild(o),this.writeCurveSegments_(o,t,i)}}writeLineStringOrCurveMember(e,t,i){const r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(e.appendChild(r),this.writeCurveOrLineString(r,t,i))}writeMultiCurveOrLineString(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=r.curve;o&&e.setAttribute("srsName",o);const c=t.getLineStrings();ve({node:e,hasZ:s,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,c,i,void 0,this)}writeGeometryElement(e,t,i){const r=i[i.length-1],s=J({},r);s.node=e;let o;Array.isArray(t)?o=jh(t,r):o=ct(t,!0,r),ve(s,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[o],i,void 0,this)}createCoordinatesNode_(e){const t=xe(e,"coordinates");return t.setAttribute("decimal","."),t.setAttribute("cs",","),t.setAttribute("ts"," "),t}writeCoordinates_(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=t.getCoordinates(),c=a.length,l=new Array(c);for(let u=0;u<c;++u){const h=a[u];l[u]=this.getCoords_(h,o,s)}ye(e,l.join(" "))}writeCurveSegments_(e,t,i){const r=xe(e.namespaceURI,"LineStringSegment");e.appendChild(r),this.writeCurveOrLineString(r,t,i)}writeSurfaceOrPolygon(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName;if(e.nodeName!=="PolygonPatch"&&o&&e.setAttribute("srsName",o),e.nodeName==="Polygon"||e.nodeName==="PolygonPatch"){const a=t.getLinearRings();ve({node:e,hasZ:s,srsName:o},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,a,i,void 0,this)}else if(e.nodeName==="Surface"){const a=xe(e.namespaceURI,"patches");e.appendChild(a),this.writeSurfacePatches_(a,t,i)}}RING_NODE_FACTORY_(e,t,i){const r=t[t.length-1],s=r.node,o=r.exteriorWritten;return o===void 0&&(r.exteriorWritten=!0),xe(s.namespaceURI,o!==void 0?"innerBoundaryIs":"outerBoundaryIs")}writeSurfacePatches_(e,t,i){const r=xe(e.namespaceURI,"PolygonPatch");e.appendChild(r),this.writeSurfaceOrPolygon(r,t,i)}writeRing(e,t,i){const r=xe(e.namespaceURI,"LinearRing");e.appendChild(r),this.writeLinearRing(r,t,i)}getCoords_(e,t,i){let r="enu";t&&(r=re(t).getAxisOrientation());let s=r.substr(0,2)==="en"?e[0]+","+e[1]:e[1]+","+e[0];if(i){const o=e[2]||0;s+=","+o}return s}writePoint(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName;o&&e.setAttribute("srsName",o);const a=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(a);const c=t.getCoordinates(),l=this.getCoords_(c,o,s);ye(a,l)}writeMultiPoint(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName;o&&e.setAttribute("srsName",o);const a=t.getPoints();ve({node:e,hasZ:s,srsName:o},this.POINTMEMBER_SERIALIZERS,_t("pointMember"),a,i,void 0,this)}writePointMember(e,t,i){const r=xe(e.namespaceURI,"Point");e.appendChild(r),this.writePoint(r,t,i)}writeLinearRing(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=this.createCoordinatesNode_(e.namespaceURI);e.appendChild(o),this.writeCoordinates_(o,t,i)}writeMultiSurfaceOrPolygon(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=r.surface;o&&e.setAttribute("srsName",o);const c=t.getPolygons();ve({node:e,hasZ:s,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,c,i,void 0,this)}writeSurfaceOrPolygonMember(e,t,i){const r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(e.appendChild(r),this.writeSurfaceOrPolygon(r,t,i))}writeEnvelope(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=["lowerCorner","upperCorner"],a=[t[0]+" "+t[1],t[2]+" "+t[3]];ve({node:e},this.ENVELOPE_SERIALIZERS,jt,a,i,o,this)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(e,t,i){const r=t[t.length-1].node;return xe("http://www.opengis.net/gml",oA[r.nodeName])}}Ue.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:ge(Ue.prototype.readFlatCoordinates)}},Ue.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:Ue.prototype.innerBoundaryIsParser,outerBoundaryIs:Ue.prototype.outerBoundaryIsParser}},Ue.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:ue(Ue.prototype.readFlatCoordinates)}},Ue.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:ge(ke.prototype.readPoint),MultiPoint:ge(ke.prototype.readMultiPoint),LineString:ge(ke.prototype.readLineString),MultiLineString:ge(ke.prototype.readMultiLineString),LinearRing:ge(ke.prototype.readLinearRing),Polygon:ge(ke.prototype.readPolygon),MultiPolygon:ge(ke.prototype.readMultiPolygon),Box:ge(Ue.prototype.readBox)}},Ue.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:L(Ue.prototype.writeCurveOrLineString),MultiCurve:L(Ue.prototype.writeMultiCurveOrLineString),Point:L(Ue.prototype.writePoint),MultiPoint:L(Ue.prototype.writeMultiPoint),LineString:L(Ue.prototype.writeCurveOrLineString),MultiLineString:L(Ue.prototype.writeMultiCurveOrLineString),LinearRing:L(Ue.prototype.writeLinearRing),Polygon:L(Ue.prototype.writeSurfaceOrPolygon),MultiPolygon:L(Ue.prototype.writeMultiSurfaceOrPolygon),Surface:L(Ue.prototype.writeSurfaceOrPolygon),MultiSurface:L(Ue.prototype.writeMultiSurfaceOrPolygon),Envelope:L(Ue.prototype.writeEnvelope)}},Ue.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:L(Ue.prototype.writeLineStringOrCurveMember),curveMember:L(Ue.prototype.writeLineStringOrCurveMember)}},Ue.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:L(Ue.prototype.writeRing),innerBoundaryIs:L(Ue.prototype.writeRing)}},Ue.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:L(Ue.prototype.writePointMember)}},Ue.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:L(Ue.prototype.writeSurfaceOrPolygonMember),polygonMember:L(Ue.prototype.writeSurfaceOrPolygonMember)}},Ue.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:L(ye),upperCorner:L(ye)}};var xo=Ue;const aA=Zi+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",lA={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class de extends ke{constructor(e){const t=e||{};super(t),this.surface_=t.surface!==void 0?t.surface:!1,this.curve_=t.curve!==void 0?t.curve:!1,this.multiCurve_=t.multiCurve!==void 0?t.multiCurve:!0,this.multiSurface_=t.multiSurface!==void 0?t.multiSurface:!0,this.schemaLocation=t.schemaLocation?t.schemaLocation:aA,this.hasZ=t.hasZ!==void 0?t.hasZ:!1}readMultiCurve(e,t){const i=V([],this.MULTICURVE_PARSERS,e,t,this);if(i)return new jn(i)}readMultiSurface(e,t){const i=V([],this.MULTISURFACE_PARSERS,e,t,this);if(i)return new ui(i)}curveMemberParser(e,t){In(this.CURVEMEMBER_PARSERS,e,t,this)}surfaceMemberParser(e,t){In(this.SURFACEMEMBER_PARSERS,e,t,this)}readPatch(e,t){return V([null],this.PATCHES_PARSERS,e,t,this)}readSegment(e,t){return V([null],this.SEGMENTS_PARSERS,e,t,this)}readPolygonPatch(e,t){return V([null],this.FLAT_LINEAR_RINGS_PARSERS,e,t,this)}readLineStringSegment(e,t){return V([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,e,t,this)}interiorParser(e,t){const i=V(void 0,this.RING_PARSERS,e,t,this);i&&t[t.length-1].push(i)}exteriorParser(e,t){const i=V(void 0,this.RING_PARSERS,e,t,this);if(i){const r=t[t.length-1];r[0]=i}}readSurface(e,t){const i=V([null],this.SURFACE_PARSERS,e,t,this);if(i&&i[0]){const r=i[0],s=[r.length];let o,a;for(o=1,a=i.length;o<a;++o)Xe(r,i[o]),s.push(r.length);return new Bt(r,H.XYZ,s)}else return}readCurve(e,t){const i=V([null],this.CURVE_PARSERS,e,t,this);if(i)return new Tt(i,H.XYZ)}readEnvelope(e,t){const i=V([null],this.ENVELOPE_PARSERS,e,t,this);return $n(i[1][0],i[1][1],i[2][0],i[2][1])}readFlatPos(e,t){let i=xn(e,!1);const r=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,s=[];let o;for(;o=r.exec(i);)s.push(parseFloat(o[1])),i=i.substr(o[0].length);if(i!=="")return;const c=t[0].srsName;let l="enu";if(c&&(l=re(c).getAxisOrientation()),l==="neu"){let h,d;for(h=0,d=s.length;h<d;h+=3){const f=s[h],p=s[h+1];s[h]=p,s[h+1]=f}}const u=s.length;if(u==2&&s.push(0),u!==0)return s}readFlatPosList(e,t){const i=xn(e,!1).replace(/^\s*|\s*$/g,""),r=t[0],s=r.srsName,o=r.srsDimension;let a="enu";s&&(a=re(s).getAxisOrientation());const c=i.split(/\s+/);let l=2;e.getAttribute("srsDimension")?l=Hi(e.getAttribute("srsDimension")):e.getAttribute("dimension")?l=Hi(e.getAttribute("dimension")):e.parentNode.getAttribute("srsDimension")?l=Hi(e.parentNode.getAttribute("srsDimension")):o&&(l=Hi(o));let u,h,d;const f=[];for(let p=0,m=c.length;p<m;p+=l)u=parseFloat(c[p]),h=parseFloat(c[p+1]),d=l===3?parseFloat(c[p+2]):0,a.substr(0,2)==="en"?f.push(u,h,d):f.push(h,u,d);return f}writePos_(e,t,i){const r=i[i.length-1],s=r.hasZ,o=s?"3":"2";e.setAttribute("srsDimension",o);const a=r.srsName;let c="enu";a&&(c=re(a).getAxisOrientation());const l=t.getCoordinates();let u;if(c.substr(0,2)==="en"?u=l[0]+" "+l[1]:u=l[1]+" "+l[0],s){const h=l[2]||0;u+=" "+h}ye(e,u)}getCoords_(e,t,i){let r="enu";t&&(r=re(t).getAxisOrientation());let s=r.substr(0,2)==="en"?e[0]+" "+e[1]:e[1]+" "+e[0];if(i){const o=e[2]||0;s+=" "+o}return s}writePosList_(e,t,i){const r=i[i.length-1],s=r.hasZ,o=s?"3":"2";e.setAttribute("srsDimension",o);const a=r.srsName,c=t.getCoordinates(),l=c.length,u=new Array(l);let h;for(let d=0;d<l;++d)h=c[d],u[d]=this.getCoords_(h,a,s);ye(e,u.join(" "))}writePoint(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=xe(e.namespaceURI,"pos");e.appendChild(o),this.writePos_(o,t,i)}writeEnvelope(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=["lowerCorner","upperCorner"],a=[t[0]+" "+t[1],t[2]+" "+t[3]];ve({node:e},this.ENVELOPE_SERIALIZERS,jt,a,i,o,this)}writeLinearRing(e,t,i){const s=i[i.length-1].srsName;s&&e.setAttribute("srsName",s);const o=xe(e.namespaceURI,"posList");e.appendChild(o),this.writePosList_(o,t,i)}RING_NODE_FACTORY_(e,t,i){const r=t[t.length-1],s=r.node,o=r.exteriorWritten;return o===void 0&&(r.exteriorWritten=!0),xe(s.namespaceURI,o!==void 0?"interior":"exterior")}writeSurfaceOrPolygon(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName;if(e.nodeName!=="PolygonPatch"&&o&&e.setAttribute("srsName",o),e.nodeName==="Polygon"||e.nodeName==="PolygonPatch"){const a=t.getLinearRings();ve({node:e,hasZ:s,srsName:o},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,a,i,void 0,this)}else if(e.nodeName==="Surface"){const a=xe(e.namespaceURI,"patches");e.appendChild(a),this.writeSurfacePatches_(a,t,i)}}writeCurveOrLineString(e,t,i){const s=i[i.length-1].srsName;if(e.nodeName!=="LineStringSegment"&&s&&e.setAttribute("srsName",s),e.nodeName==="LineString"||e.nodeName==="LineStringSegment"){const o=xe(e.namespaceURI,"posList");e.appendChild(o),this.writePosList_(o,t,i)}else if(e.nodeName==="Curve"){const o=xe(e.namespaceURI,"segments");e.appendChild(o),this.writeCurveSegments_(o,t,i)}}writeMultiSurfaceOrPolygon(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=r.surface;o&&e.setAttribute("srsName",o);const c=t.getPolygons();ve({node:e,hasZ:s,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,c,i,void 0,this)}writeMultiPoint(e,t,i){const r=i[i.length-1],s=r.srsName,o=r.hasZ;s&&e.setAttribute("srsName",s);const a=t.getPoints();ve({node:e,hasZ:o,srsName:s},this.POINTMEMBER_SERIALIZERS,_t("pointMember"),a,i,void 0,this)}writeMultiCurveOrLineString(e,t,i){const r=i[i.length-1],s=r.hasZ,o=r.srsName,a=r.curve;o&&e.setAttribute("srsName",o);const c=t.getLineStrings();ve({node:e,hasZ:s,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,c,i,void 0,this)}writeRing(e,t,i){const r=xe(e.namespaceURI,"LinearRing");e.appendChild(r),this.writeLinearRing(r,t,i)}writeSurfaceOrPolygonMember(e,t,i){const r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(e.appendChild(r),this.writeSurfaceOrPolygon(r,t,i))}writePointMember(e,t,i){const r=xe(e.namespaceURI,"Point");e.appendChild(r),this.writePoint(r,t,i)}writeLineStringOrCurveMember(e,t,i){const r=this.GEOMETRY_NODE_FACTORY_(t,i);r&&(e.appendChild(r),this.writeCurveOrLineString(r,t,i))}writeSurfacePatches_(e,t,i){const r=xe(e.namespaceURI,"PolygonPatch");e.appendChild(r),this.writeSurfaceOrPolygon(r,t,i)}writeCurveSegments_(e,t,i){const r=xe(e.namespaceURI,"LineStringSegment");e.appendChild(r),this.writeCurveOrLineString(r,t,i)}writeGeometryElement(e,t,i){const r=i[i.length-1],s=J({},r);s.node=e;let o;Array.isArray(t)?o=jh(t,r):o=ct(t,!0,r),ve(s,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[o],i,void 0,this)}writeFeatureElement(e,t,i){const r=t.getId();r&&e.setAttribute("fid",r);const s=i[i.length-1],o=s.featureNS,a=t.getGeometryName();s.serializers||(s.serializers={},s.serializers[o]={});const c=[],l=[];if(t.hasProperties()){const h=t.getProperties();for(const d in h){const f=h[d];f!==null&&(c.push(d),l.push(f),d==a||typeof f.getSimplifiedGeometry=="function"?d in s.serializers[o]||(s.serializers[o][d]=L(this.writeGeometryElement,this)):d in s.serializers[o]||(s.serializers[o][d]=L(ye)))}}const u=J({},s);u.node=e,ve(u,s.serializers,_t(void 0,o),l,i,c)}writeFeatureMembers_(e,t,i){const r=i[i.length-1],s=r.featureType,o=r.featureNS,a={};a[o]={},a[o][s]=L(this.writeFeatureElement,this);const c=J({},r);c.node=e,ve(c,a,_t(s,o),t,i)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(e,t,i){const r=t[t.length-1].node;return xe(this.namespace,lA[r.nodeName])}GEOMETRY_NODE_FACTORY_(e,t,i){const r=t[t.length-1],s=r.multiSurface,o=r.surface,a=r.curve,c=r.multiCurve;let l;return Array.isArray(e)?l="Envelope":(l=e.getType(),l==="MultiPolygon"&&s===!0?l="MultiSurface":l==="Polygon"&&o===!0?l="Surface":l==="LineString"&&a===!0?l="Curve":l==="MultiLineString"&&c===!0&&(l="MultiCurve")),xe(this.namespace,l)}writeGeometryNode(e,t){t=this.adaptOptions(t);const i=xe(this.namespace,"geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return t&&J(r,t),this.writeGeometryElement(i,e,[r]),i}writeFeaturesNode(e,t){t=this.adaptOptions(t);const i=xe(this.namespace,"featureMembers");i.setAttributeNS(ps,"xsi:schemaLocation",this.schemaLocation);const r={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return t&&J(r,t),this.writeFeatureMembers_(i,e,[r]),i}}de.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:ge(de.prototype.readFlatPos),posList:ge(de.prototype.readFlatPosList),coordinates:ge(xo.prototype.readFlatCoordinates)}},de.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:de.prototype.interiorParser,exterior:de.prototype.exteriorParser}},de.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:ge(ke.prototype.readPoint),MultiPoint:ge(ke.prototype.readMultiPoint),LineString:ge(ke.prototype.readLineString),MultiLineString:ge(ke.prototype.readMultiLineString),LinearRing:ge(ke.prototype.readLinearRing),Polygon:ge(ke.prototype.readPolygon),MultiPolygon:ge(ke.prototype.readMultiPolygon),Surface:ge(de.prototype.readSurface),MultiSurface:ge(de.prototype.readMultiSurface),Curve:ge(de.prototype.readCurve),MultiCurve:ge(de.prototype.readMultiCurve),Envelope:ge(de.prototype.readEnvelope)}},de.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:ue(de.prototype.curveMemberParser),curveMembers:ue(de.prototype.curveMemberParser)}},de.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:ue(de.prototype.surfaceMemberParser),surfaceMembers:ue(de.prototype.surfaceMemberParser)}},de.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:ue(ke.prototype.readLineString),Curve:ue(de.prototype.readCurve)}},de.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:ue(ke.prototype.readPolygon),Surface:ue(de.prototype.readSurface)}},de.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:ge(de.prototype.readPatch)}},de.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:ge(de.prototype.readSegment)}},de.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:ue(de.prototype.readFlatPosList),upperCorner:ue(de.prototype.readFlatPosList)}},de.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:ge(de.prototype.readPolygonPatch)}},de.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:ge(de.prototype.readLineStringSegment)}},de.prototype.writeFeatures,de.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:L(de.prototype.writeRing),interior:L(de.prototype.writeRing)}},de.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:L(ye),upperCorner:L(ye)}},de.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:L(de.prototype.writeSurfaceOrPolygonMember),polygonMember:L(de.prototype.writeSurfaceOrPolygonMember)}},de.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:L(de.prototype.writePointMember)}},de.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:L(de.prototype.writeLineStringOrCurveMember),curveMember:L(de.prototype.writeLineStringOrCurveMember)}},de.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:L(de.prototype.writeCurveOrLineString),MultiCurve:L(de.prototype.writeMultiCurveOrLineString),Point:L(de.prototype.writePoint),MultiPoint:L(de.prototype.writeMultiPoint),LineString:L(de.prototype.writeCurveOrLineString),MultiLineString:L(de.prototype.writeMultiCurveOrLineString),LinearRing:L(de.prototype.writeLinearRing),Polygon:L(de.prototype.writeSurfaceOrPolygon),MultiPolygon:L(de.prototype.writeMultiSurfaceOrPolygon),Surface:L(de.prototype.writeSurfaceOrPolygon),MultiSurface:L(de.prototype.writeMultiSurfaceOrPolygon),Envelope:L(de.prototype.writeEnvelope)}};var Ie=de;const tm=Ie;tm.prototype.writeFeatures,tm.prototype.writeFeaturesNode;var cA=tm;class Qe extends Ie{constructor(e){const t=e||{};super(t),this.schemaLocation=t.schemaLocation?t.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}}Qe.prototype.namespace="http://www.opengis.net/gml/3.2",Qe.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:ge(Ie.prototype.readFlatPos),posList:ge(Ie.prototype.readFlatPosList),coordinates:ge(xo.prototype.readFlatCoordinates)}},Qe.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:Ie.prototype.interiorParser,exterior:Ie.prototype.exteriorParser}},Qe.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:ge(ke.prototype.readPoint),MultiPoint:ge(ke.prototype.readMultiPoint),LineString:ge(ke.prototype.readLineString),MultiLineString:ge(ke.prototype.readMultiLineString),LinearRing:ge(ke.prototype.readLinearRing),Polygon:ge(ke.prototype.readPolygon),MultiPolygon:ge(ke.prototype.readMultiPolygon),Surface:ge(Qe.prototype.readSurface),MultiSurface:ge(Ie.prototype.readMultiSurface),Curve:ge(Qe.prototype.readCurve),MultiCurve:ge(Ie.prototype.readMultiCurve),Envelope:ge(Qe.prototype.readEnvelope)}},Qe.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:ue(Ie.prototype.curveMemberParser),curveMembers:ue(Ie.prototype.curveMemberParser)}},Qe.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:ue(Ie.prototype.surfaceMemberParser),surfaceMembers:ue(Ie.prototype.surfaceMemberParser)}},Qe.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:ue(ke.prototype.readLineString),Curve:ue(Ie.prototype.readCurve)}},Qe.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:ue(ke.prototype.readPolygon),Surface:ue(Ie.prototype.readSurface)}},Qe.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:ge(Ie.prototype.readPatch)}},Qe.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:ge(Ie.prototype.readSegment)}},Qe.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:ue(Ie.prototype.readFlatPosList),upperCorner:ue(Ie.prototype.readFlatPosList)}},Qe.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:ge(Ie.prototype.readPolygonPatch)}},Qe.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:ge(Ie.prototype.readLineStringSegment)}},Qe.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:ue(ke.prototype.pointMemberParser),pointMembers:ue(ke.prototype.pointMemberParser)}},Qe.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:ue(ke.prototype.lineStringMemberParser),lineStringMembers:ue(ke.prototype.lineStringMemberParser)}},Qe.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:ue(ke.prototype.polygonMemberParser),polygonMembers:ue(ke.prototype.polygonMemberParser)}},Qe.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:ue(ke.prototype.readFlatCoordinatesFromNode)}},Qe.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:ue(ke.prototype.readLineString)}},Qe.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:ue(ke.prototype.readPolygon)}},Qe.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:ge(ke.prototype.readFlatLinearRing)}},Qe.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:L(Ie.prototype.writeRing),interior:L(Ie.prototype.writeRing)}},Qe.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:L(ye),upperCorner:L(ye)}},Qe.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:L(Ie.prototype.writeSurfaceOrPolygonMember),polygonMember:L(Ie.prototype.writeSurfaceOrPolygonMember)}},Qe.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:L(Ie.prototype.writePointMember)}},Qe.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:L(Ie.prototype.writeLineStringOrCurveMember),curveMember:L(Ie.prototype.writeLineStringOrCurveMember)}},Qe.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:L(Ie.prototype.writeCurveOrLineString),MultiCurve:L(Ie.prototype.writeMultiCurveOrLineString),Point:L(Qe.prototype.writePoint),MultiPoint:L(Ie.prototype.writeMultiPoint),LineString:L(Ie.prototype.writeCurveOrLineString),MultiLineString:L(Ie.prototype.writeMultiCurveOrLineString),LinearRing:L(Ie.prototype.writeLinearRing),Polygon:L(Ie.prototype.writeSurfaceOrPolygon),MultiPolygon:L(Ie.prototype.writeMultiSurfaceOrPolygon),Surface:L(Ie.prototype.writeSurfaceOrPolygon),MultiSurface:L(Ie.prototype.writeMultiSurfaceOrPolygon),Envelope:L(Ie.prototype.writeEnvelope)}};var Hh=Qe;const kt=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],uA="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",hA={rte:Uv,trk:zv,wpt:Bv},dA=j(kt,{rte:ue(Uv),trk:ue(zv),wpt:ue(Bv)}),fA=j(kt,{text:C(Z,"linkText"),type:C(Z,"linkType")}),pA=j(kt,{rte:L(DA),trk:L(GA),wpt:L(zA)});class gA extends yo{constructor(e){super();const t=e||{};this.dataProjection=re("EPSG:4326"),this.readExtensions_=t.readExtensions}handleReadExtensions_(e){e||(e=[]);for(let t=0,i=e.length;t<i;++t){const r=e[t];if(this.readExtensions_){const s=r.get("extensionsNode_")||null;this.readExtensions_(r,s)}r.set("extensionsNode_",void 0)}}readFeatureFromNode(e,t){if(!Ge(kt,e.namespaceURI))return null;const i=hA[e.localName];if(!i)return null;const r=i(e,[this.getReadOptions(e,t)]);return r?(this.handleReadExtensions_([r]),r):null}readFeaturesFromNode(e,t){if(!Ge(kt,e.namespaceURI))return[];if(e.localName=="gpx"){const i=V([],dA,e,[this.getReadOptions(e,t)]);return i?(this.handleReadExtensions_(i),i):[]}return[]}writeFeaturesNode(e,t){t=this.adaptOptions(t);const i=xe("http://www.topografix.com/GPX/1/1","gpx"),r="http://www.w3.org/2000/xmlns/";return i.setAttributeNS(r,"xmlns:xsi",ps),i.setAttributeNS(ps,"xsi:schemaLocation",uA),i.setAttribute("version","1.1"),i.setAttribute("creator","OpenLayers"),ve({node:i},pA,FA,e,[t]),i}}const mA=j(kt,{name:C(Z),cmt:C(Z),desc:C(Z),src:C(Z),link:rm,number:C(Ct),extensions:sm,type:C(Z),rtept:NA}),yA=j(kt,{ele:C(Ve),time:C(Wh)}),_A=j(kt,{name:C(Z),cmt:C(Z),desc:C(Z),src:C(Z),link:rm,number:C(Ct),type:C(Z),extensions:sm,trkseg:$A}),xA=j(kt,{trkpt:kA}),vA=j(kt,{ele:C(Ve),time:C(Wh)}),wA=j(kt,{ele:C(Ve),time:C(Wh),magvar:C(Ve),geoidheight:C(Ve),name:C(Z),cmt:C(Z),desc:C(Z),src:C(Z),link:rm,sym:C(Z),type:C(Z),fix:C(Z),sat:C(Ct),hdop:C(Ve),vdop:C(Ve),pdop:C(Ve),ageofdgpsdata:C(Ve),dgpsid:C(Ct),extensions:sm}),EA=["text","type"],TA=j(kt,{text:L(ye),type:L(ye)}),bA=j(kt,["name","cmt","desc","src","link","number","type","rtept"]),SA=j(kt,{name:L(ye),cmt:L(ye),desc:L(ye),src:L(ye),link:L(om),number:L(Ec),type:L(ye),rtept:Qg(L(am))}),RA=j(kt,["ele","time"]),IA=j(kt,["name","cmt","desc","src","link","number","type","trkseg"]),CA=j(kt,{name:L(ye),cmt:L(ye),desc:L(ye),src:L(ye),link:L(om),number:L(Ec),type:L(ye),trkseg:Qg(L(UA))}),LA=_t("trkpt"),AA=j(kt,{trkpt:L(am)}),PA=j(kt,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),OA=j(kt,{ele:L(Cn),time:L(Gv),magvar:L(Cn),geoidheight:L(Cn),name:L(ye),cmt:L(ye),desc:L(ye),src:L(ye),link:L(om),sym:L(ye),type:L(ye),fix:L(ye),sat:L(Ec),hdop:L(Cn),vdop:L(Cn),pdop:L(Cn),ageofdgpsdata:L(Cn),dgpsid:L(Ec)}),MA={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function FA(n,e,t){const i=n.getGeometry();if(i){const r=MA[i.getType()];if(r){const s=e[e.length-1].node;return xe(s.namespaceURI,r)}}}function nm(n,e,t,i){return n.push(parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))),"ele"in i?(n.push(i.ele),delete i.ele,e.hasZ=!0):n.push(0),"time"in i?(n.push(i.time),delete i.time,e.hasM=!0):n.push(0),n}function im(n,e,t){let i=H.XY,r=2;if(n.hasZ&&n.hasM?(i=H.XYZM,r=4):n.hasZ?(i=H.XYZ,r=3):n.hasM&&(i=H.XYM,r=3),r!==4){for(let s=0,o=e.length/4;s<o;s++)e[s*r]=e[s*4],e[s*r+1]=e[s*4+1],n.hasZ&&(e[s*r+2]=e[s*4+2]),n.hasM&&(e[s*r+2]=e[s*4+3]);if(e.length=e.length/4*r,t)for(let s=0,o=t.length;s<o;s++)t[s]=t[s]/4*r}return i}function rm(n,e){const t=e[e.length-1],i=n.getAttribute("href");i!==null&&(t.link=i),In(fA,n,e)}function sm(n,e){const t=e[e.length-1];t.extensionsNode_=n}function NA(n,e){const t=V({},yA,n,e);if(t){const i=e[e.length-1],r=i.flatCoordinates,s=i.layoutOptions;nm(r,s,n,t)}}function kA(n,e){const t=V({},vA,n,e);if(t){const i=e[e.length-1],r=i.flatCoordinates,s=i.layoutOptions;nm(r,s,n,t)}}function $A(n,e){const t=e[e.length-1];In(xA,n,e);const i=t.flatCoordinates;t.ends.push(i.length)}function Uv(n,e){const t=e[0],i=V({flatCoordinates:[],layoutOptions:{}},mA,n,e);if(!i)return;const r=i.flatCoordinates;delete i.flatCoordinates;const s=i.layoutOptions;delete i.layoutOptions;const o=im(s,r),a=new Tt(r,o);ct(a,!1,t);const c=new it(a);return c.setProperties(i,!0),c}function zv(n,e){const t=e[0],i=V({flatCoordinates:[],ends:[],layoutOptions:{}},_A,n,e);if(!i)return;const r=i.flatCoordinates;delete i.flatCoordinates;const s=i.ends;delete i.ends;const o=i.layoutOptions;delete i.layoutOptions;const a=im(o,r,s),c=new jn(r,a,s);ct(c,!1,t);const l=new it(c);return l.setProperties(i,!0),l}function Bv(n,e){const t=e[0],i=V({},wA,n,e);if(!i)return;const r={},s=nm([],r,n,i),o=im(r,s),a=new ft(s,o);ct(a,!1,t);const c=new it(a);return c.setProperties(i,!0),c}function om(n,e,t){n.setAttribute("href",e);const r=t[t.length-1].properties,s=[r.linkText,r.linkType];ve({node:n},TA,jt,s,t,EA)}function am(n,e,t){const i=t[t.length-1],s=i.node.namespaceURI,o=i.properties;switch(n.setAttributeNS(null,"lat",String(e[1])),n.setAttributeNS(null,"lon",String(e[0])),i.geometryLayout){case H.XYZM:e[3]!==0&&(o.time=e[3]);case H.XYZ:e[2]!==0&&(o.ele=e[2]);break;case H.XYM:e[2]!==0&&(o.time=e[2]);break}const c=n.nodeName=="rtept"?RA[s]:PA[s],l=Rn(o,c);ve({node:n,properties:o},OA,jt,l,t,c)}function DA(n,e,t){const i=t[0],r=e.getProperties(),s={node:n};s.properties=r;const o=e.getGeometry();if(o.getType()==R.LINE_STRING){const u=ct(o,!0,i);s.geometryLayout=u.getLayout(),r.rtept=u.getCoordinates()}const a=t[t.length-1].node,c=bA[a.namespaceURI],l=Rn(r,c);ve(s,SA,jt,l,t,c)}function GA(n,e,t){const i=t[0],r=e.getProperties(),s={node:n};s.properties=r;const o=e.getGeometry();if(o.getType()==R.MULTI_LINE_STRING){const u=ct(o,!0,i);r.trkseg=u.getLineStrings()}const a=t[t.length-1].node,c=IA[a.namespaceURI],l=Rn(r,c);ve(s,CA,jt,l,t,c)}function UA(n,e,t){const i={node:n};i.geometryLayout=e.getLayout(),i.properties={},ve(i,AA,LA,e.getCoordinates(),t)}function zA(n,e,t){const i=t[0],r=t[t.length-1];r.properties=e.getProperties();const s=e.getGeometry();if(s.getType()==R.POINT){const o=ct(s,!0,i);r.geometryLayout=o.getLayout(),am(n,o.getCoordinates(),t)}}var BA=gA;class Mf extends Mp{constructor(e){super(),this.geometries_=e||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(je),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(!!this.geometries_)for(let e=0,t=this.geometries_.length;e<t;++e)this.changeEventsKeys_.push(pe(this.geometries_[e],ne.CHANGE,this.changed,this))}clone(){const e=new Mf(null);return e.setGeometries(this.geometries_),e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<qr(this.getExtent(),e,t))return r;const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)r=s[o].closestPointXY(e,t,i,r);return r}containsXY(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)if(i[r].containsXY(e,t))return!0;return!1}computeExtent(e){Jr(e);const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)up(e,t[i].getExtent());return e}getGeometries(){return jv(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].getType()===this.getType()?e=e.concat(t[i].getGeometriesArrayRecursive()):e.push(t[i]);return e}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=[],i=this.geometries_;let r=!1;for(let s=0,o=i.length;s<o;++s){const a=i[s],c=a.getSimplifiedGeometry(e);t.push(c),c!==a&&(r=!0)}if(r){const s=new Mf(null);return s.setGeometriesArray(t),s}else return this.simplifiedGeometryMaxMinSquaredTolerance=e,this}getType(){return R.GEOMETRY_COLLECTION}intersectsExtent(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)if(t[i].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].rotate(e,t);this.changed()}scale(e,t,i){let r=i;r||(r=Ut(this.getExtent()));const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)s[o].scale(e,t,r);this.changed()}setGeometries(e){this.setGeometriesArray(jv(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].applyTransform(e);this.changed()}translate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function jv(n){const e=[];for(let t=0,i=n.length;t<i;++t)e.push(n[t].clone());return e}var ln=Mf;class jA extends Yh{constructor(e){const t=e||{};super(),this.dataProjection=re(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=re(t.featureProjection)),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let i=null;e.type==="Feature"?i=e:i={type:"Feature",geometry:e,properties:null};const r=lm(i.geometry,t),s=new it;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&s.setGeometryName(i.geometry_name),s.setGeometry(r),"id"in i&&s.setId(i.id),i.properties&&s.setProperties(i.properties,!0),s}readFeaturesFromObject(e,t){const i=e;let r=null;if(i.type==="FeatureCollection"){const s=e;r=[];const o=s.features;for(let a=0,c=o.length;a<c;++a)r.push(this.readFeatureFromObject(o[a],t))}else r=[this.readFeatureFromObject(e,t)];return r}readGeometryFromObject(e,t){return lm(e,t)}readProjectionFromObject(e){const t=e.crs;let i;return t?t.type=="name"?i=re(t.properties.name):t.type==="EPSG"?i=re("EPSG:"+t.properties.code):ce(!1,36):i=this.dataProjection,i}writeFeatureObject(e,t){t=this.adaptOptions(t);const i={type:"Feature",geometry:null,properties:null},r=e.getId();if(r!==void 0&&(i.id=r),!e.hasProperties())return i;const s=e.getProperties(),o=e.getGeometry();return o&&(i.geometry=cm(o,t),delete s[e.getGeometryName()]),xi(s)||(i.properties=s),i}writeFeaturesObject(e,t){t=this.adaptOptions(t);const i=[];for(let r=0,s=e.length;r<s;++r)i.push(this.writeFeatureObject(e[r],t));return{type:"FeatureCollection",features:i}}writeGeometryObject(e,t){return cm(e,this.adaptOptions(t))}}function lm(n,e){if(!n)return null;let t;switch(n.type){case R.POINT:{t=YA(n);break}case R.LINE_STRING:{t=XA(n);break}case R.POLYGON:{t=KA(n);break}case R.MULTI_POINT:{t=WA(n);break}case R.MULTI_LINE_STRING:{t=ZA(n);break}case R.MULTI_POLYGON:{t=HA(n);break}case R.GEOMETRY_COLLECTION:{t=VA(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return ct(t,!1,e)}function VA(n,e){const t=n.geometries.map(function(i){return lm(i,e)});return new ln(t)}function YA(n){return new ft(n.coordinates)}function XA(n){return new Tt(n.coordinates)}function ZA(n){return new jn(n.coordinates)}function WA(n){return new ci(n.coordinates)}function HA(n){return new ui(n.coordinates)}function KA(n){return new Bt(n.coordinates)}function cm(n,e){n=ct(n,!0,e);const t=n.getType();let i;switch(t){case R.POINT:{i=nP(n);break}case R.LINE_STRING:{i=JA(n);break}case R.POLYGON:{i=iP(n,e);break}case R.MULTI_POINT:{i=eP(n);break}case R.MULTI_LINE_STRING:{i=QA(n);break}case R.MULTI_POLYGON:{i=tP(n,e);break}case R.GEOMETRY_COLLECTION:{i=qA(n,e);break}case R.CIRCLE:{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return i}function qA(n,e){const t=n.getGeometriesArray().map(function(i){const r=J({},e);return delete r.featureProjection,cm(i,r)});return{type:"GeometryCollection",geometries:t}}function JA(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function QA(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function eP(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function tP(n,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function nP(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function iP(n,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}var Vv=jA;class rP extends Pa{constructor(){super()}getType(){return Bn.TEXT}readFeature(e,t){return this.readFeatureFromText(Kh(e),this.adaptOptions(t))}readFeatureFromText(e,t){return he()}readFeatures(e,t){return this.readFeaturesFromText(Kh(e),this.adaptOptions(t))}readFeaturesFromText(e,t){return he()}readGeometry(e,t){return this.readGeometryFromText(Kh(e),this.adaptOptions(t))}readGeometryFromText(e,t){return he()}readProjection(e){return this.readProjectionFromText(Kh(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,t){return this.writeFeatureText(e,this.adaptOptions(t))}writeFeatureText(e,t){return he()}writeFeatures(e,t){return this.writeFeaturesText(e,this.adaptOptions(t))}writeFeaturesText(e,t){return he()}writeGeometry(e,t){return this.writeGeometryText(e,this.adaptOptions(t))}writeGeometryText(e,t){return he()}}function Kh(n){return typeof n=="string"?n:""}var qh=rP;const Tc={BAROMETRIC:"barometric",GPS:"gps",NONE:"none"},sP=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,oP=/^H.([A-Z]{3}).*?:(.*)/,aP=/^HFDTE(\d{2})(\d{2})(\d{2})/,lP=/\r\n|\r|\n/;class cP extends qh{constructor(e){super();const t=e||{};this.dataProjection=re("EPSG:4326"),this.altitudeMode_=t.altitudeMode?t.altitudeMode:Tc.NONE}readFeatureFromText(e,t){const i=this.altitudeMode_,r=e.split(lP),s={},o=[];let a=2e3,c=0,l=1,u=-1,h,d;for(h=0,d=r.length;h<d;++h){const g=r[h];let y;if(g.charAt(0)=="B"){if(y=sP.exec(g),y){const _=parseInt(y[1],10),v=parseInt(y[2],10),x=parseInt(y[3],10);let w=parseInt(y[4],10)+parseInt(y[5],10)/6e4;y[6]=="S"&&(w=-w);let E=parseInt(y[7],10)+parseInt(y[8],10)/6e4;if(y[9]=="W"&&(E=-E),o.push(E,w),i!=Tc.NONE){let b;i==Tc.GPS?b=parseInt(y[11],10):i==Tc.BAROMETRIC?b=parseInt(y[12],10):b=0,o.push(b)}let T=Date.UTC(a,c,l,_,v,x);T<u&&(T=Date.UTC(a,c,l+1,_,v,x)),o.push(T/1e3),u=T}}else g.charAt(0)=="H"&&(y=aP.exec(g),y?(l=parseInt(y[1],10),c=parseInt(y[2],10)-1,a=2e3+parseInt(y[3],10)):(y=oP.exec(g),y&&(s[y[1]]=y[2].trim())))}if(o.length===0)return null;const f=i==Tc.NONE?H.XYM:H.XYZM,p=new Tt(o,f),m=new it(ct(p,!1,t));return m.setProperties(s,!0),m}readFeaturesFromText(e,t){const i=this.readFeatureFromText(e,t);return i?[i]:[]}}var uP=cP;const Pt={VERSION1:"version1",VERSION2:"version2",VERSION3:"version3"},vo={};vo[Pt.VERSION1]={level0:{supports:[],formats:[],qualities:["native"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["native"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["native","color","grey","bitonal"]}},vo[Pt.VERSION2]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByDistortedWh","sizeByWh"],formats:["jpg","png"],qualities:["default","bitonal"]}},vo[Pt.VERSION3]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","regionSquare","sizeByW","sizeByH","sizeByWh"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionSquare","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["default"]}},vo.none={none:{supports:[],formats:[],qualities:[]}};const hP=/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,Yv=/^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,dP=/(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;function fP(n){let e=n.getComplianceLevelSupportedFeatures();return e===void 0&&(e=vo[Pt.VERSION1].level0),{url:n.imageInfo["@id"]===void 0?void 0:n.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),supports:e.supports,formats:[...e.formats,n.imageInfo.formats===void 0?[]:n.imageInfo.formats],qualities:[...e.qualities,n.imageInfo.qualities===void 0?[]:n.imageInfo.qualities],resolutions:n.imageInfo.scale_factors,tileSize:n.imageInfo.tile_width!==void 0?n.imageInfo.tile_height!==void 0?[n.imageInfo.tile_width,n.imageInfo.tile_height]:[n.imageInfo.tile_width,n.imageInfo.tile_width]:n.imageInfo.tile_height!=null?[n.imageInfo.tile_height,n.imageInfo.tile_height]:void 0}}function pP(n){const e=n.getComplianceLevelSupportedFeatures(),t=Array.isArray(n.imageInfo.profile)&&n.imageInfo.profile.length>1,i=t&&n.imageInfo.profile[1].supports?n.imageInfo.profile[1].supports:[],r=t&&n.imageInfo.profile[1].formats?n.imageInfo.profile[1].formats:[],s=t&&n.imageInfo.profile[1].qualities?n.imageInfo.profile[1].qualities:[];return{url:n.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:n.imageInfo.sizes===void 0?void 0:n.imageInfo.sizes.map(function(o){return[o.width,o.height]}),tileSize:n.imageInfo.tiles===void 0?void 0:[n.imageInfo.tiles.map(function(o){return o.width})[0],n.imageInfo.tiles.map(function(o){return o.height===void 0?o.width:o.height})[0]],resolutions:n.imageInfo.tiles===void 0?void 0:n.imageInfo.tiles.map(function(o){return o.scaleFactors})[0],supports:[...e.supports,...i],formats:[...e.formats,...r],qualities:[...e.qualities,...s]}}function gP(n){const e=n.getComplianceLevelSupportedFeatures(),t=n.imageInfo.extraFormats===void 0?e.formats:[...e.formats,...n.imageInfo.extraFormats],i=n.imageInfo.preferredFormats!==void 0&&Array.isArray(n.imageInfo.preferredFormats)&&n.imageInfo.preferredFormats.length>0?n.imageInfo.preferredFormats.filter(function(r){return Ge(["jpg","png","gif"],r)}).reduce(function(r,s){return r===void 0&&Ge(t,s)?s:r},void 0):void 0;return{url:n.imageInfo.id,sizes:n.imageInfo.sizes===void 0?void 0:n.imageInfo.sizes.map(function(r){return[r.width,r.height]}),tileSize:n.imageInfo.tiles===void 0?void 0:[n.imageInfo.tiles.map(function(r){return r.width})[0],n.imageInfo.tiles.map(function(r){return r.height})[0]],resolutions:n.imageInfo.tiles===void 0?void 0:n.imageInfo.tiles.map(function(r){return r.scaleFactors})[0],supports:n.imageInfo.extraFeatures===void 0?e.supports:[...e.supports,...n.imageInfo.extraFeatures],formats:t,qualities:n.imageInfo.extraQualities===void 0?e.qualities:[...e.qualities,...n.imageInfo.extraQualities],preferredFormat:i}}const Jh={};Jh[Pt.VERSION1]=fP,Jh[Pt.VERSION2]=pP,Jh[Pt.VERSION3]=gP;class mP{constructor(e){this.setImageInfo(e)}setImageInfo(e){typeof e=="string"?this.imageInfo=JSON.parse(e):this.imageInfo=e}getImageApiVersion(){if(this.imageInfo===void 0)return;let e=this.imageInfo["@context"]||"ol-no-context";typeof e=="string"&&(e=[e]);for(let t=0;t<e.length;t++)switch(e[t]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return Pt.VERSION1;case"http://iiif.io/api/image/2/context.json":return Pt.VERSION2;case"http://iiif.io/api/image/3/context.json":return Pt.VERSION3;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(Pt.VERSION1)&&this.imageInfo.identifier)return Pt.VERSION1;break}ce(!1,61)}getComplianceLevelEntryFromProfile(e){if(!(this.imageInfo===void 0||this.imageInfo.profile===void 0))switch(e===void 0&&(e=this.getImageApiVersion()),e){case Pt.VERSION1:if(hP.test(this.imageInfo.profile))return this.imageInfo.profile;break;case Pt.VERSION3:if(dP.test(this.imageInfo.profile))return this.imageInfo.profile;break;case Pt.VERSION2:if(typeof this.imageInfo.profile=="string"&&Yv.test(this.imageInfo.profile))return this.imageInfo.profile;if(Array.isArray(this.imageInfo.profile)&&this.imageInfo.profile.length>0&&typeof this.imageInfo.profile[0]=="string"&&Yv.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0];break}}getComplianceLevelFromProfile(e){const t=this.getComplianceLevelEntryFromProfile(e);if(t===void 0)return;const i=t.match(/level[0-2](?:\.json)?$/g);return Array.isArray(i)?i[0].replace(".json",""):void 0}getComplianceLevelSupportedFeatures(){if(this.imageInfo===void 0)return;const e=this.getImageApiVersion(),t=this.getComplianceLevelFromProfile(e);return t===void 0?vo.none.none:vo[e][t]}getTileSourceOptions(e){const t=e||{},i=this.getImageApiVersion();if(i===void 0)return;const r=i===void 0?void 0:Jh[i](this);if(r!==void 0)return{url:r.url,version:i,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:t.format!==void 0&&Ge(r.formats,t.format)?t.format:r.preferredFormat!==void 0?r.preferredFormat:"jpg",supports:r.supports,quality:t.quality&&Ge(r.qualities,t.quality)?t.quality:Ge(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort(function(s,o){return o-s}):void 0,tileSize:r.tileSize}}}var yP=mP;const vr=["http://www.google.com/kml/ext/2.2"],fe=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],_P="http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd",Xv={fraction:_n.FRACTION,pixels:_n.PIXELS,insetPixels:_n.PIXELS},xP=j(fe,{ExtendedData:ow,Region:aw,MultiGeometry:C(iw,"geometry"),LineString:C(tw,"geometry"),LinearRing:C(nw,"geometry"),Point:C(rw,"geometry"),Polygon:C(sw,"geometry"),Style:C(mm),StyleMap:aO,address:C(Z),description:C(Z),name:C(Z),open:C(xr),phoneNumber:C(Z),styleUrl:C(Kv),visibility:C(xr)},j(vr,{MultiTrack:C(WP,"geometry"),Track:C(ew,"geometry")})),vP=j(fe,{ExtendedData:ow,Region:aw,Link:xO,address:C(Z),description:C(Z),name:C(Z),open:C(xr),phoneNumber:C(Z),visibility:C(xr)}),wP=j(fe,{href:C(Hv)}),Zv=j(fe,{LatLonAltBox:dO,Lod:pO}),EP=j(fe,["Document","Placemark"]),TP=j(fe,{Document:L(IO),Placemark:L(fw)});let Ma,bc=null;function bP(){return bc}let um,Sc,Rc,Ic,Qh,ed=null;function SP(){return ed}let hm,td=null;function RP(){return td}let dm,ms=null;function IP(){return ms}let fm=null;function CP(){return fm}let nd=null;function LP(){return nd}function id(n){return 32/Math.min(n[0],n[1])}function AP(){Ma=[255,255,255,1],bc=new Vn({color:Ma}),um=[20,2],Sc=_n.PIXELS,Rc=_n.PIXELS,Ic=[64,64],Qh="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",ed=new pc({anchor:um,anchorOrigin:Ft.BOTTOM_LEFT,anchorXUnits:Sc,anchorYUnits:Rc,crossOrigin:"anonymous",rotation:0,scale:id(Ic),size:Ic,src:Qh}),hm="NO_IMAGE",td=new Sn({color:Ma,width:1}),dm=new Sn({color:[51,51,51,1],width:2}),ms=new Sa({font:"bold 16px Helvetica",fill:bc,stroke:dm,scale:.8}),fm=new yn({fill:bc,image:ed,text:ms,stroke:td,zIndex:0}),nd=[fm]}let rd;function PP(n){return n}class OP extends yo{constructor(e){super();const t=e||{};nd||AP(),this.dataProjection=re("EPSG:4326"),this.defaultStyle_=t.defaultStyle?t.defaultStyle:nd,this.extractStyles_=t.extractStyles!==void 0?t.extractStyles:!0,this.writeStyles_=t.writeStyles!==void 0?t.writeStyles:!0,this.sharedStyles_={},this.showPointNames_=t.showPointNames!==void 0?t.showPointNames:!0,this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",this.iconUrlFunction_=t.iconUrlFunction?t.iconUrlFunction:PP,this.supportedMediaTypes=["application/vnd.google-earth.kml+xml"]}readDocumentOrFolder_(e,t){const i=j(fe,{Document:Jg(this.readDocumentOrFolder_,this),Folder:Jg(this.readDocumentOrFolder_,this),Placemark:ue(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),r=V([],i,e,t,this);if(r)return r}readPlacemark_(e,t){const i=V({geometry:null},xP,e,t,this);if(!i)return;const r=new it,s=e.getAttribute("id");s!==null&&r.setId(s);const o=t[0],a=i.geometry;if(a&&ct(a,!1,o),r.setGeometry(a),delete i.geometry,this.extractStyles_){const c=i.Style,l=i.styleUrl,u=FP(c,l,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);r.setStyle(u)}return delete i.Style,r.setProperties(i,!0),r}readSharedStyle_(e,t){const i=e.getAttribute("id");if(i!==null){const r=mm.call(this,e,t);if(r){let s,o=e.baseURI;(!o||o=="about:blank")&&(o=window.location.href),o?s=new URL("#"+i,o).href:s="#"+i,this.sharedStyles_[s]=r}}}readSharedStyleMap_(e,t){const i=e.getAttribute("id");if(i===null)return;const r=Jv.call(this,e,t);if(!r)return;let s,o=e.baseURI;(!o||o=="about:blank")&&(o=window.location.href),o?s=new URL("#"+i,o).href:s="#"+i,this.sharedStyles_[s]=r}readFeatureFromNode(e,t){if(!Ge(fe,e.namespaceURI))return null;const i=this.readPlacemark_(e,[this.getReadOptions(e,t)]);return i||null}readFeaturesFromNode(e,t){if(!Ge(fe,e.namespaceURI))return[];let i;const r=e.localName;if(r=="Document"||r=="Folder")return i=this.readDocumentOrFolder_(e,[this.getReadOptions(e,t)]),i||[];if(r=="Placemark"){const s=this.readPlacemark_(e,[this.getReadOptions(e,t)]);return s?[s]:[]}else if(r=="kml"){i=[];for(let s=e.firstElementChild;s;s=s.nextElementSibling){const o=this.readFeaturesFromNode(s,t);o&&Xe(i,o)}return i}else return[]}readName(e){if(e)if(typeof e=="string"){const t=Li(e);return this.readNameFromDocument(t)}else return Ci(e)?this.readNameFromDocument(e):this.readNameFromNode(e);else return}readNameFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE){const i=this.readNameFromNode(t);if(i)return i}}readNameFromNode(e){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(Ge(fe,t.namespaceURI)&&t.localName=="name")return Z(t);for(let t=e.firstElementChild;t;t=t.nextElementSibling){const i=t.localName;if(Ge(fe,t.namespaceURI)&&(i=="Document"||i=="Folder"||i=="Placemark"||i=="kml")){const r=this.readNameFromNode(t);if(r)return r}}}readNetworkLinks(e){const t=[];if(typeof e=="string"){const i=Li(e);Xe(t,this.readNetworkLinksFromDocument(i))}else Ci(e)?Xe(t,this.readNetworkLinksFromDocument(e)):Xe(t,this.readNetworkLinksFromNode(e));return t}readNetworkLinksFromDocument(e){const t=[];for(let i=e.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&Xe(t,this.readNetworkLinksFromNode(i));return t}readNetworkLinksFromNode(e){const t=[];for(let i=e.firstElementChild;i;i=i.nextElementSibling)if(Ge(fe,i.namespaceURI)&&i.localName=="NetworkLink"){const r=V({},vP,i,[]);t.push(r)}for(let i=e.firstElementChild;i;i=i.nextElementSibling){const r=i.localName;Ge(fe,i.namespaceURI)&&(r=="Document"||r=="Folder"||r=="kml")&&Xe(t,this.readNetworkLinksFromNode(i))}return t}readRegion(e){const t=[];if(typeof e=="string"){const i=Li(e);Xe(t,this.readRegionFromDocument(i))}else Ci(e)?Xe(t,this.readRegionFromDocument(e)):Xe(t,this.readRegionFromNode(e));return t}readRegionFromDocument(e){const t=[];for(let i=e.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&Xe(t,this.readRegionFromNode(i));return t}readRegionFromNode(e){const t=[];for(let i=e.firstElementChild;i;i=i.nextElementSibling)if(Ge(fe,i.namespaceURI)&&i.localName=="Region"){const r=V({},Zv,i,[]);t.push(r)}for(let i=e.firstElementChild;i;i=i.nextElementSibling){const r=i.localName;Ge(fe,i.namespaceURI)&&(r=="Document"||r=="Folder"||r=="kml")&&Xe(t,this.readRegionFromNode(i))}return t}writeFeaturesNode(e,t){t=this.adaptOptions(t);const i=xe(fe[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",vr[0]),i.setAttributeNS(r,"xmlns:xsi",ps),i.setAttributeNS(ps,"xsi:schemaLocation",_P);const s={node:i},o={};e.length>1?o.Document=e:e.length==1&&(o.Placemark=e[0]);const a=EP[i.namespaceURI],c=Rn(o,a);return ve(s,TP,jt,c,[t],a,this),i}}function MP(n,e){const t=[0,0];let i="start";const r=n.getImage();if(r){const a=r.getSize();if(a&&a.length==2){const c=r.getScaleArray(),l=r.getAnchor();t[0]=c[0]*(a[0]-l[0]),t[1]=c[1]*(a[1]/2-l[1]),i="left"}}let s=n.getText();return s?(s=s.clone(),s.setFont(s.getFont()||ms.getFont()),s.setScale(s.getScale()||ms.getScale()),s.setFill(s.getFill()||ms.getFill()),s.setStroke(s.getStroke()||dm)):s=ms.clone(),s.setText(e),s.setOffsetX(t[0]),s.setOffsetY(t[1]),s.setTextAlign(i),new yn({image:r,text:s})}function FP(n,e,t,i,r){return function(s,o){let a=r,c="",l=[];if(a){const h=s.getGeometry();if(h)if(h instanceof ln)l=h.getGeometriesArrayRecursive().filter(function(d){const f=d.getType();return f===R.POINT||f===R.MULTI_POINT}),a=l.length>0;else{const d=h.getType();a=d===R.POINT||d===R.MULTI_POINT}}a&&(c=s.get("name"),a=a&&!!c,a&&c.search(/&[^&]+;/)>-1&&(rd||(rd=document.createElement("textarea")),rd.innerHTML=c,c=rd.value));let u=t;if(n?u=n:e&&(u=Wv(e,t,i)),a){const h=MP(u[0],c);if(l.length>0){h.setGeometry(new ln(l));const d=new yn({geometry:u[0].getGeometry(),image:null,fill:u[0].getFill(),stroke:u[0].getStroke(),text:null});return[h,d].concat(u.slice(1))}return h}return u}}function Wv(n,e,t){return Array.isArray(n)?n:typeof n=="string"?Wv(t[n],e,t):e}function sd(n){const e=xn(n,!1),t=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(t){const i=t[1];return[parseInt(i.substr(6,2),16),parseInt(i.substr(4,2),16),parseInt(i.substr(2,2),16),parseInt(i.substr(0,2),16)/255]}else return}function pm(n){let e=xn(n,!1);const t=[];e=e.replace(/\s*,\s*/g,",");const i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;let r;for(;r=i.exec(e);){const s=parseFloat(r[1]),o=parseFloat(r[2]),a=r[3]?parseFloat(r[3]):0;t.push(s,o,a),e=e.substr(r[0].length)}if(e==="")return t}function Hv(n){const e=xn(n,!1).trim();let t=n.baseURI;return(!t||t=="about:blank")&&(t=window.location.href),t?new URL(e,t).href:e}function Kv(n){const e=xn(n,!1).trim().replace(/^(?!.*#)/,"#");let t=n.baseURI;return(!t||t=="about:blank")&&(t=window.location.href),t?new URL(e,t).href:e}function NP(n){const e=n.getAttribute("xunits"),t=n.getAttribute("yunits");let i;return e!=="insetPixels"?t!=="insetPixels"?i=Ft.BOTTOM_LEFT:i=Ft.TOP_LEFT:t!=="insetPixels"?i=Ft.BOTTOM_RIGHT:i=Ft.TOP_RIGHT,{x:parseFloat(n.getAttribute("x")),xunits:Xv[e],y:parseFloat(n.getAttribute("y")),yunits:Xv[t],origin:i}}function qv(n){return Ve(n)}const kP=j(fe,{Pair:oO});function Jv(n,e){return V(void 0,kP,n,e,this)}const $P=j(fe,{Icon:C(qP),color:C(sd),heading:C(Ve),hotSpot:C(NP),scale:C(qv)});function DP(n,e){const t=V({},$P,n,e);if(!t)return;const i=e[e.length-1],r="Icon"in t?t.Icon:{},s=!("Icon"in t)||Object.keys(r).length>0;let o;const a=r.href;a?o=a:s&&(o=Qh);let c,l,u,h=Ft.BOTTOM_LEFT;const d=t.hotSpot;d?(c=[d.x,d.y],l=d.xunits,u=d.yunits,h=d.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(o)&&(/pushpin/.test(o)?(c=um,l=Sc,u=Rc):/arrow-reverse/.test(o)?(c=[54,42],l=Sc,u=Rc):/paddle/.test(o)&&(c=[32,1],l=Sc,u=Rc));let f;const p=r.x,m=r.y;p!==void 0&&m!==void 0&&(f=[p,m]);let g;const y=r.w,_=r.h;y!==void 0&&_!==void 0&&(g=[y,_]);let v;const x=t.heading;x!==void 0&&(v=zt(x));const w=t.scale,E=t.color;if(s){o==Qh&&(g=Ic);const T=new pc({anchor:c,anchorOrigin:h,anchorXUnits:l,anchorYUnits:u,crossOrigin:this.crossOrigin_,offset:f,offsetOrigin:Ft.BOTTOM_LEFT,rotation:v,scale:w,size:g,src:this.iconUrlFunction_(o),color:E}),b=T.getScaleArray()[0],S=T.getSize();if(S===null){const A=T.getImageState();if(A===me.IDLE||A===me.LOADING){const I=function(){const N=T.getImageState();if(!(N===me.IDLE||N===me.LOADING)){const M=T.getSize();if(M&&M.length==2){const B=id(M);T.setScale(b*B)}T.unlistenImageChange(I)}};T.listenImageChange(I),A===me.IDLE&&T.load()}}else if(S.length==2){const A=id(S);T.setScale(b*A)}i.imageStyle=T}else i.imageStyle=hm}const GP=j(fe,{color:C(sd),scale:C(qv)});function UP(n,e){const t=V({},GP,n,e);if(!t)return;const i=e[e.length-1],r=new Sa({fill:new Vn({color:"color"in t?t.color:Ma}),scale:t.scale});i.textStyle=r}const zP=j(fe,{color:C(sd),width:C(Ve)});function BP(n,e){const t=V({},zP,n,e);if(!t)return;const i=e[e.length-1],r=new Sn({color:"color"in t?t.color:Ma,width:"width"in t?t.width:1});i.strokeStyle=r}const jP=j(fe,{color:C(sd),fill:C(xr),outline:C(xr)});function VP(n,e){const t=V({},jP,n,e);if(!t)return;const i=e[e.length-1],r=new Vn({color:"color"in t?t.color:Ma});i.fillStyle=r;const s=t.fill;s!==void 0&&(i.fill=s);const o=t.outline;o!==void 0&&(i.outline=o)}const YP=j(fe,{coordinates:ge(pm)});function Qv(n,e){return V(null,YP,n,e)}function XP(n,e){const i=e[e.length-1].coordinates,r=xn(n,!1),o=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(o){const a=parseFloat(o[1]),c=parseFloat(o[2]),l=parseFloat(o[3]);i.push([a,c,l])}else i.push([])}const ZP=j(vr,{Track:ue(ew)});function WP(n,e){const t=V([],ZP,n,e);if(!!t)return new jn(t)}const HP=j(fe,{when:vO},j(vr,{coord:XP}));function ew(n,e){const t=V({coordinates:[],whens:[]},HP,n,e);if(!t)return;const i=[],r=t.coordinates,s=t.whens;for(let o=0,a=Math.min(r.length,s.length);o<a;++o)r[o].length==3&&i.push(r[o][0],r[o][1],r[o][2],s[o]);return new Tt(i,H.XYZM)}const KP=j(fe,{href:C(Hv)},j(vr,{x:C(Ve),y:C(Ve),w:C(Ve),h:C(Ve)}));function qP(n,e){const t=V({},KP,n,e);return t||null}const JP=j(fe,{coordinates:ge(pm)});function gm(n,e){return V(null,JP,n,e)}const od=j(fe,{extrude:C(xr),tessellate:C(xr),altitudeMode:C(Z)});function tw(n,e){const t=V({},od,n,e),i=gm(n,e);if(i){const r=new Tt(i,H.XYZ);return r.setProperties(t,!0),r}else return}function nw(n,e){const t=V({},od,n,e),i=gm(n,e);if(i){const r=new Bt(i,H.XYZ,[i.length]);return r.setProperties(t,!0),r}else return}const QP=j(fe,{LineString:ue(tw),LinearRing:ue(nw),MultiGeometry:ue(iw),Point:ue(rw),Polygon:ue(sw)});function iw(n,e){const t=V([],QP,n,e);if(!t)return null;if(t.length===0)return new ln(t);let i,r=!0;const s=t[0].getType();let o;for(let a=1,c=t.length;a<c;++a)if(o=t[a],o.getType()!=s){r=!1;break}if(r){let a,c;if(s==R.POINT){const l=t[0];a=l.getLayout(),c=l.getFlatCoordinates();for(let u=1,h=t.length;u<h;++u)o=t[u],Xe(c,o.getFlatCoordinates());i=new ci(c,a),ym(i,t)}else s==R.LINE_STRING?(i=new jn(t),ym(i,t)):s==R.POLYGON?(i=new ui(t),ym(i,t)):s==R.GEOMETRY_COLLECTION?i=new ln(t):ce(!1,37)}else i=new ln(t);return i}function rw(n,e){const t=V({},od,n,e),i=gm(n,e);if(i){const r=new ft(i,H.XYZ);return r.setProperties(t,!0),r}else return}const eO=j(fe,{innerBoundaryIs:mO,outerBoundaryIs:_O});function sw(n,e){const t=V({},od,n,e),i=V([null],eO,n,e);if(i&&i[0]){const r=i[0],s=[r.length];for(let a=1,c=i.length;a<c;++a)Xe(r,i[a]),s.push(r.length);const o=new Bt(r,H.XYZ,s);return o.setProperties(t,!0),o}else return}const tO=j(fe,{IconStyle:DP,LabelStyle:UP,LineStyle:BP,PolyStyle:VP});function mm(n,e){const t=V({},tO,n,e,this);if(!t)return null;let i="fillStyle"in t?t.fillStyle:bc;const r=t.fill;r!==void 0&&!r&&(i=null);let s;"imageStyle"in t?t.imageStyle!=hm&&(s=t.imageStyle):s=ed;const o="textStyle"in t?t.textStyle:ms,a="strokeStyle"in t?t.strokeStyle:td,c=t.outline;return c!==void 0&&!c?[new yn({geometry:function(l){const u=l.getGeometry(),h=u.getType();if(h===R.GEOMETRY_COLLECTION){const d=u;return new ln(d.getGeometriesArrayRecursive().filter(function(f){const p=f.getType();return p!==R.POLYGON&&p!==R.MULTI_POLYGON}))}else if(h!==R.POLYGON&&h!==R.MULTI_POLYGON)return u},fill:i,image:s,stroke:a,text:o,zIndex:void 0}),new yn({geometry:function(l){const u=l.getGeometry(),h=u.getType();if(h===R.GEOMETRY_COLLECTION){const d=u;return new ln(d.getGeometriesArrayRecursive().filter(function(f){const p=f.getType();return p===R.POLYGON||p===R.MULTI_POLYGON}))}else if(h===R.POLYGON||h===R.MULTI_POLYGON)return u},fill:i,stroke:null,zIndex:void 0})]:[new yn({fill:i,image:s,stroke:a,text:o,zIndex:void 0})]}function ym(n,e){const t=e.length,i=new Array(e.length),r=new Array(e.length),s=new Array(e.length);let o,a,c;o=!1,a=!1,c=!1;for(let l=0;l<t;++l){const u=e[l];i[l]=u.get("extrude"),r[l]=u.get("tessellate"),s[l]=u.get("altitudeMode"),o=o||i[l]!==void 0,a=a||r[l]!==void 0,c=c||s[l]}o&&n.set("extrude",i),a&&n.set("tessellate",r),c&&n.set("altitudeMode",s)}const nO=j(fe,{displayName:C(Z),value:C(Z)});function iO(n,e){const t=n.getAttribute("name");In(nO,n,e);const i=e[e.length-1];t&&i.displayName?i[t]={value:i.value,displayName:i.displayName,toString:function(){return i.value}}:t!==null?i[t]=i.value:i.displayName!==null&&(i[i.displayName]=i.value),delete i.value}const rO=j(fe,{Data:iO,SchemaData:cO});function ow(n,e){In(rO,n,e)}function aw(n,e){In(Zv,n,e)}const sO=j(fe,{Style:C(mm),key:C(Z),styleUrl:C(Kv)});function oO(n,e){const t=V({},sO,n,e,this);if(!t)return;const i=t.key;if(i&&i=="normal"){const r=t.styleUrl;r&&(e[e.length-1]=r);const s=t.Style;s&&(e[e.length-1]=s)}}function aO(n,e){const t=Jv.call(this,n,e);if(!t)return;const i=e[e.length-1];Array.isArray(t)?i.Style=t:typeof t=="string"?i.styleUrl=t:ce(!1,38)}const lO=j(fe,{SimpleData:uO});function cO(n,e){In(lO,n,e)}function uO(n,e){const t=n.getAttribute("name");if(t!==null){const i=Z(n),r=e[e.length-1];r[t]=i}}const hO=j(fe,{altitudeMode:C(Z),minAltitude:C(Ve),maxAltitude:C(Ve),north:C(Ve),south:C(Ve),east:C(Ve),west:C(Ve)});function dO(n,e){const t=V({},hO,n,e);if(!t)return;const i=e[e.length-1],r=[parseFloat(t.west),parseFloat(t.south),parseFloat(t.east),parseFloat(t.north)];i.extent=r,i.altitudeMode=t.altitudeMode,i.minAltitude=parseFloat(t.minAltitude),i.maxAltitude=parseFloat(t.maxAltitude)}const fO=j(fe,{minLodPixels:C(Ve),maxLodPixels:C(Ve),minFadeExtent:C(Ve),maxFadeExtent:C(Ve)});function pO(n,e){const t=V({},fO,n,e);if(!t)return;const i=e[e.length-1];i.minLodPixels=parseFloat(t.minLodPixels),i.maxLodPixels=parseFloat(t.maxLodPixels),i.minFadeExtent=parseFloat(t.minFadeExtent),i.maxFadeExtent=parseFloat(t.maxFadeExtent)}const gO=j(fe,{LinearRing:ue(Qv)});function mO(n,e){const t=V([],gO,n,e);t.length>0&&e[e.length-1].push(...t)}const yO=j(fe,{LinearRing:ge(Qv)});function _O(n,e){const t=V(void 0,yO,n,e);if(t){const i=e[e.length-1];i[0]=t}}function xO(n,e){In(wP,n,e)}function vO(n,e){const i=e[e.length-1].whens,r=xn(n,!1),s=Date.parse(r);i.push(isNaN(s)?0:s)}function ad(n,e){const t=so(e),r=[(t.length==4?t[3]:1)*255,t[2],t[1],t[0]];for(let s=0;s<4;++s){const o=Math.floor(r[s]).toString(16);r[s]=o.length==1?"0"+o:o}ye(n,r.join(""))}function wO(n,e,t){const i=t[t.length-1],r=i.layout,s=i.stride;let o;r==H.XY||r==H.XYM?o=2:r==H.XYZ||r==H.XYZM?o=3:ce(!1,34);const a=e.length;let c="";if(a>0){c+=e[0];for(let l=1;l<o;++l)c+=","+e[l];for(let l=s;l<a;l+=s){c+=" "+e[l];for(let u=1;u<o;++u)c+=","+e[l+u]}}ye(n,c)}const ld=j(fe,{Data:L(EO),value:L(bO),displayName:L(TO)});function EO(n,e,t){n.setAttribute("name",e.name);const i={node:n},r=e.value;typeof r=="object"?(r!==null&&r.displayName&&ve(i,ld,jt,[r.displayName],t,["displayName"]),r!==null&&r.value&&ve(i,ld,jt,[r.value],t,["value"])):ve(i,ld,jt,[r],t,["value"])}function TO(n,e){Dv(n,e)}function bO(n,e){ye(n,e)}const SO=j(fe,{Placemark:L(fw)}),RO=function(n,e,t){const i=e[e.length-1].node;return xe(i.namespaceURI,"Placemark")};function IO(n,e,t){ve({node:n},SO,RO,e,t,void 0,this)}const CO=_t("Data");function LO(n,e,t){const i={node:n},r=e.names,s=e.values,o=r.length;for(let a=0;a<o;a++)ve(i,ld,CO,[{name:r[a],value:s[a]}],t)}const lw=j(fe,["href"],j(vr,["x","y","w","h"])),cw=j(fe,{href:L(ye)},j(vr,{x:L(Cn),y:L(Cn),w:L(Cn),h:L(Cn)})),AO=function(n,e,t){return xe(vr[0],"gx:"+t)};function PO(n,e,t){const i={node:n},r=t[t.length-1].node;let s=lw[r.namespaceURI],o=Rn(e,s);ve(i,cw,jt,o,t,s),s=lw[vr[0]],o=Rn(e,s),ve(i,cw,AO,o,t,s)}const OO=j(fe,["scale","heading","Icon","color","hotSpot"]),MO=j(fe,{Icon:L(PO),color:L(ad),heading:L(Cn),hotSpot:L(oM),scale:L(mw)});function FO(n,e,t){const i={node:n},r={},s=e.getSrc(),o=e.getSize(),a=e.getImageSize(),c={href:s};if(o){c.w=o[0],c.h=o[1];const g=e.getAnchor(),y=e.getOrigin();if(y&&a&&y[0]!==0&&y[1]!==o[1]&&(c.x=y[0],c.y=a[1]-(y[1]+o[1])),g&&(g[0]!==o[0]/2||g[1]!==o[1]/2)){const _={x:g[0],xunits:_n.PIXELS,y:o[1]-g[1],yunits:_n.PIXELS};r.hotSpot=_}}r.Icon=c;let l=e.getScaleArray()[0],u=o;if(u===null&&(u=Ic),u.length==2){const g=id(u);l=l/g}l!==1&&(r.scale=l);const h=e.getRotation();h!==0&&(r.heading=h);const d=e.getColor();d&&(r.color=d);const f=t[t.length-1].node,p=OO[f.namespaceURI],m=Rn(r,p);ve(i,MO,jt,m,t,p)}const NO=j(fe,["color","scale"]),kO=j(fe,{color:L(ad),scale:L(mw)});function $O(n,e,t){const i={node:n},r={},s=e.getFill();s&&(r.color=s.getColor());const o=e.getScale();o&&o!==1&&(r.scale=o);const a=t[t.length-1].node,c=NO[a.namespaceURI],l=Rn(r,c);ve(i,kO,jt,l,t,c)}const DO=j(fe,["color","width"]),GO=j(fe,{color:L(ad),width:L(Cn)});function UO(n,e,t){const i={node:n},r={color:e.getColor(),width:Number(e.getWidth())||1},s=t[t.length-1].node,o=DO[s.namespaceURI],a=Rn(r,o);ve(i,GO,jt,a,t,o)}const zO={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},uw=function(n,e,t){if(n){const i=e[e.length-1].node;return xe(i.namespaceURI,zO[n.getType()])}},BO=_t("Point"),jO=_t("LineString"),VO=_t("LinearRing"),YO=_t("Polygon"),XO=j(fe,{LineString:L(Fa),Point:L(Fa),Polygon:L(gw),GeometryCollection:L(hw)});function hw(n,e,t){const i={node:n},r=e.getType();let s=[],o;r===R.GEOMETRY_COLLECTION?(e.getGeometriesArrayRecursive().forEach(function(a){const c=a.getType();c===R.MULTI_POINT?s=s.concat(a.getPoints()):c===R.MULTI_LINE_STRING?s=s.concat(a.getLineStrings()):c===R.MULTI_POLYGON?s=s.concat(a.getPolygons()):c===R.POINT||c===R.LINE_STRING||c===R.POLYGON?s.push(a):ce(!1,39)}),o=uw):r===R.MULTI_POINT?(s=e.getPoints(),o=BO):r===R.MULTI_LINE_STRING?(s=e.getLineStrings(),o=jO):r===R.MULTI_POLYGON?(s=e.getPolygons(),o=YO):ce(!1,39),ve(i,XO,o,s,t)}const ZO=j(fe,{LinearRing:L(Fa)});function dw(n,e,t){ve({node:n},ZO,VO,[e],t)}const _m=j(fe,{ExtendedData:L(LO),MultiGeometry:L(hw),LineString:L(Fa),LinearRing:L(Fa),Point:L(Fa),Polygon:L(gw),Style:L(sM),address:L(ye),description:L(ye),name:L(ye),open:L(_o),phoneNumber:L(ye),styleUrl:L(ye),visibility:L(_o)}),WO=j(fe,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),HO=_t("ExtendedData");function fw(n,e,t){const i={node:n};e.getId()&&n.setAttribute("id",e.getId());const r=e.getProperties(),s={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};s[e.getGeometryName()]=1;const o=Object.keys(r||{}).sort().filter(function(f){return!s[f]}),a=e.getStyleFunction();if(a){const f=a(e,0);if(f){const p=Array.isArray(f)?f:[f];let m=p;if(e.getGeometry()&&(m=p.filter(function(g){const y=g.getGeometryFunction()(e);if(y){const _=y.getType();return _===R.GEOMETRY_COLLECTION?y.getGeometriesArrayRecursive().filter(function(v){const x=v.getType();return x===R.POINT||x===R.MULTI_POINT}).length:_===R.POINT||_===R.MULTI_POINT}})),this.writeStyles_){let g=p,y=p;e.getGeometry()&&(g=p.filter(function(_){const v=_.getGeometryFunction()(e);if(v){const x=v.getType();return x===R.GEOMETRY_COLLECTION?v.getGeometriesArrayRecursive().filter(function(w){const E=w.getType();return E===R.LINE_STRING||E===R.MULTI_LINE_STRING}).length:x===R.LINE_STRING||x===R.MULTI_LINE_STRING}}),y=p.filter(function(_){const v=_.getGeometryFunction()(e);if(v){const x=v.getType();return x===R.GEOMETRY_COLLECTION?v.getGeometriesArrayRecursive().filter(function(w){const E=w.getType();return E===R.POLYGON||E===R.MULTI_POLYGON}).length:x===R.POLYGON||x===R.MULTI_POLYGON}})),r.Style={pointStyles:m,lineStyles:g,polyStyles:y}}if(m.length&&r.name===void 0){const g=m[0].getText();g&&(r.name=g.getText())}}}const c=t[t.length-1].node,l=WO[c.namespaceURI],u=Rn(r,l);if(ve(i,_m,jt,u,t,l),o.length>0){const f=Rn(r,o);ve(i,_m,HO,[{names:o,values:f}],t)}const h=t[0];let d=e.getGeometry();d&&(d=ct(d,!0,h)),ve(i,_m,uw,[d],t)}const KO=j(fe,["extrude","tessellate","altitudeMode","coordinates"]),qO=j(fe,{extrude:L(_o),tessellate:L(_o),altitudeMode:L(ye),coordinates:L(wO)});function Fa(n,e,t){const i=e.getFlatCoordinates(),r={node:n};r.layout=e.getLayout(),r.stride=e.getStride();const s=e.getProperties();s.coordinates=i;const o=t[t.length-1].node,a=KO[o.namespaceURI],c=Rn(s,a);ve(r,qO,jt,c,t,a)}const JO=j(fe,["color","fill","outline"]),pw=j(fe,{outerBoundaryIs:L(dw),innerBoundaryIs:L(dw)}),QO=_t("innerBoundaryIs"),eM=_t("outerBoundaryIs");function gw(n,e,t){const i=e.getLinearRings(),r=i.shift(),s={node:n};ve(s,pw,QO,i,t),ve(s,pw,eM,[r],t)}const tM=j(fe,{color:L(ad),fill:L(_o),outline:L(_o)});function nM(n,e,t){const i={node:n},r=e.getFill(),s=e.getStroke(),o={color:r?r.getColor():void 0,fill:r?void 0:!1,outline:s?void 0:!1},a=t[t.length-1].node,c=JO[a.namespaceURI],l=Rn(o,c);ve(i,tM,jt,l,t,c)}function mw(n,e){Cn(n,Math.round(e*1e6)/1e6)}const iM=j(fe,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),rM=j(fe,{IconStyle:L(FO),LabelStyle:L($O),LineStyle:L(UO),PolyStyle:L(nM)});function sM(n,e,t){const i={node:n},r={};if(e.pointStyles.length){const c=e.pointStyles[0].getText();c&&(r.LabelStyle=c);const l=e.pointStyles[0].getImage();l&&typeof l.getSrc=="function"&&(r.IconStyle=l)}if(e.lineStyles.length){const c=e.lineStyles[0].getStroke();c&&(r.LineStyle=c)}if(e.polyStyles.length){const c=e.polyStyles[0].getStroke();c&&!r.LineStyle&&(r.LineStyle=c),r.PolyStyle=e.polyStyles[0]}const s=t[t.length-1].node,o=iM[s.namespaceURI],a=Rn(r,o);ve(i,rM,jt,a,t,o)}function oM(n,e){n.setAttribute("x",String(e.x)),n.setAttribute("y",String(e.y)),n.setAttribute("xunits",e.xunits),n.setAttribute("yunits",e.yunits)}var aM=OP,lM=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},xm={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */xm.read=function(n,e,t,i,r){var s,o,a=r*8-i-1,c=(1<<a)-1,l=c>>1,u=-7,h=t?r-1:0,d=t?-1:1,f=n[e+h];for(h+=d,s=f&(1<<-u)-1,f>>=-u,u+=a;u>0;s=s*256+n[e+h],h+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=o*256+n[e+h],h+=d,u-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-l}return(f?-1:1)*o*Math.pow(2,s-i)},xm.write=function(n,e,t,i,r,s){var o,a,c,l=s*8-r-1,u=(1<<l)-1,h=u>>1,d=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:s-1,p=i?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+h>=1?e+=d/c:e+=d*Math.pow(2,1-h),e*c>=2&&(o++,c/=2),o+h>=u?(a=0,o=u):o+h>=1?(a=(e*c-1)*Math.pow(2,r),o=o+h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;n[t+f]=a&255,f+=p,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;n[t+f]=o&255,f+=p,o/=256,l-=8);n[t+f-p]|=m*128};var cM=et,cd=xm;function et(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0),this.pos=0,this.type=0,this.length=this.buf.length}et.Varint=0,et.Fixed64=1,et.Bytes=2,et.Fixed32=5;var vm=(1<<16)*(1<<16),yw=1/vm,uM=12,_w=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");et.prototype={destroy:function(){this.buf=null},readFields:function(n,e,t){for(t=t||this.length;this.pos<t;){var i=this.readVarint(),r=i>>3,s=this.pos;this.type=i&7,n(r,e,this),this.pos===s&&this.skip(i)}return e},readMessage:function(n,e){return this.readFields(n,e,this.readVarint()+this.pos)},readFixed32:function(){var n=ud(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=vw(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=ud(this.buf,this.pos)+ud(this.buf,this.pos+4)*vm;return this.pos+=8,n},readSFixed64:function(){var n=ud(this.buf,this.pos)+vw(this.buf,this.pos+4)*vm;return this.pos+=8,n},readFloat:function(){var n=cd.read(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=cd.read(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var e=this.buf,t,i;return i=e[this.pos++],t=i&127,i<128||(i=e[this.pos++],t|=(i&127)<<7,i<128)||(i=e[this.pos++],t|=(i&127)<<14,i<128)||(i=e[this.pos++],t|=(i&127)<<21,i<128)?t:(i=e[this.pos],t|=(i&15)<<28,hM(t,n,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2===1?(n+1)/-2:n/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=uM&&_w?SM(this.buf,e,n):bM(this.buf,e,n)},readBytes:function(){var n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e},readPackedVarint:function(n,e){if(this.type!==et.Bytes)return n.push(this.readVarint(e));var t=wr(this);for(n=n||[];this.pos<t;)n.push(this.readVarint(e));return n},readPackedSVarint:function(n){if(this.type!==et.Bytes)return n.push(this.readSVarint());var e=wr(this);for(n=n||[];this.pos<e;)n.push(this.readSVarint());return n},readPackedBoolean:function(n){if(this.type!==et.Bytes)return n.push(this.readBoolean());var e=wr(this);for(n=n||[];this.pos<e;)n.push(this.readBoolean());return n},readPackedFloat:function(n){if(this.type!==et.Bytes)return n.push(this.readFloat());var e=wr(this);for(n=n||[];this.pos<e;)n.push(this.readFloat());return n},readPackedDouble:function(n){if(this.type!==et.Bytes)return n.push(this.readDouble());var e=wr(this);for(n=n||[];this.pos<e;)n.push(this.readDouble());return n},readPackedFixed32:function(n){if(this.type!==et.Bytes)return n.push(this.readFixed32());var e=wr(this);for(n=n||[];this.pos<e;)n.push(this.readFixed32());return n},readPackedSFixed32:function(n){if(this.type!==et.Bytes)return n.push(this.readSFixed32());var e=wr(this);for(n=n||[];this.pos<e;)n.push(this.readSFixed32());return n},readPackedFixed64:function(n){if(this.type!==et.Bytes)return n.push(this.readFixed64());var e=wr(this);for(n=n||[];this.pos<e;)n.push(this.readFixed64());return n},readPackedSFixed64:function(n){if(this.type!==et.Bytes)return n.push(this.readSFixed64());var e=wr(this);for(n=n||[];this.pos<e;)n.push(this.readSFixed64());return n},skip:function(n){var e=n&7;if(e===et.Varint)for(;this.buf[this.pos++]>127;);else if(e===et.Bytes)this.pos=this.readVarint()+this.pos;else if(e===et.Fixed32)this.pos+=4;else if(e===et.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(n,e){this.writeVarint(n<<3|e)},realloc:function(n){for(var e=this.length||16;e<this.pos+n;)e*=2;if(e!==this.length){var t=new Uint8Array(e);t.set(this.buf),this.buf=t,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(n){this.realloc(4),ka(this.buf,n,this.pos),this.pos+=4},writeSFixed32:function(n){this.realloc(4),ka(this.buf,n,this.pos),this.pos+=4},writeFixed64:function(n){this.realloc(8),ka(this.buf,n&-1,this.pos),ka(this.buf,Math.floor(n*yw),this.pos+4),this.pos+=8},writeSFixed64:function(n){this.realloc(8),ka(this.buf,n&-1,this.pos),ka(this.buf,Math.floor(n*yw),this.pos+4),this.pos+=8},writeVarint:function(n){if(n=+n||0,n>268435455||n<0){dM(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))},writeSVarint:function(n){this.writeVarint(n<0?-n*2-1:n*2)},writeBoolean:function(n){this.writeVarint(Boolean(n))},writeString:function(n){n=String(n),this.realloc(n.length*4),this.pos++;var e=this.pos;this.pos=RM(this.buf,n,this.pos);var t=this.pos-e;t>=128&&xw(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},writeFloat:function(n){this.realloc(4),cd.write(this.buf,n,this.pos,!0,23,4),this.pos+=4},writeDouble:function(n){this.realloc(8),cd.write(this.buf,n,this.pos,!0,52,8),this.pos+=8},writeBytes:function(n){var e=n.length;this.writeVarint(e),this.realloc(e);for(var t=0;t<e;t++)this.buf[this.pos++]=n[t]},writeRawMessage:function(n,e){this.pos++;var t=this.pos;n(e,this);var i=this.pos-t;i>=128&&xw(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeMessage:function(n,e,t){this.writeTag(n,et.Bytes),this.writeRawMessage(e,t)},writePackedVarint:function(n,e){e.length&&this.writeMessage(n,gM,e)},writePackedSVarint:function(n,e){e.length&&this.writeMessage(n,mM,e)},writePackedBoolean:function(n,e){e.length&&this.writeMessage(n,xM,e)},writePackedFloat:function(n,e){e.length&&this.writeMessage(n,yM,e)},writePackedDouble:function(n,e){e.length&&this.writeMessage(n,_M,e)},writePackedFixed32:function(n,e){e.length&&this.writeMessage(n,vM,e)},writePackedSFixed32:function(n,e){e.length&&this.writeMessage(n,wM,e)},writePackedFixed64:function(n,e){e.length&&this.writeMessage(n,EM,e)},writePackedSFixed64:function(n,e){e.length&&this.writeMessage(n,TM,e)},writeBytesField:function(n,e){this.writeTag(n,et.Bytes),this.writeBytes(e)},writeFixed32Field:function(n,e){this.writeTag(n,et.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(n,e){this.writeTag(n,et.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(n,e){this.writeTag(n,et.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(n,e){this.writeTag(n,et.Fixed64),this.writeSFixed64(e)},writeVarintField:function(n,e){this.writeTag(n,et.Varint),this.writeVarint(e)},writeSVarintField:function(n,e){this.writeTag(n,et.Varint),this.writeSVarint(e)},writeStringField:function(n,e){this.writeTag(n,et.Bytes),this.writeString(e)},writeFloatField:function(n,e){this.writeTag(n,et.Fixed32),this.writeFloat(e)},writeDoubleField:function(n,e){this.writeTag(n,et.Fixed64),this.writeDouble(e)},writeBooleanField:function(n,e){this.writeVarintField(n,Boolean(e))}};function hM(n,e,t){var i=t.buf,r,s;if(s=i[t.pos++],r=(s&112)>>4,s<128||(s=i[t.pos++],r|=(s&127)<<3,s<128)||(s=i[t.pos++],r|=(s&127)<<10,s<128)||(s=i[t.pos++],r|=(s&127)<<17,s<128)||(s=i[t.pos++],r|=(s&127)<<24,s<128)||(s=i[t.pos++],r|=(s&1)<<31,s<128))return Na(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function wr(n){return n.type===et.Bytes?n.readVarint()+n.pos:n.pos+1}function Na(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function dM(n,e){var t,i;if(n>=0?(t=n%4294967296|0,i=n/4294967296|0):(t=~(-n%4294967296),i=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,i=i+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),fM(t,i,e),pM(i,e)}function fM(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127}function pM(n,e){var t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))))}function xw(n,e,t){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(i);for(var r=t.pos-1;r>=n;r--)t.buf[r+i]=t.buf[r]}function gM(n,e){for(var t=0;t<n.length;t++)e.writeVarint(n[t])}function mM(n,e){for(var t=0;t<n.length;t++)e.writeSVarint(n[t])}function yM(n,e){for(var t=0;t<n.length;t++)e.writeFloat(n[t])}function _M(n,e){for(var t=0;t<n.length;t++)e.writeDouble(n[t])}function xM(n,e){for(var t=0;t<n.length;t++)e.writeBoolean(n[t])}function vM(n,e){for(var t=0;t<n.length;t++)e.writeFixed32(n[t])}function wM(n,e){for(var t=0;t<n.length;t++)e.writeSFixed32(n[t])}function EM(n,e){for(var t=0;t<n.length;t++)e.writeFixed64(n[t])}function TM(n,e){for(var t=0;t<n.length;t++)e.writeSFixed64(n[t])}function ud(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+n[e+3]*16777216}function ka(n,e,t){n[t]=e,n[t+1]=e>>>8,n[t+2]=e>>>16,n[t+3]=e>>>24}function vw(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16)+(n[e+3]<<24)}function bM(n,e,t){for(var i="",r=e;r<t;){var s=n[r],o=null,a=s>239?4:s>223?3:s>191?2:1;if(r+a>t)break;var c,l,u;a===1?s<128&&(o=s):a===2?(c=n[r+1],(c&192)===128&&(o=(s&31)<<6|c&63,o<=127&&(o=null))):a===3?(c=n[r+1],l=n[r+2],(c&192)===128&&(l&192)===128&&(o=(s&15)<<12|(c&63)<<6|l&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):a===4&&(c=n[r+1],l=n[r+2],u=n[r+3],(c&192)===128&&(l&192)===128&&(u&192)===128&&(o=(s&15)<<18|(c&63)<<12|(l&63)<<6|u&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,a=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),r+=a}return i}function SM(n,e,t){return _w.decode(n.subarray(e,t))}function RM(n,e,t){for(var i=0,r,s;i<e.length;i++){if(r=e.charCodeAt(i),r>55295&&r<57344)if(s)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,s=r;continue}else r=s-55296<<10|r-56320|65536,s=null;else{r>56319||i+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):s=r;continue}else s&&(n[t++]=239,n[t++]=191,n[t++]=189,s=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128)}return t}const ww=dt();class Cc{constructor(e,t,i,r,s){this.styleFunction,this.extent_,this.id_=s,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_===R.POINT?Ys(this.flatCoordinates_):ju(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=Ut(this.getExtent());this.flatInteriorPoints_=uh(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=Cg(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Dp(this.flatCoordinates_,0,this.ends_,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=ic(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let t=0;const i=this.ends_;for(let r=0,s=i.length;r<s;++r){const o=i[r],a=ic(e,t,o,2,.5);Xe(this.flatMidpoints_,a),t=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getStride(){return 2}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=re(e);const t=e.getExtent(),i=e.getWorldExtent();if(t&&i){const r=ot(i)/ot(t);Ht(ww,i[0],i[3],r,-r,0,0,0),fr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,ww,this.flatCoordinates_)}}getEnds(){return this.ends_}}Cc.prototype.getEndss=Cc.prototype.getEnds,Cc.prototype.getFlatCoordinates=Cc.prototype.getOrientedFlatCoordinates;function Ew(n){const e=n.getType();switch(e){case R.POINT:return new ft(n.getFlatCoordinates());case R.MULTI_POINT:return new ci(n.getFlatCoordinates(),H.XY);case R.LINE_STRING:return new Tt(n.getFlatCoordinates(),H.XY);case R.MULTI_LINE_STRING:return new jn(n.getFlatCoordinates(),H.XY,n.getEnds());case R.POLYGON:const t=n.getFlatCoordinates(),i=n.getEnds(),r=jp(t,i);return r.length>1?new ui(t,H.XY,r):new Bt(t,H.XY,i);default:throw new Error("Invalid geometry type:"+e)}}function IM(n,e){const t=n.getId(),i=Ew(n),r=n.getProperties(),s=new it;return e!==void 0&&s.setGeometryName(e),s.setGeometry(i),t!==void 0&&s.setId(t),s.setProperties(r,!0),s}var hd=Cc;class CM extends Pa{constructor(e){super();const t=e||{};this.dataProjection=new qs({code:"",units:gn.TILE_PIXELS}),this.featureClass_=t.featureClass?t.featureClass:hd,this.geometryName_=t.geometryName,this.layerName_=t.layerName?t.layerName:"layer",this.layers_=t.layers?t.layers:null,this.idProperty_=t.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,i,r){e.pos=t.geometry;const s=e.readVarint()+e.pos;let o=1,a=0,c=0,l=0,u=0,h=0;for(;e.pos<s;){if(!a){const d=e.readVarint();o=d&7,a=d>>3}a--,o===1||o===2?(c+=e.readSVarint(),l+=e.readSVarint(),o===1&&u>h&&(r.push(u),h=u),i.push(c,l),u+=2):o===7?u>h&&(i.push(i[h],i[h+1]),u+=2):ce(!1,59)}u>h&&(r.push(u),h=u)}createFeature_(e,t,i){const r=t.type;if(r===0)return null;let s;const o=t.properties;let a;this.idProperty_?(a=o[this.idProperty_],delete o[this.idProperty_]):a=t.id,o[this.layerName_]=t.layer.name;const c=[],l=[];this.readRawGeometry_(e,t,c,l);const u=MM(r,l.length);if(this.featureClass_===hd)s=new this.featureClass_(u,c,l,o,a),s.transform(i.dataProjection);else{let h;if(u==R.POLYGON){const p=jp(c,l);h=p.length>1?new ui(c,H.XY,p):new Bt(c,H.XY,l)}else h=u===R.POINT?new ft(c,H.XY):u===R.LINE_STRING?new Tt(c,H.XY):u===R.POLYGON?new Bt(c,H.XY,l):u===R.MULTI_POINT?new ci(c,H.XY):u===R.MULTI_LINE_STRING?new jn(c,H.XY,l):null;const d=this.featureClass_;s=new d,this.geometryName_&&s.setGeometryName(this.geometryName_);const f=ct(h,!1,i);s.setGeometry(f),a!==void 0&&s.setId(a),s.setProperties(o,!0)}return s}getType(){return Bn.ARRAY_BUFFER}readFeatures(e,t){const i=this.layers_,r=this.adaptOptions(t),s=re(r.dataProjection);s.setWorldExtent(r.extent),r.dataProjection=s;const o=new cM(e),a=o.readFields(LM,{}),c=[];for(const l in a){if(i&&i.indexOf(l)==-1)continue;const u=a[l],h=u?[0,0,u.extent,u.extent]:null;s.setExtent(h);for(let d=0,f=u.length;d<f;++d){const p=OM(o,u,d),m=this.createFeature_(o,p,r);m!==null&&c.push(m)}}return c}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}}function LM(n,e,t){if(n===3){const i={keys:[],values:[],features:[]},r=t.readVarint()+t.pos;t.readFields(AM,i,r),i.length=i.features.length,i.length&&(e[i.name]=i)}}function AM(n,e,t){if(n===15)e.version=t.readVarint();else if(n===1)e.name=t.readString();else if(n===5)e.extent=t.readVarint();else if(n===2)e.features.push(t.pos);else if(n===3)e.keys.push(t.readString());else if(n===4){let i=null;const r=t.readVarint()+t.pos;for(;t.pos<r;)n=t.readVarint()>>3,i=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(i)}}function PM(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2){const i=t.readVarint()+t.pos;for(;t.pos<i;){const r=e.layer.keys[t.readVarint()],s=e.layer.values[t.readVarint()];e.properties[r]=s}}else n==3?e.type=t.readVarint():n==4&&(e.geometry=t.pos)}function OM(n,e,t){n.pos=e.features[t];const i=n.readVarint()+n.pos,r={layer:e,type:0,properties:{}};return n.readFields(PM,r,i),r}function MM(n,e){let t;return n===1?t=e===1?R.POINT:R.MULTI_POINT:n===2?t=e===1?R.LINE_STRING:R.MULTI_LINE_STRING:n===3&&(t=R.POLYGON),t}var wm=CM;const Em=[null],FM=j(Em,{nd:UM,tag:Tw}),NM=j(Em,{node:DM,way:GM});class kM extends yo{constructor(){super(),this.dataProjection=re("EPSG:4326")}readFeaturesFromNode(e,t){const i=this.getReadOptions(e,t);if(e.localName=="osm"){const r=V({nodes:{},ways:[],features:[]},NM,e,[i]);for(let s=0;s<r.ways.length;s++){const o=r.ways[s],a=[];for(let u=0,h=o.ndrefs.length;u<h;u++){const d=r.nodes[o.ndrefs[u]];Xe(a,d)}let c;o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?c=new Bt(a,H.XY,[a.length]):c=new Tt(a,H.XY),ct(c,!1,i);const l=new it(c);o.id!==void 0&&l.setId(o.id),l.setProperties(o.tags,!0),r.features.push(l)}if(r.features)return r.features}return[]}}const $M=j(Em,{tag:Tw});function DM(n,e){const t=e[0],i=e[e.length-1],r=n.getAttribute("id"),s=[parseFloat(n.getAttribute("lon")),parseFloat(n.getAttribute("lat"))];i.nodes[r]=s;const o=V({tags:{}},$M,n,e);if(!xi(o.tags)){const a=new ft(s);ct(a,!1,t);const c=new it(a);r!==void 0&&c.setId(r),c.setProperties(o.tags,!0),i.features.push(c)}}function GM(n,e){const t=n.getAttribute("id"),i=V({id:t,ndrefs:[],tags:{}},FM,n,e);e[e.length-1].ways.push(i)}function UM(n,e){e[e.length-1].ndrefs.push(n.getAttribute("ref"))}function Tw(n,e){const t=e[e.length-1];t.tags[n.getAttribute("k")]=n.getAttribute("v")}var zM=kM;class BM{read(e){if(e)if(typeof e=="string"){const t=Li(e);return this.readFromDocument(t)}else return Ci(e)?this.readFromDocument(e):this.readFromNode(e);else return null}readFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFromNode(t);return null}readFromNode(e){}}var dd=BM;const jM="http://www.w3.org/1999/xlink";function wo(n){return n.getAttributeNS(jM,"href")}const Xn=[null,"http://www.opengis.net/ows/1.1"],VM=j(Xn,{ServiceIdentification:C(gF),ServiceProvider:C(yF),OperationsMetadata:C(fF)});class YM extends dd{constructor(){super()}readFromNode(e){const t=V({},VM,e,[]);return t||null}}const XM=j(Xn,{DeliveryPoint:C(Z),City:C(Z),AdministrativeArea:C(Z),PostalCode:C(Z),Country:C(Z),ElectronicMailAddress:C(Z)}),ZM=j(Xn,{Value:ut(_F)}),WM=j(Xn,{AllowedValues:C(oF)}),HM=j(Xn,{Phone:C(pF),Address:C(sF)}),KM=j(Xn,{HTTP:C(hF)}),qM=j(Xn,{Get:ut(uF),Post:void 0}),JM=j(Xn,{DCP:C(cF)}),QM=j(Xn,{Operation:dF}),eF=j(Xn,{Voice:C(Z),Facsimile:C(Z)}),tF=j(Xn,{Constraint:ut(aF)}),nF=j(Xn,{IndividualName:C(Z),PositionName:C(Z),ContactInfo:C(lF)}),iF=j(Xn,{Abstract:C(Z),AccessConstraints:C(Z),Fees:C(Z),Title:C(Z),ServiceTypeVersion:C(Z),ServiceType:C(Z)}),rF=j(Xn,{ProviderName:C(Z),ProviderSite:C(wo),ServiceContact:C(mF)});function sF(n,e){return V({},XM,n,e)}function oF(n,e){return V({},ZM,n,e)}function aF(n,e){const t=n.getAttribute("name");if(!!t)return V({name:t},WM,n,e)}function lF(n,e){return V({},HM,n,e)}function cF(n,e){return V({},KM,n,e)}function uF(n,e){const t=wo(n);if(!!t)return V({href:t},tF,n,e)}function hF(n,e){return V({},qM,n,e)}function dF(n,e){const t=n.getAttribute("name"),i=V({},JM,n,e);if(!i)return;const r=e[e.length-1];r[t]=i}function fF(n,e){return V({},QM,n,e)}function pF(n,e){return V({},eF,n,e)}function gF(n,e){return V({},iF,n,e)}function mF(n,e){return V({},nF,n,e)}function yF(n,e){return V({},rF,n,e)}function _F(n,e){return Z(n)}var bw=YM;function Tm(n,e,t,i,r,s){let o,a;r!==void 0?(o=r,a=s!==void 0?s:0):(o=[],a=0);let c=e;for(;c<t;){const l=n[c++];o[a++]=n[c++],o[a++]=l;for(let u=2;u<i;++u)o[a++]=n[c++]}return o.length=a,o}class xF extends qh{constructor(e){super();const t=e||{};this.dataProjection=re("EPSG:4326"),this.factor_=t.factor?t.factor:1e5,this.geometryLayout_=t.geometryLayout?t.geometryLayout:H.XY}readFeatureFromText(e,t){const i=this.readGeometryFromText(e,t);return new it(i)}readFeaturesFromText(e,t){return[this.readFeatureFromText(e,t)]}readGeometryFromText(e,t){const i=th(this.geometryLayout_),r=Rw(e,i,this.factor_);Tm(r,0,r.length,i,r);const s=zi(r,0,r.length,i),o=new Tt(s,this.geometryLayout_);return ct(o,!1,this.adaptOptions(t))}writeFeatureText(e,t){const i=e.getGeometry();return i?this.writeGeometryText(i,t):(ce(!1,40),"")}writeFeaturesText(e,t){return this.writeFeatureText(e[0],t)}writeGeometryText(e,t){e=ct(e,!0,this.adaptOptions(t));const i=e.getFlatCoordinates(),r=e.getStride();return Tm(i,0,i.length,r,i),Sw(i,r,this.factor_)}}function Sw(n,e,t){const i=t||1e5;let r;const s=new Array(e);for(r=0;r<e;++r)s[r]=0;for(let o=0,a=n.length;o<a;)for(r=0;r<e;++r,++o){const c=n[o],l=c-s[r];s[r]=c,n[o]=l}return Iw(n,i)}function Rw(n,e,t){const i=t||1e5;let r;const s=new Array(e);for(r=0;r<e;++r)s[r]=0;const o=Cw(n,i);for(let a=0,c=o.length;a<c;)for(r=0;r<e;++r,++a)s[r]+=o[a],o[a]=s[r];return o}function Iw(n,e){const t=e||1e5;for(let i=0,r=n.length;i<r;++i)n[i]=Math.round(n[i]*t);return Lw(n)}function Cw(n,e){const t=e||1e5,i=Aw(n);for(let r=0,s=i.length;r<s;++r)i[r]/=t;return i}function Lw(n){for(let e=0,t=n.length;e<t;++e){const i=n[e];n[e]=i<0?~(i<<1):i<<1}return Pw(n)}function Aw(n){const e=Ow(n);for(let t=0,i=e.length;t<i;++t){const r=e[t];e[t]=r&1?~(r>>1):r>>1}return e}function Pw(n){let e="";for(let t=0,i=n.length;t<i;++t)e+=Mw(n[t]);return e}function Ow(n){const e=[];let t=0,i=0;for(let r=0,s=n.length;r<s;++r){const o=n.charCodeAt(r)-63;t|=(o&31)<<i,o<32?(e.push(t),t=0,i=0):i+=5}return e}function Mw(n){let e,t="";for(;n>=32;)e=(32|n&31)+63,t+=String.fromCharCode(e),n>>=5;return e=n+63,t+=String.fromCharCode(e),t}var vF=xF;class wF extends Yh{constructor(e){super();const t=e||{};this.layerName_=t.layerName,this.layers_=t.layers?t.layers:null,this.dataProjection=re(t.dataProjection?t.dataProjection:"EPSG:4326")}readFeaturesFromObject(e,t){if(e.type=="Topology"){const i=e;let r,s=null,o=null;i.transform&&(r=i.transform,s=r.scale,o=r.translate);const a=i.arcs;r&&AF(a,s,o);const c=[],l=i.objects,u=this.layerName_;let h;for(const d in l)this.layers_&&this.layers_.indexOf(d)==-1||(l[d].type==="GeometryCollection"?(h=l[d],c.push.apply(c,LF(h,a,s,o,u,d,t))):(h=l[d],c.push(Fw(h,a,s,o,u,d,t))));return c}else return[]}readProjectionFromObject(e){return this.dataProjection}}const EF={Point:TF,LineString:SF,Polygon:IF,MultiPoint:bF,MultiLineString:RF,MultiPolygon:CF};function fd(n,e){const t=[];let i;for(let r=0,s=n.length;r<s;++r)if(i=n[r],r>0&&t.pop(),i>=0){const o=e[i];for(let a=0,c=o.length;a<c;++a)t.push(o[a].slice(0))}else{const o=e[~i];for(let a=o.length-1;a>=0;--a)t.push(o[a].slice(0))}return t}function TF(n,e,t){const i=n.coordinates;return e&&t&&bm(i,e,t),new ft(i)}function bF(n,e,t){const i=n.coordinates;if(e&&t)for(let r=0,s=i.length;r<s;++r)bm(i[r],e,t);return new ci(i)}function SF(n,e){const t=fd(n.arcs,e);return new Tt(t)}function RF(n,e){const t=[];for(let i=0,r=n.arcs.length;i<r;++i)t[i]=fd(n.arcs[i],e);return new jn(t)}function IF(n,e){const t=[];for(let i=0,r=n.arcs.length;i<r;++i)t[i]=fd(n.arcs[i],e);return new Bt(t)}function CF(n,e){const t=[];for(let i=0,r=n.arcs.length;i<r;++i){const s=n.arcs[i],o=[];for(let a=0,c=s.length;a<c;++a)o[a]=fd(s[a],e);t[i]=o}return new ui(t)}function LF(n,e,t,i,r,s,o){const a=n.geometries,c=[];for(let l=0,u=a.length;l<u;++l)c[l]=Fw(a[l],e,t,i,r,s,o);return c}function Fw(n,e,t,i,r,s,o){let a=null;const c=n.type;if(c){const h=EF[c];c==="Point"||c==="MultiPoint"?a=h(n,t,i):a=h(n,e),a=ct(a,!1,o)}const l=new it({geometry:a});n.id!==void 0&&l.setId(n.id);let u=n.properties;return r&&(u||(u={}),u[r]=s),u&&l.setProperties(u,!0),l}function AF(n,e,t){for(let i=0,r=n.length;i<r;++i)PF(n[i],e,t)}function PF(n,e,t){let i=0,r=0;for(let s=0,o=n.length;s<o;++s){const a=n[s];i+=a[0],r+=a[1],a[0]=i,a[1]=r,bm(a,e,t)}}function bm(n,e,t){n[0]=n[0]*e[0]+t[0],n[1]=n[1]*e[1]+t[1]}var OF=wF;class MF{constructor(e){this.tagName_=e}getTagName(){return this.tagName_}}var Eo=MF;class FF extends Eo{constructor(e,t){super(e),this.conditions=t,ce(this.conditions.length>=2,57)}}var Sm=FF;class NF extends Sm{constructor(e){super("And",Array.prototype.slice.call(arguments))}}var Nw=NF;class kF extends Eo{constructor(e,t,i){if(super("BBOX"),this.geometryName=e,this.extent=t,t.length!==4)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");this.srsName=i}}var kw=kF;class $F extends Eo{constructor(e,t,i,r){super(e),this.geometryName=t||"the_geom",this.geometry=i,this.srsName=r}}var $a=$F;class DF extends $a{constructor(e,t,i){super("Contains",e,t,i)}}var $w=DF;class GF extends $a{constructor(e,t,i,r,s){super("DWithin",e,t,s),this.distance=i,this.unit=r}}var Dw=GF;class UF extends $a{constructor(e,t,i){super("Disjoint",e,t,i)}}var Gw=UF;class zF extends Eo{constructor(e,t){super(e),this.propertyName=t}}var Da=zF;class BF extends Da{constructor(e,t,i){super("During",e),this.begin=t,this.end=i}}var Uw=BF;class jF extends Da{constructor(e,t,i,r){super(e,t),this.expression=i,this.matchCase=r}}var To=jF;class VF extends To{constructor(e,t,i){super("PropertyIsEqualTo",e,t,i)}}var zw=VF;class YF extends To{constructor(e,t){super("PropertyIsGreaterThan",e,t)}}var Bw=YF;class XF extends To{constructor(e,t){super("PropertyIsGreaterThanOrEqualTo",e,t)}}var jw=XF;class ZF extends $a{constructor(e,t,i){super("Intersects",e,t,i)}}var Vw=ZF;class WF extends Da{constructor(e,t,i){super("PropertyIsBetween",e),this.lowerBoundary=t,this.upperBoundary=i}}var Yw=WF;class HF extends Da{constructor(e,t,i,r,s,o){super("PropertyIsLike",e),this.pattern=t,this.wildCard=i!==void 0?i:"*",this.singleChar=r!==void 0?r:".",this.escapeChar=s!==void 0?s:"!",this.matchCase=o}}var Xw=HF;class KF extends Da{constructor(e){super("PropertyIsNull",e)}}var Zw=KF;class qF extends To{constructor(e,t){super("PropertyIsLessThan",e,t)}}var Ww=qF;class JF extends To{constructor(e,t){super("PropertyIsLessThanOrEqualTo",e,t)}}var Hw=JF;class QF extends Eo{constructor(e){super("Not"),this.condition=e}}var Kw=QF;class eN extends To{constructor(e,t,i){super("PropertyIsNotEqualTo",e,t,i)}}var qw=eN;class tN extends Sm{constructor(e){super("Or",Array.prototype.slice.call(arguments))}}var Jw=tN;class nN extends Eo{constructor(e){super("ResourceId"),this.rid=e}}var Qw=nN;class iN extends $a{constructor(e,t,i){super("Within",e,t,i)}}var eE=iN;function tE(n){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Nw,e))}function rN(n){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Jw,e))}function sN(n){return new Kw(n)}function nE(n,e,t){return new kw(n,e,t)}function oN(n,e,t){return new $w(n,e,t)}function aN(n,e,t){return new Vw(n,e,t)}function lN(n,e,t){return new Gw(n,e,t)}function cN(n,e,t){return new eE(n,e,t)}function uN(n,e,t,i,r){return new Dw(n,e,t,i,r)}function hN(n,e,t){return new zw(n,e,t)}function dN(n,e,t){return new qw(n,e,t)}function fN(n,e){return new Ww(n,e)}function pN(n,e){return new Hw(n,e)}function gN(n,e){return new Bw(n,e)}function mN(n,e){return new jw(n,e)}function yN(n){return new Zw(n)}function _N(n,e,t){return new Yw(n,e,t)}function xN(n,e,t,i,r,s){return new Xw(n,e,t,i,r,s)}function vN(n,e,t){return new Uw(n,e,t)}function wN(n){return new Qw(n)}const iE={"http://www.opengis.net/gml":{boundedBy:C(ke.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:ue(ke.prototype.readFeaturesInternal)}},EN={"http://www.opengis.net/wfs":{totalInserted:C(Ct),totalUpdated:C(Ct),totalDeleted:C(Ct)},"http://www.opengis.net/wfs/2.0":{totalInserted:C(Ct),totalUpdated:C(Ct),totalDeleted:C(Ct)}},TN={"http://www.opengis.net/wfs":{TransactionSummary:C(aE,"transactionSummary"),InsertResults:C(cE,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:C(aE,"transactionSummary"),InsertResults:C(cE,"insertIds")}},bN={"http://www.opengis.net/wfs":{PropertyName:L(ye)},"http://www.opengis.net/wfs/2.0":{PropertyName:L(ye)}},rE={"http://www.opengis.net/wfs":{Insert:L(uE),Update:L(fE),Delete:L(dE),Property:L(pE),Native:L(gE)},"http://www.opengis.net/wfs/2.0":{Insert:L(uE),Update:L(fE),Delete:L(dE),Property:L(pE),Native:L(gE)}},sE="feature",Rm="http://www.w3.org/2000/xmlns/",Im={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},Cm={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},Lm={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},oE={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},Am={"2.0.0":Hh,"1.1.0":Ie,"1.0.0":xo},SN="1.1.0";class RN extends yo{constructor(e){super();const t=e||{};this.version_=t.version?t.version:SN,this.featureType_=t.featureType,this.featureNS_=t.featureNS,this.gmlFormat_=t.gmlFormat?t.gmlFormat:new Am[this.version_],this.schemaLocation_=t.schemaLocation?t.schemaLocation:oE[this.version_]}getFeatureType(){return this.featureType_}setFeatureType(e){this.featureType_=e}readFeaturesFromNode(e,t){const i={node:e};J(i,{featureType:this.featureType_,featureNS:this.featureNS_}),J(i,this.getReadOptions(e,t||{}));const r=[i];let s;this.version_==="2.0.0"?s=iE:s=this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let o=V([],s,e,r,this.gmlFormat_);return o||(o=[]),o}readTransactionResponse(e){if(e)if(typeof e=="string"){const t=Li(e);return this.readTransactionResponseFromDocument(t)}else return Ci(e)?this.readTransactionResponseFromDocument(e):this.readTransactionResponseFromNode(e);else return}readFeatureCollectionMetadata(e){if(e)if(typeof e=="string"){const t=Li(e);return this.readFeatureCollectionMetadataFromDocument(t)}else return Ci(e)?this.readFeatureCollectionMetadataFromDocument(e):this.readFeatureCollectionMetadataFromNode(e);else return}readFeatureCollectionMetadataFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(t)}readFeatureCollectionMetadataFromNode(e){const t={},i=Hi(e.getAttribute("numberOfFeatures"));return t.numberOfFeatures=i,V(t,iE,e,[],this.gmlFormat_)}readTransactionResponseFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(t)}readTransactionResponseFromNode(e){return V({},TN,e,[])}writeGetFeature(e){const t=xe(Cm[this.version_],"GetFeature");t.setAttribute("service","WFS"),t.setAttribute("version",this.version_),e.handle&&t.setAttribute("handle",e.handle),e.outputFormat&&t.setAttribute("outputFormat",e.outputFormat),e.maxFeatures!==void 0&&t.setAttribute("maxFeatures",String(e.maxFeatures)),e.resultType&&t.setAttribute("resultType",e.resultType),e.startIndex!==void 0&&t.setAttribute("startIndex",String(e.startIndex)),e.count!==void 0&&t.setAttribute("count",String(e.count)),e.viewParams!==void 0&&t.setAttribute("viewParams",e.viewParams),t.setAttributeNS(ps,"xsi:schemaLocation",this.schemaLocation_);const i={node:t};if(J(i,{version:this.version_,srsName:e.srsName,featureNS:e.featureNS?e.featureNS:this.featureNS_,featurePrefix:e.featurePrefix,propertyNames:e.propertyNames?e.propertyNames:[]}),ce(Array.isArray(e.featureTypes),11),typeof e.featureTypes[0]=="string"){let r=e.filter;e.bbox&&(ce(e.geometryName,12),r=this.combineBboxAndFilter(e.geometryName,e.bbox,e.srsName,r)),J(i,{geometryName:e.geometryName,filter:r}),RE(t,e.featureTypes,[i])}else e.featureTypes.forEach(r=>{const s=this.combineBboxAndFilter(r.geometryName,r.bbox,e.srsName,e.filter);J(i,{geometryName:r.geometryName,filter:s}),RE(t,[r.name],[i])});return t}combineBboxAndFilter(e,t,i,r){const s=nE(e,t,i);return r?tE(r,s):s}writeTransaction(e,t,i,r){const s=[],o=r.version?r.version:this.version_,a=xe(Cm[o],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",o);let c;r&&(c=r.gmlOptions?r.gmlOptions:{},r.handle&&a.setAttribute("handle",r.handle)),a.setAttributeNS(ps,"xsi:schemaLocation",oE[o]);const l=IN(a,c,o,r);return e&&pd("Insert",e,s,l),t&&pd("Update",t,s,l),i&&pd("Delete",i,s,l),r.nativeElements&&pd("Native",r.nativeElements,s,l),a}readProjectionFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(t);return null}readProjectionFromNode(e){if(e.firstElementChild&&e.firstElementChild.firstElementChild){e=e.firstElementChild.firstElementChild;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(!(t.childNodes.length===0||t.childNodes.length===1&&t.firstChild.nodeType===3)){const i=[{}];return this.gmlFormat_.readGeometryElement(t,i),re(i.pop().srsName)}}return null}}function IN(n,e,t,i){const r=i.featurePrefix?i.featurePrefix:sE;let s;return t==="1.0.0"?s=2:t==="1.1.0"?s=3:t==="2.0.0"&&(s=3.2),J({node:n},{version:t,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:r,gmlVersion:s,hasZ:i.hasZ,srsName:i.srsName},e)}function pd(n,e,t,i){ve(i,rE,_t(n),e,t)}function aE(n,e){return V({},EN,n,e)}const CN={"http://www.opengis.net/ogc":{FeatureId:ue(function(n,e){return n.getAttribute("fid")})},"http://www.opengis.net/ogc/1.1":{FeatureId:ue(function(n,e){return n.getAttribute("fid")})}};function lE(n,e){In(CN,n,e)}const LN={"http://www.opengis.net/wfs":{Feature:lE},"http://www.opengis.net/wfs/2.0":{Feature:lE}};function cE(n,e){return V([],LN,n,e)}function uE(n,e,t){const i=t[t.length-1],r=i.featureType,s=i.featureNS,o=i.gmlVersion,a=xe(s,r);n.appendChild(a),o===2?xo.prototype.writeFeatureElement(a,e,t):o===3?Ie.prototype.writeFeatureElement(a,e,t):Hh.prototype.writeFeatureElement(a,e,t)}function hE(n,e,t){const r=t[t.length-1].version,s=Im[r],o=xe(s,"Filter"),a=xe(s,"FeatureId");o.appendChild(a),a.setAttribute("fid",e),n.appendChild(o)}function Pm(n,e){n=n||sE;const t=n+":";return e.indexOf(t)===0?e:t+e}function dE(n,e,t){const i=t[t.length-1];ce(e.getId()!==void 0,26);const r=i.featureType,s=i.featurePrefix,o=i.featureNS,a=Pm(s,r);n.setAttribute("typeName",a),n.setAttributeNS(Rm,"xmlns:"+s,o);const c=e.getId();c!==void 0&&hE(n,c,t)}function fE(n,e,t){const i=t[t.length-1];ce(e.getId()!==void 0,27);const r=i.version,s=i.featureType,o=i.featurePrefix,a=i.featureNS,c=Pm(o,s),l=e.getGeometryName();n.setAttribute("typeName",c),n.setAttributeNS(Rm,"xmlns:"+o,a);const u=e.getId();if(u!==void 0){const h=e.getKeys(),d=[];for(let f=0,p=h.length;f<p;f++){const m=e.get(h[f]);if(m!==void 0){let g=h[f];m&&typeof m.getSimplifiedGeometry=="function"&&(g=l),d.push({name:g,value:m})}}ve({version:r,gmlVersion:i.gmlVersion,node:n,hasZ:i.hasZ,srsName:i.srsName},rE,_t("Property"),d,t),hE(n,u,t)}}function pE(n,e,t){const i=t[t.length-1],r=i.version,s=Cm[r],o=xe(s,"Name"),a=i.gmlVersion;if(n.appendChild(o),ye(o,e.name),e.value!==void 0&&e.value!==null){const c=xe(s,"Value");n.appendChild(c),e.value&&typeof e.value.getSimplifiedGeometry=="function"?a===2?xo.prototype.writeGeometryElement(c,e.value,t):a===3?Ie.prototype.writeGeometryElement(c,e.value,t):Hh.prototype.writeGeometryElement(c,e.value,t):ye(c,e.value)}}function gE(n,e,t){e.vendorId&&n.setAttribute("vendorId",e.vendorId),e.safeToIgnore!==void 0&&n.setAttribute("safeToIgnore",String(e.safeToIgnore)),e.value!==void 0&&ye(n,e.value)}const gd={"http://www.opengis.net/wfs":{Query:L(mE)},"http://www.opengis.net/wfs/2.0":{Query:L(mE)},"http://www.opengis.net/ogc":{During:L(vE),And:L(md),Or:L(md),Not:L(wE),BBOX:L(_E),Contains:L(ys),Intersects:L(ys),Within:L(ys),DWithin:L(xE),PropertyIsEqualTo:L(hi),PropertyIsNotEqualTo:L(hi),PropertyIsLessThan:L(hi),PropertyIsLessThanOrEqualTo:L(hi),PropertyIsGreaterThan:L(hi),PropertyIsGreaterThanOrEqualTo:L(hi),PropertyIsNull:L(EE),PropertyIsBetween:L(TE),PropertyIsLike:L(bE)},"http://www.opengis.net/fes/2.0":{During:L(vE),And:L(md),Or:L(md),Not:L(wE),BBOX:L(_E),Contains:L(ys),Disjoint:L(ys),Intersects:L(ys),ResourceId:L(AN),Within:L(ys),DWithin:L(xE),PropertyIsEqualTo:L(hi),PropertyIsNotEqualTo:L(hi),PropertyIsLessThan:L(hi),PropertyIsLessThanOrEqualTo:L(hi),PropertyIsGreaterThan:L(hi),PropertyIsGreaterThanOrEqualTo:L(hi),PropertyIsNull:L(EE),PropertyIsBetween:L(TE),PropertyIsLike:L(bE)}};function mE(n,e,t){const i=t[t.length-1],r=i.version,s=i.featurePrefix,o=i.featureNS,a=i.propertyNames,c=i.srsName;let l;s?l=Pm(s,e):l=e;let u;r==="2.0.0"?u="typeNames":u="typeName",n.setAttribute(u,l),c&&n.setAttribute("srsName",c),o&&n.setAttributeNS(Rm,"xmlns:"+s,o);const h=J({},i);h.node=n,ve(h,bN,_t("PropertyName"),a,t);const d=i.filter;if(d){const f=xe(Lc(r),"Filter");n.appendChild(f),yE(f,d,t)}}function yE(n,e,t){const i=t[t.length-1],r={node:n};J(r,{context:i}),ve(r,gd,_t(e.getTagName()),[e],t)}function _E(n,e,t){const i=t[t.length-1],s=i.context.version;i.srsName=e.srsName;const o=Am[s];Ga(s,n,e.geometryName),o.prototype.writeGeometryElement(n,e.extent,t)}function AN(n,e,t){n.setAttribute("rid",e.rid)}function ys(n,e,t){const i=t[t.length-1],s=i.context.version;i.srsName=e.srsName;const o=Am[s];Ga(s,n,e.geometryName),o.prototype.writeGeometryElement(n,e.geometry,t)}function xE(n,e,t){const s=t[t.length-1].context.version;ys(n,e,t);const o=xe(Lc(s),"Distance");ye(o,e.distance.toString()),s==="2.0.0"?o.setAttribute("uom",e.unit):o.setAttribute("units",e.unit),n.appendChild(o)}function vE(n,e,t){const s=t[t.length-1].context.version;yd(Lm[s],"ValueReference",n,e.propertyName);const o=xe(Zi,"TimePeriod");n.appendChild(o);const a=xe(Zi,"begin");o.appendChild(a),SE(a,e.begin);const c=xe(Zi,"end");o.appendChild(c),SE(c,e.end)}function md(n,e,t){const r=t[t.length-1].context,s={node:n};J(s,{context:r});const o=e.conditions;for(let a=0,c=o.length;a<c;++a){const l=o[a];ve(s,gd,_t(l.getTagName()),[l],t)}}function wE(n,e,t){const r=t[t.length-1].context,s={node:n};J(s,{context:r});const o=e.condition;ve(s,gd,_t(o.getTagName()),[o],t)}function hi(n,e,t){const s=t[t.length-1].context.version;e.matchCase!==void 0&&n.setAttribute("matchCase",e.matchCase.toString()),Ga(s,n,e.propertyName),_d(s,n,""+e.expression)}function EE(n,e,t){const s=t[t.length-1].context.version;Ga(s,n,e.propertyName)}function TE(n,e,t){const s=t[t.length-1].context.version,o=Lc(s);Ga(s,n,e.propertyName);const a=xe(o,"LowerBoundary");n.appendChild(a),_d(s,a,""+e.lowerBoundary);const c=xe(o,"UpperBoundary");n.appendChild(c),_d(s,c,""+e.upperBoundary)}function bE(n,e,t){const s=t[t.length-1].context.version;n.setAttribute("wildCard",e.wildCard),n.setAttribute("singleChar",e.singleChar),n.setAttribute("escapeChar",e.escapeChar),e.matchCase!==void 0&&n.setAttribute("matchCase",e.matchCase.toString()),Ga(s,n,e.propertyName),_d(s,n,""+e.pattern)}function yd(n,e,t,i){const r=xe(n,e);ye(r,i),t.appendChild(r)}function _d(n,e,t){yd(Lc(n),"Literal",e,t)}function Ga(n,e,t){n==="2.0.0"?yd(Lm[n],"ValueReference",e,t):yd(Im[n],"PropertyName",e,t)}function SE(n,e){const t=xe(Zi,"TimeInstant");n.appendChild(t);const i=xe(Zi,"timePosition");t.appendChild(i),ye(i,e)}function PN(n,e){const t=e||"1.1.0",i=xe(Lc(t),"Filter"),r={node:i};return J(r,{version:t,filter:n}),yE(i,n,[r]),i}function RE(n,e,t){const i=t[t.length-1],r=J({},i);r.node=n,ve(r,gd,_t("Query"),e,t)}function Lc(n){let e;return n==="2.0.0"?e=Lm[n]:e=Im[n],e}var ON=RN;const st={POINT:1,LINE_STRING:2,POLYGON:3,MULTI_POINT:4,MULTI_LINE_STRING:5,MULTI_POLYGON:6,GEOMETRY_COLLECTION:7,POLYHEDRAL_SURFACE:15,TIN:16,TRIANGLE:17};class IE{constructor(e){this.view_=e,this.pos_=0,this.initialized_=!1,this.isLittleEndian_=!1,this.hasZ_=!1,this.hasM_=!1,this.srid_=null,this.layout_=H.XY}readUint8(){return this.view_.getUint8(this.pos_++)}readUint32(e){return this.view_.getUint32((this.pos_+=4)-4,e!==void 0?e:this.isLittleEndian_)}readDouble(e){return this.view_.getFloat64((this.pos_+=8)-8,e!==void 0?e:this.isLittleEndian_)}readPoint(){const e=[];return e.push(this.readDouble()),e.push(this.readDouble()),this.hasZ_&&e.push(this.readDouble()),this.hasM_&&e.push(this.readDouble()),e}readLineString(){const e=this.readUint32(),t=[];for(let i=0;i<e;i++)t.push(this.readPoint());return t}readPolygon(){const e=this.readUint32(),t=[];for(let i=0;i<e;i++)t.push(this.readLineString());return t}readWkbHeader(e){const i=this.readUint8()>0,r=this.readUint32(i),s=Math.floor((r&268435455)/1e3),o=Boolean(r&2147483648)||s===1||s===3,a=Boolean(r&1073741824)||s===2||s===3,c=Boolean(r&536870912),l=(r&268435455)%1e3,u=["XY",o?"Z":"",a?"M":""].join(""),h=c?this.readUint32(i):null;if(e!==void 0&&e!==l)throw new Error("Unexpected WKB geometry type "+l);if(this.initialized_){if(this.isLittleEndian_!==i)throw new Error("Inconsistent endian");if(this.layout_!==u)throw new Error("Inconsistent geometry layout");if(h&&this.srid_!==h)throw new Error("Inconsistent coordinate system (SRID)")}else this.isLittleEndian_=i,this.hasZ_=o,this.hasM_=a,this.layout_=u,this.srid_=h,this.initialized_=!0;return l}readWkbPayload(e){switch(e){case st.POINT:return this.readPoint();case st.LINE_STRING:return this.readLineString();case st.POLYGON:case st.TRIANGLE:return this.readPolygon();case st.MULTI_POINT:return this.readMultiPoint();case st.MULTI_LINE_STRING:return this.readMultiLineString();case st.MULTI_POLYGON:case st.POLYHEDRAL_SURFACE:case st.TIN:return this.readMultiPolygon();case st.GEOMETRY_COLLECTION:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+e+" is found")}}readWkbBlock(e){return this.readWkbPayload(this.readWkbHeader(e))}readWkbCollection(e,t){const i=this.readUint32(),r=[];for(let s=0;s<i;s++){const o=e.call(this,t);o&&r.push(o)}return r}readMultiPoint(){return this.readWkbCollection(this.readWkbBlock,st.POINT)}readMultiLineString(){return this.readWkbCollection(this.readWkbBlock,st.LINE_STRING)}readMultiPolygon(){return this.readWkbCollection(this.readWkbBlock,st.POLYGON)}readGeometryCollection(){return this.readWkbCollection(this.readGeometry)}readGeometry(){const e=this.readWkbHeader(),t=this.readWkbPayload(e);switch(e){case st.POINT:return new ft(t,this.layout_);case st.LINE_STRING:return new Tt(t,this.layout_);case st.POLYGON:case st.TRIANGLE:return new Bt(t,this.layout_);case st.MULTI_POINT:return new ci(t,this.layout_);case st.MULTI_LINE_STRING:return new jn(t,this.layout_);case st.MULTI_POLYGON:case st.POLYHEDRAL_SURFACE:case st.TIN:return new ui(t,this.layout_);case st.GEOMETRY_COLLECTION:return new ln(t);default:return null}}getSrid(){return this.srid_}}class MN{constructor(e){e=e||{},this.layout_=e.layout,this.isLittleEndian_=e.littleEndian!==!1,this.isEWKB_=e.ewkb!==!1,this.writeQueue_=[],this.nodata_=J({X:0,Y:0,Z:0,M:0},e.nodata)}writeUint8(e){this.writeQueue_.push([1,e])}writeUint32(e){this.writeQueue_.push([4,e])}writeDouble(e){this.writeQueue_.push([8,e])}writePoint(e,t){const i=J.apply(null,t.split("").map((r,s)=>({[r]:e[s]})));for(const r of this.layout_)this.writeDouble(r in i?i[r]:this.nodata_[r])}writeLineString(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writePoint(e[i],t)}writePolygon(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writeLineString(e[i],t)}writeWkbHeader(e,t){e%=1e3,this.layout_.indexOf("Z")>=0&&(e+=this.isEWKB_?2147483648:1e3),this.layout_.indexOf("M")>=0&&(e+=this.isEWKB_?1073741824:2e3),this.isEWKB_&&Number.isInteger(t)&&(e|=536870912),this.writeUint8(this.isLittleEndian_?1:0),this.writeUint32(e),this.isEWKB_&&Number.isInteger(t)&&this.writeUint32(t)}writeMultiPoint(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writeWkbHeader(1),this.writePoint(e[i],t)}writeMultiLineString(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writeWkbHeader(2),this.writeLineString(e[i],t)}writeMultiPolygon(e,t){this.writeUint32(e.length);for(let i=0;i<e.length;i++)this.writeWkbHeader(3),this.writePolygon(e[i],t)}writeGeometryCollection(e){this.writeUint32(e.length);for(let t=0;t<e.length;t++)this.writeGeometry(e[t])}findMinimumLayout(e,t=H.XYZM){const i=(r,s)=>r===s?r:r===H.XYZM?s:s===H.XYZM?r:H.XY;if(e instanceof Ti)return i(e.getLayout(),t);if(e instanceof ln){const r=e.getGeometriesArray();for(let s=0;s<r.length&&t!==H.XY;s++)t=this.findMinimumLayout(r[s],t)}return t}writeGeometry(e,t){const i={[R.POINT]:st.POINT,[R.LINE_STRING]:st.LINE_STRING,[R.POLYGON]:st.POLYGON,[R.MULTI_POINT]:st.MULTI_POINT,[R.MULTI_LINE_STRING]:st.MULTI_LINE_STRING,[R.MULTI_POLYGON]:st.MULTI_POLYGON,[R.GEOMETRY_COLLECTION]:st.GEOMETRY_COLLECTION},r=e.getType(),s=i[r];if(!s)throw new Error("GeometryType "+r+" is not supported");this.layout_||(this.layout_=this.findMinimumLayout(e)),this.writeWkbHeader(s,t),e instanceof Ti?{[R.POINT]:this.writePoint,[R.LINE_STRING]:this.writeLineString,[R.POLYGON]:this.writePolygon,[R.MULTI_POINT]:this.writeMultiPoint,[R.MULTI_LINE_STRING]:this.writeMultiLineString,[R.MULTI_POLYGON]:this.writeMultiPolygon}[r].call(this,e.getCoordinates(),e.getLayout()):e instanceof ln&&this.writeGeometryCollection(e.getGeometriesArray())}getBuffer(){const e=this.writeQueue_.reduce((s,o)=>s+o[0],0),t=new ArrayBuffer(e),i=new DataView(t);let r=0;return this.writeQueue_.forEach(s=>{switch(s[0]){case 1:i.setUint8(r,s[1]);break;case 4:i.setUint32(r,s[1],this.isLittleEndian_);break;case 8:i.setFloat64(r,s[1],this.isLittleEndian_);break}r+=s[0]}),t}}class FN extends Pa{constructor(e){super();const t=e||{};this.splitCollection=Boolean(t.splitCollection),this.viewCache_=null,this.hex_=t.hex!==!1,this.littleEndian_=t.littleEndian!==!1,this.ewkb_=t.ewkb!==!1,this.layout_=t.geometryLayout,this.nodataZ_=t.nodataZ||0,this.nodataM_=t.nodataM||0,this.srid_=t.srid}getType(){return this.hex_?Bn.TEXT:Bn.ARRAY_BUFFER}readFeature(e,t){return new it({geometry:this.readGeometry(e,t)})}readFeatures(e,t){let i=[];const r=this.readGeometry(e,t);return this.splitCollection&&r instanceof ln?i=r.getGeometriesArray():i=[r],i.map(s=>new it({geometry:s}))}readGeometry(e,t){const i=CE(e);if(!i)return null;const s=new IE(i).readGeometry();this.viewCache_=i;const o=this.getReadOptions(e,t);return this.viewCache_=null,ct(s,!1,o)}readProjection(e){const t=this.viewCache_||CE(e);if(!t)return;const i=new IE(t);return i.readWkbHeader(),i.getSrid()&&re("EPSG:"+i.getSrid())||void 0}writeFeature(e,t){return this.writeGeometry(e.getGeometry(),t)}writeFeatures(e,t){return this.writeGeometry(new ln(e.map(i=>i.getGeometry())),t)}writeGeometry(e,t){const i=this.adaptOptions(t),r=new MN({layout:this.layout_,littleEndian:this.littleEndian_,ewkb:this.ewkb_,nodata:{Z:this.nodataZ_,M:this.nodataM_}});let s=Number.isInteger(this.srid_)?Number(this.srid_):null;if(this.srid_!==!1&&!Number.isInteger(this.srid_)){const a=i.dataProjection&&re(i.dataProjection);if(a){const c=a.getCode();c.indexOf("EPSG:")===0&&(s=Number(c.substring(5)))}}r.writeGeometry(ct(e,!0,i),s);const o=r.getBuffer();return this.hex_?NN(o):o}}function NN(n){const e=new Uint8Array(n);return Array.from(e.values()).map(t=>(t<16?"0":"")+Number(t).toString(16).toUpperCase()).join("")}function kN(n){const e=new Uint8Array(n.length/2);for(let t=0;t<n.length/2;t++)e[t]=parseInt(n.substr(t*2,2),16);return new DataView(e.buffer)}function CE(n){return typeof n=="string"?kN(n):ArrayBuffer.isView(n)?n instanceof DataView?n:new DataView(n.buffer,n.byteOffset,n.byteLength):n instanceof ArrayBuffer?new DataView(n):null}var $N=FN;const DN={POINT:ft,LINESTRING:Tt,POLYGON:Bt,MULTIPOINT:ci,MULTILINESTRING:jn,MULTIPOLYGON:ui},LE="EMPTY",AE="Z",PE="M",GN="ZM",tt={START:0,TEXT:1,LEFT_PAREN:2,RIGHT_PAREN:3,NUMBER:4,COMMA:5,EOF:6};for(const n in R)R[n].toUpperCase();class UN{constructor(e){this.wkt=e,this.index_=-1}isAlpha_(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}isNumeric_(e,t){const i=t!==void 0?t:!1;return e>="0"&&e<="9"||e=="."&&!i}isWhiteSpace_(e){return e==" "||e==" "||e=="\r"||e==`
|
9
|
+
`}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const e=this.nextChar_(),t=this.index_;let i=e,r;if(e=="(")r=tt.LEFT_PAREN;else if(e==",")r=tt.COMMA;else if(e==")")r=tt.RIGHT_PAREN;else if(this.isNumeric_(e)||e=="-")r=tt.NUMBER,i=this.readNumber_();else if(this.isAlpha_(e))r=tt.TEXT,i=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(e==="")r=tt.EOF;else throw new Error("Unexpected character: "+e)}return{position:t,value:i,type:r}}readNumber_(){let e;const t=this.index_;let i=!1,r=!1;do e=="."?i=!0:(e=="e"||e=="E")&&(r=!0),e=this.nextChar_();while(this.isNumeric_(e,i)||!r&&(e=="e"||e=="E")||r&&(e=="-"||e=="+"));return parseFloat(this.wkt.substring(t,this.index_--))}readText_(){let e;const t=this.index_;do e=this.nextChar_();while(this.isAlpha_(e));return this.wkt.substring(t,this.index_--).toUpperCase()}}class zN{constructor(e){this.lexer_=e,this.token_={position:0,type:tt.START},this.layout_=H.XY}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(e){return this.token_.type==e}match(e){const t=this.isTokenType(e);return t&&this.consume_(),t}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let e=H.XY;const t=this.token_;if(this.isTokenType(tt.TEXT)){const i=t.value;i===AE?e=H.XYZ:i===PE?e=H.XYM:i===GN&&(e=H.XYZM),e!==H.XY&&this.consume_()}return e}parseGeometryCollectionText_(){if(this.match(tt.LEFT_PAREN)){const e=[];do e.push(this.parseGeometry_());while(this.match(tt.COMMA));if(this.match(tt.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(tt.LEFT_PAREN)){const e=this.parsePoint_();if(this.match(tt.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(tt.LEFT_PAREN)){const e=this.parsePointList_();if(this.match(tt.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(tt.LEFT_PAREN)){const e=this.parseLineStringTextList_();if(this.match(tt.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(tt.LEFT_PAREN)){let e;if(this.token_.type==tt.LEFT_PAREN?e=this.parsePointTextList_():e=this.parsePointList_(),this.match(tt.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(tt.LEFT_PAREN)){const e=this.parseLineStringTextList_();if(this.match(tt.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(tt.LEFT_PAREN)){const e=this.parsePolygonTextList_();if(this.match(tt.RIGHT_PAREN))return e}throw new Error(this.formatErrorMessage_())}parsePoint_(){const e=[],t=this.layout_.length;for(let i=0;i<t;++i){const r=this.token_;if(this.match(tt.NUMBER))e.push(r.value);else break}if(e.length==t)return e;throw new Error(this.formatErrorMessage_())}parsePointList_(){const e=[this.parsePoint_()];for(;this.match(tt.COMMA);)e.push(this.parsePoint_());return e}parsePointTextList_(){const e=[this.parsePointText_()];for(;this.match(tt.COMMA);)e.push(this.parsePointText_());return e}parseLineStringTextList_(){const e=[this.parseLineStringText_()];for(;this.match(tt.COMMA);)e.push(this.parseLineStringText_());return e}parsePolygonTextList_(){const e=[this.parsePolygonText_()];for(;this.match(tt.COMMA);)e.push(this.parsePolygonText_());return e}isEmptyGeometry_(){const e=this.isTokenType(tt.TEXT)&&this.token_.value==LE;return e&&this.consume_(),e}formatErrorMessage_(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}parseGeometry_(){const e=this.token_;if(this.match(tt.TEXT)){const t=e.value;this.layout_=this.parseGeometryLayout_();const i=this.isEmptyGeometry_();if(t=="GEOMETRYCOLLECTION"){if(i)return new ln([]);const r=this.parseGeometryCollectionText_();return new ln(r)}else{const r=DN[t];if(!r)throw new Error("Invalid geometry type: "+t);let s;if(i)t=="POINT"?s=[NaN,NaN]:s=[];else switch(t){case"POINT":{s=this.parsePointText_();break}case"LINESTRING":{s=this.parseLineStringText_();break}case"POLYGON":{s=this.parsePolygonText_();break}case"MULTIPOINT":{s=this.parseMultiPointText_();break}case"MULTILINESTRING":{s=this.parseMultiLineStringText_();break}case"MULTIPOLYGON":{s=this.parseMultiPolygonText_();break}}return new r(s,this.layout_)}}throw new Error(this.formatErrorMessage_())}}class BN extends qh{constructor(e){super();const t=e||{};this.splitCollection_=t.splitCollection!==void 0?t.splitCollection:!1}parse_(e){const t=new UN(e);return new zN(t).parse()}readFeatureFromText(e,t){const i=this.readGeometryFromText(e,t),r=new it;return r.setGeometry(i),r}readFeaturesFromText(e,t){let i=[];const r=this.readGeometryFromText(e,t);this.splitCollection_&&r.getType()==R.GEOMETRY_COLLECTION?i=r.getGeometriesArray():i=[r];const s=[];for(let o=0,a=i.length;o<a;++o){const c=new it;c.setGeometry(i[o]),s.push(c)}return s}readGeometryFromText(e,t){const i=this.parse_(e);return ct(i,!1,t)}writeFeatureText(e,t){const i=e.getGeometry();return i?this.writeGeometryText(i,t):""}writeFeaturesText(e,t){if(e.length==1)return this.writeFeatureText(e[0],t);const i=[];for(let s=0,o=e.length;s<o;++s)i.push(e[s].getGeometry());const r=new ln(i);return this.writeGeometryText(r,t)}writeGeometryText(e,t){return FE(ct(e,!0,t))}}function OE(n){const e=n.getCoordinates();return e.length===0?"":e.join(" ")}function jN(n){const e=[],t=n.getPoints();for(let i=0,r=t.length;i<r;++i)e.push("("+OE(t[i])+")");return e.join(",")}function VN(n){const e=[],t=n.getGeometries();for(let i=0,r=t.length;i<r;++i)e.push(FE(t[i]));return e.join(",")}function Om(n){const e=n.getCoordinates(),t=[];for(let i=0,r=e.length;i<r;++i)t.push(e[i].join(" "));return t.join(",")}function YN(n){const e=[],t=n.getLineStrings();for(let i=0,r=t.length;i<r;++i)e.push("("+Om(t[i])+")");return e.join(",")}function ME(n){const e=[],t=n.getLinearRings();for(let i=0,r=t.length;i<r;++i)e.push("("+Om(t[i])+")");return e.join(",")}function XN(n){const e=[],t=n.getPolygons();for(let i=0,r=t.length;i<r;++i)e.push("("+ME(t[i])+")");return e.join(",")}function ZN(n){const e=n.getLayout();let t="";return(e===H.XYZ||e===H.XYZM)&&(t+=AE),(e===H.XYM||e===H.XYZM)&&(t+=PE),t}const WN={Point:OE,LineString:Om,Polygon:ME,MultiPoint:jN,MultiLineString:YN,MultiPolygon:XN,GeometryCollection:VN};function FE(n){let e=n.getType();const i=WN[e](n);if(e=e.toUpperCase(),typeof n.getFlatCoordinates=="function"){const r=ZN(n);r.length>0&&(e+=" "+r)}return i.length===0?e+" "+LE:e+"("+i+")"}var HN=BN;const cn=[null,"http://www.opengis.net/wms"],KN=j(cn,{Service:C(yk),Capability:C(mk)}),qN=j(cn,{Request:C(bk),Exception:C(wk),Layer:C(Ek)});class JN extends dd{constructor(){super(),this.version=void 0}readFromNode(e){this.version=e.getAttribute("version").trim();const t=V({version:this.version},KN,e,[]);return t||null}}const QN=j(cn,{Name:C(Z),Title:C(Z),Abstract:C(Z),KeywordList:C(DE),OnlineResource:C(wo),ContactInformation:C(_k),Fees:C(Z),AccessConstraints:C(Z),LayerLimit:C(Ct),MaxWidth:C(Ct),MaxHeight:C(Ct)}),ek=j(cn,{ContactPersonPrimary:C(xk),ContactPosition:C(Z),ContactAddress:C(vk),ContactVoiceTelephone:C(Z),ContactFacsimileTelephone:C(Z),ContactElectronicMailAddress:C(Z)}),tk=j(cn,{ContactPerson:C(Z),ContactOrganization:C(Z)}),nk=j(cn,{AddressType:C(Z),Address:C(Z),City:C(Z),StateOrProvince:C(Z),PostCode:C(Z),Country:C(Z)}),ik=j(cn,{Format:ue(Z)}),NE=j(cn,{Name:C(Z),Title:C(Z),Abstract:C(Z),KeywordList:C(DE),CRS:ut(Z),EX_GeographicBoundingBox:C(gk),BoundingBox:ut(pk),Dimension:ut(Tk),Attribution:C(fk),AuthorityURL:ut(Ik),Identifier:ut(Z),MetadataURL:ut(Ck),DataURL:ut(Er),FeatureListURL:ut(Er),Style:ut(Lk),MinScaleDenominator:C(Ve),MaxScaleDenominator:C(Ve),Layer:ut(kE)}),rk=j(cn,{Title:C(Z),OnlineResource:C(wo),LogoURL:C($E)}),sk=j(cn,{westBoundLongitude:C(Ve),eastBoundLongitude:C(Ve),southBoundLatitude:C(Ve),northBoundLatitude:C(Ve)}),ok=j(cn,{GetCapabilities:C(Mm),GetMap:C(Mm),GetFeatureInfo:C(Mm)}),ak=j(cn,{Format:ut(Z),DCPType:ut(Sk)}),lk=j(cn,{HTTP:C(Rk)}),ck=j(cn,{Get:C(Er),Post:C(Er)}),uk=j(cn,{Name:C(Z),Title:C(Z),Abstract:C(Z),LegendURL:ut($E),StyleSheetURL:C(Er),StyleURL:C(Er)}),hk=j(cn,{Format:C(Z),OnlineResource:C(wo)}),dk=j(cn,{Keyword:ue(Z)});function fk(n,e){return V({},rk,n,e)}function pk(n,e){const t=[Wi(n.getAttribute("minx")),Wi(n.getAttribute("miny")),Wi(n.getAttribute("maxx")),Wi(n.getAttribute("maxy"))],i=[Wi(n.getAttribute("resx")),Wi(n.getAttribute("resy"))];return{crs:n.getAttribute("CRS"),extent:t,res:i}}function gk(n,e){const t=V({},sk,n,e);if(!t)return;const i=t.westBoundLongitude,r=t.southBoundLatitude,s=t.eastBoundLongitude,o=t.northBoundLatitude;if(!(i===void 0||r===void 0||s===void 0||o===void 0))return[i,r,s,o]}function mk(n,e){return V({},qN,n,e)}function yk(n,e){return V({},QN,n,e)}function _k(n,e){return V({},ek,n,e)}function xk(n,e){return V({},tk,n,e)}function vk(n,e){return V({},nk,n,e)}function wk(n,e){return V([],ik,n,e)}function Ek(n,e){const t=V({},NE,n,e);return t.Layer===void 0?Object.assign(t,kE(n,e)):t}function kE(n,e){const t=e[e.length-1],i=V({},NE,n,e);if(!i)return;let r=gs(n.getAttribute("queryable"));r===void 0&&(r=t.queryable),i.queryable=r!==void 0?r:!1;let s=Hi(n.getAttribute("cascaded"));s===void 0&&(s=t.cascaded),i.cascaded=s;let o=gs(n.getAttribute("opaque"));o===void 0&&(o=t.opaque),i.opaque=o!==void 0?o:!1;let a=gs(n.getAttribute("noSubsets"));a===void 0&&(a=t.noSubsets),i.noSubsets=a!==void 0?a:!1;let c=Wi(n.getAttribute("fixedWidth"));c||(c=t.fixedWidth),i.fixedWidth=c;let l=Wi(n.getAttribute("fixedHeight"));return l||(l=t.fixedHeight),i.fixedHeight=l,["Style","CRS","AuthorityURL"].forEach(function(d){if(d in t){const f=i[d]||[];i[d]=f.concat(t[d])}}),["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(d){if(!(d in i)){const f=t[d];i[d]=f}}),i}function Tk(n,e){return{name:n.getAttribute("name"),units:n.getAttribute("units"),unitSymbol:n.getAttribute("unitSymbol"),default:n.getAttribute("default"),multipleValues:gs(n.getAttribute("multipleValues")),nearestValue:gs(n.getAttribute("nearestValue")),current:gs(n.getAttribute("current")),values:Z(n)}}function Er(n,e){return V({},hk,n,e)}function bk(n,e){return V({},ok,n,e)}function Sk(n,e){return V({},lk,n,e)}function Rk(n,e){return V({},ck,n,e)}function Mm(n,e){return V({},ak,n,e)}function $E(n,e){const t=Er(n,e);if(t){const i=[Hi(n.getAttribute("width")),Hi(n.getAttribute("height"))];return t.size=i,t}}function Ik(n,e){const t=Er(n,e);if(t)return t.name=n.getAttribute("name"),t}function Ck(n,e){const t=Er(n,e);if(t)return t.type=n.getAttribute("type"),t}function Lk(n,e){return V({},uk,n,e)}function DE(n,e){return V([],dk,n,e)}var Ak=JN;const Pk="_feature",Ok="_layer";class Mk extends yo{constructor(e){super();const t=e||{};this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new xo,this.layers_=t.layers?t.layers:null}getLayers(){return this.layers_}setLayers(e){this.layers_=e}readFeatures_(e,t){e.setAttribute("namespaceURI",this.featureNS_);const i=e.localName;let r=[];if(e.childNodes.length===0)return r;if(i=="msGMLOutput")for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s];if(a.nodeType!==Node.ELEMENT_NODE)continue;const c=a,l=t[0],u=Ok,h=c.localName.replace(u,"");if(this.layers_&&!Ge(this.layers_,h))continue;const d=h+Pk;l.featureType=d,l.featureNS=this.featureNS_;const f={};f[d]=ue(this.gmlFormat_.readFeatureElement,this.gmlFormat_);const p=j([l.featureNS,null],f);c.setAttribute("namespaceURI",this.featureNS_);const m=V([],p,c,t,this.gmlFormat_);m&&Xe(r,m)}if(i=="FeatureCollection"){const s=V([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,e,[{}],this.gmlFormat_);s&&(r=s)}return r}readFeaturesFromNode(e,t){const i={};return t&&J(i,this.getReadOptions(e,t)),this.readFeatures_(e,[i])}}var Fk=Mk;const Ki=[null,"http://www.opengis.net/wmts/1.0"],Ua=[null,"http://www.opengis.net/ows/1.1"],Nk=j(Ki,{Contents:C(Zk)});class kk extends dd{constructor(){super(),this.owsParser_=new bw}readFromNode(e){let t=e.getAttribute("version");t&&(t=t.trim());let i=this.owsParser_.readFromNode(e);return i?(i.version=t,i=V(i,Nk,e,[]),i||null):null}}const $k=j(Ki,{Layer:ut(Wk),TileMatrixSet:ut(Hk)}),Dk=j(Ki,{Style:ut(Kk),Format:ut(Z),TileMatrixSetLink:ut(qk),Dimension:ut(Jk),ResourceURL:ut(Qk)},j(Ua,{Title:C(Z),Abstract:C(Z),WGS84BoundingBox:C(GE),Identifier:C(Z)})),Gk=j(Ki,{LegendURL:ut(e$)},j(Ua,{Title:C(Z),Identifier:C(Z)})),Uk=j(Ki,{TileMatrixSet:C(Z),TileMatrixSetLimits:C(n$)}),zk=j(Ki,{TileMatrixLimits:ue(i$)}),Bk=j(Ki,{TileMatrix:C(Z),MinTileRow:C(Ct),MaxTileRow:C(Ct),MinTileCol:C(Ct),MaxTileCol:C(Ct)}),jk=j(Ki,{Default:C(Z),Value:ut(Z)},j(Ua,{Identifier:C(Z)})),Vk=j(Ua,{LowerCorner:ue(Fm),UpperCorner:ue(Fm)}),Yk=j(Ki,{WellKnownScaleSet:C(Z),TileMatrix:ut(t$)},j(Ua,{SupportedCRS:C(Z),Identifier:C(Z),BoundingBox:C(GE)})),Xk=j(Ki,{TopLeftCorner:C(Fm),ScaleDenominator:C(Ve),TileWidth:C(Ct),TileHeight:C(Ct),MatrixWidth:C(Ct),MatrixHeight:C(Ct)},j(Ua,{Identifier:C(Z)}));function Zk(n,e){return V({},$k,n,e)}function Wk(n,e){return V({},Dk,n,e)}function Hk(n,e){return V({},Yk,n,e)}function Kk(n,e){const t=V({},Gk,n,e);if(!t)return;const i=n.getAttribute("isDefault")==="true";return t.isDefault=i,t}function qk(n,e){return V({},Uk,n,e)}function Jk(n,e){return V({},jk,n,e)}function Qk(n,e){const t=n.getAttribute("format"),i=n.getAttribute("template"),r=n.getAttribute("resourceType"),s={};return t&&(s.format=t),i&&(s.template=i),r&&(s.resourceType=r),s}function GE(n,e){const t=V([],Vk,n,e);if(t.length==2)return yt(t)}function e$(n,e){const t={};return t.format=n.getAttribute("format"),t.href=wo(n),t}function Fm(n,e){const t=Z(n).split(/\s+/);if(!t||t.length!=2)return;const i=+t[0],r=+t[1];if(!(isNaN(i)||isNaN(r)))return[i,r]}function t$(n,e){return V({},Xk,n,e)}function n$(n,e){return V([],zk,n,e)}function i$(n,e){return V({},Bk,n,e)}var r$=kk;function Nm(n,e,t){const i=[];let r=n(0),s=n(1),o=e(r),a=e(s);const c=[s,r],l=[a,o],u=[1,0],h={};let d=1e5,f,p,m,g,y,_;for(;--d>0&&u.length>0;)m=u.pop(),r=c.pop(),o=l.pop(),_=m.toString(),_ in h||(i.push(o[0],o[1]),h[_]=!0),g=u.pop(),s=c.pop(),a=l.pop(),y=(m+g)/2,f=n(y),p=e(f),gp(p[0],p[1],o[0],o[1],a[0],a[1])<t?(i.push(a[0],a[1]),_=g.toString(),h[_]=!0):(u.push(g,y,y,m),l.push(a,p,p,o),c.push(s,f,f,r));return i}function s$(n,e,t,i,r,s){const o=re("EPSG:4326"),a=Math.cos(zt(e)),c=Math.sin(zt(e)),l=Math.cos(zt(i)),u=Math.sin(zt(i)),h=Math.cos(zt(t-n)),d=Math.sin(zt(t-n)),f=c*u+a*l*h;return Nm(function(p){if(1<=f)return[t,i];const m=p*Math.acos(f),g=Math.cos(m),y=Math.sin(m),_=d*l,v=a*u-c*l*h,x=Math.atan2(_,v),w=Math.asin(c*g+a*y*Math.cos(x)),E=zt(n)+Math.atan2(Math.sin(x)*y*a,g-c*Math.sin(w));return[Ll(E),Ll(w)]},Ei(o,r),s)}function UE(n,e,t,i,r){const s=re("EPSG:4326");return Nm(function(o){return[n,e+(t-e)*o]},Ei(s,i),r)}function zE(n,e,t,i,r){const s=re("EPSG:4326");return Nm(function(o){return[e+(t-e)*o,n]},Ei(s,i),r)}function o$(n,e,t,i){const r=t-i;return n[e]===n[r]&&n[e+1]===n[r+1]&&(t-e)/i>3?!!lh(n,e,t,i):!1}function a$(n,e){const t=n.canvas,i=e||{},r=i.pixelRatio||Uu,s=i.size;s&&(t.width=s[0]*r,t.height=s[1]*r,t.style.width=s[0]+"px",t.style.height=s[1]+"px");const o=[0,0,t.width,t.height],a=Jo(dt(),r,r);return new Fh(n,r,o,a,0)}function BE(n){if(!(n.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");const e=n.inversePixelTransform[0],t=n.frameState,i=js(n.inversePixelTransform.slice(),t.coordinateToPixelTransform),r=Nh(t.viewState.resolution,e);let s;const o=En();return o&&(s=qn(o,t.viewState.projection)),new Fh(n.context,e,t.extent,i,t.viewState.rotation,r,s)}function l$(n,e){return Je(n.inversePixelTransform,e.slice(0))}const c$=new Sn({color:"rgba(0,0,0,0.2)"}),u$=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001];class h$ extends fs{constructor(e){const t=e||{},i=J({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},t);delete i.maxLines,delete i.strokeStyle,delete i.targetSize,delete i.showLabels,delete i.lonLabelFormatter,delete i.latLabelFormatter,delete i.lonLabelPosition,delete i.latLabelPosition,delete i.lonLabelStyle,delete i.latLabelStyle,delete i.intervals,super(i),this.projection_=null,this.maxLat_=1/0,this.maxLon_=1/0,this.minLat_=-1/0,this.minLon_=-1/0,this.maxX_=1/0,this.maxY_=1/0,this.minX_=-1/0,this.minY_=-1/0,this.targetSize_=t.targetSize!==void 0?t.targetSize:100,this.maxLines_=t.maxLines!==void 0?t.maxLines:100,this.meridians_=[],this.parallels_=[],this.strokeStyle_=t.strokeStyle!==void 0?t.strokeStyle:c$,this.fromLonLatTransform_=void 0,this.toLonLatTransform_=void 0,this.projectionCenterLonLat_=null,this.bottomLeft_=null,this.bottomRight_=null,this.topLeft_=null,this.topRight_=null,this.meridiansLabels_=null,this.parallelsLabels_=null,t.showLabels&&(this.lonLabelFormatter_=t.lonLabelFormatter==null?Ol.bind(this,"EW"):t.lonLabelFormatter,this.latLabelFormatter_=t.latLabelFormatter==null?Ol.bind(this,"NS"):t.latLabelFormatter,this.lonLabelPosition_=t.lonLabelPosition==null?0:t.lonLabelPosition,this.latLabelPosition_=t.latLabelPosition==null?1:t.latLabelPosition,this.lonLabelStyleBase_=new yn({text:t.lonLabelStyle!==void 0?t.lonLabelStyle.clone():new Sa({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new Vn({color:"rgba(0,0,0,1)"}),stroke:new Sn({color:"rgba(255,255,255,1)",width:3})})}),this.lonLabelStyle_=function(r){const s=r.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(s),this.lonLabelStyleBase_}.bind(this),this.latLabelStyleBase_=new yn({text:t.latLabelStyle!==void 0?t.latLabelStyle.clone():new Sa({font:"12px Calibri,sans-serif",textAlign:"right",fill:new Vn({color:"rgba(0,0,0,1)"}),stroke:new Sn({color:"rgba(255,255,255,1)",width:3})})}),this.latLabelStyle_=function(r){const s=r.get("graticule_label");return this.latLabelStyleBase_.getText().setText(s),this.latLabelStyleBase_}.bind(this),this.meridiansLabels_=[],this.parallelsLabels_=[],this.addEventListener(Tn.POSTRENDER,this.drawLabels_.bind(this))),this.intervals_=t.intervals!==void 0?t.intervals:u$,this.setSource(new ho({loader:this.loaderFunction.bind(this),strategy:this.strategyFunction.bind(this),features:new At,overlaps:!1,useSpatialIndex:!1,wrapX:t.wrapX})),this.featurePool_=[],this.lineStyle_=new yn({stroke:this.strokeStyle_}),this.loadedExtent_=null,this.renderedExtent_=null,this.renderedResolution_=null,this.setRenderOrder(null)}strategyFunction(e,t){let i=e.slice();return this.projection_&&this.getSource().getWrapX()&&fp(i,this.projection_),this.loadedExtent_&&(W_(this.loadedExtent_,i,t)?i=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[i]}loaderFunction(e,t,i){this.loadedExtent_=e;const r=this.getSource(),s=this.getExtent()||[-1/0,-1/0,1/0,1/0],o=an(s,e);if(this.renderedExtent_&&Kn(this.renderedExtent_,o)&&this.renderedResolution_===t||(this.renderedExtent_=o,this.renderedResolution_=t,Qr(o)))return;const a=Ut(o),c=t*t/4;(!this.projection_||!Gn(this.projection_,i))&&this.updateProjectionInfo_(i),this.createGraticule_(o,a,t,c);let u=this.meridians_.length+this.parallels_.length;this.meridiansLabels_&&(u+=this.meridians_.length),this.parallelsLabels_&&(u+=this.parallels_.length);let h;for(;u>this.featurePool_.length;)h=new it,this.featurePool_.push(h);const d=r.getFeaturesCollection();d.clear();let f=0,p,m;for(p=0,m=this.meridians_.length;p<m;++p)h=this.featurePool_[f++],h.setGeometry(this.meridians_[p]),h.setStyle(this.lineStyle_),d.push(h);for(p=0,m=this.parallels_.length;p<m;++p)h=this.featurePool_[f++],h.setGeometry(this.parallels_[p]),h.setStyle(this.lineStyle_),d.push(h)}addMeridian_(e,t,i,r,s,o){const a=this.getMeridian_(e,t,i,r,o);if(at(a.getExtent(),s)){if(this.meridiansLabels_){const c=this.lonLabelFormatter_(e);o in this.meridiansLabels_?this.meridiansLabels_[o].text=c:this.meridiansLabels_[o]={geom:new ft([]),text:c}}this.meridians_[o++]=a}return o}addParallel_(e,t,i,r,s,o){const a=this.getParallel_(e,t,i,r,o);if(at(a.getExtent(),s)){if(this.parallelsLabels_){const c=this.latLabelFormatter_(e);o in this.parallelsLabels_?this.parallelsLabels_[o].text=c:this.parallelsLabels_[o]={geom:new ft([]),text:c}}this.parallels_[o++]=a}return o}drawLabels_(e){const t=e.frameState.viewState.rotation,i=e.frameState.viewState.resolution,r=e.frameState.size,s=e.frameState.extent,o=Ut(s);let a=s;if(t){const p=r[0]*i,m=r[1]*i;a=[o[0]-p/2,o[1]-m/2,o[0]+p/2,o[1]+m/2]}let c=0,l=0,u=this.latLabelPosition_<.5;const h=this.projection_.getExtent(),d=be(h);if(this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Gt(h,s)){c=Math.floor((s[0]-h[0])/d),l=Math.ceil((s[2]-h[2])/d);const p=Math.abs(t)>Math.PI/2;u=u!==p}const f=BE(e);for(let p=c;p<=l;++p){let m=this.meridians_.length+this.parallels_.length,g,y,_,v;if(this.meridiansLabels_)for(y=0,_=this.meridiansLabels_.length;y<_;++y){const x=this.meridians_[y];if(!t&&p===0)v=this.getMeridianPoint_(x,s,y);else{const w=x.clone();w.translate(p*d,0),w.rotate(-t,o),v=this.getMeridianPoint_(w,a,y),v.rotate(t,o)}g=this.featurePool_[m++],g.setGeometry(v),g.set("graticule_label",this.meridiansLabels_[y].text),f.drawFeature(g,this.lonLabelStyle_(g))}if(this.parallelsLabels_&&(p===c&&u||p===l&&!u))for(y=0,_=this.parallels_.length;y<_;++y){const x=this.parallels_[y];if(!t&&p===0)v=this.getParallelPoint_(x,s,y);else{const w=x.clone();w.translate(p*d,0),w.rotate(-t,o),v=this.getParallelPoint_(w,a,y),v.rotate(t,o)}g=this.featurePool_[m++],g.setGeometry(v),g.set("graticule_label",this.parallelsLabels_[y].text),f.drawFeature(g,this.latLabelStyle_(g))}}}createGraticule_(e,t,i,r){const s=this.getInterval_(i);if(s==-1){this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),this.parallelsLabels_&&(this.parallelsLabels_.length=0);return}let o=!1;const a=this.projection_.getExtent(),c=be(a);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Gt(a,e)&&(be(e)>=c?(e[0]=a[0],e[2]=a[2]):o=!0);const l=[we(t[0],this.minX_,this.maxX_),we(t[1],this.minY_,this.maxY_)],u=this.toLonLatTransform_(l);isNaN(u[1])&&(u[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);let h=we(u[0],this.minLon_,this.maxLon_),d=we(u[1],this.minLat_,this.maxLat_);const f=this.maxLines_;let p,m,g,y,_=e;o||(_=[we(e[0],this.minX_,this.maxX_),we(e[1],this.minY_,this.maxY_),we(e[2],this.minX_,this.maxX_),we(e[3],this.minY_,this.maxY_)]);const v=Ks(_,this.toLonLatTransform_,void 0,8);let x=v[3],w=v[2],E=v[1],T=v[0];if(o||(kn(_,this.bottomLeft_)&&(T=this.minLon_,E=this.minLat_),kn(_,this.bottomRight_)&&(w=this.maxLon_,E=this.minLat_),kn(_,this.topLeft_)&&(T=this.minLon_,x=this.maxLat_),kn(_,this.topRight_)&&(w=this.maxLon_,x=this.maxLat_),x=we(x,d,this.maxLat_),w=we(w,h,this.maxLon_),E=we(E,this.minLat_,d),T=we(T,this.minLon_,h)),h=Math.floor(h/s)*s,y=we(h,this.minLon_,this.maxLon_),m=this.addMeridian_(y,E,x,r,e,0),p=0,o)for(;(y-=s)>=T&&p++<f;)m=this.addMeridian_(y,E,x,r,e,m);else for(;y!=this.minLon_&&p++<f;)y=Math.max(y-s,this.minLon_),m=this.addMeridian_(y,E,x,r,e,m);if(y=we(h,this.minLon_,this.maxLon_),p=0,o)for(;(y+=s)<=w&&p++<f;)m=this.addMeridian_(y,E,x,r,e,m);else for(;y!=this.maxLon_&&p++<f;)y=Math.min(y+s,this.maxLon_),m=this.addMeridian_(y,E,x,r,e,m);for(this.meridians_.length=m,this.meridiansLabels_&&(this.meridiansLabels_.length=m),d=Math.floor(d/s)*s,g=we(d,this.minLat_,this.maxLat_),m=this.addParallel_(g,T,w,r,e,0),p=0;g!=this.minLat_&&p++<f;)g=Math.max(g-s,this.minLat_),m=this.addParallel_(g,T,w,r,e,m);for(g=we(d,this.minLat_,this.maxLat_),p=0;g!=this.maxLat_&&p++<f;)g=Math.min(g+s,this.maxLat_),m=this.addParallel_(g,T,w,r,e,m);this.parallels_.length=m,this.parallelsLabels_&&(this.parallelsLabels_.length=m)}getInterval_(e){const t=this.projectionCenterLonLat_[0],i=this.projectionCenterLonLat_[1];let r=-1;const s=Math.pow(this.targetSize_*e,2),o=[],a=[];for(let c=0,l=this.intervals_.length;c<l;++c){const u=we(this.intervals_[c]/2,0,90),h=we(i,-90+u,90-u);if(o[0]=t-u,o[1]=h-u,a[0]=t+u,a[1]=h+u,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(a,a),Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)<=s)break;r=this.intervals_[c]}return r}getMeridian_(e,t,i,r,s){const o=UE(e,t,i,this.projection_,r);let a=this.meridians_[s];return a?(a.setFlatCoordinates(H.XY,o),a.changed()):(a=new Tt(o,H.XY),this.meridians_[s]=a),a}getMeridianPoint_(e,t,i){const r=e.getFlatCoordinates();let s=1,o=r.length-1;r[s]>r[o]&&(s=o,o=1);const a=Math.max(t[1],r[s]),c=Math.min(t[3],r[o]),l=we(t[1]+Math.abs(t[1]-t[3])*this.lonLabelPosition_,a,c),h=[r[s-1]+(r[o-1]-r[s-1])*(l-r[s])/(r[o]-r[s]),l],d=this.meridiansLabels_[i].geom;return d.setCoordinates(h),d}getMeridians(){return this.meridians_}getParallel_(e,t,i,r,s){const o=zE(e,t,i,this.projection_,r);let a=this.parallels_[s];return a?(a.setFlatCoordinates(H.XY,o),a.changed()):a=new Tt(o,H.XY),a}getParallelPoint_(e,t,i){const r=e.getFlatCoordinates();let s=0,o=r.length-2;r[s]>r[o]&&(s=o,o=0);const a=Math.max(t[0],r[s]),c=Math.min(t[2],r[o]),l=we(t[0]+Math.abs(t[0]-t[2])*this.latLabelPosition_,a,c),u=r[s+1]+(r[o+1]-r[s+1])*(l-r[s])/(r[o]-r[s]),h=[l,u],d=this.parallelsLabels_[i].geom;return d.setCoordinates(h),d}getParallels(){return this.parallels_}updateProjectionInfo_(e){const t=re("EPSG:4326"),i=e.getWorldExtent();this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0];const r=Ei(e,t);if(this.minLon_<this.maxLon_)this.toLonLatTransform_=r;else{const o=this.minLon_+this.maxLon_/2;this.maxLon_+=360,this.toLonLatTransform_=function(a,c,l){const u=l||2,h=r(a,c,u);for(let d=0,f=h.length;d<f;d+=u)h[d]<o&&(h[d]+=360);return h}}this.fromLonLatTransform_=Ei(t,e);const s=Ks([this.minLon_,this.minLat_,this.maxLon_,this.maxLat_],this.fromLonLatTransform_,void 0,8);this.minX_=s[0],this.maxX_=s[2],this.minY_=s[1],this.maxY_=s[3],this.bottomLeft_=this.fromLonLatTransform_([this.minLon_,this.minLat_]),this.bottomRight_=this.fromLonLatTransform_([this.maxLon_,this.minLat_]),this.topLeft_=this.fromLonLatTransform_([this.minLon_,this.maxLat_]),this.topRight_=this.fromLonLatTransform_([this.maxLon_,this.maxLat_]),this.projectionCenterLonLat_=this.toLonLatTransform_(Ut(e.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=e}}var km=h$;class d$ extends oo{constructor(e){const t=e||{};super(t)}}var jE=d$,Tr={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class f$ extends oo{constructor(e){const t=e||{},i=J({},t);delete i.preload,delete i.useInterimTilesOnError,super(i),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(Tr.PRELOAD)}setPreload(e){this.set(Tr.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Tr.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Tr.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}var $m=f$;const za=34962,Ac=34963,VE=35040,xd=35044,Pc=35048,YE=5121,XE=5123,ZE=5125,Dm=5126,WE=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function vd(n,e){const t=J({preserveDrawingBuffer:!0},e),i=WE.length;for(let r=0;r<i;++r)try{const s=n.getContext(WE[r],t);if(s)return s}catch{}return null}let Gm;function p$(){if(!Gm){const n=document.createElement("canvas"),e=vd(n);e&&(Gm=e.getSupportedExtensions())}return Gm}const HE={STATIC_DRAW:xd,STREAM_DRAW:VE,DYNAMIC_DRAW:Pc};class g${constructor(e,t){this.array=null,this.type=e,ce(e===za||e===Ac,62),this.usage=t!==void 0?t:HE.STATIC_DRAW}ofSize(e){this.array=new(wd(this.type))(e)}fromArray(e){const t=wd(this.type);this.array=t.from?t.from(e):new t(e)}fromArrayBuffer(e){this.array=new(wd(this.type))(e)}getType(){return this.type}getArray(){return this.array}getUsage(){return this.usage}getSize(){return this.array?this.array.length:0}}function wd(n){switch(n){case za:return Float32Array;case Ac:return Uint32Array;default:return Float32Array}}var Ba=g$,Oc={LOST:"webglcontextlost",RESTORED:"webglcontextrestored"};const m$=`
|
10
|
+
precision mediump float;
|
11
|
+
|
12
|
+
attribute vec2 a_position;
|
13
|
+
varying vec2 v_texCoord;
|
14
|
+
varying vec2 v_screenCoord;
|
15
|
+
|
16
|
+
uniform vec2 u_screenSize;
|
17
|
+
|
18
|
+
void main() {
|
19
|
+
v_texCoord = a_position * 0.5 + 0.5;
|
20
|
+
v_screenCoord = v_texCoord * u_screenSize;
|
21
|
+
gl_Position = vec4(a_position, 0.0, 1.0);
|
22
|
+
}
|
23
|
+
`,y$=`
|
24
|
+
precision mediump float;
|
25
|
+
|
26
|
+
uniform sampler2D u_image;
|
27
|
+
uniform float u_opacity;
|
28
|
+
|
29
|
+
varying vec2 v_texCoord;
|
30
|
+
|
31
|
+
void main() {
|
32
|
+
gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;
|
33
|
+
}
|
34
|
+
`;class _${constructor(e){this.gl_=e.webGlContext;const t=this.gl_;this.scaleRatio_=e.scaleRatio||1,this.renderTargetTexture_=t.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=t.createFramebuffer();const i=t.createShader(t.VERTEX_SHADER);t.shaderSource(i,e.vertexShader||m$),t.compileShader(i);const r=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(r,e.fragmentShader||y$),t.compileShader(r),this.renderTargetProgram_=t.createProgram(),t.attachShader(this.renderTargetProgram_,i),t.attachShader(this.renderTargetProgram_,r),t.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=t.createBuffer();const s=[-1,-1,1,-1,-1,1,1,-1,1,1,-1,1];t.bindBuffer(t.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),t.bufferData(t.ARRAY_BUFFER,new Float32Array(s),t.STATIC_DRAW),this.renderTargetAttribLocation_=t.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=t.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],e.uniforms&&Object.keys(e.uniforms).forEach(function(o){this.uniforms_.push({value:e.uniforms[o],location:t.getUniformLocation(this.renderTargetProgram_,o)})}.bind(this))}getGL(){return this.gl_}init(e){const t=this.getGL(),i=[t.drawingBufferWidth*this.scaleRatio_,t.drawingBufferHeight*this.scaleRatio_];if(t.bindFramebuffer(t.FRAMEBUFFER,this.getFrameBuffer()),t.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const r=0,s=t.RGBA,o=0,a=t.RGBA,c=t.UNSIGNED_BYTE,l=null;t.bindTexture(t.TEXTURE_2D,this.renderTargetTexture_),t.texImage2D(t.TEXTURE_2D,r,s,i[0],i[1],o,a,c,l),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.renderTargetTexture_,0)}}apply(e,t,i,r){const s=this.getGL(),o=e.size;if(s.bindFramebuffer(s.FRAMEBUFFER,t?t.getFrameBuffer():null),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.renderTargetTexture_),!t){const c=se(s.canvas);if(!e.renderTargets[c]){const l=s.getContextAttributes();l&&l.preserveDrawingBuffer&&(s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),e.renderTargets[c]=!0}}s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.viewport(0,0,s.drawingBufferWidth,s.drawingBufferHeight),s.bindBuffer(s.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),s.useProgram(this.renderTargetProgram_),s.enableVertexAttribArray(this.renderTargetAttribLocation_),s.vertexAttribPointer(this.renderTargetAttribLocation_,2,s.FLOAT,!1,0,0),s.uniform2f(this.renderTargetUniformLocation_,o[0],o[1]),s.uniform1i(this.renderTargetTextureLocation_,0);const a=e.layerStatesArray[e.layerIndex].opacity;s.uniform1f(this.renderTargetOpacityLocation_,a),this.applyUniforms(e),i&&i(s,e),s.drawArrays(s.TRIANGLES,0,6),r&&r(s,e)}getFrameBuffer(){return this.frameBuffer_}applyUniforms(e){const t=this.getGL();let i,r=1;this.uniforms_.forEach(function(s){if(i=typeof s.value=="function"?s.value(e):s.value,i instanceof HTMLCanvasElement||i instanceof ImageData)s.texture||(s.texture=t.createTexture()),t.activeTexture(t[`TEXTURE${r}`]),t.bindTexture(t.TEXTURE_2D,s.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),i instanceof ImageData?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,i.width,i.height,0,t.UNSIGNED_BYTE,new Uint8Array(i.data)):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i),t.uniform1i(s.location,r++);else if(Array.isArray(i))switch(i.length){case 2:t.uniform2f(s.location,i[0],i[1]);return;case 3:t.uniform3f(s.location,i[0],i[1],i[2]);return;case 4:t.uniform4f(s.location,i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&t.uniform1f(s.location,i)})}}var Um=_$;function zm(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Mc(n,e){return n[0]=e[0],n[1]=e[1],n[4]=e[2],n[5]=e[3],n[12]=e[4],n[13]=e[5],n}const x$={FRAGMENT_SHADER:35632,VERTEX_SHADER:35633},bo={PROJECTION_MATRIX:"u_projectionMatrix",OFFSET_SCALE_MATRIX:"u_offsetScaleMatrix",OFFSET_ROTATION_MATRIX:"u_offsetRotateMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution"},Jn={UNSIGNED_BYTE:YE,UNSIGNED_SHORT:XE,UNSIGNED_INT:ZE,FLOAT:Dm},Ed={};function KE(n){return"shared/"+n}let qE=0;function v$(){const n="unique/"+qE;return qE+=1,n}function w$(n){let e=Ed[n];if(!e){const t=document.createElement("canvas");t.style.position="absolute",t.style.left="0",e={users:0,canvas:t},Ed[n]=e}return e.users+=1,e.canvas}function E$(n){const e=Ed[n];if(!e||(e.users-=1,e.users>0))return;const t=e.canvas,r=vd(t).getExtension("WEBGL_lose_context");r&&r.loseContext(),delete Ed[n]}class T$ extends Us{constructor(e){super();const t=e||{};this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?KE(t.canvasCacheKey):v$(),this.canvas_=w$(this.canvasCacheKey_),this.gl_=vd(this.canvas_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.canvas_.addEventListener(Oc.LOST,this.boundHandleWebGLContextLost_),this.canvas_.addEventListener(Oc.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=dt(),this.offsetScaleMatrix_=dt(),this.tmpMat4_=zm(),this.uniformLocations_={},this.attribLocations_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms);const i=this.getGL();this.postProcessPasses_=t.postProcesses?t.postProcesses.map(function(r){return new Um({webGlContext:i,scaleRatio:r.scaleRatio,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,uniforms:r.uniforms})}):[new Um({webGlContext:i})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(e){this.uniforms_=[];for(const t in e)this.uniforms_.push({name:t,value:e[t]});this.uniformLocations_={}}canvasCacheKeyMatches(e){return this.canvasCacheKey_===KE(e)}getExtension(e){if(e in this.extensionCache_)return this.extensionCache_[e];const t=this.gl_.getExtension(e);return this.extensionCache_[e]=t,t}bindBuffer(e){const t=this.getGL(),i=se(e);let r=this.bufferCache_[i];if(!r){const s=t.createBuffer();r={buffer:e,webGlBuffer:s},this.bufferCache_[i]=r}t.bindBuffer(e.getType(),r.webGlBuffer)}flushBufferData(e){const t=this.getGL();this.bindBuffer(e),t.bufferData(e.getType(),e.getArray(),e.getUsage())}deleteBuffer(e){const t=this.getGL(),i=se(e),r=this.bufferCache_[i];r&&!t.isContextLost()&&t.deleteBuffer(r.webGlBuffer),delete this.bufferCache_[i]}disposeInternal(){this.canvas_.removeEventListener(Oc.LOST,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(Oc.RESTORED,this.boundHandleWebGLContextRestored_),E$(this.canvasCacheKey_),delete this.gl_,delete this.canvas_}prepareDraw(e,t){const i=this.getGL(),r=this.getCanvas(),s=e.size,o=e.pixelRatio;r.width=s[0]*o,r.height=s[1]*o,r.style.width=s[0]+"px",r.style.height=s[1]+"px",i.useProgram(this.currentProgram_);for(let a=this.postProcessPasses_.length-1;a>=0;a--)this.postProcessPasses_[a].init(e);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,t?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(e),this.applyUniforms(e)}prepareDrawToRenderTarget(e,t,i){const r=this.getGL(),s=t.getSize();r.bindFramebuffer(r.FRAMEBUFFER,t.getFramebuffer()),r.viewport(0,0,s[0],s[1]),r.bindTexture(r.TEXTURE_2D,t.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(e),this.applyUniforms(e)}drawElements(e,t){const i=this.getGL();this.getExtension("OES_element_index_uint");const r=i.UNSIGNED_INT,s=4,o=t-e,a=e*s;i.drawElements(i.TRIANGLES,o,r,a)}finalizeDraw(e,t,i){for(let r=0,s=this.postProcessPasses_.length;r<s;r++)r===s-1?this.postProcessPasses_[r].apply(e,null,t,i):this.postProcessPasses_[r].apply(e,this.postProcessPasses_[r+1])}getCanvas(){return this.canvas_}getGL(){return this.gl_}applyFrameState(e){const t=e.size,i=e.viewState.rotation,r=Ko(this.offsetScaleMatrix_);Jo(r,2/t[0],2/t[1]);const s=Ko(this.offsetRotateMatrix_);i!==0&&j_(s,-i),this.setUniformMatrixValue(bo.OFFSET_SCALE_MATRIX,Mc(this.tmpMat4_,r)),this.setUniformMatrixValue(bo.OFFSET_ROTATION_MATRIX,Mc(this.tmpMat4_,s)),this.setUniformFloatValue(bo.TIME,(Date.now()-this.startTime_)*.001),this.setUniformFloatValue(bo.ZOOM,e.viewState.zoom),this.setUniformFloatValue(bo.RESOLUTION,e.viewState.resolution)}applyUniforms(e){const t=this.getGL();let i,r=0;this.uniforms_.forEach(function(s){if(i=typeof s.value=="function"?s.value(e):s.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData)s.texture||(s.prevValue=void 0,s.texture=t.createTexture()),t.activeTexture(t[`TEXTURE${r}`]),t.bindTexture(t.TEXTURE_2D,s.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(!(i instanceof HTMLImageElement)||i.complete)&&s.prevValue!==i&&(s.prevValue=i,t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)),t.uniform1i(this.getUniformLocation(s.name),r++);else if(Array.isArray(i)&&i.length===6)this.setUniformMatrixValue(s.name,Mc(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:t.uniform2f(this.getUniformLocation(s.name),i[0],i[1]);return;case 3:t.uniform3f(this.getUniformLocation(s.name),i[0],i[1],i[2]);return;case 4:t.uniform4f(this.getUniformLocation(s.name),i[0],i[1],i[2],i[3]);return;default:return}else typeof i=="number"&&t.uniform1f(this.getUniformLocation(s.name),i)}.bind(this))}useProgram(e){return e==this.currentProgram_?!1:(this.getGL().useProgram(e),this.currentProgram_=e,this.uniformLocations_={},this.attribLocations_={},!0)}compileShader(e,t){const i=this.getGL(),r=i.createShader(t);return i.shaderSource(r,e),i.compileShader(r),r}getProgram(e,t){const i=this.getGL(),r=this.compileShader(e,i.FRAGMENT_SHADER),s=this.compileShader(t,i.VERTEX_SHADER),o=i.createProgram();if(i.attachShader(o,r),i.attachShader(o,s),i.linkProgram(o),!i.getShaderParameter(r,i.COMPILE_STATUS)){const a=`Fragment shader compliation failed: ${i.getShaderInfoLog(r)}`;throw new Error(a)}if(i.deleteShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS)){const a=`Vertex shader compilation failed: ${i.getShaderInfoLog(s)}`;throw new Error(a)}if(i.deleteShader(s),!i.getProgramParameter(o,i.LINK_STATUS)){const a=`GL program linking failed: ${i.getShaderInfoLog(s)}`;throw new Error(a)}return o}getUniformLocation(e){return this.uniformLocations_[e]===void 0&&(this.uniformLocations_[e]=this.getGL().getUniformLocation(this.currentProgram_,e)),this.uniformLocations_[e]}getAttributeLocation(e){return this.attribLocations_[e]===void 0&&(this.attribLocations_[e]=this.getGL().getAttribLocation(this.currentProgram_,e)),this.attribLocations_[e]}makeProjectionTransform(e,t){const i=e.size,r=e.viewState.rotation,s=e.viewState.resolution,o=e.viewState.center;return Ko(t),Ht(t,0,0,2/(s*i[0]),2/(s*i[1]),-r,-o[0],-o[1]),t}setUniformFloatValue(e,t){this.getGL().uniform1f(this.getUniformLocation(e),t)}setUniformFloatVec4(e,t){this.getGL().uniform4fv(this.getUniformLocation(e),t)}setUniformMatrixValue(e,t){this.getGL().uniformMatrix4fv(this.getUniformLocation(e),!1,t)}enableAttributeArray_(e,t,i,r,s){const o=this.getAttributeLocation(e);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,t,i,!1,r,s))}enableAttributes(e){const t=JE(e);let i=0;for(let r=0;r<e.length;r++){const s=e[r];this.enableAttributeArray_(s.name,s.size,s.type||Dm,t,i),i+=s.size*QE(s.type)}}handleWebGLContextLost(){Zr(this.bufferCache_),this.currentProgram_=null}handleWebGLContextRestored(){}createTexture(e,t,i){const r=this.getGL(),s=i||r.createTexture(),o=0,a=r.RGBA,c=0,l=r.RGBA,u=r.UNSIGNED_BYTE;return r.bindTexture(r.TEXTURE_2D,s),t?r.texImage2D(r.TEXTURE_2D,o,a,l,u,t):r.texImage2D(r.TEXTURE_2D,o,a,e[0],e[1],c,l,u,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),s}}function JE(n){let e=0;for(let t=0;t<n.length;t++){const i=n[t];e+=i.size*QE(i.type)}return e}function QE(n){switch(n){case Jn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Jn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Jn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Jn.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var eT=T$;const Td={GENERATE_BUFFERS:"GENERATE_BUFFERS"};class l_ extends Dg{constructor(e,t){super(e);const i=t||{};this.inversePixelTransform_=dt(),this.pixelContext_=null,this.postProcesses_=i.postProcesses,this.uniforms_=i.uniforms,this.helper,e.addChangeListener(We.MAP,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(e,t){const i=this.getLayer();if(i.hasListener(Tn.PRECOMPOSE)){const r=new ca(Tn.PRECOMPOSE,void 0,t,e);i.dispatchEvent(r)}}dispatchPostComposeEvent(e,t){const i=this.getLayer();if(i.hasListener(Tn.POSTCOMPOSE)){const r=new ca(Tn.POSTCOMPOSE,void 0,t,e);i.dispatchEvent(r)}}reset(e){this.uniforms_=e.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(e){if(this.getLayer().getRenderSource()){let t=!0,i=-1,r;for(let o=0,a=e.layerStatesArray.length;o<a;o++){const c=e.layerStatesArray[o].layer,l=c.getRenderer();if(!(l instanceof l_)){t=!0;continue}const u=c.getClassName();if((t||u!==r)&&(i+=1,t=!1),r=u,l===this)break}const s="map/"+e.mapId+"/group/"+i;(!this.helper||!this.helper.canvasCacheKeyMatches(s))&&(this.removeHelper(),this.helper=new eT({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:s}),r&&(this.helper.getCanvas().className=r),this.afterHelperCreated())}return this.prepareFrameInternal(e)}afterHelperCreated(){}prepareFrameInternal(e){return!0}disposeInternal(){this.removeHelper(),super.disposeInternal()}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){Ht(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);const s=new ca(e,this.inversePixelTransform_,i,t);r.dispatchEvent(s)}}preRender(e,t){this.dispatchRenderEvent_(Tn.PRERENDER,e,t)}postRender(e,t){this.dispatchRenderEvent_(Tn.POSTRENDER,e,t)}getDataAtPixel(e,t,i){const r=Je([t.pixelRatio,0,0,t.pixelRatio,0,0],e.slice()),s=this.helper.getGL();if(!s)return null;const a=this.getLayer().getExtent();if(a){const f=Je(t.pixelToCoordinateTransform,e.slice());if(!kn(a,f))return null}const c=s.getContextAttributes();if(!c||!c.preserveDrawingBuffer)return new Uint8Array;const l=Math.round(r[0]),u=Math.round(r[1]);let h=this.pixelContext_;if(!h){const f=document.createElement("canvas");f.width=1,f.height=1,h=f.getContext("2d"),this.pixelContext_=h}h.clearRect(0,0,1,1);let d;try{h.drawImage(s.canvas,l,u,1,1,0,0,1,1),d=h.getImageData(0,0,1,1).data}catch{return d}return d[3]===0?null:d}}const b$=[],Bm={vertexPosition:0,indexPosition:0};function bd(n,e,t,i,r){n[e+0]=t,n[e+1]=i,n[e+2]=r}function S$(n,e,t,i,r,s){const c=3+r,l=n[e+0],u=n[e+1],h=b$;h.length=r;for(let m=0;m<h.length;m++)h[m]=n[e+2+m];let d=s?s.vertexPosition:0,f=s?s.indexPosition:0;const p=d/c;return bd(t,d,l,u,0),h.length&&t.set(h,d+3),d+=c,bd(t,d,l,u,1),h.length&&t.set(h,d+3),d+=c,bd(t,d,l,u,2),h.length&&t.set(h,d+3),d+=c,bd(t,d,l,u,3),h.length&&t.set(h,d+3),d+=c,i[f++]=p,i[f++]=p+1,i[f++]=p+3,i[f++]=p+1,i[f++]=p+2,i[f++]=p+3,Bm.vertexPosition=d,Bm.indexPosition=f,Bm}function R$(){const e=document.createElement("canvas").getContext("2d").createImageData(1,1);return e.data[0]=255,e.data[1]=255,e.data[2]=255,e.data[3]=255,e}function tT(n,e){const t=e||[],i=256,r=i-1;return t[0]=Math.floor(n/i/i/i)/r,t[1]=Math.floor(n/i/i)%i/r,t[2]=Math.floor(n/i)%i/r,t[3]=n%i/r,t}function nT(n){let e=0;const t=256,i=t-1;return e+=Math.round(n[0]*t*t*t*i),e+=Math.round(n[1]*t*t*i),e+=Math.round(n[2]*t*i),e+=Math.round(n[3]*i),e}var jm=l_;const qi=new Uint8Array(4);class I${constructor(e,t){this.helper_=e;const i=e.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.size_=t||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(e){Gi(e,this.size_)||(this.size_[0]=e[0],this.size_[1]=e[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const e=this.size_,t=this.helper_.getGL();t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer_),t.readPixels(0,0,e[0],e[1],t.RGBA,t.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(e,t){if(e<0||t<0||e>this.size_[0]||t>=this.size_[1])return qi[0]=0,qi[1]=0,qi[2]=0,qi[3]=0,qi;this.readAll();const i=Math.floor(e)+(this.size_[1]-Math.floor(t)-1)*this.size_[0];return qi[0]=this.data_[i*4],qi[1]=this.data_[i*4+1],qi[2]=this.data_[i*4+2],qi[3]=this.data_[i*4+3],qi}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}updateSize_(){const e=this.size_,t=this.helper_.getGL();this.texture_=this.helper_.createTexture(e,null,this.texture_),t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer_),t.viewport(0,0,e[0],e[1]),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(e[0]*e[1]*4)}}var iT=I$;function C$(){const n='var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,a){var u=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=a?a.vertexPosition:0,h=a?a.indexPosition:0,d=b/u;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=u,l,v,1),c.length&&i.set(c,b+3),o(i,b+=u,l,v,2),c.length&&i.set(c,b+3),o(i,b+=u,l,v,3),c.length&&i.set(c,b+3),b+=u,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o,s=r.customAttributesCount,a=2+s,u=new Float32Array(r.renderInstructions),l=u.length/a,v=4*l*(s+3),c=new Uint32Array(6*l),g=new Float32Array(v),b=0;b<u.length;b+=a)o=i(u,b,g,c,s,o);var h=e({vertexBuffer:g.buffer,indexBuffer:c.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[g.buffer,c.buffer,u.buffer])}};';return new Worker(typeof Blob=="undefined"?"data:application/javascript;base64,"+Buffer.from(n,"binary").toString("base64"):URL.createObjectURL(new Blob([n],{type:"application/javascript"})))}class L$ extends jm{constructor(e,t){const i=t.uniforms||{},r=dt();i[bo.PROJECTION_MATRIX]=r,super(e,{uniforms:i,postProcesses:t.postProcesses}),this.ready=!1,this.sourceRevision_=-1,this.verticesBuffer_=new Ba(za,Pc),this.hitVerticesBuffer_=new Ba(za,Pc),this.indicesBuffer_=new Ba(Ac,Pc),this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.program_,this.hitDetectionEnabled_=!!(t.hitFragmentShader&&t.hitVertexShader),this.hitVertexShader_=t.hitVertexShader,this.hitFragmentShader_=t.hitFragmentShader,this.hitProgram_;const s=t.attributes?t.attributes.map(function(a){return{name:"a_"+a.name,size:1,type:Jn.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:Jn.FLOAT},{name:"a_index",size:1,type:Jn.FLOAT}].concat(s),this.hitDetectionAttributes=[{name:"a_position",size:2,type:Jn.FLOAT},{name:"a_index",size:1,type:Jn.FLOAT},{name:"a_hitColor",size:4,type:Jn.FLOAT},{name:"a_featureUid",size:1,type:Jn.FLOAT}].concat(s),this.customAttributes=t.attributes?t.attributes:[],this.previousExtent_=Kt(),this.currentTransform_=r,this.renderTransform_=dt(),this.invertRenderTransform_=dt(),this.renderInstructions_=new Float32Array(0),this.hitRenderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.generateBuffersRun_=0,this.worker_=C$(),this.worker_.addEventListener("message",function(a){const c=a.data;if(c.type===Td.GENERATE_BUFFERS){const l=c.projectionTransform;c.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(c.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(c.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(c.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=l,Vs(this.invertRenderTransform_,this.renderTransform_),c.hitDetection?this.hitRenderInstructions_=new Float32Array(a.data.renderInstructions):(this.renderInstructions_=new Float32Array(a.data.renderInstructions),c.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(this)),this.featureCache_={},this.featureCount_=0;const o=this.getLayer().getSource();this.sourceListenKeys_=[pe(o,Nt.ADDFEATURE,this.handleSourceFeatureAdded_,this),pe(o,Nt.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),pe(o,Nt.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),pe(o,Nt.CLEAR,this.handleSourceFeatureClear_,this)],o.forEachFeature(function(a){this.featureCache_[se(a)]={feature:a,properties:a.getProperties(),geometry:a.getGeometry()},this.featureCount_++}.bind(this))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new iT(this.helper))}handleSourceFeatureAdded_(e){const t=e.feature;this.featureCache_[se(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(e){const t=e.feature;this.featureCache_[se(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()}}handleSourceFeatureDelete_(e){const t=e.feature;delete this.featureCache_[se(t)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(e){const t=this.helper.getGL();this.preRender(t,e);const i=this.indicesBuffer_.getSize();this.helper.drawElements(0,i),this.helper.finalizeDraw(e,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const r=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(e),this.hitRenderTarget_.clearCachedData()),this.postRender(t,e),r}prepareFrameInternal(e){const t=this.getLayer(),i=t.getSource(),r=e.viewState,s=!e.viewHints[lt.ANIMATING]&&!e.viewHints[lt.INTERACTING],o=!Kn(this.previousExtent_,e.extent),a=this.sourceRevision_<i.getRevision();if(a&&(this.sourceRevision_=i.getRevision()),s&&(o||a)){const c=r.projection,l=r.resolution,u=t instanceof Ea?t.getRenderBuffer():0,h=Nn(e.extent,u*l);i.loadFeatures(h,l,c),this.rebuildBuffers_(e),this.previousExtent_=e.extent.slice()}return this.helper.makeProjectionTransform(e,this.currentTransform_),js(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(e),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0}rebuildBuffers_(e){const t=dt();this.helper.makeProjectionTransform(e,t);const i=(2+this.customAttributes.length)*this.featureCount_;if((!this.renderInstructions_||this.renderInstructions_.length!==i)&&(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){const d=(7+this.customAttributes.length)*this.featureCount_;(!this.hitRenderInstructions_||this.hitRenderInstructions_.length!==d)&&(this.hitRenderInstructions_=new Float32Array(d))}let r,s;const o=[],a=[];let c=0,l=0,u;for(const d in this.featureCache_){if(r=this.featureCache_[d],s=r.geometry,!s||s.getType()!==R.POINT)continue;o[0]=s.getFlatCoordinates()[0],o[1]=s.getFlatCoordinates()[1],Je(t,o),u=tT(l+6,a),this.renderInstructions_[c++]=o[0],this.renderInstructions_[c++]=o[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[l++]=o[0],this.hitRenderInstructions_[l++]=o[1],this.hitRenderInstructions_[l++]=u[0],this.hitRenderInstructions_[l++]=u[1],this.hitRenderInstructions_[l++]=u[2],this.hitRenderInstructions_[l++]=u[3],this.hitRenderInstructions_[l++]=Number(d));let f;for(let p=0;p<this.customAttributes.length;p++)f=this.customAttributes[p].callback(r.feature,r.properties),this.renderInstructions_[c++]=f,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[l++]=f)}const h={type:Td.GENERATE_BUFFERS,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(h.projectionTransform=t,h.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(h,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){const d={type:Td.GENERATE_BUFFERS,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};d.projectionTransform=t,d.hitDetection=!0,this.worker_.postMessage(d,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}}forEachFeatureAtCoordinate(e,t,i,r,s){if(ce(this.hitDetectionEnabled_,66),!this.hitRenderInstructions_)return;const o=Je(t.coordinateToPixelTransform,e.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),c=[a[0]/255,a[1]/255,a[2]/255,a[3]/255],l=nT(c),u=this.hitRenderInstructions_[l],h=Math.floor(u).toString(),f=this.getLayer().getSource().getFeatureByUid(h);if(f)return r(f,this.getLayer(),null)}renderHitDetection(e){if(!this.hitVerticesBuffer_.getSize())return;this.hitRenderTarget_.setSize([Math.floor(e.size[0]/2),Math.floor(e.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(e,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);const t=this.indicesBuffer_.getSize();this.helper.drawElements(0,t)}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach(function(e){je(e)}),this.sourceListenKeys_=null,super.disposeInternal()}}var Vm=L$;const Ai={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},A$=["#00f","#0ff","#0f0","#ff0","#f00"];class P$ extends Ea{constructor(e){const t=e||{},i=J({},t);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,super(i),this.gradient_=null,this.addChangeListener(Ai.GRADIENT,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:A$),this.setBlur(t.blur!==void 0?t.blur:15),this.setRadius(t.radius!==void 0?t.radius:8);const r=t.weight?t.weight:"weight";typeof r=="string"?this.weightFunction_=function(s){return s.get(r)}:this.weightFunction_=r,this.setRenderOrder(null)}getBlur(){return this.get(Ai.BLUR)}getGradient(){return this.get(Ai.GRADIENT)}getRadius(){return this.get(Ai.RADIUS)}handleGradientChanged_(){this.gradient_=O$(this.getGradient())}setBlur(e){this.set(Ai.BLUR,e)}setGradient(e){this.set(Ai.GRADIENT,e)}setRadius(e){this.set(Ai.RADIUS,e)}createRenderer(){return new Vm(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(e){const t=this.weightFunction_(e);return t!==void 0?we(t,0,1):1}.bind(this)}],vertexShader:`
|
35
|
+
precision mediump float;
|
36
|
+
uniform mat4 u_projectionMatrix;
|
37
|
+
uniform mat4 u_offsetScaleMatrix;
|
38
|
+
uniform float u_size;
|
39
|
+
attribute vec2 a_position;
|
40
|
+
attribute float a_index;
|
41
|
+
attribute float a_weight;
|
42
|
+
|
43
|
+
varying vec2 v_texCoord;
|
44
|
+
varying float v_weight;
|
45
|
+
|
46
|
+
void main(void) {
|
47
|
+
mat4 offsetMatrix = u_offsetScaleMatrix;
|
48
|
+
float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;
|
49
|
+
float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;
|
50
|
+
vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);
|
51
|
+
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;
|
52
|
+
float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;
|
53
|
+
float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;
|
54
|
+
v_texCoord = vec2(u, v);
|
55
|
+
v_weight = a_weight;
|
56
|
+
}`,fragmentShader:`
|
57
|
+
precision mediump float;
|
58
|
+
uniform float u_blurSlope;
|
59
|
+
|
60
|
+
varying vec2 v_texCoord;
|
61
|
+
varying float v_weight;
|
62
|
+
|
63
|
+
void main(void) {
|
64
|
+
vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);
|
65
|
+
float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;
|
66
|
+
float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;
|
67
|
+
float alpha = smoothstep(0.0, 1.0, value) * v_weight;
|
68
|
+
gl_FragColor = vec4(alpha, alpha, alpha, alpha);
|
69
|
+
}`,hitVertexShader:`
|
70
|
+
precision mediump float;
|
71
|
+
uniform mat4 u_projectionMatrix;
|
72
|
+
uniform mat4 u_offsetScaleMatrix;
|
73
|
+
uniform float u_size;
|
74
|
+
attribute vec2 a_position;
|
75
|
+
attribute float a_index;
|
76
|
+
attribute float a_weight;
|
77
|
+
attribute vec4 a_hitColor;
|
78
|
+
|
79
|
+
varying vec2 v_texCoord;
|
80
|
+
varying float v_weight;
|
81
|
+
varying vec4 v_hitColor;
|
82
|
+
|
83
|
+
void main(void) {
|
84
|
+
mat4 offsetMatrix = u_offsetScaleMatrix;
|
85
|
+
float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;
|
86
|
+
float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;
|
87
|
+
vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);
|
88
|
+
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;
|
89
|
+
float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;
|
90
|
+
float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;
|
91
|
+
v_texCoord = vec2(u, v);
|
92
|
+
v_hitColor = a_hitColor;
|
93
|
+
v_weight = a_weight;
|
94
|
+
}`,hitFragmentShader:`
|
95
|
+
precision mediump float;
|
96
|
+
uniform float u_blurSlope;
|
97
|
+
|
98
|
+
varying vec2 v_texCoord;
|
99
|
+
varying float v_weight;
|
100
|
+
varying vec4 v_hitColor;
|
101
|
+
|
102
|
+
void main(void) {
|
103
|
+
vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);
|
104
|
+
float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;
|
105
|
+
float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;
|
106
|
+
float alpha = smoothstep(0.0, 1.0, value) * v_weight;
|
107
|
+
if (alpha < 0.05) {
|
108
|
+
discard;
|
109
|
+
}
|
110
|
+
|
111
|
+
gl_FragColor = v_hitColor;
|
112
|
+
}`,uniforms:{u_size:function(){return(this.get(Ai.RADIUS)+this.get(Ai.BLUR))*2}.bind(this),u_blurSlope:function(){return this.get(Ai.RADIUS)/Math.max(1,this.get(Ai.BLUR))}.bind(this)},postProcesses:[{fragmentShader:`
|
113
|
+
precision mediump float;
|
114
|
+
|
115
|
+
uniform sampler2D u_image;
|
116
|
+
uniform sampler2D u_gradientTexture;
|
117
|
+
uniform float u_opacity;
|
118
|
+
|
119
|
+
varying vec2 v_texCoord;
|
120
|
+
|
121
|
+
void main() {
|
122
|
+
vec4 color = texture2D(u_image, v_texCoord);
|
123
|
+
gl_FragColor.a = color.a * u_opacity;
|
124
|
+
gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;
|
125
|
+
gl_FragColor.rgb *= gl_FragColor.a;
|
126
|
+
}`,uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})}renderDeclutter(){}}function O$(n){const i=St(1,256),r=i.createLinearGradient(0,0,1,256),s=1/(n.length-1);for(let o=0,a=n.length;o<a;++o)r.addColorStop(o*s,n[o]);return i.fillStyle=r,i.fillRect(0,0,1,256),i.canvas}var M$=P$;const Ym=.5,F$=!0,So={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Xm={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0};class N$ extends Mh{constructor(e){super(e),this.image_=null}getImage(){return this.image_?this.image_.getImage():null}prepareFrame(e){const t=e.layerStatesArray[e.layerIndex],i=e.pixelRatio,r=e.viewState,s=r.resolution,o=this.getLayer().getSource(),a=e.viewHints;let c=e.extent;if(t.extent!==void 0&&(c=an(c,Un(t.extent,r.projection))),!a[lt.ANIMATING]&&!a[lt.INTERACTING]&&!Qr(c))if(o){let l=r.projection;const u=o.getImage(c,s,i,l);u&&this.loadImage(u)?this.image_=u:this.image_=null}else this.image_=null;return!!this.image_}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=Je(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!kn(s,r))return null;const o=this.image_.getExtent(),a=this.image_.getImage(),c=be(o),l=Math.floor(a.width*((r[0]-o[0])/c));if(l<0||l>=a.width)return null;const u=ot(o),h=Math.floor(a.height*((o[3]-r[1])/u));return h<0||h>=a.height?null:this.getImageData(a,l,h)}renderFrame(e,t){const i=this.image_,r=i.getExtent(),s=i.getResolution(),o=i.getPixelRatio(),a=e.layerStatesArray[e.layerIndex],c=e.pixelRatio,l=e.viewState,u=l.center,h=l.resolution,d=e.size,f=c*s/(h*o);let p=Math.round(d[0]*c),m=Math.round(d[1]*c);const g=l.rotation;if(g){const A=Math.round(Math.sqrt(p*p+m*m));p=A,m=A}Ht(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/c,1/c,g,-p/2,-m/2),Vs(this.inversePixelTransform,this.pixelTransform);const y=Il(this.pixelTransform);this.useContainer(t,y,a.opacity,this.getBackground(e));const _=this.context,v=_.canvas;v.width!=p||v.height!=m?(v.width=p,v.height=m):this.containerReused||_.clearRect(0,0,p,m);let x=!1,w=!0;if(a.extent){const A=Un(a.extent,l.projection);w=at(A,e.extent),x=w&&!Gt(A,e.extent),x&&this.clipUnrotated(_,e,A)}const E=i.getImage(),T=Ht(this.tempTransform,p/2,m/2,f,f,0,o*(r[0]-u[0])/s,o*(u[1]-r[3])/s);this.renderedResolution=s*c/o;const b=E.width*T[0],S=E.height*T[3];if(this.getLayer().getSource().getInterpolate()||J(_,So),this.preRender(_,e),w&&b>=.5&&S>=.5){const A=T[4],I=T[5],N=a.opacity;let M;N!==1&&(M=_.globalAlpha,_.globalAlpha=N),_.drawImage(E,0,0,+E.width,+E.height,Math.round(A),Math.round(I),Math.round(b),Math.round(S)),N!==1&&(_.globalAlpha=M)}return this.postRender(_,e),x&&_.restore(),J(_,Xm),y!==v.style.transform&&(v.style.transform=y),this.container}}var Zm=N$;class k$ extends jE{constructor(e){super(e)}createRenderer(){return new Zm(this)}getData(e){return super.getData(e)}}var rT=k$;const $$=10,sT=.25;class D${constructor(e,t,i,r,s,o){this.sourceProj_=e,this.targetProj_=t;let a={};const c=Ei(this.targetProj_,this.sourceProj_);this.transformInv_=function(_){const v=_[0]+"/"+_[1];return a[v]||(a[v]=c(_)),a[v]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&be(r)==be(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?be(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?be(this.targetProj_.getExtent()):null;const l=si(i),u=ta(i),h=Ws(i),d=Zs(i),f=this.transformInv_(l),p=this.transformInv_(u),m=this.transformInv_(h),g=this.transformInv_(d),y=$$+(o?Math.max(0,Math.ceil(pp(ea(i)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,d,f,p,m,g,y),this.wrapsXInSource_){let _=1/0;this.triangles_.forEach(function(v,x,w){_=Math.min(_,v.source[0][0],v.source[1][0],v.source[2][0])}),this.triangles_.forEach(function(v){if(Math.max(v.source[0][0],v.source[1][0],v.source[2][0])-_>this.sourceWorldWidth_/2){const x=[[v.source[0][0],v.source[0][1]],[v.source[1][0],v.source[1][1]],[v.source[2][0],v.source[2][1]]];x[0][0]-_>this.sourceWorldWidth_/2&&(x[0][0]-=this.sourceWorldWidth_),x[1][0]-_>this.sourceWorldWidth_/2&&(x[1][0]-=this.sourceWorldWidth_),x[2][0]-_>this.sourceWorldWidth_/2&&(x[2][0]-=this.sourceWorldWidth_);const w=Math.min(x[0][0],x[1][0],x[2][0]);Math.max(x[0][0],x[1][0],x[2][0])-w<this.sourceWorldWidth_/2&&(v.source=x)}}.bind(this))}a={}}addTriangle_(e,t,i,r,s,o){this.triangles_.push({source:[r,s,o],target:[e,t,i]})}addQuad_(e,t,i,r,s,o,a,c,l){const u=yt([s,o,a,c]),h=this.sourceWorldWidth_?be(u)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&h>.5&&h<1;let p=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const g=yt([e,t,i,r]);p=be(g)/this.targetWorldWidth_>sT||p}!f&&this.sourceProj_.isGlobal()&&h&&(p=h>sT||p)}if(!p&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!at(u,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(c[0])||!isFinite(c[1]))){if(l>0)p=!0;else if(m=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(c[0])||!isFinite(c[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(l>0){if(!p){const g=[(e[0]+i[0])/2,(e[1]+i[1])/2],y=this.transformInv_(g);let _;f?_=(oi(s[0],d)+oi(a[0],d))/2-oi(y[0],d):_=(s[0]+a[0])/2-y[0];const v=(s[1]+a[1])/2-y[1];p=_*_+v*v>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const g=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.transformInv_(g),_=[(r[0]+e[0])/2,(r[1]+e[1])/2],v=this.transformInv_(_);this.addQuad_(e,t,g,_,s,o,y,v,l-1),this.addQuad_(_,g,i,r,v,y,a,c,l-1)}else{const g=[(e[0]+t[0])/2,(e[1]+t[1])/2],y=this.transformInv_(g),_=[(i[0]+r[0])/2,(i[1]+r[1])/2],v=this.transformInv_(_);this.addQuad_(e,g,_,r,s,y,v,c,l-1),this.addQuad_(g,t,i,_,y,o,a,v,l-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(e,i,r,s,a,c),(m&14)==0&&this.addTriangle_(e,i,t,s,a,o),m&&((m&13)==0&&this.addTriangle_(t,r,e,o,c,s),(m&7)==0&&this.addTriangle_(t,r,i,o,c,a))}calculateSourceExtent(){const e=Kt();return this.triangles_.forEach(function(t,i,r){const s=t.source;Xs(e,s[0]),Xs(e,s[1]),Xs(e,s[2])}),e}getTriangles(){return this.triangles_}}var Wm=D$;let Hm;function oT(n,e,t,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,i)+1,Math.max(t,r)),n.restore()}function Km(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function G$(){if(Hm===void 0){const n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",oT(n,4,5,4,0),oT(n,4,5,0,5);const e=n.getImageData(0,0,3,3).data;Hm=Km(e,0)||Km(e,4)||Km(e,8)}return Hm}function ja(n,e,t,i){const r=ts(t,e,n);let s=$l(e,i,t);const o=e.getMetersPerUnit();o!==void 0&&(s*=o);const a=n.getMetersPerUnit();a!==void 0&&(s/=a);const c=n.getExtent();if(!c||kn(c,r)){const l=$l(n,s,r)/s;isFinite(l)&&l>0&&(s/=l)}return s}function aT(n,e,t,i){const r=Ut(t);let s=ja(n,e,r,i);return(!isFinite(s)||s<=0)&&Vu(t,function(o){return s=ja(n,e,o,i),isFinite(s)&&s>0}),s}function qm(n,e,t,i,r,s,o,a,c,l,u,h){const d=St(Math.round(t*n),Math.round(t*e));if(h||J(d,So),c.length===0)return d.canvas;d.scale(t,t);function f(x){return Math.round(x*t)/t}d.globalCompositeOperation="lighter";const p=Kt();c.forEach(function(x,w,E){up(p,x.extent)});const m=be(p),g=ot(p),y=St(Math.round(t*m/i),Math.round(t*g/i));h||J(y,So);const _=t/i;c.forEach(function(x,w,E){const T=x.extent[0]-p[0],b=-(x.extent[3]-p[3]),S=be(x.extent),A=ot(x.extent);x.image.width>0&&x.image.height>0&&y.drawImage(x.image,l,l,x.image.width-2*l,x.image.height-2*l,T*_,b*_,S*_,A*_)});const v=si(o);return a.getTriangles().forEach(function(x,w,E){const T=x.source,b=x.target;let S=T[0][0],A=T[0][1],I=T[1][0],N=T[1][1],M=T[2][0],B=T[2][1];const O=f((b[0][0]-v[0])/s),P=f(-(b[0][1]-v[1])/s),G=f((b[1][0]-v[0])/s),U=f(-(b[1][1]-v[1])/s),D=f((b[2][0]-v[0])/s),k=f(-(b[2][1]-v[1])/s),$=S,F=A;S=0,A=0,I-=$,N-=F,M-=$,B-=F;const te=[[I,N,0,0,G-O],[M,B,0,0,D-O],[0,0,I,N,U-P],[0,0,M,B,k-P]],z=tx(te);if(!!z){if(d.save(),d.beginPath(),G$()||!h){d.moveTo(G,U);const X=4,K=O-G,le=P-U;for(let ae=0;ae<X;ae++)d.lineTo(G+f((ae+1)*K/X),U+f(ae*le/(X-1))),ae!=X-1&&d.lineTo(G+f((ae+1)*K/X),U+f((ae+1)*le/(X-1)));d.lineTo(D,k)}else d.moveTo(G,U),d.lineTo(O,P),d.lineTo(D,k);d.clip(),d.transform(z[0],z[2],z[1],z[3],O,P),d.translate(p[0]-$,p[3]-F),d.scale(i/t,-i/t),d.drawImage(y.canvas,0,0),d.restore()}}),u&&(d.save(),d.globalCompositeOperation="source-over",d.strokeStyle="black",d.lineWidth=1,a.getTriangles().forEach(function(x,w,E){const T=x.target,b=(T[0][0]-v[0])/s,S=-(T[0][1]-v[1])/s,A=(T[1][0]-v[0])/s,I=-(T[1][1]-v[1])/s,N=(T[2][0]-v[0])/s,M=-(T[2][1]-v[1])/s;d.beginPath(),d.moveTo(A,I),d.lineTo(b,S),d.lineTo(N,M),d.closePath(),d.stroke()}),d.restore()),d.canvas}class U$ extends Kr{constructor(e,t,i,r,s,o,a,c,l,u,h,d){super(s,W.IDLE,{interpolate:!!d}),this.renderEdges_=h!==void 0?h:!1,this.pixelRatio_=a,this.gutter_=c,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=o||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent();let m=this.sourceTileGrid_.getExtent();const g=p?an(f,p):f;if(ea(g)===0){this.state=W.EMPTY;return}const y=e.getExtent();y&&(m?m=an(m,y):m=y);const _=r.getResolution(this.wrappedTileCoord_[0]),v=aT(e,i,g,_);if(!isFinite(v)||v<=0){this.state=W.EMPTY;return}const x=u!==void 0?u:Ym;if(this.triangulation_=new Wm(e,i,g,m,v*x,_),this.triangulation_.getTriangles().length===0){this.state=W.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let w=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(w[1]=we(w[1],m[1],m[3]),w[3]=we(w[3],m[1],m[3])):w=an(w,m)),!ea(w))this.state=W.EMPTY;else{const E=t.getTileRangeForExtentAndZ(w,this.sourceZ_);for(let T=E.minX;T<=E.maxX;T++)for(let b=E.minY;b<=E.maxY;b++){const S=l(this.sourceZ_,T,b,a);S&&this.sourceTiles_.push(S)}this.sourceTiles_.length===0&&(this.state=W.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(function(t,i,r){t&&t.getState()==W.LOADED&&e.push({extent:this.sourceTileGrid_.getTileCoordExtent(t.tileCoord),image:t.getImage()})}.bind(this)),this.sourceTiles_.length=0,e.length===0)this.state=W.ERROR;else{const t=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(t),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(t),a=this.sourceTileGrid_.getResolution(this.sourceZ_),c=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=qm(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,c,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=W.LOADED}this.changed()}load(){if(this.state==W.IDLE){this.state=W.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(t,i,r){const s=t.getState();if(s==W.IDLE||s==W.LOADING){e++;const o=pe(t,ne.CHANGE,function(a){const c=t.getState();(c==W.LOADED||c==W.ERROR||c==W.EMPTY)&&(je(o),e--,e===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(o)}}.bind(this)),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(t,i,r){t.getState()==W.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(je),this.sourcesListenerKeys_=null}}var Sd=U$;class z$ extends Mh{constructor(e){super(e),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=Kt(),this.tmpTileRange_=new vc(0,0,0,0)}isDrawableTile(e){const t=this.getLayer(),i=e.getState(),r=t.getUseInterimTilesOnError();return i==W.LOADED||i==W.EMPTY||i==W.ERROR&&!r}getTile(e,t,i,r){const s=r.pixelRatio,o=r.viewState.projection,a=this.getLayer();let l=a.getSource().getTile(e,t,i,s,o);return l.getState()==W.ERROR&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):l.setState(W.LOADED)),this.isDrawableTile(l)||(l=l.getInterimTile()),l}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=Je(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!kn(s,r))return null;const o=t.pixelRatio,a=t.viewState.projection,c=t.viewState,l=i.getRenderSource(),u=l.getTileGridForProjection(c.projection),h=l.getTilePixelRatio(t.pixelRatio);for(let d=u.getZForResolution(c.resolution);d>=u.getMinZoom();--d){const f=u.getTileCoordForCoordAndZ(r,d),p=l.getTile(d,f[1],f[2],o,a);if(!(p instanceof ro||p instanceof Sd))return null;if(p.getState()!==W.LOADED)continue;const m=u.getOrigin(d),g=pt(u.getTileSize(d)),y=u.getResolution(d),_=Math.floor(h*((r[0]-m[0])/y-f[1]*g[0])),v=Math.floor(h*((m[1]-r[1])/y-f[2]*g[1]));return this.getImageData(p.getImage(),_,v)}return null}loadedTileCallback(e,t,i){return this.isDrawableTile(i)?super.loadedTileCallback(e,t,i):!1}prepareFrame(e){return!!this.getLayer().getSource()}renderFrame(e,t){const i=e.layerStatesArray[e.layerIndex],r=e.viewState,s=r.projection,o=r.resolution,a=r.center,c=r.rotation,l=e.pixelRatio,u=this.getLayer(),h=u.getSource(),d=h.getRevision(),f=h.getTileGridForProjection(s),p=f.getZForResolution(o,h.zDirection),m=f.getResolution(p);let g=e.extent;const y=i.extent&&Un(i.extent,s);y&&(g=an(g,Un(i.extent,s)));const _=h.getTilePixelRatio(l);let v=Math.round(e.size[0]*_),x=Math.round(e.size[1]*_);if(c){const te=Math.round(Math.sqrt(v*v+x*x));v=te,x=te}const w=m*v/2/_,E=m*x/2/_,T=[a[0]-w,a[1]-E,a[0]+w,a[1]+E],b=f.getTileRangeForExtentAndZ(g,p),S={};S[p]={};const A=this.createLoadedTileFinder(h,s,S),I=this.tmpExtent,N=this.tmpTileRange_;this.newTiles_=!1;for(let te=b.minX;te<=b.maxX;++te)for(let z=b.minY;z<=b.maxY;++z){const X=this.getTile(p,te,z,e);if(this.isDrawableTile(X)){const ae=se(this);if(X.getState()==W.LOADED){S[p][X.tileCoord.toString()]=X;const Y=X.inTransition(ae);!this.newTiles_&&(Y||this.renderedTiles.indexOf(X)===-1)&&(this.newTiles_=!0)}if(X.getAlpha(ae,e.time)===1)continue}const K=f.getTileCoordChildTileRange(X.tileCoord,N,I);let le=!1;K&&(le=A(p+1,K)),le||f.forEachTileCoordParentTileRange(X.tileCoord,A,N,I)}const M=m/o;Ht(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/_,1/_,c,-v/2,-x/2);const B=Il(this.pixelTransform);this.useContainer(t,B,i.opacity,this.getBackground(e));const O=this.context,P=O.canvas;Vs(this.inversePixelTransform,this.pixelTransform),Ht(this.tempTransform,v/2,x/2,M,M,0,-v/2,-x/2),P.width!=v||P.height!=x?(P.width=v,P.height=x):this.containerReused||O.clearRect(0,0,v,x),y&&this.clipUnrotated(O,e,y),h.getInterpolate()||J(O,So),this.preRender(O,e),this.renderedTiles.length=0;let G=Object.keys(S).map(Number);G.sort(cr);let U,D,k;i.opacity===1&&(!this.containerReused||h.getOpaque(e.viewState.projection))?G=G.reverse():(U=[],D=[]);for(let te=G.length-1;te>=0;--te){const z=G[te],X=h.getTilePixelSize(z,l,s),le=f.getResolution(z)/m,ae=X[0]*le*M,Y=X[1]*le*M,Pe=f.getTileCoordForCoordAndZ(si(T),z),Oe=f.getTileCoordExtent(Pe),Se=Je(this.tempTransform,[_*(Oe[0]-T[0])/m,_*(T[3]-Oe[3])/m]),mt=_*h.getGutterForProjection(s),De=S[z];for(const Be in De){const nt=De[Be],Qt=nt.tileCoord,en=Pe[1]-Qt[1],ee=Math.round(Se[0]-(en-1)*ae),tn=Pe[2]-Qt[2],nn=Math.round(Se[1]-(tn-1)*Y),Xt=Math.round(Se[0]-en*ae),bt=Math.round(Se[1]-tn*Y),An=ee-Xt,Zt=nn-bt,$i=p===z,yi=$i&&nt.getAlpha(se(this),e.time)!==1;let ar=!1;if(!yi)if(U){k=[Xt,bt,Xt+An,bt,Xt+An,bt+Zt,Xt,bt+Zt];for(let ti=0,ht=U.length;ti<ht;++ti)if(p!==z&&z<D[ti]){const $t=U[ti];at([Xt,bt,Xt+An,bt+Zt],[$t[0],$t[3],$t[4],$t[7]])&&(ar||(O.save(),ar=!0),O.beginPath(),O.moveTo(k[0],k[1]),O.lineTo(k[2],k[3]),O.lineTo(k[4],k[5]),O.lineTo(k[6],k[7]),O.moveTo($t[6],$t[7]),O.lineTo($t[4],$t[5]),O.lineTo($t[2],$t[3]),O.lineTo($t[0],$t[1]),O.clip())}U.push(k),D.push(z)}else O.clearRect(Xt,bt,An,Zt);this.drawTileImage(nt,e,Xt,bt,An,Zt,mt,$i),U&&!yi?(ar&&O.restore(),this.renderedTiles.unshift(nt)):this.renderedTiles.push(nt),this.updateUsedTiles(e.usedTiles,h,nt)}}this.renderedRevision=d,this.renderedResolution=m,this.extentChanged=!this.renderedExtent_||!Kn(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=l,this.renderedProjection=s,this.manageTilePyramid(e,h,f,l,s,g,p,u.getPreload()),this.scheduleExpireCache(e,h),this.postRender(O,e),i.extent&&O.restore(),J(O,Xm),B!==P.style.transform&&(P.style.transform=B);const $=eg(i.opacity),F=this.container;return $!==F.style.opacity&&(F.style.opacity=$),this.container}drawTileImage(e,t,i,r,s,o,a,c){const l=this.getTileImage(e);if(!l)return;const u=se(this),h=c?e.getAlpha(u,t.time):1,d=h!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,r,s,o),d&&this.context.restore(),h!==1?t.animate=!0:c&&e.endTransition(u)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}scheduleExpireCache(e,t){if(t.canExpireCache()){const i=function(r,s,o){const a=se(r);a in o.usedTiles&&r.expireCache(o.viewState.projection,o.usedTiles[a])}.bind(null,t);e.postRenderFunctions.push(i)}}updateUsedTiles(e,t,i){const r=se(t);r in e||(e[r]={}),e[r][i.getKey()]=!0}manageTilePyramid(e,t,i,r,s,o,a,c,l){const u=se(t);u in e.wantedTiles||(e.wantedTiles[u]={});const h=e.wantedTiles[u],d=e.tileQueue,f=i.getMinZoom();let p=0,m,g,y,_,v,x;for(x=f;x<=a;++x)for(g=i.getTileRangeForExtentAndZ(o,x,g),y=i.getResolution(x),_=g.minX;_<=g.maxX;++_)for(v=g.minY;v<=g.maxY;++v)a-x<=c?(++p,m=t.getTile(x,_,v,r,s),m.getState()==W.IDLE&&(h[m.getKey()]=!0,d.isKeyQueued(m.getKey())||d.enqueue([m,u,i.getTileCoordCenter(m.tileCoord),y])),l!==void 0&&l(m)):t.useTile(x,_,v,s);t.updateCacheSize(p,s)}}var Jm=z$,br={IMAGE:"image",HYBRID:"hybrid",VECTOR:"vector"};const B$={image:[Ne.POLYGON,Ne.CIRCLE,Ne.LINE_STRING,Ne.IMAGE,Ne.TEXT],hybrid:[Ne.POLYGON,Ne.LINE_STRING],vector:[]},j$={hybrid:[Ne.IMAGE,Ne.TEXT,Ne.DEFAULT],vector:[Ne.POLYGON,Ne.CIRCLE,Ne.LINE_STRING,Ne.IMAGE,Ne.TEXT,Ne.DEFAULT]};class V$ extends Jm{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.dirty_=!1,this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.tmpTransform_=dt()}prepareTile(e,t,i){let r;const s=e.getState();return(s===W.LOADED||s===W.ERROR)&&(this.updateExecutorGroup_(e,t,i),this.tileImageNeedsRender_(e)&&(r=!0)),r}getTile(e,t,i,r){const s=r.pixelRatio,o=r.viewState,a=o.resolution,c=o.projection,l=this.getLayer(),u=l.getSource().getTile(e,t,i,s,c),h=r.viewHints,d=!(h[lt.ANIMATING]||h[lt.INTERACTING]);return(d||!u.wantedResolution)&&(u.wantedResolution=a),this.prepareTile(u,s,c)&&(d||Date.now()-r.time<8)&&l.getRenderMode()!==br.VECTOR&&this.renderTileImage_(u,r),super.getTile(e,t,i,r)}isDrawableTile(e){const t=this.getLayer();return super.isDrawableTile(e)&&(t.getRenderMode()===br.VECTOR?se(t)in e.executorGroups:e.hasContext(t))}getTileImage(e){return e.getImage(this.getLayer())}prepareFrame(e){const t=this.getLayer().getRevision();return this.renderedLayerRevision_!=t&&(this.renderedTiles.length=0),this.renderedLayerRevision_=t,super.prepareFrame(e)}updateExecutorGroup_(e,t,i){const r=this.getLayer(),s=r.getRevision(),o=r.getRenderOrder()||null,a=e.wantedResolution,c=e.getReplayState(r);if(!c.dirty&&c.renderedResolution===a&&c.renderedRevision==s&&c.renderedRenderOrder==o)return;const l=r.getSource(),u=r.getDeclutter(),h=l.getTileGrid(),f=l.getTileGridForProjection(i).getTileCoordExtent(e.wrappedTileCoord),p=l.getSourceTiles(t,i,e),m=se(r);delete e.hitDetectionImageData[m],e.executorGroups[m]=[],u&&(e.declutterExecutorGroups[m]=[]);for(let g=0,y=p.length;g<y;++g){const _=p[g];if(_.getState()!=W.LOADED)continue;const v=_.tileCoord,x=h.getTileCoordExtent(v),w=an(f,x),E=Nn(w,r.getRenderBuffer()*a,this.tmpExtent),T=Kn(x,w)?null:E;c.dirty=!1;const b=new uc(0,E,a,t),S=u?new uc(0,w,a,t):void 0,A=Nh(a,t),I=function(P){let G;const U=P.getStyleFunction()||r.getStyleFunction();if(U&&(G=U(P,a)),G){const D=this.renderFeature(P,A,G,b,S);this.dirty_=this.dirty_||D,c.dirty=c.dirty||D}},N=_.getFeatures();o&&o!==c.renderedRenderOrder&&N.sort(o);for(let P=0,G=N.length;P<G;++P){const U=N[P];(!T||at(T,U.getGeometry().getExtent()))&&I.call(this,U)}const M=b.finish(),B=r.getRenderMode()!==br.VECTOR&&u&&p.length===1?null:w,O=new dc(B,a,t,l.getOverlaps(),M,r.getRenderBuffer());if(e.executorGroups[m].push(O),S){const P=new dc(null,a,t,l.getOverlaps(),S.finish(),r.getRenderBuffer());e.declutterExecutorGroups[m].push(P)}}c.renderedRevision=s,c.renderedRenderOrder=o,c.renderedResolution=a}forEachFeatureAtCoordinate(e,t,i,r,s){const o=t.viewState.resolution,a=t.viewState.rotation;i=i==null?0:i;const c=this.getLayer(),u=c.getSource().getTileGridForProjection(t.viewState.projection),h=yt([e]);Nn(h,o*i,h);const d={},f=function(g,y,_){let v=g.getId();v===void 0&&(v=se(g));const x=d[v];if(x){if(x!==!0&&_<x.distanceSq){if(_===0)return d[v]=!0,s.splice(s.lastIndexOf(x),1),r(g,c,y);x.geometry=y,x.distanceSq=_}}else{if(_===0)return d[v]=!0,r(g,c,y);s.push(d[v]={feature:g,layer:c,geometry:y,distanceSq:_,callback:r})}},p=this.renderedTiles;let m;for(let g=0,y=p.length;!m&&g<y;++g){const _=p[g],v=u.getTileCoordExtent(_.wrappedTileCoord);if(!at(v,h))continue;const x=se(c),w=[_.executorGroups[x]],E=_.declutterExecutorGroups[x];E&&w.push(E),w.some(T=>{const b=T===E?t.declutterTree.all().map(S=>S.value):null;for(let S=0,A=T.length;S<A;++S)if(m=T[S].forEachFeatureAtCoordinate(e,o,a,i,f,b),m)return!0})}return m}getFeatures(e){return new Promise(function(t,i){const r=this.getLayer(),s=se(r),o=r.getSource(),a=this.renderedProjection,c=a.getExtent(),l=this.renderedResolution,u=o.getTileGridForProjection(a),h=Je(this.renderedPixelToCoordinateTransform_,e.slice()),d=u.getTileCoordForCoordAndResolution(h,l);let f;for(let v=0,x=this.renderedTiles.length;v<x;++v)if(d.toString()===this.renderedTiles[v].tileCoord.toString()){if(f=this.renderedTiles[v],f.getState()===W.LOADED){const w=u.getTileCoordExtent(f.tileCoord);o.getWrapX()&&a.canWrapX()&&!Gt(c,w)&&Wu(h,a);break}f=void 0}if(!f||f.loadingSourceTiles>0){t([]);return}const p=u.getTileCoordExtent(f.wrappedTileCoord),m=si(p),g=[(h[0]-m[0])/l,(m[1]-h[1])/l],y=f.getSourceTiles().reduce(function(v,x){return v.concat(x.getFeatures())},[]);let _=f.hitDetectionImageData[s];if(!_&&!this.animatingOrInteracting_){const v=pt(u.getTileSize(u.getZForResolution(l))),x=this.renderedRotation_,w=[this.getRenderTransform(u.getTileCoordCenter(f.wrappedTileCoord),l,0,Yn,v[0]*Yn,v[1]*Yn,0)];_=zg(v,w,y,r.getStyleFunction(),u.getTileCoordExtent(f.wrappedTileCoord),f.getReplayState(r).renderedResolution,x),f.hitDetectionImageData[s]=_}t(Bg(g,y,_))}.bind(this))}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e){const t=this.context,i=t.globalAlpha;t.globalAlpha=this.getLayer().getOpacity();const r=e.viewHints,s=!(r[lt.ANIMATING]||r[lt.INTERACTING]),o=this.renderedTiles;for(let a=0,c=o.length;a<c;++a){const l=o[a],u=l.declutterExecutorGroups[se(this.getLayer())];if(u)for(let h=u.length-1;h>=0;--h)u[h].execute(this.context,1,this.getTileRenderTransform(l,e),e.viewState.rotation,s,void 0,e.declutterTree)}t.globalAlpha=i}getTileRenderTransform(e,t){const i=t.pixelRatio,r=t.viewState,s=r.center,o=r.resolution,a=r.rotation,c=t.size,l=Math.round(c[0]*i),u=Math.round(c[1]*i),d=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),f=e.tileCoord,p=d.getTileCoordExtent(e.wrappedTileCoord),m=d.getTileCoordExtent(f,this.tmpExtent)[0]-p[0];return js(Jo(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,o,a,i,l,u,m))}renderFrame(e,t){const i=e.viewHints,r=!(i[lt.ANIMATING]||i[lt.INTERACTING]);super.renderFrame(e,t),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;const s=this.getLayer(),o=s.getRenderMode(),a=this.context,c=a.globalAlpha;a.globalAlpha=s.getOpacity();const l=j$[o],u=e.viewState,h=u.rotation,d=s.getSource(),p=d.getTileGridForProjection(u.projection).getZForResolution(u.resolution,d.zDirection),m=this.renderedTiles,g=[],y=[];for(let _=m.length-1;_>=0;--_){const v=m[_],x=v.executorGroups[se(s)].filter(S=>S.hasExecutors(l));if(x.length===0)continue;const w=this.getTileRenderTransform(v,e),E=v.tileCoord[0];let T=!1;const b=x[0].getClipCoords(w);for(let S=0,A=g.length;S<A;++S)if(p!==E&&E<y[S]){const I=g[S];at([b[0],b[3],b[4],b[7]],[I[0],I[3],I[4],I[7]])&&(T||(a.save(),T=!0),a.beginPath(),a.moveTo(b[0],b[1]),a.lineTo(b[2],b[3]),a.lineTo(b[4],b[5]),a.lineTo(b[6],b[7]),a.moveTo(I[6],I[7]),a.lineTo(I[4],I[5]),a.lineTo(I[2],I[3]),a.lineTo(I[0],I[1]),a.clip())}g.push(b),y.push(E);for(let S=0,A=x.length;S<A;++S)x[S].execute(a,1,w,h,r,l);T&&a.restore()}return a.globalAlpha=c,this.container}renderFeature(e,t,i,r,s){if(!i)return!1;let o=!1;if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)o=gc(r,e,i[a],t,this.boundHandleStyleImageChange_,void 0,s)||o;else o=gc(r,e,i,t,this.boundHandleStyleImageChange_,void 0,s);return o}tileImageNeedsRender_(e){const t=this.getLayer();if(t.getRenderMode()===br.VECTOR)return!1;const i=e.getReplayState(t),r=t.getRevision(),s=e.wantedResolution;return i.renderedTileResolution!==s||i.renderedTileRevision!==r}renderTileImage_(e,t){const i=this.getLayer(),r=e.getReplayState(i),s=i.getRevision(),o=e.executorGroups[se(i)];r.renderedTileRevision=s;const a=e.wrappedTileCoord,c=a[0],l=i.getSource();let u=t.pixelRatio;const d=t.viewState.projection,f=l.getTileGridForProjection(d),p=f.getResolution(e.tileCoord[0]),m=t.pixelRatio/e.wantedResolution*p,g=f.getResolution(c),y=e.getContext(i);u=Math.round(Math.max(u,m/u));const _=l.getTilePixelSize(c,u,d);y.canvas.width=_[0],y.canvas.height=_[1];const v=u/m;if(v!==1){const T=Ko(this.tmpTransform_);Jo(T,v,v),y.setTransform.apply(y,T)}const x=f.getTileCoordExtent(a,this.tmpExtent),w=m/g,E=Ko(this.tmpTransform_);Jo(E,w,-w),Y_(E,-x[0],-x[3]);for(let T=0,b=o.length;T<b;++T)o[T].execute(y,v,E,0,!0,B$[i.getRenderMode()]);r.renderedTileResolution=e.wantedResolution}}var lT=V$;class Y$ extends Ea{constructor(e){const t=e||{},i=J({},t);delete i.preload,delete i.useInterimTilesOnError,super(i),this.on,this.once,this.un,t.renderMode===br.IMAGE&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),t.renderMode=void 0);const r=t.renderMode||br.HYBRID;ce(r==br.HYBRID||r==br.VECTOR,28),this.renderMode_=r,this.setPreload(t.preload?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0),this.getBackground,this.setBackground}createRenderer(){return new lT(this)}getFeatures(e){return super.getFeatures(e)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(Tr.PRELOAD)}getUseInterimTilesOnError(){return this.get(Tr.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(Tr.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(Tr.USE_INTERIM_TILES_ON_ERROR,e)}}var Qm=Y$,Ro={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};const X$=[0,0,0],_s=5;class Z${constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,ce(M_(this.resolutions_,function(r,s){return s-r},!0),17);let t;if(!e.origins){for(let r=0,s=this.resolutions_.length-1;r<s;++r)if(!t)t=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,ce(this.origins_.length==this.resolutions_.length,20));const i=e.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=si(i)),ce(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,ce(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:co,ce(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map(function(r,s){const o=new vc(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o},this):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,t,i){const r=this.getTileRangeForExtentAndZ(e,t);for(let s=r.minX,o=r.maxX;s<=o;++s)for(let a=r.minY,c=r.maxY;a<=c;++a)i([t,s,a])}forEachTileCoordParentTileRange(e,t,i,r){let s,o,a,c=null,l=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):c=this.getTileCoordExtent(e,r);l>=this.minZoom;){if(this.zoomFactor_===2?(o=Math.floor(o/2),a=Math.floor(a/2),s=fo(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(c,l,i),t(l,s))return!0;--l}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,i){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const s=e[1]*2,o=e[2]*2;return fo(s,s+1,o,o+1,t)}const r=this.getTileCoordExtent(e,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,i){if(t>this.maxZoom||t<this.minZoom)return null;const r=e[0],s=e[1],o=e[2];if(t===r)return fo(s,o,s,o,i);if(this.zoomFactor_){const c=Math.pow(this.zoomFactor_,t-r),l=Math.floor(s*c),u=Math.floor(o*c);if(t<r)return fo(l,l,u,u,i);const h=Math.floor(c*(s+1))-1,d=Math.floor(c*(o+1))-1;return fo(l,h,u,d,i)}const a=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,t,i)}getTileRangeExtent(e,t,i){const r=this.getOrigin(e),s=this.getResolution(e),o=pt(this.getTileSize(e),this.tmpSize_),a=r[0]+t.minX*o[0]*s,c=r[0]+(t.maxX+1)*o[0]*s,l=r[1]+t.minY*o[1]*s,u=r[1]+(t.maxY+1)*o[1]*s;return $n(a,l,c,u,i)}getTileRangeForExtentAndZ(e,t,i){const r=X$;this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,r);const s=r[1],o=r[2];return this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,r),fo(s,r[1],o,r[2],i)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=pt(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*i,t[1]-(e[2]+.5)*r[1]*i]}getTileCoordExtent(e,t){const i=this.getOrigin(e[0]),r=this.getResolution(e[0]),s=pt(this.getTileSize(e[0]),this.tmpSize_),o=i[0]+e[1]*s[0]*r,a=i[1]-(e[2]+1)*s[1]*r,c=o+s[0]*r,l=a+s[1]*r;return $n(o,a,c,l,t)}getTileCoordForCoordAndResolution(e,t,i){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,i)}getTileCoordForXYAndResolution_(e,t,i,r,s){const o=this.getZForResolution(i),a=i/this.getResolution(o),c=this.getOrigin(o),l=pt(this.getTileSize(o),this.tmpSize_);let u=a*(e-c[0])/i/l[0],h=a*(c[1]-t)/i/l[1];return r?(u=hr(u,_s)-1,h=hr(h,_s)-1):(u=Js(u,_s),h=Js(h,_s)),La(o,u,h,s)}getTileCoordForXYAndZ_(e,t,i,r,s){const o=this.getOrigin(i),a=this.getResolution(i),c=pt(this.getTileSize(i),this.tmpSize_);let l=(e-o[0])/a/c[0],u=(o[1]-t)/a/c[1];return r?(l=hr(l,_s)-1,u=hr(u,_s)-1):(l=Js(l,_s),u=Js(u,_s)),La(i,l,u,s)}getTileCoordForCoordAndZ(e,t,i){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,i)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){const i=bl(this.resolutions_,e,t||0);return we(i,this.minZoom,this.maxZoom)}calculateTileRanges_(e){const t=this.resolutions_.length,i=new Array(t);for(let r=this.minZoom;r<t;++r)i[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=i}}var Sr=Z$;function e0(n){let e=n.getDefaultTileGrid();return e||(e=t0(n),n.setDefaultTileGrid(e)),e}function cT(n,e,t){const i=e[0],r=n.getTileCoordCenter(e),s=Rr(t);if(kn(s,r))return e;{const o=be(s),a=Math.ceil((s[0]-r[0])/o);return r[0]+=o*a,n.getTileCoordForCoordAndZ(r,i)}}function uT(n,e,t,i){const r=i!==void 0?i:Qo.TOP_LEFT,s=hT(n,e,t);return new Sr({extent:n,origin:q_(n,r),resolutions:s,tileSize:t})}function Io(n){const e=n||{},t=e.extent||re("EPSG:3857").getExtent(),i={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:hT(t,e.maxZoom,e.tileSize,e.maxResolution)};return new Sr(i)}function hT(n,e,t,i){const r=e!==void 0?e:u1,s=ot(n),o=be(n),a=pt(t!==void 0?t:co),c=i>0?i:Math.max(o/a[0],s/a[1]),l=r+1,u=new Array(l);for(let h=0;h<l;++h)u[h]=c/Math.pow(2,h);return u}function t0(n,e,t,i){const r=Rr(n);return uT(r,e,t,i)}function Rr(n){n=re(n);let e=n.getExtent();if(!e){const t=180*on[gn.DEGREES]/n.getMetersPerUnit();e=$n(-t,-t,t,t)}return e}class W$ extends Ra{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.opaque_=e.opaque!==void 0?e.opaque:!1,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const t=[256,256];this.tileGrid&&pt(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tileCache=new xc(e.cacheSize||0),this.tmpSize=[0,0],this.key_=e.key||"",this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(e,t){const i=this.getTileCacheForProjection(e);i&&i.expireCache(t)}forEachLoadedTile(e,t,i,r){const s=this.getTileCacheForProjection(e);if(!s)return!1;let o=!0,a,c,l;for(let u=i.minX;u<=i.maxX;++u)for(let h=i.minY;h<=i.maxY;++h)c=Xi(t,u,h),l=!1,s.containsKey(c)&&(a=s.get(c),l=a.getState()===W.LOADED,l&&(l=r(a)!==!1)),l||(o=!1);return o}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getOpaque(e){return this.opaque_}getResolutions(){return this.tileGrid?this.tileGrid.getResolutions():null}getTile(e,t,i,r,s){return he()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:e0(e)}getTileCacheForProjection(e){return ce(Gn(this.getProjection(),e),68),this.tileCache}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(t),o=pt(r.getTileSize(e),this.tmpSize);return s==1?o:_h(o,s,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){const i=t!==void 0?t:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(e=cT(r,e,i)),Pv(e,r)?e:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(e,t){const i=this.getTileCacheForProjection(t);e>i.highWaterMark&&(i.highWaterMark=e)}useTile(e,t,i,r){}}class n0 extends Mt{constructor(e,t){super(e),this.tile=t}}var Fc=W$;function dT(n,e){const t=/\{z\}/g,i=/\{x\}/g,r=/\{y\}/g,s=/\{-y\}/g;return function(o,a,c){if(o)return n.replace(t,o[0].toString()).replace(i,o[1].toString()).replace(r,o[2].toString()).replace(s,function(){const l=o[0],u=e.getFullTileRange(l);return ce(u,55),(u.getHeight()-o[2]-1).toString()})}}function Rd(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=dT(n[r],e);return Va(i)}function Va(n){return n.length===1?n[0]:function(e,t,i){if(e){const r=Bh(e),s=oi(r,n.length);return n[s](e,t,i)}else return}}function fT(n,e,t){}function Id(n){const e=[];let t=/\{([a-z])-([a-z])\}/.exec(n);if(t){const i=t[1].charCodeAt(0),r=t[2].charCodeAt(0);let s;for(s=i;s<=r;++s)e.push(n.replace(t[0],String.fromCharCode(s)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(n),t){const i=parseInt(t[2],10);for(let r=parseInt(t[1],10);r<=i;r++)e.push(n.replace(t[0],r.toString()));return e}return e.push(n),e}class c_ extends Fc{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===c_.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const t=e.target,i=se(t),r=t.getState();let s;r==W.LOADING?(this.tileLoadingKeys_[i]=!0,s=Ro.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==W.ERROR?Ro.TILELOADERROR:r==W.LOADED?Ro.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new n0(s,t))}setTileLoadFunction(e){this.tileCache.clear(),this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,this.tileCache.pruneExceptNewestZ(),typeof t!="undefined"?this.setKey(t):this.changed()}setUrl(e){const t=Id(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(`
|
127
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Rd(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,i){}useTile(e,t,i){const r=Xi(e,t,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)}}var i0=c_;class H$ extends i0{constructor(e){const t=e.projection||"EPSG:3857",i=e.extent||Rr(t),r=e.tileGrid||Io({extent:i,maxResolution:e.maxResolution,maxZoom:e.maxZoom!==void 0?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,opaque:!1,projection:t,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:pT,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,zDirection:e.zDirection===void 0?1:e.zDirection}),this.format_=e.format?e.format:null,this.sourceTileCache=new xc(this.tileCache.highWaterMark),this.overlaps_=e.overlaps==null?!0:e.overlaps,this.tileClass=e.tileClass?e.tileClass:Kg,this.tileGrids_={}}getFeaturesInExtent(e){const t=[],i=this.tileCache;if(i.getCount()===0)return t;const r=Wg(i.peekFirstKey())[0],s=this.tileGrid;return i.forEach(function(o){if(o.tileCoord[0]!==r||o.getState()!==W.LOADED)return;const a=o.getSourceTiles();for(let c=0,l=a.length;c<l;++c){const u=a[c],h=u.tileCoord;if(at(e,s.getTileCoordExtent(h))){const d=u.getFeatures();if(d)for(let f=0,p=d.length;f<p;++f){const m=d[f],g=m.getGeometry();at(e,g.getExtent())&&t.push(m)}}}}),t}getOverlaps(){return this.overlaps_}clear(){this.tileCache.clear(),this.sourceTileCache.clear()}expireCache(e,t){const i=this.getTileCacheForProjection(e),r=Object.keys(t).reduce((s,o)=>{const a=Av(o);if(i.containsKey(a)){const c=i.get(a).sourceTiles;for(let l=0,u=c.length;l<u;++l)s[c[l].getKey()]=!0}return s},{});super.expireCache(e,t),this.sourceTileCache.expireCache(r)}getSourceTiles(e,t,i){if(i.getState()===W.IDLE){i.setState(W.LOADING);const r=i.wrappedTileCoord,s=this.getTileGridForProjection(t),o=s.getTileCoordExtent(r),a=r[0],c=s.getResolution(a);Nn(o,-c,o);const l=this.tileGrid,u=l.getExtent();u&&an(o,u,o);const h=l.getZForResolution(c,1);l.forEachTileCoord(o,h,d=>{const f=this.tileUrlFunction(d,e,t),p=this.sourceTileCache.containsKey(f)?this.sourceTileCache.get(f):new this.tileClass(d,f?W.IDLE:W.EMPTY,f,this.format_,this.tileLoadFunction);i.sourceTiles.push(p);const m=p.getState();if(m<W.LOADED){const g=y=>{this.handleTileChange(y);const _=p.getState();if(_===W.LOADED||_===W.ERROR){const v=p.getKey();v in i.errorTileKeys?p.getState()===W.LOADED&&delete i.errorTileKeys[v]:i.loadingSourceTiles--,_===W.ERROR?i.errorTileKeys[v]=!0:p.removeEventListener(ne.CHANGE,g),i.loadingSourceTiles===0&&i.setState(xi(i.errorTileKeys)?W.LOADED:W.ERROR)}};p.addEventListener(ne.CHANGE,g),i.loadingSourceTiles++}m===W.IDLE&&(p.extent=l.getTileCoordExtent(d),p.projection=t,p.resolution=l.getResolution(d[0]),this.sourceTileCache.set(f,p),p.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(d=>d.getState()===W.ERROR)?W.ERROR:W.LOADED)}return i.sourceTiles}getTile(e,t,i,r,s){const o=Xi(e,t,i),a=this.getKey();let c;if(this.tileCache.containsKey(o)&&(c=this.tileCache.get(o),c.key===a))return c;const l=[e,t,i];let u=this.getTileCoordForTileUrlFunction(l,s);const h=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(s);if(u&&h){const m=d.getTileCoordExtent(u);Nn(m,-d.getResolution(e),m),at(h,m)||(u=null)}let f=!0;if(u!==null){const m=this.tileGrid,g=d.getResolution(e),y=m.getZForResolution(g,1),_=d.getTileCoordExtent(u);Nn(_,-g,_),m.forEachTileCoord(_,y,function(v){f=f&&!this.tileUrlFunction(v,r,s)}.bind(this))}const p=new Hg(l,f?W.EMPTY:W.IDLE,u,this.getSourceTiles.bind(this,r,s));return p.key=a,c?(p.interimTile=c,p.refreshInterimChain(),this.tileCache.replace(o,p)):this.tileCache.set(o,p),p}getTileGridForProjection(e){const t=e.getCode();let i=this.tileGrids_[t];if(!i){const r=this.tileGrid;i=t0(e,void 0,r?r.getTileSize(r.getMinZoom()):void 0),this.tileGrids_[t]=i}return i}getTilePixelRatio(e){return e}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=pt(r.getTileSize(e),this.tmpSize);return[Math.round(s[0]*t),Math.round(s[1]*t)]}updateCacheSize(e,t){super.updateCacheSize(e*2,t),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(t).highWaterMark}}var Cd=H$;function pT(n,e){n.setLoader(function(t,i,r){Vg(e,n.getFormat(),t,i,r,n.onLoad.bind(n),n.onError.bind(n))})}class K$ extends i0{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate),super({attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:q$,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:t,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ro,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const e in this.tileCacheForProjection)if(this.tileCacheForProjection[e].canExpireCache())return!0;return!1}expireCache(e,t){const i=this.getTileCacheForProjection(e);this.tileCache.expireCache(this.tileCache==i?t:{});for(const r in this.tileCacheForProjection){const s=this.tileCacheForProjection[r];s.expireCache(s==i?t:{})}}getGutterForProjection(e){return this.getProjection()&&e&&!Gn(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getOpaque(e){return this.getProjection()&&e&&!Gn(this.getProjection(),e)?!1:super.getOpaque(e)}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||Gn(t,e)))return this.tileGrid;{const i=se(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=e0(e)),this.tileGridForProjection[i]}}getTileCacheForProjection(e){const t=this.getProjection();if(!t||Gn(t,e))return this.tileCache;{const i=se(e);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new xc(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]}}createTile_(e,t,i,r,s,o){const a=[e,t,i],c=this.getTileCoordForTileUrlFunction(a,s),l=c?this.tileUrlFunction(c,r,s):void 0,u=new this.tileClass(a,l!==void 0?W.IDLE:W.EMPTY,l!==void 0?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(ne.CHANGE,this.handleTileChange.bind(this)),u}getTile(e,t,i,r,s){const o=this.getProjection();if(!o||!s||Gn(o,s))return this.getTileInternal(e,t,i,r,o||s);{const a=this.getTileCacheForProjection(s),c=[e,t,i];let l;const u=Aa(c);a.containsKey(u)&&(l=a.get(u));const h=this.getKey();if(l&&l.key==h)return l;{const d=this.getTileGridForProjection(o),f=this.getTileGridForProjection(s),p=this.getTileCoordForTileUrlFunction(c,s),m=new Sd(o,d,s,f,c,p,this.getTilePixelRatio(r),this.getGutter(),function(g,y,_,v){return this.getTileInternal(g,y,_,v,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return m.key=h,l?(m.interimTile=l,m.refreshInterimChain(),a.replace(u,m)):a.set(u,m),m}}}getTileInternal(e,t,i,r,s){let o=null;const a=Xi(e,t,i),c=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(e,t,i,r,s,c),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=c){const l=o;o=this.createTile_(e,t,i,r,s,c),l.getState()==W.IDLE?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(e){if(this.renderReprojectionEdges_!=e){this.renderReprojectionEdges_=e;for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}}setTileGridForProjection(e,t){{const i=re(e);if(i){const r=se(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}}}function q$(n,e){n.getImage().src=e}var Ji=K$;function Nc(n,e,t,i){const r=document.createElement("script"),s="olc_"+se(e);function o(){delete window[s],r.parentNode.removeChild(r)}r.async=!0,r.src=n+(n.indexOf("?")==-1?"?":"&")+(i||"callback")+"="+s;const a=setTimeout(function(){o(),t&&t()},1e4);window[s]=function(c){clearTimeout(a),o(),e(c)},document.getElementsByTagName("head")[0].appendChild(r)}class gT extends Error{constructor(e){const t="Unexpected response status: "+e.status;super(t),this.name="ResponseError",this.response=e}}class mT extends Error{constructor(e){super("Failed to issue request"),this.name="ClientError",this.client=e}}function r0(n){return new Promise(function(e,t){function i(o){const a=o.target;if(!a.status||a.status>=200&&a.status<300){let c;try{c=JSON.parse(a.responseText)}catch(l){const u="Error parsing response text as JSON: "+l.message;t(new Error(u));return}e(c);return}t(new gT(a))}function r(o){t(new mT(o.target))}const s=new XMLHttpRequest;s.addEventListener("load",i),s.addEventListener("error",r),s.open("GET",n),s.setRequestHeader("Accept","application/json"),s.send()})}function s0(n,e){return e.indexOf("://")>=0?e:new URL(e,n).href}let yT;function J$(n){typeof XMLHttpRequest!="undefined"&&(yT=XMLHttpRequest),global.XMLHttpRequest=n}function Q$(){global.XMLHttpRequest=yT}class eD extends Ji{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;if(e.interpolate!==void 0&&(t=e.interpolate),super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:t,projection:re("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Fe.LOADING,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url)if(e.jsonp)Nc(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const i=new XMLHttpRequest;i.addEventListener("load",this.onXHRLoad_.bind(this)),i.addEventListener("error",this.onXHRError_.bind(this)),i.open("GET",e.url),i.send()}else e.tileJSON?this.handleTileJSONResponse(e.tileJSON):ce(!1,51)}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(i)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){const t=re("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const l=qn(t,i);r=Ks(e.bounds,l)}const s=Rr(i),o=e.minzoom||0,a=e.maxzoom||22,c=Io({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=c,this.tileUrlFunction=Rd(e.tiles,c),e.attribution!==void 0&&!this.getAttributions()){const l=r!==void 0?r:s;this.setAttributions(function(u){return at(l,u.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(Fe.READY)}handleTileJSONError(){this.setState(Fe.ERROR)}}var _T=eD;class tD extends $m{constructor(e){super(e)}createRenderer(){return new Jm(this)}}var xT=tD,vT={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},kc=" ",wT=/(italic|oblique)$/i,ET={},o0=function(n,e,t){var i=ET[n];if(!i){Array.isArray(n)||(n=[n]);for(var r=400,s="normal",o=[],a,c,l=0,u=n.length;l<u;++l){var h=n[l],d=h.split(" "),f=d[d.length-1].toLowerCase();f=="normal"||f=="italic"||f=="oblique"?(s=c?s:f,d.pop(),f=d[d.length-1].toLowerCase()):wT.test(f)&&(f=f.replace(wT,""),s=c?s:d[d.length-1].replace(f,""));for(var p in vT){var m=d.length>1?d[d.length-2].toLowerCase():"";if(f==p||f==p.replace("-","")||m+"-"+f==p){r=a?r:vT[p],d.pop(),m&&p.startsWith(m)&&d.pop();break}}!a&&typeof f=="number"&&(r=f);var g=d.join(kc).replace("Klokantech Noto Sans","Noto Sans");g.indexOf(kc)!==-1&&(g='"'+g+'"'),o.push(g)}i=ET[n]=[s,r,o]}return i[0]+kc+i[1]+kc+e+"px"+(t?"/"+t:"")+kc+i[2]},nD=8,iD={version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90\xB0 orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Supported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},rD={"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},sD=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],oD={type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},aD={type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},lD={type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},cD={type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) \u2014 it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},uD={type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},hD={type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},dD={id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},fD=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],pD={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},gD={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},mD={"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},yD={"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},_D={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},xD={"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},vD={"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn\u2019t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},wD={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},ED={visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},TD={type:"array",value:"*",doc:"A filter selects specific features from a layer."},bD={type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},SD={type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},RD={type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},ID={type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},CD={type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},LD={type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] \u2260 value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] \u2265 value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] \u2264 value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] \u2208 {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] \u2209 {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 \u2227 ... \u2227 fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 \u2228 ... \u2228 fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `\xACf0 \u2227 ... \u2227 \xACfn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},AD={type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},PD={type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},OD={type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},MD={doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},FD={range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},ND={anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0\xB0 (0\xB0 when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0\xB0 when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0\xB0, directly above, to 180\xB0, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},kD={name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carr\xE9e projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},$D={source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},DD=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],GD={"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},UD={"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},zD={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},BD={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},jD={"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},VD={"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},YD={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},XD={"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},ZD={"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0\xB0 north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0\xB0 is directly above, at zenith, and 90\xB0 at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0\xB0 north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0\xB0 is directly above, at zenith, and 90\xB0 at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},WD={duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},HD={"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}},Ld={$version:nD,$root:iD,sources:rD,source:sD,source_vector:oD,source_raster:aD,source_raster_dem:lD,source_geojson:cD,source_video:uD,source_image:hD,layer:dD,layout:fD,layout_background:pD,layout_sky:gD,layout_fill:mD,layout_circle:yD,layout_heatmap:_D,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:xD,layout_symbol:vD,layout_raster:wD,layout_hillshade:ED,filter:TD,filter_symbol:bD,filter_fill:SD,filter_line:RD,filter_circle:ID,"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:CD,filter_operator:LD,geometry_type:AD,function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:`A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:
|
128
|
+
* In categorical functions, when the feature value does not match any of the stop domain values.
|
129
|
+
* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.
|
130
|
+
* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a \`circle-color\` property but the feature property value is not a string or not a valid color).
|
131
|
+
* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.
|
132
|
+
If no default is provided, the style property's default is used in these circumstances.`}},function_stop:PD,expression:OD,expression_name:MD,fog:FD,light:ND,projection:kD,terrain:$D,paint:DD,paint_fill:GD,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:UD,paint_circle:zD,paint_heatmap:BD,paint_symbol:jD,paint_raster:VD,paint_hillshade:YD,paint_background:XD,paint_sky:ZD,transition:WD,"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:HD},a0=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ad(n){var e={exports:{}};return n(e,e.exports),e.exports}function KD(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}/*! https://mths.be/punycode v1.3.2 by @mathias */Ad(function(n,e){(function(t){var i=e&&!e.nodeType&&e,r=n&&!n.nodeType&&n,s=typeof a0=="object"&&a0;(s.global===s||s.window===s||s.self===s)&&(t=s);var o,a=2147483647,c=36,l=1,u=26,h=38,d=700,f=72,p=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-l,w=Math.floor,E=String.fromCharCode,T;function b(k){throw RangeError(v[k])}function S(k,$){for(var F=k.length,te=[];F--;)te[F]=$(k[F]);return te}function A(k,$){var F=k.split("@"),te="";F.length>1&&(te=F[0]+"@",k=F[1]),k=k.replace(_,".");var z=k.split("."),X=S(z,$).join(".");return te+X}function I(k){for(var $=[],F=0,te=k.length,z,X;F<te;)z=k.charCodeAt(F++),z>=55296&&z<=56319&&F<te?(X=k.charCodeAt(F++),(X&64512)==56320?$.push(((z&1023)<<10)+(X&1023)+65536):($.push(z),F--)):$.push(z);return $}function N(k){return S(k,function($){var F="";return $>65535&&($-=65536,F+=E($>>>10&1023|55296),$=56320|$&1023),F+=E($),F}).join("")}function M(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:c}function B(k,$){return k+22+75*(k<26)-(($!=0)<<5)}function O(k,$,F){var te=0;for(k=F?w(k/d):k>>1,k+=w(k/$);k>x*u>>1;te+=c)k=w(k/x);return w(te+(x+1)*k/(k+h))}function P(k){var $=[],F=k.length,te,z=0,X=p,K=f,le,ae,Y,Pe,Oe,Se,mt,De,Be;for(le=k.lastIndexOf(m),le<0&&(le=0),ae=0;ae<le;++ae)k.charCodeAt(ae)>=128&&b("not-basic"),$.push(k.charCodeAt(ae));for(Y=le>0?le+1:0;Y<F;){for(Pe=z,Oe=1,Se=c;Y>=F&&b("invalid-input"),mt=M(k.charCodeAt(Y++)),(mt>=c||mt>w((a-z)/Oe))&&b("overflow"),z+=mt*Oe,De=Se<=K?l:Se>=K+u?u:Se-K,!(mt<De);Se+=c)Be=c-De,Oe>w(a/Be)&&b("overflow"),Oe*=Be;te=$.length+1,K=O(z-Pe,te,Pe==0),w(z/te)>a-X&&b("overflow"),X+=w(z/te),z%=te,$.splice(z++,0,X)}return N($)}function G(k){var $,F,te,z,X,K,le,ae,Y,Pe,Oe,Se=[],mt,De,Be,nt;for(k=I(k),mt=k.length,$=p,F=0,X=f,K=0;K<mt;++K)Oe=k[K],Oe<128&&Se.push(E(Oe));for(te=z=Se.length,z&&Se.push(m);te<mt;){for(le=a,K=0;K<mt;++K)Oe=k[K],Oe>=$&&Oe<le&&(le=Oe);for(De=te+1,le-$>w((a-F)/De)&&b("overflow"),F+=(le-$)*De,$=le,K=0;K<mt;++K)if(Oe=k[K],Oe<$&&++F>a&&b("overflow"),Oe==$){for(ae=F,Y=c;Pe=Y<=X?l:Y>=X+u?u:Y-X,!(ae<Pe);Y+=c)nt=ae-Pe,Be=c-Pe,Se.push(E(B(Pe+nt%Be,0))),ae=w(nt/Be);Se.push(E(B(ae,0))),X=O(F,De,te==z),F=0,++te}++F,++$}return Se.join("")}function U(k){return A(k,function($){return g.test($)?P($.slice(4).toLowerCase()):$})}function D(k){return A(k,function($){return y.test($)?"xn--"+G($):$})}if(o={version:"1.3.2",ucs2:{decode:I,encode:N},decode:P,encode:G,toASCII:D,toUnicode:U},i&&r)if(n.exports==i)r.exports=o;else for(T in o)o.hasOwnProperty(T)&&(i[T]=o[T]);else t.punycode=o})(a0)});function qD(n,e){return Object.prototype.hasOwnProperty.call(n,e)}var JD=function(n,e,t,i){e=e||"&",t=t||"=";var r={};if(typeof n!="string"||n.length===0)return r;var s=/\+/g;n=n.split(e);var o=1e3;i&&typeof i.maxKeys=="number"&&(o=i.maxKeys);var a=n.length;o>0&&a>o&&(a=o);for(var c=0;c<a;++c){var l=n[c].replace(s,"%20"),u=l.indexOf(t),h,d,f,p;u>=0?(h=l.substr(0,u),d=l.substr(u+1)):(h=l,d=""),f=decodeURIComponent(h),p=decodeURIComponent(d),qD(r,f)?Array.isArray(r[f])?r[f].push(p):r[f]=[r[f],p]:r[f]=p}return r},$c=function(n){switch(typeof n){case"string":return n;case"boolean":return n?"true":"false";case"number":return isFinite(n)?n:"";default:return""}},QD=function(n,e,t,i){return e=e||"&",t=t||"=",n===null&&(n=void 0),typeof n=="object"?Object.keys(n).map(function(r){var s=encodeURIComponent($c(r))+t;return Array.isArray(n[r])?n[r].map(function(o){return s+encodeURIComponent($c(o))}).join(e):s+encodeURIComponent($c(n[r]))}).join(e):i?encodeURIComponent($c(i))+t+encodeURIComponent($c(n)):""};Ad(function(n,e){e.decode=e.parse=JD,e.encode=e.stringify=QD});function Co(n,...e){for(const t of e)for(const i in t)n[i]=t[i];return n}class Qi extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class u_{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[i,r]of t)this.bindings[i]=r}concat(e){return new u_(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}}const Pd={kind:"null"},q={kind:"number"},$e={kind:"string"},Ce={kind:"boolean"},Ir={kind:"color"},Ya={kind:"object"},Le={kind:"value"},eG={kind:"error"},Od={kind:"collator"},Md={kind:"formatted"},Dc={kind:"resolvedImage"};function di(n,e){return{kind:"array",itemType:n,N:e}}function xt(n){if(n.kind==="array"){const e=xt(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const tG=[Pd,q,$e,Ce,Ir,Md,Ya,di(Le),Dc];function Gc(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Gc(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const t of tG)if(!Gc(t,e))return null}}return`Expected ${xt(n)} but found ${xt(e)} instead.`}function l0(n,e){return e.some(t=>t.kind===n.kind)}function Uc(n,e){return e.some(t=>t==="null"?n===null:t==="array"?Array.isArray(n):t==="object"?n&&!Array.isArray(n)&&typeof n=="object":t===typeof n)}var TT=Ad(function(n,e){var t={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function i(l){return l=Math.round(l),l<0?0:l>255?255:l}function r(l){return l<0?0:l>1?1:l}function s(l){return l[l.length-1]==="%"?i(parseFloat(l)/100*255):i(parseInt(l))}function o(l){return l[l.length-1]==="%"?r(parseFloat(l)/100):r(parseFloat(l))}function a(l,u,h){return h<0?h+=1:h>1&&(h-=1),h*6<1?l+(u-l)*h*6:h*2<1?u:h*3<2?l+(u-l)*(2/3-h)*6:l}function c(l){var u=l.replace(/ /g,"").toLowerCase();if(u in t)return t[u].slice();if(u[0]==="#"){if(u.length===4){var h=parseInt(u.substr(1),16);return h>=0&&h<=4095?[(h&3840)>>4|(h&3840)>>8,h&240|(h&240)>>4,h&15|(h&15)<<4,1]:null}else if(u.length===7){var h=parseInt(u.substr(1),16);return h>=0&&h<=16777215?[(h&16711680)>>16,(h&65280)>>8,h&255,1]:null}return null}var d=u.indexOf("("),f=u.indexOf(")");if(d!==-1&&f+1===u.length){var p=u.substr(0,d),m=u.substr(d+1,f-(d+1)).split(","),g=1;switch(p){case"rgba":if(m.length!==4)return null;g=o(m.pop());case"rgb":return m.length!==3?null:[s(m[0]),s(m[1]),s(m[2]),g];case"hsla":if(m.length!==4)return null;g=o(m.pop());case"hsl":if(m.length!==3)return null;var y=(parseFloat(m[0])%360+360)%360/360,_=o(m[1]),v=o(m[2]),x=v<=.5?v*(_+1):v+_-v*_,w=v*2-x;return[i(a(w,x,y+1/3)*255),i(a(w,x,y)*255),i(a(w,x,y-1/3)*255),g];default:return null}}return null}try{e.parseCSSColor=c}catch{}});class qe{constructor(e,t,i,r=1){this.r=e,this.g=t,this.b=i,this.a=r}static parse(e){if(!e)return;if(e instanceof qe)return e;if(typeof e!="string")return;const t=TT.parseCSSColor(e);if(!!t)return new qe(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}toString(){const[e,t,i,r]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(i)},${r})`}toArray(){const{r:e,g:t,b:i,a:r}=this;return r===0?[0,0,0,0]:[e*255/r,t*255/r,i*255/r,r]}}qe.black=new qe(0,0,0,1),qe.white=new qe(1,1,1,1),qe.transparent=new qe(0,0,0,0),qe.red=new qe(1,0,0,1),qe.blue=new qe(0,0,1,1);class c0{constructor(e,t,i){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class u0{constructor(e,t,i,r,s){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=s}}class ki{constructor(e){this.sections=e}static fromString(e){return new ki([new u0(e,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof ki?e:ki.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const i={};t.fontStack&&(i["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(i["font-scale"]=t.scale),t.textColor&&(i["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(i)}return e}}class Dr{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Dr({name:e,available:!1}):null}serialize(){return["image",this.name]}}function bT(n,e,t,i){return typeof n=="number"&&n>=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255?typeof i=="undefined"||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[n,e,t,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[n,e,t,i]:[n,e,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Fd(n){if(n===null)return!0;if(typeof n=="string")return!0;if(typeof n=="boolean")return!0;if(typeof n=="number")return!0;if(n instanceof qe)return!0;if(n instanceof c0)return!0;if(n instanceof ki)return!0;if(n instanceof Dr)return!0;if(Array.isArray(n)){for(const e of n)if(!Fd(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!Fd(n[e]))return!1;return!0}else return!1}function Vt(n){if(n===null)return Pd;if(typeof n=="string")return $e;if(typeof n=="boolean")return Ce;if(typeof n=="number")return q;if(n instanceof qe)return Ir;if(n instanceof c0)return Od;if(n instanceof ki)return Md;if(n instanceof Dr)return Dc;if(Array.isArray(n)){const e=n.length;let t;for(const i of n){const r=Vt(i);if(!t)t=r;else{if(t===r)continue;t=Le;break}}return di(t||Le,e)}else return Ya}function zc(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof qe||n instanceof ki||n instanceof Dr?n.toString():JSON.stringify(n)}class pl{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Fd(e[1]))return t.error("invalid value");const i=e[1];let r=Vt(i);const s=t.expectedType;return r.kind==="array"&&r.N===0&&s&&s.kind==="array"&&(typeof s.N!="number"||s.N===0)&&(r=s),new pl(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof qe?["rgba"].concat(this.value.toArray()):this.value instanceof ki?this.value.serialize():this.value}}class un{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const h0={string:$e,number:q,boolean:Ce,object:Ya};class Ni{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=1,r;const s=e[0];if(s==="array"){let a;if(e.length>2){const l=e[1];if(typeof l!="string"||!(l in h0)||l==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=h0[l],i++}else a=Le;let c;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);c=e[2],i++}r=di(a,c)}else r=h0[s];const o=[];for(;i<e.length;i++){const a=t.parse(e[i],i,Le);if(!a)return null;o.push(a)}return new Ni(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(Gc(this.type,Vt(i))){if(t===this.args.length-1)throw new un(`Expected value to be of type ${xt(this.type)}, but found ${xt(Vt(i))} instead.`)}else return i}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=this.type,t=[e.kind];if(e.kind==="array"){const i=e.itemType;if(i.kind==="string"||i.kind==="number"||i.kind==="boolean"){t.push(i.kind);const r=e.N;(typeof r=="number"||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map(i=>i.serialize()))}}class Ff{constructor(e){this.type=Md,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&typeof i=="object")return t.error("First argument must be an image or text section.");const r=[];let s=!1;for(let o=1;o<=e.length-1;++o){const a=e[o];if(s&&typeof a=="object"&&!Array.isArray(a)){s=!1;let c=null;if(a["font-scale"]&&(c=t.parse(a["font-scale"],1,q),!c))return null;let l=null;if(a["text-font"]&&(l=t.parse(a["text-font"],1,di($e)),!l))return null;let u=null;if(a["text-color"]&&(u=t.parse(a["text-color"],1,Ir),!u))return null;const h=r[r.length-1];h.scale=c,h.font=l,h.textColor=u}else{const c=t.parse(e[o],1,Le);if(!c)return null;const l=c.type.kind;if(l!=="string"&&l!=="value"&&l!=="null"&&l!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,r.push({content:c,scale:null,font:null,textColor:null})}}return new Ff(r)}evaluate(e){const t=i=>{const r=i.content.evaluate(e);return Vt(r)===Dc?new u0("",r,null,null,null):new u0(zc(r),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)};return new ki(this.sections.map(t))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const i={};t.scale&&(i["font-scale"]=t.scale.serialize()),t.font&&(i["text-font"]=t.font.serialize()),t.textColor&&(i["text-color"]=t.textColor.serialize()),e.push(i)}return e}}class Nf{constructor(e){this.type=Dc,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const i=t.parse(e[1],1,$e);return i?new Nf(i):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),i=Dr.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const nG={"to-boolean":Ce,"to-color":Ir,"to-number":q,"to-string":$e};class Fs{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0];if((i==="to-boolean"||i==="to-string")&&e.length!==2)return t.error("Expected one argument.");const r=nG[i],s=[];for(let o=1;o<e.length;o++){const a=t.parse(e[o],o,Le);if(!a)return null;s.push(a)}return new Fs(r,s)}evaluate(e){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(e));if(this.type.kind==="color"){let t,i;for(const r of this.args){if(t=r.evaluate(e),i=null,t instanceof qe)return t;if(typeof t=="string"){const s=e.parseColor(t);if(s)return s}else if(Array.isArray(t)&&(t.length<3||t.length>4?i=`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:i=bT(t[0],t[1],t[2],t[3]),!i))return new qe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new un(i||`Could not parse color from value '${typeof t=="string"?t:String(JSON.stringify(t))}'`)}else if(this.type.kind==="number"){let t=null;for(const i of this.args){if(t=i.evaluate(e),t===null)return 0;const r=Number(t);if(!isNaN(r))return r}throw new un(`Could not convert ${JSON.stringify(t)} to number.`)}else return this.type.kind==="formatted"?ki.fromString(zc(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?Dr.fromString(zc(this.args[0].evaluate(e))):zc(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){if(this.type.kind==="formatted")return new Ff([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new Nf(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild(t=>{e.push(t.serialize())}),e}}const iG=["Unknown","Point","LineString","Polygon"];class ST{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?iG[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:r}=this.featureTileCoord,s=i*t-e[0],o=r*t-e[1],a=this.featureDistanceData.bearing[0],c=this.featureDistanceData.bearing[1];return a*s+c*o}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=qe.parse(e)),t}}class mi{constructor(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(e=>e.serialize()))}static parse(e,t){const i=e[0],r=mi.definitions[i];if(!r)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter(([l])=>!Array.isArray(l)||l.length===e.length-1);let c=null;for(const[l,u]of a){c=new Df(t.registry,t.path,null,t.scope);const h=[];let d=!1;for(let f=1;f<e.length;f++){const p=e[f],m=Array.isArray(l)?l[f-1]:l.type,g=c.parse(p,1+h.length,m);if(!g){d=!0;break}h.push(g)}if(!d){if(Array.isArray(l)&&l.length!==h.length){c.error(`Expected ${l.length} arguments, but found ${h.length} instead.`);continue}for(let f=0;f<h.length;f++){const p=Array.isArray(l)?l[f]:l.type,m=h[f];c.concat(f+1).checkSubtype(p,m.type)}if(c.errors.length===0)return new mi(i,s,u,h)}}if(a.length===1)t.errors.push(...c.errors);else{const u=(a.length?a:o).map(([d])=>rG(d)).join(" | "),h=[];for(let d=1;d<e.length;d++){const f=t.parse(e[d],1+h.length);if(!f)return null;h.push(xt(f.type))}t.error(`Expected arguments of type ${u}, but found (${h.join(", ")}) instead.`)}return null}static register(e,t){mi.definitions=t;for(const i in t)e[i]=mi}}function rG(n){return Array.isArray(n)?`(${n.map(xt).join(", ")})`:`(${xt(n.type)}...)`}class kf{constructor(e,t,i){this.type=Od,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error("Expected one argument.");const i=e[1];if(typeof i!="object"||Array.isArray(i))return t.error("Collator options argument must be an object.");const r=t.parse(i["case-sensitive"]===void 0?!1:i["case-sensitive"],1,Ce);if(!r)return null;const s=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,Ce);if(!s)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,$e),!o)?null:new kf(r,s,o)}evaluate(e){return new c0(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const xs=8192;function d0(n,e){n[0]=Math.min(n[0],e[0]),n[1]=Math.min(n[1],e[1]),n[2]=Math.max(n[2],e[0]),n[3]=Math.max(n[3],e[1])}function sG(n){return(180+n)/360}function oG(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function Nd(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function aG(n,e){const t=sG(n[0]),i=oG(n[1]),r=Math.pow(2,e.z);return[Math.round(t*r*xs),Math.round(i*r*xs)]}function lG(n,e,t){const i=n[0]-e[0],r=n[1]-e[1],s=n[0]-t[0],o=n[1]-t[1];return i*o-s*r===0&&i*s<=0&&r*o<=0}function cG(n,e,t){return e[1]>n[1]!=t[1]>n[1]&&n[0]<(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1])+e[0]}function f0(n,e){let t=!1;for(let i=0,r=e.length;i<r;i++){const s=e[i];for(let o=0,a=s.length;o<a-1;o++){if(lG(n,s[o],s[o+1]))return!1;cG(n,s[o],s[o+1])&&(t=!t)}}return t}function uG(n,e){for(let t=0;t<e.length;t++)if(f0(n,e[t]))return!0;return!1}function hG(n,e){return n[0]*e[1]-n[1]*e[0]}function RT(n,e,t,i){const r=n[0]-t[0],s=n[1]-t[1],o=e[0]-t[0],a=e[1]-t[1],c=i[0]-t[0],l=i[1]-t[1],u=r*l-c*s,h=o*l-c*a;return u>0&&h<0||u<0&&h>0}function dG(n,e,t,i){const r=[e[0]-n[0],e[1]-n[1]],s=[i[0]-t[0],i[1]-t[1]];return hG(s,r)===0?!1:!!(RT(n,e,t,i)&&RT(t,i,n,e))}function fG(n,e,t){for(const i of t)for(let r=0;r<i.length-1;++r)if(dG(n,e,i[r],i[r+1]))return!0;return!1}function IT(n,e){for(let t=0;t<n.length;++t)if(!f0(n[t],e))return!1;for(let t=0;t<n.length-1;++t)if(fG(n[t],n[t+1],e))return!1;return!0}function pG(n,e){for(let t=0;t<e.length;t++)if(IT(n,e[t]))return!0;return!1}function p0(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=[];for(let o=0;o<n[r].length;o++){const a=aG(n[r][o],t);d0(e,a),s.push(a)}i.push(s)}return i}function CT(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=p0(n[r],e,t);i.push(s)}return i}function LT(n,e,t,i){if(n[0]<t[0]||n[0]>t[2]){const r=i*.5;let s=n[0]-t[0]>r?-i:t[0]-n[0]>r?i:0;s===0&&(s=n[0]-t[2]>r?-i:t[2]-n[0]>r?i:0),n[0]+=s}d0(e,n)}function gG(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function AT(n,e,t,i){const r=Math.pow(2,i.z)*xs,s=[i.x*xs,i.y*xs],o=[];for(const a of n)for(const c of a){const l=[c.x+s[0],c.y+s[1]];LT(l,e,t,r),o.push(l)}return o}function PT(n,e,t,i){const r=Math.pow(2,i.z)*xs,s=[i.x*xs,i.y*xs],o=[];for(const a of n){const c=[];for(const l of a){const u=[l.x+s[0],l.y+s[1]];d0(e,u),c.push(u)}o.push(c)}if(e[2]-e[0]<=r/2){gG(e);for(const a of o)for(const c of a)LT(c,e,t,r)}return o}function mG(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=p0(e.coordinates,i,r),o=AT(n.geometry(),t,i,r);if(!Nd(t,i))return!1;for(const a of o)if(!f0(a,s))return!1}if(e.type==="MultiPolygon"){const s=CT(e.coordinates,i,r),o=AT(n.geometry(),t,i,r);if(!Nd(t,i))return!1;for(const a of o)if(!uG(a,s))return!1}return!0}function yG(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=p0(e.coordinates,i,r),o=PT(n.geometry(),t,i,r);if(!Nd(t,i))return!1;for(const a of o)if(!IT(a,s))return!1}if(e.type==="MultiPolygon"){const s=CT(e.coordinates,i,r),o=PT(n.geometry(),t,i,r);if(!Nd(t,i))return!1;for(const a of o)if(!pG(a,s))return!1}return!0}class jo{constructor(e,t){this.type=Ce,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Fd(e[1])){const i=e[1];if(i.type==="FeatureCollection")for(let r=0;r<i.features.length;++r){const s=i.features[r].geometry.type;if(s==="Polygon"||s==="MultiPolygon")return new jo(i,i.features[r].geometry)}else if(i.type==="Feature"){const r=i.geometry.type;if(r==="Polygon"||r==="MultiPolygon")return new jo(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new jo(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return mG(e,this.geometries);if(e.geometryType()==="LineString")return yG(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Bc(n){if(n instanceof mi){if(n.name==="get"&&n.args.length===1)return!1;if(n.name==="feature-state")return!1;if(n.name==="has"&&n.args.length===1)return!1;if(n.name==="properties"||n.name==="geometry-type"||n.name==="id")return!1;if(/^filter-/.test(n.name))return!1}if(n instanceof jo)return!1;let e=!0;return n.eachChild(t=>{e&&!Bc(t)&&(e=!1)}),e}function kd(n){if(n instanceof mi&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!kd(t)&&(e=!1)}),e}function $d(n,e){if(n instanceof mi&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(i=>{t&&!$d(i,e)&&(t=!1)}),t}class $f{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new $f(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Df{constructor(e,t=[],i,r=new u_,s=[]){this.registry=e,this.path=t,this.key=t.map(o=>`[${o}]`).join(""),this.scope=r,this.errors=s,this.expectedType=i}parse(e,t,i,r,s={}){return t?this.concat(t,i,r)._parse(e,s):this._parse(e,s)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function i(r,s,o){return o==="assert"?new Ni(s,[r]):o==="coerce"?new Fs(s,[r]):r}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=e[0];if(typeof r!="string")return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[r];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){const a=this.expectedType,c=o.type;if((a.kind==="string"||a.kind==="number"||a.kind==="boolean"||a.kind==="object"||a.kind==="array")&&c.kind==="value")o=i(o,a,t.typeAnnotation||"assert");else if((a.kind==="color"||a.kind==="formatted"||a.kind==="resolvedImage")&&(c.kind==="value"||c.kind==="string"))o=i(o,a,t.typeAnnotation||"coerce");else if(this.checkSubtype(a,c))return null}if(!(o instanceof pl)&&o.type.kind!=="resolvedImage"&&g0(o)){const a=new ST;try{o=new pl(o.type,o.evaluate(a))}catch(c){return this.error(c.message),null}}return o}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e=="undefined"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i){const r=typeof e=="number"?this.path.concat(e):this.path,s=i?this.scope.concat(i):this.scope;return new Df(this.registry,r,t||null,s,this.errors)}error(e,...t){const i=`${this.key}${t.map(r=>`[${r}]`).join("")}`;this.errors.push(new Qi(i,e))}checkSubtype(e,t){const i=Gc(e,t);return i&&this.error(i),i}}function g0(n){if(n instanceof $f)return g0(n.boundExpression);if(n instanceof mi&&n.name==="error")return!1;if(n instanceof kf)return!1;if(n instanceof jo)return!1;const e=n instanceof Fs||n instanceof Ni;let t=!0;return n.eachChild(i=>{e?t=t&&g0(i):t=t&&i instanceof pl}),t?Bc(n)&&$d(n,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]):!1}function Dd(n,e){const t=n.length-1;let i=0,r=t,s=0,o,a;for(;i<=r;)if(s=Math.floor((i+r)/2),o=n[s],a=n[s+1],o<=e){if(s===t||e<a)return s;i=s+1}else if(o>e)r=s-1;else throw new un("Input is not a number.");return 0}class Gf{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[r,s]of i)this.labels.push(r),this.outputs.push(s)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,q);if(!i)return null;const r=[];let s=null;t.expectedType&&t.expectedType.kind!=="value"&&(s=t.expectedType);for(let o=1;o<e.length;o+=2){const a=o===1?-1/0:e[o],c=e[o+1],l=o,u=o+1;if(typeof a!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(r.length&&r[r.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);const h=t.parse(c,u,s);if(!h)return null;s=s||h.type,r.push([a,h])}return new Gf(s,i,r)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=Dd(t,r);return i[o].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var _G=Xa;function Xa(n,e,t,i){this.cx=3*n,this.bx=3*(t-n)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=n,this.p1y=i,this.p2x=t,this.p2y=i}Xa.prototype.sampleCurveX=function(n){return((this.ax*n+this.bx)*n+this.cx)*n},Xa.prototype.sampleCurveY=function(n){return((this.ay*n+this.by)*n+this.cy)*n},Xa.prototype.sampleCurveDerivativeX=function(n){return(3*this.ax*n+2*this.bx)*n+this.cx},Xa.prototype.solveCurveX=function(n,e){typeof e=="undefined"&&(e=1e-6);var t,i,r,s,o;for(r=n,o=0;o<8;o++){if(s=this.sampleCurveX(r)-n,Math.abs(s)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r=r-s/a}if(t=0,i=1,r=n,r<t)return t;if(r>i)return i;for(;t<i;){if(s=this.sampleCurveX(r),Math.abs(s-n)<e)return r;n>s?t=r:i=r,r=(i-t)*.5+t}return r},Xa.prototype.solve=function(n,e){return this.sampleCurveY(this.solveCurveX(n,e))};function Qn(n,e,t){return n*(1-t)+e*t}function xG(n,e,t){return new qe(Qn(n.r,e.r,t),Qn(n.g,e.g,t),Qn(n.b,e.b,t),Qn(n.a,e.a,t))}function vG(n,e,t){return n.map((i,r)=>Qn(i,e[r],t))}var OT=Object.freeze({__proto__:null,number:Qn,color:xG,array:vG});const MT=.95047,FT=1,NT=1.08883,kT=4/29,Za=6/29,$T=3*Za*Za,wG=Za*Za*Za,EG=Math.PI/180,TG=180/Math.PI;function m0(n){return n>wG?Math.pow(n,1/3):n/$T+kT}function y0(n){return n>Za?n*n*n:$T*(n-kT)}function _0(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function x0(n){return n/=255,n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function DT(n){const e=x0(n.r),t=x0(n.g),i=x0(n.b),r=m0((.4124564*e+.3575761*t+.1804375*i)/MT),s=m0((.2126729*e+.7151522*t+.072175*i)/FT),o=m0((.0193339*e+.119192*t+.9503041*i)/NT);return{l:116*s-16,a:500*(r-s),b:200*(s-o),alpha:n.a}}function GT(n){let e=(n.l+16)/116,t=isNaN(n.a)?e:e+n.a/500,i=isNaN(n.b)?e:e-n.b/200;return e=FT*y0(e),t=MT*y0(t),i=NT*y0(i),new qe(_0(3.2404542*t-1.5371385*e-.4985314*i),_0(-.969266*t+1.8760108*e+.041556*i),_0(.0556434*t-.2040259*e+1.0572252*i),n.alpha)}function bG(n,e,t){return{l:Qn(n.l,e.l,t),a:Qn(n.a,e.a,t),b:Qn(n.b,e.b,t),alpha:Qn(n.alpha,e.alpha,t)}}function SG(n){const{l:e,a:t,b:i}=DT(n),r=Math.atan2(i,t)*TG;return{h:r<0?r+360:r,c:Math.sqrt(t*t+i*i),l:e,alpha:n.a}}function RG(n){const e=n.h*EG,t=n.c,i=n.l;return GT({l:i,a:Math.cos(e)*t,b:Math.sin(e)*t,alpha:n.alpha})}function IG(n,e,t){const i=e-n;return n+t*(i>180||i<-180?i-360*Math.round(i/360):i)}function CG(n,e,t){return{h:IG(n.h,e.h,t),c:Qn(n.c,e.c,t),l:Qn(n.l,e.l,t),alpha:Qn(n.alpha,e.alpha,t)}}const jc={forward:DT,reverse:GT,interpolate:bG},Vc={forward:SG,reverse:RG,interpolate:CG};var UT=Object.freeze({__proto__:null,lab:jc,hcl:Vc});class gi{constructor(e,t,i,r,s){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[o,a]of s)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(e,t,i,r){let s=0;if(e.name==="exponential")s=v0(t,e.base,i,r);else if(e.name==="linear")s=v0(t,1,i,r);else if(e.name==="cubic-bezier"){const o=e.controlPoints;s=new _G(o[0],o[1],o[2],o[3]).solve(v0(t,1,i,r))}return s}static parse(e,t){let[i,r,s,...o]=e;if(!Array.isArray(r)||r.length===0)return t.error("Expected an interpolation type expression.",1);if(r[0]==="linear")r={name:"linear"};else if(r[0]==="exponential"){const l=r[1];if(typeof l!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:l}}else if(r[0]==="cubic-bezier"){const l=r.slice(1);if(l.length!==4||l.some(u=>typeof u!="number"||u<0||u>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:l}}else return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(s=t.parse(s,2,q),!s)return null;const a=[];let c=null;i==="interpolate-hcl"||i==="interpolate-lab"?c=Ir:t.expectedType&&t.expectedType.kind!=="value"&&(c=t.expectedType);for(let l=0;l<o.length;l+=2){const u=o[l],h=o[l+1],d=l+3,f=l+4;if(typeof u!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(a.length&&a[a.length-1][0]>=u)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);const p=t.parse(h,f,c);if(!p)return null;c=c||p.type,a.push([u,p])}return c.kind!=="number"&&c.kind!=="color"&&!(c.kind==="array"&&c.itemType.kind==="number"&&typeof c.N=="number")?t.error(`Type ${xt(c)} is not interpolatable.`):new gi(c,i,r,s,a)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=Dd(t,r),a=t[o],c=t[o+1],l=gi.interpolationFactor(this.interpolation,r,a,c),u=i[o].evaluate(e),h=i[o+1].evaluate(e);return this.operator==="interpolate"?OT[this.type.kind.toLowerCase()](u,h,l):this.operator==="interpolate-hcl"?Vc.reverse(Vc.interpolate(Vc.forward(u),Vc.forward(h),l)):jc.reverse(jc.interpolate(jc.forward(u),jc.forward(h),l))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}serialize(){let e;this.interpolation.name==="linear"?e=["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?e=["linear"]:e=["exponential",this.interpolation.base]:e=["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let i=0;i<this.labels.length;i++)t.push(this.labels[i],this.outputs[i].serialize());return t}}function v0(n,e,t,i){const r=i-t,s=n-t;return r===0?0:e===1?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}class Iu{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let i=null;const r=t.expectedType;r&&r.kind!=="value"&&(i=r);const s=[];for(const a of e.slice(1)){const c=t.parse(a,1+s.length,i,void 0,{typeAnnotation:"omit"});if(!c)return null;i=i||c.type,s.push(c)}return r&&s.some(a=>Gc(r,a.type))?new Iu(Le,s):new Iu(i,s)}evaluate(e){let t=null,i=0,r;for(const s of this.args){if(i++,t=s.evaluate(e),t&&t instanceof Dr&&!t.available&&(r||(r=t),t=null,i===this.args.length))return r;if(t!==null)break}return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}serialize(){const e=["coalesce"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class Uf{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let s=1;s<e.length-1;s+=2){const o=e[s];if(typeof o!="string")return t.error(`Expected string, but found ${typeof o} instead.`,s);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",s);const a=t.parse(e[s+1],s+1);if(!a)return null;i.push([o,a])}const r=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return r?new Uf(i,r):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,i]of this.bindings)e.push(t,i.serialize());return e.push(this.result.serialize()),e}}class h_{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,q),r=t.parse(e[2],2,di(t.expectedType||Le));if(!i||!r)return null;const s=r.type;return new h_(s.itemType,i,r)}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new un(`Array index out of bounds: ${t} < 0.`);if(t>=i.length)throw new un(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new un(`Array index must be an integer, but found ${t} instead.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class d_{constructor(e,t){this.type=Ce,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Le),r=t.parse(e[2],2,Le);return!i||!r?null:l0(i.type,[Ce,$e,q,Pd,Le])?new d_(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${xt(i.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!Uc(t,["boolean","string","number","null"]))throw new un(`Expected first argument to be of type boolean, string, number or null, but found ${xt(Vt(t))} instead.`);if(!Uc(i,["string","array"]))throw new un(`Expected second argument to be of type array or string, but found ${xt(Vt(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class zf{constructor(e,t,i){this.type=q,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Le),r=t.parse(e[2],2,Le);if(!i||!r)return null;if(!l0(i.type,[Ce,$e,q,Pd,Le]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${xt(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,q);return s?new zf(i,r,s):null}else return new zf(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!Uc(t,["boolean","string","number","null"]))throw new un(`Expected first argument to be of type boolean, string, number or null, but found ${xt(Vt(t))} instead.`);if(!Uc(i,["string","array"]))throw new un(`Expected second argument to be of type array or string, but found ${xt(Vt(i))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(e);return i.indexOf(t,r)}return i.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(this.fromIndex!=null&&this.fromIndex!==void 0){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class f_{constructor(e,t,i,r,s,o){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=s,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return t.error("Expected an even number of arguments.");let i,r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);const s={},o=[];for(let l=2;l<e.length-1;l+=2){let u=e[l];const h=e[l+1];Array.isArray(u)||(u=[u]);const d=t.concat(l);if(u.length===0)return d.error("Expected at least one branch label.");for(const p of u){if(typeof p!="number"&&typeof p!="string")return d.error("Branch labels must be numbers or strings.");if(typeof p=="number"&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return d.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof p=="number"&&Math.floor(p)!==p)return d.error("Numeric branch labels must be integer values.");if(!i)i=Vt(p);else if(d.checkSubtype(i,Vt(p)))return null;if(typeof s[String(p)]!="undefined")return d.error("Branch labels must be unique.");s[String(p)]=o.length}const f=t.parse(h,l,r);if(!f)return null;r=r||f.type,o.push(f)}const a=t.parse(e[1],1,Le);if(!a)return null;const c=t.parse(e[e.length-1],e.length-1,r);return!c||a.type.kind!=="value"&&t.concat(1).checkSubtype(i,a.type)?null:new f_(i,r,a,s,o,c)}evaluate(e){const t=this.input.evaluate(e);return(Vt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),i=[],r={};for(const o of t){const a=r[this.cases[o]];a===void 0?(r[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[a][1].push(o)}const s=o=>this.inputType.kind==="number"?Number(o):o;for(const[o,a]of i)a.length===1?e.push(s(a[0])):e.push(a.map(s)),e.push(this.outputs[o].serialize());return e.push(this.otherwise.serialize()),e}}class p_{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);const r=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,Ce);if(!a)return null;const c=t.parse(e[o+1],o+1,i);if(!c)return null;r.push([a,c]),i=i||c.type}const s=t.parse(e[e.length-1],e.length-1,i);return s?new p_(i,r,s):null}evaluate(e){for(const[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild(t=>{e.push(t.serialize())}),e}}class Bf{constructor(e,t,i,r){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,Le),r=t.parse(e[2],2,q);if(!i||!r)return null;if(!l0(i.type,[di(Le),$e,Le]))return t.error(`Expected first argument to be of type array or string, but found ${xt(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,q);return s?new Bf(i.type,i,r,s):null}else return new Bf(i.type,i,r)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!Uc(t,["string","array"]))throw new un(`Expected first argument to be of type array or string, but found ${xt(Vt(t))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(e);return t.slice(i,r)}return t.slice(i)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(this.endIndex!=null&&this.endIndex!==void 0){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function zT(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function LG(n,e,t){return e===t}function AG(n,e,t){return e!==t}function PG(n,e,t){return e<t}function OG(n,e,t){return e>t}function MG(n,e,t){return e<=t}function FG(n,e,t){return e>=t}function BT(n,e,t,i){return i.compare(e,t)===0}function NG(n,e,t,i){return!BT(n,e,t,i)}function kG(n,e,t,i){return i.compare(e,t)<0}function $G(n,e,t,i){return i.compare(e,t)>0}function DG(n,e,t,i){return i.compare(e,t)<=0}function GG(n,e,t,i){return i.compare(e,t)>=0}function Wa(n,e,t){const i=n!=="=="&&n!=="!=";return class uI{constructor(s,o,a){this.type=Ce,this.lhs=s,this.rhs=o,this.collator=a,this.hasUntypedArgument=s.type.kind==="value"||o.type.kind==="value"}static parse(s,o){if(s.length!==3&&s.length!==4)return o.error("Expected two or three arguments.");const a=s[0];let c=o.parse(s[1],1,Le);if(!c)return null;if(!zT(a,c.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${xt(c.type)}'.`);let l=o.parse(s[2],2,Le);if(!l)return null;if(!zT(a,l.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${xt(l.type)}'.`);if(c.type.kind!==l.type.kind&&c.type.kind!=="value"&&l.type.kind!=="value")return o.error(`Cannot compare types '${xt(c.type)}' and '${xt(l.type)}'.`);i&&(c.type.kind==="value"&&l.type.kind!=="value"?c=new Ni(l.type,[c]):c.type.kind!=="value"&&l.type.kind==="value"&&(l=new Ni(c.type,[l])));let u=null;if(s.length===4){if(c.type.kind!=="string"&&l.type.kind!=="string"&&c.type.kind!=="value"&&l.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(u=o.parse(s[3],3,Od),!u)return null}return new uI(c,l,u)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(i&&this.hasUntypedArgument){const c=Vt(o),l=Vt(a);if(c.kind!==l.kind||!(c.kind==="string"||c.kind==="number"))throw new un(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${c.kind}, ${l.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const c=Vt(o),l=Vt(a);if(c.kind!=="string"||l.kind!=="string")return e(s,o,a)}return this.collator?t(s,o,a,this.collator.evaluate(s)):e(s,o,a)}eachChild(s){s(this.lhs),s(this.rhs),this.collator&&s(this.collator)}outputDefined(){return!0}serialize(){const s=[n];return this.eachChild(o=>{s.push(o.serialize())}),s}}}const UG=Wa("==",LG,BT),zG=Wa("!=",AG,NG),BG=Wa("<",PG,kG),jG=Wa(">",OG,$G),VG=Wa("<=",MG,DG),YG=Wa(">=",FG,GG);class g_{constructor(e,t,i,r,s){this.type=$e,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=s}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const i=t.parse(e[1],1,q);if(!i)return null;const r=e[2];if(typeof r!="object"||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");let s=null;if(r.locale&&(s=t.parse(r.locale,1,$e),!s))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,$e),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=t.parse(r["min-fraction-digits"],1,q),!a))return null;let c=null;return r["max-fraction-digits"]&&(c=t.parse(r["max-fraction-digits"],1,q),!c)?null:new g_(i,s,o,a,c)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class m_{constructor(e){this.type=q,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=t.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${xt(i.type)} instead.`):new m_(i):null}evaluate(e){const t=this.input.evaluate(e);if(typeof t=="string")return t.length;if(Array.isArray(t))return t.length;throw new un(`Expected value to be of type string or array, but found ${xt(Vt(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild(t=>{e.push(t.serialize())}),e}}const w0={"==":UG,"!=":zG,">":jG,"<":BG,">=":YG,"<=":VG,array:Ni,at:h_,boolean:Ni,case:p_,coalesce:Iu,collator:kf,format:Ff,image:Nf,in:d_,"index-of":zf,interpolate:gi,"interpolate-hcl":gi,"interpolate-lab":gi,length:m_,let:Uf,literal:pl,match:f_,number:Ni,"number-format":g_,object:Ni,slice:Bf,step:Gf,string:Ni,"to-boolean":Fs,"to-color":Fs,"to-number":Fs,"to-string":Fs,var:$f,within:jo};function jT(n,[e,t,i,r]){e=e.evaluate(n),t=t.evaluate(n),i=i.evaluate(n);const s=r?r.evaluate(n):1,o=bT(e,t,i,s);if(o)throw new un(o);return new qe(e/255*s,t/255*s,i/255*s,s)}function VT(n,e){return n in e}function E0(n,e){const t=e[n];return typeof t=="undefined"?null:t}function XG(n,e,t,i){for(;t<=i;){const r=t+i>>1;if(e[r]===n)return!0;e[r]>n?i=r-1:t=r+1}return!1}function Lo(n){return{type:n}}mi.register(w0,{error:[eG,[$e],(n,[e])=>{throw new un(e.evaluate(n))}],typeof:[$e,[Le],(n,[e])=>xt(Vt(e.evaluate(n)))],"to-rgba":[di(q,4),[Ir],(n,[e])=>e.evaluate(n).toArray()],rgb:[Ir,[q,q,q],jT],rgba:[Ir,[q,q,q,q],jT],has:{type:Ce,overloads:[[[$e],(n,[e])=>VT(e.evaluate(n),n.properties())],[[$e,Ya],(n,[e,t])=>VT(e.evaluate(n),t.evaluate(n))]]},get:{type:Le,overloads:[[[$e],(n,[e])=>E0(e.evaluate(n),n.properties())],[[$e,Ya],(n,[e,t])=>E0(e.evaluate(n),t.evaluate(n))]]},"feature-state":[Le,[$e],(n,[e])=>E0(e.evaluate(n),n.featureState||{})],properties:[Ya,[],n=>n.properties()],"geometry-type":[$e,[],n=>n.geometryType()],id:[Le,[],n=>n.id()],zoom:[q,[],n=>n.globals.zoom],pitch:[q,[],n=>n.globals.pitch||0],"distance-from-center":[q,[],n=>n.distanceFromCenter()],"heatmap-density":[q,[],n=>n.globals.heatmapDensity||0],"line-progress":[q,[],n=>n.globals.lineProgress||0],"sky-radial-progress":[q,[],n=>n.globals.skyRadialProgress||0],accumulated:[Le,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[q,Lo(q),(n,e)=>{let t=0;for(const i of e)t+=i.evaluate(n);return t}],"*":[q,Lo(q),(n,e)=>{let t=1;for(const i of e)t*=i.evaluate(n);return t}],"-":{type:q,overloads:[[[q,q],(n,[e,t])=>e.evaluate(n)-t.evaluate(n)],[[q],(n,[e])=>-e.evaluate(n)]]},"/":[q,[q,q],(n,[e,t])=>e.evaluate(n)/t.evaluate(n)],"%":[q,[q,q],(n,[e,t])=>e.evaluate(n)%t.evaluate(n)],ln2:[q,[],()=>Math.LN2],pi:[q,[],()=>Math.PI],e:[q,[],()=>Math.E],"^":[q,[q,q],(n,[e,t])=>Math.pow(e.evaluate(n),t.evaluate(n))],sqrt:[q,[q],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[q,[q],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[q,[q],(n,[e])=>Math.log(e.evaluate(n))],log2:[q,[q],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[q,[q],(n,[e])=>Math.sin(e.evaluate(n))],cos:[q,[q],(n,[e])=>Math.cos(e.evaluate(n))],tan:[q,[q],(n,[e])=>Math.tan(e.evaluate(n))],asin:[q,[q],(n,[e])=>Math.asin(e.evaluate(n))],acos:[q,[q],(n,[e])=>Math.acos(e.evaluate(n))],atan:[q,[q],(n,[e])=>Math.atan(e.evaluate(n))],min:[q,Lo(q),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[q,Lo(q),(n,e)=>Math.max(...e.map(t=>t.evaluate(n)))],abs:[q,[q],(n,[e])=>Math.abs(e.evaluate(n))],round:[q,[q],(n,[e])=>{const t=e.evaluate(n);return t<0?-Math.round(-t):Math.round(t)}],floor:[q,[q],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[q,[q],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[Ce,[$e,Le],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[Ce,[Le],(n,[e])=>n.id()===e.value],"filter-type-==":[Ce,[$e],(n,[e])=>n.geometryType()===e.value],"filter-<":[Ce,[$e,Le],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<r}],"filter-id-<":[Ce,[Le],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<i}],"filter->":[Ce,[$e,Le],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>r}],"filter-id->":[Ce,[Le],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>i}],"filter-<=":[Ce,[$e,Le],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[Ce,[Le],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<=i}],"filter->=":[Ce,[$e,Le],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[Ce,[Le],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>=i}],"filter-has":[Ce,[Le],(n,[e])=>e.value in n.properties()],"filter-has-id":[Ce,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[Ce,[di($e)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[Ce,[di(Le)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[Ce,[$e,di(Le)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[Ce,[$e,di(Le)],(n,[e,t])=>XG(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:Ce,overloads:[[[Ce,Ce],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[Lo(Ce),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:Ce,overloads:[[[Ce,Ce],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[Lo(Ce),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[Ce,[Ce],(n,[e])=>!e.evaluate(n)],"is-supported-script":[Ce,[$e],(n,[e])=>{const t=n.globals&&n.globals.isSupportedScript;return t?t(e.evaluate(n)):!0}],upcase:[$e,[$e],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[$e,[$e],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[$e,Lo(Le),(n,e)=>e.map(t=>zc(t.evaluate(n))).join("")],"resolved-locale":[$e,[Od],(n,[e])=>e.evaluate(n).resolvedLocale()]});function T0(n){return{result:"success",value:n}}function Ha(n){return{result:"error",value:n}}function Gd(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function YT(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function b0(n){return!!n.expression&&n.expression.interpolated}function Ye(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":n===null?"null":typeof n}function Yc(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function ZG(n){return n}function S0(n,e){const t=e.type==="color",i=n.stops&&typeof n.stops[0][0]=="object",r=i||n.property!==void 0,s=i||!r,o=n.type||(b0(e)?"exponential":"interval");if(t&&(n=Co({},n),n.stops&&(n.stops=n.stops.map(u=>[u[0],qe.parse(u[1])])),n.default?n.default=qe.parse(n.default):n.default=qe.parse(e.default)),n.colorSpace&&n.colorSpace!=="rgb"&&!UT[n.colorSpace])throw new Error(`Unknown color space: ${n.colorSpace}`);let a,c,l;if(o==="exponential")a=XT;else if(o==="interval")a=HG;else if(o==="categorical"){a=WG,c=Object.create(null);for(const u of n.stops)c[u[0]]=u[1];l=typeof n.stops[0][0]}else if(o==="identity")a=KG;else throw new Error(`Unknown function type "${o}"`);if(i){const u={},h=[];for(let p=0;p<n.stops.length;p++){const m=n.stops[p],g=m[0].zoom;u[g]===void 0&&(u[g]={zoom:g,type:n.type,property:n.property,default:n.default,stops:[]},h.push(g)),u[g].stops.push([m[0].value,m[1]])}const d=[];for(const p of h)d.push([u[p].zoom,S0(u[p],e)]);const f={name:"linear"};return{kind:"composite",interpolationType:f,interpolationFactor:gi.interpolationFactor.bind(void 0,f),zoomStops:d.map(p=>p[0]),evaluate({zoom:p},m){return XT({stops:d,base:n.base},e,p).evaluate(p,m)}}}else if(s){const u=o==="exponential"?{name:"exponential",base:n.base!==void 0?n.base:1}:null;return{kind:"camera",interpolationType:u,interpolationFactor:gi.interpolationFactor.bind(void 0,u),zoomStops:n.stops.map(h=>h[0]),evaluate:({zoom:h})=>a(n,e,h,c,l)}}else return{kind:"source",evaluate(u,h){const d=h&&h.properties?h.properties[n.property]:void 0;return d===void 0?Xc(n.default,e.default):a(n,e,d,c,l)}}}function Xc(n,e,t){if(n!==void 0)return n;if(e!==void 0)return e;if(t!==void 0)return t}function WG(n,e,t,i,r){const s=typeof t===r?i[t]:void 0;return Xc(s,n.default,e.default)}function HG(n,e,t){if(Ye(t)!=="number")return Xc(n.default,e.default);const i=n.stops.length;if(i===1||t<=n.stops[0][0])return n.stops[0][1];if(t>=n.stops[i-1][0])return n.stops[i-1][1];const r=Dd(n.stops.map(s=>s[0]),t);return n.stops[r][1]}function XT(n,e,t){const i=n.base!==void 0?n.base:1;if(Ye(t)!=="number")return Xc(n.default,e.default);const r=n.stops.length;if(r===1||t<=n.stops[0][0])return n.stops[0][1];if(t>=n.stops[r-1][0])return n.stops[r-1][1];const s=Dd(n.stops.map(u=>u[0]),t),o=qG(t,i,n.stops[s][0],n.stops[s+1][0]),a=n.stops[s][1],c=n.stops[s+1][1];let l=OT[e.type]||ZG;if(n.colorSpace&&n.colorSpace!=="rgb"){const u=UT[n.colorSpace];l=(h,d)=>u.reverse(u.interpolate(u.forward(h),u.forward(d),o))}return typeof a.evaluate=="function"?{evaluate(...u){const h=a.evaluate.apply(void 0,u),d=c.evaluate.apply(void 0,u);if(!(h===void 0||d===void 0))return l(h,d,o)}}:l(a,c,o)}function KG(n,e,t){return e.type==="color"?t=qe.parse(t):e.type==="formatted"?t=ki.fromString(t.toString()):e.type==="resolvedImage"?t=Dr.fromString(t.toString()):Ye(t)!==e.type&&(e.type!=="enum"||!e.values[t])&&(t=void 0),Xc(t,n.default,e.default)}function qG(n,e,t,i){const r=i-t,s=n-t;return r===0?0:e===1?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}class ZT{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new ST,this._defaultValue=t?e3(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,i,r,s,o,a,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=c||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,r,s,o,a,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=c||null;try{const l=this.expression.evaluate(this._evaluator);if(l==null||typeof l=="number"&&l!==l)return this._defaultValue;if(this._enumValues&&!(l in this._enumValues))throw new un(`Expected value to be one of ${Object.keys(this._enumValues).map(u=>JSON.stringify(u)).join(", ")}, but found ${JSON.stringify(l)} instead.`);return l}catch(l){return this._warningHistory[l.message]||(this._warningHistory[l.message]=!0,typeof console!="undefined"&&console.warn(l.message)),this._defaultValue}}}function Ud(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in w0}function Zc(n,e){const t=new Df(w0,[],e?QG(e):void 0),i=t.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return i?T0(new ZT(i,e)):Ha(t.errors)}class R0{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!kd(t.expression)}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}}class I0{constructor(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!kd(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}interpolationFactor(e,t,i){return this.interpolationType?gi.interpolationFactor(this.interpolationType,e,t,i):0}}function C0(n,e){if(n=Zc(n,e),n.result==="error")return n;const t=n.value.expression,i=Bc(t);if(!i&&!Gd(e))return Ha([new Qi("","data expressions not supported")]);const r=$d(t,["zoom","pitch","distance-from-center"]);if(!r&&!YT(e))return Ha([new Qi("","zoom expressions not supported")]);const s=zd(t);if(!s&&!r)return Ha([new Qi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Qi)return Ha([s]);if(s instanceof gi&&!b0(e))return Ha([new Qi("",'"interpolate" expressions cannot be used with this property')]);if(!s)return T0(i?new R0("constant",n.value):new R0("source",n.value));const o=s instanceof gi?s.interpolation:void 0;return T0(i?new I0("camera",n.value,s.labels,o):new I0("composite",n.value,s.labels,o))}class jf{constructor(e,t){this._parameters=e,this._specification=t,Co(this,S0(this._parameters,this._specification))}static deserialize(e){return new jf(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function JG(n,e){if(Yc(n))return new jf(n,e);if(Ud(n)){const t=C0(n,e);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return t.value}else{let t=n;return typeof n=="string"&&e.type==="color"&&(t=qe.parse(n)),{kind:"constant",evaluate:()=>t}}}function zd(n){let e=null;if(n instanceof Uf)e=zd(n.result);else if(n instanceof Iu){for(const t of n.args)if(e=zd(t),e)break}else(n instanceof Gf||n instanceof gi)&&n.input instanceof mi&&n.input.name==="zoom"&&(e=n);return e instanceof Qi||n.eachChild(t=>{const i=zd(t);i instanceof Qi?e=i:!e&&i?e=new Qi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Qi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function QG(n){const e={color:Ir,string:$e,number:q,enum:$e,boolean:Ce,formatted:Md,resolvedImage:Dc};return n.type==="array"?di(e[n.value]||Le,n.length):e[n.type]}function e3(n){return n.type==="color"&&Yc(n.default)?new qe(0,0,0,0):n.type==="color"?qe.parse(n.default)||null:n.default===void 0?null:n.default}function Wc(n){return typeof n=="object"?["literal",n]:n}function t3(n,e){let t=n.stops;if(!t)return n3(n,e);const i=t&&typeof t[0][0]=="object",r=i||n.property!==void 0,s=i||!r;return t=t.map(o=>!r&&e.tokens&&typeof o[1]=="string"?[o[0],o3(o[1])]:[o[0],Wc(o[1])]),i?i3(n,e,t):s?s3(n,e,t):A0(n,e,t)}function n3(n,e){const t=["get",n.property];if(n.default===void 0)return e.type==="string"?["string",t]:t;if(e.type==="enum")return["match",t,Object.keys(e.values),t,n.default];{const i=[e.type==="color"?"to-color":e.type,t,Wc(n.default)];return e.type==="array"&&i.splice(1,0,e.value,e.length||null),i}}function L0(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function i3(n,e,t){const i={},r={},s=[];for(let a=0;a<t.length;a++){const c=t[a],l=c[0].zoom;i[l]===void 0&&(i[l]={zoom:l,type:n.type,property:n.property,default:n.default},r[l]=[],s.push(l)),r[l].push([c[0].value,c[1]])}if(O0({},e)==="exponential"){const a=[L0(n),["linear"],["zoom"]];for(const c of s){const l=A0(i[c],e,r[c]);Ka(a,c,l,!1)}return a}else{const a=["step",["zoom"]];for(const c of s){const l=A0(i[c],e,r[c]);Ka(a,c,l,!0)}return P0(a),a}}function r3(n,e){if(n!==void 0)return n;if(e!==void 0)return e}function WT(n,e){const t=Wc(r3(n.default,e.default));return t===void 0&&e.type==="resolvedImage"?"":t}function A0(n,e,t){const i=O0(n,e),r=["get",n.property];if(i==="categorical"&&typeof t[0][0]=="boolean"){const s=["case"];for(const o of t)s.push(["==",r,o[0]],o[1]);return s.push(WT(n,e)),s}else if(i==="categorical"){const s=["match",r];for(const o of t)Ka(s,o[0],o[1],!1);return s.push(WT(n,e)),s}else if(i==="interval"){const s=["step",["number",r]];for(const o of t)Ka(s,o[0],o[1],!0);return P0(s),n.default===void 0?s:["case",["==",["typeof",r],"number"],s,Wc(n.default)]}else if(i==="exponential"){const s=n.base!==void 0?n.base:1,o=[L0(n),s===1?["linear"]:["exponential",s],["number",r]];for(const a of t)Ka(o,a[0],a[1],!1);return n.default===void 0?o:["case",["==",["typeof",r],"number"],o,Wc(n.default)]}else throw new Error(`Unknown property function type ${i}`)}function s3(n,e,t,i=["zoom"]){const r=O0(n,e);let s,o=!1;if(r==="interval")s=["step",i],o=!0;else if(r==="exponential"){const a=n.base!==void 0?n.base:1;s=[L0(n),a===1?["linear"]:["exponential",a],i]}else throw new Error(`Unknown zoom function type "${r}"`);for(const a of t)Ka(s,a[0],a[1],o);return P0(s),s}function P0(n){n[0]==="step"&&n.length===3&&(n.push(0),n.push(n[3]))}function Ka(n,e,t,i){n.length>3&&e===n[n.length-2]||(i&&n.length===2||n.push(e),n.push(t))}function O0(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function o3(n){const e=["concat"],t=/{([^{}]+)}/g;let i=0;for(let r=t.exec(n);r!==null;r=t.exec(n)){const s=n.slice(i,t.lastIndex-r[0].length);i=t.lastIndex,s.length>0&&e.push(s),e.push(["get",r[1]])}if(e.length===1)return n;if(i<n.length)e.push(n.slice(i));else if(e.length===2)return["to-string",e[1]];return e}function Lt(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function Cr(n){if(Array.isArray(n))return n.map(Cr);if(n instanceof Object&&!(n instanceof Number||n instanceof String||n instanceof Boolean)){const e={};for(const t in n)e[t]=Cr(n[t]);return e}return Lt(n)}function Bd(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!Bd(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}function a3(n,e="fill"){if(n==null)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Bd(n)||(n=jd(n));const t=n;let i=!0;try{i=l3(t)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.
|
133
|
+
This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md
|
134
|
+
and paste the contents of this message in the report.
|
135
|
+
Thank you!
|
136
|
+
Filter Expression:
|
137
|
+
${JSON.stringify(t,null,2)}
|
138
|
+
`)}const r=Ld[`filter_${e}`],s=Zc(i,r);let o=null;if(s.result==="error")throw new Error(s.value.map(u=>`${u.key}: ${u.message}`).join(", "));o=(u,h,d)=>s.value.evaluate(u,h,{},d);let a=null,c=null;if(i!==t){const u=Zc(t,r);if(u.result==="error")throw new Error(u.value.map(h=>`${h.key}: ${h.message}`).join(", "));a=(h,d,f,p,m)=>u.value.evaluate(h,d,{},f,void 0,void 0,p,m),c=!Bc(u.value.expression)}o=o;const l=qT(i);return{filter:o,dynamicFilter:a||void 0,needGeometry:l,needFeature:!!c}}function l3(n){if(!qa(n))return n;let e=Cr(n);return KT(e),e=HT(e),e}function HT(n){if(!Array.isArray(n))return n;const e=h3(n);return e===!0?e:e.map(t=>HT(t))}function KT(n){let e=!1;const t=[];if(n[0]==="case"){for(let i=1;i<n.length-1;i+=2)e=e||qa(n[i]),t.push(n[i+1]);t.push(n[n.length-1])}else if(n[0]==="match"){e=e||qa(n[1]);for(let i=2;i<n.length-1;i+=2)t.push(n[i+1]);t.push(n[n.length-1])}else if(n[0]==="step"){e=e||qa(n[1]);for(let i=1;i<n.length-1;i+=2)t.push(n[i+1])}e&&(n.length=0,n.push("any",...t));for(let i=1;i<n.length;i++)KT(n[i])}function qa(n){if(!Array.isArray(n))return!1;if(c3(n[0]))return!0;for(let e=1;e<n.length;e++){const t=n[e];if(qa(t))return!0}return!1}function c3(n){return n==="pitch"||n==="distance-from-center"}const u3=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function h3(n){if(u3.has(n[0]))for(let e=1;e<n.length;e++){const t=n[e];if(qa(t))return!0}return n}function d3(n,e){return n<e?-1:n>e?1:0}function qT(n){if(!Array.isArray(n))return!1;if(n[0]==="within")return!0;for(let e=1;e<n.length;e++)if(qT(n[e]))return!0;return!1}function jd(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?M0(n[1],n[2],"=="):e==="!="?Vd(M0(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?M0(n[1],n[2],e):e==="any"?f3(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(jd)):e==="none"?["all"].concat(n.slice(1).map(jd).map(Vd)):e==="in"?JT(n[1],n.slice(2)):e==="!in"?Vd(JT(n[1],n.slice(2))):e==="has"?QT(n[1]):e==="!has"?Vd(QT(n[1])):e==="within"?n:!0}function M0(n,e,t){switch(n){case"$type":return[`filter-type-${t}`,e];case"$id":return[`filter-id-${t}`,e];default:return[`filter-${t}`,n,e]}}function f3(n){return["any"].concat(n.map(jd))}function JT(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",n,["literal",e.sort(d3)]]:["filter-in-small",n,["literal",e]]}}function QT(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function Vd(n){return["!",n]}var p3=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function g3(n,e){const t={};for(const i in n)i!=="ref"&&(t[i]=n[i]);return p3.forEach(i=>{i in e&&(t[i]=e[i])}),t}function m3(n){n=n.slice();const e=Object.create(null);for(let t=0;t<n.length;t++)e[n[t].id]=n[t];for(let t=0;t<n.length;t++)"ref"in n[t]&&(n[t]=g3(n[t],e[n[t].ref]));return n}class Q{constructor(e,t,i,r){this.message=(e?`${e}: `:"")+i,r&&(this.identifier=r),t!=null&&t.__line__&&(this.line=t.__line__)}}class y3{constructor(e){this.error=e,this.message=e.message;const t=e.message.match(/line (\d+)/);this.line=t?parseInt(t[1],10):0}}function eb(n){const e=n.key,t=n.value;return t?[new Q(e,t,"constants have been deprecated as of v8")]:[]}function Pi(n){const e=n.key,t=n.value,i=n.valueSpec||{},r=n.objectElementValidators||{},s=n.style,o=n.styleSpec;let a=[];const c=Ye(t);if(c!=="object")return[new Q(e,t,`object expected, ${c} found`)];for(const l in t){const u=l.split(".")[0],h=i[u]||i["*"];let d;if(r[u])d=r[u];else if(i[u])d=vn;else if(r["*"])d=r["*"];else if(i["*"])d=vn;else{a.push(new Q(e,t[l],`unknown property "${l}"`));continue}a=a.concat(d({key:(e&&`${e}.`)+l,value:t[l],valueSpec:h,style:s,styleSpec:o,object:t,objectKey:l},t))}for(const l in i)r[l]||i[l].required&&i[l].default===void 0&&t[l]===void 0&&a.push(new Q(e,t,`missing required property "${l}"`));return a}function tb(n){const e=n.value,t=n.valueSpec,i=n.style,r=n.styleSpec,s=n.key,o=n.arrayElementValidator||vn;if(Ye(e)!=="array")return[new Q(s,e,`array expected, ${Ye(e)} found`)];if(t.length&&e.length!==t.length)return[new Q(s,e,`array length ${t.length} expected, length ${e.length} found`)];if(t["min-length"]&&e.length<t["min-length"])return[new Q(s,e,`array length at least ${t["min-length"]} expected, length ${e.length} found`)];let a={type:t.value,values:t.values,minimum:t.minimum,maximum:t.maximum};r.$version<7&&(a.function=t.function),Ye(t.value)==="object"&&(a=t.value);let c=[];for(let l=0;l<e.length;l++)c=c.concat(o({array:e,arrayIndex:l,value:e[l],valueSpec:a,style:i,styleSpec:r,key:`${s}[${l}]`}));return c}function nb(n){const e=n.key,t=n.value,i=n.valueSpec;let r=Ye(t);if(r==="number"&&t!==t&&(r="NaN"),r!=="number")return[new Q(e,t,`number expected, ${r} found`)];if("minimum"in i){let s=i.minimum;if(Ye(i.minimum)==="array"){const o=n.arrayIndex;s=i.minimum[o]}if(t<s)return[new Q(e,t,`${t} is less than the minimum value ${s}`)]}if("maximum"in i){let s=i.maximum;if(Ye(i.maximum)==="array"){const o=n.arrayIndex;s=i.maximum[o]}if(t>s)return[new Q(e,t,`${t} is greater than the maximum value ${s}`)]}return[]}function ib(n){const e=n.valueSpec,t=Lt(n.value.type);let i,r={},s,o;const a=t!=="categorical"&&n.value.property===void 0,c=!a,l=Ye(n.value.stops)==="array"&&Ye(n.value.stops[0])==="array"&&Ye(n.value.stops[0][0])==="object",u=Pi({key:n.key,value:n.value,valueSpec:n.styleSpec.function,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:h,default:p}});return t==="identity"&&a&&u.push(new Q(n.key,n.value,'missing required property "property"')),t!=="identity"&&!n.value.stops&&u.push(new Q(n.key,n.value,'missing required property "stops"')),t==="exponential"&&n.valueSpec.expression&&!b0(n.valueSpec)&&u.push(new Q(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(c&&!Gd(n.valueSpec)?u.push(new Q(n.key,n.value,"property functions not supported")):a&&!YT(n.valueSpec)&&u.push(new Q(n.key,n.value,"zoom functions not supported"))),(t==="categorical"||l)&&n.value.property===void 0&&u.push(new Q(n.key,n.value,'"property" property is required')),u;function h(m){if(t==="identity")return[new Q(m.key,m.value,'identity function may not have a "stops" property')];let g=[];const y=m.value;return g=g.concat(tb({key:m.key,value:y,valueSpec:m.valueSpec,style:m.style,styleSpec:m.styleSpec,arrayElementValidator:d})),Ye(y)==="array"&&y.length===0&&g.push(new Q(m.key,y,"array must have at least one stop")),g}function d(m){let g=[];const y=m.value,_=m.key;if(Ye(y)!=="array")return[new Q(_,y,`array expected, ${Ye(y)} found`)];if(y.length!==2)return[new Q(_,y,`array length 2 expected, length ${y.length} found`)];if(l){if(Ye(y[0])!=="object")return[new Q(_,y,`object expected, ${Ye(y[0])} found`)];if(y[0].zoom===void 0)return[new Q(_,y,"object stop key must have zoom")];if(y[0].value===void 0)return[new Q(_,y,"object stop key must have value")];if(o&&o>Lt(y[0].zoom))return[new Q(_,y[0].zoom,"stop zoom values must appear in ascending order")];Lt(y[0].zoom)!==o&&(o=Lt(y[0].zoom),s=void 0,r={}),g=g.concat(Pi({key:`${_}[0]`,value:y[0],valueSpec:{zoom:{}},style:m.style,styleSpec:m.styleSpec,objectElementValidators:{zoom:nb,value:f}}))}else g=g.concat(f({key:`${_}[0]`,value:y[0],valueSpec:{},style:m.style,styleSpec:m.styleSpec},y));return Ud(Cr(y[1]))?g.concat([new Q(`${_}[1]`,y[1],"expressions are not allowed in function stops.")]):g.concat(vn({key:`${_}[1]`,value:y[1],valueSpec:e,style:m.style,styleSpec:m.styleSpec}))}function f(m,g){const y=Ye(m.value),_=Lt(m.value),v=m.value!==null?m.value:g;if(!i)i=y;else if(y!==i)return[new Q(m.key,v,`${y} stop domain type must match previous stop domain type ${i}`)];if(y!=="number"&&y!=="string"&&y!=="boolean")return[new Q(m.key,v,"stop domain value must be a number, string, or boolean")];if(y!=="number"&&t!=="categorical"){let x=`number expected, ${y} found`;return Gd(e)&&t===void 0&&(x+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Q(m.key,v,x)]}return t==="categorical"&&y==="number"&&(!isFinite(_)||Math.floor(_)!==_)?[new Q(m.key,v,`integer expected, found ${_}`)]:t!=="categorical"&&y==="number"&&s!==void 0&&_<s?[new Q(m.key,v,"stop domain values must appear in ascending order")]:(s=_,t==="categorical"&&_ in r?[new Q(m.key,v,"stop domain values must be unique")]:(r[_]=!0,[]))}function p(m){return vn({key:m.key,value:m.value,valueSpec:e,style:m.style,styleSpec:m.styleSpec})}}function Ja(n){const e=(n.expressionContext==="property"?C0:Zc)(Cr(n.value),n.valueSpec);if(e.result==="error")return e.value.map(i=>new Q(`${n.key}${i.key}`,n.value,i.message));const t=e.value.expression||e.value._styleExpression.expression;if(n.expressionContext==="property"&&n.propertyKey==="text-font"&&!t.outputDefined())return[new Q(n.key,n.value,`Invalid data expression for "${n.propertyKey}". Output values must be contained as literals within the expression.`)];if(n.expressionContext==="property"&&n.propertyType==="layout"&&!kd(t))return[new Q(n.key,n.value,'"feature-state" data expressions are not supported with layout properties.')];if(n.expressionContext==="filter")return rb(t,n);if(n.expressionContext&&n.expressionContext.indexOf("cluster")===0){if(!$d(t,["zoom","feature-state"]))return[new Q(n.key,n.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(n.expressionContext==="cluster-initial"&&!Bc(t))return[new Q(n.key,n.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rb(n,e){const t=new Set(["zoom","feature-state","pitch","distance-from-center"]);for(const r of e.valueSpec.expression.parameters)t.delete(r);if(t.size===0)return[];const i=[];return n instanceof mi&&t.has(n.name)?[new Q(e.key,e.value,`["${n.name}"] expression is not supported in a filter for a ${e.object.type} layer with id: ${e.object.id}`)]:(n.eachChild(r=>{i.push(...rb(r,e))}),i)}function _3(n){const e=n.value,t=n.key,i=Ye(e);return i!=="boolean"?[new Q(t,e,`boolean expected, ${i} found`)]:[]}function x3(n){const e=n.key,t=n.value,i=Ye(t);return i!=="string"?[new Q(e,t,`color expected, ${i} found`)]:TT.parseCSSColor(t)===null?[new Q(e,t,`color expected, "${t}" found`)]:[]}function Yd(n){const e=n.key,t=n.value,i=n.valueSpec,r=[];return Array.isArray(i.values)?i.values.indexOf(Lt(t))===-1&&r.push(new Q(e,t,`expected one of [${i.values.join(", ")}], ${JSON.stringify(t)} found`)):Object.keys(i.values).indexOf(Lt(t))===-1&&r.push(new Q(e,t,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(t)} found`)),r}function F0(n){if(Bd(Cr(n.value))){const e=Cr(n.layerType);return Ja(Co({},n,{expressionContext:"filter",valueSpec:n.styleSpec[`filter_${e||"fill"}`]}))}else return sb(n)}function sb(n){const e=n.value,t=n.key;if(Ye(e)!=="array")return[new Q(t,e,`array expected, ${Ye(e)} found`)];const i=n.styleSpec;let r,s=[];if(e.length<1)return[new Q(t,e,"filter array must have at least 1 element")];switch(s=s.concat(Yd({key:`${t}[0]`,value:e[0],valueSpec:i.filter_operator,style:n.style,styleSpec:n.styleSpec})),Lt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Lt(e[1])==="$type"&&s.push(new Q(t,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&s.push(new Q(t,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(r=Ye(e[1]),r!=="string"&&s.push(new Q(`${t}[1]`,e[1],`string expected, ${r} found`)));for(let o=2;o<e.length;o++)r=Ye(e[o]),Lt(e[1])==="$type"?s=s.concat(Yd({key:`${t}[${o}]`,value:e[o],valueSpec:i.geometry_type,style:n.style,styleSpec:n.styleSpec})):r!=="string"&&r!=="number"&&r!=="boolean"&&s.push(new Q(`${t}[${o}]`,e[o],`string, number, or boolean expected, ${r} found`));break;case"any":case"all":case"none":for(let o=1;o<e.length;o++)s=s.concat(sb({key:`${t}[${o}]`,value:e[o],style:n.style,styleSpec:n.styleSpec}));break;case"has":case"!has":r=Ye(e[1]),e.length!==2?s.push(new Q(t,e,`filter array for "${e[0]}" operator must have 2 elements`)):r!=="string"&&s.push(new Q(`${t}[1]`,e[1],`string expected, ${r} found`));break;case"within":r=Ye(e[1]),e.length!==2?s.push(new Q(t,e,`filter array for "${e[0]}" operator must have 2 elements`)):r!=="object"&&s.push(new Q(`${t}[1]`,e[1],`object expected, ${r} found`));break}return s}function ob(n,e){const t=n.key,i=n.style,r=n.styleSpec,s=n.value,o=n.objectKey,a=r[`${e}_${n.layerType}`];if(!a)return[];const c=o.match(/^(.*)-transition$/);if(e==="paint"&&c&&a[c[1]]&&a[c[1]].transition)return vn({key:t,value:s,valueSpec:r.transition,style:i,styleSpec:r});const l=n.valueSpec||a[o];if(!l)return[new Q(t,s,`unknown property "${o}"`)];let u;if(Ye(s)==="string"&&Gd(l)&&!l.tokens&&(u=/^{([^}]+)}$/.exec(s)))return[new Q(t,s,`"${o}" does not support interpolation syntax
|
139
|
+
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];const h=[];return n.layerType==="symbol"&&(o==="text-field"&&i&&!i.glyphs&&h.push(new Q(t,s,'use of "text-field" requires a style "glyphs" property')),o==="text-font"&&Yc(Cr(s))&&Lt(s.type)==="identity"&&h.push(new Q(t,s,'"text-font" does not support identity functions'))),h.concat(vn({key:n.key,value:s,valueSpec:l,style:i,styleSpec:r,expressionContext:"property",propertyType:e,propertyKey:o}))}function ab(n){return ob(n,"paint")}function lb(n){return ob(n,"layout")}function cb(n){let e=[];const t=n.value,i=n.key,r=n.style,s=n.styleSpec;!t.type&&!t.ref&&e.push(new Q(i,t,'either "type" or "ref" is required'));let o=Lt(t.type);const a=Lt(t.ref);if(t.id){const c=Lt(t.id);for(let l=0;l<n.arrayIndex;l++){const u=r.layers[l];Lt(u.id)===c&&e.push(new Q(i,t.id,`duplicate layer id "${t.id}", previously used at line ${u.id.__line__}`))}}if("ref"in t){["type","source","source-layer","filter","layout"].forEach(l=>{l in t&&e.push(new Q(i,t[l],`"${l}" is prohibited for ref layers`))});let c;r.layers.forEach(l=>{Lt(l.id)===a&&(c=l)}),c?c.ref?e.push(new Q(i,t.ref,"ref cannot reference another ref layer")):o=Lt(c.type):e.push(new Q(i,t.ref,`ref layer "${a}" not found`))}else if(!(o==="background"||o==="sky"))if(!t.source)e.push(new Q(i,t,'missing required property "source"'));else{const c=r.sources&&r.sources[t.source],l=c&&Lt(c.type);c?l==="vector"&&o==="raster"?e.push(new Q(i,t.source,`layer "${t.id}" requires a raster source`)):l==="raster"&&o!=="raster"?e.push(new Q(i,t.source,`layer "${t.id}" requires a vector source`)):l==="vector"&&!t["source-layer"]?e.push(new Q(i,t,`layer "${t.id}" must specify a "source-layer"`)):l==="raster-dem"&&o!=="hillshade"?e.push(new Q(i,t.source,"raster-dem source can only be used with layer type 'hillshade'.")):o==="line"&&t.paint&&t.paint["line-gradient"]&&(l!=="geojson"||!c.lineMetrics)&&e.push(new Q(i,t,`layer "${t.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Q(i,t.source,`source "${t.source}" not found`))}return e=e.concat(Pi({key:i,value:t,valueSpec:s.layer,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{"*"(){return[]},type(){return vn({key:`${i}.type`,value:t.type,valueSpec:s.layer.type,style:n.style,styleSpec:n.styleSpec,object:t,objectKey:"type"})},filter(c){return F0(Co({layerType:o},c))},layout(c){return Pi({layer:t,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{"*"(l){return lb(Co({layerType:o},l))}}})},paint(c){return Pi({layer:t,key:c.key,value:c.value,style:c.style,styleSpec:c.styleSpec,objectElementValidators:{"*"(l){return ab(Co({layerType:o},l))}}})}}})),e}function Qa(n){const e=n.value,t=n.key,i=Ye(e);return i!=="string"?[new Q(t,e,`string expected, ${i} found`)]:[]}const ub={promoteId:v3};function hb(n){const e=n.value,t=n.key,i=n.styleSpec,r=n.style;if(!e.type)return[new Q(t,e,'"type" is required')];const s=Lt(e.type);let o;switch(s){case"vector":case"raster":case"raster-dem":return o=Pi({key:t,value:e,valueSpec:i[`source_${s.replace("-","_")}`],style:n.style,styleSpec:i,objectElementValidators:ub}),o;case"geojson":if(o=Pi({key:t,value:e,valueSpec:i.source_geojson,style:r,styleSpec:i,objectElementValidators:ub}),e.cluster)for(const a in e.clusterProperties){const[c,l]=e.clusterProperties[a],u=typeof c=="string"?[c,["accumulated"],["get",a]]:c;o.push(...Ja({key:`${t}.${a}.map`,value:l,expressionContext:"cluster-map"})),o.push(...Ja({key:`${t}.${a}.reduce`,value:u,expressionContext:"cluster-reduce"}))}return o;case"video":return Pi({key:t,value:e,valueSpec:i.source_video,style:r,styleSpec:i});case"image":return Pi({key:t,value:e,valueSpec:i.source_image,style:r,styleSpec:i});case"canvas":return[new Q(t,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yd({key:`${t}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:r,styleSpec:i})}}function v3({key:n,value:e}){if(Ye(e)==="string")return Qa({key:n,value:e});{const t=[];for(const i in e)t.push(...Qa({key:`${n}.${i}`,value:e[i]}));return t}}function db(n){const e=n.value,t=n.styleSpec,i=t.light,r=n.style;let s=[];const o=Ye(e);if(e===void 0)return s;if(o!=="object")return s=s.concat([new Q("light",e,`object expected, ${o} found`)]),s;for(const a in e){const c=a.match(/^(.*)-transition$/);c&&i[c[1]]&&i[c[1]].transition?s=s.concat(vn({key:a,value:e[a],valueSpec:t.transition,style:r,styleSpec:t})):i[a]?s=s.concat(vn({key:a,value:e[a],valueSpec:i[a],style:r,styleSpec:t})):s=s.concat([new Q(a,e[a],`unknown property "${a}"`)])}return s}function fb(n){const e=n.value,t=n.key,i=n.style,r=n.styleSpec,s=r.terrain;let o=[];const a=Ye(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new Q("terrain",e,`object expected, ${a} found`)]),o;for(const c in e){const l=c.match(/^(.*)-transition$/);l&&s[l[1]]&&s[l[1]].transition?o=o.concat(vn({key:c,value:e[c],valueSpec:r.transition,style:i,styleSpec:r})):s[c]?o=o.concat(vn({key:c,value:e[c],valueSpec:s[c],style:i,styleSpec:r})):o=o.concat([new Q(c,e[c],`unknown property "${c}"`)])}if(!e.source)o.push(new Q(t,e,'terrain is missing required property "source"'));else{const c=i.sources&&i.sources[e.source],l=c&&Lt(c.type);c?l!=="raster-dem"&&o.push(new Q(t,e.source,`terrain cannot be used with a source of type ${l}, it only be used with a "raster-dem" source type`)):o.push(new Q(t,e.source,`source "${e.source}" not found`))}return o}function pb(n){const e=n.value,t=n.style,i=n.styleSpec,r=i.fog;let s=[];const o=Ye(e);if(e===void 0)return s;if(o!=="object")return s=s.concat([new Q("fog",e,`object expected, ${o} found`)]),s;for(const a in e){const c=a.match(/^(.*)-transition$/);c&&r[c[1]]&&r[c[1]].transition?s=s.concat(vn({key:a,value:e[a],valueSpec:i.transition,style:t,styleSpec:i})):r[a]?s=s.concat(vn({key:a,value:e[a],valueSpec:r[a],style:t,styleSpec:i})):s=s.concat([new Q(a,e[a],`unknown property "${a}"`)])}return s}function w3(n){return Qa(n).length===0?[]:Ja(n)}function E3(n){return Qa(n).length===0?[]:Ja(n)}function T3(n){const e=n.value,t=n.styleSpec,i=t.projection,r=n.style;let s=[];const o=Ye(e);if(o==="object")for(const a in e)s=s.concat(vn({key:a,value:e[a],valueSpec:i[a],style:r,styleSpec:t}));else o!=="string"&&(s=s.concat([new Q("projection",e,`object or string expected, ${o} found`)]));return s}const gb={"*"(){return[]},array:tb,boolean:_3,number:nb,color:x3,constants:eb,enum:Yd,filter:F0,function:ib,layer:cb,object:Pi,source:hb,light:db,terrain:fb,fog:pb,string:Qa,formatted:w3,resolvedImage:E3,projection:T3};function vn(n){const e=n.value,t=n.valueSpec,i=n.styleSpec;return t.expression&&Yc(Lt(e))?ib(n):t.expression&&Ud(Cr(e))?Ja(n):t.type&&gb[t.type]?gb[t.type](n):Pi(Co({},n,{valueSpec:t.type?i[t.type]:t}))}function b3(n){const e=n.value,t=n.key,i=Qa(n);return i.length||(e.indexOf("{fontstack}")===-1&&i.push(new Q(t,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&i.push(new Q(t,e,'"glyphs" url must include a "{range}" token'))),i}function Lr(n,e=Ld){let t=[];return t=t.concat(vn({key:"",value:n,valueSpec:e.$root,styleSpec:e,style:n,objectElementValidators:{glyphs:b3,"*"(){return[]}}})),n.constants&&(t=t.concat(eb({key:"constants",value:n.constants,style:n,styleSpec:e}))),mb(t)}Lr.source=vs(hb),Lr.light=vs(db),Lr.terrain=vs(fb),Lr.fog=vs(pb),Lr.layer=vs(cb),Lr.filter=vs(F0),Lr.paintProperty=vs(ab),Lr.layoutProperty=vs(lb);function mb(n){return[].concat(n).sort((e,t)=>e.line-t.line)}function vs(n){return function(...e){return mb(n.apply(this,e))}}var S3=Ad(function(n,e){var t=function(){var i=function(y,_,v,x){for(v=v||{},x=y.length;x--;v[y[x]]=_);return v},r=[1,12],s=[1,13],o=[1,9],a=[1,10],c=[1,11],l=[1,14],u=[1,15],h=[14,18,22,24],d=[18,22],f=[22,24],p={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(_,v,x,w,E,T,b){var S=T.length-1;switch(E){case 1:this.$=new String(_.replace(/\\(\\|")/g,"$1").replace(/\\n/g,`
|
140
|
+
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(_),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=T[S-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=T[S-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[T[S-2],T[S]];break;case 16:this.$={},this.$[T[S][0]]=T[S][1];break;case 17:this.$=T[S-2],T[S-2][T[S][0]]=T[S][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[T[S]];break;case 21:this.$=T[S-2],T[S-2].push(T[S]);break}},table:[{3:5,4:r,5:6,6:s,7:3,8:o,9:4,10:a,11:c,12:1,13:2,15:7,16:8,17:l,23:u},{1:[3]},{14:[1,16]},i(h,[2,7]),i(h,[2,8]),i(h,[2,9]),i(h,[2,10]),i(h,[2,11]),i(h,[2,12]),i(h,[2,3]),i(h,[2,4]),i(h,[2,5]),i([14,18,21,22,24],[2,1]),i(h,[2,2]),{3:20,4:r,18:[1,17],19:18,20:19},{3:5,4:r,5:6,6:s,7:3,8:o,9:4,10:a,11:c,13:23,15:7,16:8,17:l,23:u,24:[1,21],25:22},{1:[2,6]},i(h,[2,13]),{18:[1,24],22:[1,25]},i(d,[2,16]),{21:[1,26]},i(h,[2,18]),{22:[1,28],24:[1,27]},i(f,[2,20]),i(h,[2,14]),{3:20,4:r,20:29},{3:5,4:r,5:6,6:s,7:3,8:o,9:4,10:a,11:c,13:30,15:7,16:8,17:l,23:u},i(h,[2,19]),{3:5,4:r,5:6,6:s,7:3,8:o,9:4,10:a,11:c,13:31,15:7,16:8,17:l,23:u},i(d,[2,17]),i(d,[2,15]),i(f,[2,21])],defaultActions:{16:[2,6]},parseError:function(_,v){if(v.recoverable)this.trace(_);else throw new Error(_)},parse:function(_){var v=this,x=[0],w=[null],E=[],T=this.table,b="",S=0,A=0,I=2,N=1,M=E.slice.call(arguments,1),B=Object.create(this.lexer),O={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(O.yy[P]=this.yy[P]);B.setInput(_,O.yy),O.yy.lexer=B,O.yy.parser=this,typeof B.yylloc=="undefined"&&(B.yylloc={});var G=B.yylloc;E.push(G);var U=B.options&&B.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function D(){var Pe;return Pe=B.lex()||N,typeof Pe!="number"&&(Pe=v.symbols_[Pe]||Pe),Pe}for(var k,$,F,te,z={},X,K,le,ae;;){if($=x[x.length-1],this.defaultActions[$]?F=this.defaultActions[$]:((k===null||typeof k=="undefined")&&(k=D()),F=T[$]&&T[$][k]),typeof F=="undefined"||!F.length||!F[0]){var Y="";ae=[];for(X in T[$])this.terminals_[X]&&X>I&&ae.push("'"+this.terminals_[X]+"'");B.showPosition?Y="Parse error on line "+(S+1)+`:
|
141
|
+
`+B.showPosition()+`
|
142
|
+
Expecting `+ae.join(", ")+", got '"+(this.terminals_[k]||k)+"'":Y="Parse error on line "+(S+1)+": Unexpected "+(k==N?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(Y,{text:B.match,token:this.terminals_[k]||k,line:B.yylineno,loc:G,expected:ae})}if(F[0]instanceof Array&&F.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+k);switch(F[0]){case 1:x.push(k),w.push(B.yytext),E.push(B.yylloc),x.push(F[1]),k=null,A=B.yyleng,b=B.yytext,S=B.yylineno,G=B.yylloc;break;case 2:if(K=this.productions_[F[1]][1],z.$=w[w.length-K],z._$={first_line:E[E.length-(K||1)].first_line,last_line:E[E.length-1].last_line,first_column:E[E.length-(K||1)].first_column,last_column:E[E.length-1].last_column},U&&(z._$.range=[E[E.length-(K||1)].range[0],E[E.length-1].range[1]]),te=this.performAction.apply(z,[b,A,S,O.yy,F[1],w,E].concat(M)),typeof te!="undefined")return te;K&&(x=x.slice(0,-1*K*2),w=w.slice(0,-1*K),E=E.slice(0,-1*K)),x.push(this.productions_[F[1]][0]),w.push(z.$),E.push(z._$),le=T[x[x.length-2]][x[x.length-1]],x.push(le);break;case 3:return!0}}return!0}},m=function(){var y={EOF:1,parseError:function(v,x){if(this.yy.parser)this.yy.parser.parseError(v,x);else throw new Error(v)},setInput:function(_,v){return this.yy=v||this.yy||{},this._input=_,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var _=this._input[0];this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_;var v=_.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_},unput:function(_){var v=_.length,x=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var w=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===w.length?this.yylloc.first_column:0)+w[w.length-x.length].length-x[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
143
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(_){this.unput(this.match.slice(_))},pastInput:function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var _=this.pastInput(),v=new Array(_.length+1).join("-");return _+this.upcomingInput()+`
|
144
|
+
`+v+"^"},test_match:function(_,v){var x,w,E;if(this.options.backtrack_lexer&&(E={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(E.yylloc.range=this.yylloc.range.slice(0))),w=_[0].match(/(?:\r\n?|\n).*/g),w&&(this.yylineno+=w.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:w?w[w.length-1].length-w[w.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(_[0].length),this.matched+=_[0],x=this.performAction.call(this,this.yy,this,v,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var T in E)this[T]=E[T];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var _,v,x,w;this._more||(this.yytext="",this.match="");for(var E=this._currentRules(),T=0;T<E.length;T++)if(x=this._input.match(this.rules[E[T]]),x&&(!v||x[0].length>v[0].length)){if(v=x,w=T,this.options.backtrack_lexer){if(_=this.test_match(x,E[T]),_!==!1)return _;if(this._backtrack){v=!1;continue}else return!1}else if(!this.options.flex)break}return v?(_=this.test_match(v,E[w]),_!==!1?_:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
145
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var v=this.next();return v||this.lex()},begin:function(v){this.conditionStack.push(v)},popState:function(){var v=this.conditionStack.length-1;return v>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(v){return v=this.conditionStack.length-1-Math.abs(v||0),v>=0?this.conditionStack[v]:"INITIAL"},pushState:function(v){this.begin(v)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(v,x,w,E){switch(w){case 0:break;case 1:return 6;case 2:return x.yytext=x.yytext.substr(1,x.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return y}();p.lexer=m;function g(){this.yy={}}return g.prototype=p,p.Parser=g,new g}();typeof KD!="undefined"&&(e.parser=t,e.Parser=t.Parser,e.parse=function(){return t.parse.apply(t,arguments)})});function R3(n){if(n instanceof String||typeof n=="string"||n instanceof Buffer)try{return S3.parse(n.toString())}catch(e){throw new y3(e)}return n}function Xd(n,e=Ld){let t=n;try{t=R3(t)}catch(i){return[i]}return Lr(t,e)}const yb={StyleExpression:ZT,isExpression:Ud,isExpressionFilter:Bd,createExpression:Zc,createPropertyExpression:C0,normalizePropertyExpression:JG,ZoomConstantExpression:R0,ZoomDependentExpression:I0,StylePropertyFunction:jf},_b={convertFunction:t3,createFunction:S0,isFunction:Yc};Xd.parsed=Xd,Xd.latest=Xd;var I3=typeof Object.assign=="function"?Object.assign:function(n,e){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),i=1,r=arguments.length;i<r;++i){var s=arguments[i];if(s!=null)for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t};function N0(n){return n*Math.PI/180}var xb=function(){for(var n=[],e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n}();function vb(n,e){if(typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas!="undefined")return new OffscreenCanvas(n,e);var t=document.createElement("canvas");return t.width=n,t.height=e,t}function C3(n,e){for(var t=0,i=e.length;t<i;++t){var r=e[t];if(r<n&&t+1<i){var s=e[t]/e[t+1];return t+Math.log(e[t]/n)/Math.log(s)}}return i-1}var L3=Array(256).join("\u200A");function k0(n,e){if(e>=.05){for(var t="",i=n.split(`
|
146
|
+
`),r=L3.slice(0,Math.round(e/.1)),s=0,o=i.length;s<o;++s)s>0&&(t+=`
|
147
|
+
`),t+=i[s].split("").join(r);return t}return n}var $0;function wb(){return $0||($0=vb(1,1).getContext("2d")),$0}function Ao(n,e){return wb().measureText(n).width+(n.length-1)*e}var D0={};fh&&pe(fh,ne.CLEAR,function(){D0={}});function G0(n,e,t,i){if(n.indexOf(`
|
148
|
+
`)!==-1){for(var r=n.split(`
|
149
|
+
`),s=[],o=0,a=r.length;o<a;++o)s.push(G0(r[o],e,t,i));return s.join(`
|
150
|
+
`)}var c=t+","+e+","+n+","+i,l=D0[c];if(!l){var u=n.split(" ");if(u.length>1){var h=wb();h.font=e;for(var d=h.measureText("M").width,f=d*t,p="",s=[],o=0,a=u.length;o<a;++o){var m=u[o],g=p+(p?" ":"")+m;Ao(g,i)<=f?p=g:(p&&s.push(p),p=m)}p&&s.push(p);for(var o=0,a=s.length;o<a&&a>1;++o){var y=s[o];if(Ao(y,i)<f*.35){var _=o>0?Ao(s[o-1],i):1/0,v=o<a-1?Ao(s[o+1],i):1/0;s.splice(o,1),a-=1,_<v?(s[o-1]+=" "+y,o-=1):s[o]=y+" "+s[o]}}for(var o=0,a=s.length-1;o<a;++o){var x=s[o],w=s[o+1];if(Ao(x,i)>f*.7&&Ao(w,i)<f*.6){var E=x.split(" "),T=E.pop();Ao(T,i)<f*.2&&(s[o]=E.join(" "),s[o+1]=T+" "+w),a-=1}}l=s.join(`
|
151
|
+
`)}else l=n;l=k0(l,i),D0[c]=l}return l}var A3=_b.isFunction,P3=_b.convertFunction,O3=yb.isExpression,M3=yb.createPropertyExpression,F3={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},N3={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},k3=function(n,e){var t=M3(n,e);if(t.result==="error")throw new Error(t.value.map(function(i){return"".concat(i.key,": ").concat(i.message)}).join(", "));return t.value},U0={},Zd={zoom:0},Wd,z0;function Ee(n,e,t,i,r,s){var o=n.id;s||(s={},console.warn("No functionCache provided to getValue()")),s[o]||(s[o]={});var a=s[o];if(!a[t]){var c=(n[e]||U0)[t],l=Ld["".concat(e,"_").concat(n.type)][t];c===void 0&&(c=l.default);var u=O3(c);if(!u&&A3(c)&&(c=P3(c,l),u=!0),u){var h=k3(c,l);a[t]=h.evaluate.bind(h)}else l.type=="color"&&(c=qe.parse(c)),a[t]=function(){return c}}return Zd.zoom=i,a[t](Zd,r)}function $3(n,e,t,i,r){return r||console.warn("No filterCache provided to evaluateFilter()"),n in r||(r[n]=a3(e).filter),Zd.zoom=i,r[n](Zd,t)}function ws(n,e){if(n){if(n.a===0||e===0)return;var t=n.a;return e=e===void 0?1:e,t===0?"transparent":"rgba("+Math.round(n.r*255/t)+","+Math.round(n.g*255/t)+","+Math.round(n.b*255/t)+","+t*e+")"}return n}var D3=/^([^]*)\{(.*)\}([^]*)$/;function B0(n,e){var t;do if(t=n.match(D3),t){var i=e[t[2]]||"";n=t[1]+i+t[3]}while(t);return n}function G3(n,e,t,i,r,s,o){if(i===void 0&&(i=xb),typeof e=="string"&&(e=JSON.parse(e)),e.version!=8)throw new Error("glStyle version 8 required.");var a,c;if(s){if(typeof Image!="undefined"){var l=new Image;l.crossOrigin="anonymous",l.onload=function(){a=l,c=[l.width,l.height],n.changed(),l.onload=null},l.src=s}else if(typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope){var u=self;u.postMessage({action:"loadImage",src:s}),u.addEventListener("message",function(P){P.data.action==="imageLoaded"&&P.data.src===s&&(a=P.data.image,c=[a.width,a.height])})}}for(var h=m3(e.layers),d={},f=[],p={},m={},g={},y={},_,v=0,x=h.length;v<x;++v){var w=h[v],E=w.id;if(typeof t=="string"&&w.source==t||t.indexOf(E)!==-1){var T=w["source-layer"];if(!_){_=w.source;var b=e.sources[_];if(!b)throw new Error('Source "'.concat(_,'" is not defined'));var S=b.type;if(S!=="vector"&&S!=="geojson")throw new Error('Source "'.concat(_,'" is not of type "vector" or "geojson", but "').concat(S,'"'))}var A=d[T];A||(A=[],d[T]=A),A.push({layer:w,index:v}),f.push(E)}}var I=new Sn,N=new Vn,M=[],B=function(O,P){var G=O.getProperties(),U=d[G.layer];if(!!U){var D=i.indexOf(P);D==-1&&(D=C3(P,i));for(var k=F3[O.getGeometry().getType()],$={properties:G,type:k},F=-1,te=function(K,le){var ae=U[K],Y=ae.layer,Pe=Y.id,Oe=Y.layout||U0,Se=Y.paint||U0;if(Oe.visibility==="none"||"minzoom"in Y&&D<Y.minzoom||"maxzoom"in Y&&D>=Y.maxzoom)return"continue";var mt=Y.filter;if(!mt||$3(Pe,mt,$,D,y)){var De=void 0,Be=void 0,nt=void 0,Qt=void 0,en=void 0,ee=void 0,tn=ae.index;if(k==3&&(Y.type=="fill"||Y.type=="fill-extrusion"))if(Be=Ee(Y,"paint",Y.type+"-opacity",D,$,g),Y.type+"-pattern"in Se){var nn=Ee(Y,"paint",Y.type+"-pattern",D,$,g);if(nn){var Xt=typeof nn=="string"?B0(nn,G):nn.toString();if(a&&r&&r[Xt]){++F,ee=M[F],(!ee||!ee.getFill()||ee.getStroke()||ee.getText())&&(ee=new yn({fill:new Vn}),M[F]=ee),nt=ee.getFill(),ee.setZIndex(tn);var bt=Xt+"."+Be,An=m[bt];if(!An){var Zt=r[Xt],$i=vb(Zt.width,Zt.height),yi=$i.getContext("2d");yi.globalAlpha=Be,yi.drawImage(a,Zt.x,Zt.y,Zt.width,Zt.height,0,0,Zt.width,Zt.height),An=yi.createPattern($i,"repeat"),m[bt]=An}nt.setColor(An)}}}else De=ws(Ee(Y,"paint",Y.type+"-color",D,$,g),Be),Y.type+"-outline-color"in Se&&(en=ws(Ee(Y,"paint",Y.type+"-outline-color",D,$,g),Be)),en||(en=De),(De||en)&&(++F,ee=M[F],(!ee||De&&!ee.getFill()||!De&&ee.getFill()||en&&!ee.getStroke()||!en&&ee.getStroke()||ee.getText())&&(ee=new yn({fill:De?new Vn:void 0,stroke:en?new Sn:void 0}),M[F]=ee),De&&(nt=ee.getFill(),nt.setColor(De)),en&&(Qt=ee.getStroke(),Qt.setColor(en),Qt.setWidth(.5)),ee.setZIndex(tn));if(k!=1&&Y.type=="line"){De=!("line-pattern"in Se)&&"line-color"in Se?ws(Ee(Y,"paint","line-color",D,$,g),Ee(Y,"paint","line-opacity",D,$,g)):void 0;var ar=Ee(Y,"paint","line-width",D,$,g);De&&ar>0&&(++F,ee=M[F],(!ee||!ee.getStroke()||ee.getFill()||ee.getText())&&(ee=new yn({stroke:new Sn}),M[F]=ee),Qt=ee.getStroke(),Qt.setLineCap(Ee(Y,"layout","line-cap",D,$,g)),Qt.setLineJoin(Ee(Y,"layout","line-join",D,$,g)),Qt.setMiterLimit(Ee(Y,"layout","line-miter-limit",D,$,g)),Qt.setColor(De),Qt.setWidth(ar),Qt.setLineDash(Se["line-dasharray"]?Ee(Y,"paint","line-dasharray",D,$,g).map(function(jr){return jr*ar}):null),ee.setZIndex(tn))}var ti=!1,ht=null,$t=0,Vo=void 0,fn=void 0,Yo=void 0;if((k==1||k==2)&&"icon-image"in Oe){var Ns=Ee(Y,"layout","icon-image",D,$,g);if(Ns){Vo=typeof Ns=="string"?B0(Ns,G):Ns.toString();var ks=void 0;if(a&&r&&r[Vo]){var ml=Ee(Y,"layout","icon-rotation-alignment",D,$,g);if(k==2){var ni=O.getGeometry();if(ni.getFlatMidpoint||ni.getFlatMidpoints){var Di=ni.getExtent(),$s=Math.sqrt(Math.max(Math.pow((Di[2]-Di[0])/P,2),Math.pow((Di[3]-Di[1])/P,2)));if($s>150){var ii=ni.getType()==="MultiLineString"?ni.getFlatMidpoints():ni.getFlatMidpoint();z0||(Wd=[NaN,NaN],z0=new hd("Point",Wd,[],{},null)),ks=z0,Wd[0]=ii[0],Wd[1]=ii[1];var Gr=Ee(Y,"layout","symbol-placement",D,$,g);if(Gr==="line"&&ml==="map")for(var Ds=ni.getStride(),Wt=ni.getFlatCoordinates(),Wn=0,Pn=Wt.length-Ds;Wn<Pn;Wn+=Ds){var Hn=Wt[Wn],rn=Wt[Wn+1],Ur=Wt[Wn+Ds],zr=Wt[Wn+Ds+1],pn=Math.min(Hn,Ur),On=Math.min(rn,zr),_i=Math.max(Hn,Ur),Vf=Math.max(rn,zr);if(ii[0]>=pn&&ii[0]<=_i&&ii[1]>=On&&ii[1]<=Vf){$t=Math.atan2(rn-zr,Ur-Hn);break}}}}}if(k!==2||ks){var y_=Ee(Y,"layout","icon-size",D,$,g),lr=Se["icon-color"]!==void 0?Ee(Y,"paint","icon-color",D,$,g):null;if(!lr||lr.a!==0){var bt=Vo+"."+y_;if(lr!==null&&(bt+="."+lr),fn=p[bt],!fn){var Xo=r[Vo];fn=new pc({color:lr?[lr.r*255,lr.g*255,lr.b*255,lr.a]:void 0,img:a,imgSize:c,size:[Xo.width,Xo.height],offset:[Xo.x,Xo.y],rotateWithView:ml==="map",scale:y_/Xo.pixelRatio,displacement:"icon-offset"in Oe?Ee(Y,"layout","icon-offset",D,$,g).map(function(ri){return-ri*Xo.pixelRatio}):void 0}),p[bt]=fn}}fn&&(++F,ee=M[F],(!ee||!ee.getImage()||ee.getFill()||ee.getStroke())&&(ee=new yn,M[F]=ee),ee.setGeometry(ks),fn.setRotation($t+N0(Ee(Y,"layout","icon-rotate",D,$,g))),fn.setOpacity(Ee(Y,"paint","icon-opacity",D,$,g)),fn.setAnchor(N3[Ee(Y,"layout","icon-anchor",D,$,g)]),ee.setImage(fn),ht=ee.getText(),ee.setText(void 0),ee.setZIndex(tn),ti=!0,Yo=!1)}else Yo=!0}}}if(k==1&&Y.type==="circle"){++F,ee=M[F],(!ee||!ee.getImage()||ee.getFill()||ee.getStroke())&&(ee=new yn,M[F]=ee);var __="circle-radius"in Se?Ee(Y,"paint","circle-radius",D,$,g):5,Yf=ws(Ee(Y,"paint","circle-stroke-color",D,$,g),Ee(Y,"paint","circle-stroke-opacity",D,$,g)),Xf=ws(Ee(Y,"paint","circle-color",D,$,g),Ee(Y,"paint","circle-opacity",D,$,g)),Zf=Ee(Y,"paint","circle-stroke-width",D,$,g),x_=__+"."+Yf+"."+Xf+"."+Zf;fn=p[x_],fn||(fn=new Oh({radius:__,stroke:Yf&&Zf>0?new Sn({width:Zf,color:Yf}):void 0,fill:Xf?new Vn({color:Xf}):void 0}),p[x_]=fn),ee.setImage(fn),ht=ee.getText(),ee.setText(void 0),ee.setGeometry(void 0),ee.setZIndex(tn),ti=!0}var sn=void 0,Wf=void 0,yl,Br,_l,Hf;if("text-field"in Oe){Br=Math.round(Ee(Y,"layout","text-size",D,$,g));var Kf=Ee(Y,"layout","text-font",D,$,g);yl=Ee(Y,"layout","text-line-height",D,$,g),Wf=o0(o?o(Kf):Kf,Br,yl),_l=Ee(Y,"layout","text-letter-spacing",D,$,g),Hf=Ee(Y,"layout","text-max-width",D,$,g);var Zo=Ee(Y,"layout","text-field",D,$,g);typeof Zo=="object"&&Zo.sections?Zo.sections.length===1?sn=Zo.toString():sn=Zo.sections.reduce(function(jr,ri,Lu){var R_=ri.fontStack?ri.fontStack.split(","):Kf,tp=o0(o?o(R_):R_,Br*(ri.scale||1),yl),Wo=ri.text;if(Wo===`
|
152
|
+
`)return jr.push(`
|
153
|
+
`,""),jr;if(k==2){jr.push(k0(Wo,_l),tp);return}Wo=G0(Wo,tp,Hf,_l).split(`
|
154
|
+
`);for(var Au=0,dI=Wo.length;Au<dI;++Au)Au>0&&jr.push(`
|
155
|
+
`,""),jr.push(Wo[Au],tp);return jr},[]):sn=B0(Zo,G).trim(),Be=Ee(Y,"paint","text-opacity",D,$,g)}if(sn&&Be&&!Yo){ti||(++F,ee=M[F],(!ee||!ee.getText()||ee.getFill()||ee.getStroke())&&(ee=new yn,M[F]=ee),ee.setImage(void 0),ee.setGeometry(void 0)),ee.getText()||ee.setText(ht||new Sa({padding:[2,2,2,2]})),ht=ee.getText();var v_=Oe["text-transform"];v_=="uppercase"?sn=Array.isArray(sn)?sn.map(function(ri,Lu){return Lu%2?ri:ri.toUpperCase()}):sn.toUpperCase():v_=="lowercase"&&(sn=Array.isArray(sn)?sn.map(function(ri,Lu){return Lu%2?ri:ri.toLowerCase()}):sn.toLowerCase());var w_=Array.isArray(sn)?sn:k==2?k0(sn,_l):G0(sn,Wf,Hf,_l);ht.setText(w_),ht.setFont(Wf),ht.setRotation(N0(Ee(Y,"layout","text-rotate",D,$,g)));var Cu=Ee(Y,"layout","text-anchor",D,$,g),Gr=ti||k==1?"point":Ee(Y,"layout","symbol-placement",D,$,g);ht.setPlacement(Gr),ht.setOverflow(Gr==="point");var Gs=Ee(Y,"paint","text-halo-width",D,$,g),E_=Ee(Y,"layout","text-offset",D,$,g),T_=Ee(Y,"paint","text-translate",D,$,g),qf=0,Jf=0;if(Gr=="point"){var Qf="center";Cu.indexOf("left")!==-1?(Qf="left",Jf=Gs):Cu.indexOf("right")!==-1&&(Qf="right",Jf=-Gs),ht.setTextAlign(Qf);var hI=Ee(Y,"layout","text-rotation-alignment",D,$,g);ht.setRotateWithView(hI=="map")}else ht.setMaxAngle(N0(Ee(Y,"layout","text-max-angle",D,$,g))*sn.length/w_.length),ht.setTextAlign(),ht.setRotateWithView(!1);var ep="middle";Cu.indexOf("bottom")==0?(ep="bottom",qf=-Gs-.5*(yl-1)*Br):Cu.indexOf("top")==0&&(ep="top",qf=Gs+.5*(yl-1)*Br),ht.setTextBaseline(ep),ht.setOffsetX(E_[0]*Br+Jf+T_[0]),ht.setOffsetY(E_[1]*Br+qf+T_[1]),N.setColor(ws(Ee(Y,"paint","text-color",D,$,g),Be)),ht.setFill(N);var b_=ws(Ee(Y,"paint","text-halo-color",D,$,g),Be);if(b_){I.setColor(b_),Gs*=2;var S_=.5*Br;I.setWidth(Gs<=S_?Gs:S_),ht.setStroke(I)}else ht.setStroke(void 0);var xl=Ee(Y,"layout","text-padding",D,$,g),vl=ht.getPadding();xl!==vl[0]&&(vl[0]=xl,vl[1]=xl,vl[2]=xl,vl[3]=xl),ee.setZIndex(tn)}}},z=0,X=U.length;z<X;++z)te(z);if(F>-1)return M.length=F+1,M}};return n.setStyle(B),n.set("mapbox-source",_),n.set("mapbox-layers",f),B}var Eb={exports:{}};(function(){var n;Eb.exports={icon:"icons/google.svg",name:"google",title:"Google Fonts",link:"google.com/fonts",getNames:function(){return n},getLink:function(e){return"https://fonts.google.com/specimen/"+e.replace(/( )/g,"+")},normalizeName:function(e){return e}},n=["ABeeZee","Abel","Abril Fatface","Aclonica","Acme","Actor","Adamina","Advent Pro","Aguafina Script","Akronim","Aladin","Aldrich","Alef","Alegreya","Alegreya SC","Alegreya Sans","Alegreya Sans SC","Alex Brush","Alfa Slab One","Alice","Alike","Alike Angular","Allan","Allerta","Allerta Stencil","Allura","Almendra","Almendra Display","Almendra SC","Amarante","Amaranth","Amatic SC","Amethysta","Amiri","Amita","Anaheim","Andada","Andika","Angkor","Annie Use Your Telescope","Anonymous Pro","Antic","Antic Didone","Antic Slab","Anton","Arapey","Arbutus","Arbutus Slab","Architects Daughter","Archivo Black","Archivo Narrow","Arimo","Arizonia","Armata","Artifika","Arvo","Arya","Asap","Asar","Asset","Astloch","Asul","Atomic Age","Aubrey","Audiowide","Autour One","Average","Average Sans","Averia Gruesa Libre","Averia Libre","Averia Sans Libre","Averia Serif Libre","Bad Script","Balthazar","Bangers","Basic","Battambang","Baumans","Bayon","Belgrano","Belleza","BenchNine","Bentham","Berkshire Swash","Bevan","Bigelow Rules","Bigshot One","Bilbo","Bilbo Swash Caps","Biryani","Bitter","Black Ops One","Bokor","Bonbon","Boogaloo","Bowlby One","Bowlby One SC","Brawler","Bree Serif","Bubblegum Sans","Bubbler One","Buda","Buenard","Butcherman","Butterfly Kids","Cabin","Cabin Condensed","Cabin Sketch","Caesar Dressing","Cagliostro","Calligraffitti","Cambay","Cambo","Candal","Cantarell","Cantata One","Cantora One","Capriola","Cardo","Carme","Carrois Gothic","Carrois Gothic SC","Carter One","Catamaran","Caudex","Caveat","Caveat Brush","Cedarville Cursive","Ceviche One","Changa One","Chango","Chau Philomene One","Chela One","Chelsea Market","Chenla","Cherry Cream Soda","Cherry Swash","Chewy","Chicle","Chivo","Chonburi","Cinzel","Cinzel Decorative","Clicker Script","Coda","Coda Caption","Codystar","Combo","Comfortaa","Coming Soon","Concert One","Condiment","Content","Contrail One","Convergence","Cookie","Copse","Corben","Courgette","Cousine","Coustard","Covered By Your Grace","Crafty Girls","Creepster","Crete Round","Crimson Text","Croissant One","Crushed","Cuprum","Cutive","Cutive Mono","Damion","Dancing Script","Dangrek","Dawning of a New Day","Days One","Dekko","Delius","Delius Swash Caps","Delius Unicase","Della Respira","Denk One","Devonshire","Dhurjati","Didact Gothic","Diplomata","Diplomata SC","Domine","Donegal One","Doppio One","Dorsa","Dosis","Dr Sugiyama","Droid Sans","Droid Sans Mono","Droid Serif","Duru Sans","Dynalight","EB Garamond","Eagle Lake","Eater","Economica","Eczar","Ek Mukta","Electrolize","Elsie","Elsie Swash Caps","Emblema One","Emilys Candy","Engagement","Englebert","Enriqueta","Erica One","Esteban","Euphoria Script","Ewert","Exo","Exo 2","Expletus Sans","Fanwood Text","Fascinate","Fascinate Inline","Faster One","Fasthand","Fauna One","Federant","Federo","Felipa","Fenix","Finger Paint","Fira Mono","Fira Sans","Fjalla One","Fjord One","Flamenco","Flavors","Fondamento","Fontdiner Swanky","Forum","Francois One","Freckle Face","Fredericka the Great","Fredoka One","Freehand","Fresca","Frijole","Fruktur","Fugaz One","GFS Didot","GFS Neohellenic","Gabriela","Gafata","Galdeano","Galindo","Gentium Basic","Gentium Book Basic","Geo","Geostar","Geostar Fill","Germania One","Gidugu","Gilda Display","Give You Glory","Glass Antiqua","Glegoo","Gloria Hallelujah","Goblin One","Gochi Hand","Gorditas","Goudy Bookletter 1911","Graduate","Grand Hotel","Gravitas One","Great Vibes","Griffy","Gruppo","Gudea","Gurajada","Habibi","Halant","Hammersmith One","Hanalei","Hanalei Fill","Handlee","Hanuman","Happy Monkey","Headland One","Henny Penny","Herr Von Muellerhoff","Hind","Hind Siliguri","Hind Vadodara","Holtwood One SC","Homemade Apple","Homenaje","IM Fell DW Pica","IM Fell DW Pica SC","IM Fell Double Pica","IM Fell Double Pica SC","IM Fell English","IM Fell English SC","IM Fell French Canon","IM Fell French Canon SC","IM Fell Great Primer","IM Fell Great Primer SC","Iceberg","Iceland","Imprima","Inconsolata","Inder","Indie Flower","Inika","Inknut Antiqua","Irish Grover","Istok Web","Italiana","Italianno","Itim","Jacques Francois","Jacques Francois Shadow","Jaldi","Jim Nightshade","Jockey One","Jolly Lodger","Josefin Sans","Josefin Slab","Joti One","Judson","Julee","Julius Sans One","Junge","Jura","Just Another Hand","Just Me Again Down Here","Kadwa","Kalam","Kameron","Kantumruy","Karla","Karma","Kaushan Script","Kavoon","Kdam Thmor","Keania One","Kelly Slab","Kenia","Khand","Khmer","Khula","Kite One","Knewave","Kotta One","Koulen","Kranky","Kreon","Kristi","Krona One","Kurale","La Belle Aurore","Laila","Lakki Reddy","Lancelot","Lateef","Lato","League Script","Leckerli One","Ledger","Lekton","Lemon","Libre Baskerville","Life Savers","Lilita One","Lily Script One","Limelight","Linden Hill","Lobster","Lobster Two","Londrina Outline","Londrina Shadow","Londrina Sketch","Londrina Solid","Lora","Love Ya Like A Sister","Loved by the King","Lovers Quarrel","Luckiest Guy","Lusitana","Lustria","Macondo","Macondo Swash Caps","Magra","Maiden Orange","Mako","Mallanna","Mandali","Marcellus","Marcellus SC","Marck Script","Margarine","Marko One","Marmelad","Martel","Martel Sans","Marvel","Mate","Mate SC","Maven Pro","McLaren","Meddon","MedievalSharp","Medula One","Megrim","Meie Script","Merienda","Merienda One","Merriweather","Merriweather Sans","Metal","Metal Mania","Metamorphous","Metrophobic","Michroma","Milonga","Miltonian","Miltonian Tattoo","Miniver","Miss Fajardose","Modak","Modern Antiqua","Molengo","Molle","Monda","Monofett","Monoton","Monsieur La Doulaise","Montaga","Montez","Montserrat","Montserrat Alternates","Montserrat Subrayada","Moul","Moulpali","Mountains of Christmas","Mouse Memoirs","Mr Bedfort","Mr Dafoe","Mr De Haviland","Mrs Saint Delafield","Mrs Sheppards","Muli","Mystery Quest","NTR","Neucha","Neuton","New Rocker","News Cycle","Niconne","Nixie One","Nobile","Nokora","Norican","Nosifer","Nothing You Could Do","Noticia Text","Noto Sans","Noto Serif","Nova Cut","Nova Flat","Nova Mono","Nova Oval","Nova Round","Nova Script","Nova Slim","Nova Square","Numans","Nunito","Odor Mean Chey","Offside","Old Standard TT","Oldenburg","Oleo Script","Oleo Script Swash Caps","Open Sans","Open Sans Condensed","Oranienbaum","Orbitron","Oregano","Orienta","Original Surfer","Oswald","Over the Rainbow","Overlock","Overlock SC","Ovo","Oxygen","Oxygen Mono","PT Mono","PT Sans","PT Sans Caption","PT Sans Narrow","PT Serif","PT Serif Caption","Pacifico","Palanquin","Palanquin Dark","Paprika","Parisienne","Passero One","Passion One","Pathway Gothic One","Patrick Hand","Patrick Hand SC","Patua One","Paytone One","Peddana","Peralta","Permanent Marker","Petit Formal Script","Petrona","Philosopher","Piedra","Pinyon Script","Pirata One","Plaster","Play","Playball","Playfair Display","Playfair Display SC","Podkova","Poiret One","Poller One","Poly","Pompiere","Pontano Sans","Poppins","Port Lligat Sans","Port Lligat Slab","Pragati Narrow","Prata","Preahvihear","Press Start 2P","Princess Sofia","Prociono","Prosto One","Puritan","Purple Purse","Quando","Quantico","Quattrocento","Quattrocento Sans","Questrial","Quicksand","Quintessential","Qwigley","Racing Sans One","Radley","Rajdhani","Raleway","Raleway Dots","Ramabhadra","Ramaraja","Rambla","Rammetto One","Ranchers","Rancho","Ranga","Rationale","Ravi Prakash","Redressed","Reenie Beanie","Revalia","Rhodium Libre","Ribeye","Ribeye Marrow","Righteous","Risque","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Rochester","Rock Salt","Rokkitt","Romanesco","Ropa Sans","Rosario","Rosarivo","Rouge Script","Rozha One","Rubik","Rubik Mono One","Rubik One","Ruda","Rufina","Ruge Boogie","Ruluko","Rum Raisin","Ruslan Display","Russo One","Ruthie","Rye","Sacramento","Sahitya","Sail","Salsa","Sanchez","Sancreek","Sansita One","Sarala","Sarina","Sarpanch","Satisfy","Scada","Scheherazade","Schoolbell","Seaweed Script","Sevillana","Seymour One","Shadows Into Light","Shadows Into Light Two","Shanti","Share","Share Tech","Share Tech Mono","Shojumaru","Short Stack","Siemreap","Sigmar One","Signika","Signika Negative","Simonetta","Sintony","Sirin Stencil","Six Caps","Skranji","Slabo 13px","Slabo 27px","Slackey","Smokum","Smythe","Sniglet","Snippet","Snowburst One","Sofadi One","Sofia","Sonsie One","Sorts Mill Goudy","Source Code Pro","Source Sans Pro","Source Serif Pro","Special Elite","Spicy Rice","Spinnaker","Spirax","Squada One","Sree Krushnadevaraya","Stalemate","Stalinist One","Stardos Stencil","Stint Ultra Condensed","Stint Ultra Expanded","Stoke","Strait","Sue Ellen Francisco","Sumana","Sunshiney","Supermercado One","Sura","Suranna","Suravaram","Suwannaphum","Swanky and Moo Moo","Syncopate","Tangerine","Taprom","Tauri","Teko","Telex","Tenali Ramakrishna","Tenor Sans","Text Me One","The Girl Next Door","Tienne","Tillana","Timmana","Tinos","Titan One","Titillium Web","Trade Winds","Trocchi","Trochut","Trykker","Tulpen One","Ubuntu","Ubuntu Condensed","Ubuntu Mono","Ultra","Uncial Antiqua","Underdog","Unica One","UnifrakturCook","UnifrakturMaguntia","Unkempt","Unlock","Unna","VT323","Vampiro One","Varela","Varela Round","Vast Shadow","Vesper Libre","Vibur","Vidaloka","Viga","Voces","Volkhov","Vollkorn","Voltaire","Waiting for the Sunrise","Wallpoet","Walter Turncoat","Warnes","Wellfleet","Wendy One","Wire One","Work Sans","Yanone Kaffeesatz","Yantramanav","Yellowtail","Yeseva One","Yesteryear","Zeyada"]}).call(lM);var U3=Eb.exports,Tb={},z3=/font-family: ?([^;]*);/,B3=/("|')/g,Hd;function j3(n){if(!Hd){Hd={};for(var e=document.styleSheets,t=0,i=e.length;t<i;++t){var r=e[t];try{var s=r.rules||r.cssRules;if(s)for(var o=0,a=s.length;o<a;++o){var c=s[o];if(c.type==5){var l=c.cssText.match(z3);Hd[l[1].replace(B3,"")]=!0}}}catch{}}}return n in Hd}var bb={},V3=U3.getNames();function Y3(n){var e=n.toString();if(e in bb)return n;for(var t=n.map(function(l){var u=o0(l,1).split(" ");return[u.slice(3).join(" ").replace(/"/g,""),u[1]+u[0]]}),i=0,r=t.length;i<r;++i){var s=t[i],o=s[0];if(!j3(o)&&V3.indexOf(o)!==-1){var a="https://fonts.googleapis.com/css?family="+o.replace(/ /g,"+")+":"+s[1];if(!document.querySelector('link[href="'+a+'"]')){var c=document.createElement("link");c.href=a,c.rel="stylesheet",document.head.appendChild(c)}}}return bb[e]=!0,n}var X3=/^(.*)(\?.*)$/;function Z3(n,e){return e&&n.indexOf(".")===0&&(n=e+n),n}function j0(n,e,t){n=Z3(n,e);var i=n.match(X3);return i?i[1]+t+(i.length>2?i[2]:""):n+t}function Sb(n,e,t,i,r){return new Promise(function(s,o){if(typeof e!="object"&&(e=JSON.parse(e)),e.version!=8)return o(new Error("glStyle version 8 required."));if(!(n instanceof fs||n instanceof Qm))return o(new Error("Can only apply to VectorLayer or VectorTileLayer"));var a,c,l,u;function h(){!u&&(!e.sprite||c)?(u=G3(n,e,t,r,c,l,Y3),n.getStyle()?s():o(new Error("Nothing to show for source [".concat(t,"]")))):u?(n.setStyle(u),s()):o(new Error("Something went wrong trying to apply style."))}if(e.sprite){a=window.devicePixelRatio>=1.5?.5:1;var d=a==.5?"@2x":"",f=j0(e.sprite,i,d+".json");fetch(f,{credentials:"same-origin"}).then(function(p){return!p.ok&&d!==""?(f=j0(e.sprite,i,".json"),fetch(f,{credentials:"same-origin"})):p}).then(function(p){if(p.ok)return p.json();o(new Error("Problem fetching sprite from ".concat(f,": ").concat(p.statusText)))}).then(function(p){if(p===void 0)return o(new Error("No sprites found."));c=p,l=j0(e.sprite,i,d+".png"),h()}).catch(function(p){o(new Error("Sprites cannot be loaded: ".concat(f,": ").concat(p.message)))})}else h()})}var Rb={};function W3(n,e){var t={id:e.id,type:e.type},i={};function r(s){var o=e.layout||{},a=e.paint||{};t.paint=a;var c=typeof n.getSource=="function"?n.getSource().getTileGrid().getZForResolution(s):n.getView().getZoom(),l=typeof n.getTargetElement=="function"?n.getTargetElement():void 0,u,h;if(a["background-color"]!==void 0&&(u=Ee(t,"paint","background-color",c,Rb,i),l&&(l.style.background=qe.parse(u).toString())),a["background-opacity"]!==void 0&&(h=Ee(t,"paint","background-opacity",c,Rb,i),l&&(l.style.opacity=h)),o.visibility=="none"){l&&(l.style.backgroundColor="",l.style.opacity="");return}return ws(u,h)}if(typeof n.getTargetElement=="function")n.getTargetElement()&&r(),n.on(["change:resolution","change:target"],r);else if(typeof n.setBackground=="function")n.setBackground(r);else throw new Error("Unable to apply background.")}function H3(n,e){e.layers.some(function(t){if(t.type=="background")return W3(n,t),!0})}function K3(n){var e=n.bounds;if(e){var t=Ap([e[0],e[1]]),i=Ap([e[2],e[3]]);return[t[0],t[1],i[0],i[1]]}}function q3(n,e){n=I3({},n);var t=[e,JSON.stringify(n)].toString(),i=Tb[t];return i||(i=new _T({url:n.tiles?void 0:e,tileJSON:n.tiles?n:void 0}),Tb[t]=i),new Promise(function(r){var s=i.on("change",function(){var o=i.getState();if(o==="ready"){var a=i.getTileJSON(),c=Array.isArray(a.tiles)?a.tiles:[a.tiles];if(e)for(var l=0,u=c.length;l<u;++l)c[l]=decodeURI(new URL(c[l],e).href);var h=i.getTileGrid(),d=K3(a),f=a.minzoom||0,p=a.maxzoom||22,m=i.get("ol-source");m===void 0&&(m=new Cd({attributions:i.getAttributions(),format:new wm,tileGrid:new Sr({origin:h.getOrigin(0),extent:d||h.getExtent(),minZoom:f,resolutions:xb.slice(0,p+1),tileSize:512}),urls:c}),i.set("ol-source",m)),$u(s),r(m)}else o==="error"&&(i.set("ol-source",null),$u(s),r(void 0))});i.getState()==="ready"&&i.changed()})}new Vv;const V0="https://api.mapbox.com";function Hc(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function Ib(n,e,t){const i=Hc(n);if(!i)return decodeURI(new URL(n,t).href);const r="sprites/";if(i.indexOf(r)!==0)throw new Error(`unexpected sprites url: ${n}`);const s=i.slice(r.length);return`${V0}/styles/v1/${s}/sprite?access_token=${e}`}function Cb(n,e,t){const i=Hc(n);if(!i)return decodeURI(new URL(n,t).href);const r="fonts/";if(i.indexOf(r)!==0)throw new Error(`unexpected fonts url: ${n}`);const s=i.slice(r.length);return`${V0}/fonts/v1/${s}/0-255.pbf?access_token=${e}`}function Lb(n,e){const t=Hc(n);if(!t)return decodeURI(new URL(n,location.href).href);const i="styles/";if(t.indexOf(i)!==0)throw new Error(`unexpected style url: ${n}`);const r=t.slice(i.length);return`${V0}/styles/v1/${r}?&access_token=${e}`}function Kd(n,e,t,i){const r=new URL(n,i),s=Hc(n);return s?`https://{a-d}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`:(e&&r.searchParams.set(t,e),decodeURI(r.href))}class J3 extends Mt{constructor(e){super(ne.ERROR),this.error=e}}const Q3={VECTOR:"vector"};class eU extends Qm{constructor(e){const t="declutter"in e?e.declutter:!0,i=new Cd({state:Fe.LOADING,format:new wm});super({source:i,background:e.background,declutter:t,className:e.className,opacity:e.opacity,visible:e.visible,zIndex:e.zIndex,minResolution:e.minResolution,maxResolution:e.maxResolution,minZoom:e.minZoom,maxZoom:e.maxZoom,renderOrder:e.renderOrder,renderBuffer:e.renderBuffer,renderMode:e.renderMode,map:e.map,updateWhileAnimating:e.updateWhileAnimating,updateWhileInteracting:e.updateWhileInteracting,preload:e.preload,useInterimTilesOnError:e.useInterimTilesOnError,properties:e.properties}),this.setMaxResolutionFromTileGrid_=e.maxResolution===void 0&&e.minZoom===void 0,this.sourceId=e.source,this.layers=e.layers,e.accessToken?this.accessToken=e.accessToken:new URL(e.styleUrl,location.href).searchParams.forEach((s,o)=>{this.accessToken=s,this.accessTokenParam_=o}),this.fetchStyle(e.styleUrl)}fetchStyle(e){const t=Lb(e,this.accessToken);fetch(t).then(i=>{if(!i.ok)throw new Error(`unexpected response when fetching style: ${i.status}`);return i.json()}).then(i=>{this.onStyleLoad(i,t.startsWith("data:")?location.href:t)}).catch(i=>{this.handleError(i)})}onStyleLoad(e,t){let i,r;if(this.layers){const a={};for(let l=0;l<e.layers.length;++l){const u=e.layers[l];u.source&&(a[u.id]=u.source)}let c;for(let l=0;l<this.layers.length;++l){const u=a[this.layers[l]];if(!u){this.handleError(new Error(`could not find source for ${this.layers[l]}`));return}if(!c)c=u;else if(c!==u){this.handleError(new Error(`layers can only use a single source, found ${c} and ${u}`));return}}i=c,r=this.layers}else i=this.sourceId,r=i;r||(i=Object.keys(e.sources)[0],r=i),e.sprite&&(e.sprite=Ib(e.sprite,this.accessToken,t)),e.glyphs&&(e.glyphs=Cb(e.glyphs,this.accessToken,t));const s=e.sources[i];if(s.type!==Q3.VECTOR){this.handleError(new Error(`only works for vector sources, found ${s.type}`));return}const o=this.getSource();s.url&&s.url.indexOf("mapbox://")===0?(o.setUrl(Kd(s.url,this.accessToken,this.accessTokenParam_,t)),Sb(this,e,r).then(()=>{this.configureSource(o,e)}).catch(a=>{this.handleError(a)})):(s.tiles&&(s.tiles=s.tiles.map(a=>Kd(a,this.accessToken,this.accessTokenParam_,t))),q3(s,s.url?Kd(s.url,this.accessToken,this.accessTokenParam_,t):void 0).then(a=>{Sb(this,e,r).then(()=>{this.configureSource(a,e)}).catch(c=>{this.configureSource(a,e),this.handleError(c)})}))}configureSource(e,t){const i=this.getSource();if(e!==i&&(i.setAttributions(e.getAttributions()),i.setTileUrlFunction(e.getTileUrlFunction()),i.setTileLoadFunction(e.getTileLoadFunction()),i.tileGrid=e.tileGrid),this.getBackground()===void 0&&H3(this,t),this.setMaxResolutionFromTileGrid_){const r=i.getTileGrid();this.setMaxResolution(r.getResolution(r.getMinZoom()))}i.setState(Fe.READY)}handleError(e){this.dispatchEvent(new J3(e)),this.getSource().setState(Fe.ERROR)}}var tU=eU;class nU extends Zm{constructor(e){super(e),this.vectorRenderer_=new jg(e),this.layerImageRatio_=e.getImageRatio(),this.coordinateToVectorPixelTransform_=dt(),this.renderedPixelToCoordinateTransform_=null}disposeInternal(){this.vectorRenderer_.dispose(),super.disposeInternal()}getFeatures(e){if(!this.vectorRenderer_)return new Promise(i=>i([]));const t=Je(this.coordinateToVectorPixelTransform_,Je(this.renderedPixelToCoordinateTransform_,e.slice()));return this.vectorRenderer_.getFeatures(t)}handleFontsChanged(){this.vectorRenderer_.handleFontsChanged()}prepareFrame(e){const t=e.pixelRatio,i=e.viewState,r=i.resolution,s=e.viewHints,o=this.vectorRenderer_;let a=e.extent;this.layerImageRatio_!==1&&(a=a.slice(0),Cl(a,this.layerImageRatio_));const c=be(a)/r,l=ot(a)/r;if(!s[lt.ANIMATING]&&!s[lt.INTERACTING]&&!Qr(a)){o.useContainer(null,null,1);const u=o.context,h=J({},e,{declutterTree:new Lg(9),extent:a,size:[c,l],viewState:J({},e.viewState,{rotation:0})});let d=!0;const f=new jl(a,r,t,u.canvas,function(p){o.prepareFrame(h)&&o.replayGroupChanged&&(o.clipping=!1,o.renderFrame(h,null)&&(o.renderDeclutter(h),d=!1),p())});f.addEventListener(ne.CHANGE,function(){if(f.getState()!==me.LOADED)return;this.image_=d?null:f;const p=f.getResolution(),m=f.getPixelRatio(),g=p*t/m;this.renderedResolution=g,this.coordinateToVectorPixelTransform_=Ht(this.coordinateToVectorPixelTransform_,c/2,l/2,1/g,-1/g,0,-i.center[0],-i.center[1])}.bind(this)),f.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice()),!!this.image_}preRender(){}postRender(){}renderDeclutter(){}forEachFeatureAtCoordinate(e,t,i,r,s){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,t,i,r,s):super.forEachFeatureAtCoordinate(e,t,i,r,s)}}var Ab=nU;class iU extends Ea{constructor(e){const t=e||{},i=J({},t);delete i.imageRatio,super(i),this.imageRatio_=t.imageRatio!==void 0?t.imageRatio:1}getImageRatio(){return this.imageRatio_}createRenderer(){return new Ab(this)}}var rU=iU;class sU{constructor(e,t){this.name=e,this.data=t,this.texture_=null}getTexture(e){if(!this.texture_){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.data.length/4,1,0,e.RGBA,e.UNSIGNED_BYTE,this.data),this.texture_=t}return this.texture_}}var Pb=sU;function Ob(n,e,t){const i=t?n.LINEAR:n.NEAREST;n.bindTexture(n.TEXTURE_2D,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,i)}function oU(n,e,t,i){Ob(n,e,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t)}function Mb(n,e,t,i,r,s){const o=n.getGL();Ob(o,e,s);const a=t.byteLength/i[1];let c=1;a%8===0?c=8:a%4===0?c=4:a%2===0&&(c=2);let l;switch(r){case 1:{l=o.LUMINANCE;break}case 2:{l=o.LUMINANCE_ALPHA;break}case 3:{l=o.RGB;break}case 4:{l=o.RGBA;break}default:throw new Error(`Unsupported number of bands: ${r}`)}let u;t instanceof Float32Array?(u=o.FLOAT,n.getExtension("OES_texture_float"),n.getExtension("OES_texture_float_linear")):u=o.UNSIGNED_BYTE;const h=o.getParameter(o.UNPACK_ALIGNMENT);o.pixelStorei(o.UNPACK_ALIGNMENT,c),o.texImage2D(o.TEXTURE_2D,0,l,i[0],i[1],0,l,u,t),o.pixelStorei(o.UNPACK_ALIGNMENT,h)}let Kc=null;function aU(){const n=document.createElement("canvas");n.width=1,n.height=1,Kc=n.getContext("2d")}class lU extends Wr{constructor(e){super(),this.tile,this.textures=[],this.handleTileChange_=this.handleTileChange_.bind(this),this.size=pt(e.grid.getTileSize(e.tile.tileCoord[0])),this.tilePixelRatio_=e.tilePixelRatio||1,this.gutter_=e.gutter||0,this.bandCount=NaN,this.helper_=e.helper;const t=new Ba(za,xd);t.fromArray([0,1,1,1,1,0,0,0]),this.helper_.flushBufferData(t),this.coords=t,this.setTile(e.tile)}setTile(e){if(e!==this.tile)if(this.tile&&this.tile.removeEventListener(ne.CHANGE,this.handleTileChange_),this.tile=e,this.textures.length=0,this.loaded=e.getState()===W.LOADED,this.loaded)this.uploadTile_();else{if(e instanceof ro){const t=e.getImage();t instanceof Image&&!t.crossOrigin&&(t.crossOrigin="anonymous")}e.addEventListener(ne.CHANGE,this.handleTileChange_)}}uploadTile_(){const e=this.helper_,t=e.getGL(),i=this.tile;if(i instanceof ro||i instanceof Sd){let g=i.getImage();if(this.gutter_!==0){const _=this.tilePixelRatio_*this.gutter_,v=Math.round(g.width-2*_),x=Math.round(g.height-2*_),w=St(v,x);i.interpolate||J(w,So),w.drawImage(g,_,_,v,x,0,0,v,x),g=w.canvas}const y=t.createTexture();this.textures.push(y),this.bandCount=4,oU(t,y,g,i.interpolate);return}const r=[this.size[0]*this.tilePixelRatio_,this.size[1]*this.tilePixelRatio_],s=i.getData(),o=s instanceof Float32Array,a=r[0]*r[1],c=o?Float32Array:Uint8Array,l=c.BYTES_PER_ELEMENT,u=s.byteLength/r[1];this.bandCount=Math.floor(u/l/r[0]);const h=Math.ceil(this.bandCount/4);if(h===1){const g=t.createTexture();this.textures.push(g),Mb(e,g,s,r,this.bandCount,i.interpolate);return}const d=new Array(h);for(let g=0;g<h;++g){const y=t.createTexture();this.textures.push(y);const _=g<h-1?4:this.bandCount%4;d[g]=new c(a*_)}let f=0,p=0;const m=r[0]*this.bandCount;for(let g=0;g<r[1];++g){for(let y=0;y<m;++y){const _=s[p+y],v=Math.floor(f/this.bandCount),x=y%this.bandCount,w=Math.floor(x/4),E=d[w],T=E.length/a,b=x%4;E[v*T+b]=_,++f}p+=u/l}for(let g=0;g<h;++g){const y=this.textures[g],_=d[g],v=_.length/a;Mb(e,y,_,r,v,i.interpolate)}}handleTileChange_(){this.tile.getState()===W.LOADED&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(ne.CHANGE))}disposeInternal(){const e=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(let t=0;t<this.textures.length;++t)e.deleteTexture(this.textures[t]);this.tile.removeEventListener(ne.CHANGE,this.handleTileChange_)}getPixelData(e,t){if(!this.loaded)return null;if(e=Math.floor(this.tilePixelRatio_*e),t=Math.floor(this.tilePixelRatio_*t),this.tile instanceof rp){const s=this.tile.getData(),o=Math.floor(this.tilePixelRatio_*this.size[0]);if(s instanceof DataView){const c=s.byteLength/(this.size[0]*this.size[1]),l=t*o*c+e*c,u=s.buffer.slice(l,l+c);return new DataView(u)}const a=t*o*this.bandCount+e*this.bandCount;return s.slice(a,a+this.bandCount)}Kc||aU(),Kc.clearRect(0,0,1,1);let i;const r=this.tile.getImage();try{Kc.drawImage(r,e,t,1,1,0,0,1,1),i=Kc.getImageData(0,0,1,1).data}catch{return null}return i}}var Fb=lU;const Te={TILE_TEXTURE_ARRAY:"u_tileTextures",TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY",RENDER_EXTENT:"u_renderExtent",RESOLUTION:"u_resolution",ZOOM:"u_zoom"},qc={TEXTURE_COORD:"a_textureCoord"},cU=[{name:qc.TEXTURE_COORD,size:2,type:Jn.FLOAT}],uU={};function hU(n){return 2*(1-1/(n+1))-1}function Nb(n,e,t){t in n||(n[t]=[]),n[t].push(e)}function Y0(n,e){const t=n.layerStatesArray[n.layerIndex];t.extent&&(e=an(e,Un(t.extent,n.viewState.projection)));const i=t.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(n.viewState.projection).getExtent();r&&(e=an(e,r))}return e}function X0(n,e){return`${n.getKey()},${Aa(e)}`}class dU extends jm{constructor(e,t){super(e,{uniforms:t.uniforms}),this.renderComplete=!1,this.tileTransform_=dt(),this.tempMat4_=zm(),this.tempTileRange_=new vc(0,0,0,0),this.tempTileCoord_=La(0,0,0),this.tempSize_=[0,0],this.program_,this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.indices_=new Ba(Ac,xd),this.indices_.fromArray([0,1,3,1,2,3]);const i=t.cacheSize!==void 0?t.cacheSize:512;this.tileTextureCache_=new zh(i),this.paletteTextures_=t.paletteTextures||[],this.frameState_=null}reset(e){super.reset({uniforms:e.uniforms}),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.paletteTextures_=e.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}isDrawableTile_(e){const t=this.getLayer(),i=e.getState(),r=t.getUseInterimTilesOnError();return i==W.LOADED||i==W.EMPTY||i==W.ERROR&&!r}prepareFrameInternal(e){const i=this.getLayer().getRenderSource();return!i||Qr(Y0(e,e.extent))?!1:i.getState()===Fe.READY}enqueueTiles(e,t,i,r){const s=e.viewState,o=this.getLayer(),a=o.getRenderSource(),c=a.getTileGridForProjection(s.projection),l=a.getTilePixelRatio(e.pixelRatio),u=a.getGutterForProjection(s.projection),h=se(a);h in e.wantedTiles||(e.wantedTiles[h]={});const d=e.wantedTiles[h],f=this.tileTextureCache_,p=Math.max(i-o.getPreload(),c.getMinZoom(),o.getMinZoom());for(let m=i;m>=p;--m){const g=c.getTileRangeForExtentAndZ(t,m,this.tempTileRange_),y=c.getResolution(m);for(let _=g.minX;_<=g.maxX;++_)for(let v=g.minY;v<=g.maxY;++v){const x=La(m,_,v,this.tempTileCoord_),w=X0(a,x);let E,T;if(f.containsKey(w)&&(E=f.get(w),T=E.tile),!E||E.tile.key!==a.getKey())if(T=a.getTile(m,_,v,e.pixelRatio,s.projection),!E)E=new Fb({tile:T,grid:c,helper:this.helper,tilePixelRatio:l,gutter:u}),f.set(w,E);else if(this.isDrawableTile_(T))E.setTile(T);else{const S=T.getInterimTile();E.setTile(S)}Nb(r,E,m);const b=T.getKey();d[b]=!0,T.getState()===W.IDLE&&(e.tileQueue.isKeyQueued(b)||e.tileQueue.enqueue([T,h,c.getTileCoordCenter(x),y]))}}}renderFrame(e){this.frameState_=e,this.renderComplete=!0;const t=this.helper.getGL();this.preRender(t,e);const i=e.viewState,s=this.getLayer().getRenderSource(),o=s.getTileGridForProjection(i.projection),a=Y0(e,e.extent),c=o.getZForResolution(i.resolution,s.zDirection),l={};if(e.nextExtent){const w=o.getZForResolution(i.nextResolution,s.zDirection),E=Y0(e,e.nextExtent);this.enqueueTiles(e,E,w,l)}this.enqueueTiles(e,a,c,l);const u={},h=se(this),d=e.time;let f=!1;const p=l[c];for(let w=0,E=p.length;w<E;++w){const T=p[w],b=T.tile,S=b.tileCoord;if(T.loaded){const N=b.getAlpha(h,d);if(N===1){b.endTransition(h);continue}f=!0;const M=Aa(S);u[M]=N}if(this.renderComplete=!1,this.findAltTiles_(o,S,c+1,l))continue;const I=o.getMinZoom();for(let N=c-1;N>=I&&!this.findAltTiles_(o,S,N,l);--N);}this.helper.useProgram(this.program_),this.helper.prepareDraw(e,!f);const m=Object.keys(l).map(Number).sort(cr),g=i.center[0],y=i.center[1];for(let w=0,E=m.length;w<E;++w){const T=m[w],b=o.getResolution(T),S=pt(o.getTileSize(T),this.tempSize_),A=o.getOrigin(T),I=(g-A[0])/(S[0]*b),N=(A[1]-y)/(S[1]*b),M=i.resolution/b,B=hU(T),O=l[T];for(let P=0,G=O.length;P<G;++P){const U=O[P];if(!U.loaded)continue;const k=U.tile.tileCoord,$=Aa(k),F=k[1],te=k[2];Ht(this.tileTransform_,0,0,2/(e.size[0]*M/S[0]),-2/(e.size[1]*M/S[1]),i.rotation,-(I-F),-(N-te)),this.helper.setUniformMatrixValue(Te.TILE_TRANSFORM,Mc(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(U.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(cU);let z=0;for(;z<U.textures.length;){const K="TEXTURE"+z,le=`${Te.TILE_TEXTURE_ARRAY}[${z}]`;t.activeTexture(t[K]),t.bindTexture(t.TEXTURE_2D,U.textures[z]),t.uniform1i(this.helper.getUniformLocation(le),z),++z}for(let K=0;K<this.paletteTextures_.length;++K){const le=this.paletteTextures_[K];t.activeTexture(t["TEXTURE"+z]);const ae=le.getTexture(t);t.bindTexture(t.TEXTURE_2D,ae),t.uniform1i(this.helper.getUniformLocation(le.name),z),++z}const X=$ in u?u[$]:1;X<1&&(e.animate=!0),this.helper.setUniformFloatValue(Te.TRANSITION_ALPHA,X),this.helper.setUniformFloatValue(Te.DEPTH,B),this.helper.setUniformFloatValue(Te.TEXTURE_PIXEL_WIDTH,S[0]),this.helper.setUniformFloatValue(Te.TEXTURE_PIXEL_HEIGHT,S[1]),this.helper.setUniformFloatValue(Te.TEXTURE_RESOLUTION,b),this.helper.setUniformFloatValue(Te.TEXTURE_ORIGIN_X,A[0]+F*S[0]*b),this.helper.setUniformFloatValue(Te.TEXTURE_ORIGIN_Y,A[1]-te*S[1]*b),this.helper.setUniformFloatVec4(Te.RENDER_EXTENT,a),this.helper.setUniformFloatValue(Te.RESOLUTION,i.resolution),this.helper.setUniformFloatValue(Te.ZOOM,i.zoom),this.helper.drawElements(0,this.indices_.getSize())}}this.helper.finalizeDraw(e,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const _=this.helper.getCanvas(),v=this.tileTextureCache_;for(;v.canExpireCache();)v.pop().dispose();const x=function(w,E){s.expireCache(E.viewState.projection,uU)};return e.postRenderFunctions.push(x),this.postRender(t,e),_}getData(e){if(!this.helper.getGL())return null;const i=this.frameState_;if(!i)return null;const r=this.getLayer(),s=Je(i.pixelToCoordinateTransform,e.slice()),o=i.viewState,a=r.getExtent();if(a&&!kn(Un(a,o.projection),s))return null;const c=r.getRenderSource(),l=c.getTileGridForProjection(o.projection);if(!c.getWrapX()){const h=l.getExtent();if(h&&!kn(h,s))return null}const u=this.tileTextureCache_;for(let h=l.getZForResolution(o.resolution);h>=l.getMinZoom();--h){const d=l.getTileCoordForCoordAndZ(s,h),f=X0(c,d);if(!u.containsKey(f))continue;const p=u.get(f);if(!p.loaded)continue;const m=l.getOrigin(h),g=pt(l.getTileSize(h)),y=l.getResolution(h),_=(s[0]-m[0])/y-d[1]*g[0],v=(m[1]-s[1])/y-d[2]*g[1];return p.getPixelData(_,v)}return null}findAltTiles_(e,t,i,r){const s=e.getTileRangeForTileCoordAndZ(t,i,this.tempTileRange_);if(!s)return!1;let o=!0;const a=this.tileTextureCache_,c=this.getLayer().getRenderSource();for(let l=s.minX;l<=s.maxX;++l)for(let u=s.minY;u<=s.maxY;++u){const h=X0(c,[i,l,u]);let d=!1;if(a.containsKey(h)){const f=a.get(h);f.loaded&&(Nb(r,f,i),d=!0)}d||(o=!1)}return o}removeHelper(){if(this.helper){const e=this.tileTextureCache_;e.forEach(t=>t.dispose()),e.clear()}super.removeHelper()}disposeInternal(){const e=this.helper;e&&(e.getGL().deleteProgram(this.program_),delete this.program_,e.deleteBuffer(this.indices_)),super.disposeInternal(),delete this.indices_,delete this.tileTextureCache_,delete this.frameState_}}var kb=dU;const ie={NUMBER:1,STRING:2,COLOR:4,BOOLEAN:8,NUMBER_ARRAY:16,ANY:31,NONE:0},Ae={};function Oi(n){if(typeof n=="number")return ie.NUMBER;if(typeof n=="boolean")return ie.BOOLEAN;if(typeof n=="string")return qx(n)?ie.COLOR|ie.STRING:ie.STRING;if(!Array.isArray(n))throw new Error(`Unhandled value type: ${JSON.stringify(n)}`);const e=n;if(e.every(function(r){return typeof r=="number"}))return e.length===3||e.length===4?ie.COLOR|ie.NUMBER_ARRAY:ie.NUMBER_ARRAY;if(typeof e[0]!="string")throw new Error(`Expected an expression operator but received: ${JSON.stringify(e)}`);const i=Ae[e[0]];if(i===void 0)throw new Error(`Unrecognized expression operator: ${JSON.stringify(e)}`);return i.getReturnType(e.slice(1))}function $b(n){return pp(n)%1===0}function Jc(n){const e=n.toString();return e.indexOf(".")===-1?e+".0":e}function Z0(n){if(n.length<2||n.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${n.length}(${n.map(Jc).join(", ")})`}function Db(n){const e=so(n).slice();return e.length<4&&e.push(1),Z0(e.map(function(t,i){return i<3?t/255:t}))}function Qc(n,e){return n.stringLiteralsMap[e]===void 0&&(n.stringLiteralsMap[e]=Object.keys(n.stringLiteralsMap).length),n.stringLiteralsMap[e]}function Gb(n,e){return Jc(Qc(n,e))}function oe(n,e,t){if(Array.isArray(e)&&typeof e[0]=="string"){const r=Ae[e[0]];if(r===void 0)throw new Error(`Unrecognized expression operator: ${JSON.stringify(e)}`);return r.toGlsl(n,e.slice(1),t)}const i=Oi(e);if((i&ie.NUMBER)>0)return Jc(e);if((i&ie.BOOLEAN)>0)return e.toString();if((i&ie.STRING)>0&&(t===void 0||t==ie.STRING))return Gb(n,e.toString());if((i&ie.COLOR)>0&&(t===void 0||t==ie.COLOR))return Db(e);if((i&ie.NUMBER_ARRAY)>0)return Z0(e);throw new Error(`Unexpected expression ${e} (expected type ${t})`)}function Ub(n){if(!(Oi(n)&ie.NUMBER))throw new Error(`A numeric value was expected, got ${JSON.stringify(n)} instead`)}function Ot(n){for(let e=0;e<n.length;e++)Ub(n[e])}function zb(n){if(!(Oi(n)&ie.STRING))throw new Error(`A string value was expected, got ${JSON.stringify(n)} instead`)}function W0(n){if(!(Oi(n)&ie.BOOLEAN))throw new Error(`A boolean value was expected, got ${JSON.stringify(n)} instead`)}function gt(n,e){if(n.length!==e)throw new Error(`Exactly ${e} arguments were expected, got ${n.length} instead`)}function Es(n,e){if(n.length<e)throw new Error(`At least ${e} arguments were expected, got ${n.length} instead`)}function qd(n,e){if(n.length>e)throw new Error(`At most ${e} arguments were expected, got ${n.length} instead`)}function Bb(n){if(n.length%2!==0)throw new Error(`An even amount of arguments was expected, got ${n} instead`)}function fU(n){if(n.length%2===0)throw new Error(`An odd amount of arguments was expected, got ${n} instead`)}function H0(n,e){if(!$b(e))throw new Error(`Could not infer only one type from the following expression: ${JSON.stringify(n)}`)}Ae.get={getReturnType:function(n){return ie.ANY},toGlsl:function(n,e){gt(e,1),zb(e[0]);const t=e[0].toString();return n.attributes.indexOf(t)===-1&&n.attributes.push(t),(n.inFragmentShader?"v_":"a_")+t}};function Jd(n){return"u_var_"+n}Ae.var={getReturnType:function(n){return ie.ANY},toGlsl:function(n,e){gt(e,1),zb(e[0]);const t=e[0].toString();return n.variables.indexOf(t)===-1&&n.variables.push(t),Jd(t)}};const K0="u_paletteTextures";Ae.palette={getReturnType:function(n){return ie.COLOR},toGlsl:function(n,e){gt(e,2),Ub(e[0]);const t=oe(n,e[0]),i=e[1];if(!Array.isArray(i))throw new Error("The second argument of palette must be an array");const r=i.length,s=new Uint8Array(r*4);for(let c=0;c<r;c++){const l=i[c];let u;if(typeof l=="string")u=Wp(l);else{if(!Array.isArray(l))throw new Error("The second argument of palette must be an array of strings or colors");const d=l.length;if(d===4)u=l;else{if(d!==3)throw new Error(`Expected palette color to have 3 or 4 values, got ${d}`);u=[l[0],l[1],l[2],1]}}const h=c*4;s[h]=u[0],s[h+1]=u[1],s[h+2]=u[2],s[h+3]=u[3]*255}n.paletteTextures||(n.paletteTextures=[]);const o=`${K0}[${n.paletteTextures.length}]`,a=new Pb(o,s);return n.paletteTextures.push(a),`texture2D(${o}, vec2((${t} + 0.5) / ${r}.0, 0.5))`}};const q0="getBandValue";Ae.band={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){Es(e,1),qd(e,3);const t=e[0];if(!(q0 in n.functions)){let o="";const a=n.bandCount||1;for(let c=0;c<a;c++){const l=Math.floor(c/4);let u=c%4;u===a-1&&u===1&&(u=3);const h=`${Te.TILE_TEXTURE_ARRAY}[${l}]`;o+=`
|
156
|
+
if (band == ${c+1}.0) {
|
157
|
+
return texture2D(${h}, v_textureCoord + vec2(dx, dy))[${u}];
|
158
|
+
}
|
159
|
+
`}n.functions[q0]=`
|
160
|
+
float getBandValue(float band, float xOffset, float yOffset) {
|
161
|
+
float dx = xOffset / ${Te.TEXTURE_PIXEL_WIDTH};
|
162
|
+
float dy = yOffset / ${Te.TEXTURE_PIXEL_HEIGHT};
|
163
|
+
${o}
|
164
|
+
}
|
165
|
+
`}const i=oe(n,t),r=oe(n,e[1]||0),s=oe(n,e[2]||0);return`${q0}(${i}, ${r}, ${s})`}},Ae.time={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,0),"u_time"}},Ae.zoom={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,0),"u_zoom"}},Ae.resolution={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,0),"u_resolution"}},Ae["*"]={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,2),Ot(e),`(${oe(n,e[0])} * ${oe(n,e[1])})`}},Ae["/"]={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,2),Ot(e),`(${oe(n,e[0])} / ${oe(n,e[1])})`}},Ae["+"]={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,2),Ot(e),`(${oe(n,e[0])} + ${oe(n,e[1])})`}},Ae["-"]={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,2),Ot(e),`(${oe(n,e[0])} - ${oe(n,e[1])})`}},Ae.clamp={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){gt(e,3),Ot(e);const t=oe(n,e[1]),i=oe(n,e[2]);return`clamp(${oe(n,e[0])}, ${t}, ${i})`}},Ae["%"]={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,2),Ot(e),`mod(${oe(n,e[0])}, ${oe(n,e[1])})`}},Ae["^"]={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,2),Ot(e),`pow(${oe(n,e[0])}, ${oe(n,e[1])})`}},Ae.abs={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,1),Ot(e),`abs(${oe(n,e[0])})`}},Ae.floor={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,1),Ot(e),`floor(${oe(n,e[0])})`}},Ae.round={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,1),Ot(e),`floor(${oe(n,e[0])} + 0.5)`}},Ae.ceil={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,1),Ot(e),`ceil(${oe(n,e[0])})`}},Ae.sin={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,1),Ot(e),`sin(${oe(n,e[0])})`}},Ae.cos={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return gt(e,1),Ot(e),`cos(${oe(n,e[0])})`}},Ae.atan={getReturnType:function(n){return ie.NUMBER},toGlsl:function(n,e){return Es(e,1),qd(e,2),Ot(e),e.length===2?`atan(${oe(n,e[0])}, ${oe(n,e[1])})`:`atan(${oe(n,e[0])})`}},Ae[">"]={getReturnType:function(n){return ie.BOOLEAN},toGlsl:function(n,e){return gt(e,2),Ot(e),`(${oe(n,e[0])} > ${oe(n,e[1])})`}},Ae[">="]={getReturnType:function(n){return ie.BOOLEAN},toGlsl:function(n,e){return gt(e,2),Ot(e),`(${oe(n,e[0])} >= ${oe(n,e[1])})`}},Ae["<"]={getReturnType:function(n){return ie.BOOLEAN},toGlsl:function(n,e){return gt(e,2),Ot(e),`(${oe(n,e[0])} < ${oe(n,e[1])})`}},Ae["<="]={getReturnType:function(n){return ie.BOOLEAN},toGlsl:function(n,e){return gt(e,2),Ot(e),`(${oe(n,e[0])} <= ${oe(n,e[1])})`}};function jb(n){return{getReturnType:function(e){return ie.BOOLEAN},toGlsl:function(e,t){gt(t,2);let i=ie.ANY;for(let r=0;r<t.length;r++)i&=Oi(t[r]);if(i===ie.NONE)throw new Error(`All arguments should be of compatible type, got ${JSON.stringify(t)} instead`);return i&=~ie.COLOR,`(${oe(e,t[0],i)} ${n} ${oe(e,t[1],i)})`}}}Ae["=="]=jb("=="),Ae["!="]=jb("!="),Ae["!"]={getReturnType:function(n){return ie.BOOLEAN},toGlsl:function(n,e){return gt(e,1),W0(e[0]),`(!${oe(n,e[0])})`}};function Vb(n){return{getReturnType:function(e){return ie.BOOLEAN},toGlsl:function(e,t){Es(t,2);for(let r=0;r<t.length;r++)W0(t[r]);let i="";return i=t.map(r=>oe(e,r)).join(` ${n} `),i=`(${i})`,i}}}Ae.all=Vb("&&"),Ae.any=Vb("||"),Ae.between={getReturnType:function(n){return ie.BOOLEAN},toGlsl:function(n,e){gt(e,3),Ot(e);const t=oe(n,e[1]),i=oe(n,e[2]),r=oe(n,e[0]);return`(${r} >= ${t} && ${r} <= ${i})`}},Ae.array={getReturnType:function(n){return ie.NUMBER_ARRAY},toGlsl:function(n,e){Es(e,2),qd(e,4),Ot(e);const t=e.map(function(i){return oe(n,i,ie.NUMBER)});return`vec${e.length}(${t.join(", ")})`}},Ae.color={getReturnType:function(n){return ie.COLOR},toGlsl:function(n,e){Es(e,3),qd(e,4),Ot(e);const t=e;e.length===3&&t.push(1);const i=e.map(function(r,s){return oe(n,r,ie.NUMBER)+(s<3?" / 255.0":"")});return`vec${e.length}(${i.join(", ")})`}},Ae.interpolate={getReturnType:function(n){let e=ie.COLOR|ie.NUMBER;for(let t=3;t<n.length;t+=2)e=e&Oi(n[t]);return e},toGlsl:function(n,e,t){Bb(e),Es(e,6);const i=e[0];let r;switch(i[0]){case"linear":r=1;break;case"exponential":r=i[1];break;default:r=null}if(!r)throw new Error(`Invalid interpolation type for "interpolate" operator, received: ${JSON.stringify(i)}`);const s=t!==void 0?t:ie.ANY,o=Ae.interpolate.getReturnType(e)&s;H0(e,o);const a=oe(n,e[1]),c=Jc(r);let l="";for(let u=2;u<e.length-2;u+=2){const h=oe(n,e[u]),d=l||oe(n,e[u+1],o),f=oe(n,e[u+2]),p=oe(n,e[u+3],o);l=`mix(${d}, ${p}, pow(clamp((${a} - ${h}) / (${f} - ${h}), 0.0, 1.0), ${c}))`}return l}},Ae.match={getReturnType:function(n){let e=ie.ANY;for(let t=2;t<n.length;t+=2)e=e&Oi(n[t]);return e=e&Oi(n[n.length-1]),e},toGlsl:function(n,e,t){Bb(e),Es(e,4);const i=t!==void 0?t:ie.ANY,r=Ae.match.getReturnType(e)&i;H0(e,r);const s=oe(n,e[0]),o=oe(n,e[e.length-1],r);let a=null;for(let c=e.length-3;c>=1;c-=2){const l=oe(n,e[c]),u=oe(n,e[c+1],r);a=`(${s} == ${l} ? ${u} : ${a||o})`}return a}},Ae.case={getReturnType:function(n){let e=ie.ANY;for(let t=1;t<n.length;t+=2)e=e&Oi(n[t]);return e=e&Oi(n[n.length-1]),e},toGlsl:function(n,e,t){fU(e),Es(e,3);const i=t!==void 0?t:ie.ANY,r=Ae.case.getReturnType(e)&i;H0(e,r);for(let a=0;a<e.length-1;a+=2)W0(e[a]);const s=oe(n,e[e.length-1],r);let o=null;for(let a=e.length-3;a>=0;a-=2){const c=oe(n,e[a]),l=oe(n,e[a+1],r);o=`(${c} ? ${l} : ${o||s})`}return o}};class Yb{constructor(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}addUniform(e){return this.uniforms.push(e),this}addAttribute(e){return this.attributes.push(e),this}addVarying(e,t,i){return this.varyings.push({name:e,type:t,expression:i}),this}setSizeExpression(e){return this.sizeExpression=e,this}setRotationExpression(e){return this.rotationExpression=e,this}setSymbolOffsetExpression(e){return this.offsetExpression=e,this}setColorExpression(e){return this.colorExpression=e,this}setTextureCoordinateExpression(e){return this.texCoordExpression=e,this}setFragmentDiscardExpression(e){return this.discardExpression=e,this}setSymbolRotateWithView(e){return this.rotateWithView=e,this}getSizeExpression(){return this.sizeExpression}getOffsetExpression(){return this.offsetExpression}getColorExpression(){return this.colorExpression}getTextureCoordinateExpression(){return this.texCoordExpression}getFragmentDiscardExpression(){return this.discardExpression}getSymbolVertexShader(e){const t=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix";let i=this.attributes,r=this.varyings;return e&&(i=i.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),`precision mediump float;
|
166
|
+
uniform mat4 u_projectionMatrix;
|
167
|
+
uniform mat4 u_offsetScaleMatrix;
|
168
|
+
uniform mat4 u_offsetRotateMatrix;
|
169
|
+
uniform float u_time;
|
170
|
+
uniform float u_zoom;
|
171
|
+
uniform float u_resolution;
|
172
|
+
${this.uniforms.map(function(s){return"uniform "+s+";"}).join(`
|
173
|
+
`)}
|
174
|
+
attribute vec2 a_position;
|
175
|
+
attribute float a_index;
|
176
|
+
${i.map(function(s){return"attribute "+s+";"}).join(`
|
177
|
+
`)}
|
178
|
+
varying vec2 v_texCoord;
|
179
|
+
varying vec2 v_quadCoord;
|
180
|
+
${r.map(function(s){return"varying "+s.type+" "+s.name+";"}).join(`
|
181
|
+
`)}
|
182
|
+
void main(void) {
|
183
|
+
mat4 offsetMatrix = ${t};
|
184
|
+
vec2 halfSize = ${this.sizeExpression} * 0.5;
|
185
|
+
vec2 offset = ${this.offsetExpression};
|
186
|
+
float angle = ${this.rotationExpression};
|
187
|
+
float offsetX;
|
188
|
+
float offsetY;
|
189
|
+
if (a_index == 0.0) {
|
190
|
+
offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);
|
191
|
+
offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);
|
192
|
+
} else if (a_index == 1.0) {
|
193
|
+
offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);
|
194
|
+
offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);
|
195
|
+
} else if (a_index == 2.0) {
|
196
|
+
offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);
|
197
|
+
offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);
|
198
|
+
} else {
|
199
|
+
offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);
|
200
|
+
offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);
|
201
|
+
}
|
202
|
+
vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);
|
203
|
+
gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;
|
204
|
+
vec4 texCoord = ${this.texCoordExpression};
|
205
|
+
float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;
|
206
|
+
float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;
|
207
|
+
v_texCoord = vec2(u, v);
|
208
|
+
u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;
|
209
|
+
v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;
|
210
|
+
v_quadCoord = vec2(u, v);
|
211
|
+
${r.map(function(s){return" "+s.name+" = "+s.expression+";"}).join(`
|
212
|
+
`)}
|
213
|
+
}`}getSymbolFragmentShader(e){const t=e?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"";let i=this.varyings;return e&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),`precision mediump float;
|
214
|
+
uniform float u_time;
|
215
|
+
uniform float u_zoom;
|
216
|
+
uniform float u_resolution;
|
217
|
+
${this.uniforms.map(function(r){return"uniform "+r+";"}).join(`
|
218
|
+
`)}
|
219
|
+
varying vec2 v_texCoord;
|
220
|
+
varying vec2 v_quadCoord;
|
221
|
+
${i.map(function(r){return"varying "+r.type+" "+r.name+";"}).join(`
|
222
|
+
`)}
|
223
|
+
void main(void) {
|
224
|
+
if (${this.discardExpression}) { discard; }
|
225
|
+
gl_FragColor = ${this.colorExpression};
|
226
|
+
gl_FragColor.rgb *= gl_FragColor.a;
|
227
|
+
${t}
|
228
|
+
}`}}function Xb(n){const e=n.symbol,t=e.size!==void 0?e.size:1,i=e.color||"white",r=e.textureCoord||[0,0,1,1],s=e.offset||[0,0],o=e.opacity!==void 0?e.opacity:1,a=e.rotation!==void 0?e.rotation:0,c={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},l=oe(c,t,ie.NUMBER_ARRAY|ie.NUMBER),u=oe(c,s,ie.NUMBER_ARRAY),h=oe(c,r,ie.NUMBER_ARRAY),d=oe(c,a,ie.NUMBER),f={inFragmentShader:!0,variables:c.variables,attributes:[],stringLiteralsMap:c.stringLiteralsMap,functions:{}},p=oe(f,i,ie.COLOR),m=oe(f,o,ie.NUMBER);let g="1.0";const y=`vec2(${oe(f,t,ie.NUMBER_ARRAY|ie.NUMBER)}).x`;switch(e.symbolType){case"square":break;case"image":break;case"circle":g=`(1.0-smoothstep(1.-4./${y},1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))`;break;case"triangle":const x="(v_quadCoord*2.-1.)",w=`(atan(${x}.x,${x}.y))`;g=`(1.0-smoothstep(.5-3./${y},.5,cos(floor(.5+${w}/2.094395102)*2.094395102-${w})*length(${x})))`;break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}const _=new Yb().setSizeExpression(`vec2(${l})`).setRotationExpression(d).setSymbolOffsetExpression(u).setTextureCoordinateExpression(h).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression(`vec4(${p}.rgb, ${p}.a * ${m} * ${g})`);if(n.filter){const x=oe(f,n.filter,ie.BOOLEAN);_.setFragmentDiscardExpression(`!${x}`)}const v={};if(f.variables.forEach(function(x){const w=Jd(x);_.addUniform(`float ${w}`),v[w]=function(){if(!n.variables||n.variables[x]===void 0)throw new Error(`The following variable is missing from the style: ${x}`);let E=n.variables[x];return typeof E=="string"&&(E=Qc(c,E)),E!==void 0?E:-9999999}}),e.symbolType==="image"&&e.src){const x=new Image;x.crossOrigin=e.crossOrigin===void 0?"anonymous":e.crossOrigin,x.src=e.src,_.addUniform("sampler2D u_texture").setColorExpression(_.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),v.u_texture=x}return f.attributes.forEach(function(x){c.attributes.indexOf(x)===-1&&c.attributes.push(x),_.addVarying(`v_${x}`,"float",`a_${x}`)}),c.attributes.forEach(function(x){_.addAttribute(`float a_${x}`)}),{builder:_,attributes:c.attributes.map(function(x){return{name:x,callback:function(w,E){let T=E[x];return typeof T=="string"&&(T=Qc(c,T)),T!==void 0?T:-9999999}}}),uniforms:v}}class pU extends oo{constructor(e){const t=J({},e);super(t),this.parseResult_=Xb(e.style),this.styleVariables_=e.style.variables||{},this.hitDetectionDisabled_=!!e.disableHitDetection}createRenderer(){return new Vm(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})}updateStyleVariables(e){J(this.styleVariables_,e),this.changed()}}var gU=pU;function Zb(n,e){const t=`
|
229
|
+
attribute vec2 ${qc.TEXTURE_COORD};
|
230
|
+
uniform mat4 ${Te.TILE_TRANSFORM};
|
231
|
+
uniform float ${Te.TEXTURE_PIXEL_WIDTH};
|
232
|
+
uniform float ${Te.TEXTURE_PIXEL_HEIGHT};
|
233
|
+
uniform float ${Te.TEXTURE_RESOLUTION};
|
234
|
+
uniform float ${Te.TEXTURE_ORIGIN_X};
|
235
|
+
uniform float ${Te.TEXTURE_ORIGIN_Y};
|
236
|
+
uniform float ${Te.DEPTH};
|
237
|
+
|
238
|
+
varying vec2 v_textureCoord;
|
239
|
+
varying vec2 v_mapCoord;
|
240
|
+
|
241
|
+
void main() {
|
242
|
+
v_textureCoord = ${qc.TEXTURE_COORD};
|
243
|
+
v_mapCoord = vec2(
|
244
|
+
${Te.TEXTURE_ORIGIN_X} + ${Te.TEXTURE_RESOLUTION} * ${Te.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],
|
245
|
+
${Te.TEXTURE_ORIGIN_Y} - ${Te.TEXTURE_RESOLUTION} * ${Te.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]
|
246
|
+
);
|
247
|
+
gl_Position = ${Te.TILE_TRANSFORM} * vec4(${qc.TEXTURE_COORD}, ${Te.DEPTH}, 1.0);
|
248
|
+
}
|
249
|
+
`,i={inFragmentShader:!0,variables:[],attributes:[],stringLiteralsMap:{},functions:{},bandCount:e},r=[];if(n.color!==void 0){const h=oe(i,n.color,ie.COLOR);r.push(`color = ${h};`)}if(n.contrast!==void 0){const h=oe(i,n.contrast,ie.NUMBER);r.push(`color.rgb = clamp((${h} + 1.0) * color.rgb - (${h} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(n.exposure!==void 0){const h=oe(i,n.exposure,ie.NUMBER);r.push(`color.rgb = clamp((${h} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(n.saturation!==void 0){const h=oe(i,n.saturation,ie.NUMBER);r.push(`
|
250
|
+
float saturation = ${h} + 1.0;
|
251
|
+
float sr = (1.0 - saturation) * 0.2126;
|
252
|
+
float sg = (1.0 - saturation) * 0.7152;
|
253
|
+
float sb = (1.0 - saturation) * 0.0722;
|
254
|
+
mat3 saturationMatrix = mat3(
|
255
|
+
sr + saturation, sr, sr,
|
256
|
+
sg, sg + saturation, sg,
|
257
|
+
sb, sb, sb + saturation
|
258
|
+
);
|
259
|
+
color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));
|
260
|
+
`)}if(n.gamma!==void 0){const h=oe(i,n.gamma,ie.NUMBER);r.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${h}));`)}if(n.brightness!==void 0){const h=oe(i,n.brightness,ie.NUMBER);r.push(`color.rgb = clamp(color.rgb + ${h}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}const s={},o=i.variables.length;if(o>1&&!n.variables)throw new Error(`Missing variables in style (expected ${i.variables})`);for(let h=0;h<o;++h){const d=i.variables[h];if(!(d in n.variables))throw new Error(`Missing '${d}' in style variables`);const f=Jd(d);s[f]=function(){let p=n.variables[d];return typeof p=="string"&&(p=Qc(i,p)),p!==void 0?p:-9999999}}const a=Object.keys(s).map(function(h){return`uniform float ${h};`}),c=Math.ceil(e/4);a.push(`uniform sampler2D ${Te.TILE_TEXTURE_ARRAY}[${c}];`),i.paletteTextures&&a.push(`uniform sampler2D ${K0}[${i.paletteTextures.length}];`);const l=Object.keys(i.functions).map(function(h){return i.functions[h]}),u=`
|
261
|
+
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
262
|
+
precision highp float;
|
263
|
+
#else
|
264
|
+
precision mediump float;
|
265
|
+
#endif
|
266
|
+
|
267
|
+
varying vec2 v_textureCoord;
|
268
|
+
varying vec2 v_mapCoord;
|
269
|
+
uniform vec4 ${Te.RENDER_EXTENT};
|
270
|
+
uniform float ${Te.TRANSITION_ALPHA};
|
271
|
+
uniform float ${Te.TEXTURE_PIXEL_WIDTH};
|
272
|
+
uniform float ${Te.TEXTURE_PIXEL_HEIGHT};
|
273
|
+
uniform float ${Te.RESOLUTION};
|
274
|
+
uniform float ${Te.ZOOM};
|
275
|
+
|
276
|
+
${a.join(`
|
277
|
+
`)}
|
278
|
+
|
279
|
+
${l.join(`
|
280
|
+
`)}
|
281
|
+
|
282
|
+
void main() {
|
283
|
+
if (
|
284
|
+
v_mapCoord[0] < ${Te.RENDER_EXTENT}[0] ||
|
285
|
+
v_mapCoord[1] < ${Te.RENDER_EXTENT}[1] ||
|
286
|
+
v_mapCoord[0] > ${Te.RENDER_EXTENT}[2] ||
|
287
|
+
v_mapCoord[1] > ${Te.RENDER_EXTENT}[3]
|
288
|
+
) {
|
289
|
+
discard;
|
290
|
+
}
|
291
|
+
|
292
|
+
vec4 color = texture2D(${Te.TILE_TEXTURE_ARRAY}[0], v_textureCoord);
|
293
|
+
|
294
|
+
${r.join(`
|
295
|
+
`)}
|
296
|
+
|
297
|
+
if (color.a == 0.0) {
|
298
|
+
discard;
|
299
|
+
}
|
300
|
+
|
301
|
+
gl_FragColor = color;
|
302
|
+
gl_FragColor.rgb *= gl_FragColor.a;
|
303
|
+
gl_FragColor *= ${Te.TRANSITION_ALPHA};
|
304
|
+
}`;return{vertexShader:t,fragmentShader:u,uniforms:s,paletteTextures:i.paletteTextures}}class Wb extends $m{constructor(e){const t=e?J({},e):{},i=t.style||{};delete t.style;const r=t.cacheSize;delete t.cacheSize,super(t),this.sources_=t.sources,this.renderedResolution_=NaN,this.style_=i,this.cacheSize_=r,this.styleVariables_=this.style_.variables||{},this.addChangeListener(We.SOURCE,this.handleSourceUpdate_)}getSources(e,t){const i=this.getSource();return this.sources_?typeof this.sources_=="function"?this.sources_(e,t):this.sources_:i?[i]:[]}getRenderSource(){return this.getLayerState().source||this.getSource()}getSourceState(){const e=this.getRenderSource();return e?e.getState():Fe.UNDEFINED}handleSourceUpdate_(){this.getSource()&&this.setStyle(this.style_)}getSourceBandCount_(){const e=this.getSource();return e&&"bandCount"in e?e.bandCount:4}createRenderer(){const e=Zb(this.style_,this.getSourceBandCount_());return new kb(this,{vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,cacheSize:this.cacheSize_,paletteTextures:e.paletteTextures})}renderSources(e,t){const i=this.getRenderer();let r;for(let s=0,o=t.length;s<o;++s)this.getLayerState().source=t[s],i.prepareFrame(e)&&(r=i.renderFrame(e));return r}render(e,t){this.rendered=!0;const i=e.viewState,r=this.getSources(e.extent,i.resolution);let s=!0;for(let a=0,c=r.length;a<c;++a){const l=r[a],u=l.getState();if(u==Fe.LOADING){const h=()=>{l.getState()==Fe.READY&&(l.removeEventListener("change",h),this.changed())};l.addEventListener("change",h)}s=s&&u==Fe.READY}const o=this.renderSources(e,r);if(this.getRenderer().renderComplete&&s)return this.renderedResolution_=i.resolution,o;if(this.renderedResolution_>.5*i.resolution){const a=this.getSources(e.extent,this.renderedResolution_).filter(c=>!r.includes(c));if(a.length>0)return this.renderSources(e,a)}return o}setStyle(e){this.styleVariables_=e.variables||{},this.style_=e;const t=Zb(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures}),this.changed()}updateStyleVariables(e){J(this.styleVariables_,e),this.changed()}}Wb.prototype.dispose;var mU=Wb;let yU;function _U(n){const e=Object.keys(n.defs),t=e.length;let i,r;for(i=0;i<t;++i){const s=e[i];if(!re(s)){const o=n.defs(s);let a=o.units;!a&&o.projName==="longlat"&&(a=gn.DEGREES),Cp(new qs({code:s,axisOrientation:o.axis,metersPerUnit:o.to_meter,units:a}))}}for(i=0;i<t;++i){const s=e[i],o=re(s);for(r=0;r<t;++r){const a=e[r],c=re(a);if(!vp(s,a))if(n.defs[s]===n.defs[a])Ju([o,c]);else{const l=n(s,a);vx(o,c,Pp(o,c,l.forward),Pp(c,o,l.inverse))}}}}class xU extends Bl{constructor(e,t,i,r,s,o,a){const c=e.getExtent(),l=t.getExtent(),u=l?an(i,l):i,h=Ut(u),d=ja(e,t,h,r),f=Ym,p=new Wm(e,t,u,c,d*f,r),m=p.calculateSourceExtent(),g=o(m,d,s),y=g?me.IDLE:me.EMPTY,_=g?g.getPixelRatio():1;super(i,r,_,y),this.targetProj_=t,this.maxSourceExtent_=c,this.triangulation_=p,this.targetResolution_=r,this.targetExtent_=i,this.sourceImage_=g,this.sourcePixelRatio_=_,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==me.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==me.LOADED){const t=be(this.targetExtent_)/this.targetResolution_,i=ot(this.targetExtent_)/this.targetResolution_;this.canvas_=qm(t,i,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=e,this.changed()}load(){if(this.state==me.IDLE){this.state=me.LOADING,this.changed();const e=this.sourceImage_.getState();e==me.LOADED||e==me.ERROR?this.reproject_():(this.sourceListenerKey_=pe(this.sourceImage_,ne.CHANGE,function(t){const i=this.sourceImage_.getState();(i==me.LOADED||i==me.ERROR)&&(this.unlistenSource_(),this.reproject_())},this),this.sourceImage_.load())}}unlistenSource_(){je(this.sourceListenerKey_),this.sourceListenerKey_=null}}var Hb=xU;function Kb(n){const e=n[0],t=new Array(e);let i=1<<e-1,r,s;for(r=0;r<e;++r)s=48,n[1]&i&&(s+=1),n[2]&i&&(s+=2),t[r]=String.fromCharCode(s),i>>=1;return t.join("")}const vU='<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>';class wU extends Ji{constructor(e){const t=e.hidpi!==void 0?e.hidpi:!1;let i=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(i=e.interpolate),super({cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:i,opaque:!0,projection:re("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Fe.LOADING,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:t?2:1,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,zDirection:e.zDirection}),this.hidpi_=t,this.culture_=e.culture!==void 0?e.culture:"en-us",this.maxZoom_=e.maxZoom!==void 0?e.maxZoom:-1,this.apiKey_=e.key,this.imagerySet_=e.imagerySet;const r="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+this.apiKey_+"&c="+this.culture_;Nc(r,this.handleImageryMetadataResponse.bind(this),void 0,"jsonp")}getApiKey(){return this.apiKey_}getImagerySet(){return this.imagerySet_}handleImageryMetadataResponse(e){if(e.statusCode!=200||e.statusDescription!="OK"||e.authenticationResultCode!="ValidCredentials"||e.resourceSets.length!=1||e.resourceSets[0].resources.length!=1){this.setState(Fe.ERROR);return}const t=e.resourceSets[0].resources[0],i=this.maxZoom_==-1?t.zoomMax:this.maxZoom_,r=this.getProjection(),s=Rr(r),o=this.hidpi_?2:1,a=t.imageWidth==t.imageHeight?t.imageWidth/o:[t.imageWidth/o,t.imageHeight/o],c=Io({extent:s,minZoom:t.zoomMin,maxZoom:i,tileSize:a});this.tileGrid=c;const l=this.culture_,u=this.hidpi_;if(this.tileUrlFunction=Va(t.imageUrlSubdomains.map(function(h){const d=[0,0,0],f=t.imageUrl.replace("{subdomain}",h).replace("{culture}",l);return function(p,m,g){if(p){La(p[0],p[1],p[2],d);let y=f;return u&&(y+="&dpi=d1&device=mobile"),y.replace("{quadkey}",Kb(d))}else return}})),t.imageryProviders){const h=qn(re("EPSG:4326"),this.getProjection());this.setAttributions(function(d){const f=[],p=d.viewState,m=this.getTileGrid(),g=m.getZForResolution(p.resolution,this.zDirection),_=m.getTileCoordForCoordAndZ(p.center,g)[0];return t.imageryProviders.map(function(v){let x=!1;const w=v.coverageAreas;for(let E=0,T=w.length;E<T;++E){const b=w[E];if(_>=b.zoomMin&&_<=b.zoomMax){const S=b.bbox,A=[S[1],S[0],S[3],S[2]],I=Ks(A,h);if(at(I,d.extent)){x=!0;break}}}x&&f.push(v.attribution)}),f.push(vU),f}.bind(this))}this.setState(Fe.READY)}}var EU=wU;class TU extends Ji{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);const r=t.projection!==void 0?t.projection:"EPSG:3857",s=t.tileGrid!==void 0?t.tileGrid:Io({extent:Rr(r),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,opaque:t.opaque,projection:r,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection})}}var eu=TU;class bU extends eu{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,maxZoom:e.maxZoom!==void 0?e.maxZoom:18,minZoom:e.minZoom,projection:e.projection,transition:e.transition,wrapX:e.wrapX,zDirection:e.zDirection}),this.account_=e.account,this.mapId_=e.map||"",this.config_=e.config||{},this.templateCache_={},this.initializeMap_()}getConfig(){return this.config_}updateConfig(e){J(this.config_,e),this.initializeMap_()}setConfig(e){this.config_=e||{},this.initializeMap_()}initializeMap_(){const e=JSON.stringify(this.config_);if(this.templateCache_[e]){this.applyTemplate_(this.templateCache_[e]);return}let t="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(t+="/named/"+this.mapId_);const i=new XMLHttpRequest;i.addEventListener("load",this.handleInitResponse_.bind(this,e)),i.addEventListener("error",this.handleInitError_.bind(this)),i.open("POST",t),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.config_))}handleInitResponse_(e,t){const i=t.target;if(!i.status||i.status>=200&&i.status<300){let r;try{r=JSON.parse(i.responseText)}catch{this.setState(Fe.ERROR);return}this.applyTemplate_(r),this.templateCache_[e]=r,this.setState(Fe.READY)}else this.setState(Fe.ERROR)}handleInitError_(e){this.setState(Fe.ERROR)}applyTemplate_(e){const t="https://"+e.cdn_url.https+"/"+this.account_+"/api/v1/map/"+e.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(t)}}var SU=bU;class RU extends ho{constructor(e){super({attributions:e.attributions,wrapX:e.wrapX}),this.resolution=void 0,this.distance=e.distance!==void 0?e.distance:20,this.minDistance=e.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=e.geometryFunction||function(t){const i=t.getGeometry();return ce(i.getType()==R.POINT,10),i},this.createCustomCluster_=e.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(e.source||null)}clear(e){this.features.length=0,super.clear(e)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(e,t,i){this.source.loadFeatures(e,t,i),t!==this.resolution&&(this.resolution=t,this.refresh())}setDistance(e){this.updateDistance(e,this.minDistance)}setMinDistance(e){this.updateDistance(this.distance,e)}getMinDistance(){return this.minDistance}setSource(e){this.source&&this.source.removeEventListener(ne.CHANGE,this.boundRefresh_),this.source=e,e&&e.addEventListener(ne.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(e,t){const i=e===0?0:Math.min(t,e)/e,r=e!==this.distance||this.interpolationRatio!==i;this.distance=e,this.minDistance=t,this.interpolationRatio=i,r&&this.refresh()}cluster(){if(this.resolution===void 0||!this.source)return;const e=Kt(),t=this.distance*this.resolution,i=this.source.getFeatures(),r={};for(let s=0,o=i.length;s<o;s++){const a=i[s];if(!(se(a)in r)){const c=this.geometryFunction(a);if(c){const l=c.getCoordinates();Ys(l,e),Nn(e,t,e);const u=this.source.getFeaturesInExtent(e).filter(function(h){const d=se(h);return d in r?!1:(r[d]=!0,!0)});this.features.push(this.createCluster(u,e))}}}}createCluster(e,t){const i=[0,0];for(let a=e.length-1;a>=0;--a){const c=this.geometryFunction(e[a]);c?Ep(i,c.getCoordinates()):e.splice(a,1)}Tp(i,1/e.length);const r=Ut(t),s=this.interpolationRatio,o=new ft([i[0]*(1-s)+r[0]*s,i[1]*(1-s)+r[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(o,e):new it({geometry:o,features:e})}}var IU=RU;class CU extends Fc{constructor(e){const t=e.projection===void 0?"EPSG:3857":e.projection;let i=e.tileGrid;i===void 0&&t&&(i=Io({extent:Rr(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize})),super({cacheSize:.1,attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:t,tileGrid:i,opaque:e.opaque,state:e.state,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate}),this.tileLoadingKeys_={},this.loader_=e.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=e.bandCount===void 0?4:e.bandCount}setLoader(e){this.loader_=e}getTile(e,t,i,r,s){const o=Xi(e,t,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);const a=this.loader_;function c(){return N_(function(){return a(e,t,i)})}const l=new rp(J({tileCoord:[e,t,i],loader:c},this.tileOptions));return l.key=this.getKey(),l.addEventListener(ne.CHANGE,this.handleTileChange_),this.tileCache.set(o,l),l}handleTileChange_(e){const t=e.target,i=se(t),r=t.getState();let s;r==W.LOADING?(this.tileLoadingKeys_[i]=!0,s=Ro.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==W.ERROR?Ro.TILELOADERROR:r==W.LOADED?Ro.TILELOADEND:void 0),s&&this.dispatchEvent(new n0(s,t))}}var qb=CU;function hn(n){return(e,...t)=>LU(n,e,t)}function el(n,e){return hn(Jb(n,e).get)}const{apply:LU,construct:b8,defineProperty:S8,get:R8,getOwnPropertyDescriptor:Jb,getPrototypeOf:J0,has:I8,ownKeys:AU,set:C8,setPrototypeOf:L8}=Reflect,{iterator:tu,species:A8,toStringTag:PU,for:P8}=Symbol,OU=Object,{create:Q0,defineProperty:MU,freeze:O8,is:M8}=OU,FU=Array,NU=FU.prototype,Qb=NU[tu],kU=hn(Qb),eS=ArrayBuffer,$U=eS.prototype;el($U,"byteLength");const tS=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:null;tS&&el(tS.prototype,"byteLength");const nS=J0(Uint8Array);nS.from;const Ln=nS.prototype;Ln[tu],hn(Ln.keys),hn(Ln.values),hn(Ln.entries),hn(Ln.set),hn(Ln.reverse),hn(Ln.fill),hn(Ln.copyWithin),hn(Ln.sort),hn(Ln.slice),hn(Ln.subarray),el(Ln,"buffer"),el(Ln,"byteOffset"),el(Ln,"length"),el(Ln,PU);const tl=Uint32Array,DU=Float32Array,Qd=J0([][tu]()),GU=hn(Qd.next),UU=hn(function*(){}().next),zU=J0(Qd),BU=DataView.prototype,jU=hn(BU.getUint16),ey=WeakMap,iS=ey.prototype,rS=hn(iS.get),VU=hn(iS.set),sS=new ey,YU=Q0(null,{next:{value:function(){const e=rS(sS,this);return GU(e)}},[tu]:{value:function(){return this}}});function XU(n){if(n[tu]===Qb)return n;const e=Q0(YU);return VU(sS,e,kU(n)),e}const ZU=new ey,WU=Q0(zU,{next:{value:function(){const e=rS(ZU,this);return UU(e)},writable:!0,configurable:!0}});for(const n of AU(Qd))n!=="next"&&MU(WU,n,Jb(Qd,n));const oS=new eS(4),HU=new DU(oS),KU=new tl(oS),er=new tl(512),tr=new tl(512);for(let n=0;n<256;++n){const e=n-127;e<-27?(er[n]=0,er[n|256]=32768,tr[n]=24,tr[n|256]=24):e<-14?(er[n]=1024>>-e-14,er[n|256]=1024>>-e-14|32768,tr[n]=-e-1,tr[n|256]=-e-1):e<=15?(er[n]=e+15<<10,er[n|256]=e+15<<10|32768,tr[n]=13,tr[n|256]=13):e<128?(er[n]=31744,er[n|256]=64512,tr[n]=24,tr[n|256]=24):(er[n]=31744,er[n|256]=64512,tr[n]=13,tr[n|256]=13)}const ty=new tl(2048),nl=new tl(64),aS=new tl(64);for(let n=1;n<1024;++n){let e=n<<13,t=0;for(;(e&8388608)===0;)e<<=1,t-=8388608;e&=-8388609,t+=947912704,ty[n]=e|t}for(let n=1024;n<2048;++n)ty[n]=939524096+(n-1024<<13);for(let n=1;n<31;++n)nl[n]=n<<23;nl[31]=1199570944,nl[32]=2147483648;for(let n=33;n<63;++n)nl[n]=2147483648+(n-32<<23);nl[63]=3347054592;for(let n=1;n<64;++n)n!==32&&(aS[n]=1024);function qU(n){const e=n>>10;return KU[0]=ty[aS[e]+(n&1023)]+nl[e],HU[0]}function lS(n,e,...t){return qU(jU(n,e,...XU(t)))}function JU(n,e,t){const i=t&&t.debug||!1;i&&console.log("getting "+e+" in "+n);const r=typeof n=="object"?n.outer:n,s=`${e}\\="([^"]*)"`;i&&console.log("pattern:",s);const a=new RegExp(s).exec(r);if(i&&console.log("match:",a),a)return a[1]}var ny=JU;function QU(n,e,t){const r=new RegExp(e).exec(n.slice(t));return r?t+r.index:-1}var e5=QU;const iy=e5;function t5(n,e,t){const i=t&&t.debug||!1,r=t&&t.startIndex||0;i&&console.log("starting findTagByName with",e," and ",t);const s=iy(n,`<${e}[ >]`,r);if(i&&console.log("start:",s),s===-1)return;const o=n.slice(s+e.length);let a=iy(o,"[ /]"+e+">",0);const c=a===-1;c&&(a=iy(o,"[ /]>",0));const l=s+e.length+a+1+(c?0:e.length)+1;if(i&&console.log("end:",l),l===-1)return;const u=n.slice(s,l);let h;return c?h=null:h=u.slice(u.indexOf(">")+1,u.lastIndexOf("<")),{inner:h,outer:u,start:s,end:l}}var n5=t5;const i5=n5;function r5(n,e,t){const i=[],r=t&&t.debug||!1;let s=t&&t.startIndex||0,o;for(;o=i5(n,e,{debug:r,startIndex:s});)s=o.end,i.push(o);return r&&console.log("findTagsByName found",i.length,"tags"),i}var s5=r5;const nu={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},nr={};for(const n in nu)nu.hasOwnProperty(n)&&(nr[nu[n]]=parseInt(n,10));const o5=[nr.BitsPerSample,nr.ExtraSamples,nr.SampleFormat,nr.StripByteCounts,nr.StripOffsets,nr.StripRowCounts,nr.TileByteCounts,nr.TileOffsets,nr.SubIFDs],ry={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Me={};for(const n in ry)ry.hasOwnProperty(n)&&(Me[ry[n]]=parseInt(n,10));const ei={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},a5={Unspecified:0,Assocalpha:1,Unassalpha:2},l5={Version:0,AddCompression:1},cS={None:0,Deflate:1},c5={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function u5(n,e){const{width:t,height:i}=n,r=new Uint8Array(t*i*3);let s;for(let o=0,a=0;o<n.length;++o,a+=3)s=256-n[o]/e*256,r[a]=s,r[a+1]=s,r[a+2]=s;return r}function h5(n,e){const{width:t,height:i}=n,r=new Uint8Array(t*i*3);let s;for(let o=0,a=0;o<n.length;++o,a+=3)s=n[o]/e*256,r[a]=s,r[a+1]=s,r[a+2]=s;return r}function d5(n,e){const{width:t,height:i}=n,r=new Uint8Array(t*i*3),s=e.length/3,o=e.length/3*2;for(let a=0,c=0;a<n.length;++a,c+=3){const l=n[a];r[c]=e[l]/65536*256,r[c+1]=e[l+s]/65536*256,r[c+2]=e[l+o]/65536*256}return r}function f5(n){const{width:e,height:t}=n,i=new Uint8Array(e*t*3);for(let r=0,s=0;r<n.length;r+=4,s+=3){const o=n[r],a=n[r+1],c=n[r+2],l=n[r+3];i[s]=255*((255-o)/256)*((255-l)/256),i[s+1]=255*((255-a)/256)*((255-l)/256),i[s+2]=255*((255-c)/256)*((255-l)/256)}return i}function p5(n){const{width:e,height:t}=n,i=new Uint8ClampedArray(e*t*3);for(let r=0,s=0;r<n.length;r+=3,s+=3){const o=n[r],a=n[r+1],c=n[r+2];i[s]=o+1.402*(c-128),i[s+1]=o-.34414*(a-128)-.71414*(c-128),i[s+2]=o+1.772*(a-128)}return i}const g5=.95047,m5=1,y5=1.08883;function _5(n){const{width:e,height:t}=n,i=new Uint8Array(e*t*3);for(let r=0,s=0;r<n.length;r+=3,s+=3){const o=n[r+0],a=n[r+1]<<24>>24,c=n[r+2]<<24>>24;let l=(o+16)/116,u=a/500+l,h=l-c/200,d,f,p;u=g5*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),l=m5*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),h=y5*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),d=u*3.2406+l*-1.5372+h*-.4986,f=u*-.9689+l*1.8758+h*.0415,p=u*.0557+l*-.204+h*1.057,d=d>.0031308?1.055*d**(1/2.4)-.055:12.92*d,f=f>.0031308?1.055*f**(1/2.4)-.055:12.92*f,p=p>.0031308?1.055*p**(1/2.4)-.055:12.92*p,i[s]=Math.max(0,Math.min(1,d))*255,i[s+1]=Math.max(0,Math.min(1,f))*255,i[s+2]=Math.max(0,Math.min(1,p))*255}return i}const uS=new Map;function Ts(n,e){Array.isArray(n)||(n=[n]),n.forEach(t=>uS.set(t,e))}async function hS(n){const e=uS.get(n.Compression);if(!e)throw new Error(`Unknown compression method identifier: ${n.Compression}`);const t=await e();return new t(n)}Ts([void 0,1],()=>Promise.resolve().then(function(){return Tz}).then(n=>n.default)),Ts(5,()=>Promise.resolve().then(function(){return Cz}).then(n=>n.default)),Ts(6,()=>{throw new Error("old style JPEG compression is not supported.")}),Ts(7,()=>Promise.resolve().then(function(){return Mz}).then(n=>n.default)),Ts([8,32946],()=>Promise.resolve().then(function(){return d8}).then(n=>n.default)),Ts(32773,()=>Promise.resolve().then(function(){return p8}).then(n=>n.default)),Ts(34887,()=>Promise.resolve().then(function(){return y8}).then(n=>n.default)),Ts(50001,()=>Promise.resolve().then(function(){return x8}).then(n=>n.default));function ef(n,e,t,i=1){return new(Object.getPrototypeOf(n)).constructor(e*t*i)}function x5(n,e,t,i,r){const s=e/i,o=t/r;return n.map(a=>{const c=ef(a,i,r);for(let l=0;l<r;++l){const u=Math.min(Math.round(o*l),t-1);for(let h=0;h<i;++h){const d=Math.min(Math.round(s*h),e-1),f=a[u*e+d];c[l*i+h]=f}}return c})}function il(n,e,t){return(1-t)*n+t*e}function v5(n,e,t,i,r){const s=e/i,o=t/r;return n.map(a=>{const c=ef(a,i,r);for(let l=0;l<r;++l){const u=o*l,h=Math.floor(u),d=Math.min(Math.ceil(u),t-1);for(let f=0;f<i;++f){const p=s*f,m=p%1,g=Math.floor(p),y=Math.min(Math.ceil(p),e-1),_=a[h*e+g],v=a[h*e+y],x=a[d*e+g],w=a[d*e+y],E=il(il(_,v,m),il(x,w,m),u%1);c[l*i+f]=E}}return c})}function w5(n,e,t,i,r,s="nearest"){switch(s.toLowerCase()){case"nearest":return x5(n,e,t,i,r);case"bilinear":case"linear":return v5(n,e,t,i,r);default:throw new Error(`Unsupported resampling method: '${s}'`)}}function E5(n,e,t,i,r,s){const o=e/i,a=t/r,c=ef(n,i,r,s);for(let l=0;l<r;++l){const u=Math.min(Math.round(a*l),t-1);for(let h=0;h<i;++h){const d=Math.min(Math.round(o*h),e-1);for(let f=0;f<s;++f){const p=n[u*e*s+d*s+f];c[l*i*s+h*s+f]=p}}}return c}function T5(n,e,t,i,r,s){const o=e/i,a=t/r,c=ef(n,i,r,s);for(let l=0;l<r;++l){const u=a*l,h=Math.floor(u),d=Math.min(Math.ceil(u),t-1);for(let f=0;f<i;++f){const p=o*f,m=p%1,g=Math.floor(p),y=Math.min(Math.ceil(p),e-1);for(let _=0;_<s;++_){const v=n[h*e*s+g*s+_],x=n[h*e*s+y*s+_],w=n[d*e*s+g*s+_],E=n[d*e*s+y*s+_],T=il(il(v,x,m),il(w,E,m),u%1);c[l*i*s+f*s+_]=T}}}return c}function b5(n,e,t,i,r,s,o="nearest"){switch(o.toLowerCase()){case"nearest":return E5(n,e,t,i,r,s);case"bilinear":case"linear":return T5(n,e,t,i,r,s);default:throw new Error(`Unsupported resampling method: '${o}'`)}}function S5(n,e,t){let i=0;for(let r=e;r<t;++r)i+=n[r];return i}function sy(n,e,t){switch(n){case 1:if(e<=8)return new Uint8Array(t);if(e<=16)return new Uint16Array(t);if(e<=32)return new Uint32Array(t);break;case 2:if(e===8)return new Int8Array(t);if(e===16)return new Int16Array(t);if(e===32)return new Int32Array(t);break;case 3:switch(e){case 16:case 32:return new Float32Array(t);case 64:return new Float64Array(t)}break}throw Error("Unsupported data format/bitsPerSample")}function R5(n,e){return(n===1||n===2)&&e<=32&&e%8===0?!1:!(n===3&&(e===16||e===32||e===64))}function I5(n,e,t,i,r,s,o){const a=new DataView(n),c=t===2?o*s:o*s*i,l=t===2?1:i,u=sy(e,r,c),h=parseInt("1".repeat(r),2);if(e===1){let d;t===1?d=i*r:d=r;let f=s*d;(f&7)!==0&&(f=f+7&-8);for(let p=0;p<o;++p){const m=p*f;for(let g=0;g<s;++g){const y=m+g*l*r;for(let _=0;_<l;++_){const v=y+_*r,x=(p*s+g)*l+_,w=Math.floor(v/8),E=v%8;if(E+r<=8)u[x]=a.getUint8(w)>>8-r-E&h;else if(E+r<=16)u[x]=a.getUint16(w)>>16-r-E&h;else if(E+r<=24){const T=a.getUint16(w)<<8|a.getUint8(w+2);u[x]=T>>24-r-E&h}else u[x]=a.getUint32(w)>>32-r-E&h}}}}return u.buffer}class C5{constructor(e,t,i,r,s,o){this.fileDirectory=e,this.geoKeys=t,this.dataView=i,this.littleEndian=r,this.tiles=s?{}:null,this.isTiled=!e.StripOffsets;const a=e.PlanarConfiguration;if(this.planarConfiguration=typeof a=="undefined"?1:a,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel!="undefined"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip!="undefined"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let t=0;t<this.fileDirectory.BitsPerSample.length;++t)e+=this.getSampleByteSize(t);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,i=this.fileDirectory.BitsPerSample[e];switch(t){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(r,s){return lS(this,r,s)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,t){const i=this.getSampleFormat(e),r=this.getBitsPerSample(e);return sy(i,r,t)}async getTileOrStrip(e,t,i,r,s){const o=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight());let c;const{tiles:l}=this;this.planarConfiguration===1?c=t*o+e:this.planarConfiguration===2&&(c=i*o*a+t*o+e);let u,h;this.isTiled?(u=this.fileDirectory.TileOffsets[c],h=this.fileDirectory.TileByteCounts[c]):(u=this.fileDirectory.StripOffsets[c],h=this.fileDirectory.StripByteCounts[c]);const d=(await this.source.fetch([{offset:u,length:h}],s))[0];let f;return l===null||!l[c]?(f=(async()=>{let p=await r.decode(this.fileDirectory,d);const m=this.getSampleFormat(),g=this.getBitsPerSample();return R5(m,g)&&(p=I5(p,m,this.planarConfiguration,this.getSamplesPerPixel(),g,this.getTileWidth(),this.getBlockHeight(t))),p})(),l!==null&&(l[c]=f)):f=l[c],{x:e,y:t,sample:i,data:await f}}async _readRaster(e,t,i,r,s,o,a,c,l){const u=this.getTileWidth(),h=this.getTileHeight(),d=this.getWidth(),f=this.getHeight(),p=Math.max(Math.floor(e[0]/u),0),m=Math.min(Math.ceil(e[2]/u),Math.ceil(d/u)),g=Math.max(Math.floor(e[1]/h),0),y=Math.min(Math.ceil(e[3]/h),Math.ceil(f/h)),_=e[2]-e[0];let v=this.getBytesPerPixel();const x=[],w=[];for(let b=0;b<t.length;++b)this.planarConfiguration===1?x.push(S5(this.fileDirectory.BitsPerSample,0,t[b])/8):x.push(0),w.push(this.getReaderForSample(t[b]));const E=[],{littleEndian:T}=this;for(let b=g;b<y;++b)for(let S=p;S<m;++S)for(let A=0;A<t.length;++A){const I=A,N=t[A];this.planarConfiguration===2&&(v=this.getSampleByteSize(A));const M=this.getTileOrStrip(S,b,N,s,l);E.push(M),M.then(B=>{const O=B.data,P=new DataView(O),G=this.getBlockHeight(B.y),U=B.y*h,D=B.x*u,k=U+G,$=(B.x+1)*u,F=w[I],te=Math.min(G,G-(k-e[3]),f-U),z=Math.min(u,u-($-e[2]),d-D);for(let X=Math.max(0,e[1]-U);X<te;++X)for(let K=Math.max(0,e[0]-D);K<z;++K){const le=(X*u+K)*v,ae=F.call(P,le+x[I],T);let Y;r?(Y=(X+U-e[1])*_*t.length+(K+D-e[0])*t.length+I,i[Y]=ae):(Y=(X+U-e[1])*_+K+D-e[0],i[I][Y]=ae)}})}if(await Promise.all(E),o&&e[2]-e[0]!==o||a&&e[3]-e[1]!==a){let b;return r?b=b5(i,e[2]-e[0],e[3]-e[1],o,a,t.length,c):b=w5(i,e[2]-e[0],e[3]-e[1],o,a,c),b.width=o,b.height=a,b}return i.width=o||e[2]-e[0],i.height=a||e[3]-e[1],i}async readRasters({window:e,samples:t=[],interleave:i,pool:r=null,width:s,height:o,resampleMethod:a,fillValue:c,signal:l}={}){const u=e||[0,0,this.getWidth(),this.getHeight()];if(u[0]>u[2]||u[1]>u[3])throw new Error("Invalid subsets");const h=u[2]-u[0],d=u[3]-u[1],f=h*d,p=this.getSamplesPerPixel();if(!t||!t.length)for(let _=0;_<p;++_)t.push(_);else for(let _=0;_<t.length;++_)if(t[_]>=p)return Promise.reject(new RangeError(`Invalid sample index '${t[_]}'.`));let m;if(i){const _=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,v=Math.max.apply(null,this.fileDirectory.BitsPerSample);m=sy(_,v,f*t.length),c&&m.fill(c)}else{m=[];for(let _=0;_<t.length;++_){const v=this.getArrayForSample(t[_],f);Array.isArray(c)&&_<c.length?v.fill(c[_]):c&&!Array.isArray(c)&&v.fill(c),m.push(v)}}const g=r||await hS(this.fileDirectory);return await this._readRaster(u,t,m,i,g,s,o,a,l)}async readRGB({window:e,interleave:t=!0,pool:i=null,width:r,height:s,resampleMethod:o,enableAlpha:a=!1,signal:c}={}){const l=e||[0,0,this.getWidth(),this.getHeight()];if(l[0]>l[2]||l[1]>l[3])throw new Error("Invalid subsets");const u=this.fileDirectory.PhotometricInterpretation;if(u===ei.RGB){let y=[0,1,2];if(this.fileDirectory.ExtraSamples!==a5.Unspecified&&a){y=[];for(let _=0;_<this.fileDirectory.BitsPerSample.length;_+=1)y.push(_)}return this.readRasters({window:e,interleave:t,samples:y,pool:i,width:r,height:s,resampleMethod:o,signal:c})}let h;switch(u){case ei.WhiteIsZero:case ei.BlackIsZero:case ei.Palette:h=[0];break;case ei.CMYK:h=[0,1,2,3];break;case ei.YCbCr:case ei.CIELab:h=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const d={window:l,interleave:!0,samples:h,pool:i,width:r,height:s,resampleMethod:o,signal:c},{fileDirectory:f}=this,p=await this.readRasters(d),m=2**this.fileDirectory.BitsPerSample[0];let g;switch(u){case ei.WhiteIsZero:g=u5(p,m);break;case ei.BlackIsZero:g=h5(p,m);break;case ei.Palette:g=d5(p,f.ColorMap);break;case ei.CMYK:g=f5(p);break;case ei.YCbCr:g=p5(p);break;case ei.CIELab:g=_5(p);break;default:throw new Error("Unsupported photometric interpretation.")}if(!t){const y=new Uint8Array(g.length/3),_=new Uint8Array(g.length/3),v=new Uint8Array(g.length/3);for(let x=0,w=0;x<g.length;x+=3,++w)y[w]=g[x],_[w]=g[x+1],v[w]=g[x+2];g=[y,_,v]}return g.width=p.width,g.height=p.height,g}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let t=0;t<this.fileDirectory.ModelTiepoint.length;t+=6)e.push({i:this.fileDirectory.ModelTiepoint[t],j:this.fileDirectory.ModelTiepoint[t+1],k:this.fileDirectory.ModelTiepoint[t+2],x:this.fileDirectory.ModelTiepoint[t+3],y:this.fileDirectory.ModelTiepoint[t+4],z:this.fileDirectory.ModelTiepoint[t+5]});return e}getGDALMetadata(e=null){const t={};if(!this.fileDirectory.GDAL_METADATA)return null;const i=this.fileDirectory.GDAL_METADATA;let r=s5(i,"Item");e===null?r=r.filter(s=>ny(s,"sample")===void 0):r=r.filter(s=>Number(ny(s,"sample"))===e);for(let s=0;s<r.length;++s){const o=r[s];t[ny(o,"name")]=o.inner}return t}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,t=this.fileDirectory.ModelTransformation;if(e&&e.length===6)return[e[3],e[4],e[5]];if(t)return[t[3],t[7],t[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const t=this.fileDirectory.ModelPixelScale,i=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(i)return[i[0],i[5],i[10]];if(e){const[r,s,o]=e.getResolution();return[r*e.getWidth()/this.getWidth(),s*e.getHeight()/this.getHeight(),o*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return this.geoKeys.GTRasterTypeGeoKey===1}getBoundingBox(){const e=this.getOrigin(),t=this.getResolution(),i=e[0],r=e[1],s=i+t[0]*this.getWidth(),o=r+t[1]*this.getHeight();return[Math.min(i,s),Math.min(r,o),Math.max(i,s),Math.max(r,o)]}}var dS=C5;class L5{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,t){const i=this.getUint32(e,t),r=this.getUint32(e+4,t);let s;if(t){if(s=i+2**32*r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*i+r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}getInt64(e,t){let i=0;const r=(this._dataView.getUint8(e+(t?7:0))&128)>0;let s=!0;for(let o=0;o<8;o++){let a=this._dataView.getUint8(e+(t?o:7-o));r&&(s?a!==0&&(a=~(a-1)&255,s=!1):a=~a&255),i+=a*256**o}return r&&(i=-i),i}getUint8(e,t){return this._dataView.getUint8(e,t)}getInt8(e,t){return this._dataView.getInt8(e,t)}getUint16(e,t){return this._dataView.getUint16(e,t)}getInt16(e,t){return this._dataView.getInt16(e,t)}getUint32(e,t){return this._dataView.getUint32(e,t)}getInt32(e,t){return this._dataView.getInt32(e,t)}getFloat16(e,t){return lS(this._dataView,e,t)}getFloat32(e,t){return this._dataView.getFloat32(e,t)}getFloat64(e,t){return this._dataView.getFloat64(e,t)}}class A5{constructor(e,t,i,r){this._dataView=new DataView(e),this._sliceOffset=t,this._littleEndian=i,this._bigTiff=r}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const t=this.readUint32(e),i=this.readUint32(e+4);let r;if(this._littleEndian){if(r=t+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*t+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}readInt64(e){let t=0;const i=(this._dataView.getUint8(e+(this._littleEndian?7:0))&128)>0;let r=!0;for(let s=0;s<8;s++){let o=this._dataView.getUint8(e+(this._littleEndian?s:7-s));i&&(r?o!==0&&(o=~(o-1)&255,r=!1):o=~o&255),t+=o*256**s}return i&&(t=-t),t}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}const P5=typeof navigator!="undefined"&&navigator.hardwareConcurrency||2;class O5{constructor(e=P5,t){this.workers=null,this._awaitingDecoder=null,this.size=e,this.messageId=0,e&&(this._awaitingDecoder=t?Promise.resolve(t):new Promise(i=>{Promise.resolve().then(function(){return E8}).then(r=>{i(r.create)})}),this._awaitingDecoder.then(i=>{this._awaitingDecoder=null,this.workers=[];for(let r=0;r<e;r++)this.workers.push({worker:i(),idle:!0})}))}async decode(e,t){return this._awaitingDecoder&&await this._awaitingDecoder,this.size===0?hS(e).then(i=>i.decode(e,t)):new Promise(i=>{const r=this.workers.find(a=>a.idle)||this.workers[Math.floor(Math.random()*this.size)];r.idle=!1;const s=this.messageId++,o=a=>{a.data.id===s&&(r.idle=!0,i(a.data.decoded),r.worker.removeEventListener("message",o))};r.worker.addEventListener("message",o),r.worker.postMessage({fileDirectory:e,buffer:t,id:s},[t])})}destroy(){this.workers&&(this.workers.forEach(e=>{e.worker.terminate()}),this.workers=null)}}var M5=O5;const fS=`\r
|
305
|
+
\r
|
306
|
+
`;function pS(n){if(typeof Object.fromEntries!="undefined")return Object.fromEntries(n);const e={};for(const[t,i]of n)e[t.toLowerCase()]=i;return e}function F5(n){const e=n.split(`\r
|
307
|
+
`).map(t=>{const i=t.split(":").map(r=>r.trim());return i[0]=i[0].toLowerCase(),i});return pS(e)}function N5(n){const[e,...t]=n.split(";").map(r=>r.trim()),i=t.map(r=>r.split("="));return{type:e,params:pS(i)}}function oy(n){let e,t,i;return n&&([,e,t,i]=n.match(/bytes (\d+)-(\d+)\/(\d+)/),e=parseInt(e,10),t=parseInt(t,10),i=parseInt(i,10)),{start:e,end:t,total:i}}function k5(n,e){let t=null;const i=new TextDecoder("ascii"),r=[],s=`--${e}`,o=`${s}--`;for(let a=0;a<10;++a)i.decode(new Uint8Array(n,a,s.length))===s&&(t=a);if(t===null)throw new Error("Could not find initial boundary");for(;t<n.byteLength;){const a=i.decode(new Uint8Array(n,t,Math.min(s.length+1024,n.byteLength-t)));if(a.length===0||a.startsWith(o))break;if(!a.startsWith(s))throw new Error("Part does not start with boundary");const c=a.substr(s.length+2);if(c.length===0)break;const l=c.indexOf(fS),u=F5(c.substr(0,l)),{start:h,end:d,total:f}=oy(u["content-range"]),p=t+s.length+l+fS.length,m=parseInt(d,10)+1-parseInt(h,10);r.push({headers:u,data:n.slice(p,p+m),offset:h,length:m,fileSize:f}),t=p+m+4}return r}class gS{async fetch(e,t=void 0){return Promise.all(e.map(i=>this.fetchSlice(i,t)))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}var $5=He;He.Node=Po,He.create=He;function He(n){var e=this;if(e instanceof He||(e=new He),e.tail=null,e.head=null,e.length=0,n&&typeof n.forEach=="function")n.forEach(function(r){e.push(r)});else if(arguments.length>0)for(var t=0,i=arguments.length;t<i;t++)e.push(arguments[t]);return e}He.prototype.removeNode=function(n){if(n.list!==this)throw new Error("removing node which does not belong to this list");var e=n.next,t=n.prev;return e&&(e.prev=t),t&&(t.next=e),n===this.head&&(this.head=e),n===this.tail&&(this.tail=t),n.list.length--,n.next=null,n.prev=null,n.list=null,e},He.prototype.unshiftNode=function(n){if(n!==this.head){n.list&&n.list.removeNode(n);var e=this.head;n.list=this,n.next=e,e&&(e.prev=n),this.head=n,this.tail||(this.tail=n),this.length++}},He.prototype.pushNode=function(n){if(n!==this.tail){n.list&&n.list.removeNode(n);var e=this.tail;n.list=this,n.prev=e,e&&(e.next=n),this.tail=n,this.head||(this.head=n),this.length++}},He.prototype.push=function(){for(var n=0,e=arguments.length;n<e;n++)G5(this,arguments[n]);return this.length},He.prototype.unshift=function(){for(var n=0,e=arguments.length;n<e;n++)U5(this,arguments[n]);return this.length},He.prototype.pop=function(){if(!!this.tail){var n=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,n}},He.prototype.shift=function(){if(!!this.head){var n=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,n}},He.prototype.forEach=function(n,e){e=e||this;for(var t=this.head,i=0;t!==null;i++)n.call(e,t.value,i,this),t=t.next},He.prototype.forEachReverse=function(n,e){e=e||this;for(var t=this.tail,i=this.length-1;t!==null;i--)n.call(e,t.value,i,this),t=t.prev},He.prototype.get=function(n){for(var e=0,t=this.head;t!==null&&e<n;e++)t=t.next;if(e===n&&t!==null)return t.value},He.prototype.getReverse=function(n){for(var e=0,t=this.tail;t!==null&&e<n;e++)t=t.prev;if(e===n&&t!==null)return t.value},He.prototype.map=function(n,e){e=e||this;for(var t=new He,i=this.head;i!==null;)t.push(n.call(e,i.value,this)),i=i.next;return t},He.prototype.mapReverse=function(n,e){e=e||this;for(var t=new He,i=this.tail;i!==null;)t.push(n.call(e,i.value,this)),i=i.prev;return t},He.prototype.reduce=function(n,e){var t,i=this.head;if(arguments.length>1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=0;i!==null;r++)t=n(t,i.value,r),i=i.next;return t},He.prototype.reduceReverse=function(n,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=this.length-1;i!==null;r--)t=n(t,i.value,r),i=i.prev;return t},He.prototype.toArray=function(){for(var n=new Array(this.length),e=0,t=this.head;t!==null;e++)n[e]=t.value,t=t.next;return n},He.prototype.toArrayReverse=function(){for(var n=new Array(this.length),e=0,t=this.tail;t!==null;e++)n[e]=t.value,t=t.prev;return n},He.prototype.slice=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new He;if(e<n||e<0)return t;n<0&&(n=0),e>this.length&&(e=this.length);for(var i=0,r=this.head;r!==null&&i<n;i++)r=r.next;for(;r!==null&&i<e;i++,r=r.next)t.push(r.value);return t},He.prototype.sliceReverse=function(n,e){e=e||this.length,e<0&&(e+=this.length),n=n||0,n<0&&(n+=this.length);var t=new He;if(e<n||e<0)return t;n<0&&(n=0),e>this.length&&(e=this.length);for(var i=this.length,r=this.tail;r!==null&&i>e;i--)r=r.prev;for(;r!==null&&i>n;i--,r=r.prev)t.push(r.value);return t},He.prototype.splice=function(n,e,...t){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var i=0,r=this.head;r!==null&&i<n;i++)r=r.next;for(var s=[],i=0;r&&i<e;i++)s.push(r.value),r=this.removeNode(r);r===null&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(var i=0;i<t.length;i++)r=D5(this,r,t[i]);return s},He.prototype.reverse=function(){for(var n=this.head,e=this.tail,t=n;t!==null;t=t.prev){var i=t.prev;t.prev=t.next,t.next=i}return this.head=e,this.tail=n,this};function D5(n,e,t){var i=e===n.head?new Po(t,null,e,n):new Po(t,e,e.next,n);return i.next===null&&(n.tail=i),i.prev===null&&(n.head=i),n.length++,i}function G5(n,e){n.tail=new Po(e,n.tail,null,n),n.head||(n.head=n.tail),n.length++}function U5(n,e){n.head=new Po(e,null,n.head,n),n.tail||(n.tail=n.head),n.length++}function Po(n,e,t,i){if(!(this instanceof Po))return new Po(n,e,t,i);this.list=i,this.value=n,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{require("./iterator.js")(He)}catch{}const z5=$5,Oo=Symbol("max"),Ar=Symbol("length"),rl=Symbol("lengthCalculator"),iu=Symbol("allowStale"),Mo=Symbol("maxAge"),Pr=Symbol("dispose"),mS=Symbol("noDisposeOnSet"),qt=Symbol("lruList"),Mi=Symbol("cache"),yS=Symbol("updateAgeOnGet"),ay=()=>1;class B5{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[Oo]=e.max||1/0;const t=e.length||ay;if(this[rl]=typeof t!="function"?ay:t,this[iu]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[Mo]=e.maxAge||0,this[Pr]=e.dispose,this[mS]=e.noDisposeOnSet||!1,this[yS]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Oo]=e||1/0,ru(this)}get max(){return this[Oo]}set allowStale(e){this[iu]=!!e}get allowStale(){return this[iu]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[Mo]=e,ru(this)}get maxAge(){return this[Mo]}set lengthCalculator(e){typeof e!="function"&&(e=ay),e!==this[rl]&&(this[rl]=e,this[Ar]=0,this[qt].forEach(t=>{t.length=this[rl](t.value,t.key),this[Ar]+=t.length})),ru(this)}get lengthCalculator(){return this[rl]}get length(){return this[Ar]}get itemCount(){return this[qt].length}rforEach(e,t){t=t||this;for(let i=this[qt].tail;i!==null;){const r=i.prev;_S(this,e,i,t),i=r}}forEach(e,t){t=t||this;for(let i=this[qt].head;i!==null;){const r=i.next;_S(this,e,i,t),i=r}}keys(){return this[qt].toArray().map(e=>e.key)}values(){return this[qt].toArray().map(e=>e.value)}reset(){this[Pr]&&this[qt]&&this[qt].length&&this[qt].forEach(e=>this[Pr](e.key,e.value)),this[Mi]=new Map,this[qt]=new z5,this[Ar]=0}dump(){return this[qt].map(e=>tf(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[qt]}set(e,t,i){if(i=i||this[Mo],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const r=i?Date.now():0,s=this[rl](t,e);if(this[Mi].has(e)){if(s>this[Oo])return sl(this,this[Mi].get(e)),!1;const c=this[Mi].get(e).value;return this[Pr]&&(this[mS]||this[Pr](e,c.value)),c.now=r,c.maxAge=i,c.value=t,this[Ar]+=s-c.length,c.length=s,this.get(e),ru(this),!0}const o=new j5(e,t,s,r,i);return o.length>this[Oo]?(this[Pr]&&this[Pr](e,t),!1):(this[Ar]+=o.length,this[qt].unshift(o),this[Mi].set(e,this[qt].head),ru(this),!0)}has(e){if(!this[Mi].has(e))return!1;const t=this[Mi].get(e).value;return!tf(this,t)}get(e){return ly(this,e,!0)}peek(e){return ly(this,e,!1)}pop(){const e=this[qt].tail;return e?(sl(this,e),e.value):null}del(e){sl(this,this[Mi].get(e))}load(e){this.reset();const t=Date.now();for(let i=e.length-1;i>=0;i--){const r=e[i],s=r.e||0;if(s===0)this.set(r.k,r.v);else{const o=s-t;o>0&&this.set(r.k,r.v,o)}}}prune(){this[Mi].forEach((e,t)=>ly(this,t,!1))}}const ly=(n,e,t)=>{const i=n[Mi].get(e);if(i){const r=i.value;if(tf(n,r)){if(sl(n,i),!n[iu])return}else t&&(n[yS]&&(i.value.now=Date.now()),n[qt].unshiftNode(i));return r.value}},tf=(n,e)=>{if(!e||!e.maxAge&&!n[Mo])return!1;const t=Date.now()-e.now;return e.maxAge?t>e.maxAge:n[Mo]&&t>n[Mo]},ru=n=>{if(n[Ar]>n[Oo])for(let e=n[qt].tail;n[Ar]>n[Oo]&&e!==null;){const t=e.prev;sl(n,e),e=t}},sl=(n,e)=>{if(e){const t=e.value;n[Pr]&&n[Pr](t.key,t.value),n[Ar]-=t.length,n[Mi].delete(t.key),n[qt].removeNode(e)}};class j5{constructor(e,t,i,r,s){this.key=e,this.value=t,this.length=i,this.now=r,this.maxAge=s||0}}const _S=(n,e,t,i)=>{let r=t.value;tf(n,r)&&(sl(n,t),n[iu]||(r=void 0)),r&&e.call(i,r.value,r.key,n)};var V5=B5;async function Y5(n){return new Promise(e=>setTimeout(e,n))}function xS(n,e){const t=Array.isArray(n)?n:Array.from(n),i=Array.isArray(e)?e:Array.from(e);return t.map((r,s)=>[r,i[s]])}class gl extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,gl),this.name="AbortError"}}class X5 extends Error{constructor(e,t){super(t),this.errors=e,this.message=t,this.name="AggregateError"}}const Z5=X5;class W5{constructor(e,t,i=null){this.offset=e,this.length=t,this.data=i}get top(){return this.offset+this.length}}class vS{constructor(e,t,i){this.offset=e,this.length=t,this.blockIds=i}}class H5 extends gS{constructor(e,{blockSize:t=65536,cacheSize:i=100}={}){super(),this.source=e,this.blockSize=t,this.blockCache=new V5({max:i}),this.blockRequests=new Map,this.blockIdsToFetch=new Set}get fileSize(){return this.source.fileSize}async fetch(e,t){const i=new Map,r=new Map,s=new Set;for(const{offset:l,length:u}of e){let h=l+u;const{fileSize:d}=this;d!==null&&(h=Math.min(h,d));const f=Math.floor(l/this.blockSize)*this.blockSize;for(let p=f;p<h;p+=this.blockSize){const m=Math.floor(p/this.blockSize);this.blockCache.has(m)?i.set(m,this.blockCache.get(m)):this.blockRequests.has(m)?r.set(m,this.blockRequests.get(m)):(this.blockIdsToFetch.has(m)||this.blockIdsToFetch.add(m),s.add(m))}}await Y5(),this.fetchBlocks(t);for(const l of s){const u=this.blockRequests.get(l),h=this.blockCache.get(l);if(u)r.set(l,u);else if(h)i.set(l,h);else throw new Error(`Block ${l} is not in the block requests`)}let o=await Promise.allSettled(Array.from(r.values()));if(o.some(l=>l.status==="rejected")){const l=new Set;for(const[u,h]of xS(r.keys(),o)){const{rejected:d,reason:f}=h;d&&f.name==="AbortError"&&f.signal!==t&&(this.blockIdsToFetch.add(u),l.add(u))}if(this.blockIdsToFetch.length>0){this.fetchBlocks(t);for(const u of l){const h=this.blockRequests.get(u);if(!h)throw new Error(`Block ${u} is not in the block requests`);r.set(u,h)}o=await Promise.allSettled(Array.from(r.values()))}}if(o.some(l=>l.status==="rejected"))throw t&&t.aborted?new gl("Request was aborted"):new Z5(o.filter(l=>l.status==="rejected").map(l=>l.reason),"Request failed");const a=o.map(l=>l.value),c=new Map(xS(Array.from(r.keys()),a));for(const[l,u]of i)c.set(l,u);return this.readSliceData(e,c)}fetchBlocks(e){if(this.blockIdsToFetch.size>0){const t=this.groupBlocks(this.blockIdsToFetch),i=this.source.fetch(t,e);for(let r=0;r<t.length;++r){const s=t[r];for(const o of s.blockIds){const a=(async()=>{try{const c=(await i)[r],l=o*this.blockSize,u=l-c.offset,h=Math.min(u+this.blockSize,c.data.byteLength),d=c.data.slice(u,h),f=new W5(l,d.byteLength,d);return this.blockCache.set(o,f),f}catch(c){throw c.name==="AbortError"&&(c.signal=e),c}finally{this.blockRequests.delete(o)}})();this.blockRequests.set(o,a)}}this.blockIdsToFetch.clear()}}groupBlocks(e){const t=Array.from(e).sort((o,a)=>o-a);if(t.length===0)return[];let i=[],r=null;const s=[];for(const o of t)r===null||r+1===o?(i.push(o),r=o):(s.push(new vS(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[o],r=o);return s.push(new vS(i[0]*this.blockSize,i.length*this.blockSize,i)),s}readSliceData(e,t){return e.map(i=>{const r=i.offset+i.length,s=Math.floor(i.offset/this.blockSize),o=Math.floor((i.offset+i.length)/this.blockSize),a=new ArrayBuffer(i.length),c=new Uint8Array(a);for(let l=s;l<=o;++l){const u=t.get(l),h=u.offset-i.offset,d=u.top-r;let f=0,p=0,m;h<0?f=-h:h>0&&(p=h),d<0?m=u.length-f:m=r-u.offset-f;const g=new Uint8Array(u.data,f,m);c.set(g,p)}return a})}}class cy{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(e){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class uy{constructor(e){this.url=e}async request({headers:e,credentials:t,signal:i}={}){throw new Error("request is not implemented")}}class K5 extends cy{constructor(e){super(),this.response=e}get status(){return this.response.status}getHeader(e){return this.response.headers.get(e)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class q5 extends uy{constructor(e,t){super(e),this.credentials=t}async request({headers:e,credentials:t,signal:i}={}){const r=await fetch(this.url,{headers:e,credentials:t,signal:i});return new K5(r)}}class J5 extends cy{constructor(e,t){super(),this.xhr=e,this.data=t}get status(){return this.xhr.status}getHeader(e){return this.xhr.getResponseHeader(e)}async getData(){return this.data}}class Q5 extends uy{constructRequest(e,t){return new Promise((i,r)=>{const s=new XMLHttpRequest;s.open("GET",this.url),s.responseType="arraybuffer";for(const[o,a]of Object.entries(e))s.setRequestHeader(o,a);s.onload=()=>{const o=s.response;i(new J5(s,o))},s.onerror=r,s.onabort=()=>r(new gl("Request aborted")),s.send(),t&&(t.aborted&&s.abort(),t.addEventListener("abort",()=>s.abort()))})}async request({headers:e,signal:t}={}){return await this.constructRequest(e,t)}}var hy={};class e4 extends cy{constructor(e,t){super(),this.response=e,this.dataPromise=t}get status(){return this.response.statusCode}getHeader(e){return this.response.headers[e]}async getData(){return await this.dataPromise}}class t4 extends uy{constructor(e){super(e),this.parsedUrl=hy.parse(this.url),this.httpApi=(this.parsedUrl.protocol==="http:",hy)}constructRequest(e,t){return new Promise((i,r)=>{const s=this.httpApi.get(El(wl({},this.parsedUrl),{headers:e}),o=>{const a=new Promise(c=>{const l=[];o.on("data",u=>{l.push(u)}),o.on("end",()=>{const u=Buffer.concat(l).buffer;c(u)}),o.on("error",r)});i(new e4(o,a))});s.on("error",r),t&&(t.aborted&&s.destroy(new gl("Request aborted")),t.addEventListener("abort",()=>s.destroy(new gl("Request aborted"))))})}async request({headers:e,signal:t}={}){return await this.constructRequest(e,t)}}class dy extends gS{constructor(e,t,i,r){super(),this.client=e,this.headers=t,this.maxRanges=i,this.allowFullFile=r,this._fileSize=null}async fetch(e,t){return this.maxRanges>=e.length?this.fetchSlices(e,t):(this.maxRanges>0&&e.length>1,Promise.all(e.map(i=>this.fetchSlice(i,t))))}async fetchSlices(e,t){const i=await this.client.request({headers:El(wl({},this.headers),{Range:`bytes=${e.map(({offset:r,length:s})=>`${r}-${r+s}`).join(",")}`}),signal:t});if(i.ok)if(i.status===206){const{type:r,params:s}=N5(i.getHeader("content-type"));if(r==="multipart/byteranges"){const h=k5(await i.getData(),s.boundary);return this._fileSize=h[0].fileSize||null,h}const o=await i.getData(),{start:a,end:c,total:l}=oy(i.getHeader("content-range"));this._fileSize=l||null;const u=[{data:o,offset:a,length:c-a}];if(e.length>1){const h=await Promise.all(e.slice(1).map(d=>this.fetchSlice(d,t)));return u.concat(h)}return u}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const r=await i.getData();return this._fileSize=r.byteLength,[{data:r,offset:0,length:r.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(e,t){const{offset:i,length:r}=e,s=await this.client.request({headers:El(wl({},this.headers),{Range:`bytes=${i}-${i+r}`}),signal:t});if(s.ok)if(s.status===206){const o=await s.getData(),{total:a}=oy(s.getHeader("content-range"));return this._fileSize=a||null,{data:o,offset:i,length:r}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const o=await s.getData();return this._fileSize=o.byteLength,{data:o,offset:0,length:o.byteLength}}else throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function fy(n,{blockSize:e,cacheSize:t}){return e===null?n:new H5(n,e,t)}function n4(n,o={}){var a=o,{headers:e={},credentials:t,maxRanges:i=0,allowFullFile:r=!1}=a,s=Tl(a,["headers","credentials","maxRanges","allowFullFile"]);const c=new q5(n,t),l=new dy(c,e,i,r);return fy(l,s)}function i4(n,s={}){var o=s,{headers:e={},maxRanges:t=0,allowFullFile:i=!1}=o,r=Tl(o,["headers","maxRanges","allowFullFile"]);const a=new Q5(n),c=new dy(a,e,t,i);return fy(c,r)}function r4(n,s={}){var o=s,{headers:e={},maxRanges:t=0,allowFullFile:i=!1}=o,r=Tl(o,["headers","maxRanges","allowFullFile"]);const a=new t4(n),c=new dy(a,e,t,i);return fy(c,r)}function py(n,i={}){var r=i,{forceXHR:e=!1}=r,t=Tl(r,["forceXHR"]);return typeof fetch=="function"&&!e?n4(n,t):typeof XMLHttpRequest!="undefined"?i4(n,t):r4(n,t)}function gy(n){switch(n){case Me.BYTE:case Me.ASCII:case Me.SBYTE:case Me.UNDEFINED:return 1;case Me.SHORT:case Me.SSHORT:return 2;case Me.LONG:case Me.SLONG:case Me.FLOAT:case Me.IFD:return 4;case Me.RATIONAL:case Me.SRATIONAL:case Me.DOUBLE:case Me.LONG8:case Me.SLONG8:case Me.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${n}`)}}function s4(n){const e=n.GeoKeyDirectory;if(!e)return null;const t={};for(let i=4;i<=e[3]*4;i+=4){const r=c5[e[i]],s=e[i+1]?nu[e[i+1]]:null,o=e[i+2],a=e[i+3];let c=null;if(!s)c=a;else{if(c=n[s],typeof c=="undefined"||c===null)throw new Error(`Could not get value of geoKey '${r}'.`);typeof c=="string"?c=c.substring(a,a+o-1):c.subarray&&(c=c.subarray(a,a+o),o===1&&(c=c[0]))}t[r]=c}return t}function ol(n,e,t,i){let r=null,s=null;const o=gy(e);switch(e){case Me.BYTE:case Me.ASCII:case Me.UNDEFINED:r=new Uint8Array(t),s=n.readUint8;break;case Me.SBYTE:r=new Int8Array(t),s=n.readInt8;break;case Me.SHORT:r=new Uint16Array(t),s=n.readUint16;break;case Me.SSHORT:r=new Int16Array(t),s=n.readInt16;break;case Me.LONG:case Me.IFD:r=new Uint32Array(t),s=n.readUint32;break;case Me.SLONG:r=new Int32Array(t),s=n.readInt32;break;case Me.LONG8:case Me.IFD8:r=new Array(t),s=n.readUint64;break;case Me.SLONG8:r=new Array(t),s=n.readInt64;break;case Me.RATIONAL:r=new Uint32Array(t*2),s=n.readUint32;break;case Me.SRATIONAL:r=new Int32Array(t*2),s=n.readInt32;break;case Me.FLOAT:r=new Float32Array(t),s=n.readFloat32;break;case Me.DOUBLE:r=new Float64Array(t),s=n.readFloat64;break;default:throw new RangeError(`Invalid field type: ${e}`)}if(e===Me.RATIONAL||e===Me.SRATIONAL)for(let a=0;a<t;a+=2)r[a]=s.call(n,i+a*o),r[a+1]=s.call(n,i+(a*o+4));else for(let a=0;a<t;++a)r[a]=s.call(n,i+a*o);return e===Me.ASCII?new TextDecoder("utf-8").decode(r):r}class o4{constructor(e,t,i){this.fileDirectory=e,this.geoKeyDirectory=t,this.nextIFDByteOffset=i}}class nf extends Error{constructor(e){super(`No image at index ${e}`),this.index=e}}class wS{async readRasters(e={}){const{window:t,width:i,height:r}=e;let{resX:s,resY:o,bbox:a}=e;const c=await this.getImage();let l=c;const u=await this.getImageCount(),h=c.getBoundingBox();if(t&&a)throw new Error('Both "bbox" and "window" passed.');if(i||r){if(t){const[p,m]=c.getOrigin(),[g,y]=c.getResolution();a=[p+t[0]*g,m+t[1]*y,p+t[2]*g,m+t[3]*y]}const f=a||h;if(i){if(s)throw new Error("Both width and resX passed");s=(f[2]-f[0])/i}if(r){if(o)throw new Error("Both width and resY passed");o=(f[3]-f[1])/r}}if(s||o){const f=[];for(let p=0;p<u;++p){const m=await this.getImage(p),{SubfileType:g,NewSubfileType:y}=m.fileDirectory;(p===0||g===2||y&1)&&f.push(m)}f.sort((p,m)=>p.getWidth()-m.getWidth());for(let p=0;p<f.length;++p){const m=f[p],g=(h[2]-h[0])/m.getWidth(),y=(h[3]-h[1])/m.getHeight();if(l=m,s&&s>g||o&&o>y)break}}let d=t;if(a){const[f,p]=c.getOrigin(),[m,g]=l.getResolution(c);d=[Math.round((a[0]-f)/m),Math.round((a[1]-p)/g),Math.round((a[2]-f)/m),Math.round((a[3]-p)/g)],d=[Math.min(d[0],d[2]),Math.min(d[1],d[3]),Math.max(d[0],d[2]),Math.max(d[1],d[3])]}return l.readRasters(El(wl({},e),{window:d}))}}class Ru extends wS{constructor(e,t,i,r,s={}){super(),this.source=e,this.littleEndian=t,this.bigTiff=i,this.firstIFDOffset=r,this.cache=s.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,t){const i=this.bigTiff?4048:1024;return new A5((await this.source.fetch([{offset:e,length:typeof t!="undefined"?t:i}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const t=this.bigTiff?20:12,i=this.bigTiff?8:2;let r=await this.getSlice(e);const s=this.bigTiff?r.readUint64(e):r.readUint16(e),o=s*t+(this.bigTiff?16:6);r.covers(e,o)||(r=await this.getSlice(e,o));const a={};let c=e+(this.bigTiff?8:2);for(let h=0;h<s;c+=t,++h){const d=r.readUint16(c),f=r.readUint16(c+2),p=this.bigTiff?r.readUint64(c+4):r.readUint32(c+4);let m,g;const y=gy(f),_=c+(this.bigTiff?12:8);if(y*p<=(this.bigTiff?8:4))m=ol(r,f,p,_);else{const v=r.readOffset(_),x=gy(f)*p;if(r.covers(v,x))m=ol(r,f,p,v);else{const w=await this.getSlice(v,x);m=ol(w,f,p,v)}}p===1&&o5.indexOf(d)===-1&&!(f===Me.RATIONAL||f===Me.SRATIONAL)?g=m[0]:g=m,a[nu[d]]=g}const l=s4(a),u=r.readOffset(e+i+t*s);return new o4(a,l,u)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(e===0)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(t){throw t instanceof nf?new nf(e):t}return this.ifdRequests[e]=(async()=>{const t=await this.ifdRequests[e-1];if(t.nextIFDByteOffset===0)throw new nf(e);return this.parseFileDirectoryAt(t.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const t=await this.requestIFD(e);return new dS(t.fileDirectory,t.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,t=!0;for(;t;)try{await this.requestIFD(e),++e}catch(i){if(i instanceof nf)t=!1;else throw i}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const t="GDAL_STRUCTURAL_METADATA_SIZE=",i=t.length+100;let r=await this.getSlice(e,i);if(t===ol(r,Me.ASCII,t.length,e)){const o=ol(r,Me.ASCII,i,e).split(`
|
308
|
+
`)[0],a=Number(o.split("=")[1].split(" ")[0])+o.length;a>i&&(r=await this.getSlice(e,a));const c=ol(r,Me.ASCII,a,e);this.ghostValues={},c.split(`
|
309
|
+
`).filter(l=>l.length>0).map(l=>l.split("=")).forEach(([l,u])=>{this.ghostValues[l]=u})}return this.ghostValues}static async fromSource(e,t,i){const r=(await e.fetch([{offset:0,length:1024}],i))[0],s=new L5(r),o=s.getUint16(0,0);let a;if(o===18761)a=!0;else if(o===19789)a=!1;else throw new TypeError("Invalid byte order value.");const c=s.getUint16(2,a);let l;if(c===42)l=!1;else if(c===43){if(l=!0,s.getUint16(4,a)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const u=l?s.getUint64(8,a):s.getUint32(4,a);return new Ru(e,a,l,u,t)}close(){return typeof this.source.close=="function"?this.source.close():!1}}class a4 extends wS{constructor(e,t){super(),this.mainFile=e,this.overviewFiles=t,this.imageFiles=[e].concat(t),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const e=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(t=>t.parseFileDirectoryAt(t.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(e),this.fileDirectoriesPerFile}async getImage(e=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let t=0,i=0;for(let r=0;r<this.imageFiles.length;r++){const s=this.imageFiles[r];for(let o=0;o<this.imageCounts[r];o++){if(e===t){const a=await s.requestIFD(i);return new dS(a.fileDirectory,a.geoKeyDirectory,s.dataView,s.littleEndian,s.cache,s.source)}t++,i++}i=0}throw new RangeError("Invalid image index")}async getImageCount(){if(this.imageCount!==null)return this.imageCount;const e=[this.mainFile.getImageCount()].concat(this.overviewFiles.map(t=>t.getImageCount()));return this.imageCounts=await Promise.all(e),this.imageCount=this.imageCounts.reduce((t,i)=>t+i,0),this.imageCount}}async function l4(n,e={},t){return Ru.fromSource(py(n,e),t)}async function c4(n,e=[],t={},i){const r=await Ru.fromSource(py(n,t),i),s=await Promise.all(e.map(o=>Ru.fromSource(py(o,t))));return new a4(r,s)}const ES="STATISTICS_MAXIMUM",TS="STATISTICS_MINIMUM";let my;function u4(){return my||(my=new M5),my}function h4(n){try{return n.getBoundingBox()}catch{const t=n.fileDirectory;return[0,0,t.ImageWidth,t.ImageLength]}}function d4(n){try{return n.getOrigin().slice(0,2)}catch{return[0,n.fileDirectory.ImageLength]}}function f4(n,e){try{return n.getResolution(e)[0]}catch{return e.fileDirectory.ImageWidth/n.fileDirectory.ImageWidth}}function p4(n){const e=n.geoKeys;if(!e)return null;if(e.ProjectedCSTypeGeoKey){const t="EPSG:"+e.ProjectedCSTypeGeoKey;let i=re(t);if(!i){const r=sp(e.ProjLinearUnitsGeoKey);r&&(i=new qs({code:t,units:r}))}return i}if(e.GeographicTypeGeoKey){const t="EPSG:"+e.GeographicTypeGeoKey;let i=re(t);if(!i){const r=sp(e.GeogAngularUnitsGeoKey);r&&(i=new qs({code:t,units:r}))}return i}return null}function g4(n){return n.getImageCount().then(function(e){const t=new Array(e);for(let i=0;i<e;++i)t[i]=n.getImage(i);return Promise.all(t)})}function m4(n,e){let t;return n.overviews?t=c4(n.url,n.overviews,e):t=l4(n.url,e),t.then(g4)}function rf(n,e,t,i,r){if(Array.isArray(n)){const s=n.length;if(!Array.isArray(e)||s!=e.length){const o=new Error(i);throw r(o),o}for(let o=0;o<s;++o)rf(n[o],e[o],t,i,r);return}if(e=e,Math.abs(n-e)>t*n)throw new Error(i)}function y4(n){return n instanceof Int8Array?-128:n instanceof Int16Array?-32768:n instanceof Int32Array?-2147483648:n instanceof Float32Array?12e-39:0}function _4(n){return n instanceof Int8Array?127:n instanceof Uint8Array||n instanceof Uint8ClampedArray?255:n instanceof Int16Array?32767:n instanceof Uint16Array?65535:n instanceof Int32Array?2147483647:n instanceof Uint32Array?4294967295:n instanceof Float32Array?34e37:255}class bS extends qb{constructor(e){super({state:Fe.LOADING,tileGrid:null,projection:null,opaque:e.opaque,transition:e.transition,interpolate:e.interpolate!==!1,wrapX:e.wrapX}),this.sourceInfo_=e.sources;const t=this.sourceInfo_.length;this.sourceOptions_=e.sourceOptions,this.sourceImagery_=new Array(t),this.resolutionFactors_=new Array(t),this.samplesPerPixel_,this.nodataValues_,this.metadata_,this.normalize_=e.normalize!==!1,this.addAlpha_=!1,this.error_=null,this.readMethod_=e.convertToRGB?"readRGB":"readRasters",this.setKey(this.sourceInfo_.map(s=>s.url).join(","));const i=this,r=new Array(t);for(let s=0;s<t;++s)r[s]=m4(this.sourceInfo_[s],this.sourceOptions_);Promise.all(r).then(function(s){i.configure_(s)}).catch(function(s){console.error(s),i.error_=s,i.setState(Fe.ERROR)})}getError(){return this.error_}configure_(e){let t,i,r,s;const o=new Array(e.length),a=new Array(e.length),c=new Array(e.length);let l=0;const u=e.length;for(let f=0;f<u;++f){const p=e[f],m=p.length;let g,y;const _=new Array(m),v=new Array(m);a[f]=new Array(m),c[f]=new Array(m);for(let x=0;x<m;++x){const w=p[x],E=w.getGDALNoData();c[f][x]=w.getGDALMetadata(0),a[f][x]=E===null?NaN:E;const T=this.sourceInfo_[f].bands;o[f]=T?T.length:w.getSamplesPerPixel();const b=m-(x+1);g||(g=h4(w)),y||(y=d4(w)),v[b]=f4(w,p[0]),_[b]=[w.getTileWidth(),w.getTileHeight()]}if(t?an(t,g,t):t=g,!i)i=y;else{const x=`Origin mismatch for source ${f}, got [${y}] but expected [${i}]`;rf(i,y,0,x,this.viewRejector)}if(!s)s=v,this.resolutionFactors_[f]=1;else{s.length-l>v.length&&(l=s.length-v.length);const x=s[s.length-1]/v[v.length-1];this.resolutionFactors_[f]=x;const w=v.map(T=>T*=x),E=`Resolution mismatch for source ${f}, got [${w}] but expected [${s}]`;rf(s.slice(l,s.length),w,.02,E,this.viewRejector)}r?rf(r.slice(l,r.length),_,0,`Tile size mismatch for source ${f}`,this.viewRejector):r=_,this.sourceImagery_[f]=p.reverse()}for(let f=0,p=this.sourceImagery_.length;f<p;++f){const m=this.sourceImagery_[f];for(;m.length<s.length;)m.unshift(void 0)}if(!this.getProjection()){const f=e[0];for(let p=f.length-1;p>=0;--p){const m=f[p],g=p4(m);if(g){this.projection=g;break}}}this.samplesPerPixel_=o,this.nodataValues_=a,this.metadata_=c;e:for(let f=0;f<u;++f){if(this.sourceInfo_[f].nodata!==void 0){this.addAlpha_=!0;break}const p=a[f],m=this.sourceInfo_[f].bands;if(m){for(let g=0;g<m.length;++g)if(!isNaN(p[m[g]-1])){this.addAlpha_=!0;break e}continue}for(let g=0;g<p.length;++g)if(!isNaN(p[g])){this.addAlpha_=!0;break e}}const h=this.addAlpha_?1:0;this.bandCount=o.reduce((f,p)=>(f+=p,f),0)+h;const d=new Sr({extent:t,minZoom:l,origin:i,resolutions:s,tileSizes:r});this.tileGrid=d,this.setLoader(this.loadTile_.bind(this)),this.setState(Fe.READY),this.viewResolver({projection:this.projection,resolutions:s,center:dr(Ut(t),this.projection),extent:ns(t,this.projection),zoom:0})}loadTile_(e,t,i){const r=pt(this.tileGrid.getTileSize(e)),s=this.sourceImagery_.length,o=new Array(s),a=this.addAlpha_,c=this.bandCount,l=this.samplesPerPixel_,u=this.nodataValues_,h=this.sourceInfo_;for(let g=0;g<s;++g){const y=h[g],_=this.resolutionFactors_[g],v=[Math.round(t*(r[0]*_)),Math.round(i*(r[1]*_)),Math.round((t+1)*(r[0]*_)),Math.round((i+1)*(r[1]*_))],x=this.sourceImagery_[g][e];let w;y.bands&&(w=y.bands.map(function(T){return T-1}));let E;isNaN(y.nodata)?w?E=w.map(function(T){return u[g][T]}):E=u[g]:E=y.nodata,o[g]=x[this.readMethod_]({window:v,width:r[0],height:r[1],samples:w,fillValue:E,pool:u4(),interleave:!1})}const d=r[0]*r[1],f=d*c,p=this.normalize_,m=this.metadata_;return Promise.all(o).then(function(g){let y;p?y=new Uint8Array(f):y=new Float32Array(f);let _=0;for(let v=0;v<d;++v){let x=a;for(let w=0;w<s;++w){const E=h[w];let T=E.min,b=E.max,S,A;if(p){const I=m[w][0];T===void 0&&(I&&TS in I?T=parseFloat(I[TS]):T=y4(g[w][0])),b===void 0&&(I&&ES in I?b=parseFloat(I[ES]):b=_4(g[w][0])),S=255/(b-T),A=-T*S}for(let I=0;I<l[w];++I){const N=g[w][I][v];let M;if(p?M=we(S*N+A,0,255):M=N,!a)y[_]=M;else{let B=E.nodata;if(B===void 0){let O;E.bands?O=E.bands[I]-1:O=I,B=u[w][O]}N!==B&&(x=!1,y[_]=M)}_++}}a&&(x||(y[_]=255),_++)}return y})}}bS.prototype.getView;var x4=bS;const yy={DEFAULT:"default",TRUNCATED:"truncated"};class _y extends ro{constructor(e,t,i,r,s,o,a){super(t,i,r,s,o,a),this.zoomifyImage_=null,this.tileSize_=e}getImage(){if(this.zoomifyImage_)return this.zoomifyImage_;const e=super.getImage();if(this.state==W.LOADED){const t=this.tileSize_;if(e.width==t[0]&&e.height==t[1])return this.zoomifyImage_=e,e;{const i=St(t[0],t[1]);return i.drawImage(e,0,0),this.zoomifyImage_=i.canvas,i.canvas}}else return e}}class v4 extends Ji{constructor(e){const t=e;let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);const r=t.size,s=t.tierSizeCalculation!==void 0?t.tierSizeCalculation:yy.DEFAULT,o=t.tilePixelRatio||1,a=r[0],c=r[1],l=[],u=t.tileSize||co;let h=u*o;switch(s){case yy.DEFAULT:for(;a>h||c>h;)l.push([Math.ceil(a/h),Math.ceil(c/h)]),h+=h;break;case yy.TRUNCATED:let b=a,S=c;for(;b>h||S>h;)l.push([Math.ceil(b/h),Math.ceil(S/h)]),b>>=1,S>>=1;break;default:ce(!1,53);break}l.push([1,1]),l.reverse();const d=[o],f=[0];for(let b=1,S=l.length;b<S;b++)d.push(o<<b),f.push(l[b-1][0]*l[b-1][1]+f[b-1]);d.reverse();const p=new Sr({tileSize:u,extent:t.extent||[0,-c,a,0],resolutions:d});let m=t.url;m&&m.indexOf("{TileGroup}")==-1&&m.indexOf("{tileIndex}")==-1&&(m+="{TileGroup}/{z}-{x}-{y}.jpg");const g=Id(m);let y=u*o;function _(b){return function(S,A,I){if(S){const N=S[0],M=S[1],B=S[2],O=M+B*l[N][0],P=(O+f[N])/y|0,G={z:N,x:M,y:B,tileIndex:O,TileGroup:"TileGroup"+P};return b.replace(/\{(\w+?)\}/g,function(U,D){return G[D]})}else return}}const v=Va(g.map(_)),x=_y.bind(null,pt(u*o));super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,projection:t.projection,tilePixelRatio:o,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:x,tileGrid:p,tileUrlFunction:v,transition:t.transition}),this.zDirection=t.zDirection;const w=p.getTileCoordForCoordAndResolution(Ut(p.getExtent()),d[d.length-1]),E=v(w,1,null),T=new Image;T.addEventListener("error",function(){y=u,this.changed()}.bind(this)),T.src=E}}var w4=v4;function su(n){return n.toLocaleString("en",{maximumFractionDigits:10})}class E4 extends Ji{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);let r=t.url||"";r=r+(r.lastIndexOf("/")===r.length-1||r===""?"":"/");const s=t.version||Pt.VERSION2,o=t.sizes||[],a=t.size;ce(a!=null&&Array.isArray(a)&&a.length==2&&!isNaN(a[0])&&a[0]>0&&!isNaN(a[1])&&a[1]>0,60);const c=a[0],l=a[1],u=t.tileSize,h=t.tilePixelRatio||1,d=t.format||"jpg",f=t.quality||(t.version==Pt.VERSION1?"native":"default");let p=t.resolutions||[];const m=t.supports||[],g=t.extent||[0,-l,c,0],y=o!=null&&Array.isArray(o)&&o.length>0,_=u!==void 0&&(typeof u=="number"&&Number.isInteger(u)&&u>0||Array.isArray(u)&&u.length>0),v=m!=null&&Array.isArray(m)&&(Ge(m,"regionByPx")||Ge(m,"regionByPct"))&&(Ge(m,"sizeByWh")||Ge(m,"sizeByH")||Ge(m,"sizeByW")||Ge(m,"sizeByPct"));let x,w,E;if(p.sort(function(A,I){return I-A}),_||v)if(u!=null&&(typeof u=="number"&&Number.isInteger(u)&&u>0?(x=u,w=u):Array.isArray(u)&&u.length>0&&((u.length==1||u[1]==null&&Number.isInteger(u[0]))&&(x=u[0],w=u[0]),u.length==2&&(Number.isInteger(u[0])&&Number.isInteger(u[1])?(x=u[0],w=u[1]):u[0]==null&&Number.isInteger(u[1])&&(x=u[1],w=u[1])))),(x===void 0||w===void 0)&&(x=co,w=co),p.length==0){E=Math.max(Math.ceil(Math.log(c/x)/Math.LN2),Math.ceil(Math.log(l/w)/Math.LN2));for(let A=E;A>=0;A--)p.push(Math.pow(2,A))}else{const A=Math.max(...p);E=Math.round(Math.log(A)/Math.LN2)}else if(x=c,w=l,p=[],y){o.sort(function(I,N){return I[0]-N[0]}),E=-1;const A=[];for(let I=0;I<o.length;I++){const N=c/o[I][0];if(p.length>0&&p[p.length-1]==N){A.push(I);continue}p.push(N),E++}if(A.length>0)for(let I=0;I<A.length;I++)o.splice(A[I]-I,1)}else p.push(1),o.push([c,l]),E=0;const T=new Sr({tileSize:[x,w],extent:g,origin:si(g),resolutions:p}),b=function(A,I,N){let M,B;const O=A[0];if(O>E)return;const P=A[1],G=A[2],U=p[O];if(!(P===void 0||G===void 0||U===void 0||P<0||Math.ceil(c/U/x)<=P||G<0||Math.ceil(l/U/w)<=G)){if(v||_){const D=P*x*U,k=G*w*U;let $=x*U,F=w*U,te=x,z=w;if(D+$>c&&($=c-D),k+F>l&&(F=l-k),D+x*U>c&&(te=Math.floor((c-D+U-1)/U)),k+w*U>l&&(z=Math.floor((l-k+U-1)/U)),D==0&&$==c&&k==0&&F==l)M="full";else if(!v||Ge(m,"regionByPx"))M=D+","+k+","+$+","+F;else if(Ge(m,"regionByPct")){const X=su(D/c*100),K=su(k/l*100),le=su($/c*100),ae=su(F/l*100);M="pct:"+X+","+K+","+le+","+ae}s==Pt.VERSION3&&(!v||Ge(m,"sizeByWh"))?B=te+","+z:!v||Ge(m,"sizeByW")?B=te+",":Ge(m,"sizeByH")?B=","+z:Ge(m,"sizeByWh")?B=te+","+z:Ge(m,"sizeByPct")&&(B="pct:"+su(100/U))}else if(M="full",y){const D=o[O][0],k=o[O][1];s==Pt.VERSION3?D==c&&k==l?B="max":B=D+","+k:D==c?B="full":B=D+","}else B=s==Pt.VERSION3?"max":"full";return r+M+"/"+B+"/0/"+f+"."+d}},S=_y.bind(null,pt(u||256).map(function(A){return A*h}));super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:t.state,tileClass:S,tileGrid:T,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:b,transition:t.transition}),this.zDirection=t.zDirection}}var T4=E4;const sf={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class SS extends Mt{constructor(e,t){super(e),this.image=t}}class b4 extends Ra{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate),super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:t}),this.on,this.once,this.un,this.resolutions_=e.resolutions!==void 0?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0}getResolutions(){return this.resolutions_}findNearestResolution(e){if(this.resolutions_){const t=bl(this.resolutions_,e,0);e=this.resolutions_[t]}return e}getImage(e,t,i,r){const s=this.getProjection();if(!s||!r||Gn(s,r))return s&&(r=s),this.getImageInternal(e,t,i,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Gn(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&Kn(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Hb(s,r,e,t,i,function(o,a,c){return this.getImageInternal(o,a,c,s)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,i,r){return he()}handleImageChange(e){const t=e.target;let i;switch(t.getState()){case me.LOADING:this.loading=!0,i=sf.IMAGELOADSTART;break;case me.LOADED:this.loading=!1,i=sf.IMAGELOADEND;break;case me.ERROR:this.loading=!1,i=sf.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new SS(i,t))}}function ou(n,e){n.getImage().src=e}var bs=b4;function ir(n,e){const t=[];Object.keys(e).forEach(function(r){e[r]!==null&&e[r]!==void 0&&t.push(r+"="+encodeURIComponent(e[r]))});const i=t.join("&");return n=n.replace(/[?&]$/,""),n=n.indexOf("?")===-1?n+"?":n+"&",n+i}class S4 extends bs{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate),super({attributions:t.attributions,interpolate:i,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:ou,this.params_=t.params||{},this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getParams(){return this.params_}getImageInternal(e,t,i,r){if(this.url_===void 0)return null;t=this.findNearestResolution(t),i=this.hidpi_?i:1;const s=this.image_;if(s&&this.renderedRevision_==this.getRevision()&&s.getResolution()==t&&s.getPixelRatio()==i&&Gt(s.getExtent(),e))return s;const o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};J(o,this.params_),e=e.slice();const a=(e[0]+e[2])/2,c=(e[1]+e[3])/2;if(this.ratio_!=1){const f=this.ratio_*be(e)/2,p=this.ratio_*ot(e)/2;e[0]=a-f,e[1]=c-p,e[2]=a+f,e[3]=c+p}const l=t/i,u=Math.ceil(be(e)/l),h=Math.ceil(ot(e)/l);e[0]=a-l*u/2,e[2]=a+l*u/2,e[1]=c-l*h/2,e[3]=c+l*h/2,this.imageSize_[0]=u,this.imageSize_[1]=h;const d=this.getRequestUrl_(e,this.imageSize_,i,r,o);return this.image_=new la(e,t,i,d,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(ne.CHANGE,this.handleImageChange.bind(this)),this.image_}getImageLoadFunction(){return this.imageLoadFunction_}getRequestUrl_(e,t,i,r,s){const o=r.getCode().split(/:(?=\d+$)/).pop();s.SIZE=t[0]+","+t[1],s.BBOX=e.join(","),s.BBOXSR=o,s.IMAGESR=o,s.DPI=Math.round(90*i);const a=this.url_,c=a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return c==a&&ce(!1,50),ir(c,s)}getUrl(){return this.url_}setImageLoadFunction(e){this.image_=null,this.imageLoadFunction_=e,this.changed()}setUrl(e){e!=this.url_&&(this.url_=e,this.image_=null,this.changed())}updateParams(e){J(this.params_,e),this.image_=null,this.changed()}}var R4=S4;class I4 extends bs{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate),super({attributions:t.attributions,interpolate:i,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.canvasFunction_=t.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getImageInternal(e,t,i,r){t=this.findNearestResolution(t);let s=this.canvas_;if(s&&this.renderedRevision_==this.getRevision()&&s.getResolution()==t&&s.getPixelRatio()==i&&Gt(s.getExtent(),e))return s;e=e.slice(),Cl(e,this.ratio_);const o=be(e)/t,a=ot(e)/t,c=[o*i,a*i],l=this.canvasFunction_.call(this,e,t,i,c,r);return l&&(s=new jl(e,t,i,l)),this.canvas_=s,this.renderedRevision_=this.getRevision(),s}}var C4=I4;class L4 extends bs{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate),super({interpolate:t,projection:e.projection,resolutions:e.resolutions}),this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null,this.displayDpi_=e.displayDpi!==void 0?e.displayDpi:96,this.params_=e.params||{},this.url_=e.url,this.imageLoadFunction_=e.imageLoadFunction!==void 0?e.imageLoadFunction:ou,this.hidpi_=e.hidpi!==void 0?e.hidpi:!0,this.metersPerUnit_=e.metersPerUnit!==void 0?e.metersPerUnit:1,this.ratio_=e.ratio!==void 0?e.ratio:1,this.useOverlay_=e.useOverlay!==void 0?e.useOverlay:!1,this.image_=null,this.renderedRevision_=0}getParams(){return this.params_}getImageInternal(e,t,i,r){t=this.findNearestResolution(t),i=this.hidpi_?i:1;let s=this.image_;if(s&&this.renderedRevision_==this.getRevision()&&s.getResolution()==t&&s.getPixelRatio()==i&&Gt(s.getExtent(),e))return s;this.ratio_!=1&&(e=e.slice(),Cl(e,this.ratio_));const o=be(e)/t,a=ot(e)/t,c=[o*i,a*i];if(this.url_!==void 0){const l=this.getUrl(this.url_,this.params_,e,c,r);s=new la(e,t,i,l,this.crossOrigin_,this.imageLoadFunction_),s.addEventListener(ne.CHANGE,this.handleImageChange.bind(this))}else s=null;return this.image_=s,this.renderedRevision_=this.getRevision(),s}getImageLoadFunction(){return this.imageLoadFunction_}updateParams(e){J(this.params_,e),this.changed()}getUrl(e,t,i,r,s){const o=A4(i,r,this.metersPerUnit_,this.displayDpi_),a=Ut(i),c={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:a[0],SETVIEWCENTERY:a[1]};return J(c,t),ir(e,c)}setImageLoadFunction(e){this.image_=null,this.imageLoadFunction_=e,this.changed()}}function A4(n,e,t,i){const r=be(n),s=ot(n),o=e[0],a=e[1],c=.0254/i;return a*r>o*s?r*t/(o*c):s*t/(a*c)}var P4=L4;class O4 extends bs{constructor(e){const t=e.crossOrigin!==void 0?e.crossOrigin:null,i=e.imageLoadFunction!==void 0?e.imageLoadFunction:ou;let r=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(r=e.interpolate),super({attributions:e.attributions,interpolate:r,projection:re(e.projection)}),this.url_=e.url,this.imageExtent_=e.imageExtent,this.image_=new la(this.imageExtent_,void 0,1,this.url_,t,i),this.imageSize_=e.imageSize?e.imageSize:null,this.image_.addEventListener(ne.CHANGE,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(e,t,i,r){return at(e,this.image_.getExtent())?this.image_:null}getUrl(){return this.url_}handleImageChange(e){if(this.image_.getState()==me.LOADED){const t=this.image_.getExtent(),i=this.image_.getImage();let r,s;this.imageSize_?(r=this.imageSize_[0],s=this.imageSize_[1]):(r=i.width,s=i.height);const o=be(t),a=ot(t),c=o/r,l=a/s;let u=r,h=s;if(c>l?u=Math.round(o/l):h=Math.round(a/c),u!==r||h!==s){const d=St(u,h);this.getInterpolate()||J(d,So);const f=d.canvas;d.drawImage(i,0,0,r,s,0,0,f.width,f.height),this.image_.setImage(f)}}super.handleImageChange(e)}}var M4=O4;const Or="1.3.0";var Mr={CARMENTA_SERVER:"carmentaserver",GEOSERVER:"geoserver",MAPSERVER:"mapserver",QGIS:"qgis"};const Ss=4,RS=[101,101];class F4 extends bs{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate),super({attributions:t.attributions,interpolate:i,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:ou,this.params_=t.params||{},this.v13_=!0,this.updateV13_(),this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getFeatureInfoUrl(e,t,i,r){if(this.url_===void 0)return;const s=re(i),o=this.getProjection();o&&o!==s&&(t=ja(o,s,e,t),e=ts(e,s,o));const a=Hs(e,t,0,RS),c={SERVICE:"WMS",VERSION:Or,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};J(c,this.params_,r);const l=Js((e[0]-a[0])/t,Ss),u=Js((a[3]-e[1])/t,Ss);return c[this.v13_?"I":"X"]=l,c[this.v13_?"J":"Y"]=u,this.getRequestUrl_(a,RS,1,o||s,c)}getLegendUrl(e,t){if(this.url_===void 0)return;const i={SERVICE:"WMS",VERSION:Or,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(t===void 0||t.LAYER===void 0){const r=this.params_.LAYERS;if(!(!Array.isArray(r)||r.length===1))return;i.LAYER=r}if(e!==void 0){const r=this.getProjection()?this.getProjection().getMetersPerUnit():1,s=28e-5;i.SCALE=e*r/s}return J(i,t),ir(this.url_,i)}getParams(){return this.params_}getImageInternal(e,t,i,r){if(this.url_===void 0)return null;t=this.findNearestResolution(t),i!=1&&(!this.hidpi_||this.serverType_===void 0)&&(i=1);const s=t/i,o=Ut(e),a=hr(be(e)/s,Ss),c=hr(ot(e)/s,Ss),l=Hs(o,s,0,[a,c]),u=hr(this.ratio_*be(e)/s,Ss),h=hr(this.ratio_*ot(e)/s,Ss),d=Hs(o,s,0,[u,h]),f=this.image_;if(f&&this.renderedRevision_==this.getRevision()&&f.getResolution()==t&&f.getPixelRatio()==i&&Gt(f.getExtent(),l))return f;const p={SERVICE:"WMS",VERSION:Or,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};J(p,this.params_),this.imageSize_[0]=mp(be(d)/s,Ss),this.imageSize_[1]=mp(ot(d)/s,Ss);const m=this.getRequestUrl_(d,this.imageSize_,i,r,p);return this.image_=new la(d,t,i,m,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(ne.CHANGE,this.handleImageChange.bind(this)),this.image_}getImageLoadFunction(){return this.imageLoadFunction_}getRequestUrl_(e,t,i,r,s){if(ce(this.url_!==void 0,9),s[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(s.STYLES=""),i!=1)switch(this.serverType_){case Mr.GEOSERVER:const c=90*i+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+c:s.FORMAT_OPTIONS="dpi:"+c;break;case Mr.MAPSERVER:s.MAP_RESOLUTION=90*i;break;case Mr.CARMENTA_SERVER:case Mr.QGIS:s.DPI=90*i;break;default:ce(!1,8);break}s.WIDTH=t[0],s.HEIGHT=t[1];const o=r.getAxisOrientation();let a;return this.v13_&&o.substr(0,2)=="ne"?a=[e[1],e[0],e[3],e[2]]:a=e,s.BBOX=a.join(","),ir(this.url_,s)}getUrl(){return this.url_}setImageLoadFunction(e){this.image_=null,this.imageLoadFunction_=e,this.changed()}setUrl(e){e!=this.url_&&(this.url_=e,this.image_=null,this.changed())}updateParams(e){J(this.params_,e),this.updateV13_(),this.image_=null,this.changed()}updateV13_(){const e=this.params_.VERSION||Or;this.v13_=wp(e,"1.3")>=0}}var N4=F4;const k4={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},$4={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function IS(n,e){let t,i;for(let r=0;r<n.length;++r){const s=n[r];if(s.rel==="item"){if(s.type===e){t=s.href;break}(k4[s.type]||!i&&s.type.indexOf("image/")===0)&&(i=s.href)}}if(!t)if(i)t=i;else throw new Error('Could not find "item" link');return t}function CS(n,e,t){let i,r;const s={};for(let o=0;o<n.length;++o){const a=n[o];if(s[a.type]=a.href,a.rel==="item"){if(a.type===e){i=a.href;break}$4[a.type]&&(r=a.href)}}if(!i&&t)for(let o=0;o<t.length;++o){const a=t[o];if(s[a]){i=s[a];break}}if(!i)if(r)i=r;else throw new Error('Could not find "item" link');return i}function LS(n,e,t,i){let r=n.projection;if(!r&&(r=re(e.crs),!r))throw new Error(`Unsupported CRS: ${e.crs}`);const s=r.getAxisOrientation().substr(0,2)!=="en",o=e.tileMatrices,a={};for(let x=0;x<o.length;++x){const w=o[x];a[w.id]=w}const c={},l=[];if(i)for(let x=0;x<i.length;++x){const w=i[x],E=w.tileMatrix;l.push(E),c[E]=w}else for(let x=0;x<o.length;++x){const w=o[x].id;l.push(w)}const u=l.length,h=new Array(u),d=new Array(u),f=new Array(u),p=new Array(u),m=[-1/0,-1/0,1/0,1/0];for(let x=0;x<u;++x){const w=l[x],E=a[w],T=E.pointOfOrigin;s?h[x]=[T[1],T[0]]:h[x]=T,d[x]=E.cellSize,f[x]=[E.matrixWidth,E.matrixHeight],p[x]=[E.tileWidth,E.tileHeight];const b=c[w];if(b){const S=E.cellSize*E.tileWidth,A=h[x][0]+b.minTileCol*S,I=h[x][0]+(b.maxTileCol+1)*S,N=E.cellSize*E.tileHeight,M=E.cornerOfOrigin==="bottomLeft";let B,O;M?(B=h[x][1]+b.minTileRow*N,O=h[x][1]+(b.maxTileRow+1)*N):(B=h[x][1]-(b.maxTileRow+1)*N,O=h[x][1]-b.minTileRow*N),an(m,[A,B,I,O],m)}}const g=new Sr({origins:h,resolutions:d,sizes:f,tileSizes:p,extent:i?m:void 0}),y=n.context,_=n.url;function v(x,w,E){if(!x)return;const T=l[x[0]],b=a[T],S=b.cornerOfOrigin==="bottomLeft",A={tileMatrix:T,tileCol:x[1],tileRow:S?-x[2]-1:x[2]};if(i){const N=c[b.id];if(A.tileCol<N.minTileCol||A.tileCol>N.maxTileCol||A.tileRow<N.minTileRow||A.tileRow>N.maxTileRow)return}J(A,y);const I=t.replace(/\{(\w+?)\}/g,function(N,M){return A[M]});return s0(_,I)}return{grid:g,urlTemplate:t,urlFunction:v}}function D4(n,e){const t=e.tileMatrixSetLimits;let i;if(e.dataType==="map")i=IS(e.links,n.mediaType);else if(e.dataType==="vector")i=CS(e.links,n.mediaType,n.supportedMediaTypes);else throw new Error('Expected tileset data type to be "map" or "vector"');if(e.tileMatrixSet)return LS(n,e.tileMatrixSet,i,t);const r=e.links.find(a=>a.rel==="http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme");if(!r)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");const s=r.href,o=s0(n.url,s);return r0(o).then(function(a){return LS(n,a,i,t)})}function xy(n){return r0(n.url).then(function(e){return D4(n,e)})}class G4 extends Ji{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate),super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:t,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Fe.LOADING,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition});const i={url:e.url,projection:this.getProjection(),mediaType:e.mediaType,context:e.context||null};xy(i).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(e){this.tileGrid=e.grid,this.setTileUrlFunction(e.urlFunction,e.urlTemplate),this.setState(Fe.READY)}handleError_(e){console.error(e),this.setState(Fe.ERROR)}}var U4=G4;class z4 extends Cd{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,format:e.format,overlaps:e.overlaps,projection:e.projection,tileClass:e.tileClass,transition:e.transition,wrapX:e.wrapX,zDirection:e.zDirection,state:Fe.LOADING});const t={url:e.url,projection:this.getProjection(),mediaType:e.mediaType,supportedMediaTypes:e.format.supportedMediaTypes,context:e.context||null};xy(t).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(e){this.tileGrid=e.grid,this.setTileUrlFunction(e.urlFunction,e.urlTemplate),this.setState(Fe.READY)}handleError_(e){console.error(e),this.setState(Fe.ERROR)}}var B4=z4;const vy='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class j4 extends eu{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);let r;t.attributions!==void 0?r=t.attributions:r=[vy];const s=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",o=t.url!==void 0?t.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:r,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:s,interpolate:i,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:o,wrapX:t.wrapX,zDirection:t.zDirection})}}var V4=j4;let AS=!0;try{new ImageData(10,10)}catch{AS=!1}let wy;function PS(n,e,t){if(AS)return new ImageData(n,e,t);wy||(wy=document.createElement("canvas").getContext("2d"));const i=wy.createImageData(e,t);return i.data.set(n),i}function OS(n){let e=!0;try{new ImageData(10,10)}catch{e=!1}function t(i,r,s){return e?new ImageData(i,r,s):{data:i,width:r,height:s}}return function(i){const r=i.buffers,s=i.meta,o=i.imageOps,a=i.width,c=i.height,l=r.length,u=r[0].byteLength;if(o){const p=new Array(l);for(let g=0;g<l;++g)p[g]=t(new Uint8ClampedArray(r[g]),a,c);return n(p,s).data.buffer}const h=new Uint8ClampedArray(u),d=new Array(l),f=new Array(l);for(let p=0;p<l;++p)d[p]=new Uint8ClampedArray(r[p]),f[p]=[0,0,0,0];for(let p=0;p<u;p+=4){for(let g=0;g<l;++g){const y=d[g];f[g][0]=y[p],f[g][1]=y[p+1],f[g][2]=y[p+2],f[g][3]=y[p+3]}const m=n(f,s);h[p]=m[0],h[p+1]=m[1],h[p+2]=m[2],h[p+3]=m[3]}return h.buffer}}function Y4(n,e){const i=Object.keys(n.lib||{}).map(function(s){return"var "+s+" = "+n.lib[s].toString()+";"}).concat(["var __minion__ = ("+OS.toString()+")(",n.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Worker(typeof Blob=="undefined"?"data:text/javascript;base64,"+Buffer.from(i.join(`
|
310
|
+
`),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}function X4(n,e){const t=OS(n.operation);let i=!1;return{postMessage:function(r){setTimeout(function(){i||e({data:{buffer:t(r),meta:r.meta}})},0)},terminate:function(){i=!0}}}class MS extends Us{constructor(e){super(),this._imageOps=!!e.imageOps;let t;e.threads===0?t=0:this._imageOps?t=1:t=e.threads||1;const i=new Array(t);if(t)for(let r=0;r<t;++r)i[r]=Y4(e,this._onWorkerMessage.bind(this,r));else i[0]=X4(e,this._onWorkerMessage.bind(this,0));this._workers=i,this._queue=[],this._maxQueueLength=e.queue||1/0,this._running=0,this._dataLookup={},this._job=null}process(e,t,i){this._enqueue({inputs:e,meta:t,callback:i}),this._dispatch()}_enqueue(e){for(this._queue.push(e);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)}_dispatch(){if(this._running||this._queue.length===0)return;const e=this._queue.shift();this._job=e;const t=e.inputs[0].width,i=e.inputs[0].height,r=e.inputs.map(function(c){return c.data.buffer}),s=this._workers.length;if(this._running=s,s===1){this._workers[0].postMessage({buffers:r,meta:e.meta,imageOps:this._imageOps,width:t,height:i},r);return}const o=e.inputs[0].data.length,a=4*Math.ceil(o/4/s);for(let c=0;c<s;++c){const l=c*a,u=[];for(let h=0,d=r.length;h<d;++h)u.push(r[h].slice(l,l+a));this._workers[c].postMessage({buffers:u,meta:e.meta,imageOps:this._imageOps,width:t,height:i},u)}}_onWorkerMessage(e,t){this.disposed||(this._dataLookup[e]=t.data,--this._running,this._running===0&&this._resolveJob())}_resolveJob(){const e=this._job,t=this._workers.length;let i,r;if(t===1)i=new Uint8ClampedArray(this._dataLookup[0].buffer),r=this._dataLookup[0].meta;else{const s=e.inputs[0].data.length;i=new Uint8ClampedArray(s),r=new Array(t);const o=4*Math.ceil(s/4/t);for(let a=0;a<t;++a){const c=this._dataLookup[a].buffer,l=a*o;i.set(new Uint8ClampedArray(c),l),r[a]=this._dataLookup[a].meta}}this._job=null,this._dataLookup={},e.callback(null,PS(i,e.inputs[0].width,e.inputs[0].height),r),this._dispatch()}disposeInternal(){for(let e=0;e<this._workers.length;++e)this._workers[e].terminate();this._workers.length=0}}const FS={BEFOREOPERATIONS:"beforeoperations",AFTEROPERATIONS:"afteroperations"},NS={PIXEL:"pixel",IMAGE:"image"};class Ey extends Mt{constructor(e,t,i){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=i}}class kS extends bs{constructor(e){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType!==void 0?e.operationType:NS.PIXEL,this.threads_=e.threads!==void 0?e.threads:1,this.layers_=H4(e.sources);const t=this.changed.bind(this);for(let i=0,r=this.layers_.length;i<r;++i)this.layers_[i].addEventListener(ne.CHANGE,t);this.tileQueue_=new gh(function(){return 1},this.changed.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:dt(),declutterTree:null,extent:null,index:0,layerIndex:0,layerStatesArray:W4(this.layers_),pixelRatio:1,pixelToCoordinateTransform:dt(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:se(this),renderTargets:{}},this.setAttributions(function(i){const r=[];for(let s=0,o=e.sources.length;s<o;++s){const a=e.sources[s],l=(a instanceof Ra?a:a.getSource()).getAttributions();if(typeof l=="function"){const u=l(i);r.push.apply(r,u)}}return r.length!==0?r:null}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new MS({operation:e,imageOps:this.operationType_===NS.IMAGE,queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,i){const r=J({},this.frameState_);r.viewState=J({},r.viewState);const s=Ut(e);r.extent=e.slice(),r.size[0]=Math.round(be(e)/t),r.size[1]=Math.round(ot(e)/t),r.time=Date.now();const o=r.viewState;return o.center=s,o.projection=i,o.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let i=0,r=this.layers_.length;i<r;++i)if(t=this.layers_[i].getSource(),t.getState()!==Fe.READY){e=!1;break}return e}getImage(e,t,i,r){if(!this.allSourcesReady_())return null;const s=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=s,this.renderedImageCanvas_){const o=this.renderedImageCanvas_.getResolution(),a=this.renderedImageCanvas_.getExtent();(t!==o||!Kn(e,a))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),s.tileQueue.loadMoreTiles(16,16),s.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){const e=this.requestedFrameState_,t=this.layers_.length,i=new Array(t);for(let s=0;s<t;++s){e.layerIndex=s;const o=Z4(this.layers_[s],e);if(o)i[s]=o;else return}const r={};this.dispatchEvent(new Ey(FS.BEFOREOPERATIONS,e,r)),this.processor_.process(i,r,this.onWorkerComplete_.bind(this,e))}onWorkerComplete_(e,t,i,r){if(t||!i)return;const s=e.extent,o=e.viewState.resolution;if(o!==this.requestedFrameState_.viewState.resolution||!Kn(s,this.requestedFrameState_.extent))return;let a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else{const c=Math.round(be(s)/o),l=Math.round(ot(s)/o);a=St(c,l),this.renderedImageCanvas_=new jl(s,o,1,a.canvas)}a.putImageData(i,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new Ey(FS.AFTEROPERATIONS,e,r)),e.animate&&requestAnimationFrame(this.changed.bind(this))}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}kS.prototype.dispose;let Fo=null;function Z4(n,e){const t=n.getRenderer();if(!t)throw new Error("Unsupported layer type: "+n);if(!t.prepareFrame(e))return null;const i=e.size[0],r=e.size[1];if(i===0||r===0)return null;const s=t.renderFrame(e,null);let o;if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===i&&o.height===r)return o.getContext("2d").getImageData(0,0,i,r)}if(!Fo)Fo=St(i,r);else{const a=Fo.canvas;a.width!==i||a.height!==r?Fo=St(i,r):Fo.clearRect(0,0,i,r)}return Fo.drawImage(o,0,0,i,r),Fo.getImageData(0,0,i,r)}function W4(n){return n.map(function(e){return e.getLayerState()})}function H4(n){const e=n.length,t=new Array(e);for(let i=0;i<e;++i)t[i]=K4(n[i]);return t}function K4(n){let e;return n instanceof Ra?n instanceof Fc?e=new xT({source:n}):n instanceof bs&&(e=new rT({source:n})):e=n,e}var q4=kS;const J4=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',vy],Q4={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},ez={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}};class tz extends eu{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);const i=e.layer.indexOf("-"),r=i==-1?e.layer:e.layer.slice(0,i),s=ez[r],o=Q4[e.layer],a=e.url!==void 0?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;super({attributions:J4,cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:t,maxZoom:e.maxZoom!=null?e.maxZoom:s.maxZoom,minZoom:e.minZoom!=null?e.minZoom:s.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:a,wrapX:e.wrapX,zDirection:e.zDirection})}}var nz=tz;class iz extends Ji{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate),super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.params_=t.params||{},this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=Kt(),this.setKey(this.getKeyForParams_())}getKeyForParams_(){let e=0;const t=[];for(const i in this.params_)t[e++]=i+"-"+this.params_[i];return t.join("/")}getParams(){return this.params_}getRequestUrl_(e,t,i,r,s,o){const a=this.urls;if(!a)return;const c=s.getCode().split(/:(?=\d+$)/).pop();o.SIZE=t[0]+","+t[1],o.BBOX=i.join(","),o.BBOXSR=c,o.IMAGESR=c,o.DPI=Math.round(o.DPI?o.DPI*r:90*r);let l;if(a.length==1)l=a[0];else{const h=oi(Bh(e),a.length);l=a[h]}const u=l.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return ir(u,o)}getTilePixelRatio(e){return this.hidpi_?e:1}updateParams(e){J(this.params_,e),this.setKey(this.getKeyForParams_())}tileUrlFunction(e,t,i){let r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),r.getResolutions().length<=e[0])return;t!=1&&!this.hidpi_&&(t=1);const s=r.getTileCoordExtent(e,this.tmpExtent_);let o=pt(r.getTileSize(e[0]),this.tmpSize);t!=1&&(o=_h(o,t,this.tmpSize));const a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return J(a,this.params_),this.getRequestUrl_(e,o,s,t,i,a)}}var rz=iz;class sz extends eu{constructor(e){const t=e||{};super({opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:t.wrapX!==void 0?t.wrapX:!0,zDirection:t.zDirection,url:t.template||"z:{z} x:{x} y:{y}",tileLoadFunction:(i,r)=>{const s=i.getTileCoord()[0],o=pt(this.tileGrid.getTileSize(s)),a=St(o[0],o[1]);a.strokeStyle="grey",a.strokeRect(.5,.5,o[0]+.5,o[1]+.5),a.fillStyle="grey",a.strokeStyle="white",a.textAlign="center",a.textBaseline="middle",a.font="24px sans-serif",a.lineWidth=4,a.strokeText(r,o[0]/2,o[1]/2,o[0]),a.fillText(r,o[0]/2,o[1]/2,o[0]),i.setImage(a.canvas)}})}}var oz=sz;class az extends Ji{constructor(e){const t=e||{};let i=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(i=t.interpolate);const r=t.params||{},s="TRANSPARENT"in r?r.TRANSPARENT:!0;super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:i,opaque:!s,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0,this.params_=r,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=Kt(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(e,t,i,r){const s=re(i),o=this.getProjection();let a=this.getTileGrid();a||(a=this.getTileGridForProjection(s));const c=a.getZForResolution(t,this.zDirection),l=a.getTileCoordForCoordAndZ(e,c);if(a.getResolutions().length<=l[0])return;let u=a.getResolution(l[0]),h=a.getTileCoordExtent(l,this.tmpExtent_),d=pt(a.getTileSize(l[0]),this.tmpSize);const f=this.gutter_;f!==0&&(d=pg(d,f,this.tmpSize),h=Nn(h,u*f,h)),o&&o!==s&&(u=ja(o,s,e,u),h=ra(h,s,o),e=ts(e,s,o));const p={SERVICE:"WMS",VERSION:Or,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};J(p,this.params_,r);const m=Math.floor((e[0]-h[0])/u),g=Math.floor((h[3]-e[1])/u);return p[this.v13_?"I":"X"]=m,p[this.v13_?"J":"Y"]=g,this.getRequestUrl_(l,d,h,1,o||s,p)}getLegendUrl(e,t){if(this.urls[0]===void 0)return;const i={SERVICE:"WMS",VERSION:Or,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(t===void 0||t.LAYER===void 0){const r=this.params_.LAYERS;if(!(!Array.isArray(r)||r.length===1))return;i.LAYER=r}if(e!==void 0){const r=this.getProjection()?this.getProjection().getMetersPerUnit():1,s=28e-5;i.SCALE=e*r/s}return J(i,t),ir(this.urls[0],i)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(e,t,i,r,s,o){const a=this.urls;if(!a)return;if(o.WIDTH=t[0],o.HEIGHT=t[1],o[this.v13_?"CRS":"SRS"]=s.getCode(),"STYLES"in this.params_||(o.STYLES=""),r!=1)switch(this.serverType_){case Mr.GEOSERVER:const h=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+h:o.FORMAT_OPTIONS="dpi:"+h;break;case Mr.MAPSERVER:o.MAP_RESOLUTION=90*r;break;case Mr.CARMENTA_SERVER:case Mr.QGIS:o.DPI=90*r;break;default:ce(!1,52);break}const c=s.getAxisOrientation(),l=i;if(this.v13_&&c.substr(0,2)=="ne"){let h;h=i[0],l[0]=i[1],l[1]=h,h=i[2],l[2]=i[3],l[3]=h}o.BBOX=l.join(",");let u;if(a.length==1)u=a[0];else{const h=oi(Bh(e),a.length);u=a[h]}return ir(u,o)}getTilePixelRatio(e){return!this.hidpi_||this.serverType_===void 0?1:e}getKeyForParams_(){let e=0;const t=[];for(const i in this.params_)t[e++]=i+"-"+this.params_[i];return t.join("/")}updateParams(e){J(this.params_,e),this.updateV13_(),this.setKey(this.getKeyForParams_())}updateV13_(){const e=this.params_.VERSION||Or;this.v13_=wp(e,"1.3")>=0}tileUrlFunction(e,t,i){let r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),r.getResolutions().length<=e[0])return;t!=1&&(!this.hidpi_||this.serverType_===void 0)&&(t=1);const s=r.getResolution(e[0]);let o=r.getTileCoordExtent(e,this.tmpExtent_),a=pt(r.getTileSize(e[0]),this.tmpSize);const c=this.gutter_;c!==0&&(a=pg(a,c,this.tmpSize),o=Nn(o,s*c,o)),t!=1&&(a=_h(a,t,this.tmpSize));const l={SERVICE:"WMS",VERSION:Or,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return J(l,this.params_),this.getRequestUrl_(e,a,o,t,i,l)}}var lz=az;class $S extends Kr{constructor(e,t,i,r,s,o){super(e,t),this.src_=i,this.extent_=r,this.preemptive_=s,this.grid_=null,this.keys_=null,this.data_=null,this.jsonp_=o}getImage(){return null}getData(e){if(!this.grid_||!this.keys_)return null;const t=(e[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),i=(e[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),r=this.grid_[Math.floor((1-i)*this.grid_.length)];if(typeof r!="string")return null;let s=r.charCodeAt(Math.floor(t*r.length));s>=93&&s--,s>=35&&s--,s-=32;let o=null;if(s in this.keys_){const a=this.keys_[s];this.data_&&a in this.data_?o=this.data_[a]:o=a}return o}forDataAtCoordinate(e,t,i){this.state==W.EMPTY&&i===!0?(this.state=W.IDLE,Bs(this,ne.CHANGE,function(r){t(this.getData(e))},this),this.loadInternal_()):i===!0?setTimeout(function(){t(this.getData(e))}.bind(this),0):t(this.getData(e))}getKey(){return this.src_}handleError_(){this.state=W.ERROR,this.changed()}handleLoad_(e){this.grid_=e.grid,this.keys_=e.keys,this.data_=e.data,this.state=W.LOADED,this.changed()}loadInternal_(){if(this.state==W.IDLE)if(this.state=W.LOADING,this.jsonp_)Nc(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",this.src_),e.send()}}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleError_();return}this.handleLoad_(i)}else this.handleError_()}onXHRError_(e){this.handleError_()}load(){this.preemptive_?this.loadInternal_():this.setState(W.EMPTY)}}class cz extends Fc{constructor(e){if(super({projection:re("EPSG:3857"),state:Fe.LOADING,zDirection:e.zDirection}),this.preemptive_=e.preemptive!==void 0?e.preemptive:!0,this.tileUrlFunction_=fT,this.template_=void 0,this.jsonp_=e.jsonp||!1,e.url)if(this.jsonp_)Nc(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",e.url),t.send()}else e.tileJSON?this.handleTileJSONResponse(e.tileJSON):ce(!1,51)}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(i)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTemplate(){return this.template_}forDataAtCoordinateAndResolution(e,t,i,r){if(this.tileGrid){const s=this.tileGrid.getZForResolution(t,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(e,s);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(e,i,r)}else r===!0?setTimeout(function(){i(null)},0):i(null)}handleTileJSONError(){this.setState(Fe.ERROR)}handleTileJSONResponse(e){const t=re("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const u=qn(t,i);r=Ks(e.bounds,u)}const s=Rr(i),o=e.minzoom||0,a=e.maxzoom||22,c=Io({extent:s,maxZoom:a,minZoom:o});this.tileGrid=c,this.template_=e.template;const l=e.grids;if(!l){this.setState(Fe.ERROR);return}if(this.tileUrlFunction_=Rd(l,c),e.attribution!==void 0){const u=r!==void 0?r:s;this.setAttributions(function(h){return at(u,h.extent)?[e.attribution]:null})}this.setState(Fe.READY)}getTile(e,t,i,r,s){const o=Xi(e,t,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);{const a=[e,t,i],c=this.getTileCoordForTileUrlFunction(a,s),l=this.tileUrlFunction_(c,r,s),u=new $S(a,l!==void 0?W.IDLE:W.EMPTY,l!==void 0?l:"",this.tileGrid.getTileCoordExtent(a),this.preemptive_,this.jsonp_);return this.tileCache.set(o,u),u}}useTile(e,t,i){const r=Xi(e,t,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)}}var uz=cz,Fr={KVP:"KVP",REST:"REST"};class DS extends Sr{constructor(e){super({extent:e.extent,origin:e.origin,origins:e.origins,resolutions:e.resolutions,tileSize:e.tileSize,tileSizes:e.tileSizes,sizes:e.sizes}),this.matrixIds_=e.matrixIds}getMatrixId(e){return this.matrixIds_[e]}getMatrixIds(){return this.matrixIds_}}var hz=DS;function GS(n,e,t){const i=[],r=[],s=[],o=[],a=[],c=t!==void 0?t:[],l="SupportedCRS",u="TileMatrix",h="Identifier",d="ScaleDenominator",f="TopLeftCorner",p="TileWidth",m="TileHeight",g=n[l],y=re(g),_=y.getMetersPerUnit(),v=y.getAxisOrientation().substr(0,2)=="ne";return n[u].sort(function(x,w){return w[d]-x[d]}),n[u].forEach(function(x){let w;if(c.length>0?w=zs(c,function(E){return x[h]==E[u]?!0:x[h].indexOf(":")===-1?n[h]+":"+x[h]===E[u]:!1}):w=!0,w){r.push(x[h]);const E=x[d]*28e-5/_,T=x[p],b=x[m];v?s.push([x[f][1],x[f][0]]):s.push(x[f]),i.push(E),o.push(T==b?T:[T,b]),a.push([x.MatrixWidth,x.MatrixHeight])}}),new DS({extent:e,origins:s,resolutions:i,matrixIds:r,tileSizes:o,sizes:a})}class dz extends Ji{constructor(e){let t=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(t=e.interpolate);const i=e.requestEncoding!==void 0?e.requestEncoding:Fr.KVP,r=e.tileGrid;let s=e.urls;s===void 0&&e.url!==void 0&&(s=Id(e.url)),super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:t,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,urls:s,wrapX:e.wrapX!==void 0?e.wrapX:!1,transition:e.transition,zDirection:e.zDirection}),this.version_=e.version!==void 0?e.version:"1.0.0",this.format_=e.format!==void 0?e.format:"image/jpeg",this.dimensions_=e.dimensions!==void 0?e.dimensions:{},this.layer_=e.layer,this.matrixSet_=e.matrixSet,this.style_=e.style,this.requestEncoding_=i,this.setKey(this.getKeyForDimensions_()),s&&s.length>0&&(this.tileUrlFunction=Va(s.map(this.createFromWMTSTemplate.bind(this))))}setUrls(e){this.urls=e;const t=e.join(`
|
311
|
+
`);this.setTileUrlFunction(Va(e.map(this.createFromWMTSTemplate.bind(this))),t)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){let e=0;const t=[];for(const i in this.dimensions_)t[e++]=i+"-"+this.dimensions_[i];return t.join("/")}updateDimensions(e){J(this.dimensions_,e),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(e){const t=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};t==Fr.KVP&&J(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),e=t==Fr.KVP?ir(e,i):e.replace(/\{(\w+?)\}/g,function(o,a){return a.toLowerCase()in i?i[a.toLowerCase()]:o});const r=this.tileGrid,s=this.dimensions_;return function(o,a,c){if(o){const l={TileMatrix:r.getMatrixId(o[0]),TileCol:o[1],TileRow:o[2]};J(l,s);let u=e;return t==Fr.KVP?u=ir(u,l):u=u.replace(/\{(\w+?)\}/g,function(h,d){return l[d]}),u}else return}}}var fz=dz;function pz(n,e){const t=n.Contents.Layer,i=zs(t,function(N,M,B){return N.Identifier==e.layer});if(i===null)return null;const r=n.Contents.TileMatrixSet;let s;i.TileMatrixSetLink.length>1?"projection"in e?s=Fu(i.TileMatrixSetLink,function(N,M,B){const P=zs(r,function(D){return D.Identifier==N.TileMatrixSet}).SupportedCRS,G=re(P),U=re(e.projection);return G&&U?Gn(G,U):P==e.projection}):s=Fu(i.TileMatrixSetLink,function(N,M,B){return N.TileMatrixSet==e.matrixSet}):s=0,s<0&&(s=0);const o=i.TileMatrixSetLink[s].TileMatrixSet,a=i.TileMatrixSetLink[s].TileMatrixSetLimits;let c=i.Format[0];"format"in e&&(c=e.format),s=Fu(i.Style,function(N,M,B){return"style"in e?N.Title==e.style:N.isDefault}),s<0&&(s=0);const l=i.Style[s].Identifier,u={};"Dimension"in i&&i.Dimension.forEach(function(N,M,B){const O=N.Identifier;let P=N.Default;P===void 0&&(P=N.Value[0]),u[O]=P});const h=n.Contents.TileMatrixSet,d=zs(h,function(N,M,B){return N.Identifier==o});let f;const p=d.SupportedCRS;if(p&&(f=re(p)),"projection"in e){const N=re(e.projection);N&&(!f||Gn(N,f))&&(f=N)}let m=!1;const g=f.getAxisOrientation().substr(0,2)=="ne";let y=d.TileMatrix[0],_={MinTileCol:0,MinTileRow:0,MaxTileCol:y.MatrixWidth-1,MaxTileRow:y.MatrixHeight-1};if(a){_=a[a.length-1];const N=zs(d.TileMatrix,M=>M.Identifier===_.TileMatrix||d.Identifier+":"+M.Identifier===_.TileMatrix);N&&(y=N)}const v=y.ScaleDenominator*28e-5/f.getMetersPerUnit(),x=g?[y.TopLeftCorner[1],y.TopLeftCorner[0]]:y.TopLeftCorner,w=y.TileWidth*v,E=y.TileHeight*v,T=d.BoundingBox;let b=[x[0]+w*_.MinTileCol,x[1]-E*(1+_.MaxTileRow),x[0]+w*(1+_.MaxTileCol),x[1]-E*_.MinTileRow];if(T!==void 0&&!Gt(T,b)){const N=i.WGS84BoundingBox,M=re("EPSG:4326").getExtent();if(b=T,N)m=N[0]===M[0]&&N[2]===M[2];else{const B=ra(T,d.SupportedCRS,"EPSG:4326");m=B[0]-1e-10<=M[0]&&B[2]+1e-10>=M[2]}}const S=GS(d,b,a),A=[];let I=e.requestEncoding;if(I=I!==void 0?I:"","OperationsMetadata"in n&&"GetTile"in n.OperationsMetadata){const N=n.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let M=0,B=N.length;M<B;++M)if(N[M].Constraint){const P=zs(N[M].Constraint,function(G){return G.name=="GetEncoding"}).AllowedValues.Value;if(I===""&&(I=P[0]),I===Fr.KVP)Ge(P,Fr.KVP)&&A.push(N[M].href);else break}else N[M].href&&(I=Fr.KVP,A.push(N[M].href))}return A.length===0&&(I=Fr.REST,i.ResourceURL.forEach(function(N){N.resourceType==="tile"&&(c=N.format,A.push(N.template))})),{urls:A,layer:e.layer,matrixSet:o,format:c,projection:f,requestEncoding:I,tileGrid:S,style:l,dimensions:u,wrapX:m,crossOrigin:e.crossOrigin}}function gz(n,e){const t=new zh(32),i=n.getExtent();return function(r,s){t.expireCache(),i&&(r=an(i,r));const o=n.getZForResolution(s),a=[];return n.forEachTileCoord(r,o,c=>{const l=c.toString();if(!t.containsKey(l)){const u=e(c);t.set(l,u)}a.push(t.get(l))}),a}}class mz{constructor(e){this.first_,this.last_,this.head_,this.circular_=e===void 0?!0:e,this.length_=0}insertItem(e){const t={prev:void 0,next:void 0,data:e},i=this.head_;if(!i)this.first_=t,this.last_=t,this.circular_&&(t.next=t,t.prev=t);else{const r=i.next;t.prev=i,t.next=r,i.next=t,r&&(r.prev=t),i===this.last_&&(this.last_=t)}this.head_=t,this.length_++}removeItem(){const e=this.head_;if(e){const t=e.next,i=e.prev;t&&(t.prev=i),i&&(i.next=t),this.head_=t||i,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===e?this.first_=this.head_:this.last_===e&&(this.last_=i?this.head_.prev:this.head_),this.length_--}}firstItem(){if(this.head_=this.first_,this.head_)return this.head_.data}lastItem(){if(this.head_=this.last_,this.head_)return this.head_.data}nextItem(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data}getNextItem(){if(this.head_&&this.head_.next)return this.head_.next.data}prevItem(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data}getPrevItem(){if(this.head_&&this.head_.prev)return this.head_.prev.data}getCurrItem(){if(this.head_)return this.head_.data}setFirstItem(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)}concat(e){if(e.head_){if(this.head_){const t=this.head_.next;this.head_.next=e.first_,e.first_.prev=this.head_,t.prev=e.last_,e.last_.next=t,this.length_+=e.length_}else this.head_=e.head_,this.first_=e.first_,this.last_=e.last_,this.length_=e.length_;e.head_=void 0,e.first_=void 0,e.last_=void 0,e.length_=0}}getLength(){return this.length_}}var yz=mz;const _z={CIRCLE:"circle",SQUARE:"square",TRIANGLE:"triangle",IMAGE:"image"};function xz(n,e){let t=n.length-e,i=0;do{for(let r=e;r>0;r--)n[i+e]+=n[i],i++;t-=e}while(t>0)}function vz(n,e,t){let i=0,r=n.length;const s=r/t;for(;r>e;){for(let a=e;a>0;--a)n[i+e]+=n[i],++i;r-=e}const o=n.slice();for(let a=0;a<s;++a)for(let c=0;c<t;++c)n[t*a+c]=o[(t-c-1)*s+a]}function wz(n,e,t,i,r,s){if(!e||e===1)return n;for(let c=0;c<r.length;++c){if(r[c]%8!==0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(r[c]!==r[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const o=r[0]/8,a=s===2?1:r.length;for(let c=0;c<i&&!(c*a*t*o>=n.byteLength);++c){let l;if(e===2){switch(r[0]){case 8:l=new Uint8Array(n,c*a*t*o,a*t*o);break;case 16:l=new Uint16Array(n,c*a*t*o,a*t*o/2);break;case 32:l=new Uint32Array(n,c*a*t*o,a*t*o/4);break;default:throw new Error(`Predictor 2 not allowed with ${r[0]} bits per sample.`)}xz(l,a)}else e===3&&(l=new Uint8Array(n,c*a*t*o,a*t*o),vz(l,a,o))}return n}class No{async decode(e,t){const i=await this.decodeBlock(t),r=e.Predictor||1;if(r!==1){const s=!e.StripOffsets,o=s?e.TileWidth:e.ImageWidth,a=s?e.TileLength:e.RowsPerStrip||e.ImageLength;return wz(i,r,o,a,e.BitsPerSample,e.PlanarConfiguration)}return i}}class Ez extends No{decodeBlock(e){return e}}var Tz=Object.freeze(Object.defineProperty({__proto__:null,default:Ez},Symbol.toStringTag,{value:"Module"}));const US=9,Ty=256,by=257,bz=12;function Sz(n,e,t){const i=e%8,r=Math.floor(e/8),s=8-i,o=e+t-(r+1)*8;let a=8*(r+2)-(e+t);const c=(r+2)*8-e;if(a=Math.max(0,a),r>=n.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),by;let l=n[r]&2**(8-i)-1;l<<=t-s;let u=l;if(r+1<n.length){let h=n[r+1]>>>a;h<<=Math.max(0,t-c),u+=h}if(o>8&&r+2<n.length){const h=(r+3)*8-(e+t);u+=n[r+2]>>>h}return u}function Sy(n,e){for(let t=e.length-1;t>=0;t--)n.push(e[t]);return n}function Rz(n){const e=new Uint16Array(4093),t=new Uint8Array(4093);for(let p=0;p<=257;p++)e[p]=4096,t[p]=p;let i=258,r=US,s=0;function o(){i=258,r=US}function a(p){const m=Sz(p,s,r);return s+=r,m}function c(p,m){return t[i]=m,e[i]=p,i++,i-1}function l(p){const m=[];for(let g=p;g!==4096;g=e[g])m.push(t[g]);return m}const u=[];o();const h=new Uint8Array(n);let d=a(h),f;for(;d!==by;){if(d===Ty){for(o(),d=a(h);d===Ty;)d=a(h);if(d===by)break;if(d>Ty)throw new Error(`corrupted code at scanline ${d}`);{const p=l(d);Sy(u,p),f=d}}else if(d<i){const p=l(d);Sy(u,p),c(f,p[p.length-1]),f=d}else{const p=l(f);if(!p)throw new Error(`Bogus entry. Not in dictionary, ${f} / ${i}, position: ${s}`);Sy(u,p),u.push(p[p.length-1]),c(f,p[p.length-1]),f=d}i+1>=2**r&&(r===bz?f=void 0:r++),d=a(h)}return new Uint8Array(u)}class Iz extends No{decodeBlock(e){return Rz(e).buffer}}var Cz=Object.freeze(Object.defineProperty({__proto__:null,default:Iz},Symbol.toStringTag,{value:"Module"}));const au=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),of=4017,af=799,lf=3406,cf=2276,uf=1567,hf=3784,al=5793,df=2896;function zS(n,e){let t=0;const i=[];let r=16;for(;r>0&&!n[r-1];)--r;i.push({children:[],index:0});let s=i[0],o;for(let a=0;a<r;a++){for(let c=0;c<n[a];c++){for(s=i.pop(),s.children[s.index]=e[t];s.index>0;)s=i.pop();for(s.index++,i.push(s);i.length<=a;)i.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;t++}a+1<r&&(i.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return i[0].children}function Lz(n,e,t,i,r,s,o,a,c){const{mcusPerLine:l,progressive:u}=t,h=e;let d=e,f=0,p=0;function m(){if(p>0)return p--,f>>p&1;if(f=n[d++],f===255){const z=n[d++];if(z)throw new Error(`unexpected marker: ${(f<<8|z).toString(16)}`)}return p=7,f>>>7}function g(z){let X=z,K;for(;(K=m())!==null;){if(X=X[K],typeof X=="number")return X;if(typeof X!="object")throw new Error("invalid huffman sequence")}return null}function y(z){let X=z,K=0;for(;X>0;){const le=m();if(le===null)return;K=K<<1|le,--X}return K}function _(z){const X=y(z);return X>=1<<z-1?X:X+(-1<<z)+1}function v(z,X){const K=g(z.huffmanTableDC),le=K===0?0:_(K);z.pred+=le,X[0]=z.pred;let ae=1;for(;ae<64;){const Y=g(z.huffmanTableAC),Pe=Y&15,Oe=Y>>4;if(Pe===0){if(Oe<15)break;ae+=16}else{ae+=Oe;const Se=au[ae];X[Se]=_(Pe),ae++}}}function x(z,X){const K=g(z.huffmanTableDC),le=K===0?0:_(K)<<c;z.pred+=le,X[0]=z.pred}function w(z,X){X[0]|=m()<<c}let E=0;function T(z,X){if(E>0){E--;return}let K=s;const le=o;for(;K<=le;){const ae=g(z.huffmanTableAC),Y=ae&15,Pe=ae>>4;if(Y===0){if(Pe<15){E=y(Pe)+(1<<Pe)-1;break}K+=16}else{K+=Pe;const Oe=au[K];X[Oe]=_(Y)*(1<<c),K++}}}let b=0,S;function A(z,X){let K=s;const le=o;let ae=0;for(;K<=le;){const Y=au[K],Pe=X[Y]<0?-1:1;switch(b){case 0:{const Oe=g(z.huffmanTableAC),Se=Oe&15;if(ae=Oe>>4,Se===0)ae<15?(E=y(ae)+(1<<ae),b=4):(ae=16,b=1);else{if(Se!==1)throw new Error("invalid ACn encoding");S=_(Se),b=ae?2:3}continue}case 1:case 2:X[Y]?X[Y]+=(m()<<c)*Pe:(ae--,ae===0&&(b=b===2?3:0));break;case 3:X[Y]?X[Y]+=(m()<<c)*Pe:(X[Y]=S<<c,b=0);break;case 4:X[Y]&&(X[Y]+=(m()<<c)*Pe);break}K++}b===4&&(E--,E===0&&(b=0))}function I(z,X,K,le,ae){const Y=K/l|0,Pe=K%l,Oe=Y*z.v+le,Se=Pe*z.h+ae;X(z,z.blocks[Oe][Se])}function N(z,X,K){const le=K/z.blocksPerLine|0,ae=K%z.blocksPerLine;X(z,z.blocks[le][ae])}const M=i.length;let B,O,P,G,U,D;u?s===0?D=a===0?x:w:D=a===0?T:A:D=v;let k=0,$,F;M===1?F=i[0].blocksPerLine*i[0].blocksPerColumn:F=l*t.mcusPerColumn;const te=r||F;for(;k<F;){for(O=0;O<M;O++)i[O].pred=0;if(E=0,M===1)for(B=i[0],U=0;U<te;U++)N(B,D,k),k++;else for(U=0;U<te;U++){for(O=0;O<M;O++){B=i[O];const{h:z,v:X}=B;for(P=0;P<X;P++)for(G=0;G<z;G++)I(B,D,k,P,G)}if(k++,k===F)break}if(p=0,$=n[d]<<8|n[d+1],$<65280)throw new Error("marker was not found");if($>=65488&&$<=65495)d+=2;else break}return d-h}function Az(n,e){const t=[],{blocksPerLine:i,blocksPerColumn:r}=e,s=i<<3,o=new Int32Array(64),a=new Uint8Array(64);function c(l,u,h){const d=e.quantizationTable;let f,p,m,g,y,_,v,x,w;const E=h;let T;for(T=0;T<64;T++)E[T]=l[T]*d[T];for(T=0;T<8;++T){const b=8*T;if(E[1+b]===0&&E[2+b]===0&&E[3+b]===0&&E[4+b]===0&&E[5+b]===0&&E[6+b]===0&&E[7+b]===0){w=al*E[0+b]+512>>10,E[0+b]=w,E[1+b]=w,E[2+b]=w,E[3+b]=w,E[4+b]=w,E[5+b]=w,E[6+b]=w,E[7+b]=w;continue}f=al*E[0+b]+128>>8,p=al*E[4+b]+128>>8,m=E[2+b],g=E[6+b],y=df*(E[1+b]-E[7+b])+128>>8,x=df*(E[1+b]+E[7+b])+128>>8,_=E[3+b]<<4,v=E[5+b]<<4,w=f-p+1>>1,f=f+p+1>>1,p=w,w=m*hf+g*uf+128>>8,m=m*uf-g*hf+128>>8,g=w,w=y-v+1>>1,y=y+v+1>>1,v=w,w=x+_+1>>1,_=x-_+1>>1,x=w,w=f-g+1>>1,f=f+g+1>>1,g=w,w=p-m+1>>1,p=p+m+1>>1,m=w,w=y*cf+x*lf+2048>>12,y=y*lf-x*cf+2048>>12,x=w,w=_*af+v*of+2048>>12,_=_*of-v*af+2048>>12,v=w,E[0+b]=f+x,E[7+b]=f-x,E[1+b]=p+v,E[6+b]=p-v,E[2+b]=m+_,E[5+b]=m-_,E[3+b]=g+y,E[4+b]=g-y}for(T=0;T<8;++T){const b=T;if(E[1*8+b]===0&&E[2*8+b]===0&&E[3*8+b]===0&&E[4*8+b]===0&&E[5*8+b]===0&&E[6*8+b]===0&&E[7*8+b]===0){w=al*h[T+0]+8192>>14,E[0*8+b]=w,E[1*8+b]=w,E[2*8+b]=w,E[3*8+b]=w,E[4*8+b]=w,E[5*8+b]=w,E[6*8+b]=w,E[7*8+b]=w;continue}f=al*E[0*8+b]+2048>>12,p=al*E[4*8+b]+2048>>12,m=E[2*8+b],g=E[6*8+b],y=df*(E[1*8+b]-E[7*8+b])+2048>>12,x=df*(E[1*8+b]+E[7*8+b])+2048>>12,_=E[3*8+b],v=E[5*8+b],w=f-p+1>>1,f=f+p+1>>1,p=w,w=m*hf+g*uf+2048>>12,m=m*uf-g*hf+2048>>12,g=w,w=y-v+1>>1,y=y+v+1>>1,v=w,w=x+_+1>>1,_=x-_+1>>1,x=w,w=f-g+1>>1,f=f+g+1>>1,g=w,w=p-m+1>>1,p=p+m+1>>1,m=w,w=y*cf+x*lf+2048>>12,y=y*lf-x*cf+2048>>12,x=w,w=_*af+v*of+2048>>12,_=_*of-v*af+2048>>12,v=w,E[0*8+b]=f+x,E[7*8+b]=f-x,E[1*8+b]=p+v,E[6*8+b]=p-v,E[2*8+b]=m+_,E[5*8+b]=m-_,E[3*8+b]=g+y,E[4*8+b]=g-y}for(T=0;T<64;++T){const b=128+(E[T]+8>>4);b<0?u[T]=0:b>255?u[T]=255:u[T]=b}}for(let l=0;l<r;l++){const u=l<<3;for(let h=0;h<8;h++)t.push(new Uint8Array(s));for(let h=0;h<i;h++){c(e.blocks[l][h],a,o);let d=0;const f=h<<3;for(let p=0;p<8;p++){const m=t[u+p];for(let g=0;g<8;g++)m[f+g]=a[d++]}}}return t}class Pz{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let t=0;function i(){const a=e[t]<<8|e[t+1];return t+=2,a}function r(){const a=i(),c=e.subarray(t,t+a-2);return t+=c.length,c}function s(a){let c=0,l=0,u,h;for(h in a.components)a.components.hasOwnProperty(h)&&(u=a.components[h],c<u.h&&(c=u.h),l<u.v&&(l=u.v));const d=Math.ceil(a.samplesPerLine/8/c),f=Math.ceil(a.scanLines/8/l);for(h in a.components)if(a.components.hasOwnProperty(h)){u=a.components[h];const p=Math.ceil(Math.ceil(a.samplesPerLine/8)*u.h/c),m=Math.ceil(Math.ceil(a.scanLines/8)*u.v/l),g=d*u.h,y=f*u.v,_=[];for(let v=0;v<y;v++){const x=[];for(let w=0;w<g;w++)x.push(new Int32Array(64));_.push(x)}u.blocksPerLine=p,u.blocksPerColumn=m,u.blocks=_}a.maxH=c,a.maxV=l,a.mcusPerLine=d,a.mcusPerColumn=f}let o=i();if(o!==65496)throw new Error("SOI not found");for(o=i();o!==65497;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const a=r();o===65504&&a[0]===74&&a[1]===70&&a[2]===73&&a[3]===70&&a[4]===0&&(this.jfif={version:{major:a[5],minor:a[6]},densityUnits:a[7],xDensity:a[8]<<8|a[9],yDensity:a[10]<<8|a[11],thumbWidth:a[12],thumbHeight:a[13],thumbData:a.subarray(14,14+3*a[12]*a[13])}),o===65518&&a[0]===65&&a[1]===100&&a[2]===111&&a[3]===98&&a[4]===101&&a[5]===0&&(this.adobe={version:a[6],flags0:a[7]<<8|a[8],flags1:a[9]<<8|a[10],transformCode:a[11]});break}case 65499:{const c=i()+t-2;for(;t<c;){const l=e[t++],u=new Int32Array(64);if(l>>4===0)for(let h=0;h<64;h++){const d=au[h];u[d]=e[t++]}else if(l>>4===1)for(let h=0;h<64;h++){const d=au[h];u[d]=i()}else throw new Error("DQT: invalid table spec");this.quantizationTables[l&15]=u}break}case 65472:case 65473:case 65474:{i();const a={extended:o===65473,progressive:o===65474,precision:e[t++],scanLines:i(),samplesPerLine:i(),components:{},componentsOrder:[]},c=e[t++];let l;for(let u=0;u<c;u++){l=e[t];const h=e[t+1]>>4,d=e[t+1]&15,f=e[t+2];a.componentsOrder.push(l),a.components[l]={h,v:d,quantizationIdx:f},t+=3}s(a),this.frames.push(a);break}case 65476:{const a=i();for(let c=2;c<a;){const l=e[t++],u=new Uint8Array(16);let h=0;for(let f=0;f<16;f++,t++)u[f]=e[t],h+=u[f];const d=new Uint8Array(h);for(let f=0;f<h;f++,t++)d[f]=e[t];c+=17+h,l>>4===0?this.huffmanTablesDC[l&15]=zS(u,d):this.huffmanTablesAC[l&15]=zS(u,d)}break}case 65501:i(),this.resetInterval=i();break;case 65498:{i();const a=e[t++],c=[],l=this.frames[0];for(let p=0;p<a;p++){const m=l.components[e[t++]],g=e[t++];m.huffmanTableDC=this.huffmanTablesDC[g>>4],m.huffmanTableAC=this.huffmanTablesAC[g&15],c.push(m)}const u=e[t++],h=e[t++],d=e[t++];t+=Lz(e,t,l,c,this.resetInterval,u,h,d>>4,d&15);break}case 65535:e[t]!==255&&t--;break;default:if(e[t-3]===255&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error(`unknown JPEG marker ${o.toString(16)}`)}o=i()}}getResult(){const{frames:e}=this;if(this.frames.length===0)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let u=0;u<this.frames.length;u++){const h=this.frames[u].components;for(const d of Object.keys(h))h[d].quantizationTable=this.quantizationTables[h[d].quantizationIdx],delete h[d].quantizationIdx}const t=e[0],{components:i,componentsOrder:r}=t,s=[],o=t.samplesPerLine,a=t.scanLines;for(let u=0;u<r.length;u++){const h=i[r[u]];s.push({lines:Az(t,h),scaleX:h.h/t.maxH,scaleY:h.v/t.maxV})}const c=new Uint8Array(o*a*s.length);let l=0;for(let u=0;u<a;++u)for(let h=0;h<o;++h)for(let d=0;d<s.length;++d){const f=s[d];c[l]=f.lines[0|u*f.scaleY][0|h*f.scaleX],++l}return c}}class Oz extends No{constructor(e){super(),this.reader=new Pz,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}var Mz=Object.freeze(Object.defineProperty({__proto__:null,default:Oz},Symbol.toStringTag,{value:"Module"}));/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Fz=4,BS=0,jS=1,Nz=2;function ll(n){let e=n.length;for(;--e>=0;)n[e]=0}const kz=0,VS=1,$z=2,Dz=3,Gz=258,Ry=29,lu=256,cu=lu+1+Ry,cl=30,Iy=19,YS=2*cu+1,ko=15,Cy=16,Uz=7,Ly=256,XS=16,ZS=17,WS=18,Ay=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),ff=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),zz=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),HS=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bz=512,Nr=new Array((cu+2)*2);ll(Nr);const uu=new Array(cl*2);ll(uu);const hu=new Array(Bz);ll(hu);const du=new Array(Gz-Dz+1);ll(du);const Py=new Array(Ry);ll(Py);const pf=new Array(cl);ll(pf);function Oy(n,e,t,i,r){this.static_tree=n,this.extra_bits=e,this.extra_base=t,this.elems=i,this.max_length=r,this.has_stree=n&&n.length}let KS,qS,JS;function My(n,e){this.dyn_tree=n,this.max_code=0,this.stat_desc=e}const QS=n=>n<256?hu[n]:hu[256+(n>>>7)],fu=(n,e)=>{n.pending_buf[n.pending++]=e&255,n.pending_buf[n.pending++]=e>>>8&255},Zn=(n,e,t)=>{n.bi_valid>Cy-t?(n.bi_buf|=e<<n.bi_valid&65535,fu(n,n.bi_buf),n.bi_buf=e>>Cy-n.bi_valid,n.bi_valid+=t-Cy):(n.bi_buf|=e<<n.bi_valid&65535,n.bi_valid+=t)},rr=(n,e,t)=>{Zn(n,t[e*2],t[e*2+1])},eR=(n,e)=>{let t=0;do t|=n&1,n>>>=1,t<<=1;while(--e>0);return t>>>1},jz=n=>{n.bi_valid===16?(fu(n,n.bi_buf),n.bi_buf=0,n.bi_valid=0):n.bi_valid>=8&&(n.pending_buf[n.pending++]=n.bi_buf&255,n.bi_buf>>=8,n.bi_valid-=8)},Vz=(n,e)=>{const t=e.dyn_tree,i=e.max_code,r=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,c=e.stat_desc.max_length;let l,u,h,d,f,p,m=0;for(d=0;d<=ko;d++)n.bl_count[d]=0;for(t[n.heap[n.heap_max]*2+1]=0,l=n.heap_max+1;l<YS;l++)u=n.heap[l],d=t[t[u*2+1]*2+1]+1,d>c&&(d=c,m++),t[u*2+1]=d,!(u>i)&&(n.bl_count[d]++,f=0,u>=a&&(f=o[u-a]),p=t[u*2],n.opt_len+=p*(d+f),s&&(n.static_len+=p*(r[u*2+1]+f)));if(m!==0){do{for(d=c-1;n.bl_count[d]===0;)d--;n.bl_count[d]--,n.bl_count[d+1]+=2,n.bl_count[c]--,m-=2}while(m>0);for(d=c;d!==0;d--)for(u=n.bl_count[d];u!==0;)h=n.heap[--l],!(h>i)&&(t[h*2+1]!==d&&(n.opt_len+=(d-t[h*2+1])*t[h*2],t[h*2+1]=d),u--)}},tR=(n,e,t)=>{const i=new Array(ko+1);let r=0,s,o;for(s=1;s<=ko;s++)i[s]=r=r+t[s-1]<<1;for(o=0;o<=e;o++){let a=n[o*2+1];a!==0&&(n[o*2]=eR(i[a]++,a))}},Yz=()=>{let n,e,t,i,r;const s=new Array(ko+1);for(t=0,i=0;i<Ry-1;i++)for(Py[i]=t,n=0;n<1<<Ay[i];n++)du[t++]=i;for(du[t-1]=i,r=0,i=0;i<16;i++)for(pf[i]=r,n=0;n<1<<ff[i];n++)hu[r++]=i;for(r>>=7;i<cl;i++)for(pf[i]=r<<7,n=0;n<1<<ff[i]-7;n++)hu[256+r++]=i;for(e=0;e<=ko;e++)s[e]=0;for(n=0;n<=143;)Nr[n*2+1]=8,n++,s[8]++;for(;n<=255;)Nr[n*2+1]=9,n++,s[9]++;for(;n<=279;)Nr[n*2+1]=7,n++,s[7]++;for(;n<=287;)Nr[n*2+1]=8,n++,s[8]++;for(tR(Nr,cu+1,s),n=0;n<cl;n++)uu[n*2+1]=5,uu[n*2]=eR(n,5);KS=new Oy(Nr,Ay,lu+1,cu,ko),qS=new Oy(uu,ff,0,cl,ko),JS=new Oy(new Array(0),zz,0,Iy,Uz)},nR=n=>{let e;for(e=0;e<cu;e++)n.dyn_ltree[e*2]=0;for(e=0;e<cl;e++)n.dyn_dtree[e*2]=0;for(e=0;e<Iy;e++)n.bl_tree[e*2]=0;n.dyn_ltree[Ly*2]=1,n.opt_len=n.static_len=0,n.last_lit=n.matches=0},iR=n=>{n.bi_valid>8?fu(n,n.bi_buf):n.bi_valid>0&&(n.pending_buf[n.pending++]=n.bi_buf),n.bi_buf=0,n.bi_valid=0},Xz=(n,e,t,i)=>{iR(n),i&&(fu(n,t),fu(n,~t)),n.pending_buf.set(n.window.subarray(e,e+t),n.pending),n.pending+=t},rR=(n,e,t,i)=>{const r=e*2,s=t*2;return n[r]<n[s]||n[r]===n[s]&&i[e]<=i[t]},Fy=(n,e,t)=>{const i=n.heap[t];let r=t<<1;for(;r<=n.heap_len&&(r<n.heap_len&&rR(e,n.heap[r+1],n.heap[r],n.depth)&&r++,!rR(e,i,n.heap[r],n.depth));)n.heap[t]=n.heap[r],t=r,r<<=1;n.heap[t]=i},sR=(n,e,t)=>{let i,r,s=0,o,a;if(n.last_lit!==0)do i=n.pending_buf[n.d_buf+s*2]<<8|n.pending_buf[n.d_buf+s*2+1],r=n.pending_buf[n.l_buf+s],s++,i===0?rr(n,r,e):(o=du[r],rr(n,o+lu+1,e),a=Ay[o],a!==0&&(r-=Py[o],Zn(n,r,a)),i--,o=QS(i),rr(n,o,t),a=ff[o],a!==0&&(i-=pf[o],Zn(n,i,a)));while(s<n.last_lit);rr(n,Ly,e)},Ny=(n,e)=>{const t=e.dyn_tree,i=e.stat_desc.static_tree,r=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,a,c=-1,l;for(n.heap_len=0,n.heap_max=YS,o=0;o<s;o++)t[o*2]!==0?(n.heap[++n.heap_len]=c=o,n.depth[o]=0):t[o*2+1]=0;for(;n.heap_len<2;)l=n.heap[++n.heap_len]=c<2?++c:0,t[l*2]=1,n.depth[l]=0,n.opt_len--,r&&(n.static_len-=i[l*2+1]);for(e.max_code=c,o=n.heap_len>>1;o>=1;o--)Fy(n,t,o);l=s;do o=n.heap[1],n.heap[1]=n.heap[n.heap_len--],Fy(n,t,1),a=n.heap[1],n.heap[--n.heap_max]=o,n.heap[--n.heap_max]=a,t[l*2]=t[o*2]+t[a*2],n.depth[l]=(n.depth[o]>=n.depth[a]?n.depth[o]:n.depth[a])+1,t[o*2+1]=t[a*2+1]=l,n.heap[1]=l++,Fy(n,t,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],Vz(n,e),tR(t,c,n.bl_count)},oR=(n,e,t)=>{let i,r=-1,s,o=e[0*2+1],a=0,c=7,l=4;for(o===0&&(c=138,l=3),e[(t+1)*2+1]=65535,i=0;i<=t;i++)s=o,o=e[(i+1)*2+1],!(++a<c&&s===o)&&(a<l?n.bl_tree[s*2]+=a:s!==0?(s!==r&&n.bl_tree[s*2]++,n.bl_tree[XS*2]++):a<=10?n.bl_tree[ZS*2]++:n.bl_tree[WS*2]++,a=0,r=s,o===0?(c=138,l=3):s===o?(c=6,l=3):(c=7,l=4))},aR=(n,e,t)=>{let i,r=-1,s,o=e[0*2+1],a=0,c=7,l=4;for(o===0&&(c=138,l=3),i=0;i<=t;i++)if(s=o,o=e[(i+1)*2+1],!(++a<c&&s===o)){if(a<l)do rr(n,s,n.bl_tree);while(--a!==0);else s!==0?(s!==r&&(rr(n,s,n.bl_tree),a--),rr(n,XS,n.bl_tree),Zn(n,a-3,2)):a<=10?(rr(n,ZS,n.bl_tree),Zn(n,a-3,3)):(rr(n,WS,n.bl_tree),Zn(n,a-11,7));a=0,r=s,o===0?(c=138,l=3):s===o?(c=6,l=3):(c=7,l=4)}},Zz=n=>{let e;for(oR(n,n.dyn_ltree,n.l_desc.max_code),oR(n,n.dyn_dtree,n.d_desc.max_code),Ny(n,n.bl_desc),e=Iy-1;e>=3&&n.bl_tree[HS[e]*2+1]===0;e--);return n.opt_len+=3*(e+1)+5+5+4,e},Wz=(n,e,t,i)=>{let r;for(Zn(n,e-257,5),Zn(n,t-1,5),Zn(n,i-4,4),r=0;r<i;r++)Zn(n,n.bl_tree[HS[r]*2+1],3);aR(n,n.dyn_ltree,e-1),aR(n,n.dyn_dtree,t-1)},Hz=n=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&n.dyn_ltree[t*2]!==0)return BS;if(n.dyn_ltree[9*2]!==0||n.dyn_ltree[10*2]!==0||n.dyn_ltree[13*2]!==0)return jS;for(t=32;t<lu;t++)if(n.dyn_ltree[t*2]!==0)return jS;return BS};let lR=!1;const Kz=n=>{lR||(Yz(),lR=!0),n.l_desc=new My(n.dyn_ltree,KS),n.d_desc=new My(n.dyn_dtree,qS),n.bl_desc=new My(n.bl_tree,JS),n.bi_buf=0,n.bi_valid=0,nR(n)},cR=(n,e,t,i)=>{Zn(n,(kz<<1)+(i?1:0),3),Xz(n,e,t,!0)},qz=n=>{Zn(n,VS<<1,3),rr(n,Ly,Nr),jz(n)},Jz=(n,e,t,i)=>{let r,s,o=0;n.level>0?(n.strm.data_type===Nz&&(n.strm.data_type=Hz(n)),Ny(n,n.l_desc),Ny(n,n.d_desc),o=Zz(n),r=n.opt_len+3+7>>>3,s=n.static_len+3+7>>>3,s<=r&&(r=s)):r=s=t+5,t+4<=r&&e!==-1?cR(n,e,t,i):n.strategy===Fz||s===r?(Zn(n,(VS<<1)+(i?1:0),3),sR(n,Nr,uu)):(Zn(n,($z<<1)+(i?1:0),3),Wz(n,n.l_desc.max_code+1,n.d_desc.max_code+1,o+1),sR(n,n.dyn_ltree,n.dyn_dtree)),nR(n),i&&iR(n)},Qz=(n,e,t)=>(n.pending_buf[n.d_buf+n.last_lit*2]=e>>>8&255,n.pending_buf[n.d_buf+n.last_lit*2+1]=e&255,n.pending_buf[n.l_buf+n.last_lit]=t&255,n.last_lit++,e===0?n.dyn_ltree[t*2]++:(n.matches++,e--,n.dyn_ltree[(du[t]+lu+1)*2]++,n.dyn_dtree[QS(e)*2]++),n.last_lit===n.lit_bufsize-1);var eB=Kz,tB=cR,nB=Jz,iB=Qz,rB=qz,sB={_tr_init:eB,_tr_stored_block:tB,_tr_flush_block:nB,_tr_tally:iB,_tr_align:rB};const oB=(n,e,t,i)=>{let r=n&65535|0,s=n>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do r=r+e[i++]|0,s=s+r|0;while(--o);r%=65521,s%=65521}return r|s<<16|0};var pu=oB;const aB=()=>{let n,e=[];for(var t=0;t<256;t++){n=t;for(var i=0;i<8;i++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e},lB=new Uint32Array(aB()),cB=(n,e,t,i)=>{const r=lB,s=i+t;n^=-1;for(let o=i;o<s;o++)n=n>>>8^r[(n^e[o])&255];return n^-1};var Jt=cB,ul={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},gu={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:uB,_tr_stored_block:hB,_tr_flush_block:dB,_tr_tally:Rs,_tr_align:fB}=sB,{Z_NO_FLUSH:$o,Z_PARTIAL_FLUSH:pB,Z_FULL_FLUSH:gB,Z_FINISH:Is,Z_BLOCK:uR,Z_OK:sr,Z_STREAM_END:hR,Z_STREAM_ERROR:fi,Z_DATA_ERROR:mB,Z_BUF_ERROR:ky,Z_DEFAULT_COMPRESSION:yB,Z_FILTERED:_B,Z_HUFFMAN_ONLY:gf,Z_RLE:xB,Z_FIXED:vB,Z_DEFAULT_STRATEGY:wB,Z_UNKNOWN:EB,Z_DEFLATED:mf}=gu,TB=9,bB=15,SB=8,RB=29,IB=256,$y=IB+1+RB,CB=30,LB=19,AB=2*$y+1,PB=15,ze=3,Cs=258,Fi=Cs+ze+1,OB=32,yf=42,Dy=69,_f=73,xf=91,vf=103,Do=113,mu=666,Yt=1,yu=2,Go=3,hl=4,MB=3,Ls=(n,e)=>(n.msg=ul[e],e),dR=n=>(n<<1)-(n>4?9:0),As=n=>{let e=n.length;for(;--e>=0;)n[e]=0};let FB=(n,e,t)=>(e<<n.hash_shift^t)&n.hash_mask,Ps=FB;const Os=n=>{const e=n.state;let t=e.pending;t>n.avail_out&&(t=n.avail_out),t!==0&&(n.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),n.next_out),n.next_out+=t,e.pending_out+=t,n.total_out+=t,n.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},dn=(n,e)=>{dB(n,n.block_start>=0?n.block_start:-1,n.strstart-n.block_start,e),n.block_start=n.strstart,Os(n.strm)},Ke=(n,e)=>{n.pending_buf[n.pending++]=e},_u=(n,e)=>{n.pending_buf[n.pending++]=e>>>8&255,n.pending_buf[n.pending++]=e&255},NB=(n,e,t,i)=>{let r=n.avail_in;return r>i&&(r=i),r===0?0:(n.avail_in-=r,e.set(n.input.subarray(n.next_in,n.next_in+r),t),n.state.wrap===1?n.adler=pu(n.adler,e,r,t):n.state.wrap===2&&(n.adler=Jt(n.adler,e,r,t)),n.next_in+=r,n.total_in+=r,r)},fR=(n,e)=>{let t=n.max_chain_length,i=n.strstart,r,s,o=n.prev_length,a=n.nice_match;const c=n.strstart>n.w_size-Fi?n.strstart-(n.w_size-Fi):0,l=n.window,u=n.w_mask,h=n.prev,d=n.strstart+Cs;let f=l[i+o-1],p=l[i+o];n.prev_length>=n.good_match&&(t>>=2),a>n.lookahead&&(a=n.lookahead);do if(r=e,!(l[r+o]!==p||l[r+o-1]!==f||l[r]!==l[i]||l[++r]!==l[i+1])){i+=2,r++;do;while(l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&l[++i]===l[++r]&&i<d);if(s=Cs-(d-i),i=d-Cs,s>o){if(n.match_start=e,o=s,s>=a)break;f=l[i+o-1],p=l[i+o]}}while((e=h[e&u])>c&&--t!==0);return o<=n.lookahead?o:n.lookahead},Uo=n=>{const e=n.w_size;let t,i,r,s,o;do{if(s=n.window_size-n.lookahead-n.strstart,n.strstart>=e+(e-Fi)){n.window.set(n.window.subarray(e,e+e),0),n.match_start-=e,n.strstart-=e,n.block_start-=e,i=n.hash_size,t=i;do r=n.head[--t],n.head[t]=r>=e?r-e:0;while(--i);i=e,t=i;do r=n.prev[--t],n.prev[t]=r>=e?r-e:0;while(--i);s+=e}if(n.strm.avail_in===0)break;if(i=NB(n.strm,n.window,n.strstart+n.lookahead,s),n.lookahead+=i,n.lookahead+n.insert>=ze)for(o=n.strstart-n.insert,n.ins_h=n.window[o],n.ins_h=Ps(n,n.ins_h,n.window[o+1]);n.insert&&(n.ins_h=Ps(n,n.ins_h,n.window[o+ze-1]),n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++,n.insert--,!(n.lookahead+n.insert<ze)););}while(n.lookahead<Fi&&n.strm.avail_in!==0)},kB=(n,e)=>{let t=65535;for(t>n.pending_buf_size-5&&(t=n.pending_buf_size-5);;){if(n.lookahead<=1){if(Uo(n),n.lookahead===0&&e===$o)return Yt;if(n.lookahead===0)break}n.strstart+=n.lookahead,n.lookahead=0;const i=n.block_start+t;if((n.strstart===0||n.strstart>=i)&&(n.lookahead=n.strstart-i,n.strstart=i,dn(n,!1),n.strm.avail_out===0)||n.strstart-n.block_start>=n.w_size-Fi&&(dn(n,!1),n.strm.avail_out===0))return Yt}return n.insert=0,e===Is?(dn(n,!0),n.strm.avail_out===0?Go:hl):(n.strstart>n.block_start&&(dn(n,!1),n.strm.avail_out===0),Yt)},Gy=(n,e)=>{let t,i;for(;;){if(n.lookahead<Fi){if(Uo(n),n.lookahead<Fi&&e===$o)return Yt;if(n.lookahead===0)break}if(t=0,n.lookahead>=ze&&(n.ins_h=Ps(n,n.ins_h,n.window[n.strstart+ze-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),t!==0&&n.strstart-t<=n.w_size-Fi&&(n.match_length=fR(n,t)),n.match_length>=ze)if(i=Rs(n,n.strstart-n.match_start,n.match_length-ze),n.lookahead-=n.match_length,n.match_length<=n.max_lazy_match&&n.lookahead>=ze){n.match_length--;do n.strstart++,n.ins_h=Ps(n,n.ins_h,n.window[n.strstart+ze-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart;while(--n.match_length!==0);n.strstart++}else n.strstart+=n.match_length,n.match_length=0,n.ins_h=n.window[n.strstart],n.ins_h=Ps(n,n.ins_h,n.window[n.strstart+1]);else i=Rs(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++;if(i&&(dn(n,!1),n.strm.avail_out===0))return Yt}return n.insert=n.strstart<ze-1?n.strstart:ze-1,e===Is?(dn(n,!0),n.strm.avail_out===0?Go:hl):n.last_lit&&(dn(n,!1),n.strm.avail_out===0)?Yt:yu},dl=(n,e)=>{let t,i,r;for(;;){if(n.lookahead<Fi){if(Uo(n),n.lookahead<Fi&&e===$o)return Yt;if(n.lookahead===0)break}if(t=0,n.lookahead>=ze&&(n.ins_h=Ps(n,n.ins_h,n.window[n.strstart+ze-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart),n.prev_length=n.match_length,n.prev_match=n.match_start,n.match_length=ze-1,t!==0&&n.prev_length<n.max_lazy_match&&n.strstart-t<=n.w_size-Fi&&(n.match_length=fR(n,t),n.match_length<=5&&(n.strategy===_B||n.match_length===ze&&n.strstart-n.match_start>4096)&&(n.match_length=ze-1)),n.prev_length>=ze&&n.match_length<=n.prev_length){r=n.strstart+n.lookahead-ze,i=Rs(n,n.strstart-1-n.prev_match,n.prev_length-ze),n.lookahead-=n.prev_length-1,n.prev_length-=2;do++n.strstart<=r&&(n.ins_h=Ps(n,n.ins_h,n.window[n.strstart+ze-1]),t=n.prev[n.strstart&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=n.strstart);while(--n.prev_length!==0);if(n.match_available=0,n.match_length=ze-1,n.strstart++,i&&(dn(n,!1),n.strm.avail_out===0))return Yt}else if(n.match_available){if(i=Rs(n,0,n.window[n.strstart-1]),i&&dn(n,!1),n.strstart++,n.lookahead--,n.strm.avail_out===0)return Yt}else n.match_available=1,n.strstart++,n.lookahead--}return n.match_available&&(i=Rs(n,0,n.window[n.strstart-1]),n.match_available=0),n.insert=n.strstart<ze-1?n.strstart:ze-1,e===Is?(dn(n,!0),n.strm.avail_out===0?Go:hl):n.last_lit&&(dn(n,!1),n.strm.avail_out===0)?Yt:yu},$B=(n,e)=>{let t,i,r,s;const o=n.window;for(;;){if(n.lookahead<=Cs){if(Uo(n),n.lookahead<=Cs&&e===$o)return Yt;if(n.lookahead===0)break}if(n.match_length=0,n.lookahead>=ze&&n.strstart>0&&(r=n.strstart-1,i=o[r],i===o[++r]&&i===o[++r]&&i===o[++r])){s=n.strstart+Cs;do;while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&r<s);n.match_length=Cs-(s-r),n.match_length>n.lookahead&&(n.match_length=n.lookahead)}if(n.match_length>=ze?(t=Rs(n,1,n.match_length-ze),n.lookahead-=n.match_length,n.strstart+=n.match_length,n.match_length=0):(t=Rs(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++),t&&(dn(n,!1),n.strm.avail_out===0))return Yt}return n.insert=0,e===Is?(dn(n,!0),n.strm.avail_out===0?Go:hl):n.last_lit&&(dn(n,!1),n.strm.avail_out===0)?Yt:yu},DB=(n,e)=>{let t;for(;;){if(n.lookahead===0&&(Uo(n),n.lookahead===0)){if(e===$o)return Yt;break}if(n.match_length=0,t=Rs(n,0,n.window[n.strstart]),n.lookahead--,n.strstart++,t&&(dn(n,!1),n.strm.avail_out===0))return Yt}return n.insert=0,e===Is?(dn(n,!0),n.strm.avail_out===0?Go:hl):n.last_lit&&(dn(n,!1),n.strm.avail_out===0)?Yt:yu};function or(n,e,t,i,r){this.good_length=n,this.max_lazy=e,this.nice_length=t,this.max_chain=i,this.func=r}const xu=[new or(0,0,0,0,kB),new or(4,4,8,4,Gy),new or(4,5,16,8,Gy),new or(4,6,32,32,Gy),new or(4,4,16,16,dl),new or(8,16,32,32,dl),new or(8,16,128,128,dl),new or(8,32,128,256,dl),new or(32,128,258,1024,dl),new or(32,258,258,4096,dl)],GB=n=>{n.window_size=2*n.w_size,As(n.head),n.max_lazy_match=xu[n.level].max_lazy,n.good_match=xu[n.level].good_length,n.nice_match=xu[n.level].nice_length,n.max_chain_length=xu[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=ze-1,n.match_available=0,n.ins_h=0};function UB(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mf,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(AB*2),this.dyn_dtree=new Uint16Array((2*CB+1)*2),this.bl_tree=new Uint16Array((2*LB+1)*2),As(this.dyn_ltree),As(this.dyn_dtree),As(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(PB+1),this.heap=new Uint16Array(2*$y+1),As(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*$y+1),As(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const pR=n=>{if(!n||!n.state)return Ls(n,fi);n.total_in=n.total_out=0,n.data_type=EB;const e=n.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?yf:Do,n.adler=e.wrap===2?0:1,e.last_flush=$o,uB(e),sr},gR=n=>{const e=pR(n);return e===sr&&GB(n.state),e},zB=(n,e)=>!n||!n.state||n.state.wrap!==2?fi:(n.state.gzhead=e,sr),mR=(n,e,t,i,r,s)=>{if(!n)return fi;let o=1;if(e===yB&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),r<1||r>TB||t!==mf||i<8||i>15||e<0||e>9||s<0||s>vB)return Ls(n,fi);i===8&&(i=9);const a=new UB;return n.state=a,a.strm=n,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=r+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+ze-1)/ze),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<r+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=e,a.strategy=s,a.method=t,gR(n)},BB=(n,e)=>mR(n,e,mf,bB,SB,wB),jB=(n,e)=>{let t,i;if(!n||!n.state||e>uR||e<0)return n?Ls(n,fi):fi;const r=n.state;if(!n.output||!n.input&&n.avail_in!==0||r.status===mu&&e!==Is)return Ls(n,n.avail_out===0?ky:fi);r.strm=n;const s=r.last_flush;if(r.last_flush=e,r.status===yf)if(r.wrap===2)n.adler=0,Ke(r,31),Ke(r,139),Ke(r,8),r.gzhead?(Ke(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Ke(r,r.gzhead.time&255),Ke(r,r.gzhead.time>>8&255),Ke(r,r.gzhead.time>>16&255),Ke(r,r.gzhead.time>>24&255),Ke(r,r.level===9?2:r.strategy>=gf||r.level<2?4:0),Ke(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Ke(r,r.gzhead.extra.length&255),Ke(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(n.adler=Jt(n.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Dy):(Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,0),Ke(r,r.level===9?2:r.strategy>=gf||r.level<2?4:0),Ke(r,MB),r.status=Do);else{let o=mf+(r.w_bits-8<<4)<<8,a=-1;r.strategy>=gf||r.level<2?a=0:r.level<6?a=1:r.level===6?a=2:a=3,o|=a<<6,r.strstart!==0&&(o|=OB),o+=31-o%31,r.status=Do,_u(r,o),r.strstart!==0&&(_u(r,n.adler>>>16),_u(r,n.adler&65535)),n.adler=1}if(r.status===Dy)if(r.gzhead.extra){for(t=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>t&&(n.adler=Jt(n.adler,r.pending_buf,r.pending-t,t)),Os(n),t=r.pending,r.pending===r.pending_buf_size));)Ke(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>t&&(n.adler=Jt(n.adler,r.pending_buf,r.pending-t,t)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=_f)}else r.status=_f;if(r.status===_f)if(r.gzhead.name){t=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>t&&(n.adler=Jt(n.adler,r.pending_buf,r.pending-t,t)),Os(n),t=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.name.length?i=r.gzhead.name.charCodeAt(r.gzindex++)&255:i=0,Ke(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>t&&(n.adler=Jt(n.adler,r.pending_buf,r.pending-t,t)),i===0&&(r.gzindex=0,r.status=xf)}else r.status=xf;if(r.status===xf)if(r.gzhead.comment){t=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>t&&(n.adler=Jt(n.adler,r.pending_buf,r.pending-t,t)),Os(n),t=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindex<r.gzhead.comment.length?i=r.gzhead.comment.charCodeAt(r.gzindex++)&255:i=0,Ke(r,i)}while(i!==0);r.gzhead.hcrc&&r.pending>t&&(n.adler=Jt(n.adler,r.pending_buf,r.pending-t,t)),i===0&&(r.status=vf)}else r.status=vf;if(r.status===vf&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Os(n),r.pending+2<=r.pending_buf_size&&(Ke(r,n.adler&255),Ke(r,n.adler>>8&255),n.adler=0,r.status=Do)):r.status=Do),r.pending!==0){if(Os(n),n.avail_out===0)return r.last_flush=-1,sr}else if(n.avail_in===0&&dR(e)<=dR(s)&&e!==Is)return Ls(n,ky);if(r.status===mu&&n.avail_in!==0)return Ls(n,ky);if(n.avail_in!==0||r.lookahead!==0||e!==$o&&r.status!==mu){let o=r.strategy===gf?DB(r,e):r.strategy===xB?$B(r,e):xu[r.level].func(r,e);if((o===Go||o===hl)&&(r.status=mu),o===Yt||o===Go)return n.avail_out===0&&(r.last_flush=-1),sr;if(o===yu&&(e===pB?fB(r):e!==uR&&(hB(r,0,0,!1),e===gB&&(As(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Os(n),n.avail_out===0))return r.last_flush=-1,sr}return e!==Is?sr:r.wrap<=0?hR:(r.wrap===2?(Ke(r,n.adler&255),Ke(r,n.adler>>8&255),Ke(r,n.adler>>16&255),Ke(r,n.adler>>24&255),Ke(r,n.total_in&255),Ke(r,n.total_in>>8&255),Ke(r,n.total_in>>16&255),Ke(r,n.total_in>>24&255)):(_u(r,n.adler>>>16),_u(r,n.adler&65535)),Os(n),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?sr:hR)},VB=n=>{if(!n||!n.state)return fi;const e=n.state.status;return e!==yf&&e!==Dy&&e!==_f&&e!==xf&&e!==vf&&e!==Do&&e!==mu?Ls(n,fi):(n.state=null,e===Do?Ls(n,mB):sr)},YB=(n,e)=>{let t=e.length;if(!n||!n.state)return fi;const i=n.state,r=i.wrap;if(r===2||r===1&&i.status!==yf||i.lookahead)return fi;if(r===1&&(n.adler=pu(n.adler,e,t,0)),i.wrap=0,t>=i.w_size){r===0&&(As(i.head),i.strstart=0,i.block_start=0,i.insert=0);let c=new Uint8Array(i.w_size);c.set(e.subarray(t-i.w_size,t),0),e=c,t=i.w_size}const s=n.avail_in,o=n.next_in,a=n.input;for(n.avail_in=t,n.next_in=0,n.input=e,Uo(i);i.lookahead>=ze;){let c=i.strstart,l=i.lookahead-(ze-1);do i.ins_h=Ps(i,i.ins_h,i.window[c+ze-1]),i.prev[c&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=c,c++;while(--l);i.strstart=c,i.lookahead=ze-1,Uo(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ze-1,i.match_available=0,n.next_in=o,n.input=a,n.avail_in=s,i.wrap=r,sr};var XB=BB,ZB=mR,WB=gR,HB=pR,KB=zB,qB=jB,JB=VB,QB=YB,ej="pako deflate (from Nodeca project)",vu={deflateInit:XB,deflateInit2:ZB,deflateReset:WB,deflateResetKeep:HB,deflateSetHeader:KB,deflate:qB,deflateEnd:JB,deflateSetDictionary:QB,deflateInfo:ej};const tj=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var nj=function(n){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(!!t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)tj(t,i)&&(n[i]=t[i])}}return n},ij=n=>{let e=0;for(let i=0,r=n.length;i<r;i++)e+=n[i].length;const t=new Uint8Array(e);for(let i=0,r=0,s=n.length;i<s;i++){let o=n[i];t.set(o,r),r+=o.length}return t},wf={assign:nj,flattenChunks:ij};let yR=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{yR=!1}const wu=new Uint8Array(256);for(let n=0;n<256;n++)wu[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;wu[254]=wu[254]=1;var rj=n=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(n);let e,t,i,r,s,o=n.length,a=0;for(r=0;r<o;r++)t=n.charCodeAt(r),(t&64512)===55296&&r+1<o&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),r++)),a+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(a),s=0,r=0;s<a;r++)t=n.charCodeAt(r),(t&64512)===55296&&r+1<o&&(i=n.charCodeAt(r+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),r++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const sj=(n,e)=>{if(e<65534&&n.subarray&&yR)return String.fromCharCode.apply(null,n.length===e?n:n.subarray(0,e));let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(n[i]);return t};var oj=(n,e)=>{const t=e||n.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(n.subarray(0,e));let i,r;const s=new Array(t*2);for(r=0,i=0;i<t;){let o=n[i++];if(o<128){s[r++]=o;continue}let a=wu[o];if(a>4){s[r++]=65533,i+=a-1;continue}for(o&=a===2?31:a===3?15:7;a>1&&i<t;)o=o<<6|n[i++]&63,a--;if(a>1){s[r++]=65533;continue}o<65536?s[r++]=o:(o-=65536,s[r++]=55296|o>>10&1023,s[r++]=56320|o&1023)}return sj(s,r)},aj=(n,e)=>{e=e||n.length,e>n.length&&(e=n.length);let t=e-1;for(;t>=0&&(n[t]&192)===128;)t--;return t<0||t===0?e:t+wu[n[t]]>e?t:e},Eu={string2buf:rj,buf2string:oj,utf8border:aj};function lj(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var _R=lj;const xR=Object.prototype.toString,{Z_NO_FLUSH:cj,Z_SYNC_FLUSH:uj,Z_FULL_FLUSH:hj,Z_FINISH:dj,Z_OK:Ef,Z_STREAM_END:fj,Z_DEFAULT_COMPRESSION:pj,Z_DEFAULT_STRATEGY:gj,Z_DEFLATED:mj}=gu;function Uy(n){this.options=wf.assign({level:pj,method:mj,chunkSize:16384,windowBits:15,memLevel:8,strategy:gj},n||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _R,this.strm.avail_out=0;let t=vu.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Ef)throw new Error(ul[t]);if(e.header&&vu.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=Eu.string2buf(e.dictionary):xR.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,t=vu.deflateSetDictionary(this.strm,i),t!==Ef)throw new Error(ul[t]);this._dict_set=!0}}Uy.prototype.push=function(n,e){const t=this.strm,i=this.options.chunkSize;let r,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?dj:cj,typeof n=="string"?t.input=Eu.string2buf(n):xR.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(s===uj||s===hj)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(r=vu.deflate(t,s),r===fj)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),r=vu.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Ef;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},Uy.prototype.onData=function(n){this.chunks.push(n)},Uy.prototype.onEnd=function(n){n===Ef&&(this.result=wf.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};const Tf=30,yj=12;var _j=function(e,t){let i,r,s,o,a,c,l,u,h,d,f,p,m,g,y,_,v,x,w,E,T,b,S,A;const I=e.state;i=e.next_in,S=e.input,r=i+(e.avail_in-5),s=e.next_out,A=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),c=I.dmax,l=I.wsize,u=I.whave,h=I.wnext,d=I.window,f=I.hold,p=I.bits,m=I.lencode,g=I.distcode,y=(1<<I.lenbits)-1,_=(1<<I.distbits)-1;e:do{p<15&&(f+=S[i++]<<p,p+=8,f+=S[i++]<<p,p+=8),v=m[f&y];t:for(;;){if(x=v>>>24,f>>>=x,p-=x,x=v>>>16&255,x===0)A[s++]=v&65535;else if(x&16){w=v&65535,x&=15,x&&(p<x&&(f+=S[i++]<<p,p+=8),w+=f&(1<<x)-1,f>>>=x,p-=x),p<15&&(f+=S[i++]<<p,p+=8,f+=S[i++]<<p,p+=8),v=g[f&_];n:for(;;){if(x=v>>>24,f>>>=x,p-=x,x=v>>>16&255,x&16){if(E=v&65535,x&=15,p<x&&(f+=S[i++]<<p,p+=8,p<x&&(f+=S[i++]<<p,p+=8)),E+=f&(1<<x)-1,E>c){e.msg="invalid distance too far back",I.mode=Tf;break e}if(f>>>=x,p-=x,x=s-o,E>x){if(x=E-x,x>u&&I.sane){e.msg="invalid distance too far back",I.mode=Tf;break e}if(T=0,b=d,h===0){if(T+=l-x,x<w){w-=x;do A[s++]=d[T++];while(--x);T=s-E,b=A}}else if(h<x){if(T+=l+h-x,x-=h,x<w){w-=x;do A[s++]=d[T++];while(--x);if(T=0,h<w){x=h,w-=x;do A[s++]=d[T++];while(--x);T=s-E,b=A}}}else if(T+=h-x,x<w){w-=x;do A[s++]=d[T++];while(--x);T=s-E,b=A}for(;w>2;)A[s++]=b[T++],A[s++]=b[T++],A[s++]=b[T++],w-=3;w&&(A[s++]=b[T++],w>1&&(A[s++]=b[T++]))}else{T=s-E;do A[s++]=A[T++],A[s++]=A[T++],A[s++]=A[T++],w-=3;while(w>2);w&&(A[s++]=A[T++],w>1&&(A[s++]=A[T++]))}}else if((x&64)===0){v=g[(v&65535)+(f&(1<<x)-1)];continue n}else{e.msg="invalid distance code",I.mode=Tf;break e}break}}else if((x&64)===0){v=m[(v&65535)+(f&(1<<x)-1)];continue t}else if(x&32){I.mode=yj;break e}else{e.msg="invalid literal/length code",I.mode=Tf;break e}break}}while(i<r&&s<a);w=p>>3,i-=w,p-=w<<3,f&=(1<<p)-1,e.next_in=i,e.next_out=s,e.avail_in=i<r?5+(r-i):5-(i-r),e.avail_out=s<a?257+(a-s):257-(s-a),I.hold=f,I.bits=p};const fl=15,vR=852,wR=592,ER=0,zy=1,TR=2,xj=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),vj=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),wj=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Ej=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Tj=(n,e,t,i,r,s,o,a)=>{const c=a.bits;let l=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,y=0,_=0,v,x,w,E,T,b=null,S=0,A;const I=new Uint16Array(fl+1),N=new Uint16Array(fl+1);let M=null,B=0,O,P,G;for(l=0;l<=fl;l++)I[l]=0;for(u=0;u<i;u++)I[e[t+u]]++;for(f=c,d=fl;d>=1&&I[d]===0;d--);if(f>d&&(f=d),d===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,a.bits=1,0;for(h=1;h<d&&I[h]===0;h++);for(f<h&&(f=h),g=1,l=1;l<=fl;l++)if(g<<=1,g-=I[l],g<0)return-1;if(g>0&&(n===ER||d!==1))return-1;for(N[1]=0,l=1;l<fl;l++)N[l+1]=N[l]+I[l];for(u=0;u<i;u++)e[t+u]!==0&&(o[N[e[t+u]]++]=u);if(n===ER?(b=M=o,A=19):n===zy?(b=xj,S-=257,M=vj,B-=257,A=256):(b=wj,M=Ej,A=-1),_=0,u=0,l=h,T=s,p=f,m=0,w=-1,y=1<<f,E=y-1,n===zy&&y>vR||n===TR&&y>wR)return 1;for(;;){O=l-m,o[u]<A?(P=0,G=o[u]):o[u]>A?(P=M[B+o[u]],G=b[S+o[u]]):(P=32+64,G=0),v=1<<l-m,x=1<<p,h=x;do x-=v,r[T+(_>>m)+x]=O<<24|P<<16|G|0;while(x!==0);for(v=1<<l-1;_&v;)v>>=1;if(v!==0?(_&=v-1,_+=v):_=0,u++,--I[l]===0){if(l===d)break;l=e[t+o[u]]}if(l>f&&(_&E)!==w){for(m===0&&(m=f),T+=h,p=l-m,g=1<<p;p+m<d&&(g-=I[p+m],!(g<=0));)p++,g<<=1;if(y+=1<<p,n===zy&&y>vR||n===TR&&y>wR)return 1;w=_&E,r[w]=f<<24|p<<16|T-s|0}}return _!==0&&(r[T+_]=l-m<<24|64<<16|0),a.bits=f,0};var Tu=Tj;const bj=0,bR=1,SR=2,{Z_FINISH:RR,Z_BLOCK:Sj,Z_TREES:bf,Z_OK:zo,Z_STREAM_END:Rj,Z_NEED_DICT:Ij,Z_STREAM_ERROR:pi,Z_DATA_ERROR:IR,Z_MEM_ERROR:CR,Z_BUF_ERROR:Cj,Z_DEFLATED:LR}=gu,AR=1,PR=2,OR=3,MR=4,FR=5,NR=6,kR=7,$R=8,DR=9,GR=10,Sf=11,kr=12,By=13,UR=14,jy=15,zR=16,BR=17,jR=18,VR=19,Rf=20,If=21,YR=22,XR=23,ZR=24,WR=25,HR=26,Vy=27,KR=28,qR=29,vt=30,JR=31,Lj=32,Aj=852,Pj=592,Oj=15,Mj=Oj,QR=n=>(n>>>24&255)+(n>>>8&65280)+((n&65280)<<8)+((n&255)<<24);function Fj(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const eI=n=>{if(!n||!n.state)return pi;const e=n.state;return n.total_in=n.total_out=e.total=0,n.msg="",e.wrap&&(n.adler=e.wrap&1),e.mode=AR,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Aj),e.distcode=e.distdyn=new Int32Array(Pj),e.sane=1,e.back=-1,zo},tI=n=>{if(!n||!n.state)return pi;const e=n.state;return e.wsize=0,e.whave=0,e.wnext=0,eI(n)},nI=(n,e)=>{let t;if(!n||!n.state)return pi;const i=n.state;return e<0?(t=0,e=-e):(t=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?pi:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,tI(n))},iI=(n,e)=>{if(!n)return pi;const t=new Fj;n.state=t,t.window=null;const i=nI(n,e);return i!==zo&&(n.state=null),i},Nj=n=>iI(n,Mj);let rI=!0,Yy,Xy;const kj=n=>{if(rI){Yy=new Int32Array(512),Xy=new Int32Array(32);let e=0;for(;e<144;)n.lens[e++]=8;for(;e<256;)n.lens[e++]=9;for(;e<280;)n.lens[e++]=7;for(;e<288;)n.lens[e++]=8;for(Tu(bR,n.lens,0,288,Yy,0,n.work,{bits:9}),e=0;e<32;)n.lens[e++]=5;Tu(SR,n.lens,0,32,Xy,0,n.work,{bits:5}),rI=!1}n.lencode=Yy,n.lenbits=9,n.distcode=Xy,n.distbits=5},sI=(n,e,t,i)=>{let r;const s=n.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),s.window.set(e.subarray(t-i,t-i+r),s.wnext),i-=r,i?(s.window.set(e.subarray(t-i,t),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},$j=(n,e)=>{let t,i,r,s,o,a,c,l,u,h,d,f,p,m,g=0,y,_,v,x,w,E,T,b;const S=new Uint8Array(4);let A,I;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!n||!n.state||!n.output||!n.input&&n.avail_in!==0)return pi;t=n.state,t.mode===kr&&(t.mode=By),o=n.next_out,r=n.output,c=n.avail_out,s=n.next_in,i=n.input,a=n.avail_in,l=t.hold,u=t.bits,h=a,d=c,b=zo;e:for(;;)switch(t.mode){case AR:if(t.wrap===0){t.mode=By;break}for(;u<16;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if(t.wrap&2&&l===35615){t.check=0,S[0]=l&255,S[1]=l>>>8&255,t.check=Jt(t.check,S,2,0),l=0,u=0,t.mode=PR;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((l&255)<<8)+(l>>8))%31){n.msg="incorrect header check",t.mode=vt;break}if((l&15)!==LR){n.msg="unknown compression method",t.mode=vt;break}if(l>>>=4,u-=4,T=(l&15)+8,t.wbits===0)t.wbits=T;else if(T>t.wbits){n.msg="invalid window size",t.mode=vt;break}t.dmax=1<<t.wbits,n.adler=t.check=1,t.mode=l&512?GR:kr,l=0,u=0;break;case PR:for(;u<16;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if(t.flags=l,(t.flags&255)!==LR){n.msg="unknown compression method",t.mode=vt;break}if(t.flags&57344){n.msg="unknown header flags set",t.mode=vt;break}t.head&&(t.head.text=l>>8&1),t.flags&512&&(S[0]=l&255,S[1]=l>>>8&255,t.check=Jt(t.check,S,2,0)),l=0,u=0,t.mode=OR;case OR:for(;u<32;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}t.head&&(t.head.time=l),t.flags&512&&(S[0]=l&255,S[1]=l>>>8&255,S[2]=l>>>16&255,S[3]=l>>>24&255,t.check=Jt(t.check,S,4,0)),l=0,u=0,t.mode=MR;case MR:for(;u<16;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}t.head&&(t.head.xflags=l&255,t.head.os=l>>8),t.flags&512&&(S[0]=l&255,S[1]=l>>>8&255,t.check=Jt(t.check,S,2,0)),l=0,u=0,t.mode=FR;case FR:if(t.flags&1024){for(;u<16;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}t.length=l,t.head&&(t.head.extra_len=l),t.flags&512&&(S[0]=l&255,S[1]=l>>>8&255,t.check=Jt(t.check,S,2,0)),l=0,u=0}else t.head&&(t.head.extra=null);t.mode=NR;case NR:if(t.flags&1024&&(f=t.length,f>a&&(f=a),f&&(t.head&&(T=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(s,s+f),T)),t.flags&512&&(t.check=Jt(t.check,i,f,s)),a-=f,s+=f,t.length-=f),t.length))break e;t.length=0,t.mode=kR;case kR:if(t.flags&2048){if(a===0)break e;f=0;do T=i[s+f++],t.head&&T&&t.length<65536&&(t.head.name+=String.fromCharCode(T));while(T&&f<a);if(t.flags&512&&(t.check=Jt(t.check,i,f,s)),a-=f,s+=f,T)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=$R;case $R:if(t.flags&4096){if(a===0)break e;f=0;do T=i[s+f++],t.head&&T&&t.length<65536&&(t.head.comment+=String.fromCharCode(T));while(T&&f<a);if(t.flags&512&&(t.check=Jt(t.check,i,f,s)),a-=f,s+=f,T)break e}else t.head&&(t.head.comment=null);t.mode=DR;case DR:if(t.flags&512){for(;u<16;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if(l!==(t.check&65535)){n.msg="header crc mismatch",t.mode=vt;break}l=0,u=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),n.adler=t.check=0,t.mode=kr;break;case GR:for(;u<32;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}n.adler=t.check=QR(l),l=0,u=0,t.mode=Sf;case Sf:if(t.havedict===0)return n.next_out=o,n.avail_out=c,n.next_in=s,n.avail_in=a,t.hold=l,t.bits=u,Ij;n.adler=t.check=1,t.mode=kr;case kr:if(e===Sj||e===bf)break e;case By:if(t.last){l>>>=u&7,u-=u&7,t.mode=Vy;break}for(;u<3;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}switch(t.last=l&1,l>>>=1,u-=1,l&3){case 0:t.mode=UR;break;case 1:if(kj(t),t.mode=Rf,e===bf){l>>>=2,u-=2;break e}break;case 2:t.mode=BR;break;case 3:n.msg="invalid block type",t.mode=vt}l>>>=2,u-=2;break;case UR:for(l>>>=u&7,u-=u&7;u<32;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if((l&65535)!==(l>>>16^65535)){n.msg="invalid stored block lengths",t.mode=vt;break}if(t.length=l&65535,l=0,u=0,t.mode=jy,e===bf)break e;case jy:t.mode=zR;case zR:if(f=t.length,f){if(f>a&&(f=a),f>c&&(f=c),f===0)break e;r.set(i.subarray(s,s+f),o),a-=f,s+=f,c-=f,o+=f,t.length-=f;break}t.mode=kr;break;case BR:for(;u<14;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if(t.nlen=(l&31)+257,l>>>=5,u-=5,t.ndist=(l&31)+1,l>>>=5,u-=5,t.ncode=(l&15)+4,l>>>=4,u-=4,t.nlen>286||t.ndist>30){n.msg="too many length or distance symbols",t.mode=vt;break}t.have=0,t.mode=jR;case jR:for(;t.have<t.ncode;){for(;u<3;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}t.lens[N[t.have++]]=l&7,l>>>=3,u-=3}for(;t.have<19;)t.lens[N[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,A={bits:t.lenbits},b=Tu(bj,t.lens,0,19,t.lencode,0,t.work,A),t.lenbits=A.bits,b){n.msg="invalid code lengths set",t.mode=vt;break}t.have=0,t.mode=VR;case VR:for(;t.have<t.nlen+t.ndist;){for(;g=t.lencode[l&(1<<t.lenbits)-1],y=g>>>24,_=g>>>16&255,v=g&65535,!(y<=u);){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if(v<16)l>>>=y,u-=y,t.lens[t.have++]=v;else{if(v===16){for(I=y+2;u<I;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if(l>>>=y,u-=y,t.have===0){n.msg="invalid bit length repeat",t.mode=vt;break}T=t.lens[t.have-1],f=3+(l&3),l>>>=2,u-=2}else if(v===17){for(I=y+3;u<I;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}l>>>=y,u-=y,T=0,f=3+(l&7),l>>>=3,u-=3}else{for(I=y+7;u<I;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}l>>>=y,u-=y,T=0,f=11+(l&127),l>>>=7,u-=7}if(t.have+f>t.nlen+t.ndist){n.msg="invalid bit length repeat",t.mode=vt;break}for(;f--;)t.lens[t.have++]=T}}if(t.mode===vt)break;if(t.lens[256]===0){n.msg="invalid code -- missing end-of-block",t.mode=vt;break}if(t.lenbits=9,A={bits:t.lenbits},b=Tu(bR,t.lens,0,t.nlen,t.lencode,0,t.work,A),t.lenbits=A.bits,b){n.msg="invalid literal/lengths set",t.mode=vt;break}if(t.distbits=6,t.distcode=t.distdyn,A={bits:t.distbits},b=Tu(SR,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,A),t.distbits=A.bits,b){n.msg="invalid distances set",t.mode=vt;break}if(t.mode=Rf,e===bf)break e;case Rf:t.mode=If;case If:if(a>=6&&c>=258){n.next_out=o,n.avail_out=c,n.next_in=s,n.avail_in=a,t.hold=l,t.bits=u,_j(n,d),o=n.next_out,r=n.output,c=n.avail_out,s=n.next_in,i=n.input,a=n.avail_in,l=t.hold,u=t.bits,t.mode===kr&&(t.back=-1);break}for(t.back=0;g=t.lencode[l&(1<<t.lenbits)-1],y=g>>>24,_=g>>>16&255,v=g&65535,!(y<=u);){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if(_&&(_&240)===0){for(x=y,w=_,E=v;g=t.lencode[E+((l&(1<<x+w)-1)>>x)],y=g>>>24,_=g>>>16&255,v=g&65535,!(x+y<=u);){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}l>>>=x,u-=x,t.back+=x}if(l>>>=y,u-=y,t.back+=y,t.length=v,_===0){t.mode=HR;break}if(_&32){t.back=-1,t.mode=kr;break}if(_&64){n.msg="invalid literal/length code",t.mode=vt;break}t.extra=_&15,t.mode=YR;case YR:if(t.extra){for(I=t.extra;u<I;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}t.length+=l&(1<<t.extra)-1,l>>>=t.extra,u-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=XR;case XR:for(;g=t.distcode[l&(1<<t.distbits)-1],y=g>>>24,_=g>>>16&255,v=g&65535,!(y<=u);){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if((_&240)===0){for(x=y,w=_,E=v;g=t.distcode[E+((l&(1<<x+w)-1)>>x)],y=g>>>24,_=g>>>16&255,v=g&65535,!(x+y<=u);){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}l>>>=x,u-=x,t.back+=x}if(l>>>=y,u-=y,t.back+=y,_&64){n.msg="invalid distance code",t.mode=vt;break}t.offset=v,t.extra=_&15,t.mode=ZR;case ZR:if(t.extra){for(I=t.extra;u<I;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}t.offset+=l&(1<<t.extra)-1,l>>>=t.extra,u-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){n.msg="invalid distance too far back",t.mode=vt;break}t.mode=WR;case WR:if(c===0)break e;if(f=d-c,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){n.msg="invalid distance too far back",t.mode=vt;break}f>t.wnext?(f-=t.wnext,p=t.wsize-f):p=t.wnext-f,f>t.length&&(f=t.length),m=t.window}else m=r,p=o-t.offset,f=t.length;f>c&&(f=c),c-=f,t.length-=f;do r[o++]=m[p++];while(--f);t.length===0&&(t.mode=If);break;case HR:if(c===0)break e;r[o++]=t.length,c--,t.mode=If;break;case Vy:if(t.wrap){for(;u<32;){if(a===0)break e;a--,l|=i[s++]<<u,u+=8}if(d-=c,n.total_out+=d,t.total+=d,d&&(n.adler=t.check=t.flags?Jt(t.check,r,d,o-d):pu(t.check,r,d,o-d)),d=c,(t.flags?l:QR(l))!==t.check){n.msg="incorrect data check",t.mode=vt;break}l=0,u=0}t.mode=KR;case KR:if(t.wrap&&t.flags){for(;u<32;){if(a===0)break e;a--,l+=i[s++]<<u,u+=8}if(l!==(t.total&4294967295)){n.msg="incorrect length check",t.mode=vt;break}l=0,u=0}t.mode=qR;case qR:b=Rj;break e;case vt:b=IR;break e;case JR:return CR;case Lj:default:return pi}return n.next_out=o,n.avail_out=c,n.next_in=s,n.avail_in=a,t.hold=l,t.bits=u,(t.wsize||d!==n.avail_out&&t.mode<vt&&(t.mode<Vy||e!==RR))&&sI(n,n.output,n.next_out,d-n.avail_out),h-=n.avail_in,d-=n.avail_out,n.total_in+=h,n.total_out+=d,t.total+=d,t.wrap&&d&&(n.adler=t.check=t.flags?Jt(t.check,r,d,n.next_out-d):pu(t.check,r,d,n.next_out-d)),n.data_type=t.bits+(t.last?64:0)+(t.mode===kr?128:0)+(t.mode===Rf||t.mode===jy?256:0),(h===0&&d===0||e===RR)&&b===zo&&(b=Cj),b},Dj=n=>{if(!n||!n.state)return pi;let e=n.state;return e.window&&(e.window=null),n.state=null,zo},Gj=(n,e)=>{if(!n||!n.state)return pi;const t=n.state;return(t.wrap&2)===0?pi:(t.head=e,e.done=!1,zo)},Uj=(n,e)=>{const t=e.length;let i,r,s;return!n||!n.state||(i=n.state,i.wrap!==0&&i.mode!==Sf)?pi:i.mode===Sf&&(r=1,r=pu(r,e,t,0),r!==i.check)?IR:(s=sI(n,e,t,t),s?(i.mode=JR,CR):(i.havedict=1,zo))};var zj=tI,Bj=nI,jj=eI,Vj=Nj,Yj=iI,Xj=$j,Zj=Dj,Wj=Gj,Hj=Uj,Kj="pako inflate (from Nodeca project)",$r={inflateReset:zj,inflateReset2:Bj,inflateResetKeep:jj,inflateInit:Vj,inflateInit2:Yj,inflate:Xj,inflateEnd:Zj,inflateGetHeader:Wj,inflateSetDictionary:Hj,inflateInfo:Kj};function qj(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Jj=qj;const oI=Object.prototype.toString,{Z_NO_FLUSH:Qj,Z_FINISH:e8,Z_OK:bu,Z_STREAM_END:Zy,Z_NEED_DICT:Wy,Z_STREAM_ERROR:t8,Z_DATA_ERROR:aI,Z_MEM_ERROR:n8}=gu;function Su(n){this.options=wf.assign({chunkSize:1024*64,windowBits:15,to:""},n||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(n&&n.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _R,this.strm.avail_out=0;let t=$r.inflateInit2(this.strm,e.windowBits);if(t!==bu)throw new Error(ul[t]);if(this.header=new Jj,$r.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Eu.string2buf(e.dictionary):oI.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=$r.inflateSetDictionary(this.strm,e.dictionary),t!==bu)))throw new Error(ul[t])}Su.prototype.push=function(n,e){const t=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?e8:Qj,oI.call(n)==="[object ArrayBuffer]"?t.input=new Uint8Array(n):t.input=n,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),s=$r.inflate(t,o),s===Wy&&r&&(s=$r.inflateSetDictionary(t,r),s===bu?s=$r.inflate(t,o):s===aI&&(s=Wy));t.avail_in>0&&s===Zy&&t.state.wrap>0&&n[t.next_in]!==0;)$r.inflateReset(t),s=$r.inflate(t,o);switch(s){case t8:case aI:case Wy:case n8:return this.onEnd(s),this.ended=!0,!1}if(a=t.avail_out,t.next_out&&(t.avail_out===0||s===Zy))if(this.options.to==="string"){let c=Eu.utf8border(t.output,t.next_out),l=t.next_out-c,u=Eu.buf2string(t.output,c);t.next_out=l,t.avail_out=i-l,l&&t.output.set(t.output.subarray(c,c+l),0),this.onData(u)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===bu&&a===0)){if(s===Zy)return s=$r.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},Su.prototype.onData=function(n){this.chunks.push(n)},Su.prototype.onEnd=function(n){n===bu&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=wf.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg};function Hy(n,e){const t=new Su(e);if(t.push(n),t.err)throw t.msg||ul[t.err];return t.result}function i8(n,e){return e=e||{},e.raw=!0,Hy(n,e)}var r8=Su,s8=Hy,o8=i8,a8=Hy,l8=gu,c8={Inflate:r8,inflate:s8,inflateRaw:o8,ungzip:a8,constants:l8};const{Inflate:F8,inflate:u8,inflateRaw:N8,ungzip:k8}=c8;var lI=u8;class h8 extends No{decodeBlock(e){return lI(new Uint8Array(e)).buffer}}var d8=Object.freeze(Object.defineProperty({__proto__:null,default:h8},Symbol.toStringTag,{value:"Module"}));class f8 extends No{decodeBlock(e){const t=new DataView(e),i=[];for(let r=0;r<e.byteLength;++r){let s=t.getInt8(r);if(s<0){const o=t.getUint8(r+1);s=-s;for(let a=0;a<=s;++a)i.push(o);r+=1}else{for(let o=0;o<=s;++o)i.push(t.getUint8(r+o+1));r+=s+1}}return new Uint8Array(i).buffer}}var p8=Object.freeze(Object.defineProperty({__proto__:null,default:f8},Symbol.toStringTag,{value:"Module"})),cI={exports:{}};(function(n){/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var s={};s.defaultNoDataValue=-34027999387901484e22,s.decode=function(h,d){d=d||{};var f=d.encodedMaskData||d.encodedMaskData===null,p=l(h,d.inputOffset||0,f),m=d.noDataValue!==null?d.noDataValue:s.defaultNoDataValue,g=o(p,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),y={width:p.width,height:p.height,pixelData:g.resultPixels,minValue:g.minValue,maxValue:p.pixels.maxValue,noDataValue:m};return g.resultMask&&(y.maskData=g.resultMask),d.returnEncodedMask&&p.mask&&(y.encodedMaskData=p.mask.bitset?p.mask.bitset:null),d.returnFileInfo&&(y.fileInfo=a(p),d.computeUsedBitDepths&&(y.fileInfo.bitDepths=c(p))),y};var o=function(h,d,f,p,m){var g=0,y=h.pixels.numBlocksX,_=h.pixels.numBlocksY,v=Math.floor(h.width/y),x=Math.floor(h.height/_),w=2*h.maxZError,E=Number.MAX_VALUE,T;f=f||(h.mask?h.mask.bitset:null);var b,S;b=new d(h.width*h.height),m&&f&&(S=new Uint8Array(h.width*h.height));for(var A=new Float32Array(v*x),I,N,M=0;M<=_;M++){var B=M!==_?x:h.height%_;if(B!==0)for(var O=0;O<=y;O++){var P=O!==y?v:h.width%y;if(P!==0){var G=M*h.width*x+O*v,U=h.width-P,D=h.pixels.blocks[g],k,$,F;D.encoding<2?(D.encoding===0?k=D.rawData:(u(D.stuffedData,D.bitsPerPixel,D.numValidPixels,D.offset,w,A,h.pixels.maxValue),k=A),$=0):D.encoding===2?F=0:F=D.offset;var te;if(f)for(N=0;N<B;N++){for(G&7&&(te=f[G>>3],te<<=G&7),I=0;I<P;I++)G&7||(te=f[G>>3]),te&128?(S&&(S[G]=1),T=D.encoding<2?k[$++]:F,E=E>T?T:E,b[G++]=T):(S&&(S[G]=0),b[G++]=p),te<<=1;G+=U}else if(D.encoding<2)for(N=0;N<B;N++){for(I=0;I<P;I++)T=k[$++],E=E>T?T:E,b[G++]=T;G+=U}else for(E=E>F?F:E,N=0;N<B;N++){for(I=0;I<P;I++)b[G++]=F;G+=U}if(D.encoding===1&&$!==D.numValidPixels)throw"Block and Mask do not match";g++}}}return{resultPixels:b,resultMask:S,minValue:E}},a=function(h){return{fileIdentifierString:h.fileIdentifierString,fileVersion:h.fileVersion,imageType:h.imageType,height:h.height,width:h.width,maxZError:h.maxZError,eofOffset:h.eofOffset,mask:h.mask?{numBlocksX:h.mask.numBlocksX,numBlocksY:h.mask.numBlocksY,numBytes:h.mask.numBytes,maxValue:h.mask.maxValue}:null,pixels:{numBlocksX:h.pixels.numBlocksX,numBlocksY:h.pixels.numBlocksY,numBytes:h.pixels.numBytes,maxValue:h.pixels.maxValue,noDataValue:h.noDataValue}}},c=function(h){for(var d=h.pixels.numBlocksX*h.pixels.numBlocksY,f={},p=0;p<d;p++){var m=h.pixels.blocks[p];m.encoding===0?f.float32=!0:m.encoding===1?f[m.bitsPerPixel]=!0:f[0]=!0}return Object.keys(f)},l=function(h,d,f){var p={},m=new Uint8Array(h,d,10);if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+p.fileIdentifierString;d+=10;var g=new DataView(h,d,24);if(p.fileVersion=g.getInt32(0,!0),p.imageType=g.getInt32(4,!0),p.height=g.getUint32(8,!0),p.width=g.getUint32(12,!0),p.maxZError=g.getFloat64(16,!0),d+=24,!f)if(g=new DataView(h,d,16),p.mask={},p.mask.numBlocksY=g.getUint32(0,!0),p.mask.numBlocksX=g.getUint32(4,!0),p.mask.numBytes=g.getUint32(8,!0),p.mask.maxValue=g.getFloat32(12,!0),d+=16,p.mask.numBytes>0){var y=new Uint8Array(Math.ceil(p.width*p.height/8));g=new DataView(h,d,p.mask.numBytes);var _=g.getInt16(0,!0),v=2,x=0;do{if(_>0)for(;_--;)y[x++]=g.getUint8(v++);else{var w=g.getUint8(v++);for(_=-_;_--;)y[x++]=w}_=g.getInt16(v,!0),v+=2}while(v<p.mask.numBytes);if(_!==-32768||x<y.length)throw"Unexpected end of mask RLE encoding";p.mask.bitset=y,d+=p.mask.numBytes}else(p.mask.numBytes|p.mask.numBlocksY|p.mask.maxValue)===0&&(p.mask.bitset=new Uint8Array(Math.ceil(p.width*p.height/8)));g=new DataView(h,d,16),p.pixels={},p.pixels.numBlocksY=g.getUint32(0,!0),p.pixels.numBlocksX=g.getUint32(4,!0),p.pixels.numBytes=g.getUint32(8,!0),p.pixels.maxValue=g.getFloat32(12,!0),d+=16;var E=p.pixels.numBlocksX,T=p.pixels.numBlocksY,b=E+(p.width%E>0?1:0),S=T+(p.height%T>0?1:0);p.pixels.blocks=new Array(b*S);for(var A=0,I=0;I<S;I++)for(var N=0;N<b;N++){var M=0,B=h.byteLength-d;g=new DataView(h,d,Math.min(10,B));var O={};p.pixels.blocks[A++]=O;var P=g.getUint8(0);if(M++,O.encoding=P&63,O.encoding>3)throw"Invalid block encoding ("+O.encoding+")";if(O.encoding===2){d++;continue}if(P!==0&&P!==2){if(P>>=6,O.offsetType=P,P===2)O.offset=g.getInt8(1),M++;else if(P===1)O.offset=g.getInt16(1,!0),M+=2;else if(P===0)O.offset=g.getFloat32(1,!0),M+=4;else throw"Invalid block offset type";if(O.encoding===1)if(P=g.getUint8(M),M++,O.bitsPerPixel=P&63,P>>=6,O.numValidPixelsType=P,P===2)O.numValidPixels=g.getUint8(M),M++;else if(P===1)O.numValidPixels=g.getUint16(M,!0),M+=2;else if(P===0)O.numValidPixels=g.getUint32(M,!0),M+=4;else throw"Invalid valid pixel count type"}if(d+=M,O.encoding!==3){var G,U;if(O.encoding===0){var D=(p.pixels.numBytes-1)/4;if(D!==Math.floor(D))throw"uncompressed block has invalid length";G=new ArrayBuffer(D*4),U=new Uint8Array(G),U.set(new Uint8Array(h,d,D*4));var k=new Float32Array(G);O.rawData=k,d+=D*4}else if(O.encoding===1){var $=Math.ceil(O.numValidPixels*O.bitsPerPixel/8),F=Math.ceil($/4);G=new ArrayBuffer(F*4),U=new Uint8Array(G),U.set(new Uint8Array(h,d,$)),O.stuffedData=new Uint32Array(G),d+=$}}}return p.eofOffset=d,p},u=function(h,d,f,p,m,g,y){var _=(1<<d)-1,v=0,x,w=0,E,T,b=Math.ceil((y-p)/m),S=h.length*4-Math.ceil(d*f/8);for(h[h.length-1]<<=8*S,x=0;x<f;x++){if(w===0&&(T=h[v++],w=32),w>=d)E=T>>>w-d&_,w-=d;else{var A=d-w;E=(T&_)<<A&_,T=h[v++],w=32-A,E+=T>>>w}g[x]=E<b?p+E*m:y}return g};return s}(),t=function(){var s={unstuff:function(l,u,h,d,f,p,m,g){var y=(1<<h)-1,_=0,v,x=0,w,E,T,b,S=l.length*4-Math.ceil(h*d/8);if(l[l.length-1]<<=8*S,f)for(v=0;v<d;v++)x===0&&(E=l[_++],x=32),x>=h?(w=E>>>x-h&y,x-=h):(T=h-x,w=(E&y)<<T&y,E=l[_++],x=32-T,w+=E>>>x),u[v]=f[w];else for(b=Math.ceil((g-p)/m),v=0;v<d;v++)x===0&&(E=l[_++],x=32),x>=h?(w=E>>>x-h&y,x-=h):(T=h-x,w=(E&y)<<T&y,E=l[_++],x=32-T,w+=E>>>x),u[v]=w<b?p+w*m:g},unstuffLUT:function(l,u,h,d,f,p){var m=(1<<u)-1,g=0,y=0,_=0,v=0,x=0,w,E=[],T=l.length*4-Math.ceil(u*h/8);l[l.length-1]<<=8*T;var b=Math.ceil((p-d)/f);for(y=0;y<h;y++)v===0&&(w=l[g++],v=32),v>=u?(x=w>>>v-u&m,v-=u):(_=u-v,x=(w&m)<<_&m,w=l[g++],v=32-_,x+=w>>>v),E[y]=x<b?d+x*f:p;return E.unshift(d),E},unstuff2:function(l,u,h,d,f,p,m,g){var y=(1<<h)-1,_=0,v,x=0,w=0,E,T,b;if(f)for(v=0;v<d;v++)x===0&&(T=l[_++],x=32,w=0),x>=h?(E=T>>>w&y,x-=h,w+=h):(b=h-x,E=T>>>w&y,T=l[_++],x=32-b,E|=(T&(1<<b)-1)<<h-b,w=b),u[v]=f[E];else{var S=Math.ceil((g-p)/m);for(v=0;v<d;v++)x===0&&(T=l[_++],x=32,w=0),x>=h?(E=T>>>w&y,x-=h,w+=h):(b=h-x,E=T>>>w&y,T=l[_++],x=32-b,E|=(T&(1<<b)-1)<<h-b,w=b),u[v]=E<S?p+E*m:g}return u},unstuffLUT2:function(l,u,h,d,f,p){var m=(1<<u)-1,g=0,y=0,_=0,v=0,x=0,w=0,E,T=[],b=Math.ceil((p-d)/f);for(y=0;y<h;y++)v===0&&(E=l[g++],v=32,w=0),v>=u?(x=E>>>w&m,v-=u,w+=u):(_=u-v,x=E>>>w&m,E=l[g++],v=32-_,x|=(E&(1<<_)-1)<<u-_,w=_),T[y]=x<b?d+x*f:p;return T.unshift(d),T},originalUnstuff:function(l,u,h,d){var f=(1<<h)-1,p=0,m,g=0,y,_,v,x=l.length*4-Math.ceil(h*d/8);for(l[l.length-1]<<=8*x,m=0;m<d;m++)g===0&&(_=l[p++],g=32),g>=h?(y=_>>>g-h&f,g-=h):(v=h-g,y=(_&f)<<v&f,_=l[p++],g=32-v,y+=_>>>g),u[m]=y;return u},originalUnstuff2:function(l,u,h,d){var f=(1<<h)-1,p=0,m,g=0,y=0,_,v,x;for(m=0;m<d;m++)g===0&&(v=l[p++],g=32,y=0),g>=h?(_=v>>>y&f,g-=h,y+=h):(x=h-g,_=v>>>y&f,v=l[p++],g=32-x,_|=(v&(1<<x)-1)<<h-x,y=x),u[m]=_;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(l){for(var u=65535,h=65535,d=l.length,f=Math.floor(d/2),p=0;f;){var m=f>=359?359:f;f-=m;do u+=l[p++]<<8,h+=u+=l[p++];while(--m);u=(u&65535)+(u>>>16),h=(h&65535)+(h>>>16)}return d&1&&(h+=u+=l[p]<<8),u=(u&65535)+(u>>>16),h=(h&65535)+(h>>>16),(h<<16|u)>>>0},readHeaderInfo:function(l,u){var h=u.ptr,d=new Uint8Array(l,h,6),f={};if(f.fileIdentifierString=String.fromCharCode.apply(null,d),f.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+f.fileIdentifierString;h+=6;var p=new DataView(l,h,8),m=p.getInt32(0,!0);f.fileVersion=m,h+=4,m>=3&&(f.checksum=p.getUint32(4,!0),h+=4),p=new DataView(l,h,12),f.height=p.getUint32(0,!0),f.width=p.getUint32(4,!0),h+=8,m>=4?(f.numDims=p.getUint32(8,!0),h+=4):f.numDims=1,p=new DataView(l,h,40),f.numValidPixel=p.getUint32(0,!0),f.microBlockSize=p.getInt32(4,!0),f.blobSize=p.getInt32(8,!0),f.imageType=p.getInt32(12,!0),f.maxZError=p.getFloat64(16,!0),f.zMin=p.getFloat64(24,!0),f.zMax=p.getFloat64(32,!0),h+=40,u.headerInfo=f,u.ptr=h;var g,y;if(m>=3&&(y=m>=4?52:48,g=this.computeChecksumFletcher32(new Uint8Array(l,h-y,f.blobSize-14)),g!==f.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(l,u){var h=u.headerInfo,d=this.getDataTypeArray(h.imageType),f=h.numDims*this.getDataTypeSize(h.imageType),p=this.readSubArray(l,u.ptr,d,f),m=this.readSubArray(l,u.ptr+f,d,f);u.ptr+=2*f;var g,y=!0;for(g=0;g<h.numDims;g++)if(p[g]!==m[g]){y=!1;break}return h.minValues=p,h.maxValues=m,y},readSubArray:function(l,u,h,d){var f;if(h===Uint8Array)f=new Uint8Array(l,u,d);else{var p=new ArrayBuffer(d),m=new Uint8Array(p);m.set(new Uint8Array(l,u,d)),f=new h(p)}return f},readMask:function(l,u){var h=u.ptr,d=u.headerInfo,f=d.width*d.height,p=d.numValidPixel,m=new DataView(l,h,4),g={};if(g.numBytes=m.getUint32(0,!0),h+=4,(p===0||f===p)&&g.numBytes!==0)throw"invalid mask";var y,_;if(p===0)y=new Uint8Array(Math.ceil(f/8)),g.bitset=y,_=new Uint8Array(f),u.pixels.resultMask=_,h+=g.numBytes;else if(g.numBytes>0){y=new Uint8Array(Math.ceil(f/8)),m=new DataView(l,h,g.numBytes);var v=m.getInt16(0,!0),x=2,w=0,E=0;do{if(v>0)for(;v--;)y[w++]=m.getUint8(x++);else for(E=m.getUint8(x++),v=-v;v--;)y[w++]=E;v=m.getInt16(x,!0),x+=2}while(x<g.numBytes);if(v!==-32768||w<y.length)throw"Unexpected end of mask RLE encoding";_=new Uint8Array(f);var T=0,b=0;for(b=0;b<f;b++)b&7?(T=y[b>>3],T<<=b&7):T=y[b>>3],T&128&&(_[b]=1);u.pixels.resultMask=_,g.bitset=y,h+=g.numBytes}return u.ptr=h,u.mask=g,!0},readDataOneSweep:function(l,u,h,d){var f=u.ptr,p=u.headerInfo,m=p.numDims,g=p.width*p.height,y=p.imageType,_=p.numValidPixel*o.getDataTypeSize(y)*m,v,x=u.pixels.resultMask;if(h===Uint8Array)v=new Uint8Array(l,f,_);else{var w=new ArrayBuffer(_),E=new Uint8Array(w);E.set(new Uint8Array(l,f,_)),v=new h(w)}if(v.length===g*m)d?u.pixels.resultPixels=o.swapDimensionOrder(v,g,m,h,!0):u.pixels.resultPixels=v;else{u.pixels.resultPixels=new h(g*m);var T=0,b=0,S=0,A=0;if(m>1){if(d){for(b=0;b<g;b++)if(x[b])for(A=b,S=0;S<m;S++,A+=g)u.pixels.resultPixels[A]=v[T++]}else for(b=0;b<g;b++)if(x[b])for(A=b*m,S=0;S<m;S++)u.pixels.resultPixels[A+S]=v[T++]}else for(b=0;b<g;b++)x[b]&&(u.pixels.resultPixels[b]=v[T++])}return f+=_,u.ptr=f,!0},readHuffmanTree:function(l,u){var h=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(l,u.ptr,16);u.ptr+=16;var f=d.getInt32(0,!0);if(f<2)throw"unsupported Huffman version";var p=d.getInt32(4,!0),m=d.getInt32(8,!0),g=d.getInt32(12,!0);if(m>=g)return!1;var y=new Uint32Array(g-m);o.decodeBits(l,u,y);var _=[],v,x,w,E;for(v=m;v<g;v++)x=v-(v<p?0:p),_[x]={first:y[v-m],second:null};var T=l.byteLength-u.ptr,b=Math.ceil(T/4),S=new ArrayBuffer(b*4),A=new Uint8Array(S);A.set(new Uint8Array(l,u.ptr,T));var I=new Uint32Array(S),N=0,M,B=0;for(M=I[0],v=m;v<g;v++)x=v-(v<p?0:p),E=_[x].first,E>0&&(_[x].second=M<<N>>>32-E,32-N>=E?(N+=E,N===32&&(N=0,B++,M=I[B])):(N+=E-32,B++,M=I[B],_[x].second|=M>>>32-N));var O=0,P=0,G=new a;for(v=0;v<_.length;v++)_[v]!==void 0&&(O=Math.max(O,_[v].first));O>=h?P=h:P=O;var U=[],D,k,$,F,te,z;for(v=m;v<g;v++)if(x=v-(v<p?0:p),E=_[x].first,E>0)if(D=[E,x],E<=P)for(k=_[x].second<<P-E,$=1<<P-E,w=0;w<$;w++)U[k|w]=D;else for(k=_[x].second,z=G,F=E-1;F>=0;F--)te=k>>>F&1,te?(z.right||(z.right=new a),z=z.right):(z.left||(z.left=new a),z=z.left),F===0&&!z.val&&(z.val=D[1]);return{decodeLut:U,numBitsLUTQick:P,numBitsLUT:O,tree:G,stuffedData:I,srcPtr:B,bitPos:N}},readHuffman:function(l,u,h,d){var f=u.headerInfo,p=f.numDims,m=u.headerInfo.height,g=u.headerInfo.width,y=g*m,_=this.readHuffmanTree(l,u),v=_.decodeLut,x=_.tree,w=_.stuffedData,E=_.srcPtr,T=_.bitPos,b=_.numBitsLUTQick,S=_.numBitsLUT,A=u.headerInfo.imageType===0?128:0,I,N,M,B=u.pixels.resultMask,O,P,G,U,D,k,$,F=0;T>0&&(E++,T=0);var te=w[E],z=u.encodeMode===1,X=new h(y*p),K=X,le;if(p<2||z){for(le=0;le<p;le++)if(p>1&&(K=new h(X.buffer,y*le,y),F=0),u.headerInfo.numValidPixel===g*m)for(k=0,U=0;U<m;U++)for(D=0;D<g;D++,k++){if(N=0,O=te<<T>>>32-b,P=O,32-T<b&&(O|=w[E+1]>>>64-T-b,P=O),v[P])N=v[P][1],T+=v[P][0];else for(O=te<<T>>>32-S,P=O,32-T<S&&(O|=w[E+1]>>>64-T-S,P=O),I=x,$=0;$<S;$++)if(G=O>>>S-$-1&1,I=G?I.right:I.left,!(I.left||I.right)){N=I.val,T=T+$+1;break}T>=32&&(T-=32,E++,te=w[E]),M=N-A,z?(D>0?M+=F:U>0?M+=K[k-g]:M+=F,M&=255,K[k]=M,F=M):K[k]=M}else for(k=0,U=0;U<m;U++)for(D=0;D<g;D++,k++)if(B[k]){if(N=0,O=te<<T>>>32-b,P=O,32-T<b&&(O|=w[E+1]>>>64-T-b,P=O),v[P])N=v[P][1],T+=v[P][0];else for(O=te<<T>>>32-S,P=O,32-T<S&&(O|=w[E+1]>>>64-T-S,P=O),I=x,$=0;$<S;$++)if(G=O>>>S-$-1&1,I=G?I.right:I.left,!(I.left||I.right)){N=I.val,T=T+$+1;break}T>=32&&(T-=32,E++,te=w[E]),M=N-A,z?(D>0&&B[k-1]?M+=F:U>0&&B[k-g]?M+=K[k-g]:M+=F,M&=255,K[k]=M,F=M):K[k]=M}}else for(k=0,U=0;U<m;U++)for(D=0;D<g;D++)if(k=U*g+D,!B||B[k])for(le=0;le<p;le++,k+=y){if(N=0,O=te<<T>>>32-b,P=O,32-T<b&&(O|=w[E+1]>>>64-T-b,P=O),v[P])N=v[P][1],T+=v[P][0];else for(O=te<<T>>>32-S,P=O,32-T<S&&(O|=w[E+1]>>>64-T-S,P=O),I=x,$=0;$<S;$++)if(G=O>>>S-$-1&1,I=G?I.right:I.left,!(I.left||I.right)){N=I.val,T=T+$+1;break}T>=32&&(T-=32,E++,te=w[E]),M=N-A,K[k]=M}u.ptr=u.ptr+(E+1)*4+(T>0?4:0),u.pixels.resultPixels=X,p>1&&!d&&(u.pixels.resultPixels=o.swapDimensionOrder(X,y,p,h))},decodeBits:function(l,u,h,d,f){{var p=u.headerInfo,m=p.fileVersion,g=0,y=l.byteLength-u.ptr>=5?5:l.byteLength-u.ptr,_=new DataView(l,u.ptr,y),v=_.getUint8(0);g++;var x=v>>6,w=x===0?4:3-x,E=(v&32)>0,T=v&31,b=0;if(w===1)b=_.getUint8(g),g++;else if(w===2)b=_.getUint16(g,!0),g+=2;else if(w===4)b=_.getUint32(g,!0),g+=4;else throw"Invalid valid pixel count type";var S=2*p.maxZError,A,I,N,M,B,O,P,G,U,D=p.numDims>1?p.maxValues[f]:p.zMax;if(E){for(u.counter.lut++,G=_.getUint8(g),g++,M=Math.ceil((G-1)*T/8),B=Math.ceil(M/4),I=new ArrayBuffer(B*4),N=new Uint8Array(I),u.ptr+=g,N.set(new Uint8Array(l,u.ptr,M)),P=new Uint32Array(I),u.ptr+=M,U=0;G-1>>>U;)U++;M=Math.ceil(b*U/8),B=Math.ceil(M/4),I=new ArrayBuffer(B*4),N=new Uint8Array(I),N.set(new Uint8Array(l,u.ptr,M)),A=new Uint32Array(I),u.ptr+=M,m>=3?O=s.unstuffLUT2(P,T,G-1,d,S,D):O=s.unstuffLUT(P,T,G-1,d,S,D),m>=3?s.unstuff2(A,h,U,b,O):s.unstuff(A,h,U,b,O)}else u.counter.bitstuffer++,U=T,u.ptr+=g,U>0&&(M=Math.ceil(b*U/8),B=Math.ceil(M/4),I=new ArrayBuffer(B*4),N=new Uint8Array(I),N.set(new Uint8Array(l,u.ptr,M)),A=new Uint32Array(I),u.ptr+=M,m>=3?d==null?s.originalUnstuff2(A,h,U,b):s.unstuff2(A,h,U,b,!1,d,S,D):d==null?s.originalUnstuff(A,h,U,b):s.unstuff(A,h,U,b,!1,d,S,D))}},readTiles:function(l,u,h,d){var f=u.headerInfo,p=f.width,m=f.height,g=p*m,y=f.microBlockSize,_=f.imageType,v=o.getDataTypeSize(_),x=Math.ceil(p/y),w=Math.ceil(m/y);u.pixels.numBlocksY=w,u.pixels.numBlocksX=x,u.pixels.ptr=0;var E=0,T=0,b=0,S=0,A=0,I=0,N=0,M=0,B=0,O=0,P=0,G=0,U=0,D=0,k=0,$=0,F,te,z,X,K,le,ae=new h(y*y),Y=m%y||y,Pe=p%y||y,Oe,Se,mt=f.numDims,De,Be=u.pixels.resultMask,nt=u.pixels.resultPixels,Qt=f.fileVersion,en=Qt>=5?14:15,ee,tn=f.zMax,nn;for(b=0;b<w;b++)for(A=b!==w-1?y:Y,S=0;S<x;S++)for(I=S!==x-1?y:Pe,P=b*p*y+S*y,G=p-I,De=0;De<mt;De++){if(mt>1?(nn=nt,P=b*p*y+S*y,nt=new h(u.pixels.resultPixels.buffer,g*De*v,g),tn=f.maxValues[De]):nn=null,N=l.byteLength-u.ptr,F=new DataView(l,u.ptr,Math.min(10,N)),te={},$=0,M=F.getUint8(0),$++,ee=f.fileVersion>=5?M&4:0,B=M>>6&255,O=M>>2&en,O!==(S*y>>3&en)||ee&&De===0)throw"integrity issue";if(le=M&3,le>3)throw u.ptr+=$,"Invalid block encoding ("+le+")";if(le===2){if(ee)if(Be)for(E=0;E<A;E++)for(T=0;T<I;T++)Be[P]&&(nt[P]=nn[P]),P++;else for(E=0;E<A;E++)for(T=0;T<I;T++)nt[P]=nn[P],P++;u.counter.constant++,u.ptr+=$;continue}else if(le===0){if(ee)throw"integrity issue";if(u.counter.uncompressed++,u.ptr+=$,U=A*I*v,D=l.byteLength-u.ptr,U=U<D?U:D,z=new ArrayBuffer(U%v===0?U:U+v-U%v),X=new Uint8Array(z),X.set(new Uint8Array(l,u.ptr,U)),K=new h(z),k=0,Be)for(E=0;E<A;E++){for(T=0;T<I;T++)Be[P]&&(nt[P]=K[k++]),P++;P+=G}else for(E=0;E<A;E++){for(T=0;T<I;T++)nt[P++]=K[k++];P+=G}u.ptr+=k*v}else if(Oe=o.getDataTypeUsed(ee&&_<6?4:_,B),Se=o.getOnePixel(te,$,Oe,F),$+=o.getDataTypeSize(Oe),le===3)if(u.ptr+=$,u.counter.constantoffset++,Be)for(E=0;E<A;E++){for(T=0;T<I;T++)Be[P]&&(nt[P]=ee?Math.min(tn,nn[P]+Se):Se),P++;P+=G}else for(E=0;E<A;E++){for(T=0;T<I;T++)nt[P]=ee?Math.min(tn,nn[P]+Se):Se,P++;P+=G}else if(u.ptr+=$,o.decodeBits(l,u,ae,Se,De),$=0,ee)if(Be)for(E=0;E<A;E++){for(T=0;T<I;T++)Be[P]&&(nt[P]=ae[$++]+nn[P]),P++;P+=G}else for(E=0;E<A;E++){for(T=0;T<I;T++)nt[P]=ae[$++]+nn[P],P++;P+=G}else if(Be)for(E=0;E<A;E++){for(T=0;T<I;T++)Be[P]&&(nt[P]=ae[$++]),P++;P+=G}else for(E=0;E<A;E++){for(T=0;T<I;T++)nt[P++]=ae[$++];P+=G}}mt>1&&!d&&(u.pixels.resultPixels=o.swapDimensionOrder(u.pixels.resultPixels,g,mt,h))},formatFileInfo:function(l){return{fileIdentifierString:l.headerInfo.fileIdentifierString,fileVersion:l.headerInfo.fileVersion,imageType:l.headerInfo.imageType,height:l.headerInfo.height,width:l.headerInfo.width,numValidPixel:l.headerInfo.numValidPixel,microBlockSize:l.headerInfo.microBlockSize,blobSize:l.headerInfo.blobSize,maxZError:l.headerInfo.maxZError,pixelType:o.getPixelType(l.headerInfo.imageType),eofOffset:l.eofOffset,mask:l.mask?{numBytes:l.mask.numBytes}:null,pixels:{numBlocksX:l.pixels.numBlocksX,numBlocksY:l.pixels.numBlocksY,maxValue:l.headerInfo.zMax,minValue:l.headerInfo.zMin,noDataValue:l.noDataValue}}},constructConstantSurface:function(l,u){var h=l.headerInfo.zMax,d=l.headerInfo.zMin,f=l.headerInfo.maxValues,p=l.headerInfo.numDims,m=l.headerInfo.height*l.headerInfo.width,g=0,y=0,_=0,v=l.pixels.resultMask,x=l.pixels.resultPixels;if(v)if(p>1){if(u)for(g=0;g<p;g++)for(_=g*m,h=f[g],y=0;y<m;y++)v[y]&&(x[_+y]=h);else for(y=0;y<m;y++)if(v[y])for(_=y*p,g=0;g<p;g++)x[_+p]=f[g]}else for(y=0;y<m;y++)v[y]&&(x[y]=h);else if(p>1&&d!==h)if(u)for(g=0;g<p;g++)for(_=g*m,h=f[g],y=0;y<m;y++)x[_+y]=h;else for(y=0;y<m;y++)for(_=y*p,g=0;g<p;g++)x[_+g]=f[g];else for(y=0;y<m*p;y++)x[y]=h},getDataTypeArray:function(l){var u;switch(l){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(l){var u;switch(l){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(l,u){if(u==null)return!1;var h;switch(l){case 0:h=u>=-128&&u<=127;break;case 1:h=u>=0&&u<=255;break;case 2:h=u>=-32768&&u<=32767;break;case 3:h=u>=0&&u<=65536;break;case 4:h=u>=-2147483648&&u<=2147483647;break;case 5:h=u>=0&&u<=4294967296;break;case 6:h=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:h=u>=-17976931348623157e292&&u<=17976931348623157e292;break;default:h=!1}return h},getDataTypeSize:function(l){var u=0;switch(l){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=l}return u},getDataTypeUsed:function(l,u){var h=l;switch(l){case 2:case 4:h=l-u;break;case 3:case 5:h=l-2*u;break;case 6:u===0?h=l:u===1?h=2:h=1;break;case 7:u===0?h=l:h=l-2*u+1;break;default:h=l;break}return h},getOnePixel:function(l,u,h,d){var f=0;switch(h){case 0:f=d.getInt8(u);break;case 1:f=d.getUint8(u);break;case 2:f=d.getInt16(u,!0);break;case 3:f=d.getUint16(u,!0);break;case 4:f=d.getInt32(u,!0);break;case 5:f=d.getUInt32(u,!0);break;case 6:f=d.getFloat32(u,!0);break;case 7:f=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return f},swapDimensionOrder:function(l,u,h,d,f){var p=0,m=0,g=0,y=0,_=l;if(h>1)if(_=new d(u*h),f)for(p=0;p<u;p++)for(y=p,g=0;g<h;g++,y+=u)_[y]=l[m++];else for(p=0;p<u;p++)for(y=p,g=0;g<h;g++,y+=u)_[m++]=l[y];return _}},a=function(l,u,h){this.val=l,this.left=u,this.right=h},c={decode:function(l,u){u=u||{};var h=u.noDataValue,d=0,f={};f.ptr=u.inputOffset||0,f.pixels={},o.readHeaderInfo(l,f);var p=f.headerInfo,m=p.fileVersion,g=o.getDataTypeArray(p.imageType);if(m>5)throw"unsupported lerc version 2."+m;o.readMask(l,f),p.numValidPixel!==p.width*p.height&&!f.pixels.resultMask&&(f.pixels.resultMask=u.maskData);var y=p.width*p.height;f.pixels.resultPixels=new g(y*p.numDims),f.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var _=!u.returnPixelInterleavedDims;if(p.numValidPixel!==0)if(p.zMax===p.zMin)o.constructConstantSurface(f,_);else if(m>=4&&o.checkMinMaxRanges(l,f))o.constructConstantSurface(f,_);else{var v=new DataView(l,f.ptr,2),x=v.getUint8(0);if(f.ptr++,x)o.readDataOneSweep(l,f,g,_);else if(m>1&&p.imageType<=1&&Math.abs(p.maxZError-.5)<1e-5){var w=v.getUint8(1);if(f.ptr++,f.encodeMode=w,w>2||m<4&&w>1)throw"Invalid Huffman flag "+w;w?o.readHuffman(l,f,g,_):o.readTiles(l,f,g,_)}else o.readTiles(l,f,g,_)}f.eofOffset=f.ptr;var E;u.inputOffset?(E=f.headerInfo.blobSize+u.inputOffset-f.ptr,Math.abs(E)>=1&&(f.eofOffset=u.inputOffset+f.headerInfo.blobSize)):(E=f.headerInfo.blobSize-f.ptr,Math.abs(E)>=1&&(f.eofOffset=f.headerInfo.blobSize));var T={width:p.width,height:p.height,pixelData:f.pixels.resultPixels,minValue:p.zMin,maxValue:p.zMax,validPixelCount:p.numValidPixel,dimCount:p.numDims,dimStats:{minValues:p.minValues,maxValues:p.maxValues},maskData:f.pixels.resultMask};if(f.pixels.resultMask&&o.isValidPixelValue(p.imageType,h)){var b=f.pixels.resultMask;for(d=0;d<y;d++)b[d]||(T.pixelData[d]=h);T.noDataValue=h}return f.noDataValue=h,u.returnFileInfo&&(T.fileInfo=o.formatFileInfo(f)),T},getBandCount:function(l){var u=0,h=0,d={};for(d.ptr=0,d.pixels={};h<l.byteLength-58;)o.readHeaderInfo(l,d),h+=d.headerInfo.blobSize,u++,d.ptr=h;return u}};return c}(),i=function(){var s=new ArrayBuffer(4),o=new Uint8Array(s),a=new Uint32Array(s);return a[0]=1,o[0]===1}(),r={decode:function(s,o){if(!i)throw"Big endian system is not supported.";o=o||{};var a=o.inputOffset||0,c=new Uint8Array(s,a,10),l=String.fromCharCode.apply(null,c),u,h;if(l.trim()==="CntZImage")u=e,h=1;else if(l.substring(0,5)==="Lerc2")u=t,h=2;else throw"Unexpected file identifier string: "+l;for(var d=0,f=s.byteLength-10,p,m=[],g,y,_={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]},v=0;a<f;){var x=u.decode(s,{inputOffset:a,encodedMaskData:p,maskData:y,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,returnPixelInterleavedDims:o.returnPixelInterleavedDims,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});a=x.fileInfo.eofOffset,y=x.maskData,d===0&&(p=x.encodedMaskData,_.width=x.width,_.height=x.height,_.dimCount=x.dimCount||1,_.pixelType=x.pixelType||x.fileInfo.pixelType,_.mask=y),h>1&&(y&&m.push(y),x.fileInfo.mask&&x.fileInfo.mask.numBytes>0&&v++),d++,_.pixels.push(x.pixelData),_.statistics.push({minValue:x.minValue,maxValue:x.maxValue,noDataValue:x.noDataValue,dimStats:x.dimStats})}var w,E,T;if(h>1&&v>1){for(T=_.width*_.height,_.bandMasks=m,y=new Uint8Array(T),y.set(m[0]),w=1;w<m.length;w++)for(g=m[w],E=0;E<T;E++)y[E]=y[E]&g[E];_.maskData=y}return _}};n.exports?n.exports=r:this.Lerc=r})()})(cI);var g8=cI.exports;class m8 extends No{constructor(e){super(),this.planarConfiguration=typeof e.PlanarConfiguration!="undefined"?e.PlanarConfiguration:1,this.samplesPerPixel=typeof e.SamplesPerPixel!="undefined"?e.SamplesPerPixel:1,this.addCompression=e.LercParameters[l5.AddCompression]}decodeBlock(e){switch(this.addCompression){case cS.None:break;case cS.Deflate:e=lI(new Uint8Array(e)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return g8.decode(e,{returnPixelInterleavedDims:this.planarConfiguration===1}).pixels[0].buffer}}var y8=Object.freeze(Object.defineProperty({__proto__:null,default:m8},Symbol.toStringTag,{value:"Module"}));class _8 extends No{constructor(){if(super(),typeof createImageBitmap=="undefined")throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if(typeof document=="undefined"&&typeof OffscreenCanvas=="undefined")throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(e,t){const i=new Blob([t]),r=await createImageBitmap(i);let s;typeof document!="undefined"?(s=document.createElement("canvas"),s.width=r.width,s.height=r.height):s=new OffscreenCanvas(r.width,r.height);const o=s.getContext("2d");return o.drawImage(r,0,0),o.getImageData(0,0,r.width,r.height).data.buffer}}var x8=Object.freeze(Object.defineProperty({__proto__:null,default:_8},Symbol.toStringTag,{value:"Module"})),v8=Worker;function w8(){const n='function e(e,t,r,n,i,a,o){try{var s=e[a](o),f=s.value}catch(e){return void r(e)}s.done?t(f):Promise.resolve(f).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,f,"next",t)}function f(t){e(o,i,a,s,f,"throw",t)}s(void 0)}))}}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var n={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new T(n||[]);return a._invoke=function(e,t,r){var n=h;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===m){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=I(o,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var f=c(e,t,r);if("normal"===f.type){if(n=r.done?m:d,f.arg===v)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n=m,r.method="throw",r.arg=f.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function w(){}function g(){}var b={};l(b,o,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(D([])));x&&x!==n&&i.call(x,o)&&(b=x);var _=g.prototype=y.prototype=Object.create(b);function A(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(a,o,s,f){var l=c(e[a],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"===r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,f)}),(function(e){n("throw",e,s,f)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,f)}))}f(l.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a \'throw\' method")}return v}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function U(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}function D(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:E}}function E(){return{value:t,done:!0}}return w.prototype=g,l(_,"constructor",g),l(g,"constructor",w),w.displayName=l(g,f,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,f,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},A(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new P(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},A(_),l(_,f,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var f=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(f&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(n);var i=n.exports,a=new Map;function o(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){return a.set(e,t)}))}function s(e){return f.apply(this,arguments)}function f(){return(f=t(i.mark((function e(t){var r,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.get(t.Compression)){e.next=3;break}throw new Error("Unknown compression method identifier: ".concat(t.Compression));case 3:return e.next=5,r();case 5:return n=e.sent,e.abrupt("return",new n(t));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}o([void 0,1],(function(){return Promise.resolve().then((function(){return _})).then((function(e){return e.default}))})),o(5,(function(){return Promise.resolve().then((function(){return S})).then((function(e){return e.default}))})),o(6,(function(){throw new Error("old style JPEG compression is not supported.")})),o(7,(function(){return Promise.resolve().then((function(){return L})).then((function(e){return e.default}))})),o([8,32946],(function(){return Promise.resolve().then((function(){return Ne})).then((function(e){return e.default}))})),o(32773,(function(){return Promise.resolve().then((function(){return Ye})).then((function(e){return e.default}))})),o(34887,(function(){return Promise.resolve().then((function(){return ut})).then((function(e){return e.default}))})),o(50001,(function(){return Promise.resolve().then((function(){return dt})).then((function(e){return e.default}))}));var l=globalThis;function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function m(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function y(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function w(e,t,r){for(var n=0,i=e.length,a=i/r;i>t;){for(var o=t;o>0;--o)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),f=0;f<a;++f)for(var l=0;l<r;++l)e[r*f+l]=s[(r-l-1)*a+f]}function g(e,t,r,n,i,a){if(!t||1===t)return e;for(var o=0;o<i.length;++o){if(i[o]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[o]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var s=i[0]/8,f=2===a?1:i.length,l=0;l<n&&!(l*f*r*s>=e.byteLength);++l){var u=void 0;if(2===t){switch(i[0]){case 8:u=new Uint8Array(e,l*f*r*s,f*r*s);break;case 16:u=new Uint16Array(e,l*f*r*s,f*r*s/2);break;case 32:u=new Uint32Array(e,l*f*r*s,f*r*s/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(i[0]," bits per sample."))}y(u,f)}else 3===t&&w(u=new Uint8Array(e,l*f*r*s,f*r*s),f,s)}return e}l.addEventListener("message",function(){var e=t(i.mark((function e(t){var r,n,a,o,f,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.data,n=r.id,a=r.fileDirectory,o=r.buffer,e.next=3,s(a);case 3:return f=e.sent,e.next=6,f.decode(a,o);case 6:u=e.sent,l.postMessage({decoded:u,id:n},[u]);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var b=function(){function e(){u(this,e)}var r;return h(e,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(n=e.sent,1===(a=t.Predictor||1)){e.next=9;break}return o=!t.StripOffsets,s=o?t.TileWidth:t.ImageWidth,f=o?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt("return",g(n,a,s,f,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var x=function(e){p(r,b);var t=k(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return e}}]),r}(),_=Object.freeze({__proto__:null,default:x});function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}function P(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function I(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,a=9,o=0;function s(){i=258,a=9}function f(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),a=8-n,o=t+r-8*(i+1),s=8*(i+2)-(t+r),f=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var l=e[i]&Math.pow(2,8-n)-1,u=l<<=r-a;if(i+1<e.length){var c=e[i+1]>>>s;u+=c<<=Math.max(0,r-f)}if(o>8&&i+2<e.length){var h=8*(i+3)-(t+r);u+=e[i+2]>>>h}return u}(e,o,a);return o+=a,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function u(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var c=[];s();for(var h,d=new Uint8Array(e),p=f(d);257!==p;){if(256===p){for(s(),p=f(d);256===p;)p=f(d);if(257===p)break;if(p>256)throw new Error("corrupted code at scanline ".concat(p));P(c,u(p)),h=p}else if(p<i){var m=u(p);P(c,m),l(h,m[m.length-1]),h=p}else{var v=u(h);if(!v)throw new Error("Bogus entry. Not in dictionary, ".concat(h," / ").concat(i,", position: ").concat(o));P(c,v),c.push(v[v.length-1]),l(h,v[v.length-1]),h=p}i+1>=Math.pow(2,a)&&(12===a?h=void 0:a++),p=f(d)}return new Uint8Array(c)}var U=function(e){p(r,b);var t=A(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return I(e).buffer}}]),r}(),S=Object.freeze({__proto__:null,default:U});function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var D=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function E(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var a,o=n[0],s=0;s<i;s++){for(var f=0;f<e[s];f++){for((o=n.pop()).children[o.index]=t[r];o.index>0;)o=n.pop();for(o.index++,n.push(o);n.length<=s;)n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a;r++}s+1<i&&(n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a)}return n[0].children}function B(e,t,n,i,a,o,s,f,l){var u=n.mcusPerLine,c=n.progressive,h=t,d=t,p=0,m=0;function v(){if(m>0)return m--,p>>m&1;if(255===(p=e[d++])){var t=e[d++];if(t)throw new Error("unexpected marker: ".concat((p<<8|t).toString(16)))}return m=7,p>>>7}function y(e){for(var t,n=e;null!==(t=v());){if("number"==typeof(n=n[t]))return n;if("object"!==r(n))throw new Error("invalid huffman sequence")}return null}function w(e){for(var t=e,r=0;t>0;){var n=v();if(null===n)return;r=r<<1|n,--t}return r}function g(e){var t=w(e);return t>=1<<e-1?t:t+(-1<<e)+1}var b=0;var k,x=0;function _(e,t,r,n,i){var a=r%u,o=(r/u|0)*e.v+n,s=a*e.h+i;t(e,e.blocks[o][s])}function A(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}var P,I,U,S,T,E,B=i.length;E=c?0===o?0===f?function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r)<<l;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=v()<<l}:0===f?function(e,t){if(b>0)b--;else for(var r=o,n=s;r<=n;){var i=y(e.huffmanTableAC),a=15&i,f=i>>4;if(0===a){if(f<15){b=w(f)+(1<<f)-1;break}r+=16}else t[D[r+=f]]=g(a)*(1<<l),r++}}:function(e,t){for(var r=o,n=s,i=0;r<=n;){var a=D[r],f=t[a]<0?-1:1;switch(x){case 0:var u=y(e.huffmanTableAC),c=15&u;if(i=u>>4,0===c)i<15?(b=w(i)+(1<<i),x=4):(i=16,x=1);else{if(1!==c)throw new Error("invalid ACn encoding");k=g(c),x=i?2:3}continue;case 1:case 2:t[a]?t[a]+=(v()<<l)*f:0==--i&&(x=2===x?3:0);break;case 3:t[a]?t[a]+=(v()<<l)*f:(t[a]=k<<l,x=0);break;case 4:t[a]&&(t[a]+=(v()<<l)*f)}r++}4===x&&0==--b&&(x=0)}:function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r);e.pred+=n,t[0]=e.pred;for(var i=1;i<64;){var a=y(e.huffmanTableAC),o=15&a,s=a>>4;if(0===o){if(s<15)break;i+=16}else t[D[i+=s]]=g(o),i++}};var O,M,C=0;M=1===B?i[0].blocksPerLine*i[0].blocksPerColumn:u*n.mcusPerColumn;for(var L=a||M;C<M;){for(I=0;I<B;I++)i[I].pred=0;if(b=0,1===B)for(P=i[0],T=0;T<L;T++)A(P,E,C),C++;else for(T=0;T<L;T++){for(I=0;I<B;I++){var R=P=i[I],V=R.h,G=R.v;for(U=0;U<G;U++)for(S=0;S<V;S++)_(P,E,C,U,S)}if(++C===M)break}if(m=0,(O=e[d]<<8|e[d+1])<65280)throw new Error("marker was not found");if(!(O>=65488&&O<=65495))break;d+=2}return d-h}function O(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,a=n<<3,o=new Int32Array(64),s=new Uint8Array(64);function f(e,r,n){var i,a,o,s,f,l,u,c,h,d,p=t.quantizationTable,m=n;for(d=0;d<64;d++)m[d]=e[d]*p[d];for(d=0;d<8;++d){var v=8*d;0!==m[1+v]||0!==m[2+v]||0!==m[3+v]||0!==m[4+v]||0!==m[5+v]||0!==m[6+v]||0!==m[7+v]?(i=5793*m[0+v]+128>>8,a=5793*m[4+v]+128>>8,o=m[2+v],s=m[6+v],f=2896*(m[1+v]-m[7+v])+128>>8,c=2896*(m[1+v]+m[7+v])+128>>8,l=m[3+v]<<4,h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+128>>8,o=1567*o-3784*s+128>>8,s=h,h=f-(u=m[5+v]<<4)+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+v]=i+c,m[7+v]=i-c,m[1+v]=a+u,m[6+v]=a-u,m[2+v]=o+l,m[5+v]=o-l,m[3+v]=s+f,m[4+v]=s-f):(h=5793*m[0+v]+512>>10,m[0+v]=h,m[1+v]=h,m[2+v]=h,m[3+v]=h,m[4+v]=h,m[5+v]=h,m[6+v]=h,m[7+v]=h)}for(d=0;d<8;++d){var y=d;0!==m[8+y]||0!==m[16+y]||0!==m[24+y]||0!==m[32+y]||0!==m[40+y]||0!==m[48+y]||0!==m[56+y]?(i=5793*m[0+y]+2048>>12,a=5793*m[32+y]+2048>>12,o=m[16+y],s=m[48+y],f=2896*(m[8+y]-m[56+y])+2048>>12,c=2896*(m[8+y]+m[56+y])+2048>>12,l=m[24+y],h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+2048>>12,o=1567*o-3784*s+2048>>12,s=h,h=f-(u=m[40+y])+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+y]=i+c,m[56+y]=i-c,m[8+y]=a+u,m[48+y]=a-u,m[16+y]=o+l,m[40+y]=o-l,m[24+y]=s+f,m[32+y]=s-f):(h=5793*n[d+0]+8192>>14,m[0+y]=h,m[8+y]=h,m[16+y]=h,m[24+y]=h,m[32+y]=h,m[40+y]=h,m[48+y]=h,m[56+y]=h)}for(d=0;d<64;++d){var w=128+(m[d]+8>>4);r[d]=w<0?0:w>255?255:w}}for(var l=0;l<i;l++){for(var u=l<<3,c=0;c<8;c++)r.push(new Uint8Array(a));for(var h=0;h<n;h++){f(t.blocks[l][h],s,o);for(var d=0,p=h<<3,m=0;m<8;m++)for(var v=r[u+m],y=0;y<8;y++)v[p+y]=s[d++]}}return r}var M=function(){function e(){u(this,e),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return h(e,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(e){var t=0;function r(){var r=e[t]<<8|e[t+1];return t+=2,r}function n(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var a=Math.ceil(e.samplesPerLine/8/n),o=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];for(var s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),f=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=a*t.h,u=o*t.v,c=[],h=0;h<u;h++){for(var d=[],p=0;p<l;p++)d.push(new Int32Array(64));c.push(d)}t.blocksPerLine=s,t.blocksPerColumn=f,t.blocks=c}e.maxH=n,e.maxV=i,e.mcusPerLine=a,e.mcusPerColumn=o}var i,a,o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var s=(i=void 0,a=void 0,i=r(),a=e.subarray(t,t+i-2),t+=a.length,a);65504===o&&74===s[0]&&70===s[1]&&73===s[2]&&70===s[3]&&0===s[4]&&(this.jfif={version:{major:s[5],minor:s[6]},densityUnits:s[7],xDensity:s[8]<<8|s[9],yDensity:s[10]<<8|s[11],thumbWidth:s[12],thumbHeight:s[13],thumbData:s.subarray(14,14+3*s[12]*s[13])}),65518===o&&65===s[0]&&100===s[1]&&111===s[2]&&98===s[3]&&101===s[4]&&0===s[5]&&(this.adobe={version:s[6],flags0:s[7]<<8|s[8],flags1:s[9]<<8|s[10],transformCode:s[11]});break;case 65499:for(var f=r()+t-2;t<f;){var l=e[t++],u=new Int32Array(64);if(l>>4==0)for(var c=0;c<64;c++){u[D[c]]=e[t++]}else{if(l>>4!=1)throw new Error("DQT: invalid table spec");for(var h=0;h<64;h++){u[D[h]]=r()}}this.quantizationTables[15&l]=u}break;case 65472:case 65473:case 65474:r();for(var d={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},p=e[t++],m=void 0,v=0;v<p;v++){m=e[t];var y=e[t+1]>>4,w=15&e[t+1],g=e[t+2];d.componentsOrder.push(m),d.components[m]={h:y,v:w,quantizationIdx:g},t+=3}n(d),this.frames.push(d);break;case 65476:for(var b=r(),k=2;k<b;){for(var x=e[t++],_=new Uint8Array(16),A=0,P=0;P<16;P++,t++)_[P]=e[t],A+=_[P];for(var I=new Uint8Array(A),U=0;U<A;U++,t++)I[U]=e[t];k+=17+A,x>>4==0?this.huffmanTablesDC[15&x]=E(_,I):this.huffmanTablesAC[15&x]=E(_,I)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var S=e[t++],T=[],O=this.frames[0],M=0;M<S;M++){var C=O.components[e[t++]],L=e[t++];C.huffmanTableDC=this.huffmanTablesDC[L>>4],C.huffmanTableAC=this.huffmanTablesAC[15&L],T.push(C)}var R=e[t++],V=e[t++],G=e[t++],F=B(e,t,O,T,this.resetInterval,R,V,G>>4,15&G);t+=F;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=r()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t<this.frames.length;t++)for(var r=this.frames[t].components,n=0,i=Object.keys(r);n<i.length;n++){var a=i[n];r[a].quantizationTable=this.quantizationTables[r[a].quantizationIdx],delete r[a].quantizationIdx}for(var o=e[0],s=o.components,f=o.componentsOrder,l=[],u=o.samplesPerLine,c=o.scanLines,h=0;h<f.length;h++){var d=s[f[h]];l.push({lines:O(0,d),scaleX:d.h/o.maxH,scaleY:d.v/o.maxV})}for(var p=new Uint8Array(u*c*l.length),m=0,v=0;v<c;++v)for(var y=0;y<u;++y)for(var w=0;w<l.length;++w){var g=l[w];p[m]=g.lines[0|v*g.scaleY][0|y*g.scaleX],++m}return p}}]),e}(),C=function(e){p(r,b);var t=T(r);function r(e){var n;return u(this,r),(n=t.call(this)).reader=new M,e.JPEGTables&&n.reader.parse(e.JPEGTables),n}return h(r,[{key:"decodeBlock",value:function(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}]),r}(),L=Object.freeze({__proto__:null,default:C});function R(e){for(var t=e.length;--t>=0;)e[t]=0}R(new Array(576)),R(new Array(60)),R(new Array(512)),R(new Array(256)),R(new Array(29)),R(new Array(30));var V=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0},G=new Uint32Array(function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}()),F=function(e,t,r,n){var i=G,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[255&(e^t[o])];return-1^e},z={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},N=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Z=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==r(n))throw new TypeError(n+"must be non-object");for(var i in n)N(n,i)&&(e[i]=n[i])}}return e},K=function(e){for(var t=0,r=0,n=e.length;r<n;r++)t+=e[r].length;for(var i=new Uint8Array(t),a=0,o=0,s=e.length;a<s;a++){var f=e[a];i.set(f,o),o+=f.length}return i},H=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){H=!1}for(var Y=new Uint8Array(256),X=0;X<256;X++)Y[X]=X>=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;Y[254]=Y[254]=1;var W=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},q=function(e,t){var r,n,i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var a=new Array(2*i);for(n=0,r=0;r<i;){var o=e[r++];if(o<128)a[n++]=o;else{var s=Y[o];if(s>4)a[n++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r<i;)o=o<<6|63&e[r++],s--;s>1?a[n++]=65533:o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&H)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}(a,n)},J=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Y[e[r]]>t?r:t};var Q=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=e.state;r=e.next_in,A=e.input,n=r+(e.avail_in-5),i=e.next_out,P=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=I.dmax,f=I.wsize,l=I.whave,u=I.wnext,c=I.window,h=I.hold,d=I.bits,p=I.lencode,m=I.distcode,v=(1<<I.lenbits)-1,y=(1<<I.distbits)-1;e:do{d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=p[h&v];t:for(;;){if(h>>>=g=w>>>24,d-=g,0===(g=w>>>16&255))P[i++]=65535&w;else{if(!(16&g)){if(0==(64&g)){w=p[(65535&w)+(h&(1<<g)-1)];continue t}if(32&g){I.mode=12;break e}e.msg="invalid literal/length code",I.mode=30;break e}b=65535&w,(g&=15)&&(d<g&&(h+=A[r++]<<d,d+=8),b+=h&(1<<g)-1,h>>>=g,d-=g),d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=m[h&y];r:for(;;){if(h>>>=g=w>>>24,d-=g,!(16&(g=w>>>16&255))){if(0==(64&g)){w=m[(65535&w)+(h&(1<<g)-1)];continue r}e.msg="invalid distance code",I.mode=30;break e}if(k=65535&w,d<(g&=15)&&(h+=A[r++]<<d,(d+=8)<g&&(h+=A[r++]<<d,d+=8)),(k+=h&(1<<g)-1)>s){e.msg="invalid distance too far back",I.mode=30;break e}if(h>>>=g,d-=g,k>(g=i-a)){if((g=k-g)>l&&I.sane){e.msg="invalid distance too far back",I.mode=30;break e}if(x=0,_=c,0===u){if(x+=f-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}else if(u<g){if(x+=f+u-g,(g-=u)<b){b-=g;do{P[i++]=c[x++]}while(--g);if(x=0,u<b){b-=g=u;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}}else if(x+=u-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}for(;b>2;)P[i++]=_[x++],P[i++]=_[x++],P[i++]=_[x++],b-=3;b&&(P[i++]=_[x++],b>1&&(P[i++]=_[x++]))}else{x=i-k;do{P[i++]=P[x++],P[i++]=P[x++],P[i++]=P[x++],b-=3}while(b>2);b&&(P[i++]=P[x++],b>1&&(P[i++]=P[x++]))}break}}break}}while(r<n&&i<o);r-=b=d>>3,h&=(1<<(d-=b<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<o?o-i+257:257-(i-o),I.hold=h,I.bits=d},ee=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),te=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),re=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ne=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ie=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d,p,m,v,y=s.bits,w=0,g=0,b=0,k=0,x=0,_=0,A=0,P=0,I=0,U=0,S=null,T=0,D=new Uint16Array(16),E=new Uint16Array(16),B=null,O=0;for(w=0;w<=15;w++)D[w]=0;for(g=0;g<n;g++)D[t[r+g]]++;for(x=y,k=15;k>=1&&0===D[k];k--);if(x>k&&(x=k),0===k)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(b=1;b<k&&0===D[b];b++);for(x<b&&(x=b),P=1,w=1;w<=15;w++)if(P<<=1,(P-=D[w])<0)return-1;if(P>0&&(0===e||1!==k))return-1;for(E[1]=0,w=1;w<15;w++)E[w+1]=E[w]+D[w];for(g=0;g<n;g++)0!==t[r+g]&&(o[E[t[r+g]]++]=g);if(0===e?(S=B=o,d=19):1===e?(S=ee,T-=257,B=te,O-=257,d=256):(S=re,B=ne,d=-1),U=0,g=0,w=b,h=a,_=x,A=0,u=-1,c=(I=1<<x)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){p=w-A,o[g]<d?(m=0,v=o[g]):o[g]>d?(m=B[O+o[g]],v=S[T+o[g]]):(m=96,v=0),f=1<<w-A,b=l=1<<_;do{i[h+(U>>A)+(l-=f)]=p<<24|m<<16|v|0}while(0!==l);for(f=1<<w-1;U&f;)f>>=1;if(0!==f?(U&=f-1,U+=f):U=0,g++,0==--D[w]){if(w===k)break;w=t[r+o[g]]}if(w>x&&(U&c)!==u){for(0===A&&(A=x),h+=b,P=1<<(_=w-A);_+A<k&&!((P-=D[_+A])<=0);)_++,P<<=1;if(I+=1<<_,1===e&&I>852||2===e&&I>592)return 1;i[u=U&c]=x<<24|_<<16|h-a|0}}return 0!==U&&(i[h+U]=w-A<<24|64<<16|0),s.bits=x,0},ae=j.Z_FINISH,oe=j.Z_BLOCK,se=j.Z_TREES,fe=j.Z_OK,le=j.Z_STREAM_END,ue=j.Z_NEED_DICT,ce=j.Z_STREAM_ERROR,he=j.Z_DATA_ERROR,de=j.Z_MEM_ERROR,pe=j.Z_BUF_ERROR,me=j.Z_DEFLATED,ve=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function ye(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var we,ge,be=function(e){if(!e||!e.state)return ce;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,fe},ke=function(e){if(!e||!e.state)return ce;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,be(e)},xe=function(e,t){var r;if(!e||!e.state)return ce;var n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ce:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ke(e))},_e=function(e,t){if(!e)return ce;var r=new ye;e.state=r,r.window=null;var n=xe(e,t);return n!==fe&&(e.state=null),n},Ae=!0,Pe=function(e){if(Ae){we=new Int32Array(512),ge=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ie(1,e.lens,0,288,we,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ie(2,e.lens,0,32,ge,0,e.work,{bits:5}),Ae=!1}e.lencode=we,e.lenbits=9,e.distcode=ge,e.distbits=5},Ie=function(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Ue={inflateReset:ke,inflateReset2:xe,inflateResetKeep:be,inflateInit:function(e){return _e(e,15)},inflateInit2:_e,inflate:function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=0,U=new Uint8Array(4),S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ce;12===(r=e.state).mode&&(r.mode=13),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,c=s,h=f,_=fe;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(2&r.wrap&&35615===l){r.check=0,U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0),l=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&l)!==me){e.msg="unknown compression method",r.mode=30;break}if(u-=4,x=8+(15&(l>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,e.adler=r.check=1,r.mode=512&l?10:12,l=0,u=0;break;case 2:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.flags=l,(255&r.flags)!==me){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.time=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,U[2]=l>>>16&255,U[3]=l>>>24&255,r.check=F(r.check,U,4,0)),l=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+d),x)),512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}l=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}e.adler=r.check=ve(l),l=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,ue;e.adler=r.check=1,r.mode=12;case 12:if(t===oe||t===se)break e;case 13:if(r.last){l>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}switch(r.last=1&l,u-=1,3&(l>>>=1)){case 0:r.mode=14;break;case 1:if(Pe(r),r.mode=20,t===se){l>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}l>>>=2,u-=2;break;case 14:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,l=0,u=0,r.mode=15,t===se)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>s&&(d=s),d>f&&(d=f),0===d)break e;i.set(n.subarray(a,a+d),o),s-=d,a+=d,f-=d,o+=d,r.length-=d;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.nlen=257+(31&l),l>>>=5,u-=5,r.ndist=1+(31&l),l>>>=5,u-=5,r.ncode=4+(15&l),l>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.lens[S[r.have++]]=7&l,l>>>=3,u-=3}for(;r.have<19;)r.lens[S[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},_=ie(0,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(w<16)l>>>=v,u-=v,r.lens[r.have++]=w;else{if(16===w){for(P=v+2;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l>>>=v,u-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}x=r.lens[r.have-1],d=3+(3&l),l>>>=2,u-=2}else if(17===w){for(P=v+3;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=3+(7&(l>>>=v)),l>>>=3,u-=3}else{for(P=v+7;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=11+(127&(l>>>=v)),l>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=x}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,A={bits:r.lenbits},_=ie(1,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},_=ie(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,_){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,t===se)break e;case 20:r.mode=21;case 21:if(s>=6&&f>=258){e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,$(e,h),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(y&&0==(240&y)){for(g=v,b=y,k=w;y=(I=r.lencode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,r.length=w,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=12;break}if(64&y){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;y=(I=r.distcode[l&(1<<r.distbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(0==(240&y)){for(g=v,b=y,k=w;y=(I=r.distcode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,64&y){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(d=h-f,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===f)break e;i[o++]=r.length,f--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break e;s--,l|=n[a++]<<u,u+=8}if(h-=f,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?F(r.check,i,h,o-h):V(r.check,i,h,o-h)),h=f,(r.flags?l:ve(l))!==r.check){e.msg="incorrect data check",r.mode=30;break}l=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}l=0,u=0}r.mode=29;case 29:_=le;break e;case 30:_=he;break e;case 31:return de;default:return ce}return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,(r.wsize||h!==e.avail_out&&r.mode<30&&(r.mode<27||t!==ae))&&Ie(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?F(r.check,i,h,e.next_out-h):V(r.check,i,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===c&&0===h||t===ae)&&_===fe&&(_=pe),_},inflateEnd:function(e){if(!e||!e.state)return ce;var t=e.state;return t.window&&(t.window=null),e.state=null,fe},inflateGetHeader:function(e,t){if(!e||!e.state)return ce;var r=e.state;return 0==(2&r.wrap)?ce:(r.head=t,t.done=!1,fe)},inflateSetDictionary:function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?ce:11===r.mode&&V(1,t,n,0)!==r.check?he:Ie(e,t,n,n)?(r.mode=31,de):(r.havedict=1,fe):ce},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Te=Object.prototype.toString,De=j.Z_NO_FLUSH,Ee=j.Z_FINISH,Be=j.Z_OK,Oe=j.Z_STREAM_END,Me=j.Z_NEED_DICT,Ce=j.Z_STREAM_ERROR,Le=j.Z_DATA_ERROR,Re=j.Z_MEM_ERROR;function Ve(e){this.options=Z({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Q,this.strm.avail_out=0;var r=Ue.inflateInit2(this.strm,t.windowBits);if(r!==Be)throw new Error(z[r]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=W(t.dictionary):"[object ArrayBuffer]"===Te.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Ue.inflateSetDictionary(this.strm,t.dictionary))!==Be))throw new Error(z[r])}function Ge(e,t){var r=new Ve(t);if(r.push(e),r.err)throw r.msg||z[r.err];return r.result}Ve.prototype.push=function(e,t){var r,n,i,a=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Ee:De,"[object ArrayBuffer]"===Te.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(o),a.next_out=0,a.avail_out=o),(r=Ue.inflate(a,n))===Me&&s&&((r=Ue.inflateSetDictionary(a,s))===Be?r=Ue.inflate(a,n):r===Le&&(r=Me));a.avail_in>0&&r===Oe&&a.state.wrap>0&&0!==e[a.next_in];)Ue.inflateReset(a),r=Ue.inflate(a,n);switch(r){case Ce:case Le:case Me:case Re:return this.onEnd(r),this.ended=!0,!1}if(i=a.avail_out,a.next_out&&(0===a.avail_out||r===Oe))if("string"===this.options.to){var f=J(a.output,a.next_out),l=a.next_out-f,u=q(a.output,f);a.next_out=l,a.avail_out=o-l,l&&a.output.set(a.output.subarray(f,f+l),0),this.onData(u)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(r!==Be||0!==i){if(r===Oe)return r=Ue.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Ve.prototype.onData=function(e){this.chunks.push(e)},Ve.prototype.onEnd=function(e){e===Be&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=K(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Fe={Inflate:Ve,inflate:Ge,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Ge(e,t)},ungzip:Ge,constants:j}.inflate;function ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var je=function(e){p(r,b);var t=ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return Fe(new Uint8Array(e)).buffer}}]),r}(),Ne=Object.freeze({__proto__:null,default:je});function Ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var Ke,He=function(e){p(r,b);var t=Ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),r=[],n=0;n<e.byteLength;++n){var i=t.getInt8(n);if(i<0){var a=t.getUint8(n+1);i=-i;for(var o=0;o<=i;++o)r.push(a);n+=1}else{for(var s=0;s<=i;++s)r.push(t.getUint8(n+s+1));n+=i+1}}return new Uint8Array(r).buffer}}]),r}(),Ye=Object.freeze({__proto__:null,default:He}),Xe={exports:{}};Ke=Xe,\n/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */\nfunction(){var e,t,r,n,i,a,o,s,f,l,u,c,h,d,p,m,v=(e={defaultNoDataValue:-34027999387901484e22,decode:function(a,o){var s=(o=o||{}).encodedMaskData||null===o.encodedMaskData,f=i(a,o.inputOffset||0,s),l=null!==o.noDataValue?o.noDataValue:e.defaultNoDataValue,u=t(f,o.pixelType||Float32Array,o.encodedMaskData,l,o.returnMask),c={width:f.width,height:f.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:f.pixels.maxValue,noDataValue:l};return u.resultMask&&(c.maskData=u.resultMask),o.returnEncodedMask&&f.mask&&(c.encodedMaskData=f.mask.bitset?f.mask.bitset:null),o.returnFileInfo&&(c.fileInfo=r(f),o.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(f))),c}},t=function(e,t,r,n,i){var o,s,f,l=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,h=Math.floor(e.width/u),d=Math.floor(e.height/c),p=2*e.maxZError,m=Number.MAX_VALUE;r=r||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),i&&r&&(f=new Uint8Array(e.width*e.height));for(var v,y,w=new Float32Array(h*d),g=0;g<=c;g++){var b=g!==c?d:e.height%c;if(0!==b)for(var k=0;k<=u;k++){var x=k!==u?h:e.width%u;if(0!==x){var _,A,P,I,U=g*e.width*d+k*h,S=e.width-x,T=e.pixels.blocks[l];if(T.encoding<2?(0===T.encoding?_=T.rawData:(a(T.stuffedData,T.bitsPerPixel,T.numValidPixels,T.offset,p,w,e.pixels.maxValue),_=w),A=0):P=2===T.encoding?0:T.offset,r)for(y=0;y<b;y++){for(7&U&&(I=r[U>>3],I<<=7&U),v=0;v<x;v++)7&U||(I=r[U>>3]),128&I?(f&&(f[U]=1),m=m>(o=T.encoding<2?_[A++]:P)?o:m,s[U++]=o):(f&&(f[U]=0),s[U++]=n),I<<=1;U+=S}else if(T.encoding<2)for(y=0;y<b;y++){for(v=0;v<x;v++)m=m>(o=_[A++])?o:m,s[U++]=o;U+=S}else for(m=m>P?P:m,y=0;y<b;y++){for(v=0;v<x;v++)s[U++]=P;U+=S}if(1===T.encoding&&A!==T.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:s,resultMask:f,minValue:m}},r=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,r={},n=0;n<t;n++){var i=e.pixels.blocks[n];0===i.encoding?r.float32=!0:1===i.encoding?r[i.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},i=function(e,t,r){var n={},i=new Uint8Array(e,t,10);if(n.fileIdentifierString=String.fromCharCode.apply(null,i),"CntZImage"!==n.fileIdentifierString.trim())throw"Unexpected file identifier string: "+n.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(n.fileVersion=a.getInt32(0,!0),n.imageType=a.getInt32(4,!0),n.height=a.getUint32(8,!0),n.width=a.getUint32(12,!0),n.maxZError=a.getFloat64(16,!0),t+=24,!r)if(a=new DataView(e,t,16),n.mask={},n.mask.numBlocksY=a.getUint32(0,!0),n.mask.numBlocksX=a.getUint32(4,!0),n.mask.numBytes=a.getUint32(8,!0),n.mask.maxValue=a.getFloat32(12,!0),t+=16,n.mask.numBytes>0){var o=new Uint8Array(Math.ceil(n.width*n.height/8)),s=(a=new DataView(e,t,n.mask.numBytes)).getInt16(0,!0),f=2,l=0;do{if(s>0)for(;s--;)o[l++]=a.getUint8(f++);else{var u=a.getUint8(f++);for(s=-s;s--;)o[l++]=u}s=a.getInt16(f,!0),f+=2}while(f<n.mask.numBytes);if(-32768!==s||l<o.length)throw"Unexpected end of mask RLE encoding";n.mask.bitset=o,t+=n.mask.numBytes}else 0==(n.mask.numBytes|n.mask.numBlocksY|n.mask.maxValue)&&(n.mask.bitset=new Uint8Array(Math.ceil(n.width*n.height/8)));a=new DataView(e,t,16),n.pixels={},n.pixels.numBlocksY=a.getUint32(0,!0),n.pixels.numBlocksX=a.getUint32(4,!0),n.pixels.numBytes=a.getUint32(8,!0),n.pixels.maxValue=a.getFloat32(12,!0),t+=16;var c=n.pixels.numBlocksX,h=n.pixels.numBlocksY,d=c+(n.width%c>0?1:0),p=h+(n.height%h>0?1:0);n.pixels.blocks=new Array(d*p);for(var m=0,v=0;v<p;v++)for(var y=0;y<d;y++){var w=0,g=e.byteLength-t;a=new DataView(e,t,Math.min(10,g));var b={};n.pixels.blocks[m++]=b;var k=a.getUint8(0);if(w++,b.encoding=63&k,b.encoding>3)throw"Invalid block encoding ("+b.encoding+")";if(2!==b.encoding){if(0!==k&&2!==k){if(k>>=6,b.offsetType=k,2===k)b.offset=a.getInt8(1),w++;else if(1===k)b.offset=a.getInt16(1,!0),w+=2;else{if(0!==k)throw"Invalid block offset type";b.offset=a.getFloat32(1,!0),w+=4}if(1===b.encoding)if(k=a.getUint8(w),w++,b.bitsPerPixel=63&k,k>>=6,b.numValidPixelsType=k,2===k)b.numValidPixels=a.getUint8(w),w++;else if(1===k)b.numValidPixels=a.getUint16(w,!0),w+=2;else{if(0!==k)throw"Invalid valid pixel count type";b.numValidPixels=a.getUint32(w,!0),w+=4}}var x;if(t+=w,3!==b.encoding)if(0===b.encoding){var _=(n.pixels.numBytes-1)/4;if(_!==Math.floor(_))throw"uncompressed block has invalid length";x=new ArrayBuffer(4*_),new Uint8Array(x).set(new Uint8Array(e,t,4*_));var A=new Float32Array(x);b.rawData=A,t+=4*_}else if(1===b.encoding){var P=Math.ceil(b.numValidPixels*b.bitsPerPixel/8),I=Math.ceil(P/4);x=new ArrayBuffer(4*I),new Uint8Array(x).set(new Uint8Array(e,t,P)),b.stuffedData=new Uint32Array(x),t+=P}}else t++}return n.eofOffset=t,n},a=function(e,t,r,n,i,a,o){var s,f,l,u=(1<<t)-1,c=0,h=0,d=Math.ceil((o-n)/i),p=4*e.length-Math.ceil(t*r/8);for(e[e.length-1]<<=8*p,s=0;s<r;s++){if(0===h&&(l=e[c++],h=32),h>=t)f=l>>>h-t&u,h-=t;else{var m=t-h;f=(l&u)<<m&u,f+=(l=e[c++])>>>(h=32-m)}a[s]=f<d?n+f*i:o}return a},e),y=(o=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d=(1<<r)-1,p=0,m=0,v=4*e.length-Math.ceil(r*n/8);if(e[e.length-1]<<=8*v,i)for(f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=i[l];else for(h=Math.ceil((s-a)/o),f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=l<h?a+l*o:s},s=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=[],p=4*e.length-Math.ceil(t*r/8);e[e.length-1]<<=8*p;var m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32),c>=t?(h=o>>>c-t&s,c-=t):(h=(o&s)<<(u=t-c)&s,h+=(o=e[f++])>>>(c=32-u)),d[l]=h<m?n+h*i:a;return d.unshift(n),d},f=function(e,t,r,n,i,a,o,s){var f,l,u,c,h=(1<<r)-1,d=0,p=0,m=0;if(i)for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=i[l];else{var v=Math.ceil((s-a)/o);for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=l<v?a+l*o:s}return t},l=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=0,p=[],m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32,d=0),c>=t?(h=o>>>d&s,c-=t,d+=t):(h=o>>>d&s,c=32-(u=t-c),h|=((o=e[f++])&(1<<u)-1)<<t-u,d=u),p[l]=h<m?n+h*i:a;return p.unshift(n),p},u=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=4*e.length-Math.ceil(r*n/8);for(e[e.length-1]<<=8*c,i=0;i<n;i++)0===u&&(o=e[l++],u=32),u>=r?(a=o>>>u-r&f,u-=r):(a=(o&f)<<(s=r-u)&f,a+=(o=e[l++])>>>(u=32-s)),t[i]=a;return t},c=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=0;for(i=0;i<n;i++)0===u&&(o=e[l++],u=32,c=0),u>=r?(a=o>>>c&f,u-=r,c+=r):(a=o>>>c&f,u=32-(s=r-u),a|=((o=e[l++])&(1<<s)-1)<<r-s,c=s),t[i]=a;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,r=65535,n=e.length,i=Math.floor(n/2),a=0;i;){var o=i>=359?359:i;i-=o;do{t+=e[a++]<<8,r+=t+=e[a++]}while(--o);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=t+=e[a]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,n=new Uint8Array(e,r,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,n),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;r+=6;var a,o=new DataView(e,r,8),s=o.getInt32(0,!0);if(i.fileVersion=s,r+=4,s>=3&&(i.checksum=o.getUint32(4,!0),r+=4),o=new DataView(e,r,12),i.height=o.getUint32(0,!0),i.width=o.getUint32(4,!0),r+=8,s>=4?(i.numDims=o.getUint32(8,!0),r+=4):i.numDims=1,o=new DataView(e,r,40),i.numValidPixel=o.getUint32(0,!0),i.microBlockSize=o.getInt32(4,!0),i.blobSize=o.getInt32(8,!0),i.imageType=o.getInt32(12,!0),i.maxZError=o.getFloat64(16,!0),i.zMin=o.getFloat64(24,!0),i.zMax=o.getFloat64(32,!0),r+=40,t.headerInfo=i,t.ptr=r,s>=3&&(a=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-a,i.blobSize-14))!==i.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,n=this.getDataTypeArray(r.imageType),i=r.numDims*this.getDataTypeSize(r.imageType),a=this.readSubArray(e,t.ptr,n,i),o=this.readSubArray(e,t.ptr+i,n,i);t.ptr+=2*i;var s,f=!0;for(s=0;s<r.numDims;s++)if(a[s]!==o[s]){f=!1;break}return r.minValues=a,r.maxValues=o,f},readSubArray:function(e,t,r,n){var i;if(r===Uint8Array)i=new Uint8Array(e,t,n);else{var a=new ArrayBuffer(n);new Uint8Array(a).set(new Uint8Array(e,t,n)),i=new r(a)}return i},readMask:function(e,t){var r,n,i=t.ptr,a=t.headerInfo,o=a.width*a.height,s=a.numValidPixel,f=new DataView(e,i,4),l={};if(l.numBytes=f.getUint32(0,!0),i+=4,(0===s||o===s)&&0!==l.numBytes)throw"invalid mask";if(0===s)r=new Uint8Array(Math.ceil(o/8)),l.bitset=r,n=new Uint8Array(o),t.pixels.resultMask=n,i+=l.numBytes;else if(l.numBytes>0){r=new Uint8Array(Math.ceil(o/8));var u=(f=new DataView(e,i,l.numBytes)).getInt16(0,!0),c=2,h=0,d=0;do{if(u>0)for(;u--;)r[h++]=f.getUint8(c++);else for(d=f.getUint8(c++),u=-u;u--;)r[h++]=d;u=f.getInt16(c,!0),c+=2}while(c<l.numBytes);if(-32768!==u||h<r.length)throw"Unexpected end of mask RLE encoding";n=new Uint8Array(o);var p=0,m=0;for(m=0;m<o;m++)7&m?(p=r[m>>3],p<<=7&m):p=r[m>>3],128&p&&(n[m]=1);t.pixels.resultMask=n,l.bitset=r,i+=l.numBytes}return t.ptr=i,t.mask=l,!0},readDataOneSweep:function(e,t,r,n){var i,a=t.ptr,o=t.headerInfo,s=o.numDims,f=o.width*o.height,l=o.imageType,u=o.numValidPixel*h.getDataTypeSize(l)*s,c=t.pixels.resultMask;if(r===Uint8Array)i=new Uint8Array(e,a,u);else{var d=new ArrayBuffer(u);new Uint8Array(d).set(new Uint8Array(e,a,u)),i=new r(d)}if(i.length===f*s)t.pixels.resultPixels=n?h.swapDimensionOrder(i,f,s,r,!0):i;else{t.pixels.resultPixels=new r(f*s);var p=0,m=0,v=0,y=0;if(s>1){if(n){for(m=0;m<f;m++)if(c[m])for(y=m,v=0;v<s;v++,y+=f)t.pixels.resultPixels[y]=i[p++]}else for(m=0;m<f;m++)if(c[m])for(y=m*s,v=0;v<s;v++)t.pixels.resultPixels[y+v]=i[p++]}else for(m=0;m<f;m++)c[m]&&(t.pixels.resultPixels[m]=i[p++])}return a+=u,t.ptr=a,!0},readHuffmanTree:function(e,t){var r=this.HUFFMAN_LUT_BITS_MAX,n=new DataView(e,t.ptr,16);if(t.ptr+=16,n.getInt32(0,!0)<2)throw"unsupported Huffman version";var i=n.getInt32(4,!0),a=n.getInt32(8,!0),o=n.getInt32(12,!0);if(a>=o)return!1;var s=new Uint32Array(o-a);h.decodeBits(e,t,s);var f,l,u,c,p=[];for(f=a;f<o;f++)p[l=f-(f<i?0:i)]={first:s[f-a],second:null};var m=e.byteLength-t.ptr,v=Math.ceil(m/4),y=new ArrayBuffer(4*v);new Uint8Array(y).set(new Uint8Array(e,t.ptr,m));var w,g=new Uint32Array(y),b=0,k=0;for(w=g[0],f=a;f<o;f++)(c=p[l=f-(f<i?0:i)].first)>0&&(p[l].second=w<<b>>>32-c,32-b>=c?32===(b+=c)&&(b=0,w=g[++k]):(b+=c-32,w=g[++k],p[l].second|=w>>>32-b));var x=0,_=0,A=new d;for(f=0;f<p.length;f++)void 0!==p[f]&&(x=Math.max(x,p[f].first));_=x>=r?r:x;var P,I,U,S,T,D=[];for(f=a;f<o;f++)if((c=p[l=f-(f<i?0:i)].first)>0)if(P=[c,l],c<=_)for(I=p[l].second<<_-c,U=1<<_-c,u=0;u<U;u++)D[I|u]=P;else for(I=p[l].second,T=A,S=c-1;S>=0;S--)I>>>S&1?(T.right||(T.right=new d),T=T.right):(T.left||(T.left=new d),T=T.left),0!==S||T.val||(T.val=P[1]);return{decodeLut:D,numBitsLUTQick:_,numBitsLUT:x,tree:A,stuffedData:g,srcPtr:k,bitPos:b}},readHuffman:function(e,t,r,n){var i,a,o,s,f,l,u,c,d,p=t.headerInfo.numDims,m=t.headerInfo.height,v=t.headerInfo.width,y=v*m,w=this.readHuffmanTree(e,t),g=w.decodeLut,b=w.tree,k=w.stuffedData,x=w.srcPtr,_=w.bitPos,A=w.numBitsLUTQick,P=w.numBitsLUT,I=0===t.headerInfo.imageType?128:0,U=t.pixels.resultMask,S=0;_>0&&(x++,_=0);var T,D=k[x],E=1===t.encodeMode,B=new r(y*p),O=B;if(p<2||E){for(T=0;T<p;T++)if(p>1&&(O=new r(B.buffer,y*T,y),S=0),t.headerInfo.numValidPixel===v*m)for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(o+=u>0?S:l>0?O[c-v]:S,o&=255,O[c]=o,S=o):O[c]=o}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++)if(U[c]){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(u>0&&U[c-1]?o+=S:l>0&&U[c-v]?o+=O[c-v]:o+=S,o&=255,O[c]=o,S=o):O[c]=o}}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++)if(c=l*v+u,!U||U[c])for(T=0;T<p;T++,c+=y){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,O[c]=o}t.ptr=t.ptr+4*(x+1)+(_>0?4:0),t.pixels.resultPixels=B,p>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(B,y,p,r))},decodeBits:function(e,t,r,n,i){var a=t.headerInfo,h=a.fileVersion,d=0,p=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,m=new DataView(e,t.ptr,p),v=m.getUint8(0);d++;var y=v>>6,w=0===y?4:3-y,g=(32&v)>0,b=31&v,k=0;if(1===w)k=m.getUint8(d),d++;else if(2===w)k=m.getUint16(d,!0),d+=2;else{if(4!==w)throw"Invalid valid pixel count type";k=m.getUint32(d,!0),d+=4}var x,_,A,P,I,U,S,T,D,E=2*a.maxZError,B=a.numDims>1?a.maxValues[i]:a.zMax;if(g){for(t.counter.lut++,T=m.getUint8(d),d++,P=Math.ceil((T-1)*b/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),A=new Uint8Array(_),t.ptr+=d,A.set(new Uint8Array(e,t.ptr,P)),S=new Uint32Array(_),t.ptr+=P,D=0;T-1>>>D;)D++;P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,U=h>=3?l(S,b,T-1,n,E,B):s(S,b,T-1,n,E,B),h>=3?f(x,r,D,k,U):o(x,r,D,k,U)}else t.counter.bitstuffer++,D=b,t.ptr+=d,D>0&&(P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,h>=3?null==n?c(x,r,D,k):f(x,r,D,k,!1,n,E,B):null==n?u(x,r,D,k):o(x,r,D,k,!1,n,E,B))},readTiles:function(e,t,r,n){var i=t.headerInfo,a=i.width,o=i.height,s=a*o,f=i.microBlockSize,l=i.imageType,u=h.getDataTypeSize(l),c=Math.ceil(a/f),d=Math.ceil(o/f);t.pixels.numBlocksY=d,t.pixels.numBlocksX=c,t.pixels.ptr=0;var p,m,v,y,w,g,b,k,x,_,A=0,P=0,I=0,U=0,S=0,T=0,D=0,E=0,B=0,O=0,M=0,C=0,L=0,R=0,V=0,G=new r(f*f),F=o%f||f,z=a%f||f,j=i.numDims,N=t.pixels.resultMask,Z=t.pixels.resultPixels,K=i.fileVersion>=5?14:15,H=i.zMax;for(I=0;I<d;I++)for(S=I!==d-1?f:F,U=0;U<c;U++)for(O=I*a*f+U*f,M=a-(T=U!==c-1?f:z),k=0;k<j;k++){if(j>1?(_=Z,O=I*a*f+U*f,Z=new r(t.pixels.resultPixels.buffer,s*k*u,s),H=i.maxValues[k]):_=null,D=e.byteLength-t.ptr,m={},V=0,E=(p=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),V++,x=i.fileVersion>=5?4&E:0,B=E>>6&255,(E>>2&K)!=(U*f>>3&K))throw"integrity issue";if(x&&0===k)throw"integrity issue";if((w=3&E)>3)throw t.ptr+=V,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(x)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=V,C=(C=S*T*u)<(L=e.byteLength-t.ptr)?C:L,v=new ArrayBuffer(C%u==0?C:C+u-C%u),new Uint8Array(v).set(new Uint8Array(e,t.ptr,C)),y=new r(v),R=0,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=y[R++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=y[R++];O+=M}t.ptr+=R*u}else if(g=h.getDataTypeUsed(x&&l<6?4:l,B),b=h.getOnePixel(m,V,g,p),V+=h.getDataTypeSize(g),3===w)if(t.ptr+=V,t.counter.constantoffset++,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=x?Math.min(H,_[O]+b):b),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=x?Math.min(H,_[O]+b):b,O++;O+=M}else if(t.ptr+=V,h.decodeBits(e,t,G,b,k),V=0,x)if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]+_[O]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=G[V++]+_[O],O++;O+=M}else if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=G[V++];O+=M}else{if(x)if(N)for(A=0;A<S;A++)for(P=0;P<T;P++)N[O]&&(Z[O]=_[O]),O++;else for(A=0;A<S;A++)for(P=0;P<T;P++)Z[O]=_[O],O++;t.counter.constant++,t.ptr+=V}}j>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(t.pixels.resultPixels,s,j,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,n=e.headerInfo.zMin,i=e.headerInfo.maxValues,a=e.headerInfo.numDims,o=e.headerInfo.height*e.headerInfo.width,s=0,f=0,l=0,u=e.pixels.resultMask,c=e.pixels.resultPixels;if(u)if(a>1){if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)u[f]&&(c[l+f]=r);else for(f=0;f<o;f++)if(u[f])for(l=f*a,s=0;s<a;s++)c[l+a]=i[s]}else for(f=0;f<o;f++)u[f]&&(c[f]=r);else if(a>1&&n!==r)if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)c[l+f]=r;else for(f=0;f<o;f++)for(l=f*a,s=0;s<a;s++)c[l+s]=i[s];else for(f=0;f<o*a;f++)c[f]=r},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var r;switch(e){case 0:r=t>=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,n){var i=0;switch(r){case 0:i=n.getInt8(t);break;case 1:i=n.getUint8(t);break;case 2:i=n.getInt16(t,!0);break;case 3:i=n.getUint16(t,!0);break;case 4:i=n.getInt32(t,!0);break;case 5:i=n.getUInt32(t,!0);break;case 6:i=n.getFloat32(t,!0);break;case 7:i=n.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return i},swapDimensionOrder:function(e,t,r,n,i){var a=0,o=0,s=0,f=0,l=e;if(r>1)if(l=new n(t*r),i)for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[f]=e[o++];else for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[o++]=e[f];return l}},d=function(e,t,r){this.val=e,this.left=t,this.right=r},{decode:function(e,t){var r=(t=t||{}).noDataValue,n=0,i={};i.ptr=t.inputOffset||0,i.pixels={},h.readHeaderInfo(e,i);var a=i.headerInfo,o=a.fileVersion,s=h.getDataTypeArray(a.imageType);if(o>5)throw"unsupported lerc version 2."+o;h.readMask(e,i),a.numValidPixel===a.width*a.height||i.pixels.resultMask||(i.pixels.resultMask=t.maskData);var f=a.width*a.height;i.pixels.resultPixels=new s(f*a.numDims),i.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var l,u=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)h.constructConstantSurface(i,u);else if(o>=4&&h.checkMinMaxRanges(e,i))h.constructConstantSurface(i,u);else{var c=new DataView(e,i.ptr,2),d=c.getUint8(0);if(i.ptr++,d)h.readDataOneSweep(e,i,s,u);else if(o>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var p=c.getUint8(1);if(i.ptr++,i.encodeMode=p,p>2||o<4&&p>1)throw"Invalid Huffman flag "+p;p?h.readHuffman(e,i,s,u):h.readTiles(e,i,s,u)}else h.readTiles(e,i,s,u)}i.eofOffset=i.ptr,t.inputOffset?(l=i.headerInfo.blobSize+t.inputOffset-i.ptr,Math.abs(l)>=1&&(i.eofOffset=t.inputOffset+i.headerInfo.blobSize)):(l=i.headerInfo.blobSize-i.ptr,Math.abs(l)>=1&&(i.eofOffset=i.headerInfo.blobSize));var m={width:a.width,height:a.height,pixelData:i.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:i.pixels.resultMask};if(i.pixels.resultMask&&h.isValidPixelValue(a.imageType,r)){var v=i.pixels.resultMask;for(n=0;n<f;n++)v[n]||(m.pixelData[n]=r);m.noDataValue=r}return i.noDataValue=r,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(i)),m},getBandCount:function(e){for(var t=0,r=0,n={ptr:0,pixels:{}};r<e.byteLength-58;)h.readHeaderInfo(e,n),r+=n.headerInfo.blobSize,t++,n.ptr=r;return t}}),w=(p=new ArrayBuffer(4),m=new Uint8Array(p),new Uint32Array(p)[0]=1,1===m[0]),g={decode:function(e,t){if(!w)throw"Big endian system is not supported.";var r,n,i=(t=t||{}).inputOffset||0,a=new Uint8Array(e,i,10),o=String.fromCharCode.apply(null,a);if("CntZImage"===o.trim())r=v,n=1;else{if("Lerc2"!==o.substring(0,5))throw"Unexpected file identifier string: "+o;r=y,n=2}for(var s,f,l,u,c,h,d=0,p=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]},b=0;i<p;){var k=r.decode(e,{inputOffset:i,encodedMaskData:s,maskData:l,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,returnPixelInterleavedDims:t.returnPixelInterleavedDims,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});i=k.fileInfo.eofOffset,l=k.maskData,0===d&&(s=k.encodedMaskData,g.width=k.width,g.height=k.height,g.dimCount=k.dimCount||1,g.pixelType=k.pixelType||k.fileInfo.pixelType,g.mask=l),n>1&&(l&&m.push(l),k.fileInfo.mask&&k.fileInfo.mask.numBytes>0&&b++),d++,g.pixels.push(k.pixelData),g.statistics.push({minValue:k.minValue,maxValue:k.maxValue,noDataValue:k.noDataValue,dimStats:k.dimStats})}if(n>1&&b>1){for(h=g.width*g.height,g.bandMasks=m,(l=new Uint8Array(h)).set(m[0]),u=1;u<m.length;u++)for(f=m[u],c=0;c<h;c++)l[c]=l[c]&f[c];g.maskData=l}return g}};Ke.exports?Ke.exports=g:this.Lerc=g}();var We=Xe.exports,qe={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Je={};for(var Qe in qe)qe.hasOwnProperty(Qe)&&(Je[qe[Qe]]=parseInt(Qe,10));Je.BitsPerSample,Je.ExtraSamples,Je.SampleFormat,Je.StripByteCounts,Je.StripOffsets,Je.StripRowCounts,Je.TileByteCounts,Je.TileOffsets,Je.SubIFDs;var $e={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},et={};for(var tt in $e)$e.hasOwnProperty(tt)&&(et[$e[tt]]=parseInt(tt,10));var rt=1,nt=0,it=1,at={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},ot={};for(var st in at)at.hasOwnProperty(st)&&(ot[at[st]]=parseInt(st,10));function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var lt=function(e){p(r,b);var t=ft(r);function r(e){var n;return u(this,r),(n=t.call(this)).planarConfiguration=void 0!==e.PlanarConfiguration?e.PlanarConfiguration:1,n.samplesPerPixel=void 0!==e.SamplesPerPixel?e.SamplesPerPixel:1,n.addCompression=e.LercParameters[rt],n}return h(r,[{key:"decodeBlock",value:function(e){switch(this.addCompression){case nt:break;case it:e=Fe(new Uint8Array(e)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return We.decode(e,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),r}(),ut=Object.freeze({__proto__:null,default:lt});function ct(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var ht=function(e){p(a,b);var r,n=ct(a);function a(){var e;if(u(this,a),e=n.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return e}return h(a,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Blob([r]),e.next=3,createImageBitmap(n);case 3:return a=e.sent,"undefined"!=typeof document?((o=document.createElement("canvas")).width=a.width,o.height=a.height):o=new OffscreenCanvas(a.width,a.height),(s=o.getContext("2d")).drawImage(a,0,0),e.abrupt("return",s.getImageData(0,0,a.width,a.height).data.buffer);case 8:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})}]),a}(),dt=Object.freeze({__proto__:null,default:ht});';return new v8(typeof Blob=="undefined"?"data:application/javascript;base64,"+Buffer.from(n,"binary").toString("base64"):URL.createObjectURL(new Blob([n],{type:"application/javascript"})))}var E8=Object.freeze(Object.defineProperty({__proto__:null,create:w8},Symbol.toStringTag,{value:"Module"}));export{Mu as AssertionError,At as Collection,Us as Disposable,it as Feature,Vx as Geolocation,km as Graticule,la as Image,Bl as ImageBase,jl as ImageCanvas,ro as ImageTile,Xp as Kinetic,Lv as Map,Si as MapBrowserEvent,og as MapBrowserEventHandler,ya as MapEvent,Fn as Object,Du as Observable,yg as Overlay,xh as PluggableMap,Kr as Tile,xc as TileCache,gh as TileQueue,vc as TileRange,Ou as VERSION,Hg as VectorRenderTile,Kg as VectorTile,Vi as View,se as getUid,Mu as ol$AssertionError,At as ol$Collection,Sl as ol$Collection$CollectionEvent,wt as ol$CollectionEventType,rp as ol$DataTile,Us as ol$Disposable,it as ol$Feature,D_ as ol$Feature$createStyleFunction,Vx as ol$Geolocation,km as ol$Graticule,la as ol$Image,dh as ol$Image$listenImage,Bl as ol$ImageBase,jl as ol$ImageCanvas,me as ol$ImageState,ro as ol$ImageTile,Xp as ol$Kinetic,Lv as ol$Map,Si as ol$MapBrowserEvent,og as ol$MapBrowserEventHandler,Re as ol$MapBrowserEventType,ya as ol$MapEvent,lo as ol$MapEventType,Rt as ol$MapProperty,Fn as ol$Object,np as ol$Object$ObjectEvent,Vr as ol$ObjectEventType,Du as ol$Observable,$u as ol$Observable$unByKey,yg as ol$Overlay,bn as ol$OverlayPositioning,xh as ol$PluggableMap,Kr as ol$Tile,xc as ol$TileCache,gh as ol$TileQueue,c1 as ol$TileQueue$getTilePriority,vc as ol$TileRange,fo as ol$TileRange$createOrUpdate,W as ol$TileState,Ou as ol$VERSION,Hg as ol$VectorRenderTile,Kg as ol$VectorTile,Vi as ol$View,m1 as ol$View$createCenterConstraint,y1 as ol$View$createResolutionConstraint,_1 as ol$View$createRotationConstraint,x1 as ol$View$isNoopAnimation,lt as ol$ViewHint,zn as ol$ViewProperty,P_ as ol$array$binarySearch,Gi as ol$array$equals,Xe as ol$array$extend,zs as ol$array$find,Fu as ol$array$findIndex,Ge as ol$array$includes,M_ as ol$array$isSorted,bl as ol$array$linearFindNearest,cr as ol$array$numberSafeCompareFunction,wI as ol$array$remove,O_ as ol$array$reverseSubArray,EI as ol$array$stableSort,ce as ol$asserts$assert,ag as ol$centerconstraint$createExtent,h1 as ol$centerconstraint$none,so as ol$color$asArray,Zp as ol$color$asString,Wp as ol$color$fromString,qx as ol$color$isStringColor,Hp as ol$color$normalize,Kp as ol$color$toString,Ii as ol$colorlike$asColorLike,E1 as ol$control$Attribution,Yi as ol$control$Control,FC as ol$control$FullScreen,kC as ol$control$MousePosition,UC as ol$control$OverviewMap,T1 as ol$control$Rotate,jC as ol$control$ScaleLine,as as ol$control$ScaleLine$Units,b1 as ol$control$Zoom,YC as ol$control$ZoomSlider,ZC as ol$control$ZoomToExtent,P1 as ol$control$defaults,Ep as ol$coordinate$add,dx as ol$coordinate$closestOnCircle,Pl as ol$coordinate$closestOnSegment,BI as ol$coordinate$createStringXY,Ol as ol$coordinate$degreesToStringHDMS,Ml as ol$coordinate$distance,ai as ol$coordinate$equals,fx as ol$coordinate$format,bp as ol$coordinate$getWorldsAway,Zu as ol$coordinate$rotate,Tp as ol$coordinate$scale,Dn as ol$coordinate$squaredDistance,Fl as ol$coordinate$squaredDistanceToSegment,jI as ol$coordinate$toStringHDMS,px as ol$coordinate$toStringXY,Wu as ol$coordinate$wrapX,Wl as ol$css$CLASS_COLLAPSED,ss as ol$css$CLASS_CONTROL,Zl as ol$css$CLASS_HIDDEN,t1 as ol$css$CLASS_SELECTABLE,bi as ol$css$CLASS_UNSELECTABLE,Jp as ol$css$CLASS_UNSUPPORTED,eg as ol$css$cssOpacity,Qp as ol$css$getFontParameters,St as ol$dom$createCanvasContext2D,Xx as ol$dom$outerHeight,Yx as ol$dom$outerWidth,Yp as ol$dom$removeChildren,Vl as ol$dom$removeNode,Zx as ol$dom$replaceChildren,io as ol$dom$replaceNode,ip as ol$easing$easeIn,Hr as ol$easing$easeOut,Gu as ol$easing$inAndOut,$_ as ol$easing$linear,RI as ol$easing$upAndDown,Mt as ol$events$Event,xI as ol$events$Event$preventDefault,A_ as ol$events$Event$stopPropagation,ne as ol$events$EventType,cs as ol$events$KeyCode,Wr as ol$events$Target,Th as ol$events$condition$all,F1 as ol$events$condition$altKeyOnly,N1 as ol$events$condition$altShiftKeysOnly,_a as ol$events$condition$always,JC as ol$events$condition$click,e2 as ol$events$condition$doubleClick,k1 as ol$events$condition$focus,wg as ol$events$condition$focusWithTabindex,Eg as ol$events$condition$mouseActionButton,uo as ol$events$condition$mouseOnly,Tg as ol$events$condition$never,bh as ol$events$condition$noModifierKeys,i2 as ol$events$condition$penOnly,t2 as ol$events$condition$platformModifierKeyOnly,QC as ol$events$condition$pointerMove,Rg as ol$events$condition$primaryAction,nc as ol$events$condition$shiftKeyOnly,bg as ol$events$condition$singleClick,Sg as ol$events$condition$targetNotEditable,n2 as ol$events$condition$touchOnly,pe as ol$events$listen,Bs as ol$events$listenOnce,je as ol$events$unlistenByKey,Qo as ol$extent$Corner,Dt as ol$extent$Relationship,Ks as ol$extent$applyTransform,W_ as ol$extent$approximatelyEquals,yt as ol$extent$boundingExtent,Nn as ol$extent$buffer,cp as ol$extent$clone,qr as ol$extent$closestSquaredDistanceXY,kn as ol$extent$containsCoordinate,Gt as ol$extent$containsExtent,zu as ol$extent$containsXY,Bu as ol$extent$coordinateRelationship,Kt as ol$extent$createEmpty,$n as ol$extent$createOrUpdate,Jr as ol$extent$createOrUpdateEmpty,Ys as ol$extent$createOrUpdateFromCoordinate,FI as ol$extent$createOrUpdateFromCoordinates,ju as ol$extent$createOrUpdateFromFlatCoordinates,NI as ol$extent$createOrUpdateFromRings,Kn as ol$extent$equals,up as ol$extent$extend,Xs as ol$extent$extendCoordinate,hp as ol$extent$extendCoordinates,dp as ol$extent$extendFlatCoordinates,H_ as ol$extent$extendRings,K_ as ol$extent$extendXY,Vu as ol$extent$forEachCorner,ea as ol$extent$getArea,Zs as ol$extent$getBottomLeft,Ws as ol$extent$getBottomRight,Ut as ol$extent$getCenter,q_ as ol$extent$getCorner,kI as ol$extent$getEnlargedArea,Hs as ol$extent$getForViewAndSize,ot as ol$extent$getHeight,an as ol$extent$getIntersection,$I as ol$extent$getIntersectionArea,DI as ol$extent$getMargin,GI as ol$extent$getSize,si as ol$extent$getTopLeft,ta as ol$extent$getTopRight,be as ol$extent$getWidth,at as ol$extent$intersects,Q_ as ol$extent$intersectsSegment,Qr as ol$extent$isEmpty,J_ as ol$extent$returnOrUpdate,Cl as ol$extent$scaleFromCenter,fp as ol$extent$wrapX,Vg as ol$featureloader$loadFeaturesXhr,lL as ol$featureloader$setWithCredentials,Yg as ol$featureloader$xhr,eA as ol$format$EsriJSON,Pa as ol$format$Feature,jh as ol$format$Feature$transformExtentWithOptions,ct as ol$format$Feature$transformGeometryWithOptions,Bn as ol$format$FormatType,cA as ol$format$GML,xo as ol$format$GML2,Ie as ol$format$GML3,Hh as ol$format$GML32,ke as ol$format$GMLBase,Zi as ol$format$GMLBase$GMLNS,BA as ol$format$GPX,Vv as ol$format$GeoJSON,uP as ol$format$IGC,yP as ol$format$IIIFInfo,Pt as ol$format$IIIFInfo$Versions,Yh as ol$format$JSONFeature,aM as ol$format$KML,bP as ol$format$KML$getDefaultFillStyle,SP as ol$format$KML$getDefaultImageStyle,RP as ol$format$KML$getDefaultStrokeStyle,CP as ol$format$KML$getDefaultStyle,LP as ol$format$KML$getDefaultStyleArray,IP as ol$format$KML$getDefaultTextStyle,pm as ol$format$KML$readFlatCoordinates,wm as ol$format$MVT,zM as ol$format$OSMXML,bw as ol$format$OWS,vF as ol$format$Polyline,Rw as ol$format$Polyline$decodeDeltas,Cw as ol$format$Polyline$decodeFloats,Aw as ol$format$Polyline$decodeSignedIntegers,Ow as ol$format$Polyline$decodeUnsignedIntegers,Sw as ol$format$Polyline$encodeDeltas,Iw as ol$format$Polyline$encodeFloats,Lw as ol$format$Polyline$encodeSignedIntegers,Mw as ol$format$Polyline$encodeUnsignedInteger,Pw as ol$format$Polyline$encodeUnsignedIntegers,qh as ol$format$TextFeature,OF as ol$format$TopoJSON,ON as ol$format$WFS,PN as ol$format$WFS$writeFilter,$N as ol$format$WKB,HN as ol$format$WKT,Ak as ol$format$WMSCapabilities,Fk as ol$format$WMSGetFeatureInfo,r$ as ol$format$WMTSCapabilities,dd as ol$format$XML,yo as ol$format$XMLFeature,Nw as ol$format$filter$And,kw as ol$format$filter$Bbox,Da as ol$format$filter$Comparison,To as ol$format$filter$ComparisonBinary,$w as ol$format$filter$Contains,Dw as ol$format$filter$DWithin,Gw as ol$format$filter$Disjoint,Uw as ol$format$filter$During,zw as ol$format$filter$EqualTo,Eo as ol$format$filter$Filter,Bw as ol$format$filter$GreaterThan,jw as ol$format$filter$GreaterThanOrEqualTo,Vw as ol$format$filter$Intersects,Yw as ol$format$filter$IsBetween,Xw as ol$format$filter$IsLike,Zw as ol$format$filter$IsNull,Ww as ol$format$filter$LessThan,Hw as ol$format$filter$LessThanOrEqualTo,Sm as ol$format$filter$LogicalNary,Kw as ol$format$filter$Not,qw as ol$format$filter$NotEqualTo,Jw as ol$format$filter$Or,Qw as ol$format$filter$ResourceId,$a as ol$format$filter$Spatial,eE as ol$format$filter$Within,tE as ol$format$filter$and,nE as ol$format$filter$bbox,_N as ol$format$filter$between,oN as ol$format$filter$contains,lN as ol$format$filter$disjoint,vN as ol$format$filter$during,uN as ol$format$filter$dwithin,hN as ol$format$filter$equalTo,gN as ol$format$filter$greaterThan,mN as ol$format$filter$greaterThanOrEqualTo,aN as ol$format$filter$intersects,yN as ol$format$filter$isNull,fN as ol$format$filter$lessThan,pN as ol$format$filter$lessThanOrEqualTo,xN as ol$format$filter$like,sN as ol$format$filter$not,dN as ol$format$filter$notEqualTo,rN as ol$format$filter$or,wN as ol$format$filter$resourceId,cN as ol$format$filter$within,wo as ol$format$xlink$readHref,xr as ol$format$xsd$readBoolean,gs as ol$format$xsd$readBooleanString,Wh as ol$format$xsd$readDateTime,Ve as ol$format$xsd$readDecimal,Wi as ol$format$xsd$readDecimalString,Hi as ol$format$xsd$readNonNegativeIntegerString,Ct as ol$format$xsd$readPositiveInteger,Z as ol$format$xsd$readString,_o as ol$format$xsd$writeBooleanTextNode,Dv as ol$format$xsd$writeCDATASection,Gv as ol$format$xsd$writeDateTimeTextNode,Cn as ol$format$xsd$writeDecimalTextNode,Ec as ol$format$xsd$writeNonNegativeIntegerTextNode,ye as ol$format$xsd$writeStringTextNode,Yr as ol$functions$FALSE,Mn as ol$functions$TRUE,Xr as ol$functions$VOID,F_ as ol$functions$memoizeOne,N_ as ol$functions$toPromise,Ig as ol$geom$Circle,Mp as ol$geom$Geometry,ln as ol$geom$GeometryCollection,H as ol$geom$GeometryLayout,R as ol$geom$GeometryType,Tt as ol$geom$LineString,aa as ol$geom$LinearRing,jn as ol$geom$MultiLineString,ci as ol$geom$MultiPoint,ui as ol$geom$MultiPolygon,ft as ol$geom$Point,Bt as ol$geom$Polygon,jx as ol$geom$Polygon$circular,zl as ol$geom$Polygon$fromCircle,no as ol$geom$Polygon$fromExtent,Vp as ol$geom$Polygon$makeRegular,Ti as ol$geom$SimpleGeometry,th as ol$geom$SimpleGeometry$getStrideForLayout,Ix as ol$geom$SimpleGeometry$transformGeom2D,lh as ol$geom$flat$area$linearRing,$p as ol$geom$flat$area$linearRings,Nx as ol$geom$flat$area$linearRingss,Cg as ol$geom$flat$center$linearRingss,ih as ol$geom$flat$closest$arrayMaxSquaredDelta,sh as ol$geom$flat$closest$assignClosestArrayPoint,Ax as ol$geom$flat$closest$assignClosestMultiArrayPoint,rh as ol$geom$flat$closest$assignClosestPoint,nh as ol$geom$flat$closest$maxSquaredDelta,Lx as ol$geom$flat$closest$multiArrayMaxSquaredDelta,kx as ol$geom$flat$contains$linearRingContainsExtent,rs as ol$geom$flat$contains$linearRingContainsXY,ch as ol$geom$flat$contains$linearRingsContainsXY,$x as ol$geom$flat$contains$linearRingssContainsXY,Fp as ol$geom$flat$deflate$deflateCoordinate,sa as ol$geom$flat$deflate$deflateCoordinates,oh as ol$geom$flat$deflate$deflateCoordinatesArray,Px as ol$geom$flat$deflate$deflateMultiCoordinatesArray,Tm as ol$geom$flat$flip$flipXY,s$ as ol$geom$flat$geodesic$greatCircleArc,UE as ol$geom$flat$geodesic$meridian,zE as ol$geom$flat$geodesic$parallel,zi as ol$geom$flat$inflate$inflateCoordinates,oa as ol$geom$flat$inflate$inflateCoordinatesArray,ah as ol$geom$flat$inflate$inflateMultiCoordinatesArray,uh as ol$geom$flat$interiorpoint$getInteriorPointOfArray,Dp as ol$geom$flat$interiorpoint$getInteriorPointsOfMultiArray,ic as ol$geom$flat$interpolate$interpolatePoint,Ch as ol$geom$flat$interpolate$lineStringCoordinateAtM,W1 as ol$geom$flat$interpolate$lineStringsCoordinateAtM,Gl as ol$geom$flat$intersectsextent$intersectsLineString,Dx as ol$geom$flat$intersectsextent$intersectsLineStringArray,Gx as ol$geom$flat$intersectsextent$intersectsLinearRing,Up as ol$geom$flat$intersectsextent$intersectsLinearRingArray,Ux as ol$geom$flat$intersectsextent$intersectsLinearRingMultiArray,Lh as ol$geom$flat$length$lineStringLength,x2 as ol$geom$flat$length$linearRingLength,jp as ol$geom$flat$orient$inflateEnds,Ul as ol$geom$flat$orient$linearRingIsClockwise,zp as ol$geom$flat$orient$linearRingsAreOriented,Bx as ol$geom$flat$orient$linearRingssAreOriented,hh as ol$geom$flat$orient$orientLinearRings,Bp as ol$geom$flat$orient$orientLinearRingsArray,zx as ol$geom$flat$reverse$coordinates,Gp as ol$geom$flat$segments$forEach,Dl as ol$geom$flat$simplify$douglasPeucker,Np as ol$geom$flat$simplify$douglasPeuckerArray,QI as ol$geom$flat$simplify$douglasPeuckerMultiArray,Mx as ol$geom$flat$simplify$quantize,kp as ol$geom$flat$simplify$quantizeArray,Fx as ol$geom$flat$simplify$quantizeMultiArray,Ox as ol$geom$flat$simplify$radialDistance,JI as ol$geom$flat$simplify$simplifyLineString,is as ol$geom$flat$simplify$snap,rv as ol$geom$flat$straightchunk$matchingChunk,ov as ol$geom$flat$textpath$drawTextOnPath,o$ as ol$geom$flat$topology$lineStringIsClosed,eh as ol$geom$flat$transform$rotate,Sx as ol$geom$flat$transform$scale,fr as ol$geom$flat$transform$transform2D,Op as ol$geom$flat$transform$translate,se as ol$getUid,Uu as ol$has$DEVICE_PIXEL_RATIO,G_ as ol$has$FIREFOX,z_ as ol$has$IMAGE_DECODE,op as ol$has$MAC,ap as ol$has$PASSIVE_EVENT_LISTENERS,AI as ol$has$SAFARI,U_ as ol$has$WEBKIT,Rl as ol$has$WORKER_OFFSCREEN_CANVAS,M1 as ol$interaction$DoubleClickZoom,m2 as ol$interaction$DragAndDrop,Z1 as ol$interaction$DragAndDrop$DragAndDropEvent,U1 as ol$interaction$DragBox,Rh as ol$interaction$DragBox$DragBoxEvent,$1 as ol$interaction$DragPan,D1 as ol$interaction$DragRotate,_2 as ol$interaction$DragRotateAndZoom,z1 as ol$interaction$DragZoom,gL as ol$interaction$Draw,yc as ol$interaction$Draw$DrawEvent,fL as ol$interaction$Draw$createBox,dL as ol$interaction$Draw$createRegularPolygon,wL as ol$interaction$Extent,xv as ol$interaction$Extent$ExtentEvent,ls as ol$interaction$Interaction,O1 as ol$interaction$Interaction$pan,wh as ol$interaction$Interaction$zoomByDelta,B1 as ol$interaction$KeyboardPan,j1 as ol$interaction$KeyboardZoom,SL as ol$interaction$Modify,Dh as ol$interaction$Modify$ModifyEvent,V1 as ol$interaction$MouseWheelZoom,Ih as ol$interaction$MouseWheelZoom$Mode,Y1 as ol$interaction$PinchRotate,X1 as ol$interaction$PinchZoom,li as ol$interaction$Pointer,Eh as ol$interaction$Pointer$centroid,tc as ol$interaction$Property,CL as ol$interaction$Select,Rv as ol$interaction$Select$SelectEvent,AL as ol$interaction$Snap,OL as ol$interaction$Translate,Uh as ol$interaction$Translate$TranslateEvent,Cv as ol$interaction$defaults,qp as ol$layer$Base,jE as ol$layer$BaseImage,$m as ol$layer$BaseTile,Ea as ol$layer$BaseVector,km as ol$layer$Graticule,Jl as ol$layer$Group,pr as ol$layer$Group$GroupEvent,M$ as ol$layer$Heatmap,rT as ol$layer$Image,oo as ol$layer$Layer,Xl as ol$layer$Layer$inView,tU as ol$layer$MapboxVector,Hc as ol$layer$MapboxVector$getMapboxPath,Cb as ol$layer$MapboxVector$normalizeGlyphsUrl,Kd as ol$layer$MapboxVector$normalizeSourceUrl,Ib as ol$layer$MapboxVector$normalizeSpriteUrl,Lb as ol$layer$MapboxVector$normalizeStyleUrl,We as ol$layer$Property,xT as ol$layer$Tile,Tr as ol$layer$TileProperty,fs as ol$layer$Vector,rU as ol$layer$VectorImage,Qm as ol$layer$VectorTile,br as ol$layer$VectorTileRenderType,gU as ol$layer$WebGLPoints,mU as ol$layer$WebGLTile,yv as ol$loadingstrategy$all,oL as ol$loadingstrategy$bbox,aL as ol$loadingstrategy$tile,hr as ol$math$ceil,we as ol$math$clamp,ex as ol$math$cosh,Js as ol$math$floor,Ui as ol$math$lerp,pp as ol$math$log2,oi as ol$math$modulo,mp as ol$math$round,tx as ol$math$solveLinearSystem,ur as ol$math$squaredDistance,gp as ol$math$squaredSegmentDistance,Ll as ol$math$toDegrees,Yu as ol$math$toFixed,zt as ol$math$toRadians,mT as ol$net$ClientError,gT as ol$net$ResponseError,r0 as ol$net$getJSON,Nc as ol$net$jsonp,J$ as ol$net$overrideXHR,s0 as ol$net$resolveUrl,Q$ as ol$net$restoreXHR,J as ol$obj$assign,Zr as ol$obj$clear,Nu as ol$obj$getValues,xi as ol$obj$isEmpty,yU as ol$pixel$nothing,Ri as ol$pointer$EventType,on as ol$proj$METERS_PER_UNIT,qs as ol$proj$Projection,gn as ol$proj$Units,on as ol$proj$Units$METERS_PER_UNIT,sp as ol$proj$Units$fromCode,bx as ol$proj$addCommon,vx as ol$proj$addCoordinateTransforms,Ju as ol$proj$addEquivalentProjections,xx as ol$proj$addEquivalentTransforms,Cp as ol$proj$addProjection,_x as ol$proj$addProjections,VI as ol$proj$clearAllProjections,ZI as ol$proj$clearUserProjection,qu as ol$proj$cloneTransform,Qu as ol$proj$createProjection,Pp as ol$proj$createSafeCoordinateTransform,Lp as ol$proj$createTransformFromCoordinateTransform,Ip as ol$proj$disableCoordinateWarning,nx as ol$proj$epsg3857$EXTENT,Qs as ol$proj$epsg3857$HALF_SIZE,Al as ol$proj$epsg3857$MAX_SAFE_Y,yp as ol$proj$epsg3857$PROJECTIONS,na as ol$proj$epsg3857$RADIUS,ix as ol$proj$epsg3857$WORLD_EXTENT,rx as ol$proj$epsg3857$fromEPSG4326,sx as ol$proj$epsg3857$toEPSG4326,_p as ol$proj$epsg4326$EXTENT,ax as ol$proj$epsg4326$METERS_PER_UNIT,xp as ol$proj$epsg4326$PROJECTIONS,ox as ol$proj$epsg4326$RADIUS,Gn as ol$proj$equivalent,Ap as ol$proj$fromLonLat,rt as ol$proj$fromUserCoordinate,Un as ol$proj$fromUserExtent,Tx as ol$proj$fromUserResolution,re as ol$proj$get,$l as ol$proj$getPointResolution,Ei as ol$proj$getTransform,qn as ol$proj$getTransformFromProjections,En as ol$proj$getUserProjection,kl as ol$proj$identityTransform,_U as ol$proj$proj4$register,ux as ol$proj$projections$add,lx as ol$proj$projections$clear,cx as ol$proj$projections$get,wx as ol$proj$setUserProjection,YI as ol$proj$toLonLat,dr as ol$proj$toUserCoordinate,ns as ol$proj$toUserExtent,Ex as ol$proj$toUserResolution,ts as ol$proj$transform,ra as ol$proj$transformExtent,XI as ol$proj$transformWithProjections,to as ol$proj$transforms$add,hx as ol$proj$transforms$clear,vp as ol$proj$transforms$get,zI as ol$proj$transforms$remove,WI as ol$proj$useGeographic,G1 as ol$render$Box,ca as ol$render$Event,Tn as ol$render$EventType,hd as ol$render$Feature,IM as ol$render$Feature$toFeature,Ew as ol$render$Feature$toGeometry,Ng as ol$render$VectorContext,Ta as ol$render$canvas$Builder,uc as ol$render$canvas$BuilderGroup,Ne as ol$render$canvas$BuilderType,cv as ol$render$canvas$Executor,dc as ol$render$canvas$ExecutorGroup,uv as ol$render$canvas$ExecutorGroup$getPixelIndexArray,nv as ol$render$canvas$ImageBuilder,Fh as ol$render$canvas$Immediate,_e as ol$render$canvas$Instruction,us as ol$render$canvas$Instruction$beginPathInstruction,Fg as ol$render$canvas$Instruction$closePathInstruction,lc as ol$render$canvas$Instruction$fillInstruction,gr as ol$render$canvas$Instruction$strokeInstruction,iv as ol$render$canvas$LineStringBuilder,kg as ol$render$canvas$PolygonBuilder,sv as ol$render$canvas$TextBuilder,cc as ol$render$canvas$TextBuilder$TEXT_ALIGN,ji as ol$render$canvas$checkedFonts,Bi as ol$render$canvas$defaultFillStyle,tg as ol$render$canvas$defaultFont,Hl as ol$render$canvas$defaultLineCap,ua as ol$render$canvas$defaultLineDash,ha as ol$render$canvas$defaultLineDashOffset,ao as ol$render$canvas$defaultLineJoin,ga as ol$render$canvas$defaultLineWidth,da as ol$render$canvas$defaultMiterLimit,os as ol$render$canvas$defaultPadding,fa as ol$render$canvas$defaultStrokeStyle,pa as ol$render$canvas$defaultTextAlign,Kl as ol$render$canvas$defaultTextBaseline,a1 as ol$render$canvas$drawImageOrLabel,o1 as ol$render$canvas$getTextDimensions,Yn as ol$render$canvas$hitdetect$HIT_DETECT_RESOLUTION,zg as ol$render$canvas$hitdetect$createHitDetectionImageData,Bg as ol$render$canvas$hitdetect$hitDetect,fh as ol$render$canvas$labelCache,ig as ol$render$canvas$measureAndCacheTextWidth,r1 as ol$render$canvas$measureTextHeight,ql as ol$render$canvas$measureTextWidth,i1 as ol$render$canvas$registerFont,mC as ol$render$canvas$rotateAtOffset,ph as ol$render$canvas$textHeights,l$ as ol$render$getRenderPixel,BE as ol$render$getVectorContext,a$ as ol$render$toContext,rg as ol$renderer$Composite,Dg as ol$renderer$Layer,e1 as ol$renderer$Map,Zm as ol$renderer$canvas$ImageLayer,Mh as ol$renderer$canvas$Layer,Jm as ol$renderer$canvas$TileLayer,Ab as ol$renderer$canvas$VectorImageLayer,jg as ol$renderer$canvas$VectorLayer,lT as ol$renderer$canvas$VectorTileLayer,So as ol$renderer$canvas$common$IMAGE_SMOOTHING_DISABLED,Xm as ol$renderer$canvas$common$IMAGE_SMOOTHING_ENABLED,pv as ol$renderer$vector$defaultOrder,Nh as ol$renderer$vector$getSquaredTolerance,kh as ol$renderer$vector$getTolerance,gc as ol$renderer$vector$renderFeature,jm as ol$renderer$webgl$Layer,Td as ol$renderer$webgl$Layer$WebGLWorkerMessageType,nT as ol$renderer$webgl$Layer$colorDecodeId,tT as ol$renderer$webgl$Layer$colorEncodeId,R$ as ol$renderer$webgl$Layer$getBlankImageData,S$ as ol$renderer$webgl$Layer$writePointFeatureToBuffers,Vm as ol$renderer$webgl$PointsLayer,kb as ol$renderer$webgl$TileLayer,qc as ol$renderer$webgl$TileLayer$Attributes,Te as ol$renderer$webgl$TileLayer$Uniforms,Hb as ol$reproj$Image,Sd as ol$reproj$Tile,Wm as ol$reproj$Triangulation,aT as ol$reproj$calculateSourceExtentResolution,ja as ol$reproj$calculateSourceResolution,F$ as ol$reproj$common$ENABLE_RASTER_REPROJECTION,Ym as ol$reproj$common$ERROR_THRESHOLD,qm as ol$reproj$render,ug as ol$resolutionconstraint$createMinMaxResolution,f1 as ol$resolutionconstraint$createSnapToPower,d1 as ol$resolutionconstraint$createSnapToResolutions,p1 as ol$rotationconstraint$createSnapToN,g1 as ol$rotationconstraint$createSnapToZero,mh as ol$rotationconstraint$disable,hg as ol$rotationconstraint$none,pg as ol$size$buffer,gg as ol$size$hasArea,_h as ol$size$scale,pt as ol$size$toSize,EU as ol$source$BingMaps,Kb as ol$source$BingMaps$quadKey,SU as ol$source$CartoDB,IU as ol$source$Cluster,qb as ol$source$DataTile,x4 as ol$source$GeoTIFF,T4 as ol$source$IIIF,bs as ol$source$Image,SS as ol$source$Image$ImageSourceEvent,sf as ol$source$Image$ImageSourceEventType,ou as ol$source$Image$defaultImageLoadFunction,R4 as ol$source$ImageArcGISRest,C4 as ol$source$ImageCanvas,P4 as ol$source$ImageMapGuide,M4 as ol$source$ImageStatic,N4 as ol$source$ImageWMS,U4 as ol$source$OGCMapTile,B4 as ol$source$OGCVectorTile,V4 as ol$source$OSM,vy as ol$source$OSM$ATTRIBUTION,q4 as ol$source$Raster,MS as ol$source$Raster$Processor,Ey as ol$source$Raster$RasterSourceEvent,PS as ol$source$Raster$newImageData,Ra as ol$source$Source,nz as ol$source$Stamen,Fe as ol$source$State,Fc as ol$source$Tile,n0 as ol$source$Tile$TileSourceEvent,rz as ol$source$TileArcGISRest,oz as ol$source$TileDebug,Ro as ol$source$TileEventType,Ji as ol$source$TileImage,_T as ol$source$TileJSON,lz as ol$source$TileWMS,uz as ol$source$UTFGrid,$S as ol$source$UTFGrid$CustomTile,i0 as ol$source$UrlTile,ho as ol$source$Vector,_r as ol$source$Vector$VectorSourceEvent,Nt as ol$source$VectorEventType,Cd as ol$source$VectorTile,pT as ol$source$VectorTile$defaultLoadFunction,Mr as ol$source$WMSServerType,fz as ol$source$WMTS,pz as ol$source$WMTS$optionsFromCapabilities,Fr as ol$source$WMTSRequestEncoding,eu as ol$source$XYZ,w4 as ol$source$Zoomify,_y as ol$source$Zoomify$CustomTile,Or as ol$source$common$DEFAULT_WMS_VERSION,IS as ol$source$ogcTileUtil$getMapTileUrlTemplate,xy as ol$source$ogcTileUtil$getTileSetInfo,CS as ol$source$ogcTileUtil$getVectorTileUrlTemplate,gz as ol$source$sourcesFromTileGrid,Nl as ol$sphere$DEFAULT_RADIUS,mx as ol$sphere$getArea,Hu as ol$sphere$getDistance,gx as ol$sphere$getLength,yx as ol$sphere$offset,wp as ol$string$compareVersions,es as ol$string$padNumber,zh as ol$structs$LRUCache,yz as ol$structs$LinkedList,l1 as ol$structs$PriorityQueue,Ql as ol$structs$PriorityQueue$DROP,mc as ol$structs$RBush,Oh as ol$style$Circle,Vn as ol$style$Fill,pc as ol$style$Icon,_n as ol$style$IconAnchorUnits,V2 as ol$style$IconImage,dv as ol$style$IconImage$get,cC as ol$style$IconImageCache,Yl as ol$style$IconImageCache$shared,Ft as ol$style$IconOrigin,Og as ol$style$Image,q1 as ol$style$RegularShape,Sn as ol$style$Stroke,yn as ol$style$Style,Q1 as ol$style$Style$createDefaultStyle,wa as ol$style$Style$createEditingStyle,J1 as ol$style$Style$toFunction,Sa as ol$style$Text,$g as ol$style$TextPlacement,Ae as ol$style$expressions$Operators,K0 as ol$style$expressions$PALETTE_TEXTURE_ARRAY,ie as ol$style$expressions$ValueTypes,Z0 as ol$style$expressions$arrayToGlsl,Db as ol$style$expressions$colorToGlsl,oe as ol$style$expressions$expressionToGlsl,Qc as ol$style$expressions$getStringNumberEquivalent,Oi as ol$style$expressions$getValueType,$b as ol$style$expressions$isTypeUnique,Jc as ol$style$expressions$numberToGlsl,Gb as ol$style$expressions$stringToGlsl,Jd as ol$style$expressions$uniformNameForVariable,_z as ol$style$literal$SymbolType,La as ol$tilecoord$createOrUpdate,Wg as ol$tilecoord$fromKey,Av as ol$tilecoord$getCacheKeyForTileKey,Aa as ol$tilecoord$getKey,Xi as ol$tilecoord$getKeyZXY,Bh as ol$tilecoord$hash,Pv as ol$tilecoord$withinExtentAndZ,Sr as ol$tilegrid$TileGrid,hz as ol$tilegrid$WMTS,GS as ol$tilegrid$WMTS$createFromCapabilitiesMatrixSet,u1 as ol$tilegrid$common$DEFAULT_MAX_ZOOM,co as ol$tilegrid$common$DEFAULT_TILE_SIZE,uT as ol$tilegrid$createForExtent,t0 as ol$tilegrid$createForProjection,Io as ol$tilegrid$createXYZ,Rr as ol$tilegrid$extentFromProjection,e0 as ol$tilegrid$getForProjection,cT as ol$tilegrid$wrapX,dT as ol$tileurlfunction$createFromTemplate,Rd as ol$tileurlfunction$createFromTemplates,Va as ol$tileurlfunction$createFromTileUrlFunctions,Id as ol$tileurlfunction$expandUrl,fT as ol$tileurlfunction$nullTileUrlFunction,Je as ol$transform$apply,Ht as ol$transform$compose,PI as ol$transform$composeCssTransform,dt as ol$transform$create,X_ as ol$transform$determinant,OI as ol$transform$invert,Vs as ol$transform$makeInverse,V_ as ol$transform$makeScale,js as ol$transform$multiply,Ko as ol$transform$reset,j_ as ol$transform$rotate,Jo as ol$transform$scale,qo as ol$transform$set,B_ as ol$transform$setFromArray,Il as ol$transform$toString,Y_ as ol$transform$translate,ir as ol$uri$appendParams,Ou as ol$util$VERSION,he as ol$util$abstract,se as ol$util$getUid,zm as ol$vec$mat4$create,Mc as ol$vec$mat4$fromTransform,za as ol$webgl$ARRAY_BUFFER,Ba as ol$webgl$Buffer,HE as ol$webgl$Buffer$BufferUsage,wd as ol$webgl$Buffer$getArrayClassForType,Oc as ol$webgl$ContextEventType,Pc as ol$webgl$DYNAMIC_DRAW,Ac as ol$webgl$ELEMENT_ARRAY_BUFFER,Dm as ol$webgl$FLOAT,eT as ol$webgl$Helper,Jn as ol$webgl$Helper$AttributeType,bo as ol$webgl$Helper$DefaultUniform,x$ as ol$webgl$Helper$ShaderType,JE as ol$webgl$Helper$computeAttributesStride,Pb as ol$webgl$PaletteTexture,Um as ol$webgl$PostProcessingPass,iT as ol$webgl$RenderTarget,xd as ol$webgl$STATIC_DRAW,VE as ol$webgl$STREAM_DRAW,Yb as ol$webgl$ShaderBuilder$ShaderBuilder,Xb as ol$webgl$ShaderBuilder$parseLiteralStyle,Fb as ol$webgl$TileTexture,YE as ol$webgl$UNSIGNED_BYTE,ZE as ol$webgl$UNSIGNED_INT,XE as ol$webgl$UNSIGNED_SHORT,vd as ol$webgl$getContext,p$ as ol$webgl$getSupportedExtensions,jt as ol$xml$OBJECT_PROPERTY_NODE_FACTORY,ps as ol$xml$XML_SCHEMA_INSTANCE_URI,xe as ol$xml$createElementNS,xn as ol$xml$getAllTextContent,qg as ol$xml$getAllTextContent_,kv as ol$xml$getAttributeNS,mo as ol$xml$getDocument,$v as ol$xml$getXMLSerializer,Ci as ol$xml$isDocument,Jg as ol$xml$makeArrayExtender,ue as ol$xml$makeArrayPusher,Qg as ol$xml$makeArraySerializer,L as ol$xml$makeChildAppender,ut as ol$xml$makeObjectPropertyPusher,C as ol$xml$makeObjectPropertySetter,ge as ol$xml$makeReplacer,Rn as ol$xml$makeSequence,_t as ol$xml$makeSimpleNodeFactory,j as ol$xml$makeStructureNS,Li as ol$xml$parse,In as ol$xml$parseNode,V as ol$xml$pushParseAndPop,ve as ol$xml$pushSerializeAndPop,nA as ol$xml$registerDocument,tA as ol$xml$registerXMLSerializer,em as ol$xml$serialize};
|