six-degrees 0.7.0 → 1.0.0
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +1 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +32 -4
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +16 -16
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/admin-delete/route.js +1 -1
- package/.next/standalone/.next/server/app/api/admin-delete/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/admin-update/route.js +1 -1
- package/.next/standalone/.next/server/app/api/admin-update/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/bridges/route.js +1 -1
- package/.next/standalone/.next/server/app/api/bridges/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/bulk-import/route.js +1 -1
- package/.next/standalone/.next/server/app/api/bulk-import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/company-scores/legacy/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/company-scores/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/connections/route.js +1 -1
- package/.next/standalone/.next/server/app/api/connections/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/backup/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/csv/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/export/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/restart/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/restore/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/data/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/delete-cluster/route.js +1 -1
- package/.next/standalone/.next/server/app/api/delete-cluster/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ingest/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ingest/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/network/route.js +1 -1
- package/.next/standalone/.next/server/app/api/network/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/notifications/route.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/outreach/route.js +3 -3
- package/.next/standalone/.next/server/app/api/outreach/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/queue/route.js +1 -1
- package/.next/standalone/.next/server/app/api/queue/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/scraper/route.js +4 -4
- package/.next/standalone/.next/server/app/api/scraper/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/settings/sector-preview/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/settings/sector-suggestions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/setup-profile/route.js +1 -1
- package/.next/standalone/.next/server/app/api/setup-profile/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/social/crm/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/social/messages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/social/route.js +1 -1
- package/.next/standalone/.next/server/app/api/social/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/unlock/route.js +1 -1
- package/.next/standalone/.next/server/app/api/unlock/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/update/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/update-images/route.js +1 -1
- package/.next/standalone/.next/server/app/api/update-images/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/users/route.js +1 -1
- package/.next/standalone/.next/server/app/api/users/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/avatars/[file]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/import/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/import/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/import.html +1 -1
- package/.next/standalone/.next/server/app/import.rsc +18 -18
- package/.next/standalone/.next/server/app/import.segments/_full.segment.rsc +18 -18
- package/.next/standalone/.next/server/app/import.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/import.segments/import/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +19 -19
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +19 -19
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/insights/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/insights/page/build-manifest.json +20 -0
- package/.next/standalone/.next/server/app/insights/page/next-font-manifest.json +11 -0
- package/.next/standalone/.next/server/app/insights/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/insights/page/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/insights/page.js +13 -0
- package/.next/standalone/.next/server/app/insights/page.js.map +5 -0
- package/.next/standalone/.next/server/app/insights/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/insights/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/insights.html +1 -0
- package/.next/standalone/.next/server/app/insights.meta +26 -0
- package/.next/standalone/.next/server/app/insights.rsc +35 -0
- package/.next/standalone/.next/server/app/insights.segments/_full.segment.rsc +35 -0
- package/.next/standalone/.next/server/app/insights.segments/_tree.segment.rsc +4 -0
- package/.next/standalone/.next/server/app/insights.segments/insights/__PAGE__.segment.rsc +33 -0
- package/.next/standalone/.next/server/app/launch/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/launch/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/launch.html +2 -2
- package/.next/standalone/.next/server/app/launch.rsc +18 -18
- package/.next/standalone/.next/server/app/launch.segments/_full.segment.rsc +18 -18
- package/.next/standalone/.next/server/app/launch.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/launch.segments/launch/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/paths/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/paths/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/paths.html +1 -1
- package/.next/standalone/.next/server/app/paths.rsc +19 -19
- package/.next/standalone/.next/server/app/paths.segments/_full.segment.rsc +19 -19
- package/.next/standalone/.next/server/app/paths.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/paths.segments/paths/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/profile/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/profile/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/profile.html +1 -1
- package/.next/standalone/.next/server/app/profile.rsc +19 -19
- package/.next/standalone/.next/server/app/profile.segments/_full.segment.rsc +19 -19
- package/.next/standalone/.next/server/app/profile.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/profile.segments/profile/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/queue/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/queue/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/queue.html +1 -1
- package/.next/standalone/.next/server/app/queue.rsc +19 -19
- package/.next/standalone/.next/server/app/queue.segments/_full.segment.rsc +19 -19
- package/.next/standalone/.next/server/app/queue.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/queue.segments/queue/__PAGE__.segment.rsc +21 -20
- package/.next/standalone/.next/server/app/scores/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/scores/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/scores.html +1 -1
- package/.next/standalone/.next/server/app/scores.rsc +18 -18
- package/.next/standalone/.next/server/app/scores.segments/_full.segment.rsc +18 -18
- package/.next/standalone/.next/server/app/scores.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/scores.segments/scores/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +19 -19
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +19 -19
- package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup.html +1 -1
- package/.next/standalone/.next/server/app/setup.rsc +19 -19
- package/.next/standalone/.next/server/app/setup.segments/_full.segment.rsc +19 -19
- package/.next/standalone/.next/server/app/setup.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/social/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/social/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/social.html +1 -1
- package/.next/standalone/.next/server/app/social.rsc +18 -18
- package/.next/standalone/.next/server/app/social.segments/_full.segment.rsc +18 -18
- package/.next/standalone/.next/server/app/social.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/social.segments/social/__PAGE__.segment.rsc +16 -16
- package/.next/standalone/.next/server/app-paths-manifest.json +1 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__063s0x7._.js → [root-of-the-server]__0r-0t-9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ra6xyg._.js +15 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__20rwfdw._.js → [root-of-the-server]__0rcpjad._.js} +5 -2
- package/.next/standalone/.next/server/chunks/_1_fynia._.js +7 -7
- package/.next/standalone/.next/server/chunks/_1itd1o_._.js +1 -1
- package/.next/standalone/.next/server/chunks/lib_02iz_9q._.js +2 -2
- package/.next/standalone/.next/server/chunks/lib_05agvk3._.js +2 -2
- package/.next/standalone/.next/server/chunks/lib_0v84u66._.js +2 -2
- package/.next/standalone/.next/server/chunks/lib_db-client_0_dch35.js +9 -9
- package/.next/standalone/.next/server/chunks/{lib_rpc_0jnfp2e.js → lib_rpc_00nndai.js} +1 -1
- package/.next/standalone/.next/server/chunks/{lib_rpc_0b17r6v.js → lib_rpc_03ibb-x.js} +1 -1
- package/.next/standalone/.next/server/chunks/{lib_rpc_0doq0t-.js → lib_rpc_03ri3ji.js} +1 -1
- package/.next/standalone/.next/server/chunks/{lib_rpc_0fd2rlw.js → lib_rpc_078ce48.js} +1 -1
- package/.next/standalone/.next/server/chunks/lib_rpc_0a69mgr.js +3 -0
- package/.next/standalone/.next/server/chunks/{lib_rpc_005abye.js → lib_rpc_0cej3t8.js} +1 -1
- package/.next/standalone/.next/server/chunks/lib_rpc_0cmh4g6.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_rpc_0nx2_pc.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_rpc_0r79-w1.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_rpc_0yx8ynd.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_rpc_12p-o9-.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_rpc_1466dnb.js +3 -0
- package/.next/standalone/.next/server/chunks/{lib_rpc_0is4qoc.js → lib_rpc_1hjjjr4.js} +1 -1
- package/.next/standalone/.next/server/chunks/lib_rpc_1sryxv6.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_rpc_1trn-x5.js +3 -0
- package/.next/standalone/.next/server/chunks/lib_rpc_1ygu_mv.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0egamyq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_04am_h8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_07zb7lu._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0_79idq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0gds903._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0klqt9z._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_1k9qfsk._.js → _14jak5s._.js} +6 -2
- package/.next/standalone/.next/server/chunks/ssr/_14nxd3q._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1cj2yog._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_1fm1ih_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1hdqw0-._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/_1k2nmbw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0gy11ar._.js → _1r62six._.js} +6 -2
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_insights_page_actions_0-0tf75.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/app_components_0uuff77._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_components_1j3q-h5._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_01o3i5y._.js → app_components_settings_SectorPicker_1c-29qw.js} +2 -6
- package/.next/standalone/.next/server/chunks/ssr/app_components_ui_0pdmz2z.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/app_insights_page_1d_chja.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/app_page_1fazqbf.js +14 -14
- package/.next/standalone/.next/server/chunks/ssr/app_queue_page_0c6znd6.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/app_settings_page_1f8mjj_.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_setup_page_1-282zx.js +4 -4
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/middleware-manifest.json +5 -5
- package/.next/standalone/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.json +4 -0
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/prefetch-hints.json +14 -0
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/02wnf8dkxegxg.js +34 -0
- package/.next/standalone/.next/static/chunks/0hggugbh84m4t.js +21 -0
- package/.next/{static/chunks/2eo9pqq9gay3r.js → standalone/.next/static/chunks/0ka4prpk3w9wn.js} +4 -4
- package/.next/standalone/.next/static/chunks/0s_xxwp7z88vv.js +1 -0
- package/.next/standalone/.next/static/chunks/1-nnl8amfm4yh.js +57 -0
- package/.next/{static/chunks/44yn0tcd9dfk3.js → standalone/.next/static/chunks/1bkt_hhjzvbh8.js} +1 -1
- package/.next/standalone/.next/static/chunks/1cmphb3kh2ers.css +3 -0
- package/.next/{static/chunks/1qbjermbf68xj.js → standalone/.next/static/chunks/1d8yv3k_atka7.js} +1 -1
- package/.next/standalone/.next/static/chunks/1ods5h86raivz.js +1 -0
- package/.next/standalone/.next/static/chunks/23hc51oa4vkhc.js +5 -0
- package/.next/standalone/.next/static/chunks/27n8k9wxlz5-7.js +1 -0
- package/.next/standalone/.next/static/chunks/{0p3g5tfostsep.js → 2q9i7pcxcnph1.js} +2 -2
- package/.next/{static/chunks/2zf4jmz9l3li2.js → standalone/.next/static/chunks/2w-y83mjlpnse.js} +1 -1
- package/.next/standalone/.next/static/chunks/2ws1xf293j-tm.js +5 -0
- package/.next/standalone/.next/static/chunks/3cqn-r-y5rrw1.js +5 -0
- package/.next/standalone/.next/static/chunks/3opgg1efrx8q6.js +1 -0
- package/.next/standalone/.next/static/chunks/3p51fpxxi4d5y.js +34 -0
- package/.next/{static/chunks/0an_b6zi1r_qq.js → standalone/.next/static/chunks/3y40z6of3r9py.js} +1 -5
- package/.next/standalone/.next/static/chunks/403dpflln8ah5.js +1 -0
- package/.next/standalone/CHANGELOG.md +83 -0
- package/.next/standalone/README.md +40 -14
- package/.next/standalone/SECURITY.md +17 -4
- package/.next/standalone/app/api/outreach/route.js +13 -73
- package/.next/standalone/app/api/scraper/route.js +106 -5
- package/.next/standalone/app/components/AppHeader.js +22 -6
- package/.next/standalone/app/components/AppTabs.js +4 -0
- package/.next/standalone/app/components/AutoConnect.js +286 -0
- package/.next/standalone/app/components/ChainView.js +75 -2
- package/.next/standalone/app/components/FilterPanel.js +8 -1
- package/.next/standalone/app/components/LinkedInLimits.js +38 -13
- package/.next/standalone/app/components/OutlinkQuest.js +32 -11
- package/.next/standalone/app/components/ScanStatusBar.js +18 -3
- package/.next/standalone/app/components/ScanTrail.js +13 -3
- package/.next/standalone/app/components/SeparationView.js +6 -22
- package/.next/standalone/app/components/Sidebar.js +147 -38
- package/.next/standalone/app/components/insights/Boards.js +275 -0
- package/.next/standalone/app/components/insights/PeopleView.js +266 -0
- package/.next/standalone/app/components/insights/Rail.js +156 -0
- package/.next/standalone/app/components/insights/Report.js +382 -0
- package/.next/standalone/app/components/insights/parts.js +239 -0
- package/.next/standalone/app/components/settings/UsageSection.js +50 -3
- package/.next/standalone/app/globals.css +2 -3
- package/.next/standalone/app/insights/page.js +220 -0
- package/.next/standalone/app/page.js +1 -17
- package/.next/standalone/app/queue/page.js +30 -18
- package/.next/standalone/app/setup/page.js +71 -13
- package/.next/standalone/install.sh +7 -6
- package/.next/standalone/lib/auto-connect.js +145 -0
- package/.next/standalone/lib/companies.js +1 -1
- package/.next/standalone/lib/in-progress.js +46 -0
- package/.next/standalone/lib/insights-board.js +613 -0
- package/.next/standalone/lib/linkedin-limits.js +36 -11
- package/.next/standalone/lib/requests-client.js +10 -0
- package/.next/standalone/lib/requests.js +124 -0
- package/.next/standalone/lib/scan-state.js +1 -0
- package/.next/standalone/lib/scanner-setup.js +82 -3
- package/.next/standalone/lib/scraper-client.js +18 -5
- package/.next/standalone/lib/settings.js +6 -0
- package/.next/standalone/lib/usage.js +5 -0
- package/.next/standalone/package-lock.json +2 -2
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/scripts/build-app.mjs +167 -11
- package/.next/standalone/scripts/build-desktop.mjs +3 -2
- package/.next/standalone/scripts/ci-mac-signing.sh +128 -0
- package/.next/standalone/scripts/entitlements/electron.plist +23 -0
- package/.next/standalone/scripts/entitlements/node.plist +27 -0
- package/.next/standalone/scripts/mac-sign.mjs +563 -0
- package/.next/standalone/scripts/make-dmg-background.mjs +2 -1
- package/.next/standalone/scripts/scrape.py +569 -9
- package/.next/standalone/scripts/set-signing-secrets.sh +96 -0
- package/.next/static/chunks/02wnf8dkxegxg.js +34 -0
- package/.next/static/chunks/0hggugbh84m4t.js +21 -0
- package/.next/{standalone/.next/static/chunks/2eo9pqq9gay3r.js → static/chunks/0ka4prpk3w9wn.js} +4 -4
- package/.next/static/chunks/0s_xxwp7z88vv.js +1 -0
- package/.next/static/chunks/1-nnl8amfm4yh.js +57 -0
- package/.next/{standalone/.next/static/chunks/44yn0tcd9dfk3.js → static/chunks/1bkt_hhjzvbh8.js} +1 -1
- package/.next/static/chunks/1cmphb3kh2ers.css +3 -0
- package/.next/{standalone/.next/static/chunks/1qbjermbf68xj.js → static/chunks/1d8yv3k_atka7.js} +1 -1
- package/.next/static/chunks/1ods5h86raivz.js +1 -0
- package/.next/static/chunks/23hc51oa4vkhc.js +5 -0
- package/.next/static/chunks/27n8k9wxlz5-7.js +1 -0
- package/.next/static/chunks/{0p3g5tfostsep.js → 2q9i7pcxcnph1.js} +2 -2
- package/.next/{standalone/.next/static/chunks/2zf4jmz9l3li2.js → static/chunks/2w-y83mjlpnse.js} +1 -1
- package/.next/static/chunks/2ws1xf293j-tm.js +5 -0
- package/.next/static/chunks/3cqn-r-y5rrw1.js +5 -0
- package/.next/static/chunks/3opgg1efrx8q6.js +1 -0
- package/.next/static/chunks/3p51fpxxi4d5y.js +34 -0
- package/.next/{standalone/.next/static/chunks/0an_b6zi1r_qq.js → static/chunks/3y40z6of3r9py.js} +1 -5
- package/.next/static/chunks/403dpflln8ah5.js +1 -0
- package/CHANGELOG.md +83 -0
- package/README.md +40 -14
- package/SECURITY.md +17 -4
- package/lib/auto-connect.js +145 -0
- package/lib/companies.js +1 -1
- package/lib/in-progress.js +46 -0
- package/lib/insights-board.js +613 -0
- package/lib/linkedin-limits.js +36 -11
- package/lib/requests-client.js +10 -0
- package/lib/requests.js +124 -0
- package/lib/scan-state.js +1 -0
- package/lib/scanner-setup.js +82 -3
- package/lib/scraper-client.js +18 -5
- package/lib/settings.js +6 -0
- package/lib/usage.js +5 -0
- package/package.json +1 -1
- package/scripts/scrape.py +569 -9
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_4y8z7._.js +0 -8
- package/.next/standalone/.next/server/chunks/_02twlca._.js +0 -10
- package/.next/standalone/.next/server/chunks/lib_rpc_0nef_n7.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_rpc_0plrzra.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_rpc_13a4m0c.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_rpc_1if17c-.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_rpc_1j-zw7v.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_rpc_1sngt-q.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_rpc_1v2sgme.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_rpc_1vh-tgx.js +0 -3
- package/.next/standalone/.next/server/chunks/lib_rpc_1zaubz7.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_02sband._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_189g8lg._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_1f_n00p._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_components_0t908t-._.js +0 -3
- package/.next/standalone/.next/static/chunks/0e3g0sil79cus.js +0 -21
- package/.next/standalone/.next/static/chunks/0zd0t7e60bn4z.js +0 -1
- package/.next/standalone/.next/static/chunks/163b-20vwa06i.js +0 -34
- package/.next/standalone/.next/static/chunks/1pa-2v1ajvrko.js +0 -1
- package/.next/standalone/.next/static/chunks/23_1z47al92nz.js +0 -57
- package/.next/standalone/.next/static/chunks/260bomtr214m8.js +0 -34
- package/.next/standalone/.next/static/chunks/2xk2ra4piiuod.js +0 -34
- package/.next/standalone/.next/static/chunks/3b0-14cxqsprt.js +0 -1
- package/.next/standalone/.next/static/chunks/3jarus1_38s2z.js +0 -1
- package/.next/standalone/.next/static/chunks/3ssu341hav_sq.css +0 -3
- package/.next/standalone/.next/static/chunks/3v1qd3sqhqn0d.js +0 -1
- package/.next/static/chunks/0e3g0sil79cus.js +0 -21
- package/.next/static/chunks/0zd0t7e60bn4z.js +0 -1
- package/.next/static/chunks/163b-20vwa06i.js +0 -34
- package/.next/static/chunks/1pa-2v1ajvrko.js +0 -1
- package/.next/static/chunks/23_1z47al92nz.js +0 -57
- package/.next/static/chunks/260bomtr214m8.js +0 -34
- package/.next/static/chunks/2xk2ra4piiuod.js +0 -34
- package/.next/static/chunks/3b0-14cxqsprt.js +0 -1
- package/.next/static/chunks/3jarus1_38s2z.js +0 -1
- package/.next/static/chunks/3ssu341hav_sq.css +0 -3
- package/.next/static/chunks/3v1qd3sqhqn0d.js +0 -1
- /package/.next/standalone/.next/static/{ZVpLBK-2vpllv2HxOFs2d → mwCGF3OV3CWV4SjUgg5T8}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{ZVpLBK-2vpllv2HxOFs2d → mwCGF3OV3CWV4SjUgg5T8}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{ZVpLBK-2vpllv2HxOFs2d → mwCGF3OV3CWV4SjUgg5T8}/_ssgManifest.js +0 -0
- /package/.next/static/{ZVpLBK-2vpllv2HxOFs2d → mwCGF3OV3CWV4SjUgg5T8}/_buildManifest.js +0 -0
- /package/.next/static/{ZVpLBK-2vpllv2HxOFs2d → mwCGF3OV3CWV4SjUgg5T8}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{ZVpLBK-2vpllv2HxOFs2d → mwCGF3OV3CWV4SjUgg5T8}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[73156,28681,48170,54090,1348,99628,41238,98612,26525,92375,19041,97838,e=>{"use strict";var t=e.x("node:sqlite",()=>require("node:sqlite"),!0),n=e.i(2157),r=e.i(60526),i=e.i(50227);let a=`-- Six Degrees — local SQLite schema.
|
|
1
|
+
module.exports=[73156,28681,48170,54090,1348,99628,3126,41238,98612,26525,92375,19041,97838,e=>{"use strict";var t=e.x("node:sqlite",()=>require("node:sqlite"),!0),n=e.i(2157),r=e.i(60526),i=e.i(50227);let a=`-- Six Degrees — local SQLite schema.
|
|
2
2
|
--
|
|
3
3
|
-- Ported from the Postgres schema this project ran on before it went
|
|
4
4
|
-- local-first. Type mapping: uuid -> TEXT (generated in JS), jsonb and
|
|
@@ -159,16 +159,16 @@ CREATE TABLE IF NOT EXISTS user_profile (
|
|
|
159
159
|
created_at TEXT DEFAULT (datetime('now')),
|
|
160
160
|
updated_at TEXT DEFAULT (datetime('now'))
|
|
161
161
|
);
|
|
162
|
-
`;e.s(["SCHEMA_SQL",0,a],28681);let o="0.
|
|
163
|
-
`)}};e.s(["durable",0,w],99628);let b={fast:{label:"Fast",pagePause:20,chunkCooldown:60,profileGap:60},medium:{label:"Medium",pagePause:45,chunkCooldown:180,profileGap:90},slow:{label:"Slow",pagePause:90,chunkCooldown:300,profileGap:120}},_=[25,50,100,200,500],A=[100,250,500,1e3,0],k=[10,25,50,100],N="America/Los_Angeles";function I(e){try{return JSON.parse((0,n.readFileSync)(e,"utf8"))}catch{return null}}function R(e,t){let r=`${e}.${process.pid}.${Date.now()}.tmp`;(0,n.writeFileSync)(r,JSON.stringify(t,null,2)),(0,n.renameSync)(r,e)}function D(e=Date.now()){let t=Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:N,year:"numeric",month:"numeric"}).formatToParts(new Date(e)).map(e=>[e.type,e.value])),n=Number(t.year),r=Number(t.month),i=Date.UTC(n,r-1,1,8);for(let e=0;e<2;e++)i=Date.UTC(n,r-1,1,-function(e){let t=(new Intl.DateTimeFormat("en-US",{timeZone:N,timeZoneName:"shortOffset"}).formatToParts(new Date(e)).find(e=>"timeZoneName"===e.type)?.value||"GMT-8").match(/GMT([+-]\d+)(?::(\d+))?/);return t?Number(t[1]):-8}(i));return i}function O(e){let t,n=I(i.default.join(e,"scan-limits.json"))||{},r=(e,t)=>Number.isInteger(e)&&e>=0?e:t;return{daily:r(n.daily,50),monthly:r(n.monthly,250),profiles:(t=r(n.profiles,0)||50,k.filter(e=>e<=t).pop()??k[0]),pace:b[n.pace]?n.pace:"fast"}}function x(e){let t=i.default.join(e,"linkedin-activity.json"),r=(0,n.existsSync)(t)?I(t):{searches:[],profiles:[]};return r&&"object"==typeof r?{searches:(Array.isArray(r.searches)?r.searches:[]).map(Number),profiles:(Array.isArray(r.profiles)?r.profiles:[]).map(Number)}:null}function F(e,t=Date.now()){let n=O(e),r=function(e,t=Date.now()){let n=x(e);if(!n)return{searchesToday:1/0,searchesMonth:0,profilesToday:1/0,unreadable:!0};let{searches:r,profiles:i}=n,a=t/1e3-86400,o=D(t)/1e3;return{searchesToday:r.filter(e=>e>a).length,searchesMonth:r.filter(e=>e>=o).length,profilesToday:i.filter(e=>e>a).length}}(e,t),a=(e,t)=>e?Math.max(0,e-t):null;return{...r,limits:n,leftToday:a(n.daily,r.searchesToday),leftMonth:a(n.monthly,r.searchesMonth),profilesLeftToday:a(n.profiles,r.profilesToday),monthResets:function(e=Date.now()){let t=D(e);return D(t+3456e6)}(t),cooldown:function(e,t=Date.now()){let n=I(i.default.join(e,"linkedin-cooldown.json")),r=1e3*Number(n?.until);return n&&void 0===n.lifted_at&&Number.isFinite(r)&&!(r<=t)?{until:r,reason:String(n.reason||"LinkedIn pushed back"),setAt:1e3*Number(n.set_at)||null}:null}(e,t)}}function L(e,t,n){let r=t/1e3-n;return e.filter(e=>e>r).length}function $(e,t,n,r=86400){if(!n)return null;let i=e.filter(e=>e>t/1e3-r).sort((e,t)=>e-t);return i.length<n?null:(i[i.length-n]+r)*1e3}let j=/^(\d{4})-(\d{2})-(\d{2})_(\d{2})(\d{2})(\d{2})\.txt$/,X="linkedin-activity.json",v="linkedin-cooldown.json",U="scan-limits.json",C=e=>!!e&&"object"==typeof e&&!Array.isArray(e),M=e=>void 0===e||Array.isArray(e)&&e.every(e=>"number"==typeof e&&Number.isFinite(e)&&e>=0),P=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0;function q(e,t){if(!C(t))return"it is not a JSON object";if(e===X){if(!M(t.searches)||!M(t.profiles))return"its record of searches is not a list of times"}else if(e===v){if(!P(t.until))return"its pause has no end time";if(void 0!==t.reason&&"string"!=typeof t.reason)return"its pause has a reason that is not text";if(void 0!==t.set_at&&!P(t.set_at))return"its pause has a start time that is not a time";for(let e of["lifted_at","was_until"])if(void 0!==t[e]&&!P(t[e]))return"its lifted pause has a time that is not a time"}else if(e===U){if(void 0!==t.daily&&!_.includes(t.daily))return`its daily limit (${String(t.daily).slice(0,20)}) is not one Six Degrees offers`;if(void 0!==t.monthly&&!A.includes(t.monthly))return`its monthly limit (${String(t.monthly).slice(0,20)}) is not one Six Degrees offers`;if(void 0!==t.profiles&&!k.includes(t.profiles))return`its limit on profile views (${String(t.profiles).slice(0,20)}) is not one Six Degrees offers`}return null}function G(e=[],t=[]){let n=e=>e.reduce((e,t)=>e.set(t,(e.get(t)||0)+1),new Map),r=n(e);for(let[e,i]of n(t))i>(r.get(e)||0)&&r.set(e,i);return[...r].sort((e,t)=>e[0]-t[0]).flatMap(([e,t])=>Array(t).fill(e))}function B(e){if(void 0===e)return[];if(!Array.isArray(e))return null;let t=e.map(Number);return t.every(Number.isFinite)?t:null}let W=e=>{try{return(0,n.lstatSync)(e),!0}catch{return!1}};function Y({dir:e,from:t}){let n=t=>i.default.join(e,t),r=e=>{let n=I(i.default.join(t,e));return C(n)&&!q(e,n)?n:null},a=r(X);if(a){let e=W(n(X))?I(n(X)):{},t=C(e)?B(e.searches):null,r=C(e)?B(e.profiles):null;t&&r&&w.writeJsonDurably(n(X),{searches:G(t,a.searches),profiles:G(r,a.profiles)})}let o=r(v);if(o){let e=I(n(v)),t=Number.isFinite(Number(e?.until))?Number(e.until):-1/0;o.until>t&&w.writeJsonDurably(n(v),{until:o.until,reason:o.reason??"LinkedIn pushed back",set_at:o.set_at??null,...void 0!==o.lifted_at&&{lifted_at:o.lifted_at,was_until:o.was_until??o.until}})}let s=r(U);s&&!W(n(U))&&w.writeJsonDurably(n(U),{daily:s.daily??50,monthly:s.monthly??250,profiles:s.profiles??50})}e.s(["budgetFileProblem",0,q,"liftCooldown",0,function(e,t=Date.now()){let r=i.default.join(e,v),a=I(r),o=Number(a?.until);if(!C(a)||!Number.isFinite(o)){try{(0,n.unlinkSync)(r)}catch{}return}let s=t/1e3;o<=s||R(r,{until:s,reason:"string"==typeof a.reason?a.reason:"LinkedIn pushed back",set_at:P(a.set_at)?a.set_at:null,lifted_at:s,was_until:o})},"linkedinState",0,F,"linkedinUsage",0,function(e,t=Date.now()){let r=F(e,t),a=x(e),o=function(e,t=Date.now()){let r,a=function(e){let t;try{t=(0,n.readdirSync)(i.default.join(e,"pushback"),{withFileTypes:!0}).filter(e=>e.isFile()&&j.test(e.name)).map(e=>e.name)}catch{return null}for(let r of t.sort().reverse()){let[,t,a,o,s,l,c]=r.match(j).map(Number),u=new Date(t,a-1,o,s,l,c);if(u.getMonth()===a-1&&u.getDate()===o&&!(s>23)&&!(l>59)&&!(c>59))return{at:u.getTime(),reason:function(e){let t;try{t=(0,n.openSync)(e,"r");let r=Buffer.alloc(256),i=(0,n.readSync)(t,r,0,256,0),a=r.subarray(0,i).toString("utf8").split(/\r?\n/)[0].match(/^reason: (.+)$/),o=a&&a[1].replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,120);return o&&!/:\/\/|www\.|linkedin\.com|\/in\//i.test(o)?o:null}catch{return null}finally{void 0!==t&&(0,n.closeSync)(t)}}(i.default.join(e,"pushback",r))}}return null}(e),o=I(i.default.join(e,v)),s=Number(o?.until),l=C(o)&&Number.isFinite(s)?{at:P(o.set_at)?1e3*o.set_at:null,reason:"string"==typeof o.reason&&o.reason.trim()?o.reason.trim().slice(0,160):"LinkedIn pushed back",pausedUntil:(P(o.was_until)?o.was_until:s)*1e3,liftedAt:P(o.lifted_at)?1e3*o.lifted_at:null}:null,c=a&&{at:a.at,reason:a.reason?`LinkedIn pushed back: ${a.reason}`:"LinkedIn pushed back",pausedUntil:null,liftedAt:null};return(r=l&&c&&null!=l.at&&6e5>=Math.abs(l.at-c.at)?{...l,at:Math.min(l.at,c.at)}:l&&c?(l.at??-1/0)>=c.at?l:c:l||c)?{...r,active:!r.liftedAt&&null!=r.pausedUntil&&r.pausedUntil>t}:null}(e,t),s=e=>a?e(a):null;return{...r,now:t,searchesToday:a?r.searchesToday:null,profilesToday:a?r.profilesToday:null,searchesMonth:a?r.searchesMonth:null,leftMonth:a?r.leftMonth:null,searchesLastHour:s(e=>L(e.searches,t,3600)),searchesWeek:s(e=>L(e.searches,t,604800)),dayFreesAt:s(e=>$(e.searches,t,r.limits.daily)),dayClearAt:s(e=>(function(e,t,n=86400){let r=e.filter(e=>e>t/1e3-n);return r.length?(Math.max(...r)+n)*1e3:null})(e.searches,t)),profilesFreeAt:s(e=>$(e.profiles,t,r.limits.profiles)),lastPushback:o,searchesSincePushback:s(e=>(function(e,t){if(!Number.isFinite(t)||!Array.isArray(e))return 0;let n=(t+6e4)/1e3;return e.filter(e=>e>n).length})(e.searches,o?.at))}},"mergeBudgetFiles",0,Y,"writeLimits",0,function(e,{daily:t,monthly:n,profiles:r,pace:a}={}){let o=O(e),s={daily:_.includes(t)?t:o.daily,monthly:A.includes(n)?n:o.monthly,profiles:k.includes(r)?r:o.profiles,pace:b[a]?a:o.pace};return R(i.default.join(e,"scan-limits.json"),s),s}],41238);var J=e.i(74533);let H=/^[A-Za-z0-9_-]+\.(webp|jpg|jpeg|png)$/,K="/avatars/";function V(e){return"string"==typeof e&&e.startsWith(K)&&H.test(e.slice(K.length))?e:null}function z(e){return e.prepare(`SELECT DISTINCT profile_url AS profileUrl, profile_image_url AS imageUrl
|
|
162
|
+
`;e.s(["SCHEMA_SQL",0,a],28681);let o="1.0.0";e.s(["APP_VERSION",0,o],48170);var s=e.x("node:sqlite",()=>require("node:sqlite"),!0),l=e.i(12714),c=e.i(12506);let u=["/api/admin-delete","/api/admin-update","/api/delete-cluster","/api/setup-profile","/api/scraper","/api/update","/api/data/export","/api/data/import","/api/data/restart","/api/data/reveal","/api/data/backup","/api/data/restore","/api/data/csv"],d=new Set(["127.0.0.1","::1","localhost"]),f=new Set(["127.0.0.1","localhost","[::1]","0.0.0.0"]);function p(e){return d.has(String(e||"").toLowerCase())}function h({method:e,pathname:t,headers:n,env:r={}}){let i=e=>n?.get?.(e)??null,a=r.SIX_DEGREES_BIND||r.HOSTNAME;if(function({bind:e,host:t}){let n;if(!p(e)||!t)return!1;try{n=new URL(`http://${t}`).hostname.toLowerCase()}catch{return!0}return!f.has(n)}({bind:a,host:i("host")}))return{status:421,error:"This app only answers to 127.0.0.1 and localhost."};if(function({method:e,secFetchSite:t,origin:n,host:r}){if(!e||!["POST","PUT","PATCH","DELETE"].includes(e.toUpperCase()))return!1;if(t){if("same-origin"===t||"none"===t)return!1;if("same-site"!==t||!n)return!0}if(n)try{let e=new URL(n).host;return!!r&&e!==r}catch{return!0}return!1}({method:e,secFetchSite:i("sec-fetch-site"),origin:i("origin"),host:i("host")}))return{status:403,error:"Cross-site requests are not accepted. This app only answers to pages it serves."};if(!u.some(e=>t===e||t.startsWith(`${e}/`)))return null;let o=function({bind:e,token:t,bearer:n}){return t&&function(e,t){if("string"!=typeof e||"string"!=typeof t||e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e.charCodeAt(r)^t.charCodeAt(r);return 0===n}(n,t)?{allow:!0,reason:"valid admin token"}:p(e)?{allow:!0,reason:"server is bound to loopback; only this machine can connect"}:t?{allow:!1,status:401,reason:"missing or incorrect admin token"}:{allow:!1,status:503,reason:"server is not bound to loopback and no ADMIN_TOKEN is configured"}}({bind:a,token:r.ADMIN_TOKEN,bearer:(i("authorization")||"").replace(/^Bearer\s+/i,"")});return o.allow?null:{status:o.status,error:o.reason}}e.s(["requestRefusal",0,h],54090);let m=Symbol.for("six-degrees.scan-state");function y(){let e=globalThis[m];return e?.running!==!0?null:"string"==typeof e.action&&e.action?e.action:"scan"}function T(e){switch(e){case"install":return"The scanner's packages are being installed";case"setup":return"The scanner is being set up";case"login":return"The LinkedIn sign-in window is open";case"photos":return"Profile photos are being saved";case"connect":return"A connection request is being sent";default:return"A scan is running"}}e.s(["busyRefusal",0,function(e,t=y()){return t?`${T(t)}. ${e}`:null},"registerScanState",0,function(e){return globalThis[m]||(globalThis[m]=e),globalThis[m]},"runningNow",0,T,"scannerJob",0,y],1348);let E=new Set(["ENOENT","EINVAL","ENOTSUP","ENOSYS","EISDIR","EPERM","EBADF"]);function g(e){let t;try{t=n.default.openSync(e,"r")}catch(e){if(E.has(e.code))return;throw e}try{n.default.fsyncSync(t)}catch(e){if(!E.has(e.code))throw e}finally{n.default.closeSync(t)}}function w(e,t){let r=`${e}.${process.pid}.tmp`;try{let i=n.default.openSync(r,"w");try{n.default.writeFileSync(i,t),n.default.fsyncSync(i)}finally{n.default.closeSync(i)}n.default.renameSync(r,e)}catch(e){throw n.default.rmSync(r,{force:!0}),e}g(i.default.dirname(e))}let S={syncFile:function(e){let t=n.default.openSync(e,"r");try{n.default.fsyncSync(t)}finally{n.default.closeSync(t)}},syncFolder:g,writeFileDurably:w,writeJsonDurably:function(e,t){w(e,`${JSON.stringify(t,null,2)}
|
|
163
|
+
`)}};e.s(["durable",0,S],99628);let b={fast:{label:"Fast",pagePause:20,chunkCooldown:60,profileGap:60},medium:{label:"Medium",pagePause:45,chunkCooldown:180,profileGap:90},slow:{label:"Slow",pagePause:90,chunkCooldown:300,profileGap:120}},_={day:15,week:80},A=/^Connect result: ([a-z-]+)$/,k=_.day,N=_.week,I={sent:{ok:!0,marks:!0,text:"Request sent"},"already-pending":{ok:!0,marks:!0,text:"A request to them was already pending on LinkedIn, so nothing new was sent. It’s marked as sent here."},"email-needed":{text:"LinkedIn wants their email address before it sends this one. Use Connect to add them yourself."},"no-connect":{text:"LinkedIn shows no Connect for them here, only Follow or Message, or a request is already out. Nothing was sent."},"not-sent":{text:"LinkedIn asked something Auto doesn’t answer for you, so it closed that and sent nothing. Use Connect to add them yourself."},unclear:{text:"Auto pressed Send but couldn’t see the request go through, so it isn’t marked as sent. Use Connect to check their profile."},"not-loaded":{text:"Their profile didn’t load, so nothing was sent. Try again in a while."},unavailable:{text:"LinkedIn says their profile isn’t available, so nothing was sent."},"linkedin-limit":{text:"LinkedIn says this account has reached its invitation limit for now. Nothing was sent."},pushback:{text:"LinkedIn pushed back, so scanning and Auto are paused for a day. Settings, LinkedIn usage says when it ends."},stopped:{text:"Stopped before anything was sent."},"not-signed-in":{text:"LinkedIn isn’t signed in in the scanner’s Chrome. Sign in on the Scan page (step 2), then try again."},cooldown:{text:"Scanning is paused after LinkedIn pushed back, and Auto waits with it. Nothing was sent."},"invites-day":{text:`Auto has sent ${k} requests in the last 24 hours, its limit. Nothing was sent.`},"invites-week":{text:`Auto has sent ${N} requests in the last 7 days, its limit. Nothing was sent.`},profiles:{text:"Today’s profile views are used, and Auto opens their profile to send. Nothing was sent."},"not-found":{text:"That person isn’t in your network on this computer, so nothing was sent."}};Object.keys(I),e.s(["AUTO_ACCEPTED_SETTING",0,{default:null,parse(e){if(null===e)return null;if("string"!=typeof e||Number.isNaN(Date.parse(e)))throw Error("When Auto was first allowed is a date and time.");return new Date(e).toISOString()}},"AUTO_REFUSAL",0,"Auto asks once before its first request. Press Auto again and confirm.","INVITE_CAPS",0,_,"connectMarks",0,e=>!!I[e]?.marks,"connectResultIn",0,function(e){let t=String(e??"").trim().match(A);return t&&Object.hasOwn(I,t[1])?t[1]:null},"inviteRefusal",0,function(e,t=e=>new Date(e).toLocaleString()){return e?e.unreadable?"The record of what Six Degrees has asked of LinkedIn couldn’t be read, so Auto waits until it can.":e.invitesToday>=k?`Auto has sent ${k} requests in the last 24 hours, its limit.${e.invitesFreeAt?` The next one frees up ${t(e.invitesFreeAt)}.`:""}`:e.invitesWeek>=N?`Auto has sent ${N} requests in the last 7 days, its limit.${e.invitesWeekFreeAt?` The next one frees up ${t(e.invitesWeekFreeAt)}.`:""}`:0===e.profilesLeftToday?"Today’s profile views are used, and Auto opens their profile to send the request. Try again once one frees up (Settings, LinkedIn usage).":null:null},"personRefusal",0,function(e,{connected:t=!1,requested:n=!1,accepted:r=!1}={}){if(!e)return{status:400,error:"That person could not be found."};let i=e.name||"They";return t||r||1===e.degree?{status:409,error:`${i} is already one of your connections.`}:n?{status:409,error:`A request to ${i} is already out.`}:e.profile_url?null:{status:400,error:`There is no LinkedIn profile on file for ${i}.`}}],3126);let x=[25,50,100,200,500],R=[100,250,500,1e3,0],D=[10,25,50,100],L="America/Los_Angeles";function O(e){try{return JSON.parse((0,n.readFileSync)(e,"utf8"))}catch{return null}}function F(e,t){let r=`${e}.${process.pid}.${Date.now()}.tmp`;(0,n.writeFileSync)(r,JSON.stringify(t,null,2)),(0,n.renameSync)(r,e)}function $(e=Date.now()){let t=Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:L,year:"numeric",month:"numeric"}).formatToParts(new Date(e)).map(e=>[e.type,e.value])),n=Number(t.year),r=Number(t.month),i=Date.UTC(n,r-1,1,8);for(let e=0;e<2;e++)i=Date.UTC(n,r-1,1,-function(e){let t=(new Intl.DateTimeFormat("en-US",{timeZone:L,timeZoneName:"shortOffset"}).formatToParts(new Date(e)).find(e=>"timeZoneName"===e.type)?.value||"GMT-8").match(/GMT([+-]\d+)(?::(\d+))?/);return t?Number(t[1]):-8}(i));return i}function v(e){let t,n=O(i.default.join(e,"scan-limits.json"))||{},r=(e,t)=>Number.isInteger(e)&&e>=0?e:t;return{daily:r(n.daily,50),monthly:r(n.monthly,250),profiles:(t=r(n.profiles,0)||50,D.filter(e=>e<=t).pop()??D[0]),pace:b[n.pace]?n.pace:"fast"}}function j(e){let t=i.default.join(e,"linkedin-activity.json"),r=(0,n.existsSync)(t)?O(t):{searches:[],profiles:[]};if(!r||"object"!=typeof r)return null;let a=e=>(Array.isArray(e)?e:[]).map(Number);return{searches:a(r.searches),profiles:a(r.profiles),invites:a(r.invites)}}function X(e,t=Date.now()){let n=v(e),r=function(e,t=Date.now()){let n=j(e);if(!n)return{searchesToday:1/0,searchesMonth:0,profilesToday:1/0,invitesToday:1/0,invitesWeek:1/0,unreadable:!0};let{searches:r,profiles:i,invites:a}=n,o=t/1e3-86400,s=$(t)/1e3;return{searchesToday:r.filter(e=>e>o).length,searchesMonth:r.filter(e=>e>=s).length,profilesToday:i.filter(e=>e>o).length,invitesToday:a.filter(e=>e>o).length,invitesWeek:a.filter(e=>e>t/1e3-604800).length}}(e,t),a=(e,t)=>e?Math.max(0,e-t):null,o=r.unreadable?null:j(e)?.invites||[];return{...r,limits:n,leftToday:a(n.daily,r.searchesToday),leftMonth:a(n.monthly,r.searchesMonth),profilesLeftToday:a(n.profiles,r.profilesToday),inviteCaps:_,invitesFreeAt:o?C(o,t,_.day):null,invitesWeekFreeAt:o?C(o,t,_.week,604800):null,monthResets:function(e=Date.now()){let t=$(e);return $(t+3456e6)}(t),cooldown:function(e,t=Date.now()){let n=O(i.default.join(e,"linkedin-cooldown.json")),r=1e3*Number(n?.until);return n&&void 0===n.lifted_at&&Number.isFinite(r)&&!(r<=t)?{until:r,reason:String(n.reason||"LinkedIn pushed back"),setAt:1e3*Number(n.set_at)||null}:null}(e,t)}}function U(e,t,n){let r=t/1e3-n;return e.filter(e=>e>r).length}function C(e,t,n,r=86400){if(!n)return null;let i=e.filter(e=>e>t/1e3-r).sort((e,t)=>e-t);return i.length<n?null:(i[i.length-n]+r)*1e3}let M=/^(\d{4})-(\d{2})-(\d{2})_(\d{2})(\d{2})(\d{2})\.txt$/,P="linkedin-activity.json",q="linkedin-cooldown.json",G="scan-limits.json",B=e=>!!e&&"object"==typeof e&&!Array.isArray(e),W=e=>void 0===e||Array.isArray(e)&&e.every(e=>"number"==typeof e&&Number.isFinite(e)&&e>=0),Y=e=>"number"==typeof e&&Number.isFinite(e)&&e>=0;function J(e,t){if(!B(t))return"it is not a JSON object";if(e===P){if(!W(t.searches)||!W(t.profiles)||!W(t.invites))return"its record of searches is not a list of times"}else if(e===q){if(!Y(t.until))return"its pause has no end time";if(void 0!==t.reason&&"string"!=typeof t.reason)return"its pause has a reason that is not text";if(void 0!==t.set_at&&!Y(t.set_at))return"its pause has a start time that is not a time";for(let e of["lifted_at","was_until"])if(void 0!==t[e]&&!Y(t[e]))return"its lifted pause has a time that is not a time"}else if(e===G){if(void 0!==t.daily&&!x.includes(t.daily))return`its daily limit (${String(t.daily).slice(0,20)}) is not one Six Degrees offers`;if(void 0!==t.monthly&&!R.includes(t.monthly))return`its monthly limit (${String(t.monthly).slice(0,20)}) is not one Six Degrees offers`;if(void 0!==t.profiles&&!D.includes(t.profiles))return`its limit on profile views (${String(t.profiles).slice(0,20)}) is not one Six Degrees offers`}return null}function V(e=[],t=[]){let n=e=>e.reduce((e,t)=>e.set(t,(e.get(t)||0)+1),new Map),r=n(e);for(let[e,i]of n(t))i>(r.get(e)||0)&&r.set(e,i);return[...r].sort((e,t)=>e[0]-t[0]).flatMap(([e,t])=>Array(t).fill(e))}function H(e){if(void 0===e)return[];if(!Array.isArray(e))return null;let t=e.map(Number);return t.every(Number.isFinite)?t:null}let K=e=>{try{return(0,n.lstatSync)(e),!0}catch{return!1}};function z({dir:e,from:t}){let n=t=>i.default.join(e,t),r=e=>{let n=O(i.default.join(t,e));return B(n)&&!J(e,n)?n:null},a=r(P);if(a){let e=K(n(P))?O(n(P)):{},t=B(e)?H(e.searches):null,r=B(e)?H(e.profiles):null,i=B(e)?H(e.invites):null;if(t&&r&&i){let e=V(i,a.invites);S.writeJsonDurably(n(P),{searches:V(t,a.searches),profiles:V(r,a.profiles),...e.length?{invites:e}:{}})}}let o=r(q);if(o){let e=O(n(q)),t=Number.isFinite(Number(e?.until))?Number(e.until):-1/0;o.until>t&&S.writeJsonDurably(n(q),{until:o.until,reason:o.reason??"LinkedIn pushed back",set_at:o.set_at??null,...void 0!==o.lifted_at&&{lifted_at:o.lifted_at,was_until:o.was_until??o.until}})}let s=r(G);s&&!K(n(G))&&S.writeJsonDurably(n(G),{daily:s.daily??50,monthly:s.monthly??250,profiles:s.profiles??50})}e.s(["budgetFileProblem",0,J,"liftCooldown",0,function(e,t=Date.now()){let r=i.default.join(e,q),a=O(r),o=Number(a?.until);if(!B(a)||!Number.isFinite(o)){try{(0,n.unlinkSync)(r)}catch{}return}let s=t/1e3;o<=s||F(r,{until:s,reason:"string"==typeof a.reason?a.reason:"LinkedIn pushed back",set_at:Y(a.set_at)?a.set_at:null,lifted_at:s,was_until:o})},"linkedinState",0,X,"linkedinUsage",0,function(e,t=Date.now()){let r=X(e,t),a=j(e),o=function(e,t=Date.now()){let r,a=function(e){let t;try{t=(0,n.readdirSync)(i.default.join(e,"pushback"),{withFileTypes:!0}).filter(e=>e.isFile()&&M.test(e.name)).map(e=>e.name)}catch{return null}for(let r of t.sort().reverse()){let[,t,a,o,s,l,c]=r.match(M).map(Number),u=new Date(t,a-1,o,s,l,c);if(u.getMonth()===a-1&&u.getDate()===o&&!(s>23)&&!(l>59)&&!(c>59))return{at:u.getTime(),reason:function(e){let t;try{t=(0,n.openSync)(e,"r");let r=Buffer.alloc(256),i=(0,n.readSync)(t,r,0,256,0),a=r.subarray(0,i).toString("utf8").split(/\r?\n/)[0].match(/^reason: (.+)$/),o=a&&a[1].replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,120);return o&&!/:\/\/|www\.|linkedin\.com|\/in\//i.test(o)?o:null}catch{return null}finally{void 0!==t&&(0,n.closeSync)(t)}}(i.default.join(e,"pushback",r))}}return null}(e),o=O(i.default.join(e,q)),s=Number(o?.until),l=B(o)&&Number.isFinite(s)?{at:Y(o.set_at)?1e3*o.set_at:null,reason:"string"==typeof o.reason&&o.reason.trim()?o.reason.trim().slice(0,160):"LinkedIn pushed back",pausedUntil:(Y(o.was_until)?o.was_until:s)*1e3,liftedAt:Y(o.lifted_at)?1e3*o.lifted_at:null}:null,c=a&&{at:a.at,reason:a.reason?`LinkedIn pushed back: ${a.reason}`:"LinkedIn pushed back",pausedUntil:null,liftedAt:null};return(r=l&&c&&null!=l.at&&6e5>=Math.abs(l.at-c.at)?{...l,at:Math.min(l.at,c.at)}:l&&c?(l.at??-1/0)>=c.at?l:c:l||c)?{...r,active:!r.liftedAt&&null!=r.pausedUntil&&r.pausedUntil>t}:null}(e,t),s=e=>a?e(a):null;return{...r,now:t,searchesToday:a?r.searchesToday:null,profilesToday:a?r.profilesToday:null,invitesToday:a?r.invitesToday:null,invitesWeek:a?r.invitesWeek:null,searchesMonth:a?r.searchesMonth:null,leftMonth:a?r.leftMonth:null,searchesLastHour:s(e=>U(e.searches,t,3600)),searchesWeek:s(e=>U(e.searches,t,604800)),dayFreesAt:s(e=>C(e.searches,t,r.limits.daily)),dayClearAt:s(e=>(function(e,t,n=86400){let r=e.filter(e=>e>t/1e3-n);return r.length?(Math.max(...r)+n)*1e3:null})(e.searches,t)),profilesFreeAt:s(e=>C(e.profiles,t,r.limits.profiles)),lastPushback:o,searchesSincePushback:s(e=>(function(e,t){if(!Number.isFinite(t)||!Array.isArray(e))return 0;let n=(t+6e4)/1e3;return e.filter(e=>e>n).length})(e.searches,o?.at))}},"mergeBudgetFiles",0,z,"writeLimits",0,function(e,{daily:t,monthly:n,profiles:r,pace:a}={}){let o=v(e),s={daily:x.includes(t)?t:o.daily,monthly:R.includes(n)?n:o.monthly,profiles:D.includes(r)?r:o.profiles,pace:b[a]?a:o.pace};return F(i.default.join(e,"scan-limits.json"),s),s}],41238);var Q=e.i(74533);let Z=/^[A-Za-z0-9_-]+\.(webp|jpg|jpeg|png)$/,ee="/avatars/";function et(e){return"string"==typeof e&&e.startsWith(ee)&&Z.test(e.slice(ee.length))?e:null}function en(e){return e.prepare(`SELECT DISTINCT profile_url AS profileUrl, profile_image_url AS imageUrl
|
|
164
164
|
FROM linkedin_connections
|
|
165
165
|
WHERE profile_image_url IS NOT NULL AND profile_image_url <> ''
|
|
166
166
|
AND substr(profile_image_url, 1, 9) <> '/avatars/'
|
|
167
|
-
ORDER BY profile_url`).all().filter(e=>e.profileUrl&&!
|
|
168
|
-
WHERE substr(profile_image_url, 1, 9) = '/avatars/'`).all().map(e=>e.name))}function eA(e,{dir:t,outFile:r,includePhotos:a=!0,includeSocial:o=!0,appVersion:s,schemaSql:l,now:c=new Date}){let u;e.exec(`VACUUM INTO ${eg(r)}`);let f=new eh.DatabaseSync(r);try{f.exec("PRAGMA journal_mode = DELETE"),f.exec(`${Object.values(eT).join(";\n")};`),f.exec("BEGIN"),a||f.exec("UPDATE linkedin_connections SET profile_image_url = NULL WHERE profile_image_url LIKE '/avatars/%'"),f.exec("DELETE FROM app_meta WHERE key = 'last_import'");let e=f.prepare("INSERT INTO sd_export_files (path, bytes, sha256) VALUES (?, ?, ?)"),r=0,d=0,p=a?e_(f):null;for(let s of function(e,{includePhotos:t=!0,photos:r=null,includeSocial:a=!0}={}){let o=e=>{try{return(0,n.lstatSync)(e).isFile()}catch{return!1}},s=[];for(let t of en){let n=i.default.join(e,t);o(n)&&s.push({rel:t,abs:n})}if(a)for(let t of eu(e).sort()){let n=i.default.join(e,t);et.test(t)&&o(n)&&s.push({rel:t,abs:n})}if(t)for(let t of eu(i.default.join(e,"avatars")).sort()){if(!H.test(t)||r&&!r.has(t))continue;let n=i.default.join(e,"avatars",t);o(n)&&s.push({rel:`avatars/${t}`,abs:n})}return s}(t,{includePhotos:a,photos:p,includeSocial:o})){let t;try{t=(0,n.readFileSync)(s.abs)}catch{continue}e.run(s.rel,t,eE(t)),d++,s.rel.startsWith("avatars/")&&r++}let h={};for(let e of eS(l))try{h[e]=f.prepare(`SELECT count(*) AS n FROM "${e}"`).get().n}catch{h[e]=0}let m="";try{m=f.prepare("SELECT value FROM app_meta WHERE key = 'scoring_version'").get()?.value??""}catch{}let y=eb(f),T={format:1,app_version:s,scoring_version:m,exported_at:c.toISOString(),include_photos:+!!a,people:y,photos:r,files:d,counts:JSON.stringify(h)},E=f.prepare("INSERT INTO sd_export_manifest (key, value) VALUES (?, ?)");for(let[e,t]of Object.entries(T))E.run(e,String(t));f.exec("COMMIT"),u={people:y,photos:r,files:d,counts:h}}catch(e){try{f.exec("ROLLBACK")}catch{}throw e}finally{f.close()}return{...u,bytes:(0,n.statSync)(r).size}}e.s(["EXPORT_EXTENSION",0,ey,"EXPORT_FORMAT",0,1,"EXPORT_TABLES",0,eT,"appIndexes",0,ew,"appTables",0,eS,"buildExport",0,eA,"countPeople",0,eb,"exportFileName",0,function(e=new Date){let t=e=>String(e).padStart(2,"0");return`Six Degrees backup ${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}${ey}`},"referencedPhotos",0,e_,"sha256",0,eE,"sqlString",0,eg],92375);let ek="/api/data/import",eN=Buffer.from("SQLite format 3\0","latin1");class eI extends Error{constructor(e,{status:t=400,...n}={}){super(e),this.status=t,this.extra=n}}function eR(e){let t=e/1024/1024;return`${t<10?t.toFixed(1):Math.round(t)} MB`}let eD=e=>String(e).slice(0,80);async function eO(e,t,{declared:n}){let r=await (0,l.open)(t,"wx",384),i=0;try{if(e)for await(let t of e){let e=t instanceof Uint8Array?t:new Uint8Array(t);if((i+=e.byteLength)>n)throw new eI("The file was bigger than the size it was sent with, so nothing was imported. Try again.");for(let t=0;t<e.byteLength;){let{bytesWritten:n}=await r.write(e,t,e.byteLength-t);t+=n}}}finally{await r.close()}if(i!==n)throw new eI(`The file didn't arrive whole (${i} of ${n} bytes), so nothing was imported. Try again.`);return i}function ex(e){return"string"!=typeof e?null:en.includes(e)?"file":et.test(e)?"social":e.startsWith("avatars/")&&H.test(e.slice(8))?"photo":null}let eF=["users","linkedin_connections",...Object.keys(eT)],eL=Object.freeze({tables:[],indexes:[],columns:{}});function e$(e,{applySchema:t,schemaSql:r,appVersion:i,retired:a=eL}){let o,l=Buffer.alloc(100),u=0,f=(0,n.openSync)(e,"r");try{u=(0,n.readSync)(f,l,0,100,0)}finally{(0,n.closeSync)(f)}if(u<100||!l.subarray(0,16).equals(eN))throw new eI("This isn't a Six Degrees export (a .sixdegrees file), so nothing was imported.");try{o=new s.DatabaseSync(e,{readOnly:!0})}catch(e){throw new eI(`This file couldn't be opened (${e.message}), so nothing was imported.`)}try{let e;o.exec("PRAGMA trusted_schema = OFF; PRAGMA query_only = ON; PRAGMA cell_size_check = ON;");try{e=o.prepare("PRAGMA integrity_check").all()}catch(t){e=[{integrity_check:t.message}]}if(1!==e.length||"ok"!==e[0].integrity_check)throw new eI("This file is damaged (its database fails SQLite's own check), so nothing was imported. Export it again on the other computer.");let n=function(e,t){let n=new s.DatabaseSync(":memory:");try{e(n),n.exec(`${Object.values(eT).join(";\n")};`);let r=new Map;for(let e of[...eS(t),...Object.keys(eT)]){let t=n.prepare(`PRAGMA table_info("${e}")`).all();r.set(e,{required:t.filter(e=>e.pk>0||e.notnull&&null===e.dflt_value).map(e=>e.name),allowed:new Set(t.map(e=>e.name))})}return{tables:r,indexes:new Set(ew(t))}}finally{n.close()}}(t,r),l=(e,t)=>new eI(`This file holds something a Six Degrees export never does (the ${eD(e)} “${eD(t)}”), so nothing was imported.`),u=new Map(o.prepare("PRAGMA main.table_list").all().map(e=>[e.name,e])),f=o.prepare("SELECT type, name, tbl_name FROM sqlite_master").all(),d=e=>n.tables.has(e)||a.tables.includes(e);for(let e of f){if("table"===e.type){let t=u.get(e.name)?.type;if("table"!==t)throw l(`${t||"unknown"} table`,e.name);if(d(e.name))continue}if(!("index"===e.type&&(n.indexes.has(e.name)||a.indexes.includes(e.name)||String(e.name).startsWith("sqlite_autoindex_")&&d(e.tbl_name))))throw l(e.type,e.name)}let p=new Set(f.filter(e=>"table"===e.type).map(e=>e.name));if(!p.has("sd_export_manifest")||!p.has("sd_export_files"))throw new eI("This is a database but not a Six Degrees export, so nothing was imported. Make one on the other computer with Export backup file… in Settings → Your data.");for(let[e,{required:t,allowed:r}]of n.tables){if(!p.has(e)){if(!eF.includes(e))continue;throw new eI(`This export has no “${e}” table, so nothing was imported.`)}let n=o.prepare(`PRAGMA table_xinfo("${e}")`).all(),i=n.map(e=>e.name),s=a.columns[e]||[];if(!(0===u.get(e).wr&&n.every(e=>0===e.hidden&&(r.has(e.name)||s.includes(e.name)))&&t.every(e=>i.includes(e))))throw new eI(`This export's “${e}” table isn't laid out the way Six Degrees makes it, so nothing was imported.`)}let h=Object.fromEntries(o.prepare("SELECT key, value FROM sd_export_manifest").all().map(e=>[e.key,e.value])),m=Number(h.format);if(1!==m)throw new eI(Number.isInteger(m)&&m>1?"This export was made by a newer Six Degrees than this copy. Update this copy first, then import it.":"This file's export details aren't ones Six Degrees writes, so nothing was imported.");let y=String(h.app_version??"");if(!/^v?\d+\.\d+\.\d+/.test(y))throw new eI("This file doesn't say which version of Six Degrees made it, so nothing was imported.");if((0,c.compareVersions)(y,i)>0)throw new eI(`This file comes from Six Degrees ${eD(y)}, which is newer than this copy (${i}). Update this copy first, then import it.`);let T=null;try{T=JSON.parse(h.counts)}catch{}if(!T||"object"!=typeof T||Array.isArray(T))throw new eI("This file's export details aren't ones Six Degrees writes, so nothing was imported.");let E=(e,t,n)=>new eI(`This file's ${e} doesn't match its own export details (${t}, where they say ${eD(n)}), so nothing was imported. Export it again on the other computer.`);for(let e of p){if(Object.hasOwn(eT,e))continue;let t=o.prepare(`SELECT count(*) AS n FROM "${e}"`).get().n;if(!Object.hasOwn(T,e)||Number(T[e])!==t)throw E(`“${e}” table`,`${t} rows`,T[e]??"nothing")}for(let[e,t]of Object.entries(T))if(!p.has(e)&&0!==Number(t))throw E(`“${eD(e)}” table`,"no table",t);let g=0,S=0,w=o.prepare("SELECT bytes, sha256 FROM sd_export_files WHERE path = ?");for(let{path:e}of o.prepare("SELECT path FROM sd_export_files").all()){let t,n=ex(e);if(!n)throw new eI(`This file carries “${eD(e)}”, which an export never includes, so nothing was imported.`);let r=w.get(e);if(!(r?.bytes instanceof Uint8Array)||eE(r.bytes)!==r.sha256)throw new eI(`“${e}” inside this file is damaged (it doesn't match its checksum), so nothing was imported.`);if("photo"===n){g++;continue}try{t=JSON.parse(Buffer.from(r.bytes).toString("utf8"))}catch{t=void 0}if(!t||"object"!=typeof t||Array.isArray(t))throw new eI(`“${e}” inside this file can't be read, so nothing was imported.`);let i=ee.includes(e)?q(e,t):null;if(i)throw new eI(`“${e}” inside this file can't be used (${i}), so nothing was imported.`);S++}if(Number(h.files)!==g+S)throw E("list of files",`${g+S} files`,h.files??"nothing");return{fromVersion:y,exportedAt:h.exported_at||null,people:eb(o),photos:g,files:S}}catch(e){if(e instanceof eI)throw e;throw new eI(`This file couldn't be read as a Six Degrees export (${eD(e.message)}), so nothing was imported.`)}finally{o.close()}}function ej(e,{dir:t,applySchema:r,schemaSql:a,appVersion:o,replacedPeople:l=0,now:c=new Date,retired:u=eL,restoredFrom:f=null}){let d=e$(e,{applySchema:r,schemaSql:a,appVersion:o,retired:u}),p=i.default.dirname(e),h=i.default.join(p,"files"),m=i.default.join(p,"data.sqlite"),y=[],T=new s.DatabaseSync(m);try{T.exec("PRAGMA trusted_schema = OFF; PRAGMA cell_size_check = ON;"),r(T),T.exec(`ATTACH DATABASE ${eg(e)} AS up`);try{for(let e of(T.exec("BEGIN"),eS(a))){let t=new Set(T.prepare(`PRAGMA main.table_info("${e}")`).all().map(e=>e.name)),n=T.prepare(`PRAGMA up.table_info("${e}")`).all().filter(e=>t.has(e.name)).map(e=>`"${e.name}"`).join(", ");n&&T.exec(`INSERT INTO main."${e}" (${n}) SELECT ${n} FROM up."${e}" ORDER BY rowid`)}T.exec("COMMIT")}catch(e){try{T.exec("ROLLBACK")}catch{}throw new eI(`This export's network doesn't fit this copy's database (${e.message}), so nothing was imported.`)}(0,n.mkdirSync)(i.default.join(h,"avatars"),{recursive:!0});let t=T.prepare("SELECT bytes, sha256 FROM up.sd_export_files WHERE path = ?");for(let{path:e}of T.prepare("SELECT path FROM up.sd_export_files").all()){let r=t.get(e),a=ex(e);if(!a||!(r?.bytes instanceof Uint8Array)||eE(r.bytes)!==r.sha256)throw new eI(`“${eD(e)}” inside this file is damaged, so nothing was imported.`);(0,n.writeFileSync)(i.default.join(h,e),r.bytes,{flag:"wx"}),("file"===a||"social"===a)&&y.push(i.default.join(h,e))}}finally{T.close()}(0,n.rmSync)(e,{force:!0});let E={stagedAt:c.toISOString(),exportedAt:d.exportedAt,fromVersion:d.fromVersion,people:d.people,photos:d.photos,replacedPeople:l,...f?{restoredFrom:f}:{}};for(let e of((0,n.writeFileSync)(i.default.join(p,"READY"),`${JSON.stringify(E,null,2)}
|
|
169
|
-
`),[m,...y,i.default.join(p,"READY")]))
|
|
170
|
-
`)}catch{}throw e}let _=`${o}.done-${u.stamp}`;(0,n.renameSync)(o,_),(0,n.rmSync)(_,{recursive:!0,force:!0});let A=t=>{let n=i.default.relative(e,t);return!n||n.startsWith("..")||i.default.isAbsolute(n)?t:n};return{appliedAt:r.toISOString(),stagedAt:l.stagedAt??null,exportedAt:l.exportedAt??null,fromVersion:l.fromVersion??null,people:l.people??null,photos:l.photos??null,replacedPeople:l.replacedPeople??null,restoredFrom:l.restoredFrom??null,keptDatabase:
|
|
171
|
-
ON CONFLICT(key) DO UPDATE SET value = excluded.value`).run(JSON.stringify(t))}e.s(["IMPORT_ROUTE",0,ek,"ImportError",0,eI,"MAX_IMPORT_BYTES",0,0x10000000,"admitImport",0,function(e,{env:t,scanRunning:n,pending:r,currentPeople:i,max:a=0x10000000}){let o=h({method:e.method,pathname:ek,headers:e.headers,env:t});if(o)return{refused:o};let s=Number(e.headers.get("x-six-degrees-size")),l=i(),c=function({scanRunning:e,pending:t,declared:n,currentPeople:r=0,confirmedPeople:i,max:a=0x10000000}){return e?new eI(`${T(e)}. Let it finish, or stop it on the Scan page, then import.`,{status:409}):t?new eI("An import is already waiting to finish. Restart Six Degrees to finish it, or cancel it first.",{status:409}):!Number.isSafeInteger(n)||n<=0?new eI("Choose a Six Degrees export (a .sixdegrees file) to import."):n>a?new eI(`That file is ${eR(n)}. This copy can import files up to ${eR(a)}.`,{status:413}):r>0&&i!==r?new eI(`This copy already has ${r.toLocaleString("en-US")} people. Confirm that the import replaces them.`,{status:409,needsConfirm:!0,people:r}):null}({scanRunning:n(),pending:r(),declared:s,currentPeople:l,confirmedPeople:Number(e.headers.get("x-six-degrees-replace")),max:a});return c?{refused:{status:c.status,error:c.message,...c.extra}}:{declared:s,currentPeople:l}},"applyPendingImport",0,eG,"cancelPendingImport",0,function(e){let t=eq(e);if(!t)return{cancelled:!1,reason:"none"};if(t.started)return{cancelled:!1,reason:"started"};let r=i.default.join(e,er),a=`${r}.cancelled-${Date.now()}`;return(0,n.renameSync)(r,a),(0,n.rmSync)(a,{recursive:!0,force:!0}),{cancelled:!0}},"lastImport",0,function(e){try{let t=e.prepare("SELECT value FROM app_meta WHERE key = 'last_import'").get()?.value,n=t?JSON.parse(t):null;return n&&"object"==typeof n?n:null}catch{return null}},"pendingImport",0,eq,"receiveUpload",0,eO,"recordImport",0,eB,"restartAdvice",0,function({kind:e,code:t,dataDir:n=null}){let r="It finishes the import as it starts.";if(t)return{canRestart:!0,how:"Click Restart now to finish it: Six Degrees restarts, which takes a few seconds, and finishes the import as it starts."};if("mac-app"===e)return{canRestart:!1,how:`Quit Six Degrees (⌘Q) and open it again. ${r}`};if("windows-app"===e||"linux-app"===e)return{canRestart:!1,how:`Quit Six Degrees (File → Exit) and open it again. ${r}`};if("npm"===e){let e=n?` --data-dir '${String(n).replace(/'/g,"'\\''")}'`:"";return{canRestart:!1,how:`Stop Six Degrees with Ctrl-C in its Terminal window, then start it again. ${r}`,command:`npx six-degrees${e}`}}return"source"===e?{canRestart:!1,how:`Stop Six Degrees with Ctrl-C in its Terminal window, then start it again. ${r}`,command:"npm run start:packaged"}:{canRestart:!1,how:`Stop the server with Ctrl-C and start it again the way you started it. ${r}`}},"restartCodeFrom",0,function(e=process.env){let t=Number(e.SIX_DEGREES_RESTART_CODE);return Number.isInteger(t)&&t>1&&t<126?t:null},"stageImport",0,ej,"validateImport",0,e$],19041);var eW=e.x("node:sqlite",()=>require("node:sqlite"),!0);let eY=["daily","before-update","manual"],eJ=Object.freeze({daily:7,"before-update":3,"before-import":3}),eH="auto-before-",eK=/^\..+\.partial(?:-journal)?$/,eV=/(\d{4}-\d{2}-\d{2})T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,ez=/^(daily|before-update|manual)-(.+)-(\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-\d{3}Z)\.sixdegrees$/,eQ=/^(.+\.sqlite)-(?:wal|shm|journal)$/,eZ=/^(.+)-files$/;function e0(e,{autoPrefix:t=eH}={}){let n=ed(e,{autoPrefix:t}),r=new Set(n.map(e=>e.name)),i=new Map,a=[];for(let e of n){let n=eQ.exec(e.name);if(!e.folder&&n&&r.has(n[1])){a.push([n[1],e]);continue}let o=eZ.exec(e.name);if(e.folder&&o&&r.has(`${o[1]}.sqlite`)){a.push([`${o[1]}.sqlite`,e]);continue}i.set(e.name,function(e,t){let{name:n}=e,r={name:n,kind:"manual",format:null,version:null,restorable:!1,byHand:!0,withFiles:null,parts:[],bytes:e.bytes,modifiedAt:e.modifiedAt,at:function(e){let t=eV.exec(String(e));if(!t)return null;let n=Date.parse(`${t[1]}T${t[2]}:${t[3]}:${t[4]}.${t[5]}Z`);return Number.isFinite(n)?n:null}(n)??e.modifiedAt,folder:e.folder};if(e.folder)return r;let i=ez.exec(n);if(i)Object.assign(r,{kind:i[1],version:i[2],format:"sixdegrees",byHand:!1});else if(n.startsWith(t)&&n.endsWith(".sqlite")){let e=n.slice(t.length,-7),i=eV.exec(e);Object.assign(r,{kind:"before-update",format:"database",byHand:!1,version:i&&e.slice(0,i.index).replace(/-$/,"")||null})}else n.startsWith(ei)&&n.endsWith(".sqlite")?Object.assign(r,{kind:"before-import",format:"database",byHand:!1}):n.endsWith(ey)?r.format="sixdegrees":n.endsWith(".sqlite")&&(r.format="database");return r.restorable=null!==r.format,r}(e,t))}for(let[e,t]of a){let n=i.get(e);n.bytes+=t.bytes||0,n.parts.push(t.name),t.folder&&(n.withFiles=t.name)}return[...i.values()].sort((e,t)=>t.at-e.at||t.name.localeCompare(e.name))}function e1(e,{now:t=Date.now(),keep:r=eJ,floorMs:a=2592e6,autoPrefix:o=eH}={}){let s=t instanceof Date?t.getTime():t,l=e0(e,{autoPrefix:o}),c=[];for(let[t,o]of Object.entries(r))for(let r of l.filter(e=>e.kind===t&&!e.byHand).slice(o))if("before-import"!==t||!(s-r.at<a)){for(let t of[...r.parts,r.name])(0,n.rmSync)(i.default.join(e,t),{recursive:!0,force:!0});c.push(r.name)}for(let t of eu(e))if(eK.test(t))try{s-(0,n.lstatSync)(i.default.join(e,t)).mtimeMs>=36e5&&(0,n.rmSync)(i.default.join(e,t),{force:!0})}catch{}return c.length&&w.syncFolder(e),c}let e2=Symbol.for("six-degrees.backups-checked"),e5=Symbol.for("six-degrees.backup-failed"),e6=()=>globalThis[e2]||=new Map;function e3(e){return String(e||"it could not be read").replace(/,? so nothing was imported\..*$/s,".").replace(/\s+Export it again on the other computer\.?$/,"")}function e8(e,{applySchema:t,schemaSql:n,appVersion:r}){try{let i=e$(e,{applySchema:t,schemaSql:n,appVersion:r});return{ok:!0,...i}}catch(e){return{ok:!1,problem:e3(e instanceof eI?e.message:`It could not be read (${e.message}).`).replace(/^This file/,"This backup")}}}function e4(e){try{let t=(0,n.lstatSync)(e);return t.isFile()?`${e}|${t.size}|${t.mtimeMs}`:null}catch{return null}}function e9(e,t,n=new Date){globalThis[e5]={kind:e,at:n.toISOString(),message:e3(t?.message||String(t))}}function e7(e,{db:t,dataDir:r,backupsDir:a,appVersion:o,dataVersion:s=o,schemaSql:l,applySchema:c,now:u=new Date,rotate:f=!0}){let d;if(!eY.includes(e))throw Error(`There is no kind of backup called '${e}'.`);(0,n.mkdirSync)(a,{recursive:!0});let p=function(e,t,n=new Date){return`${e}-${t}-${n.toISOString().replace(/[:.]/g,"-")}${ey}`}(e,o,u),h=i.default.join(a,p),m=i.default.join(a,`.${p}.partial`),y=()=>{(0,n.rmSync)(m,{force:!0}),(0,n.rmSync)(`${m}-journal`,{force:!0})};y();try{d=eA(t,{dir:r,outFile:m,includePhotos:!0,includeSocial:!1,appVersion:s,schemaSql:l,now:u}),w.syncFile(m);let e=e8(m,{applySchema:c,schemaSql:l,appVersion:o});if(!e.ok)throw Error(`the copy failed its check: ${e.problem}`);(0,n.renameSync)(m,h),w.syncFolder(a)}catch(e){throw y(),e}let T=e4(h);if(T&&e6().set(T,{ok:!0,people:d.people,photos:d.photos}),globalThis[e5]=null,f)try{e1(a,{now:u})}catch{}return{name:p,file:h,kind:e,bytes:d.bytes,people:d.people,photos:d.photos,verified:!0}}function te(e){var t;let n=e.now||new Date;if(!function(e,t=Date.now()){return null==e||t-e>=864e5||e-t>=864e5}((t=e.backupsDir,e0(t).find(e=>"daily"===e.kind)?.at??null),n.getTime())||0===eb(e.db))return null;try{return e7("daily",{...e,now:n})}catch(e){throw e9("daily",e,n),e}}function tt(e,t,{restorable:n=!0}={}){return"string"!=typeof t||!t||t!==i.default.basename(t)||"."===t||".."===t||/[\\/\0]/.test(t)||!ed(e).some(e=>e.name===t)?null:e0(e).find(e=>e.name===t&&(e.restorable||!n))||null}function tn(){let e=process.env.SIX_DEGREES_HOME||i.default.join((0,r.homedir)(),".six-degrees");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e}e.s(["AUTO_BACKUP_PREFIX",0,eH,"backupReport",0,function(e,{applySchema:t,schemaSql:n,appVersion:r}){let a=e0(e),o=a.find(e=>"sixdegrees"===e.format&&!e.byHand)||null,s=null;if(o){let a=function(e,t){let n=e4(e);if(!n)return{ok:!1,problem:"It is no longer there."};let r=e6();return r.has(n)||r.set(n,e8(e,t)),r.get(n)}(i.default.join(e,o.name),{applySchema:t,schemaSql:n,appVersion:r});s={name:o.name,kind:o.kind,at:new Date(o.at).toISOString(),verified:a.ok,people:a.ok?a.people??null:null,problem:a.ok?null:a.problem}}return{backups:a,last:s,failed:globalThis[e5]||null,keep:eJ,floorDays:30}},"dailyBackupIfDue",0,te,"findBackup",0,tt,"makeBackup",0,e7,"noteBackupFailure",0,e9,"restoreBackup",0,function(e,{dir:t,backupsDir:r,applySchema:a,schemaSql:o,appVersion:s,replacedPeople:l=0,now:c=new Date}){let u=tt(r,e);if(!u)throw new eI("There is no backup by that name in the backups folder.",{status:404});ep(t);let f=(0,n.mkdtempSync)(i.default.join(t,eo));try{let e=i.default.join(f,"upload.sixdegrees"),d=i.default.join(r,u.name);if("sixdegrees"===u.format)(0,n.copyFileSync)(d,e);else{let a,l=i.default.join(f,"backup.sqlite");(0,n.copyFileSync)(d,l);try{a=new eW.DatabaseSync(l)}catch(e){throw new eI(`This backup couldn't be opened (${e.message}).`)}try{eA(a,{dir:u.withFiles?i.default.join(r,u.withFiles):t,outFile:e,includePhotos:!0,includeSocial:!!u.withFiles,appVersion:s,schemaSql:o,now:c})}catch(e){throw new eI(`This backup couldn't be read (${e.message}).`)}finally{a.close()}(0,n.rmSync)(l,{force:!0})}return ej(e,{dir:t,applySchema:a,schemaSql:o,appVersion:s,replacedPeople:l,now:c,restoredFrom:u.name})}catch(e){if((0,n.rmSync)(f,{recursive:!0,force:!0}),e instanceof eI)throw new eI(e3(e.message).replace(/^This file/,"This backup"),{status:e.status,...e.extra});throw e}},"restorePreflight",0,function({scanRunning:e,pending:t,currentPeople:n=0,confirmedPeople:r}){return e?new eI(`${T(e)}. Let it finish, or stop it on the Scan page, then restore.`,{status:409}):t?new eI("An import or a restore is already waiting to finish. Restart Six Degrees to finish it, or cancel it first.",{status:409}):n>0&&r!==n?new eI(`This copy has ${n.toLocaleString("en-US")} people. Confirm that the backup replaces them.`,{status:409,needsConfirm:!0,people:n}):null},"rotateBackups",0,e1],97838);let tr={users:["sectors","goals","company_prestige_config"],user_profile:["sectors","goals","company_prestige_config"],linkedin_connections:["influence_signals"],notifications:["data"],queue_items:[],user_stats:[]},ti={linkedin_connections:["is_catalyst"],notifications:["seen"],users:[],user_profile:[],queue_items:[],user_stats:[]},ta=null,to=Symbol.for("six-degrees.db-opened");function ts(){return process.env.SIX_DEGREES_DB||i.default.join(tn(),"six-degrees.sqlite")}function tl(){if(ta)return ta;let e=ts(),r=null;if(!globalThis[to])try{(r=eG({dir:tn(),dbFile:e}))&&console.log(`Six Degrees: finished the import (${r.people} people). What was here before: ${r.keptDatabase||"nothing to keep"}.`)}catch(e){console.error(`Six Degrees: could not finish the import (will try again next start): ${e.message}`)}globalThis[to]=!0,ta=new t.DatabaseSync(e);try{let t=function(e,{dir:t,version:r,dataDir:o=t,now:s=new Date,schemaSql:l=a,applySchema:u=td}){let f=i.default.join(t,"app-version"),d=null;try{d=(0,n.readFileSync)(f,"utf8").trim()}catch{}if(d===r)return null;let p=null;if(e.prepare("SELECT count(*) AS n FROM sqlite_master WHERE type = 'table' AND name = 'linkedin_connections'").get().n>0){let a=i.default.join(t,"backups"),f=/^v?\d+\.\d+\.\d+/.test(d||"")&&0>=(0,c.compareVersions)(d,r);try{p=e7("before-update",{db:e,dataDir:o,backupsDir:a,appVersion:r,dataVersion:f?d:r,schemaSql:l,applySchema:u,now:s}).file}catch(o){e9("before-update",o,s),(0,n.mkdirSync)(a,{recursive:!0}),p=i.default.join(a,`${eH}${r}-${s.toISOString().replace(/[:.]/g,"-")}.sqlite`);let t=i.default.join(a,`.${i.default.basename(p)}.partial`);try{e.exec(`VACUUM INTO '${t.replace(/'/g,"''")}'`),w.syncFile(t),(0,n.renameSync)(t,p),w.syncFolder(a)}catch(e){throw(0,n.rmSync)(t,{force:!0}),e}try{e1(a,{now:s})}catch{}}}return(0,n.writeFileSync)(f,`${r}
|
|
172
|
-
`),p}(
|
|
167
|
+
ORDER BY profile_url`).all().filter(e=>e.profileUrl&&!et(e.imageUrl))}e.s(["AVATAR_FILE",0,Z,"localPhoto",0,et,"waitingPhotoCount",0,function(e){return new Set(en(e).map(e=>e.profileUrl)).size},"waitingPhotos",0,en],98612);let er="csv-network.json",ei=["bridge-progress.json","bridge-skips.json","bridge-unclear.json",er],ea=["scan-limits.json","linkedin-activity.json","linkedin-cooldown.json"],eo=/^(?:social|social-messages|crm)-[\w-]+\.json$/,es=[...ei,...ea],el="import-pending",ec="before-import-",eu=".export-",ed=".import-upload-",ef=".python-setup-",ep=[eu,ed,ef],eh=/^import-pending\.(done|cancelled)-/;function em(e){try{return(0,n.lstatSync)(e).isDirectory()?(0,n.readdirSync)(e):[]}catch{return[]}}function ey(e,t=()=>!0){let r=0,a=0;for(let o of em(e))if(t(o))try{let t=(0,n.lstatSync)(i.default.join(e,o));t.isFile()&&(r++,a+=t.size)}catch{}return{count:r,bytes:a}}function eT(e,{autoPrefix:t}={}){let r=[];try{r=(0,n.readdirSync)(e)}catch{return[]}let a=[];for(let o of r){let r;if(o.startsWith(".")||o.endsWith(".partial"))continue;let s=i.default.join(e,o);try{r=(0,n.lstatSync)(s)}catch{continue}(r.isFile()||r.isDirectory())&&a.push({name:o,bytes:r.isFile()?r.size:function e(t,r={left:5e4}){let a=0,o=[];try{o=(0,n.readdirSync)(t)}catch{return 0}for(let s of o){if(r.left--<=0)break;let o=i.default.join(t,s);try{let t=(0,n.lstatSync)(o);t.isDirectory()?a+=e(o,r):t.isFile()&&(a+=t.size)}catch{}}return a}(s),modifiedAt:r.mtimeMs,kind:t&&o.startsWith(t)?"auto":o.startsWith(ec)?"import":"manual",folder:r.isDirectory()})}return a.sort((e,t)=>t.modifiedAt-e.modifiedAt||t.name.localeCompare(e.name))}function eE(e,{now:t=Date.now(),maxAgeMs:r=36e5}={}){let a=[];try{a=(0,n.readdirSync)(e)}catch{return 0}let o=0;for(let s of a){let a=ep.some(e=>s.startsWith(e));if(!a&&!eh.test(s))continue;let l=i.default.join(e,s);try{let e=(0,n.lstatSync)(l);if(!e.isDirectory()||a&&t-e.mtimeMs<r)continue;(0,n.rmSync)(l,{recursive:!0,force:!0}),o++}catch{}}return o}e.s(["BUDGET_FILES",0,ea,"CSV_NETWORK_FILE",0,er,"EXPORT_WORK_PREFIX",0,eu,"IMPORT_BACKUP_PREFIX",0,ec,"NETWORK_FILES",0,ei,"PENDING_DIR",0,el,"SETUP_WORK_PREFIX",0,ef,"SOCIAL_FILE",0,eo,"TRAVELLING_FILES",0,es,"UPLOAD_WORK_PREFIX",0,ed,"folderReport",0,function({dir:e,dbFile:t,autoPrefix:r,inNetwork:a=null}){let o=i.default.join(e,"avatars");return{dataDir:e,dbFile:t,databaseBytes:["","-wal","-shm"].reduce((e,r)=>e+function(e){try{let t=(0,n.lstatSync)(e);return t.isFile()?t.size:0}catch{return 0}}(t+r),0),photos:ey(o,e=>Z.test(e)),photosInCopy:a?ey(o,e=>Z.test(e)&&a.has(e)):null,backups:eT(i.default.join(i.default.dirname(t),"backups"),{autoPrefix:r}),linkedinSignIn:(0,n.existsSync)(i.default.join(e,"chrome-profile"))}},"listBackups",0,eT,"namesInFolder",0,em,"revealFolder",0,function(e,{platform:t=process.platform,spawnImpl:n=Q.spawn,waitMs:r=3e3,select:i=null}={}){let a=function(e=process.platform){return"darwin"===e?"open":"linux"===e?"xdg-open":null}(t);if(!a)return Promise.resolve({ok:!1,message:"There is no file browser to open it with on this computer."});let o=i&&"open"===a?["-R",i]:[e];return new Promise(e=>{let t,i=null,s=!1,l=t=>{s||(s=!0,clearTimeout(i),e(t))};try{t=n(a,o,{stdio:"ignore",detached:!0})}catch(e){l({ok:!1,message:`It couldn't be opened (${e.message}).`});return}t.on("error",e=>l({ok:!1,message:"ENOENT"===e.code?`This computer has no ${a}, so there is no file browser to open it with.`:`It couldn't be opened (${e.message}).`})),t.on("exit",e=>l(0===e?{ok:!0}:{ok:!1,message:`The file browser didn't open (${a} stopped with code ${e}).`})),i=setTimeout(()=>{try{t.unref()}catch{}l({ok:!0})},r)})},"sweepLeftovers",0,eE],26525);var eg=e.x("node:sqlite",()=>require("node:sqlite"),!0),ew=e.i(66680);let eS=".sixdegrees",eb={sd_export_manifest:"CREATE TABLE sd_export_manifest (key TEXT PRIMARY KEY, value TEXT NOT NULL)",sd_export_files:"CREATE TABLE sd_export_files (path TEXT PRIMARY KEY, bytes BLOB NOT NULL, sha256 TEXT NOT NULL)"};function e_(e){return(0,ew.createHash)("sha256").update(e).digest("hex")}function eA(e){return`'${String(e).replace(/'/g,"''")}'`}function ek(e){return[...e.matchAll(/CREATE TABLE IF NOT EXISTS (\w+)/g)].map(e=>e[1])}function eN(e){return[...e.matchAll(/CREATE (?:UNIQUE )?INDEX IF NOT EXISTS (\w+)/g)].map(e=>e[1])}function eI(e,t="main"){try{return e.prepare(`SELECT count(DISTINCT profile_url) AS n FROM ${t}.linkedin_connections`).get().n}catch{return 0}}function ex(e){return new Set(e.prepare(`SELECT DISTINCT substr(profile_image_url, 10) AS name FROM linkedin_connections
|
|
168
|
+
WHERE substr(profile_image_url, 1, 9) = '/avatars/'`).all().map(e=>e.name))}function eR(e,{dir:t,outFile:r,includePhotos:a=!0,includeSocial:o=!0,appVersion:s,schemaSql:l,now:c=new Date}){let u;e.exec(`VACUUM INTO ${eA(r)}`);let d=new eg.DatabaseSync(r);try{d.exec("PRAGMA journal_mode = DELETE"),d.exec(`${Object.values(eb).join(";\n")};`),d.exec("BEGIN"),a||d.exec("UPDATE linkedin_connections SET profile_image_url = NULL WHERE profile_image_url LIKE '/avatars/%'"),d.exec("DELETE FROM app_meta WHERE key = 'last_import'");let e=d.prepare("INSERT INTO sd_export_files (path, bytes, sha256) VALUES (?, ?, ?)"),r=0,f=0,p=a?ex(d):null;for(let s of function(e,{includePhotos:t=!0,photos:r=null,includeSocial:a=!0}={}){let o=e=>{try{return(0,n.lstatSync)(e).isFile()}catch{return!1}},s=[];for(let t of es){let n=i.default.join(e,t);o(n)&&s.push({rel:t,abs:n})}if(a)for(let t of em(e).sort()){let n=i.default.join(e,t);eo.test(t)&&o(n)&&s.push({rel:t,abs:n})}if(t)for(let t of em(i.default.join(e,"avatars")).sort()){if(!Z.test(t)||r&&!r.has(t))continue;let n=i.default.join(e,"avatars",t);o(n)&&s.push({rel:`avatars/${t}`,abs:n})}return s}(t,{includePhotos:a,photos:p,includeSocial:o})){let t;try{t=(0,n.readFileSync)(s.abs)}catch{continue}e.run(s.rel,t,e_(t)),f++,s.rel.startsWith("avatars/")&&r++}let h={};for(let e of ek(l))try{h[e]=d.prepare(`SELECT count(*) AS n FROM "${e}"`).get().n}catch{h[e]=0}let m="";try{m=d.prepare("SELECT value FROM app_meta WHERE key = 'scoring_version'").get()?.value??""}catch{}let y=eI(d),T={format:1,app_version:s,scoring_version:m,exported_at:c.toISOString(),include_photos:+!!a,people:y,photos:r,files:f,counts:JSON.stringify(h)},E=d.prepare("INSERT INTO sd_export_manifest (key, value) VALUES (?, ?)");for(let[e,t]of Object.entries(T))E.run(e,String(t));d.exec("COMMIT"),u={people:y,photos:r,files:f,counts:h}}catch(e){try{d.exec("ROLLBACK")}catch{}throw e}finally{d.close()}return{...u,bytes:(0,n.statSync)(r).size}}e.s(["EXPORT_EXTENSION",0,eS,"EXPORT_FORMAT",0,1,"EXPORT_TABLES",0,eb,"appIndexes",0,eN,"appTables",0,ek,"buildExport",0,eR,"countPeople",0,eI,"exportFileName",0,function(e=new Date){let t=e=>String(e).padStart(2,"0");return`Six Degrees backup ${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}${eS}`},"referencedPhotos",0,ex,"sha256",0,e_,"sqlString",0,eA],92375);let eD="/api/data/import",eL=Buffer.from("SQLite format 3\0","latin1");class eO extends Error{constructor(e,{status:t=400,...n}={}){super(e),this.status=t,this.extra=n}}function eF(e){let t=e/1024/1024;return`${t<10?t.toFixed(1):Math.round(t)} MB`}let e$=e=>String(e).slice(0,80);async function ev(e,t,{declared:n}){let r=await (0,l.open)(t,"wx",384),i=0;try{if(e)for await(let t of e){let e=t instanceof Uint8Array?t:new Uint8Array(t);if((i+=e.byteLength)>n)throw new eO("The file was bigger than the size it was sent with, so nothing was imported. Try again.");for(let t=0;t<e.byteLength;){let{bytesWritten:n}=await r.write(e,t,e.byteLength-t);t+=n}}}finally{await r.close()}if(i!==n)throw new eO(`The file didn't arrive whole (${i} of ${n} bytes), so nothing was imported. Try again.`);return i}function ej(e){return"string"!=typeof e?null:es.includes(e)?"file":eo.test(e)?"social":e.startsWith("avatars/")&&Z.test(e.slice(8))?"photo":null}let eX=["users","linkedin_connections",...Object.keys(eb)],eU=Object.freeze({tables:[],indexes:[],columns:{}});function eC(e,{applySchema:t,schemaSql:r,appVersion:i,retired:a=eU}){let o,l=Buffer.alloc(100),u=0,d=(0,n.openSync)(e,"r");try{u=(0,n.readSync)(d,l,0,100,0)}finally{(0,n.closeSync)(d)}if(u<100||!l.subarray(0,16).equals(eL))throw new eO("This isn't a Six Degrees export (a .sixdegrees file), so nothing was imported.");try{o=new s.DatabaseSync(e,{readOnly:!0})}catch(e){throw new eO(`This file couldn't be opened (${e.message}), so nothing was imported.`)}try{let e;o.exec("PRAGMA trusted_schema = OFF; PRAGMA query_only = ON; PRAGMA cell_size_check = ON;");try{e=o.prepare("PRAGMA integrity_check").all()}catch(t){e=[{integrity_check:t.message}]}if(1!==e.length||"ok"!==e[0].integrity_check)throw new eO("This file is damaged (its database fails SQLite's own check), so nothing was imported. Export it again on the other computer.");let n=function(e,t){let n=new s.DatabaseSync(":memory:");try{e(n),n.exec(`${Object.values(eb).join(";\n")};`);let r=new Map;for(let e of[...ek(t),...Object.keys(eb)]){let t=n.prepare(`PRAGMA table_info("${e}")`).all();r.set(e,{required:t.filter(e=>e.pk>0||e.notnull&&null===e.dflt_value).map(e=>e.name),allowed:new Set(t.map(e=>e.name))})}return{tables:r,indexes:new Set(eN(t))}}finally{n.close()}}(t,r),l=(e,t)=>new eO(`This file holds something a Six Degrees export never does (the ${e$(e)} “${e$(t)}”), so nothing was imported.`),u=new Map(o.prepare("PRAGMA main.table_list").all().map(e=>[e.name,e])),d=o.prepare("SELECT type, name, tbl_name FROM sqlite_master").all(),f=e=>n.tables.has(e)||a.tables.includes(e);for(let e of d){if("table"===e.type){let t=u.get(e.name)?.type;if("table"!==t)throw l(`${t||"unknown"} table`,e.name);if(f(e.name))continue}if(!("index"===e.type&&(n.indexes.has(e.name)||a.indexes.includes(e.name)||String(e.name).startsWith("sqlite_autoindex_")&&f(e.tbl_name))))throw l(e.type,e.name)}let p=new Set(d.filter(e=>"table"===e.type).map(e=>e.name));if(!p.has("sd_export_manifest")||!p.has("sd_export_files"))throw new eO("This is a database but not a Six Degrees export, so nothing was imported. Make one on the other computer with Export backup file… in Settings → Your data.");for(let[e,{required:t,allowed:r}]of n.tables){if(!p.has(e)){if(!eX.includes(e))continue;throw new eO(`This export has no “${e}” table, so nothing was imported.`)}let n=o.prepare(`PRAGMA table_xinfo("${e}")`).all(),i=n.map(e=>e.name),s=a.columns[e]||[];if(!(0===u.get(e).wr&&n.every(e=>0===e.hidden&&(r.has(e.name)||s.includes(e.name)))&&t.every(e=>i.includes(e))))throw new eO(`This export's “${e}” table isn't laid out the way Six Degrees makes it, so nothing was imported.`)}let h=Object.fromEntries(o.prepare("SELECT key, value FROM sd_export_manifest").all().map(e=>[e.key,e.value])),m=Number(h.format);if(1!==m)throw new eO(Number.isInteger(m)&&m>1?"This export was made by a newer Six Degrees than this copy. Update this copy first, then import it.":"This file's export details aren't ones Six Degrees writes, so nothing was imported.");let y=String(h.app_version??"");if(!/^v?\d+\.\d+\.\d+/.test(y))throw new eO("This file doesn't say which version of Six Degrees made it, so nothing was imported.");if((0,c.compareVersions)(y,i)>0)throw new eO(`This file comes from Six Degrees ${e$(y)}, which is newer than this copy (${i}). Update this copy first, then import it.`);let T=null;try{T=JSON.parse(h.counts)}catch{}if(!T||"object"!=typeof T||Array.isArray(T))throw new eO("This file's export details aren't ones Six Degrees writes, so nothing was imported.");let E=(e,t,n)=>new eO(`This file's ${e} doesn't match its own export details (${t}, where they say ${e$(n)}), so nothing was imported. Export it again on the other computer.`);for(let e of p){if(Object.hasOwn(eb,e))continue;let t=o.prepare(`SELECT count(*) AS n FROM "${e}"`).get().n;if(!Object.hasOwn(T,e)||Number(T[e])!==t)throw E(`“${e}” table`,`${t} rows`,T[e]??"nothing")}for(let[e,t]of Object.entries(T))if(!p.has(e)&&0!==Number(t))throw E(`“${e$(e)}” table`,"no table",t);let g=0,w=0,S=o.prepare("SELECT bytes, sha256 FROM sd_export_files WHERE path = ?");for(let{path:e}of o.prepare("SELECT path FROM sd_export_files").all()){let t,n=ej(e);if(!n)throw new eO(`This file carries “${e$(e)}”, which an export never includes, so nothing was imported.`);let r=S.get(e);if(!(r?.bytes instanceof Uint8Array)||e_(r.bytes)!==r.sha256)throw new eO(`“${e}” inside this file is damaged (it doesn't match its checksum), so nothing was imported.`);if("photo"===n){g++;continue}try{t=JSON.parse(Buffer.from(r.bytes).toString("utf8"))}catch{t=void 0}if(!t||"object"!=typeof t||Array.isArray(t))throw new eO(`“${e}” inside this file can't be read, so nothing was imported.`);let i=ea.includes(e)?J(e,t):null;if(i)throw new eO(`“${e}” inside this file can't be used (${i}), so nothing was imported.`);w++}if(Number(h.files)!==g+w)throw E("list of files",`${g+w} files`,h.files??"nothing");return{fromVersion:y,exportedAt:h.exported_at||null,people:eI(o),photos:g,files:w}}catch(e){if(e instanceof eO)throw e;throw new eO(`This file couldn't be read as a Six Degrees export (${e$(e.message)}), so nothing was imported.`)}finally{o.close()}}function eM(e,{dir:t,applySchema:r,schemaSql:a,appVersion:o,replacedPeople:l=0,now:c=new Date,retired:u=eU,restoredFrom:d=null}){let f=eC(e,{applySchema:r,schemaSql:a,appVersion:o,retired:u}),p=i.default.dirname(e),h=i.default.join(p,"files"),m=i.default.join(p,"data.sqlite"),y=[],T=new s.DatabaseSync(m);try{T.exec("PRAGMA trusted_schema = OFF; PRAGMA cell_size_check = ON;"),r(T),T.exec(`ATTACH DATABASE ${eA(e)} AS up`);try{for(let e of(T.exec("BEGIN"),ek(a))){let t=new Set(T.prepare(`PRAGMA main.table_info("${e}")`).all().map(e=>e.name)),n=T.prepare(`PRAGMA up.table_info("${e}")`).all().filter(e=>t.has(e.name)).map(e=>`"${e.name}"`).join(", ");n&&T.exec(`INSERT INTO main."${e}" (${n}) SELECT ${n} FROM up."${e}" ORDER BY rowid`)}T.exec("COMMIT")}catch(e){try{T.exec("ROLLBACK")}catch{}throw new eO(`This export's network doesn't fit this copy's database (${e.message}), so nothing was imported.`)}(0,n.mkdirSync)(i.default.join(h,"avatars"),{recursive:!0});let t=T.prepare("SELECT bytes, sha256 FROM up.sd_export_files WHERE path = ?");for(let{path:e}of T.prepare("SELECT path FROM up.sd_export_files").all()){let r=t.get(e),a=ej(e);if(!a||!(r?.bytes instanceof Uint8Array)||e_(r.bytes)!==r.sha256)throw new eO(`“${e$(e)}” inside this file is damaged, so nothing was imported.`);(0,n.writeFileSync)(i.default.join(h,e),r.bytes,{flag:"wx"}),("file"===a||"social"===a)&&y.push(i.default.join(h,e))}}finally{T.close()}(0,n.rmSync)(e,{force:!0});let E={stagedAt:c.toISOString(),exportedAt:f.exportedAt,fromVersion:f.fromVersion,people:f.people,photos:f.photos,replacedPeople:l,...d?{restoredFrom:d}:{}};for(let e of((0,n.writeFileSync)(i.default.join(p,"READY"),`${JSON.stringify(E,null,2)}
|
|
169
|
+
`),[m,...y,i.default.join(p,"READY")]))S.syncFile(e);for(let e of[i.default.join(h,"avatars"),h,p])S.syncFolder(e);return(0,n.renameSync)(p,i.default.join(t,el)),S.syncFolder(t),E}let eP=e=>{try{return(0,n.lstatSync)(e),!0}catch{return!1}};function eq(e){let t=Buffer.alloc(eL.length),r=(0,n.openSync)(e,"r");try{let e=(0,n.readSync)(r,t,0,t.length,0);return 0===e||e===t.length&&t.equals(eL)}finally{(0,n.closeSync)(r)}}function eG(e){try{return JSON.parse((0,n.readFileSync)(e,"utf8"))}catch{return null}}function eB(e,t){try{(0,n.renameSync)(e,t)}catch(r){if("EXDEV"!==r.code)throw r;(0,n.cpSync)(e,t,{recursive:!0}),(0,n.lstatSync)(t).isFile()&&S.syncFile(t),(0,n.rmSync)(e,{recursive:!0,force:!0})}}function eW(e,t){let r=`${t}.partial`;(0,n.rmSync)(r,{force:!0});try{let a=new s.DatabaseSync(e);try{a.exec(`VACUUM INTO ${eA(r)}`)}finally{a.close()}S.syncFile(r),(0,n.renameSync)(r,t),S.syncFolder(i.default.dirname(t))}catch(e){throw(0,n.rmSync)(r,{force:!0}),e}}function eY(e,t){let n=null,r=null;try{let i=(n=new s.DatabaseSync(t,{readOnly:!0})).prepare("PRAGMA quick_check").all();if(1!==i.length||"ok"!==i[0].quick_check)return!1;(r=new s.DatabaseSync(e)).exec("PRAGMA query_only = ON");let a=e=>e.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%'").all().map(e=>e.name),o=(e,t)=>e.prepare(`SELECT count(*) AS n FROM "${t.replace(/"/g,'""')}"`).get().n,l=new Set(a(n));return a(r).every(e=>l.has(e)&&o(r,e)===o(n,e))}catch{return!1}finally{n?.close(),r?.close()}}function eJ(e){let t=i.default.join(e,el);if(!eP(i.default.join(t,"READY")))return null;let r=eG(i.default.join(t,"READY"))||{},a=eG(i.default.join(t,"APPLYING")),o=null;try{o=(0,n.readFileSync)(i.default.join(t,"ERROR"),"utf8").trim()||null}catch{}let s=!!(a&&("start"!==a.phase||a.keptAsIs));return{...r,started:s,error:o}}function eV({dir:e,dbFile:t,now:r=new Date,copyDatabase:a=eW}){eE(e,{now:r.getTime()});let o=i.default.join(e,el);if(!eP(i.default.join(o,"READY")))return null;let l=eG(i.default.join(o,"READY"))||{},c=i.default.join(o,"APPLYING"),u=eG(c)||{stamp:r.toISOString().replace(/[:.]/g,"-"),phase:"start"},d=()=>S.writeFileDurably(c,JSON.stringify(u)),f=e=>{u.phase=e,d()},p=i.default.dirname(t),h=i.default.join(p,"backups"),m=i.default.join(h,`${ec}${u.stamp}.sqlite`),y=i.default.join(h,`${ec}${u.stamp}-files`),T=i.default.join(o,"data.sqlite"),E=["-wal","-shm","-journal"],g=()=>{for(let e of E)eP(`${t}${e}`)&&!eP(`${m}${e}`)&&eB(`${t}${e}`,`${m}${e}`);eP(t)&&!eP(m)&&eB(t,m),S.syncFolder(h),S.syncFolder(p)},w=!1,b=()=>{(0,n.mkdirSync)(h,{recursive:!0});try{if(!eq(t))throw Error("it is not a SQLite database");a(t,m),w=!0}catch(e){for(let e of["",...E])(0,n.rmSync)(`${m}${e}`,{force:!0});(0,n.rmSync)(`${m}.partial`,{force:!0}),u.keptAsIs=String(e.message||e).slice(0,200),d(),g()}};try{eP(c)||d();let r=["start","database-kept","files-kept"].includes(u.phase);if("start"===u.phase&&(!eP(T)||!function(e){let t=null;try{(t=new s.DatabaseSync(e)).exec("PRAGMA query_only = ON");let n=t.prepare("PRAGMA quick_check").all();return 1===n.length&&"ok"===n[0].quick_check&&1===t.prepare("SELECT count(*) AS n FROM sqlite_master WHERE type = 'table' AND name = 'linkedin_connections'").get().n}catch{return!1}finally{t?.close()}}(T)))throw Error("the imported network waiting here is damaged. Cancel the import and import the file again");if(r&&!u.keptAsIs&&eP(t)&&eq(t)&&function(e){let t=null;try{return(t=new s.DatabaseSync(e)).exec("PRAGMA locking_mode = EXCLUSIVE"),t.prepare("SELECT count(*) AS n FROM sqlite_master").get(),!1}catch(e){return 5===e.errcode||6===e.errcode||/database (table )?is locked/i.test(String(e.message))}finally{try{t?.close()}catch{}}}(t))throw Error("another copy of Six Degrees has this network open (one started with npx six-degrees or npm run dev, perhaps). Quit that copy, then restart this one");if(r&&u.keptAsIs&&g(),"start"===u.phase&&(!u.keptAsIs&&eP(t)&&b(),f("database-kept")),"database-kept"===u.phase){let t=()=>(0,n.mkdirSync)(y,{recursive:!0});for(let n of["avatars",...ei]){let r=i.default.join(e,n);eP(r)&&(t(),eB(r,i.default.join(y,n)))}if(em(i.default.join(o,"files")).some(e=>eo.test(e)))for(let n of em(e).filter(e=>eo.test(e)))t(),eB(i.default.join(e,n),i.default.join(y,n));for(let r of ea){let a=i.default.join(e,r);eP(a)&&(0,n.lstatSync)(a).isFile()&&(t(),(0,n.copyFileSync)(a,i.default.join(y,r)),S.syncFile(i.default.join(y,r)))}eP(y)&&S.syncFolder(y),S.syncFolder(h),S.syncFolder(e),f("files-kept")}if("files-kept"===u.phase){if(eP(T)){if(!u.keptAsIs&&eP(t)){let e=w&&eY(t,m);if(e||(b(),e=!!u.keptAsIs||eY(t,m)),!e)throw Error("the copy of the network here couldn't be checked, so it wasn't replaced")}for(let e of E)(0,n.rmSync)(`${t}${e}`,{force:!0});(0,n.mkdirSync)(p,{recursive:!0}),eB(T,t),S.syncFolder(p)}f("database-placed")}if("database-placed"===u.phase){let t=i.default.join(o,"files"),r=i.default.join(t,"avatars");if(eP(r)){for(let t of((0,n.mkdirSync)(i.default.join(e,"avatars"),{recursive:!0}),em(r)))eB(i.default.join(r,t),i.default.join(e,"avatars",t));S.syncFolder(i.default.join(e,"avatars"))}for(let n of ei){let r=i.default.join(t,n);eP(r)&&eB(r,i.default.join(e,n))}for(let n of em(t).filter(e=>eo.test(e)))eB(i.default.join(t,n),i.default.join(e,n));z({dir:e,from:t}),S.syncFolder(e),f("done")}}catch(e){try{(0,n.writeFileSync)(i.default.join(o,"ERROR"),`${e.message}
|
|
170
|
+
`)}catch{}throw e}let _=`${o}.done-${u.stamp}`;(0,n.renameSync)(o,_),(0,n.rmSync)(_,{recursive:!0,force:!0});let A=t=>{let n=i.default.relative(e,t);return!n||n.startsWith("..")||i.default.isAbsolute(n)?t:n};return{appliedAt:r.toISOString(),stagedAt:l.stagedAt??null,exportedAt:l.exportedAt??null,fromVersion:l.fromVersion??null,people:l.people??null,photos:l.photos??null,replacedPeople:l.replacedPeople??null,restoredFrom:l.restoredFrom??null,keptDatabase:eP(m)?A(m):null,keptFiles:eP(y)?A(y):null,keptAsIs:u.keptAsIs??null}}function eH(e,t){e.prepare(`INSERT INTO app_meta (key, value) VALUES ('last_import', ?)
|
|
171
|
+
ON CONFLICT(key) DO UPDATE SET value = excluded.value`).run(JSON.stringify(t))}e.s(["IMPORT_ROUTE",0,eD,"ImportError",0,eO,"MAX_IMPORT_BYTES",0,0x10000000,"admitImport",0,function(e,{env:t,scanRunning:n,pending:r,currentPeople:i,max:a=0x10000000}){let o=h({method:e.method,pathname:eD,headers:e.headers,env:t});if(o)return{refused:o};let s=Number(e.headers.get("x-six-degrees-size")),l=i(),c=function({scanRunning:e,pending:t,declared:n,currentPeople:r=0,confirmedPeople:i,max:a=0x10000000}){return e?new eO(`${T(e)}. Let it finish, or stop it on the Scan page, then import.`,{status:409}):t?new eO("An import is already waiting to finish. Restart Six Degrees to finish it, or cancel it first.",{status:409}):!Number.isSafeInteger(n)||n<=0?new eO("Choose a Six Degrees export (a .sixdegrees file) to import."):n>a?new eO(`That file is ${eF(n)}. This copy can import files up to ${eF(a)}.`,{status:413}):r>0&&i!==r?new eO(`This copy already has ${r.toLocaleString("en-US")} people. Confirm that the import replaces them.`,{status:409,needsConfirm:!0,people:r}):null}({scanRunning:n(),pending:r(),declared:s,currentPeople:l,confirmedPeople:Number(e.headers.get("x-six-degrees-replace")),max:a});return c?{refused:{status:c.status,error:c.message,...c.extra}}:{declared:s,currentPeople:l}},"applyPendingImport",0,eV,"cancelPendingImport",0,function(e){let t=eJ(e);if(!t)return{cancelled:!1,reason:"none"};if(t.started)return{cancelled:!1,reason:"started"};let r=i.default.join(e,el),a=`${r}.cancelled-${Date.now()}`;return(0,n.renameSync)(r,a),(0,n.rmSync)(a,{recursive:!0,force:!0}),{cancelled:!0}},"lastImport",0,function(e){try{let t=e.prepare("SELECT value FROM app_meta WHERE key = 'last_import'").get()?.value,n=t?JSON.parse(t):null;return n&&"object"==typeof n?n:null}catch{return null}},"pendingImport",0,eJ,"receiveUpload",0,ev,"recordImport",0,eH,"restartAdvice",0,function({kind:e,code:t,dataDir:n=null}){let r="It finishes the import as it starts.";if(t)return{canRestart:!0,how:"Click Restart now to finish it: Six Degrees restarts, which takes a few seconds, and finishes the import as it starts."};if("mac-app"===e)return{canRestart:!1,how:`Quit Six Degrees (⌘Q) and open it again. ${r}`};if("windows-app"===e||"linux-app"===e)return{canRestart:!1,how:`Quit Six Degrees (File → Exit) and open it again. ${r}`};if("npm"===e){let e=n?` --data-dir '${String(n).replace(/'/g,"'\\''")}'`:"";return{canRestart:!1,how:`Stop Six Degrees with Ctrl-C in its Terminal window, then start it again. ${r}`,command:`npx six-degrees${e}`}}return"source"===e?{canRestart:!1,how:`Stop Six Degrees with Ctrl-C in its Terminal window, then start it again. ${r}`,command:"npm run start:packaged"}:{canRestart:!1,how:`Stop the server with Ctrl-C and start it again the way you started it. ${r}`}},"restartCodeFrom",0,function(e=process.env){let t=Number(e.SIX_DEGREES_RESTART_CODE);return Number.isInteger(t)&&t>1&&t<126?t:null},"stageImport",0,eM,"validateImport",0,eC],19041);var eK=e.x("node:sqlite",()=>require("node:sqlite"),!0);let ez=["daily","before-update","manual"],eQ=Object.freeze({daily:7,"before-update":3,"before-import":3}),eZ="auto-before-",e0=/^\..+\.partial(?:-journal)?$/,e1=/(\d{4}-\d{2}-\d{2})T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,e2=/^(daily|before-update|manual)-(.+)-(\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-\d{3}Z)\.sixdegrees$/,e5=/^(.+\.sqlite)-(?:wal|shm|journal)$/,e6=/^(.+)-files$/;function e4(e,{autoPrefix:t=eZ}={}){let n=eT(e,{autoPrefix:t}),r=new Set(n.map(e=>e.name)),i=new Map,a=[];for(let e of n){let n=e5.exec(e.name);if(!e.folder&&n&&r.has(n[1])){a.push([n[1],e]);continue}let o=e6.exec(e.name);if(e.folder&&o&&r.has(`${o[1]}.sqlite`)){a.push([`${o[1]}.sqlite`,e]);continue}i.set(e.name,function(e,t){let{name:n}=e,r={name:n,kind:"manual",format:null,version:null,restorable:!1,byHand:!0,withFiles:null,parts:[],bytes:e.bytes,modifiedAt:e.modifiedAt,at:function(e){let t=e1.exec(String(e));if(!t)return null;let n=Date.parse(`${t[1]}T${t[2]}:${t[3]}:${t[4]}.${t[5]}Z`);return Number.isFinite(n)?n:null}(n)??e.modifiedAt,folder:e.folder};if(e.folder)return r;let i=e2.exec(n);if(i)Object.assign(r,{kind:i[1],version:i[2],format:"sixdegrees",byHand:!1});else if(n.startsWith(t)&&n.endsWith(".sqlite")){let e=n.slice(t.length,-7),i=e1.exec(e);Object.assign(r,{kind:"before-update",format:"database",byHand:!1,version:i&&e.slice(0,i.index).replace(/-$/,"")||null})}else n.startsWith(ec)&&n.endsWith(".sqlite")?Object.assign(r,{kind:"before-import",format:"database",byHand:!1}):n.endsWith(eS)?r.format="sixdegrees":n.endsWith(".sqlite")&&(r.format="database");return r.restorable=null!==r.format,r}(e,t))}for(let[e,t]of a){let n=i.get(e);n.bytes+=t.bytes||0,n.parts.push(t.name),t.folder&&(n.withFiles=t.name)}return[...i.values()].sort((e,t)=>t.at-e.at||t.name.localeCompare(e.name))}function e3(e,{now:t=Date.now(),keep:r=eQ,floorMs:a=2592e6,autoPrefix:o=eZ}={}){let s=t instanceof Date?t.getTime():t,l=e4(e,{autoPrefix:o}),c=[];for(let[t,o]of Object.entries(r))for(let r of l.filter(e=>e.kind===t&&!e.byHand).slice(o))if("before-import"!==t||!(s-r.at<a)){for(let t of[...r.parts,r.name])(0,n.rmSync)(i.default.join(e,t),{recursive:!0,force:!0});c.push(r.name)}for(let t of em(e))if(e0.test(t))try{s-(0,n.lstatSync)(i.default.join(e,t)).mtimeMs>=36e5&&(0,n.rmSync)(i.default.join(e,t),{force:!0})}catch{}return c.length&&S.syncFolder(e),c}let e8=Symbol.for("six-degrees.backups-checked"),e9=Symbol.for("six-degrees.backup-failed"),e7=()=>globalThis[e8]||=new Map;function te(e){return String(e||"it could not be read").replace(/,? so nothing was imported\..*$/s,".").replace(/\s+Export it again on the other computer\.?$/,"")}function tt(e,{applySchema:t,schemaSql:n,appVersion:r}){try{let i=eC(e,{applySchema:t,schemaSql:n,appVersion:r});return{ok:!0,...i}}catch(e){return{ok:!1,problem:te(e instanceof eO?e.message:`It could not be read (${e.message}).`).replace(/^This file/,"This backup")}}}function tn(e){try{let t=(0,n.lstatSync)(e);return t.isFile()?`${e}|${t.size}|${t.mtimeMs}`:null}catch{return null}}function tr(e,t,n=new Date){globalThis[e9]={kind:e,at:n.toISOString(),message:te(t?.message||String(t))}}function ti(e,{db:t,dataDir:r,backupsDir:a,appVersion:o,dataVersion:s=o,schemaSql:l,applySchema:c,now:u=new Date,rotate:d=!0}){let f;if(!ez.includes(e))throw Error(`There is no kind of backup called '${e}'.`);(0,n.mkdirSync)(a,{recursive:!0});let p=function(e,t,n=new Date){return`${e}-${t}-${n.toISOString().replace(/[:.]/g,"-")}${eS}`}(e,o,u),h=i.default.join(a,p),m=i.default.join(a,`.${p}.partial`),y=()=>{(0,n.rmSync)(m,{force:!0}),(0,n.rmSync)(`${m}-journal`,{force:!0})};y();try{f=eR(t,{dir:r,outFile:m,includePhotos:!0,includeSocial:!1,appVersion:s,schemaSql:l,now:u}),S.syncFile(m);let e=tt(m,{applySchema:c,schemaSql:l,appVersion:o});if(!e.ok)throw Error(`the copy failed its check: ${e.problem}`);(0,n.renameSync)(m,h),S.syncFolder(a)}catch(e){throw y(),e}let T=tn(h);if(T&&e7().set(T,{ok:!0,people:f.people,photos:f.photos}),globalThis[e9]=null,d)try{e3(a,{now:u})}catch{}return{name:p,file:h,kind:e,bytes:f.bytes,people:f.people,photos:f.photos,verified:!0}}function ta(e){var t;let n=e.now||new Date;if(!function(e,t=Date.now()){return null==e||t-e>=864e5||e-t>=864e5}((t=e.backupsDir,e4(t).find(e=>"daily"===e.kind)?.at??null),n.getTime())||0===eI(e.db))return null;try{return ti("daily",{...e,now:n})}catch(e){throw tr("daily",e,n),e}}function to(e,t,{restorable:n=!0}={}){return"string"!=typeof t||!t||t!==i.default.basename(t)||"."===t||".."===t||/[\\/\0]/.test(t)||!eT(e).some(e=>e.name===t)?null:e4(e).find(e=>e.name===t&&(e.restorable||!n))||null}function ts(){let e=process.env.SIX_DEGREES_HOME||i.default.join((0,r.homedir)(),".six-degrees");return(0,n.existsSync)(e)||(0,n.mkdirSync)(e,{recursive:!0}),e}e.s(["AUTO_BACKUP_PREFIX",0,eZ,"backupReport",0,function(e,{applySchema:t,schemaSql:n,appVersion:r}){let a=e4(e),o=a.find(e=>"sixdegrees"===e.format&&!e.byHand)||null,s=null;if(o){let a=function(e,t){let n=tn(e);if(!n)return{ok:!1,problem:"It is no longer there."};let r=e7();return r.has(n)||r.set(n,tt(e,t)),r.get(n)}(i.default.join(e,o.name),{applySchema:t,schemaSql:n,appVersion:r});s={name:o.name,kind:o.kind,at:new Date(o.at).toISOString(),verified:a.ok,people:a.ok?a.people??null:null,problem:a.ok?null:a.problem}}return{backups:a,last:s,failed:globalThis[e9]||null,keep:eQ,floorDays:30}},"dailyBackupIfDue",0,ta,"findBackup",0,to,"makeBackup",0,ti,"noteBackupFailure",0,tr,"restoreBackup",0,function(e,{dir:t,backupsDir:r,applySchema:a,schemaSql:o,appVersion:s,replacedPeople:l=0,now:c=new Date}){let u=to(r,e);if(!u)throw new eO("There is no backup by that name in the backups folder.",{status:404});eE(t);let d=(0,n.mkdtempSync)(i.default.join(t,ed));try{let e=i.default.join(d,"upload.sixdegrees"),f=i.default.join(r,u.name);if("sixdegrees"===u.format)(0,n.copyFileSync)(f,e);else{let a,l=i.default.join(d,"backup.sqlite");(0,n.copyFileSync)(f,l);try{a=new eK.DatabaseSync(l)}catch(e){throw new eO(`This backup couldn't be opened (${e.message}).`)}try{eR(a,{dir:u.withFiles?i.default.join(r,u.withFiles):t,outFile:e,includePhotos:!0,includeSocial:!!u.withFiles,appVersion:s,schemaSql:o,now:c})}catch(e){throw new eO(`This backup couldn't be read (${e.message}).`)}finally{a.close()}(0,n.rmSync)(l,{force:!0})}return eM(e,{dir:t,applySchema:a,schemaSql:o,appVersion:s,replacedPeople:l,now:c,restoredFrom:u.name})}catch(e){if((0,n.rmSync)(d,{recursive:!0,force:!0}),e instanceof eO)throw new eO(te(e.message).replace(/^This file/,"This backup"),{status:e.status,...e.extra});throw e}},"restorePreflight",0,function({scanRunning:e,pending:t,currentPeople:n=0,confirmedPeople:r}){return e?new eO(`${T(e)}. Let it finish, or stop it on the Scan page, then restore.`,{status:409}):t?new eO("An import or a restore is already waiting to finish. Restart Six Degrees to finish it, or cancel it first.",{status:409}):n>0&&r!==n?new eO(`This copy has ${n.toLocaleString("en-US")} people. Confirm that the backup replaces them.`,{status:409,needsConfirm:!0,people:n}):null},"rotateBackups",0,e3],97838);let tl={users:["sectors","goals","company_prestige_config"],user_profile:["sectors","goals","company_prestige_config"],linkedin_connections:["influence_signals"],notifications:["data"],queue_items:[],user_stats:[]},tc={linkedin_connections:["is_catalyst"],notifications:["seen"],users:[],user_profile:[],queue_items:[],user_stats:[]},tu=null,td=Symbol.for("six-degrees.db-opened");function tf(){return process.env.SIX_DEGREES_DB||i.default.join(ts(),"six-degrees.sqlite")}function tp(){if(tu)return tu;let e=tf(),r=null;if(!globalThis[td])try{(r=eV({dir:ts(),dbFile:e}))&&console.log(`Six Degrees: finished the import (${r.people} people). What was here before: ${r.keptDatabase||"nothing to keep"}.`)}catch(e){console.error(`Six Degrees: could not finish the import (will try again next start): ${e.message}`)}globalThis[td]=!0,tu=new t.DatabaseSync(e);try{let t=function(e,{dir:t,version:r,dataDir:o=t,now:s=new Date,schemaSql:l=a,applySchema:u=tT}){let d=i.default.join(t,"app-version"),f=null;try{f=(0,n.readFileSync)(d,"utf8").trim()}catch{}if(f===r)return null;let p=null;if(e.prepare("SELECT count(*) AS n FROM sqlite_master WHERE type = 'table' AND name = 'linkedin_connections'").get().n>0){let a=i.default.join(t,"backups"),d=/^v?\d+\.\d+\.\d+/.test(f||"")&&0>=(0,c.compareVersions)(f,r);try{p=ti("before-update",{db:e,dataDir:o,backupsDir:a,appVersion:r,dataVersion:d?f:r,schemaSql:l,applySchema:u,now:s}).file}catch(o){tr("before-update",o,s),(0,n.mkdirSync)(a,{recursive:!0}),p=i.default.join(a,`${eZ}${r}-${s.toISOString().replace(/[:.]/g,"-")}.sqlite`);let t=i.default.join(a,`.${i.default.basename(p)}.partial`);try{e.exec(`VACUUM INTO '${t.replace(/'/g,"''")}'`),S.syncFile(t),(0,n.renameSync)(t,p),S.syncFolder(a)}catch(e){throw(0,n.rmSync)(t,{force:!0}),e}try{e3(a,{now:s})}catch{}}}return(0,n.writeFileSync)(d,`${r}
|
|
172
|
+
`),p}(tu,{dir:i.default.dirname(e),dataDir:ts(),version:o});t&&console.log(`Six Degrees ${o}: backed up your data first → ${t}`)}catch(e){console.error(`Six Degrees: could not back up your data before ${o} (will try again next start): ${e.message}`)}if(tT(tu),r){try{eH(tu,r)}catch{}try{e3(th())}catch{}}try{let e=ty(tu);e&&console.log(`Six Degrees: made today's backup → ${e.file}`)}catch(e){console.error(`Six Degrees: could not make today's backup (will try again after the next scan or start): ${e.message}`)}return tu}function th(){return i.default.join(i.default.dirname(tf()),"backups")}function tm(e=tp()){return{db:e,dataDir:ts(),backupsDir:th(),appVersion:o,schemaSql:a,applySchema:tT}}function ty(e=tp(),t=new Date){return ta({...tm(e),now:t})}function tT(e){e.exec(a),function(e){for(let[t,n,r]of tE)e.prepare(`PRAGMA table_info(${t})`).all().some(e=>e.name===n)||e.exec(`ALTER TABLE ${t} ADD COLUMN ${n} ${r}`)}(e)}let tE=[["linkedin_connections","score_why","TEXT"],["linkedin_connections","mutual_count","INTEGER"]];e.s(["applySchema",0,tT,"backUpDailyIfDue",0,ty,"backupOptions",0,tm,"backupsFolder",0,th,"dataDir",0,ts,"dbFile",0,tf,"decodeRow",0,function(e,t){if(!t)return t;let n={...t};for(let t of tl[e]||[])if("string"==typeof n[t])try{n[t]=JSON.parse(n[t])}catch{}for(let t of tc[e]||[])(0===n[t]||1===n[t])&&(n[t]=!!n[t]);return n},"encodeValue",0,function(e,t,n){return void 0===n?null:(tl[e]||[]).includes(t)?null===n?null:JSON.stringify(n):(tc[e]||[]).includes(t)?null===n?null:+!!n:"boolean"==typeof n?+!!n:null!==n&&"object"==typeof n?JSON.stringify(n):n},"getDb",0,tp,"newId",0,function(){return crypto.randomUUID()},"nowIso",0,function(){return new Date().toISOString()}],73156)}];
|
|
173
173
|
|
|
174
174
|
//# sourceMappingURL=lib_db-client_0_dch35.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[35862,s=>{s.v(e=>Promise.all(["server/chunks/lib_rpc_0c9d9ti.js","server/chunks/lib_scoring_1-e4ur0.js","server/chunks/lib_05agvk3._.js"].map(e=>s.l(e))).then(()=>e(33471)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=lib_rpc_00nndai.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[35862,s=>{s.v(e=>Promise.all(["server/chunks/lib_rpc_0c9d9ti.js","server/chunks/lib_scoring_1-e4ur0.js","server/chunks/lib_05agvk3._.js"].map(e=>s.l(e))).then(()=>e(33471)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=lib_rpc_03ibb-x.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[35862,s=>{s.v(e=>Promise.all(["server/chunks/lib_rpc_0c9d9ti.js","server/chunks/lib_scoring_1-e4ur0.js","server/chunks/lib_05agvk3._.js"].map(e=>s.l(e))).then(()=>e(33471)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=lib_rpc_03ri3ji.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[35862,s=>{s.v(e=>Promise.all(["server/chunks/lib_rpc_0c9d9ti.js","server/chunks/lib_scoring_1-e4ur0.js","server/chunks/lib_05agvk3._.js"].map(e=>s.l(e))).then(()=>e(33471)))}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=lib_rpc_078ce48.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[93695,(a,b,c)=>{b.exports=a.x("next/dist/shared/lib/no-fallback-error.external.js",()=>require("next/dist/shared/lib/no-fallback-error.external.js"))},26758,a=>{a.v("/_next/static/media/favicon.23vm2o6v3er2z.ico"+(globalThis.NEXT_CLIENT_ASSET_SUFFIX||""))},38872,a=>{"use strict";let b={src:a.i(26758).default,width:48,height:48};a.s(["default",0,b])},73796,a=>{"use strict";a.s(["default",()=>b]);let b=(0,a.i(11857).registerClientReference)(function(){throw Error("Attempted to call the default export of [project]/app/insights/page.js from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"[project]/app/insights/page.js","default")},90727,a=>{"use strict";var b=a.i(73796);a.n(b)},31458,function(a){a.n(a.i(90727))},81742,a=>{"use strict";var b=a.i(12948),c=a.i(67436),d=a.i(94331);a.i(70408);let e=(0,b.instrumentModuleGetter)(()=>a.r(38872)),f=(0,b.instrumentModuleGetter)(()=>a.r(19325)),g=(0,b.instrumentModuleGetter)(()=>a.r(43619)),h=(0,b.instrumentModuleGetter)(()=>a.r(13718)),i=(0,b.instrumentModuleGetter)(()=>a.r(18198)),j=(0,b.instrumentModuleGetter)(()=>a.r(62212)),k=["",{children:["insights",{children:["__PAGE__",{},{metadata:{},page:[(0,b.instrumentModuleGetter)(()=>a.r(31458)),"[project]/app/insights/page.js"]},[]]},{metadata:{}},[]]},{metadata:{icon:[async()=>{let a=(0,d.interopDefault)(await e());return[{url:`/favicon.ico?${a.src.split("/").splice(-1)[0]}`,sizes:`${a.width}x${a.height}`,type:"image/x-icon"}]}]},layout:[f,"[project]/app/layout.js"],"not-found":[g,"[project]/node_modules/next/dist/client/components/builtin/not-found.js"],forbidden:[h,"[project]/node_modules/next/dist/client/components/builtin/forbidden.js"],unauthorized:[i,"[project]/node_modules/next/dist/client/components/builtin/unauthorized.js"],"global-error":[j,"[project]/node_modules/next/dist/client/components/builtin/global-error.js"]},[]],l=a.r.bind(a),m=a.l.bind(a),n=(0,c.createAppPageEntrypoint)({tree:k,page:"/insights/page",pathname:"/insights",require:l,loadChunk:m,interopDefault:d.interopDefault}),o=n.__next_app__,p=n.routeModule,q=n.handler;a.s(["__next_app__",0,o,"handler",0,q,"routeModule",0,p],58816),a.i(58816);var r=a.i(22922);a.s(["ClientPageRoot",()=>r.ClientPageRoot,"ClientSegmentRoot",()=>r.ClientSegmentRoot,"Fragment",()=>r.Fragment,"HTTPAccessFallbackBoundary",()=>r.HTTPAccessFallbackBoundary,"InstantValidation",()=>r.InstantValidation,"LayoutRouter",()=>r.LayoutRouter,"LoadingBoundaryProvider",()=>r.LoadingBoundaryProvider,"Postpone",()=>r.Postpone,"RenderFromTemplateContext",()=>r.RenderFromTemplateContext,"RootLayoutBoundary",()=>r.RootLayoutBoundary,"SegmentViewNode",()=>r.SegmentViewNode,"SegmentViewStateNode",()=>r.SegmentViewStateNode,"__next_app__",0,o,"captureOwnerStack",()=>r.captureOwnerStack,"collectPrefetchHints",()=>r.collectPrefetchHints,"collectSegmentData",()=>r.collectSegmentData,"createElement",()=>r.createElement,"createMetadataComponents",()=>r.createMetadataComponents,"createPrerenderParamsForClientSegment",()=>r.createPrerenderParamsForClientSegment,"createPrerenderSearchParamsForClientPage",()=>r.createPrerenderSearchParamsForClientPage,"createServerParamsForServerSegment",()=>r.createServerParamsForServerSegment,"createServerSearchParamsForServerPage",()=>r.createServerSearchParamsForServerPage,"createTemporaryReferenceSet",()=>r.createTemporaryReferenceSet,"decodeAction",()=>r.decodeAction,"decodeFormState",()=>r.decodeFormState,"decodeReply",()=>r.decodeReply,"handler",0,q,"isEmptyHTMLPrelude",()=>r.isEmptyHTMLPrelude,"patchFetch",()=>r.patchFetch,"preconnect",()=>r.preconnect,"preloadFont",()=>r.preloadFont,"preloadStyle",()=>r.preloadStyle,"prerender",()=>r.prerender,"prerenderToNodeStream",()=>r.prerenderToNodeStream,"renderToPipeableStream",()=>r.renderToPipeableStream,"renderToReadableStream",()=>r.renderToReadableStream,"routeModule",0,p,"serverHooks",()=>r.serverHooks,"taintObjectReference",()=>r.taintObjectReference],81742)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=%5Broot-of-the-server%5D__0egamyq._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[50949,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(35112),e=a.i(61782),f=a.i(37732),g=a.i(24475),h=a.i(35364);let i="linear-gradient(135deg, #FFD700, #FF6B35)",j=!1;async function k(){if(j)return!0;try{let a=await fetch("/api/settings",{cache:"no-store"}),b=await a.json();j=!!b?.settings?.autoConnectAccepted}catch{j=!1}return j}async function l(){let a=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:{autoConnectAccepted:new Date().toISOString()}})});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error||"Your answer couldn’t be saved.");j=!0}function m({onSend:a,onCancel:e}){let f=(0,c.useRef)(null);return(0,c.useEffect)(()=>{f.current?.focus();let a=a=>{"Escape"===a.key&&e()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e]),(0,d.createPortal)((0,b.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"Auto sends connection requests",onClick:e,style:{position:"fixed",inset:0,zIndex:400,background:"rgba(var(--sd-shade, 0, 0, 0), 0.72)",display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:(0,b.jsxs)("div",{"data-auto-ask":!0,onClick:a=>a.stopPropagation(),style:{width:"min(420px, 100%)",boxSizing:"border-box",borderRadius:14,padding:"20px 20px 16px",background:"var(--sd-surface, #12111c)",border:"1px solid rgba(255,215,0,0.28)",boxShadow:"0 18px 60px rgba(0,0,0,0.5)",textAlign:"left"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[(0,b.jsx)("span",{style:{padding:"3px 9px",borderRadius:6,background:i,color:"#000",fontWeight:800,fontSize:12},children:"Auto"}),(0,b.jsx)("span",{style:{fontSize:15,fontWeight:750,color:"var(--sd-fg-1, #fff)"},children:"Before the first one"})]}),(0,b.jsx)("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:"var(--sd-fg-2, #d6dbe4)"},children:h.AUTO_CONFIRM}),(0,b.jsxs)("p",{style:{margin:"10px 0 0",fontSize:12,lineHeight:1.55,color:"var(--sd-fg-3, #8b9a9a)"},children:["It never adds a note, and stops at ",h.INVITE_CAPS.day," in any 24 hours and ",h.INVITE_CAPS.week," in any 7 days. This is asked once."]}),(0,b.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[(0,b.jsx)("button",{type:"button",onClick:e,style:{padding:"9px 16px",borderRadius:8,fontSize:13,fontWeight:650,cursor:"pointer",background:"transparent",color:"var(--sd-fg-2, #ccc)",border:"1px solid rgba(var(--sd-ink, 255, 255, 255), 0.18)"},children:"Cancel"}),(0,b.jsx)("button",{ref:f,type:"button",onClick:a,style:{padding:"9px 18px",borderRadius:8,fontSize:13,fontWeight:800,cursor:"pointer",background:i,color:"#000",border:"none"},children:"Send it"})]})]})}),document.body)}let n={card:{padding:"10px 18px",fontSize:13,radius:8,minWidth:104},quest:{padding:"7px 14px",fontSize:12.5,radius:8,minWidth:92},row:{padding:"4px 9px",fontSize:9.5,radius:4,minWidth:0},table:{padding:"6px 11px",fontSize:12,radius:7,minWidth:0}};function o({auto:a,size:c,label:d="Auto"}){let e=n[c]||n.card,f=a.sending||!!a.busy||!!a.result?.marks,g=a.busy?`${a.busy}. Auto waits for it to finish.`:h.AUTO_EXPLAIN;return(0,b.jsx)("button",{type:"button","data-auto-connect":!0,onClick:b=>{b.stopPropagation(),a.press()},disabled:f,title:g,"aria-label":a.sending?"Sending the request":`${d}: ${h.AUTO_EXPLAIN}`,style:{padding:e.padding,borderRadius:e.radius,fontSize:e.fontSize,fontWeight:800,border:"none",minWidth:e.minWidth,background:i,color:"#000",cursor:f?"not-allowed":"pointer",opacity:a.busy?.45:1,whiteSpace:"nowrap",flexShrink:0,boxShadow:f?"none":"0 2px 12px rgba(255,140,50,0.28)"},children:a.sending?"Sending…":d})}let p=a=>a.ok?"var(--sd-green, #00ff88)":"var(--sd-coral, #ff8a7a)";function q({person:a,size:d,connect:i,onSent:n,style:r}){let s=function(a,b){let d=(0,e.default)(),[i,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(null),r=(0,c.useRef)(new Set),s=(0,c.useRef)(null),t=d.running&&"connect"===d.action&&!!a?.id&&d.target?.id===a.id,u=!d.running||t||n?null:(0,f.busyReason)(d),v=c=>{q(c),c.marks&&setTimeout(()=>{(0,g.sawRequested)(a),b?.(a)},2500)},w=(d.finished||[]).find(b=>"connect"===b.action&&b.target?.id===a?.id);async function x(){m(!1),o(!0),q(null);try{let{startedAt:b,ended:c}=await (0,f.beginScrape)("connect",{id:a.id,name:a.name});r.current.add(b),s.current=b,v((0,h.connectOutcome)(await c))}catch(a){a.details?.needsAutoAcceptance?(j=!1,m(!0)):q({ok:!1,text:a.message})}finally{o(!1)}}return(0,c.useEffect)(()=>{!w||r.current.has(w.startedAt)||s.current===w.startedAt||(s.current=w.startedAt,v((0,h.connectOutcome)(w)))},[w?.startedAt]),{press:async function(){n||t||u||(q(null),await k()?x():m(!0))},confirm:async function(){try{await l(),x()}catch(a){m(!1),q({ok:!1,text:a.message})}},cancel:()=>m(!1),dismiss:()=>q(null),asking:i,sending:n||t,busy:u,result:p}}(a,n),t=s.asking&&(0,b.jsx)(m,{onSend:s.confirm,onCancel:s.cancel});if("row"===d||"table"===d)return(0,b.jsxs)("span",{style:{position:"relative",display:"inline-flex",gap:4,alignItems:"center",flexShrink:0,...r},onClick:a=>a.stopPropagation(),children:[(0,b.jsx)(o,{auto:s,size:d}),i(!0),s.result&&(0,b.jsxs)("span",{role:"status",style:{position:"absolute",top:"calc(100% + 4px)",right:0,zIndex:20,width:230,boxSizing:"border-box",padding:"7px 24px 7px 9px",borderRadius:7,fontSize:11,lineHeight:1.45,fontWeight:600,textAlign:"left",color:p(s.result),background:"var(--sd-surface, #14131d)",border:`1px solid ${s.result.ok?"rgba(0,255,136,0.35)":"rgba(255,138,122,0.4)"}`,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[s.result.text,(0,b.jsx)("button",{type:"button","aria-label":"Close",onClick:s.dismiss,style:{position:"absolute",top:3,right:4,background:"none",border:"none",cursor:"pointer",color:"var(--sd-fg-3, #888)",fontSize:12,lineHeight:1},children:"×"})]}),t]});let u="card"===d;return(0,b.jsxs)("div",{style:r,children:[(0,b.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"stretch",flexWrap:"wrap"},children:[(0,b.jsx)(o,{auto:s,size:d}),i(!0)]}),u&&(0,b.jsx)("div",{style:{fontSize:11,lineHeight:1.5,color:"var(--sd-fg-3, #8b9a9a)",marginTop:8},children:s.busy?`${s.busy}. Auto waits for it to finish.`:h.AUTO_EXPLAIN}),s.result&&(0,b.jsx)("div",{role:"status",style:{fontSize:12,lineHeight:1.5,fontWeight:650,marginTop:8,color:p(s.result)},children:s.result.text}),t]})}a.s(["default",0,function({person:a,canAuto:c=!0,size:d="card",connect:e,onSent:f,style:g}){return c&&a?.id&&a?.profile_url?(0,b.jsx)(q,{person:a,size:d,connect:e,onSent:f,style:g},a.id):e(!1)},"secondaryLook",0,function(a="card",{color:b="var(--sd-gold, #FFD700)",line:c="rgba(255,215,0,0.5)"}={}){let d=n[a]||n.card;return{padding:d.padding,borderRadius:d.radius,fontSize:d.fontSize,fontWeight:700,background:"transparent",color:b,border:`1px solid ${c}`,textDecoration:"none",cursor:"pointer",whiteSpace:"nowrap",boxSizing:"border-box",display:"inline-flex",alignItems:"center",justifyContent:"center"}}])},76892,a=>{"use strict";var b=a.i(72131),c=a.i(24475);a.s(["default",0,function(){return(0,b.useSyncExternalStore)(c.watchRequests,c.requestsNow,()=>c.REQUESTS_UNKNOWN)}])},35364,a=>{"use strict";let b={day:15,week:80},c=b.day,d=b.week,e={sent:{ok:!0,marks:!0,text:"Request sent"},"already-pending":{ok:!0,marks:!0,text:"A request to them was already pending on LinkedIn, so nothing new was sent. It’s marked as sent here."},"email-needed":{text:"LinkedIn wants their email address before it sends this one. Use Connect to add them yourself."},"no-connect":{text:"LinkedIn shows no Connect for them here, only Follow or Message, or a request is already out. Nothing was sent."},"not-sent":{text:"LinkedIn asked something Auto doesn’t answer for you, so it closed that and sent nothing. Use Connect to add them yourself."},unclear:{text:"Auto pressed Send but couldn’t see the request go through, so it isn’t marked as sent. Use Connect to check their profile."},"not-loaded":{text:"Their profile didn’t load, so nothing was sent. Try again in a while."},unavailable:{text:"LinkedIn says their profile isn’t available, so nothing was sent."},"linkedin-limit":{text:"LinkedIn says this account has reached its invitation limit for now. Nothing was sent."},pushback:{text:"LinkedIn pushed back, so scanning and Auto are paused for a day. Settings, LinkedIn usage says when it ends."},stopped:{text:"Stopped before anything was sent."},"not-signed-in":{text:"LinkedIn isn’t signed in in the scanner’s Chrome. Sign in on the Scan page (step 2), then try again."},cooldown:{text:"Scanning is paused after LinkedIn pushed back, and Auto waits with it. Nothing was sent."},"invites-day":{text:`Auto has sent ${c} requests in the last 24 hours, its limit. Nothing was sent.`},"invites-week":{text:`Auto has sent ${d} requests in the last 7 days, its limit. Nothing was sent.`},profiles:{text:"Today’s profile views are used, and Auto opens their profile to send. Nothing was sent."},"not-found":{text:"That person isn’t in your network on this computer, so nothing was sent."}};Object.keys(e),a.s(["AUTO_CONFIRM",0,"Auto sends connection requests from your LinkedIn account, one each time you press it. LinkedIn limits how many invitations an account can send, and may restrict accounts that send many.","AUTO_EXPLAIN",0,"Sends the request for you from the scanner’s Chrome, without a note. Counts toward your LinkedIn usage.","INVITE_CAPS",0,b,"REPORTED_WEEKLY_INVITES",0,100,"connectOutcome",0,function(a){let b=a?.outcome&&Object.hasOwn(e,a.outcome)?a.outcome:null;if(b){let a=e[b];return{result:b,ok:!!a.ok,marks:!!a.marks,text:a.text}}let c=Array.isArray(a?.failure)?a.failure.filter(Boolean).slice(-2).join(" "):"";return{result:null,ok:!1,marks:!1,text:c?`Auto couldn’t finish, and nothing is marked as sent: ${c}`:"Auto couldn’t finish, and nothing is marked as sent."}}])},24475,a=>{"use strict";var b=a.i(90231);let c=Object.freeze({known:!1,sent:new Set,mine:new Map,version:0}),d=new Set,e=c,f=null,g=new Map;function h(a=e.sent,b=e.known){for(let c of(e=Object.freeze({known:b,sent:a,mine:new Map(g),version:e.version+1}),[...d]))c()}async function i(a){let b=await fetch("/api/outreach",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||"Could not save that.");return c}async function j(a,{bridgeId:c}={}){let d=(0,b.keyFor)(a),e=g.has(d)?g.get(d):void 0;g.set(d,!0),h();try{return await i({action:"mark-sent",connectionId:a.id,profileUrl:a.profile_url,bridgeId:c})}catch(a){throw void 0===e?g.delete(d):g.set(d,e),h(),a}}async function k(a){let c=(0,b.keyFor)(a),d=g.has(c)?g.get(c):void 0;g.set(c,!1),h();try{return await i({action:"undo",connectionId:a.id,profileUrl:a.profile_url})}catch(a){throw void 0===d?g.delete(c):g.set(c,d),h(),a}}a.s(["REQUESTS_UNKNOWN",0,c,"hasRequest",0,function(a,c=e){if(!a)return!1;let d=(0,b.keyFor)(a);return c.mine.has(d)?c.mine.get(d):c.known?c.sent.has(d):"pending"===a.unlock_status||"sent"===a.outreach_status},"markRequested",0,j,"requestsNow",0,function(){return e},"sawRequested",0,function(a){g.set((0,b.keyFor)(a),!0),h()},"undoRequest",0,k,"watchRequests",0,function(a){return d.add(a),f||e.known||(f=fetch("/api/outreach").then(a=>a.ok?a.json():null).then(a=>{a&&h(new Set((a.pending||[]).map(b.keyFor)),!0)}).catch(()=>{}).finally(()=>{f=null})),()=>d.delete(a)}])}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=_04am_h8._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[45217,a=>{"use strict";var b=a.i(72131);let c="http://www.w3.org/2000/svg",d={side:{r:2,bezel:26,scale:56},bar:{r:20,bezel:12,scale:22}};a.s(["default",0,function(){return(0,b.useEffect)(()=>{let a=document.documentElement,b=window.matchMedia?.("(prefers-reduced-transparency: reduce)"),e=null,f=new Map,g=0,h=null,i=()=>{if(e)return e;let a=document.createElementNS(c,"svg");return a.setAttribute("width","0"),a.setAttribute("height","0"),a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.pointerEvents="none",e=document.createElementNS(c,"defs"),a.appendChild(e),document.body.appendChild(a),e},j=()=>{let e="frosted"!==a.dataset.buttons||b?.matches?[]:[...document.querySelectorAll("[data-glass-panel]")];for(let[a,b]of f)e.includes(a)||(a.style.removeProperty("--lg-lens"),document.getElementById(b.id)?.remove(),f.delete(a));for(let a of e){let b=Math.round(a.offsetWidth),e=Math.round(a.offsetHeight);if(b<20||e<20)continue;let h=f.get(a);if(h&&h.w===b&&h.h===e)continue;let j=d[a.dataset.glassPanel]||d.side,k=h?.id||`lg-lens-${++g}`;document.getElementById(k)?.remove();let l=document.createElementNS(c,"filter");for(let[a,b]of(l.setAttribute("id",k),Object.entries({x:"0",y:"0",width:"100%",height:"100%","color-interpolation-filters":"sRGB"})))l.setAttribute(a,b);let m=document.createElementNS(c,"feImage");for(let[a,c]of Object.entries({x:"0",y:"0",width:String(b),height:String(e),preserveAspectRatio:"none",result:"map"}))m.setAttribute(a,c);m.setAttribute("href",function(a,b,c,d){let e=document.createElement("canvas");e.width=a,e.height=b;let f=e.getContext("2d"),g=f.createImageData(a,b),h=g.data;for(let e=0;e<b;e++)for(let f=0;f<a;f++){let g=(e*a+f)*4,[i,j]=f<d+c||e<d+c||f>=a-d-c||e>=b-d-c?function(a,b,c,d,e,f){let g=a+.5-c/2,h=b+.5-d/2,i=Math.abs(g)-(c/2-e),j=Math.abs(h)-(d/2-e),k=Math.max(i,0),l=Math.max(j,0),m=Math.hypot(k,l),n=e-(m+Math.min(Math.max(i,j),0)),o=0,p=0;m>0?(o=k/m,p=l/m):i>j?o=1:p=1;let q=Math.max(0,1-n/f),r=q*q;return[(o*=-Math.sign(g)||0)*r,(p*=-Math.sign(h)||0)*r]}(f,e,a,b,c,d):[0,0];h[g]=128+127*i,h[g+1]=128+127*j,h[g+2]=128,h[g+3]=255}return f.putImageData(g,0,0),e.toDataURL()}(b,e,Math.min(j.r,Math.floor(Math.min(b,e)/2)),j.bezel));let n=document.createElementNS(c,"feDisplacementMap");for(let[a,b]of Object.entries({in:"SourceGraphic",in2:"map",scale:String(j.scale),xChannelSelector:"R",yChannelSelector:"G"}))n.setAttribute(a,b);l.append(m,n),i().appendChild(l),a.style.setProperty("--lg-lens",`url(#${k})`),f.set(a,{id:k,w:b,h:e})}},k=()=>{clearTimeout(h),h=setTimeout(j,150)};j();let l=new ResizeObserver(k),m=()=>{l.disconnect(),document.querySelectorAll("[data-glass-panel]").forEach(a=>l.observe(a))};m();let n=new MutationObserver(a=>{a.some(a=>"attributes"===a.type||[...a.addedNodes,...a.removedNodes].some(a=>1===a.nodeType&&(a.matches?.("[data-glass-panel]")||a.querySelector?.("[data-glass-panel]"))))&&(m(),k())});return n.observe(document.body,{childList:!0,subtree:!0}),n.observe(a,{attributes:!0,attributeFilter:["data-buttons"]}),b?.addEventListener?.("change",k),()=>{clearTimeout(h),l.disconnect(),n.disconnect(),b?.removeEventListener?.("change",k)}},[]),null}],45217)},66537,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(37732),g=a.i(7846),h=a.i(63033);let i={full:"Scanning your network",refresh:"Checking for new connections",bridge:"Scanning a circle",resume:"Carrying on with a circle","resume-all":"Carrying on with circles","auto-bridge":"Auto-Bridge","auto-bridge-retry":"Auto-Bridge",rescrape:"Re-scanning a circle",login:"Signing in to LinkedIn",setup:"Setting up the scanner",company:"Scanning a company",photos:"Saving photos",messages:"Reading your messages list","messages-full":"Reading your whole messages history"};a.s(["default",0,function(){let a,j,[k,l]=(0,c.useState)(()=>(0,f.scannerNow)()),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(!1),s=(0,c.useSyncExternalStore)(g.watchAllDay,g.allDayNow,()=>!1),t=(0,c.useSyncExternalStore)(h.watchActivities,h.activitiesNow,h.noActivities),u=(0,c.useSyncExternalStore)(h.watchNotchTabs,h.notchTabsNow,h.noNotchTabs);(0,c.useEffect)(()=>(0,f.watchScanner)(()=>{let a=(0,f.scannerNow)();l(a),a.running||n(!1)}),[]);let v=(0,d.usePathname)(),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=null,b=null,c=0,d=()=>{c=0;let d=document.querySelector("header");d!==a&&(b?.disconnect(),b=null,(a=d)&&(b=new ResizeObserver(e)).observe(a));let f=a?Math.round(a.getBoundingClientRect().bottom):null;x(a=>a===f?a:f);let g=document.getElementById("main-tabs")?.getBoundingClientRect(),h=g&&g.width?Math.round(g.left+g.width/2):null;z(a=>a===h?a:h)},e=()=>{c||(c=requestAnimationFrame(d))};e();let f=new MutationObserver(e);return f.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",e),()=>{cancelAnimationFrame(c),b?.disconnect(),f.disconnect(),window.removeEventListener("resize",e)}},[v]);let A=!!k?.running,B=t[t.length-1]||null,C=A||B||s,D=!!(C||u);if((0,c.useEffect)(()=>((0,h.setNotchShown)(D),()=>(0,h.setNotchShown)(!1)),[D]),!C&&!u)return null;let E=k?.progress,F=E?.kind==="batch"&&E.total?`${E.current||E.done||0} of ${E.total}`:E?.kind==="walk"&&E.total?`${(E.done||0).toLocaleString()} of ${E.total.toLocaleString()}`:E?.kind==="saving"?"saving":null,G=E?.total?Math.min(1,(E.current||E.done||0)/E.total):B?.progress??null,H=k?.budget,I=A?[...k.log||[]].reverse().find(a=>a&&a.trim())?.trim():null,J=o||q,K=A?"#00ff88":B?"warn"===B.tone?"#FFD700":"#3498DB":"#556",L=A?i[k.action]||"Scanning":B?B.label:"Auto scan",M=A?F:B?B.detail:null,N=null!=y?`clamp(170px, ${y}px, calc(100vw - 170px))`:"50%";return(0,b.jsxs)("div",{"data-glass-panel":"bar",onMouseLeave:()=>p(!1),style:{position:"fixed",left:N,top:w??"var(--scan-bar-top, 94px)",transform:"translateX(-50%)",zIndex:60,maxWidth:"calc(100vw - 16px)",padding:J&&C?"4px 6px 10px":"4px 6px 5px",borderRadius:"0 0 14px 14px",border:`1px solid ${A?"rgba(0,255,136,0.25)":"rgba(var(--sd-ink, 255, 255, 255), 0.1)"}`,borderTop:"none",background:"var(--sd-surface, rgba(8,10,22,0.96))",color:"var(--sd-fg-2, #cfd8d8)",fontSize:12,opacity:u||A||B||J?1:.55,boxShadow:A?"0 6px 20px rgba(0,0,0,0.35)":"none",transition:"padding 0.18s ease, opacity 0.18s ease"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,overflowX:"auto"},children:[u&&(0,b.jsx)("div",{role:"tablist","aria-label":"View",style:{display:"flex",gap:2},children:u.items.map(a=>{let c=a.key===u.current;return(0,b.jsxs)("button",{role:"tab","aria-selected":c,title:a.title,onClick:()=>u.onPick(a.key),style:{display:"flex",alignItems:"center",gap:6,padding:"5px 11px",borderRadius:8,border:"none",cursor:"pointer",whiteSpace:"nowrap",fontSize:12,fontWeight:600,background:c?"rgba(52,152,219,0.22)":"transparent",color:c?"var(--sd-fg-1, #cfe6f7)":"var(--sd-fg-3, #8b9aa8)"},children:[a.icon&&(0,b.jsx)("span",{"aria-hidden":"true",children:a.icon}),a.label]},a.key)})}),u&&C&&(0,b.jsx)("span",{"aria-hidden":"true",style:{width:1,alignSelf:"stretch",margin:"3px 4px",background:"rgba(var(--sd-ink, 255, 255, 255), 0.12)"}}),C&&(0,b.jsxs)("button",{onMouseEnter:()=>p(!0),onClick:()=>r(a=>!a),"aria-expanded":J,title:J?"Close":"Open",style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",color:"inherit",font:"inherit",cursor:"pointer",padding:"5px 8px",whiteSpace:"nowrap"},children:[(0,b.jsx)("span",{className:A?"notch-pulse":void 0,style:{width:7,height:7,borderRadius:"50%",background:K,flexShrink:0}}),(0,b.jsxs)("span",{role:"status","aria-live":"polite",style:{display:"flex",alignItems:"center",gap:8},children:[(0,b.jsx)("b",{style:{color:A||B?"var(--sd-fg-1, #fff)":"var(--sd-fg-2, #b8c4c4)",fontWeight:600},children:L}),M&&(0,b.jsx)("span",{style:{color:"var(--sd-fg-3, #8b9a9a)"},children:M})]}),!A&&!B&&J&&(0,b.jsx)("span",{style:{color:"var(--sd-fg-3, #8b9a9a)"},children:"ready · press Auto scan beside Scan to start"})]})]}),C&&null!=G&&(0,b.jsx)("div",{style:{height:2,margin:"3px 6px 0",borderRadius:2,background:"rgba(var(--sd-ink, 255, 255, 255), 0.08)",overflow:"hidden"},children:(0,b.jsx)("div",{style:{width:`${Math.round(100*G)}%`,height:"100%",background:A?"#00ff88":"#3498DB",transition:"width 0.4s ease"}})}),J&&A&&(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,margin:"8px 8px 0",flexWrap:"wrap"},children:[k.target?.name&&(0,b.jsx)("span",{children:k.target.name}),H&&(0,b.jsxs)(e.default,{href:"/settings#usage",style:{color:(a=H.searches,(j=H.cap)?a/j>=.9?"#ff6b6b":a/j>=.6?"#FFD700":"#00ff88":"#8b9a9a"),textDecoration:"none"},title:"Searches on your LinkedIn account in the last 24 hours, and your daily budget. Open LinkedIn usage",children:[H.searches,H.cap?` of ${H.cap}`:""," searches in the last 24 hours"]}),I&&(0,b.jsx)("span",{style:{color:"var(--sd-fg-4, #667)",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:I,children:I}),(0,b.jsx)(e.default,{href:"/setup",style:{color:"var(--sd-blue, #3498DB)",textDecoration:"none"},children:"Details"}),(0,b.jsx)("button",{onClick:async()=>{n(!0);try{await (0,f.stopScrape)()}catch{n(!1)}},disabled:m,title:"Stops after saving what's been read; Resume on the Scan page carries on from the same page",style:{padding:"3px 10px",borderRadius:8,fontSize:12,cursor:m?"default":"pointer",background:"rgba(255,107,107,0.12)",color:"var(--sd-fg-2, #ff9b9b)",border:"1px solid rgba(255,107,107,0.35)"},children:m?"Stopping…":"Stop"})]}),J&&!A&&B?.detail&&(0,b.jsx)("div",{style:{margin:"6px 8px 0",color:"var(--sd-fg-3, #8b9a9a)"},children:B.detail})]})}])},59617,a=>{"use strict";var b=a.i(72131),c=a.i(37732),d=a.i(58834);let e=!1;a.s(["default",0,function(){return(0,b.useEffect)(()=>{if(d.IS_DEMO||e)return;let a=()=>{};return fetch("/api/social").then(a=>a.json()).then(({social:b})=>{if(!b?.autoSync||e)return;let d=b.liveAt?Date.parse(b.liveAt):0,f=new Date().getHours();Date.now()-d<864e5||f<9||f>=19||(a=(0,c.watchScanner)(()=>{let b=(0,c.scannerNow)();b.known&&!e&&(e=!0,a(),b.running||(0,c.beginScrape)("messages").catch(()=>{}))}))}).catch(()=>{}),()=>a()},[]),null}])},17372,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["default",0,function(){let[a,d]=(0,c.useState)(null);return((0,c.useEffect)(()=>{let a=!0;return fetch("/api/update").then(a=>a.json()).then(b=>{a&&b?.restartNeeded&&d(b)}).catch(()=>{}),()=>{a=!1}},[]),a)?(0,b.jsxs)("div",{role:"status",style:{position:"fixed",left:0,right:0,bottom:0,zIndex:9999,background:"linear-gradient(90deg, #FFD700, #FF6B35)",color:"#1a1200",padding:"9px 16px",fontSize:13,fontWeight:600,lineHeight:1.5,display:"flex",alignItems:"center",justifyContent:"center",gap:10,flexWrap:"wrap",textAlign:"center"},children:[(0,b.jsxs)("span",{children:["You have newer code on disk (",a.sha,") than this server is running (",a.bootSha,"). Restart it to see the changes: ",(0,b.jsx)("code",{style:{background:"rgba(var(--sd-shade, 0, 0, 0), 0.16)",padding:"1px 6px",borderRadius:4},children:"Ctrl-C"})," in the terminal, then ",(0,b.jsx)("code",{style:{background:"rgba(var(--sd-shade, 0, 0, 0), 0.16)",padding:"1px 6px",borderRadius:4},children:"npm run dev"}),"."]}),(0,b.jsx)("button",{onClick:()=>d(null),style:{border:"none",background:"rgba(var(--sd-shade, 0, 0, 0), 0.18)",color:"#1a1200",borderRadius:6,padding:"3px 10px",fontWeight:700,cursor:"pointer"},children:"Dismiss"})]}):null}])},53938,a=>{"use strict";var b=a.i(72131),c=a.i(26338);a.s(["default",0,function(){return(0,b.useEffect)(()=>{let b=!0;return fetch("/api/settings",{cache:"no-store"}).then(a=>a.ok?a.json():null).then(async d=>{if(!b||!d?.settings)return;(0,c.adoptSavedTheme)(d.settings.theme);let{adoptSavedLayouts:e}=await a.A(7315);b&&e(d.settings.galaxyLayouts)}).catch(()=>{}),()=>{b=!1}},[]),null}])},63033,a=>{"use strict";let b=new Set,c=[],d=[],e=new Set,f=null,g=new Set,h=!1;a.s(["activitiesNow",0,()=>c,"noActivities",0,()=>d,"noNotch",0,()=>!1,"noNotchTabs",0,()=>null,"notchShownNow",0,()=>h,"notchTabsNow",0,()=>f,"setNotchShown",0,function(a){!!a!==h&&(h=!!a,g.forEach(a=>a()))},"setNotchTabs",0,function(a){f=a&&Array.isArray(a.items)&&a.items.length>1?a:null,e.forEach(a=>a())},"showActivity",0,function(a){return a?.id?(c=[...c.filter(b=>b.id!==a.id),a],b.forEach(a=>a()),()=>{var d;return d=a.id,void(c.some(a=>a.id===d)&&(c=c.filter(a=>a.id!==d),b.forEach(a=>a())))}):()=>{}},"watchActivities",0,function(a){return b.add(a),()=>b.delete(a)},"watchNotchShown",0,function(a){return g.add(a),()=>g.delete(a)},"watchNotchTabs",0,function(a){return e.add(a),()=>e.delete(a)}])},31483,a=>{"use strict";async function b(a,{keepalive:c=!1}={}){try{let b=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:a}),keepalive:c}),d=await b.json();return{settings:d.settings||null,effects:d.effects||null,error:b.ok?null:d.error||"Could not save."}}catch{return{settings:null,effects:null,error:"Could not reach the app. Reload this page to see what is saved."}}}a.s(["saveSettings",0,b])},90788,a=>{"use strict";a.s(["laterSaver",0,function(a,b=400){let c,d=null,e=b=>{clearTimeout(d),d=null,Promise.resolve(a(c,{now:b})).catch(()=>{})},f=a=>{c=a,d&&clearTimeout(d),d=setTimeout(()=>e(!1),b)};return f.flush=()=>{d&&e(!0)},f},"reconcileSaved",0,function({saved:a,cached:b,isDefault:c,same:d}){return null==a?{use:b,save:!c(b),changed:!1}:{use:a,save:!1,changed:!d(a,b)}}])},26338,a=>{"use strict";var b=a.i(91621),c=a.i(31483),d=a.i(90788);let e=Object.freeze({base:"standard",custom:{}}),f=new Set,g=e,h=(a,c)=>JSON.stringify((0,b.cleanTheme)(a))===JSON.stringify((0,b.cleanTheme)(c)),i=(0,d.laterSaver)((a,{now:b})=>(0,c.saveSettings)({theme:a},{keepalive:b}));function j(a){g=(0,b.cleanTheme)(a);try{localStorage.setItem("six-degrees-theme",JSON.stringify(g))}catch{}!function(a){let c=(0,b.resolveTheme)(a);Object.assign(b.TIER_COLORS,c.tiers);let d=(0,b.isLight)(c);if(Object.assign(b.MAP_LOOK,{you:c.you,lines:c.lines,line:c.line,bg:c.bg,dots:c.dots,light:d,text:d?"#11141c":"#ffffff"}),"u"<typeof document)return;let e=(0,b.themeVars)(a),f=document.documentElement;for(let a of[...f.style])!a.startsWith("--sd-")||a in e||f.style.removeProperty(a);for(let[a,b]of Object.entries(e))f.style.setProperty(a,b);Object.assign(f.dataset,(0,b.themeAttrs)(a)),f.style.colorScheme=d?"light":"dark";try{localStorage.setItem("six-degrees-theme-vars",JSON.stringify({vars:e,attrs:(0,b.themeAttrs)(a)}))}catch{}}(g),f.forEach(a=>a())}a.s(["adoptSavedTheme",0,function(a){let{use:f,save:i,changed:k}=(0,d.reconcileSaved)({saved:null==a?null:(0,b.cleanTheme)(a),cached:g,isDefault:a=>h(a,e),same:h});i&&(0,c.saveSettings)({theme:g}),k&&j(f)},"serverTheme",0,()=>e,"setTheme",0,function(a){j(a),i(g)},"themeNow",0,()=>g,"watchTheme",0,function(a){return f.add(a),()=>f.delete(a)}])}];
|
|
1
|
+
module.exports=[45217,a=>{"use strict";var b=a.i(72131);let c="http://www.w3.org/2000/svg",d={side:{r:2,bezel:26,scale:56},bar:{r:20,bezel:12,scale:22}};a.s(["default",0,function(){return(0,b.useEffect)(()=>{let a=document.documentElement,b=window.matchMedia?.("(prefers-reduced-transparency: reduce)"),e=null,f=new Map,g=0,h=null,i=()=>{if(e)return e;let a=document.createElementNS(c,"svg");return a.setAttribute("width","0"),a.setAttribute("height","0"),a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.pointerEvents="none",e=document.createElementNS(c,"defs"),a.appendChild(e),document.body.appendChild(a),e},j=()=>{let e="frosted"!==a.dataset.buttons||b?.matches?[]:[...document.querySelectorAll("[data-glass-panel]")];for(let[a,b]of f)e.includes(a)||(a.style.removeProperty("--lg-lens"),document.getElementById(b.id)?.remove(),f.delete(a));for(let a of e){let b=Math.round(a.offsetWidth),e=Math.round(a.offsetHeight);if(b<20||e<20)continue;let h=f.get(a);if(h&&h.w===b&&h.h===e)continue;let j=d[a.dataset.glassPanel]||d.side,k=h?.id||`lg-lens-${++g}`;document.getElementById(k)?.remove();let l=document.createElementNS(c,"filter");for(let[a,b]of(l.setAttribute("id",k),Object.entries({x:"0",y:"0",width:"100%",height:"100%","color-interpolation-filters":"sRGB"})))l.setAttribute(a,b);let m=document.createElementNS(c,"feImage");for(let[a,c]of Object.entries({x:"0",y:"0",width:String(b),height:String(e),preserveAspectRatio:"none",result:"map"}))m.setAttribute(a,c);m.setAttribute("href",function(a,b,c,d){let e=document.createElement("canvas");e.width=a,e.height=b;let f=e.getContext("2d"),g=f.createImageData(a,b),h=g.data;for(let e=0;e<b;e++)for(let f=0;f<a;f++){let g=(e*a+f)*4,[i,j]=f<d+c||e<d+c||f>=a-d-c||e>=b-d-c?function(a,b,c,d,e,f){let g=a+.5-c/2,h=b+.5-d/2,i=Math.abs(g)-(c/2-e),j=Math.abs(h)-(d/2-e),k=Math.max(i,0),l=Math.max(j,0),m=Math.hypot(k,l),n=e-(m+Math.min(Math.max(i,j),0)),o=0,p=0;m>0?(o=k/m,p=l/m):i>j?o=1:p=1;let q=Math.max(0,1-n/f),r=q*q;return[(o*=-Math.sign(g)||0)*r,(p*=-Math.sign(h)||0)*r]}(f,e,a,b,c,d):[0,0];h[g]=128+127*i,h[g+1]=128+127*j,h[g+2]=128,h[g+3]=255}return f.putImageData(g,0,0),e.toDataURL()}(b,e,Math.min(j.r,Math.floor(Math.min(b,e)/2)),j.bezel));let n=document.createElementNS(c,"feDisplacementMap");for(let[a,b]of Object.entries({in:"SourceGraphic",in2:"map",scale:String(j.scale),xChannelSelector:"R",yChannelSelector:"G"}))n.setAttribute(a,b);l.append(m,n),i().appendChild(l),a.style.setProperty("--lg-lens",`url(#${k})`),f.set(a,{id:k,w:b,h:e})}},k=()=>{clearTimeout(h),h=setTimeout(j,150)};j();let l=new ResizeObserver(k),m=()=>{l.disconnect(),document.querySelectorAll("[data-glass-panel]").forEach(a=>l.observe(a))};m();let n=new MutationObserver(a=>{a.some(a=>"attributes"===a.type||[...a.addedNodes,...a.removedNodes].some(a=>1===a.nodeType&&(a.matches?.("[data-glass-panel]")||a.querySelector?.("[data-glass-panel]"))))&&(m(),k())});return n.observe(document.body,{childList:!0,subtree:!0}),n.observe(a,{attributes:!0,attributeFilter:["data-buttons"]}),b?.addEventListener?.("change",k),()=>{clearTimeout(h),l.disconnect(),n.disconnect(),b?.removeEventListener?.("change",k)}},[]),null}],45217)},66537,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(38246),f=a.i(37732),g=a.i(7846),h=a.i(63033);let i={full:"Scanning your network",refresh:"Checking for new connections",bridge:"Scanning a circle",resume:"Carrying on with a circle","resume-all":"Carrying on with circles","auto-bridge":"Auto-Bridge","auto-bridge-retry":"Auto-Bridge",rescrape:"Re-scanning a circle",login:"Signing in to LinkedIn",setup:"Setting up the scanner",company:"Scanning a company",photos:"Saving photos",messages:"Reading your messages list","messages-full":"Reading your whole messages history",connect:"Sending a connection request"};a.s(["default",0,function(){let a,j,[k,l]=(0,c.useState)(()=>(0,f.scannerNow)()),[m,n]=(0,c.useState)(!1),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(!1),s=(0,c.useSyncExternalStore)(g.watchAllDay,g.allDayNow,()=>!1),t=(0,c.useSyncExternalStore)(h.watchActivities,h.activitiesNow,h.noActivities),u=(0,c.useSyncExternalStore)(h.watchNotchTabs,h.notchTabsNow,h.noNotchTabs);(0,c.useEffect)(()=>(0,f.watchScanner)(()=>{let a=(0,f.scannerNow)();l(a),a.running||n(!1)}),[]);let v=(0,d.usePathname)(),[w,x]=(0,c.useState)(null),y=(0,c.useRef)(null),[z,A]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=null,b=null,c=0,d=()=>{c=0;let d=document.querySelector("header");d!==a&&(b?.disconnect(),b=null,(a=d)&&(b=new ResizeObserver(e)).observe(a));let f=a?Math.round(a.getBoundingClientRect().bottom):null;x(a=>a===f?a:f);let g=document.getElementById("main-tabs")?.getBoundingClientRect(),h=g&&g.width?Math.round(g.left+g.width/2):null;A(a=>a===h?a:h)},e=()=>{c||(c=requestAnimationFrame(d))};e();let f=new MutationObserver(()=>{y.current&&(y.current.style.visibility=document.querySelector("header")?"":"hidden"),e()});return f.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",e),()=>{cancelAnimationFrame(c),b?.disconnect(),f.disconnect(),window.removeEventListener("resize",e)}},[v]);let B=!!k?.running,C=t[t.length-1]||null,D=B||C||s,E=!!(D||u);if((0,c.useEffect)(()=>((0,h.setNotchShown)(E),()=>(0,h.setNotchShown)(!1)),[E]),!D&&!u||null==w)return null;let F=k?.progress,G=F?.kind==="batch"&&F.total?`${F.current||F.done||0} of ${F.total}`:F?.kind==="walk"&&F.total?`${(F.done||0).toLocaleString()} of ${F.total.toLocaleString()}`:F?.kind==="saving"?"saving":null,H=F?.total?Math.min(1,(F.current||F.done||0)/F.total):C?.progress??null,I=k?.budget,J=B?[...k.log||[]].reverse().find(a=>a&&a.trim())?.trim():null,K=o||q,L=B?"#00ff88":C?"warn"===C.tone?"#FFD700":"#3498DB":"#556",M=B?i[k.action]||"Scanning":C?C.label:"Auto scan",N=B?G:C?C.detail:null,O=null!=z?`clamp(170px, ${z}px, calc(100vw - 170px))`:"50%";return(0,b.jsxs)("div",{ref:y,"data-glass-panel":"bar",className:"notch-in",onMouseLeave:()=>p(!1),style:{position:"fixed",left:O,top:w,transform:"translateX(-50%)",zIndex:60,maxWidth:"calc(100vw - 16px)",padding:K&&D?"4px 6px 10px":"4px 6px 5px",borderRadius:"0 0 14px 14px",border:`1px solid ${B?"rgba(0,255,136,0.25)":"rgba(var(--sd-ink, 255, 255, 255), 0.1)"}`,borderTop:"none",background:"var(--sd-surface, rgba(8,10,22,0.96))",color:"var(--sd-fg-2, #cfd8d8)",fontSize:12,opacity:u||B||C||K?1:.55,boxShadow:B?"0 6px 20px rgba(0,0,0,0.35)":"none",transition:"padding 0.18s ease, opacity 0.18s ease"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,overflowX:"auto"},children:[u&&(0,b.jsx)("div",{role:"tablist","aria-label":"View",style:{display:"flex",gap:2},children:u.items.map(a=>{let c=a.key===u.current;return(0,b.jsxs)("button",{role:"tab","aria-selected":c,title:a.title,onClick:()=>u.onPick(a.key),style:{display:"flex",alignItems:"center",gap:6,padding:"5px 11px",borderRadius:8,border:"none",cursor:"pointer",whiteSpace:"nowrap",fontSize:12,fontWeight:600,background:c?"rgba(52,152,219,0.22)":"transparent",color:c?"var(--sd-fg-1, #cfe6f7)":"var(--sd-fg-3, #8b9aa8)"},children:[a.icon&&(0,b.jsx)("span",{"aria-hidden":"true",children:a.icon}),a.label]},a.key)})}),u&&D&&(0,b.jsx)("span",{"aria-hidden":"true",style:{width:1,alignSelf:"stretch",margin:"3px 4px",background:"rgba(var(--sd-ink, 255, 255, 255), 0.12)"}}),D&&(0,b.jsxs)("button",{onMouseEnter:()=>p(!0),onClick:()=>r(a=>!a),"aria-expanded":K,title:K?"Close":"Open",style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",color:"inherit",font:"inherit",cursor:"pointer",padding:"5px 8px",whiteSpace:"nowrap"},children:[(0,b.jsx)("span",{className:B?"notch-pulse":void 0,style:{width:7,height:7,borderRadius:"50%",background:L,flexShrink:0}}),(0,b.jsxs)("span",{role:"status","aria-live":"polite",style:{display:"flex",alignItems:"center",gap:8},children:[(0,b.jsx)("b",{style:{color:B||C?"var(--sd-fg-1, #fff)":"var(--sd-fg-2, #b8c4c4)",fontWeight:600},children:M}),N&&(0,b.jsx)("span",{style:{color:"var(--sd-fg-3, #8b9a9a)"},children:N})]}),!B&&!C&&K&&(0,b.jsx)("span",{style:{color:"var(--sd-fg-3, #8b9a9a)"},children:"ready · press Auto scan beside Scan to start"})]})]}),D&&null!=H&&(0,b.jsx)("div",{style:{height:2,margin:"3px 6px 0",borderRadius:2,background:"rgba(var(--sd-ink, 255, 255, 255), 0.08)",overflow:"hidden"},children:(0,b.jsx)("div",{style:{width:`${Math.round(100*H)}%`,height:"100%",background:B?"#00ff88":"#3498DB",transition:"width 0.4s ease"}})}),K&&B&&(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,margin:"8px 8px 0",flexWrap:"wrap"},children:[k.target?.name&&(0,b.jsx)("span",{children:k.target.name}),I&&(0,b.jsxs)(e.default,{href:"/settings#usage",style:{color:(a=I.searches,(j=I.cap)?a/j>=.9?"#ff6b6b":a/j>=.6?"#FFD700":"#00ff88":"#8b9a9a"),textDecoration:"none"},title:"Searches on your LinkedIn account in the last 24 hours, and your daily budget. Open LinkedIn usage",children:[I.searches,I.cap?` of ${I.cap}`:""," searches in the last 24 hours"]}),J&&(0,b.jsx)("span",{style:{color:"var(--sd-fg-4, #667)",maxWidth:280,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:J,children:J}),(0,b.jsx)(e.default,{href:"/setup",style:{color:"var(--sd-blue, #3498DB)",textDecoration:"none"},children:"Details"}),(0,b.jsx)("button",{onClick:async()=>{n(!0);try{await (0,f.stopScrape)()}catch{n(!1)}},disabled:m,title:"Stops after saving what's been read; Resume on the Scan page carries on from the same page",style:{padding:"3px 10px",borderRadius:8,fontSize:12,cursor:m?"default":"pointer",background:"rgba(255,107,107,0.12)",color:"var(--sd-fg-2, #ff9b9b)",border:"1px solid rgba(255,107,107,0.35)"},children:m?"Stopping…":"Stop"})]}),K&&!B&&C?.detail&&(0,b.jsx)("div",{style:{margin:"6px 8px 0",color:"var(--sd-fg-3, #8b9a9a)"},children:C.detail})]})}])},59617,a=>{"use strict";var b=a.i(72131),c=a.i(37732),d=a.i(58834);let e=!1;a.s(["default",0,function(){return(0,b.useEffect)(()=>{if(d.IS_DEMO||e)return;let a=()=>{};return fetch("/api/social").then(a=>a.json()).then(({social:b})=>{if(!b?.autoSync||e)return;let d=b.liveAt?Date.parse(b.liveAt):0,f=new Date().getHours();Date.now()-d<864e5||f<9||f>=19||(a=(0,c.watchScanner)(()=>{let b=(0,c.scannerNow)();b.known&&!e&&(e=!0,a(),b.running||(0,c.beginScrape)("messages").catch(()=>{}))}))}).catch(()=>{}),()=>a()},[]),null}])},17372,a=>{"use strict";var b=a.i(87924),c=a.i(72131);a.s(["default",0,function(){let[a,d]=(0,c.useState)(null);return((0,c.useEffect)(()=>{let a=!0;return fetch("/api/update").then(a=>a.json()).then(b=>{a&&b?.restartNeeded&&d(b)}).catch(()=>{}),()=>{a=!1}},[]),a)?(0,b.jsxs)("div",{role:"status",style:{position:"fixed",left:0,right:0,bottom:0,zIndex:9999,background:"linear-gradient(90deg, #FFD700, #FF6B35)",color:"#1a1200",padding:"9px 16px",fontSize:13,fontWeight:600,lineHeight:1.5,display:"flex",alignItems:"center",justifyContent:"center",gap:10,flexWrap:"wrap",textAlign:"center"},children:[(0,b.jsxs)("span",{children:["You have newer code on disk (",a.sha,") than this server is running (",a.bootSha,"). Restart it to see the changes: ",(0,b.jsx)("code",{style:{background:"rgba(var(--sd-shade, 0, 0, 0), 0.16)",padding:"1px 6px",borderRadius:4},children:"Ctrl-C"})," in the terminal, then ",(0,b.jsx)("code",{style:{background:"rgba(var(--sd-shade, 0, 0, 0), 0.16)",padding:"1px 6px",borderRadius:4},children:"npm run dev"}),"."]}),(0,b.jsx)("button",{onClick:()=>d(null),style:{border:"none",background:"rgba(var(--sd-shade, 0, 0, 0), 0.18)",color:"#1a1200",borderRadius:6,padding:"3px 10px",fontWeight:700,cursor:"pointer"},children:"Dismiss"})]}):null}])},53938,a=>{"use strict";var b=a.i(72131),c=a.i(26338);a.s(["default",0,function(){return(0,b.useEffect)(()=>{let b=!0;return fetch("/api/settings",{cache:"no-store"}).then(a=>a.ok?a.json():null).then(async d=>{if(!b||!d?.settings)return;(0,c.adoptSavedTheme)(d.settings.theme);let{adoptSavedLayouts:e}=await a.A(7315);b&&e(d.settings.galaxyLayouts)}).catch(()=>{}),()=>{b=!1}},[]),null}])},63033,a=>{"use strict";let b=new Set,c=[],d=[],e=new Set,f=null,g=new Set,h=!1;a.s(["activitiesNow",0,()=>c,"noActivities",0,()=>d,"noNotch",0,()=>!1,"noNotchTabs",0,()=>null,"notchShownNow",0,()=>h,"notchTabsNow",0,()=>f,"setNotchShown",0,function(a){!!a!==h&&(h=!!a,g.forEach(a=>a()))},"setNotchTabs",0,function(a){f=a&&Array.isArray(a.items)&&a.items.length>1?a:null,e.forEach(a=>a())},"showActivity",0,function(a){return a?.id?(c=[...c.filter(b=>b.id!==a.id),a],b.forEach(a=>a()),()=>{var d;return d=a.id,void(c.some(a=>a.id===d)&&(c=c.filter(a=>a.id!==d),b.forEach(a=>a())))}):()=>{}},"watchActivities",0,function(a){return b.add(a),()=>b.delete(a)},"watchNotchShown",0,function(a){return g.add(a),()=>g.delete(a)},"watchNotchTabs",0,function(a){return e.add(a),()=>e.delete(a)}])},31483,a=>{"use strict";async function b(a,{keepalive:c=!1}={}){try{let b=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:a}),keepalive:c}),d=await b.json();return{settings:d.settings||null,effects:d.effects||null,error:b.ok?null:d.error||"Could not save."}}catch{return{settings:null,effects:null,error:"Could not reach the app. Reload this page to see what is saved."}}}a.s(["saveSettings",0,b])},90788,a=>{"use strict";a.s(["laterSaver",0,function(a,b=400){let c,d=null,e=b=>{clearTimeout(d),d=null,Promise.resolve(a(c,{now:b})).catch(()=>{})},f=a=>{c=a,d&&clearTimeout(d),d=setTimeout(()=>e(!1),b)};return f.flush=()=>{d&&e(!0)},f},"reconcileSaved",0,function({saved:a,cached:b,isDefault:c,same:d}){return null==a?{use:b,save:!c(b),changed:!1}:{use:a,save:!1,changed:!d(a,b)}}])},26338,a=>{"use strict";var b=a.i(91621),c=a.i(31483),d=a.i(90788);let e=Object.freeze({base:"standard",custom:{}}),f=new Set,g=e,h=(a,c)=>JSON.stringify((0,b.cleanTheme)(a))===JSON.stringify((0,b.cleanTheme)(c)),i=(0,d.laterSaver)((a,{now:b})=>(0,c.saveSettings)({theme:a},{keepalive:b}));function j(a){g=(0,b.cleanTheme)(a);try{localStorage.setItem("six-degrees-theme",JSON.stringify(g))}catch{}!function(a){let c=(0,b.resolveTheme)(a);Object.assign(b.TIER_COLORS,c.tiers);let d=(0,b.isLight)(c);if(Object.assign(b.MAP_LOOK,{you:c.you,lines:c.lines,line:c.line,bg:c.bg,dots:c.dots,light:d,text:d?"#11141c":"#ffffff"}),"u"<typeof document)return;let e=(0,b.themeVars)(a),f=document.documentElement;for(let a of[...f.style])!a.startsWith("--sd-")||a in e||f.style.removeProperty(a);for(let[a,b]of Object.entries(e))f.style.setProperty(a,b);Object.assign(f.dataset,(0,b.themeAttrs)(a)),f.style.colorScheme=d?"light":"dark";try{localStorage.setItem("six-degrees-theme-vars",JSON.stringify({vars:e,attrs:(0,b.themeAttrs)(a)}))}catch{}}(g),f.forEach(a=>a())}a.s(["adoptSavedTheme",0,function(a){let{use:f,save:i,changed:k}=(0,d.reconcileSaved)({saved:null==a?null:(0,b.cleanTheme)(a),cached:g,isDefault:a=>h(a,e),same:h});i&&(0,c.saveSettings)({theme:g}),k&&j(f)},"serverTheme",0,()=>e,"setTheme",0,function(a){j(a),i(g)},"themeNow",0,()=>g,"watchTheme",0,function(a){return f.add(a),()=>f.delete(a)}])}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=_07zb7lu._.js.map
|