@reearth/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +1 -0
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +1 -0
- package/dist/cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +1 -0
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +1 -0
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +1 -0
- package/dist/cesium/Widgets/Animation/Animation.css +127 -0
- package/dist/cesium/Widgets/Animation/lighter.css +70 -0
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +124 -0
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +14 -0
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +70 -0
- package/dist/cesium/Widgets/Geocoder/lighter.css +17 -0
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +92 -0
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/dist/cesium/Widgets/Timeline/Timeline.css +103 -0
- package/dist/cesium/Widgets/Timeline/lighter.css +23 -0
- package/dist/cesium/Widgets/VRButton/VRButton.css +8 -0
- package/dist/cesium/Widgets/Viewer/Viewer.css +107 -0
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/dist/cesium/Widgets/lighter.css +237 -0
- package/dist/cesium/Widgets/lighterShared.css +46 -0
- package/dist/cesium/Widgets/shared.css +103 -0
- package/dist/cesium/Widgets/widgets.css +1346 -0
- package/dist/cesium/Workers/chunk-2ED5WI77.js +26 -0
- package/dist/cesium/Workers/chunk-2MBPFWCP.js +26 -0
- package/dist/cesium/Workers/chunk-3C74MLG3.js +26 -0
- package/dist/cesium/Workers/chunk-45U7TTT3.js +26 -0
- package/dist/cesium/Workers/chunk-4N7SRDH5.js +26 -0
- package/dist/cesium/Workers/chunk-4T6AS6BZ.js +26 -0
- package/dist/cesium/Workers/chunk-5AG2MVRM.js +26 -0
- package/dist/cesium/Workers/chunk-5Z6L2FHX.js +26 -0
- package/dist/cesium/Workers/chunk-6AUUBDOF.js +26 -0
- package/dist/cesium/Workers/chunk-74N6MC2V.js +26 -0
- package/dist/cesium/Workers/chunk-7VJK3KHI.js +26 -0
- package/dist/cesium/Workers/chunk-7VZHIB6P.js +26 -0
- package/dist/cesium/Workers/chunk-7X2YQ6I4.js +27 -0
- package/dist/cesium/Workers/chunk-B2SKQ7LU.js +26 -0
- package/dist/cesium/Workers/chunk-B4TQDFIE.js +26 -0
- package/dist/cesium/Workers/chunk-B6TRTFAA.js +26 -0
- package/dist/cesium/Workers/chunk-BK3HCS7I.js +26 -0
- package/dist/cesium/Workers/chunk-BOPB43LN.js +26 -0
- package/dist/cesium/Workers/chunk-C6DMEJQ7.js +26 -0
- package/dist/cesium/Workers/chunk-CN7UN2OZ.js +26 -0
- package/dist/cesium/Workers/chunk-CSISXEG7.js +26 -0
- package/dist/cesium/Workers/chunk-CUOR5F7T.js +28 -0
- package/dist/cesium/Workers/chunk-DGCK3LD2.js +30 -0
- package/dist/cesium/Workers/chunk-DXEZYE3K.js +62 -0
- package/dist/cesium/Workers/chunk-EXBFEYPQ.js +26 -0
- package/dist/cesium/Workers/chunk-FK5KFB6H.js +26 -0
- package/dist/cesium/Workers/chunk-HPBHKP5S.js +26 -0
- package/dist/cesium/Workers/chunk-JCJ24DHF.js +26 -0
- package/dist/cesium/Workers/chunk-JEWHFDAA.js +26 -0
- package/dist/cesium/Workers/chunk-JZLZJJQD.js +26 -0
- package/dist/cesium/Workers/chunk-KRZBI2MU.js +26 -0
- package/dist/cesium/Workers/chunk-KTTUANTJ.js +26 -0
- package/dist/cesium/Workers/chunk-LDCAXLGS.js +26 -0
- package/dist/cesium/Workers/chunk-LOPN5R3I.js +26 -0
- package/dist/cesium/Workers/chunk-MDLPQIMP.js +26 -0
- package/dist/cesium/Workers/chunk-MRR3RGFO.js +26 -0
- package/dist/cesium/Workers/chunk-NPBZI5YA.js +26 -0
- package/dist/cesium/Workers/chunk-NUSW5B6A.js +26 -0
- package/dist/cesium/Workers/chunk-OUXRUXNB.js +26 -0
- package/dist/cesium/Workers/chunk-QPOPEH3M.js +26 -0
- package/dist/cesium/Workers/chunk-R2AN7EKC.js +26 -0
- package/dist/cesium/Workers/chunk-RURL6ZX2.js +26 -0
- package/dist/cesium/Workers/chunk-SUQM3OSW.js +28 -0
- package/dist/cesium/Workers/chunk-UBIRX2SP.js +26 -0
- package/dist/cesium/Workers/chunk-VAKC5J5C.js +26 -0
- package/dist/cesium/Workers/chunk-VHNZBQTR.js +27 -0
- package/dist/cesium/Workers/chunk-VKV642QV.js +26 -0
- package/dist/cesium/Workers/chunk-VMSXG4OA.js +26 -0
- package/dist/cesium/Workers/chunk-VQZSIOZW.js +26 -0
- package/dist/cesium/Workers/chunk-WZUWQMI7.js +26 -0
- package/dist/cesium/Workers/chunk-YBI55DLZ.js +26 -0
- package/dist/cesium/Workers/chunk-YEJWCH6C.js +26 -0
- package/dist/cesium/Workers/chunk-YPDO7SPO.js +26 -0
- package/dist/cesium/Workers/chunk-ZYWD6OQH.js +26 -0
- package/dist/cesium/Workers/combineGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createGeometry.js +26 -0
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createTaskProcessorWorker.js +26 -0
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +26 -0
- package/dist/cesium/Workers/createVectorTileGeometries.js +26 -0
- package/dist/cesium/Workers/createVectorTilePoints.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolygons.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolylines.js +26 -0
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +26 -0
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
- package/dist/cesium/Workers/createWallGeometry.js +26 -0
- package/dist/cesium/Workers/createWallOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/decodeDraco.js +26 -0
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
- package/dist/cesium/Workers/decodeI3S.js +26 -0
- package/dist/cesium/Workers/transcodeKTX2.js +56 -0
- package/dist/cesium/Workers/transferTypedArrayTest.js +26 -0
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +26 -0
- package/dist/core.js +83397 -0
- package/dist/core.umd.cjs +6710 -0
- package/dist/index-DqatWUTw.js +3225 -0
- package/dist/index.d.ts +1760 -0
- package/package.json +115 -0
- package/src/Map/ClusteredLayers/index.tsx +106 -0
- package/src/Map/Layer/hooks.ts +180 -0
- package/src/Map/Layer/index.tsx +92 -0
- package/src/Map/Layers/hooks.test.ts +819 -0
- package/src/Map/Layers/hooks.ts +955 -0
- package/src/Map/Layers/index.test.tsx +188 -0
- package/src/Map/Layers/index.tsx +76 -0
- package/src/Map/Layers/keys.ts +51 -0
- package/src/Map/Layers/utils.test.ts +53 -0
- package/src/Map/Layers/utils.ts +37 -0
- package/src/Map/Sketch/hooks.ts +641 -0
- package/src/Map/Sketch/index.tsx +101 -0
- package/src/Map/Sketch/preset.ts +29 -0
- package/src/Map/Sketch/sketchMachine.ts +323 -0
- package/src/Map/Sketch/sketchMachine.typegen.ts +72 -0
- package/src/Map/Sketch/types.ts +52 -0
- package/src/Map/Sketch/utils.ts +24 -0
- package/src/Map/hooks.ts +127 -0
- package/src/Map/index.tsx +147 -0
- package/src/Map/ref.ts +147 -0
- package/src/Map/types/event.ts +104 -0
- package/src/Map/types/index.ts +545 -0
- package/src/Map/useTimelineManager.ts +215 -0
- package/src/Map/utils.test.ts +62 -0
- package/src/Map/utils.ts +71 -0
- package/src/Visualizer/DropHolder.tsx +41 -0
- package/src/Visualizer/Error.tsx +15 -0
- package/src/Visualizer/context.tsx +27 -0
- package/src/Visualizer/coreContext.tsx +47 -0
- package/src/Visualizer/engines.ts +7 -0
- package/src/Visualizer/featureFlags.ts +9 -0
- package/src/Visualizer/hooks.ts +403 -0
- package/src/Visualizer/index.stories.tsx +128 -0
- package/src/Visualizer/index.tsx +187 -0
- package/src/Visualizer/interactionMode.ts +25 -0
- package/src/Visualizer/useViewport.ts +74 -0
- package/src/e2eConfig.ts +20 -0
- package/src/engines/Cesium/Cluster.tsx +90 -0
- package/src/engines/Cesium/Event.tsx +15 -0
- package/src/engines/Cesium/Feature/Box/Edge.tsx +94 -0
- package/src/engines/Cesium/Feature/Box/ScalePoints.tsx +158 -0
- package/src/engines/Cesium/Feature/Box/Side.tsx +70 -0
- package/src/engines/Cesium/Feature/Box/constants.ts +63 -0
- package/src/engines/Cesium/Feature/Box/hooks/box.ts +375 -0
- package/src/engines/Cesium/Feature/Box/hooks/edge.ts +112 -0
- package/src/engines/Cesium/Feature/Box/hooks/scalePoint.ts +174 -0
- package/src/engines/Cesium/Feature/Box/hooks/side.ts +72 -0
- package/src/engines/Cesium/Feature/Box/index.tsx +156 -0
- package/src/engines/Cesium/Feature/Box/utils.ts +168 -0
- package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +48 -0
- package/src/engines/Cesium/Feature/Ellipse/index.tsx +91 -0
- package/src/engines/Cesium/Feature/Ellipsoid/index.tsx +84 -0
- package/src/engines/Cesium/Feature/Frustum/FrustumColorAppearance.ts +38 -0
- package/src/engines/Cesium/Feature/Frustum/getFieldOfView.ts +23 -0
- package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +49 -0
- package/src/engines/Cesium/Feature/Frustum/index.tsx +163 -0
- package/src/engines/Cesium/Feature/Frustum/shaders/frustumAppearance.frag.glsl +31 -0
- package/src/engines/Cesium/Feature/Frustum/shaders/frustumAppearance.vert.glsl +29 -0
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +186 -0
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMeshMaterial.ts +81 -0
- package/src/engines/Cesium/Feature/HeatMap/colorMap.ts +47 -0
- package/src/engines/Cesium/Feature/HeatMap/constants.ts +781 -0
- package/src/engines/Cesium/Feature/HeatMap/createMeshImageData.ts +108 -0
- package/src/engines/Cesium/Feature/HeatMap/index.tsx +169 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/heatmapMeshMaterial.glsl +78 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/makeContour.glsl +13 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/sampleBicubic.glsl +57 -0
- package/src/engines/Cesium/Feature/Marker/index.tsx +296 -0
- package/src/engines/Cesium/Feature/Marker/marker.svg +3 -0
- package/src/engines/Cesium/Feature/Model/index.stories.tsx +48 -0
- package/src/engines/Cesium/Feature/Model/index.tsx +223 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +98 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +163 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/primPhotoIcon.svg +3 -0
- package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +174 -0
- package/src/engines/Cesium/Feature/Polygon/index.tsx +182 -0
- package/src/engines/Cesium/Feature/Polyline/index.tsx +98 -0
- package/src/engines/Cesium/Feature/Raster/hooks.ts +52 -0
- package/src/engines/Cesium/Feature/Raster/index.stories.tsx +77 -0
- package/src/engines/Cesium/Feature/Raster/index.tsx +37 -0
- package/src/engines/Cesium/Feature/Raster/mvt.ts +33 -0
- package/src/engines/Cesium/Feature/Raster/tiles.ts +27 -0
- package/src/engines/Cesium/Feature/Raster/tms.ts +31 -0
- package/src/engines/Cesium/Feature/Raster/types.ts +5 -0
- package/src/engines/Cesium/Feature/Raster/utils.test.ts +14 -0
- package/src/engines/Cesium/Feature/Raster/utils.ts +10 -0
- package/src/engines/Cesium/Feature/Raster/wms.ts +28 -0
- package/src/engines/Cesium/Feature/Resource/index.stories.tsx +46 -0
- package/src/engines/Cesium/Feature/Resource/index.tsx +218 -0
- package/src/engines/Cesium/Feature/Resource/utils.test.ts +69 -0
- package/src/engines/Cesium/Feature/Resource/utils.ts +377 -0
- package/src/engines/Cesium/Feature/Tileset/DrawClippingPolygon/index.tsx +77 -0
- package/src/engines/Cesium/Feature/Tileset/TilesetFeatureIndex.ts +46 -0
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +793 -0
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +41 -0
- package/src/engines/Cesium/Feature/Tileset/index.tsx +127 -0
- package/src/engines/Cesium/Feature/Tileset/types.ts +5 -0
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +457 -0
- package/src/engines/Cesium/Feature/Tileset/useDrawClipping.ts +200 -0
- package/src/engines/Cesium/Feature/context.ts +33 -0
- package/src/engines/Cesium/Feature/index.tsx +250 -0
- package/src/engines/Cesium/Feature/utils.test.tsx +30 -0
- package/src/engines/Cesium/Feature/utils.tsx +289 -0
- package/src/engines/Cesium/FeatureIndex.ts +15 -0
- package/src/engines/Cesium/JapanSeaLevelEllipsoid.ts +20 -0
- package/src/engines/Cesium/PostProcesses/README.md +1 -0
- package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusion.tsx +120 -0
- package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusionOutputType.ts +7 -0
- package/src/engines/Cesium/PostProcesses/hbao/README.md +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/config.ts +29 -0
- package/src/engines/Cesium/PostProcesses/hbao/createAmbientOcclusionStage.ts +173 -0
- package/src/engines/Cesium/PostProcesses/hbao/createCrossBilateralFilterStage.ts +94 -0
- package/src/engines/Cesium/PostProcesses/hbao/index.ts +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/ambientOcclusionGenerate.glsl +151 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/ambientOcclusionModulate.glsl +46 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/crossBilateralFilter.glsl +108 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/depth.glsl +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/globeDepth.glsl +15 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/highPassRandom.glsl +28 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/packing.glsl +7 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/reconstructNormal.glsl +109 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/reconstructPosition.glsl +10 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/turboColorMap.glsl +20 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/vogelDisk.glsl +13 -0
- package/src/engines/Cesium/Shaders/CustomShaders/NonPBRLightingShader.ts +66 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/Definitions.glsl +5 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/HeatmapForTerrain.glsl +13 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +57 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/README.md +13 -0
- package/src/engines/Cesium/Sketch/ControlPoint.tsx +67 -0
- package/src/engines/Cesium/Sketch/Entity.tsx +43 -0
- package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +51 -0
- package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +70 -0
- package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +75 -0
- package/src/engines/Cesium/Sketch/MeasurementText.tsx +13 -0
- package/src/engines/Cesium/Sketch/PolygonEntity.tsx +48 -0
- package/src/engines/Cesium/Sketch/PolylineEntity.tsx +44 -0
- package/src/engines/Cesium/Sketch/ScreenSpaceElement.tsx +87 -0
- package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +67 -0
- package/src/engines/Cesium/Sketch/SurfaceMeasurement.tsx +80 -0
- package/src/engines/Cesium/Sketch/createGeometry.ts +224 -0
- package/src/engines/Cesium/Sketch/index.tsx +119 -0
- package/src/engines/Cesium/Sketch/utils.ts +27 -0
- package/src/engines/Cesium/VertexTerrainElevationMaterial.ts +33 -0
- package/src/engines/Cesium/cameraLimiter.ts +256 -0
- package/src/engines/Cesium/common.test.ts +38 -0
- package/src/engines/Cesium/common.ts +901 -0
- package/src/engines/Cesium/constants.ts +25 -0
- package/src/engines/Cesium/core/Clock.tsx +58 -0
- package/src/engines/Cesium/core/Globe.tsx +136 -0
- package/src/engines/Cesium/core/Imagery.test.ts +102 -0
- package/src/engines/Cesium/core/Imagery.tsx +184 -0
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +141 -0
- package/src/engines/Cesium/core/Indicator/crosshair.svg +3 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +321 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryLayer.tsx +56 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryProvider.ts +146 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +258 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/getAnnotationType.ts +117 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/helpers.ts +24 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/index.ts +3 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/types.ts +26 -0
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +39 -0
- package/src/engines/Cesium/core/presets.ts +95 -0
- package/src/engines/Cesium/helpers/createUniforms.ts +64 -0
- package/src/engines/Cesium/helpers/sphericalHaromic.test.ts +33 -0
- package/src/engines/Cesium/helpers/sphericalHaromic.ts +27 -0
- package/src/engines/Cesium/hooks/useInstance.ts +98 -0
- package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +157 -0
- package/src/engines/Cesium/hooks/useSceneEvent.ts +47 -0
- package/src/engines/Cesium/hooks.ts +1004 -0
- package/src/engines/Cesium/index.stories.tsx +42 -0
- package/src/engines/Cesium/index.tsx +285 -0
- package/src/engines/Cesium/pickMany.ts +310 -0
- package/src/engines/Cesium/type.d.ts +47 -0
- package/src/engines/Cesium/types.ts +24 -0
- package/src/engines/Cesium/useEngineRef.test.tsx +627 -0
- package/src/engines/Cesium/useEngineRef.ts +945 -0
- package/src/engines/Cesium/useOverrideGlobeShader.ts +322 -0
- package/src/engines/Cesium/utils/mouse.ts +16 -0
- package/src/engines/Cesium/utils/polygon.ts +48 -0
- package/src/engines/Cesium/utils/utils.ts +446 -0
- package/src/engines/Cesium/vertexTerrainElevationMaterial.glsl +25 -0
- package/src/engines/index.ts +37 -0
- package/src/env.d.ts +3 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useRefFunction.ts +10 -0
- package/src/hooks/useRefValue.ts +7 -0
- package/src/index.ts +4 -0
- package/src/mantle/README.md +7 -0
- package/src/mantle/atoms/cache.test.ts +61 -0
- package/src/mantle/atoms/cache.ts +55 -0
- package/src/mantle/atoms/compute.test.ts +794 -0
- package/src/mantle/atoms/compute.ts +344 -0
- package/src/mantle/atoms/data.test.ts +182 -0
- package/src/mantle/atoms/data.ts +114 -0
- package/src/mantle/atoms/index.ts +1 -0
- package/src/mantle/compat/backward.test.ts +368 -0
- package/src/mantle/compat/backward.ts +189 -0
- package/src/mantle/compat/forward.test.ts +688 -0
- package/src/mantle/compat/forward.ts +272 -0
- package/src/mantle/compat/index.ts +4 -0
- package/src/mantle/compat/types.ts +73 -0
- package/src/mantle/data/csv.test.ts +478 -0
- package/src/mantle/data/csv.ts +194 -0
- package/src/mantle/data/geojson.ts +72 -0
- package/src/mantle/data/georss.ts +172 -0
- package/src/mantle/data/gml.ts +244 -0
- package/src/mantle/data/gpx.test.ts +65 -0
- package/src/mantle/data/gpx.ts +551 -0
- package/src/mantle/data/gtfs.ts +116 -0
- package/src/mantle/data/gtfsReader.ts +454 -0
- package/src/mantle/data/index.test.ts +16 -0
- package/src/mantle/data/index.ts +73 -0
- package/src/mantle/data/shapefile.ts +232 -0
- package/src/mantle/data/utils.ts +21 -0
- package/src/mantle/evaluator/index.ts +40 -0
- package/src/mantle/evaluator/simple/conditionalExpression/index.ts +60 -0
- package/src/mantle/evaluator/simple/expression/constants.ts +204 -0
- package/src/mantle/evaluator/simple/expression/expression.test.ts +63 -0
- package/src/mantle/evaluator/simple/expression/expression.ts +116 -0
- package/src/mantle/evaluator/simple/expression/functions/binaryFunctions.ts +43 -0
- package/src/mantle/evaluator/simple/expression/functions/colors.ts +189 -0
- package/src/mantle/evaluator/simple/expression/functions/index.ts +3 -0
- package/src/mantle/evaluator/simple/expression/functions/unaryFunctions.ts +54 -0
- package/src/mantle/evaluator/simple/expression/index.ts +1 -0
- package/src/mantle/evaluator/simple/expression/node.ts +570 -0
- package/src/mantle/evaluator/simple/expression/runtime.ts +266 -0
- package/src/mantle/evaluator/simple/expression/variableReplacer.test.ts +54 -0
- package/src/mantle/evaluator/simple/expression/variableReplacer.ts +121 -0
- package/src/mantle/evaluator/simple/index.test.ts +656 -0
- package/src/mantle/evaluator/simple/index.ts +178 -0
- package/src/mantle/evaluator/simple/interval.test.ts +102 -0
- package/src/mantle/evaluator/simple/interval.ts +27 -0
- package/src/mantle/evaluator/simple/utils.test.ts +56 -0
- package/src/mantle/evaluator/simple/utils.ts +31 -0
- package/src/mantle/index.ts +6 -0
- package/src/mantle/types/appearance.ts +318 -0
- package/src/mantle/types/events.ts +16 -0
- package/src/mantle/types/expression.ts +9 -0
- package/src/mantle/types/index.ts +156 -0
- package/src/mantle/types/value.ts +153 -0
- package/src/mantle/utils.test.ts +74 -0
- package/src/mantle/utils.ts +53 -0
- package/src/reearthTypes.ts +64 -0
- package/src/setupTests.ts +1 -0
- package/src/test/setup.ts +40 -0
- package/src/test/utils.tsx +40 -0
- package/src/types.ts +66 -0
- package/src/utils/StringMatcher.test.ts +132 -0
- package/src/utils/StringMatcher.ts +104 -0
- package/src/utils/assertType.ts +1 -0
- package/src/utils/generate-random-string.ts +9 -0
- package/src/utils/idle.ts +22 -0
- package/src/utils/image.ts +35 -0
- package/src/utils/index.ts +11 -0
- package/src/utils/object.ts +70 -0
- package/src/utils/raf.ts +58 -0
- package/src/utils/time.ts +18 -0
- package/src/utils/use-delayed-count.test.ts +139 -0
- package/src/utils/use-delayed-count.ts +65 -0
- package/src/utils/use-dnd/drag.ts +34 -0
- package/src/utils/use-dnd/drop.ts +93 -0
- package/src/utils/use-dnd/index.tsx +20 -0
- package/src/utils/use-dnd/types.ts +47 -0
- package/src/utils/util.ts +81 -0
- package/src/utils/value.ts +260 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,3225 @@
|
|
|
1
|
+
window.CESIUM_BASE_URL = "/cesium/";
|
|
2
|
+
var oe = typeof global < "u" ? global : typeof self < "u" ? self : typeof window < "u" ? window : {}, P = [], M = [], Qt = typeof Uint8Array < "u" ? Uint8Array : Array, je = !1;
|
|
3
|
+
function at() {
|
|
4
|
+
je = !0;
|
|
5
|
+
for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = 0, r = t.length; e < r; ++e)
|
|
6
|
+
P[e] = t[e], M[t.charCodeAt(e)] = e;
|
|
7
|
+
M[45] = 62, M[95] = 63;
|
|
8
|
+
}
|
|
9
|
+
function Ht(t) {
|
|
10
|
+
je || at();
|
|
11
|
+
var e, r, n, i, o, s, f = t.length;
|
|
12
|
+
if (f % 4 > 0)
|
|
13
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
14
|
+
o = t[f - 2] === "=" ? 2 : t[f - 1] === "=" ? 1 : 0, s = new Qt(f * 3 / 4 - o), n = o > 0 ? f - 4 : f;
|
|
15
|
+
var l = 0;
|
|
16
|
+
for (e = 0, r = 0; e < n; e += 4, r += 3)
|
|
17
|
+
i = M[t.charCodeAt(e)] << 18 | M[t.charCodeAt(e + 1)] << 12 | M[t.charCodeAt(e + 2)] << 6 | M[t.charCodeAt(e + 3)], s[l++] = i >> 16 & 255, s[l++] = i >> 8 & 255, s[l++] = i & 255;
|
|
18
|
+
return o === 2 ? (i = M[t.charCodeAt(e)] << 2 | M[t.charCodeAt(e + 1)] >> 4, s[l++] = i & 255) : o === 1 && (i = M[t.charCodeAt(e)] << 10 | M[t.charCodeAt(e + 1)] << 4 | M[t.charCodeAt(e + 2)] >> 2, s[l++] = i >> 8 & 255, s[l++] = i & 255), s;
|
|
19
|
+
}
|
|
20
|
+
function Gt(t) {
|
|
21
|
+
return P[t >> 18 & 63] + P[t >> 12 & 63] + P[t >> 6 & 63] + P[t & 63];
|
|
22
|
+
}
|
|
23
|
+
function Zt(t, e, r) {
|
|
24
|
+
for (var n, i = [], o = e; o < r; o += 3)
|
|
25
|
+
n = (t[o] << 16) + (t[o + 1] << 8) + t[o + 2], i.push(Gt(n));
|
|
26
|
+
return i.join("");
|
|
27
|
+
}
|
|
28
|
+
function Qe(t) {
|
|
29
|
+
je || at();
|
|
30
|
+
for (var e, r = t.length, n = r % 3, i = "", o = [], s = 16383, f = 0, l = r - n; f < l; f += s)
|
|
31
|
+
o.push(Zt(t, f, f + s > l ? l : f + s));
|
|
32
|
+
return n === 1 ? (e = t[r - 1], i += P[e >> 2], i += P[e << 4 & 63], i += "==") : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], i += P[e >> 10], i += P[e >> 4 & 63], i += P[e << 2 & 63], i += "="), o.push(i), o.join("");
|
|
33
|
+
}
|
|
34
|
+
function be(t, e, r, n, i) {
|
|
35
|
+
var o, s, f = i * 8 - n - 1, l = (1 << f) - 1, u = l >> 1, h = -7, c = r ? i - 1 : 0, g = r ? -1 : 1, v = t[e + c];
|
|
36
|
+
for (c += g, o = v & (1 << -h) - 1, v >>= -h, h += f; h > 0; o = o * 256 + t[e + c], c += g, h -= 8)
|
|
37
|
+
;
|
|
38
|
+
for (s = o & (1 << -h) - 1, o >>= -h, h += n; h > 0; s = s * 256 + t[e + c], c += g, h -= 8)
|
|
39
|
+
;
|
|
40
|
+
if (o === 0)
|
|
41
|
+
o = 1 - u;
|
|
42
|
+
else {
|
|
43
|
+
if (o === l)
|
|
44
|
+
return s ? NaN : (v ? -1 : 1) * (1 / 0);
|
|
45
|
+
s = s + Math.pow(2, n), o = o - u;
|
|
46
|
+
}
|
|
47
|
+
return (v ? -1 : 1) * s * Math.pow(2, o - n);
|
|
48
|
+
}
|
|
49
|
+
function lt(t, e, r, n, i, o) {
|
|
50
|
+
var s, f, l, u = o * 8 - i - 1, h = (1 << u) - 1, c = h >> 1, g = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, v = n ? 0 : o - 1, A = n ? 1 : -1, x = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
51
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (f = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -s)) < 1 && (s--, l *= 2), s + c >= 1 ? e += g / l : e += g * Math.pow(2, 1 - c), e * l >= 2 && (s++, l /= 2), s + c >= h ? (f = 0, s = h) : s + c >= 1 ? (f = (e * l - 1) * Math.pow(2, i), s = s + c) : (f = e * Math.pow(2, c - 1) * Math.pow(2, i), s = 0)); i >= 8; t[r + v] = f & 255, v += A, f /= 256, i -= 8)
|
|
52
|
+
;
|
|
53
|
+
for (s = s << i | f, u += i; u > 0; t[r + v] = s & 255, v += A, s /= 256, u -= 8)
|
|
54
|
+
;
|
|
55
|
+
t[r + v - A] |= x * 128;
|
|
56
|
+
}
|
|
57
|
+
var Xt = {}.toString, ut = Array.isArray || function(t) {
|
|
58
|
+
return Xt.call(t) == "[object Array]";
|
|
59
|
+
}, Kt = 50;
|
|
60
|
+
a.TYPED_ARRAY_SUPPORT = oe.TYPED_ARRAY_SUPPORT !== void 0 ? oe.TYPED_ARRAY_SUPPORT : !0;
|
|
61
|
+
we();
|
|
62
|
+
function we() {
|
|
63
|
+
return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
|
|
64
|
+
}
|
|
65
|
+
function $(t, e) {
|
|
66
|
+
if (we() < e)
|
|
67
|
+
throw new RangeError("Invalid typed array length");
|
|
68
|
+
return a.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e), t.__proto__ = a.prototype) : (t === null && (t = new a(e)), t.length = e), t;
|
|
69
|
+
}
|
|
70
|
+
function a(t, e, r) {
|
|
71
|
+
if (!a.TYPED_ARRAY_SUPPORT && !(this instanceof a))
|
|
72
|
+
return new a(t, e, r);
|
|
73
|
+
if (typeof t == "number") {
|
|
74
|
+
if (typeof e == "string")
|
|
75
|
+
throw new Error(
|
|
76
|
+
"If encoding is specified then the first argument must be a string"
|
|
77
|
+
);
|
|
78
|
+
return $e(this, t);
|
|
79
|
+
}
|
|
80
|
+
return ht(this, t, e, r);
|
|
81
|
+
}
|
|
82
|
+
a.poolSize = 8192;
|
|
83
|
+
a._augment = function(t) {
|
|
84
|
+
return t.__proto__ = a.prototype, t;
|
|
85
|
+
};
|
|
86
|
+
function ht(t, e, r, n) {
|
|
87
|
+
if (typeof e == "number")
|
|
88
|
+
throw new TypeError('"value" argument must not be a number');
|
|
89
|
+
return typeof ArrayBuffer < "u" && e instanceof ArrayBuffer ? rr(t, e, r, n) : typeof e == "string" ? tr(t, e, r) : nr(t, e);
|
|
90
|
+
}
|
|
91
|
+
a.from = function(t, e, r) {
|
|
92
|
+
return ht(null, t, e, r);
|
|
93
|
+
};
|
|
94
|
+
a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype, a.__proto__ = Uint8Array, typeof Symbol < "u" && Symbol.species && a[Symbol.species]);
|
|
95
|
+
function ct(t) {
|
|
96
|
+
if (typeof t != "number")
|
|
97
|
+
throw new TypeError('"size" argument must be a number');
|
|
98
|
+
if (t < 0)
|
|
99
|
+
throw new RangeError('"size" argument must not be negative');
|
|
100
|
+
}
|
|
101
|
+
function er(t, e, r, n) {
|
|
102
|
+
return ct(e), e <= 0 ? $(t, e) : r !== void 0 ? typeof n == "string" ? $(t, e).fill(r, n) : $(t, e).fill(r) : $(t, e);
|
|
103
|
+
}
|
|
104
|
+
a.alloc = function(t, e, r) {
|
|
105
|
+
return er(null, t, e, r);
|
|
106
|
+
};
|
|
107
|
+
function $e(t, e) {
|
|
108
|
+
if (ct(e), t = $(t, e < 0 ? 0 : qe(e) | 0), !a.TYPED_ARRAY_SUPPORT)
|
|
109
|
+
for (var r = 0; r < e; ++r)
|
|
110
|
+
t[r] = 0;
|
|
111
|
+
return t;
|
|
112
|
+
}
|
|
113
|
+
a.allocUnsafe = function(t) {
|
|
114
|
+
return $e(null, t);
|
|
115
|
+
};
|
|
116
|
+
a.allocUnsafeSlow = function(t) {
|
|
117
|
+
return $e(null, t);
|
|
118
|
+
};
|
|
119
|
+
function tr(t, e, r) {
|
|
120
|
+
if ((typeof r != "string" || r === "") && (r = "utf8"), !a.isEncoding(r))
|
|
121
|
+
throw new TypeError('"encoding" must be a valid string encoding');
|
|
122
|
+
var n = dt(e, r) | 0;
|
|
123
|
+
t = $(t, n);
|
|
124
|
+
var i = t.write(e, r);
|
|
125
|
+
return i !== n && (t = t.slice(0, i)), t;
|
|
126
|
+
}
|
|
127
|
+
function Be(t, e) {
|
|
128
|
+
var r = e.length < 0 ? 0 : qe(e.length) | 0;
|
|
129
|
+
t = $(t, r);
|
|
130
|
+
for (var n = 0; n < r; n += 1)
|
|
131
|
+
t[n] = e[n] & 255;
|
|
132
|
+
return t;
|
|
133
|
+
}
|
|
134
|
+
function rr(t, e, r, n) {
|
|
135
|
+
if (e.byteLength, r < 0 || e.byteLength < r)
|
|
136
|
+
throw new RangeError("'offset' is out of bounds");
|
|
137
|
+
if (e.byteLength < r + (n || 0))
|
|
138
|
+
throw new RangeError("'length' is out of bounds");
|
|
139
|
+
return r === void 0 && n === void 0 ? e = new Uint8Array(e) : n === void 0 ? e = new Uint8Array(e, r) : e = new Uint8Array(e, r, n), a.TYPED_ARRAY_SUPPORT ? (t = e, t.__proto__ = a.prototype) : t = Be(t, e), t;
|
|
140
|
+
}
|
|
141
|
+
function nr(t, e) {
|
|
142
|
+
if (j(e)) {
|
|
143
|
+
var r = qe(e.length) | 0;
|
|
144
|
+
return t = $(t, r), t.length === 0 || e.copy(t, 0, 0, r), t;
|
|
145
|
+
}
|
|
146
|
+
if (e) {
|
|
147
|
+
if (typeof ArrayBuffer < "u" && e.buffer instanceof ArrayBuffer || "length" in e)
|
|
148
|
+
return typeof e.length != "number" || xr(e.length) ? $(t, 0) : Be(t, e);
|
|
149
|
+
if (e.type === "Buffer" && ut(e.data))
|
|
150
|
+
return Be(t, e.data);
|
|
151
|
+
}
|
|
152
|
+
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
153
|
+
}
|
|
154
|
+
function qe(t) {
|
|
155
|
+
if (t >= we())
|
|
156
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + we().toString(16) + " bytes");
|
|
157
|
+
return t | 0;
|
|
158
|
+
}
|
|
159
|
+
a.isBuffer = T;
|
|
160
|
+
function j(t) {
|
|
161
|
+
return !!(t != null && t._isBuffer);
|
|
162
|
+
}
|
|
163
|
+
a.compare = function(e, r) {
|
|
164
|
+
if (!j(e) || !j(r))
|
|
165
|
+
throw new TypeError("Arguments must be Buffers");
|
|
166
|
+
if (e === r)
|
|
167
|
+
return 0;
|
|
168
|
+
for (var n = e.length, i = r.length, o = 0, s = Math.min(n, i); o < s; ++o)
|
|
169
|
+
if (e[o] !== r[o]) {
|
|
170
|
+
n = e[o], i = r[o];
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
return n < i ? -1 : i < n ? 1 : 0;
|
|
174
|
+
};
|
|
175
|
+
a.isEncoding = function(e) {
|
|
176
|
+
switch (String(e).toLowerCase()) {
|
|
177
|
+
case "hex":
|
|
178
|
+
case "utf8":
|
|
179
|
+
case "utf-8":
|
|
180
|
+
case "ascii":
|
|
181
|
+
case "latin1":
|
|
182
|
+
case "binary":
|
|
183
|
+
case "base64":
|
|
184
|
+
case "ucs2":
|
|
185
|
+
case "ucs-2":
|
|
186
|
+
case "utf16le":
|
|
187
|
+
case "utf-16le":
|
|
188
|
+
return !0;
|
|
189
|
+
default:
|
|
190
|
+
return !1;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
a.concat = function(e, r) {
|
|
194
|
+
if (!ut(e))
|
|
195
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
196
|
+
if (e.length === 0)
|
|
197
|
+
return a.alloc(0);
|
|
198
|
+
var n;
|
|
199
|
+
if (r === void 0)
|
|
200
|
+
for (r = 0, n = 0; n < e.length; ++n)
|
|
201
|
+
r += e[n].length;
|
|
202
|
+
var i = a.allocUnsafe(r), o = 0;
|
|
203
|
+
for (n = 0; n < e.length; ++n) {
|
|
204
|
+
var s = e[n];
|
|
205
|
+
if (!j(s))
|
|
206
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
207
|
+
s.copy(i, o), o += s.length;
|
|
208
|
+
}
|
|
209
|
+
return i;
|
|
210
|
+
};
|
|
211
|
+
function dt(t, e) {
|
|
212
|
+
if (j(t))
|
|
213
|
+
return t.length;
|
|
214
|
+
if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer))
|
|
215
|
+
return t.byteLength;
|
|
216
|
+
typeof t != "string" && (t = "" + t);
|
|
217
|
+
var r = t.length;
|
|
218
|
+
if (r === 0)
|
|
219
|
+
return 0;
|
|
220
|
+
for (var n = !1; ; )
|
|
221
|
+
switch (e) {
|
|
222
|
+
case "ascii":
|
|
223
|
+
case "latin1":
|
|
224
|
+
case "binary":
|
|
225
|
+
return r;
|
|
226
|
+
case "utf8":
|
|
227
|
+
case "utf-8":
|
|
228
|
+
case void 0:
|
|
229
|
+
return ye(t).length;
|
|
230
|
+
case "ucs2":
|
|
231
|
+
case "ucs-2":
|
|
232
|
+
case "utf16le":
|
|
233
|
+
case "utf-16le":
|
|
234
|
+
return r * 2;
|
|
235
|
+
case "hex":
|
|
236
|
+
return r >>> 1;
|
|
237
|
+
case "base64":
|
|
238
|
+
return vt(t).length;
|
|
239
|
+
default:
|
|
240
|
+
if (n)
|
|
241
|
+
return ye(t).length;
|
|
242
|
+
e = ("" + e).toLowerCase(), n = !0;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
a.byteLength = dt;
|
|
246
|
+
function ir(t, e, r) {
|
|
247
|
+
var n = !1;
|
|
248
|
+
if ((e === void 0 || e < 0) && (e = 0), e > this.length || ((r === void 0 || r > this.length) && (r = this.length), r <= 0) || (r >>>= 0, e >>>= 0, r <= e))
|
|
249
|
+
return "";
|
|
250
|
+
for (t || (t = "utf8"); ; )
|
|
251
|
+
switch (t) {
|
|
252
|
+
case "hex":
|
|
253
|
+
return pr(this, e, r);
|
|
254
|
+
case "utf8":
|
|
255
|
+
case "utf-8":
|
|
256
|
+
return gt(this, e, r);
|
|
257
|
+
case "ascii":
|
|
258
|
+
return cr(this, e, r);
|
|
259
|
+
case "latin1":
|
|
260
|
+
case "binary":
|
|
261
|
+
return dr(this, e, r);
|
|
262
|
+
case "base64":
|
|
263
|
+
return ur(this, e, r);
|
|
264
|
+
case "ucs2":
|
|
265
|
+
case "ucs-2":
|
|
266
|
+
case "utf16le":
|
|
267
|
+
case "utf-16le":
|
|
268
|
+
return mr(this, e, r);
|
|
269
|
+
default:
|
|
270
|
+
if (n)
|
|
271
|
+
throw new TypeError("Unknown encoding: " + t);
|
|
272
|
+
t = (t + "").toLowerCase(), n = !0;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
a.prototype._isBuffer = !0;
|
|
276
|
+
function X(t, e, r) {
|
|
277
|
+
var n = t[e];
|
|
278
|
+
t[e] = t[r], t[r] = n;
|
|
279
|
+
}
|
|
280
|
+
a.prototype.swap16 = function() {
|
|
281
|
+
var e = this.length;
|
|
282
|
+
if (e % 2 !== 0)
|
|
283
|
+
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
284
|
+
for (var r = 0; r < e; r += 2)
|
|
285
|
+
X(this, r, r + 1);
|
|
286
|
+
return this;
|
|
287
|
+
};
|
|
288
|
+
a.prototype.swap32 = function() {
|
|
289
|
+
var e = this.length;
|
|
290
|
+
if (e % 4 !== 0)
|
|
291
|
+
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
292
|
+
for (var r = 0; r < e; r += 4)
|
|
293
|
+
X(this, r, r + 3), X(this, r + 1, r + 2);
|
|
294
|
+
return this;
|
|
295
|
+
};
|
|
296
|
+
a.prototype.swap64 = function() {
|
|
297
|
+
var e = this.length;
|
|
298
|
+
if (e % 8 !== 0)
|
|
299
|
+
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
300
|
+
for (var r = 0; r < e; r += 8)
|
|
301
|
+
X(this, r, r + 7), X(this, r + 1, r + 6), X(this, r + 2, r + 5), X(this, r + 3, r + 4);
|
|
302
|
+
return this;
|
|
303
|
+
};
|
|
304
|
+
a.prototype.toString = function() {
|
|
305
|
+
var e = this.length | 0;
|
|
306
|
+
return e === 0 ? "" : arguments.length === 0 ? gt(this, 0, e) : ir.apply(this, arguments);
|
|
307
|
+
};
|
|
308
|
+
a.prototype.equals = function(e) {
|
|
309
|
+
if (!j(e))
|
|
310
|
+
throw new TypeError("Argument must be a Buffer");
|
|
311
|
+
return this === e ? !0 : a.compare(this, e) === 0;
|
|
312
|
+
};
|
|
313
|
+
a.prototype.inspect = function() {
|
|
314
|
+
var e = "", r = Kt;
|
|
315
|
+
return this.length > 0 && (e = this.toString("hex", 0, r).match(/.{2}/g).join(" "), this.length > r && (e += " ... ")), "<Buffer " + e + ">";
|
|
316
|
+
};
|
|
317
|
+
a.prototype.compare = function(e, r, n, i, o) {
|
|
318
|
+
if (!j(e))
|
|
319
|
+
throw new TypeError("Argument must be a Buffer");
|
|
320
|
+
if (r === void 0 && (r = 0), n === void 0 && (n = e ? e.length : 0), i === void 0 && (i = 0), o === void 0 && (o = this.length), r < 0 || n > e.length || i < 0 || o > this.length)
|
|
321
|
+
throw new RangeError("out of range index");
|
|
322
|
+
if (i >= o && r >= n)
|
|
323
|
+
return 0;
|
|
324
|
+
if (i >= o)
|
|
325
|
+
return -1;
|
|
326
|
+
if (r >= n)
|
|
327
|
+
return 1;
|
|
328
|
+
if (r >>>= 0, n >>>= 0, i >>>= 0, o >>>= 0, this === e)
|
|
329
|
+
return 0;
|
|
330
|
+
for (var s = o - i, f = n - r, l = Math.min(s, f), u = this.slice(i, o), h = e.slice(r, n), c = 0; c < l; ++c)
|
|
331
|
+
if (u[c] !== h[c]) {
|
|
332
|
+
s = u[c], f = h[c];
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
return s < f ? -1 : f < s ? 1 : 0;
|
|
336
|
+
};
|
|
337
|
+
function pt(t, e, r, n, i) {
|
|
338
|
+
if (t.length === 0)
|
|
339
|
+
return -1;
|
|
340
|
+
if (typeof r == "string" ? (n = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, isNaN(r) && (r = i ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {
|
|
341
|
+
if (i)
|
|
342
|
+
return -1;
|
|
343
|
+
r = t.length - 1;
|
|
344
|
+
} else if (r < 0)
|
|
345
|
+
if (i)
|
|
346
|
+
r = 0;
|
|
347
|
+
else
|
|
348
|
+
return -1;
|
|
349
|
+
if (typeof e == "string" && (e = a.from(e, n)), j(e))
|
|
350
|
+
return e.length === 0 ? -1 : He(t, e, r, n, i);
|
|
351
|
+
if (typeof e == "number")
|
|
352
|
+
return e = e & 255, a.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf == "function" ? i ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : He(t, [e], r, n, i);
|
|
353
|
+
throw new TypeError("val must be string, number or Buffer");
|
|
354
|
+
}
|
|
355
|
+
function He(t, e, r, n, i) {
|
|
356
|
+
var o = 1, s = t.length, f = e.length;
|
|
357
|
+
if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
|
|
358
|
+
if (t.length < 2 || e.length < 2)
|
|
359
|
+
return -1;
|
|
360
|
+
o = 2, s /= 2, f /= 2, r /= 2;
|
|
361
|
+
}
|
|
362
|
+
function l(v, A) {
|
|
363
|
+
return o === 1 ? v[A] : v.readUInt16BE(A * o);
|
|
364
|
+
}
|
|
365
|
+
var u;
|
|
366
|
+
if (i) {
|
|
367
|
+
var h = -1;
|
|
368
|
+
for (u = r; u < s; u++)
|
|
369
|
+
if (l(t, u) === l(e, h === -1 ? 0 : u - h)) {
|
|
370
|
+
if (h === -1 && (h = u), u - h + 1 === f)
|
|
371
|
+
return h * o;
|
|
372
|
+
} else
|
|
373
|
+
h !== -1 && (u -= u - h), h = -1;
|
|
374
|
+
} else
|
|
375
|
+
for (r + f > s && (r = s - f), u = r; u >= 0; u--) {
|
|
376
|
+
for (var c = !0, g = 0; g < f; g++)
|
|
377
|
+
if (l(t, u + g) !== l(e, g)) {
|
|
378
|
+
c = !1;
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
if (c)
|
|
382
|
+
return u;
|
|
383
|
+
}
|
|
384
|
+
return -1;
|
|
385
|
+
}
|
|
386
|
+
a.prototype.includes = function(e, r, n) {
|
|
387
|
+
return this.indexOf(e, r, n) !== -1;
|
|
388
|
+
};
|
|
389
|
+
a.prototype.indexOf = function(e, r, n) {
|
|
390
|
+
return pt(this, e, r, n, !0);
|
|
391
|
+
};
|
|
392
|
+
a.prototype.lastIndexOf = function(e, r, n) {
|
|
393
|
+
return pt(this, e, r, n, !1);
|
|
394
|
+
};
|
|
395
|
+
function or(t, e, r, n) {
|
|
396
|
+
r = Number(r) || 0;
|
|
397
|
+
var i = t.length - r;
|
|
398
|
+
n ? (n = Number(n), n > i && (n = i)) : n = i;
|
|
399
|
+
var o = e.length;
|
|
400
|
+
if (o % 2 !== 0)
|
|
401
|
+
throw new TypeError("Invalid hex string");
|
|
402
|
+
n > o / 2 && (n = o / 2);
|
|
403
|
+
for (var s = 0; s < n; ++s) {
|
|
404
|
+
var f = parseInt(e.substr(s * 2, 2), 16);
|
|
405
|
+
if (isNaN(f))
|
|
406
|
+
return s;
|
|
407
|
+
t[r + s] = f;
|
|
408
|
+
}
|
|
409
|
+
return s;
|
|
410
|
+
}
|
|
411
|
+
function sr(t, e, r, n) {
|
|
412
|
+
return Se(ye(e, t.length - r), t, r, n);
|
|
413
|
+
}
|
|
414
|
+
function mt(t, e, r, n) {
|
|
415
|
+
return Se(vr(e), t, r, n);
|
|
416
|
+
}
|
|
417
|
+
function fr(t, e, r, n) {
|
|
418
|
+
return mt(t, e, r, n);
|
|
419
|
+
}
|
|
420
|
+
function ar(t, e, r, n) {
|
|
421
|
+
return Se(vt(e), t, r, n);
|
|
422
|
+
}
|
|
423
|
+
function lr(t, e, r, n) {
|
|
424
|
+
return Se(br(e, t.length - r), t, r, n);
|
|
425
|
+
}
|
|
426
|
+
a.prototype.write = function(e, r, n, i) {
|
|
427
|
+
if (r === void 0)
|
|
428
|
+
i = "utf8", n = this.length, r = 0;
|
|
429
|
+
else if (n === void 0 && typeof r == "string")
|
|
430
|
+
i = r, n = this.length, r = 0;
|
|
431
|
+
else if (isFinite(r))
|
|
432
|
+
r = r | 0, isFinite(n) ? (n = n | 0, i === void 0 && (i = "utf8")) : (i = n, n = void 0);
|
|
433
|
+
else
|
|
434
|
+
throw new Error(
|
|
435
|
+
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
436
|
+
);
|
|
437
|
+
var o = this.length - r;
|
|
438
|
+
if ((n === void 0 || n > o) && (n = o), e.length > 0 && (n < 0 || r < 0) || r > this.length)
|
|
439
|
+
throw new RangeError("Attempt to write outside buffer bounds");
|
|
440
|
+
i || (i = "utf8");
|
|
441
|
+
for (var s = !1; ; )
|
|
442
|
+
switch (i) {
|
|
443
|
+
case "hex":
|
|
444
|
+
return or(this, e, r, n);
|
|
445
|
+
case "utf8":
|
|
446
|
+
case "utf-8":
|
|
447
|
+
return sr(this, e, r, n);
|
|
448
|
+
case "ascii":
|
|
449
|
+
return mt(this, e, r, n);
|
|
450
|
+
case "latin1":
|
|
451
|
+
case "binary":
|
|
452
|
+
return fr(this, e, r, n);
|
|
453
|
+
case "base64":
|
|
454
|
+
return ar(this, e, r, n);
|
|
455
|
+
case "ucs2":
|
|
456
|
+
case "ucs-2":
|
|
457
|
+
case "utf16le":
|
|
458
|
+
case "utf-16le":
|
|
459
|
+
return lr(this, e, r, n);
|
|
460
|
+
default:
|
|
461
|
+
if (s)
|
|
462
|
+
throw new TypeError("Unknown encoding: " + i);
|
|
463
|
+
i = ("" + i).toLowerCase(), s = !0;
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
a.prototype.toJSON = function() {
|
|
467
|
+
return {
|
|
468
|
+
type: "Buffer",
|
|
469
|
+
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
function ur(t, e, r) {
|
|
473
|
+
return e === 0 && r === t.length ? Qe(t) : Qe(t.slice(e, r));
|
|
474
|
+
}
|
|
475
|
+
function gt(t, e, r) {
|
|
476
|
+
r = Math.min(t.length, r);
|
|
477
|
+
for (var n = [], i = e; i < r; ) {
|
|
478
|
+
var o = t[i], s = null, f = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
|
|
479
|
+
if (i + f <= r) {
|
|
480
|
+
var l, u, h, c;
|
|
481
|
+
switch (f) {
|
|
482
|
+
case 1:
|
|
483
|
+
o < 128 && (s = o);
|
|
484
|
+
break;
|
|
485
|
+
case 2:
|
|
486
|
+
l = t[i + 1], (l & 192) === 128 && (c = (o & 31) << 6 | l & 63, c > 127 && (s = c));
|
|
487
|
+
break;
|
|
488
|
+
case 3:
|
|
489
|
+
l = t[i + 1], u = t[i + 2], (l & 192) === 128 && (u & 192) === 128 && (c = (o & 15) << 12 | (l & 63) << 6 | u & 63, c > 2047 && (c < 55296 || c > 57343) && (s = c));
|
|
490
|
+
break;
|
|
491
|
+
case 4:
|
|
492
|
+
l = t[i + 1], u = t[i + 2], h = t[i + 3], (l & 192) === 128 && (u & 192) === 128 && (h & 192) === 128 && (c = (o & 15) << 18 | (l & 63) << 12 | (u & 63) << 6 | h & 63, c > 65535 && c < 1114112 && (s = c));
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
s === null ? (s = 65533, f = 1) : s > 65535 && (s -= 65536, n.push(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), n.push(s), i += f;
|
|
496
|
+
}
|
|
497
|
+
return hr(n);
|
|
498
|
+
}
|
|
499
|
+
var Ge = 4096;
|
|
500
|
+
function hr(t) {
|
|
501
|
+
var e = t.length;
|
|
502
|
+
if (e <= Ge)
|
|
503
|
+
return String.fromCharCode.apply(String, t);
|
|
504
|
+
for (var r = "", n = 0; n < e; )
|
|
505
|
+
r += String.fromCharCode.apply(
|
|
506
|
+
String,
|
|
507
|
+
t.slice(n, n += Ge)
|
|
508
|
+
);
|
|
509
|
+
return r;
|
|
510
|
+
}
|
|
511
|
+
function cr(t, e, r) {
|
|
512
|
+
var n = "";
|
|
513
|
+
r = Math.min(t.length, r);
|
|
514
|
+
for (var i = e; i < r; ++i)
|
|
515
|
+
n += String.fromCharCode(t[i] & 127);
|
|
516
|
+
return n;
|
|
517
|
+
}
|
|
518
|
+
function dr(t, e, r) {
|
|
519
|
+
var n = "";
|
|
520
|
+
r = Math.min(t.length, r);
|
|
521
|
+
for (var i = e; i < r; ++i)
|
|
522
|
+
n += String.fromCharCode(t[i]);
|
|
523
|
+
return n;
|
|
524
|
+
}
|
|
525
|
+
function pr(t, e, r) {
|
|
526
|
+
var n = t.length;
|
|
527
|
+
(!e || e < 0) && (e = 0), (!r || r < 0 || r > n) && (r = n);
|
|
528
|
+
for (var i = "", o = e; o < r; ++o)
|
|
529
|
+
i += yr(t[o]);
|
|
530
|
+
return i;
|
|
531
|
+
}
|
|
532
|
+
function mr(t, e, r) {
|
|
533
|
+
for (var n = t.slice(e, r), i = "", o = 0; o < n.length; o += 2)
|
|
534
|
+
i += String.fromCharCode(n[o] + n[o + 1] * 256);
|
|
535
|
+
return i;
|
|
536
|
+
}
|
|
537
|
+
a.prototype.slice = function(e, r) {
|
|
538
|
+
var n = this.length;
|
|
539
|
+
e = ~~e, r = r === void 0 ? n : ~~r, e < 0 ? (e += n, e < 0 && (e = 0)) : e > n && (e = n), r < 0 ? (r += n, r < 0 && (r = 0)) : r > n && (r = n), r < e && (r = e);
|
|
540
|
+
var i;
|
|
541
|
+
if (a.TYPED_ARRAY_SUPPORT)
|
|
542
|
+
i = this.subarray(e, r), i.__proto__ = a.prototype;
|
|
543
|
+
else {
|
|
544
|
+
var o = r - e;
|
|
545
|
+
i = new a(o, void 0);
|
|
546
|
+
for (var s = 0; s < o; ++s)
|
|
547
|
+
i[s] = this[s + e];
|
|
548
|
+
}
|
|
549
|
+
return i;
|
|
550
|
+
};
|
|
551
|
+
function I(t, e, r) {
|
|
552
|
+
if (t % 1 !== 0 || t < 0)
|
|
553
|
+
throw new RangeError("offset is not uint");
|
|
554
|
+
if (t + e > r)
|
|
555
|
+
throw new RangeError("Trying to access beyond buffer length");
|
|
556
|
+
}
|
|
557
|
+
a.prototype.readUIntLE = function(e, r, n) {
|
|
558
|
+
e = e | 0, r = r | 0, n || I(e, r, this.length);
|
|
559
|
+
for (var i = this[e], o = 1, s = 0; ++s < r && (o *= 256); )
|
|
560
|
+
i += this[e + s] * o;
|
|
561
|
+
return i;
|
|
562
|
+
};
|
|
563
|
+
a.prototype.readUIntBE = function(e, r, n) {
|
|
564
|
+
e = e | 0, r = r | 0, n || I(e, r, this.length);
|
|
565
|
+
for (var i = this[e + --r], o = 1; r > 0 && (o *= 256); )
|
|
566
|
+
i += this[e + --r] * o;
|
|
567
|
+
return i;
|
|
568
|
+
};
|
|
569
|
+
a.prototype.readUInt8 = function(e, r) {
|
|
570
|
+
return r || I(e, 1, this.length), this[e];
|
|
571
|
+
};
|
|
572
|
+
a.prototype.readUInt16LE = function(e, r) {
|
|
573
|
+
return r || I(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
574
|
+
};
|
|
575
|
+
a.prototype.readUInt16BE = function(e, r) {
|
|
576
|
+
return r || I(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
577
|
+
};
|
|
578
|
+
a.prototype.readUInt32LE = function(e, r) {
|
|
579
|
+
return r || I(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + this[e + 3] * 16777216;
|
|
580
|
+
};
|
|
581
|
+
a.prototype.readUInt32BE = function(e, r) {
|
|
582
|
+
return r || I(e, 4, this.length), this[e] * 16777216 + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
583
|
+
};
|
|
584
|
+
a.prototype.readIntLE = function(e, r, n) {
|
|
585
|
+
e = e | 0, r = r | 0, n || I(e, r, this.length);
|
|
586
|
+
for (var i = this[e], o = 1, s = 0; ++s < r && (o *= 256); )
|
|
587
|
+
i += this[e + s] * o;
|
|
588
|
+
return o *= 128, i >= o && (i -= Math.pow(2, 8 * r)), i;
|
|
589
|
+
};
|
|
590
|
+
a.prototype.readIntBE = function(e, r, n) {
|
|
591
|
+
e = e | 0, r = r | 0, n || I(e, r, this.length);
|
|
592
|
+
for (var i = r, o = 1, s = this[e + --i]; i > 0 && (o *= 256); )
|
|
593
|
+
s += this[e + --i] * o;
|
|
594
|
+
return o *= 128, s >= o && (s -= Math.pow(2, 8 * r)), s;
|
|
595
|
+
};
|
|
596
|
+
a.prototype.readInt8 = function(e, r) {
|
|
597
|
+
return r || I(e, 1, this.length), this[e] & 128 ? (255 - this[e] + 1) * -1 : this[e];
|
|
598
|
+
};
|
|
599
|
+
a.prototype.readInt16LE = function(e, r) {
|
|
600
|
+
r || I(e, 2, this.length);
|
|
601
|
+
var n = this[e] | this[e + 1] << 8;
|
|
602
|
+
return n & 32768 ? n | 4294901760 : n;
|
|
603
|
+
};
|
|
604
|
+
a.prototype.readInt16BE = function(e, r) {
|
|
605
|
+
r || I(e, 2, this.length);
|
|
606
|
+
var n = this[e + 1] | this[e] << 8;
|
|
607
|
+
return n & 32768 ? n | 4294901760 : n;
|
|
608
|
+
};
|
|
609
|
+
a.prototype.readInt32LE = function(e, r) {
|
|
610
|
+
return r || I(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
611
|
+
};
|
|
612
|
+
a.prototype.readInt32BE = function(e, r) {
|
|
613
|
+
return r || I(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
614
|
+
};
|
|
615
|
+
a.prototype.readFloatLE = function(e, r) {
|
|
616
|
+
return r || I(e, 4, this.length), be(this, e, !0, 23, 4);
|
|
617
|
+
};
|
|
618
|
+
a.prototype.readFloatBE = function(e, r) {
|
|
619
|
+
return r || I(e, 4, this.length), be(this, e, !1, 23, 4);
|
|
620
|
+
};
|
|
621
|
+
a.prototype.readDoubleLE = function(e, r) {
|
|
622
|
+
return r || I(e, 8, this.length), be(this, e, !0, 52, 8);
|
|
623
|
+
};
|
|
624
|
+
a.prototype.readDoubleBE = function(e, r) {
|
|
625
|
+
return r || I(e, 8, this.length), be(this, e, !1, 52, 8);
|
|
626
|
+
};
|
|
627
|
+
function N(t, e, r, n, i, o) {
|
|
628
|
+
if (!j(t))
|
|
629
|
+
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
630
|
+
if (e > i || e < o)
|
|
631
|
+
throw new RangeError('"value" argument is out of bounds');
|
|
632
|
+
if (r + n > t.length)
|
|
633
|
+
throw new RangeError("Index out of range");
|
|
634
|
+
}
|
|
635
|
+
a.prototype.writeUIntLE = function(e, r, n, i) {
|
|
636
|
+
if (e = +e, r = r | 0, n = n | 0, !i) {
|
|
637
|
+
var o = Math.pow(2, 8 * n) - 1;
|
|
638
|
+
N(this, e, r, n, o, 0);
|
|
639
|
+
}
|
|
640
|
+
var s = 1, f = 0;
|
|
641
|
+
for (this[r] = e & 255; ++f < n && (s *= 256); )
|
|
642
|
+
this[r + f] = e / s & 255;
|
|
643
|
+
return r + n;
|
|
644
|
+
};
|
|
645
|
+
a.prototype.writeUIntBE = function(e, r, n, i) {
|
|
646
|
+
if (e = +e, r = r | 0, n = n | 0, !i) {
|
|
647
|
+
var o = Math.pow(2, 8 * n) - 1;
|
|
648
|
+
N(this, e, r, n, o, 0);
|
|
649
|
+
}
|
|
650
|
+
var s = n - 1, f = 1;
|
|
651
|
+
for (this[r + s] = e & 255; --s >= 0 && (f *= 256); )
|
|
652
|
+
this[r + s] = e / f & 255;
|
|
653
|
+
return r + n;
|
|
654
|
+
};
|
|
655
|
+
a.prototype.writeUInt8 = function(e, r, n) {
|
|
656
|
+
return e = +e, r = r | 0, n || N(this, e, r, 1, 255, 0), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[r] = e & 255, r + 1;
|
|
657
|
+
};
|
|
658
|
+
function xe(t, e, r, n) {
|
|
659
|
+
e < 0 && (e = 65535 + e + 1);
|
|
660
|
+
for (var i = 0, o = Math.min(t.length - r, 2); i < o; ++i)
|
|
661
|
+
t[r + i] = (e & 255 << 8 * (n ? i : 1 - i)) >>> (n ? i : 1 - i) * 8;
|
|
662
|
+
}
|
|
663
|
+
a.prototype.writeUInt16LE = function(e, r, n) {
|
|
664
|
+
return e = +e, r = r | 0, n || N(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : xe(this, e, r, !0), r + 2;
|
|
665
|
+
};
|
|
666
|
+
a.prototype.writeUInt16BE = function(e, r, n) {
|
|
667
|
+
return e = +e, r = r | 0, n || N(this, e, r, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : xe(this, e, r, !1), r + 2;
|
|
668
|
+
};
|
|
669
|
+
function Ee(t, e, r, n) {
|
|
670
|
+
e < 0 && (e = 4294967295 + e + 1);
|
|
671
|
+
for (var i = 0, o = Math.min(t.length - r, 4); i < o; ++i)
|
|
672
|
+
t[r + i] = e >>> (n ? i : 3 - i) * 8 & 255;
|
|
673
|
+
}
|
|
674
|
+
a.prototype.writeUInt32LE = function(e, r, n) {
|
|
675
|
+
return e = +e, r = r | 0, n || N(this, e, r, 4, 4294967295, 0), a.TYPED_ARRAY_SUPPORT ? (this[r + 3] = e >>> 24, this[r + 2] = e >>> 16, this[r + 1] = e >>> 8, this[r] = e & 255) : Ee(this, e, r, !0), r + 4;
|
|
676
|
+
};
|
|
677
|
+
a.prototype.writeUInt32BE = function(e, r, n) {
|
|
678
|
+
return e = +e, r = r | 0, n || N(this, e, r, 4, 4294967295, 0), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255) : Ee(this, e, r, !1), r + 4;
|
|
679
|
+
};
|
|
680
|
+
a.prototype.writeIntLE = function(e, r, n, i) {
|
|
681
|
+
if (e = +e, r = r | 0, !i) {
|
|
682
|
+
var o = Math.pow(2, 8 * n - 1);
|
|
683
|
+
N(this, e, r, n, o - 1, -o);
|
|
684
|
+
}
|
|
685
|
+
var s = 0, f = 1, l = 0;
|
|
686
|
+
for (this[r] = e & 255; ++s < n && (f *= 256); )
|
|
687
|
+
e < 0 && l === 0 && this[r + s - 1] !== 0 && (l = 1), this[r + s] = (e / f >> 0) - l & 255;
|
|
688
|
+
return r + n;
|
|
689
|
+
};
|
|
690
|
+
a.prototype.writeIntBE = function(e, r, n, i) {
|
|
691
|
+
if (e = +e, r = r | 0, !i) {
|
|
692
|
+
var o = Math.pow(2, 8 * n - 1);
|
|
693
|
+
N(this, e, r, n, o - 1, -o);
|
|
694
|
+
}
|
|
695
|
+
var s = n - 1, f = 1, l = 0;
|
|
696
|
+
for (this[r + s] = e & 255; --s >= 0 && (f *= 256); )
|
|
697
|
+
e < 0 && l === 0 && this[r + s + 1] !== 0 && (l = 1), this[r + s] = (e / f >> 0) - l & 255;
|
|
698
|
+
return r + n;
|
|
699
|
+
};
|
|
700
|
+
a.prototype.writeInt8 = function(e, r, n) {
|
|
701
|
+
return e = +e, r = r | 0, n || N(this, e, r, 1, 127, -128), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[r] = e & 255, r + 1;
|
|
702
|
+
};
|
|
703
|
+
a.prototype.writeInt16LE = function(e, r, n) {
|
|
704
|
+
return e = +e, r = r | 0, n || N(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8) : xe(this, e, r, !0), r + 2;
|
|
705
|
+
};
|
|
706
|
+
a.prototype.writeInt16BE = function(e, r, n) {
|
|
707
|
+
return e = +e, r = r | 0, n || N(this, e, r, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 8, this[r + 1] = e & 255) : xe(this, e, r, !1), r + 2;
|
|
708
|
+
};
|
|
709
|
+
a.prototype.writeInt32LE = function(e, r, n) {
|
|
710
|
+
return e = +e, r = r | 0, n || N(this, e, r, 4, 2147483647, -2147483648), a.TYPED_ARRAY_SUPPORT ? (this[r] = e & 255, this[r + 1] = e >>> 8, this[r + 2] = e >>> 16, this[r + 3] = e >>> 24) : Ee(this, e, r, !0), r + 4;
|
|
711
|
+
};
|
|
712
|
+
a.prototype.writeInt32BE = function(e, r, n) {
|
|
713
|
+
return e = +e, r = r | 0, n || N(this, e, r, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), a.TYPED_ARRAY_SUPPORT ? (this[r] = e >>> 24, this[r + 1] = e >>> 16, this[r + 2] = e >>> 8, this[r + 3] = e & 255) : Ee(this, e, r, !1), r + 4;
|
|
714
|
+
};
|
|
715
|
+
function _t(t, e, r, n, i, o) {
|
|
716
|
+
if (r + n > t.length)
|
|
717
|
+
throw new RangeError("Index out of range");
|
|
718
|
+
if (r < 0)
|
|
719
|
+
throw new RangeError("Index out of range");
|
|
720
|
+
}
|
|
721
|
+
function wt(t, e, r, n, i) {
|
|
722
|
+
return i || _t(t, e, r, 4), lt(t, e, r, n, 23, 4), r + 4;
|
|
723
|
+
}
|
|
724
|
+
a.prototype.writeFloatLE = function(e, r, n) {
|
|
725
|
+
return wt(this, e, r, !0, n);
|
|
726
|
+
};
|
|
727
|
+
a.prototype.writeFloatBE = function(e, r, n) {
|
|
728
|
+
return wt(this, e, r, !1, n);
|
|
729
|
+
};
|
|
730
|
+
function yt(t, e, r, n, i) {
|
|
731
|
+
return i || _t(t, e, r, 8), lt(t, e, r, n, 52, 8), r + 8;
|
|
732
|
+
}
|
|
733
|
+
a.prototype.writeDoubleLE = function(e, r, n) {
|
|
734
|
+
return yt(this, e, r, !0, n);
|
|
735
|
+
};
|
|
736
|
+
a.prototype.writeDoubleBE = function(e, r, n) {
|
|
737
|
+
return yt(this, e, r, !1, n);
|
|
738
|
+
};
|
|
739
|
+
a.prototype.copy = function(e, r, n, i) {
|
|
740
|
+
if (n || (n = 0), !i && i !== 0 && (i = this.length), r >= e.length && (r = e.length), r || (r = 0), i > 0 && i < n && (i = n), i === n || e.length === 0 || this.length === 0)
|
|
741
|
+
return 0;
|
|
742
|
+
if (r < 0)
|
|
743
|
+
throw new RangeError("targetStart out of bounds");
|
|
744
|
+
if (n < 0 || n >= this.length)
|
|
745
|
+
throw new RangeError("sourceStart out of bounds");
|
|
746
|
+
if (i < 0)
|
|
747
|
+
throw new RangeError("sourceEnd out of bounds");
|
|
748
|
+
i > this.length && (i = this.length), e.length - r < i - n && (i = e.length - r + n);
|
|
749
|
+
var o = i - n, s;
|
|
750
|
+
if (this === e && n < r && r < i)
|
|
751
|
+
for (s = o - 1; s >= 0; --s)
|
|
752
|
+
e[s + r] = this[s + n];
|
|
753
|
+
else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
|
|
754
|
+
for (s = 0; s < o; ++s)
|
|
755
|
+
e[s + r] = this[s + n];
|
|
756
|
+
else
|
|
757
|
+
Uint8Array.prototype.set.call(
|
|
758
|
+
e,
|
|
759
|
+
this.subarray(n, n + o),
|
|
760
|
+
r
|
|
761
|
+
);
|
|
762
|
+
return o;
|
|
763
|
+
};
|
|
764
|
+
a.prototype.fill = function(e, r, n, i) {
|
|
765
|
+
if (typeof e == "string") {
|
|
766
|
+
if (typeof r == "string" ? (i = r, r = 0, n = this.length) : typeof n == "string" && (i = n, n = this.length), e.length === 1) {
|
|
767
|
+
var o = e.charCodeAt(0);
|
|
768
|
+
o < 256 && (e = o);
|
|
769
|
+
}
|
|
770
|
+
if (i !== void 0 && typeof i != "string")
|
|
771
|
+
throw new TypeError("encoding must be a string");
|
|
772
|
+
if (typeof i == "string" && !a.isEncoding(i))
|
|
773
|
+
throw new TypeError("Unknown encoding: " + i);
|
|
774
|
+
} else
|
|
775
|
+
typeof e == "number" && (e = e & 255);
|
|
776
|
+
if (r < 0 || this.length < r || this.length < n)
|
|
777
|
+
throw new RangeError("Out of range index");
|
|
778
|
+
if (n <= r)
|
|
779
|
+
return this;
|
|
780
|
+
r = r >>> 0, n = n === void 0 ? this.length : n >>> 0, e || (e = 0);
|
|
781
|
+
var s;
|
|
782
|
+
if (typeof e == "number")
|
|
783
|
+
for (s = r; s < n; ++s)
|
|
784
|
+
this[s] = e;
|
|
785
|
+
else {
|
|
786
|
+
var f = j(e) ? e : ye(new a(e, i).toString()), l = f.length;
|
|
787
|
+
for (s = 0; s < n - r; ++s)
|
|
788
|
+
this[s + r] = f[s % l];
|
|
789
|
+
}
|
|
790
|
+
return this;
|
|
791
|
+
};
|
|
792
|
+
var gr = /[^+\/0-9A-Za-z-_]/g;
|
|
793
|
+
function _r(t) {
|
|
794
|
+
if (t = wr(t).replace(gr, ""), t.length < 2)
|
|
795
|
+
return "";
|
|
796
|
+
for (; t.length % 4 !== 0; )
|
|
797
|
+
t = t + "=";
|
|
798
|
+
return t;
|
|
799
|
+
}
|
|
800
|
+
function wr(t) {
|
|
801
|
+
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
|
|
802
|
+
}
|
|
803
|
+
function yr(t) {
|
|
804
|
+
return t < 16 ? "0" + t.toString(16) : t.toString(16);
|
|
805
|
+
}
|
|
806
|
+
function ye(t, e) {
|
|
807
|
+
e = e || 1 / 0;
|
|
808
|
+
for (var r, n = t.length, i = null, o = [], s = 0; s < n; ++s) {
|
|
809
|
+
if (r = t.charCodeAt(s), r > 55295 && r < 57344) {
|
|
810
|
+
if (!i) {
|
|
811
|
+
if (r > 56319) {
|
|
812
|
+
(e -= 3) > -1 && o.push(239, 191, 189);
|
|
813
|
+
continue;
|
|
814
|
+
} else if (s + 1 === n) {
|
|
815
|
+
(e -= 3) > -1 && o.push(239, 191, 189);
|
|
816
|
+
continue;
|
|
817
|
+
}
|
|
818
|
+
i = r;
|
|
819
|
+
continue;
|
|
820
|
+
}
|
|
821
|
+
if (r < 56320) {
|
|
822
|
+
(e -= 3) > -1 && o.push(239, 191, 189), i = r;
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
r = (i - 55296 << 10 | r - 56320) + 65536;
|
|
826
|
+
} else
|
|
827
|
+
i && (e -= 3) > -1 && o.push(239, 191, 189);
|
|
828
|
+
if (i = null, r < 128) {
|
|
829
|
+
if ((e -= 1) < 0)
|
|
830
|
+
break;
|
|
831
|
+
o.push(r);
|
|
832
|
+
} else if (r < 2048) {
|
|
833
|
+
if ((e -= 2) < 0)
|
|
834
|
+
break;
|
|
835
|
+
o.push(
|
|
836
|
+
r >> 6 | 192,
|
|
837
|
+
r & 63 | 128
|
|
838
|
+
);
|
|
839
|
+
} else if (r < 65536) {
|
|
840
|
+
if ((e -= 3) < 0)
|
|
841
|
+
break;
|
|
842
|
+
o.push(
|
|
843
|
+
r >> 12 | 224,
|
|
844
|
+
r >> 6 & 63 | 128,
|
|
845
|
+
r & 63 | 128
|
|
846
|
+
);
|
|
847
|
+
} else if (r < 1114112) {
|
|
848
|
+
if ((e -= 4) < 0)
|
|
849
|
+
break;
|
|
850
|
+
o.push(
|
|
851
|
+
r >> 18 | 240,
|
|
852
|
+
r >> 12 & 63 | 128,
|
|
853
|
+
r >> 6 & 63 | 128,
|
|
854
|
+
r & 63 | 128
|
|
855
|
+
);
|
|
856
|
+
} else
|
|
857
|
+
throw new Error("Invalid code point");
|
|
858
|
+
}
|
|
859
|
+
return o;
|
|
860
|
+
}
|
|
861
|
+
function vr(t) {
|
|
862
|
+
for (var e = [], r = 0; r < t.length; ++r)
|
|
863
|
+
e.push(t.charCodeAt(r) & 255);
|
|
864
|
+
return e;
|
|
865
|
+
}
|
|
866
|
+
function br(t, e) {
|
|
867
|
+
for (var r, n, i, o = [], s = 0; s < t.length && !((e -= 2) < 0); ++s)
|
|
868
|
+
r = t.charCodeAt(s), n = r >> 8, i = r % 256, o.push(i), o.push(n);
|
|
869
|
+
return o;
|
|
870
|
+
}
|
|
871
|
+
function vt(t) {
|
|
872
|
+
return Ht(_r(t));
|
|
873
|
+
}
|
|
874
|
+
function Se(t, e, r, n) {
|
|
875
|
+
for (var i = 0; i < n && !(i + r >= e.length || i >= t.length); ++i)
|
|
876
|
+
e[i + r] = t[i];
|
|
877
|
+
return i;
|
|
878
|
+
}
|
|
879
|
+
function xr(t) {
|
|
880
|
+
return t !== t;
|
|
881
|
+
}
|
|
882
|
+
function T(t) {
|
|
883
|
+
return t != null && (!!t._isBuffer || bt(t) || Er(t));
|
|
884
|
+
}
|
|
885
|
+
function bt(t) {
|
|
886
|
+
return !!t.constructor && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t);
|
|
887
|
+
}
|
|
888
|
+
function Er(t) {
|
|
889
|
+
return typeof t.readFloatLE == "function" && typeof t.slice == "function" && bt(t.slice(0, 0));
|
|
890
|
+
}
|
|
891
|
+
var Sr;
|
|
892
|
+
function H() {
|
|
893
|
+
}
|
|
894
|
+
H.prototype = /* @__PURE__ */ Object.create(null);
|
|
895
|
+
function p() {
|
|
896
|
+
p.init.call(this);
|
|
897
|
+
}
|
|
898
|
+
p.EventEmitter = p;
|
|
899
|
+
p.usingDomains = !1;
|
|
900
|
+
p.prototype.domain = void 0;
|
|
901
|
+
p.prototype._events = void 0;
|
|
902
|
+
p.prototype._maxListeners = void 0;
|
|
903
|
+
p.defaultMaxListeners = 10;
|
|
904
|
+
p.init = function() {
|
|
905
|
+
this.domain = null, p.usingDomains && Sr.active, (!this._events || this._events === Object.getPrototypeOf(this)._events) && (this._events = new H(), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
906
|
+
};
|
|
907
|
+
p.prototype.setMaxListeners = function(e) {
|
|
908
|
+
if (typeof e != "number" || e < 0 || isNaN(e))
|
|
909
|
+
throw new TypeError('"n" argument must be a positive number');
|
|
910
|
+
return this._maxListeners = e, this;
|
|
911
|
+
};
|
|
912
|
+
function xt(t) {
|
|
913
|
+
return t._maxListeners === void 0 ? p.defaultMaxListeners : t._maxListeners;
|
|
914
|
+
}
|
|
915
|
+
p.prototype.getMaxListeners = function() {
|
|
916
|
+
return xt(this);
|
|
917
|
+
};
|
|
918
|
+
function Rr(t, e, r) {
|
|
919
|
+
if (e)
|
|
920
|
+
t.call(r);
|
|
921
|
+
else
|
|
922
|
+
for (var n = t.length, i = ue(t, n), o = 0; o < n; ++o)
|
|
923
|
+
i[o].call(r);
|
|
924
|
+
}
|
|
925
|
+
function Ir(t, e, r, n) {
|
|
926
|
+
if (e)
|
|
927
|
+
t.call(r, n);
|
|
928
|
+
else
|
|
929
|
+
for (var i = t.length, o = ue(t, i), s = 0; s < i; ++s)
|
|
930
|
+
o[s].call(r, n);
|
|
931
|
+
}
|
|
932
|
+
function Or(t, e, r, n, i) {
|
|
933
|
+
if (e)
|
|
934
|
+
t.call(r, n, i);
|
|
935
|
+
else
|
|
936
|
+
for (var o = t.length, s = ue(t, o), f = 0; f < o; ++f)
|
|
937
|
+
s[f].call(r, n, i);
|
|
938
|
+
}
|
|
939
|
+
function Cr(t, e, r, n, i, o) {
|
|
940
|
+
if (e)
|
|
941
|
+
t.call(r, n, i, o);
|
|
942
|
+
else
|
|
943
|
+
for (var s = t.length, f = ue(t, s), l = 0; l < s; ++l)
|
|
944
|
+
f[l].call(r, n, i, o);
|
|
945
|
+
}
|
|
946
|
+
function Ar(t, e, r, n) {
|
|
947
|
+
if (e)
|
|
948
|
+
t.apply(r, n);
|
|
949
|
+
else
|
|
950
|
+
for (var i = t.length, o = ue(t, i), s = 0; s < i; ++s)
|
|
951
|
+
o[s].apply(r, n);
|
|
952
|
+
}
|
|
953
|
+
p.prototype.emit = function(e) {
|
|
954
|
+
var r, n, i, o, s, f, l, u = e === "error";
|
|
955
|
+
if (f = this._events, f)
|
|
956
|
+
u = u && f.error == null;
|
|
957
|
+
else if (!u)
|
|
958
|
+
return !1;
|
|
959
|
+
if (l = this.domain, u) {
|
|
960
|
+
if (r = arguments[1], l)
|
|
961
|
+
r || (r = new Error('Uncaught, unspecified "error" event')), r.domainEmitter = this, r.domain = l, r.domainThrown = !1, l.emit("error", r);
|
|
962
|
+
else {
|
|
963
|
+
if (r instanceof Error)
|
|
964
|
+
throw r;
|
|
965
|
+
var h = new Error('Uncaught, unspecified "error" event. (' + r + ")");
|
|
966
|
+
throw h.context = r, h;
|
|
967
|
+
}
|
|
968
|
+
return !1;
|
|
969
|
+
}
|
|
970
|
+
if (n = f[e], !n)
|
|
971
|
+
return !1;
|
|
972
|
+
var c = typeof n == "function";
|
|
973
|
+
switch (i = arguments.length, i) {
|
|
974
|
+
case 1:
|
|
975
|
+
Rr(n, c, this);
|
|
976
|
+
break;
|
|
977
|
+
case 2:
|
|
978
|
+
Ir(n, c, this, arguments[1]);
|
|
979
|
+
break;
|
|
980
|
+
case 3:
|
|
981
|
+
Or(n, c, this, arguments[1], arguments[2]);
|
|
982
|
+
break;
|
|
983
|
+
case 4:
|
|
984
|
+
Cr(n, c, this, arguments[1], arguments[2], arguments[3]);
|
|
985
|
+
break;
|
|
986
|
+
default:
|
|
987
|
+
for (o = new Array(i - 1), s = 1; s < i; s++)
|
|
988
|
+
o[s - 1] = arguments[s];
|
|
989
|
+
Ar(n, c, this, o);
|
|
990
|
+
}
|
|
991
|
+
return !0;
|
|
992
|
+
};
|
|
993
|
+
function Et(t, e, r, n) {
|
|
994
|
+
var i, o, s;
|
|
995
|
+
if (typeof r != "function")
|
|
996
|
+
throw new TypeError('"listener" argument must be a function');
|
|
997
|
+
if (o = t._events, o ? (o.newListener && (t.emit(
|
|
998
|
+
"newListener",
|
|
999
|
+
e,
|
|
1000
|
+
r.listener ? r.listener : r
|
|
1001
|
+
), o = t._events), s = o[e]) : (o = t._events = new H(), t._eventsCount = 0), !s)
|
|
1002
|
+
s = o[e] = r, ++t._eventsCount;
|
|
1003
|
+
else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), !s.warned && (i = xt(t), i && i > 0 && s.length > i)) {
|
|
1004
|
+
s.warned = !0;
|
|
1005
|
+
var f = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + e + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
1006
|
+
f.name = "MaxListenersExceededWarning", f.emitter = t, f.type = e, f.count = s.length, Lr(f);
|
|
1007
|
+
}
|
|
1008
|
+
return t;
|
|
1009
|
+
}
|
|
1010
|
+
function Lr(t) {
|
|
1011
|
+
typeof console.warn == "function" ? console.warn(t) : console.log(t);
|
|
1012
|
+
}
|
|
1013
|
+
p.prototype.addListener = function(e, r) {
|
|
1014
|
+
return Et(this, e, r, !1);
|
|
1015
|
+
};
|
|
1016
|
+
p.prototype.on = p.prototype.addListener;
|
|
1017
|
+
p.prototype.prependListener = function(e, r) {
|
|
1018
|
+
return Et(this, e, r, !0);
|
|
1019
|
+
};
|
|
1020
|
+
function St(t, e, r) {
|
|
1021
|
+
var n = !1;
|
|
1022
|
+
function i() {
|
|
1023
|
+
t.removeListener(e, i), n || (n = !0, r.apply(t, arguments));
|
|
1024
|
+
}
|
|
1025
|
+
return i.listener = r, i;
|
|
1026
|
+
}
|
|
1027
|
+
p.prototype.once = function(e, r) {
|
|
1028
|
+
if (typeof r != "function")
|
|
1029
|
+
throw new TypeError('"listener" argument must be a function');
|
|
1030
|
+
return this.on(e, St(this, e, r)), this;
|
|
1031
|
+
};
|
|
1032
|
+
p.prototype.prependOnceListener = function(e, r) {
|
|
1033
|
+
if (typeof r != "function")
|
|
1034
|
+
throw new TypeError('"listener" argument must be a function');
|
|
1035
|
+
return this.prependListener(e, St(this, e, r)), this;
|
|
1036
|
+
};
|
|
1037
|
+
p.prototype.removeListener = function(e, r) {
|
|
1038
|
+
var n, i, o, s, f;
|
|
1039
|
+
if (typeof r != "function")
|
|
1040
|
+
throw new TypeError('"listener" argument must be a function');
|
|
1041
|
+
if (i = this._events, !i)
|
|
1042
|
+
return this;
|
|
1043
|
+
if (n = i[e], !n)
|
|
1044
|
+
return this;
|
|
1045
|
+
if (n === r || n.listener && n.listener === r)
|
|
1046
|
+
--this._eventsCount === 0 ? this._events = new H() : (delete i[e], i.removeListener && this.emit("removeListener", e, n.listener || r));
|
|
1047
|
+
else if (typeof n != "function") {
|
|
1048
|
+
for (o = -1, s = n.length; s-- > 0; )
|
|
1049
|
+
if (n[s] === r || n[s].listener && n[s].listener === r) {
|
|
1050
|
+
f = n[s].listener, o = s;
|
|
1051
|
+
break;
|
|
1052
|
+
}
|
|
1053
|
+
if (o < 0)
|
|
1054
|
+
return this;
|
|
1055
|
+
if (n.length === 1) {
|
|
1056
|
+
if (n[0] = void 0, --this._eventsCount === 0)
|
|
1057
|
+
return this._events = new H(), this;
|
|
1058
|
+
delete i[e];
|
|
1059
|
+
} else
|
|
1060
|
+
Tr(n, o);
|
|
1061
|
+
i.removeListener && this.emit("removeListener", e, f || r);
|
|
1062
|
+
}
|
|
1063
|
+
return this;
|
|
1064
|
+
};
|
|
1065
|
+
p.prototype.removeAllListeners = function(e) {
|
|
1066
|
+
var r, n;
|
|
1067
|
+
if (n = this._events, !n)
|
|
1068
|
+
return this;
|
|
1069
|
+
if (!n.removeListener)
|
|
1070
|
+
return arguments.length === 0 ? (this._events = new H(), this._eventsCount = 0) : n[e] && (--this._eventsCount === 0 ? this._events = new H() : delete n[e]), this;
|
|
1071
|
+
if (arguments.length === 0) {
|
|
1072
|
+
for (var i = Object.keys(n), o = 0, s; o < i.length; ++o)
|
|
1073
|
+
s = i[o], s !== "removeListener" && this.removeAllListeners(s);
|
|
1074
|
+
return this.removeAllListeners("removeListener"), this._events = new H(), this._eventsCount = 0, this;
|
|
1075
|
+
}
|
|
1076
|
+
if (r = n[e], typeof r == "function")
|
|
1077
|
+
this.removeListener(e, r);
|
|
1078
|
+
else if (r)
|
|
1079
|
+
do
|
|
1080
|
+
this.removeListener(e, r[r.length - 1]);
|
|
1081
|
+
while (r[0]);
|
|
1082
|
+
return this;
|
|
1083
|
+
};
|
|
1084
|
+
p.prototype.listeners = function(e) {
|
|
1085
|
+
var r, n, i = this._events;
|
|
1086
|
+
return i ? (r = i[e], r ? typeof r == "function" ? n = [r.listener || r] : n = Nr(r) : n = []) : n = [], n;
|
|
1087
|
+
};
|
|
1088
|
+
p.listenerCount = function(t, e) {
|
|
1089
|
+
return typeof t.listenerCount == "function" ? t.listenerCount(e) : Rt.call(t, e);
|
|
1090
|
+
};
|
|
1091
|
+
p.prototype.listenerCount = Rt;
|
|
1092
|
+
function Rt(t) {
|
|
1093
|
+
var e = this._events;
|
|
1094
|
+
if (e) {
|
|
1095
|
+
var r = e[t];
|
|
1096
|
+
if (typeof r == "function")
|
|
1097
|
+
return 1;
|
|
1098
|
+
if (r)
|
|
1099
|
+
return r.length;
|
|
1100
|
+
}
|
|
1101
|
+
return 0;
|
|
1102
|
+
}
|
|
1103
|
+
p.prototype.eventNames = function() {
|
|
1104
|
+
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
1105
|
+
};
|
|
1106
|
+
function Tr(t, e) {
|
|
1107
|
+
for (var r = e, n = r + 1, i = t.length; n < i; r += 1, n += 1)
|
|
1108
|
+
t[r] = t[n];
|
|
1109
|
+
t.pop();
|
|
1110
|
+
}
|
|
1111
|
+
function ue(t, e) {
|
|
1112
|
+
for (var r = new Array(e); e--; )
|
|
1113
|
+
r[e] = t[e];
|
|
1114
|
+
return r;
|
|
1115
|
+
}
|
|
1116
|
+
function Nr(t) {
|
|
1117
|
+
for (var e = new Array(t.length), r = 0; r < e.length; ++r)
|
|
1118
|
+
e[r] = t[r].listener || t[r];
|
|
1119
|
+
return e;
|
|
1120
|
+
}
|
|
1121
|
+
function It() {
|
|
1122
|
+
throw new Error("setTimeout has not been defined");
|
|
1123
|
+
}
|
|
1124
|
+
function Ot() {
|
|
1125
|
+
throw new Error("clearTimeout has not been defined");
|
|
1126
|
+
}
|
|
1127
|
+
var Y = It, W = Ot;
|
|
1128
|
+
typeof oe.setTimeout == "function" && (Y = setTimeout);
|
|
1129
|
+
typeof oe.clearTimeout == "function" && (W = clearTimeout);
|
|
1130
|
+
function Ct(t) {
|
|
1131
|
+
if (Y === setTimeout)
|
|
1132
|
+
return setTimeout(t, 0);
|
|
1133
|
+
if ((Y === It || !Y) && setTimeout)
|
|
1134
|
+
return Y = setTimeout, setTimeout(t, 0);
|
|
1135
|
+
try {
|
|
1136
|
+
return Y(t, 0);
|
|
1137
|
+
} catch {
|
|
1138
|
+
try {
|
|
1139
|
+
return Y.call(null, t, 0);
|
|
1140
|
+
} catch {
|
|
1141
|
+
return Y.call(this, t, 0);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
function Dr(t) {
|
|
1146
|
+
if (W === clearTimeout)
|
|
1147
|
+
return clearTimeout(t);
|
|
1148
|
+
if ((W === Ot || !W) && clearTimeout)
|
|
1149
|
+
return W = clearTimeout, clearTimeout(t);
|
|
1150
|
+
try {
|
|
1151
|
+
return W(t);
|
|
1152
|
+
} catch {
|
|
1153
|
+
try {
|
|
1154
|
+
return W.call(null, t);
|
|
1155
|
+
} catch {
|
|
1156
|
+
return W.call(this, t);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
var q = [], ie = !1, K, ge = -1;
|
|
1161
|
+
function Fr() {
|
|
1162
|
+
!ie || !K || (ie = !1, K.length ? q = K.concat(q) : ge = -1, q.length && At());
|
|
1163
|
+
}
|
|
1164
|
+
function At() {
|
|
1165
|
+
if (!ie) {
|
|
1166
|
+
var t = Ct(Fr);
|
|
1167
|
+
ie = !0;
|
|
1168
|
+
for (var e = q.length; e; ) {
|
|
1169
|
+
for (K = q, q = []; ++ge < e; )
|
|
1170
|
+
K && K[ge].run();
|
|
1171
|
+
ge = -1, e = q.length;
|
|
1172
|
+
}
|
|
1173
|
+
K = null, ie = !1, Dr(t);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
function D(t) {
|
|
1177
|
+
var e = new Array(arguments.length - 1);
|
|
1178
|
+
if (arguments.length > 1)
|
|
1179
|
+
for (var r = 1; r < arguments.length; r++)
|
|
1180
|
+
e[r - 1] = arguments[r];
|
|
1181
|
+
q.push(new Lt(t, e)), q.length === 1 && !ie && Ct(At);
|
|
1182
|
+
}
|
|
1183
|
+
function Lt(t, e) {
|
|
1184
|
+
this.fun = t, this.array = e;
|
|
1185
|
+
}
|
|
1186
|
+
Lt.prototype.run = function() {
|
|
1187
|
+
this.fun.apply(null, this.array);
|
|
1188
|
+
};
|
|
1189
|
+
var Mr = "browser", Br = "browser", Ur = !0, kr = {}, Pr = [], jr = "", $r = {}, qr = {}, zr = {};
|
|
1190
|
+
function ee() {
|
|
1191
|
+
}
|
|
1192
|
+
var Vr = ee, Jr = ee, Yr = ee, Wr = ee, Qr = ee, Hr = ee, Gr = ee;
|
|
1193
|
+
function Zr(t) {
|
|
1194
|
+
throw new Error("process.binding is not supported");
|
|
1195
|
+
}
|
|
1196
|
+
function Xr() {
|
|
1197
|
+
return "/";
|
|
1198
|
+
}
|
|
1199
|
+
function Kr(t) {
|
|
1200
|
+
throw new Error("process.chdir is not supported");
|
|
1201
|
+
}
|
|
1202
|
+
function en() {
|
|
1203
|
+
return 0;
|
|
1204
|
+
}
|
|
1205
|
+
var ne = oe.performance || {}, tn = ne.now || ne.mozNow || ne.msNow || ne.oNow || ne.webkitNow || function() {
|
|
1206
|
+
return (/* @__PURE__ */ new Date()).getTime();
|
|
1207
|
+
};
|
|
1208
|
+
function rn(t) {
|
|
1209
|
+
var e = tn.call(ne) * 1e-3, r = Math.floor(e), n = Math.floor(e % 1 * 1e9);
|
|
1210
|
+
return t && (r = r - t[0], n = n - t[1], n < 0 && (r--, n += 1e9)), [r, n];
|
|
1211
|
+
}
|
|
1212
|
+
var nn = /* @__PURE__ */ new Date();
|
|
1213
|
+
function on() {
|
|
1214
|
+
var t = /* @__PURE__ */ new Date(), e = t - nn;
|
|
1215
|
+
return e / 1e3;
|
|
1216
|
+
}
|
|
1217
|
+
var _e = {
|
|
1218
|
+
nextTick: D,
|
|
1219
|
+
title: Mr,
|
|
1220
|
+
browser: Ur,
|
|
1221
|
+
env: kr,
|
|
1222
|
+
argv: Pr,
|
|
1223
|
+
version: jr,
|
|
1224
|
+
versions: $r,
|
|
1225
|
+
on: Vr,
|
|
1226
|
+
addListener: Jr,
|
|
1227
|
+
once: Yr,
|
|
1228
|
+
off: Wr,
|
|
1229
|
+
removeListener: Qr,
|
|
1230
|
+
removeAllListeners: Hr,
|
|
1231
|
+
emit: Gr,
|
|
1232
|
+
binding: Zr,
|
|
1233
|
+
cwd: Xr,
|
|
1234
|
+
chdir: Kr,
|
|
1235
|
+
umask: en,
|
|
1236
|
+
hrtime: rn,
|
|
1237
|
+
platform: Br,
|
|
1238
|
+
release: qr,
|
|
1239
|
+
config: zr,
|
|
1240
|
+
uptime: on
|
|
1241
|
+
}, Ue;
|
|
1242
|
+
typeof Object.create == "function" ? Ue = function(e, r) {
|
|
1243
|
+
e.super_ = r, e.prototype = Object.create(r.prototype, {
|
|
1244
|
+
constructor: {
|
|
1245
|
+
value: e,
|
|
1246
|
+
enumerable: !1,
|
|
1247
|
+
writable: !0,
|
|
1248
|
+
configurable: !0
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
} : Ue = function(e, r) {
|
|
1252
|
+
e.super_ = r;
|
|
1253
|
+
var n = function() {
|
|
1254
|
+
};
|
|
1255
|
+
n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
|
|
1256
|
+
};
|
|
1257
|
+
var se = Ue, sn = /%[sdj%]/g;
|
|
1258
|
+
function fn(t) {
|
|
1259
|
+
if (!Ve(t)) {
|
|
1260
|
+
for (var e = [], r = 0; r < arguments.length; r++)
|
|
1261
|
+
e.push(G(arguments[r]));
|
|
1262
|
+
return e.join(" ");
|
|
1263
|
+
}
|
|
1264
|
+
for (var r = 1, n = arguments, i = n.length, o = String(t).replace(sn, function(f) {
|
|
1265
|
+
if (f === "%%")
|
|
1266
|
+
return "%";
|
|
1267
|
+
if (r >= i)
|
|
1268
|
+
return f;
|
|
1269
|
+
switch (f) {
|
|
1270
|
+
case "%s":
|
|
1271
|
+
return String(n[r++]);
|
|
1272
|
+
case "%d":
|
|
1273
|
+
return Number(n[r++]);
|
|
1274
|
+
case "%j":
|
|
1275
|
+
try {
|
|
1276
|
+
return JSON.stringify(n[r++]);
|
|
1277
|
+
} catch {
|
|
1278
|
+
return "[Circular]";
|
|
1279
|
+
}
|
|
1280
|
+
default:
|
|
1281
|
+
return f;
|
|
1282
|
+
}
|
|
1283
|
+
}), s = n[r]; r < i; s = n[++r])
|
|
1284
|
+
ze(s) || !he(s) ? o += " " + s : o += " " + G(s);
|
|
1285
|
+
return o;
|
|
1286
|
+
}
|
|
1287
|
+
function Tt(t, e) {
|
|
1288
|
+
if (Q(oe.process))
|
|
1289
|
+
return function() {
|
|
1290
|
+
return Tt(t, e).apply(this, arguments);
|
|
1291
|
+
};
|
|
1292
|
+
if (_e.noDeprecation === !0)
|
|
1293
|
+
return t;
|
|
1294
|
+
var r = !1;
|
|
1295
|
+
function n() {
|
|
1296
|
+
if (!r) {
|
|
1297
|
+
if (_e.throwDeprecation)
|
|
1298
|
+
throw new Error(e);
|
|
1299
|
+
_e.traceDeprecation ? console.trace(e) : console.error(e), r = !0;
|
|
1300
|
+
}
|
|
1301
|
+
return t.apply(this, arguments);
|
|
1302
|
+
}
|
|
1303
|
+
return n;
|
|
1304
|
+
}
|
|
1305
|
+
var me = {}, Ce;
|
|
1306
|
+
function an(t) {
|
|
1307
|
+
if (Q(Ce) && (Ce = _e.env.NODE_DEBUG || ""), t = t.toUpperCase(), !me[t])
|
|
1308
|
+
if (new RegExp("\\b" + t + "\\b", "i").test(Ce)) {
|
|
1309
|
+
var e = 0;
|
|
1310
|
+
me[t] = function() {
|
|
1311
|
+
var r = fn.apply(null, arguments);
|
|
1312
|
+
console.error("%s %d: %s", t, e, r);
|
|
1313
|
+
};
|
|
1314
|
+
} else
|
|
1315
|
+
me[t] = function() {
|
|
1316
|
+
};
|
|
1317
|
+
return me[t];
|
|
1318
|
+
}
|
|
1319
|
+
function G(t, e) {
|
|
1320
|
+
var r = {
|
|
1321
|
+
seen: [],
|
|
1322
|
+
stylize: un
|
|
1323
|
+
};
|
|
1324
|
+
return arguments.length >= 3 && (r.depth = arguments[2]), arguments.length >= 4 && (r.colors = arguments[3]), Nt(e) ? r.showHidden = e : e && _n(r, e), Q(r.showHidden) && (r.showHidden = !1), Q(r.depth) && (r.depth = 2), Q(r.colors) && (r.colors = !1), Q(r.customInspect) && (r.customInspect = !0), r.colors && (r.stylize = ln), ve(r, t, r.depth);
|
|
1325
|
+
}
|
|
1326
|
+
G.colors = {
|
|
1327
|
+
bold: [1, 22],
|
|
1328
|
+
italic: [3, 23],
|
|
1329
|
+
underline: [4, 24],
|
|
1330
|
+
inverse: [7, 27],
|
|
1331
|
+
white: [37, 39],
|
|
1332
|
+
grey: [90, 39],
|
|
1333
|
+
black: [30, 39],
|
|
1334
|
+
blue: [34, 39],
|
|
1335
|
+
cyan: [36, 39],
|
|
1336
|
+
green: [32, 39],
|
|
1337
|
+
magenta: [35, 39],
|
|
1338
|
+
red: [31, 39],
|
|
1339
|
+
yellow: [33, 39]
|
|
1340
|
+
};
|
|
1341
|
+
G.styles = {
|
|
1342
|
+
special: "cyan",
|
|
1343
|
+
number: "yellow",
|
|
1344
|
+
boolean: "yellow",
|
|
1345
|
+
undefined: "grey",
|
|
1346
|
+
null: "bold",
|
|
1347
|
+
string: "green",
|
|
1348
|
+
date: "magenta",
|
|
1349
|
+
// "name": intentionally not styling
|
|
1350
|
+
regexp: "red"
|
|
1351
|
+
};
|
|
1352
|
+
function ln(t, e) {
|
|
1353
|
+
var r = G.styles[e];
|
|
1354
|
+
return r ? "\x1B[" + G.colors[r][0] + "m" + t + "\x1B[" + G.colors[r][1] + "m" : t;
|
|
1355
|
+
}
|
|
1356
|
+
function un(t, e) {
|
|
1357
|
+
return t;
|
|
1358
|
+
}
|
|
1359
|
+
function hn(t) {
|
|
1360
|
+
var e = {};
|
|
1361
|
+
return t.forEach(function(r, n) {
|
|
1362
|
+
e[r] = !0;
|
|
1363
|
+
}), e;
|
|
1364
|
+
}
|
|
1365
|
+
function ve(t, e, r) {
|
|
1366
|
+
if (t.customInspect && e && Ne(e.inspect) && // Filter out the util module, it's inspect function is special
|
|
1367
|
+
e.inspect !== G && // Also filter out any prototype objects using the circular check.
|
|
1368
|
+
!(e.constructor && e.constructor.prototype === e)) {
|
|
1369
|
+
var n = e.inspect(r, t);
|
|
1370
|
+
return Ve(n) || (n = ve(t, n, r)), n;
|
|
1371
|
+
}
|
|
1372
|
+
var i = cn(t, e);
|
|
1373
|
+
if (i)
|
|
1374
|
+
return i;
|
|
1375
|
+
var o = Object.keys(e), s = hn(o);
|
|
1376
|
+
if (t.showHidden && (o = Object.getOwnPropertyNames(e)), Te(e) && (o.indexOf("message") >= 0 || o.indexOf("description") >= 0))
|
|
1377
|
+
return Ae(e);
|
|
1378
|
+
if (o.length === 0) {
|
|
1379
|
+
if (Ne(e)) {
|
|
1380
|
+
var f = e.name ? ": " + e.name : "";
|
|
1381
|
+
return t.stylize("[Function" + f + "]", "special");
|
|
1382
|
+
}
|
|
1383
|
+
if (Le(e))
|
|
1384
|
+
return t.stylize(RegExp.prototype.toString.call(e), "regexp");
|
|
1385
|
+
if (Ze(e))
|
|
1386
|
+
return t.stylize(Date.prototype.toString.call(e), "date");
|
|
1387
|
+
if (Te(e))
|
|
1388
|
+
return Ae(e);
|
|
1389
|
+
}
|
|
1390
|
+
var l = "", u = !1, h = ["{", "}"];
|
|
1391
|
+
if (mn(e) && (u = !0, h = ["[", "]"]), Ne(e)) {
|
|
1392
|
+
var c = e.name ? ": " + e.name : "";
|
|
1393
|
+
l = " [Function" + c + "]";
|
|
1394
|
+
}
|
|
1395
|
+
if (Le(e) && (l = " " + RegExp.prototype.toString.call(e)), Ze(e) && (l = " " + Date.prototype.toUTCString.call(e)), Te(e) && (l = " " + Ae(e)), o.length === 0 && (!u || e.length == 0))
|
|
1396
|
+
return h[0] + l + h[1];
|
|
1397
|
+
if (r < 0)
|
|
1398
|
+
return Le(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special");
|
|
1399
|
+
t.seen.push(e);
|
|
1400
|
+
var g;
|
|
1401
|
+
return u ? g = dn(t, e, r, s, o) : g = o.map(function(v) {
|
|
1402
|
+
return ke(t, e, r, s, v, u);
|
|
1403
|
+
}), t.seen.pop(), pn(g, l, h);
|
|
1404
|
+
}
|
|
1405
|
+
function cn(t, e) {
|
|
1406
|
+
if (Q(e))
|
|
1407
|
+
return t.stylize("undefined", "undefined");
|
|
1408
|
+
if (Ve(e)) {
|
|
1409
|
+
var r = "'" + JSON.stringify(e).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
1410
|
+
return t.stylize(r, "string");
|
|
1411
|
+
}
|
|
1412
|
+
if (gn(e))
|
|
1413
|
+
return t.stylize("" + e, "number");
|
|
1414
|
+
if (Nt(e))
|
|
1415
|
+
return t.stylize("" + e, "boolean");
|
|
1416
|
+
if (ze(e))
|
|
1417
|
+
return t.stylize("null", "null");
|
|
1418
|
+
}
|
|
1419
|
+
function Ae(t) {
|
|
1420
|
+
return "[" + Error.prototype.toString.call(t) + "]";
|
|
1421
|
+
}
|
|
1422
|
+
function dn(t, e, r, n, i) {
|
|
1423
|
+
for (var o = [], s = 0, f = e.length; s < f; ++s)
|
|
1424
|
+
Dt(e, String(s)) ? o.push(ke(
|
|
1425
|
+
t,
|
|
1426
|
+
e,
|
|
1427
|
+
r,
|
|
1428
|
+
n,
|
|
1429
|
+
String(s),
|
|
1430
|
+
!0
|
|
1431
|
+
)) : o.push("");
|
|
1432
|
+
return i.forEach(function(l) {
|
|
1433
|
+
l.match(/^\d+$/) || o.push(ke(
|
|
1434
|
+
t,
|
|
1435
|
+
e,
|
|
1436
|
+
r,
|
|
1437
|
+
n,
|
|
1438
|
+
l,
|
|
1439
|
+
!0
|
|
1440
|
+
));
|
|
1441
|
+
}), o;
|
|
1442
|
+
}
|
|
1443
|
+
function ke(t, e, r, n, i, o) {
|
|
1444
|
+
var s, f, l;
|
|
1445
|
+
if (l = Object.getOwnPropertyDescriptor(e, i) || { value: e[i] }, l.get ? l.set ? f = t.stylize("[Getter/Setter]", "special") : f = t.stylize("[Getter]", "special") : l.set && (f = t.stylize("[Setter]", "special")), Dt(n, i) || (s = "[" + i + "]"), f || (t.seen.indexOf(l.value) < 0 ? (ze(r) ? f = ve(t, l.value, null) : f = ve(t, l.value, r - 1), f.indexOf(`
|
|
1446
|
+
`) > -1 && (o ? f = f.split(`
|
|
1447
|
+
`).map(function(u) {
|
|
1448
|
+
return " " + u;
|
|
1449
|
+
}).join(`
|
|
1450
|
+
`).substr(2) : f = `
|
|
1451
|
+
` + f.split(`
|
|
1452
|
+
`).map(function(u) {
|
|
1453
|
+
return " " + u;
|
|
1454
|
+
}).join(`
|
|
1455
|
+
`))) : f = t.stylize("[Circular]", "special")), Q(s)) {
|
|
1456
|
+
if (o && i.match(/^\d+$/))
|
|
1457
|
+
return f;
|
|
1458
|
+
s = JSON.stringify("" + i), s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (s = s.substr(1, s.length - 2), s = t.stylize(s, "name")) : (s = s.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), s = t.stylize(s, "string"));
|
|
1459
|
+
}
|
|
1460
|
+
return s + ": " + f;
|
|
1461
|
+
}
|
|
1462
|
+
function pn(t, e, r) {
|
|
1463
|
+
var n = t.reduce(function(i, o) {
|
|
1464
|
+
return o.indexOf(`
|
|
1465
|
+
`) >= 0, i + o.replace(/\u001b\[\d\d?m/g, "").length + 1;
|
|
1466
|
+
}, 0);
|
|
1467
|
+
return n > 60 ? r[0] + (e === "" ? "" : e + `
|
|
1468
|
+
`) + " " + t.join(`,
|
|
1469
|
+
`) + " " + r[1] : r[0] + e + " " + t.join(", ") + " " + r[1];
|
|
1470
|
+
}
|
|
1471
|
+
function mn(t) {
|
|
1472
|
+
return Array.isArray(t);
|
|
1473
|
+
}
|
|
1474
|
+
function Nt(t) {
|
|
1475
|
+
return typeof t == "boolean";
|
|
1476
|
+
}
|
|
1477
|
+
function ze(t) {
|
|
1478
|
+
return t === null;
|
|
1479
|
+
}
|
|
1480
|
+
function gn(t) {
|
|
1481
|
+
return typeof t == "number";
|
|
1482
|
+
}
|
|
1483
|
+
function Ve(t) {
|
|
1484
|
+
return typeof t == "string";
|
|
1485
|
+
}
|
|
1486
|
+
function Q(t) {
|
|
1487
|
+
return t === void 0;
|
|
1488
|
+
}
|
|
1489
|
+
function Le(t) {
|
|
1490
|
+
return he(t) && Je(t) === "[object RegExp]";
|
|
1491
|
+
}
|
|
1492
|
+
function he(t) {
|
|
1493
|
+
return typeof t == "object" && t !== null;
|
|
1494
|
+
}
|
|
1495
|
+
function Ze(t) {
|
|
1496
|
+
return he(t) && Je(t) === "[object Date]";
|
|
1497
|
+
}
|
|
1498
|
+
function Te(t) {
|
|
1499
|
+
return he(t) && (Je(t) === "[object Error]" || t instanceof Error);
|
|
1500
|
+
}
|
|
1501
|
+
function Ne(t) {
|
|
1502
|
+
return typeof t == "function";
|
|
1503
|
+
}
|
|
1504
|
+
function Je(t) {
|
|
1505
|
+
return Object.prototype.toString.call(t);
|
|
1506
|
+
}
|
|
1507
|
+
function _n(t, e) {
|
|
1508
|
+
if (!e || !he(e))
|
|
1509
|
+
return t;
|
|
1510
|
+
for (var r = Object.keys(e), n = r.length; n--; )
|
|
1511
|
+
t[r[n]] = e[r[n]];
|
|
1512
|
+
return t;
|
|
1513
|
+
}
|
|
1514
|
+
function Dt(t, e) {
|
|
1515
|
+
return Object.prototype.hasOwnProperty.call(t, e);
|
|
1516
|
+
}
|
|
1517
|
+
function te() {
|
|
1518
|
+
this.head = null, this.tail = null, this.length = 0;
|
|
1519
|
+
}
|
|
1520
|
+
te.prototype.push = function(t) {
|
|
1521
|
+
var e = { data: t, next: null };
|
|
1522
|
+
this.length > 0 ? this.tail.next = e : this.head = e, this.tail = e, ++this.length;
|
|
1523
|
+
};
|
|
1524
|
+
te.prototype.unshift = function(t) {
|
|
1525
|
+
var e = { data: t, next: this.head };
|
|
1526
|
+
this.length === 0 && (this.tail = e), this.head = e, ++this.length;
|
|
1527
|
+
};
|
|
1528
|
+
te.prototype.shift = function() {
|
|
1529
|
+
if (this.length !== 0) {
|
|
1530
|
+
var t = this.head.data;
|
|
1531
|
+
return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, t;
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
te.prototype.clear = function() {
|
|
1535
|
+
this.head = this.tail = null, this.length = 0;
|
|
1536
|
+
};
|
|
1537
|
+
te.prototype.join = function(t) {
|
|
1538
|
+
if (this.length === 0)
|
|
1539
|
+
return "";
|
|
1540
|
+
for (var e = this.head, r = "" + e.data; e = e.next; )
|
|
1541
|
+
r += t + e.data;
|
|
1542
|
+
return r;
|
|
1543
|
+
};
|
|
1544
|
+
te.prototype.concat = function(t) {
|
|
1545
|
+
if (this.length === 0)
|
|
1546
|
+
return a.alloc(0);
|
|
1547
|
+
if (this.length === 1)
|
|
1548
|
+
return this.head.data;
|
|
1549
|
+
for (var e = a.allocUnsafe(t >>> 0), r = this.head, n = 0; r; )
|
|
1550
|
+
r.data.copy(e, n), n += r.data.length, r = r.next;
|
|
1551
|
+
return e;
|
|
1552
|
+
};
|
|
1553
|
+
var wn = a.isEncoding || function(t) {
|
|
1554
|
+
switch (t && t.toLowerCase()) {
|
|
1555
|
+
case "hex":
|
|
1556
|
+
case "utf8":
|
|
1557
|
+
case "utf-8":
|
|
1558
|
+
case "ascii":
|
|
1559
|
+
case "binary":
|
|
1560
|
+
case "base64":
|
|
1561
|
+
case "ucs2":
|
|
1562
|
+
case "ucs-2":
|
|
1563
|
+
case "utf16le":
|
|
1564
|
+
case "utf-16le":
|
|
1565
|
+
case "raw":
|
|
1566
|
+
return !0;
|
|
1567
|
+
default:
|
|
1568
|
+
return !1;
|
|
1569
|
+
}
|
|
1570
|
+
};
|
|
1571
|
+
function yn(t) {
|
|
1572
|
+
if (t && !wn(t))
|
|
1573
|
+
throw new Error("Unknown encoding: " + t);
|
|
1574
|
+
}
|
|
1575
|
+
function ce(t) {
|
|
1576
|
+
switch (this.encoding = (t || "utf8").toLowerCase().replace(/[-_]/, ""), yn(t), this.encoding) {
|
|
1577
|
+
case "utf8":
|
|
1578
|
+
this.surrogateSize = 3;
|
|
1579
|
+
break;
|
|
1580
|
+
case "ucs2":
|
|
1581
|
+
case "utf16le":
|
|
1582
|
+
this.surrogateSize = 2, this.detectIncompleteChar = bn;
|
|
1583
|
+
break;
|
|
1584
|
+
case "base64":
|
|
1585
|
+
this.surrogateSize = 3, this.detectIncompleteChar = xn;
|
|
1586
|
+
break;
|
|
1587
|
+
default:
|
|
1588
|
+
this.write = vn;
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
this.charBuffer = new a(6), this.charReceived = 0, this.charLength = 0;
|
|
1592
|
+
}
|
|
1593
|
+
ce.prototype.write = function(t) {
|
|
1594
|
+
for (var e = ""; this.charLength; ) {
|
|
1595
|
+
var r = t.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : t.length;
|
|
1596
|
+
if (t.copy(this.charBuffer, this.charReceived, 0, r), this.charReceived += r, this.charReceived < this.charLength)
|
|
1597
|
+
return "";
|
|
1598
|
+
t = t.slice(r, t.length), e = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
|
|
1599
|
+
var i = e.charCodeAt(e.length - 1);
|
|
1600
|
+
if (i >= 55296 && i <= 56319) {
|
|
1601
|
+
this.charLength += this.surrogateSize, e = "";
|
|
1602
|
+
continue;
|
|
1603
|
+
}
|
|
1604
|
+
if (this.charReceived = this.charLength = 0, t.length === 0)
|
|
1605
|
+
return e;
|
|
1606
|
+
break;
|
|
1607
|
+
}
|
|
1608
|
+
this.detectIncompleteChar(t);
|
|
1609
|
+
var n = t.length;
|
|
1610
|
+
this.charLength && (t.copy(this.charBuffer, 0, t.length - this.charReceived, n), n -= this.charReceived), e += t.toString(this.encoding, 0, n);
|
|
1611
|
+
var n = e.length - 1, i = e.charCodeAt(n);
|
|
1612
|
+
if (i >= 55296 && i <= 56319) {
|
|
1613
|
+
var o = this.surrogateSize;
|
|
1614
|
+
return this.charLength += o, this.charReceived += o, this.charBuffer.copy(this.charBuffer, o, 0, o), t.copy(this.charBuffer, 0, 0, o), e.substring(0, n);
|
|
1615
|
+
}
|
|
1616
|
+
return e;
|
|
1617
|
+
};
|
|
1618
|
+
ce.prototype.detectIncompleteChar = function(t) {
|
|
1619
|
+
for (var e = t.length >= 3 ? 3 : t.length; e > 0; e--) {
|
|
1620
|
+
var r = t[t.length - e];
|
|
1621
|
+
if (e == 1 && r >> 5 == 6) {
|
|
1622
|
+
this.charLength = 2;
|
|
1623
|
+
break;
|
|
1624
|
+
}
|
|
1625
|
+
if (e <= 2 && r >> 4 == 14) {
|
|
1626
|
+
this.charLength = 3;
|
|
1627
|
+
break;
|
|
1628
|
+
}
|
|
1629
|
+
if (e <= 3 && r >> 3 == 30) {
|
|
1630
|
+
this.charLength = 4;
|
|
1631
|
+
break;
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
this.charReceived = e;
|
|
1635
|
+
};
|
|
1636
|
+
ce.prototype.end = function(t) {
|
|
1637
|
+
var e = "";
|
|
1638
|
+
if (t && t.length && (e = this.write(t)), this.charReceived) {
|
|
1639
|
+
var r = this.charReceived, n = this.charBuffer, i = this.encoding;
|
|
1640
|
+
e += n.slice(0, r).toString(i);
|
|
1641
|
+
}
|
|
1642
|
+
return e;
|
|
1643
|
+
};
|
|
1644
|
+
function vn(t) {
|
|
1645
|
+
return t.toString(this.encoding);
|
|
1646
|
+
}
|
|
1647
|
+
function bn(t) {
|
|
1648
|
+
this.charReceived = t.length % 2, this.charLength = this.charReceived ? 2 : 0;
|
|
1649
|
+
}
|
|
1650
|
+
function xn(t) {
|
|
1651
|
+
this.charReceived = t.length % 3, this.charLength = this.charReceived ? 3 : 0;
|
|
1652
|
+
}
|
|
1653
|
+
E.ReadableState = Ft;
|
|
1654
|
+
var y = an("stream");
|
|
1655
|
+
se(E, p);
|
|
1656
|
+
function En(t, e, r) {
|
|
1657
|
+
if (typeof t.prependListener == "function")
|
|
1658
|
+
return t.prependListener(e, r);
|
|
1659
|
+
!t._events || !t._events[e] ? t.on(e, r) : Array.isArray(t._events[e]) ? t._events[e].unshift(r) : t._events[e] = [r, t._events[e]];
|
|
1660
|
+
}
|
|
1661
|
+
function Sn(t, e) {
|
|
1662
|
+
return t.listeners(e).length;
|
|
1663
|
+
}
|
|
1664
|
+
function Ft(t, e) {
|
|
1665
|
+
t = t || {}, this.objectMode = !!t.objectMode, e instanceof B && (this.objectMode = this.objectMode || !!t.readableObjectMode);
|
|
1666
|
+
var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
|
|
1667
|
+
this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.buffer = new te(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.defaultEncoding = t.defaultEncoding || "utf8", this.ranOut = !1, this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, t.encoding && (this.decoder = new ce(t.encoding), this.encoding = t.encoding);
|
|
1668
|
+
}
|
|
1669
|
+
function E(t) {
|
|
1670
|
+
if (!(this instanceof E))
|
|
1671
|
+
return new E(t);
|
|
1672
|
+
this._readableState = new Ft(t, this), this.readable = !0, t && typeof t.read == "function" && (this._read = t.read), p.call(this);
|
|
1673
|
+
}
|
|
1674
|
+
E.prototype.push = function(t, e) {
|
|
1675
|
+
var r = this._readableState;
|
|
1676
|
+
return !r.objectMode && typeof t == "string" && (e = e || r.defaultEncoding, e !== r.encoding && (t = a.from(t, e), e = "")), Mt(this, r, t, e, !1);
|
|
1677
|
+
};
|
|
1678
|
+
E.prototype.unshift = function(t) {
|
|
1679
|
+
var e = this._readableState;
|
|
1680
|
+
return Mt(this, e, t, "", !0);
|
|
1681
|
+
};
|
|
1682
|
+
E.prototype.isPaused = function() {
|
|
1683
|
+
return this._readableState.flowing === !1;
|
|
1684
|
+
};
|
|
1685
|
+
function Mt(t, e, r, n, i) {
|
|
1686
|
+
var o = On(e, r);
|
|
1687
|
+
if (o)
|
|
1688
|
+
t.emit("error", o);
|
|
1689
|
+
else if (r === null)
|
|
1690
|
+
e.reading = !1, Cn(t, e);
|
|
1691
|
+
else if (e.objectMode || r && r.length > 0)
|
|
1692
|
+
if (e.ended && !i) {
|
|
1693
|
+
var s = new Error("stream.push() after EOF");
|
|
1694
|
+
t.emit("error", s);
|
|
1695
|
+
} else if (e.endEmitted && i) {
|
|
1696
|
+
var f = new Error("stream.unshift() after end event");
|
|
1697
|
+
t.emit("error", f);
|
|
1698
|
+
} else {
|
|
1699
|
+
var l;
|
|
1700
|
+
e.decoder && !i && !n && (r = e.decoder.write(r), l = !e.objectMode && r.length === 0), i || (e.reading = !1), l || (e.flowing && e.length === 0 && !e.sync ? (t.emit("data", r), t.read(0)) : (e.length += e.objectMode ? 1 : r.length, i ? e.buffer.unshift(r) : e.buffer.push(r), e.needReadable && Re(t))), An(t, e);
|
|
1701
|
+
}
|
|
1702
|
+
else
|
|
1703
|
+
i || (e.reading = !1);
|
|
1704
|
+
return Rn(e);
|
|
1705
|
+
}
|
|
1706
|
+
function Rn(t) {
|
|
1707
|
+
return !t.ended && (t.needReadable || t.length < t.highWaterMark || t.length === 0);
|
|
1708
|
+
}
|
|
1709
|
+
E.prototype.setEncoding = function(t) {
|
|
1710
|
+
return this._readableState.decoder = new ce(t), this._readableState.encoding = t, this;
|
|
1711
|
+
};
|
|
1712
|
+
var Xe = 8388608;
|
|
1713
|
+
function In(t) {
|
|
1714
|
+
return t >= Xe ? t = Xe : (t--, t |= t >>> 1, t |= t >>> 2, t |= t >>> 4, t |= t >>> 8, t |= t >>> 16, t++), t;
|
|
1715
|
+
}
|
|
1716
|
+
function Ke(t, e) {
|
|
1717
|
+
return t <= 0 || e.length === 0 && e.ended ? 0 : e.objectMode ? 1 : t !== t ? e.flowing && e.length ? e.buffer.head.data.length : e.length : (t > e.highWaterMark && (e.highWaterMark = In(t)), t <= e.length ? t : e.ended ? e.length : (e.needReadable = !0, 0));
|
|
1718
|
+
}
|
|
1719
|
+
E.prototype.read = function(t) {
|
|
1720
|
+
y("read", t), t = parseInt(t, 10);
|
|
1721
|
+
var e = this._readableState, r = t;
|
|
1722
|
+
if (t !== 0 && (e.emittedReadable = !1), t === 0 && e.needReadable && (e.length >= e.highWaterMark || e.ended))
|
|
1723
|
+
return y("read: emitReadable", e.length, e.ended), e.length === 0 && e.ended ? De(this) : Re(this), null;
|
|
1724
|
+
if (t = Ke(t, e), t === 0 && e.ended)
|
|
1725
|
+
return e.length === 0 && De(this), null;
|
|
1726
|
+
var n = e.needReadable;
|
|
1727
|
+
y("need readable", n), (e.length === 0 || e.length - t < e.highWaterMark) && (n = !0, y("length less than watermark", n)), e.ended || e.reading ? (n = !1, y("reading or ended", n)) : n && (y("do read"), e.reading = !0, e.sync = !0, e.length === 0 && (e.needReadable = !0), this._read(e.highWaterMark), e.sync = !1, e.reading || (t = Ke(r, e)));
|
|
1728
|
+
var i;
|
|
1729
|
+
return t > 0 ? i = Bt(t, e) : i = null, i === null ? (e.needReadable = !0, t = 0) : e.length -= t, e.length === 0 && (e.ended || (e.needReadable = !0), r !== t && e.ended && De(this)), i !== null && this.emit("data", i), i;
|
|
1730
|
+
};
|
|
1731
|
+
function On(t, e) {
|
|
1732
|
+
var r = null;
|
|
1733
|
+
return !T(e) && typeof e != "string" && e !== null && e !== void 0 && !t.objectMode && (r = new TypeError("Invalid non-string/buffer chunk")), r;
|
|
1734
|
+
}
|
|
1735
|
+
function Cn(t, e) {
|
|
1736
|
+
if (!e.ended) {
|
|
1737
|
+
if (e.decoder) {
|
|
1738
|
+
var r = e.decoder.end();
|
|
1739
|
+
r && r.length && (e.buffer.push(r), e.length += e.objectMode ? 1 : r.length);
|
|
1740
|
+
}
|
|
1741
|
+
e.ended = !0, Re(t);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
function Re(t) {
|
|
1745
|
+
var e = t._readableState;
|
|
1746
|
+
e.needReadable = !1, e.emittedReadable || (y("emitReadable", e.flowing), e.emittedReadable = !0, e.sync ? D(et, t) : et(t));
|
|
1747
|
+
}
|
|
1748
|
+
function et(t) {
|
|
1749
|
+
y("emit readable"), t.emit("readable"), Ye(t);
|
|
1750
|
+
}
|
|
1751
|
+
function An(t, e) {
|
|
1752
|
+
e.readingMore || (e.readingMore = !0, D(Ln, t, e));
|
|
1753
|
+
}
|
|
1754
|
+
function Ln(t, e) {
|
|
1755
|
+
for (var r = e.length; !e.reading && !e.flowing && !e.ended && e.length < e.highWaterMark && (y("maybeReadMore read 0"), t.read(0), r !== e.length); )
|
|
1756
|
+
r = e.length;
|
|
1757
|
+
e.readingMore = !1;
|
|
1758
|
+
}
|
|
1759
|
+
E.prototype._read = function(t) {
|
|
1760
|
+
this.emit("error", new Error("not implemented"));
|
|
1761
|
+
};
|
|
1762
|
+
E.prototype.pipe = function(t, e) {
|
|
1763
|
+
var r = this, n = this._readableState;
|
|
1764
|
+
switch (n.pipesCount) {
|
|
1765
|
+
case 0:
|
|
1766
|
+
n.pipes = t;
|
|
1767
|
+
break;
|
|
1768
|
+
case 1:
|
|
1769
|
+
n.pipes = [n.pipes, t];
|
|
1770
|
+
break;
|
|
1771
|
+
default:
|
|
1772
|
+
n.pipes.push(t);
|
|
1773
|
+
break;
|
|
1774
|
+
}
|
|
1775
|
+
n.pipesCount += 1, y("pipe count=%d opts=%j", n.pipesCount, e);
|
|
1776
|
+
var i = !e || e.end !== !1, o = i ? f : h;
|
|
1777
|
+
n.endEmitted ? D(o) : r.once("end", o), t.on("unpipe", s);
|
|
1778
|
+
function s(S) {
|
|
1779
|
+
y("onunpipe"), S === r && h();
|
|
1780
|
+
}
|
|
1781
|
+
function f() {
|
|
1782
|
+
y("onend"), t.end();
|
|
1783
|
+
}
|
|
1784
|
+
var l = Tn(r);
|
|
1785
|
+
t.on("drain", l);
|
|
1786
|
+
var u = !1;
|
|
1787
|
+
function h() {
|
|
1788
|
+
y("cleanup"), t.removeListener("close", A), t.removeListener("finish", x), t.removeListener("drain", l), t.removeListener("error", v), t.removeListener("unpipe", s), r.removeListener("end", f), r.removeListener("end", h), r.removeListener("data", g), u = !0, n.awaitDrain && (!t._writableState || t._writableState.needDrain) && l();
|
|
1789
|
+
}
|
|
1790
|
+
var c = !1;
|
|
1791
|
+
r.on("data", g);
|
|
1792
|
+
function g(S) {
|
|
1793
|
+
y("ondata"), c = !1;
|
|
1794
|
+
var b = t.write(S);
|
|
1795
|
+
b === !1 && !c && ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && Ut(n.pipes, t) !== -1) && !u && (y("false write response, pause", r._readableState.awaitDrain), r._readableState.awaitDrain++, c = !0), r.pause());
|
|
1796
|
+
}
|
|
1797
|
+
function v(S) {
|
|
1798
|
+
y("onerror", S), F(), t.removeListener("error", v), Sn(t, "error") === 0 && t.emit("error", S);
|
|
1799
|
+
}
|
|
1800
|
+
En(t, "error", v);
|
|
1801
|
+
function A() {
|
|
1802
|
+
t.removeListener("finish", x), F();
|
|
1803
|
+
}
|
|
1804
|
+
t.once("close", A);
|
|
1805
|
+
function x() {
|
|
1806
|
+
y("onfinish"), t.removeListener("close", A), F();
|
|
1807
|
+
}
|
|
1808
|
+
t.once("finish", x);
|
|
1809
|
+
function F() {
|
|
1810
|
+
y("unpipe"), r.unpipe(t);
|
|
1811
|
+
}
|
|
1812
|
+
return t.emit("pipe", r), n.flowing || (y("pipe resume"), r.resume()), t;
|
|
1813
|
+
};
|
|
1814
|
+
function Tn(t) {
|
|
1815
|
+
return function() {
|
|
1816
|
+
var e = t._readableState;
|
|
1817
|
+
y("pipeOnDrain", e.awaitDrain), e.awaitDrain && e.awaitDrain--, e.awaitDrain === 0 && t.listeners("data").length && (e.flowing = !0, Ye(t));
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1820
|
+
E.prototype.unpipe = function(t) {
|
|
1821
|
+
var e = this._readableState;
|
|
1822
|
+
if (e.pipesCount === 0)
|
|
1823
|
+
return this;
|
|
1824
|
+
if (e.pipesCount === 1)
|
|
1825
|
+
return t && t !== e.pipes ? this : (t || (t = e.pipes), e.pipes = null, e.pipesCount = 0, e.flowing = !1, t && t.emit("unpipe", this), this);
|
|
1826
|
+
if (!t) {
|
|
1827
|
+
var r = e.pipes, n = e.pipesCount;
|
|
1828
|
+
e.pipes = null, e.pipesCount = 0, e.flowing = !1;
|
|
1829
|
+
for (var i = 0; i < n; i++)
|
|
1830
|
+
r[i].emit("unpipe", this);
|
|
1831
|
+
return this;
|
|
1832
|
+
}
|
|
1833
|
+
var o = Ut(e.pipes, t);
|
|
1834
|
+
return o === -1 ? this : (e.pipes.splice(o, 1), e.pipesCount -= 1, e.pipesCount === 1 && (e.pipes = e.pipes[0]), t.emit("unpipe", this), this);
|
|
1835
|
+
};
|
|
1836
|
+
E.prototype.on = function(t, e) {
|
|
1837
|
+
var r = p.prototype.on.call(this, t, e);
|
|
1838
|
+
if (t === "data")
|
|
1839
|
+
this._readableState.flowing !== !1 && this.resume();
|
|
1840
|
+
else if (t === "readable") {
|
|
1841
|
+
var n = this._readableState;
|
|
1842
|
+
!n.endEmitted && !n.readableListening && (n.readableListening = n.needReadable = !0, n.emittedReadable = !1, n.reading ? n.length && Re(this) : D(Nn, this));
|
|
1843
|
+
}
|
|
1844
|
+
return r;
|
|
1845
|
+
};
|
|
1846
|
+
E.prototype.addListener = E.prototype.on;
|
|
1847
|
+
function Nn(t) {
|
|
1848
|
+
y("readable nexttick read 0"), t.read(0);
|
|
1849
|
+
}
|
|
1850
|
+
E.prototype.resume = function() {
|
|
1851
|
+
var t = this._readableState;
|
|
1852
|
+
return t.flowing || (y("resume"), t.flowing = !0, Dn(this, t)), this;
|
|
1853
|
+
};
|
|
1854
|
+
function Dn(t, e) {
|
|
1855
|
+
e.resumeScheduled || (e.resumeScheduled = !0, D(Fn, t, e));
|
|
1856
|
+
}
|
|
1857
|
+
function Fn(t, e) {
|
|
1858
|
+
e.reading || (y("resume read 0"), t.read(0)), e.resumeScheduled = !1, e.awaitDrain = 0, t.emit("resume"), Ye(t), e.flowing && !e.reading && t.read(0);
|
|
1859
|
+
}
|
|
1860
|
+
E.prototype.pause = function() {
|
|
1861
|
+
return y("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (y("pause"), this._readableState.flowing = !1, this.emit("pause")), this;
|
|
1862
|
+
};
|
|
1863
|
+
function Ye(t) {
|
|
1864
|
+
var e = t._readableState;
|
|
1865
|
+
for (y("flow", e.flowing); e.flowing && t.read() !== null; )
|
|
1866
|
+
;
|
|
1867
|
+
}
|
|
1868
|
+
E.prototype.wrap = function(t) {
|
|
1869
|
+
var e = this._readableState, r = !1, n = this;
|
|
1870
|
+
t.on("end", function() {
|
|
1871
|
+
if (y("wrapped end"), e.decoder && !e.ended) {
|
|
1872
|
+
var s = e.decoder.end();
|
|
1873
|
+
s && s.length && n.push(s);
|
|
1874
|
+
}
|
|
1875
|
+
n.push(null);
|
|
1876
|
+
}), t.on("data", function(s) {
|
|
1877
|
+
if (y("wrapped data"), e.decoder && (s = e.decoder.write(s)), !(e.objectMode && s == null) && !(!e.objectMode && (!s || !s.length))) {
|
|
1878
|
+
var f = n.push(s);
|
|
1879
|
+
f || (r = !0, t.pause());
|
|
1880
|
+
}
|
|
1881
|
+
});
|
|
1882
|
+
for (var i in t)
|
|
1883
|
+
this[i] === void 0 && typeof t[i] == "function" && (this[i] = /* @__PURE__ */ function(s) {
|
|
1884
|
+
return function() {
|
|
1885
|
+
return t[s].apply(t, arguments);
|
|
1886
|
+
};
|
|
1887
|
+
}(i));
|
|
1888
|
+
var o = ["error", "close", "destroy", "pause", "resume"];
|
|
1889
|
+
return Pn(o, function(s) {
|
|
1890
|
+
t.on(s, n.emit.bind(n, s));
|
|
1891
|
+
}), n._read = function(s) {
|
|
1892
|
+
y("wrapped _read", s), r && (r = !1, t.resume());
|
|
1893
|
+
}, n;
|
|
1894
|
+
};
|
|
1895
|
+
E._fromList = Bt;
|
|
1896
|
+
function Bt(t, e) {
|
|
1897
|
+
if (e.length === 0)
|
|
1898
|
+
return null;
|
|
1899
|
+
var r;
|
|
1900
|
+
return e.objectMode ? r = e.buffer.shift() : !t || t >= e.length ? (e.decoder ? r = e.buffer.join("") : e.buffer.length === 1 ? r = e.buffer.head.data : r = e.buffer.concat(e.length), e.buffer.clear()) : r = Mn(t, e.buffer, e.decoder), r;
|
|
1901
|
+
}
|
|
1902
|
+
function Mn(t, e, r) {
|
|
1903
|
+
var n;
|
|
1904
|
+
return t < e.head.data.length ? (n = e.head.data.slice(0, t), e.head.data = e.head.data.slice(t)) : t === e.head.data.length ? n = e.shift() : n = r ? Bn(t, e) : Un(t, e), n;
|
|
1905
|
+
}
|
|
1906
|
+
function Bn(t, e) {
|
|
1907
|
+
var r = e.head, n = 1, i = r.data;
|
|
1908
|
+
for (t -= i.length; r = r.next; ) {
|
|
1909
|
+
var o = r.data, s = t > o.length ? o.length : t;
|
|
1910
|
+
if (s === o.length ? i += o : i += o.slice(0, t), t -= s, t === 0) {
|
|
1911
|
+
s === o.length ? (++n, r.next ? e.head = r.next : e.head = e.tail = null) : (e.head = r, r.data = o.slice(s));
|
|
1912
|
+
break;
|
|
1913
|
+
}
|
|
1914
|
+
++n;
|
|
1915
|
+
}
|
|
1916
|
+
return e.length -= n, i;
|
|
1917
|
+
}
|
|
1918
|
+
function Un(t, e) {
|
|
1919
|
+
var r = a.allocUnsafe(t), n = e.head, i = 1;
|
|
1920
|
+
for (n.data.copy(r), t -= n.data.length; n = n.next; ) {
|
|
1921
|
+
var o = n.data, s = t > o.length ? o.length : t;
|
|
1922
|
+
if (o.copy(r, r.length - t, 0, s), t -= s, t === 0) {
|
|
1923
|
+
s === o.length ? (++i, n.next ? e.head = n.next : e.head = e.tail = null) : (e.head = n, n.data = o.slice(s));
|
|
1924
|
+
break;
|
|
1925
|
+
}
|
|
1926
|
+
++i;
|
|
1927
|
+
}
|
|
1928
|
+
return e.length -= i, r;
|
|
1929
|
+
}
|
|
1930
|
+
function De(t) {
|
|
1931
|
+
var e = t._readableState;
|
|
1932
|
+
if (e.length > 0)
|
|
1933
|
+
throw new Error('"endReadable()" called on non-empty stream');
|
|
1934
|
+
e.endEmitted || (e.ended = !0, D(kn, e, t));
|
|
1935
|
+
}
|
|
1936
|
+
function kn(t, e) {
|
|
1937
|
+
!t.endEmitted && t.length === 0 && (t.endEmitted = !0, e.readable = !1, e.emit("end"));
|
|
1938
|
+
}
|
|
1939
|
+
function Pn(t, e) {
|
|
1940
|
+
for (var r = 0, n = t.length; r < n; r++)
|
|
1941
|
+
e(t[r], r);
|
|
1942
|
+
}
|
|
1943
|
+
function Ut(t, e) {
|
|
1944
|
+
for (var r = 0, n = t.length; r < n; r++)
|
|
1945
|
+
if (t[r] === e)
|
|
1946
|
+
return r;
|
|
1947
|
+
return -1;
|
|
1948
|
+
}
|
|
1949
|
+
C.WritableState = We;
|
|
1950
|
+
se(C, p);
|
|
1951
|
+
function jn() {
|
|
1952
|
+
}
|
|
1953
|
+
function $n(t, e, r) {
|
|
1954
|
+
this.chunk = t, this.encoding = e, this.callback = r, this.next = null;
|
|
1955
|
+
}
|
|
1956
|
+
function We(t, e) {
|
|
1957
|
+
Object.defineProperty(this, "buffer", {
|
|
1958
|
+
get: Tt(function() {
|
|
1959
|
+
return this.getBuffer();
|
|
1960
|
+
}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")
|
|
1961
|
+
}), t = t || {}, this.objectMode = !!t.objectMode, e instanceof B && (this.objectMode = this.objectMode || !!t.writableObjectMode);
|
|
1962
|
+
var r = t.highWaterMark, n = this.objectMode ? 16 : 16 * 1024;
|
|
1963
|
+
this.highWaterMark = r || r === 0 ? r : n, this.highWaterMark = ~~this.highWaterMark, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1;
|
|
1964
|
+
var i = t.decodeStrings === !1;
|
|
1965
|
+
this.decodeStrings = !i, this.defaultEncoding = t.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(o) {
|
|
1966
|
+
Qn(e, o);
|
|
1967
|
+
}, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new $t(this);
|
|
1968
|
+
}
|
|
1969
|
+
We.prototype.getBuffer = function() {
|
|
1970
|
+
for (var e = this.bufferedRequest, r = []; e; )
|
|
1971
|
+
r.push(e), e = e.next;
|
|
1972
|
+
return r;
|
|
1973
|
+
};
|
|
1974
|
+
function C(t) {
|
|
1975
|
+
if (!(this instanceof C) && !(this instanceof B))
|
|
1976
|
+
return new C(t);
|
|
1977
|
+
this._writableState = new We(t, this), this.writable = !0, t && (typeof t.write == "function" && (this._write = t.write), typeof t.writev == "function" && (this._writev = t.writev)), p.call(this);
|
|
1978
|
+
}
|
|
1979
|
+
C.prototype.pipe = function() {
|
|
1980
|
+
this.emit("error", new Error("Cannot pipe, not readable"));
|
|
1981
|
+
};
|
|
1982
|
+
function qn(t, e) {
|
|
1983
|
+
var r = new Error("write after end");
|
|
1984
|
+
t.emit("error", r), D(e, r);
|
|
1985
|
+
}
|
|
1986
|
+
function zn(t, e, r, n) {
|
|
1987
|
+
var i = !0, o = !1;
|
|
1988
|
+
return r === null ? o = new TypeError("May not write null values to stream") : !a.isBuffer(r) && typeof r != "string" && r !== void 0 && !e.objectMode && (o = new TypeError("Invalid non-string/buffer chunk")), o && (t.emit("error", o), D(n, o), i = !1), i;
|
|
1989
|
+
}
|
|
1990
|
+
C.prototype.write = function(t, e, r) {
|
|
1991
|
+
var n = this._writableState, i = !1;
|
|
1992
|
+
return typeof e == "function" && (r = e, e = null), a.isBuffer(t) ? e = "buffer" : e || (e = n.defaultEncoding), typeof r != "function" && (r = jn), n.ended ? qn(this, r) : zn(this, n, t, r) && (n.pendingcb++, i = Jn(this, n, t, e, r)), i;
|
|
1993
|
+
};
|
|
1994
|
+
C.prototype.cork = function() {
|
|
1995
|
+
var t = this._writableState;
|
|
1996
|
+
t.corked++;
|
|
1997
|
+
};
|
|
1998
|
+
C.prototype.uncork = function() {
|
|
1999
|
+
var t = this._writableState;
|
|
2000
|
+
t.corked && (t.corked--, !t.writing && !t.corked && !t.finished && !t.bufferProcessing && t.bufferedRequest && kt(this, t));
|
|
2001
|
+
};
|
|
2002
|
+
C.prototype.setDefaultEncoding = function(e) {
|
|
2003
|
+
if (typeof e == "string" && (e = e.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e + "").toLowerCase()) > -1))
|
|
2004
|
+
throw new TypeError("Unknown encoding: " + e);
|
|
2005
|
+
return this._writableState.defaultEncoding = e, this;
|
|
2006
|
+
};
|
|
2007
|
+
function Vn(t, e, r) {
|
|
2008
|
+
return !t.objectMode && t.decodeStrings !== !1 && typeof e == "string" && (e = a.from(e, r)), e;
|
|
2009
|
+
}
|
|
2010
|
+
function Jn(t, e, r, n, i) {
|
|
2011
|
+
r = Vn(e, r, n), a.isBuffer(r) && (n = "buffer");
|
|
2012
|
+
var o = e.objectMode ? 1 : r.length;
|
|
2013
|
+
e.length += o;
|
|
2014
|
+
var s = e.length < e.highWaterMark;
|
|
2015
|
+
if (s || (e.needDrain = !0), e.writing || e.corked) {
|
|
2016
|
+
var f = e.lastBufferedRequest;
|
|
2017
|
+
e.lastBufferedRequest = new $n(r, n, i), f ? f.next = e.lastBufferedRequest : e.bufferedRequest = e.lastBufferedRequest, e.bufferedRequestCount += 1;
|
|
2018
|
+
} else
|
|
2019
|
+
Pe(t, e, !1, o, r, n, i);
|
|
2020
|
+
return s;
|
|
2021
|
+
}
|
|
2022
|
+
function Pe(t, e, r, n, i, o, s) {
|
|
2023
|
+
e.writelen = n, e.writecb = s, e.writing = !0, e.sync = !0, r ? t._writev(i, e.onwrite) : t._write(i, o, e.onwrite), e.sync = !1;
|
|
2024
|
+
}
|
|
2025
|
+
function Yn(t, e, r, n, i) {
|
|
2026
|
+
--e.pendingcb, r ? D(i, n) : i(n), t._writableState.errorEmitted = !0, t.emit("error", n);
|
|
2027
|
+
}
|
|
2028
|
+
function Wn(t) {
|
|
2029
|
+
t.writing = !1, t.writecb = null, t.length -= t.writelen, t.writelen = 0;
|
|
2030
|
+
}
|
|
2031
|
+
function Qn(t, e) {
|
|
2032
|
+
var r = t._writableState, n = r.sync, i = r.writecb;
|
|
2033
|
+
if (Wn(r), e)
|
|
2034
|
+
Yn(t, r, n, e, i);
|
|
2035
|
+
else {
|
|
2036
|
+
var o = Pt(r);
|
|
2037
|
+
!o && !r.corked && !r.bufferProcessing && r.bufferedRequest && kt(t, r), n ? D(tt, t, r, o, i) : tt(t, r, o, i);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
function tt(t, e, r, n) {
|
|
2041
|
+
r || Hn(t, e), e.pendingcb--, n(), jt(t, e);
|
|
2042
|
+
}
|
|
2043
|
+
function Hn(t, e) {
|
|
2044
|
+
e.length === 0 && e.needDrain && (e.needDrain = !1, t.emit("drain"));
|
|
2045
|
+
}
|
|
2046
|
+
function kt(t, e) {
|
|
2047
|
+
e.bufferProcessing = !0;
|
|
2048
|
+
var r = e.bufferedRequest;
|
|
2049
|
+
if (t._writev && r && r.next) {
|
|
2050
|
+
var n = e.bufferedRequestCount, i = new Array(n), o = e.corkedRequestsFree;
|
|
2051
|
+
o.entry = r;
|
|
2052
|
+
for (var s = 0; r; )
|
|
2053
|
+
i[s] = r, r = r.next, s += 1;
|
|
2054
|
+
Pe(t, e, !0, e.length, i, "", o.finish), e.pendingcb++, e.lastBufferedRequest = null, o.next ? (e.corkedRequestsFree = o.next, o.next = null) : e.corkedRequestsFree = new $t(e);
|
|
2055
|
+
} else {
|
|
2056
|
+
for (; r; ) {
|
|
2057
|
+
var f = r.chunk, l = r.encoding, u = r.callback, h = e.objectMode ? 1 : f.length;
|
|
2058
|
+
if (Pe(t, e, !1, h, f, l, u), r = r.next, e.writing)
|
|
2059
|
+
break;
|
|
2060
|
+
}
|
|
2061
|
+
r === null && (e.lastBufferedRequest = null);
|
|
2062
|
+
}
|
|
2063
|
+
e.bufferedRequestCount = 0, e.bufferedRequest = r, e.bufferProcessing = !1;
|
|
2064
|
+
}
|
|
2065
|
+
C.prototype._write = function(t, e, r) {
|
|
2066
|
+
r(new Error("not implemented"));
|
|
2067
|
+
};
|
|
2068
|
+
C.prototype._writev = null;
|
|
2069
|
+
C.prototype.end = function(t, e, r) {
|
|
2070
|
+
var n = this._writableState;
|
|
2071
|
+
typeof t == "function" ? (r = t, t = null, e = null) : typeof e == "function" && (r = e, e = null), t != null && this.write(t, e), n.corked && (n.corked = 1, this.uncork()), !n.ending && !n.finished && Gn(this, n, r);
|
|
2072
|
+
};
|
|
2073
|
+
function Pt(t) {
|
|
2074
|
+
return t.ending && t.length === 0 && t.bufferedRequest === null && !t.finished && !t.writing;
|
|
2075
|
+
}
|
|
2076
|
+
function rt(t, e) {
|
|
2077
|
+
e.prefinished || (e.prefinished = !0, t.emit("prefinish"));
|
|
2078
|
+
}
|
|
2079
|
+
function jt(t, e) {
|
|
2080
|
+
var r = Pt(e);
|
|
2081
|
+
return r && (e.pendingcb === 0 ? (rt(t, e), e.finished = !0, t.emit("finish")) : rt(t, e)), r;
|
|
2082
|
+
}
|
|
2083
|
+
function Gn(t, e, r) {
|
|
2084
|
+
e.ending = !0, jt(t, e), r && (e.finished ? D(r) : t.once("finish", r)), e.ended = !0, t.writable = !1;
|
|
2085
|
+
}
|
|
2086
|
+
function $t(t) {
|
|
2087
|
+
var e = this;
|
|
2088
|
+
this.next = null, this.entry = null, this.finish = function(r) {
|
|
2089
|
+
var n = e.entry;
|
|
2090
|
+
for (e.entry = null; n; ) {
|
|
2091
|
+
var i = n.callback;
|
|
2092
|
+
t.pendingcb--, i(r), n = n.next;
|
|
2093
|
+
}
|
|
2094
|
+
t.corkedRequestsFree ? t.corkedRequestsFree.next = e : t.corkedRequestsFree = e;
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
se(B, E);
|
|
2098
|
+
var nt = Object.keys(C.prototype);
|
|
2099
|
+
for (var Fe = 0; Fe < nt.length; Fe++) {
|
|
2100
|
+
var Me = nt[Fe];
|
|
2101
|
+
B.prototype[Me] || (B.prototype[Me] = C.prototype[Me]);
|
|
2102
|
+
}
|
|
2103
|
+
function B(t) {
|
|
2104
|
+
if (!(this instanceof B))
|
|
2105
|
+
return new B(t);
|
|
2106
|
+
E.call(this, t), C.call(this, t), t && t.readable === !1 && (this.readable = !1), t && t.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, t && t.allowHalfOpen === !1 && (this.allowHalfOpen = !1), this.once("end", Zn);
|
|
2107
|
+
}
|
|
2108
|
+
function Zn() {
|
|
2109
|
+
this.allowHalfOpen || this._writableState.ended || D(Xn, this);
|
|
2110
|
+
}
|
|
2111
|
+
function Xn(t) {
|
|
2112
|
+
t.end();
|
|
2113
|
+
}
|
|
2114
|
+
se(k, B);
|
|
2115
|
+
function Kn(t) {
|
|
2116
|
+
this.afterTransform = function(e, r) {
|
|
2117
|
+
return ei(t, e, r);
|
|
2118
|
+
}, this.needTransform = !1, this.transforming = !1, this.writecb = null, this.writechunk = null, this.writeencoding = null;
|
|
2119
|
+
}
|
|
2120
|
+
function ei(t, e, r) {
|
|
2121
|
+
var n = t._transformState;
|
|
2122
|
+
n.transforming = !1;
|
|
2123
|
+
var i = n.writecb;
|
|
2124
|
+
if (!i)
|
|
2125
|
+
return t.emit("error", new Error("no writecb in Transform class"));
|
|
2126
|
+
n.writechunk = null, n.writecb = null, r != null && t.push(r), i(e);
|
|
2127
|
+
var o = t._readableState;
|
|
2128
|
+
o.reading = !1, (o.needReadable || o.length < o.highWaterMark) && t._read(o.highWaterMark);
|
|
2129
|
+
}
|
|
2130
|
+
function k(t) {
|
|
2131
|
+
if (!(this instanceof k))
|
|
2132
|
+
return new k(t);
|
|
2133
|
+
B.call(this, t), this._transformState = new Kn(this);
|
|
2134
|
+
var e = this;
|
|
2135
|
+
this._readableState.needReadable = !0, this._readableState.sync = !1, t && (typeof t.transform == "function" && (this._transform = t.transform), typeof t.flush == "function" && (this._flush = t.flush)), this.once("prefinish", function() {
|
|
2136
|
+
typeof this._flush == "function" ? this._flush(function(r) {
|
|
2137
|
+
it(e, r);
|
|
2138
|
+
}) : it(e);
|
|
2139
|
+
});
|
|
2140
|
+
}
|
|
2141
|
+
k.prototype.push = function(t, e) {
|
|
2142
|
+
return this._transformState.needTransform = !1, B.prototype.push.call(this, t, e);
|
|
2143
|
+
};
|
|
2144
|
+
k.prototype._transform = function(t, e, r) {
|
|
2145
|
+
throw new Error("Not implemented");
|
|
2146
|
+
};
|
|
2147
|
+
k.prototype._write = function(t, e, r) {
|
|
2148
|
+
var n = this._transformState;
|
|
2149
|
+
if (n.writecb = r, n.writechunk = t, n.writeencoding = e, !n.transforming) {
|
|
2150
|
+
var i = this._readableState;
|
|
2151
|
+
(n.needTransform || i.needReadable || i.length < i.highWaterMark) && this._read(i.highWaterMark);
|
|
2152
|
+
}
|
|
2153
|
+
};
|
|
2154
|
+
k.prototype._read = function(t) {
|
|
2155
|
+
var e = this._transformState;
|
|
2156
|
+
e.writechunk !== null && e.writecb && !e.transforming ? (e.transforming = !0, this._transform(e.writechunk, e.writeencoding, e.afterTransform)) : e.needTransform = !0;
|
|
2157
|
+
};
|
|
2158
|
+
function it(t, e) {
|
|
2159
|
+
if (e)
|
|
2160
|
+
return t.emit("error", e);
|
|
2161
|
+
var r = t._writableState, n = t._transformState;
|
|
2162
|
+
if (r.length)
|
|
2163
|
+
throw new Error("Calling transform done when ws.length != 0");
|
|
2164
|
+
if (n.transforming)
|
|
2165
|
+
throw new Error("Calling transform done when still transforming");
|
|
2166
|
+
return t.push(null);
|
|
2167
|
+
}
|
|
2168
|
+
se(le, k);
|
|
2169
|
+
function le(t) {
|
|
2170
|
+
if (!(this instanceof le))
|
|
2171
|
+
return new le(t);
|
|
2172
|
+
k.call(this, t);
|
|
2173
|
+
}
|
|
2174
|
+
le.prototype._transform = function(t, e, r) {
|
|
2175
|
+
r(null, t);
|
|
2176
|
+
};
|
|
2177
|
+
se(z, p);
|
|
2178
|
+
z.Readable = E;
|
|
2179
|
+
z.Writable = C;
|
|
2180
|
+
z.Duplex = B;
|
|
2181
|
+
z.Transform = k;
|
|
2182
|
+
z.PassThrough = le;
|
|
2183
|
+
z.Stream = z;
|
|
2184
|
+
function z() {
|
|
2185
|
+
p.call(this);
|
|
2186
|
+
}
|
|
2187
|
+
z.prototype.pipe = function(t, e) {
|
|
2188
|
+
var r = this;
|
|
2189
|
+
function n(h) {
|
|
2190
|
+
t.writable && t.write(h) === !1 && r.pause && r.pause();
|
|
2191
|
+
}
|
|
2192
|
+
r.on("data", n);
|
|
2193
|
+
function i() {
|
|
2194
|
+
r.readable && r.resume && r.resume();
|
|
2195
|
+
}
|
|
2196
|
+
t.on("drain", i), !t._isStdio && (!e || e.end !== !1) && (r.on("end", s), r.on("close", f));
|
|
2197
|
+
var o = !1;
|
|
2198
|
+
function s() {
|
|
2199
|
+
o || (o = !0, t.end());
|
|
2200
|
+
}
|
|
2201
|
+
function f() {
|
|
2202
|
+
o || (o = !0, typeof t.destroy == "function" && t.destroy());
|
|
2203
|
+
}
|
|
2204
|
+
function l(h) {
|
|
2205
|
+
if (u(), p.listenerCount(this, "error") === 0)
|
|
2206
|
+
throw h;
|
|
2207
|
+
}
|
|
2208
|
+
r.on("error", l), t.on("error", l);
|
|
2209
|
+
function u() {
|
|
2210
|
+
r.removeListener("data", n), t.removeListener("drain", i), r.removeListener("end", s), r.removeListener("close", f), r.removeListener("error", l), t.removeListener("error", l), r.removeListener("end", u), r.removeListener("close", u), t.removeListener("close", u);
|
|
2211
|
+
}
|
|
2212
|
+
return r.on("end", u), r.on("close", u), t.on("close", u), t.emit("pipe", r), t;
|
|
2213
|
+
};
|
|
2214
|
+
const qt = function(t) {
|
|
2215
|
+
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2216
|
+
};
|
|
2217
|
+
class m extends Error {
|
|
2218
|
+
constructor(e, r, n, ...i) {
|
|
2219
|
+
Array.isArray(r) && (r = r.join(" ").trim()), super(r), Error.captureStackTrace !== void 0 && Error.captureStackTrace(this, m), this.code = e;
|
|
2220
|
+
for (const o of i)
|
|
2221
|
+
for (const s in o) {
|
|
2222
|
+
const f = o[s];
|
|
2223
|
+
this[s] = T(f) ? f.toString(n.encoding) : f == null ? f : JSON.parse(JSON.stringify(f));
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
const zt = function(t) {
|
|
2228
|
+
const e = [];
|
|
2229
|
+
for (let r = 0, n = t.length; r < n; r++) {
|
|
2230
|
+
const i = t[r];
|
|
2231
|
+
if (i == null || i === !1)
|
|
2232
|
+
e[r] = { disabled: !0 };
|
|
2233
|
+
else if (typeof i == "string")
|
|
2234
|
+
e[r] = { name: i };
|
|
2235
|
+
else if (qt(i)) {
|
|
2236
|
+
if (typeof i.name != "string")
|
|
2237
|
+
throw new m("CSV_OPTION_COLUMNS_MISSING_NAME", [
|
|
2238
|
+
"Option columns missing name:",
|
|
2239
|
+
`property "name" is required at position ${r}`,
|
|
2240
|
+
"when column is an object literal"
|
|
2241
|
+
]);
|
|
2242
|
+
e[r] = i;
|
|
2243
|
+
} else
|
|
2244
|
+
throw new m("CSV_INVALID_COLUMN_DEFINITION", [
|
|
2245
|
+
"Invalid column definition:",
|
|
2246
|
+
"expect a string or a literal object,",
|
|
2247
|
+
`got ${JSON.stringify(i)} at position ${r}`
|
|
2248
|
+
]);
|
|
2249
|
+
}
|
|
2250
|
+
return e;
|
|
2251
|
+
};
|
|
2252
|
+
class ot {
|
|
2253
|
+
constructor(e = 100) {
|
|
2254
|
+
this.size = e, this.length = 0, this.buf = a.allocUnsafe(e);
|
|
2255
|
+
}
|
|
2256
|
+
prepend(e) {
|
|
2257
|
+
if (T(e)) {
|
|
2258
|
+
const r = this.length + e.length;
|
|
2259
|
+
if (r >= this.size && (this.resize(), r >= this.size))
|
|
2260
|
+
throw Error("INVALID_BUFFER_STATE");
|
|
2261
|
+
const n = this.buf;
|
|
2262
|
+
this.buf = a.allocUnsafe(this.size), e.copy(this.buf, 0), n.copy(this.buf, e.length), this.length += e.length;
|
|
2263
|
+
} else {
|
|
2264
|
+
const r = this.length++;
|
|
2265
|
+
r === this.size && this.resize();
|
|
2266
|
+
const n = this.clone();
|
|
2267
|
+
this.buf[0] = e, n.copy(this.buf, 1, 0, r);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
append(e) {
|
|
2271
|
+
const r = this.length++;
|
|
2272
|
+
r === this.size && this.resize(), this.buf[r] = e;
|
|
2273
|
+
}
|
|
2274
|
+
clone() {
|
|
2275
|
+
return a.from(this.buf.slice(0, this.length));
|
|
2276
|
+
}
|
|
2277
|
+
resize() {
|
|
2278
|
+
const e = this.length;
|
|
2279
|
+
this.size = this.size * 2;
|
|
2280
|
+
const r = a.allocUnsafe(this.size);
|
|
2281
|
+
this.buf.copy(r, 0, 0, e), this.buf = r;
|
|
2282
|
+
}
|
|
2283
|
+
toString(e) {
|
|
2284
|
+
return e ? this.buf.slice(0, this.length).toString(e) : Uint8Array.prototype.slice.call(this.buf.slice(0, this.length));
|
|
2285
|
+
}
|
|
2286
|
+
toJSON() {
|
|
2287
|
+
return this.toString("utf8");
|
|
2288
|
+
}
|
|
2289
|
+
reset() {
|
|
2290
|
+
this.length = 0;
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
const ti = 12, ri = 13, ni = 10, ii = 32, oi = 9, si = function(t) {
|
|
2294
|
+
return {
|
|
2295
|
+
bomSkipped: !1,
|
|
2296
|
+
bufBytesStart: 0,
|
|
2297
|
+
castField: t.cast_function,
|
|
2298
|
+
commenting: !1,
|
|
2299
|
+
// Current error encountered by a record
|
|
2300
|
+
error: void 0,
|
|
2301
|
+
enabled: t.from_line === 1,
|
|
2302
|
+
escaping: !1,
|
|
2303
|
+
escapeIsQuote: T(t.escape) && T(t.quote) && a.compare(t.escape, t.quote) === 0,
|
|
2304
|
+
// columns can be `false`, `true`, `Array`
|
|
2305
|
+
expectedRecordLength: Array.isArray(t.columns) ? t.columns.length : void 0,
|
|
2306
|
+
field: new ot(20),
|
|
2307
|
+
firstLineToHeaders: t.cast_first_line_to_header,
|
|
2308
|
+
needMoreDataSize: Math.max(
|
|
2309
|
+
// Skip if the remaining buffer smaller than comment
|
|
2310
|
+
t.comment !== null ? t.comment.length : 0,
|
|
2311
|
+
...t.delimiter.map((e) => e.length),
|
|
2312
|
+
// Skip if the remaining buffer can be escape sequence
|
|
2313
|
+
t.quote !== null ? t.quote.length : 0
|
|
2314
|
+
),
|
|
2315
|
+
previousBuf: void 0,
|
|
2316
|
+
quoting: !1,
|
|
2317
|
+
stop: !1,
|
|
2318
|
+
rawBuffer: new ot(100),
|
|
2319
|
+
record: [],
|
|
2320
|
+
recordHasError: !1,
|
|
2321
|
+
record_length: 0,
|
|
2322
|
+
recordDelimiterMaxLength: t.record_delimiter.length === 0 ? 0 : Math.max(...t.record_delimiter.map((e) => e.length)),
|
|
2323
|
+
trimChars: [a.from(" ", t.encoding)[0], a.from(" ", t.encoding)[0]],
|
|
2324
|
+
wasQuoting: !1,
|
|
2325
|
+
wasRowDelimiter: !1,
|
|
2326
|
+
timchars: [
|
|
2327
|
+
a.from(a.from([ri], "utf8").toString(), t.encoding),
|
|
2328
|
+
a.from(a.from([ni], "utf8").toString(), t.encoding),
|
|
2329
|
+
a.from(a.from([ti], "utf8").toString(), t.encoding),
|
|
2330
|
+
a.from(a.from([ii], "utf8").toString(), t.encoding),
|
|
2331
|
+
a.from(a.from([oi], "utf8").toString(), t.encoding)
|
|
2332
|
+
]
|
|
2333
|
+
};
|
|
2334
|
+
}, fi = function(t) {
|
|
2335
|
+
return t.replace(/([A-Z])/g, function(e, r) {
|
|
2336
|
+
return "_" + r.toLowerCase();
|
|
2337
|
+
});
|
|
2338
|
+
}, st = function(t) {
|
|
2339
|
+
const e = {};
|
|
2340
|
+
for (const n in t)
|
|
2341
|
+
e[fi(n)] = t[n];
|
|
2342
|
+
if (e.encoding === void 0 || e.encoding === !0)
|
|
2343
|
+
e.encoding = "utf8";
|
|
2344
|
+
else if (e.encoding === null || e.encoding === !1)
|
|
2345
|
+
e.encoding = null;
|
|
2346
|
+
else if (typeof e.encoding != "string" && e.encoding !== null)
|
|
2347
|
+
throw new m("CSV_INVALID_OPTION_ENCODING", [
|
|
2348
|
+
"Invalid option encoding:",
|
|
2349
|
+
"encoding must be a string or null to return a buffer,",
|
|
2350
|
+
`got ${JSON.stringify(e.encoding)}`
|
|
2351
|
+
], e);
|
|
2352
|
+
if (e.bom === void 0 || e.bom === null || e.bom === !1)
|
|
2353
|
+
e.bom = !1;
|
|
2354
|
+
else if (e.bom !== !0)
|
|
2355
|
+
throw new m("CSV_INVALID_OPTION_BOM", [
|
|
2356
|
+
"Invalid option bom:",
|
|
2357
|
+
"bom must be true,",
|
|
2358
|
+
`got ${JSON.stringify(e.bom)}`
|
|
2359
|
+
], e);
|
|
2360
|
+
if (e.cast_function = null, e.cast === void 0 || e.cast === null || e.cast === !1 || e.cast === "")
|
|
2361
|
+
e.cast = void 0;
|
|
2362
|
+
else if (typeof e.cast == "function")
|
|
2363
|
+
e.cast_function = e.cast, e.cast = !0;
|
|
2364
|
+
else if (e.cast !== !0)
|
|
2365
|
+
throw new m("CSV_INVALID_OPTION_CAST", [
|
|
2366
|
+
"Invalid option cast:",
|
|
2367
|
+
"cast must be true or a function,",
|
|
2368
|
+
`got ${JSON.stringify(e.cast)}`
|
|
2369
|
+
], e);
|
|
2370
|
+
if (e.cast_date === void 0 || e.cast_date === null || e.cast_date === !1 || e.cast_date === "")
|
|
2371
|
+
e.cast_date = !1;
|
|
2372
|
+
else if (e.cast_date === !0)
|
|
2373
|
+
e.cast_date = function(n) {
|
|
2374
|
+
const i = Date.parse(n);
|
|
2375
|
+
return isNaN(i) ? n : new Date(i);
|
|
2376
|
+
};
|
|
2377
|
+
else if (typeof e.cast_date != "function")
|
|
2378
|
+
throw new m("CSV_INVALID_OPTION_CAST_DATE", [
|
|
2379
|
+
"Invalid option cast_date:",
|
|
2380
|
+
"cast_date must be true or a function,",
|
|
2381
|
+
`got ${JSON.stringify(e.cast_date)}`
|
|
2382
|
+
], e);
|
|
2383
|
+
if (e.cast_first_line_to_header = null, e.columns === !0)
|
|
2384
|
+
e.cast_first_line_to_header = void 0;
|
|
2385
|
+
else if (typeof e.columns == "function")
|
|
2386
|
+
e.cast_first_line_to_header = e.columns, e.columns = !0;
|
|
2387
|
+
else if (Array.isArray(e.columns))
|
|
2388
|
+
e.columns = zt(e.columns);
|
|
2389
|
+
else if (e.columns === void 0 || e.columns === null || e.columns === !1)
|
|
2390
|
+
e.columns = !1;
|
|
2391
|
+
else
|
|
2392
|
+
throw new m("CSV_INVALID_OPTION_COLUMNS", [
|
|
2393
|
+
"Invalid option columns:",
|
|
2394
|
+
"expect an array, a function or true,",
|
|
2395
|
+
`got ${JSON.stringify(e.columns)}`
|
|
2396
|
+
], e);
|
|
2397
|
+
if (e.group_columns_by_name === void 0 || e.group_columns_by_name === null || e.group_columns_by_name === !1)
|
|
2398
|
+
e.group_columns_by_name = !1;
|
|
2399
|
+
else {
|
|
2400
|
+
if (e.group_columns_by_name !== !0)
|
|
2401
|
+
throw new m("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [
|
|
2402
|
+
"Invalid option group_columns_by_name:",
|
|
2403
|
+
"expect an boolean,",
|
|
2404
|
+
`got ${JSON.stringify(e.group_columns_by_name)}`
|
|
2405
|
+
], e);
|
|
2406
|
+
if (e.columns === !1)
|
|
2407
|
+
throw new m("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [
|
|
2408
|
+
"Invalid option group_columns_by_name:",
|
|
2409
|
+
"the `columns` mode must be activated."
|
|
2410
|
+
], e);
|
|
2411
|
+
}
|
|
2412
|
+
if (e.comment === void 0 || e.comment === null || e.comment === !1 || e.comment === "")
|
|
2413
|
+
e.comment = null;
|
|
2414
|
+
else if (typeof e.comment == "string" && (e.comment = a.from(e.comment, e.encoding)), !T(e.comment))
|
|
2415
|
+
throw new m("CSV_INVALID_OPTION_COMMENT", [
|
|
2416
|
+
"Invalid option comment:",
|
|
2417
|
+
"comment must be a buffer or a string,",
|
|
2418
|
+
`got ${JSON.stringify(e.comment)}`
|
|
2419
|
+
], e);
|
|
2420
|
+
if (e.comment_no_infix === void 0 || e.comment_no_infix === null || e.comment_no_infix === !1)
|
|
2421
|
+
e.comment_no_infix = !1;
|
|
2422
|
+
else if (e.comment_no_infix !== !0)
|
|
2423
|
+
throw new m("CSV_INVALID_OPTION_COMMENT", [
|
|
2424
|
+
"Invalid option comment_no_infix:",
|
|
2425
|
+
"value must be a boolean,",
|
|
2426
|
+
`got ${JSON.stringify(e.comment_no_infix)}`
|
|
2427
|
+
], e);
|
|
2428
|
+
const r = JSON.stringify(e.delimiter);
|
|
2429
|
+
if (Array.isArray(e.delimiter) || (e.delimiter = [e.delimiter]), e.delimiter.length === 0)
|
|
2430
|
+
throw new m("CSV_INVALID_OPTION_DELIMITER", [
|
|
2431
|
+
"Invalid option delimiter:",
|
|
2432
|
+
"delimiter must be a non empty string or buffer or array of string|buffer,",
|
|
2433
|
+
`got ${r}`
|
|
2434
|
+
], e);
|
|
2435
|
+
if (e.delimiter = e.delimiter.map(function(n) {
|
|
2436
|
+
if (n == null || n === !1)
|
|
2437
|
+
return a.from(",", e.encoding);
|
|
2438
|
+
if (typeof n == "string" && (n = a.from(n, e.encoding)), !T(n) || n.length === 0)
|
|
2439
|
+
throw new m("CSV_INVALID_OPTION_DELIMITER", [
|
|
2440
|
+
"Invalid option delimiter:",
|
|
2441
|
+
"delimiter must be a non empty string or buffer or array of string|buffer,",
|
|
2442
|
+
`got ${r}`
|
|
2443
|
+
], e);
|
|
2444
|
+
return n;
|
|
2445
|
+
}), e.escape === void 0 || e.escape === !0 ? e.escape = a.from('"', e.encoding) : typeof e.escape == "string" ? e.escape = a.from(e.escape, e.encoding) : (e.escape === null || e.escape === !1) && (e.escape = null), e.escape !== null && !T(e.escape))
|
|
2446
|
+
throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);
|
|
2447
|
+
if (e.from === void 0 || e.from === null)
|
|
2448
|
+
e.from = 1;
|
|
2449
|
+
else if (typeof e.from == "string" && /\d+/.test(e.from) && (e.from = parseInt(e.from)), Number.isInteger(e.from)) {
|
|
2450
|
+
if (e.from < 0)
|
|
2451
|
+
throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(t.from)}`);
|
|
2452
|
+
} else
|
|
2453
|
+
throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);
|
|
2454
|
+
if (e.from_line === void 0 || e.from_line === null)
|
|
2455
|
+
e.from_line = 1;
|
|
2456
|
+
else if (typeof e.from_line == "string" && /\d+/.test(e.from_line) && (e.from_line = parseInt(e.from_line)), Number.isInteger(e.from_line)) {
|
|
2457
|
+
if (e.from_line <= 0)
|
|
2458
|
+
throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(t.from_line)}`);
|
|
2459
|
+
} else
|
|
2460
|
+
throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(t.from_line)}`);
|
|
2461
|
+
if (e.ignore_last_delimiters === void 0 || e.ignore_last_delimiters === null)
|
|
2462
|
+
e.ignore_last_delimiters = !1;
|
|
2463
|
+
else if (typeof e.ignore_last_delimiters == "number")
|
|
2464
|
+
e.ignore_last_delimiters = Math.floor(e.ignore_last_delimiters), e.ignore_last_delimiters === 0 && (e.ignore_last_delimiters = !1);
|
|
2465
|
+
else if (typeof e.ignore_last_delimiters != "boolean")
|
|
2466
|
+
throw new m("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS", [
|
|
2467
|
+
"Invalid option `ignore_last_delimiters`:",
|
|
2468
|
+
"the value must be a boolean value or an integer,",
|
|
2469
|
+
`got ${JSON.stringify(e.ignore_last_delimiters)}`
|
|
2470
|
+
], e);
|
|
2471
|
+
if (e.ignore_last_delimiters === !0 && e.columns === !1)
|
|
2472
|
+
throw new m("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS", [
|
|
2473
|
+
"The option `ignore_last_delimiters`",
|
|
2474
|
+
"requires the activation of the `columns` option"
|
|
2475
|
+
], e);
|
|
2476
|
+
if (e.info === void 0 || e.info === null || e.info === !1)
|
|
2477
|
+
e.info = !1;
|
|
2478
|
+
else if (e.info !== !0)
|
|
2479
|
+
throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);
|
|
2480
|
+
if (e.max_record_size === void 0 || e.max_record_size === null || e.max_record_size === !1)
|
|
2481
|
+
e.max_record_size = 0;
|
|
2482
|
+
else if (!(Number.isInteger(e.max_record_size) && e.max_record_size >= 0))
|
|
2483
|
+
if (typeof e.max_record_size == "string" && /\d+/.test(e.max_record_size))
|
|
2484
|
+
e.max_record_size = parseInt(e.max_record_size);
|
|
2485
|
+
else
|
|
2486
|
+
throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);
|
|
2487
|
+
if (e.objname === void 0 || e.objname === null || e.objname === !1)
|
|
2488
|
+
e.objname = void 0;
|
|
2489
|
+
else if (T(e.objname)) {
|
|
2490
|
+
if (e.objname.length === 0)
|
|
2491
|
+
throw new Error("Invalid Option: objname must be a non empty buffer");
|
|
2492
|
+
e.encoding === null || (e.objname = e.objname.toString(e.encoding));
|
|
2493
|
+
} else if (typeof e.objname == "string") {
|
|
2494
|
+
if (e.objname.length === 0)
|
|
2495
|
+
throw new Error("Invalid Option: objname must be a non empty string");
|
|
2496
|
+
} else if (typeof e.objname != "number")
|
|
2497
|
+
throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);
|
|
2498
|
+
if (e.objname !== void 0) {
|
|
2499
|
+
if (typeof e.objname == "number") {
|
|
2500
|
+
if (e.columns !== !1)
|
|
2501
|
+
throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field");
|
|
2502
|
+
} else if (e.columns === !1)
|
|
2503
|
+
throw Error("Invalid Option: objname field must be combined with columns or be defined as an index");
|
|
2504
|
+
}
|
|
2505
|
+
if (e.on_record === void 0 || e.on_record === null)
|
|
2506
|
+
e.on_record = void 0;
|
|
2507
|
+
else if (typeof e.on_record != "function")
|
|
2508
|
+
throw new m("CSV_INVALID_OPTION_ON_RECORD", [
|
|
2509
|
+
"Invalid option `on_record`:",
|
|
2510
|
+
"expect a function,",
|
|
2511
|
+
`got ${JSON.stringify(e.on_record)}`
|
|
2512
|
+
], e);
|
|
2513
|
+
if (e.quote === null || e.quote === !1 || e.quote === "")
|
|
2514
|
+
e.quote = null;
|
|
2515
|
+
else if (e.quote === void 0 || e.quote === !0 ? e.quote = a.from('"', e.encoding) : typeof e.quote == "string" && (e.quote = a.from(e.quote, e.encoding)), !T(e.quote))
|
|
2516
|
+
throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);
|
|
2517
|
+
if (e.raw === void 0 || e.raw === null || e.raw === !1)
|
|
2518
|
+
e.raw = !1;
|
|
2519
|
+
else if (e.raw !== !0)
|
|
2520
|
+
throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);
|
|
2521
|
+
if (e.record_delimiter === void 0)
|
|
2522
|
+
e.record_delimiter = [];
|
|
2523
|
+
else if (typeof e.record_delimiter == "string" || T(e.record_delimiter)) {
|
|
2524
|
+
if (e.record_delimiter.length === 0)
|
|
2525
|
+
throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
|
2526
|
+
"Invalid option `record_delimiter`:",
|
|
2527
|
+
"value must be a non empty string or buffer,",
|
|
2528
|
+
`got ${JSON.stringify(e.record_delimiter)}`
|
|
2529
|
+
], e);
|
|
2530
|
+
e.record_delimiter = [e.record_delimiter];
|
|
2531
|
+
} else if (!Array.isArray(e.record_delimiter))
|
|
2532
|
+
throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
|
2533
|
+
"Invalid option `record_delimiter`:",
|
|
2534
|
+
"value must be a string, a buffer or array of string|buffer,",
|
|
2535
|
+
`got ${JSON.stringify(e.record_delimiter)}`
|
|
2536
|
+
], e);
|
|
2537
|
+
if (e.record_delimiter = e.record_delimiter.map(function(n, i) {
|
|
2538
|
+
if (typeof n != "string" && !T(n))
|
|
2539
|
+
throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
|
2540
|
+
"Invalid option `record_delimiter`:",
|
|
2541
|
+
"value must be a string, a buffer or array of string|buffer",
|
|
2542
|
+
`at index ${i},`,
|
|
2543
|
+
`got ${JSON.stringify(n)}`
|
|
2544
|
+
], e);
|
|
2545
|
+
if (n.length === 0)
|
|
2546
|
+
throw new m("CSV_INVALID_OPTION_RECORD_DELIMITER", [
|
|
2547
|
+
"Invalid option `record_delimiter`:",
|
|
2548
|
+
"value must be a non empty string or buffer",
|
|
2549
|
+
`at index ${i},`,
|
|
2550
|
+
`got ${JSON.stringify(n)}`
|
|
2551
|
+
], e);
|
|
2552
|
+
return typeof n == "string" && (n = a.from(n, e.encoding)), n;
|
|
2553
|
+
}), typeof e.relax_column_count != "boolean")
|
|
2554
|
+
if (e.relax_column_count === void 0 || e.relax_column_count === null)
|
|
2555
|
+
e.relax_column_count = !1;
|
|
2556
|
+
else
|
|
2557
|
+
throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);
|
|
2558
|
+
if (typeof e.relax_column_count_less != "boolean")
|
|
2559
|
+
if (e.relax_column_count_less === void 0 || e.relax_column_count_less === null)
|
|
2560
|
+
e.relax_column_count_less = !1;
|
|
2561
|
+
else
|
|
2562
|
+
throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);
|
|
2563
|
+
if (typeof e.relax_column_count_more != "boolean")
|
|
2564
|
+
if (e.relax_column_count_more === void 0 || e.relax_column_count_more === null)
|
|
2565
|
+
e.relax_column_count_more = !1;
|
|
2566
|
+
else
|
|
2567
|
+
throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);
|
|
2568
|
+
if (typeof e.relax_quotes != "boolean")
|
|
2569
|
+
if (e.relax_quotes === void 0 || e.relax_quotes === null)
|
|
2570
|
+
e.relax_quotes = !1;
|
|
2571
|
+
else
|
|
2572
|
+
throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);
|
|
2573
|
+
if (typeof e.skip_empty_lines != "boolean")
|
|
2574
|
+
if (e.skip_empty_lines === void 0 || e.skip_empty_lines === null)
|
|
2575
|
+
e.skip_empty_lines = !1;
|
|
2576
|
+
else
|
|
2577
|
+
throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);
|
|
2578
|
+
if (typeof e.skip_records_with_empty_values != "boolean")
|
|
2579
|
+
if (e.skip_records_with_empty_values === void 0 || e.skip_records_with_empty_values === null)
|
|
2580
|
+
e.skip_records_with_empty_values = !1;
|
|
2581
|
+
else
|
|
2582
|
+
throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);
|
|
2583
|
+
if (typeof e.skip_records_with_error != "boolean")
|
|
2584
|
+
if (e.skip_records_with_error === void 0 || e.skip_records_with_error === null)
|
|
2585
|
+
e.skip_records_with_error = !1;
|
|
2586
|
+
else
|
|
2587
|
+
throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);
|
|
2588
|
+
if (e.rtrim === void 0 || e.rtrim === null || e.rtrim === !1)
|
|
2589
|
+
e.rtrim = !1;
|
|
2590
|
+
else if (e.rtrim !== !0)
|
|
2591
|
+
throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);
|
|
2592
|
+
if (e.ltrim === void 0 || e.ltrim === null || e.ltrim === !1)
|
|
2593
|
+
e.ltrim = !1;
|
|
2594
|
+
else if (e.ltrim !== !0)
|
|
2595
|
+
throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);
|
|
2596
|
+
if (e.trim === void 0 || e.trim === null || e.trim === !1)
|
|
2597
|
+
e.trim = !1;
|
|
2598
|
+
else if (e.trim !== !0)
|
|
2599
|
+
throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);
|
|
2600
|
+
if (e.trim === !0 && t.ltrim !== !1 ? e.ltrim = !0 : e.ltrim !== !0 && (e.ltrim = !1), e.trim === !0 && t.rtrim !== !1 ? e.rtrim = !0 : e.rtrim !== !0 && (e.rtrim = !1), e.to === void 0 || e.to === null)
|
|
2601
|
+
e.to = -1;
|
|
2602
|
+
else if (typeof e.to == "string" && /\d+/.test(e.to) && (e.to = parseInt(e.to)), Number.isInteger(e.to)) {
|
|
2603
|
+
if (e.to <= 0)
|
|
2604
|
+
throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(t.to)}`);
|
|
2605
|
+
} else
|
|
2606
|
+
throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(t.to)}`);
|
|
2607
|
+
if (e.to_line === void 0 || e.to_line === null)
|
|
2608
|
+
e.to_line = -1;
|
|
2609
|
+
else if (typeof e.to_line == "string" && /\d+/.test(e.to_line) && (e.to_line = parseInt(e.to_line)), Number.isInteger(e.to_line)) {
|
|
2610
|
+
if (e.to_line <= 0)
|
|
2611
|
+
throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(t.to_line)}`);
|
|
2612
|
+
} else
|
|
2613
|
+
throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(t.to_line)}`);
|
|
2614
|
+
return e;
|
|
2615
|
+
}, ft = function(t) {
|
|
2616
|
+
return t.every((e) => e == null || e.toString && e.toString().trim() === "");
|
|
2617
|
+
}, ai = 13, li = 10, re = {
|
|
2618
|
+
// Note, the following are equals:
|
|
2619
|
+
// Buffer.from("\ufeff")
|
|
2620
|
+
// Buffer.from([239, 187, 191])
|
|
2621
|
+
// Buffer.from('EFBBBF', 'hex')
|
|
2622
|
+
utf8: a.from([239, 187, 191]),
|
|
2623
|
+
// Note, the following are equals:
|
|
2624
|
+
// Buffer.from "\ufeff", 'utf16le
|
|
2625
|
+
// Buffer.from([255, 254])
|
|
2626
|
+
utf16le: a.from([255, 254])
|
|
2627
|
+
}, ui = function(t = {}) {
|
|
2628
|
+
const e = {
|
|
2629
|
+
bytes: 0,
|
|
2630
|
+
comment_lines: 0,
|
|
2631
|
+
empty_lines: 0,
|
|
2632
|
+
invalid_field_length: 0,
|
|
2633
|
+
lines: 1,
|
|
2634
|
+
records: 0
|
|
2635
|
+
}, r = st(t);
|
|
2636
|
+
return {
|
|
2637
|
+
info: e,
|
|
2638
|
+
original_options: t,
|
|
2639
|
+
options: r,
|
|
2640
|
+
state: si(r),
|
|
2641
|
+
__needMoreData: function(n, i, o) {
|
|
2642
|
+
if (o)
|
|
2643
|
+
return !1;
|
|
2644
|
+
const { encoding: s, escape: f, quote: l } = this.options, { quoting: u, needMoreDataSize: h, recordDelimiterMaxLength: c } = this.state, g = i - n - 1, v = Math.max(
|
|
2645
|
+
h,
|
|
2646
|
+
// Skip if the remaining buffer smaller than record delimiter
|
|
2647
|
+
// If "record_delimiter" is yet to be discovered:
|
|
2648
|
+
// 1. It is equals to `[]` and "recordDelimiterMaxLength" equals `0`
|
|
2649
|
+
// 2. We set the length to windows line ending in the current encoding
|
|
2650
|
+
// Note, that encoding is known from user or bom discovery at that point
|
|
2651
|
+
// recordDelimiterMaxLength,
|
|
2652
|
+
c === 0 ? a.from(`\r
|
|
2653
|
+
`, s).length : c,
|
|
2654
|
+
// Skip if remaining buffer can be an escaped quote
|
|
2655
|
+
u ? (f === null ? 0 : f.length) + l.length : 0,
|
|
2656
|
+
// Skip if remaining buffer can be record delimiter following the closing quote
|
|
2657
|
+
u ? l.length + c : 0
|
|
2658
|
+
);
|
|
2659
|
+
return g < v;
|
|
2660
|
+
},
|
|
2661
|
+
// Central parser implementation
|
|
2662
|
+
parse: function(n, i, o, s) {
|
|
2663
|
+
const { bom: f, comment_no_infix: l, encoding: u, from_line: h, ltrim: c, max_record_size: g, raw: v, relax_quotes: A, rtrim: x, skip_empty_lines: F, to: S, to_line: b } = this.options;
|
|
2664
|
+
let { comment: _, escape: L, quote: U, record_delimiter: Ie } = this.options;
|
|
2665
|
+
const { bomSkipped: Vt, previousBuf: de, rawBuffer: Jt, escapeIsQuote: Yt } = this.state;
|
|
2666
|
+
let w;
|
|
2667
|
+
if (de === void 0)
|
|
2668
|
+
if (n === void 0) {
|
|
2669
|
+
s();
|
|
2670
|
+
return;
|
|
2671
|
+
} else
|
|
2672
|
+
w = n;
|
|
2673
|
+
else
|
|
2674
|
+
de !== void 0 && n === void 0 ? w = de : w = a.concat([de, n]);
|
|
2675
|
+
if (Vt === !1)
|
|
2676
|
+
if (f === !1)
|
|
2677
|
+
this.state.bomSkipped = !0;
|
|
2678
|
+
else if (w.length < 3) {
|
|
2679
|
+
if (i === !1) {
|
|
2680
|
+
this.state.previousBuf = w;
|
|
2681
|
+
return;
|
|
2682
|
+
}
|
|
2683
|
+
} else {
|
|
2684
|
+
for (const R in re)
|
|
2685
|
+
if (re[R].compare(w, 0, re[R].length) === 0) {
|
|
2686
|
+
const V = re[R].length;
|
|
2687
|
+
this.state.bufBytesStart += V, w = w.slice(V), this.options = st({ ...this.original_options, encoding: R }), { comment: _, escape: L, quote: U } = this.options;
|
|
2688
|
+
break;
|
|
2689
|
+
}
|
|
2690
|
+
this.state.bomSkipped = !0;
|
|
2691
|
+
}
|
|
2692
|
+
const Oe = w.length;
|
|
2693
|
+
let d;
|
|
2694
|
+
for (d = 0; d < Oe && !this.__needMoreData(d, Oe, i); d++) {
|
|
2695
|
+
if (this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1), b !== -1 && this.info.lines > b) {
|
|
2696
|
+
this.state.stop = !0, s();
|
|
2697
|
+
return;
|
|
2698
|
+
}
|
|
2699
|
+
this.state.quoting === !1 && Ie.length === 0 && this.__autoDiscoverRecordDelimiter(w, d) && (Ie = this.options.record_delimiter);
|
|
2700
|
+
const R = w[d];
|
|
2701
|
+
if (v === !0 && Jt.append(R), (R === ai || R === li) && this.state.wasRowDelimiter === !1 && (this.state.wasRowDelimiter = !0), this.state.escaping === !0)
|
|
2702
|
+
this.state.escaping = !1;
|
|
2703
|
+
else {
|
|
2704
|
+
if (L !== null && this.state.quoting === !0 && this.__isEscape(w, d, R) && d + L.length < Oe)
|
|
2705
|
+
if (Yt) {
|
|
2706
|
+
if (this.__isQuote(w, d + L.length)) {
|
|
2707
|
+
this.state.escaping = !0, d += L.length - 1;
|
|
2708
|
+
continue;
|
|
2709
|
+
}
|
|
2710
|
+
} else {
|
|
2711
|
+
this.state.escaping = !0, d += L.length - 1;
|
|
2712
|
+
continue;
|
|
2713
|
+
}
|
|
2714
|
+
if (this.state.commenting === !1 && this.__isQuote(w, d))
|
|
2715
|
+
if (this.state.quoting === !0) {
|
|
2716
|
+
const O = w[d + U.length], fe = x && this.__isCharTrimable(w, d + U.length), Z = _ !== null && this.__compareBytes(_, w, d + U.length, O), J = this.__isDelimiter(w, d + U.length, O), pe = Ie.length === 0 ? this.__autoDiscoverRecordDelimiter(w, d + U.length) : this.__isRecordDelimiter(O, w, d + U.length);
|
|
2717
|
+
if (L !== null && this.__isEscape(w, d, R) && this.__isQuote(w, d + L.length))
|
|
2718
|
+
d += L.length - 1;
|
|
2719
|
+
else if (!O || J || pe || Z || fe) {
|
|
2720
|
+
this.state.quoting = !1, this.state.wasQuoting = !0, d += U.length - 1;
|
|
2721
|
+
continue;
|
|
2722
|
+
} else if (A === !1) {
|
|
2723
|
+
const ae = this.__error(
|
|
2724
|
+
new m("CSV_INVALID_CLOSING_QUOTE", [
|
|
2725
|
+
"Invalid Closing Quote:",
|
|
2726
|
+
`got "${String.fromCharCode(O)}"`,
|
|
2727
|
+
`at line ${this.info.lines}`,
|
|
2728
|
+
"instead of delimiter, record delimiter, trimable character",
|
|
2729
|
+
"(if activated) or comment"
|
|
2730
|
+
], this.options, this.__infoField())
|
|
2731
|
+
);
|
|
2732
|
+
if (ae !== void 0)
|
|
2733
|
+
return ae;
|
|
2734
|
+
} else
|
|
2735
|
+
this.state.quoting = !1, this.state.wasQuoting = !0, this.state.field.prepend(U), d += U.length - 1;
|
|
2736
|
+
} else if (this.state.field.length !== 0) {
|
|
2737
|
+
if (A === !1) {
|
|
2738
|
+
const O = this.__infoField(), fe = Object.keys(re).map((J) => re[J].equals(this.state.field.toString()) ? J : !1).filter(Boolean)[0], Z = this.__error(
|
|
2739
|
+
new m("INVALID_OPENING_QUOTE", [
|
|
2740
|
+
"Invalid Opening Quote:",
|
|
2741
|
+
`a quote is found on field ${JSON.stringify(O.column)} at line ${O.lines}, value is ${JSON.stringify(this.state.field.toString(u))}`,
|
|
2742
|
+
fe ? `(${fe} bom)` : void 0
|
|
2743
|
+
], this.options, O, {
|
|
2744
|
+
field: this.state.field
|
|
2745
|
+
})
|
|
2746
|
+
);
|
|
2747
|
+
if (Z !== void 0)
|
|
2748
|
+
return Z;
|
|
2749
|
+
}
|
|
2750
|
+
} else {
|
|
2751
|
+
this.state.quoting = !0, d += U.length - 1;
|
|
2752
|
+
continue;
|
|
2753
|
+
}
|
|
2754
|
+
if (this.state.quoting === !1) {
|
|
2755
|
+
const O = this.__isRecordDelimiter(R, w, d);
|
|
2756
|
+
if (O !== 0) {
|
|
2757
|
+
if (this.state.commenting && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0)
|
|
2758
|
+
this.info.comment_lines++;
|
|
2759
|
+
else {
|
|
2760
|
+
if (this.state.enabled === !1 && this.info.lines + (this.state.wasRowDelimiter === !0 ? 1 : 0) >= h) {
|
|
2761
|
+
this.state.enabled = !0, this.__resetField(), this.__resetRecord(), d += O - 1;
|
|
2762
|
+
continue;
|
|
2763
|
+
}
|
|
2764
|
+
if (F === !0 && this.state.wasQuoting === !1 && this.state.record.length === 0 && this.state.field.length === 0) {
|
|
2765
|
+
this.info.empty_lines++, d += O - 1;
|
|
2766
|
+
continue;
|
|
2767
|
+
}
|
|
2768
|
+
this.info.bytes = this.state.bufBytesStart + d;
|
|
2769
|
+
const pe = this.__onField();
|
|
2770
|
+
if (pe !== void 0)
|
|
2771
|
+
return pe;
|
|
2772
|
+
this.info.bytes = this.state.bufBytesStart + d + O;
|
|
2773
|
+
const ae = this.__onRecord(o);
|
|
2774
|
+
if (ae !== void 0)
|
|
2775
|
+
return ae;
|
|
2776
|
+
if (S !== -1 && this.info.records >= S) {
|
|
2777
|
+
this.state.stop = !0, s();
|
|
2778
|
+
return;
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
this.state.commenting = !1, d += O - 1;
|
|
2782
|
+
continue;
|
|
2783
|
+
}
|
|
2784
|
+
if (this.state.commenting)
|
|
2785
|
+
continue;
|
|
2786
|
+
if ((_ === null ? 0 : this.__compareBytes(_, w, d, R)) !== 0 && (l === !1 || this.state.field.length === 0)) {
|
|
2787
|
+
this.state.commenting = !0;
|
|
2788
|
+
continue;
|
|
2789
|
+
}
|
|
2790
|
+
const Z = this.__isDelimiter(w, d, R);
|
|
2791
|
+
if (Z !== 0) {
|
|
2792
|
+
this.info.bytes = this.state.bufBytesStart + d;
|
|
2793
|
+
const J = this.__onField();
|
|
2794
|
+
if (J !== void 0)
|
|
2795
|
+
return J;
|
|
2796
|
+
d += Z - 1;
|
|
2797
|
+
continue;
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
if (this.state.commenting === !1 && g !== 0 && this.state.record_length + this.state.field.length > g)
|
|
2802
|
+
return this.__error(
|
|
2803
|
+
new m("CSV_MAX_RECORD_SIZE", [
|
|
2804
|
+
"Max Record Size:",
|
|
2805
|
+
"record exceed the maximum number of tolerated bytes",
|
|
2806
|
+
`of ${g}`,
|
|
2807
|
+
`at line ${this.info.lines}`
|
|
2808
|
+
], this.options, this.__infoField())
|
|
2809
|
+
);
|
|
2810
|
+
const V = c === !1 || this.state.quoting === !0 || this.state.field.length !== 0 || !this.__isCharTrimable(w, d), Wt = x === !1 || this.state.wasQuoting === !1;
|
|
2811
|
+
if (V === !0 && Wt === !0)
|
|
2812
|
+
this.state.field.append(R);
|
|
2813
|
+
else {
|
|
2814
|
+
if (x === !0 && !this.__isCharTrimable(w, d))
|
|
2815
|
+
return this.__error(
|
|
2816
|
+
new m("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE", [
|
|
2817
|
+
"Invalid Closing Quote:",
|
|
2818
|
+
"found non trimable byte after quote",
|
|
2819
|
+
`at line ${this.info.lines}`
|
|
2820
|
+
], this.options, this.__infoField())
|
|
2821
|
+
);
|
|
2822
|
+
V === !1 && (d += this.__isCharTrimable(w, d) - 1);
|
|
2823
|
+
continue;
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
if (i === !0)
|
|
2827
|
+
if (this.state.quoting === !0) {
|
|
2828
|
+
const R = this.__error(
|
|
2829
|
+
new m("CSV_QUOTE_NOT_CLOSED", [
|
|
2830
|
+
"Quote Not Closed:",
|
|
2831
|
+
`the parsing is finished with an opening quote at line ${this.info.lines}`
|
|
2832
|
+
], this.options, this.__infoField())
|
|
2833
|
+
);
|
|
2834
|
+
if (R !== void 0)
|
|
2835
|
+
return R;
|
|
2836
|
+
} else if (this.state.wasQuoting === !0 || this.state.record.length !== 0 || this.state.field.length !== 0) {
|
|
2837
|
+
this.info.bytes = this.state.bufBytesStart + d;
|
|
2838
|
+
const R = this.__onField();
|
|
2839
|
+
if (R !== void 0)
|
|
2840
|
+
return R;
|
|
2841
|
+
const V = this.__onRecord(o);
|
|
2842
|
+
if (V !== void 0)
|
|
2843
|
+
return V;
|
|
2844
|
+
} else
|
|
2845
|
+
this.state.wasRowDelimiter === !0 ? this.info.empty_lines++ : this.state.commenting === !0 && this.info.comment_lines++;
|
|
2846
|
+
else
|
|
2847
|
+
this.state.bufBytesStart += d, this.state.previousBuf = w.slice(d);
|
|
2848
|
+
this.state.wasRowDelimiter === !0 && (this.info.lines++, this.state.wasRowDelimiter = !1);
|
|
2849
|
+
},
|
|
2850
|
+
__onRecord: function(n) {
|
|
2851
|
+
const { columns: i, group_columns_by_name: o, encoding: s, info: f, from: l, relax_column_count: u, relax_column_count_less: h, relax_column_count_more: c, raw: g, skip_records_with_empty_values: v } = this.options, { enabled: A, record: x } = this.state;
|
|
2852
|
+
if (A === !1)
|
|
2853
|
+
return this.__resetRecord();
|
|
2854
|
+
const F = x.length;
|
|
2855
|
+
if (i === !0) {
|
|
2856
|
+
if (v === !0 && ft(x)) {
|
|
2857
|
+
this.__resetRecord();
|
|
2858
|
+
return;
|
|
2859
|
+
}
|
|
2860
|
+
return this.__firstLineToColumns(x);
|
|
2861
|
+
}
|
|
2862
|
+
if (i === !1 && this.info.records === 0 && (this.state.expectedRecordLength = F), F !== this.state.expectedRecordLength) {
|
|
2863
|
+
const S = i === !1 ? new m("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH", [
|
|
2864
|
+
"Invalid Record Length:",
|
|
2865
|
+
`expect ${this.state.expectedRecordLength},`,
|
|
2866
|
+
`got ${F} on line ${this.info.lines}`
|
|
2867
|
+
], this.options, this.__infoField(), {
|
|
2868
|
+
record: x
|
|
2869
|
+
}) : new m("CSV_RECORD_INCONSISTENT_COLUMNS", [
|
|
2870
|
+
"Invalid Record Length:",
|
|
2871
|
+
`columns length is ${i.length},`,
|
|
2872
|
+
// rename columns
|
|
2873
|
+
`got ${F} on line ${this.info.lines}`
|
|
2874
|
+
], this.options, this.__infoField(), {
|
|
2875
|
+
record: x
|
|
2876
|
+
});
|
|
2877
|
+
if (u === !0 || h === !0 && F < this.state.expectedRecordLength || c === !0 && F > this.state.expectedRecordLength)
|
|
2878
|
+
this.info.invalid_field_length++, this.state.error = S;
|
|
2879
|
+
else {
|
|
2880
|
+
const b = this.__error(S);
|
|
2881
|
+
if (b)
|
|
2882
|
+
return b;
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
if (v === !0 && ft(x)) {
|
|
2886
|
+
this.__resetRecord();
|
|
2887
|
+
return;
|
|
2888
|
+
}
|
|
2889
|
+
if (this.state.recordHasError === !0) {
|
|
2890
|
+
this.__resetRecord(), this.state.recordHasError = !1;
|
|
2891
|
+
return;
|
|
2892
|
+
}
|
|
2893
|
+
if (this.info.records++, l === 1 || this.info.records >= l) {
|
|
2894
|
+
const { objname: S } = this.options;
|
|
2895
|
+
if (i !== !1) {
|
|
2896
|
+
const b = {};
|
|
2897
|
+
for (let _ = 0, L = x.length; _ < L; _++)
|
|
2898
|
+
i[_] === void 0 || i[_].disabled || (o === !0 && b[i[_].name] !== void 0 ? Array.isArray(b[i[_].name]) ? b[i[_].name] = b[i[_].name].concat(x[_]) : b[i[_].name] = [b[i[_].name], x[_]] : b[i[_].name] = x[_]);
|
|
2899
|
+
if (g === !0 || f === !0) {
|
|
2900
|
+
const _ = Object.assign(
|
|
2901
|
+
{ record: b },
|
|
2902
|
+
g === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2903
|
+
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2904
|
+
), L = this.__push(
|
|
2905
|
+
S === void 0 ? _ : [b[S], _],
|
|
2906
|
+
n
|
|
2907
|
+
);
|
|
2908
|
+
if (L)
|
|
2909
|
+
return L;
|
|
2910
|
+
} else {
|
|
2911
|
+
const _ = this.__push(
|
|
2912
|
+
S === void 0 ? b : [b[S], b],
|
|
2913
|
+
n
|
|
2914
|
+
);
|
|
2915
|
+
if (_)
|
|
2916
|
+
return _;
|
|
2917
|
+
}
|
|
2918
|
+
} else if (g === !0 || f === !0) {
|
|
2919
|
+
const b = Object.assign(
|
|
2920
|
+
{ record: x },
|
|
2921
|
+
g === !0 ? { raw: this.state.rawBuffer.toString(s) } : {},
|
|
2922
|
+
f === !0 ? { info: this.__infoRecord() } : {}
|
|
2923
|
+
), _ = this.__push(
|
|
2924
|
+
S === void 0 ? b : [x[S], b],
|
|
2925
|
+
n
|
|
2926
|
+
);
|
|
2927
|
+
if (_)
|
|
2928
|
+
return _;
|
|
2929
|
+
} else {
|
|
2930
|
+
const b = this.__push(
|
|
2931
|
+
S === void 0 ? x : [x[S], x],
|
|
2932
|
+
n
|
|
2933
|
+
);
|
|
2934
|
+
if (b)
|
|
2935
|
+
return b;
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
this.__resetRecord();
|
|
2939
|
+
},
|
|
2940
|
+
__firstLineToColumns: function(n) {
|
|
2941
|
+
const { firstLineToHeaders: i } = this.state;
|
|
2942
|
+
try {
|
|
2943
|
+
const o = i === void 0 ? n : i.call(null, n);
|
|
2944
|
+
if (!Array.isArray(o))
|
|
2945
|
+
return this.__error(
|
|
2946
|
+
new m("CSV_INVALID_COLUMN_MAPPING", [
|
|
2947
|
+
"Invalid Column Mapping:",
|
|
2948
|
+
"expect an array from column function,",
|
|
2949
|
+
`got ${JSON.stringify(o)}`
|
|
2950
|
+
], this.options, this.__infoField(), {
|
|
2951
|
+
headers: o
|
|
2952
|
+
})
|
|
2953
|
+
);
|
|
2954
|
+
const s = zt(o);
|
|
2955
|
+
this.state.expectedRecordLength = s.length, this.options.columns = s, this.__resetRecord();
|
|
2956
|
+
return;
|
|
2957
|
+
} catch (o) {
|
|
2958
|
+
return o;
|
|
2959
|
+
}
|
|
2960
|
+
},
|
|
2961
|
+
__resetRecord: function() {
|
|
2962
|
+
this.options.raw === !0 && this.state.rawBuffer.reset(), this.state.error = void 0, this.state.record = [], this.state.record_length = 0;
|
|
2963
|
+
},
|
|
2964
|
+
__onField: function() {
|
|
2965
|
+
const { cast: n, encoding: i, rtrim: o, max_record_size: s } = this.options, { enabled: f, wasQuoting: l } = this.state;
|
|
2966
|
+
if (f === !1)
|
|
2967
|
+
return this.__resetField();
|
|
2968
|
+
let u = this.state.field.toString(i);
|
|
2969
|
+
if (o === !0 && l === !1 && (u = u.trimRight()), n === !0) {
|
|
2970
|
+
const [h, c] = this.__cast(u);
|
|
2971
|
+
if (h !== void 0)
|
|
2972
|
+
return h;
|
|
2973
|
+
u = c;
|
|
2974
|
+
}
|
|
2975
|
+
this.state.record.push(u), s !== 0 && typeof u == "string" && (this.state.record_length += u.length), this.__resetField();
|
|
2976
|
+
},
|
|
2977
|
+
__resetField: function() {
|
|
2978
|
+
this.state.field.reset(), this.state.wasQuoting = !1;
|
|
2979
|
+
},
|
|
2980
|
+
__push: function(n, i) {
|
|
2981
|
+
const { on_record: o } = this.options;
|
|
2982
|
+
if (o !== void 0) {
|
|
2983
|
+
const s = this.__infoRecord();
|
|
2984
|
+
try {
|
|
2985
|
+
n = o.call(null, n, s);
|
|
2986
|
+
} catch (f) {
|
|
2987
|
+
return f;
|
|
2988
|
+
}
|
|
2989
|
+
if (n == null)
|
|
2990
|
+
return;
|
|
2991
|
+
}
|
|
2992
|
+
i(n);
|
|
2993
|
+
},
|
|
2994
|
+
// Return a tuple with the error and the casted value
|
|
2995
|
+
__cast: function(n) {
|
|
2996
|
+
const { columns: i, relax_column_count: o } = this.options;
|
|
2997
|
+
if (Array.isArray(i) === !0 && o && this.options.columns.length <= this.state.record.length)
|
|
2998
|
+
return [void 0, void 0];
|
|
2999
|
+
if (this.state.castField !== null)
|
|
3000
|
+
try {
|
|
3001
|
+
const f = this.__infoField();
|
|
3002
|
+
return [void 0, this.state.castField.call(null, n, f)];
|
|
3003
|
+
} catch (f) {
|
|
3004
|
+
return [f];
|
|
3005
|
+
}
|
|
3006
|
+
if (this.__isFloat(n))
|
|
3007
|
+
return [void 0, parseFloat(n)];
|
|
3008
|
+
if (this.options.cast_date !== !1) {
|
|
3009
|
+
const f = this.__infoField();
|
|
3010
|
+
return [void 0, this.options.cast_date.call(null, n, f)];
|
|
3011
|
+
}
|
|
3012
|
+
return [void 0, n];
|
|
3013
|
+
},
|
|
3014
|
+
// Helper to test if a character is a space or a line delimiter
|
|
3015
|
+
__isCharTrimable: function(n, i) {
|
|
3016
|
+
return ((s, f) => {
|
|
3017
|
+
const { timchars: l } = this.state;
|
|
3018
|
+
e:
|
|
3019
|
+
for (let u = 0; u < l.length; u++) {
|
|
3020
|
+
const h = l[u];
|
|
3021
|
+
for (let c = 0; c < h.length; c++)
|
|
3022
|
+
if (h[c] !== s[f + c])
|
|
3023
|
+
continue e;
|
|
3024
|
+
return h.length;
|
|
3025
|
+
}
|
|
3026
|
+
return 0;
|
|
3027
|
+
})(n, i);
|
|
3028
|
+
},
|
|
3029
|
+
// Keep it in case we implement the `cast_int` option
|
|
3030
|
+
// __isInt(value){
|
|
3031
|
+
// // return Number.isInteger(parseInt(value))
|
|
3032
|
+
// // return !isNaN( parseInt( obj ) );
|
|
3033
|
+
// return /^(\-|\+)?[1-9][0-9]*$/.test(value)
|
|
3034
|
+
// }
|
|
3035
|
+
__isFloat: function(n) {
|
|
3036
|
+
return n - parseFloat(n) + 1 >= 0;
|
|
3037
|
+
},
|
|
3038
|
+
__compareBytes: function(n, i, o, s) {
|
|
3039
|
+
if (n[0] !== s)
|
|
3040
|
+
return 0;
|
|
3041
|
+
const f = n.length;
|
|
3042
|
+
for (let l = 1; l < f; l++)
|
|
3043
|
+
if (n[l] !== i[o + l])
|
|
3044
|
+
return 0;
|
|
3045
|
+
return f;
|
|
3046
|
+
},
|
|
3047
|
+
__isDelimiter: function(n, i, o) {
|
|
3048
|
+
const { delimiter: s, ignore_last_delimiters: f } = this.options;
|
|
3049
|
+
if (f === !0 && this.state.record.length === this.options.columns.length - 1)
|
|
3050
|
+
return 0;
|
|
3051
|
+
if (f !== !1 && typeof f == "number" && this.state.record.length === f - 1)
|
|
3052
|
+
return 0;
|
|
3053
|
+
e:
|
|
3054
|
+
for (let l = 0; l < s.length; l++) {
|
|
3055
|
+
const u = s[l];
|
|
3056
|
+
if (u[0] === o) {
|
|
3057
|
+
for (let h = 1; h < u.length; h++)
|
|
3058
|
+
if (u[h] !== n[i + h])
|
|
3059
|
+
continue e;
|
|
3060
|
+
return u.length;
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
return 0;
|
|
3064
|
+
},
|
|
3065
|
+
__isRecordDelimiter: function(n, i, o) {
|
|
3066
|
+
const { record_delimiter: s } = this.options, f = s.length;
|
|
3067
|
+
e:
|
|
3068
|
+
for (let l = 0; l < f; l++) {
|
|
3069
|
+
const u = s[l], h = u.length;
|
|
3070
|
+
if (u[0] === n) {
|
|
3071
|
+
for (let c = 1; c < h; c++)
|
|
3072
|
+
if (u[c] !== i[o + c])
|
|
3073
|
+
continue e;
|
|
3074
|
+
return u.length;
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
return 0;
|
|
3078
|
+
},
|
|
3079
|
+
__isEscape: function(n, i, o) {
|
|
3080
|
+
const { escape: s } = this.options;
|
|
3081
|
+
if (s === null)
|
|
3082
|
+
return !1;
|
|
3083
|
+
const f = s.length;
|
|
3084
|
+
if (s[0] === o) {
|
|
3085
|
+
for (let l = 0; l < f; l++)
|
|
3086
|
+
if (s[l] !== n[i + l])
|
|
3087
|
+
return !1;
|
|
3088
|
+
return !0;
|
|
3089
|
+
}
|
|
3090
|
+
return !1;
|
|
3091
|
+
},
|
|
3092
|
+
__isQuote: function(n, i) {
|
|
3093
|
+
const { quote: o } = this.options;
|
|
3094
|
+
if (o === null)
|
|
3095
|
+
return !1;
|
|
3096
|
+
const s = o.length;
|
|
3097
|
+
for (let f = 0; f < s; f++)
|
|
3098
|
+
if (o[f] !== n[i + f])
|
|
3099
|
+
return !1;
|
|
3100
|
+
return !0;
|
|
3101
|
+
},
|
|
3102
|
+
__autoDiscoverRecordDelimiter: function(n, i) {
|
|
3103
|
+
const { encoding: o } = this.options, s = [
|
|
3104
|
+
// Important, the windows line ending must be before mac os 9
|
|
3105
|
+
a.from(`\r
|
|
3106
|
+
`, o),
|
|
3107
|
+
a.from(`
|
|
3108
|
+
`, o),
|
|
3109
|
+
a.from("\r", o)
|
|
3110
|
+
];
|
|
3111
|
+
e:
|
|
3112
|
+
for (let f = 0; f < s.length; f++) {
|
|
3113
|
+
const l = s[f].length;
|
|
3114
|
+
for (let u = 0; u < l; u++)
|
|
3115
|
+
if (s[f][u] !== n[i + u])
|
|
3116
|
+
continue e;
|
|
3117
|
+
return this.options.record_delimiter.push(s[f]), this.state.recordDelimiterMaxLength = s[f].length, s[f].length;
|
|
3118
|
+
}
|
|
3119
|
+
return 0;
|
|
3120
|
+
},
|
|
3121
|
+
__error: function(n) {
|
|
3122
|
+
const { encoding: i, raw: o, skip_records_with_error: s } = this.options, f = typeof n == "string" ? new Error(n) : n;
|
|
3123
|
+
if (s) {
|
|
3124
|
+
this.state.recordHasError = !0, this.options.on_skip !== void 0 && this.options.on_skip(f, o ? this.state.rawBuffer.toString(i) : void 0);
|
|
3125
|
+
return;
|
|
3126
|
+
} else
|
|
3127
|
+
return f;
|
|
3128
|
+
},
|
|
3129
|
+
__infoDataSet: function() {
|
|
3130
|
+
return {
|
|
3131
|
+
...this.info,
|
|
3132
|
+
columns: this.options.columns
|
|
3133
|
+
};
|
|
3134
|
+
},
|
|
3135
|
+
__infoRecord: function() {
|
|
3136
|
+
const { columns: n, raw: i, encoding: o } = this.options;
|
|
3137
|
+
return {
|
|
3138
|
+
...this.__infoDataSet(),
|
|
3139
|
+
error: this.state.error,
|
|
3140
|
+
header: n === !0,
|
|
3141
|
+
index: this.state.record.length,
|
|
3142
|
+
raw: i ? this.state.rawBuffer.toString(o) : void 0
|
|
3143
|
+
};
|
|
3144
|
+
},
|
|
3145
|
+
__infoField: function() {
|
|
3146
|
+
const { columns: n } = this.options, i = Array.isArray(n);
|
|
3147
|
+
return {
|
|
3148
|
+
...this.__infoRecord(),
|
|
3149
|
+
column: i === !0 ? n.length > this.state.record.length ? n[this.state.record.length].name : null : this.state.record.length,
|
|
3150
|
+
quoting: this.state.wasQuoting
|
|
3151
|
+
};
|
|
3152
|
+
}
|
|
3153
|
+
};
|
|
3154
|
+
};
|
|
3155
|
+
class hi extends k {
|
|
3156
|
+
constructor(e = {}) {
|
|
3157
|
+
super({ readableObjectMode: !0, ...e, encoding: null }), this.api = ui(e), this.api.options.on_skip = (r, n) => {
|
|
3158
|
+
this.emit("skip", r, n);
|
|
3159
|
+
}, this.state = this.api.state, this.options = this.api.options, this.info = this.api.info;
|
|
3160
|
+
}
|
|
3161
|
+
// Implementation of `Transform._transform`
|
|
3162
|
+
_transform(e, r, n) {
|
|
3163
|
+
if (this.state.stop === !0)
|
|
3164
|
+
return;
|
|
3165
|
+
const i = this.api.parse(e, !1, (o) => {
|
|
3166
|
+
this.push(o);
|
|
3167
|
+
}, () => {
|
|
3168
|
+
this.push(null), this.end(), this.destroy();
|
|
3169
|
+
});
|
|
3170
|
+
i !== void 0 && (this.state.stop = !0), n(i);
|
|
3171
|
+
}
|
|
3172
|
+
// Implementation of `Transform._flush`
|
|
3173
|
+
_flush(e) {
|
|
3174
|
+
if (this.state.stop === !0)
|
|
3175
|
+
return;
|
|
3176
|
+
const r = this.api.parse(void 0, !0, (n) => {
|
|
3177
|
+
this.push(n);
|
|
3178
|
+
}, () => {
|
|
3179
|
+
this.push(null), this.on("end", this.destroy);
|
|
3180
|
+
});
|
|
3181
|
+
e(r);
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
const ci = function() {
|
|
3185
|
+
let t, e, r;
|
|
3186
|
+
for (const i in arguments) {
|
|
3187
|
+
const o = arguments[i], s = typeof o;
|
|
3188
|
+
if (t === void 0 && (typeof o == "string" || T(o)))
|
|
3189
|
+
t = o;
|
|
3190
|
+
else if (e === void 0 && qt(o))
|
|
3191
|
+
e = o;
|
|
3192
|
+
else if (r === void 0 && s === "function")
|
|
3193
|
+
r = o;
|
|
3194
|
+
else
|
|
3195
|
+
throw new m("CSV_INVALID_ARGUMENT", [
|
|
3196
|
+
"Invalid argument:",
|
|
3197
|
+
`got ${JSON.stringify(o)} at index ${i}`
|
|
3198
|
+
], e || {});
|
|
3199
|
+
}
|
|
3200
|
+
const n = new hi(e);
|
|
3201
|
+
if (r) {
|
|
3202
|
+
const i = e === void 0 || e.objname === void 0 ? [] : {};
|
|
3203
|
+
n.on("readable", function() {
|
|
3204
|
+
let o;
|
|
3205
|
+
for (; (o = this.read()) !== null; )
|
|
3206
|
+
e === void 0 || e.objname === void 0 ? i.push(o) : i[o[0]] = o[1];
|
|
3207
|
+
}), n.on("error", function(o) {
|
|
3208
|
+
r(o, void 0, n.api.__infoDataSet());
|
|
3209
|
+
}), n.on("end", function() {
|
|
3210
|
+
r(void 0, i, n.api.__infoDataSet());
|
|
3211
|
+
});
|
|
3212
|
+
}
|
|
3213
|
+
if (t !== void 0) {
|
|
3214
|
+
const i = function() {
|
|
3215
|
+
n.write(t), n.end();
|
|
3216
|
+
};
|
|
3217
|
+
typeof setImmediate == "function" ? setImmediate(i) : setTimeout(i, 0);
|
|
3218
|
+
}
|
|
3219
|
+
return n;
|
|
3220
|
+
};
|
|
3221
|
+
export {
|
|
3222
|
+
m as CsvError,
|
|
3223
|
+
hi as Parser,
|
|
3224
|
+
ci as parse
|
|
3225
|
+
};
|