photostructure 0.6.0-alpha.2 → 2026.4.8-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +31 -29
- package/README.md +20 -8
- package/SECURITY.md +29 -0
- package/VERSION.json +12 -0
- package/bin/bootstrap.js +9 -0
- package/bin/fix.js +9 -0
- package/bin/info.js +9 -0
- package/bin/list.js +9 -0
- package/bin/logcat.js +9 -0
- package/bin/logtail.js +9 -0
- package/bin/main.js +9 -0
- package/bin/photostructure.js +9 -0
- package/bin/sync.js +9 -0
- package/bin/web.js +9 -0
- package/bin/worker.js +9 -0
- package/data/cuss.txt.br +0 -0
- package/data/icc/AdobeCompat-v2.icc +0 -0
- package/data/icc/AppleCompat-v2.icc +0 -0
- package/data/icc/ColorMatchCompat-v2.icc +0 -0
- package/data/icc/DisplayP3-v2-magic.icc +0 -0
- package/data/icc/DisplayP3-v2-micro.icc +0 -0
- package/data/icc/DisplayP3-v4.icc +0 -0
- package/data/icc/DisplayP3Compat-v2-magic.icc +0 -0
- package/data/icc/DisplayP3Compat-v2-micro.icc +0 -0
- package/data/icc/DisplayP3Compat-v4.icc +0 -0
- package/data/icc/ProPhoto-v2-magic.icc +0 -0
- package/data/icc/ProPhoto-v2-micro.icc +0 -0
- package/data/icc/ProPhoto-v4.icc +0 -0
- package/data/icc/Rec2020-v2-magic.icc +0 -0
- package/data/icc/Rec2020-v2-micro.icc +0 -0
- package/data/icc/Rec2020-v4.icc +0 -0
- package/data/icc/Rec2020Compat-v2-magic.icc +0 -0
- package/data/icc/Rec2020Compat-v2-micro.icc +0 -0
- package/data/icc/Rec2020Compat-v4.icc +0 -0
- package/data/icc/Rec709-v2-magic.icc +0 -0
- package/data/icc/Rec709-v2-micro.icc +0 -0
- package/data/icc/Rec709-v4.icc +0 -0
- package/data/icc/WideGamutCompat-v2.icc +0 -0
- package/data/icc/_info.md +49 -0
- package/data/icc/license +116 -0
- package/data/icc/readme.md +142 -0
- package/data/icc/sGrey-v2-magic.icc +0 -0
- package/data/icc/sGrey-v2-micro.icc +0 -0
- package/data/icc/sGrey-v2-nano.icc +0 -0
- package/data/icc/sGrey-v4.icc +0 -0
- package/data/icc/sRGB-v2-magic.icc +0 -0
- package/data/icc/sRGB-v2-micro.icc +0 -0
- package/data/icc/sRGB-v2-nano.icc +0 -0
- package/data/icc/sRGB-v4.icc +0 -0
- package/data/icc/scRGB-v2.icc +0 -0
- package/data/migrations/models/20181030_models.sql +151 -0
- package/data/migrations/models/20190417_rotation.sql +2 -0
- package/data/migrations/models/20190425_merged_assets.sql +11 -0
- package/{migrations → data/migrations}/models/20190426_clean_sha.sql +4 -4
- package/data/migrations/models/20190426_lowercase_psnet_hostname.sql +1 -0
- package/{migrations → data/migrations}/models/20190727_find_by_ca_and_geo.sql +3 -1
- package/data/migrations/models/20190730_session.sql +7 -0
- package/data/migrations/models/20190922_numeric_captured_at.sql +1 -0
- package/data/migrations/models/20190923_asset_file_v2_nofk.sql +107 -0
- package/data/migrations/models/20191013_asset_v2_nofk.sql +81 -0
- package/data/migrations/models/20200104_video_duration.sql +9 -0
- package/data/migrations/models/20200116_heartbeat.sql +9 -0
- package/data/migrations/models/20200127_spread_modes.sql +1 -0
- package/data/migrations/models/20200128_asset_file_v3_nofk.sql +143 -0
- package/data/migrations/models/20200130_advisory_lock.sql +21 -0
- package/data/migrations/models/20200211_updateCount.sql +2 -0
- package/data/migrations/models/20200512_asset_file_v4_nofk.sql +145 -0
- package/data/migrations/models/20200515_drop_merged_asset.sql +1 -0
- package/data/migrations/models/20200816_normalize_asset_file_uris.sql +1 -0
- package/data/migrations/models/20200823_add_asset_excluded.sql +11 -0
- package/data/migrations/models/20200825_fix_root_tags.sql +1 -0
- package/data/migrations/models/20200826_dedupe_tag_paths.sql +1 -0
- package/data/migrations/models/20200827_tag_v2_nofk.sql +35 -0
- package/data/migrations/models/20200923_suffix_tag_paths.sql +1 -0
- package/data/migrations/models/20200927_progress_v2.sql +23 -0
- package/data/migrations/models/20201006_progress_meta.sql +16 -0
- package/data/migrations/models/20201007_operation.sql +12 -0
- package/data/migrations/models/20201023_dedupe_tag_paths.sql +1 -0
- package/data/migrations/models/20201026_normalize_asset_file_uris.sql +1 -0
- package/data/migrations/models/20201030_add_tag_counts.sql +5 -0
- package/data/migrations/models/20201106_normalize_tag_paths.sql +1 -0
- package/data/migrations/models/20201112_tag_display_name.sql +2 -0
- package/data/migrations/models/20201113_drop_tc_tables.sql +1 -0
- package/data/migrations/models/20201211_tag_description.sql +5 -0
- package/data/migrations/models/20210322_sha_blocklist.sql +6 -0
- package/data/migrations/models/20210323_create_tag_fts.sql +1 -0
- package/data/migrations/models/20210324_asset_fave_delete.sql +20 -0
- package/data/migrations/models/20210531_asset_duration.sql +20 -0
- package/data/migrations/models/20210604_changed_tag.sql +7 -0
- package/data/migrations/models/20210627_changed_tag_updated_at.sql +2 -0
- package/data/migrations/models/20210827_asset_excluded_at.sql +19 -0
- package/data/migrations/models/20210930_asset_file_rating.sql +2 -0
- package/data/migrations/models/20210930_asset_revision.sql +16 -0
- package/data/migrations/models/20211025_ts_cleanup.sql +11 -0
- package/data/migrations/models/20220222_rebuild_rotated_heic.sql +2 -0
- package/data/migrations/models/20220922_rebuild_videos.sql +3 -0
- package/data/migrations/models/20220923_add_asset_file_mode_pct.sql +63 -0
- package/data/migrations/models/20221031_add_asset_file_hashes.sql +5 -0
- package/data/migrations/models/20231105_copy_asset_duration.sql +3 -0
- package/data/migrations/models/20231115_strict_nofk.sql +674 -0
- package/data/migrations/models/20231116_rebuild_tag_asset_counts.sql +1 -0
- package/data/migrations/models/20240115_task.sql +18 -0
- package/data/migrations/models/20240131_drop_operation_version.sql +35 -0
- package/data/migrations/models/20240201_create_tag_fts.sql +1 -0
- package/data/migrations/models/20240307_rebuild_progress_nofk.sql +59 -0
- package/data/migrations/models/20240313_rebuild_null_island.sql +3 -0
- package/data/migrations/models/20240723_add_asset_file_image_data_hash.sql +2 -0
- package/data/migrations/models/20240920_drop_task.sql +1 -0
- package/data/migrations/models/20240929_metadata_local.sql +3 -0
- package/data/migrations/models/20250421_asset_tag_fk_indexes.sql +21 -0
- package/data/migrations/models/20250421_tag_hierarchy.sql +13 -0
- package/data/migrations/models/20250422_schema_v3.sql +170 -0
- package/data/migrations/models/20250423_schema_v3_backfill_nofk.sql +1 -0
- package/data/migrations/models/20250929_indexes.sql +80 -0
- package/data/migrations/models/20260117_scan_generation.sql +31 -0
- package/data/migrations/models/20260122_fix_scan_generation_idx.sql +5 -0
- package/data/migrations/models/20260204_vec0_captured_at_local.sql +10 -0
- package/data/migrations/models/20260217_reaggregate_to_validate_siblings.sql +8 -0
- package/data/migrations/models/20260321_captured_at_src_detail.sql +3 -0
- package/data/migrations/models/20260322_captured_at_src_backfill.sql +2 -0
- package/data/migrations/models/20260403_drop_tag_fts.sql +5 -0
- package/data/migrations/models/20260425_volume_label.sql +5 -0
- package/data/migrations/models/20260426_vec0_bname.sql +6 -0
- package/data/models-schema.json +907 -0
- package/data/models-schema.sql +268 -0
- package/data/words.txt.br +0 -0
- package/defaults.env +6376 -0
- package/package.json +47 -25
- package/photostructure +26 -27
- package/public/192.png.gz +0 -0
- package/public/3rd-party-licenses.html.gz +0 -0
- package/public/3rd-party-licenses.txt.gz +0 -0
- package/public/512.png.gz +0 -0
- package/public/app/Array.js +8 -0
- package/public/app/Array.js.gz +0 -0
- package/public/app/BabyMarkdown.js +14 -0
- package/public/app/BabyMarkdown.js.gz +0 -0
- package/public/app/DropDown.vue_vue_type_script_setup_true_lang.js +12 -0
- package/public/app/DropDown.vue_vue_type_script_setup_true_lang.js.gz +0 -0
- package/public/app/HealthChecks.js +8 -0
- package/public/app/HealthChecks.js.gz +0 -0
- package/public/app/Lazy.js +8 -0
- package/public/app/Lazy.js.gz +0 -0
- package/public/app/PageActionsMenu.vue_vue_type_script_setup_true_lang.js +8 -0
- package/public/app/PageActionsMenu.vue_vue_type_script_setup_true_lang.js.gz +0 -0
- package/public/app/ProgressState.js +8 -0
- package/public/app/Random.js +8 -0
- package/public/app/SSEChannels.js +8 -0
- package/public/app/SSEChannels.js.gz +0 -0
- package/public/app/Search.js +8 -0
- package/public/app/Search.js.gz +0 -0
- package/public/app/StickyHeader.js +8 -0
- package/public/app/StickyHeader.js.gz +0 -0
- package/public/app/Tag.js +8 -0
- package/public/app/Tag.js.gz +0 -0
- package/public/app/_plugin-vue_export-helper.js +8 -0
- package/public/app/_plugin-vue_export-helper.js.gz +0 -0
- package/public/app/about.css +8 -0
- package/public/app/about.css.gz +0 -0
- package/public/app/about.js +8 -0
- package/public/app/about.js.gz +0 -0
- package/public/app/app.css +8 -0
- package/public/app/app.css.gz +0 -0
- package/public/app/app.js +12 -0
- package/public/app/app.js.gz +0 -0
- package/public/app/health.css +8 -0
- package/public/app/health.css.gz +0 -0
- package/public/app/health.js +9 -0
- package/public/app/health.js.gz +0 -0
- package/public/app/logs.css +8 -0
- package/public/app/logs.css.gz +0 -0
- package/public/app/logs.js +8 -0
- package/public/app/logs.js.gz +0 -0
- package/public/app/onReady.js +8 -0
- package/public/app/platform.js +8 -0
- package/public/app/roboto-mono-v22-latin-700.woff2.gz +0 -0
- package/public/app/roboto-mono-v22-latin-regular.woff2.gz +0 -0
- package/public/app/roboto-v30-latin-700.woff2.gz +0 -0
- package/public/app/roboto-v30-latin-700italic.woff2.gz +0 -0
- package/public/app/roboto-v30-latin-italic.woff2.gz +0 -0
- package/public/app/roboto-v30-latin-regular.woff2.gz +0 -0
- package/public/app/settings.css +8 -0
- package/public/app/settings.css.gz +0 -0
- package/public/app/settings.js +8 -0
- package/public/app/settings.js.gz +0 -0
- package/public/app/splash.css +8 -0
- package/public/app/splash.css.gz +0 -0
- package/public/app/splash.js +8 -0
- package/public/app/splash.js.gz +0 -0
- package/public/app/sse-worker.js +8 -0
- package/public/app/sse-worker.js.gz +0 -0
- package/public/app/sync.css +8 -0
- package/public/app/sync.css.gz +0 -0
- package/public/app/sync.js +12 -0
- package/public/app/sync.js.gz +0 -0
- package/public/app/toast.js +9 -0
- package/public/app/toast.js.gz +0 -0
- package/public/app/useAnchorHighlight.js +8 -0
- package/public/app/useSectionPersistence.js +8 -0
- package/public/app/useSectionPersistence.js.gz +0 -0
- package/public/apple-touch-icon.png.gz +0 -0
- package/public/browserconfig.xml +9 -0
- package/public/eula.html +25 -26
- package/public/favicon-16x16.png.gz +0 -0
- package/public/favicon-32x32.png.gz +0 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/roboto-mono-v22-latin-700.woff2.gz +0 -0
- package/public/fonts/roboto-mono-v22-latin-regular.woff2.gz +0 -0
- package/public/fonts/roboto-v30-latin-700.woff2.gz +0 -0
- package/public/fonts/roboto-v30-latin-700italic.woff2.gz +0 -0
- package/public/fonts/roboto-v30-latin-italic.woff2.gz +0 -0
- package/public/fonts/roboto-v30-latin-regular.woff2.gz +0 -0
- package/public/icon.svg.gz +0 -0
- package/public/images/1.png.gz +0 -0
- package/public/images/128.png +0 -0
- package/public/images/22-Template.png.gz +0 -0
- package/public/images/22-Template@2x.png.gz +0 -0
- package/public/images/22-Template@3x.png.gz +0 -0
- package/public/images/22-blue.png.gz +0 -0
- package/public/images/22-blue@2x.png.gz +0 -0
- package/public/images/22-blue@3x.png.gz +0 -0
- package/public/images/22-dark.png +0 -0
- package/public/images/22-dark@2x.png +0 -0
- package/public/images/22-dark@3x.png +0 -0
- package/public/images/22-gradient.png.gz +0 -0
- package/public/images/22-gradient@2x.png.gz +0 -0
- package/public/images/22-gradient@3x.png.gz +0 -0
- package/public/images/22-light.png +0 -0
- package/public/images/22-light@2x.png +0 -0
- package/public/images/22-light@3x.png +0 -0
- package/public/images/256.png +0 -0
- package/public/images/512.png.gz +0 -0
- package/public/images/64.png +0 -0
- package/public/images/antenna.svg.gz +0 -0
- package/public/images/article.svg.gz +0 -0
- package/public/images/baby.svg.gz +0 -0
- package/public/images/ballot-box.svg.gz +0 -0
- package/public/images/bank.svg.gz +0 -0
- package/public/images/bar-chart.svg.gz +0 -0
- package/public/images/beetle.svg.gz +0 -0
- package/public/images/birthday.svg.gz +0 -0
- package/public/images/bookmark-tabs.svg.gz +0 -0
- package/public/images/books-desat.svg.gz +0 -0
- package/public/images/books.svg.gz +0 -0
- package/public/images/busy-circle.svg.gz +0 -0
- package/public/images/busy-circles.svg.gz +0 -0
- package/public/images/busy-dots.svg.gz +0 -0
- package/public/images/busy.svg.gz +0 -0
- package/public/images/calendar.svg.gz +0 -0
- package/public/images/camera.svg.gz +0 -0
- package/public/images/card-box.svg.gz +0 -0
- package/public/images/card-index-dividers.svg.gz +0 -0
- package/public/images/cd.svg.gz +0 -0
- package/public/images/chart.svg.gz +0 -0
- package/public/images/check.svg.gz +0 -0
- package/public/images/checkered-flag.svg.gz +0 -0
- package/public/images/clear-256.png.gz +0 -0
- package/public/images/clear-64.png.gz +0 -0
- package/public/images/clock.svg.gz +0 -0
- package/public/images/computer.svg.gz +0 -0
- package/public/images/cpu.svg.gz +0 -0
- package/public/images/crane.svg.gz +0 -0
- package/public/images/cross-mark.svg.gz +0 -0
- package/public/images/disabled.svg.gz +0 -0
- package/public/images/dvd.svg.gz +0 -0
- package/public/images/emergency-light.svg.gz +0 -0
- package/public/images/error.svg.gz +0 -0
- package/public/images/expressionless-desat.svg.gz +0 -0
- package/public/images/expressionless.svg.gz +0 -0
- package/public/images/file-cabinet.svg.gz +0 -0
- package/public/images/fill.svg.gz +0 -0
- package/public/images/floppy.svg.gz +0 -0
- package/public/images/gift.svg.gz +0 -0
- package/public/images/green-check.svg.gz +0 -0
- package/public/images/green-radio.svg.gz +0 -0
- package/public/images/handshake.svg.gz +0 -0
- package/public/images/health.svg.gz +0 -0
- package/public/images/heart.svg.gz +0 -0
- package/public/images/home.svg.gz +0 -0
- package/public/images/info.svg.gz +0 -0
- package/public/images/library.svg.gz +0 -0
- package/public/images/logo-blue.svg.gz +0 -0
- package/public/images/logo-circle.svg.gz +0 -0
- package/public/images/logo-dark-700pt.svg.gz +0 -0
- package/public/images/logo-dark.svg.gz +0 -0
- package/public/images/logo-gradient-gloss-512w.png.gz +0 -0
- package/public/images/logo-gradient-gloss.svg.gz +0 -0
- package/public/images/logo-gradient-square-512w.png.gz +0 -0
- package/public/images/logo-gradient.svg.gz +0 -0
- package/public/images/logo-horizontal-600w.png.gz +0 -0
- package/public/images/logo-horizontal-white.svg.gz +0 -0
- package/public/images/logo-horizontal.svg.gz +0 -0
- package/public/images/logo-lite.svg.gz +0 -0
- package/public/images/logo-plus-512w.png.gz +0 -0
- package/public/images/logo-plus-horizontal.svg.gz +0 -0
- package/public/images/logo-plus.svg.gz +0 -0
- package/public/images/logo-square.svg.gz +0 -0
- package/public/images/logo-white.svg.gz +0 -0
- package/public/images/logo.ico +0 -0
- package/public/images/logo.png +0 -0
- package/public/images/logo@2x.png.gz +0 -0
- package/public/images/logo@3x.png.gz +0 -0
- package/public/images/logo@4x.png.gz +0 -0
- package/public/images/logo@5x.png +0 -0
- package/public/images/maximize.svg.gz +0 -0
- package/public/images/microscope.svg.gz +0 -0
- package/public/images/minidisc.svg.gz +0 -0
- package/public/images/movie-camera.svg.gz +0 -0
- package/public/images/navigate_next.svg.gz +0 -0
- package/public/images/new-yellow.svg.gz +0 -0
- package/public/images/new.svg.gz +0 -0
- package/public/images/open-book.svg.gz +0 -0
- package/public/images/open-folder.svg.gz +0 -0
- package/public/images/pause.svg.gz +0 -0
- package/public/images/photostructure-black.svg.gz +0 -0
- package/public/images/photostructure-white.svg.gz +0 -0
- package/public/images/refresh.svg.gz +0 -0
- package/public/images/rocket.svg.gz +0 -0
- package/public/images/sad-cat.svg.gz +0 -0
- package/public/images/safe.svg.gz +0 -0
- package/public/images/scales.svg.gz +0 -0
- package/public/images/seedling.svg.gz +0 -0
- package/public/images/shield.svg.gz +0 -0
- package/public/images/sleeping-face-desat.svg.gz +0 -0
- package/public/images/sleeping-face.svg.gz +0 -0
- package/public/images/sparkles.svg.gz +0 -0
- package/public/images/speed.svg.gz +0 -0
- package/public/images/splash.svg +1 -1
- package/public/images/splashbg1-1024w.jpg +0 -0
- package/public/images/splashbg2-1024w.jpg +0 -0
- package/public/images/splashbg3-1024w.jpg +0 -0
- package/public/images/splashbg4-1024w.jpg +0 -0
- package/public/images/splashbg5-1024w.jpg +0 -0
- package/public/images/splashbg6-1024w.jpg +0 -0
- package/public/images/star2.svg.gz +0 -0
- package/public/images/starry-night.svg.gz +0 -0
- package/public/images/stethoscope.svg.gz +0 -0
- package/public/images/stop.svg.gz +0 -0
- package/public/images/surf.svg.gz +0 -0
- package/public/images/sync.svg.gz +0 -0
- package/public/images/tada.svg.gz +0 -0
- package/public/images/terminal.svg.gz +0 -0
- package/public/images/thinking.svg.gz +0 -0
- package/public/images/thumbs-down.svg.gz +0 -0
- package/public/images/thumbs-up.svg.gz +0 -0
- package/public/images/toolbox.svg.gz +0 -0
- package/public/images/tools.svg.gz +0 -0
- package/public/images/umbrella.svg.gz +0 -0
- package/public/images/warning.svg.gz +0 -0
- package/public/images/wave.svg.gz +0 -0
- package/public/images/wrench.svg.gz +0 -0
- package/public/images/xray.svg.gz +0 -0
- package/public/images/zzz.svg.gz +0 -0
- package/public/mstile-144x144.png.gz +0 -0
- package/public/mstile-150x150.png.gz +0 -0
- package/public/mstile-310x150.png.gz +0 -0
- package/public/mstile-310x310.png.gz +0 -0
- package/public/mstile-70x70.png.gz +0 -0
- package/public/safari-pinned-tab.svg.gz +0 -0
- package/public/sw.js +5 -0
- package/server/bin/install-codec-tools.sh +48 -0
- package/server/sudoers.d/photostructure-codec-install +18 -0
- package/tools/README.md +23 -0
- package/tools/build.sh +30 -0
- package/tools/download-rg.sh +61 -0
- package/tools/license-overrides/photostructure-sqlite-vec-MIT.txt +21 -0
- package/tools/licenses/d3-color-difference/LICENSE.txt +29 -0
- package/tools/licenses/deep-eql/LICENSE.txt +21 -0
- package/tools/licenses/exiftool/{license.txt → LICENSE.txt} +140 -140
- package/tools/licenses/fft.js/LICENSE.txt +9 -0
- package/tools/licenses/libjpeg-turbo/LICENSE.md +7 -16
- package/tools/licenses/libraw/COPYRIGHT.txt +27 -0
- package/tools/licenses/moveable-type/LICENSE.txt +6 -0
- package/tools/licenses/noto-emoji/LICENSE.txt +201 -0
- package/tools/licenses/sharp-phash/LICENSE.txt +21 -0
- package/tools/licenses/{twemoji → type-detect}/LICENSE.txt +1 -1
- package/tools/linux-arm64/dcraw_emu +0 -0
- package/tools/linux-arm64/jpegtran +0 -0
- package/tools/linux-arm64/raw-identify +0 -0
- package/tools/linux-arm64/rg +0 -0
- package/tools/linux-arm64/sqlite3 +0 -0
- package/tools/linux-x64/dcraw_emu +0 -0
- package/tools/linux-x64/jpegtran +0 -0
- package/tools/linux-x64/raw-identify +0 -0
- package/tools/linux-x64/rg +0 -0
- package/tools/linux-x64/sqlite3 +0 -0
- package/tools/mac-arm64/dcraw_emu +0 -0
- package/tools/mac-arm64/jpegtran +0 -0
- package/tools/mac-arm64/jpegtran-README.md +31 -0
- package/tools/mac-arm64/libraw-README.md +42 -0
- package/tools/mac-arm64/raw-identify +0 -0
- package/tools/mac-arm64/rg +0 -0
- package/tools/mac-arm64/sqlite3 +0 -0
- package/tools/mac-arm64/sqlite3-README.md +35 -0
- package/tools/mac-x64/dcraw_emu +0 -0
- package/tools/mac-x64/jpegtran +0 -0
- package/tools/mac-x64/jpegtran-README.md +30 -0
- package/tools/mac-x64/libraw-README.md +52 -0
- package/tools/mac-x64/raw-identify +0 -0
- package/tools/mac-x64/rg +0 -0
- package/tools/mac-x64/sqlite3 +0 -0
- package/tools/mac-x64/sqlite3-README.md +6 -0
- package/tools/win-x64/dcraw_emu.exe +0 -0
- package/tools/{win-ia32/jpegtran → win-x64}/jpegtran.exe +0 -0
- package/tools/{win-ia32/jpegtran → win-x64}/libjpeg-62.dll +0 -0
- package/tools/win-x64/libraw-README.md +6 -0
- package/tools/win-x64/libraw.dll +0 -0
- package/tools/win-x64/raw-identify.exe +0 -0
- package/tools/win-x64/recycle-bin-README.md +3 -0
- package/tools/win-x64/recycle-bin.exe +0 -0
- package/tools/win-x64/rg.exe +0 -0
- package/tools/win-x64/sqlite3-README.md +4 -0
- package/tools/win-x64/sqlite3.exe +0 -0
- package/views/_fouc-prevention.ejs +13 -0
- package/views/error.ejs +64 -0
- package/views/eula.html +57 -0
- package/views/settings.ejs +958 -0
- package/views/spa.ejs +54 -0
- package/views/splash.ejs +30 -0
- package/views/welcome-tools.ejs +201 -0
- package/views/welcome.ejs +89 -0
- package/app/info.js +0 -3
- package/app/logtail.js +0 -3
- package/app/main.js +0 -3
- package/app/sync-file.js +0 -3
- package/app/sync.js +0 -3
- package/app/web.js +0 -3
- package/migrations/models/20181030_models.sql +0 -145
- package/migrations/models/20190417_rotation.sql +0 -1
- package/migrations/models/20190425_merged_assets.sql +0 -10
- package/migrations/models/20190426_lowercase_psnet_hostname.sql +0 -1
- package/migrations/models/20190522_on_new_exif_uid.sql +0 -1
- package/migrations/models/20190729_on_new_exif_uid.sql +0 -1
- package/migrations/models/20190730_session.sql +0 -6
- package/migrations/stats/20181030_stats.sql +0 -16
- package/migrations/stats/20190312_files_not_bytes.sql +0 -23
- package/migrations/stats/20190515_rebuild_queue.sql +0 -21
- package/public/app/latest.js.gz +0 -0
- package/public/fonts/roboto-mono-v5-latin-regular.woff.gz +0 -0
- package/public/fonts/roboto-mono-v5-latin-regular.woff2.gz +0 -0
- package/public/fonts/roboto-v18-latin-300.woff.gz +0 -0
- package/public/fonts/roboto-v18-latin-300.woff2.gz +0 -0
- package/public/fonts/roboto-v18-latin-500.woff.gz +0 -0
- package/public/fonts/roboto-v18-latin-500.woff2.gz +0 -0
- package/public/fonts/roboto-v18-latin-700.woff.gz +0 -0
- package/public/fonts/roboto-v18-latin-700.woff2.gz +0 -0
- package/public/fonts/roboto-v18-latin-900.woff.gz +0 -0
- package/public/fonts/roboto-v18-latin-900.woff2.gz +0 -0
- package/public/fonts/roboto-v18-latin-italic.woff.gz +0 -0
- package/public/fonts/roboto-v18-latin-italic.woff2.gz +0 -0
- package/public/fonts/roboto-v18-latin-regular.woff.gz +0 -0
- package/public/fonts/roboto-v18-latin-regular.woff2.gz +0 -0
- package/public/images/128.png.gz +0 -0
- package/public/images/256-gradient.png +0 -0
- package/public/images/256-gradient.png.gz +0 -0
- package/public/images/256.png.gz +0 -0
- package/public/images/64.png.gz +0 -0
- package/public/images/bg.svg.gz +0 -0
- package/public/images/bg10.jpg.gz +0 -0
- package/public/images/blue-splash-1024w.png.gz +0 -0
- package/public/images/blue-tri-bg.svg.gz +0 -0
- package/public/images/boom.svg.gz +0 -0
- package/public/images/dark-cyan-fuschia-bg.svg.gz +0 -0
- package/public/images/fit.svg.gz +0 -0
- package/public/images/light-cyan-fuschia-bg.svg.gz +0 -0
- package/public/images/line-logo-top-cuts-filled.svg.gz +0 -0
- package/public/images/line-logo-top-cuts.svg.gz +0 -0
- package/public/images/link.svg.gz +0 -0
- package/public/images/logo-gradient-gloss-sq.svg.gz +0 -0
- package/public/images/logo-gradient.svg +0 -1
- package/public/images/logo-icon-path.svg.gz +0 -0
- package/public/images/logo-text-path.svg.gz +0 -0
- package/public/images/logo-text-white.svg.gz +0 -0
- package/public/images/navigate_prev.svg.gz +0 -0
- package/public/images/no-entry.svg.gz +0 -0
- package/public/images/phone.svg.gz +0 -0
- package/public/images/private.svg.gz +0 -0
- package/public/images/profile.svg.gz +0 -0
- package/public/images/public.svg.gz +0 -0
- package/public/images/show-in-folder-black.svg.gz +0 -0
- package/public/images/show-in-folder.svg.gz +0 -0
- package/public/images/shrug.svg.gz +0 -0
- package/public/images/splash-1024w.png +0 -0
- package/public/images/splash-1024w.png.gz +0 -0
- package/public/images/splash-512w.png +0 -0
- package/public/images/splash-512w.png.gz +0 -0
- package/public/images/splash-blue.svg +0 -1
- package/public/images/splashbg01-1024w.jpg +0 -0
- package/public/images/splashbg01-1024w.jpg.gz +0 -0
- package/public/images/splashbg02-1024w.jpg +0 -0
- package/public/images/splashbg02-1024w.jpg.gz +0 -0
- package/public/images/text-logo-blue.svg.gz +0 -0
- package/public/images/transparent-white.svg.gz +0 -0
- package/public/images/trash.svg.gz +0 -0
- package/public/release-notes.html +0 -581
- package/public/splash.html +0 -360
- package/tools/licenses/dcraw/dcraw.txt +0 -24
- package/tools/licenses/vue-my-dropdown/LICENSE.txt +0 -19
- package/tools/linux-arm/dcraw/dcraw +0 -0
- package/tools/linux-arm/dcraw/install.sh +0 -5
- package/tools/linux-arm/jpegtran/README.md +0 -11
- package/tools/linux-arm/jpegtran/jpegtran +0 -0
- package/tools/linux-arm/sqlite3/sqlite3 +0 -0
- package/tools/linux-ia32/sqlite3/sqlite3 +0 -0
- package/tools/linux-x64/dcraw/dcraw +0 -0
- package/tools/linux-x64/jpegtran/jpegtran +0 -0
- package/tools/mac-x64/dcraw/dcraw +0 -0
- package/tools/mac-x64/dcraw/install.sh +0 -8
- package/tools/mac-x64/jpegtran/jpegtran +0 -0
- package/tools/mac-x64/sqlite3/README.md +0 -33
- package/tools/mac-x64/sqlite3/sqlite3 +0 -0
- package/tools/win-ia32/dcraw/README.md +0 -30
- package/tools/win-ia32/dcraw/dcraw.exe +0 -0
- package/tools/win-ia32/sqlite3/sqlite3.exe +0 -0
package/app/logtail.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
module.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=364)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(6),r=n(9),s=n(41),o=n(61),a=n(4),u=n(11);var l=n(6);e.defined=l.defined,e.orElse=l.orElse;var c=n(9);function d(t,e){return null!=t?e(t):void 0}function h(t,e){try{return t()}catch(t){return null!=e?e(t):void 0}}function f(t){return r.keys(t).filter(e=>o.isPrimitive(t[e])||u.isDate(t[e])).map(e=>[e,t[e]])}e.compactValues=c.compactValues,e.entries=c.entries,e.fromEntries=c.fromEntries,e.keys=c.keys,e.mapFields=c.mapFields,e.maybeCall=c.maybeCall,e.onlyReqValued=c.onlyReqValued,e.pick=c.pick,e.reqValuedOrElse=c.reqValuedOrElse,e.values=c.values,e.without=c.without,e.definedThunks=function(...t){return t.every(t=>i.defined(t()))},e.firstThunk=function(...t){for(const e of t){const t=e();if(null!=t)return t}},e.firstTrueThunk=function(t,e){for(const n of t){const t=n();if(null!=t&&(null==e||e(t)))return t}},e.firstDefined=function(...t){return t.find(i.defined)},e.firstDefinedField=function(t,...e){return d(e.find(e=>null!=t[e]),e=>t[e])},e.firstFieldLike=function(t,e){return a.first(r.keys(t),n=>e(n,t[n])?t[n]:void 0)},e.ornull=function(t){return void 0===t?null:t},e.map=d,e.mapOr=function(t,e,n){return null!=t?e(t):s.isFunction(n)?n():n},e.mapAnd=function(t,e){return null!=t&&e(t)},e.mapOrThrow=function(t,e,n){if(null!=t)return e(t);throw new Error(n)},e.Try=h,e.tryEach=function(t,e){[...t].forEach(t=>h(()=>e(t)))},e.identity=function(t){return t},e.ctor=function(t){return d(t.constructor,t=>t.name)},e.hasKeys=function(t){return Object.keys(t).some(e=>"string"==typeof e&&t.propertyIsEnumerable(e))},e.primitiveEntries=f,e.spread=function(t,...e){return Object.assign({},t,...a.compact(e))},e.assignMissingPrimitives=function(t,e){return null==e?t:(f(e).forEach(([e,n])=>{null==t[e]&&(t[e]=n)}),t)},e.pickMap=function(t,e,n){const i={};for(const r of e)i[r]=n(r,t[r]);return i},e.mapEntries=function(t,e){const n={};for(const i of r.keys(t))n[i]=e(i,t[i]);return n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(3),r=n(34),s=n(189),o=n(134),a=n(101),u=n(174),l=n(0),c=n(12);e.rootLogger=i.lazy(()=>o.ConsoleLogger.instance()),e.safeRootLogger=i.lazy(()=>a.safeLogger(e.rootLogger())),e.rootLogger.onChange(()=>e.safeRootLogger.clear()),e.alsoLogToConsole=function(){e.rootLogger.set(e.rootLogger()===o.ConsoleLogger.instance()?e.rootLogger():new s.CompoundLogger(e.rootLogger(),o.ConsoleLogger.instance()))},e.setLoggerProcessName=function(t,n){l.map(e.rootLogger.prior(),t=>t.close());const i=new u.LogWriter(r.BaseFile.for(n),t);e.rootLogger.set(c.Settings.logStdout.valueOrDefault?new s.CompoundLogger(i,o.ConsoleLogger.instance()):i)},e.mkLogger=function(t){return new a.ContextualLogger(t,e.rootLogger)},e.mkSafeLogger=function(t){return new a.ContextualLogger(t,e.safeRootLogger)}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(42),s=n(15),o=n(33),a=n(4),u=n(29),l=n(11),c=n(7),d=n(0),h=n(184),f=n(37),p=n(51);var m=n(84);function g(t){return i(this,void 0,void 0,function*(){try{return yield t,!0}catch(t){return!1}})}function y(t,e,n=(()=>void 0),r=(()=>void 0)){return i(this,void 0,void 0,function*(){let i,s=!1,o=!1;return yield Promise.race([h.asPromise(t).then(t=>o?void 0:(i=t,s=!0,t)),f.unrefDelay(e).then(()=>{s||(o=!0)})]),s?yield r(i):yield n(),i})}function v(t,n,r=e.DefaultMaxConcurrent){return i(this,void 0,void 0,function*(){return(yield p.withBoundedConcurrency({name:"tuples",laters:t.map(t=>()=>i(this,void 0,void 0,function*(){return[yield n(t),t]})),maxConcurrent:r})).filter(([t,e])=>null!=t&&null!=e)})}e.thenTap=m.thenTap,e.DefaultMaxConcurrent=8,e.PromiseStates=o.strEnum("pending","resolved","rejected"),e.resolvedThen=function(t,e){return i(this,void 0,void 0,function*(){if(null==t)return Promise.resolve(void 0);try{return yield t,e()}catch(t){return}})},e.resolvedWithin=function(t,e){return Promise.race([t,f.delay(e).then(()=>void 0)])},e.resolved=g,e.rejected=function(t){return i(this,void 0,void 0,function*(){return!(yield g(t))})},e.thenDefined=function(t){return i(this,void 0,void 0,function*(){return null!=(yield t)})},e.allSerial=function(t){return i(this,void 0,void 0,function*(){const e=[];for(const n of a.compact(t))e.push(yield n());return a.compact(e)})},e.awaitAll=function(t){return i(this,void 0,void 0,function*(){yield Promise.all(a.compact(t))})},e.thenFlatten=function(t){return i(this,void 0,void 0,function*(){return null==t?[]:a.flatten(a.compact(yield Promise.all(t)))})},e.thenCompact=function(t){return i(this,void 0,void 0,function*(){const e=a.compact(t);return a.isEmpty(e)?[]:a.compact(yield Promise.all(e))})},e.asyncFind=function(t,e){return i(this,void 0,void 0,function*(){for(const n of t)if(yield e(n))return n})},e.asyncFilter=function(t,n,r=e.DefaultMaxConcurrent){return i(this,void 0,void 0,function*(){return(yield v(a.compact(t),n,r)).filter(([t])=>t).map(([,t])=>t)})},e.tryAsync=function(t){return i(this,void 0,void 0,function*(){try{return yield t()}catch(t){return}})},e.DefaultTryAllTimeoutMs=30*l.secondMs,e.tryAll=function(t,n=(t=>console.error(t)),r=e.DefaultTryAllTimeoutMs){return i(this,void 0,void 0,function*(){for(const e of t)try{yield y(e,r)}catch(t){n(t)}})},e.thenFinally=function(t,e=(()=>{}),n=(()=>{})){return i(this,void 0,void 0,function*(){let i,r=null;try{i=yield"function"==typeof t?t():t}catch(t){r=t;try{yield e(t)}catch(t){}}try{yield n(null!=r?r:i)}catch(t){}if(null!=r)throw r;return i})},e.thenNot=function(t,e=!0){return i(this,void 0,void 0,function*(){if(null==t)return e;const n=yield t;return null==n?e:!u.truthy(n)})},e.thenMap=function(t,e){return i(this,void 0,void 0,function*(){const n=yield t;return null==n?void 0:e(n)})},e.thenMapOr=function(t,e,n){return i(this,void 0,void 0,function*(){const i=yield t;if(null==i)return n();const r=yield e(i);return null==r?n():r})},e.thenAnd=function(t,e){return i(this,void 0,void 0,function*(){if(null!=t)return(yield t)?e():void 0})},e.thenOrElse=function(t,e){return i(this,void 0,void 0,function*(){return d.orElse(yield t,e)})},e.thenSome=function(t,e){return i(this,void 0,void 0,function*(){let n=0;for(const i of t)if(yield e(i,n++,t))return!0;return!1})},e.thenEvery=function(t,e){return i(this,void 0,void 0,function*(){let n=0;for(const i of t)if(!1===(yield e(i,n++,t)))return!1;return!0})},e.firstAsync=function(t,e){return i(this,void 0,void 0,function*(){if(null!=t){let n=-1;for(const i of t){n++;try{if(null==i)continue;const t=yield e(i,n);if(null!=t)return t}catch(t){}}}})},e.firstDefinedPromise=function(...t){return i(this,void 0,void 0,function*(){for(const e of t){const t=yield e();if(null!=t)return t}})},e.firstResolvedDefinedPromise=function(t,e){return i(this,void 0,void 0,function*(){for(const n of t)try{const t=yield n();if(null!=t)return t}catch(t){e(t)}})},e.firstTruePromise=function(t,...e){return i(this,void 0,void 0,function*(){for(const n of e)try{const e=yield n();if(null!=e&&!0===(yield t(e)))return e}catch(t){}})},e.until=function(t,e,n){return i(this,void 0,void 0,function*(){const i=c.mapGt0(e,t=>Date.now()+t),o=s.Opt(n).getOrElse(()=>d.orElse(e,3e4)/10),a=c.clamp(100,1e4,o);for(;null==i||Date.now()<i;){const e=yield t();if(!0===e)return!0;if(null!=e&&!1!==e)throw new Error("f must return a boolean, but returned "+r.inspect(e));yield f.delay(a)}return!1})},e.untilDefined=function(t,{timeoutMs:e,timeBetweenMs:n}){return i(this,void 0,void 0,function*(){const i=c.mapGt0(e,t=>Date.now()+t),r=s.Opt(n).getOrElse(()=>d.orElse(e,3e4)/10),o=c.clamp(50,1e4,r);for(;null==i||Date.now()<i;){const e=yield t();if(null!=e)return e;yield f.delay(o)}})},e.thenOrTimeout=y,e.tuples=v,e.thenGreatest=function(t,e){return i(this,void 0,void 0,function*(){return d.map(a.greatestBy(yield v(t,e),t=>t[0]),t=>t[1])})},e.sortByAsync=function(t,e){return i(this,void 0,void 0,function*(){return a.sortBy(yield v(t,e),t=>t[0]).map(t=>t[1])})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.lazy=function(t,e){let n,i=0;const r=[];function s(t){return i=Date.now(),n=t,r.forEach(t=>t(n)),n}function o(){return(0===i||null!=e&&i+e<=Date.now())&&s(t()),n}return o.clear=function(){const t=n;return i=0,n=void 0,r.forEach(t=>t(n)),t},o.set=function(t){return s(t)},o.prior=function(){return n},o.refresh=function(){return s(t())},o.setTTL=function(t){return e=t},o.onChange=function(t){r.push(t)},o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(9),s=n(61),o=n(10),a=n(7),u=n(0);var l=n(5);function c(t){return u.defined(t)&&t.every(u.defined)}function d(t,e,n=1,i=u.identity){const r=[];if(t<e)for(let s=t;s<e;s+=n)r.push(i(s));else for(let s=t;s>e;s-=n)r.push(i(s));return r}function h(...t){const e=Math.max(...t.map(t=>t.length));return a.times(e,e=>t.map(t=>t[e]))}function f(t){return y(t,(t,e)=>t.valueOf()<e.valueOf())}function p(t){return g(t,t=>t.valueOf())}function m(t,e){return y(t,(t,n)=>u.map(e(t),t=>u.map(e(n),e=>t<e)))}function g(t,e){return y(t,(t,n)=>u.map(e(t),t=>u.map(e(n),e=>t>e)))}function y(t,e){let n,i=-1;for(let r=0;r<t.length;r++)u.map(t[r],t=>{null!=n&&!0!==e(t,n)||(i=r,n=t)});return i}e.clear=l.clear,e.compact=l.compact,e.count=l.count,e.includesAll=l.includesAll,e.isEmpty=l.isEmpty,e.isNotEmpty=l.isNotEmpty,e.mapNotEmpty=l.mapNotEmpty,e.filterInPlace=l.filterInPlace,e.uniq=l.uniq,e.uniqBy=l.uniqBy,e.sort=l.sort,e.sortBy=l.sortBy,e.sorted=l.sorted,e.startsWith=l.startsWith,e.toA=l.toA,e.allDefined=c,e.mapAllDefined=function(t,e){return c(t)?e(t):void 0},e.mapAll=function(t,e){return c(t)?e(t):void 0},e.allNotDefined=function(t){return null==t||t.every(t=>null==t)},e.allNotBlank=function(...t){return null!=t&&t.every(o.notBlank)},e.anyNotDefined=function(t){return null==t||t.some(t=>null==t)},e.anyDefined=function(t){return null!=t&&t.some(t=>null!=t)},e.first=function(t,e){if(null!=t)for(const n of i.compact(t)){const t=e(n);if(null!=t)return t}},e.firstNonEmptyThunk=function(...t){for(const e of t){const t=e();if(i.isNotEmpty(t))return t}},e.concat=function(...t){const e=[];for(const n of t)if(Array.isArray(n))for(const t of n)null!=t&&e.push(t);else null!=n&&e.push(n);return e},e.flatten=function t(e,n=[]){return null==e?n:(e.forEach(e=>u.map(e,e=>Array.isArray(e)?t(e,n):n.push(e))),n)},e.exclude=function(t,e){if(e.length<50)return t.filter(t=>!e.includes(t));{const n=new Set(e);return t.filter(t=>!n.has(t))}},e.remove=function(t,e){const n=t.length;return i.filterInPlace(t,t=>t!==e),n!==t.length},e.diff=function(t,e){const n=new Set(e.map(t=>t.valueOf()));return t.filter(t=>!n.has(t.valueOf()))},e.intersect=function(t,e){const n=new Set(e.map(t=>t.valueOf()));return t.filter(t=>n.has(t.valueOf()))},e.eqlContents=function(t,e){return h(i.sort(t),i.sort(e)).every(([t,e])=>t===e)},e.removeFirst=function(t,e){const n=t.findIndex(e);return n>=0?t.splice(n,1)[0]:void 0},e.uniqInPlace=function(t){i.filterInPlace(t,(e,n)=>t.indexOf(e)===n)},e.partition=function(t,e){const n=[],i=[];return t.forEach((t,r)=>(e(t,r)?n:i).push(t)),[n,i]},e.uniqCount=function(t){return function t(e){if(null==e||0===e.length)return[];const n=e[0];const i=e.lastIndexOf(n);return[{t:n,count:i+1},...t(e.slice(i+1))]}(t.sort())},e.mapCompact=function(t,e){return i.compact(i.compact(t).map(e))},e.toMapEntries=function(t,e){return new Map(t.map(e).filter(u.defined))},e.flatMap=function(t,e){return t.reduce((t,n)=>t.concat(e(n)),[])},e.range=function(t,e,n=u.identity){return d(t,e,1,n)},e.stepRange=d,e.retainLastN=function(t,e){return t.length>e&&t.splice(0,t.length-e),t},e.retainFirstN=function(t,e){return t.length=Math.min(t.length,e),t},e.contextAround=function(t,e,n,i){const r=t.findIndex(i);if(-1!==r){return{before:0===r?[]:t.slice(Math.max(0,r-e),r),after:r===t.length-1?[]:t.slice(r+1,Math.min(r+1+n,t.length))}}},e.zip=h,e.flatZip=function(...t){const e=Math.max(...t.map(t=>t.length)),n=[];return a.times(e,e=>t.map(t=>n.push(t[e]))),n},e.unzip=function(t){return[t.map(([t])=>t),t.map(([,t])=>t)]},e.ancestry=function(t){return a.times(t.length,e=>t.slice(0,e+1))},e.leastIndex=f,e.greatestIndex=p,e.min=function(t){return t[f(t)]},e.max=function(t){return t[p(t)]},e.leastIndexBy=m,e.greatestIndexBy=g,e.leastBy=function(t,e){return t[m(t,e)]},e.greatestBy=function(t,e){return t[g(t,e)]},e.combinations=function*t(e,n){if(!(null==e||e.length<n))for(let i=0;i<e.length;i++)if(1===n)yield[e[i]];else for(const r of t(e.slice(i+1),n-1))yield[e[i],...r]},e.sortByInPlace=function(t,e){return t.sort((t,n)=>s.cmp(e(t),e(n)))},e.reverse=function(t){const e=[];for(let n=t.length-1;n>=0;n--)e.push(t[n]);return e},e.batches=function(t,e){return e<=0&&(e=1),d(0,t.length,e,n=>t.slice(n,n+e))},e.sortArrArr=function(t){return i.sortBy(t.map(t=>i.sort(t)),t=>t[0].valueOf())},e.contextFilter=function(t,e){let n;return t.filter((t,i)=>r.tap(e(t,i,n),e=>{e&&(n=t)}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(8),r=n(46),s=n(180),o=n(95),a=n(6),u=n(61),l=n(18);function c(t){return null==t?[]:"function"==typeof Array.from?Array.from(t):Array.isArray(t)?t:[].slice.call(t)}function d(t){return s.isList(t)&&t.length>0&&t.some(t=>null!=t)}function h(t){return!d(t)}function f(t){return u.isPrimitive(t)||u.isPrimitiveArray(t)?t:t.valueOf()}function p(t,e){if(null==t)return!1;for(const n of t)if(e===n)return!0;return!1}function m(t){if(null==t)return[];const e=c(t);return e.every(a.defined)?e:e.filter(a.defined)}e.toA=c,e.isNotEmpty=d,e.isEmpty=h,e.mapNotEmpty=function(t,e){return d(t)?e(t):void 0},e.sort=function(t){return m(t).sort((t,e)=>u.cmp(a.map(t,f),a.map(e,f)))},e.sorted=function(t){return t.every((e,n)=>0===n||e>t[n-1])},e.sortBy=function(t,e){return c(t).map(t=>[e(t),t]).filter(([t])=>null!=t).sort((t,e)=>u.cmp(t[0],e[0])).map(t=>t[1])},e.startsWith=function(t,e){return r.arrayEql(t.slice(0,e.length),e)},e.filterInPlace=function(t,e){for(let n=0;n<t.length;)e(t[n],n,t)?n++:t.splice(n,1);return t},e.includes=p,e.indexOf=function(t,e){if(null==t)return;let n=0;for(const i of t){if(e(i,n))return n;n++}},e.includesAll=function(t,e){return null!=t&&null!=e&&e.every(e=>p(t,e))},e.pushUniq=function(t,e){return p(t,e)||t.push(e),t},e.compact=m;const g=["null","undefined"];function y(t,e){if(h(t))return[];const n=new Map;return t.forEach(t=>o.getOrSet(n,e(t),()=>t)),[...n.values()]}e.compactBlankish=function(t){return c(t).filter(t=>i.notBlank(t)&&!g.includes(l.toS(t)))},e.compactBlanks=function(t){return null==t?[]:t.map(l.toS).filter(i.notBlank)},e.uniq=function(t){return y(t,t=>JSON.stringify(t))},e.uniqBy=y,e.clear=function(t){return t.length=0,t},e.count=function(t,e){return t.reduce((t,n)=>t+(e(n)?1:0),0)},e.sum=function(t,e){return t.reduce((t,n)=>t+e(n),0)},e.firstMatch=function(t,e){for(const n of m(e)){const e=t.exec(n);if(null!=e)return e}},e.commonPrefixLength=function(t,e){if(null==t||null==e)return 0;if(r.eql(t,e))return t.length;let n=0;for(;r.eql(t[n],e[n]);)n++;return n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(41);function r(t){return null!=t}e.map=function(t,e){return null==t?void 0:e(t)},e.orElse=function(t,e){return null!=t?t:i.isFunction(e)?e():e},e.mapOr=function(t,e,n){return null==t?n():e(t)},e.defined=r,e.allDefined=function(t){return null!=t&&t.every(r)},e.firstDefined=function(...t){return t.find(r)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(17),r=n(59),s=n(4),o=n(10),a=n(0);var u=n(17);e.clamp=u.clamp,e.gt0=u.gt0,e.gte0=u.gte0,e.isNumber=u.isNumber,e.id=u.id,e.mapFinite=u.mapFinite,e.mapInt=u.mapInt,e.round=u.round,e.sigFigs=u.sigFigs,e.times=u.times,e.toInt=u.toInt,e.toFloat=u.toFloat,e.toPrecision=u.toPrecision;var l=n(59);e.fmt=l.fmt,e.fmtBytes=l.fmtBytes,e.GB=l.GB,e.GiB=l.GiB,e.KB=l.KB,e.KiB=l.KiB,e.MB=l.MB,e.megapixels=l.megapixels,e.MiB=l.MiB,e.MP=l.MP;const c=t=>(e,n)=>i.isNumber(e)&&i.isNumber(n)&&t(e,n);e.lt=c((t,e)=>t<e),e.lte=c((t,e)=>t<=e),e.gt=c((t,e)=>t>e),e.gte=c((t,e)=>t>=e),e.firstGt0=function(...t){return t.find(i.gt0)},e.firstNonZero=function(...t){for(const e of s.flatten(t)){const t=i.toFloat(e);if(null!=t&&0!==t)return t}},e.mapGte0=function(t,e){return i.mapInt(t,t=>t>=0?e(t):void 0)},e.mapGt0=function(t,e){return i.mapInt(t,t=>t>0?e(t):void 0)},e.within=function(t,n,i){return null!=i&&([t,n]=[Math.min(t,n),Math.max(t,n)],e.gte(i,t)&&e.lte(i,n))};const d=/[+-]?[0-9\.]/;function h(t){if(i.isNumber(t))return t;if(o.blank(t))return;const e=String(t);return a.map(d.exec(e),t=>i.toFloat(e.substr(t.index)))}e.extractInt=function(t){return i.toInt(h(t))},e.extractFloat=h,e.closeTo=function(t,e,n){return Math.abs(t-e)<n},e.assertPositive=function(t,e){if(null==e||e<=0)throw new Error(t+" must be positive")},e.plur=function(t,e,n=e+"s"){return r.fmt(t)+" "+(1===t?e:n)},e.absdiff=function(t,e){t=null==t?0:t,e=null==e?0:e;const n=Math.min(t,e);return Math.abs(n+t-(n+e))};e.Array2D=class{constructor(t){this.columns=t,this.store=[]}get(t,e){return t<0||e<0?0:a.orElse(this.store[t*this.columns+e],()=>0)}set(t,e,n){this.store[t*this.columns+e]=n}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(18);function s(t){if(null==t)return!0;const e=r.toS(t);return 0===e.length||0===e.trim().length}function o(t){return!s(t)}e.blank=s,e.notBlank=o,e.ifNotBlank=function(t){if(null==t)return;const e=r.toS(t);return 0===e.length||0===e.trim().length?void 0:e},e.notBlankOr=function(t,e){if(null==t)return e;const n=r.toS(t).trim();return n.length>0?n:e},e.notBlankAnd=function(t,e){return!s(t)&&e(t)},e.mapNotBlank=function(t,e){if(!1===t||null==t||""===t)return;const n=r.toS(t);return o(n)?e(n):void 0},e.firstNotBlank=function(...t){return i.toA(t).find(t=>o(t))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(8),s=n(6),o=n(41);var a=n(6);function u(t){return null==t||"object"!=typeof t?[]:Object.keys(t).filter(e=>"string"==typeof e&&(null==t.propertyIsEnumerable||t.propertyIsEnumerable(e)))}function l(t){return u(t).map(e=>t[e])}function c(t){return u(t).map(e=>[e,t[e]])}function d(t,e={}){return"object"!=typeof e&&(e={}),i.compact(t).reduce((t,[e,n])=>f(t,()=>{null!=e&&null!=n&&(t[e]=n)}),e)}function h(t){return l(t).every(t=>null!=t)}function f(t,e){return null!=e?e(t):console.dir(t,{depth:3}),t}e.map=a.map,e.emptyObj=function(t){return i.isEmpty(u(t))},e.keys=u,e.values=l,e.compactValues=function(t){const e=c(t).filter(([t,e])=>null!=t&&null!=e);return i.isEmpty(e)?void 0:d(e)},e.entries=c,e.fromEntries=d,e.mapFields=function(t,e,n={}){return d(i.compact(c(t).map(([t,n])=>e(t,n))).filter(([t,e])=>null!=t&&null!=e),n)},e.pick=function(t,...e){if(null==t)return t;if(!e.every(t=>"string"==typeof t))throw new Error("bad keys: "+JSON.stringify(e));return i.isEmpty(e)?{}:e.reduce((e,n)=>f(e,()=>s.map(t[n],t=>e[n]=t)),{})},e.pickFirst=function(t,e,n=s.defined){if(null!=t)for(const i of e)if(n(t[i]))return t[i]},e.without=function(t,...e){if(null==t||e.every(e=>r.blank(t[e])))return t;const n=c(t).filter(([t])=>!e.includes(t));return i.isEmpty(n)?void 0:d(n)},e.reqValued=h,e.reqValuedOrElse=function(t){return h(t)?t:void 0},e.onlyReqValued=function(t){return t.filter(h)},e.sortedKeys=function(t){return d(i.sortBy(c(t),([t])=>t))},e.filter=function(t,e){return null==t?t:d(c(t).filter(([t,n])=>e(t,n)))},e.tap=f,e.allKeys=function(t){const e=u(t);for(;null!=(t=Reflect.getPrototypeOf(t));)e.push(...Reflect.ownKeys(t).filter(t=>"string"==typeof t));return i.uniq(e)},e.maybeCall=function(t,e,...n){return null!=t&&o.isFunction(t[e])?t[e].bind(t)(...n):void 0},e.firstValueCaseInsensitive=function(t,e){if(r.blank(e))return;if(null!=t[e])return t[e];const n=e.toLocaleLowerCase().normalize();for(const e of u(t))if(n===e.toLocaleLowerCase().normalize()&&null!=t[e])return t[e]}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(8);var s=n(8);e.blank=s.blank,e.notBlank=s.notBlank,e.mapNotBlank=s.mapNotBlank,e.firstNotBlank=s.firstNotBlank;var o=n(5);e.compactBlanks=o.compactBlanks,e.firstNotBlankThunk=function(...t){for(const e of t)try{const t=e();if(r.notBlank(t))return t}catch(t){}throw new Error("No elements were defined")},e.firstNotBlankPromise=function(...t){return i(this,void 0,void 0,function*(){for(const e of t)try{const t=yield e();if(r.notBlank(t))return t}catch(t){}throw new Error("No elements were defined")})}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(79),s=n(16),o=n(6),a=n(17),u=n(15),l=n(61),c=n(4),d=n(10),h=n(98),f=n(26),p=n(38),m=n(7),g=n(0),y=n(13);var v=n(16);function S(t){return t instanceof Date}function w(t,e=5*s.secondMs){return m.gt0(t)&&Math.abs(Date.now()-t)<=e}function b(t,e=2){return y.leftPad(t,e,"0")}function P(t,e,n){return t<1?void 0:m.plur(t,e,n)}function E(t,e=2){if(!m.gte0(t))return a.isNumber(t)?"-"+E(Math.abs(t),e):"";const n=[P(Math.floor(t/s.dayMs),"day","days"),P(Math.floor(t/s.hourMs)%24,"hour","hours"),P(Math.floor(t/s.minuteMs)%60,"minute","minutes"),P(Math.floor(t/s.secondMs)%60,"second","seconds")],i=n.findIndex(t=>null!=t);return c.compact(n.slice(i,i+e)).join(", ")}e.dayMs=v.dayMs,e.hourMs=v.hourMs,e.minuteMs=v.minuteMs,e.secondMs=v.secondMs,e.isDate=S,e.cmpDate=function(t,e){const n=g.mapOr(t,t=>t.getTime(),0),i=g.mapOr(e,t=>t.getTime(),0);return l.cmp(n,i)},e.unixtime=function(t){const e=S(t)?t.getTime():a.isNumber(t)?t:void 0;return o.map(e,t=>Math.floor(t/1e3))},e.ago=function(t,e){return new Date(g.orElse(e,new Date).getTime()-t)},e.closeTo=function(t,e,n){return null!=t&&null!=e&&Math.abs(t.getTime()-e.getTime())<=n},e.recent=function(t,e=5*s.secondMs){return w(o.map(t,t=>f.datedToMillis(t)),e)},e.recentMs=w,e.elapsed=function(t){const e=Date.now(),n=t();return{elapsedMs:Date.now()-e,result:n}},e.elapsedAsync=function(t){return i(this,void 0,void 0,function*(){const e=Date.now(),n=yield t();return{elapsedMs:Date.now()-e,result:n}})},e.thenElapsed=function(t){return i(this,void 0,void 0,function*(){const e=Date.now(),n=yield t;return{elapsedMs:Date.now()-e,result:n}})},e.datestamp=function(t=new Date){return t.getFullYear()+"-"+b(t.getMonth()+1)+"-"+b(t.getDate())},e.datestampUTC=function(t=new Date){return t.getUTCFullYear()+"-"+b(t.getUTCMonth()+1)+"-"+b(t.getUTCDate())},e.filestampUTC=function(t=new Date){return[t.getUTCFullYear(),b(t.getUTCMonth()+1),b(t.getUTCDate()),"-",b(t.getUTCHours()),b(t.getUTCMinutes()),b(t.getUTCSeconds())].join("")},e.fmtMs=function(t,e=2){return t<10*s.secondMs?Number(t).toLocaleString()+"ms":E(t,e)},e.fmtDuration=E;const x=new Map;e.fmtIsoDate=function(t,e,n=r.DateTime.DATETIME_MED){let i=r.DateTime.fromISO(t,{setZone:!0});if(i.isValid)return d.mapNotBlank(e,t=>i=i.setLocale(t)),i.toLocaleString(n);{const n=h.DateInterval.parse(t);return null==n?t:(i=n.middle.toDateTime(),d.mapNotBlank(e,t=>i=i.setLocale(t)),i.toLocaleString(r.DateTime.DATE_MED))}},e.isoNow=function(){return(new Date).toISOString()},e.fmtShort=function(t,e="en-US"){return p.getOrSet(x,e,()=>new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"})).format(f.datedToMillis(t))};const M=/((?:19|20)\d\d)([01]\d)([0123]\d)([012]\d)([012345]\d)([012345]\d)\.(\d{6})([+-]\d{3})?/;e.wmiDate=function(t){const e=M.exec(t);if(null==e)return;const n=e.slice(1,8).map(t=>m.toInt(t));if(!c.allDefined(n))return;const[i,r,o,a,u,l,d]=n,h=m.toInt(e[8],{defaultValue:0});return new Date(Date.UTC(i,r-1,o,a,u,l,d/1e3)-h*s.minuteMs)};const _=/Date\((\d+)\)/;e.pwshJsonDate=function(t){return u.Opt(t).flatMap(t=>_.exec(t)).flatMap(t=>t[1]).flatMap(m.toInt).filter(t=>m.within(0,Date.now()+s.dayMs,t)).map(t=>new Date(t)).get()},e.MaxTzOffsetHours=14},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(45),r=n(30),s=n(22),o=n(5),a=n(8),u=n(146),l=n(9),c=n(33),d=n(18),h=n(128),f=n(129),p=n(4),m=n(3),g=n(10),y=n(29),v=n(28),S=n(7),w=n(0),b=n(23),P=n(49),E=n(138);var x;function M(t){const n=(a.blank(t)?"":t).split(r.delimiter);if(b.isWin&&a.blank(s.env.SYSTEMROOT))throw new Error("%SYSTEMROOT% is not set");return n.push(...e.DefaultPaths),o.uniq(n).filter(g.notBlank).join(r.delimiter)}function _(t){const n={};e.settingsForChildProcs().forEach(t=>t.addToEnv(n));const i=w.compactValues(Object.assign({},s.env,{ELECTRON_RUN_AS_NODE:"1",PATH:e.pathWithDefaults()},n,w.orElse(t,{})));return x.logStdout.deleteFromEnv(i),i}!function(t){t.nodeEnv=new E.StringEnumSetting({name:"nodeEnv",key:"NODE_ENV",category:E.SettingCategories.System,description:"runtime environment",defaultValue:()=>{const t=d.toS(s.env.NODE_ENV).toLowerCase();return t.startsWith("test")?"test":t.startsWith("prod")?"production":t.startsWith("dev")?"development":s.argv.some(t=>t.includes("mocha"))?"test":"production"},validValues:["development","test","production"],persisted:!1,addToChildProcs:!0}),t.electronVersion=new E.StringSetting({name:"electronVersion",key:"PS_ELECTRON_VERSION",category:E.SettingCategories.System,description:"",defaultValue:s.versions.electron,persisted:!1,addToChildProcs:!0}),t.libraryPath=new E.StringSetting({name:"libraryPath",key:"PS_LIBRARY_PATH",alternateKeys:["PS_LIBRARY"],category:E.SettingCategories.System,description:"This is the full path to your PhotoStructure library. If missing, or set to an empty string, the welcome page will be shown when PhotoStructure launches. Use native file separators.",defaultValue:"",persisted:!0,advanced:!1,addToChildProcs:!0}),t.logLevel=new E.StringSetting({name:"logLevel",key:"PS_LOG_LEVEL",alternateKeys:["PS_LOG","LOG"],category:E.SettingCategories.Logging,description:"Determines which level of log messages are emitted to log files. May be 'debug', 'info', 'warn', or 'error'.",defaultValue:"error",persisted:!0,addToChildProcs:!0}),t.logDir=new E.StringSetting({name:"logDir",key:"PS_LOG_DIR",category:E.SettingCategories.Logging,description:"Determines the directory that log files will be written to.",defaultValue:()=>"darwin"===i.platform()?v.resolve(i.homedir(),"Library","Logs",f.AppName):v.resolve(h.appData(),f.AppName,"logs"),persisted:!0,addToChildProcs:!0}),t.logColor=new E.BooleanSetting({name:"logColor",key:"PS_LOG_COLOR",category:E.SettingCategories.Logging,description:"Should log messages be colorized with ANSI escape sequences? Great for nerds, bad for everyone else.",defaultValue:!1,persisted:!0}),t.logCompression=new E.BooleanSetting({name:"logCompression",key:"PS_LOG_COMPRESS",category:E.SettingCategories.Logging,description:"Should log files be compressed as they are rotated?",defaultValue:!0,persisted:!0}),t.logWebRequests=new E.BooleanSetting({name:"logWebRequests",key:"PS_LOG_WEB_REQUESTS",category:E.SettingCategories.Logging,description:"Write an access log for all web requests?",defaultValue:!1,persisted:!0}),t.logWebDir=new E.StringSetting({name:"logWebDir",key:"PS_LOG_WEB_DIR",category:E.SettingCategories.Logging,description:"Determines the directory that log files will be written to. If unset, will use logDir.",defaultValue:"",persisted:!0,addToChildProcs:!0}),t.logSql=new E.StringSetting({name:"logSql",key:"PS_LOG_SQL",category:E.SettingCategories.Logging,description:"If non-blank, and a given db query includes the given string, the query will be logged.",defaultValue:"",persisted:!0}),t.logStdout=new E.BooleanSetting({name:"logStdout",key:"PS_LOG_STDOUT",alternateKeys:["LOG_STDOUT","PS_STDOUT"],category:E.SettingCategories.Logging,description:"Log to stdout? This should be false unless you're running a service by hand.",defaultValue:!1,persisted:!1}),t.minDiskFreeGb=new E.IntegerSetting({name:"minDiskFreeGb",key:"PS_MIN_DISK_FREE_GB",category:E.SettingCategories.System,description:"PhotoStructure will pause processing if the GB free on the disk that your library is stored on drops below this value. The value provided here will be multiplied by 1000^3. Note that many OSes will corrupt themselves when disks fill up, and SSDs can fail as they approach full capacity. A value of less than 8 may be unsafe.",defaultValue:8,persisted:!0}),t.maxCpuPercent=new E.BoundedIntegerSetting({name:"maxCpuPercent",key:"PS_MAX_CPU_PERCENT",category:E.SettingCategories.System,description:"PhotoStructure will not schedule work if the current system utilization percent is higher than this value. This value must be between 0 and 100. Smaller values (less than 25) may mean PhotoStructure can never schedule work. A value of 100 will allow PhotoStructure to schedule work on all of your CPUs, and may make your system unusable.",defaultValue:75,min:0,max:200,persisted:!0}),t.maxMemoryMb=new E.BoundedIntegerSetting({name:"maxMemoryMb",key:"PS_MAX_MEMORY_MB",category:E.SettingCategories.System,description:"PhotoStructure will restart services if their process consumes more than this value (measured in megabytes, or 1,000,000 bytes).",defaultValue:1e3,min:512,max:8e3,persisted:!0}),t.dbCacheSizeMb=new E.IntegerSetting({name:"dbCacheSizeMb",key:"PS_DB_CACHE_SIZE_MB",category:E.SettingCategories.System,description:"PhotoStructure uses SQLite, and the cache_size pragma should ideally be set such that the whole DB can be in memory. See https://sqlite.org/pragma.html#pragma_cache_size for more information.",defaultValue:128,persisted:!0}),t.vlcPath=new E.StringSetting({name:"vlcPath",key:"PS_VLC_PATH",category:E.SettingCategories.Tools,description:'This should be the absolute, native path to the "vlc" binary on this system. If this is set to "vlc", PhotoStructure will search your $PATH.',defaultValue:"vlc",persisted:!0}),t.ffmpegPath=new E.StringSetting({name:"ffmpegPath",key:"PS_FFMPEG_PATH",category:E.SettingCategories.Tools,description:'This should be the absolute, native path to the "ffmpeg" binary on this system. If this is set to "ffmpeg", PhotoStructure will search your $PATH.',defaultValue:"ffmpeg",persisted:!0}),t.updateChannel=new E.StringEnumSetting({name:"updateChannel",key:"PS_UPDATE_CHANNEL",category:E.SettingCategories.Updates,description:'TL:DR; keep this on "latest." This controls which builds of PhotoStructure you are eligible to automatically update to. Please note that "alpha" builds may not even launch, and "beta" builds will not have been thoroughly tested. Please only consider changing this if customer support asks you to.',defaultValue:"latest",validValues:["alpha","beta","latest"],persisted:!0}),t.allowDowngrade=new E.BooleanSetting({name:"allowDowngrade",key:"PS_ALLOW_DOWNGRADE",category:E.SettingCategories.Updates,description:"If you're running an alpha or beta build, and you switch back to 'updateChannel = \"latest\"', would you like PhotoStructure to downgrade you? Note that enabling this may make your library unreadable, if the current stable version of PhotoStructure can't read new alpha or beta database schemas.",defaultValue:!1,persisted:!0}),t.updateOnLaunch=new E.BooleanSetting({name:"updateOnLaunch",key:"PS_UPDATE_ON_LAUNCH",category:E.SettingCategories.Updates,description:"If true, PhotoStructure will check for updates automatically on launch.",defaultValue:!0,persisted:!0}),t.updateCheckMinutes=new E.IntegerSetting({name:"updateCheckMinutes",key:"PS_UPDATE_CHECK_MINUTES",category:E.SettingCategories.Updates,description:"While running, PhotoStructure will check periodically for updates. The default is daily.",defaultValue:1440,persisted:!0}),t.reportErrors=new E.BooleanSetting({name:"reportErrors",key:"PS_REPORT_ERRORS",category:E.SettingCategories.ErrorReporting,description:"If true, PhotoStructure will send crash reports when it encounters errors. Crash reports may include the path to the file that caused an error, system metadata, and recent log messages.",defaultValue:!0,advanced:!1,persisted:!0}),t.maxErrorsPerDay=new E.IntegerSetting({name:"maxErrorsPerDay",key:"PS_MAX_ERRORS_PER_DAY",category:E.SettingCategories.ErrorReporting,description:"Set this to zero to remove all bugs in PhotoStructure.\n\nHUR HUR #DADJOKE\n\nIf your system generates more than this number of errors in the course of a day, the subsequent error reports will not be reported.",defaultValue:3,persisted:!0}),t.email=new E.StringSetting({name:"email",key:"PS_EMAIL",category:E.SettingCategories.ErrorReporting,description:"If set, this email will be added to error reports, so we can contact you to help debug the issue. It is not required.",defaultValue:"",advanced:!1,persisted:!0}),t.inspect=new E.BooleanSetting({name:"inspect",key:"PS_INSPECT",category:E.SettingCategories.System,description:"Should processes run with --inspect? This should only be enabled temporarily, as it impacts both performance and security.",defaultValue:!1,persisted:!0}),t.rpcPort=new E.IntegerSetting({name:"rpcPort",key:"PS_RPC_PORT",category:E.SettingCategories.Web,description:"Network port for rpc access to your PhotoStructure library. Only binds to loopback (even if exposeNetworkWithoutAuth is true).",defaultValue:1807,persisted:!0,addToChildProcs:!0}),t.httpPort=new E.IntegerSetting({name:"httpPort",key:"PS_HTTP_PORT",category:E.SettingCategories.Web,description:"Network port for HTTP access to your PhotoStructure library.",defaultValue:1787,persisted:!0,addToChildProcs:!0}),t.sessionTimeoutHours=new E.BoundedIntegerSetting({name:"sessionTimeoutHours",key:"PS_SESSION_TIMEOUT_HOURS",category:E.SettingCategories.Web,description:"How long should unused HTTP sessions exist before requiring visitors to log back in? This defaults to 180 days, just to maximize convenience.",defaultValue:4320,max:8760,min:1,persisted:!0}),t.exposeNetworkWithoutAuth=new E.BooleanSetting({name:"exposeNetworkWithoutAuth",key:"PS_EXPOSE_NETWORK_WITHOUT_AUTH",category:E.SettingCategories.Web,description:"Normally the web service is bound to loopback, so your PhotoStructure library is only accessible to this machine. Setting this to true will expose your library to all computers on your network (if they know your PhotoStructure port). You should own or trust all systems on that network, as there is no auth in PhotoStructure currently. Future versions of PhotoStructure will add authorization mechanisms, at which point this setting will be deleted.\n\n** Don't enable this unless you know what you're doing. **",defaultValue:!1,persisted:!0}),t.copyAssetsToLibrary=new E.BooleanSetting({name:"copyAssetsToLibrary",key:"PS_COPY_ASSETS",category:E.SettingCategories.Sync,description:"Should PhotoStructure copy photos and videos to your PhotoStructure Library?",defaultValue:!0,advanced:!1,persisted:!0}),t.scanAllDrives=new E.BooleanSetting({name:"scanAllDrives",key:"PS_SCAN_ALL_DRIVES",category:E.SettingCategories.Sync,description:"Should PhotoStructure scan all folders on all drives available to this computer for photos and videos?",defaultValue:!0,advanced:!1,persisted:!0}),t.scanMyPictures=new E.BooleanSetting({name:"scanMyPictures",key:"PS_SCAN_MY_PICTURES",category:E.SettingCategories.Sync,description:"Should PhotoStructure only scan your system's 'Pictures' folder for photos and videos?",defaultValue:!t.scanAllDrives.defaultValue,advanced:!1,persisted:!0}),t.scanPaths=new E.StringArraySetting({name:"scanPaths",key:"PS_SCAN_PATHS",category:E.SettingCategories.Sync,description:"This holds an array of full native paths to scan for assets.",advanced:!1,persisted:!0}),t.assetSubdirectoryDatestampFormat=new E.StringSetting({name:"assetSubdirectoryDatestampFormat",key:"PS_ASSET_SUBDIR_FORMAT",category:E.SettingCategories.Sync,description:"If you chose to copy assets into your library, they will be copied into <library directory>/<result of this pattern>/<original imagename>.\nSee <https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html#instance-method-toFormat> and <https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens>.",defaultValue:"y/y-MM-dd",persisted:!0}),t.validateJpegImages=new E.BooleanSetting({name:"validateJpegImages",key:"PS_VALIDATE_JPEG_IMAGES",category:E.SettingCategories.Sync,description:"Should JPEG photos be validated before importing? If a JPEG has any decoding errors, and this setting is true, that file will not be imported into your library. Enabling this feature slows down imports.",defaultValue:!0,advanced:!1,persisted:!0}),t.validateRawImages=new E.BooleanSetting({name:"validateRawImages",key:"PS_VALIDATE_RAW_IMAGES",category:E.SettingCategories.Sync,description:"Should raw-format images (like NEF, CR2, ARW, and ORF) be validated before importing? If an image has any decoding errors, and this setting is true, that file will not be imported into your library. Enabling this feature slows down imports.",defaultValue:!0,advanced:!1,persisted:!0}),t.validateVideos=new E.BooleanSetting({name:"validateVideos",key:"PS_VALIDATE_VIDEOS",category:E.SettingCategories.Sync,description:'Should videos be validated before importing? If a video has any decoding errors, and this setting is true, that file will not be imported into your library. Enabling this feature dramatically slows down imports, as videos must be "played" to be validated. Note that if you set transcodeVideos to true, this setting is effectively true for all videos that aren\'t MP4-encoded.',defaultValue:!1,advanced:!1,persisted:!0}),t.transcodeVideos=new E.BooleanSetting({name:"transcodeVideos",key:"PS_TRANSCODE_VIDEOS",category:E.SettingCategories.Sync,description:"Should videos be transcoded during import? VLC must be installed. Note that this dramatically slows down imports, and *dramatically* increases the disk space your library will need to use. If this is set to false, though, your browser will not be able to render your videos unless they are already MP4-encoded.",defaultValue:!0,persisted:!0}),t.squareThumbStrategy=new E.StringEnumSetting({name:"squareThumbStrategy",key:"PS_SQUARE_THUMB_STRATEGY",category:E.SettingCategories.Sync,description:'When PhotoStructure crops images and videos to square thumbnails, it needs to crop non-square images to a square. The default, "attention," focuses on faces and higher image energy, but is more expensive than simply cropping to the center of the image (which is faster, but will mean less-nice cropping, where faces are chopped in half). More details are available here: https://sharp.dimens.io/en/stable/api-resize/',defaultValue:"attention",validValues:["center","entropy","attention"],persisted:!0}),t.sharpen=new E.BooleanSetting({name:"sharpen",key:"PS_SHARPEN",category:E.SettingCategories.Sync,description:'Should previews be sharpened? This can make the images "pop" a bit more, but almost doubles the time it takes to make the thumbnails.',defaultValue:!1,persisted:!0}),t.progressive=new E.BooleanSetting({name:"progressive",key:"PS_PROGRESSIVE",category:E.SettingCategories.Sync,description:"Should preview JPEGs be progressively encoded? If set, syncs will take a bit longer, but FHD/QHD/UHD previews will be smaller.",defaultValue:!0,persisted:!0}),t.previewResolutions=new E.StringEnumsSetting({name:"previewResolutions",key:"PS_PREVIEW_RESOLUTIONS",category:E.SettingCategories.Sync,description:"This controls the resolutions that PhotoStructure creates for every asset. Note that resolutions will be skipped if there already is a preview value with 2.5x the megapixels, so even though there are a lot of sizes here, you'll only see 3-4 images on your disk per asset.",defaultValue:p.exclude(u.FitSizeValues,["uhd8k","uhd5k"]),validValues:u.FitSizeValues,persisted:!0}),t.statTimeoutSeconds=new E.BoundedIntegerSetting({name:"statTimeoutSeconds",key:"PS_STAT_TIMEOUT_SECONDS",category:E.SettingCategories.Sync,description:'Filesystem traversal can be dangerous business with scratched CDROMs and old busted hard drives. To prevent PhotoStructure from getting "stuck" when trying to read these devices, it will timeout directory iteration if reading a directory entry exceeds this value. The default of 30 seconds should cover most issues with spun-down hard drives and NAS/WAN latency.',defaultValue:30,min:1,max:300,persisted:!0}),t.minFileSizeBytes=new E.IntegerSetting({name:"minFileSizeBytes",key:"PS_MIN_ASSET_SIZE",category:E.SettingCategories.Sync,description:"What's the minimum photo or video size you want imported into your library? (This can prevent small GIFs and screenshots from being imported).",defaultValue:50*S.KB,persisted:!0}),t.maxFileSizeBytes=new E.IntegerSetting({name:"maxFileSizeBytes",key:"PS_MAX_ASSET_SIZE",category:E.SettingCategories.Sync,description:"What's the maximum photo or video size you want imported into your library? (This can prevent movies from being pulled into and filling up your library)",defaultValue:.5*S.GB,persisted:!0}),t.minImageDimension=new E.IntegerSetting({name:"minImageDimension",key:"PS_MIN_IMAGE_DIMENSION",category:E.SettingCategories.Sync,description:"What's the minimum number of pixels an image's dimensions must meet or exceed to be imported? Note that this value is applied to both the height and width of the image. The default comes from the VGA standard of 640x480.",defaultValue:480,persisted:!0}),t.minVideoDimension=new E.IntegerSetting({name:"minVideoDimension",key:"PS_MIN_VIDEO_DIMENSION",category:E.SettingCategories.Sync,description:"What's the minimum number of pixels a video's dimensions must meet or exceed to be imported? Note that this value is applied to both the height and width of the video. The default comes from the QVGA standard of 320x240.",defaultValue:240,persisted:!0}),t.neverIgnored=new E.StringArraySetting({name:"neverIgnored",key:"PS_NEVER_IGNORED",category:E.SettingCategories.Sync,description:"Paths to files or directories that should not be ignored, even if they are hidden or have .nomedia files.",persisted:!0}),t.startPaused=new E.BooleanSetting({name:"startPaused",key:"PS_START_PAUSED",category:E.SettingCategories.Sync,description:"Should processing be paused by default when PhotoStructure starts? You'll have the manually resume processing via the system tray menu.",defaultValue:!1,persisted:!0}),t.syncIntervalHours=new E.BoundedIntegerSetting({name:"syncIntervalHours",key:"PS_SYNC_INTERVAL_HOURS",category:E.SettingCategories.Sync,description:"This value controls both how often the sync process runs, and how often new files are discovered and imported. WARNING: Setting this value to a small value (say, less than 10) will mean PhotoStructure is constantly scanning your disks, which may reduce the lifespan of your storage media. Note that setting this and fileSyncIntervalHours to 0 will disable automatic scheduling of the sync process. This defaults to every day (to balance picking up new files automatically and trying to avoid unnecessary wear and tear on your storage media).",defaultValue:24,max:504,min:0,persisted:!0}),t.fileSyncIntervalHours=new E.BoundedIntegerSetting({name:"fileSyncIntervalHours",key:"PS_FILE_SYNC_INTERVAL_HOURS",category:E.SettingCategories.Sync,description:"This value controls how often the files in your library are checked for changes. The `syncIntervalHours` setting, in contrast, controls how often *new* files are discovered. This defaults to every week (to try to balance picking up changes with wear and tear on your storage media)",defaultValue:168,max:1344,min:0,persisted:!0}),t.forceSync=new E.BooleanSetting({name:"forceSync",key:"PS_FORCE_SYNC",category:E.SettingCategories.Sync,description:"When set, all files will be visited, even if the asset seems in sync with the filesystem",defaultValue:!1,persisted:!1}),t.defaultSidecarType=new E.StringEnumSetting({name:"defaultSidecarType",key:"PS_DEFAULT_SIDECAR_TYPE",category:E.SettingCategories.Sync,description:"What type of sidecar file do you want to generate for non-destructive edits?",defaultValue:"XMP",validValues:c.strEnumValues(P.SidecarExtsEnum),persisted:!0}),t.writeMetadataToSidecars=new E.BooleanSetting({name:"writeMetadataToSidecars",key:"PS_WRITE_METADATA_TO_SIDECARS",category:E.SettingCategories.Sync,description:"Should changes made through the UI, like rotations, captions, and keywords, be written to a sidecar (which will be created if missing), or should metadata be saved to a copy of the original?",defaultValue:!0,persisted:!0})}(x=e.Settings||(e.Settings={})),e.envSuggestedPathsKey="SUGGESTED_PATHS",e.envSkipFiltersKey="PS_SKIP_FILTERS",e.envSkipFilters=y.truthy(s.env[e.envSkipFiltersKey]),e.DefaultPaths=Object.freeze(b.isWin?[s.env.SYSTEMROOT,r.join(s.env.SYSTEMROOT,"System32"),r.join(s.env.SYSTEMROOT,"System32","webm")]:["/usr/local/sbin","/usr/local/bin","/usr/sbin","/usr/bin","/sbin","/bin"]),e.withDefaultPaths=M,e.pathWithDefaults=m.lazy(()=>M(s.env.PATH)),e.persistedSystemSettings=m.lazy(()=>l.values(x).filter(t=>t.opts.persisted&&E.SystemCategories.includes(t.category))),e.persistedLibrarySettings=m.lazy(()=>l.values(x).filter(t=>t.opts.persisted&&E.LibraryCategories.includes(t.category))),e.settingsForChildProcs=m.lazy(()=>l.values(x).filter(t=>t.addToChildProcs)),e.psenv=function(){const t=l.values(x).map(t=>t.key);return l.sortedKeys(l.filter(s.env,e=>"nodeEnv"===e||t.includes(e)))},e.childEnv=_,e.spawnOptions=function(t){const e=w.orElse(t,{});return Object.assign({},e,{env:_(e.env),detached:!1,shell:!1})};const T=x.nodeEnv.valueOrDefault;x.nodeEnv.value=T,x.nodeEnv.addToEnv(),e.isDev="development"===T,e.isTest="test"===T,e.isProd="production"===T},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(4),r=n(10),s=n(7),o=n(0),a=n(19),u=n(181);e.isString=function(t){return"string"==typeof t};const l={};function c(t,e){if(e<1)return"";for(null==l[t]&&(l[t]=t);e>l[t].length;)l[t]+=t;return l[t].substring(0,e)}function d(t,e){return t=a.toS(t),e=a.toS(e),t.startsWith(e)?t:e+t}function h(t){return t.sort((t,e)=>t.valueOf().localeCompare(e.valueOf()))}e.leftPad=function t(e,n,i){if("number"==typeof e&&e<0)return"-"+t(String(-e),n-1,i);const r=String(e);return c(i,n-r.length)+r},e.padding=c,e.padReplace=function(t,e,n,i){return t.substr(0,e)+c(i,n)+t.substr(e+n)},e.contains=function(t,e,n){return a.toS(t).indexOf(a.toS(e),n)>-1},e.count=function t(e,n,i=0){if(null==n||0===n.length)return 0;const r=e.indexOf(n,i);return-1===r?0:1+t(e,n,r+n.length)},e.replaceAll=function(t,e,n){return t.split(e).join(n)},e.maybeToS=function(t){return null==t?void 0:String(t)},e.mapParse=function(t,e){if(r.notBlank(t))try{return e(JSON.parse(t))}catch(t){}},e.trim=function(t){return t.map(a.toS).filter(t=>r.notBlank(t))},e.splitEvery=function(t,e,n){const i=Math.min(Math.ceil(t.length/e),o.orElse(n,()=>t.length))-1;return i<=0?[t]:[...s.times(i,n=>t.slice(n*e,(n+1)*e)),t.slice(i*e)]},e.stripPrefix=function(t,e){const n=a.toS(t),i=a.toS(e);return i.length>0&&n.startsWith(i)?n.slice(i.length):n},e.stripSuffix=function(t,e){const n=a.toS(t),i=a.toS(e);return i.length>0&&n.endsWith(i)?n.slice(0,-i.length):n},e.stripPreSuff=function(t,e,n){return(t=a.toS(t)).endsWith(n)&&t.startsWith(e)?t.slice(e.length,-n.length):t},e.ensurePrefix=d,e.ensureSuffix=function(t,e){return t=a.toS(t),e=a.toS(e),t.endsWith(e)?t:t+e},e.ellipsize=function(t,e=80){if(null==t)return"";const n=a.toS(t);return n.length<=e?n:n.slice(0,e-1)+"…"},e.gist=function(t,e=80,n=80){const i=a.toS(t),r=i.length-(e+n);return r<=0?i:i.slice(0,e).trim()+" …(+"+r+" chars)…"+i.slice(-n).trim()},e.capitalize=function(t){return r.blank(t)?t:t.charAt(0).toUpperCase()+t.slice(1)},e.equalsIgnoreCase=function(t,e){return null!=t&&null!=e&&a.toS(t).toLowerCase()===a.toS(e).toLowerCase()},e.startsWithIgnoreCase=function(t,e){return null!=t&&null!=e&&t.toLowerCase().normalize().startsWith(e.toLowerCase().normalize())},e.includesIgnoreCase=function(t,e){const n=a.toS(e).trim().toLowerCase().normalize();return!i.isEmpty(t)&&0!==n.length&&t.map(t=>a.toS(t).trim().toLowerCase().normalize()).filter(r.notBlank).some(t=>n.includes(t))},e.reverse=function(t){return null==t?t:t.split("").reverse().join("")},e.localeSort=h,e.sortChars=function(t){return h(t.split("")).join("")},e.longestPrefix=function(t,e){return i.greatestBy(e.filter(e=>t.startsWith(e)),t=>t.length)},e.stripAnsiEsc=function(t){return a.toS(t).replace(/\u001b\[[0-9;]+[a-z]/gi,"")};const f=/[\r\n]/;e.wrap=function t(e,n={maxLineLen:75,prefix:""}){if(e.includes("\n"))return i.flatten(e.split(f).map(e=>t(e,n)));if((e=d(a.toS(e).trim(),n.prefix)).length<=n.maxLineLen)return[e.trim()];const r=e.slice(0,n.maxLineLen+1).replace(/[\s-]/g," ").lastIndexOf(" "),s=r<=1?n.maxLineLen-(n.prefix.length+2):r;return[e.slice(0,s+1).trim(),...t(e.slice(s+1),n)]};const p=[[/[‘’]/g,"'"],[/[“”„«»”〃]/g,'"']];function m(t){return p.reduce((t,[e,n])=>t.replace(e,n),t).normalize()}e.dumbquote=m;const g=/^(['"]).+\1$/;e.stripQuotes=function(t){return r.blank(t)?t:(t=a.toS(t).trim(),null!=g.exec(m(t))&&(t=t.slice(1,-1).trim()),t)},e.wbrPath=function(t){return t.split(/(?<=[\\\/_,:=-]+)/).map(t=>u.escape(t.normalize())).join("<wbr>")},e.escapeRegExp=function(t){return a.toS(t).replace(/[?.()[\]{}*^+|$]/g,"\\$&")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=new(n(182).EventEmitter);i.setMaxListeners(50),e.eventEmitter=i,e.emitBoom=function(){e.eventEmitter.emit("boom")},e.onBoom=function(t){e.eventEmitter.on("boom",t)},e.emitIdle=function(){e.eventEmitter.emit("idle")},e.onIdle=function(t){e.eventEmitter.on("idle",t)},e.emitPause=function(){e.eventEmitter.emit("pause")},e.onPause=function(t){e.eventEmitter.on("pause",t)},e.emitResume=function(){e.eventEmitter.emit("resume")},e.onResume=function(t){e.eventEmitter.on("resume",t)},e.emitBeforeExit=function(t,n){e.eventEmitter.emit("beforeExit",{reason:t,status:n})},e.onBeforeExit=function(t){e.eventEmitter.on("beforeExit",({reason:e,status:n})=>t(e,n))},e.emitClearCache=function(){e.eventEmitter.emit("clearCache")},e.onClearCache=function(t){e.eventEmitter.on("clearCache",t)},e.emitFileChanged=function(t){e.eventEmitter.emit("fileChanged",t)},e.onFileChanged=function(t){e.eventEmitter.on("fileChanged",t)},e.emitFocus=function(t,n){e.eventEmitter.emit("focus",t,n)},e.onFocus=function(t){e.eventEmitter.on("focus",t)},e.emitFatal=function(t,n){e.eventEmitter.emit("fatal",{message:t,error:n})},e.onFatal=function(t){e.eventEmitter.on("fatal",({message:e,error:n})=>t(e,n))},e.emitNonFatal=function(t,n){e.eventEmitter.emit("nonFatal",{message:t,error:n})},e.onNonFatal=function(t){e.eventEmitter.on("nonFatal",({message:e,error:n})=>t(e,n))},e.emitRpcServerChange=function(){e.eventEmitter.emit("rpcServerChange")},e.onRpcServerChange=function(t){e.eventEmitter.on("rpcServerChange",t)},e.readyToUpdate=!1,e.emitReadyToUpdate=function(){e.readyToUpdate=!0,e.eventEmitter.emit("readyToUpdate")},e.onReadyToUpdate=function(t){e.eventEmitter.on("readyToUpdate",t)},e.emitUpdateNow=function(){e.eventEmitter.emit("updateNow")},e.onUpdateNow=function(t){e.eventEmitter.on("updateNow",t)},e.emitVolumesChanged=function(){e.eventEmitter.emit("volumesChanged")},e.onVolumesChanged=function(t){e.eventEmitter.on("volumesChanged",t)}},function(t,e,n){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.isDefined=!1,t.isEmpty=!0,t.get=function(){},t.exists=()=>!1;const e=()=>t;t.map=e,t.flatMap=e,t.filter=e,t.forEach=e,t.getOrElse=function(t){return t()},t.orElse=function(t){return s(t())},t.zip1=e,t.zip2=e,t.zip3=e}(i||(i={})),e.None=i;class r{constructor(t){this.a=t,this.isDefined=!0,this.isEmpty=!1}get(){return this.a}exists(t){return t(this.a)}map(t){return new r(t(this.a))}flatMap(t){const e=t(this.a);return o(e)?e:s(e)}filter(t){return s(t(this.a)?this.a:void 0)}forEach(t){return t(this.a),this}getOrElse(t){return this.a}orElse(t){return this}zip1(t,e){return s(t).flatMap(t=>e(this.a,t))}zip2(t,e,n){return s(t).flatMap(t=>s(e).flatMap(e=>n(this.a,t,e)))}zip3(t,e,n,i){return s(t).flatMap(t=>s(e).flatMap(e=>s(n).flatMap(n=>i(this.a,t,e,n))))}}function s(t){return o(t)?t:null!=t?new r(t):e.None}function o(t){return t instanceof r||t===e.None}e.Some=r,e.Opt=s,e.isOpt=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(55),r=n(15);e.secondMs=1e3,e.minuteMs=60*e.secondMs,e.hourMs=60*e.minuteMs,e.dayMs=24*e.hourMs,e.weekMs=7*e.dayMs;const s=i.lazy(()=>new Intl.DateTimeFormat(void 0,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}));e.fmtDateShort=function(t){return r.Opt(t).flatMap(t=>t instanceof Date?t.getTime():t).map(t=>s().format(t)).get()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(8),r=n(6),s=n(15),o=n(18);function a(t){return"number"==typeof t&&isFinite(t)}function u(t,e){return a(t)?e(t):void 0}function l(t){return p(t,t=>{const e=Math.trunc(t);return 0===e?Math.abs(e):e})}function c(t,e){if(i.blank(t))return e.defaultValue;if(a(t))return e.nton(t);try{const n=e.ston(o.toS(t));return a(n)?e.nton(n):e.defaultValue}catch(t){return e.defaultValue}}function d(t,e){return c(t,Object.assign({defaultValue:void 0,nton:t=>l(t),ston:parseInt},e))}function h(t){return a(t)&&t>0}function f(t,e){return s.Opt(t).flatMap(t=>d(t)).flatMap(e).get()}function p(t,e){return s.Opt(t).filter(a).flatMap(e).get()}function m(t){return t<0?-Math.round(-t):Math.round(t)}function g(t,e){if(null==t)return 0;const n=Math.pow(10,e);return m(t*n)/n}e.isNumber=a,e.mapFinite=u,e.trunc=l,e.toInt=d,e.toFloat=function(t,e){return c(t,Object.assign({defaultValue:void 0,nton:t=>t,ston:parseFloat},e))},e.toGt0=function(t){const e=d(t);return null!=e&&e>0?e:void 0},e.gt0=h,e.gte0=function(t){return a(t)&&t>=0},e.mapInt=f,e.id=function(t){const e=d(t);return h(e)?String(e):void 0},e.mapIntOr=function(t,e,n){return r.orElse(f(t,e),n)},e.mapNumeric=p,e.round=m,e.toPrecisionMaybe=function(t,e){return u(t,t=>g(t,e))},e.toFixed=function(t,e){try{return p(t,t=>parseInt(t.toFixed(e)))}catch(t){return}},e.toPrecision=g,e.sigFigs=function(t,e){if(0===t||0===e)return 0;const n=Math.pow(10,e-m(Math.ceil(Math.log10(Math.abs(t)))));return m(t*n)/n},e.base2Ceil=function(t){return Math.pow(2,Math.ceil(Math.log2(t)))},e.base10Ceil=function(t){return Math.pow(10,Math.ceil(Math.log10(t)))},e.clamp=function(t,e,n){return a(n)?([t,e]=[Math.min(t,e),Math.max(t,e)],Math.max(t,Math.min(n,e))):m((t+e)/2)},e.times=function(t,e){if(!a(t))return[];const n=Math.round(t);return n<=0?[]:[...Array(n)].map((t,n)=>e(n))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toS=function t(e){return null==e?"":"string"==typeof e?e:Array.isArray(e)?e.map(t).join(","):e.toString()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(18);e.toS=i.toS},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(186),s=n(22),o=n(35),a=n(9),u=n(36),l=n(37),c=n(3),d=n(2),h=n(11),f=n(25),p=n(54),m=n(1),g=n(7),y=n(0),v=n(81),S=n(23),w=n(12),b=n(13),P=n(19),E=c.lazy(()=>m.mkLogger("ChildProcess"));function x(t){return a.pick(t,"pid","killed","connected","exitCode","signalCode")}function M(t,e,n){const r=new Date;let a=!1;return t.on("exit",()=>a=!0),o.setTimeout(()=>i(this,void 0,void 0,function*(){if(a)return;yield d.until(()=>g.gt0(t.pid),h.secondMs);const i=t.pid;return g.gt0(i)?v.addPid({pid:i,cmd:e,maxAgeMs:n,ppid:s.pid},r):void E().warn("newProc(): not writing pidfile, child_process has no pid",{cmd:e,cp:x(t)})}),S.isWin?500:250),t}function _(t,e,n,i){return M(r.execFile(t,e,w.spawnOptions(i)),t,n)}function T(t,e,n){return i(this,void 0,void 0,function*(){const i=y.orElse(n.quiet,!1),r=y.orElse(n.ignoreStderr,!1),s=y.orElse(n.ignoreExitCode,!1);let a="";E().debug("stdoutResult(): execFile",{cmd:t,args:e,opts:n});const l=yield _(t,e,n.timeout,y.without(n,"timeout","quiet","disconnect","ignoreStderr","ignoreExitCode"));if(!0===n.disconnect)return l.disconnect(),{result:"",pid:l.pid};const c=JSON.stringify({cmd:t,args:e}),d=new u.Deferred(c);o.setTimeout(()=>{d.pending&&E().warn("stdoutResult(): SLOW COMMAND",{cmd:t,args:e})},n.timeout/3).unref(),d.setTimeout(n.timeout);const h=(r,s)=>{f.isIgnorableError(s)||(null!=l.pid&&O(l),i||E().warn("stdoutResult(): "+r,{cmd:t,args:e,opts:n,error:s}),d.pending&&d.reject(s))};try{l.on("error",t=>h("on(error)",t)),l.on("close",n=>{const r=Date.now()-d.start,o=0!==n?"warn":r<1e3?"trace":r<3e3?"debug":"info";i||E().log(o,"stdoutResult(): on(close)",{cmd:t,code:n,args:e,elapsed:r,result:b.gist(a,160,160)}),s||0===n?d.resolve({result:a,code:n,pid:l.pid}):d.reject(new Error("non-zero exit code: "+JSON.stringify({code:n,cmd:t,args:e})))}),l.stdin.end(),l.stdout.on("data",t=>y.map(t,t=>{a+=t.toString()})),l.stderr.on("error",t=>h("stderr(error)",t)),l.stderr.on("data",t=>r?E().warn("stdoutResult(): stderr(data): "+P.toS(t)):h("stderr(data)",t))}catch(t){h("try/catch",t)}return d.promise})}function O(t,e=30*h.secondMs){return i(this,void 0,void 0,function*(){if(null==t)return!1;const n=t.pid;if(E().debug("endProcess("+n+")",{killed:t.killed,connected:t.connected}),!t.killed){if(n<=0)return E().warn("endProcess(): asked to end invalid pid",x(t)),!1;if(n===s.pid)return E().warn("endProcess(): asked to end MY pid",x(t)),!1;y.Try(()=>t.kill())}return yield l.delay(250),yield p.closeStreams(t),t.connected&&y.Try(()=>t.disconnect()),y.Try(()=>t.unref()),(yield k(n,e))?(E().debug("endProcess(): exitted",x(t)),!0):(yield v.kill(n,!0).catch(t=>{E().warn("endProcess(): kill("+n+",true) failed: "+t)}),k(n,5e3))})}function k(t,e){return d.until(()=>d.thenNot(v.pidExists(t)),e)}e.spawn=function(t,e,n,i){return E().debug("spawn()",{command:t,args:e,maxAgeMs:n,options:i}),M(r.spawn(t,e,w.spawnOptions(i)),t,n)},e.execFile=_,e.stdout=function(t,e,n){return T(t,e,n).then(t=>t.result)},e.stdoutResult=T,e.endProcess=O,e.waitForExit=k},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(9),s=n(33),o=n(4),a=n(72),u=n(11),l=n(14),c=n(1),d=n(73),h=n(7),f=n(0),p=n(12),m=n(3),g=n(2),y=n(50),v=m.lazy(()=>c.mkSafeLogger(a.red("Endable")));e.EndableWrapper=class{constructor(t,e,n){this.name=t,this._onEnd=e,this._isEnded=n,this._ended=!1}get ended(){return f.mapOr(this._isEnded,t=>t(),()=>!1)||this._ended}end(){return this._ended=!0,this._onEnd()}};const S=new d.MultiMap;y.setUnrefInterval(()=>M(),1*u.minuteMs);const w=new Map,b=5*u.secondMs;function P(t,e){return S.add(t,e),e}e.EndableRanks=s.strEnum("first","service","cleanup","db","logger"),e.addFirstEndable=function(t){return P(e.EndableRanks.first,t)},w.set(e.EndableRanks.first,5*u.secondMs),e.addServiceEndable=function(t){return P(e.EndableRanks.service,t)},e.addCleanupEndable=function(t){return P(e.EndableRanks.cleanup,t)},w.set(e.EndableRanks.cleanup,1*u.minuteMs),e.addDbEndable=function(t){return P(e.EndableRanks.db,t)},e.addLoggerEndable=function(t){return P(e.EndableRanks.logger,t)},w.set(e.EndableRanks.logger,10*u.secondMs),e.addEndable=P;let E=!1;function x(t,e=g.DefaultTryAllTimeoutMs){if(null!=t&&!t.ended)return v().debug(a.magenta(t.name+" ending...")),g.thenOrTimeout(t.end(),e,()=>v().warn(a.magenta(t.name+".end() timed out")),()=>v().debug(a.magenta(t.name+".end() completed"))).catch(e=>{v().warn(a.magenta(t.name+".end() rejected: ")+e)})}function M(){S.filterInPlace((t,e)=>!e.ended),v().debug("vacuumEndables()",S.entriesArray().map(([t,e])=>[t,e.map(t=>t.name)]))}e.ending=function(){return E},e.setEnding=function(t){if(!p.isTest)throw new Error("cannot set ending");E=t},e.end=x,l.onBeforeExit(()=>E=!0),e.endEndables=m.lazy(()=>i(this,void 0,void 0,function*(){p.isTest||(E=!0),M();for(const t of r.keys(e.EndableRanks)){const e=f.orElse(S.get(t),[]);if(o.isNotEmpty(e)){v().debug(a.magenta("endEndables(): ending "+t));const n=h.firstGt0(w.get(t),b);yield Promise.all(e.map(t=>x(t,n)))}}}))},function(t,e){t.exports=require("process")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(43),r=n(45),s=n(22),o=n(8),a=n(3),u=n(29),l=r.platform();e.inspectFlag=s.argv.includes("--inspect")||u.truthy(s.env.NODE_INSPECT),e.isWin=l.startsWith("win"),e.isWinStore=e.isWin&&u.truthy(s.windowsStore),e.isWinPortable=e.isWin&&o.notBlank(s.env.PORTABLE_EXECUTABLE_DIR),e.isMac="darwin"===l,e.isMacStore=e.isMac&&u.truthy(s.mas),e.isLinux="linux"===l,e.isLinuxAppImage=e.isLinux&&o.notBlank(s.env.APPIMAGE),e.isLinuxSnap=e.isLinux&&o.notBlank(s.env.SNAP_USER_DATA),e.isPosix=e.isMac||e.isLinux,e.isDocker=a.lazy(()=>{try{return e.isLinux&&i.readFileSync("/proc/1/cgroup").toString().includes("/docker/")}catch(t){return console.warn("isDocker: failed to read /proc/1/cgroup: "+t),!1}}),e.platformName=e.isWin?"win":e.isMac?"mac":e.isLinux?"linux":l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(16),r=n(11);e.mountpointsTtlMs=15*r.secondMs,e.dfTtlMs=5*i.minuteMs,e.cmdTimeoutMs=25*r.secondMs,e.longTtlMs=1*r.hourMs},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(8),s=n(15),o=n(21),a=n(13),u=n(19);e.asError=function(t){if(r.blank(t))throw new Error("undefined error");if(t instanceof Error)return t;if(Array.isArray(t)){const e=t[0];return e instanceof Error?(t.length>1&&(e.errors=t.slice(1)),e):new Error(t.map(t=>u.toS(t)).filter(r.notBlank).join(", "))}return new Error(u.toS(t))},e.FatalErrorFlag="¹",e.NonRetriableErrorFlag="²",e.IgnorableErrorFlag="³",e.PleaseSendErrorFlag="⁴",e.ErrorFlags=[e.FatalErrorFlag,e.NonRetriableErrorFlag,e.IgnorableErrorFlag,e.PleaseSendErrorFlag];const l=new RegExp("["+e.ErrorFlags.join("")+"]","g");function c(t){return t instanceof f?t.fatal:!h(t).includes(e.FatalErrorFlag)}function d(t){return t instanceof Error?h(t):u.toS(t)}function h(t){return null==t?h(new Error("undefined error")):r.notBlankOr(i.compactBlanks([t.name,t.message]).join(": "),u.toS(t))}e.removeErrorFlags=function(t){return t.replace(l,"")},e.hasErrorFlag=function(t){return e.ErrorFlags.some(e=>t.includes(e))},e.isFatalError=c,e.isRetriableError=function(t){return!c(t)&&!h(t).includes(e.NonRetriableErrorFlag)&&(!(t instanceof f)||t.retriable)},e.isSendableError=function(t){return h(t).includes(e.PleaseSendErrorFlag)},e.isIgnorableError=function(t){return o.ending()||!c(t)&&a.includesIgnoreCase([e.IgnorableErrorFlag,"diskutil: interrupted","net::ERR_","debugger listening on","for help","https://nodejs.org/en/docs/inspector","debugger attached"],d(t))},e.maybeErrorToS=d,e.errorToS=h,e.throws=function(t){try{return t(),!1}catch(t){return!0}},e.stack=function t(){const e={};return Error.captureStackTrace(e,t),e.stack.split(/\n(?:\s*at\s+)?/).slice(1)},e.trimErrorMessage=function(t){return u.toS(t).trim().replace(/^Error: /i,"").trim().replace(/^[0-9T\.: -]+Z? /i,"").replace(/^error /i,"").trim()},e.cleanError=function(t,e){return u.toS(t).split(/\r?\n/).map(t=>a.stripPrefix(t,e)).map(t=>t.replace(/: ?/,"")).filter(r.notBlank).join(", ")};class f extends Error{constructor({cause:t,message:n,retriable:o=!0,ignorable:l=!1,fatal:c=!1}){super(function(t,n,o,l,c){const d=[t];s.Opt(n).flatMap(t=>t.message).flatMap(t=>a.stripPrefix(t,"Error: ")).forEach(t=>d.push(t));const h=d.map(t=>u.toS(t).trim()).filter(r.notBlank).join(": "),f=[];c||o||f.push(e.NonRetriableErrorFlag);l&&!c&&f.push(e.IgnorableErrorFlag);c&&f.push(e.FatalErrorFlag);i.isNotEmpty(f)&&f.unshift(" ");return h+f.join("")}(n,t,o,l,c)),this.cause=t,this.retriable=o,this.fatal=c}}e.WrappedError=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(65),r=n(79),s=n(5),o=n(8),a=n(46),u=n(6),l=n(17),c=n(15),d=n(4),h=n(3),f=n(10),p=n(98),m=n(7),g=n(0),y=n(13),v=n(19);function S(t,e=2){return null==t?"":y.leftPad(t,e,"0")}function w(t){return null!=t&&("string"!=typeof t&&(!String(tt(t)).startsWith("1970-01-01T00:00:00")&&(!!b(V(t))&&(!!P(W(t))&&(t instanceof r.DateTime?t.isValid:E(V(t),W(t),z(t)))))))}function b(t){return m.within(e.minYear,e.maxYear,t)}function P(t){return m.within(1,12,t)}function E(t,e,n){return null!=n&&r.DateTime.fromObject({year:t,month:e,day:n}).isValid}function x(t,e,n){return b(t)&&(null==e||P(e)&&(null==n||E(t,e,n)))}e.validDate=w,e.minYear=1826,e.maxYear=(new Date).getFullYear()+2,e.validYear=b,e.validMonth=P,e.validDay=E,e.validYMD=x;class M{constructor(t,e,n){this.year=t,this.month=e,this.day=n}static for(t,e,n){return x(t,e,n)?new M(t,e,n):void 0}static localToday(){return it(new Date)}toString(){return s.compact([this.year,this.month,this.day]).map(t=>S(t)).join("-")}toISOString(){return this.toString()}toDateTime(){return r.DateTime.fromObject(this)}}e.FuzzyDate=M;class _{constructor(t,e,n,i,r){this.monthsToMonth=t,this.re=e,this.yearIndex=n,this.monthIndex=i,this.dayIndex=r}apply(t){const e=this.re.exec(t);if(null!=e){const t=parseInt(e[this.yearIndex],10),n=this.month(e),i=null==this.dayIndex?void 0:parseInt(e[this.dayIndex],10);return M.for(t,n,i)}}month(t){if(null==this.monthIndex)return;const e=t[this.monthIndex].toLowerCase();return this.monthsToMonth.has(e)?this.monthsToMonth.get(e):m.toInt(e)}}const T="((?:19|20)[0-9]{2})",O="(1[0-2]|0?[1-9])",k="([1-3][0-9]|0?[1-9])",D="([0-5][0-9])",I="([-\\.\\,:_/ |])?";function C(t,e){const n=e.exec(t);if(null==n)return;const i=[...n.slice(1)],[s,o,a,u,l,h]=i.splice(0,6).map(t=>m.toInt(t)),f=m.clamp(0,999,1e3*m.toFloat(i.shift(),{defaultValue:0})),p=$(function(t,e){if(d.isEmpty(t))return e;const[n,i]=t.splice(0,2),[r,s]=t.splice(0,2).map(t=>m.toInt(t));return y.equalsIgnoreCase(n,"z")?0:d.anyNotDefined([i,r,s])?e:("-"===i?-1:1)*(60*r+s)}(i));return c.Opt(r.DateTime.fromObject({year:s,month:o,day:a,hour:u,minute:l,second:h,millisecond:f,zone:p})).filter(t=>t.isValid).flatMap(t=>Q(t,p)).get()}const F=new RegExp([T,"(1[0-2]|0[1-9])","([1-3][0-9]|0[1-9])","(1[0-9]|2[0-3]|0[0-9])",D,D,"(?:(\\.[0-9]+))?"].join("[-:_ ]?")+"(?:(Z)|(?:([+-])([01][0-9]):?([0-5][0-9])))?","i");function A(t){return C(t,F)}function R(t,e=!0){return f.mapNotBlank(t,t=>g.firstTrueThunk([()=>p.DateInterval.parse(t),()=>i.ExifDateTime.fromEXIF(t),()=>e?i.ExifDate.fromEXIF(t):void 0,()=>A(t),()=>e?i.ExifDate.fromEXIF(t):void 0,()=>e?B().parseYMD(t):void 0],t=>w(t)))}e.parseFuzzyDatetime=A,e.dateTimeBetween=function(t,e){return t.until(e).divideEqually(2)[0].end},e.agoMs=function(t){return l.mapNumeric(Z(t),t=>Date.now()-t)},e.parseDatedWithTime=function(t){return R(t,!1)},e.parseDated=R;class L{constructor(t){this.locale=t,this.monthsToMonth=new Map,this.ymdPatterns=[],this.ymPatterns=[],this.setup()}parseYMD(t){return d.first(this.ymdPatterns,e=>e.apply(t))}addParser(t,e,n,i){const r=new _(this.monthsToMonth,new RegExp(t+"(?:$|[^\\d])","i"),e,n,i);null!=i&&null!=n?this.ymdPatterns.push(r):null!=n&&this.ymPatterns.push(r)}setup(){["short","long"].forEach(t=>{const e=new Intl.DateTimeFormat(this.locale,{month:t});m.times(12,t=>{const n=e.format(new Date(2017,t));this.monthsToMonth.set(n.toLowerCase(),t+1)})});const t="("+d.sort([...this.monthsToMonth.keys()]).join("|")+")";this.addParser(T+I+O+"\\2"+k,1,3,4),this.addParser(T+I+t+"\\2"+k,1,3,4),this.addParser(t+I+k+",?\\2"+T,4,1,3),this.addParser(k+I+t+",?\\2"+T,4,3,1),this.addParser(t+I+T,3,1),this.addParser(T+I+t,1,3)}extractDateFromPath(t){j.forEach(e=>{d.startsWith(t,e)&&t.splice(0,e.length)}),t=t.filter(e=>o.notBlank(e)&&null==t[0].match(N));const e=[...t].reverse();return g.firstThunk(()=>d.first(e,t=>this.parseYMD(t)),()=>this.parseYMD(t.join(" ")),()=>this.parseYMD(e.join(" ")),()=>d.first(this.ymPatterns,e=>e.apply(t.join(" "))),()=>d.first(this.ymPatterns,t=>t.apply(e.join(" "))))}}e.FuzzyDateParser=L;const N=/^((DCIM)|(DSC[_0F]?|IMG_|GOPRO|MOV_|P)\d+)$/i,B=h.lazy(()=>new L(void 0)),j=[];function V(t){return g.map(t,t=>t instanceof Date?t.getFullYear():t.year)}function W(t){return g.map(t,t=>t instanceof Date?t.getMonth()+1:t.month)}function z(t){return g.map(t,t=>t instanceof Date?t.getDate():t.day)}function G(t){return st(t)?t instanceof Date?t.getHours():t.hour:void 0}function q(t){return st(t)?t instanceof Date?t.getMinutes():t.minute:void 0}function U(t){return st(t)?t instanceof Date?t.getSeconds():t.second:void 0}function H(t){return st(t)?t instanceof Date?t.getMilliseconds():t.millisecond:void 0}function J(t){return g.map(U(t),e=>{const n=g.orElse(H(t),0);let i=(e+n/1e3).toString();for(e<10&&(i="0"+i),0===n&&(i+=".");i.length<6;)i+="0";return i})}function $(t){if(null==t)return;if(0===t)return"UTC";const e=t<0?"-":"+",n=15*l.round(t/15),i=Math.abs(n),r=Math.floor(i/60),s=Math.floor(Math.abs(i%60));return`UTC${e}${S(r)}:${S(s)}`}function Y(t){return!l.isNumber(t)&&(t instanceof i.ExifDateTime?null!=t.tzoffsetMinutes:t instanceof r.DateTime&&null!=t.offsetNameShort)}function K(t){return t instanceof r.DateTime?g.map(t.offsetNameShort,()=>$(t.offset)):t instanceof i.ExifDateTime?$(t.tzoffsetMinutes):void 0}function Q(t,e){const n=Z(t);if(null==n||!st(t))return;const r=o.blank(e)?Y(t)?K(t):void 0:e,s=f.mapNotBlank(r,t=>ot(n,t));return null==e||null!=s?g.map(V(t),e=>g.map(W(t),n=>g.map(z(t),r=>g.map(G(t),o=>new i.ExifDateTime(e,n,r,o,g.orElse(q(t),0),g.orElse(U(t),0),H(t),s,t.rawValue))))):void 0}function X(t){if(null==t)return;if("number"==typeof t)return new Date(t);if(t instanceof Date)return t;if(t instanceof r.DateTime)return t.toJSDate();if(t.toDate)return t.toDate();if(m.gt0(t.year)&&m.gt0(t.month)&&m.gt0(t.day))return new Date(t.year,g.orElse(t.month,1)-1,t.day,12);const e=v.toS(t);return o.notBlank(e)?g.map(et(e),X):void 0}function Z(t){if(null!=t)return l.isNumber(t)?t:t instanceof Date?t.getTime():t instanceof r.DateTime?t.toMillis():g.map(X(t),t=>t.getTime())}function tt(t,e=!0){if(t instanceof p.DateInterval)return t.toString(e);const n=l.isNumber(t)?new Date(t):t,i=nt(n);if(!st(n))return i;const r=`${S(G(n))}:${S(q(n))}:${J(n)}`,s=g.map(e&&Y(t)?K(n):void 0,t=>"UTC"===t?"Z":y.stripPrefix(t,"UTC"));return i+"T"+r+v.toS(s)}function et(t,e){return"string"!=typeof t||o.blank(t)?void 0:c.Opt(i.ExifDateTime.fromISO(t,e)).orElse(()=>i.ExifDate.fromISO(t)).orElse(()=>i.ExifTime.fromEXIF(t)).get()}function nt(t){return s.compact([V(t),W(t),z(t)]).map(t=>S(t)).join("-")}function it(t){return g.map(t,t=>g.map(V(t),e=>new M(e,W(t),z(t))))}function rt(t,e){const[n,i]=[t,e].map(Z);return null==n||null==i?void 0:n-i}function st(t){return t instanceof Date||t instanceof i.ExifDateTime||t instanceof r.DateTime}function ot(t,e){const n=r.Info.normalizeZone(e);return n.isValid?n.offset(t):void 0}e.addIgnorableSubpath=function(t){j.push(t)},e.clearIgnorableSubpaths=function(){j.length=0},e.extractDateFromPath=function(t){return B().extractDateFromPath(t)},e.parseYMD=function(t){return B().parseYMD(t)},e.isDated=function(t){return t instanceof M||t instanceof i.ExifDate||t instanceof i.ExifDateTime||t instanceof Date||t instanceof p.DateInterval||t instanceof r.DateTime},e.getYear=V,e.getMonth=W,e.getDay=z,e.getHour=G,e.getMinute=q,e.getSecond=U,e.getMillisecond=H,e.hasSeconds=function(t){return st(t)&&(m.gt0(q(t))||m.gt0(U(t))||m.gt0(H(t)))},e.getSecMs=J,e.zoneOffsetToName=$,e.hasZoneOffset=Y,e.getZoneName=K,e.toDateTime=Q,e.toDate=X,e.datedToMillis=Z,e.datedToISO=tt,e.fromISO=et,e.datedToYMD=nt,e.toFuzzyDate=it,e.sameDay=function(t,e){return a.eql(it(t),it(e))},e.diffMillis=rt,e.closeTo=function(t,e,n){return u.mapOr(rt(t,e),t=>Math.abs(t)<n,()=>!1)},e.gtDate=function(t,e){const n=Z(t),i=Z(e);return null!=n&&null!=i&&n>i},e.nowish=function(t,e=2500){const n=Z(t),i=Date.now();return m.within(i-e,i+e,n)},e.dateBetween=function(t,e,n=1,i=1){if(null==Z(t)||null==Z(e))return;const[s,o]=[t,e].map(t=>Z(t)).sort(),a=(o-s)/(i+1),u=K(t),l=u===K(e)?u:void 0,c=r.DateTime.fromMillis(s+a*n,{zone:l});return[t,e].some(t=>!st(t))?it(c):c},e.hasTime=st,e.zoneToOffset=ot},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(9),r=n(84);var s=n(9);e.tap=s.tap,e.atap=function(t,e){return r.isPromise(t)?r.thenTap(t,e):i.tap(t,e)},e.amap=function(t,e){return r.isPromise(t)?t.then(t=>e(t)):e(t)},e.awaitAll=function(t){return t.some(t=>r.isPromise(t))?Promise.all(t):t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(30),r=n(6),s=n(17),o=n(18),a=n(4),u=n(10),l=n(23),c=n(13),d=i.posix;function h(t){return i.sep===d.sep?t:d.sep===i.sep?t:t.split(i.sep).join(d.sep)}e.posix2native=function(t,e){if(i.sep===d.sep)return t;const n=u.notBlank(e)?i.sep+i.sep+e+i.sep:"",r=t.split(d.sep);return c.equalsIgnoreCase(r[0],e)&&r.unshift(),n+r.join(i.sep)},e.native2posix=h;const f=/^([A-Z]:)[\\\/]?(.*)$/i;e.resolve=function(...t){const e=i.join(...t);return i.resolve(l.isWin?function(t){const e=f.exec(t);return null!=e?e[1].toUpperCase()+"\\"+e[2]:t}(e):e)};const p=/(\.?.*?)(\.[a-z]{1,10}\.(?:gz|z|xz|bz2))$/i;function m(t){const e=p.exec(t);return null!=e&&u.notBlank(e[2])?e[2]:i.extname(t)}function g(t){return c.stripPrefix(t,i.sep).split(i.sep)}e.parse=function(t){const e=i.parse(t),n=m(e.base),r=c.stripSuffix(e.base,n);return Object.assign({},e,{ext:n,name:r})},e.extname2=m,e.containedBy=function(t,e){return u.notBlank(t)&&u.notBlank(e)&&(t===e||t.startsWith(c.ensureSuffix(e,d.sep)))},e.containedByNativePath=function(t,e){return u.notBlank(t)&&u.notBlank(e)&&(t===e||t.startsWith(c.ensureSuffix(e,i.sep)))},e.pathnames=g,e.posixPathFrom=function(t,e){return t.nativePath===e.nativePath?"":c.stripPrefix(h(e.nativePath),c.ensureSuffix(h(t.nativePath),"/"))},e.posixPathFromGrandparent=function(t){return g(t).slice(-3).join("/")};const y=/(.*?)(?:-(\d+)|\((\d+)\))$/;e.nameWithoutCount=function(t){return r.mapOr(o.toS(t).match(y),t=>t[1],()=>t)},e.countFromName=function(t){return r.map(o.toS(t).match(y),t=>a.first([t[2],t[3]],s.toInt))}},function(t,e,n){"use strict";function i(t){if("boolean"==typeof t)return t;if(null==t)return!1;const e=String(t).toLowerCase();return["true","1"].includes(e)}function r(t){if("boolean"==typeof t)return!t;if(null==t)return!1;const e=String(t).toLowerCase();return["false","0"].includes(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.isBoolean=function(t){return"boolean"==typeof t},e.truthy=i,e.toBoolean=function(t){return!!i(t)||!r(t)&&void 0},e.boolToInt=function(t){return i(t)?1:0},e.falsy=r,e.or=function(t){return t.some(t=>i(t))},e.and=function(t){return t.every(t=>i(t))}},function(t,e){t.exports=require("path")},,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(9);e.strEnum=function(...t){return Object.freeze(t.reduce((t,e)=>(t[e]=e,t),Object.create(null)))},e.strEnumValues=function(t){return i.keys(t)},e.enumHas=function(t,e){return"string"==typeof e&&t[e]===e}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(43),s=n(99),o=n(30),a=n(145),u=n(96),l=n(42),c=n(183),d=n(5),h=n(80),f=n(6),p=n(15),m=n(4),g=n(36),y=n(37),v=n(3),S=n(92),w=n(2),b=n(10),P=n(63),E=n(20),x=n(11),M=n(14),_=n(26),T=n(1),O=n(57),k=n(7),D=n(0),I=n(23),C=n(13),F=n(103),A=n(19),R=n(24),L=n(139),N=n(173),B=n(52),j=n(28),V=n(104),W=n(106),z=n(88),G=n(54),q=n(188);e.DefaultEnsureNewOptions=Object.freeze({emptyIsNew:!0,maxVersions:512,requireNumber:!1,leftPad:1,startIndex:1}),e.execDir=function(){return Y.for(process.execPath).parent()};const U=x.minuteMs,H=500;class J extends P.BoundedMap{constructor(){super(U,H,!0),M.onFileChanged(t=>this.clearFromPath(t)),M.onClearCache(()=>this.clearEntries()),this.on("expire",(t,e)=>D.map(e,t=>t.clear()))}clearEntries(){for(const t of this.values())t.clear()}clearFromPath(t){for(const e of this.values())(null==t||e.nativePath.startsWith(t))&&e.clear()}}e.FileCache=J;const $=new J;class Y{constructor(t,e){if(this.dirent=e,this.bflog=v.lazy(()=>T.mkLogger("BaseFile("+this.nativePath+")")),this.dirents=v.lazy(()=>i(this,void 0,void 0,function*(){return w.thenMap(this.directoryEntry(),t=>t.children())})),this.stat=v.lazy(()=>this.trap("stat",()=>s.stat(this.nativePath).catch(()=>void 0)),Y.attrTTL),this.statSync=v.lazy(()=>this.trapSync("statSync",()=>D.Try(()=>s.statSync(this.nativePath))),Y.attrTTL),this.executable=v.lazy(()=>this.access(s.constants.R_OK|s.constants.X_OK)),this.shaResult=v.lazy(()=>i(this,void 0,void 0,function*(){const t=yield this.size();if(0===t||null==t)return;const e=t>5*k.MiB?new V.PushProgressObserver({op:"SHA",path:this.nativePath},t):void 0;return x.elapsedAsync(()=>this.trap("sha",()=>B.fileSha(this.nativePath,{observer:e}).then(t=>t.toString("base64"))))}),Y.attrTTL),null!=e)this.nativePath=e.nativePath,this.dir=e.dir,this.base=e.base,this.name=e.name,this.ext=e.ext;else{this.nativePath=j.resolve(t),this.nativePath.startsWith("\\\\")&&(this.hostname=this.nativePath.split("\\")[2]);const e=j.parse(this.nativePath);this.dir=e.dir,this.base=e.base,this.name=e.name,this.ext=e.ext}this.posixPath=j.native2posix(this.nativePath),$.set(t,this)}[l.inspect.custom](){return{ctor:this.constructor.name,nativePath:this.nativePath}}static withFastestAccess(t){return i(this,void 0,void 0,function*(){const e=m.compact(t),n=yield Promise.all(e.map(t=>t.shaMs()));return e[m.leastIndex(n)]})}static forPosix(t){return t instanceof Y?t:this.for(C.replaceAll(t,"/",o.sep))}static forDirectoryEntry(t){return this.for(t.nativePath,t)}static for(t,e){if(t instanceof Y)return t;const n=$.get(t);if(null!=n)return n;const i=j.resolve(t);return $.getOrSet(i,()=>new Y(i,e))}static clear(t){M.emitFileChanged(t)}for(t,e){return Y.for(t,e)}clear(){return this.dirent=void 0,this.dirents.clear(),this.stat.clear(),this.statSync.clear(),this.executable.clear(),this.shaResult.clear(),this}clearThisAndParent(){return M.emitFileChanged(this.dir),this}toString(){return this.nativePath}valueOf(){return this.pathnames}eql(t){return null!=t&&this.nativePath===t.toString()}get baseWithParent(){return(this.isRoot?"":this.parent().base)+"/"+this.base}get baseWithGrandparent(){return(this.isRoot?"":this.parent().baseWithParent)+"/"+this.base}posixPathFrom(t){return j.posixPathFrom(t,this)}directoryEntry(){return i(this,void 0,void 0,function*(){if(null==this.dirent){const t=yield this.isFile(),e=yield this.isDirectory(),n=yield this.isSymbolicLink(),i={name:this.base,isFile:function(){return t},isDirectory:function(){return e},isSymbolicLink:function(){return n}};this.dirent=new N.DirectoryEntry(this.dir,i)}return this.dirent})}_child(t){return this.for(o.join(this.nativePath,t.base),t)}childNames(){return w.thenMap(this.dirents(),t=>t.map(t=>t.base))}children(t){return i(this,void 0,void 0,function*(){return w.thenMap(this.dirents(),e=>w.thenCompact(e.map(e=>i(this,void 0,void 0,function*(){return S.apply(this._child(e),t)}))))})}childFiles(t){return i(this,void 0,void 0,function*(){const e=[];for(const n of d.toA(yield this.dirents()))if(n.isFile()){const i=this._child(n);(null==t||t(i))&&e.push(i)}return e})}childDirectories(t){return i(this,void 0,void 0,function*(){return w.thenMap(this.dirents(),e=>w.thenCompact(e.filter(t=>t.isDirectory()).map(e=>i(this,void 0,void 0,function*(){return S.apply(this._child(e),t)}))))})}childrenSync(){return D.orElse(this.trapSync("childrenSync",()=>r.readdirSync(this.nativePath).map(t=>this.join(t))),[])}hasChildren(t){return i(this,void 0,void 0,function*(){const e=yield this.childNames();return m.isNotEmpty(t)?d.includesAll(e,t):m.isNotEmpty(e)})}hasNoChildren(){return i(this,void 0,void 0,function*(){return(yield this.isFile())||m.isEmpty(yield this.childNames())})}visitDescendants(t){return i(this,void 0,void 0,function*(){return w.thenMap(this.children(),e=>i(this,void 0,void 0,function*(){for(const n of e)yield n.visitDescendants(t),yield t(n)}))})}descendants(t){return i(this,void 0,void 0,function*(){const e=[];for(const n of d.toA(yield this.childFiles()))(yield t(n))&&e.push(n);const n=yield this.childDirectories();if(null!=n){for(const i of n)yield w.thenMap(i.descendants(t),t=>e.push(...t));return e}})}ancestorWithChildren(t){return i(this,void 0,void 0,function*(){return(yield this.hasChildren(t))?this:this.isRoot?void 0:this.parent().ancestorWithChildren(t)})}siblings(){return i(this,void 0,void 0,function*(){return this.selfAndSiblings().then(t=>t.filter(t=>!this.eql(t)))})}dirEntSiblings(t){return i(this,void 0,void 0,function*(){return w.thenMap(this.parent().dirents(),e=>t(e).map(t=>this.parent()._child(t)))})}selfAndSiblings(){return i(this,void 0,void 0,function*(){return this.parent().children()})}firstExistingSelfOrAncestor(){return i(this,void 0,void 0,function*(){return this.isRoot||(yield this.exists())?this:this.parent().firstExistingSelfOrAncestor()})}get pathnames(){return this.nativePath.split(o.sep).filter(t=>null!=t&&""!==t)}get pathnamesWithoutDrive(){return I.isWin?this.pathnames.slice(1):this.pathnames}get depth(){return this.pathnames.length-(I.isWin?1:0)}get isRoot(){return this.pathnames.length===(I.isWin?1:0)}root(t=0){return this.depth<=t?this:this.parent().root(t)}parent(){return this.isRoot?this:this.for(this.dir)}isAncestorOf(t){return null!=t&&m.startsWith(t.pathnames,this.pathnames)}isDescendantOf(t){return null!=t&&m.startsWith(this.pathnames,t.pathnames)}parentsAndSelf(){return[...this.parents(),this]}selfAndParents(t){return[this,...this.isRoot||t<=0?[]:this.parent().selfAndParents(t-1)]}parents(){const t=this.parent();return this.isRoot?[]:[...t.parents(),t]}sibling(t){return this.parent().join(t)}withPrefix(t){return this.sibling(t+this.base)}withNameSuffix(t){return this.sibling(this.name+t+this.ext)}siblingOf(t){return this.nativePath!==t.nativePath&&this.dir===t.dir}join(...t){return m.isEmpty(t)?this:this.for(o.join(this.nativePath,...t))}child(...t){return m.isEmpty(t)?this:this.join(...j.native2posix(o.join(...t)).split("/").filter(t=>".."!==t))}trap(t,e,n="warn"){return i(this,void 0,void 0,function*(){try{const i=yield e();return this.bflog().trace(`trap ${t}()`,Buffer.isBuffer(i)?"<Buffer>":i),i}catch(e){return void this.bflog().log(n,`trap: ${t}() failed: ${e}`)}})}trapOr(t,e,n="warn"){return i(this,void 0,void 0,function*(){try{return this.bflog().debug(`trapOr ${t}()`),yield e(),!0}catch(e){return this.bflog().log(n,`trapOr: ${t}() failed: ${e}`),!1}})}trapSync(t,e){try{return this.bflog().debug(`trapSync ${t}()`),e()}catch(e){return void this.bflog().warn(`trapSync: ${t}() failed: ${e}`)}}exists(){return i(this,void 0,void 0,function*(){return null!=this.dirent||(yield w.thenDefined(this.stat()))})}existsSync(){return null!=this.dirent||null!=this.statSync()}notExists(){return i(this,void 0,void 0,function*(){return w.thenNot(this.exists())})}mtime(){return w.thenMap(this.stat(),t=>t.mtime)}mtimeMs(){return w.thenMap(this.stat(),t=>Math.floor(t.mtimeMs))}mtimeSec(){return w.thenMap(this.stat(),t=>x.unixtime(t.mtime))}lastModifiedUtc(){return i(this,void 0,void 0,function*(){return w.thenMap(this.stat(),t=>t.mtime.toUTCString())})}statTimes(){return w.thenMap(this.stat(),t=>d.uniq([t.birthtimeMs,t.mtimeMs].filter(t=>null!=t&&0!==t)))}maxStatMs(){return w.thenMap(this.statTimes(),m.max)}maxStatDate(){return w.thenMap(this.maxStatMs(),t=>new Date(t))}minStatMs(){return w.thenMap(this.statTimes(),O.min)}minStatDate(){return w.thenMap(this.minStatMs(),t=>new Date(t))}size(){return w.thenMap(this.stat(),t=>t.size)}access(t){return this.trapOr("access("+t+")",()=>s.access(this.nativePath,t))}isReadable(){return this.access(s.constants.R_OK)}isHiddenPosix(){return this.base.startsWith(".")}isEmpty(){return i(this,void 0,void 0,function*(){if(yield this.isDirectory())return m.isNotEmpty(yield this.childNames());{const t=yield this.size();return null==t||0===t}})}isNonEmpty(t=1){return w.thenMapOr(this.stat(),e=>e.size>t,()=>!1)}modifiedGTE(t){return i(this,void 0,void 0,function*(){return w.thenMap(this.mtime(),e=>x.unixtime(e)>=x.unixtime(t))})}modifiedCloseTo(t,e){return i(this,void 0,void 0,function*(){return w.thenMap(this.mtimeMs(),n=>Math.abs(n-t)<=e)})}modifiedGT(t){return i(this,void 0,void 0,function*(){if(null!=t)return w.thenMap(this.mtime(),e=>x.unixtime(e)>x.unixtime(t))})}isDirectory(){return i(this,void 0,void 0,function*(){return null!=this.dirent?this.dirent.isDirectory():w.thenMapOr(this.stat(),t=>t.isDirectory(),()=>!1)})}isNotDirectory(){return i(this,void 0,void 0,function*(){return w.thenNot(this.isDirectory())})}isDirectorySync(){return null!=this.dirent?this.dirent.isDirectory():f.mapOr(this.statSync(),t=>t.isDirectory(),()=>!1)}isSymbolicLink(){return i(this,void 0,void 0,function*(){return null!=this.dirent?this.dirent.isSymbolicLink():w.thenMapOr(this.stat(),t=>t.isSymbolicLink(),()=>!1)})}nearestDir(){return i(this,void 0,void 0,function*(){return(yield this.isDirectory())?this:this.parent()})}isFile(){return i(this,void 0,void 0,function*(){return null!=this.dirent?this.dirent.isFile():this.stat().then(t=>p.Opt(t).map(t=>t.isFile()).getOrElse(()=>!1))})}isFileSync(){return null!=this.dirent?this.dirent.isFile():p.Opt(this.statSync()).filter(t=>t.isFile()).isDefined}rmdir(t="warn"){return this.clear(),this.trapOr("rmdir",()=>s.rmdir(this.nativePath),t)}mkdirp(){return i(this,void 0,void 0,function*(){return(yield this.clear().isDirectory())?this:this.trap("mkdirp",()=>i(this,void 0,void 0,function*(){try{return yield s.mkdirp(this.nativePath),this.clearThisAndParent()}catch(t){if("EEXIST"!==t.code)throw t}if(null==(yield this.parent().mkdirp()))throw new Error("Failed to mkdirp parent of "+this);if(yield s.mkdir(this.nativePath),!1===(yield w.until(()=>this.clear().isDirectory(),2*x.secondMs)))throw new Error("Failed to mkdirp "+this);return this.clearThisAndParent()}))})}mkdirpSync(){return this.trapSync("mkdirpSync",()=>(s.mkdirpSync(this.nativePath),this.clearThisAndParent()))}sha(){return w.thenMap(this.shaResult(),t=>t.result)}shaMs(){return w.thenMap(this.shaResult(),t=>t.elapsedMs)}writeStream(t,e){return i(this,void 0,void 0,function*(){return yield G.pipelinePromise([t,s.createWriteStream(this.nativePath,e)]),this.clearThisAndParent()})}writeJSON(t,e={}){return i(this,void 0,void 0,function*(){return this.trap("writeJSON",()=>i(this,void 0,void 0,function*(){return yield this.parent().mkdirp(),yield s.writeFile(this.nativePath,JSON.stringify(t,e.replacer,e.spaces),Object.assign({flag:"w"},e)),this.clearThisAndParent()}))})}readJSON(){return this.trap("readJSON",()=>h.retryOnReject(()=>s.readJSON(this.nativePath),{maxRetries:2,onRetryWaitUntil:()=>y.delay(25),errorIsRetriable:t=>-2!==t.errno}))}readJSONSync(){return this.trapSync("readJSONSync",()=>s.readJSONSync(this.nativePath))}readFile(){return this.trap("readFile",()=>s.readFile(this.nativePath),void 0)}readLines(){return w.thenMap(this.readFile(),t=>L.splitLines(t.toString()))}readFileSync(){return D.Try(()=>D.map(s.readFileSync(this.nativePath),A.toS))}writeTxt(t){return this.writeFile(L.crlf(t))}writeFile(t){return this.trapOr("writeFile",()=>i(this,void 0,void 0,function*(){yield this.parent().mkdirp(),yield s.outputFile(this.nativePath,t),this.clearThisAndParent()}))}appendFile(t){return this.trapOr("appendFile",()=>i(this,void 0,void 0,function*(){yield s.mkdirp(this.dir),yield s.appendFile(this.nativePath,t),this.clearThisAndParent()}))}wip(t="."){return this.sibling(t+this.base)}unwip(t="."){return i(this,void 0,void 0,function*(){const e=this.sibling(C.stripPrefix(this.base,t));return this.mv(e,{overwrite:!0})})}dest(t){return i(this,void 0,void 0,function*(){const e=t.clear();return b.notBlank(this.ext)&&b.blank(e.ext)||(yield e.isDirectory())?e.join(this.base):e})}copyFile(t,e={maxRetries:1}){return i(this,void 0,void 0,function*(){return h.retryOnReject(()=>this._copyFile(t),{maxRetries:e.maxRetries,onRetryWaitUntil:()=>y.delay(250)})})}_copyFile(t){return i(this,void 0,void 0,function*(){let e;const n=(yield this.dest(t)).clear();if(this.nativePath===n.nativePath)return this;{const t=yield this.stat(),o=D.map(t,t=>t.size);if(null==t||null==o)throw new Error("Can't copy missing files");const a=yield this.sha();if(null==a)throw new Error("Can't copy file without SHA");const u=n.wip();try{if(null==(yield n.parent().mkdirp()))throw new Error("Cannot mkdirp "+n.dir);const l=new Promise((t,e)=>r.copyFile(this.nativePath,u.nativePath,r.constants.COPYFILE_FICLONE,n=>null==n?t():e(n)));o>5*k.MiB&&(e=new V.PullProgressObserver({op:"file copy",path:this.nativePath,dest:n.nativePath},o,()=>u.clear().size())),yield l;const c=yield w.until(()=>i(this,void 0,void 0,function*(){return o===(yield u.clear().size())}),15*x.secondMs),d=yield u.clear().sha();if(!c||d!==a)throw this.bflog().warn("copyFile() failed",{sizeMatches:c,destSha:d,thisSha:a}),new Error("wipDest mismatch");const h=yield u.unwip();if(null==h)throw new Error(".unwip() failed");return yield s.chmod(h.nativePath,t.mode),yield s.utimes(h.nativePath,t.atime,t.mtime),this.bflog().debug(`copyFile(${n.nativePath}): success`),n.clearThisAndParent()}catch(t){throw this.bflog().warn(`copyFile(${u.nativePath}) failed: ${t}`),yield u.unlink(),yield n.unlink(),t}finally{D.map(e,t=>t.end())}}})}touch(t=Date.now(),e){return i(this,void 0,void 0,function*(){return this.trap("touch",()=>w.thenMap(this.ensureFile(),()=>this.utimes(t,e)))})}utimes(t,e){return i(this,void 0,void 0,function*(){const n=D.orElse(t,Date.now()),i=D.orElse(e,n);return this.trap("utimes",()=>s.utimes(this.nativePath,x.unixtime(i),x.unixtime(n)).then(()=>this.clearThisAndParent()))})}unlink(t="warn"){return i(this,void 0,void 0,function*(){return this.trap("unlink",()=>i(this,void 0,void 0,function*(){return yield s.unlink(this.nativePath),this.clearThisAndParent()}),t)})}remove(){return i(this,void 0,void 0,function*(){return this.trap("remove",()=>i(this,void 0,void 0,function*(){return this.bflog().info("remove()"),yield s.remove(this.nativePath),this.clearThisAndParent()}))})}unlock(){return i(this,void 0,void 0,function*(){return I.isMac&&(yield this.clear().exists())&&(yield E.stdout("chflags",["nouchg",this.nativePath],{timeout:R.cmdTimeoutMs})),this})}renameWithNameSuffix(t){return i(this,void 0,void 0,function*(){return w.thenMap(this.withNameSuffix(t).ensureNew({emptyIsNew:!0}),t=>t.unlink("debug").then(()=>this.mv(t)))})}mv(t,e={overwrite:!1}){return i(this,void 0,void 0,function*(){const n=yield this.dest(t);return this.nativePath===n.nativePath?(this.bflog().warn("mv(): no-op",new Error("internal error")),this):(yield n.parent().mkdirp(),yield Promise.all([this.unlock(),n.unlock()]),this.bflog().debug("mv",n),yield s.move(this.nativePath,n.nativePath,e),yield n.unlock(),this.clearThisAndParent(),n.clearThisAndParent())})}gzip(){return i(this,void 0,void 0,function*(){return this.trap("gzip",()=>i(this,void 0,void 0,function*(){const t=yield this.for(this.nativePath+".gz").ensureNew();return yield new Promise((e,n)=>u.pipeline(s.createReadStream(this.nativePath),c.createGzip(),s.createWriteStream(t.nativePath),t=>null==t?e():n(t))),yield this.unlink(),t}))})}ensureFile(){return this.trap("ensureFile",()=>s.ensureFile(this.nativePath).then(()=>this.clearThisAndParent()))}ensureFileSync(){return this.trapSync("ensureFileSync",()=>(s.ensureFileSync(this.nativePath),this.clearThisAndParent()))}get nameWithoutCount(){return j.nameWithoutCount(this.name)}get baseWithoutCount(){return this.nameWithoutCount+this.ext}get siblingWithoutCount(){return this.sibling(this.baseWithoutCount)}ensureNewNativePath(t){return i(this,void 0,void 0,function*(){const n=Object.assign({},e.DefaultEnsureNewOptions,t);if(this.clear(),!n.requireNumber&&((yield this.notExists())||n.emptyIsNew&&(yield this.isEmpty())))return this.nativePath;const i=this.parent();yield i.mkdirp();for(let t=n.startIndex;t<=n.maxVersions;t++){const e=i.join(`${this.name}-${C.leftPad(t,n.leftPad,"0")}${this.ext}`);if(e.clear(),(yield e.notExists())||n.emptyIsNew&&(yield e.isEmpty()))return e.nativePath}throw new Error("There are already more than "+n.maxVersions+" of "+this)})}ensureNew(t={}){return this.ensureNewNativePath(t).then(t=>this.for(t))}renameYMD(){return i(this,void 0,void 0,function*(){if(yield this.clear().isNonEmpty()){const t=_.datedToYMD(yield w.thenOrElse(this.mtime(),()=>new Date)),e=yield this.withNameSuffix("-"+t).ensureNew({emptyIsNew:!0});if(null!=e)return this.mv(e);this.bflog().warn("renameYMD(): failed (ensureNew returned null)")}})}saveIfNewOrDelete(t){return i(this,void 0,void 0,function*(){if(yield this.clear().isEmpty())return void(yield this.unlink());const e=yield this.siblingWithSameContents();if(null!=e)return yield this.unlink(),e;const n=yield this.sibling(t).ensureNew();return this.mv(n)})}chmod(t){return i(this,void 0,void 0,function*(){return yield s.chmod(this.nativePath,t),this.clear()})}zreadline(){return a.createInterface({input:s.createReadStream(this.nativePath).on("error",t=>{throw new Error("Failed to read from "+this+": "+t)}).pipe(c.createGunzip()).on("error",t=>{throw new Error("Failed to gunzip "+this+": "+t)})})}zcat(){return this.ext.endsWith(".gz")?this.trap("zcat",()=>i(this,void 0,void 0,function*(){const t=new q.WritableToBuffer;return yield new Promise((e,n)=>u.pipeline(s.createReadStream(this.nativePath),c.createGunzip(),t,t=>null==t?e():n(t))),w.thenMap(t.buffer,t=>t.toString())})):w.thenMap(this.readFile(),t=>t.toString())}siblingWithSameContents(){return i(this,void 0,void 0,function*(){return this.parent().childWithSameContents(this)})}childWithSameContents(t){return i(this,void 0,void 0,function*(){if((yield this.notExists())||!(yield this.isDirectory()))return;const e=yield t.size(),n=yield this.children(),i=[];for(const r of d.toA(n))(yield r.size())!==e||t.eql(r)||i.push(r);if(m.isEmpty(i))return;const r=yield t.sha();for(const t of i.sort((t,e)=>F.diceCoeff(t.base,e.base)).reverse())if((yield t.sha())===r)return t})}applyIfEmpty(t){return i(this,void 0,void 0,function*(){if(yield this.clear().isNonEmpty())return this;const e=this.wip();try{return yield e.parent().mkdirp(),yield e.unlink("debug"),yield t(e),(yield e.clear().isEmpty())?(this.bflog().warn("applyIfEmpty(): builder didn't write to dest"),void(yield e.unlink("debug"))):e.unwip()}catch(t){throw yield w.tryAll([()=>e.unlink(),()=>this.unlink()]),t}})}firstMatchingLine(t){const e=new g.Deferred("firstMatchingLine("+this+")"),n=r.createReadStream(this.nativePath,{flags:"r"});return n.on("error",t=>{-2===t.errno||"ENOENT"===t.code?(e.maybeResolve(void 0),n.close()):e.maybeReject(t)}),n.on("close",()=>e.maybeResolve(void 0)),z.onDataChunked(n,L.newlineRe,i=>{const r=t.exec(i);null!=r&&(e.maybeResolve(r),n.close())}),e.promise}}Y.attrTTL=1*x.minuteMs,Y.projectRoot=v.lazy(()=>{const t=W.ProjectPath.Root();if(null==t)throw new Error("Cannot find project path");return Y.for(t)}),e.BaseFile=Y},function(t,e){t.exports=require("timers")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(35),r=n(42),s=n(6),o=n(25),a=n(1),u=n(12),l=n(13),c=n(2),d=n(50);e.Deferred=class{constructor(t){this.name=t,this.start=Date.now(),this.state=c.PromiseStates.pending,this.promise=new Promise((t,e)=>{this._resolve=t,this._reject=e}),this.logger=a.mkLogger("Deferred("+this.toString()+")")}toString(){return l.isString(this.name)?this.name:JSON.stringify(this.name)}[r.inspect.custom](){return{ctor:"Deferred",name:this.toString(),start:this.start,end:this.end,state:this.state}}observeQuietly(t){return t.then(t=>{this.resolve(t)}).catch(t=>{this.logger.log(u.isTest?"warn":"error","observeQuietly.reject()",t),this.resolve(void 0)}),this}observe(t){return t.then(t=>{this.resolve(t)}).catch(t=>{this.reject(t)}),this}setTimeout(t){return s.map(this.priorTimeout,i.clearTimeout),this.priorTimeout=d.setUnrefTimeout(()=>{if(this.pending){const t="TIMEOUT: "+this.name+" after "+(Date.now()-this.start)+"ms";this.reject(t)}},t),this}get stateStr(){return this.pending?"pending":this.resolved?"resolved":"rejected"}get pending(){return this.state===c.PromiseStates.pending}get value(){return this.resolved?this._value:void 0}get error(){return this._error}get settled(){return this.state!==c.PromiseStates.pending}get resolved(){return this.state===c.PromiseStates.resolved}get rejected(){return this.state===c.PromiseStates.rejected}get settledMs(){return null==this.end?void 0:this.end-this.start}resolve(t){return this.settle(()=>{this.state=c.PromiseStates.resolved,this._value=t,this._resolve(t)})}maybeResolve(t){return this.pending?this.resolve(t):this}reject(t){this.logger.log(u.isTest?"warn":"error",".reject()",t);const e=o.asError(t);return this.settle(()=>{this._error=e,this.state=c.PromiseStates.rejected,this._reject(e)})}maybeReject(t){return this.pending?this.reject(t):this}finally(t){return this.promise.finally(t),this}then(t){return this.promise.then(t)}settle(t){if(this.state===c.PromiseStates.pending){s.map(this.priorTimeout,i.clearTimeout),t(),this.end=Date.now();const e=this.settledMs;if(this.resolved&&e>5e3){const t=e>5e3?"info":"debug";this.logger.log(t,"Completed in "+e+"ms")}}else this.logger.warn("settled multiple times (already "+this.stateStr+")",{value:this._value});return this}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(147);e.delay=i.delay,e.delayUntil=i.delayUntil,e.later=i.later,e.unrefDelay=i.unrefDelay},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(5),s=n(4),o=n(0);var a=n(95);function u(t){const e=s.compact(t).filter(([t,e])=>null!=t&&null!=e);return new Map(e)}function l(t,e){return new Map([...t.entries()].filter(([t,n])=>e(t,n)))}e.getOrSet=a.getOrSet,e.hasAll=function(t,e){return e.every(e=>t.has(e))},e.getOrSetAsync=function(t,e,n){return i(this,void 0,void 0,function*(){const i=t.get(e);if(null!=i)return i;const r=Promise.resolve(n());return t.set(e,r),r.then(n=>{null==n?t.delete(e):t.set(e,n)}).catch(()=>t.delete(e)),r})},e.flatMap=function(t,e){return new Map(s.concat(...t.map(t=>e(t))))},e.compactMap=u,e.toMap=function(t,e){return u(s.compact(t).map(e))},e.toMapAsync=function(t,e){return i(this,void 0,void 0,function*(){if(null==t)return new Map;return u(yield Promise.all(s.compact(r.toA(t)).map(t=>e(t))))})},e.toObj=function(t){const e={};for(const[n,i]of t)e[n]=i;return e},e.filter=l,e.filterInPlace=function(t,e){[...t.entries()].forEach(([n,i])=>e(n,i)||t.delete(n))},e.pickKeys=function(t,e){return l(t,t=>e.indexOf(t)>=0)},e.getLike=function(t,e){return o.map([...t.entries()].find(([t])=>e(t)),([,t])=>t)},e.inverse=function(t){return new Map([...t.entries()].map(([t,e])=>[e,t]))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(43),r=n(45),s=n(22),o=n(9),a=n(33),u=n(128),l=n(129),c=n(4),d=n(3),h=n(10),f=n(28),p=n(0),m=n(12);var g;e.AppPaths=a.strEnum("exe","home","appData","userData","pictures","temp"),function(t){t.getName=function(){return l.AppName},t.exe=d.lazy(()=>s.execPath),t.home=d.lazy(()=>p.orElse(c.first(h.compactBlanks([r.homedir(),s.env.HOME,s.env.HOMEPATH,s.env.USERPROFILE]).map(t=>f.resolve(t)),t=>p.map(i.statSync(t),()=>t)),r.homedir())),t.appData=d.lazy(()=>u.appData()),t.appName=d.lazy(()=>l.AppName+(m.isProd?"":`-${m.Settings.nodeEnv.value}`)),t.userData=d.lazy(()=>f.resolve(t.appData(),t.appName())),t.pictures=d.lazy(()=>f.resolve(t.home(),"Pictures")),t.temp=d.lazy(()=>f.resolve(r.tmpdir(),l.AppName+"-"+r.userInfo().username)),t.getPath=function(e){return o.maybeCall(t,e)},t.setPath=function(e,n){t[e].set(f.resolve(n))}}(g=e.App||(e.App={})),m.Settings.nodeEnv.addListener(()=>void o.values(g).forEach(t=>o.maybeCall(t,"clear"))),g.appName.onChange(()=>g.userData.clear())},,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(179),r=n(61);var s;function o(t){return"symbol"==typeof t}function a(t){return"function"==typeof t}function u(t){return null==t?s.Empty:o(t)?s.Symbol:r.isPrimitive(t)?s.Primitive:Array.isArray(t)?s.Array:i.isIterable(t)?s.Iterable:a(t)?s.Function:"object"==typeof t?t.constructor&&"Object"===t.constructor.name?s.Object:s.Instance:s.Unknown}!function(t){t[t.Empty=0]="Empty",t[t.Primitive=1]="Primitive",t[t.Symbol=2]="Symbol",t[t.Object=3]="Object",t[t.Array=4]="Array",t[t.Iterable=5]="Iterable",t[t.Instance=6]="Instance",t[t.Function=7]="Function",t[t.Unknown=8]="Unknown"}(s=e.ObjectType||(e.ObjectType={})),e.isSymbol=o,e.isFunction=a,e.isObject=function(t){return u(t)===s.Object},e.objectType=u},function(t,e){t.exports=require("util")},function(t,e){t.exports=require("fs")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(6);class r{constructor(t){this.value=t,this.ctime=Date.now()}touch(){this.ctime=Date.now()}}e.Entry=r;e.TTLMap=class{constructor(t,e=new Map){this.ttlMs=t,this.store=e,this.expireListeners=[]}get size(){return this.vacuum(),this.store.size}clear(){return this.store.clear(),this}delete(t){return this.store.delete(t)}deleteIf(t){this.store.forEach((e,n)=>{t(n,e.value)&&this.store.delete(n)})}entries(){const t=this;return function*(){for(const[e,n]of t.store.entries())t.expired(e,n)||(yield[e,n.value])}()}forEach(t){this.store.forEach((e,n)=>{this.expired(n,e)||t(e.value,n,this)})}get(t){return i.map(this.store.get(t),e=>this.expired(t,e)?void 0:e.value)}touch(t){i.map(this.store.get(t),t=>t.touch())}pop(t){const e=this.store.get(t);return this.store.delete(t),i.map(e,e=>this.expired(t,e)?void 0:e.value)}has(t){return!this.expired(t,this.store.get(t))}keys(){const t=this;return function*(){for(const[e,n]of t.store.entries())t.expired(e,n)||(yield e)}()}set(t,e){return i.map(this.store.get(t),e=>this.expireListeners.forEach(n=>n(t,e.value))),this.store.set(t,new r(e)),this}values(){const t=this;return function*(){for(const[e,n]of t.store.entries())t.expired(e,n)||(yield n.value)}()}[Symbol.iterator](){return this.entries()}getOrSet(t,e){const n=this.store.get(t);if(this.valid(t,n))return n.touch(),n.value;{const n=e();return this.set(t,n),n}}on(t,e){this.expireListeners.push(e)}valid(t,e){return!this.expired(t,e)}expired(t,e){return null!=e&&e.ctime+this.ttlMs<=Date.now()?(this.store.delete(t),this.expireListeners.forEach(n=>n(t,e.value)),!0):null==e}vacuum(){this.store.forEach((t,e)=>{this.expired(e,t)})}}},function(t,e){t.exports=require("os")},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(5),s=n(9),o=n(41);function a(t,e){return i(this,void 0,void 0,function*(){const n=yield t,i=yield e;return null!=n&&null!=i&&u(n,i)})}function u(t,e){return null==l(t,e)}function l(t,e){switch(o.objectType(t)){case o.ObjectType.Empty:case o.ObjectType.Symbol:case o.ObjectType.Primitive:return t===e?void 0:`${t} !== ${e}`;case o.ObjectType.Array:return c(t,e);case o.ObjectType.Iterable:return c([...t],[...e]);default:return t instanceof Set?d(t,e):t instanceof Map?h(t,e):f(t,e)}}function c(t,e){if(!Array.isArray(t))return"a is not an Array";if(!Array.isArray(e))return"b is not an Array";if(t.length!==e.length)return`length mismatch (${t.length} != ${e.length})`;const n=r.compact(t.map((t,n)=>{const i=l(t,e[n]);return null==i?void 0:"["+n+"] not eql: "+i}));return 0===n.length?void 0:n.join(", ")}function d(t,e){if(!(t instanceof Set))return"a is not a Set";if(!(e instanceof Set))return"b is not a Set";if(t.size!==e.size)return`size mismatch (${t.size} != ${e.size})`;const n=[...t.keys()].filter(t=>!e.has(t));return 0===n.length?void 0:"Missing keys in b: "+n}function h(t,e){if(!(t instanceof Map))return"a is not a Map";if(!(e instanceof Map))return"b is not a Map";if(t.size!==e.size)return`size mismatch (${t.size} != ${e.size})`;const n=[...t.keys()].filter(t=>!e.has(t));if(n.length>0)return"Missing keys in b: "+n;const i=r.compact([...t.entries()].map(([t,n])=>l(n,e.get(t))));return 0===i.length?void 0:"Mismatched entries: "+i.join(", ")}function f(t,e){const n=s.keys(t),i=s.keys(e),o=c(n.sort(),i.sort());if(null!=o)return o;const a=r.compact(n.map(n=>{const i=l(t[n],e[n]);return null==i?void 0:"Mismatch at ["+n+"]: "+i}));return 0===a.length?void 0:a.join(", ")}e.eqlAsync=a,e.notEqlAsync=function(t,e){return i(this,void 0,void 0,function*(){return!(yield a(t,e))})},e.eql=u,e.notEql=function(t,e){return!u(t,e)},e.whyNotEql=l,e.arrayEql=function(t,e){return null==c(t,e)},e.whyNotArrayEql=c,e.setEql=function(t,e){return null==d(t,e)},e.whyNotSetEql=d,e.mapEql=function(t,e){return null==h(t,e)},e.whyNotMapEql=h,e.whyNotObjEql=f},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(87),s=n(8),o=n(16),a=n(6),u=n(21),l=n(3),c=n(2),d=n(132),h=n(20),f=n(11),p=n(14),m=n(1),g=n(12),y=n(13),v=n(24),S=10*o.minuteMs,w="{ready}",b=" | ConvertTo-Json -Compress";p.onClearCache(()=>a.map(P.instance.prior(),t=>t.clearMockResults()));class P{constructor(){this.logger=m.mkLogger("PowerShell"),this.mockResults=new Map,this.pwsh=d.observeBatchCluster(new r.BatchCluster({processFactory:()=>h.execFile("powershell",[],S),versionCommand:`function prompt {"${w}"}`,pass:w,fail:"Error",exitCommand:"exit",maxProcs:2,maxTasksPerProcess:150,taskTimeoutMillis:v.cmdTimeoutMs,cleanupChildProcs:!1}),"PowerShell",u.EndableRanks.db)}end(){return this.pwsh.end()}get ended(){return this.pwsh.ended}get spawnedProcs(){return this.pwsh.spawnedProcs}pushMockResult(t,e){this.mockResults.set(y.ensureSuffix(t,b),e)}clearMockResults(){this.mockResults.clear()}execute(t,e){return i(this,void 0,void 0,function*(){if(this.pwsh.ended||u.ending())this.logger.warn("execute() failed (ended)",{cmd:t});else{if(g.isTest&&this.mockResults.has(t)){const n=this.mockResults.get(t);return e(n.stdout,n.stderr,n.passed)}try{this.logger.debug("execute()",{cmd:t});const n=yield f.elapsedAsync(()=>this.pwsh.enqueueTask(new r.Task(t,(n,i,r)=>e(a.map(n,e=>y.stripPrefix(e,t)),i,r)))),i=n.elapsedMs<500?"trace":n.elapsedMs<1500?"debug":n.elapsedMs<3e3?"info":"warn";return this.logger.log(i,"execute()",{cmd:t,elapsedMs:n.elapsedMs}),n.result}catch(e){return void this.logger.warn("execute() failed: "+e,{cmd:t})}}})}executeJson(t){return i(this,void 0,void 0,function*(){const e=yield this.execute(y.ensureSuffix(t,b),(t,e,n)=>({stdout:t,stderr:e,passed:n}));if(null!=e)if(s.blank(e.stdout)||s.notBlank(e.stderr)||!e.passed)this.logger.warn("executeJson(): failed result",Object.assign({cmd:t},e));else try{return JSON.parse(e.stdout)}catch(t){const n=e.stdout.replace(/\\/g,"\\\\");return this.logger.info("executeJson(): parsing failed, trying dub-whack fix...",{before:y.ellipsize(e.stdout),after:y.ellipsize(n)}),JSON.parse(n)}else this.logger.warn("executeJson(): null result",{cmd:t})})}executeJsonToA(t){return i(this,void 0,void 0,function*(){return c.thenMap(this.executeJson(t),t=>Array.isArray(t)?t:[t])})}}P.instance=l.lazy(()=>new P),e.PowerShell=P},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(133),r=n(10),s=n(0),o=n(13);class a{constructor(t,e,n=s.identity){this.name=t,this.numerals=e,this.decodePreparser=n,this.base=e.length}digitsToNumerals(t){return t.map(t=>this.numerals[t]).join("")}encode(t,e=0){const n=[],i=t<0;if(i&&e--,0===(t=Math.abs(t)))n.push(0);else for(;t>0;)n.push(t%this.base),t=Math.floor(t/this.base);for(;n.length<e;)n.push(0);return(i?"-":"")+this.digitsToNumerals(n.reverse())}encodeBuffer(t){if(null==t||0===t.length)return"";const e=[0];for(let n of t)for(e.forEach((t,i)=>{n+=t<<8,e[i]=n%this.base,n=Math.floor(n/this.base)});n>0;)e.push(n%this.base),n=Math.floor(n/this.base);return this.digitsToNumerals(e.reverse())}decode(t){if(null==t||r.blank(t))return;const e="-"===(t=this.decodePreparser(t))[0];e&&(t=t.slice(1));let n=0;for(const e of t){const t=this.numerals.indexOf(e);if(t<0)return;n=n*this.base+t}return e?-1*n:n}randomChars(t){return this.encodeBuffer(i.randomBytes(t+3)).slice(1,t+1)}randomUid(t=25,e=5){return o.splitEvery(this.randomChars(t),e).join("-")}}e.Radix=a,e.Hex=new a("hex","0123456789abcdef",t=>t.toLowerCase()),e.Radix58=new a("Radix58","123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.RadixAlphaNum=new a("RadixAlphaNum","0123456789abcdefghijklmnopqrstuvwxyz",t=>t.toLowerCase()),e.GeoRadix=new a("GeoRadix","0123456789bcdefghjkmnpqrstuvwxyz",t=>t.toLowerCase())},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(8),s=n(6),o=n(33),a=n(18),u=n(4),l=n(0),c=n(13);e.fileExtsToDesc=[[["3G2","3GP2"],"3rd Gen. Partnership Project 2 a/v (QuickTime-based)"],[["3GP","3GPP"],"3rd Gen. Partnership Project a/v (QuickTime-based)"],[["ARQ"],"Sony Alpha Pixel-Shift RAW (TIFF-based)"],[["ARW"],"Sony Alpha RAW (TIFF-based)"],[["ASF"],"Microsoft Advanced Systems Format"],[["AVI"],"Audio Video Interleaved (RIFF-based)"],[["CR2"],"Canon RAW 2 (TIFF-based) (CR2 spec)"],[["CR3"],"Canon RAW 3 (QuickTime-based) (CR3 spec)"],[["CRM"],"Canon RAW Movie (QuickTime-based)"],[["CRW","CIFF"],"Canon RAW Camera Image File Format (CRW spec)"],[["DNG"],"Digital Negative (TIFF-based)"],[["ERF"],"Epson RAW Format (TIFF-based)"],[["EXIF"],"Exchangeable Image File Format metadata (TIFF-based)"],[["EXV"],"Exiv2 metadata file (JPEG-based)"],[["GIF"],"Compuserve Graphics Interchange Format"],[["GPR"],"GoPro RAW (DNG-based)"],[["JPEG","JPG","JPE"],"Joint Photographic Experts Group image"],[["M2TS","MTS","M2T"],"MPEG-2 Transport Stream (used for AVCHD video)"],[["M4A","M4B","M4P","M4V"],"MPEG-4 Audio/Video (QuickTime-based)"],[["MEF"],"Mamiya (RAW) Electronic Format (TIFF-based)"],[["MIE"],"Meta Information Encapsulation (MIE specification)"],[["MOV","QT"],"Apple QuickTime Movie"],[["MP4"],"Motion Picture Experts Group version 4 (QuickTime-based)"],[["MPEG","MPG","M2V"],"Motion Picture Experts Group version 1 or 2"],[["MQV"],"Sony Mobile QuickTime Video"],[["MRW"],"Minolta RAW"],[["NEF"],"Nikon (RAW) Electronic Format (TIFF-based)"],[["NRW"],"Nikon RAW (2) (TIFF-based)"],[["ORF"],"Olympus RAW Format (TIFF-based)"],[["PNG"],"Portable Network Graphics"],[["PPM","PBM","PGM"],"Portable Pixel/Bit/Gray Map"],[["RAF"],"FujiFilm RAW Format"],[["RAW"],"Panasonic RAW (TIFF-based)"],[["RW2"],"Panasonic RAW 2 (TIFF-based)"],[["RWL"],"Leica RAW (TIFF-based)"],[["SR2"],"Sony RAW 2 (TIFF-based)"],[["SRF"],"Sony RAW Format (TIFF-based)"],[["SRW"],"Samsung RAW format (TIFF-based)"],[["THM"],"Thumbnail image (JPEG)"],[["TIFF","TIF"],"Tagged Image File Format"],[["WEBM"],"Google Web Movie (Matroska-based)"],[["WEBP"],"Google Web Picture (RIFF-based)"],[["WMV"],"Windows Media Audio/Video (ASF-based)"],[["XMP"],"Extensible Metadata Platform sidecar file"]];const d=e.fileExtsToDesc.map(([t])=>t);function h(t){return u.flatten(i.compact(t.map(t=>t.toUpperCase()).map(t=>d.find(e=>e.includes(t))))).map(m)}function f(t){return r.blank(t)?void 0:c.ensurePrefix(a.toS(t),".").toLowerCase()}function p(t){const e=new Set(i.compactBlanks(t.map(f)));return t=>l.orElse(s.map(f(t),t=>e.has(t)),!1)}function m(t){return c.ensurePrefix(t,".").toUpperCase()}e.BaseSharpImageExts=["GIF","JPEG","PNG","PPM","TIFF","THM","WEBP"],e.SharpImageExts=h(e.BaseSharpImageExts),e.isSharpExt=p(e.SharpImageExts),e.sharpSupportedMimeTypes=new Set(["image/gif","image/jpeg","image/pjpeg","image/png","image/tiff","image/webp"]),e.isSharpMimetype=function(t){return e.sharpSupportedMimeTypes.has(a.toS(t).toLowerCase())},e.BaseRawImageExts=["ARQ","ARW","CR2","CR3","CRW","DNG","ERF","GPR","MEF","MRW","NEF","NRW","ORF","RAF","RAW","RW2","RWL","SR2","SRF","SRW"],e.RawImageExts=h(e.BaseRawImageExts),e.isRawImageExt=p(e.RawImageExts),e.BaseVideoExts=["3G2","3GP","ASF","AVI","CRM","M4A","MOV","MP4","MPEG","MQV","MTS","WEBM","WMV"],e.VideoExts=h(e.BaseVideoExts),e.isVideoExt=p(e.VideoExts),e.SidecarExtsEnum=o.strEnum("EXIF","EXV","MIE","XMP"),e.SidecarExts=h(o.strEnumValues(e.SidecarExtsEnum)),e.isSidecarExt=p(e.SidecarExts),e.AssetFileExts=[...e.SharpImageExts,...e.RawImageExts,...e.VideoExts].sort(),e.AllExifExts=[...e.AssetFileExts,...e.SidecarExts].sort(),e.browserImgExts=h(["JPEG","PNG"]),e.browserExts=h(["JPEG","PNG","GIF","MP4","WEBM","WEBP"]),e.asExt=m,e.ExtTypes=o.strEnum("image","raw","video"),e.extType=function(t){return e.isSharpExt(t)?e.ExtTypes.image:e.isRawImageExt(t)?e.ExtTypes.raw:e.isVideoExt(t)?e.ExtTypes.video:void 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(35),r=n(9),s=n(27);e.setUnrefTimeout=function(t,e,...n){return s.tap(i.setTimeout(t,Math.round(e),n),t=>t.unref())},e.setUnrefInterval=function(t,e,...n){return s.tap(i.setInterval(t,Math.round(e),n),t=>t.unref())},e.unref=function(t){return r.maybeCall(t,"unref"),t}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(5),s=n(41),o=n(4),a=n(67),u=n(36),l=n(58);class c{constructor(){this._pushCount=0,this._arr=[],this.nextSettledLatches=[],this.serialLatencyAvg=new a.Average}get arr(){return o.filterInPlace(this._arr,t=>t.pending),this._arr}get pushCount(){return this._pushCount}push(t,e){this._pushCount++;const n=s.isFunction(e)?e():e;return this.arr.push(new u.Deferred(t).observeQuietly(n).finally(()=>this.emitSettled())),n}emitSettled(){this.nextSettledLatches.forEach(t=>t.resolve()),this.nextSettledLatches.length=0}awaitNextSettled(){const t=new l.Latch;return this.nextSettledLatches.push(t),t}serial(t,e){const n=Date.now();return this.push(t,this.awaitAll().then(()=>(this.serialLatencyAvg.push(Date.now()-n),e())))}oneRunAtATime(t,e){return this.pending?this.awaitAll():this.serial(t,e)}maybeRun(t,e){return this.pending?void 0:this.serial(t,e)}get pendingCount(){return r.count(this._arr,t=>t.pending)}get pending(){return this.pendingCount>0}pendingNames(){return this.arr.map(t=>t.name)}get settled(){return 0===this.arr.length}awaitAll(){return 0===this.arr.length?Promise.resolve(void 0):Promise.all(this.arr.map(t=>t.promise)).then(()=>void 0)}}e.Promises=c,e.oneRunAtATime=function(t,e){const n=new c;return()=>n.oneRunAtATime(t,e)},e.maybeRun=function(t,e){const n=new c;return()=>n.maybeRun(t,e)},e.serially=function(t,e){const n=new c;return()=>n.serial(t,e)},e.withBoundedConcurrency=function({name:t,laters:e,maxConcurrent:n=4}){return i(this,void 0,void 0,function*(){const i=[],r=new c;for(const s of e){for(;r.pendingCount>=n;)yield r.awaitNextSettled();i.push(r.push(t,s))}return Promise.all(i)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(133),r=n(43),s=n(9),o=n(15),a=n(48);function u(t,n=e.HashBits){return i.createHash("sha512").update(t).digest().slice(0,n/8)}e.HashBits=192,e.fileSha=function(t,n){const a=r.createReadStream(t,{autoClose:!0}),u=i.createHash("sha512");let l=0;const c=o.Opt(n).flatMap(t=>t.msbits).getOrElse(()=>e.HashBits)/8,d=s.map(n,t=>t.observer);return new Promise((t,e)=>{a.on("error",t=>e(t)),a.on("data",t=>{l+=t.length,s.map(d,t=>t.onProgress(l)),u.update(t)}),a.on("end",()=>t(u.digest().slice(0,c)))})},e.stringSha=u,e.shortStringSha=function(t,e=9,n=a.Radix58,i=224){return n.encodeBuffer(u(t,i)).substring(0,e)}},,function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(96),s=n(5),o=n(37),a=n(25),u=n(0),l=n(21);e.ReadableBuffer=class extends r.Readable{constructor(t){super(),this.push(t),this.push(null)}},e.end=function(t){return i(this,void 0,void 0,function*(){null!=t&&(u.Try(()=>u.maybeCall(t,"unref")),l.ending()?t.end(null):yield new Promise(e=>t.end(null,e)),yield o.delay(50),u.Try(()=>u.maybeCall(t,"destroy")))})},e.close=function(t){return i(this,void 0,void 0,function*(){null!=t&&(u.Try(()=>u.maybeCall(t,"unref")),l.ending()?t.close(()=>{}):yield new Promise(e=>t.close(e)),yield o.delay(50),u.Try(()=>u.maybeCall(t,"destroy")))})},e.onError=function(t,e){[{name:"cp",ea:t},{name:"stdin",ea:t.stdin},{name:"stdout",ea:t.stdout},{name:"stderr",ea:t.stderr}].forEach(({name:t,ea:n})=>u.map(n,n=>n.on("error",n=>{a.isIgnorableError(n)||e(t,n)})))},e.closeStreams=function(t){null!=t&&[t.stdin,t.stdout,t.stderr].forEach(t=>u.Try(()=>u.map(t,t=>t.destroy())))},e.pipelinePromise=function(t){return new Promise((e,n)=>{const i=[];t.forEach(t=>t.on("error",t=>{i.push(t)})),r.pipeline(t,t=>o.later(()=>{null!=t?n(t):s.isNotEmpty(i)?n(a.asError(i)):e()},10))})},e.remoteDesc=function(t){return t.destroyed?"destroyed":`${t.remoteFamily}:${t.remoteAddress}:${t.remotePort}`}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.lazy=function(t){let e,n=!1;return()=>{if(!n){n=!0;try{e=t()}catch(t){}}return e}}},,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(131),s=n(7);function o(t,e){const n=new r.CountingSet;return t.forEach(t=>s.mapFinite(t,t=>n.incr(t))),n.top(e).map(t=>t[0])}function a(t){return t.reduce((t,e)=>t+e,0)}function u(t){return i.isEmpty(t)?NaN:a(t)/t.length}function l(t){const e=u(t);return u(t.map(t=>Math.pow(t-e,2)))}function c(t){return Math.sqrt(t.reduce((t,e)=>t+e*e,0))}function d(t,e){return t.reduce((t,n,i)=>t+n*e[i],0)}e.min=function(t){return t.reduce((t,e)=>null==t?e:null==e||t<=e?t:e,void 0)},e.max=function(t){return t.reduce((t,e)=>null==t?e:null==e||t>=e?t:e,void 0)},e.deltas=function(t){return null==t||t.length<=1?[]:t.slice(1).map((e,n)=>e-t[n])},e.modes=o,e.mode=function(t){return o(t,1)[0]},e.sum=a,e.avg=u,e.variance=l,e.stdDev=function(t){return Math.sqrt(l(t))},e.weightedAvg=function(t){let e;for(const n of t)e=null==e?n:(e+n)/2;return null==e?NaN:e},e.l2norm=c,e.dot=d,e.cosineSimilarity=function(t,e){return d(t,e)/(c(t)*c(e))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Latch=class{constructor(t){this.id=t,this._state="pending",this.promise=new Promise((t,e)=>{this._resolve=t,this._reject=e})}resolve(){return this.pending&&this._resolve(),this._state="resolved",this}reject(t){return this.pending&&this._reject(t),this._state="rejected",this}observe(t){return t.then(()=>this.resolve()).catch(t=>this.reject(t)),this}observeQuietly(t){return t.then(()=>this.resolve()).catch(()=>this.resolve()),this}get pending(){return"pending"===this._state}get settled(){return!this.pending}get resolved(){return"resolved"===this._state}get rejected(){return"rejected"===this._state}get state(){return this._state}then(t){return this.promise.then(t)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(17),r=new Intl.NumberFormat;e.fmt=function(t){return r.format(t)},e.KB=1e3,e.MB=1e3*e.KB,e.GB=1e3*e.MB,e.TB=1e3*e.GB,e.KiB=1024,e.MiB=1024*e.KiB,e.GiB=1024*e.MiB,e.TiB=1024*e.GiB;const s=["B","KB","MB","GB","TB","PB"],o=["B","KiB","MiB","GiB","TiB","PiB"];e.fmtBytes=function(t,e=3){const n=Math.floor(Math.log10(t)),r=Math.floor(n/3),o=Math.pow(10,3*r),a=s[r];return i.sigFigs(t/o,e)+" "+a},e.fmtMebi=function(t,e=3){const n=Math.floor(Math.log2(t)),r=Math.floor(n/10),s=Math.pow(2,10*r),a=o[r];return i.sigFigs(t/s,e)+" "+a},e.MP=1e6,e.megapixels=function(t){return i.sigFigs(t/e.MP,3)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wmic=()=>"wmic",e.fsutil=()=>"fsutil",e.nslookupWin=()=>"nslookup",e.pingWin=()=>"ping",e.arpWin=()=>"arp"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=["number","string","boolean"];function s(t){return-1!==r.indexOf(typeof t)}function o(t,e){return null==t&&null==e?0:null==t?-1:null==e?1:"string"==typeof t&&"string"==typeof e?t.localeCompare(e):Array.isArray(t)&&Array.isArray(e)?a(t,e):t>e?1:t<e?-1:0}function a(t,e){if(i.isEmpty(t)&&i.isEmpty(e))return 0;const n=Math.min(t.length,e.length);for(let i=0;i<n;i++){const n=o(t[i],e[i]);if(0!==n)return n}return o(t.length,e.length)}e.isPrimitive=s,e.isPrimitiveArray=function(t){return Array.isArray(t)&&t.every(s)},e.cmp=o,e.cmpArr=a},,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(44),r=n(185);e.BoundedMap=class extends i.TTLMap{constructor(t,e,n){super(t,new r.MRUMap(e,n)),this.maxSize=e,this.fifo=n}}},,function(t,e){t.exports=require("exiftool-vendored")},,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(4),r=n(130),s=n(131),o=n(7),a=n(0),u=n(57);e.Average=class{constructor(t=10,e=0,n=0){this.maxSamples=t,this._k=e,this._avg=n,this._weightedTotalAvg=n,this._samples=new r.BoundedList(t)}push(t){if(!isFinite(t))throw new Error("Average.push("+t+"): not a number");if(this._k++,this._samples.push(t),this._min=null==this._min?t:Math.min(t,this._min),this._max=null==this._max?t:Math.max(t,this._max),1===this._k)this._m=t,this._v=0,this._avg=t,this._weightedTotalAvg=t;else{const e=this._m;this._m+=(t-this._m)/this._k,this._v+=(t-e)*(t-this._m),this._avg=this._avg*(this._k-1)/this._k+t/this._k,this._weightedTotalAvg=(this._weightedTotalAvg+t)/2}return t}stats(t=2){const e={k:o.sigFigs(this.k,t)};if(!this.empty){const n=e=>a.map(e,e=>o.sigFigs(e,t));e.mean=n(this.avg),e.max=n(this.max),e.min=n(this.min)}return e}get empty(){return 0===this._k}get k(){return this._k}get avg(){return this.empty?void 0:o.sigFigs(this._avg,4)}get max(){return this._max}get min(){return this._min}get stdDev(){return this._k<2?void 0:Math.sqrt(this._v/(this._k-1))}get sampleMode(){if(this.empty)return;const t=new s.CountingSet;this._samples.forEach(e=>t.incr(e));const e=t.entriesByCountDesc(),n=e[0][1],r=e.filter(([,t])=>t===n);return i.sortBy(r,([t])=>o.absdiff(this._avg,t))[0][0]}get sampleStdDev(){return i.mapNotEmpty(this._samples,u.stdDev)}get sampleAvg(){return i.mapNotEmpty(this._samples,u.avg)}get samples(){return[...this._samples]}p(t){if(0===this._samples.length)return 0;const e=[...this._samples].sort((t,e)=>t-e);return e[Math.floor(e.length*(t/100))]}get weightedAvg(){return i.mapNotEmpty(this._samples,t=>o.sigFigs(u.weightedAvg(t),4))}get weightedTotalAvg(){return this._weightedTotalAvg}clear(){this._avg=0,this._k=0,this._weightedTotalAvg=0,this._samples.length=0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(18),r=n(4),s=n(3),o=n(10),a=n(1),u=n(7),l=n(0),c=n(100),d=n(13);class h{constructor(t){this.h=t,this.text=l.orElse(t.text,i.toS(t)),this.greedyLeft=l.orElse(t.greedyLeft,!1)}toEntry(t){return[this.text,t.substring(this.leftIdx,this.rightIdx).trim()]}}const f=s.lazy(()=>a.mkLogger("Fixed"));e.parseFixed=function(t,e,n=!0){return new p(t,e,n).entries};class p{constructor(t,e,n=!0){this.warnIfMissingHeaders=n;const i=e.split(/[\r\n]{1,2}/);this.headerRow=i[0],this.rows=i.slice(1);const s=Math.max(...this.rows.map(t=>t.length));this.col2blanks=new Map(u.times(s,t=>[t,r.count(this.rows,e=>o.blank(e[t]))])),this.headers=this.extractHeaders(t.map(t=>new h(t))),this.entries=this.rows.map(t=>this.headers.map(e=>e.toEntry(t))).map(t=>l.fromEntries(t)).filter(t=>l.values(t).some(o.notBlank))}extractHeaders(t){let e=this.headerRow;r.sortBy(t,t=>-t.text.length),f().trace("extractHeaders()",t),t.forEach(t=>{const n=new RegExp(`\\b${t.text}\\b`,"i"),i=n.exec(e);null==i?this.warnIfMissingHeaders&&f().warn("extractHeaders(): Failed to find header!",{re:n,headerLine:e}):(t.indexOf=i.index,e=d.padReplace(e,i.index,t.text.length," "))});const n=t.filter(t=>null!=t.indexOf),i=r.sortBy(n,t=>t.indexOf);f().trace("extractHeaders()",{byAppearance:i}),i.forEach((t,e)=>{const n=t.indexOf,r=i[e-1],s=0===e?0:r.indexOf+r.text.length-1,[o,a]=t.greedyLeft?[s,n]:[n,s];t.leftIdx=l.map(this.firstBlankColumn(o,a),t=>t+1),0===e&&null==t.leftIdx&&(t.leftIdx=0),f().trace("extractHeaders(): finding leftIdx",{from:n,to:s,header:t}),null==t.leftIdx&&f().warn("no blank column for "+t.text+" between "+n+" and "+s)}),r.filterInPlace(i,t=>null!=t.leftIdx),i.slice(0,-1).forEach((t,e)=>{const n=i[e+1];t.rightIdx=n.leftIdx-1});const s=r.toA(c.diff(t.map(t=>t.text),i.map(t=>t.text)));return s.length>0&&f().warn("Missing headers",{missingHeaders:s}),i}firstBlankColumn(t,e){return r.range(t,e).find(t=>this.col2blanks.get(t)===this.rows.length)}}e.Fixed=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(22),r=n(9);e.getEnv=function(t){return r.firstValueCaseInsensitive(i.env,t)}},,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(10),r=n(127);function s(t){return e=>i.blank(e)?"":t(e)}e.black=s(r.default.black),e.blue=s(r.default.blue),e.cyan=s(r.default.cyan),e.green=s(r.default.green),e.grey=s(r.default.grey),e.magenta=s(r.default.magenta),e.red=s(r.default.red),e.yellow=s(r.default.yellow)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(6),s=n(4),o=n(38),a=n(57),u=n(27);e.groupBy=function(t,e){const n=new l;return t.forEach(t=>r.map(e(t),e=>n.add(e,t))),n};class l{constructor(t=new Map){this.store=t}get(t){return this.store.get(t)}has(t){return this.store.has(t)}get keyCount(){return this.store.size}get valueCount(){return a.sum([...this.store.values()].map(t=>t.length))}add(t,e){return u.tap(o.getOrSet(this.store,t,()=>[]),t=>t.push(e))}delete(t,e){if(null==e)return this.store.delete(t);{const n=this.store.get(t);if(null==n)return!1;{const i=s.remove(n,e);return i&&0===n.length&&this.store.delete(t),i}}}clear(){return this.store.clear(),this}keys(){const t=this;return function*(){for(const[e,n]of t.store.entries())n.length>0&&(yield e)}()}values(){const t=this;return function*(){for(const[,e]of t.store.entries())e.length>0&&(yield e)}()}flatValues(){const t=this;return function*(){for(const[,e]of t.store.entries())if(e.length>0)for(const t of e)yield t}()}entriesArray(){return[...this.store.entries()].filter(([,t])=>s.isNotEmpty(t))}entries(){const t=this;return function*(){for(const[e,n]of t.store.entries())n.length>0&&(yield[e,n])}()}tuples(){const t=this;return function*(){for(const[e,n]of t.store.entries())for(const t of i.toA(n))null!=t&&(yield[e,t])}()}filterInPlace(t){let e=!1;for(const[n,i]of this.store.entries()){const r=i.length;s.filterInPlace(i,e=>t(n,e)),e=e||r!==i.length}return e}}e.MultiMap=l},,,,,,function(t,e){t.exports=require("luxon")},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(15);e.retryOnReject=function(t,e){const n=r.Opt(e.errorIsRetriable).getOrElse(()=>()=>!0),s=r.Opt(e.onRetryWaitUntil).getOrElse(()=>()=>Promise.resolve());let o=0;const a=()=>i(this,void 0,void 0,function*(){try{return yield t()}catch(t){if(n(t)&&o<e.maxRetries)return o++,yield s(o),a();throw t}});return a()}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(87),s=n(22),o=n(5),a=n(8),u=n(16),l=n(6),c=n(17),d=n(15),h=n(18),f=n(39),p=n(4),m=n(21),g=n(3),y=n(2),v=n(51),S=n(50),w=n(11),b=n(14),P=n(34),E=n(28),x=n(1),M=n(38),_=n(7),T=n(0),O=n(23),k=n(187),D=n(47),I=g.lazy(()=>x.mkLogger("Pids"));function C(t,e){return i(this,void 0,void 0,function*(){return null!=t&&null!=e&&(t.name===h.toS(e.pid)&&A(yield t.readJSON(),e))})}e.addPid=function(t,e){return R.instance().addPid(t,e)};const F=10*u.secondMs;function A(t,e){if(null==t||null==e)return!1;const n=l.map(e.start,t=>t.getTime()),i=t.startTime;return _.gt0(n)&&_.gt0(i)&&Math.abs(n-i)<F}class R{constructor(t=P.BaseFile.for(f.App.userData()).join("pids")){this.pidsDir=t,this.p=new v.Promises,this.killOldProcs=(t={})=>this.p.serial("killOldProcs()",()=>i(this,void 0,void 0,function*(){const e=T.orElse(t.everything,!1),n=T.orElse(t.force,O.isWin),i=yield this.pidfiles(),r=yield M.toMapAsync(i,t=>y.thenMap(t.readJSON(),t=>[t.pid,t])),a=o.uniq(p.flatten(o.toA(r.values()).map(t=>[t.pid,t.ppid])));if(o.isEmpty(a))return I().debug("killOldProcs(): no pidfiles"),[];const u=yield k.pidInfos(a);if(I().debug("killOldProcs()",{pids:a,allEntries:u}),null==u)return void b.emitNonFatal("Pids.killOldProcs(): failed to get process information");const c=new Set(u.map(t=>t.pid)),d=u.filter(t=>r.has(t.pid)),h=o.sortBy(o.compact(d.map(t=>l.map(r.get(t.pid),e=>A(e,t)?Object.assign({},e,t):void 0))),t=>t.pid).filter(t=>s.pid!==t.pid),f=e?h:h.filter(e=>!c.has(e.ppid)||!c.has(e.pid)||_.gt0(e.timeoutTime)&&Date.now()>=e.timeoutTime||null!=t.everythingBefore&&e.startTime<t.everythingBefore);I().debug("killOldProcs()",{trackedEntries:d,victims:f,pidfiles:o.toA(r.values())});for(const t of f)I().info("killOldProcs(): killing",{entry:t}),L(t.pid,n,!1);return yield this.vacuumPids(),o.sortBy(f,t=>t.pid)}))}addPid(t,e){return i(this,void 0,void 0,function*(){if(null==t)throw new Error("undefined info");const n=t.pid;if(!_.gt0(n))throw new Error("undefined pid");if(!_.gte0(t.maxAgeMs))throw new Error("bad maxAgeMs: "+JSON.stringify(t));const i=this.pidsDir.join(t.pid+".json"),r=d.Opt(T.Try(()=>E.parse(t.cmd).base)).filter(a.notBlank).getOrElse(()=>t.cmd),s=e.getTime(),o=_.mapGt0(t.maxAgeMs,t=>s+t),u=Object.assign({},t,{cmd:r,startTime:s,timeoutTime:o});if(null==(yield i.writeJSON(u)))throw new Error("Failed to write to "+i);return I().debug("addPid() wrote "+i,u),i})}pidfiles(){return this.pidsDir.clear().children(t=>".json"===t.ext&&null!=c.toInt(t.name))}onKill(t){return i(this,void 0,void 0,function*(){const e=this.pidsDir.join(t+".json");return y.thenMap(e.clear().readJSON(),e=>this.addPid(Object.assign({},e,{maxAgeMs:1}),w.ago(u.minuteMs)).catch(e=>{I().info("onKill(): failed to rewrite pidfile: "+e,{pid:t})}))})}vacuumPids(){return i(this,void 0,void 0,function*(){const t=yield this.pidfiles(),e=o.toA(t).map(t=>c.toInt(t.name)).filter(_.gt0);if(o.isEmpty(e))return;const n=yield k.pidInfos(e);if(null!=n){I().info("vacuumPids",{pids:e,pidfiles:o.toA(t).map(t=>t.base),entries:n});for(const e of t){const t=n.find(t=>h.toS(t.pid)===e.name);null!=t&&(yield C(e,t))||(I().info("vacuumPids(): Removing old pidfile "+e.base,{psEntry:t,pidfile:yield e.readFile().then(h.toS).catch(t=>"(failed to read file: "+t+")")}),yield e.unlink())}}else b.emitNonFatal("Failed to get pidInfo for pids "+e)})}}function L(t,e=!1,n=!0){if(t===s.pid||t===s.ppid)throw new Error("cannot self-terminate");return e&&n&&R.instance().onKill(t),O.isWin?function(t,e=!1){return i(this,void 0,void 0,function*(){if(m.ending()||D.PowerShell.instance().ended)return r.kill(t,e);try{const n=o.compact(["Stop-Process","-Id",c.toInt(t),e?"-Force":void 0]).join(" ");yield D.PowerShell.instance().execute(n,T.identity)}catch(n){I().warn("killWin(): pwsh error, using TASKKILL: "+n),r.kill(t,e)}})}(t,e):function(t,e=!1){return i(this,void 0,void 0,function*(){try{s.kill(t,e?"SIGKILL":"SIGTERM")}catch(t){if(!String(t).includes("ESRCH"))throw t}})}(t,e)}function N(t){return i(this,void 0,void 0,function*(){return null!=(yield k.pidInfo(t))})}R.instance=g.lazy(()=>new R),e.Pids=R,e.kill=L,e.pidExists=N,e.pidNotExists=function(t){return y.thenNot(N(t))},e.ProcCleaner=g.lazy(()=>{const t=[{everything:!1,force:!1,intervalMs:5*u.minuteMs},{everything:!1,force:!0,intervalMs:17*u.minuteMs}].map(t=>S.setUnrefInterval(()=>R.instance().killOldProcs(t),t.intervalMs));return m.addCleanupEndable(new m.EndableWrapper("ProcCleaner",()=>(t.map(clearInterval),R.instance().killOldProcs())))})},,,function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.thenTap=function(t,e=console.dir.bind(console)){return i(this,void 0,void 0,function*(){const n=yield t;return yield e(n),n})},e.isPromise=function(t){return null!=t&&"function"==typeof t.then&&"function"==typeof t.catch}},,,function(t,e){t.exports=require("batch-cluster")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(8);e.onDataChunked=function(t,e,n){new r(e,n,!0).read(t)};class r{constructor(t,e,n=!0){this.sep=t,this.onData=e,this.filterBlanks=n,this.incompleteChunk=""}onChunk(t){if(null==t)return;const e=(this.incompleteChunk+t.toString()).split(this.sep);this.incompleteChunk=e.pop(),e.forEach(t=>{this.filterBlanks&&!i.notBlank(t)||this.onData(t)})}read(t){return t.on("data",t=>this.onChunk(t)),t.on("close",()=>this.onChunk("")),this}}e.Chunker=r},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(5),s=n(8),o=n(18),a=n(3),u=n(10),l=n(12);function c(t){const n=e.LogLevels.indexOf(t.toLowerCase());return-1===n?e.LogLevels.length-1:n}e.LogLevels=["error","warn","info","debug","trace"],e.levelIndex=c,e.silently=function(t){try{return e.logFilter().silent=!0,t()}finally{e.logFilter().silent=!1}},e.silentlyAsync=function(t){return i(this,void 0,void 0,function*(){try{return e.logFilter().silent=!0,yield t()}finally{e.logFilter().silent=!1}})},function(t){t.highlight=()=>!1,t.enabled=()=>!t.silent,t.defaultLevelIndex=c("trace"),t.silent=!1}(e.PermissiveLogFilter||(e.PermissiveLogFilter={}));const d=/^(?:(.+?):)?(error|warn|info|debug|trace)$/i;class h{constructor(t){this.silent=!1,this.contexts=[];let e=c(l.Settings.logLevel.defaultValue);const n=u.notBlank(t)?t:l.Settings.logLevel.valueOrDefault;r.compactBlanks(n.split(",")).forEach(n=>{const i=d.exec(n.trim());if(null==i)l.isTest||console.error("EnvLogFilter: Ignoring '"+n+"' from "+t);else{const t=o.toS(i[1]).toLowerCase(),n=c(i[2]);s.blank(t)?e=n:this.contexts.push({prefix:t,levelIndex:n})}}),this.defaultLevelIndex=e}contextOverride(t){if(0===this.contexts.length&&s.blank(t))return;const e=o.toS(t).toLowerCase();return this.contexts.find(t=>e.startsWith(t.prefix))}enabled(t,e){if(this.silent)return!1;const n=c(t),i=this.contextOverride(e);return n<=(null!=i?i.levelIndex:this.defaultLevelIndex)}highlight(t){const e=this.contextOverride(t);return null!=e&&e.levelIndex>=this.defaultLevelIndex}}e.LogFilterImpl=h,e.logFilter=a.lazy(()=>new h),l.Settings.logLevel.addListener(()=>e.logFilter.clear())},,,function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(5),s=n(6),o=n(2);e.True=()=>!0,e.not=function(t){return e=>!t(e)},e.and=function(...t){return e=>{for(const n of t)if(!n(e))return!1;return!0}},e.or=function(...t){return e=>{for(const n of t)if(n(e))return!0;return!1}},e.all=function(t,e){for(const n of t)if(!e(n))return!1;return!0},e.some=function(t,e){for(const n of t)if(e(n))return!0;return!1},e.none=function(t,e){for(const n of t)if(e(n))return!1;return!0},e.find=function(t,e){for(const n of t)if(e(n))return n},e.filter=function(t,e){return i(this,void 0,void 0,function*(){return null==t||null==e?s.mapOr(t,r.compact,()=>[]):o.asyncFilter(t,e)})},e.apply=function(t,e){return i(this,void 0,void 0,function*(){return null==t||null==e?t:(yield e(t))?t:void 0})}},,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getOrSet=function(t,e,n){if(t.has(e))return t.get(e);{const i=n();return t.set(e,i),i}}},function(t,e){t.exports=require("stream")},,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(65),r=n(9),s=n(26),o=n(7),a=n(19),u=/^(.+?)(?:--|\/)(.+?)(?:(?:\/)(\d+)\/(\d+))?$/;class l{constructor(t,e,n,i=0,r=1){this.start=t,this.middle=e,this.end=n,this.index=i,this.splits=r,this.toISOString=this.toString.bind(this),this.year=s.getYear(this.middle),this.month=s.getMonth(this.middle),this.day=s.getDay(this.middle)}static parse(t){t=a.toS(t).trim();const e=u.exec(t);if(null==e)return;const n=i.ExifDateTime.fromISO(e[1]),r=i.ExifDateTime.fromISO(e[2]),s=o.toInt(e[3]),l=o.toInt(e[4]);return this.for(n,r,s,l)}static for(t,e,n=0,i=1){if(!s.validDate(t)||!s.validDate(e))return;const a=s.toDateTime(t),u=s.toDateTime(e);if(null==a||null==u)return;i=o.clamp(1,1e3,o.toInt(i,{defaultValue:1})),n=o.clamp(0,i-1,o.toInt(n,{defaultValue:0}));const c=r.map(a.toDateTime().until(u.toDateTime()).divideEqually(i+1)[n],t=>t.end);return null!=c?new l(a,s.toDateTime(c,a.zone),u,n,i):void 0}interval(){return this.start.toDateTime().until(this.end.toDateTime())}toDateTime(){return this.middle.toDateTime()}toDate(){return this.toDateTime().toJSDate()}get hasTimes(){return s.hasTime(this.start)&&s.hasTime(this.end)}toString(t=!0){return`${s.datedToISO(this.start,t)}/${s.datedToISO(this.end,t)}`+(0===this.index&&1===this.splits?"":`/${this.index}/${this.splits}`)}includes(t){if(null==t)return!1;const e=s.toDateTime(t);return null!=e?this.interval().contains(e.toDateTime()):this.year===s.getYear(t)&&this.month===s.getMonth(t)&&this.day===s.getDay(t)}}e.DateInterval=l},function(t,e){t.exports=require("fs-extra")},function(t,e,n){"use strict";function i(t){return t instanceof Set?t:new Set([...t])}Object.defineProperty(e,"__esModule",{value:!0}),e.asSet=i,e.union=function(t,e){return new Set([...t,...e])},e.intersection=function(t,e){const n=i(e);return new Set([...t].filter(t=>n.has(t)))},e.diff=function(t,e){const n=i(e);return new Set([...t].filter(t=>!n.has(t)))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(95),s=n(6),o=n(33),a=n(2),u=n(130),l=n(25),c=n(0),d=n(19);e.LogLevels=o.strEnum("error","warn","info","debug","trace");const h=()=>void 0;e.NoOpLogger={enabled:()=>!1,log:h,flush:()=>Promise.resolve(),close:h,error:h,warn:h,info:h,debug:h,trace:h},e.safeLogger=function(t){return{enabled:(e,n)=>c.Try(()=>t.enabled(e,n),()=>!1),log:(e,n,i,r)=>c.Try(()=>t.log(e,n,i,r)),flush:()=>a.tryAsync(()=>t.flush()),close:()=>a.tryAsync(()=>t.close())}};const f=/^[a-z]*/i;e.MaxRecentLogEntriesByLevel=20;const p=new Map;e.clearRecentLogEntries=function(){p.clear()},e.recentLogEntries=function(){const t=[];for(const e of p.values())t.push(...e.toA());return i.sortBy(t,t=>t.timestamp)};e.ContextualLogger=class{constructor(t,e){this.context=t,this.logger=e,this.error=(t,e)=>{this.log("error",t,e)},this.warn=(t,e)=>{this.log("warn",t,e)},this.info=(t,e)=>{this.log("info",t,e)},this.debug=(t,e)=>{this.log("debug",t,e)},this.trace=(t,e)=>{this.log("trace",t,e)},this.filterContext=s.mapOr(f.exec(d.toS(this.context)),t=>t[0],()=>this.context)}throw(t,e){const n=l.asError(t);throw this.log("error",l.errorToS(n),e),n}log(t,n,i){var s;"trace"!==t&&(s={timestamp:Date.now(),level:t,context:this.context,msg:n,meta:i},r.getOrSet(p,s.level,()=>new u.BoundedList(e.MaxRecentLogEntriesByLevel)).push(s)),this.enabled(t)&&c.map(this.logger(),e=>e.log(t,this.context,n,i))}enabled(t){const e=this.logger();return null!=e&&e.enabled(t,this.filterContext)}flush(){return this.logger().flush()}close(){return c.map(this.logger(),t=>t.close())}}},,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(5),r=n(4),s=n(10),o=n(63),a=n(11),u=n(48),l=n(7),c=n(0),d=n(100),h=n(19);function f(t,e){if(null==t)return e;if(null==e)return t;if((t=t.normalize())===(e=e.normalize())||e.includes(t))return t;if(t.includes(e))return e;const n=new l.Array2D(t.length);let i=0,r="";for(let s=0;s<t.length;s++)for(let o=0;o<e.length;o++)t[s]===e[o]&&(0===s||0===o?n.set(s,o,1):n.set(s,o,n.get(s-1,o-1)+1),n.get(s,o)>=i&&(i=n.get(s,o),r=t.substr(s-i+1,i)));return r}function p(t,e){if(null!=t&&null!=e)return t=t.normalize(),e=e.normalize(),t.length!==e.length?void 0:t.split("").reduce((t,n,i)=>n===e.charAt(i)?t:t+1,0)}e.commonSubstringRatio=function(t,e){return[t,e].some(s.blank)?0:f(t,e).length/Math.max(t.length,e.length)},e.lcs=f,e.hamming=p;const m=new o.BoundedMap(10*a.minuteMs,1e4,!0),g=String.fromCharCode(31);function y(t,e){return t=t.normalize(),e=e.normalize(),m.getOrSet(r.sort([t,e]).join(g),()=>{if(0===t.length)return e.length;if(0===e.length)return t.length;const n=t.charAt(t.length-1)===e.charAt(e.length-1)?0:1,i=t.slice(0,-1),r=e.slice(0,-1);return Math.min(y(i,e)+1,y(t,r)+1,y(i,r)+n)})}function v(t,e){const n=t.toUpperCase().normalize(),i=e.toUpperCase().normalize();return c.firstThunk(()=>n===i?1:void 0,()=>s.blank(t)!==s.blank(e)?0:void 0,()=>1===t.length&&1===e.length?0:void 0,()=>{const t=S(n),e=S(i);return 2*w(t,e).length/(t.length+e.length)})}function S(t){return null==t||0===t.length?[]:t.slice(0,-1).split("").map((e,n)=>e+t[n+1])}function w(t,e){const n=d.intersection(t,e),i=[];return n.forEach(n=>{const s=Math.min(r.count(t,t=>t===n),r.count(e,t=>t===n));l.times(s,()=>i.push(n))}),i}function b(t,e,n){const r=i.commonPrefixLength(t,e);return n(t.substr(r))-n(e.substr(r))}function P(t){const e=s.compactBlanks(h.toS(t).split(/[^\d]+/));return r.sortBy(e,t=>-t.length)[0]}function E(t,e){const[n,i]=[t,e].map(P).map(t=>s.blank(t)?"":t);return b(n,i,t=>l.toInt(t,{defaultValue:0}))}e.levenshtein=y,e.diceCoeff=v,e.bigrams=S,e.nonUniqIntersection=w,e.lnsDiff=E;const x=/[^0-9a-z]+/gi;function M(t,e){const[n,i]=[t,e].map(t=>h.toS(t).replace(x,"").toLowerCase());return b(n,i,t=>u.RadixAlphaNum.decode(t))}e.radixDiff=M,e.str=function(t,e){return{pref:i.commonPrefixLength(t,e),lev:y(t,e),ham:p(t,e),dice:v(t,e),lns:E(t,e),radixDiff:M(t,e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(35),r=n(157),s=n(9),o=n(105),a=n(2),u=n(7),l=750;e.PushProgressObserver=class{constructor(t,e){this.context=t,this.total=e,this.start=Date.now(),this.emit=o.throttle(()=>{r.emitProgressEvt(Object.assign({},this.context,{pct:u.sigFigs(100*this.current/this.total,3),elapsedMs:Date.now()-this.start}))},l,!0)}onProgress(t){this.current=u.clamp(0,this.total,t),this.emit()}};e.PullProgressObserver=class{constructor(t,e,n){this.ctx=t,this.total=e,this.progress=n,this.start=Date.now(),this.onInterval=o.throttle(()=>a.thenMap(this.progress(),t=>this.emit(t)),l),this.timer=i.setInterval(()=>this.onInterval(),l)}observe(t){return t.then(()=>this.completed()).catch(()=>this.end()),t}emit(t){s.map(t,t=>r.emitProgressEvt(Object.assign({},this.ctx,{pct:100*u.clamp(0,this.total,t)/this.total,elapsedMs:Date.now()-this.start})))}completed(){Date.now()-this.start>l&&this.emit(this.total),this.end()}end(){s.map(this.timer,t=>i.clearInterval(t)),this.timer=void 0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throttle=function(t,e,n=!1){let i=n?Date.now()+e:0,r=0;const s=()=>{const n=Date.now();return n>=i?(i=n+e,r++,t()):void 0};return s.count=()=>r,s}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(43),r=n(30),s=n(22),o=n(3),a=n(0);function u(t){const e=[];for(;t!==r.dirname(t);)t=r.dirname(t),e.push(t);return e}function l(t){try{return i.readdirSync(t)}catch(t){return[]}}function c(t,e){const n=l(t);return e.every(t=>n.includes(t))}function d(t,e){return u(t).find(t=>c(t,e))}e.execDir=o.lazy(()=>r.dirname(process.execPath)),e.ancestors=u,e.childrenSync=l,e.hasChildren=c,e.ancestorWithChildren=d,function(t){function n(e){return o.lazy(()=>r.join(t.Root(),e))}t.Root=o.lazy(()=>{const t=["migrations","public","tools","views"];return a.firstThunk(()=>[r.join(e.execDir(),"resources"),r.join(e.execDir(),"..","Resources"),e.execDir(),process.cwd()].find(e=>c(e,t)),()=>d(s.cwd(),t),()=>{throw new Error("Failed to find project root.")})}),t.Migrations=n("migrations"),t.Public=n("public"),t.Tools=n("tools"),t.Views=n("views")}(e.ProjectPath||(e.ProjectPath={}))},,,,,,,,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(127),r=n(42),s=n(15),o=n(10),a=n(72),u=n(12),l=n(19),c=n(89);e.OnlyMessages={formatLogEntry:t=>t.msg,format:(t,e,n,i)=>n};const d=[{re:/sync-file/,f:i.default.bgCyan},{re:/sync/,f:i.default.bgBlue},{re:/web/,f:i.default.bgGreen},{re:/db/,f:i.default.bgMagenta},{re:/main/,f:i.default.bgRed}];class h{constructor(t={}){this.chalkedLevels=new Map,this.inspectOptions=Object.assign(h.defaultInspectOptions(),t),u.Settings.logColor.valueOrDefault?(i.default.enabled=!0,i.default.level=1):(this.inspectOptions.colors=!1,i.default.enabled=!1),u.isTest&&(this.inspectOptions.breakLength=255),this.chalkedLevels.set("error",a.red("error")),this.chalkedLevels.set("warn",a.yellow("warn ")),this.chalkedLevels.set("info",a.green("info ")),this.chalkedLevels.set("debug",a.blue("debug")),this.prefix=s.Opt(t.prefix).flatMap(t=>s.Opt(d.find(e=>null!=t.match(e.re))).map(e=>e.f(a.black(t))).getOrElse(()=>t)).getOrElse(()=>"")}formatLogEntry(t){return o.compactBlanks([a.grey(new Date(t.timestamp).toISOString()),this.chalkedLevels.get(t.level),a.blue(t.context),t.msg,f(t.meta,this.inspectOptions)]).map(t=>l.toS(t)).join(" ")}format(t,e,n,i){const r=c.logFilter().highlight(e)?a.yellow:a.blue;return o.compactBlanks([a.grey((new Date).toISOString()),this.prefix,this.chalkedLevels.get(t),r(e),n,f(i,this.inspectOptions)]).map(t=>l.toS(t)).join(" ")}}function f(t,e){return null==t?t:r.inspect(t,e)}h.defaultInspectOptions=()=>({showHidden:!1,depth:4,compact:!0,colors:!0,customInspect:!0,maxArrayLength:25}),e.ColoredLogFormatter=h,e.DefaultLogFormatter=new h},,,,,,,function(t,e){t.exports=require("chalk")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(45),r=n(30),s=n(22),o=n(8),a=n(69);e.appData=function(){const t=a.getEnv("APPDATA");if(o.notBlank(t))return r.resolve(t);switch(i.platform()){case"win32":return r.resolve(i.homedir(),"AppData","Roaming");case"darwin":return r.resolve(i.homedir(),"Library","Application Support");case"linux":return o.firstNotBlank(s.env.XDG_DATA_HOME,s.env.XDG_CONFIG_HOME,r.resolve(i.homedir(),".config"));default:throw new Error("Platform not supported")}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AppName="PhotoStructure"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(17),r=n(7);e.BoundedList=class{constructor(t){if(this.maxLength=t,this._length=0,this._firstIndex=0,t>1e3)throw new Error("BoundedList.maxLength of "+t);this.store=new Array(...r.times(t,()=>null))}mapIndex(t,e){return t<0||t>this._length-1?void 0:e((t+this._firstIndex+this.maxLength)%this.maxLength)}get(t){return this.mapIndex(t,t=>this.store[t])}set(t,e){return this.mapIndex(t,t=>this.store[t]=e)}get length(){return this._length}set length(t){this._length=i.clamp(0,this._length,t)}[Symbol.iterator](){const t=this;return function*(){for(let e=0;e<t.length;e++)yield t.mapIndex(e,e=>t.store[e])}()}push(...t){for(const e of t)this._length<this.maxLength?this._length++:(this._firstIndex++,this._firstIndex=this._firstIndex%this.maxLength),this.mapIndex(this._length-1,t=>{this.store[t]=e});return this._length}pop(){return this.mapIndex(this._length-1,t=>(this._length--,this.store[t]))}unshift(...t){for(const e of t.reverse())this._length<this.maxLength&&this._length++,this._firstIndex--,this.mapIndex(0,t=>{this.store[t]=e,this._firstIndex=t});return this._length}shift(){return this.mapIndex(0,t=>(this._firstIndex++,this._length--,this.store[t]))}every(t){for(let e=0;e<this._length;e++)if(!t(this.get(e),e))return!1;return!0}some(t){for(let e=0;e<this._length;e++)if(t(this.get(e),e))return!0;return!1}forEach(t){for(let e=0;e<this._length;e++)t(this.get(e),e)}map(t){const e=[];for(let n=0;n<this._length;n++)e.push(t(this.get(n),n));return e}reduce(t,e){let n=e;for(let e=0;e<this._length;e++)n=t(n,this.get(e),e);return n}reverse(){for(let t=0;t<Math.floor(this._length/2);t++)this.mapIndex(t,e=>{this.mapIndex(this._length-1-t,t=>{const n=this.store[t];this.store[t]=this.store[e],this.store[e]=n})});return this}toA(){return[...this]}slice(t,e){return[...this].slice(t,e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(4),r=n(67),s=n(0),o=n(27);e.CountingSet=class{constructor(){this.m=new Map}incr(t,e=1){const n=this.get(t)+e;return 0===n?this.m.delete(t):this.m.set(t,n),this}get(t){return s.orElse(this.m.get(t),()=>0)}has(t){return this.m.has(t)}get size(){return this.m.size}keys(){return this.m.keys()}entries(){return this.m.entries()}entriesByCountDesc(){return i.sortBy([...this.entries()],([,t])=>-t)}top(t=1){return this.entriesByCountDesc().slice(0,t)}get averageCounts(){return o.tap(new r.Average(this.size),t=>[...this.m.values()].forEach(e=>t.push(e)))}forEach(t){this.m.forEach(t)}clear(){this.m.clear()}get toS(){return i.sort([...this.keys()]).map(t=>t+" "+this.get(t)).join("\n")}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(87),r=n(22),s=n(16),o=n(6),a=n(18),u=n(21),l=n(14),c=n(1),d=n(81);class h{constructor(t,e){this.name=t,this.bc=e}get ended(){return this.bc.ended}end(){return this.bc.end()}}e.observeBatchCluster=function(t,e,n=u.EndableRanks.service){const f=c.mkLogger(e);return i.setLogger(f),u.addEndable(n,new h(e,t)),t.on("childStart",n=>d.addPid({pid:n.pid,ppid:r.pid,cmd:e,maxAgeMs:t.options.maxProcAgeMillis+s.minuteMs},new Date)),t.on("startError",t=>{l.emitFatal("Failed to start "+e,t)}),t.on("taskError",(t,n)=>{if(!a.toS(t).includes("end() called when not idle")&&!u.ending()){const i=o.map(n,t=>t.command);f.warn("observeBatchCluster.taskError()",{error:t,cmd:i}),l.emitNonFatal(e+" failed to run "+i,t)}}),t.on("internalError",t=>{f.warn("observeBatchCluster.internalError()",t),l.emitNonFatal("Internal error from "+e,t)}),t.on("endError",t=>{f.warn("observeBatchCluster.endError()",t),f.error("Failed to shut down: "+t)}),t}},function(t,e){t.exports=require("crypto")},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(9),s=n(3),o=n(89),a=n(120),u=n(101);class l{constructor(t,e=[["error",console.error]]){this.logFilter=t,this.loggers=r.fromEntries(e)}log(t,e,n,i){(this.loggers[t]||console.log)(a.DefaultLogFormatter.format(t,e,n,i))}enabled(t,e){return this.logFilter.enabled(t,e)}flush(){return i(this,void 0,void 0,function*(){})}close(){}}l.instance=s.lazy(()=>new l(o.logFilter())),e.ConsoleLogger=l,e.mkConsoleLogger=function(t){return new u.ContextualLogger(t,()=>l.instance())}},,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(30),r=n(22),s=n(5),o=n(8),a=n(46),u=n(6),l=n(17),c=n(9),d=n(41),h=n(15),f=n(33),p=n(18),m=n(29),g=n(0);e.SettingCategories=f.strEnum("System","Logging","Updates","ErrorReporting","Tools","Web","Sync","Filters"),e.LibraryCategories=Object.freeze([e.SettingCategories.Web,e.SettingCategories.Sync,e.SettingCategories.Filters]),e.SystemCategories=Object.freeze(f.strEnumValues(e.SettingCategories).filter(t=>!e.LibraryCategories.includes(t)));class y{constructor(t){this.opts=t,this.listeners=[],y.instances.push(this),this.readFromEnv(),this.addToChildProcs=!0===t.addToChildProcs}static importSavedPref(t){return o.mapNotBlank(t.key,e=>u.map(this.instances.find(t=>t.key===e),e=>g.Try(()=>c.tap(e,e=>e.value=t.value))))}readFromEnv(){if(!this.hasValue())return h.Opt(r.env[this.opts.key]).filter(o.notBlank).orElse(()=>h.Opt(this.opts.alternateKeys).map(t=>t.map(t=>r.env[t])).flatMap(t=>t.find(o.notBlank))).flatMap(this.opts.fromEnv).map(t=>this.value=t).get()}addListener(t){this.listeners.push(t),this.hasValue()&&setImmediate(()=>t(this.value))}removeListener(t){s.filterInPlace(this.listeners,e=>e===t)}onChange(){const t=this.value;this.listeners.forEach(e=>e(t))}get name(){return this.opts.name}get key(){return this.opts.key}get category(){return this.opts.category}get persisted(){return this.opts.persisted}get advanced(){return g.orElse(this.opts.advanced,!0)}get value(){return this._value}set value(t){const e=this._value;this._value=this.opts.fromEnv(this.opts.toEnv(t)),a.eql(e,this._value)||this.onChange()}set valueFromFile(t){this.value!==this.defaultValue&&(this.value=t)}get defaultValue(){return d.isFunction(this.opts.defaultValue)?this.opts.defaultValue():this.opts.defaultValue}get valueOrDefault(){return g.orElse(this.value,this.defaultValue)}addToEnv(t,e){const n=g.orElse(t,r.env);return n[this.opts.key]=v(this.opts.toEnv(g.orElse(e,this.valueOrDefault))),n}deleteFromEnv(t){const e=g.orElse(t,r.env);return delete e[this.opts.key],u.map(this.opts.alternateKeys,t=>t.forEach(t=>{delete e[t]})),e}hasValue(){return null!=this.value}clear(){return this._value=void 0,this.onChange(),this}addToJSON(){return{}}toJSON(){return{key:this.opts.key,value:this.value,defaultValue:this.opts.defaultValue,description:this.opts.description}}}y.instances=[],e.Setting=y;const v=t=>o.notBlank(t)&&"undefined"!==t?p.toS(t).trim():void 0;function S(t,e){const n=p.toS(t).toLowerCase();return e.find(t=>t.toLowerCase()===n)}e.StringSetting=class extends y{constructor(t){super(Object.assign({toEnv:v,fromEnv:v},t))}hasValue(){return o.notBlank(this.value)}};e.StringEnumSetting=class extends y{constructor(t){if(super(Object.assign({toEnv:e=>S(e,t.validValues),fromEnv:e=>S(e,t.validValues)},t)),this.validValues=t.validValues,!this.validValues.includes(this.defaultValue))throw new Error(`validValues, ${this.validValues}, doesn't include defaultValue, ${t.defaultValue}`)}addToJSON(){return{validValues:this.validValues}}};e.StringArraySetting=class extends y{constructor(t){super(Object.assign({defaultValue:[],fromEnv:t=>o.mapNotBlank(t,t=>{try{return s.compactBlankish(s.toA(JSON.parse(t)))}catch(e){return s.compactBlankish(t.split(i.delimiter))}}),toEnv:t=>u.map(t,t=>JSON.stringify(s.uniq(t)))},t))}get values(){return s.uniq(s.compactBlanks(this.valueOrDefault))}push(...t){this.value=s.uniq(s.compactBlanks(this.valueOrDefault.concat(...t)))}removeValue(t){u.map(this.value,e=>this.value=e.filter(e=>e!==t))}};e.StringEnumsSetting=class extends y{constructor(t){super(Object.assign({defaultValue:t.defaultValue,fromEnv:t=>o.mapNotBlank(t,t=>{try{return this.asValidValues(JSON.parse(t))}catch(e){return this.asValidValues(t.split(i.delimiter))}}),toEnv:t=>u.map(t,t=>JSON.stringify(s.uniq(t)))},t)),this.validValues=t.validValues}asValidValues(t){return s.compactBlankish(s.toA(t).map(t=>S(p.toS(t),this.validValues)))}addToJSON(){return{validValues:this.validValues}}};e.IntegerSetting=class extends y{constructor(t){super(Object.assign({},t,{toEnv:v,fromEnv:l.toInt}))}};e.BoundedIntegerSetting=class extends y{constructor(t){super(Object.assign({},t,{toEnv:v,fromEnv:e=>h.Opt(e).flatMap(parseInt).map(e=>l.clamp(t.min,t.max,e)).get()})),this.options=t}addToJSON(){return{minValue:this.options.min,maxValue:this.options.max}}};e.BooleanSetting=class extends y{constructor(t){super(Object.assign({},t,{toEnv:v,fromEnv:m.toBoolean}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(4),r=n(23);e.crlf=function(t){const n=t.trim()+"\n";return r.isWin?n.replace(e.newlineRe,"\r\n"):n},e.newlineRe=/\r?\n/gm,e.splitLines=function(...t){return i.flatten(t.map(t=>t.split(e.newlineRe)))}},,,,,,function(t,e){t.exports=require("readline")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(33);e.FitSizes=i.strEnum("uhd8k","uhd5k","uhd4k","qhd","fhd","hd","wvga","qvga","qqvga"),e.FitSizeValues=i.strEnumValues(e.FitSizes),e.SqSizes=i.strEnum("s480","s240","s120","s60"),e.SqWidths=[60,120,240,480]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(35),r=n(17);function s(t){return o(t,!1)}function o(t,e){return new Promise(n=>{if(t<=0)n();else{const r=i.setTimeout(()=>n(),Math.round(t+1));e&&r.unref()}})}e.unrefDelay=function(t){return o(t,!0)},e.delay=s,e.delayUntil=function(t){const e=(r.gt0(t)?t:t.getTime())-Date.now();if(e<0){if(e>-500)return;throw new Error("Mr. Fusion not found, cannot time travel back "+-e+"ms")}return s(e).then(()=>e)},e.later=function(t,e=1){return i.setTimeout(t,Math.max(1,Math.round(e)))}},,,,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(8),r=n(17),s=n(7),o=n(14);function a(t){return null!=t&&i.notBlank(t.path)&&i.notBlank(t.op)&&s.within(0,100,t.pct)}e.isProgressEvt=a;const u="progress";e.emitProgressEvt=function(t){a(t)&&o.eventEmitter.emit(u,Object.assign({},t,{pct:r.sigFigs(r.clamp(0,100,t.pct),2)}))},e.onProgressEvt=function(t){o.eventEmitter.on(u,t)},e.removeProgressEvtListener=function(t){return o.eventEmitter.removeListener(u,t)}},,,,,,,,,,,,,,,,function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(43),s=n(99),o=n(30),a=n(5),u=n(6),l=n(2),c=n(13),d=n(28);class h{constructor(t,e){this.dir=t,this.nativePath=o.join(this.dir,e.name),this.ext=d.extname2(e.name),this.base=e.name,this.name=c.stripSuffix(this.base,this.ext),this._isFile=e.isFile(),this._isDirectory=e.isDirectory(),this._isSymbolicLink=e.isSymbolicLink()}static for(t){return i(this,void 0,void 0,function*(){const e=d.parse(t);return s.stat(t).then(t=>new h(e.dir,{name:e.base,isFile:t.isFile.bind(t),isDirectory:t.isDirectory.bind(t),isSymbolicLink:t.isSymbolicLink.bind(t)})).catch(()=>void 0)})}toString(){return this.nativePath}isFile(){return this._isFile}isDirectory(){return this._isDirectory}isSymbolicLink(){return this._isSymbolicLink}parent(){const t=d.parse(this.dir);return t.dir===this.dir?this:new h(t.dir,{name:t.base,isFile:function(){return!1},isDirectory:function(){return!0},isSymbolicLink:function(){return!1}})}children(){return this.isDirectory()?new Promise((t,e)=>{r.readdir(this.nativePath,{withFileTypes:!0},(n,i)=>{null!=n?e(n):t(u.map(i,t=>a.sortBy(t,t=>t.name.toLowerCase().normalize()).map(t=>new h(this.nativePath,t))))})}):void 0}stat(){return s.stat(this.nativePath).catch(()=>void 0)}size(){return i(this,void 0,void 0,function*(){return l.thenMap(this.stat(),t=>t.size)})}mtimeMs(){return i(this,void 0,void 0,function*(){return l.thenMap(this.stat(),t=>t.mtimeMs)})}}e.DirectoryEntry=h},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(43),s=n(35),o=n(6),a=n(21),u=n(51),l=n(50),c=n(11),d=n(54),h=n(12),f=n(134),p=n(89),m=n(120);e.CaptureLogger=class{constructor(){this.logEntries=[]}log(t,e,n,i){this.logEntries.push({timestamp:Date.now(),level:t,context:e,msg:n,meta:i})}enabled(){return!0}close(){}flush(){return i(this,void 0,void 0,function*(){})}};e.LogWriter=class{constructor(t,e,n={}){this.logdir=t,this.prefix=e,this.ended=!1,this.mutex=new u.Promises,this._linesSinceRotate=0,this.pendingWrites=[],this._startIndex=0,this.maybeFlush=()=>{this.mutex.maybeRun("maybeFlush",()=>this._flush())},this.shouldRotate=()=>null==this._stream||this._linesSinceRotate>=this.opts.maxLinesPerFile,this.flush=()=>this.mutex.serial("flush",()=>this._flush()),this.name="GzLogWriter("+t+")",this.opts=Object.assign({filter:p.logFilter(),maxLinesPerFile:25e4,logFormatter:new m.ColoredLogFormatter({prefix:e}),errorLogger:f.ConsoleLogger.instance(),flushEveryMs:500},n),this.flushInterval=l.setUnrefInterval(()=>this.maybeFlush(),this.opts.flushEveryMs),a.addLoggerEndable(this)}enabled(t,e){return this.opts.filter.enabled(t,e)}log(t,e,n,i){this.opts.filter.enabled(t,e)&&(this.ended&&p.levelIndex(t)<=1?this.opts.errorLogger.log(t,e,n,i):this.pendingWrites.push(this.opts.logFormatter.format(t,e,n,i)+"\n"))}end(){return i(this,void 0,void 0,function*(){return this.ended=!0,o.map(this.flushInterval,s.clearInterval),this.flushInterval=void 0,this.close()})}close(){return i(this,void 0,void 0,function*(){return yield this.flush(),this.mutex.serial("close",()=>this._closeCurrent())})}_flush(){return i(this,void 0,void 0,function*(){const t=[...this.pendingWrites];for(this.pendingWrites.length=0;t.length>0;){this.shouldRotate()&&(yield this._rotate());const e=this._stream;if(null==e)return void this.opts.errorLogger.log("error","LogWriter.flush()","this._rotate() returned an empty stream");const n=this.opts.maxLinesPerFile-this._linesSinceRotate,i=t.splice(0,n);this._linesSinceRotate+=i.length,e.write(i.join(""))}})}errback(t){return e=>this.opts.errorLogger.log("error","Caught error from "+t,e)}_rotate(){return i(this,void 0,void 0,function*(){yield this._closeCurrent(),this._currentFile=yield this.logdir.join(c.datestamp(),this.prefix+".log").ensureNew({emptyIsNew:!0,startIndex:++this._startIndex,requireNumber:!0,leftPad:3}),this._stream=r.createWriteStream(this._currentFile.nativePath).on("error",this.errback("file write stream"))})}_closeCurrent(){return i(this,void 0,void 0,function*(){yield o.map(this._stream,t=>d.end(t)),this._stream=void 0,this._linesSinceRotate=0,h.Settings.logCompression.valueOrDefault&&(yield o.map(this._currentFile,t=>t.gzip())),this._currentFile=void 0})}}},,,,function(t,e){("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"0.6.0-alpha.1+20190821062758"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isIterable=function(t){return null!=t&&"string"!=typeof t&&"function"==typeof t[Symbol.iterator]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(41);e.isList=function(t){return null!=t&&(Array.isArray(t)||isFinite(t.length)&&i.isFunction(t[Symbol.iterator])&&i.isFunction(t.push)&&i.isFunction(t.pop)&&i.isFunction(t.forEach)&&i.isFunction(t.some))}},function(t,e){t.exports=require("he")},function(t,e){t.exports=require("events")},function(t,e){t.exports=require("zlib")},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(41);e.asPromise=function(t){return i(this,void 0,void 0,function*(){return r.isFunction(t)?t():t})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(27);e.MRUMap=class{constructor(t=1e3,e=!1){if(this.maxSize=t,this.fifo=e,this.delegate=new Map,this.expireListeners=[],t<1)throw new Error("maxSize must be positive")}get size(){return this.delegate.size}clear(){return this.delegate.clear(),this}delete(t){return this.delegate.delete(t)}entries(){return this.delegate.entries()}forEach(t){this.delegate.forEach(t)}get(t){if(this.delegate.has(t)){const e=this.delegate.get(t);return this.fifo||(this.delegate.delete(t),this.delegate.set(t,e)),e}}getOrSet(t,e){return this.delegate.has(t)?this.get(t):i.tap(e(),e=>this.set(t,e))}has(t){return this.delegate.has(t)}keys(){return this.delegate.keys()}set(t,e){return this.delegate.set(t,e),this.vacuum(),this}values(){return this.delegate.values()}[Symbol.iterator](){return this.entries()}on(t,e){this.expireListeners.push(e)}vacuum(){if(this.delegate.size>this.maxSize)for(const[t,e]of this.delegate)if(this.delegate.delete(t),this.expireListeners.forEach(n=>n(t,e)),this.delegate.size<=this.maxSize)return}}},function(t,e){t.exports=require("child_process")},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(22),s=n(5),o=n(4),a=n(21),u=n(3),l=n(2),c=n(10),d=n(20),h=n(11),f=n(68),p=n(60),m=n(1),g=n(7),y=n(0),v=n(23),S=n(47),w=n(19),b=u.lazy(()=>m.mkLogger("Ps"));function P(t){return null!=t&&g.gt0(t.pid)&&null!=t.start&&c.notBlank(t.cmd)}function E(t){return i(this,void 0,void 0,function*(){const e=s.toA(t).filter(g.gt0);if(s.isEmpty(e))throw new Error("Invalid pids: "+JSON.stringify(t));return l.thenTap(l.thenMap(v.isWin?function(t){return i(this,void 0,void 0,function*(){if(a.ending()||S.PowerShell.instance().ended)return D(t);const e=[M,"-Id",T(t),"-ErrorAction SilentlyContinue",_].join(" ");return l.thenMap(S.PowerShell.instance().executeJsonToA(e),t=>x(t))})}(e):function(t){return i(this,void 0,void 0,function*(){return I((yield d.stdoutResult("ps",["-p",T(t),"-wwwo","pid,lstart,command"],Object.assign({},O,{ignoreExitCode:!0}))).result)})}(e),t=>t.filter(t=>P(t)&&e.includes(t.pid))),t=>b().debug("pidInfo()",{pids:e,result:t}))})}function x(t){return t.map(t=>({pid:t.Id,start:h.pwshJsonDate(t.StartTime),cmd:t.ProcessName}))}e.ps=function(){return i(this,void 0,void 0,function*(){const t=yield v.isWin?function(){return i(this,void 0,void 0,function*(){if(a.ending()||S.PowerShell.instance().ended)return D();const t=yield S.PowerShell.instance().executeJsonToA([M,_].join(" "));return null==t?D():x(t)})}():function(){return i(this,void 0,void 0,function*(){return I(yield d.stdout("ps",["-ewwwo","pid,lstart,command"],O))})}();return y.orElse(o.sortBy(t.filter(P),t=>t.pid),[])})},e.pidInfo=function(t){return i(this,void 0,void 0,function*(){return l.thenMap(E([t]),e=>s.toA(e).find(e=>e.pid===t))})},e.pidInfos=E;const M="Get-Process",_="| Select-Object -Property Id,ProcessName,StartTime";function T(t){return s.uniq([...t.filter(g.gt0),r.pid]).join(",")}const O={maxBuffer:1048576,timeout:15*h.secondMs,ignoreExitCode:!0,ignoreStderr:!0},k=["CommandLine","CreationDate","ProcessId"];function D(t){return i(this,void 0,void 0,function*(){const e=["process"];if(s.isNotEmpty(t)){const n=s.uniq([...t.filter(g.gt0),r.pid]).map(t=>`ProcessId=${t}`).join(" or ");e.push("where",n)}e.push("get",k.join(","));const n=yield d.stdoutResult(p.wmic(),e,O);return y.onlyReqValued(f.parseFixed(k,n.result).map(t=>({pid:g.toInt(t.ProcessId,{defaultValue:-1}),start:h.wmiDate(t.CreationDate),cmd:w.toS(t.CommandLine)})))})}function I(t){return f.parseFixed(["PID",{greedyLeft:!0,text:"STARTED"},"COMMAND"],t).map(t=>({pid:g.toInt(t.PID,{defaultValue:-1}),start:new Date(t.STARTED),cmd:w.toS(t.COMMAND)}))}e.psWinWmic=D},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(36),r=n(96);e.WritableToBuffer=class extends r.Duplex{constructor(t){super(t),this.deferred=new i.Deferred("WritableToBuffer"),this._buf=[],this.on("finish",()=>{this.deferred.resolve(this.data)}),this.on("error",t=>{this.deferred.reject(t)})}get data(){return Buffer.concat(this._buf)}get buffer(){return this.deferred.promise}_read(){}_write(t,e,n){const i=Buffer.isBuffer(t)?t:Buffer.from(t,e);this._buf.push(i),n()}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});e.CompoundLogger=class{constructor(t,...e){if(this.primary=t,null==t)throw new Error("null primary logger");this.delegates=[t,...e]}enabled(t,e){return this.primary.enabled(t,e)}log(t,e,n,i){this.enabled(t,e)&&this.delegates.forEach(r=>r.log(t,e,n,i))}flush(){return i(this,void 0,void 0,function*(){yield Promise.all(this.delegates.map(t=>t.flush()))})}close(){this.delegates.forEach(t=>t.close())}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){n(178),t.exports=n(365)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=n(366),r=n(22);new i.LogTail(()=>r.stdout)},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{u(i.next(t))}catch(t){s(t)}}function a(t){try{u(i.throw(t))}catch(t){s(t)}}function u(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(o,a)}u((i=i.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const r=n(43),s=n(35),o=n(2),a=n(0),u=n(12),l=n(34);e.LogTail=class{constructor(t){this.onData=t,this.root=l.BaseFile.for(u.Settings.logDir.valueOrDefault),this.name2max=new Map,this.start()}start(){return i(this,void 0,void 0,function*(){console.log("Tailing "+this.root+"/**/*.log...");for(const t of yield this.logFiles())yield o.thenMap(t.clear().size(),e=>{e>0&&this.name2max.set(t.baseWithParent,e)});s.setInterval(()=>this.onInterval(),500),s.setInterval(()=>{this.root.clear(),l.BaseFile.clear()},2e3)})}logFiles(){return i(this,void 0,void 0,function*(){return o.thenOrElse(this.root.clear().descendants(t=>".log"===t.ext),()=>[])})}onInterval(){return i(this,void 0,void 0,function*(){const t=this.name2max;for(const e of yield this.logFiles()){const n=yield e.clear().size(),i=a.orElse(t.get(e.baseWithParent),()=>0);null!=n&&n>i&&(t.set(e.baseWithParent,n),this.readChild(e,i,n-1))}})}readChild(t,e,n){r.createReadStream(t.nativePath,{autoClose:!0,start:e,end:n}).on("error",t=>console.error(t)).pipe(this.onData(t))}}}]);
|
|
3
|
-
//# sourceMappingURL=logtail.js.map
|