most-box 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -19
- package/electron/afterPack.cjs +87 -0
- package/electron/main.js +156 -8
- package/electron/preload.js +6 -0
- package/electron/updateChecker.js +97 -0
- package/electron/updateChecker.test.js +147 -0
- package/out/404/index.html +2 -2
- package/out/404.html +2 -2
- package/out/__next.__PAGE__.txt +6 -6
- package/out/__next._full.txt +16 -16
- package/out/__next._head.txt +3 -3
- package/out/__next._index.txt +8 -8
- package/out/__next._tree.txt +5 -5
- package/out/_next/static/chunks/04mo7rr..0_1q.js +1 -0
- package/out/_next/static/chunks/06rf3qq5ggs6v.js +1 -0
- package/out/_next/static/chunks/07td.jq7xff84.css +1 -0
- package/out/_next/static/chunks/0_0oph_z1az14.js +1 -0
- package/out/_next/static/chunks/{0qou.u2e2dy48.css → 0adx~d-j05c9d.css} +2 -2
- package/out/_next/static/chunks/0cl7d~7abnk_p.css +1 -0
- package/out/_next/static/chunks/0d306t1wvjpdx.js +1 -0
- package/out/_next/static/chunks/0g_a~e050bgzg.css +1 -0
- package/out/_next/static/chunks/{0o6lrkxy4jwag.js → 0gcsdf57gcm6h.js} +1 -1
- package/out/_next/static/chunks/0hpev4am9jpmu.css +1 -0
- package/out/_next/static/chunks/0m_5nb6x8qy._.js +1 -0
- package/out/_next/static/chunks/0n.ayxmsar6e5.js +1 -0
- package/out/_next/static/chunks/{0usvo~vu7r8np.js → 0o9ce4cyf76by.js} +1 -1
- package/out/_next/static/chunks/0olqjomda37-e.js +1 -0
- package/out/_next/static/chunks/{0o98f1yq..o.8.js → 0pt.5cg1t09qs.js} +1 -1
- package/out/_next/static/chunks/0qgx9t4jx16ua.css +1 -0
- package/out/_next/static/chunks/0s~g.l~x049o2.js +1 -0
- package/out/_next/static/chunks/0ukyg~tkm~h2m.css +1 -0
- package/out/_next/static/chunks/0voe1.ttrh84k.css +1 -0
- package/out/_next/static/chunks/0wtf0xsiicxx6.js +1 -0
- package/out/_next/static/chunks/0x.ky97owcxxs.js +1 -0
- package/out/_next/static/chunks/0xdwau5k2augv.css +4 -0
- package/out/_next/static/chunks/0ysj5b94vu4ri.js +1 -0
- package/out/_next/static/chunks/12nr19.nnn6s3.js +5 -0
- package/out/_next/static/chunks/{0qub_r0x_r-e9.css → 12pep-2t-qg4n.css} +1 -1
- package/out/_next/static/chunks/14_inksek_rth.js +2 -0
- package/out/_next/static/chunks/153-sz7s.qml2.js +1 -0
- package/out/_next/static/chunks/17cwkb2yn_akx.js +1 -0
- package/out/_next/static/chunks/184hxsuf-5c84.js +1 -0
- package/out/_next/static/chunks/{turbopack-0xs6mybc~5t_3.js → turbopack-0xta0kqwzkf28.js} +1 -1
- package/out/_not-found/__next._full.txt +13 -13
- package/out/_not-found/__next._head.txt +3 -3
- package/out/_not-found/__next._index.txt +8 -8
- package/out/_not-found/__next._not-found.__PAGE__.txt +4 -4
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +3 -3
- package/out/_not-found/index.html +2 -2
- package/out/_not-found/index.txt +13 -13
- package/out/admin/__next._full.txt +15 -15
- package/out/admin/__next._head.txt +3 -3
- package/out/admin/__next._index.txt +8 -8
- package/out/admin/__next._tree.txt +4 -4
- package/out/admin/__next.admin.__PAGE__.txt +4 -4
- package/out/admin/__next.admin.txt +4 -4
- package/out/admin/index.html +2 -2
- package/out/admin/index.txt +15 -15
- package/out/app/__next._full.txt +14 -14
- package/out/app/__next._head.txt +3 -3
- package/out/app/__next._index.txt +8 -8
- package/out/app/__next._tree.txt +3 -3
- package/out/app/__next.app.__PAGE__.txt +4 -4
- package/out/app/__next.app.txt +3 -3
- package/out/app/index.html +2 -2
- package/out/app/index.txt +14 -14
- package/out/chat/__next._full.txt +15 -15
- package/out/chat/__next._head.txt +3 -3
- package/out/chat/__next._index.txt +8 -8
- package/out/chat/__next._tree.txt +4 -4
- package/out/chat/__next.chat.__PAGE__.txt +4 -4
- package/out/chat/__next.chat.txt +4 -4
- package/out/chat/index.html +2 -2
- package/out/chat/index.txt +15 -15
- package/out/chat/join/__next._full.txt +25 -0
- package/out/chat/join/__next._head.txt +5 -0
- package/out/{changelog → chat/join}/__next._index.txt +8 -8
- package/out/chat/join/__next._tree.txt +5 -0
- package/out/chat/join/__next.chat.join.__PAGE__.txt +9 -0
- package/out/chat/join/__next.chat.join.txt +5 -0
- package/out/chat/join/__next.chat.txt +5 -0
- package/out/chat/join/index.html +15 -0
- package/out/chat/join/index.txt +25 -0
- package/out/download/__next._full.txt +37 -33
- package/out/download/__next._head.txt +3 -3
- package/out/download/__next._index.txt +8 -8
- package/out/download/__next._tree.txt +5 -5
- package/out/download/__next.download.__PAGE__.txt +9 -14
- package/out/download/__next.download.txt +3 -3
- package/out/download/index.html +2 -2
- package/out/download/index.txt +37 -33
- package/out/favicon.ico +0 -0
- package/out/gandengyan/__next._full.txt +25 -0
- package/out/{changelog → gandengyan}/__next._head.txt +3 -3
- package/out/{docs → gandengyan}/__next._index.txt +8 -8
- package/out/gandengyan/__next._tree.txt +5 -0
- package/out/gandengyan/__next.gandengyan.__PAGE__.txt +10 -0
- package/out/gandengyan/__next.gandengyan.txt +5 -0
- package/out/gandengyan/index.html +15 -0
- package/out/gandengyan/index.txt +25 -0
- package/out/index.html +2 -2
- package/out/index.txt +16 -16
- package/out/note/__next._full.txt +14 -14
- package/out/note/__next._head.txt +3 -3
- package/out/note/__next._index.txt +8 -8
- package/out/note/__next._tree.txt +3 -3
- package/out/note/__next.note.__PAGE__.txt +4 -4
- package/out/note/__next.note.txt +3 -3
- package/out/note/index.html +2 -2
- package/out/note/index.txt +14 -14
- package/out/ping/__next._full.txt +16 -16
- package/out/ping/__next._head.txt +3 -3
- package/out/ping/__next._index.txt +8 -8
- package/out/ping/__next._tree.txt +5 -5
- package/out/ping/__next.ping.__PAGE__.txt +5 -5
- package/out/ping/__next.ping.txt +4 -4
- package/out/ping/index.html +2 -2
- package/out/ping/index.txt +16 -16
- package/out/web3/__next._full.txt +15 -15
- package/out/web3/__next._head.txt +3 -3
- package/out/web3/__next._index.txt +8 -8
- package/out/web3/__next._tree.txt +4 -4
- package/out/web3/__next.web3.__PAGE__.txt +4 -4
- package/out/web3/__next.web3.txt +4 -4
- package/out/web3/ed25519/__next._full.txt +13 -13
- package/out/web3/ed25519/__next._head.txt +3 -3
- package/out/web3/ed25519/__next._index.txt +8 -8
- package/out/web3/ed25519/__next._tree.txt +4 -4
- package/out/web3/ed25519/__next.web3.ed25519.__PAGE__.txt +2 -2
- package/out/web3/ed25519/__next.web3.ed25519.txt +3 -3
- package/out/web3/ed25519/__next.web3.txt +4 -4
- package/out/web3/ed25519/index.html +1 -1
- package/out/web3/ed25519/index.txt +13 -13
- package/out/web3/index.html +2 -2
- package/out/web3/index.txt +15 -15
- package/out/web3/tools/__next._full.txt +13 -13
- package/out/web3/tools/__next._head.txt +3 -3
- package/out/web3/tools/__next._index.txt +8 -8
- package/out/web3/tools/__next._tree.txt +4 -4
- package/out/web3/tools/__next.web3.tools.__PAGE__.txt +2 -2
- package/out/web3/tools/__next.web3.tools.txt +3 -3
- package/out/web3/tools/__next.web3.txt +4 -4
- package/out/web3/tools/index.html +1 -1
- package/out/web3/tools/index.txt +13 -13
- package/package.json +44 -35
- package/public/favicon.ico +0 -0
- package/server/index.js +142 -1304
- package/server/src/config.js +1 -1
- package/server/src/core/channelAttachment.js +68 -0
- package/server/src/core/cid.js +2 -88
- package/server/src/core/cidTopic.js +29 -0
- package/server/src/core/mostLink.js +88 -0
- package/server/src/games/gandengyan.js +675 -0
- package/server/src/http/access.js +127 -0
- package/server/src/http/app.js +1102 -0
- package/server/src/http/errors.js +35 -0
- package/server/src/http/nodeLogs.js +53 -0
- package/server/src/http/nodeStatus.js +146 -0
- package/server/src/http/staticFiles.js +84 -0
- package/server/src/http/uploads.js +114 -0
- package/server/src/index.js +799 -211
- package/server/src/node/config.js +38 -6
- package/server/src/utils/api.js +305 -14
- package/server/src/utils/auth.js +63 -0
- package/server/src/utils/dateTime.js +30 -0
- package/server/src/utils/downloadMessages.js +89 -0
- package/server/src/utils/errors.js +7 -0
- package/server/src/utils/mostWallet.js +151 -0
- package/server/src/utils/mp.js +2 -26
- package/server/src/utils/noteBackup.js +2 -5
- package/server/src/utils/noteUtils.js +11 -3
- package/server/src/utils/userIdentity.js +0 -1
- package/out/_next/static/chunks/00-u5nq76f0.j.js +0 -1
- package/out/_next/static/chunks/00fm8lijienf1.js +0 -1
- package/out/_next/static/chunks/00o9ht.f2qm00.css +0 -4
- package/out/_next/static/chunks/00zi-erhjrny2.js +0 -2
- package/out/_next/static/chunks/084xf0edl9sfo.js +0 -1
- package/out/_next/static/chunks/09f1gfke9m5wg.css +0 -1
- package/out/_next/static/chunks/09xyi6fpro_d-.css +0 -1
- package/out/_next/static/chunks/0_npg_pcoywti.js +0 -5
- package/out/_next/static/chunks/0_r_mk1~6bosc.js +0 -1
- package/out/_next/static/chunks/0arm0a6adt7cc.css +0 -1
- package/out/_next/static/chunks/0c9j3eq_14vv2.css +0 -1
- package/out/_next/static/chunks/0d4bueddmcnca.js +0 -1
- package/out/_next/static/chunks/0gtwvy1z9ksa7.css +0 -1
- package/out/_next/static/chunks/0ho~log~~-jwp.css +0 -1
- package/out/_next/static/chunks/0j27tcmtt4ly7.js +0 -1
- package/out/_next/static/chunks/0j3v4mq67wtnh.js +0 -1
- package/out/_next/static/chunks/0lkmf5ry.s_7w.js +0 -1
- package/out/_next/static/chunks/0p486m03-zfoi.js +0 -1
- package/out/_next/static/chunks/0r1~k82nji8sf.js +0 -1
- package/out/_next/static/chunks/0v7qp4hv-_._r.js +0 -1
- package/out/_next/static/chunks/0wuwlgcn6gxqt.js +0 -1
- package/out/_next/static/chunks/0xl5_avhu._i8.js +0 -1
- package/out/_next/static/chunks/10kvl8vj_plm-.js +0 -1
- package/out/_next/static/chunks/16m27azcs4k6w.js +0 -1
- package/out/changelog/__next._full.txt +0 -25
- package/out/changelog/__next._tree.txt +0 -5
- package/out/changelog/__next.changelog.__PAGE__.txt +0 -10
- package/out/changelog/__next.changelog.txt +0 -5
- package/out/changelog/index.html +0 -15
- package/out/changelog/index.txt +0 -25
- package/out/docs/__next._full.txt +0 -25
- package/out/docs/__next._head.txt +0 -5
- package/out/docs/__next._tree.txt +0 -5
- package/out/docs/__next.docs.__PAGE__.txt +0 -10
- package/out/docs/__next.docs.txt +0 -5
- package/out/docs/getting-started/__next._full.txt +0 -25
- package/out/docs/getting-started/__next._head.txt +0 -5
- package/out/docs/getting-started/__next._index.txt +0 -9
- package/out/docs/getting-started/__next._tree.txt +0 -5
- package/out/docs/getting-started/__next.docs.getting-started.__PAGE__.txt +0 -10
- package/out/docs/getting-started/__next.docs.getting-started.txt +0 -5
- package/out/docs/getting-started/__next.docs.txt +0 -5
- package/out/docs/getting-started/index.html +0 -15
- package/out/docs/getting-started/index.txt +0 -25
- package/out/docs/index.html +0 -15
- package/out/docs/index.txt +0 -25
- package/out/note/edit/__next._full.txt +0 -24
- package/out/note/edit/__next._head.txt +0 -5
- package/out/note/edit/__next._index.txt +0 -9
- package/out/note/edit/__next._tree.txt +0 -4
- package/out/note/edit/__next.note.edit.__PAGE__.txt +0 -9
- package/out/note/edit/__next.note.edit.txt +0 -5
- package/out/note/edit/__next.note.txt +0 -5
- package/out/note/edit/index.html +0 -15
- package/out/note/edit/index.txt +0 -24
- /package/out/_next/static/{sIuUKxnnGU7K9Tu9UDKE8 → aPEZ4zaaR5W3WpSZ0dFsa}/_buildManifest.js +0 -0
- /package/out/_next/static/{sIuUKxnnGU7K9Tu9UDKE8 → aPEZ4zaaR5W3WpSZ0dFsa}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{sIuUKxnnGU7K9Tu9UDKE8 → aPEZ4zaaR5W3WpSZ0dFsa}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.portal-page{min-height:calc(100dvh - 144px)}.portal-hero{text-align:center;padding:64px 24px 32px}.portal-hero-title{letter-spacing:-.03em;background:linear-gradient(135deg, var(--text-primary), var(--accent));-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;margin-bottom:8px;font-size:48px;font-weight:700;line-height:1.1}.portal-hero-subtitle{color:var(--text-secondary);font-size:18px}@media (max-width:768px){.portal-hero{padding:40px 24px 24px}.portal-hero-title{font-size:36px}.portal-hero-subtitle{font-size:16px}}.portal-cards-section{padding-bottom:32px}.portal-cards{grid-template-columns:repeat(3,1fr);gap:16px;display:grid}@media (max-width:768px){.portal-cards{grid-template-columns:1fr}}.portal-card{text-align:center;background:var(--glass-bg-subtle);-webkit-backdrop-filter:var(--blur-sm);border:1px solid var(--glass-border);border-radius:var(--radius-lg);cursor:pointer;transition:all var(--transition);border:2px solid #0000;flex-direction:column;align-items:center;gap:6px;padding:28px 20px;display:flex;position:relative}.portal-card:hover{background:var(--glass-bg);box-shadow:var(--glass-shadow);transform:translateY(-2px)}.portal-card.active{background:var(--glass-bg);border-color:var(--accent);box-shadow:0 4px 24px #5e6ad226}.portal-card-open-btn{opacity:.5;position:absolute;top:12px;right:12px}.portal-card:hover .portal-card-open-btn,.portal-card.active .portal-card-open-btn{opacity:1}.portal-card-icon{color:var(--accent);margin-bottom:4px}.portal-card-title{color:var(--text-primary);font-size:17px;font-weight:600}.portal-card-subtitle{color:var(--text-secondary);font-size:13px}.portal-card-status{border-radius:var(--radius-full);background:var(--glass-bg-subtle);border:1px solid var(--glass-border);align-items:center;gap:5px;margin-top:6px;padding:3px 10px;font-size:11px;font-weight:500;display:inline-flex}.status-dot{border-radius:50%;width:7px;height:7px;display:inline-block}.status-dot.checking{background:var(--warning);animation:1.2s ease-in-out infinite pulse-dot}.status-dot.connected{background:var(--success)}.status-dot.disconnected{background:var(--danger)}.status-dot.ready{background:var(--info)}@keyframes pulse-dot{0%,to{opacity:.4;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.portal-marketing{padding-bottom:64px}.portal-marketing-inner{background:var(--glass-bg-subtle);-webkit-backdrop-filter:var(--blur-sm);border:1px solid var(--glass-border);border-radius:var(--radius-lg);padding:40px;animation:.3s ease-out fadeInUp}@media (max-width:768px){.portal-marketing-inner{padding:24px}}.portal-marketing-header h2{margin-bottom:12px;font-size:28px;font-weight:600}.portal-marketing-header p{color:var(--text-secondary);max-width:60ch;font-size:16px;line-height:1.7}@media (max-width:768px){.portal-marketing-header h2{font-size:22px}.portal-marketing-header p{font-size:14px}}.portal-marketing-features{grid-template-columns:repeat(2,1fr);gap:12px;margin-top:28px;display:grid}@media (max-width:768px){.portal-marketing-features{grid-template-columns:1fr}}.portal-feature-item{color:var(--text-secondary);align-items:flex-start;gap:10px;font-size:14px;line-height:1.5;display:flex}.portal-feature-icon{color:var(--accent);flex-shrink:0;margin-top:1px}.portal-marketing-steps{border-top:1px solid var(--glass-border);flex-direction:column;gap:16px;margin-top:32px;padding-top:32px;display:flex}.portal-step{align-items:flex-start;gap:14px;display:flex}.portal-step-num{background:var(--accent);color:#fff;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;font-size:13px;font-weight:700;display:flex}.portal-step-content strong{color:var(--text-primary);font-size:15px;font-weight:600}.portal-step-content p{color:var(--text-secondary);margin-top:2px;font-size:13px}.portal-step-code{background:var(--glass-bg-subtle);border:1px solid var(--glass-border);border-radius:var(--radius-sm);font-size:13px;font-family:var(--font-mono);color:var(--text-primary);margin-top:8px;padding:10px 14px;display:block}.portal-step-link{margin-top:6px}.portal-step-link a{color:var(--accent);align-items:center;gap:4px;font-size:13px;display:inline-flex}.portal-actions{border-top:1px solid var(--glass-border);flex-wrap:wrap;gap:12px;margin-top:32px;padding-top:32px;display:flex}.portal-actions .mkt-btn-primary,.portal-actions .mkt-btn-secondary{align-items:center;gap:6px;display:inline-flex}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.web3-page{padding:var(--space-8) var(--space-4);flex-direction:column;flex:1;align-items:center;display:flex;overflow:auto}.web3-container{width:100%;max-width:720px}.web3-container.narrow{max-width:640px}.web3-container.tools{max-width:720px}.web3-login-card{background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-lg);backdrop-filter:var(--blur-lg);border:1px solid var(--glass-border);border-radius:var(--radius-xl);padding:var(--space-10) var(--space-8);text-align:center;width:100%;max-width:420px;box-shadow:var(--glass-shadow-lg);margin:auto;animation:.3s ease-out scaleIn}.web3-login-avatar{border-radius:var(--radius-full);background:var(--accent-soft);width:72px;height:72px;margin:0 auto var(--space-5);color:var(--accent);justify-content:center;align-items:center;display:flex}.web3-login-card h2{margin-bottom:var(--space-2);font-size:22px;font-weight:600}.web3-login-desc{color:var(--text-secondary);margin-bottom:var(--space-6);font-size:14px}.web3-login-form{gap:var(--space-3);flex-direction:column;display:flex}.web3-login-error{color:var(--danger);margin-top:-var(--space-1);font-size:13px}.web3-identity-card{background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-lg);backdrop-filter:var(--blur-lg);border:1px solid var(--glass-border);border-radius:var(--radius-xl);padding:var(--space-8);text-align:center;box-shadow:var(--glass-shadow);margin-bottom:var(--space-6)}.web3-identity-avatar{border-radius:var(--radius-lg);object-fit:cover;width:88px;height:88px;margin-bottom:var(--space-4);box-shadow:var(--shadow-md)}.web3-identity-name{margin-bottom:var(--space-2);font-size:20px;font-weight:600}.web3-identity-address{justify-content:center;align-items:center;gap:var(--space-2);flex-wrap:wrap;display:flex}.web3-identity-address code{font-family:var(--font-mono);color:var(--text-secondary);word-break:break-all;font-size:13px}.web3-key-grid{gap:var(--space-4);margin-bottom:var(--space-6);grid-template-columns:repeat(2,1fr);display:grid}@media (max-width:640px){.web3-key-grid{grid-template-columns:1fr}}.web3-key-card{background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-md);backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);border-radius:var(--radius-lg);padding:var(--space-5);box-shadow:var(--glass-shadow);transition:transform var(--transition-fast)}.web3-key-card:hover{transform:translateY(-2px)}.web3-key-card.accent{border-color:var(--danger)}.web3-key-card-header{align-items:center;gap:var(--space-2);margin-bottom:var(--space-3);display:flex}.web3-key-card-icon{color:var(--accent)}.web3-key-card.accent .web3-key-card-icon{color:var(--danger)}.web3-key-card-title{color:var(--text-primary);font-size:14px;font-weight:600}.web3-key-card-body{gap:var(--space-2);flex-direction:column;display:flex}.web3-private-toggle{align-items:center;gap:var(--space-2);margin-bottom:var(--space-2);display:flex}.web3-pem-list{gap:var(--space-4);margin-bottom:var(--space-6);flex-direction:column;display:flex}.web3-pem-block{background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-md);backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);border-radius:var(--radius-lg);padding:var(--space-4);box-shadow:var(--glass-shadow)}.web3-pem-header{margin-bottom:var(--space-3);justify-content:space-between;align-items:center;gap:var(--space-2);flex-wrap:wrap;display:flex}.web3-pem-label{color:var(--text-primary);font-size:14px;font-weight:600}.web3-pem-actions{gap:var(--space-2);display:flex}.web3-ipns-bar{align-items:center;gap:var(--space-3);padding:var(--space-4);background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-md);backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);border-radius:var(--radius-lg);margin-bottom:var(--space-4);display:flex}.web3-ipns-label{color:var(--text-secondary);white-space:nowrap;font-size:13px;font-weight:600}.web3-ipns-value{font-family:var(--font-mono);word-break:break-all;color:var(--text-primary);font-size:13px}.web3-raw-section{margin-top:var(--space-4)}.web3-raw-toggle{background:var(--glass-bg-subtle);border:1px solid var(--glass-border);border-radius:var(--radius-md);color:var(--text-secondary);cursor:pointer;transition:all var(--transition-fast);margin-bottom:var(--space-3);align-items:center;gap:6px;padding:8px 14px;font-size:13px;display:inline-flex}.web3-raw-toggle:hover{background:var(--glass-bg);color:var(--text-primary)}.web3-raw-grid{gap:var(--space-3);flex-direction:column;display:flex}.web3-raw-item{background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-md);backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);border-radius:var(--radius-md);padding:var(--space-3) var(--space-4)}.web3-raw-label{color:var(--text-muted);margin-bottom:4px;font-size:12px;display:block}.web3-raw-value{font-family:var(--font-mono);word-break:break-all;color:var(--text-primary);font-size:12px;display:block}.web3-raw-value.danger{color:var(--danger)}.web3-mode-switcher{gap:var(--space-2);margin-bottom:var(--space-5);display:flex}.web3-mode-pill{border-radius:var(--radius-full);cursor:pointer;transition:all var(--transition-fast);background:var(--glass-bg-subtle);border:1px solid var(--glass-border);color:var(--text-secondary);align-items:center;gap:6px;padding:8px 16px;font-size:13px;font-weight:500;display:inline-flex}.web3-mode-pill:hover{background:var(--glass-bg);color:var(--text-primary)}.web3-mode-pill.active{background:var(--accent);color:#fff;border-color:var(--accent)}.web3-tools-inputs{gap:var(--space-3);margin-bottom:var(--space-3);flex-direction:column;display:flex}.web3-tools-warning,.web3-tools-danger{color:var(--danger);border-radius:var(--radius-md);background:#ff3b300f;border:1px solid #ff3b3026;align-items:center;gap:6px;padding:10px 12px;font-size:13px;display:flex}.web3-tools-error{color:var(--danger);margin-top:-var(--space-1);font-size:13px}.web3-tools-preview{align-items:center;gap:var(--space-3);padding:var(--space-6);background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-lg);backdrop-filter:var(--blur-lg);border:1px solid var(--glass-border);border-radius:var(--radius-xl);margin-bottom:var(--space-5);text-align:center;flex-direction:column;display:flex}.web3-tools-avatar{border-radius:var(--radius-full);object-fit:cover;width:80px;height:80px;box-shadow:var(--shadow-md)}.web3-tools-address{flex-direction:column;align-items:center;gap:6px;display:flex}.web3-tools-address span{color:var(--text-muted);font-size:12px}.web3-tools-address code{font-family:var(--font-mono);color:var(--text-primary);word-break:break-all;font-size:14px}.web3-tools-section{margin-bottom:var(--space-5)}.web3-tools-toggle{background:var(--glass-bg-subtle);border:1px solid var(--glass-border);border-radius:var(--radius-md);color:var(--text-primary);cursor:pointer;transition:all var(--transition-fast);margin-bottom:var(--space-3);align-items:center;gap:6px;padding:10px 16px;font-size:13px;font-weight:500;display:inline-flex}.web3-tools-toggle:hover{background:var(--glass-bg)}.web3-tools-toggle.small{padding:6px 12px;font-size:12px}.web3-mnemonic-reveal{gap:var(--space-3);flex-direction:column;display:flex}.web3-mnemonic-card{align-items:center;gap:var(--space-3);padding:var(--space-4);background:var(--glass-bg-heavy);border:1px solid var(--glass-border);border-radius:var(--radius-lg);display:flex}.web3-mnemonic-text{font-family:var(--font-mono);word-break:break-word;color:var(--text-primary);flex:1;font-size:14px;line-height:1.6}.web3-tools-section>.web3-tools-danger{margin-bottom:var(--space-4)}.web3-derive-table-wrap{border-radius:var(--radius-lg);border:1px solid var(--glass-border);overflow-x:auto}.web3-derive-table{border-collapse:collapse;width:100%;font-size:13px}.web3-derive-table th,.web3-derive-table td{text-align:left;border-bottom:1px solid var(--glass-border);white-space:nowrap;padding:10px 12px}.web3-derive-table th{background:var(--glass-bg-subtle);color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none;font-weight:600}.web3-derive-table th:hover{background:var(--glass-bg)}.web3-derive-table th.danger,.web3-derive-table td.danger{color:var(--danger)}.web3-derive-table tbody tr:hover{background:var(--glass-bg-subtle)}.web3-derive-table td{font-family:var(--font-mono);color:var(--text-primary);font-size:12px}.web3-derive-table td:nth-child(2){text-overflow:ellipsis;max-width:160px;overflow:hidden}.web3-derive-th{white-space:nowrap}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68877,e=>{"use strict";let a=(0,e.i(56420).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",0,a],68877)},68590,e=>{"use strict";let a=(0,e.i(56420).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,a],68590)},30274,e=>{"use strict";let a=(0,e.i(56420).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,a],30274)},35965,e=>{"use strict";let a=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,a],35965)},96699,e=>{"use strict";let a=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,a],96699)},93583,e=>{"use strict";let a=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.s(["Menu",0,a],93583)},59665,5142,e=>{"use strict";var a=e.i(18050),t=e.i(71645),s=e.i(93583);function n(e=!1,a={}){let[s,i]=(0,t.useState)(e),r=(0,t.useCallback)(()=>{i(e=>e||(a.onOpen?.(),!0))},[a.onOpen]),c=(0,t.useCallback)(()=>{i(e=>e?(a.onClose?.(),!1):e)},[a.onClose]);return[s,{open:r,close:c,toggle:(0,t.useCallback)(()=>{s?c():r()},[c,r,s]),set:i}]}e.s(["useDisclosure",0,n],5142);let i=(0,t.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:r,headerRight:c,children:l}){let[o,d]=n(!1),[u,h]=(0,t.useState)(!1),m=function(e,{getInitialValueInEffect:a}={getInitialValueInEffect:!0}){let[s,n]=(0,t.useState)(a?void 0:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,t.useEffect)(()=>{try{if("matchMedia"in window){let a=window.matchMedia(e);n(a.matches);let t=e=>n(e.matches);return a.addEventListener("change",t),()=>{a.removeEventListener("change",t)}}}catch(e){return}},[e]),s||!1}("(max-width: 768px)");return(0,a.jsx)(i.Provider,{value:{closeSidebar:d.close},children:(0,a.jsxs)("div",{className:"app-layout",children:[(0,a.jsx)("div",{className:`sidebar-overlay ${o?"visible":""}`,onClick:()=>d.close()}),(0,a.jsx)("div",{className:`sidebar ${o?"open":""} ${u?"collapsed":""}`,children:e({closeSidebar:d.close})}),(0,a.jsxs)("div",{className:"main-content",children:[(0,a.jsxs)("header",{className:"app-header",children:[(0,a.jsxs)("div",{className:"header-left",children:[(0,a.jsx)("button",{onClick:()=>{m?d.toggle():h(!u)},className:"btn btn-icon sidebar-toggle-btn","aria-label":m?"打开菜单":u?"展开侧边栏":"收起侧边栏",children:(0,a.jsx)(s.Menu,{size:16})}),r]}),(0,a.jsx)("div",{className:"header-right",children:c})]}),l]})]})})}],59665)},27648,e=>{"use strict";var a=e.i(18050),t=e.i(93957),s=e.i(71192);e.s(["default",0,function({className:e=""}){let n=(0,s.useUserStore)(e=>e.identity),i=(0,s.useUserStore)(e=>e.openLoginModal),r=(0,s.useUserStore)(e=>e.logoutUser);return(0,a.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${e}`,children:[(0,a.jsxs)("div",{className:"user-info",children:[(0,a.jsx)("img",{className:"user-avatar-img",src:(0,t.generateAvatar)(n?.address),alt:"avatar"}),(0,a.jsx)("span",{className:"user-name",title:n?.address,children:n?.displayName||"未登录"})]}),n?(0,a.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:r,children:"退出"}):(0,a.jsx)("button",{className:"btn btn-primary login-btn",onClick:i,children:"登录"})]})}])},77071,e=>{"use strict";let a=(0,e.i(56420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,a],77071)},41222,e=>{"use strict";var a=e.i(18050),t=e.i(71645),s=e.i(68590),n=e.i(30274),i=e.i(77071),r=e.i(35965),c=e.i(96699),l=e.i(63676),o=e.i(62368),d=e.i(68877),u=e.i(59665);e.i(4121);var h=e.i(47910),m=e.i(88361),p=e.i(26913),f=e.i(93957),g=e.i(3593),x=e.i(71192),j=e.i(5142),w=e.i(22016),y=e.i(27648);let b=(e,a=100,t=0)=>p.api.get(`/api/channels/${encodeURIComponent(e)}/messages?limit=${a}&offset=${t}`).json(),v=e=>p.api.get(`/api/channels/${encodeURIComponent(e)}/peers`).json(),N=[{name:"general"},{name:"random"},{name:"tech"}],k=[{id:"m1",author:"user1",authorName:"Alice",content:"大家好!欢迎使用 P2P 聊天",timestamp:Date.now()-36e5},{id:"m2",author:"user2",authorName:"Bob",content:"这个聊天是基于 Hyperswarm 的,完全去中心化",timestamp:Date.now()-35e5},{id:"m3",author:"user3",authorName:"Charlie",content:"消息通过 P2P 网络同步,无需服务器",timestamp:Date.now()-34e5}];e.s(["default",0,function(){let e=(0,g.useAppStore)(e=>e.isDarkMode),S=(0,g.useAppStore)(e=>e.setIsDarkMode),C=(0,g.useAppStore)(e=>e.hasBackend),M=(0,g.useAppStore)(e=>e.addToast),$=(0,x.useUserStore)(e=>e.identity),[E,R]=(0,t.useState)([]),[z,P]=(0,t.useState)(null),[U,D]=(0,t.useState)([]),[I,A]=(0,t.useState)(""),[T,O]=(0,j.useDisclosure)(!1),[L,q]=(0,t.useState)(""),[F,W]=(0,t.useState)(!1),[B,J]=(0,t.useState)(!1),[K,V]=(0,j.useDisclosure)(!1),[H,X]=(0,t.useState)(null),G=(0,t.useRef)(null),Q=(0,t.useRef)(null),Y=(0,t.useRef)(null),Z=(0,t.useRef)(null),_=(0,t.useRef)(!1);(0,t.useEffect)(()=>{Y.current=z},[z]),(0,t.useEffect)(()=>{Q.current?.scrollIntoView({behavior:"smooth"})},[U]),(0,t.useEffect)(()=>{p.api.get("/api/node-id").json().then(e=>q(e.id)).catch(e=>{console.warn("[Chat] Failed to fetch node ID:",e.message),es(e,"无法读取节点 ID")})},[]);let ee=(0,t.useRef)(null),ea=(0,t.useRef)(!0);async function et(e){if(!0===C)try{let a=await b(e);D(e=>{let t=a.filter(a=>{let t=a.id||`${a.author}-${a.timestamp}`;return!e.some(e=>(e.id||`${e.author}-${e.timestamp}`)===t)});return 0===t.length?e:[...e,...t]}),await v(e)}catch{}}async function es(e,a){M(await (0,p.getApiErrorMessage)(e,a),"error")}async function en(){try{let e=await p.api.get("/api/channels").json();R(e)}catch(e){R([]),await es(e,"无法读取频道列表")}}function ei(e,a){G.current&&G.current.readyState===WebSocket.OPEN&&G.current.send(JSON.stringify({event:e,data:a}))}function er(e){if(!L){ee.current=e;return}ei("channel:subscribe",{channel:e})}function ec(e){ei("channel:unsubscribe",{channel:e})}async function el(e){Y.current&&ec(Y.current.name),P(e),er(e.name),window.history.pushState({},"",`?channel=${encodeURIComponent(e.name)}`);try{if(!0===C){let a=await b(e.name);D(a),await v(e.name)}else D(k)}catch(e){D([]),await es(e,"打开频道失败")}}async function eo(e,a){if(a&&a.stopPropagation(),!B){J(!0),ec(e);try{let a;if(await (a=e,p.api.delete(`/api/channels/${encodeURIComponent(a)}`).json()),z?.name===e){P(null),D([]);let e=new URL(window.location.href);e.searchParams.delete("channel"),window.history.pushState({},"",e.pathname)}en(),V.close(),X(null)}catch(e){await es(e,"退出频道失败")}finally{J(!1)}}}async function ed(e){if(e.trim()&&!F){W(!0);try{let a,t;await (a=e.trim(),t="public",p.api.post("/api/channels",{json:{name:a,type:t}}).json()),O.close(),en()}catch(e){await es(e,"加入频道失败")}finally{W(!1)}}}async function eu(){if(!I.trim()||!z||!$)return;let e=I.trim();A("");let a=`${$.address}-${Date.now()}-${Math.random().toString(36).slice(2)}`,t={id:a,author:$.address,authorName:$.displayName,content:e,timestamp:Date.now(),pending:!0};D(e=>[...e,t]);try{let t,s,n,i,r=await (t=z.name,s=e,n=$.address,i=$.displayName,p.api.post(`/api/channels/${encodeURIComponent(t)}/messages`,{json:{content:s,author:n,authorName:i}}).json());D(e=>e.map(e=>e.id===a?{...r.message,id:r.message.id||r.message.timestamp}:e))}catch(e){D(e=>e.filter(e=>e.id!==a)),await es(e,"发送失败")}}(0,t.useEffect)(()=>(ea.current=!0,()=>{ea.current=!1}),[]),(0,t.useEffect)(()=>{if(L&&ee.current){let e=ee.current;ee.current=null,er(e)}},[L]),(0,t.useEffect)(()=>{if(!0===C)return function e(){let a=new WebSocket((0,p.getWebSocketUrl)("/ws"));a.onopen=()=>{_.current=!0,L&&1===a.readyState&&a.send(JSON.stringify({event:"register",data:{peerId:L}})),Y.current&&(er(Y.current.name),et(Y.current.name))},a.onmessage=e=>{try{let{event:s,data:n}=JSON.parse(e.data);var a=s,t=n;let i=Y.current;switch(a){case"channel:message":i&&t.channel===i.name&&(D(e=>{let a=t.message.id||`${t.message.author}-${t.message.timestamp}`,s=e.findIndex(e=>e.pending&&e.content===t.message.content&&e.author===t.message.author);if(-1!==s){let n=[...e];return n[s]={...t.message,id:a},n}return e.some(e=>e.id===a||e.timestamp===t.message.timestamp&&e.content===t.message.content&&e.author===t.message.author)?e:[...e,{...t.message,id:a}]}),v(i.name).catch(e=>{console.warn("[Chat] Failed to fetch peers:",e.message)}));break;case"channel:peer:online":case"channel:peer:offline":i&&v(i.name).catch(e=>{console.warn("[Chat] Failed to fetch peers on event:",e.message)});break;case"channel:joined":case"channel:left":en()}}catch(e){console.warn("[Chat WS] Failed to parse message:",e.message)}},a.onclose=()=>{_.current=!1,ea.current&&(Z.current=setTimeout(e,3e3))},a.onerror=()=>{a.close()},G.current=a}(),()=>{Z.current&&clearTimeout(Z.current),G.current&&G.current.close()}},[C]),(0,t.useEffect)(()=>{L&&G.current&&_.current&&G.current.send(JSON.stringify({event:"register",data:{peerId:L}}))},[L]),(0,t.useEffect)(()=>{!0===C?en():R(N)},[C]),(0,t.useEffect)(()=>{z&&(!0===C?b(z.name).then(D).catch(e=>{D([]),es(e,"无法读取频道消息")}):D(k))},[z,C]),(0,t.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get("channel");if(e&&E.length>0){let a=E.find(a=>a.name===e);a&&z?.name!==a.name&&el(a)}},[E]),(0,t.useEffect)(()=>{if(!z&&E.length>0){let e=new URLSearchParams(window.location.search).get("channel");if(e){let a=E.find(a=>a.name===e);a&&el(a)}}},[z,E]);let eh=z?(0,a.jsx)("h2",{className:"header-title",children:z.name}):(0,a.jsx)("h2",{className:"header-title",children:"聊天"});return(0,a.jsxs)(u.default,{sidebar:({closeSidebar:e})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"sidebar-header",onClick:()=>window.location.href="/",style:{cursor:"pointer"},children:(0,a.jsx)("h1",{children:"MOST PEOPLE"})}),(0,a.jsx)("nav",{className:"sidebar-nav",children:0===E.length?(0,a.jsx)("div",{style:{padding:"40px 20px",textAlign:"center",color:"var(--text-muted)"},children:(0,a.jsx)("p",{children:"暂无频道"})}):E.map(t=>(0,a.jsxs)("div",{className:`sidebar-nav-btn ${z?.name===t.name?"active":""}`,onClick:()=>{el(t),e()},role:"button",tabIndex:0,onKeyDown:a=>{"Enter"===a.key&&(el(t),e())},children:[(0,a.jsx)(s.MessageSquare,{size:16}),(0,a.jsx)("span",{children:t.name}),(0,a.jsx)("button",{className:"leave-channel-btn",onClick:e=>{e.stopPropagation(),X(t),V.open()},title:"退出频道",children:(0,a.jsx)(l.X,{size:14})})]},t.name))}),(0,a.jsxs)("button",{className:"create-channel-btn",onClick:()=>O.open(),children:[(0,a.jsx)(i.Plus,{size:16}),"加入频道"]}),(0,a.jsx)(y.default,{})]}),headerTitle:eh,headerRight:(0,a.jsx)("button",{className:"btn btn-icon",onClick:()=>S(!e),title:"切换主题",children:e?(0,a.jsx)(r.Sun,{size:16}):(0,a.jsx)(c.Moon,{size:16})}),children:[!1===C&&(0,a.jsxs)("div",{className:"download-banner",children:[(0,a.jsx)("span",{children:"Web 端仅用于界面展示,下载桌面客户端获得完整功能"}),(0,a.jsxs)(w.default,{href:"/download",className:"download-banner-btn",children:[(0,a.jsx)(o.Download,{size:14}),"下载客户端",(0,a.jsx)(d.ArrowRight,{size:12})]})]}),z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"chat-messages",children:[0===U.length?(0,a.jsxs)("div",{className:"chat-messages-empty",children:[(0,a.jsx)("div",{className:"empty-icon",children:(0,a.jsx)(s.MessageSquare,{size:28})}),(0,a.jsx)("p",{children:"暂无消息,开始聊天吧!"})]}):U.map(e=>(0,a.jsxs)("div",{className:`chat-message ${e.author===$?.address?"self":"other"} ${e.pending?"pending":""}`,children:[(0,a.jsx)("img",{className:"msg-avatar",src:(0,f.generateAvatar)(e.author),alt:"avatar"}),(0,a.jsxs)("div",{className:"msg-content",children:[(0,a.jsx)("span",{className:"message-author",children:e.authorName||e.author?.slice(0,8)||"Unknown"}),(0,a.jsx)("div",{className:"message-bubble",children:e.content}),(0,a.jsx)("span",{className:"message-time",children:new Date(e.timestamp).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})})]})]},e.id||`${e.author}-${e.timestamp}`)),(0,a.jsx)("div",{ref:Q})]}),(0,a.jsxs)("div",{className:"chat-input-area",children:[(0,a.jsx)("input",{type:"text",className:"input input-pill",placeholder:$?"输入消息...":"请先登录后发言",value:I,disabled:!$,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"===e.key&&I.trim()&&eu()}}),(0,a.jsx)("button",{className:"send-btn",onClick:eu,disabled:!$||!I.trim(),children:(0,a.jsx)(n.Send,{size:18})})]})]}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"chat-welcome",children:[(0,a.jsx)("div",{className:"welcome-icon",children:(0,a.jsx)(s.MessageSquare,{size:36})}),(0,a.jsx)("h2",{children:"选择频道"}),(0,a.jsx)("p",{children:"从左侧边栏选择一个频道开始聊天,或创建一个新频道"})]})}),T&&(0,a.jsx)(h.InputModal,{title:"加入频道",placeholder:"频道名",confirmText:"加入",onConfirm:ed,onClose:()=>O.close(),isLoading:F,loadingText:"加入中..."}),K&&H&&(0,a.jsx)(m.ConfirmModal,{title:"退出频道",message:`确定要退出频道 "${H.name}" 吗?`,confirmText:B?"退出中...":"退出",onConfirm:()=>eo(H.name,void 0),onClose:()=>{V.close(),X(null)},danger:!0})]})}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[data-theme=dark]{--chat-bg-secondary:#1c1c1e99;--chat-bg-tertiary:#2c2c2e66;--chat-border:#ffffff14}.chat-messages{background:0 0;flex-direction:column;flex:1;gap:16px;padding:20px 24px;display:flex;overflow-y:auto}.chat-messages-empty{color:var(--text-muted);flex-direction:column;flex:1;justify-content:center;align-items:center;gap:12px;display:flex}.chat-messages-empty .empty-icon{border-radius:var(--radius-lg);background:var(--glass-bg-subtle);width:64px;height:64px;-webkit-backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);color:var(--text-muted);justify-content:center;align-items:center;display:flex}.chat-messages-empty p{font-size:14px}.chat-message{align-items:flex-start;gap:10px;max-width:70%;animation:.25s fadeIn;display:flex}.chat-message.self{flex-direction:row-reverse;align-self:flex-end}.chat-message.self .msg-content{align-items:flex-end}.chat-message.self .message-bubble{background:linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 75%, var(--info)));color:#fff;border:1px solid #ffffff1a;border-radius:18px 4px 18px 18px;box-shadow:0 4px 16px #5e6ad240}.chat-message.self .message-author{color:var(--accent)}.chat-message.self .message-time{color:var(--text-muted)}.chat-message.other{align-self:flex-start}.chat-message.other .msg-content{align-items:flex-start}.chat-message.other .message-bubble{background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow), var(--glass-shadow-inset);border-radius:4px 18px 18px}.chat-message .msg-avatar{flex-shrink:0}.chat-message .msg-content{flex-direction:column;gap:4px;max-width:100%;display:flex}.chat-message .message-author{color:var(--text-muted);font-size:11px;font-weight:500}.chat-message .message-bubble{word-break:break-word;padding:10px 14px;font-size:14px;line-height:1.5}.chat-message .message-time{color:var(--text-muted);opacity:.7;font-size:10px}.chat-message.pending .message-bubble{opacity:.6}.chat-input-area{border-top:1px solid var(--glass-border);background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-xl);gap:12px;padding:16px 24px;display:flex}.chat-input-area .send-btn{border:1px solid var(--glass-border);background:var(--accent);color:#fff;cursor:pointer;width:44px;height:44px;transition:all var(--transition-fast);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;display:flex}.chat-input-area .send-btn:hover:not(:disabled){background:var(--accent-hover);transform:scale(1.05);box-shadow:0 4px 16px #5e6ad24d}.chat-input-area .send-btn:disabled{opacity:.5;cursor:not-allowed}.chat-welcome{text-align:center;background:0 0;flex-direction:column;flex:1;justify-content:center;align-items:center;padding:40px;display:flex}.chat-welcome .welcome-icon{border-radius:var(--radius-xl);background:var(--glass-bg-heavy);width:80px;height:80px;-webkit-backdrop-filter:var(--blur-2xl);border:1px solid var(--glass-border);color:var(--accent);box-shadow:var(--glass-shadow-lg), var(--glass-shadow-inset);justify-content:center;align-items:center;margin-bottom:20px;display:flex}.chat-welcome h2{margin-bottom:8px;font-size:22px;font-weight:700}.chat-welcome p{color:var(--text-secondary);max-width:320px;font-size:14px;line-height:1.6}.create-channel-btn{border-radius:var(--radius-md);border:1.5px dashed var(--glass-border);background:var(--glass-bg-subtle);color:var(--text-secondary);cursor:pointer;transition:all var(--transition);justify-content:center;align-items:center;gap:6px;margin:8px;padding:10px;font-size:13px;font-weight:500;display:flex}.create-channel-btn:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}.peer-info{color:var(--text-secondary);align-items:center;gap:8px;font-size:11px;display:flex}.peer-info .peer-dot{background:var(--success);border-radius:50%;width:6px;height:6px}.peer-info .peer-id{font-family:var(--font-mono);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.leave-channel-btn{opacity:0;color:var(--text-muted);cursor:pointer;border-radius:var(--radius-sm);transition:all var(--transition-fast);background:0 0;border:none;justify-content:center;align-items:center;margin-left:auto;padding:4px;display:flex}.sidebar-nav-btn:hover .leave-channel-btn{opacity:1}.leave-channel-btn:hover{color:var(--danger);background:#ff3b301a}.chat-sidebar-overlay{display:none}@media (max-width:768px){.chat-sidebar{z-index:50;transition:left var(--transition);position:fixed;top:0;bottom:0;left:-240px}.chat-sidebar.open{left:0}.chat-sidebar-overlay{z-index:40;opacity:0;pointer-events:none;transition:opacity var(--transition);background:#0006;display:block;position:fixed;inset:0}.chat-sidebar-overlay.visible{opacity:1;pointer-events:auto}.chat-messages{padding:16px}.chat-message{max-width:85%}.chat-input-area{padding:12px 16px}.sidebar-nav-btn .leave-channel-btn{opacity:1}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.download-page{flex-direction:column;min-height:100dvh;display:flex}.download-hero{text-align:center;padding:64px 24px 48px}.download-hero-icon{border-radius:var(--radius-lg);background:var(--accent-soft);width:72px;height:72px;color:var(--accent);justify-content:center;align-items:center;margin-bottom:24px;display:inline-flex}.download-hero-title{letter-spacing:-.02px;background:linear-gradient(135deg, var(--text-primary), var(--accent));-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;margin-bottom:16px;font-size:40px;font-weight:700;line-height:1.1}.download-hero-desc{color:var(--text-secondary);max-width:48ch;margin:0 auto;font-size:16px;line-height:1.6}.download-platforms{padding:48px 24px}.download-section-title{text-align:center;color:var(--text-primary);margin-bottom:32px;font-size:24px;font-weight:600}.download-platform-grid{grid-template-columns:repeat(3,1fr);gap:20px;display:grid}.download-platform-card{text-align:center;background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);border-radius:var(--radius-lg);color:var(--text-primary);transition:all var(--transition);flex-direction:column;align-items:center;padding:32px 24px;text-decoration:none;display:flex}.download-platform-card:hover{background:var(--glass-bg-heavy);box-shadow:var(--glass-shadow);border-color:var(--accent);transform:translateY(-2px)}.download-platform-icon{color:var(--accent);margin-bottom:16px}.download-platform-card h3{margin-bottom:8px;font-size:18px;font-weight:600}.download-platform-card p{color:var(--text-secondary);margin-bottom:20px;font-size:13px}.download-platform-btn{background:var(--accent);color:#fff;border-radius:var(--radius-md);transition:all var(--transition-fast);align-items:center;gap:8px;padding:10px 20px;font-size:14px;font-weight:500;display:inline-flex}.download-platform-card:hover .download-platform-btn{background:var(--accent-hover)}.download-comparison{background:var(--glass-bg-subtle);border-top:1px solid var(--glass-border);border-bottom:1px solid var(--glass-border);padding:48px 24px}.download-table-wrap{overflow-x:auto}.download-table{border-collapse:collapse;width:100%;max-width:600px;margin:0 auto}.download-table th,.download-table td{text-align:left;border-bottom:1px solid var(--glass-border);padding:14px 20px}.download-table th{color:var(--text-primary);font-size:14px;font-weight:600}.download-table td{color:var(--text-secondary);font-size:14px}.download-table td.col-web{color:var(--warning)}.download-table td.col-desktop{color:var(--success);font-weight:500}.download-cta{text-align:center;padding:64px 24px}.download-cta-desc{color:var(--text-secondary);margin-bottom:24px;font-size:16px;line-height:1.6}@media (max-width:768px){.download-hero-title{font-size:32px}.download-platform-grid{grid-template-columns:1fr;gap:16px}.download-platform-card{text-align:left;flex-direction:row;gap:16px;padding:20px}.download-platform-icon{flex-shrink:0;margin-bottom:0}.download-platform-card p{margin-bottom:12px}.download-platform-btn{margin-top:auto}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,35965,e=>{"use strict";let t=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,t],35965)},96699,e=>{"use strict";let t=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,t],96699)},93583,e=>{"use strict";let t=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.s(["Menu",0,t],93583)},40983,e=>{"use strict";var t=e.i(18050),n=e.i(71645),i=e.i(22016),r=e.i(35965),a=e.i(96699),l=e.i(93583);function s({size:e=24}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.4"}),(0,t.jsx)("rect",{x:"14",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)"})]})}let o=[{href:"/docs/getting-started/",label:"文档"},{href:"/changelog/",label:"更新日志"}];function c(){let[e,c]=(0,n.useState)(!1),[u,f]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;("dark"===e||!e&&t)&&f(!0)},[]),(0,n.useEffect)(()=>{document.documentElement.setAttribute("data-theme",u?"dark":"light"),localStorage.setItem("theme",u?"dark":"light")},[u]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("nav",{className:"mkt-nav",children:(0,t.jsxs)("div",{className:"mkt-nav-inner",children:[(0,t.jsxs)(i.default,{href:"/",className:"mkt-nav-logo",children:[(0,t.jsx)(s,{}),"MOST PEOPLE"]}),(0,t.jsxs)("div",{className:`mkt-nav-links ${e?"open":""}`,children:[o.map(e=>(0,t.jsx)(i.default,{href:e.href,onClick:()=>c(!1),children:e.label},e.href)),(0,t.jsxs)("button",{className:"mkt-theme-toggle mkt-mobile-only",onClick:()=>{f(!u),c(!1)},"aria-label":"切换主题",children:[u?(0,t.jsx)(r.Sun,{size:16}):(0,t.jsx)(a.Moon,{size:16}),u?" 亮色模式":" 暗色模式"]})]}),(0,t.jsxs)("div",{className:"mkt-nav-cta",children:[(0,t.jsx)("button",{className:"mkt-theme-toggle mkt-desktop-only",onClick:()=>f(!u),"aria-label":"切换主题",children:u?(0,t.jsx)(r.Sun,{size:16}):(0,t.jsx)(a.Moon,{size:16})}),(0,t.jsx)(i.default,{href:"/app/",className:"btn btn-primary",children:"开始使用"}),(0,t.jsx)("button",{className:"btn btn-icon sidebar-toggle-btn mkt-mobile-only",onClick:()=>c(!e),"aria-label":"菜单",children:(0,t.jsx)(l.Menu,{size:16})})]})]})})})}let u=[{href:"/",label:"关于"},{href:"/docs/getting-started/",label:"文档"},{href:"/changelog/",label:"更新日志"},{href:"/ping/",label:"网络"},{href:"https://github.com/most-people/most",label:"GitHub",external:!0}];function f(){return(0,t.jsx)("footer",{className:"mkt-footer",children:(0,t.jsx)("div",{className:"mkt-container",children:(0,t.jsxs)("div",{className:"mkt-footer-inner",children:[(0,t.jsx)("div",{className:"mkt-footer-links",children:u.map(e=>(0,t.jsx)(i.default,{href:e.href,...e.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e.label},e.href))}),(0,t.jsxs)("span",{className:"mkt-footer-copy",children:["© ",new Date().getFullYear()," MOST PEOPLE · MIT License"]})]})})})}e.s(["MarketingLayout",0,function({children:e}){return(0,t.jsxs)("div",{className:"mkt-layout",children:[(0,t.jsx)(c,{}),(0,t.jsx)("main",{className:"mkt-layout-main",children:e}),(0,t.jsx)(f,{})]})}],40983)},31214,e=>{"use strict";let t=(0,e.i(56420).default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);e.s(["Cloud",0,t],31214)},66627,e=>{"use strict";let t=(0,e.i(56420).default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);e.s(["Wifi",0,t],66627)},66595,e=>{"use strict";let t=(0,e.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],66595)},51921,e=>{"use strict";let t=(0,e.i(56420).default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,t],51921)},68590,e=>{"use strict";let t=(0,e.i(56420).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],68590)},30274,e=>{"use strict";let t=(0,e.i(56420).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,t],30274)},23449,e=>{"use strict";let t;var n,i=e.i(18050),r=e.i(71645);let a=Object.freeze({left:0,top:0,width:16,height:16}),l=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),s=Object.freeze({...a,...l}),o=Object.freeze({...s,body:"",hidden:!1});function c(e,t){let n,i,r=(n={},!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0),(i=((e.rotate||0)+(t.rotate||0))%4)&&(n.rotate=i),n);for(let n in o)n in l?n in e&&!(n in r)&&(r[n]=l[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function u(e,t){let n,i,r,a=[];if("object"!=typeof e||"object"!=typeof e.icons)return a;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),a.push(e)});let l=(n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null),Object.keys(n).concat(Object.keys(i)).forEach(function e(t){if(n[t])return r[t]=[];if(!(t in r)){r[t]=null;let n=i[t]&&i[t].parent,a=n&&e(n);a&&(r[t]=[n].concat(a))}return r[t]}),r);for(let n in l){let i=l[n];i&&(t(n,function(e,t,n){let i=e.icons,r=e.aliases||Object.create(null),a={};function l(e){a=c(i[e]||r[e],a)}return l(t),n.forEach(l),c(e,a)}(e,n,i)),a.push(n))}return a}let f={provider:"",aliases:{},not_found:{},...a};function d(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function h(e){if("object"!=typeof e||null===e||"string"!=typeof e.prefix||!e.icons||"object"!=typeof e.icons||!d(e,f))return null;let t=e.icons;for(let e in t){let n=t[e];if(!e||"string"!=typeof n.body||!d(n,o))return null}let n=e.aliases||Object.create(null);for(let e in n){let i=n[e],r=i.parent;if(!e||"string"!=typeof r||!t[r]&&!n[r]||!d(i,o))return null}return e}let p=Object.create(null);function g(e,t){let n=p[e]||(p[e]=Object.create(null));return n[t]||(n[t]={provider:e,prefix:t,icons:Object.create(null),missing:new Set})}function m(e,t){return h(t)?u(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}let y=/^[a-z0-9]+(-[a-z0-9]+)*$/,b=(e,t,n,i="")=>{let r=e.split(":");if("@"===e.slice(0,1)){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){let e=r.pop(),n=r.pop(),a={provider:r.length>0?r[0]:i,prefix:n,name:e};return t&&!x(a)?null:a}let a=r[0],l=a.split("-");if(l.length>1){let e={provider:i,prefix:l.shift(),name:l.join("-")};return t&&!x(e)?null:e}if(n&&""===i){let e={provider:i,prefix:"",name:a};return t&&!x(e,n)?null:e}return null},x=(e,t)=>!!e&&!!((t&&""===e.prefix||e.prefix)&&e.name),k=!1;function v(e){return"boolean"==typeof e&&(k=e),k}function j(e){let t="string"==typeof e?b(e,!0,k):e;if(t){let e=g(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}let w=Object.freeze({width:null,height:null}),M=Object.freeze({...w,...l}),N=/(-?[0-9.]*[0-9]+[0-9.]*)/g,z=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function E(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;let i=e.split(N);if(null===i||!i.length)return e;let r=[],a=i.shift(),l=z.test(a);for(;;){if(l){let e=parseFloat(a);isNaN(e)?r.push(a):r.push(Math.ceil(e*t*n)/n)}else r.push(a);if(void 0===(a=i.shift()))return r.join("");l=!l}}let S=/\sid="(\S+)"/g,T="IconifyId"+Date.now().toString(16)+(0x1000000*Math.random()|0).toString(16),O=0,C=Object.create(null);function F(e){return C[e]||C[""]}function A(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(!((t=e.resources)instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}let I=Object.create(null),L=["https://api.simplesvg.com","https://api.unisvg.com"],P=[];for(;L.length>0;)1===L.length||Math.random()>.5?P.push(L.shift()):P.push(L.pop());I[""]=A({resources:["https://api.iconify.design"].concat(P)});let $=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();function H(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}let R=0,q={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _(e){let t={...q,...e},n=[];function i(){n=n.filter(e=>"pending"===e().status)}return{query:function(e,r,a){let l=function(e,t,n,i){let r,a,l=e.resources.length,s=e.random?Math.floor(Math.random()*l):e.index;if(e.random){let t=e.resources.slice(0);for(r=[];t.length>1;){let e=Math.floor(Math.random()*t.length);r.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}r=r.concat(t)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));let o=Date.now(),c="pending",u=0,f=null,d=[],h=[];function p(){f&&(clearTimeout(f),f=null)}function g(){"pending"===c&&(c="aborted"),p(),d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function m(e,t){t&&(h=[]),"function"==typeof e&&h.push(e)}function y(){c="failed",h.forEach(e=>{e(void 0,a)})}function b(){d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}return"function"==typeof i&&h.push(i),setTimeout(function i(){if("pending"!==c)return;p();let l=r.shift();if(void 0===l){if(d.length){f=setTimeout(()=>{p(),"pending"===c&&(b(),y())},e.timeout);return}y();return}let s={status:"pending",resource:l,callback:(t,n)=>{!function(t,n,l){let s="success"!==n;switch(d=d.filter(e=>e!==t),c){case"pending":break;case"failed":if(s||!e.dataAfterTimeout)return;break;default:return}if("abort"===n){a=l,y();return}if(s){a=l,d.length||(r.length?i():y());return}if(p(),b(),!e.random){let n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}c="completed",h.forEach(e=>{e(l)})}(s,t,n)}};d.push(s),u++,f=setTimeout(i,e.rotate),n(l,t,s.callback)}),function(){return{startTime:o,payload:t,status:c,queriesSent:u,queriesPending:d.length,subscribe:m,abort:g}}}(t,e,r,(e,t)=>{i(),a&&a(e,t)});return n.push(l),l},find:function(e){return n.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:i}}let V=Object.create(null);function D(){}function U(e,t,n){function i(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&"object"==typeof n)try{if(!m(e,n).length)return void i()}catch(e){console.error(e)}i(),e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,i=e.provider,r=e.prefix;t.forEach(t=>{let a=t.icons,l=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==r)return!0;let l=t.name;if(e.icons[l])a.loaded.push({provider:i,prefix:r,name:l});else{if(!e.missing.has(l))return n=!0,!0;a.missing.push({provider:i,prefix:r,name:l})}return!1}),a.pending.length!==l&&(n||H([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}))}function B(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}let G=/[\s,]+/,W={...M,inline:!1},Q={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},J={display:"inline-block"},K={backgroundColor:"currentColor"},X={backgroundColor:"transparent"},Y={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Z={WebkitMask:K,mask:K,background:X};for(let e in Z){let t=Z[e];for(let n in Y)t[e+n]=Y[n]}let ee={...W,inline:!0};function et(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}if(v(!0),n={prepare:(e,t,n)=>{let i=[],r=function(e,t){let n,i=I[e];if(!i)return 0;if(i.maxURL){let e=0;i.resources.forEach(t=>{e=Math.max(e,t.length)}),n=i.maxURL-e-i.path.length-(t+".json?icons=").length}else n=0;return n}(e,t),a="icons",l={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,o)=>{(s+=n.length+1)>=r&&o>0&&(i.push(l),l={type:a,provider:e,prefix:t,icons:[]},s=n.length),l.icons.push(n)}),i.push(l),i},send:(e,t,n)=>{if(!$)return void n("abort",424);let i=function(e){if("string"==typeof e){let t=I[e];if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":i+=t.prefix+".json?"+new URLSearchParams({icons:t.icons.join(",")}).toString();break;case"custom":{let e=t.uri;i+="/"===e.slice(0,1)?e.slice(1):e;break}default:n("abort",400);return}let r=503;$(e+i).then(e=>{let t=e.status;return 200!==t?void setTimeout(()=>{n(404===t?"abort":"next",t)}):(r=501,e.json())}).then(e=>{"object"!=typeof e||null===e?setTimeout(()=>{404===e?n("abort",e):n("next",r)}):setTimeout(()=>{n("success",e)})}).catch(()=>{n("next",r)})}},C[""]=n,"u">typeof document&&"u">typeof window){let e=window;if(void 0!==e.IconifyPreload){let t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),k&&!t&&!e.prefix){let t=!1;return h(e)&&(e.prefix="",u(e,(e,n)=>{(function(e,t){let n=b(e,!0,k);if(!n)return!1;let i=g(n.provider,n.prefix);if(!t)return i.missing.add(n.name),!0;var r=n.name;try{if("string"==typeof t.body)return i.icons[r]={...t},!0}catch(e){}return!1})(e,n)&&(t=!0)})),t}let n=e.prefix;return!!x({prefix:n,name:"a"})&&!!m(g(t,n),e)}(e))&&console.error(n)}catch(e){console.error(n)}})}if(void 0!==e.IconifyProviders){let t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){let n="IconifyProviders["+e+"] is invalid.";try{let i=t[e];if("object"!=typeof i||!i||void 0===i.resources)continue;!function(e,t){let n=A(t);return null!==n&&(I[e]=n,!0)}(e,i)&&console.error(n)}catch(e){console.error(n)}}}}function en(e){let[n,i]=(0,r.useState)(!!e.ssr),[a,l]=(0,r.useState)({}),[o,c]=(0,r.useState)(function(t){if(t){let t=e.icon;if("object"==typeof t)return{name:"",data:t};let n=j(t);if(n)return{name:t,data:n}}return{name:""}}(!!e.ssr));function u(){let e=a.callback;e&&(e(),l({}))}function f(e){if(JSON.stringify(o)!==JSON.stringify(e))return u(),c(e),!0}(0,r.useEffect)(()=>(i(!0),u),[]),(0,r.useEffect)(()=>{n&&function t(){var n;let i=e.icon;if("object"==typeof i)return void f({name:"",data:i});let r=j(i);f({name:i,data:r})&&(void 0===r?l({callback:((e,t)=>{var n;let i,r,a,l,s,o=(n=function(e,t=!0,n=!1){let i=[];return e.forEach(e=>{let r="string"==typeof e?b(e,t,n):e;r&&i.push(r)}),i}(e,!0,v()),a={loaded:[],missing:[],pending:[]},l=Object.create(null),n.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name)),s={provider:"",prefix:"",name:""},n.forEach(e=>{if(s.name===e.name&&s.prefix===e.prefix&&s.provider===e.provider)return;s=e;let t=e.provider,n=e.prefix,i=e.name,r=l[t]||(l[t]=Object.create(null)),o=r[n]||(r[n]=g(t,n));(i in o.icons?a.loaded:""===n||o.missing.has(i)?a.missing:a.pending).push({provider:t,prefix:n,name:i})}),a);if(!o.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(o.loaded,o.missing,o.pending,D)}),()=>{e=!1}}let c=Object.create(null),u=[];return o.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===r&&t===i)return;i=t,r=n,u.push(g(t,n));let a=c[t]||(c[t]=Object.create(null));a[n]||(a[n]=[])}),o.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,r=g(t,n),a=r.pendingIcons||(r.pendingIcons=new Set);a.has(i)||(a.add(i),c[t][n].push(i))}),u.forEach(e=>{let t=c[e.provider][e.prefix];t.length&&(e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{let t,n;e.iconsQueueFlag=!1;let{provider:i,prefix:r}=e,a=e.iconsToLoad;if(delete e.iconsToLoad,!a||!a.length)return;let l=e.loadIcon;if(e.loadIcons&&(a.length>1||!l))return void B(e.loadIcons(a,r,i),t=>{U(e,a,t)});if(l)return void a.forEach(t=>{B(l(t,r,i),n=>{let i=n?{prefix:r,icons:{[t]:n}}:null;U(e,[t],i)})});let{valid:s,invalid:o}=(t=[],n=[],a.forEach(e=>{(e.match(y)?t:n).push(e)}),{valid:t,invalid:n});if(o.length&&U(e,o,null),!s.length)return;let c=r.match(y)?F(i):null;c?c.prepare(i,r,s).forEach(t=>{!function(e,t,n){let i,r;if("string"==typeof e){let t=F(e);if(!t)return n(void 0,424);r=t.send;let a=function(e){if(!V[e]){let t=I[e];if(!t)return;let n=_(t);V[e]={config:t,redundancy:n}}return V[e]}(e);a&&(i=a.redundancy)}else{let t=A(e);if(t){i=_(t);let n=F(e.resources?e.resources[0]:"");n&&(r=n.send)}}i&&r?i.query(t,r,n)().abort:n(void 0,424)}(i,t,n=>{U(e,t.icons,n)})}):U(e,s,null)})))}),t?function(e,t,n){let i=R++,r=H.bind(null,n,i);if(!t.pending.length)return r;let a={id:i,icons:t,callback:e,abort:r};return n.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(a)}),r}(t,o,u):D})([i],t)}):r&&(null==(n=e.onLoad)||n.call(e,i)))}()},[e.icon,n]);let{name:d,data:h}=o;return h?((e,n,i)=>{var a;let l,o,c,u,f,d,h,p,g,m,y,x,k,v=n.inline?ee:W,j=function(e,t){let n={...e};for(let e in t){let i=t[e],r=typeof i;e in w?(null===i||i&&("string"===r||"number"===r))&&(n[e]=i):r===typeof n[e]&&(n[e]="rotate"===e?i%4:i)}return n}(v,n),N=n.mode||"svg",z={},C=n.style||{},F={..."svg"===N?Q:{}};if(i){let e=b(i,!1,!0);if(e){let t=["iconify"];for(let n of["provider","prefix"])e[n]&&t.push("iconify--"+e[n]);F.className=t.join(" ")}}for(let e in n){let t=n[e];if(void 0!==t)switch(e){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":F.ref=t;break;case"className":F[e]=(F[e]?F[e]+" ":"")+t;break;case"inline":case"hFlip":case"vFlip":j[e]=!0===t||"true"===t||1===t;break;case"flip":"string"==typeof t&&function(e,t){t.split(G).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}(j,t);break;case"color":z.color=t;break;case"rotate":"string"==typeof t?j[e]=function(e,t=0){let n=e.replace(/^-?[0-9.]*/,"");function i(e){for(;e<0;)e+=4;return e%4}if(""===n){let t=parseInt(e);return isNaN(t)?0:i(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let r=parseFloat(e.slice(0,e.length-n.length));return isNaN(r)?0:(r/=t)%1==0?i(r):0}}return t}(t):"number"==typeof t&&(j[e]=t);break;case"ariaHidden":case"aria-hidden":!0!==t&&"true"!==t&&delete F["aria-hidden"];break;default:void 0===v[e]&&(F[e]=t)}}let A=(c={...s,...e},u={...M,...j},f={left:c.left,top:c.top,width:c.width,height:c.height},d=c.body,[c,u].forEach(e=>{var t,n,i,r;let a,l,s=[],o=e.hFlip,c=e.vFlip,u=e.rotate;switch(o?c?u+=2:(s.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),s.push("scale(-1 1)"),f.top=f.left=0):c&&(s.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),s.push("scale(1 -1)"),f.top=f.left=0),u<0&&(u-=4*Math.floor(u/4)),u%=4){case 1:s.unshift("rotate(90 "+(a=f.height/2+f.top).toString()+" "+a.toString()+")");break;case 2:s.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:s.unshift("rotate(-90 "+(a=f.width/2+f.left).toString()+" "+a.toString()+")")}u%2==1&&(f.left!==f.top&&(a=f.left,f.left=f.top,f.top=a),f.width!==f.height&&(a=f.width,f.width=f.height,f.height=a)),s.length&&(t=d,n='<g transform="'+s.join(" ")+'">',i=(l=function(e,t="defs"){let n="",i=e.indexOf("<"+t);for(;i>=0;){let r=e.indexOf(">",i),a=e.indexOf("</"+t);if(-1===r||-1===a)break;let l=e.indexOf(">",a);if(-1===l)break;n+=e.slice(r+1,a).trim(),e=e.slice(0,i).trim()+e.slice(l+1)}return{defs:n,content:e}}(t)).defs,r=n+l.content+"</g>",d=i?"<defs>"+i+"</defs>"+r:r)}),h=u.width,p=u.height,g=f.width,m=f.height,null===h?l=E(o=null===p?"1em":"auto"===p?m:p,g/m):(l="auto"===h?g:h,o=null===p?E(l,m/g):"auto"===p?m:p),y={},(x=(e,t)=>{"unset"!==t&&"undefined"!==t&&"none"!==t&&(y[e]=t.toString())})("width",l),x("height",o),y.viewBox=(k=[f.left,f.top,g,m]).join(" "),{attributes:y,viewBox:k,body:d}),I=A.attributes;if(j.inline&&(z.verticalAlign="-0.125em"),"svg"===N){F.style={...z,...C},Object.assign(F,I);let e=0,i=n.id;return"string"==typeof i&&(i=i.replace(/-/g,"_")),F.dangerouslySetInnerHTML={__html:(a=function(e,t=T){let n,i=[];for(;n=S.exec(e);)i.push(n[1]);if(!i.length)return e;let r="suffix"+(0x1000000*Math.random()|Date.now()).toString(16);return i.forEach(n=>{let i="function"==typeof t?t(n):t+(O++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+i+r+"$3")}),e=e.replace(RegExp(r,"g"),"")}(A.body,i?()=>i+"ID"+e++:"iconifyReact"),void 0===t&&function(){try{t=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){t=null}}(),t?t.createHTML(a):a)},(0,r.createElement)("svg",F)}let{body:L,width:P,height:$}=e,H="mask"===N||"bg"!==N&&-1!==L.indexOf("currentColor"),R=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let e in t)n+=" "+e+'="'+t[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}(L,{...I,width:P+"",height:$+""});return F.style={...z,"--svg":'url("data:image/svg+xml,'+R.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")+'")',width:et(I.width),height:et(I.height),...J,...H?K:X,...C},(0,r.createElement)("span",F)})({...s,...h},e,d):e.children?e.children:e.fallback?e.fallback:(0,r.createElement)("span",{})}let ei=(0,r.forwardRef)((e,t)=>en({...e,_ref:t}));(0,r.forwardRef)((e,t)=>en({inline:!0,...e,_ref:t}));var er=e.i(66595),ea=e.i(31214),el=e.i(56420);let es=(0,el.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),eo=(0,el.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),ec=(0,el.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),eu=(0,el.default)("at-sign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),ef=(0,el.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var ed=e.i(68590);let eh=(0,el.default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),ep=(0,el.default)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);var eg=e.i(30274);let em=(0,el.default)("messages-square",[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]);var ey=e.i(51921);let eb=(0,el.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),ex=(0,el.default)("triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]),ek=(0,el.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var ev=e.i(66627);let ej=[{name:"Google",host:"google.com",icon:"simple-icons:google",fallback:(0,i.jsx)(er.Search,{size:20})},{name:"Cloudflare",host:"cloudflare.com",icon:"simple-icons:cloudflare",fallback:(0,i.jsx)(ea.Cloud,{size:20})},{name:"YouTube",host:"youtube.com",icon:"simple-icons:youtube",fallback:(0,i.jsx)(es,{size:20})},{name:"GitHub",host:"github.com",icon:"simple-icons:github",fallback:(0,i.jsx)(eo,{size:20})},{name:"ChatGPT",host:"chatgpt.com",icon:"simple-icons:openai",fallback:(0,i.jsx)(ec,{size:20})},{name:"X",host:"x.com",icon:"simple-icons:x",fallback:(0,i.jsx)(eu,{size:20})},{name:"Instagram",host:"instagram.com",icon:"simple-icons:instagram",fallback:(0,i.jsx)(ef,{size:20})},{name:"Reddit",host:"reddit.com",icon:"simple-icons:reddit",fallback:(0,i.jsx)(ed.MessageSquare,{size:20})},{name:"Wikipedia",host:"wikipedia.org",icon:"simple-icons:wikipedia",fallback:(0,i.jsx)(eh,{size:20})},{name:"Apple",host:"apple.com",icon:"simple-icons:apple",fallback:(0,i.jsx)(ep,{size:20})},{name:"Telegram",host:"telegram.org",icon:"simple-icons:telegram",fallback:(0,i.jsx)(eg.Send,{size:20})},{name:"Discord",host:"discord.com",icon:"simple-icons:discord",fallback:(0,i.jsx)(em,{size:20})},{name:"TikTok",host:"tiktok.com",icon:"simple-icons:tiktok",fallback:(0,i.jsx)(ey.Music,{size:20})},{name:"npm",host:"npmjs.com",icon:"simple-icons:npm",fallback:(0,i.jsx)(eb,{size:20})},{name:"Vercel",host:"vercel.com",icon:"simple-icons:vercel",fallback:(0,i.jsx)(ex,{size:20})}];function ew({icon:e,fallback:t}){let[n,a]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=new Image;t.onload=()=>a(!0),t.onerror=()=>a(!1),t.src=`https://api.iconify.design/${e.replace(":","/")}.svg`},[e]),(0,i.jsxs)("span",{className:"brand-icon-wrap",children:[(0,i.jsx)("span",{className:`brand-icon-fallback ${n?"hidden":""}`,children:t}),(0,i.jsx)("span",{className:`brand-icon-real ${n?"visible":""}`,children:(0,i.jsx)(ei,{icon:e,width:20,height:20})})]})}function eM(){let[e,t]=(0,r.useState)(new Map),[n,a]=(0,r.useState)(!1),l=(0,r.useRef)(new Map),s=(0,r.useCallback)(e=>{t(t=>{let n=new Map(t);return n.set(e,{status:"pending",latency:0}),n});let n=new AbortController;l.current.set(e,n);let i=performance.now(),r=(n,i)=>{t(t=>{let r=new Map(t);return r.set(e,{status:n,latency:i}),r})},a=setTimeout(()=>{n.abort()},5e3);fetch(`https://${e}/`,{method:"HEAD",mode:"no-cors",cache:"no-store",signal:n.signal}).then(()=>{clearTimeout(a),r("ok",Math.round(performance.now()-i))}).catch(()=>{clearTimeout(a),r("timeout",0)})},[]),o=(0,r.useCallback)(()=>{a(!0);let e=new Map;ej.forEach(t=>{e.set(t.host,{status:"pending",latency:0})}),t(e);let n=new Set(ej.map(e=>e.host));ej.forEach(e=>{let i=new AbortController;l.current.set(e.host,i);let r=performance.now(),s=(i,r)=>{n.has(e.host)&&(n.delete(e.host),t(t=>{let n=new Map(t);return n.set(e.host,{status:i,latency:r}),n}),0===n.size&&a(!1))},o=setTimeout(()=>{i.abort()},5e3);fetch(`https://${e.host}/`,{method:"HEAD",mode:"no-cors",cache:"no-store",signal:i.signal}).then(()=>{clearTimeout(o),s("ok",Math.round(performance.now()-r))}).catch(()=>{clearTimeout(o),s("timeout",0)})})},[]);return(0,r.useEffect)(()=>(o(),()=>{l.current.forEach(e=>e.abort()),l.current.clear()}),[o]),(0,i.jsxs)("div",{className:"ping-page",children:[(0,i.jsxs)("div",{className:"ping-header",children:[(0,i.jsxs)("div",{className:"ping-title-wrap",children:[(0,i.jsx)(ev.Wifi,{size:28,className:"ping-title-icon"}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{className:"ping-title",children:"网络连通性"}),(0,i.jsx)("p",{className:"ping-subtitle",children:"通过向对应网站发送请求进行测试,延迟值仅供参考。"})]})]}),(0,i.jsx)("button",{className:"btn btn-icon",onClick:o,disabled:n,"aria-label":"重新测试全部",title:"重新测试全部",children:(0,i.jsx)(ek,{size:18,className:n?"ping-spin":""})})]}),(0,i.jsx)("div",{className:"ping-grid",children:ej.map(t=>{let n=e.get(t.host),r=!n||"pending"===n.status,a=n?.status==="timeout";return(0,i.jsxs)("div",{className:`ping-card ${r?"pending":""}`,children:[(0,i.jsxs)("div",{className:"ping-card-top",children:[(0,i.jsx)("span",{className:"ping-card-icon",children:(0,i.jsx)(ew,{icon:t.icon,fallback:t.fallback})}),(0,i.jsx)("a",{href:`https://${t.host}`,target:"_blank",rel:"noreferrer",className:"ping-card-name",children:t.name}),(0,i.jsx)("button",{className:"ping-card-refresh",onClick:()=>s(t.host),disabled:r,"aria-label":`重新测试 ${t.name}`,title:"重新测试",children:(0,i.jsx)(ek,{size:13,className:r?"ping-spin":""})})]}),(0,i.jsxs)("div",{className:"ping-card-bottom",children:[r?(0,i.jsx)("span",{className:"ping-pulse-dot"}):(0,i.jsx)("span",{className:"ping-status-label",style:{color:a?"var(--danger)":"var(--success)"},children:a?"不可用":"可用"}),(0,i.jsx)("span",{className:"ping-latency",style:r?{color:"var(--text-muted)"}:{color:a?"var(--danger)":"var(--success)"},children:r?"--":a?"超时":`${n.latency} ms`})]})]},t.host)})})]})}var eN=e.i(40983);e.s(["default",0,function(){return(0,i.jsx)(eN.MarketingLayout,{children:(0,i.jsx)(eM,{})})}],23449)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,35965,e=>{"use strict";let t=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,t],35965)},96699,e=>{"use strict";let t=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,t],96699)},93583,e=>{"use strict";let t=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.s(["Menu",0,t],93583)},40983,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(22016),i=e.i(35965),r=e.i(96699),l=e.i(93583);function n({size:e=24}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.4"}),(0,t.jsx)("rect",{x:"14",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)"})]})}let o=[{href:"/docs/getting-started/",label:"文档"},{href:"/changelog/",label:"更新日志"}];function c(){let[e,c]=(0,a.useState)(!1),[d,h]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;("dark"===e||!e&&t)&&h(!0)},[]),(0,a.useEffect)(()=>{document.documentElement.setAttribute("data-theme",d?"dark":"light"),localStorage.setItem("theme",d?"dark":"light")},[d]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("nav",{className:"mkt-nav",children:(0,t.jsxs)("div",{className:"mkt-nav-inner",children:[(0,t.jsxs)(s.default,{href:"/",className:"mkt-nav-logo",children:[(0,t.jsx)(n,{}),"MOST PEOPLE"]}),(0,t.jsxs)("div",{className:`mkt-nav-links ${e?"open":""}`,children:[o.map(e=>(0,t.jsx)(s.default,{href:e.href,onClick:()=>c(!1),children:e.label},e.href)),(0,t.jsxs)("button",{className:"mkt-theme-toggle mkt-mobile-only",onClick:()=>{h(!d),c(!1)},"aria-label":"切换主题",children:[d?(0,t.jsx)(i.Sun,{size:16}):(0,t.jsx)(r.Moon,{size:16}),d?" 亮色模式":" 暗色模式"]})]}),(0,t.jsxs)("div",{className:"mkt-nav-cta",children:[(0,t.jsx)("button",{className:"mkt-theme-toggle mkt-desktop-only",onClick:()=>h(!d),"aria-label":"切换主题",children:d?(0,t.jsx)(i.Sun,{size:16}):(0,t.jsx)(r.Moon,{size:16})}),(0,t.jsx)(s.default,{href:"/app/",className:"btn btn-primary",children:"开始使用"}),(0,t.jsx)("button",{className:"btn btn-icon sidebar-toggle-btn mkt-mobile-only",onClick:()=>c(!e),"aria-label":"菜单",children:(0,t.jsx)(l.Menu,{size:16})})]})]})})})}let d=[{href:"/",label:"关于"},{href:"/docs/getting-started/",label:"文档"},{href:"/changelog/",label:"更新日志"},{href:"/ping/",label:"网络"},{href:"https://github.com/most-people/most",label:"GitHub",external:!0}];function h(){return(0,t.jsx)("footer",{className:"mkt-footer",children:(0,t.jsx)("div",{className:"mkt-container",children:(0,t.jsxs)("div",{className:"mkt-footer-inner",children:[(0,t.jsx)("div",{className:"mkt-footer-links",children:d.map(e=>(0,t.jsx)(s.default,{href:e.href,...e.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e.label},e.href))}),(0,t.jsxs)("span",{className:"mkt-footer-copy",children:["© ",new Date().getFullYear()," MOST PEOPLE · MIT License"]})]})})})}e.s(["MarketingLayout",0,function({children:e}){return(0,t.jsxs)("div",{className:"mkt-layout",children:[(0,t.jsx)(c,{}),(0,t.jsx)("main",{className:"mkt-layout-main",children:e}),(0,t.jsx)(h,{})]})}],40983)},58734,e=>{"use strict";var t=e.i(18050),a=e.i(22016);let s=[{version:"0.0.6",date:"2026-04-30",categories:{新增:["桌面客户端下载页 (/download)","Web 端 Mock 数据展示(文件管理器、聊天)"],重构:["Web 端与桌面端职责分离:Web 端仅用于功能展示,完整功能引导至桌面客户端","移除后端连接引导面板 (BackendGuidePanel),改为下载引导","移除 PWA 支持 (PwaInstallPrompt、manifest.json)","SettingsDrawer 改为关于页面,展示下载入口","文档页 (docs/getting-started) 更新为桌面客户端下载引导","功能门户 (FeaturePortal) 步骤更新为下载客户端引导","移除远程访问配置和后端地址设置 UI"]}},{version:"0.0.5",date:"2026-04-21",categories:{新增:["全界面 Apple Liquid Glass 设计重构","暗色模式更新为 Linear 风格,移除 Tailwind CSS","全局应用状态管理 (AppProvider) 与设置抽屉 (SettingsDrawer)","支持自定义后端 URL 及连接状态检测","智能首页:通过 API 检测自动切换应用/营销模式","路由重构:首页 → /,应用 → /app,官网合并到主项目","用户身份系统:头像、显示名、P2P 身份绑定","聊天频道新增头像显示和 UI 优化","PWA 安装提示(全局状态 + 路由感知)","网络连接测试页"],修复:["统一 ModalOverlay 玻璃弹窗容器,防止遮罩重叠和宽度溢出","增加弹窗遮罩和玻璃透明度,减少内容重叠","WebSocket 广播失效与频道订阅空处理器","加强安全、清理代码、完善测试覆盖","补充 TypeScript 类型定义,修复构建类型错误","API 路径规范化,移除重复 /api/peer-id 端点","添加 API 输入验证"],重构:["前后端解耦:后端移至 server/,使用 Hono 框架","通用组件样式统一,消除页面级 CSS 重复","使用 AppShell 统一应用布局,合并 Web3 页面","跨路由样式按需加载"]}},{version:"0.0.4",date:"2026-04-13",categories:{新增:["远程访问支持:服务器默认监听 0.0.0.0,支持局域网直接访问","设置页新增网络地址展示(本机/局域网/Tailscale/ZeroTier)","设置页新增折叠式远程访问指引","CORS 改为动态反射 Origin 头,支持跨域访问","官网 most.box:首页、文档、更新日志"],修复:["修复前端硬编码 localhost URL 导致远程访问下载失败","修复自动开浏览器 URL 在 HOST 为 0.0.0.0 时无法打开","移除欢迎引导弹窗(功能已整合到设置页)"]}},{version:"0.0.2",date:"2026-04-04",categories:{新增:["busboy multipart 解析,支持文件上传","WebSocket 重构,支持实时事件广播","API 速率限制(120 请求/分钟)","文件 Range 请求支持,优化预览体验","文件预览功能和移动端交互改进","移动端响应式布局(≤768px / ≤480px 断点)"],修复:["大文件上传 OOM(改为 stream 写入临时文件)","元数据写入损坏(原子写入 tmp + renameSync)","启动时自动清理残留临时上传文件","busboy 中文文件名乱码","下载完成后无法预览"],重构:["解耦 Hyperdrive 存储与目录结构","关闭服务按钮移入设置弹窗"]}},{version:"0.0.1",date:"2026-01-01",categories:{新增:["首次发布","基于 Hyperswarm/Hyperdrive 的 P2P 文件分享","确定性 CID v1 文件发布","大文件流式传输支持(GB 级以上)","CID 完整性验证","自定义 most:// 链接格式用于分享","基于 React 的 Web UI","命令行界面"]}}];var i=e.i(40983);e.s(["default",0,function(){return(0,t.jsx)(i.MarketingLayout,{children:(0,t.jsx)("main",{style:{paddingTop:64},children:(0,t.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"48px 24px 80px"},children:[(0,t.jsx)("h1",{style:{fontSize:32,fontWeight:700,marginBottom:8},children:"更新日志"}),(0,t.jsxs)("p",{style:{color:"var(--text-secondary)",marginBottom:48},children:["本项目所有重要变更将记录在此文件中。格式遵循"," ",(0,t.jsx)("a",{href:"https://keepachangelog.com/en/1.0.0/",target:"_blank",rel:"noopener",children:"Keep a Changelog"}),"。"]}),s.map(e=>(0,t.jsxs)("div",{style:{marginBottom:48,paddingBottom:48,borderBottom:"1px solid var(--border-color)"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:12,marginBottom:24},children:[(0,t.jsx)("span",{style:{fontSize:20,fontWeight:600},children:e.version}),(0,t.jsx)("span",{style:{fontSize:14,color:"var(--text-muted)"},children:e.date})]}),Object.entries(e.categories).map(([e,t])=>({name:e,items:t})).map(e=>(0,t.jsxs)("div",{style:{marginBottom:20},children:[(0,t.jsx)("h3",{style:{fontSize:12,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-muted)",marginBottom:8},children:e.name}),(0,t.jsx)("ul",{style:{listStyle:"none",padding:0},children:e.items.map(e=>(0,t.jsxs)("li",{style:{padding:"4px 0",paddingLeft:16,position:"relative",color:"var(--text-secondary)",fontSize:14},children:[(0,t.jsx)("span",{style:{position:"absolute",left:0},children:"•"}),e]},e))})]},e.name))]},e.version)),(0,t.jsx)("div",{style:{marginTop:48},children:(0,t.jsx)(a.default,{href:"/",style:{color:"var(--accent)",fontSize:14},children:"← 返回首页"})})]})})})}],58734)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96661,e=>{"use strict";e.s(["mergeClasses",0,(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()])},71987,88973,e=>{"use strict";e.s(["default",0,{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}],71987),e.s(["hasA11yProp",0,e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1}],88973)},5014,e=>{"use strict";var t=e.i(71645),r=e.i(71987),n=e.i(88973),s=e.i(96661);let a=(0,t.createContext)({}),o=(0,t.forwardRef)(({color:e,size:o,strokeWidth:i,absoluteStrokeWidth:l,className:c="",children:u,iconNode:d,...f},p)=>{let{size:h=24,strokeWidth:m=2,absoluteStrokeWidth:y=!1,color:g="currentColor",className:x=""}=(0,t.useContext)(a)??{},v=l??y?24*Number(i??m)/Number(o??h):i??m;return(0,t.createElement)("svg",{ref:p,...r.default,width:o??h??r.default.width,height:o??h??r.default.height,stroke:e??g,strokeWidth:v,className:(0,s.mergeClasses)("lucide",x,c),...!u&&!(0,n.hasA11yProp)(f)&&{"aria-hidden":"true"},...f},[...d.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(u)?u:[u]])});e.s(["default",0,o],5014)},56420,e=>{"use strict";var t=e.i(71645),r=e.i(96661);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var s=e.i(5014);e.s(["default",0,(e,a)=>{let o=(0,t.forwardRef)(({className:o,...i},l)=>(0,t.createElement)(s.default,{ref:l,iconNode:a,className:(0,r.mergeClasses)(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,o),...i}));return o.displayName=n(e),o}],56420)},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return i}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});function a(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function o(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,o(e));else t.set(r,o(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return b},NormalizeError:function(){return x},PageNotFoundError:function(){return v},SP:function(){return m},ST:function(){return y},WEB_VITALS:function(){return a},execOnce:function(){return o},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return w}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function o(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>i.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&f(r))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,y=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class x extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class b extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(e){return JSON.stringify({message:e.message,stack:e.stack})}},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",s=e.pathname||"",i=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),i&&"#"!==i[0]&&(i="#"+i),u&&"?"!==u[0]&&(u="?"+u),s=s.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${n}${c}${s}${u}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return i(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return s}});let n=e.r(71645);function s(e,t){let r=(0,n.useRef)(null),s=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(r.current=a(e,n)),t&&(s.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),s=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,s.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return g},useLinkStatus:function(){return v}};for(var s in n)Object.defineProperty(r,s,{enumerable:!0,get:n[s]});let a=e.r(90809),o=e.r(18050),i=a._(e.r(71645)),l=e.r(95057),c=e.r(8372),u=e.r(18581),d=e.r(18967),f=e.r(5550);e.r(33525);let p=e.r(88540),h=e.r(91949),m=e.r(73668),y=e.r(9396);function g(t){var r,n;let s,a,g,[v,b]=(0,i.useOptimistic)(h.IDLE_LINK_STATUS),j=(0,i.useRef)(null),{href:w,as:N,children:k,prefetch:C=null,passHref:E,replace:P,shallow:S,scroll:O,onClick:A,onMouseEnter:T,onTouchStart:U,legacyBehavior:_=!1,onNavigate:L,transitionTypes:M,ref:R,unstable_dynamicOnHover:$,...D}=t;s=k,_&&("string"==typeof s||"number"==typeof s)&&(s=(0,o.jsx)("a",{children:s}));let z=i.default.useContext(c.AppRouterContext),I=!1!==C,B=!1!==C?null===(n=C)||"auto"===n?y.FetchStrategy.PPR:y.FetchStrategy.Full:y.FetchStrategy.PPR,F="string"==typeof(r=N||w)?r:(0,l.formatUrl)(r);if(_){if(s?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});a=i.default.Children.only(s)}let K=_?a&&"object"==typeof a&&a.ref:R,W=i.default.useCallback(e=>(null!==z&&(j.current=(0,h.mountLinkInstance)(e,F,z,B,I,b)),()=>{j.current&&((0,h.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,h.unmountPrefetchableInstance)(e)}),[I,F,z,B,b]),X={ref:(0,u.useMergedRef)(W,K),onClick(t){_||"function"!=typeof A||A(t),_&&a.props&&"function"==typeof a.props.onClick&&a.props.onClick(t),!z||t.defaultPrevented||function(t,r,n,s,a,o,l){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){s&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),o){let e=!1;if(o({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);i.default.startTransition(()=>{d(r,s?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,l)})}}(t,F,j,P,O,L,M)},onMouseEnter(e){_||"function"!=typeof T||T(e),_&&a.props&&"function"==typeof a.props.onMouseEnter&&a.props.onMouseEnter(e),z&&I&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){_||"function"!=typeof U||U(e),_&&a.props&&"function"==typeof a.props.onTouchStart&&a.props.onTouchStart(e),z&&I&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,d.isAbsoluteUrl)(F)?X.href=F:_&&!E&&("a"!==a.type||"href"in a.props)||(X.href=(0,f.addBasePath)(F)),g=_?i.default.cloneElement(a,X):(0,o.jsx)("a",{...D,...X,children:s}),(0,o.jsx)(x.Provider,{value:v,children:g})}e.r(84508);let x=(0,i.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,i.useContext)(x);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},62368,e=>{"use strict";let t=(0,e.i(56420).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",0,t],62368)},63676,e=>{"use strict";let t=(0,e.i(56420).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],63676)},4121,57667,80809,88361,47910,e=>{"use strict";var t=e.i(18050);let r={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function n(e){let t=e.replace("Key","").toLowerCase();return r[e]||t}var s=e.i(71645);function a({children:e,onClose:r,closeOnOverlayClick:o=!1}){return!function(e,t=["INPUT","TEXTAREA","SELECT"],r=!1){let a=(0,s.useEffectEvent)(s=>{e.forEach(([e,a,o={preventDefault:!0,usePhysicalKeys:!1}])=>{var i;(i=o.usePhysicalKeys,t=>{let r,s,a,o;return function(e,t,r){let{alt:s,ctrl:a,meta:o,mod:i,shift:l,key:c}=e,{altKey:u,ctrlKey:d,metaKey:f,shiftKey:p,key:h,code:m}=t;if(s!==u)return!1;if(i){if(!d&&!f)return!1}else if(a!==d||o!==f)return!1;return l===p&&!!c&&(r?n(m)===n(c):n(h??m)===n(c))}((s={alt:(r=e.toLowerCase().split("+").map(e=>e.trim())).includes("alt"),ctrl:r.includes("ctrl"),meta:r.includes("meta"),mod:r.includes("mod"),shift:r.includes("shift")},a=["alt","ctrl","meta","shift","mod"],o=r.find(e=>!a.includes(e)),{...s,key:"[plus]"===o?"+":o}),t,i)})(s)&&function(e,t,r=!1){return!(e.target instanceof HTMLElement)||(r?!t.includes(e.target.tagName):!e.target.isContentEditable&&!t.includes(e.target.tagName))}(s,t,r)&&(o.preventDefault&&s.preventDefault(),a(s))})});(0,s.useEffect)(()=>(document.documentElement.addEventListener("keydown",a),()=>document.documentElement.removeEventListener("keydown",a)),[])}(r?[["Escape",r]]:[]),(0,t.jsxs)("div",{className:"modal-overlay",onClick:e=>{o&&e.target===e.currentTarget&&r?.()},children:[(0,t.jsx)("div",{className:"modal-overlay-backdrop"}),(0,t.jsx)("div",{className:"modal-glass",children:e})]})}e.s(["ModalOverlay",0,a],57667),e.s(["Toast",0,function({message:e,type:r,onDone:n,index:a}){return(0,s.useEffect)(()=>{let e=setTimeout(n,3e3);return()=>clearTimeout(e)},[]),(0,t.jsx)("div",{className:`toast ${r}`,style:{bottom:80+60*a},children:e})}],80809);var o=e.i(63676);e.s(["ConfirmModal",0,function({title:e,message:r,confirmText:n,onConfirm:s,onClose:i,danger:l,closeOnOverlayClick:c}){return(0,t.jsx)(a,{onClose:i,closeOnOverlayClick:c,children:(0,t.jsxs)("div",{className:"confirm-modal",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"modal-header",children:[(0,t.jsx)("h3",{children:e}),(0,t.jsx)("button",{onClick:i,className:"btn btn-icon",children:(0,t.jsx)(o.X,{size:18})})]}),(0,t.jsx)("p",{children:r}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{onClick:i,className:"btn btn-secondary",children:"取消"}),(0,t.jsx)("button",{onClick:s,className:`btn ${l?"btn-danger":"btn-primary"}`,children:n})]})]})})}],88361),e.s(["InputModal",0,function({title:e,placeholder:r,defaultValue:n,confirmText:i,onConfirm:l,onClose:c,isLoading:u,loadingText:d}){let[f,p]=(0,s.useState)(n||"");return(0,t.jsx)(a,{onClose:c,children:(0,t.jsxs)("div",{className:"input-modal",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"modal-header",children:[(0,t.jsx)("h3",{children:e}),(0,t.jsx)("button",{onClick:c,className:"btn btn-icon",children:(0,t.jsx)(o.X,{size:18})})]}),(0,t.jsx)("input",{type:"text",value:f,onChange:e=>p(e.target.value),placeholder:r,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&f.trim()&&!u&&l(f.trim())},className:"input input-compact"}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{onClick:c,disabled:u,className:"btn btn-secondary",children:"取消"}),(0,t.jsx)("button",{onClick:()=>f.trim()&&l(f.trim()),disabled:!f.trim()||u,className:"btn btn-primary",style:{opacity:u?.7:1},children:u?d||"处理中...":i})]})]})})}],47910),e.s([],4121)},72382,e=>{"use strict";let t=(0,e.i(56420).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],72382)},80860,e=>{"use strict";let t=(0,e.i(56420).default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["EyeOff",0,t],80860)},14232,e=>{"use strict";var t=e.i(18050),r=e.i(71645);class n extends r.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}handleReload=()=>{window.location.reload()};render(){return this.state.hasError?(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",padding:32,background:"#f8fafc",fontFamily:"system-ui"},children:[(0,t.jsx)("h1",{style:{fontSize:20,fontWeight:600,marginBottom:8,color:"#1e293b"},children:"出错了"}),(0,t.jsx)("p",{style:{color:"#64748b",marginBottom:24,textAlign:"center",maxWidth:400},children:"发生了意外错误,请尝试重新加载页面"}),(0,t.jsx)("button",{onClick:this.handleReload,style:{padding:"10px 24px",borderRadius:8,border:"none",background:"#3b82f6",color:"#fff",fontSize:14,cursor:"pointer"},children:"重新加载"})]}):this.props.children}}e.s(["ErrorBoundary",0,n])},52925,e=>{"use strict";var t=e.i(18050),r=e.i(71645),n=e.i(3593),s=e.i(71192);e.i(4121);var a=e.i(80809),o=e.i(63676),i=e.i(62368),l=e.i(56420);let c=(0,l.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),u=(0,l.default)("apple",[["path",{d:"M12 6.528V3a1 1 0 0 1 1-1h0",key:"11qiee"}],["path",{d:"M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21",key:"110c12"}]]),d=(0,l.default)("laptop",[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]);var f=e.i(22016);let p=function({onClose:e}){let r=(0,n.useAppStore)(e=>e.hasBackend),s=[{name:"Windows",icon:(0,t.jsx)(c,{size:16}),ext:".exe"},{name:"macOS",icon:(0,t.jsx)(u,{size:16}),ext:".dmg"},{name:"Linux",icon:(0,t.jsx)(d,{size:16}),ext:".AppImage"}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"drawer-backdrop",onClick:e}),(0,t.jsxs)("div",{className:"settings-drawer",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"drawer-header",children:[(0,t.jsx)("h2",{className:"drawer-title",children:"关于"}),(0,t.jsx)("button",{onClick:e,className:"btn btn-icon",children:(0,t.jsx)(o.X,{size:18})})]}),(0,t.jsxs)("div",{className:"drawer-content",children:[(0,t.jsxs)("div",{className:"drawer-section drawer-about",children:[(0,t.jsx)("h3",{children:"MostBox"}),(0,t.jsx)("p",{children:"版本 0.1.0"}),(0,t.jsx)("p",{className:"drawer-subtitle",children:"Hyperswarm · Hyperdrive · IPFS"})]}),!1===r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"drawer-divider"}),(0,t.jsxs)("div",{className:"drawer-section",children:[(0,t.jsxs)("label",{className:"drawer-label",children:[(0,t.jsx)(i.Download,{size:14,className:"icon-inline"}),"下载桌面客户端"]}),(0,t.jsx)("p",{className:"drawer-hint",style:{marginBottom:"12px"},children:"Web 端仅用于界面展示。下载桌面客户端获得完整的 P2P 文件分享和加密聊天体验。"}),(0,t.jsx)("div",{className:"download-platforms-mini",children:s.map(r=>(0,t.jsxs)(f.default,{href:"/download",className:"download-platform-mini",onClick:e,children:[r.icon,(0,t.jsx)("span",{children:r.name}),(0,t.jsx)("span",{className:"download-platform-mini-ext",children:r.ext})]},r.name))})]}),(0,t.jsx)("div",{className:"drawer-divider"}),(0,t.jsxs)("div",{className:"drawer-section",children:[(0,t.jsx)("label",{className:"drawer-label",children:"说明"}),(0,t.jsxs)("div",{className:"drawer-note",children:[(0,t.jsx)("p",{children:"桌面客户端提供以下完整功能:"}),(0,t.jsxs)("ul",{children:[(0,t.jsx)("li",{children:"P2P 文件分享与下载"}),(0,t.jsx)("li",{children:"加密频道聊天"}),(0,t.jsx)("li",{children:"本地持久化存储"}),(0,t.jsx)("li",{children:"离线消息同步"}),(0,t.jsx)("li",{children:"大文件无限制传输"})]})]})]})]})]})]})]})};var h=e.i(74080),m=e.i(72382),y=e.i(80860),g=e.i(57667),x=e.i(93957);function v(){let e=(0,n.useAppStore)(e=>e.addToast),r=(0,s.useUserStore)(e=>e.showLoginModal),a=(0,s.useUserStore)(e=>e.closeLoginModal),i=(0,s.useUserStore)(e=>e.loginUsername),l=(0,s.useUserStore)(e=>e.loginPassword),c=(0,s.useUserStore)(e=>e.showPassword),u=(0,s.useUserStore)(e=>e.loginPreviewAddress),d=(0,s.useUserStore)(e=>e.hasPreviewedAvatar),f=(0,s.useUserStore)(e=>e.loginLoading),p=(0,s.useUserStore)(e=>e.loginError),v=(0,s.useUserStore)(e=>e.setLoginUsername),b=(0,s.useUserStore)(e=>e.setLoginPassword),j=(0,s.useUserStore)(e=>e.togglePassword),w=(0,s.useUserStore)(e=>e.previewLoginIdentity),N=(0,s.useUserStore)(e=>e.loginUser);if(!r)return null;let k=u?`${u.slice(0,6)}...${u.slice(-4)}`:"Most People",C=(0,t.jsx)(g.ModalOverlay,{onClose:a,closeOnOverlayClick:!0,children:(0,t.jsxs)("form",{className:"login-modal",onSubmit:t=>{let r;t.preventDefault(),(r=N())&&e(`已登录 ${r.username}`,"success")},children:[(0,t.jsxs)("div",{className:"login-modal-header",children:[(0,t.jsx)("h3",{children:"登录"}),(0,t.jsx)("button",{className:"login-modal-close",onClick:a,type:"button",children:(0,t.jsx)(o.X,{size:18})})]}),(0,t.jsxs)("div",{className:"login-modal-body",children:[(0,t.jsx)("img",{className:"login-avatar-preview",src:u?(0,x.generateAvatar)(u):"/pwa-512x512.png",alt:"avatar"}),(0,t.jsx)("p",{className:"login-tip",children:k}),p&&(0,t.jsx)("p",{className:"login-error",children:p}),(0,t.jsx)("input",{type:"text",className:"input input-compact",placeholder:"用户名",value:i,onChange:e=>v(e.target.value),autoFocus:!0}),(0,t.jsxs)("div",{className:"login-password-wrapper",children:[(0,t.jsx)("input",{type:c?"text":"password",className:"input input-compact",placeholder:"密码",value:l,onChange:e=>b(e.target.value)}),(0,t.jsx)("button",{className:"login-password-toggle",type:"button",onClick:j,children:c?(0,t.jsx)(y.EyeOff,{size:16}):(0,t.jsx)(m.Eye,{size:16})})]}),(0,t.jsxs)("div",{className:"login-buttons-row",children:[(0,t.jsx)("button",{className:"btn btn-secondary",onClick:w,disabled:d||f,type:"button",children:d?"已预览":"预览头像"}),(0,t.jsx)("button",{className:"btn btn-primary",disabled:!d||f,type:"submit",children:f?"登录中":"登录"})]})]})]})});return(0,h.createPortal)(C,document.body)}e.s(["default",0,function(){let e=(0,n.useAppStore)(e=>e.checkBackend),o=(0,n.useAppStore)(e=>e.initializeLocalData),i=(0,s.useUserStore)(e=>e.initializeUser),l=(0,n.useAppStore)(e=>e.toasts),c=(0,n.useAppStore)(e=>e.removeToast),u=(0,n.useAppStore)(e=>e.showSettings),d=(0,n.useAppStore)(e=>e.closeSettings);return(0,r.useEffect)(()=>{o(),i(),e()},[e,o,i]),(0,t.jsxs)(t.Fragment,{children:[l.map((e,r)=>(0,t.jsx)(a.Toast,{message:e.message,type:e.type,onDone:()=>c(e.id),index:r},e.id)),u&&(0,t.jsx)(p,{onClose:d}),(0,t.jsx)(v,{})]})}],52925)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66627,e=>{"use strict";let a=(0,e.i(56420).default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);e.s(["Wifi",0,a],66627)},11241,e=>{"use strict";let a=(0,e.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,a],11241)},51757,e=>{"use strict";let a=(0,e.i(56420).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,a],51757)},56522,e=>{"use strict";let a=(0,e.i(56420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",0,a],56522)},26091,e=>{"use strict";let a=(0,e.i(56420).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,a],26091)},73474,e=>{"use strict";let a=(0,e.i(56420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,a],73474)},50285,41220,e=>{"use strict";var a=e.i(56420);let s=(0,a.default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,s],50285);let i=(0,a.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["Server",0,i],41220)},23261,e=>{"use strict";var a=e.i(18050),s=e.i(71645),i=e.i(22016),t=e.i(56420);let n=(0,t.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var d=e.i(11241),l=e.i(51757);let r=(0,t.default)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]),c=(0,t.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var h=e.i(26091),m=e.i(50285);let o=(0,t.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var x=e.i(56522),p=e.i(41220);let j=(0,t.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var u=e.i(73474),y=e.i(66627),v=e.i(26913),g=e.i(3593);function k(e){return!Number.isFinite(e)||e<=0?"0 B":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(2)} GB`}function N(e){return Number.isFinite(e)?String(Math.round(e/0x40000000*100)/100):"0"}function f(e){let a=Number(e);return!Number.isFinite(a)||a<0?0:Math.round(1024*a*1048576)}function b(e,a=12,s=8){return e?e.length<=a+s+3?e:`${e.slice(0,a)}...${e.slice(-s)}`:"-"}e.s(["default",0,function(){let e,t,M,z,w=(0,g.useAppStore)(e=>e.hasBackend),B=(0,g.useAppStore)(e=>e.addToast),[S,$]=(0,s.useState)(null),[C,F]=(0,s.useState)([]),[H,A]=(0,s.useState)(""),[G,T]=(0,s.useState)(!1),[P,V]=(0,s.useState)(!1),[D,L]=(0,s.useState)({dataPath:"",capacityGiB:"100",maxFileSizeGiB:"100"}),I=(0,s.useMemo)(()=>!S||S.capacity.configuredBytes<=0?0:Math.min(100,Math.round(S.capacity.usedBytes/S.capacity.configuredBytes*100)),[S]),E=(0,s.useMemo)(()=>(S?.holdings||[]).slice(0,100),[S]),q=Math.max(0,(S?.holdings.length||0)-100),W=async()=>{try{let e=await v.api.get("/api/node/status").json();$(e),L({dataPath:e.dataPath||"",capacityGiB:N(e.config.capacityBytes),maxFileSizeGiB:N(e.config.maxFileSizeBytes)}),A("")}catch(a){let e=await (0,v.getApiErrorMessage)(a,"无法读取节点状态");A(e),B(e,"error")}},K=async()=>{try{let e=await v.api.get("/api/node/logs?limit=80").json();F(e.logs||[])}catch{}},O=async()=>{T(!0);try{await v.api.post("/api/node/config",{json:{dataPath:D.dataPath,capacityBytes:f(D.capacityGiB),maxFileSizeBytes:f(D.maxFileSizeGiB)}}).json(),B("节点配置已保存","success"),await W(),await K()}catch(a){let e=await (0,v.getApiErrorMessage)(a,"保存配置失败");B(e,"error"),A(e)}finally{T(!1)}},U=async()=>{S?.nodeId&&(await navigator.clipboard.writeText(S.nodeId),B("节点 ID 已复制","success"))},R=async()=>{V(!0);try{await v.api.delete("/api/node/logs").json(),F([]),B("节点日志已清空","success")}catch(a){let e=await (0,v.getApiErrorMessage)(a,"清空日志失败");B(e,"error"),A(e)}finally{V(!1)}};return(0,s.useEffect)(()=>{if(!0!==w)return;W(),K();let e=new WebSocket((0,v.getWebSocketUrl)("/ws"));return e.onmessage=e=>{try{let a=JSON.parse(e.data);"node:status"===a.event&&$(a.data),"node:log"===a.event&&F(e=>[a.data,...e].slice(0,80)),"node:logs:cleared"===a.event&&F([]),("publish:success"===a.event||"download:success"===a.event||"network:status"===a.event)&&W()}catch{}},()=>e.close()},[w]),(0,a.jsxs)("main",{className:"admin-page",children:[(0,a.jsxs)("header",{className:"admin-topbar",children:[(0,a.jsxs)("div",{className:"admin-title-group",children:[(0,a.jsx)(i.default,{href:"/app",className:"btn btn-icon","aria-label":"返回文件控制台",children:(0,a.jsx)(d.ArrowLeft,{size:16})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"admin-kicker",children:"MostBox daemon"}),(0,a.jsx)("h1",{children:"节点管理台"})]})]}),(0,a.jsxs)("div",{className:"admin-topbar-actions",children:[(0,a.jsxs)("span",{className:`admin-status-pill ${S?.status==="online"?"online":""}`,children:[(0,a.jsx)(n,{size:14}),S?.status==="online"?"在线":"等待"]}),(0,a.jsxs)("button",{className:"btn btn-secondary",onClick:W,children:[(0,a.jsx)(o,{size:16}),"刷新"]})]})]}),!1===w&&(0,a.jsxs)("section",{className:"admin-panel admin-error",children:[(0,a.jsx)(p.Server,{size:20}),(0,a.jsx)("span",{children:"未连接本地 daemon"})]}),H&&(0,a.jsxs)("section",{className:"admin-panel admin-error",children:[(0,a.jsx)(h.FileText,{size:20}),(0,a.jsx)("span",{children:H})]}),(0,a.jsxs)("section",{className:"admin-overview",children:[(0,a.jsxs)("div",{className:"admin-metric",children:[(0,a.jsx)("div",{className:"admin-metric-icon",children:(0,a.jsx)(j,{size:18})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:"节点 ID"}),(0,a.jsx)("strong",{children:b(S?.nodeId||"")})]}),(0,a.jsx)("button",{className:"btn btn-icon admin-metric-action",onClick:U,"aria-label":"复制节点 ID",children:(0,a.jsx)(r,{size:15})})]}),(0,a.jsxs)("div",{className:"admin-metric",children:[(0,a.jsx)("div",{className:"admin-metric-icon",children:(0,a.jsx)(y.Wifi,{size:18})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:"连接"}),(0,a.jsx)("strong",{children:S?`${S.network.peers} peers`:"-"})]})]}),(0,a.jsxs)("div",{className:"admin-metric",children:[(0,a.jsx)("div",{className:"admin-metric-icon",children:(0,a.jsx)(m.HardDrive,{size:18})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:"容量"}),(0,a.jsxs)("strong",{children:[I,"%"]})]})]}),(0,a.jsxs)("div",{className:"admin-metric",children:[(0,a.jsx)("div",{className:"admin-metric-icon",children:(0,a.jsx)(p.Server,{size:18})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:"运行"}),(0,a.jsx)("strong",{children:S?(t=Math.floor((e=Math.max(0,Number(S.uptimeSeconds)||0))/86400),M=Math.floor(e%86400/3600),z=Math.floor(e%3600/60),t>0?`${t} 天 ${M} 小时`:M>0?`${M} 小时 ${z} 分钟`:`${z} 分钟`):"-"})]})]})]}),(0,a.jsxs)("section",{className:"admin-grid",children:[(0,a.jsxs)("div",{className:"admin-panel admin-span-2",children:[(0,a.jsxs)("div",{className:"admin-panel-header",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"admin-kicker",children:"Status"}),(0,a.jsx)("h2",{children:"节点状态"})]}),(0,a.jsx)(l.CheckCircle2,{size:18})]}),(0,a.jsxs)("div",{className:"admin-status-grid",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:"版本"}),(0,a.jsx)("strong",{children:S?.version||"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:"监听"}),(0,a.jsx)("strong",{children:S?`${S.host}:${S.port}`:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{children:"数据目录"}),(0,a.jsx)("strong",{children:S?.dataPath||"-"})]})]}),(0,a.jsx)("div",{className:"admin-address-list",children:(S?.listen.addresses||[]).map(e=>(0,a.jsxs)("span",{children:[e.label,": ",e.ip,":",S?.port]},`${e.type}-${e.ip}`))})]}),(0,a.jsxs)("div",{className:"admin-panel",children:[(0,a.jsxs)("div",{className:"admin-panel-header",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"admin-kicker",children:"Settings"}),(0,a.jsx)("h2",{children:"节点设置"})]}),(0,a.jsx)(c,{size:18})]}),(0,a.jsxs)("label",{className:"admin-field",children:[(0,a.jsx)("span",{children:"数据目录"}),(0,a.jsx)("input",{className:"input",value:D.dataPath,onChange:e=>L(a=>({...a,dataPath:e.target.value}))})]}),(0,a.jsxs)("label",{className:"admin-field",children:[(0,a.jsx)("span",{children:"容量上限 GiB"}),(0,a.jsx)("input",{className:"input",type:"number",min:"0",step:"1",value:D.capacityGiB,onChange:e=>L(a=>({...a,capacityGiB:e.target.value}))})]}),(0,a.jsxs)("label",{className:"admin-field",children:[(0,a.jsx)("span",{children:"单文件最大 GiB"}),(0,a.jsx)("input",{className:"input",type:"number",min:"0",step:"1",value:D.maxFileSizeGiB,onChange:e=>L(a=>({...a,maxFileSizeGiB:e.target.value}))})]}),(0,a.jsx)("p",{className:"admin-field-hint",children:"发布和下载成功后会固定做种;MostBox 不设同时做种数或传输限速。"}),(0,a.jsxs)("button",{className:"btn btn-primary btn-full",onClick:O,disabled:G,children:[(0,a.jsx)(x.Save,{size:16}),"保存配置"]})]}),(0,a.jsxs)("div",{className:"admin-panel admin-span-2",children:[(0,a.jsxs)("div",{className:"admin-panel-header",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"admin-kicker",children:"Storage"}),(0,a.jsx)("h2",{children:"持有副本"})]}),(0,a.jsx)(m.HardDrive,{size:18})]}),(0,a.jsxs)("div",{className:"admin-capacity-row",children:[(0,a.jsx)("progress",{value:I,max:"100"}),(0,a.jsxs)("span",{children:[k(S?.capacity.usedBytes||0)," /"," ",k(S?.capacity.configuredBytes||0)]})]}),q>0&&(0,a.jsxs)("p",{className:"admin-table-note",children:["当前仅展示前 100 个副本,另有 ",q," 个仍在后台做种。"]}),(0,a.jsxs)("div",{className:"admin-table",children:[(0,a.jsxs)("div",{className:"admin-table-row admin-table-head",children:[(0,a.jsx)("span",{children:"文件"}),(0,a.jsx)("span",{children:"CID"}),(0,a.jsx)("span",{children:"大小"}),(0,a.jsx)("span",{children:"状态"})]}),E.map(e=>(0,a.jsxs)("div",{className:"admin-table-row",children:[(0,a.jsx)("span",{children:e.fileName||"-"}),(0,a.jsx)("span",{children:b(e.cid)}),(0,a.jsx)("span",{children:k(e.size)}),(0,a.jsx)("span",{children:function(e){switch(e.seedStatus){case"queued":return"队列中";case"joining":return"加入中";case"active":return"做种中";case"paused":return"已暂停";case"error":return e.seedError?`错误:${e.seedError}`:"错误";default:return e.joined?"做种中":"未 join"}}(e)})]},e.cid)),(!S||0===S.holdings.length)&&(0,a.jsx)("div",{className:"admin-empty-row",children:"暂无持有副本"})]})]}),(0,a.jsxs)("div",{className:"admin-panel admin-span-2",children:[(0,a.jsxs)("div",{className:"admin-panel-header",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"admin-kicker",children:"Logs"}),(0,a.jsx)("h2",{children:"节点日志"})]}),(0,a.jsxs)("div",{className:"admin-panel-actions",children:[(0,a.jsxs)("button",{className:"btn btn-ghost",onClick:R,disabled:P||0===C.length,children:[(0,a.jsx)(u.Trash2,{size:16}),"清空日志"]}),(0,a.jsx)(h.FileText,{size:18})]})]}),(0,a.jsxs)("div",{className:"admin-log-list",children:[C.map(e=>(0,a.jsxs)("div",{className:"admin-log-row",children:[(0,a.jsx)("time",{children:new Date(e.ts).toLocaleTimeString("zh-CN")}),(0,a.jsx)("span",{className:`admin-log-level ${e.level}`,children:e.level}),(0,a.jsx)("strong",{children:e.event}),(0,a.jsx)("span",{children:e.message})]},e.id)),0===C.length&&(0,a.jsx)("div",{className:"admin-empty-row",children:"暂无日志"})]})]})]})]})}],23261)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89664,e=>{"use strict";let t=(0,e.i(56420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],89664)},68877,e=>{"use strict";let t=(0,e.i(56420).default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);e.s(["ArrowRight",0,t],68877)},8734,e=>{"use strict";let t=(0,e.i(56420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],8734)},66595,e=>{"use strict";let t=(0,e.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],66595)},51921,e=>{"use strict";let t=(0,e.i(56420).default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,t],51921)},73474,e=>{"use strict";let t=(0,e.i(56420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],73474)},26091,e=>{"use strict";let t=(0,e.i(56420).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],26091)},50285,41220,e=>{"use strict";var t=e.i(56420);let a=(0,t.default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,a],50285);let s=(0,t.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);e.s(["Server",0,s],41220)},35965,e=>{"use strict";let t=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,t],35965)},96699,e=>{"use strict";let t=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,t],96699)},93583,e=>{"use strict";let t=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.s(["Menu",0,t],93583)},59665,5142,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(93583);function i(e=!1,t={}){let[s,l]=(0,a.useState)(e),c=(0,a.useCallback)(()=>{l(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),d=(0,a.useCallback)(()=>{l(e=>e?(t.onClose?.(),!1):e)},[t.onClose]);return[s,{open:c,close:d,toggle:(0,a.useCallback)(()=>{s?d():c()},[d,c,s]),set:l}]}e.s(["useDisclosure",0,i],5142);let l=(0,a.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:c,headerRight:d,children:h}){let[r,u]=i(!1),[y,n]=(0,a.useState)(!1),o=function(e,{getInitialValueInEffect:t}={getInitialValueInEffect:!0}){let[s,i]=(0,a.useState)(t?void 0:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,a.useEffect)(()=>{try{if("matchMedia"in window){let t=window.matchMedia(e);i(t.matches);let a=e=>i(e.matches);return t.addEventListener("change",a),()=>{t.removeEventListener("change",a)}}}catch(e){return}},[e]),s||!1}("(max-width: 768px)");return(0,t.jsx)(l.Provider,{value:{closeSidebar:u.close},children:(0,t.jsxs)("div",{className:"app-layout",children:[(0,t.jsx)("div",{className:`sidebar-overlay ${r?"visible":""}`,onClick:()=>u.close()}),(0,t.jsx)("div",{className:`sidebar ${r?"open":""} ${y?"collapsed":""}`,children:e({closeSidebar:u.close})}),(0,t.jsxs)("div",{className:"main-content",children:[(0,t.jsxs)("header",{className:"app-header",children:[(0,t.jsxs)("div",{className:"header-left",children:[(0,t.jsx)("button",{onClick:()=>{o?u.toggle():n(!y)},className:"btn btn-icon sidebar-toggle-btn","aria-label":o?"打开菜单":y?"展开侧边栏":"收起侧边栏",children:(0,t.jsx)(s.Menu,{size:16})}),c]}),(0,t.jsx)("div",{className:"header-right",children:d})]}),h]})]})})}],59665)},25981,e=>{"use strict";let t=(0,e.i(56420).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],25981)},26067,e=>{"use strict";let t=(0,e.i(56420).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],26067)},79490,e=>{"use strict";let t=(0,e.i(56420).default)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);e.s(["Edit2",0,t],79490)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,64621,9616,e=>{"use strict";function t(e){if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")}new Uint8Array(0);let r=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),o=0;o<r.length;o++)r[o]=255;for(var s=0;s<e.length;s++){var n=e.charAt(s),i=n.charCodeAt(0);if(255!==r[i])throw TypeError(n+" is ambiguous");r[i]=s}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function u(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var o=0,s=0;e[t]===l;)o++,t++;for(var n=(e.length-t)*c+1>>>0,i=new Uint8Array(n);e[t];){var h=r[e.charCodeAt(t)];if(255===h)return;for(var u=0,d=n-1;(0!==h||u<s)&&-1!==d;d--,u++)h+=a*i[d]>>>0,i[d]=h%256>>>0,h=h/256>>>0;if(0!==h)throw Error("Non-zero carry");s=u,t++}if(" "!==e[t]){for(var f=n-s;f!==n&&0===i[f];)f++;for(var p=new Uint8Array(o+(n-f)),y=o;f!==n;)p[y++]=i[f++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,o=0,s=0,n=t.length;s!==n&&0===t[s];)s++,r++;for(var i=(n-s)*h+1>>>0,c=new Uint8Array(i);s!==n;){for(var u=t[s],d=0,f=i-1;(0!==u||d<o)&&-1!==f;f--,d++)u+=256*c[f]>>>0,c[f]=u%a>>>0,u=u/a>>>0;if(0!==u)throw Error("Non-zero carry");o=d,s++}for(var p=i-o;p!==i&&0===c[p];)p++;for(var y=l.repeat(r);p<i;++p)y+=e.charAt(c[p]);return y},decodeUnsafe:u,decode:function(e){var r=u(e);if(r)return r;throw Error(`Non-${t} character`)}}};class o{name;prefix;baseEncode;constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class s{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;const o=t.codePointAt(0);if(void 0===o)throw Error("Invalid prefix character");this.prefixCodePoint=o,this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return i(this,e)}}class n{decoders;constructor(e){this.decoders=e}or(e){return i(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(null!=r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}function i(e,t){return new n({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}class a{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new o(e,t,r),this.decoder=new s(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}function l({name:e,prefix:t,encode:r,decode:o}){return new a(e,t,r,o)}function c({name:e,prefix:o,alphabet:s}){let{encode:n,decode:i}=r(s,e);return l({prefix:o,name:e,encode:n,decode:e=>t(i(e))})}function h({name:e,prefix:t,bitsPerChar:r,alphabet:o}){let s=function(e){let t={};for(let r=0;r<e.length;++r)t[e[r]]=r;return t}(o);return l({prefix:t,name:e,encode:e=>(function(e,t,r){let o="="===t[t.length-1],s=(1<<r)-1,n="",i=0,a=0;for(let o=0;o<e.length;++o)for(a=a<<8|e[o],i+=8;i>r;)i-=r,n+=t[s&a>>i];if(0!==i&&(n+=t[s&a<<r-i]),o)for(;(n.length*r&7)!=0;)n+="=";return n})(e,o,r),decode:t=>(function(e,t,r,o){let s=e.length;for(;"="===e[s-1];)--s;let n=new Uint8Array(s*r/8|0),i=0,a=0,l=0;for(let c=0;c<s;++c){let s=t[e[c]];if(void 0===s)throw SyntaxError(`Non-${o} character`);a=a<<r|s,(i+=r)>=8&&(i-=8,n[l++]=255&a>>i)}if(i>=r||(255&a<<8-i)!=0)throw SyntaxError("Unexpected end of data");return n})(t,s,r,e)})}let u=h({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5});h({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),h({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),h({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),h({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),h({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),h({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),h({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),h({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});let d=c({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"});c({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});let f=c({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});c({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});function p(e,t,r){t=t||[];for(var o=r=r||0;e>=0x80000000;)t[r++]=255&e|128,e/=128;for(;-128&e;)t[r++]=255&e|128,e>>>=7;return t[r]=0|e,p.bytes=r-o+1,t}function y(e,t){var r,o=0,t=t||0,s=0,n=t,i=e.length;do{if(n>=i)throw y.bytes=0,RangeError("Could not decode varint");r=e[n++],o+=s<28?(127&r)<<s:(127&r)*Math.pow(2,s),s+=7}while(r>=128)return y.bytes=n-t,o}let m=function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10};function g(e,t=0){return[y(e,t),y.bytes]}function b(e,t,r=0){return p(e,t,r),t}function w(e,t){let r=t.byteLength,o=m(e),s=o+m(r),n=new Uint8Array(s+r);return b(e,n,0),b(r,n,o),n.set(t,s),new T(e,r,t,n)}function R(e){let r=t(e),[o,s]=g(r),[n,i]=g(r.subarray(s)),a=r.subarray(s+i);if(a.byteLength!==n)throw Error("Incorrect length");return new T(o,n,a,r)}function v(e,t){return e===t||e.code===t.code&&e.size===t.size&&t.bytes instanceof Uint8Array&&function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e.bytes,t.bytes)}class T{code;size;digest;bytes;constructor(e,t,r,o){this.code=e,this.size=t,this.digest=r,this.bytes=o}}function S(e,t){let{bytes:r,version:o}=e;return 0===o?function(e,t,r){let{prefix:o}=r;if(o!==f.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let s=t.get(o);if(null!=s)return s;{let s=r.encode(e).slice(1);return t.set(o,s),s}}(r,E(e),t??f.encoder):function(e,t,r){let{prefix:o}=r,s=t.get(o);if(null!=s)return s;{let s=r.encode(e);return t.set(o,s),s}}(r,E(e),t??u.encoder)}e.s(["Digest",0,T,"create",0,w,"decode",0,R,"equals",0,v],9616);let x=new WeakMap;function E(e){let t=x.get(e);if(null==t){let t=new Map;return x.set(e,t),t}return t}class P{code;version;multihash;bytes;"/";constructor(e,t,r,o){this.code=t,this.version=e,this.multihash=r,this.bytes=o,this["/"]=o}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:t}=this;if(e!==A)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==C)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return P.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=w(e,t);return P.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return P.equals(this,e)}static equals(e,t){return null!=t&&e.code===t.code&&e.version===t.version&&v(e.multihash,t.multihash)}toString(e){return S(this,e)}toJSON(){return{"/":S(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(null==e)return null;if(e instanceof P)return e;if(null!=e["/"]&&e["/"]===e.bytes||e.asCID===e){let{version:t,code:r,multihash:o,bytes:s}=e;return new P(t,r,o,s??q(t,r,o.bytes))}if(!0!==e[k])return null;{let{version:t,multihash:r,code:o}=e,s=R(r);return P.create(t,o,s)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");if(!(r.bytes instanceof Uint8Array))throw Error("Invalid digest");switch(e){case 0:if(t===A)return new P(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${A}) block encoding`);case 1:{let o=q(e,t,r.bytes);return new P(e,t,r,o)}default:throw Error("Invalid version")}}static createV0(e){return P.create(0,A,e)}static createV1(e,t){return P.create(1,e,t)}static decode(e){let[t,r]=P.decodeFirst(e);if(0!==r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let r=P.inspectBytes(e),o=r.size-r.multihashSize,s=t(e.subarray(o,o+r.multihashSize));if(s.byteLength!==r.multihashSize)throw Error("Incorrect length");let n=s.subarray(r.multihashSize-r.digestSize),i=new T(r.multihashCode,r.digestSize,n,s);return[0===r.version?P.createV0(i):P.createV1(r.codec,i),e.subarray(r.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,o]=g(e.subarray(t));return t+=o,r},o=r(),s=A;if(18===o?(o=0,t=0):s=r(),0!==o&&1!==o)throw RangeError(`Invalid CID version ${o}`);let n=t,i=r(),a=r(),l=t+a;return{version:o,codec:s,multihashCode:i,digestSize:a,multihashSize:l-n,size:l}}static parse(e,t){let[r,o]=function(e,t){switch(e[0]){case"Q":{let r=t??f;return[f.prefix,r.decode(`${f.prefix}${e}`)]}case f.prefix:{let r=t??f;return[f.prefix,r.decode(e)]}case u.prefix:{let r=t??u;return[u.prefix,r.decode(e)]}case d.prefix:{let r=t??d;return[d.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}(e,t),s=P.decode(o);if(0===s.version&&"Q"!==e[0])throw Error("Version 0 CID string must not include multibase prefix");return E(s).set(r,e),s}}let A=112,C=18;function q(e,t,r){let o=m(e),s=o+m(t),n=new Uint8Array(s+r.byteLength);return b(e,n,0),b(t,n,o),n.set(r,s),n}let k=Symbol.for("@ipld/js-cid/CID");e.s(["CID",0,P],64621)},3789,68834,e=>{"use strict";var t=e.i(64621),r=e.i(9616);function o({name:e,code:t,encode:r,minDigestLength:n,maxDigestLength:i}){return new s(e,t,r,n,i)}class s{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,r,o,s){this.name=e,this.code=t,this.encode=r,this.minDigestLength=o??20,this.maxDigestLength=s}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(null!=this.maxDigestLength&&t.truncate>this.maxDigestLength)throw Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?n(r,this.code,t?.truncate):r.then(e=>n(e,this.code,t?.truncate))}throw Error("Unknown type, must be binary type")}}function n(e,t,o){if(null!=o&&o!==e.byteLength){if(o>e.byteLength)throw Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,o)}return r.create(t,e)}function i(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}let a=o({name:"sha2-256",code:18,encode:i("SHA-256")});function l(e=""){return String(e).replace(/\\/g,"/").split("/").map(e=>e.trim()).filter(e=>e&&"."!==e).filter(e=>".."!==e).join("/")}function c(e){let t=l(e?.path||""),r=String(e?.name||"").trim();return t?`${t}/${r}`:r}async function h(e=""){let r=new TextEncoder().encode(String(e)),o=await a.digest(r);return t.CID.create(1,85,o).toString()}function u(e,t){return"directory"===e.type&&"directory"!==t.type?-1:"directory"!==e.type&&"directory"===t.type?1:(t.updated_at||t.created_at||0)-(e.updated_at||e.created_at||0)}o({name:"sha2-512",code:19,encode:i("SHA-512")}),e.s(["calculateNoteCid",0,h,"filterNotesByPath",0,function(e,t="",r=""){let o=l(t),s=r.trim().toLowerCase(),n=Array.isArray(e)?e:[];if(s)return n.filter(e=>String(e.name||"").toLowerCase().includes(s)).sort(u);let i=[],a=new Map;for(let e of n){let t=l(e.path||"");if(t===o){i.push(e);continue}if(""===o||t.startsWith(`${o}/`)){let r=(""===o?t:t.slice(o.length+1)).split("/").filter(Boolean)[0];r&&!a.has(r)&&a.set(r,{name:r,type:"directory",path:o,size:0,cid:`__dir__${o}/${r}`,created_at:e.created_at||Date.now(),updated_at:e.updated_at||e.created_at||Date.now()})}}return[...a.values(),...i].sort(u)},"getNoteFullPath",0,c,"normalizeNotePath",0,l,"renameNotesByPath",0,function(e,t,r,o){let s=l(t),n=l(r),i=String(o||"").trim(),a=l(n?`${n}/${i}`:i),h=Date.now();return e.map(e=>{let t=c(e);if(t===s)return{...e,path:n,name:i,updated_at:h};if(t.startsWith(`${s}/`)){let r=t.slice(s.length+1),o=l(`${a}/${r}`),n=o.lastIndexOf("/");return{...e,path:-1===n?"":o.slice(0,n),name:o.slice(n+1),updated_at:h}}return e})},"validateNoteName",0,function(e){let t=String(e||"").trim();return t?t.includes("/")?{valid:!1,error:"名称不能包含 /"}:t.includes("\\")?{valid:!1,error:"名称不能包含 \\"}:{valid:!0,name:t}:{valid:!1,error:"请输入名称"}}],3789);var d=e.i(71645);let f=e=>{let t,r=new Set,o=(e,o)=>{let s="function"==typeof e?e(t):e;if(!Object.is(s,t)){let e=t;t=(null!=o?o:"object"!=typeof s||null===s)?s:Object.assign({},t,s),r.forEach(r=>r(t,e))}},s=()=>t,n={setState:o,getState:s,getInitialState:()=>i,subscribe:e=>(r.add(e),()=>r.delete(e))},i=t=e(o,s,n);return n},p=e=>{let t=e?f(e):f,r=e=>(function(e,t=e=>e){let r=d.default.useSyncExternalStore(e.subscribe,d.default.useCallback(()=>t(e.getState()),[e,t]),d.default.useCallback(()=>t(e.getInitialState()),[e,t]));return d.default.useDebugValue(r),r})(t,e);return Object.assign(r,t),r};e.s(["create",0,e=>e?p(e):p],68834)},26913,e=>{"use strict";class t extends Error{name="KyError";get isKyError(){return!0}}class r extends t{name="HTTPError";response;request;options;data;constructor(e,t,r){const o=e.status||0===e.status?e.status:"",s=e.statusText??"",n=`${o} ${s}`.trim(),i=n?`status code ${n}`:"an unknown error";super(`Request failed with ${i}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=r}}class o extends t{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}}class s extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}}class n extends t{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new s(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}class i extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}}class a extends t{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}}let l=(()=>{let e=!1,t=!1,r="function"==typeof globalThis.Request;if("function"==typeof globalThis.ReadableStream&&r)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(e){if(e instanceof Error&&"unsupported BodyInit type"===e.message)return!1;throw e}return e&&!t})(),c="function"==typeof globalThis.AbortController,h="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,u="function"==typeof globalThis.ReadableStream,d="function"==typeof globalThis.FormData,f=["get","post","put","patch","head","delete"],p={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},y=Symbol("stop");class m{options;constructor(e){this.options=e}}let g=e=>new m(e),b={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},w={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},R=new TextEncoder,v=(e,t,r)=>{let o,s=0;return e.pipeThrough(new TransformStream({transform(e,n){if(n.enqueue(e),o){s+=o.byteLength;let e=0===t?0:s/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,s),transferredBytes:s},o)}o=e},flush(){o&&(s+=o.byteLength,r?.({percent:1,totalBytes:Math.max(t,s),transferredBytes:s},o))}}))},T=e=>null!==e&&"object"==typeof e,S=Symbol("replaceOption"),x=e=>T(e)&&!0===e[S]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},E=(...e)=>{for(let t of e)if((!T(t)||Array.isArray(t))&&void 0!==t)throw TypeError("The `options` argument must be an object");return L({},...e)},P=(e={},t={})=>{let r=new globalThis.Headers(e),o=t instanceof globalThis.Headers;for(let[e,s]of new globalThis.Headers(t).entries())o&&"undefined"===s||void 0===s?r.delete(e):r.set(e,s);return r},A=e=>{if(!T(e)||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},C=e=>{if(e instanceof URLSearchParams){let t=new URLSearchParams(e),r=e[N];return r&&(t[N]=new Set(r)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:A(e)?{...e}:e},q=(e,t)=>A(e)&&A(t)?Object.fromEntries(Object.entries({...e,...t}).filter(e=>void 0!==e[1])):P(e,t);function k(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:L(e[r]??[],t[r]??[])}let D=(e={},t={})=>({init:k(e,t,"init"),beforeRequest:k(e,t,"beforeRequest"),beforeRetry:k(e,t,"beforeRetry"),beforeError:k(e,t,"beforeError"),afterResponse:k(e,t,"afterResponse")}),N=Symbol("deletedParameters"),U=(e,t)=>{let r=new URLSearchParams,o=new Set;for(let s of[e,t])if(void 0!==s)if(s instanceof URLSearchParams){for(let[e,t]of s.entries())r.append(e,t),o.delete(e);let e=s[N];if(e)for(let t of e)r.delete(t),o.add(t)}else if(Array.isArray(s))for(let e of s){if(!Array.isArray(e)||2!==e.length)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1])),o.delete(String(e[0]))}else if(T(s))for(let[e,t]of Object.entries(s))void 0===t?(r.delete(e),o.add(e)):(r.append(e,String(t)),o.delete(e));else for(let[e,t]of new URLSearchParams(s).entries())r.append(e,t),o.delete(e);return o.size>0&&(r[N]=o),r},L=(...e)=>{let t,r={},o={},s={},n=[];for(let i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(T(i)){for(let[e,o]of Object.entries(i)){if("signal"===e&&o instanceof globalThis.AbortSignal){n.push(o);continue}let s=x(o),{isReplace:i}=s;if(o=s.value,"context"===e){if(null!=o&&(!T(o)||Array.isArray(o)))throw TypeError("The `context` option must be an object");r={...r,context:null==o?{}:i?{...o}:{...r.context,...o}};continue}if("searchParams"===e){t=null==o?void 0:i||void 0===t?o:U(t,o);continue}T(o)&&!i&&e in r&&(o=L(r[e],o)),r={...r,[e]:o}}if(T(i.hooks)){let{value:e,isReplace:t}=x(i.hooks);s=t?D({},e):D(s,e),r.hooks=s}if(T(i.headers)){let{value:e,isReplace:t}=x(i.headers);o=t?C(e):q(o,e),r.headers=o}}return void 0!==t&&(r.searchParams=t),n.length>0&&(1===n.length?r.signal=n[0]:h?r.signal=AbortSignal.any(n):r.signal=n.at(-1)),r},j={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1};async function O(e,t,r,o){return new Promise((s,n)=>{let i=setTimeout(()=>{r&&r.abort(),n(new a(e))},o.timeout);o.fetch(e,t).then(s).catch(n).then(()=>{clearTimeout(i)})})}async function B(e,{signal:t}){return new Promise((r,o)=>{function s(){clearTimeout(n),o(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",s,{once:!0}));let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e)})}let $=Object.prototype.toString,z=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]),I=(e,t)=>e instanceof t||e?.name===t.name,H=Symbol("timedOutResponseData"),M="The `schema` argument must follow the Standard Schema specification",F=Object.prototype.toString,_=e=>e instanceof globalThis.Request||"[object Request]"===F.call(e),J=e=>e instanceof globalThis.Response||"[object Response]"===F.call(e),V=async(e,t)=>{if("object"!=typeof t&&"function"!=typeof t||null===t)throw TypeError(M);let r=t["~standard"];if("object"!=typeof r||null===r||"function"!=typeof r.validate)throw TypeError(M);let o=await r.validate(e);if(o.issues)throw new i(o.issues);return o.value};class W{static create(e,t){var o,s;let i,a=t.hooks?.init??[],l=a.length>0?(i={...t,json:C(t.json),context:C(t.context),headers:C(t.headers),searchParams:Array.isArray(o=t.searchParams)?o.map(e=>[...e]):C(o)},void 0!==t.retry&&(i.retry="object"!=typeof(s=t.retry)?s:{...s,...s.methods&&{methods:[...s.methods]},...s.statusCodes&&{statusCodes:[...s.statusCodes]},...s.afterStatusCodes&&{afterStatusCodes:[...s.afterStatusCodes]}}),i):t;for(let e of a)e(l);let c=new W(e,l),h=async()=>{if("number"==typeof c.#e.timeout&&c.#e.timeout>0x7fffffff)throw RangeError("The `timeout` option cannot be greater than 2147483647");if("number"==typeof c.#e.totalTimeout&&c.#e.totalTimeout>0x7fffffff)throw RangeError("The `totalTimeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await c.#t(),t=e??await c.#r(async()=>c.#o()),o=void 0!==e||c.#s();for(;;){if(void 0===t)return t;if(J(t))try{t=await c.#n(t)}catch(r){if(!(r instanceof n))throw r;let e=await c.#i(r,async()=>c.#o());if(void 0===e)return e;t=e,o=c.#s();continue}let e=t;if(!e.ok&&"opaque"!==e.type&&("function"==typeof c.#e.throwHttpErrors?c.#e.throwHttpErrors(e.status):c.#e.throwHttpErrors)){let s=new r(e,c.#a(e),c.#l());if(s.data=await c.#c(e),o)throw s;let n=await c.#i(s,async()=>c.#o());if(void 0===n)return n;t=n,o=c.#s();continue}break}if(!J(t))return t;if(c.#h(t),c.#e.onDownloadProgress){if("function"!=typeof c.#e.onDownloadProgress)throw TypeError("The `onDownloadProgress` option must be a function");if(!u)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let e=t.clone();c.#u(t);var s=c.#e.onDownloadProgress;if(!e.body)return e;let r={status:e.status,statusText:e.statusText,headers:e.headers};if(204===e.status)return new Response(null,r);let o=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(v(e.body,o,s),r)}return t},d=(async()=>{try{return await h()}catch(t){if(!(t instanceof Error)||c.#d.has(t))throw t;let e=t;for(let t of c.#e.hooks.beforeError){let r=await t({request:c.request,options:c.#l(),error:e,retryCount:c.#f});r instanceof Error&&(e=r)}throw e}finally{let e=c.#p;c.#y(e?.body??void 0),c.request!==e&&c.#y(c.request.body??void 0)}})();for(let[e,t]of Object.entries(p))("bytes"!==e||"function"==typeof globalThis.Response?.prototype?.bytes)&&(d[e]=async r=>{c.request.headers.set("accept",c.request.headers.get("accept")||t);let o=await d;if("json"!==e)return o[e]();let s=await o.text();if(""===s)return void 0!==r?V(void 0,r):JSON.parse(s);let n=l.parseJson?await l.parseJson(s,{request:c.#a(o),response:o}):JSON.parse(s);return void 0===r?n:V(n,r)});return d}static #m(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#g;#f=0;#b;#e;#p;#w;#d=new WeakSet;#R;#v;#T=!1;#S=new WeakMap;constructor(e,t={}){if(this.#b=e,Object.hasOwn(t,"prefixUrl"))throw Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");if(this.#e={...t,headers:P(this.#b.headers,t.headers),hooks:D({},t.hooks),method:(e=>f.includes(e)?e.toUpperCase():e)(t.method??this.#b.method??"GET"),prefix:String(t.prefix||""),retry:((e={})=>{if("number"==typeof e)return{...j,limit:e};if(e.methods&&!Array.isArray(e.methods))throw Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw Error("retry.statusCodes must be an array");let t=Object.fromEntries(Object.entries({...e,methods:e.methods?.map(e=>e.toLowerCase())}).filter(([,e])=>void 0!==e));return{...j,...t}})(t.retry),throwHttpErrors:t.throwHttpErrors??!0,timeout:t.timeout??1e4,totalTimeout:t.totalTimeout??!1,fetch:t.fetch??globalThis.fetch.bind(globalThis),context:t.context??{}},"string"!=typeof this.#b&&!(this.#b instanceof URL||this.#b instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if("string"==typeof this.#b){if(this.#e.prefix){const e=this.#e.prefix.replace(/\/+$/,""),t=this.#b.replace(/^\/+/,"");this.#b=`${e}/${t}`}if(this.#e.baseUrl){let e;try{e=new URL(this.#b)}catch{}e||(this.#b=new URL(this.#b,new Request(this.#e.baseUrl).url))}}c&&h&&(this.#w=this.#e.signal??this.#b.signal,this.#g=new globalThis.AbortController,this.#e.signal=this.#x()),l&&(this.#e.duplex="half"),void 0!==this.#e.json&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));const r=t.headers&&new globalThis.Headers(t.headers).has("content-type");if(this.#b instanceof globalThis.Request&&(d&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#b,this.#e),(e=>void 0!==e&&(Array.isArray(e)?e.length>0:e instanceof URLSearchParams?e.size>0||!!e[N]?.size:"object"==typeof e?Object.keys(e).length>0:"string"==typeof e?e.trim().length>0:!!e))(this.#e.searchParams)){const e=new URL(this.request.url),t=this.#e.searchParams?.[N];if(t)for(const r of t)e.searchParams.delete(r);if("string"==typeof this.#e.searchParams){const t=this.#e.searchParams.replace(/^\?/,"");""!==t&&(e.search=e.search?`${e.search}&${t}`:`?${t}`)}else for(const[t,r]of new URLSearchParams(W.#m(this.#e.searchParams)).entries())e.searchParams.append(t,r);if(this.#e.searchParams&&"object"==typeof this.#e.searchParams&&!Array.isArray(this.#e.searchParams)&&!(this.#e.searchParams instanceof URLSearchParams))for(const[t,r]of Object.entries(this.#e.searchParams))void 0===r&&e.searchParams.delete(t);this.request=new globalThis.Request(e,this.#e)}if(this.#e.onUploadProgress&&"function"!=typeof this.#e.onUploadProgress)throw TypeError("The `onUploadProgress` option must be a function");this.#v="number"==typeof this.#e.totalTimeout?this.#E():void 0}#P(){let e=this.#e.retry.delay(this.#f+1),t=e;return!0===this.#e.retry.jitter?t=Math.random()*e:"function"==typeof this.#e.retry.jitter&&(!Number.isFinite(t=this.#e.retry.jitter(e))||t<0)&&(t=e),Math.min(this.#e.retry.backoffLimit,t)}async #A(e){if(this.#f>=this.#e.retry.limit)throw e;let t=e instanceof Error?e:new s(e);if(t instanceof n)return t.customDelay??this.#P();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#e.retry.shouldRetry){let r=await this.#e.retry.shouldRetry({error:t,retryCount:this.#f+1});if(!1===r)throw e;if(!0===r)return this.#P()}if(I(e,a)){if(!this.#e.retry.retryOnTimeout)throw e;return this.#P()}if(I(e,r)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;let t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);return(Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now()),Number.isFinite(e))?(e=Math.max(0,e),Math.min(this.#e.retry.maxRetryAfter,e)):Math.min(this.#e.retry.maxRetryAfter,this.#P())}if(413===e.response.status)throw e;return this.#P()}if(!I(e,o))throw e;return this.#P()}#h(e){let t=this.#a(e);return this.#e.parseJson&&(e.json=async()=>{let r=await e.text();return""===r?JSON.parse(r):this.#e.parseJson(r,{request:t,response:e})}),e}async #c(e){let t=await this.#C(e,this.#q());if(t===H)return void this.#k();if(!t)return;if(!this.#D(e.headers.get("content-type")??""))return t;let r=await this.#N(t,e,this.#q(),this.#a(e));return r===H?void this.#k():r}#q(){let e=!1===this.#e.timeout?1e4:this.#e.timeout,t=this.#U();if(void 0===t)return e;if(t<=0)throw new a(this.request);return Math.min(e,t)}#D(e){let t=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async #C(e,t){let r,{body:o}=e;if(!o)try{return await e.text()}catch{return}try{r=o.getReader()}catch{return}let s=(e=>{let t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),r=t?.[1]??t?.[2];if(r)try{return new TextDecoder(r)}catch{}return new TextDecoder})(e.headers.get("content-type")??""),n=[],i=0,a=(async()=>{try{for(;;){let{done:e,value:t}=await r.read();if(e)break;if((i+=t.byteLength)>0xa00000)return void r.cancel().catch(()=>void 0);n.push(s.decode(t,{stream:!0}))}}catch{return}return n.push(s.decode()),n.join("")})(),l=new Promise(e=>{let r=setTimeout(()=>{e(H)},t);a.finally(()=>{clearTimeout(r)})}),c=await Promise.race([a,l]);return c===H&&r.cancel().catch(()=>void 0),c}async #N(e,t,r,o){let s;try{return await Promise.race([Promise.resolve().then(()=>this.#e.parseJson?this.#e.parseJson(e,{request:o,response:t}):JSON.parse(e)),new Promise(e=>{s=setTimeout(()=>{e(H)},r)})])}catch{return}finally{clearTimeout(s)}}#y(e){e&&e.cancel().catch(()=>void 0)}#u(e){this.#y(e.body??void 0)}#x(){return this.#w?AbortSignal.any([this.#w,this.#g.signal]):this.#g.signal}#k(){let e=this.#U();if(void 0!==e&&e<=0)throw new a(this.request)}async #t(){for(let e of this.#e.hooks.beforeRequest){let t=await e({request:this.request,options:this.#l(),retryCount:0});if(_(t))this.#L(t);else if(J(t))return t}}async #n(e){let t=this.#a(e);for(let r of this.#e.hooks.afterResponse){let o,s=this.#j(e.clone(),t);this.#h(s);try{o=await r({request:this.request,options:this.#l(),response:s,retryCount:this.#f})}catch(t){throw s!==e&&this.#u(s),this.#u(e),t}if(o instanceof m)throw s!==e&&this.#u(s),this.#u(e),new n(o.options);let i=J(o)?this.#j(o,t):e;s!==e&&s!==i&&s.body!==i.body&&this.#u(s),e!==i&&e.body!==i.body&&this.#u(e),e=i}return e}async #r(e){try{return await e()}catch(t){return this.#i(t,e)}}async #i(e,t){this.#T=!1;let r=Math.min(await this.#A(e),0x7fffffff),o={signal:this.#w},s=this.#U();if(void 0!==s){if(s<=0)throw new a(this.request);if(r>=s)throw await B(s,o),new a(this.request)}if(await B(r,o),this.#k(),e instanceof n&&e.customRequest){let t=new globalThis.Request(e.customRequest,this.#e.signal?{signal:this.#e.signal}:void 0);this.#L(t)}for(let t of this.#e.hooks.beforeRetry){let r;try{r=await t({request:this.request,options:this.#l(),error:e,retryCount:this.#f+1})}catch(t){throw t instanceof Error&&t!==e&&this.#d.add(t),t}if(_(r)){this.#L(r);break}if(J(r))return this.#T=!0,this.#f++,r;if(r===y)return}return this.#k(),this.#f++,this.#r(t)}#s(){let e=this.#T;return this.#T=!1,e}async #o(){this.#g?.signal.aborted&&(this.#g=new globalThis.AbortController,this.#e.signal=this.#x(),this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));let e=(e=>{let t={};for(let r in e)Object.hasOwn(e,r)&&(r in w||r in b||(t[r]=e[r]));return t})(this.#e),t=this.#e.retry.limit>0?this.request.clone():void 0,r=this.#O(this.request,this.#e.body??void 0);this.#p=r,t&&(this.request=t);try{let t=this.#U();if(void 0!==t&&t<=0)throw new a(this.request);let o=!1===this.#e.timeout?t:void 0===t?this.#e.timeout:Math.min(this.#e.timeout,t),s=void 0===o?await this.#e.fetch(r,e):await O(r,e,this.#g,{timeout:o,fetch:this.#e.fetch});return this.#j(s,r)}catch(e){if(function(e){if(!(e&&"[object Error]"===$.call(e)&&"TypeError"===e.name&&"string"==typeof e.message))return!1;let{message:t,stack:r}=e;return"Load failed"===t?void 0===r||"__sentry_captured__"in e:!!(t.startsWith("error sending request for url")||"Failed to fetch"===t||t.startsWith("Failed to fetch (")&&t.endsWith(")"))||z.has(t)}(e))throw new o(this.request,{cause:e});throw e}}#U(){if(void 0===this.#v)return;let e=this.#E()-this.#v;return Math.max(0,this.#e.totalTimeout-e)}#E(){return globalThis.performance?.now()??Date.now()}#l(){if(!this.#R){let{hooks:e,json:t,parseJson:r,stringifyJson:o,searchParams:s,timeout:n,totalTimeout:i,throwHttpErrors:a,fetch:l,...c}=this.#e;this.#R=Object.freeze(c)}return this.#R}#L(e){this.#R=void 0,this.request=e}#a(e){return this.#S.get(e)??this.request}#j(e,t){return this.#S.set(e,t),e}#O(e,t){return this.#e.onUploadProgress&&e.body&&l?((e,t,r)=>{if(!e.body)return e;let o=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(let[r,o]of e)t+=40,t+=R.encode(`Content-Disposition: form-data; name="${r}"`).byteLength,t+="string"==typeof o?R.encode(o).byteLength:o.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?R.encode(e).byteLength:e instanceof URLSearchParams?R.encode(e.toString()).byteLength:0})(r??e.body);return new Request(e,{duplex:"half",body:v(e.body,o,t)})})(e,this.#e.onUploadProgress,t??this.#e.body??void 0):e}}let K=e=>{let t=(t,r)=>W.create(t,E(e,r));for(let r of f)t[r]=(t,o)=>W.create(t,E(e,o,{method:r}));return t.create=e=>K(E(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),K(E(e,t))),t.stop=y,t.retry=g,t},G=K(),Q="mostbox_backend_url",X="http://localhost:1976";function Z(){return["localhost","127.0.0.1"].includes(window.location.hostname)&&"3000"===window.location.port}function Y(){return localStorage.getItem(Q)||(Z()?X:"")}function ee(e){return e.startsWith("/")?e:`/${e}`}function et(){let e=Y();return G.create({prefix:e})}let er=et();async function eo(e){let t=e&&"object"==typeof e&&"response"in e?e.response:e instanceof Response?e:null;if(!t)return{};let r=t.bodyUsed?null:await t.clone().json().catch(()=>null);return{status:t.status,code:"string"==typeof r?.code?r.code:void 0,error:"string"==typeof r?.error?r.error:"string"==typeof r?.message?r.message:void 0}}async function es(e,t="请求失败"){let r=await eo(e);return r.error?r.error:"TimeoutError"===(e&&"object"==typeof e&&"name"in e?String(e.name):"")?"请求超时,请稍后重试":!r.status&&e instanceof Error&&e.message?e.message:t}async function en(){let e=Y();try{return(await fetch(`${e}/api/node-id`,{method:"GET",signal:AbortSignal.timeout(3e3)})).ok}catch{return!1}}async function ei(){if(Z())return!1;try{return(await fetch("/api/node-id",{method:"GET",signal:AbortSignal.timeout(2e3)})).ok}catch{return!1}}async function ea(){try{return(await fetch(`${X}/api/node-id`,{method:"GET",signal:AbortSignal.timeout(2e3)})).ok}catch{return!1}}e.s(["api",()=>er,"checkBackendConnection",0,en,"detectLocalhostBackend",0,ea,"detectSameOriginBackend",0,ei,"getApiErrorMessage",0,es,"getApiErrorPayload",0,eo,"getApiUrl",0,function(e){let t=Y();return`${t}${ee(e)}`},"getBackendUrlExport",0,function(){return Y()},"getWebSocketUrl",0,function(e="/ws"){let t=Y()||window.location.origin,r=new URL(ee(e),t);return r.protocol="https:"===r.protocol?"wss:":"ws:",r.toString()},"setBackendUrl",0,function(e){let t=(e||"").trim().replace(/\/+$/,"");t?localStorage.setItem(Q,t):localStorage.removeItem(Q),er=et()}],26913)},3593,e=>{"use strict";var t=e.i(3789),r=e.i(68834),o=e.i(26913);let s="mostbox_notes";function n(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e&&("file"===e.type||void 0!==e.content)).map(e=>({name:String(e.name||"未命名"),cid:String(e.cid||""),path:(0,t.normalizeNotePath)(e.path||""),content:String(e.content||""),size:Number(e.size||0),type:"file",created_at:Number(e.created_at||e.updated_at||Date.now()),updated_at:Number(e.updated_at||e.created_at||Date.now()),isSecret:!0===e.isSecret||String(e.content||"").startsWith("mp://1")})):[]}function i(e,r){var o;o={notes:e,notesPath:(0,t.normalizeNotePath)(r)},localStorage.setItem(s,JSON.stringify(o))}let a=(0,r.create)((e,r)=>({hasBackend:null,checkBackend:async()=>{let t=(0,o.getBackendUrlExport)();if(t&&await (0,o.checkBackendConnection)()){(0,o.setBackendUrl)(t),e({hasBackend:!0});return}if(await (0,o.detectSameOriginBackend)()){(0,o.setBackendUrl)(""),e({hasBackend:!0});return}await (0,o.detectLocalhostBackend)()?((0,o.setBackendUrl)("http://localhost:1976"),e({hasBackend:!0})):e({hasBackend:!1})},isDarkMode:!1,setIsDarkMode:t=>{e({isDarkMode:t}),document.documentElement.setAttribute("data-theme",t?"dark":"light"),localStorage.setItem("theme",t?"dark":"light")},toasts:[],addToast:(t,r="info")=>{e(e=>({toasts:[...e.toasts,{id:Date.now(),message:t,type:r}]}))},removeToast:t=>{e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))},showSettings:!1,openSettings:()=>e({showSettings:!0}),closeSettings:()=>e({showSettings:!1}),localDataReady:!1,initializeLocalData:()=>{let r=function(e){try{let t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}(s);e({notes:n(r?.notes),notesPath:(0,t.normalizeNotePath)(r?.notesPath||""),localDataReady:!0})},notes:[],notesPath:"",setNotesPath:o=>{let s=(0,t.normalizeNotePath)(o);e({notesPath:s}),i(r().notes,s)},saveNote:async o=>{let s=(0,t.validateNoteName)(o.name);if(!s.valid)throw Error(s.error);let n=(0,t.normalizeNotePath)(o.path||""),a=String(o.content||""),l=await (0,t.calculateNoteCid)(a),c=new TextEncoder().encode(a).length,h=Date.now(),u=r().notes,d=o.cid?u.findIndex(e=>e.cid===o.cid):u.findIndex(e=>(0,t.normalizeNotePath)(e.path)===n&&e.name===s.name),f=(0,t.normalizeNotePath)(n?`${n}/${s.name}`:s.name);if(u.some((e,r)=>r!==d&&(0,t.getNoteFullPath)(e)===f))throw Error("目标位置已存在同名笔记");let p=d>=0?u[d]:null,y={name:s.name,cid:l,path:n,content:a,size:c,type:"file",created_at:p?.created_at||h,updated_at:h,isSecret:!0===o.isSecret||a.startsWith("mp://1")},m=d>=0?u.map((e,t)=>t===d?y:e):[...u,y];return e({notes:m}),i(m,r().notesPath),l},deleteNote:(o,s,n)=>{let a=void 0!==s&&void 0!==n?(0,t.normalizeNotePath)(`${s}/${n}`):"",l=r().notes.filter(e=>{if(o&&e.cid===o)return!1;if(a){let r=(0,t.getNoteFullPath)(e);return r!==a&&!r.startsWith(`${a}/`)}return!0});e({notes:l}),i(l,r().notesPath)},renameNote:(o,s,n)=>{let a=(0,t.validateNoteName)(n);if(!a.valid)throw Error(a.error);let l=(0,t.normalizeNotePath)(o),c=(0,t.normalizeNotePath)(s),h=(0,t.normalizeNotePath)(c?`${c}/${a.name}`:a.name);if(h.startsWith(`${l}/`))throw Error("不能移动到自身子目录");if(r().notes.some(e=>{let r=(0,t.getNoteFullPath)(e);return r!==l&&r===h}))throw Error("目标位置已存在同名笔记");let u=(0,t.renameNotesByPath)(r().notes,l,c,a.name);e({notes:u}),i(u,r().notesPath)},importNotes:t=>{let o=n(t);e({notes:o}),i(o,r().notesPath)}}));{let e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;("dark"===e||!e&&t)&&a.setState({isDarkMode:!0})}e.s(["useAppStore",0,a])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,27648,e=>{"use strict";var t=e.i(18050),s=e.i(93957),n=e.i(71192);e.s(["default",0,function({className:e=""}){let a=(0,n.useUserStore)(e=>e.identity),r=(0,n.useUserStore)(e=>e.openLoginModal),i=(0,n.useUserStore)(e=>e.logoutUser);return(0,t.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${e}`,children:[(0,t.jsxs)("div",{className:"user-info",children:[(0,t.jsx)("img",{className:"user-avatar-img",src:(0,s.generateAvatar)(a?.address),alt:"avatar"}),(0,t.jsx)("span",{className:"user-name",title:a?.address,children:a?.displayName||"未登录"})]}),a?(0,t.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:i,children:"退出"}):(0,t.jsx)("button",{className:"btn btn-primary login-btn",onClick:r,children:"登录"})]})}])},77071,e=>{"use strict";let t=(0,e.i(56420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],77071)},93583,e=>{"use strict";let t=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.s(["Menu",0,t],93583)},96699,e=>{"use strict";let t=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,t],96699)},35965,e=>{"use strict";let t=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,t],35965)},59665,5142,e=>{"use strict";var t=e.i(18050),s=e.i(71645),n=e.i(93583);function a(e=!1,t={}){let[n,r]=(0,s.useState)(e),i=(0,s.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),l=(0,s.useCallback)(()=>{r(e=>e?(t.onClose?.(),!1):e)},[t.onClose]);return[n,{open:i,close:l,toggle:(0,s.useCallback)(()=>{n?l():i()},[l,i,n]),set:r}]}e.s(["useDisclosure",0,a],5142);let r=(0,s.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:i,headerRight:l,children:o}){let[c,d]=a(!1),[u,h]=(0,s.useState)(!1),p=function(e,{getInitialValueInEffect:t}={getInitialValueInEffect:!0}){let[n,a]=(0,s.useState)(t?void 0:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,s.useEffect)(()=>{try{if("matchMedia"in window){let t=window.matchMedia(e);a(t.matches);let s=e=>a(e.matches);return t.addEventListener("change",s),()=>{t.removeEventListener("change",s)}}}catch(e){return}},[e]),n||!1}("(max-width: 768px)");return(0,t.jsx)(r.Provider,{value:{closeSidebar:d.close},children:(0,t.jsxs)("div",{className:"app-layout",children:[(0,t.jsx)("div",{className:`sidebar-overlay ${c?"visible":""}`,onClick:()=>d.close()}),(0,t.jsx)("div",{className:`sidebar ${c?"open":""} ${u?"collapsed":""}`,children:e({closeSidebar:d.close})}),(0,t.jsxs)("div",{className:"main-content",children:[(0,t.jsxs)("header",{className:"app-header",children:[(0,t.jsxs)("div",{className:"header-left",children:[(0,t.jsx)("button",{onClick:()=>{p?d.toggle():h(!u)},className:"btn btn-icon sidebar-toggle-btn","aria-label":p?"打开菜单":u?"展开侧边栏":"收起侧边栏",children:(0,t.jsx)(n.Menu,{size:16})}),i]}),(0,t.jsx)("div",{className:"header-right",children:l})]}),o]})]})})}],59665)},25981,e=>{"use strict";let t=(0,e.i(56420).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],25981)},26091,e=>{"use strict";let t=(0,e.i(56420).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,t],26091)},73474,e=>{"use strict";let t=(0,e.i(56420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],73474)},66595,e=>{"use strict";let t=(0,e.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],66595)},79490,e=>{"use strict";let t=(0,e.i(56420).default)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);e.s(["Edit2",0,t],79490)},26067,e=>{"use strict";let t=(0,e.i(56420).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],26067)},10566,e=>{"use strict";let t=(0,e.i(56420).default)("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);e.s(["NotebookPen",0,t],10566)},11241,e=>{"use strict";let t=(0,e.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],11241)},18566,(e,t,s)=>{t.exports=e.r(76562)},51757,e=>{"use strict";let t=(0,e.i(56420).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",0,t],51757)},6537,e=>{"use strict";let t=(0,e.i(56420).default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["Lock",0,t],6537)},31214,e=>{"use strict";let t=(0,e.i(56420).default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);e.s(["Cloud",0,t],31214)},67585,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let n=e.r(32061);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,s)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return o}});let n=e.r(18050),a=e.r(74080),r=e.r(63599),i=e.r(9885),l=e.r(43369);function o({moduleIds:e}){if("u">typeof window)return null;let t=r.workAsyncStorage.getStore();if(void 0===t)return null;let s=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;s.push(...e)}}if(0===s.length)return null;let c=(0,l.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:s.map(e=>{let s=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(s,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return c}});let n=e.r(18050),a=e.r(71645),r=e.r(67585),i=e.r(52157);function l(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},c=function(e){let t={...o,...e},s=(0,a.lazy)(()=>t.loader().then(l)),c=t.loading;function d(e){let l=c?(0,n.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,d=o?a.Suspense:a.Fragment,u=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(s,{...e})]}):(0,n.jsx)(r.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(s,{...e})});return(0,n.jsx)(d,{...o?{fallback:l}:{},children:u})}return d.displayName="LoadableComponent",d}},70703,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return a}});let n=e.r(55682)._(e.r(69093));function a(e,t){let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,n.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},42489,96013,86041,e=>{"use strict";var t=e.i(18050),s=e.i(71645),n=e.i(56420);let a=(0,n.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var r=e.i(51757),i=e.i(31214),l=e.i(62368),o=e.i(96699);let c=(0,n.default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var d=e.i(35965),u=e.i(25981),h=e.i(3593),p=e.i(71192);e.s(["NoteMoreMenu",0,function({sync:e}){let n=(0,s.useRef)(null),[m,f]=(0,s.useState)(!1),x=(0,h.useAppStore)(e=>e.isDarkMode),j=(0,h.useAppStore)(e=>e.setIsDarkMode),y=(0,p.useUserStore)(e=>e.wallet),b=null!==e.action;async function k(e){f(!1),await e()}return(0,s.useEffect)(()=>{if(m)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){n.current?.contains(e.target)||f(!1)}},[m]),(0,t.jsxs)("div",{className:"note-more",ref:n,children:[(0,t.jsx)("button",{className:"btn btn-icon note-more-trigger",onClick:()=>f(e=>!e),title:"更多","aria-label":"更多",children:(0,t.jsx)(c,{size:16})}),m&&(0,t.jsxs)("div",{className:"note-more-menu",children:[(0,t.jsxs)("div",{className:`note-sync-status ${e.hasConflict?"conflict":""}`,children:[(0,t.jsx)("span",{className:"note-sync-status-icon",children:e.hasConflict?(0,t.jsx)(a,{size:16}):"synced"===e.status?(0,t.jsx)(r.CheckCircle2,{size:16}):(0,t.jsx)(i.Cloud,{size:16})}),(0,t.jsxs)("span",{children:[(0,t.jsx)("strong",{children:"云同步"}),(0,t.jsx)("small",{children:e.statusLabel})]})]}),(0,t.jsxs)("button",{className:"note-more-item",onClick:()=>k(e.exportLocalBackup),disabled:!y||b,children:[(0,t.jsx)(u.Upload,{size:16}),"本地导出"]}),(0,t.jsxs)("button",{className:"note-more-item",onClick:()=>k(e.importLocalBackup),disabled:!y||b,children:[(0,t.jsx)(l.Download,{size:16}),"本地导入"]}),(0,t.jsx)("div",{className:"note-more-separator"}),(0,t.jsxs)("button",{className:"note-more-item",onClick:function(){f(!1),j(!x)},children:[x?(0,t.jsx)(d.Sun,{size:16}):(0,t.jsx)(o.Moon,{size:16}),x?"浅色模式":"深色模式"]})]})]})}],42489);var m=e.i(27648);e.s(["NoteSidebar",0,function({children:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"sidebar-header",onClick:()=>{window.location.href="/"},children:(0,t.jsx)("h1",{children:"MOST PEOPLE"})}),e,(0,t.jsx)(m.default,{})]})}],96013);var f=e.i(128),x=e.i(3789);let j="https://api.most.box/api/backup";async function y(e,t){let s=await e.clone().json().catch(()=>null);return s?.error||t}function b(e,t){return(0,f.mostEncode)(JSON.stringify({notes:e||[]}),t)}function k(e,t){if(!String(e||"").startsWith("mp://1"))throw Error("无效的备份数据格式");let s=(0,f.mostDecode)(e,t);if(!s)throw Error("解密失败,请确认当前 Web3 登录账号正确");let n=JSON.parse(s);if(!Array.isArray(n.notes))throw Error("备份数据缺少 notes");return n}async function g(e){return(0,x.calculateNoteCid)(JSON.stringify({notes:e||[]}))}async function v(e,t,s=j){let n=Date.now().toString(),a=new URL(s).pathname,r=`${n}:${String(t).toUpperCase()}:${a}`,{address:i,signature:l}=await (0,f.mostSignMessage)(e.danger,r);return{Authorization:`${i},${n},${l}`}}async function N(e,t){let s=JSON.stringify({notes:t||[]}),n=await (0,x.calculateNoteCid)(s);return{cid:n,body:b(t,e.danger),headers:{"Content-Type":"text/plain","x-backup-cid":n,...await v(e,"PUT",j)}}}async function w(e,t,s=j){let n=await N(e,t),a=await fetch(s,{method:"PUT",headers:n.headers,body:n.body});if(!a.ok)throw Error(await y(a,"云备份失败"));return{cid:n.cid}}async function S(e,t=j){let s=await fetch(t,{method:"GET",headers:await v(e,"GET",t)});if(404===s.status)return{found:!1,cid:"",time:0,notes:[]};if(!s.ok)throw Error(await y(s,"云端恢复失败"));let n=await s.text();if(!n)throw Error("云端无备份数据");let a=k(n,e.danger);return{found:!0,cid:s.headers.get("x-backup-cid")||"",time:Number(s.headers.get("x-backup-time")||0),notes:a.notes}}let C=!1,M="",z="";function P(e,t){return e instanceof Error?e.message:t}e.s(["useNoteBackupSync",0,function(){let e=(0,p.useUserStore)(e=>e.wallet),t=(0,p.useUserStore)(e=>e.openLoginModal),n=(0,h.useAppStore)(e=>e.addToast),a=(0,h.useAppStore)(e=>e.notes),r=(0,h.useAppStore)(e=>e.importNotes),i=(0,h.useAppStore)(e=>e.localDataReady),[l,o]=(0,s.useState)(null),[c,d]=(0,s.useState)(e?"idle":"disabled"),[u,m]=(0,s.useState)(C),[f,x]=(0,s.useState)(!1),j=(0,s.useRef)(0),y=(0,s.useCallback)(e=>{C=e,m(e)},[]),v=(0,s.useCallback)((e=!1)=>{let s=p.useUserStore.getState().wallet;return s||(e||(n("请先登录 Web3 账号","warning"),t()),null)},[n,t]),N=(0,s.useCallback)(async(e={})=>{let{silent:t=!1,confirmConflict:s=!0}=e,a=v(t);if(!a)return d("disabled"),!1;if(C&&s&&!window.confirm("本地数据与云端不一致,本地修改将会覆盖云端数据,是否继续?"))return t||n("已取消同步","info"),d("conflict"),!1;o("save"),d("uploading");try{let e=h.useAppStore.getState().notes;return M=(await w(a,e)).cid,z=a.address,y(!1),d("synced"),t||n("云端备份已更新","success"),!0}catch(e){return d("error"),t?console.info(P(e,"云备份失败")):n(P(e,"云备份失败"),"error"),!1}finally{o(null)}},[n,v,y]),A=(0,s.useCallback)(async(e={})=>{let{manual:t=!1,uploadWhenMissing:s=!1}=e,a=v(!t);if(!a)return d("disabled"),!1;o(t?"restore":"sync"),d(t?"restoring":"checking");try{let e=await S(a),i=h.useAppStore.getState().notes;if(!e.found){if(y(!1),z=a.address,s&&i.length>0)return o(null),N({silent:!0,confirmConflict:!1});return d(i.length>0?"idle":"synced"),t&&n("云端暂无备份","info"),!1}let l=e.notes||[],c=await g(i),u=e.cid||await g(l);if(i.length>0&&c!==u&&!window.confirm("云端备份与本地笔记不一致。恢复会覆盖本地笔记,是否继续?"))return y(!0),d("conflict"),t&&n("已取消恢复","info"),!1;return c!==u&&r(l),M=u,z=a.address,y(!1),d("synced"),t&&n("已从云端恢复","success"),!0}catch(e){return d("error"),t?n(P(e,"云端恢复失败"),"error"):console.info(P(e,"云端恢复失败")),!1}finally{o(null)}},[n,r,v,y,N]),E=(0,s.useCallback)(()=>{let e=v(!1);if(e)try{let t=h.useAppStore.getState().notes,s=b(t,e.danger),a=new Blob([s],{type:"text/plain"}),r=URL.createObjectURL(a),i=document.createElement("a");i.href=r,i.download=`${e.address.slice(-4)}-most-notes-${new Date().toISOString().slice(0,10)}.txt`,i.click(),URL.revokeObjectURL(r),n("笔记已导出到本地","success")}catch(e){n(P(e,"导出失败"),"error")}},[n,v]),$=(0,s.useCallback)(()=>{let e=v(!1);if(!e)return;let t=document.createElement("input");t.type="file",t.accept=".txt",t.onchange=t=>{let s=t.target.files?.[0];if(!s)return;let a=new FileReader;a.onload=async()=>{try{let t=a.result,s=k(t,e.danger);if(h.useAppStore.getState().notes.length>0&&!window.confirm("恢复将覆盖当前本地笔记,是否继续?"))return void n("已取消恢复","info");r(s.notes),n("已从本地恢复笔记","success"),await N({silent:!0})}catch(e){n(P(e,"导入失败"),"error")}},a.readAsText(s)},t.click()},[n,r,v,N]);(0,s.useEffect)(()=>{if(!i)return;if(!e){z="",M="",x(!1),y(!1),d("disabled");return}if(z===e.address){x(!0),d(C?"conflict":"synced");return}let t=!1;return x(!1),A({manual:!1,uploadWhenMissing:!0}).finally(()=>{t||x(!0)}),()=>{t=!0}},[i,A,y,e]),(0,s.useEffect)(()=>{if(!e||!i||!f||(j.current+=1,j.current<=1))return;let t=window.setTimeout(async()=>{let e=h.useAppStore.getState().notes;await g(e)!==M&&await N({silent:!0})},900);return()=>window.clearTimeout(t)},[f,i,a,N,e]);let T=(0,s.useMemo)(()=>(function(e){switch(e){case"disabled":return"未登录";case"checking":return"检查中";case"uploading":return"同步中";case"restoring":return"恢复中";case"synced":return"已同步";case"conflict":return"有冲突";case"error":return"同步失败";default:return"待同步"}})(c),[c]);return{action:l,status:c,statusLabel:T,hasConflict:u,uploadNow:N,restoreFromCloud:A,exportLocalBackup:E,importLocalBackup:$}}],86041)},58559,e=>{"use strict";var t=e.i(18050),s=e.i(71645),n=e.i(70703),a=e.i(18566),r=e.i(11241),i=e.i(79490),l=e.i(26091),o=e.i(26067),c=e.i(56420);let d=(0,c.default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var u=e.i(6537),h=e.i(10566);let p=(0,c.default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var m=e.i(77071),f=e.i(66595),x=e.i(73474),j=e.i(63676),y=e.i(59665);e.i(4121);var b=e.i(88361),k=e.i(47910),g=e.i(57667),v=e.i(3593),N=e.i(71192),w=e.i(128),S=e.i(3789),C=e.i(42489),M=e.i(96013),z=e.i(86041);let P=(0,n.default)(()=>e.A(71504).then(e=>e.MilkdownEditor),{loadableGenerated:{modules:[36975]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"note-editor-loading",children:"加载编辑器..."})});function A(e){return e?new Date(e).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function E(e,t){return e instanceof Error?e.message:t}function $(){let e=(0,a.useRouter)(),n=(0,a.useSearchParams)(),c=(0,z.useNoteBackupSync)(),$=(0,v.useAppStore)(e=>e.addToast),T=(0,N.useUserStore)(e=>e.wallet),L=(0,N.useUserStore)(e=>e.openLoginModal),O=(0,v.useAppStore)(e=>e.notes),U=(0,v.useAppStore)(e=>e.notesPath),R=(0,v.useAppStore)(e=>e.setNotesPath),_=(0,v.useAppStore)(e=>e.saveNote),B=(0,v.useAppStore)(e=>e.deleteNote),D=(0,v.useAppStore)(e=>e.renameNote),F=(0,v.useAppStore)(e=>e.localDataReady),I=n.get("cid")||"",W=O.find(e=>e.cid===I),H=!!I,[V,q]=(0,s.useState)(""),[G,J]=(0,s.useState)(null),[Z,K]=(0,s.useState)(null),[X,Q]=(0,s.useState)(null),[Y,ee]=(0,s.useState)(""),[et,es]=(0,s.useState)(""),[en,ea]=(0,s.useState)(""),[er,ei]=(0,s.useState)("");(0,s.useEffect)(()=>{if(!I){ea(""),ei("");return}if(!W){ea(""),ei(F?"笔记不存在":"");return}if(W.content.startsWith("mp://1")){if(!T){ea(""),ei("请先登录 Web3 账号以解密此笔记");return}let e=(0,w.mostDecode)(W.content,T.danger);if(!e){ea(""),ei("无法解密,请确认当前 Web3 账号正确");return}ea(e),ei("");return}ea(W.content||""),ei("")},[I,F,W,T]);let el=(0,s.useMemo)(()=>(0,S.filterNotesByPath)(O,U,V),[O,U,V]),eo=function(e=""){return(0,S.normalizeNotePath)(e).split("/").filter(Boolean).at(-1)||"全部笔记"}((0,S.normalizeNotePath)(U)),ec=el.filter(e=>"file"===e.type).length,ed=(0,s.useMemo)(()=>{let e=U.split("/").filter(Boolean);return[{label:"全部笔记",path:""},...e.map((t,s)=>({label:t,path:e.slice(0,s+1).join("/")}))]},[U]);function eu(t){e.push(`/note/edit?cid=${encodeURIComponent(t.cid)}`)}function eh(){return!!T||($("请先登录 Web3 账号","warning"),L(),!1)}function ep(){J({title:"新建笔记",placeholder:"笔记名称",confirmText:"创建",onConfirm:async t=>{if(eh())try{let s=await _({name:t,path:U,content:"",isSecret:!1});J(null),$("笔记已创建","success"),await c.uploadNow({silent:!0}),e.push(`/note/edit?cid=${encodeURIComponent(s)}`)}catch(e){$(E(e,"创建失败"),"error")}}})}async function em(){if(X)try{let e="directory"===X.type?(0,S.normalizeNotePath)(X.path?`${X.path}/${X.name}`:X.name):(0,S.getNoteFullPath)(X);D(e,et,Y),Q(null),$("已重命名","success"),await c.uploadNow({silent:!0})}catch(e){$(E(e,"重命名失败"),"error")}}let ef=(0,t.jsxs)("div",{className:"note-header-title",children:[(0,t.jsx)("h2",{className:"header-title",children:"笔记工作台"}),(0,t.jsxs)("span",{children:[O.length," 篇笔记"]})]}),ex=(0,t.jsxs)("div",{className:"note-theme-wrap",children:[(0,t.jsxs)("div",{className:"note-header-actions",children:[(0,t.jsxs)("button",{className:"btn btn-secondary",onClick:function(){J({title:"新建文件夹",placeholder:"文件夹名称",confirmText:"创建",onConfirm:async e=>{if(eh())try{await _({name:"index",path:(0,S.normalizeNotePath)(`${U}/${e}`),content:"",isSecret:!1}),J(null),$("文件夹已创建","success"),await c.uploadNow({silent:!0})}catch(e){$(E(e,"创建失败"),"error")}}})},children:[(0,t.jsx)(d,{size:16}),"文件夹"]}),(0,t.jsxs)("button",{className:"btn btn-primary",onClick:ep,children:[(0,t.jsx)(m.Plus,{size:16}),"新笔记"]})]}),(0,t.jsx)(C.NoteMoreMenu,{sync:c})]}),ej=(0,t.jsxs)("section",{className:"note-list-panel note-sidebar-list","aria-label":"笔记列表",children:[(0,t.jsxs)("div",{className:"note-list-header",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"note-kicker",children:"当前位置"}),(0,t.jsx)("h3",{children:eo})]}),(0,t.jsxs)("span",{className:"note-count",children:[ec," 篇"]})]}),(0,t.jsxs)("div",{className:"note-search",children:[(0,t.jsx)(f.Search,{size:16}),(0,t.jsx)("input",{className:"input input-flex",value:V,onChange:e=>q(e.target.value),placeholder:"搜索笔记"})]}),!V&&(0,t.jsx)("div",{className:"note-breadcrumbs",children:ed.map((e,n)=>(0,t.jsxs)(s.default.Fragment,{children:[n>0&&(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("button",{onClick:()=>R(e.path),children:e.label})]},e.path||"root"))}),0===el.length?(0,t.jsxs)("div",{className:"note-empty-state",children:[(0,t.jsx)(h.NotebookPen,{size:32}),(0,t.jsx)("p",{children:V?"未找到笔记":"还没有笔记"}),!V&&(0,t.jsxs)("button",{className:"btn btn-primary",onClick:ep,children:[(0,t.jsx)(m.Plus,{size:16}),"新笔记"]})]}):(0,t.jsx)("div",{className:"note-list",children:el.map(s=>(0,t.jsxs)("article",{className:`note-list-item ${"file"===s.type&&s.cid===I?"active":""}`,children:[(0,t.jsxs)("button",{className:`note-list-item-main ${"directory"===s.type?"folder":""}`,onClick:()=>{if("directory"===s.type)R((0,S.normalizeNotePath)(s.path?`${s.path}/${s.name}`:s.name));else e.push(`/note/?cid=${encodeURIComponent(s.cid)}`)},children:[(0,t.jsx)("span",{className:"note-list-icon",children:"directory"===s.type?(0,t.jsx)(o.Folder,{size:18}):s.isSecret?(0,t.jsx)(u.Lock,{size:18}):(0,t.jsx)(l.FileText,{size:18})}),(0,t.jsxs)("span",{className:"note-list-copy",children:[(0,t.jsx)("span",{className:"note-list-name",children:s.name}),"file"===s.type?(0,t.jsx)("span",{className:"note-list-preview",children:s.isSecret||s.content.startsWith("mp://1")?"私密内容已加密":String(s.content||"").replace(/```[\s\S]*?```/g," ").replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/[#>*_`~|-]/g," ").replace(/\s+/g," ").trim()||"空白笔记"}):(0,t.jsx)("span",{className:"note-list-preview",children:"文件夹"})]}),"file"===s.type&&(0,t.jsx)("span",{className:"note-list-date",children:A(s.updated_at)})]}),(0,t.jsxs)("div",{className:"note-list-actions",children:["file"===s.type&&(0,t.jsx)("button",{className:"btn btn-icon",onClick:()=>eu(s),title:"编辑",children:(0,t.jsx)(i.Edit2,{size:14})}),(0,t.jsx)("button",{className:"btn btn-icon",onClick:()=>{Q(s),ee(s.name),es(s.path||"")},title:"重命名",children:(0,t.jsx)(p,{size:14})}),(0,t.jsx)("button",{className:"btn btn-icon",onClick:()=>{let t;K({title:(t="directory"===s.type)?"删除文件夹":"删除笔记",message:`确定要删除「${s.name}」吗?此操作不可撤销。`,confirmText:"删除",onConfirm:async()=>{B(t?void 0:s.cid,s.path,s.name),K(null),$("已删除","success"),await c.uploadNow({silent:!0}),"file"===s.type&&s.cid===I&&e.push("/note/")}})},title:"删除",children:(0,t.jsx)(x.Trash2,{size:14})})]})]},`${s.cid}:${s.path}:${s.name}`))})]});return(0,t.jsxs)(y.default,{sidebar:()=>(0,t.jsx)(M.NoteSidebar,{children:ej}),headerTitle:ef,headerRight:ex,children:[(0,t.jsx)("main",{className:`note-page note-browser-page ${H?"has-editor":""}`,children:(0,t.jsx)("section",{className:"note-workspace",children:(0,t.jsx)("section",{className:"note-editor-panel","aria-label":"笔记阅读器",children:H?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"note-editor-panel-header",children:[(0,t.jsxs)("div",{className:"note-editor-title-area",children:[(0,t.jsx)("span",{className:"note-kicker",children:"阅读模式"}),(0,t.jsx)("h3",{children:W?.name||"未命名笔记"}),W&&(0,t.jsxs)("div",{className:"note-editor-info",children:[(0,t.jsx)("span",{children:W.path||"全部笔记"}),(0,t.jsx)("span",{children:W.isSecret||W.content.startsWith("mp://1")?"私密":"公开"}),(0,t.jsx)("span",{children:A(W.updated_at)})]})]}),(0,t.jsxs)("div",{className:"note-editor-actions",children:[(0,t.jsxs)("button",{className:"btn btn-secondary",onClick:()=>e.push("/note/"),children:[(0,t.jsx)(r.ArrowLeft,{size:16}),"关闭"]}),W&&(0,t.jsxs)("button",{className:"btn btn-primary",onClick:()=>eu(W),disabled:!!er,children:[(0,t.jsx)(i.Edit2,{size:16}),"编辑"]})]})]}),er?(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(u.Lock,{size:36}),(0,t.jsx)("p",{children:er})]}):W?(0,t.jsx)("div",{className:"note-editor-frame reading",children:(0,t.jsx)(P,{content:en,readOnly:!0,className:"milkdown-editor"})}):(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(h.NotebookPen,{size:36}),(0,t.jsx)("p",{children:F?"笔记不存在":"加载中..."})]})]}):(0,t.jsxs)("div",{className:"note-editor-empty",children:[(0,t.jsx)("div",{className:"note-editor-empty-icon",children:(0,t.jsx)(h.NotebookPen,{size:32})}),(0,t.jsx)("h3",{children:"没有打开的笔记"}),(0,t.jsx)("p",{children:O.length>0?"选择一篇笔记继续":"创建第一篇笔记"}),(0,t.jsxs)("button",{className:"btn btn-primary",onClick:ep,children:[(0,t.jsx)(m.Plus,{size:16}),"新笔记"]})]})})})}),G&&(0,t.jsx)(k.InputModal,{title:G.title,placeholder:G.placeholder,defaultValue:G.defaultValue,confirmText:G.confirmText,onConfirm:G.onConfirm,onClose:()=>J(null)}),Z&&(0,t.jsx)(b.ConfirmModal,{title:Z.title,message:Z.message,confirmText:Z.confirmText,danger:!0,onConfirm:Z.onConfirm,onClose:()=>K(null)}),X&&(0,t.jsx)(g.ModalOverlay,{onClose:()=>Q(null),children:(0,t.jsxs)("div",{className:"note-rename-modal",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"modal-header",children:[(0,t.jsx)("h3",{children:"重命名 / 移动"}),(0,t.jsx)("button",{className:"btn btn-icon",onClick:()=>Q(null),children:(0,t.jsx)(j.X,{size:18})})]}),(0,t.jsx)("input",{className:"input input-compact",value:et,onChange:e=>es(e.target.value),placeholder:"目录路径"}),(0,t.jsx)("input",{className:"input input-compact",value:Y,onChange:e=>ee(e.target.value),placeholder:"名称"}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"btn btn-secondary",onClick:()=>Q(null),children:"取消"}),(0,t.jsx)("button",{className:"btn btn-primary",onClick:em,children:"确认"})]})]})})]})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{className:"note-editor-loading",children:"加载中..."}),children:(0,t.jsx)($,{})})}],58559)},71504,e=>{e.v(t=>Promise.all(["static/chunks/0h4r.qtmpa6eh.js","static/chunks/07r9nn-pzlgg1.js","static/chunks/0usvo~vu7r8np.js","static/chunks/0.w4hkvap~bva.js"].map(t=>e.l(t))).then(()=>t(36975)))}]);
|