most-box 0.1.3 → 0.1.5

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.
Files changed (205) hide show
  1. package/README.md +7 -4
  2. package/electron/main.js +31 -10
  3. package/out/404/index.html +2 -2
  4. package/out/404.html +2 -2
  5. package/out/__next.__PAGE__.txt +6 -6
  6. package/out/__next._full.txt +15 -15
  7. package/out/__next._head.txt +3 -3
  8. package/out/__next._index.txt +7 -7
  9. package/out/__next._tree.txt +4 -4
  10. package/out/_next/static/chunks/{0hpev4am9jpmu.css → 0.4ov9319fecg.css} +1 -1
  11. package/out/_next/static/chunks/0._8s6pbfw.xk.js +1 -0
  12. package/out/_next/static/chunks/02jvyg27pp0mz.js +1 -0
  13. package/out/_next/static/chunks/02zzxfop_k6tl.css +1 -0
  14. package/out/_next/static/chunks/06lttvu7563zo.css +1 -0
  15. package/out/_next/static/chunks/{0pt.5cg1t09qs.js → 08qqf0rsi3oot.js} +1 -1
  16. package/out/_next/static/chunks/{0adx~d-j05c9d.css → 09h7l4i38xc7q.css} +1 -1
  17. package/out/_next/static/chunks/09hqx79-jkvm_.css +1 -0
  18. package/out/_next/static/chunks/09vcm1ku9k7o8.js +1 -0
  19. package/out/_next/static/chunks/0c6e_d2jq179x.js +1 -0
  20. package/out/_next/static/chunks/0ccalho416.d7.js +1 -0
  21. package/out/_next/static/chunks/0exj_tg.ew-t3.js +1 -0
  22. package/out/_next/static/chunks/0f-wz5d~tv-r4.js +1 -0
  23. package/out/_next/static/chunks/0f0jhsujtf-61.js +1 -0
  24. package/out/_next/static/chunks/0hyds~bp.auvh.js +1 -0
  25. package/out/_next/static/chunks/0ig8a4sazk3~2.css +1 -0
  26. package/out/_next/static/chunks/0iq1h7g4dudg8.js +1 -0
  27. package/out/_next/static/chunks/0knnzo9aih48r.js +1 -0
  28. package/out/_next/static/chunks/0nzyk~sg_tn._.js +1 -0
  29. package/out/_next/static/chunks/{12nr19.nnn6s3.js → 0t_3xxx4zkerp.js} +2 -2
  30. package/out/_next/static/chunks/0w~2fjq86t7c7.css +1 -0
  31. package/out/_next/static/chunks/0xrqerhosrp9~.js +1 -0
  32. package/out/_next/static/chunks/0xx_10jns1.s7.css +1 -0
  33. package/out/_next/static/chunks/14-fm9r_mom81.js +1 -0
  34. package/out/_next/static/chunks/14jhy~xia8lh8.js +1 -0
  35. package/out/_next/static/chunks/{turbopack-0xta0kqwzkf28.js → turbopack-05qngmxam3ar~.js} +1 -1
  36. package/out/_not-found/__next._full.txt +12 -12
  37. package/out/_not-found/__next._head.txt +3 -3
  38. package/out/_not-found/__next._index.txt +7 -7
  39. package/out/_not-found/__next._not-found.__PAGE__.txt +4 -4
  40. package/out/_not-found/__next._not-found.txt +3 -3
  41. package/out/_not-found/__next._tree.txt +2 -2
  42. package/out/_not-found/index.html +2 -2
  43. package/out/_not-found/index.txt +12 -12
  44. package/out/admin/__next._full.txt +14 -14
  45. package/out/admin/__next._head.txt +3 -3
  46. package/out/admin/__next._index.txt +7 -7
  47. package/out/admin/__next._tree.txt +3 -3
  48. package/out/admin/__next.admin.__PAGE__.txt +4 -4
  49. package/out/admin/__next.admin.txt +4 -4
  50. package/out/admin/index.html +2 -2
  51. package/out/admin/index.txt +14 -14
  52. package/out/app/__next._full.txt +13 -13
  53. package/out/app/__next._head.txt +3 -3
  54. package/out/app/__next._index.txt +7 -7
  55. package/out/app/__next._tree.txt +2 -2
  56. package/out/app/__next.app.__PAGE__.txt +4 -4
  57. package/out/app/__next.app.txt +3 -3
  58. package/out/app/index.html +2 -2
  59. package/out/app/index.txt +13 -13
  60. package/out/chat/__next._full.txt +14 -14
  61. package/out/chat/__next._head.txt +3 -3
  62. package/out/chat/__next._index.txt +7 -7
  63. package/out/chat/__next._tree.txt +3 -3
  64. package/out/chat/__next.chat.__PAGE__.txt +4 -4
  65. package/out/chat/__next.chat.txt +4 -4
  66. package/out/chat/index.html +2 -2
  67. package/out/chat/index.txt +14 -14
  68. package/out/chat/join/__next._full.txt +14 -14
  69. package/out/chat/join/__next._head.txt +3 -3
  70. package/out/chat/join/__next._index.txt +7 -7
  71. package/out/chat/join/__next._tree.txt +3 -3
  72. package/out/chat/join/__next.chat.join.__PAGE__.txt +4 -4
  73. package/out/chat/join/__next.chat.join.txt +3 -3
  74. package/out/chat/join/__next.chat.txt +4 -4
  75. package/out/chat/join/index.html +2 -2
  76. package/out/chat/join/index.txt +14 -14
  77. package/out/download/__next._full.txt +34 -36
  78. package/out/download/__next._head.txt +3 -3
  79. package/out/download/__next._index.txt +7 -7
  80. package/out/download/__next._tree.txt +4 -4
  81. package/out/download/__next.download.__PAGE__.txt +7 -7
  82. package/out/download/__next.download.txt +3 -3
  83. package/out/download/index.html +2 -2
  84. package/out/download/index.txt +34 -36
  85. package/out/favicon.ico +0 -0
  86. package/out/game/__next._full.txt +20 -0
  87. package/out/game/__next._head.txt +5 -0
  88. package/out/game/__next._index.txt +9 -0
  89. package/out/game/__next._tree.txt +5 -0
  90. package/out/game/__next.game.__PAGE__.txt +6 -0
  91. package/out/game/__next.game.txt +5 -0
  92. package/out/game/gandengyan/__next._full.txt +26 -0
  93. package/out/game/gandengyan/__next._head.txt +5 -0
  94. package/out/game/gandengyan/__next._index.txt +9 -0
  95. package/out/game/gandengyan/__next._tree.txt +6 -0
  96. package/out/game/gandengyan/__next.game.gandengyan.__PAGE__.txt +10 -0
  97. package/out/game/gandengyan/__next.game.gandengyan.txt +5 -0
  98. package/out/game/gandengyan/__next.game.txt +5 -0
  99. package/out/game/gandengyan/index.html +15 -0
  100. package/out/game/gandengyan/index.txt +26 -0
  101. package/out/game/index.html +1 -0
  102. package/out/game/index.txt +20 -0
  103. package/out/game/zhajinhua/__next._full.txt +25 -0
  104. package/out/game/zhajinhua/__next._head.txt +5 -0
  105. package/out/game/zhajinhua/__next._index.txt +9 -0
  106. package/out/game/zhajinhua/__next._tree.txt +5 -0
  107. package/out/game/zhajinhua/__next.game.txt +5 -0
  108. package/out/game/zhajinhua/__next.game.zhajinhua.__PAGE__.txt +9 -0
  109. package/out/game/zhajinhua/__next.game.zhajinhua.txt +5 -0
  110. package/out/game/zhajinhua/index.html +15 -0
  111. package/out/game/zhajinhua/index.txt +25 -0
  112. package/out/index.html +2 -2
  113. package/out/index.txt +15 -15
  114. package/out/logo-512.png +0 -0
  115. package/out/logo.ico +0 -0
  116. package/out/logo.svg +12 -0
  117. package/out/note/__next._full.txt +13 -13
  118. package/out/note/__next._head.txt +3 -3
  119. package/out/note/__next._index.txt +7 -7
  120. package/out/note/__next._tree.txt +2 -2
  121. package/out/note/__next.note.__PAGE__.txt +4 -4
  122. package/out/note/__next.note.txt +3 -3
  123. package/out/note/index.html +2 -2
  124. package/out/note/index.txt +13 -13
  125. package/out/ping/__next._full.txt +14 -14
  126. package/out/ping/__next._head.txt +3 -3
  127. package/out/ping/__next._index.txt +7 -7
  128. package/out/ping/__next._tree.txt +3 -3
  129. package/out/ping/__next.ping.__PAGE__.txt +5 -5
  130. package/out/ping/__next.ping.txt +3 -3
  131. package/out/ping/index.html +2 -2
  132. package/out/ping/index.txt +14 -14
  133. package/out/web3/__next._full.txt +13 -13
  134. package/out/web3/__next._head.txt +3 -3
  135. package/out/web3/__next._index.txt +7 -7
  136. package/out/web3/__next._tree.txt +2 -2
  137. package/out/web3/__next.web3.__PAGE__.txt +4 -4
  138. package/out/web3/__next.web3.txt +3 -3
  139. package/out/web3/ed25519/__next._full.txt +11 -11
  140. package/out/web3/ed25519/__next._head.txt +3 -3
  141. package/out/web3/ed25519/__next._index.txt +7 -7
  142. package/out/web3/ed25519/__next._tree.txt +2 -2
  143. package/out/web3/ed25519/__next.web3.ed25519.__PAGE__.txt +2 -2
  144. package/out/web3/ed25519/__next.web3.ed25519.txt +3 -3
  145. package/out/web3/ed25519/__next.web3.txt +3 -3
  146. package/out/web3/ed25519/index.html +1 -1
  147. package/out/web3/ed25519/index.txt +11 -11
  148. package/out/web3/index.html +2 -2
  149. package/out/web3/index.txt +13 -13
  150. package/out/web3/tools/__next._full.txt +11 -11
  151. package/out/web3/tools/__next._head.txt +3 -3
  152. package/out/web3/tools/__next._index.txt +7 -7
  153. package/out/web3/tools/__next._tree.txt +2 -2
  154. package/out/web3/tools/__next.web3.tools.__PAGE__.txt +2 -2
  155. package/out/web3/tools/__next.web3.tools.txt +3 -3
  156. package/out/web3/tools/__next.web3.txt +3 -3
  157. package/out/web3/tools/index.html +1 -1
  158. package/out/web3/tools/index.txt +11 -11
  159. package/package.json +6 -5
  160. package/public/favicon.ico +0 -0
  161. package/public/logo-512.png +0 -0
  162. package/public/logo.ico +0 -0
  163. package/public/logo.svg +12 -0
  164. package/server/index.js +0 -8
  165. package/server/src/config.js +1 -1
  166. package/server/src/core/gameRoom.js +222 -0
  167. package/server/src/core/zhajinhua.js +563 -0
  168. package/server/src/games/gandengyan.js +354 -413
  169. package/server/src/http/app.js +22 -14
  170. package/server/src/http/uploads.js +1 -0
  171. package/server/src/index.js +275 -90
  172. package/server/src/utils/avatar.js +3 -2
  173. package/out/_next/static/chunks/04mo7rr..0_1q.js +0 -1
  174. package/out/_next/static/chunks/06rf3qq5ggs6v.js +0 -1
  175. package/out/_next/static/chunks/07td.jq7xff84.css +0 -1
  176. package/out/_next/static/chunks/0_0oph_z1az14.js +0 -1
  177. package/out/_next/static/chunks/0ao1lbi4b.sfa.js +0 -1
  178. package/out/_next/static/chunks/0cl7d~7abnk_p.css +0 -1
  179. package/out/_next/static/chunks/0d306t1wvjpdx.js +0 -1
  180. package/out/_next/static/chunks/0g_a~e050bgzg.css +0 -1
  181. package/out/_next/static/chunks/0m_5nb6x8qy._.js +0 -1
  182. package/out/_next/static/chunks/0n.ayxmsar6e5.js +0 -1
  183. package/out/_next/static/chunks/0olqjomda37-e.js +0 -1
  184. package/out/_next/static/chunks/0qgx9t4jx16ua.css +0 -1
  185. package/out/_next/static/chunks/0s~g.l~x049o2.js +0 -1
  186. package/out/_next/static/chunks/0voe1.ttrh84k.css +0 -1
  187. package/out/_next/static/chunks/0wtf0xsiicxx6.js +0 -1
  188. package/out/_next/static/chunks/0x.ky97owcxxs.js +0 -1
  189. package/out/_next/static/chunks/0ysj5b94vu4ri.js +0 -1
  190. package/out/_next/static/chunks/153-sz7s.qml2.js +0 -1
  191. package/out/_next/static/chunks/17cwkb2yn_akx.js +0 -1
  192. package/out/_next/static/chunks/184hxsuf-5c84.js +0 -1
  193. package/out/gandengyan/__next._full.txt +0 -25
  194. package/out/gandengyan/__next._head.txt +0 -5
  195. package/out/gandengyan/__next._index.txt +0 -9
  196. package/out/gandengyan/__next._tree.txt +0 -5
  197. package/out/gandengyan/__next.gandengyan.__PAGE__.txt +0 -10
  198. package/out/gandengyan/__next.gandengyan.txt +0 -5
  199. package/out/gandengyan/index.html +0 -15
  200. package/out/gandengyan/index.txt +0 -25
  201. /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → 2smv1H9Y4Z2Ri-SL-UFgR}/_buildManifest.js +0 -0
  202. /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → 2smv1H9Y4Z2Ri-SL-UFgR}/_clientMiddlewareManifest.js +0 -0
  203. /package/out/_next/static/{aPEZ4zaaR5W3WpSZ0dFsa → 2smv1H9Y4Z2Ri-SL-UFgR}/_ssgManifest.js +0 -0
  204. /package/out/{pwa-512x512.png → avatar.png} +0 -0
  205. /package/public/{pwa-512x512.png → avatar.png} +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(t,e,r)=>{e.exports=t.r(76562)},31214,t=>{"use strict";let e=(0,t.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"}]]);t.s(["Cloud",0,e],31214)},10566,t=>{"use strict";let e=(0,t.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"}]]);t.s(["NotebookPen",0,e],10566)},66595,t=>{"use strict";let e=(0,t.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);t.s(["Search",0,e],66595)},67927,t=>{"use strict";let e=(0,t.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);t.s(["ChevronRight",0,e],67927)},26067,t=>{"use strict";let e=(0,t.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"}]]);t.s(["Folder",0,e],26067)},25981,t=>{"use strict";let e=(0,t.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"}]]);t.s(["Upload",0,e],25981)},62368,t=>{"use strict";let e=(0,t.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"}]]);t.s(["Download",0,e],62368)},26091,t=>{"use strict";let e=(0,t.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"}]]);t.s(["FileText",0,e],26091)},73474,t=>{"use strict";let e=(0,t.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"}]]);t.s(["Trash2",0,e],73474)},56522,t=>{"use strict";let e=(0,t.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"}]]);t.s(["Save",0,e],56522)},53138,51757,t=>{"use strict";var e=t.i(56420);let r=(0,e.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"}]]);t.s(["AlertTriangle",0,r],53138);let a=(0,e.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);t.s(["CheckCircle2",0,a],51757)},96699,t=>{"use strict";let e=(0,t.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"}]]);t.s(["Moon",0,e],96699)},35965,t=>{"use strict";let e=(0,t.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"}]]);t.s(["Sun",0,e],35965)},11241,t=>{"use strict";let e=(0,t.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);t.s(["ArrowLeft",0,e],11241)},59665,5142,t=>{"use strict";var e=t.i(18050),r=t.i(71645);let a=(0,t.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);function n(t=!1,e={}){let[a,s]=(0,r.useState)(t),i=(0,r.useCallback)(()=>{s(t=>t||(e.onOpen?.(),!0))},[e.onOpen]),u=(0,r.useCallback)(()=>{s(t=>t?(e.onClose?.(),!1):t)},[e.onClose]);return[a,{open:i,close:u,toggle:(0,r.useCallback)(()=>{a?u():i()},[u,i,a]),set:s}]}t.s(["useDisclosure",0,n],5142);let s=(0,r.createContext)(null);t.s(["default",0,function({sidebar:t,headerTitle:i,headerRight:u,children:c}){let[h,o]=n(!1),[l,d]=(0,r.useState)(!1),f=function(t,{getInitialValueInEffect:e}={getInitialValueInEffect:!0}){let[a,n]=(0,r.useState)(e?void 0:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(t).matches);return(0,r.useEffect)(()=>{try{if("matchMedia"in window){let e=window.matchMedia(t);n(e.matches);let r=t=>n(t.matches);return e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}}}catch(t){return}},[t]),a||!1}("(max-width: 768px)"),p=()=>{f?o.open():d(!1)};return(0,e.jsx)(s.Provider,{value:{closeSidebar:o.close,openSidebar:p,isSidebarVisible:f?h:!l},children:(0,e.jsxs)("div",{className:"app-layout",children:[(0,e.jsx)("div",{className:`sidebar-overlay ${h?"visible":""}`,onClick:()=>o.close()}),(0,e.jsx)("div",{className:`sidebar ${h?"open":""} ${l?"collapsed":""}`,children:t({closeSidebar:o.close,openSidebar:p})}),(0,e.jsxs)("div",{className:"main-content",children:[(0,e.jsxs)("header",{className:"app-header",children:[(0,e.jsxs)("div",{className:"header-left",children:[(0,e.jsx)("button",{onClick:()=>{f?o.toggle():d(!l)},className:"btn btn-icon sidebar-toggle-btn","aria-label":f?"打开菜单":l?"展开侧边栏":"收起侧边栏",children:(0,e.jsx)(a,{size:16})}),i]}),(0,e.jsx)("div",{className:"header-right",children:u})]}),c]})]})})},"useAppShell",0,function(){let t=(0,r.useContext)(s);if(!t)throw Error("useAppShell must be used within AppShell");return t}],59665)},27648,t=>{"use strict";var e=t.i(18050),r=t.i(93957),a=t.i(71192);t.s(["default",0,function({className:t=""}){let n=(0,a.useUserStore)(t=>t.identity),s=(0,a.useUserStore)(t=>t.openLoginModal),i=(0,a.useUserStore)(t=>t.logoutUser);return(0,e.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${t}`,children:[(0,e.jsxs)("div",{className:"user-info",children:[(0,e.jsx)("img",{className:"user-avatar-img",src:(0,r.generateAvatar)(n?.address,n?.avatar),alt:"avatar"}),(0,e.jsx)("span",{className:"user-name",title:n?.address,children:n?.displayName||"未登录"})]}),n?(0,e.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:i,children:"退出"}):(0,e.jsx)("button",{className:"btn btn-primary login-btn",onClick:s,children:"登录"})]})}])},39626,t=>{"use strict";var e=t.i(18050);let r=(0,t.i(56420).default)("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);var a=t.i(59665);t.s(["default",0,function({label:t="打开侧边栏",className:n="",variant:s="primary"}){let{isSidebarVisible:i,openSidebar:u}=(0,a.useAppShell)();return i?null:(0,e.jsxs)("button",{type:"button",className:`btn ${"primary"===s?"btn-primary":""} sidebar-open-hint ${n}`.trim(),onClick:u,children:[(0,e.jsx)(r,{size:16}),t]})}],39626)},77071,t=>{"use strict";let e=(0,t.i(56420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);t.s(["Plus",0,e],77071)},22315,(t,e,r)=>{t.e,e.exports=function(){"use strict";var t="millisecond",e="second",r="minute",a="hour",n="week",s="month",i="quarter",u="year",c="date",h="Invalid Date",o=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(t,e,r){var a=String(t);return!a||a.length>=e?t:""+Array(e+1-a.length).join(r)+t},f="en",p={};p[f]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}};var y="$isDayjsObject",m=function(t){return t instanceof $||!(!t||!t[y])},v=function t(e,r,a){var n;if(!e)return f;if("string"==typeof e){var s=e.toLowerCase();p[s]&&(n=s),r&&(p[s]=r,n=s);var i=e.split("-");if(!n&&i.length>1)return t(i[0])}else{var u=e.name;p[u]=e,n=u}return!a&&n&&(f=n),n||!a&&f},k=function(t,e){if(m(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new $(r)},M={s:d,z:function(t){var e=-t.utcOffset(),r=Math.abs(e);return(e<=0?"+":"-")+d(Math.floor(r/60),2,"0")+":"+d(r%60,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var a=12*(r.year()-e.year())+(r.month()-e.month()),n=e.clone().add(a,s),i=r-n<0,u=e.clone().add(a+(i?-1:1),s);return+(-(a+(r-n)/(i?n-u:u-n))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return({M:s,y:u,w:n,d:"day",D:c,h:a,m:r,s:e,ms:t,Q:i})[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}};M.l=v,M.i=m,M.w=function(t,e){return k(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var $=function(){function d(t){this.$L=v(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[y]=!0}var f=d.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(M.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var a=e.match(o);if(a){var n=a[2]-1||0,s=(a[7]||"0").substring(0,3);return r?new Date(Date.UTC(a[1],n,a[3]||1,a[4]||0,a[5]||0,a[6]||0,s)):new Date(a[1],n,a[3]||1,a[4]||0,a[5]||0,a[6]||0,s)}}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return M},f.isValid=function(){return this.$d.toString()!==h},f.isSame=function(t,e){var r=k(t);return this.startOf(e)<=r&&r<=this.endOf(e)},f.isAfter=function(t,e){return k(t)<this.startOf(e)},f.isBefore=function(t,e){return this.endOf(e)<k(t)},f.$g=function(t,e,r){return M.u(t)?this[e]:this.set(r,t)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(t,i){var h=this,o=!!M.u(i)||i,l=M.p(t),d=function(t,e){var r=M.w(h.$u?Date.UTC(h.$y,e,t):new Date(h.$y,e,t),h);return o?r:r.endOf("day")},f=function(t,e){return M.w(h.toDate()[t].apply(h.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(e)),h)},p=this.$W,y=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(l){case u:return o?d(1,0):d(31,11);case s:return o?d(1,y):d(0,y+1);case n:var k=this.$locale().weekStart||0,$=(p<k?p+7:p)-k;return d(o?m-$:m+(6-$),y);case"day":case c:return f(v+"Hours",0);case a:return f(v+"Minutes",1);case r:return f(v+"Seconds",2);case e:return f(v+"Milliseconds",3);default:return this.clone()}},f.endOf=function(t){return this.startOf(t,!1)},f.$set=function(n,i){var h,o=M.p(n),l="set"+(this.$u?"UTC":""),d=((h={}).day=l+"Date",h[c]=l+"Date",h[s]=l+"Month",h[u]=l+"FullYear",h[a]=l+"Hours",h[r]=l+"Minutes",h[e]=l+"Seconds",h[t]=l+"Milliseconds",h)[o],f="day"===o?this.$D+(i-this.$W):i;if(o===s||o===u){var p=this.clone().set(c,1);p.$d[d](f),p.init(),this.$d=p.set(c,Math.min(this.$D,p.daysInMonth())).$d}else d&&this.$d[d](f);return this.init(),this},f.set=function(t,e){return this.clone().$set(t,e)},f.get=function(t){return this[M.p(t)]()},f.add=function(t,i){var c,h=this;t=Number(t);var o=M.p(i),l=function(e){var r=k(h);return M.w(r.date(r.date()+Math.round(e*t)),h)};if(o===s)return this.set(s,this.$M+t);if(o===u)return this.set(u,this.$y+t);if("day"===o)return l(1);if(o===n)return l(7);var d=((c={})[r]=6e4,c[a]=36e5,c[e]=1e3,c)[o]||1,f=this.$d.getTime()+t*d;return M.w(f,this)},f.subtract=function(t,e){return this.add(-1*t,e)},f.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var a=t||"YYYY-MM-DDTHH:mm:ssZ",n=M.z(this),s=this.$H,i=this.$m,u=this.$M,c=r.weekdays,o=r.months,d=r.meridiem,f=function(t,r,n,s){return t&&(t[r]||t(e,a))||n[r].slice(0,s)},p=function(t){return M.s(s%12||12,t,"0")},y=d||function(t,e,r){var a=t<12?"AM":"PM";return r?a.toLowerCase():a};return a.replace(l,function(t,a){return a||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return M.s(e.$y,4,"0");case"M":return u+1;case"MM":return M.s(u+1,2,"0");case"MMM":return f(r.monthsShort,u,o,3);case"MMMM":return f(o,u);case"D":return e.$D;case"DD":return M.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return f(r.weekdaysMin,e.$W,c,2);case"ddd":return f(r.weekdaysShort,e.$W,c,3);case"dddd":return c[e.$W];case"H":return String(s);case"HH":return M.s(s,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return y(s,i,!0);case"A":return y(s,i,!1);case"m":return String(i);case"mm":return M.s(i,2,"0");case"s":return String(e.$s);case"ss":return M.s(e.$s,2,"0");case"SSS":return M.s(e.$ms,3,"0");case"Z":return n}return null}(t)||n.replace(":","")})},f.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},f.diff=function(t,c,h){var o,l=this,d=M.p(c),f=k(t),p=(f.utcOffset()-this.utcOffset())*6e4,y=this-f,m=function(){return M.m(l,f)};switch(d){case u:o=m()/12;break;case s:o=m();break;case i:o=m()/3;break;case n:o=(y-p)/6048e5;break;case"day":o=(y-p)/864e5;break;case a:o=y/36e5;break;case r:o=y/6e4;break;case e:o=y/1e3;break;default:o=y}return h?o:M.a(o)},f.daysInMonth=function(){return this.endOf(s).$D},f.$locale=function(){return p[this.$L]},f.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),a=v(t,e,!0);return a&&(r.$L=a),r},f.clone=function(){return M.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},d}(),g=$.prototype;return k.prototype=g,[["$ms",t],["$s",e],["$m",r],["$H",a],["$W","day"],["$M",s],["$y",u],["$D",c]].forEach(function(t){g[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),k.extend=function(t,e){return t.$i||(t(e,$,k),t.$i=!0),k},k.locale=v,k.isDayjs=m,k.unix=function(t){return k(1e3*t)},k.en=p[f],k.Ls=p,k.p={},k}()},16327,6537,77816,t=>{"use strict";var e=t.i(56420);let r=(0,e.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);t.s(["ChevronDown",0,r],16327);let a=(0,e.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"}]]);t.s(["Lock",0,a],6537);var n=t.i(22315);function s(t){let e;if(!t)return"";let r=(0,n.default)(Number(t)),a=r.hour();return e=a>=0&&a<3?"凌晨":a>=3&&a<6?"拂晓":a>=6&&a<9?"早晨":a>=9&&a<12?"上午":a>=12&&a<15?"下午":a>=15&&a<18?"傍晚":a>=18&&a<21?"晚上":"深夜",r.format(`YYYY年M月D日 ${e}h:m`)}t.s(["formatDate",0,s,"formatTime",0,s],77816)},71504,t=>{t.v(e=>Promise.all(["static/chunks/0h4r.qtmpa6eh.js","static/chunks/07r9nn-pzlgg1.js","static/chunks/0o9ce4cyf76by.js","static/chunks/0.w4hkvap~bva.js"].map(e=>t.l(e))).then(()=>e(36975)))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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)},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return s}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let l=e.r(90809)._(e.r(98183)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",i=e.hash||"",s=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(u+=":"+e.port)),s&&"object"==typeof s&&(s=String(l.urlQueryToSearchParams(s)));let c=e.search||s&&`?${s}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||o.test(n))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${a}${c}${i}`}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(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 a}});let n=e.r(71645);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=l(e,n)),t&&(a.current=l(t,n))},[e,t])}function l(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 l}});let n=e.r(18967),a=e.r(52817);function l(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.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 y},useLinkStatus:function(){return x}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let l=e.r(90809),o=e.r(18050),i=l._(e.r(71645)),s=e.r(95057),u=e.r(8372),c=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),b=e.r(9396);function y(t){var r,n;let a,l,y,[x,v]=(0,i.useOptimistic)(h.IDLE_LINK_STATUS),j=(0,i.useRef)(null),{href:w,as:_,children:k,prefetch:R=null,passHref:U,replace:C,shallow:S,scroll:E,onClick:P,onMouseEnter:A,onTouchStart:M,legacyBehavior:O=!1,onNavigate:N,transitionTypes:T,ref:L,unstable_dynamicOnHover:$,...I}=t;a=k,O&&("string"==typeof a||"number"==typeof a)&&(a=(0,o.jsx)("a",{children:a}));let H=i.default.useContext(u.AppRouterContext),B=!1!==R,D=!1!==R?null===(n=R)||"auto"===n?b.FetchStrategy.PPR:b.FetchStrategy.Full:b.FetchStrategy.PPR,G="string"==typeof(r=_||w)?r:(0,s.formatUrl)(r);if(O){if(a?.$$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});l=i.default.Children.only(a)}let z=O?l&&"object"==typeof l&&l.ref:L,K=i.default.useCallback(e=>(null!==H&&(j.current=(0,h.mountLinkInstance)(e,G,H,D,B,v)),()=>{j.current&&((0,h.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,h.unmountPrefetchableInstance)(e)}),[B,G,H,D,v]),F={ref:(0,c.useMergedRef)(K,z),onClick(t){O||"function"!=typeof P||P(t),O&&l.props&&"function"==typeof l.props.onClick&&l.props.onClick(t),!H||t.defaultPrevented||function(t,r,n,a,l,o,s){if("u">typeof window){let u,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((u=t.currentTarget.getAttribute("target"))&&"_self"!==u||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){a&&(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,a?"replace":"push",!1===l?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,s)})}}(t,G,j,C,E,N,T)},onMouseEnter(e){O||"function"!=typeof A||A(e),O&&l.props&&"function"==typeof l.props.onMouseEnter&&l.props.onMouseEnter(e),H&&B&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)},onTouchStart:function(e){O||"function"!=typeof M||M(e),O&&l.props&&"function"==typeof l.props.onTouchStart&&l.props.onTouchStart(e),H&&B&&(0,h.onNavigationIntent)(e.currentTarget,!0===$)}};return(0,d.isAbsoluteUrl)(G)?F.href=G:O&&!U&&("a"!==l.type||"href"in l.props)||(F.href=(0,f.addBasePath)(G)),y=O?i.default.cloneElement(l,F):(0,o.jsx)("a",{...I,...F,children:a}),(0,o.jsx)(g.Provider,{value:x,children:y})}e.r(84508);let g=(0,i.createContext)(h.IDLE_LINK_STATUS),x=()=>(0,i.useContext)(g);("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)},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)},66344,e=>{"use strict";var t=e.i(47167),r=e.i(18050),n=e.i(71645),a=e.i(56420);let l=(0,a.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"}]]);var o=e.i(31214);let i=(0,a.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var s=e.i(62368);let u=(0,a.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"}]]),c=(0,a.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"}]]),d="https://github.com/most-people/most/releases/latest",f=t.default.env.NEXT_PUBLIC_RELEASE_MANIFEST_URL||`${(t.default.env.NEXT_PUBLIC_R2_PUBLIC_BASE_URL||"https://download.most.box").replace(/\/+$/,"")}/releases/latest.json`,p=[{platform:"windows",arch:"x64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"windows",arch:"arm64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"macos",arch:"x64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"macos",arch:"arm64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"linux",arch:"x64",kind:"installer",filename:"GitHub Releases",githubUrl:d},{platform:"linux",arch:"arm64",kind:"installer",filename:"GitHub Releases",githubUrl:d}],h={windows:{name:"Windows",ext:".exe",desc:"Windows 10 或更高版本",icon:c},macos:{name:"macOS",ext:".dmg",desc:"macOS 12 Monterey 或更高版本",icon:l},linux:{name:"Linux",ext:".AppImage",desc:"Ubuntu 20.04+ / Debian 11+ / 其他主流发行版",icon:u}};function m(e){return"object"==typeof e&&null!==e}function b(e){return!!m(e)&&["windows","macos","linux"].includes(String(e.platform))&&["x64","arm64"].includes(String(e.arch))&&"installer"===e.kind&&"string"==typeof e.filename&&"string"==typeof e.githubUrl&&("string"==typeof e.r2Url||void 0===e.r2Url)}e.s(["default",0,function(){let[e,t]=(0,n.useState)(null),[a,l]=(0,n.useState)("loading"),[u,c]=(0,n.useState)("windows:x64"),[d,y]=(0,n.useState)("r2");(0,n.useEffect)(()=>{c(function(){let e;if("u"<typeof navigator)return"windows:x64";let t=(e=navigator,[e.userAgentData?.platform,navigator.platform,navigator.userAgent].filter(Boolean).join(" ").toLowerCase()),r=/arm|aarch64/.test(t)?"arm64":"x64";return/mac|darwin/.test(t)?`macos:${r}`:/linux/.test(t)?`linux:${r}`:`windows:${r}`}())},[]),(0,n.useEffect)(()=>{let e=new AbortController;return fetch(f,{cache:"no-store",signal:e.signal}).then(e=>{if(!e.ok)throw Error(`Manifest request failed: ${e.status}`);return e.json()}).then(e=>{if(!(m(e)&&"string"==typeof e.version&&"string"==typeof e.publishedAt&&Array.isArray(e.assets)&&e.assets.every(b)))throw Error("Invalid download manifest");t(e),l("ready")}).catch(e=>{e instanceof DOMException&&"AbortError"===e.name||(t(null),l("fallback"))}),()=>e.abort()},[]),(0,n.useEffect)(()=>{"fallback"===a&&y("github")},[a]);let g=e?.assets.length?e.assets:p,x=g.some(e=>e.r2Url),v="r2"===d&&x?"r2":"github";return(0,r.jsxs)("div",{className:"download-options",children:[(0,r.jsxs)("div",{className:"download-source-tabs",role:"tablist","aria-label":"下载来源",children:[(0,r.jsxs)("button",{type:"button",role:"tab","aria-selected":"r2"===v,disabled:!x,className:"r2"===v?"download-source-tab is-active":"download-source-tab",onClick:()=>y("r2"),children:[(0,r.jsx)(o.Cloud,{size:16}),"Cloudflare R2"]}),(0,r.jsxs)("button",{type:"button",role:"tab","aria-selected":"github"===v,className:"github"===v?"download-source-tab is-active":"download-source-tab",onClick:()=>y("github"),children:[(0,r.jsx)(i,{size:16}),"GitHub Releases"]})]}),(0,r.jsx)("p",{className:"download-source-note",children:"loading"===a?"正在获取 Cloudflare R2 高速镜像。":"ready"===a&&e?`当前版本 ${e.version},可切换 Cloudflare R2 或 GitHub Releases 下载。`:"无法获取高速镜像信息,已切换到 GitHub Releases 备用下载。"}),(0,r.jsx)("div",{className:"download-platform-grid",children:g.map(e=>{let t=h[e.platform],n=t.icon,a=`${e.platform}:${e.arch}`,l="r2"===v&&e.r2Url?e.r2Url:e.githubUrl,o=a===u;return(0,r.jsxs)("article",{className:o?"download-platform-card is-recommended":"download-platform-card",children:[(0,r.jsx)("div",{className:"download-platform-icon",children:(0,r.jsx)(n,{size:32})}),(0,r.jsxs)("div",{className:"download-platform-content",children:[(0,r.jsxs)("div",{className:"download-platform-heading",children:[(0,r.jsx)("h3",{children:t.name}),(0,r.jsx)("span",{children:e.arch})]}),(0,r.jsx)("p",{children:t.desc}),(0,r.jsxs)("dl",{className:"download-platform-meta",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("dt",{children:"来源"}),(0,r.jsx)("dd",{children:"r2"===v&&e.r2Url&&e.r2Url?"Cloudflare R2 高速镜像":"GitHub Releases"})]}),e.size?(0,r.jsxs)("div",{children:[(0,r.jsx)("dt",{children:"大小"}),(0,r.jsx)("dd",{children:function(e){if(!e)return"";let t=e/1024/1024;return`${t.toFixed(t>=100?0:1)} MB`}(e.size)})]}):null,e.sha256?(0,r.jsxs)("div",{children:[(0,r.jsx)("dt",{children:"SHA256"}),(0,r.jsx)("dd",{children:e.sha256.slice(0,12)})]}):null]}),(0,r.jsx)("div",{className:"download-platform-actions",children:(0,r.jsxs)("a",{href:l,className:"btn btn-primary",children:[(0,r.jsx)(s.Download,{size:16}),"下载 ",t.ext]})})]}),o?(0,r.jsx)("span",{className:"download-recommended-badge",children:"当前"}):null]},a)})})]})}],66344)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return i}});let i=e=>{}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return b},NormalizeError:function(){return x},PageNotFoundError:function(){return v},SP:function(){return p},ST:function(){return g},WEB_VITALS:function(){return a},execOnce:function(){return n},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return s},isResSent:function(){return h},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return f},stringifyError:function(){return k}};for(var l in i)Object.defineProperty(r,l,{enumerable:!0,get:i[l]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return(...i)=>(r||(r=!0,t=e(...i)),t)}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,s=e=>o.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function h(e){return e.finished||e.headersSent}function f(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let i=await e.getInitialProps(t);if(r&&h(r))return i;if(!i)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${i}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return i}let p="u">typeof performance,g=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y 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 w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function k(e){return JSON.stringify({message:e.message,stack:e.stack})}},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i={assign:function(){return s},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return o}};for(var l in i)Object.defineProperty(r,l,{enumerable:!0,get:i[l]});function a(e){let t={};for(let[r,i]of e.entries()){let e=t[r];void 0===e?t[r]=i:Array.isArray(e)?e.push(i):t[r]=[e,i]}return t}function n(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[r,i]of Object.entries(e))if(Array.isArray(i))for(let e of i)t.append(r,n(e));else t.set(r,n(i));return t}function s(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,i]of r.entries())e.append(t,i)}return e}},57667,80809,e=>{"use strict";var t=e.i(18050),r=e.i(71645);let i={" ":"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 l(e){let t=e.replace("Key","").toLowerCase();return i[e]||t}e.s(["ModalOverlay",0,function({children:e,onClose:i,closeOnOverlayClick:a=!1}){return!function(e,t=["INPUT","TEXTAREA","SELECT"],i=!1){let a=(0,r.useEffectEvent)(r=>{e.forEach(([e,a,n={preventDefault:!0,usePhysicalKeys:!1}])=>{var o;(o=n.usePhysicalKeys,t=>{let r,i,a,n;return function(e,t,r){let{alt:i,ctrl:a,meta:n,mod:o,shift:s,key:c}=e,{altKey:d,ctrlKey:u,metaKey:h,shiftKey:f,key:m,code:p}=t;if(i!==d)return!1;if(o){if(!u&&!h)return!1}else if(a!==u||n!==h)return!1;return s===f&&!!c&&(r?l(p)===l(c):l(m??p)===l(c))}((i={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"],n=r.find(e=>!a.includes(e)),{...i,key:"[plus]"===n?"+":n}),t,o)})(r)&&function(e,t,r=!1){return!(e.target instanceof HTMLElement)||(r?!t.includes(e.target.tagName):!e.target.isContentEditable&&!t.includes(e.target.tagName))}(r,t,i)&&(n.preventDefault&&r.preventDefault(),a(r))})});(0,r.useEffect)(()=>(document.documentElement.addEventListener("keydown",a),()=>document.documentElement.removeEventListener("keydown",a)),[])}(i?[["Escape",i]]:[]),(0,r.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=()=>{document.documentElement.style.setProperty("--modal-visual-height",`${e.height}px`),document.documentElement.style.setProperty("--modal-visual-top",`${e.offsetTop}px`)};return t(),e.addEventListener("resize",t),e.addEventListener("scroll",t),()=>{e.removeEventListener("resize",t),e.removeEventListener("scroll",t),document.documentElement.style.removeProperty("--modal-visual-height"),document.documentElement.style.removeProperty("--modal-visual-top")}},[]),(0,t.jsxs)("div",{className:"modal-overlay",onClick:e=>{a&&e.target===e.currentTarget&&i?.()},children:[(0,t.jsx)("div",{className:"modal-overlay-backdrop"}),(0,t.jsx)("div",{className:"modal-glass",children:e})]})}],57667),e.s(["Toast",0,function({message:e,type:i,onDone:l,index:a}){(0,r.useEffect)(()=>{let e=setTimeout(l,3e3);return()=>clearTimeout(e)},[]);let n=Math.min(Math.max(a,0),5);return(0,t.jsx)("div",{className:`toast ${i} toast-stack-${n}`,children:e})}],80809)},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,88361,47910,e=>{"use strict";var t=e.i(57667);e.i(80809);var r=e.i(18050),i=e.i(63676);e.s(["ConfirmModal",0,function({title:e,message:l,confirmText:a,onConfirm:n,onClose:o,danger:s,closeOnOverlayClick:c}){return(0,r.jsx)(t.ModalOverlay,{onClose:o,closeOnOverlayClick:c,children:(0,r.jsxs)("div",{className:"confirm-modal",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h3",{children:e}),(0,r.jsx)("button",{onClick:o,className:"btn btn-icon",children:(0,r.jsx)(i.X,{size:18})})]}),(0,r.jsx)("p",{children:l}),(0,r.jsxs)("div",{className:"modal-actions",children:[(0,r.jsx)("button",{onClick:o,className:"btn btn-secondary",children:"取消"}),(0,r.jsx)("button",{onClick:n,className:`btn ${s?"btn-danger":"btn-primary"}`,children:a})]})]})})}],88361);var l=e.i(71645);e.s(["InputModal",0,function({title:e,placeholder:a,defaultValue:n,confirmText:o,onConfirm:s,onClose:c,isLoading:d,loadingText:u,validate:h}){let[f,m]=(0,l.useState)(n||""),p=f.trim(),g=p&&h?h(p):"",y=!!p&&!g&&!d;function x(){y&&s(p)}return(0,r.jsx)(t.ModalOverlay,{onClose:c,children:(0,r.jsxs)("div",{className:"input-modal",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h3",{children:e}),(0,r.jsx)("button",{onClick:c,className:"btn btn-icon",children:(0,r.jsx)(i.X,{size:18})})]}),(0,r.jsx)("input",{type:"text",value:f,onChange:e=>m(e.target.value),placeholder:a,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&x()},className:"input input-compact","aria-invalid":!!g,"aria-describedby":g?"input-modal-error":void 0}),g&&(0,r.jsx)("p",{className:"input-modal-error",id:"input-modal-error",children:g}),(0,r.jsxs)("div",{className:"modal-actions",children:[(0,r.jsx)("button",{onClick:c,disabled:d,className:"btn btn-secondary",children:"取消"}),(0,r.jsx)("button",{onClick:x,disabled:!y,className:`btn btn-primary ${d?"btn-loading":""}`,children:d?u||"处理中...":o})]})]})})}],47910),e.s([],4121)},96661,5014,e=>{"use strict";let t=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();e.s(["mergeClasses",0,t],96661);var r=e.i(71645),i={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"};let l=(0,r.createContext)({}),a=(0,r.forwardRef)(({color:e,size:a,strokeWidth:n,absoluteStrokeWidth:o,className:s="",children:c,iconNode:d,...u},h)=>{let{size:f=24,strokeWidth:m=2,absoluteStrokeWidth:p=!1,color:g="currentColor",className:y=""}=(0,r.useContext)(l)??{},x=o??p?24*Number(n??m)/Number(a??f):n??m;return(0,r.createElement)("svg",{ref:h,...i,width:a??f??i.width,height:a??f??i.height,stroke:e??g,strokeWidth:x,className:t("lucide",y,s),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(u)&&{"aria-hidden":"true"},...u},[...d.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(c)?c:[c]])});e.s(["default",0,a],5014)},56420,e=>{"use strict";var t=e.i(71645),r=e.i(96661);let i=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 l=e.i(5014);e.s(["default",0,(e,a)=>{let n=(0,t.forwardRef)(({className:n,...o},s)=>(0,t.createElement)(l.default,{ref:s,iconNode:a,className:(0,r.mergeClasses)(`lucide-${i(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...o}));return n.displayName=i(e),n}],56420)},71192,11470,e=>{"use strict";var t=e.i(68834),r=e.i(66112);function i(e,t){let{address:i,danger:l}=(0,r.mostWallet)(e,t);return{username:e,address:i,danger:l,displayName:`${e}#${i.slice(-4).toUpperCase()}`}}function l(){if("u"<typeof localStorage)return null;try{let e=localStorage.getItem("mostbox_identity");if(!e)return null;return JSON.parse(e)}catch{return null}}function a(e){"u">typeof localStorage&&localStorage.setItem("mostbox_identity",JSON.stringify(e))}function n(){"u">typeof localStorage&&(localStorage.removeItem("mostbox_identity"),localStorage.removeItem("mostbox_guest_identity"))}function o(e){return e&&"object"==typeof e&&e.username&&e.address&&e.danger&&"匿名"!==e.username?{username:e.username,address:e.address,danger:e.danger,displayName:e.displayName?e.displayName:`${e.username}#${e.address.slice(-4).toUpperCase()}`,avatar:"string"==typeof e.avatar?e.avatar:void 0}:null}function s(){return{loginUsername:"",loginPassword:"",showPassword:!1,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginLoading:!1,loginError:""}}e.s(["clearIdentity",0,n,"createLoginIdentity",0,i,"loadIdentity",0,l,"saveIdentity",0,a],11470);let c=(0,t.create)((e,t)=>({identity:null,wallet:void 0,showLoginModal:!1,loginUsername:"",loginPassword:"",showPassword:!1,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginLoading:!1,loginError:"",initializeUser:()=>{let t=o(l());t||n(),e({identity:t,wallet:t||void 0})},openLoginModal:()=>{e({showLoginModal:!0,loginError:""})},closeLoginModal:()=>{e({showLoginModal:!1,...s()})},setLoginUsername:t=>{e({loginUsername:t,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginError:""})},setLoginPassword:t=>{e({loginPassword:t,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginError:""})},togglePassword:()=>{e(e=>({showPassword:!e.showPassword}))},previewLoginIdentity:()=>{let{loginUsername:r,loginPassword:l}=t();if(!r.trim()||!l.trim())return e({loginError:"请输入用户名和密码"}),null;let a=i(r.trim(),l);return e({loginPreviewAddress:a.address,hasPreviewedAvatar:!0,loginError:""}),a},loginUser:()=>{let{loginUsername:r,loginPassword:l,hasPreviewedAvatar:n}=t();if(!r.trim()||!l.trim())return e({loginError:"请输入用户名和密码"}),null;if(!n)return e({loginError:"请先预览并确认头像"}),null;e({loginLoading:!0,loginError:""});try{let t=i(r.trim(),l);return a(t),e({identity:t,wallet:t,showLoginModal:!1,...s()}),t}catch(t){return e({loginLoading:!1,loginError:t instanceof Error?t.message:"登录失败"}),null}},setUserIdentity:t=>{let r=o(t);r&&(a(r),e({identity:r,wallet:r}))},logoutUser:()=>{n(),e({identity:null,wallet:void 0})}}));e.s(["useUserStore",0,c],71192)},93957,e=>{"use strict";function t(e){return e.replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function r(e){return e^=e<<13,e^=e>>17,e^=e<<5}function i(e=""){let t=function(e){let t=0;for(let i=0;i<e.length;i++)t=r(t=(t<<5)-t+e.charCodeAt(i)|0);return t}(e=e.toString().slice(0,1024))||1,l=()=>t=r(t),a=(e,t)=>Math.floor((l()- -0x80000000)/0xffffffff*(t+1-e)+e);return{seed:e,next:l,bool:(e=50)=>a(1,100)<=e,integer:(e,t)=>a(e,t),pick(e,t){var r;return 0===e.length?(l(),t):null!=(r=e[a(0,e.length-1)])?r:t},shuffle(e){let t=i(l().toString()),r=[...e];for(let e=r.length-1;e>0;e--){let i=t.integer(0,e);[r[e],r[i]]=[r[i],r[e]]}return r},string(e,t="abcdefghijklmnopqrstuvwxyz1234567890"){let r=i(l().toString()),a="";for(let i=0;i<e;i++)a+=t[r.integer(0,t.length-1)];return a}}}function l(e){let t=e.attributes.viewBox.split(" "),r=parseInt(t[0]),i=parseInt(t[1]);return{x:r,y:i,width:parseInt(t[2]),height:parseInt(t[3])}}let a={type:"object",$schema:"http://json-schema.org/draft-07/schema#",properties:{seed:{type:"string"},flip:{type:"boolean",default:!1},rotate:{type:"integer",minimum:0,maximum:360,default:0},scale:{type:"integer",minimum:0,maximum:200,default:100},radius:{type:"integer",minimum:0,maximum:50,default:0},size:{type:"integer",minimum:1},backgroundColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"}},backgroundType:{type:"array",items:{type:"string",enum:["solid","gradientLinear"]},default:["solid"]},backgroundRotation:{type:"array",items:{type:"integer",minimum:-360,maximum:360},default:[0,360]},translateX:{type:"integer",minimum:-100,maximum:100,default:0},translateY:{type:"integer",minimum:-100,maximum:100,default:0},clip:{type:"boolean",default:!0},randomizeIds:{type:"boolean",default:!1}}};function n(e){var t;let r={},i=null!=(t=e.properties)?t:{};return Object.keys(i).forEach(e=>{let t=i[e];"object"==typeof t&&void 0!==t.default&&(Array.isArray(t.default)?r[e]=[...t.default]:"object"==typeof t.default?r[e]={...t.default}:r[e]=t.default)}),r}function o(e){return"transparent"===e?e:`#${e}`}e.s([],95706),e.i(95706),e.s(["eyes",0,{bulging:(e,t)=>'<circle cx="28" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="74" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="28" cy="24" r="15" fill="#F1EEDA"/><circle cx="74" cy="24" r="15" fill="#F1EEDA"/><rect x="26" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="74" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>',dizzy:(e,t)=>'<path d="m25 27.2 5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L28.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L25 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5ZM79 27.2l5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L82.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L79 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5Z" fill="#000" fill-opacity=".8"/>',eva:(e,t)=>'<g fill-rule="evenodd" clip-rule="evenodd"><path d="M53 0c34.75 0 49 17.47 49 31 0 13.53-19.59 17-49 17-29.05 0-51-3.47-51-17S17.11 0 53 0Z" fill="#000" fill-opacity=".8"/><path d="M28.82 34.65c-6.53-1.35-11.24-6.34-10.52-11.14.72-4.79 6.6-7.58 13.12-6.23 6.53 1.36 11.24 6.35 10.52 11.15-.72 4.8-6.6 7.59-13.12 6.23ZM75.42 34.65c-6.52 1.36-12.4-1.43-13.12-6.23-.72-4.8 4-9.8 10.52-11.15 6.52-1.35 12.4 1.44 13.12 6.24.72 4.81-4 9.8-10.52 11.15Z" fill="#25A6F5"/></g>',frame1:(e,t)=>'<rect y="4" width="104" height="42" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><rect x="66" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M21 4h8L12 46H4L21 4Z" fill="#fff" fill-opacity=".4"/>',frame2:(e,t)=>'<rect x="8" y="10" width="88" height="36" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><rect x="66" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><path fill-rule="evenodd" clip-rule="evenodd" d="M83 10h5L76 46h-5l12-36Z" fill="#fff" fill-opacity=".4"/>',glow:(e,t)=>'<g fill="#fff"><circle cx="21" cy="30" r="15" fill-opacity=".1"/><circle cx="83" cy="30" r="15" fill-opacity=".1"/><circle cx="21" cy="30" r="12" fill-opacity=".1"/><circle cx="83" cy="30" r="12" fill-opacity=".1"/><circle cx="21" cy="30" r="6" fill-opacity=".8"/><circle cx="83" cy="30" r="6" fill-opacity=".8"/><circle cx="21" cy="30" r="3" fill-opacity=".8"/><circle cx="83" cy="30" r="3" fill-opacity=".8"/></g>',happy:(e,t)=>'<path d="m18 19 12-2M20 31c0-3.31 2.9-6 7-6 3.1 0 6 2.69 6 6M86 20l-12-3M84 31c0-3.31-2.9-6-6-6-4.1 0-7 2.69-7 6" stroke="#000" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>',hearts:(e,t)=>'<path d="M29.27 9.68c-2.55.13-4.96 2.24-6.25 4.15-1.48-1.76-4.1-3.6-6.65-3.47-5.48.28-8.85 3.8-8.63 8.1.3 5.72 4.88 8.89 9.7 12.24 1.71 1.15 5 4.15 5.42 4.82.42.67 2.14.6 2.58-.13a37.8 37.8 0 0 1 4.9-5.36c4.43-3.84 8.66-7.47 8.36-13.2-.23-4.3-3.95-7.44-9.43-7.15ZM87.63 10.36c-2.55-.14-5.17 1.7-6.65 3.47-1.3-1.9-3.7-4.02-6.25-4.15-5.48-.29-9.2 2.86-9.43 7.16-.3 5.72 3.93 9.35 8.36 13.19 1.6 1.32 4.55 4.64 4.9 5.36.35.7 2.06.82 2.58.13.51-.7 3.7-3.67 5.42-4.82 4.81-3.35 9.4-6.52 9.7-12.24.22-4.3-3.15-7.82-8.63-8.1Z" fill="#FF5353" fill-opacity=".8"/>',robocop:(e,t)=>'<rect x="7" y="16" width="91" height="16" rx="4" fill="#000" fill-opacity=".8"/><mask id="eyesRobocop-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="16" width="91" height="16"><rect x="7" y="16" width="91" height="16" rx="4" fill="#fff"/></mask><g mask="url(#eyesRobocop-a)" fill-rule="evenodd" clip-rule="evenodd" fill="#fff" fill-opacity=".8"><path d="M76 7h18L82 37H64L76 7ZM52 7h9L49 37h-9L52 7Z"/></g>',round:(e,t)=>'<g fill="#fff"><circle cx="24" cy="30" r="6"/><circle cx="80" cy="30" r="6"/></g>',roundFrame01:(e,t)=>'<rect y="12" width="104" height="32" rx="16" fill="#000" fill-opacity=".8"/><rect x="24" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/><rect x="70" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/>',roundFrame02:(e,t)=>'<rect y="11" width="104" height="34" rx="17" fill="#000" fill-opacity=".8"/><circle cx="29" cy="28" r="13" fill="#F1EEDA"/><circle cx="75" cy="28" r="13" fill="#F1EEDA"/><rect x="24" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="70" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>',sensor:(e,t)=>'<path d="M28 44a20 20 0 0 0 19.9-18h41.52a5 5 0 1 0 0-4H47.9A20 20 0 1 0 28 44Z" fill="#000" fill-opacity=".2"/><circle cx="94" cy="24" r="2" fill="#fff"/><circle cx="28" cy="24" r="16" fill="#000" fill-opacity=".6"/><circle cx="34" cy="16" r="3" fill="#fff"/>',shade01:(e,t)=>'<path d="M96 2H8c-4.5 0-8 3.5-8 8.03V28c0 4.5 3.5 8 8 8h13c8 0 11 8 18 8h27c7 0 9-8 17-8h13c4.5 0 8-3.5 8-8V10c0-4.5-3.5-8-8-8Z" fill="#000" fill-opacity=".8"/><path d="M87 14H17c-3.5 0-5 3-5 5v2c0 2 1.5 5 5 5h12c6 0 11.62 8 17 8h14c5.38 0 9-8 15-8h12c3.5 0 5-3 5-5v-2c0-2-1.5-5-5-5Z" fill="#FF3D3D"/><path d="M22.44 36.09 37.26 2h11L31.4 40.78l-.76-.58c-2.38-1.82-4.83-3.69-8.2-4.11ZM11.48 36 26.26 2h4L15.48 36h-4Z" fill="#fff" fill-opacity=".2"/>'},"mouth",0,{bite:(e,t)=>'<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#000" fill-opacity=".6"/><path fill-rule="evenodd" clip-rule="evenodd" d="m20 17 6-8H14l6 8ZM32 17l6-8H26l6 8ZM44 17l6-8H38l6 8ZM56 17l6-8H50l6 8Z" fill="#E1E6E8"/>',diagram:(e,t)=>'<rect x="4" y="4" width="68" height="24" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="8" width="60" height="16" rx="2" fill="#000" fill-opacity=".8"/><path d="M9 17h11l2-4 3 7 4-8 2 9 3-11 3 10 3-3h15l3-4 2 7 3-3h4" stroke="#4EFAC9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',grill01:(e,t)=>'<g fill="#000" fill-opacity=".6"><rect x="12" y="12" width="4" height="8" rx="2"/><rect x="36" y="12" width="4" height="8" rx="2"/><rect x="24" y="12" width="4" height="8" rx="2"/><rect x="48" y="12" width="4" height="8" rx="2"/><rect x="60" y="12" width="4" height="8" rx="2"/></g>',grill02:(e,t)=>'<g fill="#000" fill-opacity=".6"><rect x="28" y="10" width="6" height="14" rx="2"/><rect x="14" y="10" width="6" height="14" rx="2"/><rect x="42" y="10" width="6" height="14" rx="2"/><rect x="56" y="10" width="6" height="14" rx="2"/></g>',grill03:(e,t)=>'<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#fff"/><path fill="#000" fill-opacity=".1" d="M18 9h4v14h-4zM42 9h4v14h-4zM30 9h4v14h-4zM54 9h4v14h-4z"/>',smile01:(e,t)=>'<path d="M27.05 8.44a2 2 0 1 1 3.9-.88C31.72 10.96 34.4 13 38 13c3.6 0 6.28-2.04 7.05-5.44a2 2 0 1 1 3.9.88C47.75 13.7 43.43 17 38 17s-9.76-3.3-10.95-8.56Z" fill="#000" fill-opacity=".6"/>',smile02:(e,t)=>'<path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#000" fill-opacity=".8"/><mask id="mouthSmile02-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="18" y="8" width="40" height="20"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#fff"/></mask><g mask="url(#mouthSmile02-a)"><rect x="30" y="2" width="16" height="14" rx="2" fill="#fff"/></g>',square01:(e,t)=>'<rect x="24" y="6" width="27" height="8" rx="4" fill="#000" fill-opacity=".8"/>',square02:(e,t)=>'<rect x="16" y="8" width="44" height="4" rx="2" fill="#000" fill-opacity=".8"/>'}],23855);var s=e.i(23855);function c({prng:e,group:t,values:r=[]}){let i=e.pick(r);return i&&s[t][i]?{name:i,value:s[t][i]}:void 0}let d={title:"Bottts",creator:"Pablo Stanley",source:"https://bottts.com/",homepage:"https://twitter.com/pablostanley",license:{name:"Free for personal and commercial use",url:"https://bottts.com/"}},u=({prng:e,options:t})=>{var r,i,l,a;let n=function({prng:e,options:t}){return{mouth:c({prng:e,group:"mouth",values:t.mouth}),eyes:c({prng:e,group:"eyes",values:t.eyes})}}({prng:e,options:t}),o=function({prng:e,options:t}){return{}}({prng:e,options:t});return{attributes:{viewBox:"0 0 120 120",fill:"none","shape-rendering":"auto"},body:`<g transform="translate(22 68)">${null!=(i=null==(r=n.mouth)?void 0:r.value(n,o))?i:""}</g><g transform="translate(8 20)">${null!=(a=null==(l=n.eyes)?void 0:l.value(n,o))?a:""}</g>`,extra:()=>({...Object.entries(n).reduce((e,[t,r])=>(e[t]=null==r?void 0:r.name,e),{}),...Object.entries(o).reduce((e,[t,r])=>(e[`${t}Color`]=r,e),{})})}};e.s(["create",0,u,"meta",0,d],17022),e.i(17022),e.s(["create",0,u,"meta",0,d,"schema",0,{$schema:"http://json-schema.org/draft-07/schema#",properties:{backgroundColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["ffb300","1e88e5","546e7a","6d4c41","00acc1","f4511e","5e35b1","43a047","757575","3949ab","039be5","7cb342","c0ca33","fb8c00","d81b60","8e24aa","e53935","00897b","fdd835"]},eyes:{type:"array",items:{type:"string",enum:["bulging","dizzy","eva","frame1","frame2","glow","happy","hearts","robocop","round","roundFrame01","roundFrame02","sensor","shade01"]},default:["bulging","dizzy","eva","frame1","frame2","glow","happy","hearts","robocop","round","roundFrame01","roundFrame02","sensor","shade01"]},mouth:{type:"array",items:{type:"string",enum:["bite","diagram","grill01","grill02","grill03","smile01","smile02","square01","square02"]},default:["bite","diagram","grill01","grill02","grill03","smile01","smile02","square01","square02"]}}}],13161);var h=e.i(13161),h=h;e.s(["generateAvatar",0,function(e,r){return r||(e?(function(e,r={}){var s,c,d,u,h,f,m,p,g,y,x,v,b,w,k,j,E,$,N,S,C,M,P,L,A,U,F,z,O,T,D,I,R,Z;let B,_,H,X,q,W,J,K,V,G,Y,Q,ee,et,er,ei,el;f=r;let ea=i((r=JSON.parse(JSON.stringify({...n(a),...n(null!=(m=e.schema)?m:{}),...f}))).seed),en=e.create({prng:ea,options:r}),eo=ea.pick(null!=(s=r.backgroundType)?s:[],"solid"),{primary:es,secondary:ec}=(p=null!=(c=r.backgroundColor)?c:[],(B=ea.shuffle(p)).length<=1||2==p.length&&"gradientLinear"==eo?(B=p,ea.next()):B=ea.shuffle(p),0===B.length&&(B=["transparent"]),_=B[0],H=null!=(g=B[1])?g:B[0],{primary:o(_),secondary:o(H)}),ed=ea.integer((null==(d=r.backgroundRotation)?void 0:d.length)?Math.min(...r.backgroundRotation):0,(null==(u=r.backgroundRotation)?void 0:u.length)?Math.max(...r.backgroundRotation):0);r.size&&(en.attributes.width=r.size.toString(),en.attributes.height=r.size.toString()),void 0!==r.scale&&100!==r.scale&&(en.body=function(e,t){let{width:r,height:i,x:a,y:n}=l(e),o=t?(t-100)/100:0;return`<g transform="translate(${-((r/2+a)*o*1)} ${-((i/2+n)*o*1)}) scale(${t/100})">${e.body}</g>`}(en,r.scale)),r.flip&&(en.body=function(e){let{width:t,x:r}=l(e);return`<g transform="scale(-1 1) translate(${-1*t-2*r} 0)">${e.body}</g>`}(en)),r.rotate&&(en.body=function(e,t){let{width:r,height:i,x:a,y:n}=l(e);return`<g transform="rotate(${t}, ${r/2+a}, ${i/2+n})">${e.body}</g>`}(en,r.rotate)),(r.translateX||r.translateY)&&(y=r.translateX,x=r.translateY,q=((X=l(en)).width+2*X.x)*((null!=y?y:0)/100),W=(X.height+2*X.y)*((null!=x?x:0)/100),en.body=`<g transform="translate(${q} ${W})">${en.body}</g>`),"transparent"!==es&&"transparent"!==ec&&(en.body=function(e,r,i,a,n){let{width:o,height:s,x:c,y:d}=l(e),u=`<rect fill="${t(r)}" width="${o}" height="${s}" x="${c}" y="${d}" />`;switch(a){case"solid":return u+e.body;case"gradientLinear":return`<rect fill="url(#backgroundLinear)" width="${o}" height="${s}" x="${c}" y="${d}" /><defs><linearGradient id="backgroundLinear" gradientTransform="rotate(${n} 0.5 0.5)"><stop stop-color="${t(r)}"/><stop offset="1" stop-color="${t(i)}"/></linearGradient></defs>`+e.body}}(en,es,ec,eo,ed)),(r.radius||r.clip)&&(en.body=function(e,t){let{width:r,height:i,x:a,y:n}=l(e);return`<mask id="viewboxMask"><rect width="${r}" height="${i}" rx="${t?r*t/100:0}" ry="${t?i*t/100:0}" x="${a}" y="${n}" fill="#fff" /></mask><g mask="url(#viewboxMask)">${e.body}</g>`}(en,null!=(h=r.radius)?h:0)),r.randomizeIds&&(J=i(Math.random().toString()),K={},en.body=en.body.replace(/(id="|url\(#)([a-z0-9-_]+)([")])/gi,(e,t,r,i)=>(K[r]=K[r]||J.string(8),`${t}${K[r]}${i}`)));let eu=Object.keys(V={xmlns:"http://www.w3.org/2000/svg",...en.attributes}).map(e=>`${t(e)}="${t(V[e])}"`).join(" "),eh=(G=null==(v=e.meta)?void 0:v.title,Y=null==(b=e.meta)?void 0:b.creator,Q=null==(w=e.meta)?void 0:w.source,ee=null==(j=null==(k=e.meta)?void 0:k.license)?void 0:j.url,er=(null==(S=(N=e).meta)?void 0:S.title)?`„${null==(C=N.meta)?void 0:C.title}”`:"Design",ei=`„${null!=(P=null==(M=N.meta)?void 0:M.creator)?P:"Unknown"}”`,(null==(L=N.meta)?void 0:L.source)&&(er+=` (${N.meta.source})`),el="",(null==(U=null==(A=N.meta)?void 0:A.license)?void 0:U.name)!=="MIT"&&(null==(F=N.meta)?void 0:F.creator)!=="DiceBear"&&(null==(z=N.meta)?void 0:z.title)&&(el+="Remix of "),el+=`${er} by ${ei}`,(null==(T=null==(O=N.meta)?void 0:O.license)?void 0:T.name)&&(el+=`, licensed under „${null==(I=null==(D=N.meta)?void 0:D.license)?void 0:I.name}”`,(null==(Z=null==(R=N.meta)?void 0:R.license)?void 0:Z.url)&&(el+=` (${N.meta.license.url})`)),et=el,G||Y||Q||ee||et?'<metadata xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"><rdf:RDF><rdf:Description>'+(G?`<dc:title>${t(G)}</dc:title>`:"")+(Y?`<dc:creator>${t(Y)}</dc:creator>`:"")+(Q?`<dc:source xsi:type="dcterms:URI">${t(null!=($=null==(E=e.meta)?void 0:E.source)?$:"")}</dc:source>`:"")+(ee?`<dcterms:license xsi:type="dcterms:URI">${t(ee)}</dcterms:license>`:"")+(et?`<dc:rights>${t(et)}</dc:rights>`:"")+"</rdf:Description></rdf:RDF></metadata>":""),ef=`<svg ${eu}>${eh}${en.body}</svg>`;return{toString:()=>ef,toJson:()=>{var e;return{svg:ef,extra:{primaryBackgroundColor:es,secondaryBackgroundColor:ec,backgroundType:eo,backgroundRotation:ed,...null==(e=en.extra)?void 0:e.call(en)}}},toDataUri:()=>`data:image/svg+xml;utf8,${encodeURIComponent(ef)}`}})(h,{seed:"most.box@"+e,flip:!0,backgroundType:["gradientLinear"]}).toDataUri():"/avatar.png")}],93957)},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)},41220,e=>{"use strict";let t=(0,e.i(56420).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,t],41220)},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 i 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",{className:"error-boundary-page",children:[(0,t.jsx)("h1",{className:"error-boundary-title",children:"出错了"}),(0,t.jsx)("p",{className:"error-boundary-desc",children:"发生了意外错误,请尝试重新加载页面"}),(0,t.jsx)("button",{onClick:this.handleReload,className:"error-boundary-btn",children:"重新加载"})]}):this.props.children}}e.s(["ErrorBoundary",0,i])},52925,e=>{"use strict";var t=e.i(18050),r=e.i(71645),i=e.i(3593),l=e.i(71192);e.i(4121);var a=e.i(80809),n=e.i(74080),o=e.i(72382),s=e.i(80860),c=e.i(63676),d=e.i(57667),u=e.i(93957);function h(){let e=(0,i.useAppStore)(e=>e.addToast),r=(0,l.useUserStore)(e=>e.showLoginModal),a=(0,l.useUserStore)(e=>e.closeLoginModal),h=(0,l.useUserStore)(e=>e.loginUsername),f=(0,l.useUserStore)(e=>e.loginPassword),m=(0,l.useUserStore)(e=>e.showPassword),p=(0,l.useUserStore)(e=>e.loginPreviewAddress),g=(0,l.useUserStore)(e=>e.hasPreviewedAvatar),y=(0,l.useUserStore)(e=>e.loginLoading),x=(0,l.useUserStore)(e=>e.loginError),v=(0,l.useUserStore)(e=>e.setLoginUsername),b=(0,l.useUserStore)(e=>e.setLoginPassword),w=(0,l.useUserStore)(e=>e.togglePassword),k=(0,l.useUserStore)(e=>e.previewLoginIdentity),j=(0,l.useUserStore)(e=>e.loginUser);if(!r)return null;let E=p?`${p.slice(0,6)}...${p.slice(-4)}`:"Most People",$=(0,t.jsx)(d.ModalOverlay,{onClose:a,closeOnOverlayClick:!0,children:(0,t.jsxs)("form",{className:"login-modal",onSubmit:t=>{let r;t.preventDefault(),(r=j())&&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)(c.X,{size:18})})]}),(0,t.jsxs)("div",{className:"login-modal-body",children:[(0,t.jsx)("img",{className:"login-avatar-preview",src:p?(0,u.generateAvatar)(p):"/avatar.png",alt:"avatar"}),(0,t.jsx)("p",{className:"login-tip",children:E}),x&&(0,t.jsx)("p",{className:"login-error",children:x}),(0,t.jsx)("input",{type:"text",className:"input input-compact",placeholder:"用户名",value:h,onChange:e=>v(e.target.value),autoFocus:!0}),(0,t.jsxs)("div",{className:"login-password-wrapper",children:[(0,t.jsx)("input",{type:m?"text":"password",className:"input input-compact",placeholder:"密码",value:f,onChange:e=>b(e.target.value)}),(0,t.jsx)("button",{className:"login-password-toggle",type:"button",onClick:w,children:m?(0,t.jsx)(s.EyeOff,{size:16}):(0,t.jsx)(o.Eye,{size:16})})]}),(0,t.jsxs)("div",{className:"login-buttons-row",children:[(0,t.jsx)("button",{className:"btn btn-secondary",onClick:k,disabled:g||y,type:"button",children:g?"检查地址":"登录"}),(0,t.jsx)("button",{className:"btn btn-primary",disabled:!g||y,type:"submit",children:y?"登录中":"确认"})]})]})]})});return(0,n.createPortal)($,document.body)}var f=e.i(41220);let m=(0,e.i(56420).default)("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);var p=e.i(26913);function g({variant:e="page"}){let l=(0,i.useAppStore)(e=>e.checkBackend),a=(0,i.useAppStore)(e=>e.addToast),n=(0,p.getRemoteBackendUrlExport)(),[o,s]=(0,r.useState)(n),[c,d]=(0,r.useState)((0,p.getBackendInviteExport)()),[u,h]=(0,r.useState)(!1),y=n?"修改远程节点":"连接远程节点",x="输入别人部署好的 MostBox 节点地址和邀请码,无需安装客户端即可使用文件分享和聊天。",v="page"===e;async function b(){let e=o.trim().replace(/\/+$/,"");if(!function(e){try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch{return!1}}(e))return void a("请输入有效的 http(s) 节点地址","warning");h(!0);try{let{ok:t,reason:r}=await (0,p.checkBackendConnectionTarget)({url:e,invite:c});if(!t)return void("http"===r?a("远程节点 HTTP 不可达,请检查地址","error"):"ws"===r?a("远程节点 WebSocket 不可达,请检查地址或代理配置","error"):a("远程节点连接失败,请检查地址和邀请码","error"));(0,p.configureBackend)({url:e,invite:c}),s(e),(0,p.setBackendUrl)(e),i.useAppStore.setState({hasBackend:!0}),a("远程节点已连接","success")}catch{a("远程节点连接失败","error")}finally{h(!1)}}async function w(){(0,p.clearBackendConnection)(),s(""),d(""),await l(),a("已清除远程节点,优先使用本地节点","success")}return(0,t.jsxs)("div",{className:`remote-node-connect remote-node-connect-${e}`,children:[v?(0,t.jsxs)("div",{className:"remote-node-connect-heading",children:[(0,t.jsx)(f.Server,{size:20}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{children:y}),(0,t.jsx)("p",{children:x})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("label",{className:"drawer-label",children:[(0,t.jsx)(f.Server,{size:14,className:"icon-inline"}),y]}),(0,t.jsx)("p",{className:"drawer-hint drawer-hint-spaced",children:x})]}),(0,t.jsxs)("div",{className:"remote-node-form",children:[(0,t.jsx)("input",{className:"input input-compact",placeholder:"https://node.example.com",value:o,onChange:e=>s(e.target.value)}),(0,t.jsx)("input",{className:"input input-compact",placeholder:"邀请码",value:c,onChange:e=>d(e.target.value)}),(0,t.jsxs)("button",{className:"btn btn-primary btn-full",onClick:b,disabled:u||!o.trim(),children:[(0,t.jsx)(f.Server,{size:16}),u?"连接中...":n?"更新连接":"连接节点"]}),n&&(0,t.jsxs)("button",{className:"btn btn-secondary btn-full",onClick:w,disabled:u,children:[(0,t.jsx)(m,{size:16}),"断开连接"]})]}),n&&(0,t.jsxs)("p",{className:v?"remote-node-status":"drawer-status",children:["当前远程节点:",n]})]})}function y(){let e=(0,i.useAppStore)(e=>e.showConnectModal),r=(0,i.useAppStore)(e=>e.closeConnectModal);if(!e)return null;let l=(0,t.jsx)(d.ModalOverlay,{onClose:r,closeOnOverlayClick:!0,children:(0,t.jsxs)("div",{className:"connect-modal",children:[(0,t.jsxs)("div",{className:"connect-modal-header",children:[(0,t.jsx)("h3",{children:"连接节点"}),(0,t.jsx)("button",{className:"connect-modal-close",onClick:r,type:"button",children:(0,t.jsx)(c.X,{size:18})})]}),(0,t.jsx)("div",{className:"connect-modal-body",children:(0,t.jsx)(g,{variant:"drawer"})})]})});return(0,n.createPortal)(l,document.body)}e.s(["default",0,function(){let e=(0,i.useAppStore)(e=>e.checkBackend),n=(0,i.useAppStore)(e=>e.initializeLocalData),o=(0,l.useUserStore)(e=>e.initializeUser),s=(0,l.useUserStore)(e=>e.identity),c=(0,i.useAppStore)(e=>e.loadUserNotes),d=(0,i.useAppStore)(e=>e.resetAppState),u=(0,i.useAppStore)(e=>e.toasts),f=(0,i.useAppStore)(e=>e.removeToast);return(0,r.useEffect)(()=>{n(),o(),e()},[e,n,o]),(0,r.useEffect)(()=>{s?c(s.address):d()},[s?.address,c,d]),(0,t.jsxs)(t.Fragment,{children:[u.map((e,r)=>(0,t.jsx)(a.Toast,{message:e.message,type:e.type,onDone:()=>f(e.id),index:r},e.id)),(0,t.jsx)(h,{}),(0,t.jsx)(y,{})]})}],52925)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89664,e=>{"use strict";let n=(0,e.i(56420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,n],89664)},35965,e=>{"use strict";let n=(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,n],35965)},96699,e=>{"use strict";let n=(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,n],96699)},11241,e=>{"use strict";let n=(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,n],11241)},59665,5142,e=>{"use strict";var n=e.i(18050),t=e.i(71645);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"}]]);function i(e=!1,n={}){let[a,s]=(0,t.useState)(e),r=(0,t.useCallback)(()=>{s(e=>e||(n.onOpen?.(),!0))},[n.onOpen]),l=(0,t.useCallback)(()=>{s(e=>e?(n.onClose?.(),!1):e)},[n.onClose]);return[a,{open:r,close:l,toggle:(0,t.useCallback)(()=>{a?l():r()},[l,r,a]),set:s}]}e.s(["useDisclosure",0,i],5142);let s=(0,t.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:r,headerRight:l,children:c}){let[d,o]=i(!1),[h,u]=(0,t.useState)(!1),p=function(e,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[a,i]=(0,t.useState)(n?void 0:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,t.useEffect)(()=>{try{if("matchMedia"in window){let n=window.matchMedia(e);i(n.matches);let t=e=>i(e.matches);return n.addEventListener("change",t),()=>{n.removeEventListener("change",t)}}}catch(e){return}},[e]),a||!1}("(max-width: 768px)"),m=()=>{p?o.open():u(!1)};return(0,n.jsx)(s.Provider,{value:{closeSidebar:o.close,openSidebar:m,isSidebarVisible:p?d:!h},children:(0,n.jsxs)("div",{className:"app-layout",children:[(0,n.jsx)("div",{className:`sidebar-overlay ${d?"visible":""}`,onClick:()=>o.close()}),(0,n.jsx)("div",{className:`sidebar ${d?"open":""} ${h?"collapsed":""}`,children:e({closeSidebar:o.close,openSidebar:m})}),(0,n.jsxs)("div",{className:"main-content",children:[(0,n.jsxs)("header",{className:"app-header",children:[(0,n.jsxs)("div",{className:"header-left",children:[(0,n.jsx)("button",{onClick:()=>{p?o.toggle():u(!h)},className:"btn btn-icon sidebar-toggle-btn","aria-label":p?"打开菜单":h?"展开侧边栏":"收起侧边栏",children:(0,n.jsx)(a,{size:16})}),r]}),(0,n.jsx)("div",{className:"header-right",children:l})]}),c]})]})})},"useAppShell",0,function(){let e=(0,t.useContext)(s);if(!e)throw Error("useAppShell must be used within AppShell");return e}],59665)},87884,e=>{"use strict";var n=e.i(26913);e.s(["channelApi",0,{getChannels(e={}){let t=new URLSearchParams;e.type&&t.set("type",e.type),e.excludeType&&t.set("excludeType",e.excludeType);let a=t.toString();return n.api.get(a?`/api/channels?${a}`:"/api/channels").json()},createChannel:(e,t="personal")=>n.api.post("/api/channels",{json:{name:e,type:t}}).json(),leaveChannel:e=>n.api.delete(`/api/channels/${encodeURIComponent(e)}`).json(),getChannelMessages:(e,t=100,a=0)=>n.api.get(`/api/channels/${encodeURIComponent(e)}/messages?limit=${t}&offset=${a}`).json(),sendChannelMessage:({channelName:e,content:t,author:a,authorName:i,attachment:s})=>n.api.post(`/api/channels/${encodeURIComponent(e)}/messages`,{json:s?{content:t,author:a,authorName:i,attachment:s}:{content:t,author:a,authorName:i}}).json(),getChannelPeers:e=>n.api.get(`/api/channels/${encodeURIComponent(e)}/peers`).json(),setChannelRemark:(e,t)=>n.api.put(`/api/channels/${encodeURIComponent(e)}/remark`,{json:{remark:t}}).json()}])},18566,(e,n,t)=>{n.exports=e.r(76562)},58925,e=>{"use strict";let n=(0,e.i(56420).default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);e.s(["KeyRound",0,n],58925)},90165,e=>{"use strict";var n=e.i(18050),t=e.i(71645),a=e.i(18566),i=e.i(58925),s=e.i(89664);let r=(0,e.i(56420).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var l=e.i(35965),c=e.i(96699),d=e.i(11241),o=e.i(59665),h=e.i(3593),u=e.i(71192),p=e.i(11470),m=e.i(26913),j=e.i(87884);let f=[{name:"node_url",required:!1,description:"Web 端未连接后端时,用于连接远程节点。"},{name:"node_invite",required:!1,description:"配合 node_url 作为远程节点邀请码。"},{name:"uid",required:!0,description:"作为用户名,密码为空,用于生成账户并自动登录。"},{name:"avatar",required:!1,description:"覆盖默认头像。"},{name:"name",required:!1,description:"覆盖默认昵称。"},{name:"locale",required:!1,description:"预留给多语言切换,当前暂不执行。"},{name:"channels[].id",required:!0,description:"频道 ID,用于自动加入频道。"},{name:"channels[].name",required:!1,description:"频道备注,不作为频道 ID。"}];function x(e){try{return JSON.parse(e)}catch{return null}}function y(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function v(e){return"string"==typeof e?e.trim():""}function k(){let e=(0,a.useSearchParams)(),k=(0,h.useAppStore)(e=>e.isDarkMode),b=(0,h.useAppStore)(e=>e.setIsDarkMode),g=(0,h.useAppStore)(e=>e.hasBackend),S=(0,u.useUserStore)(e=>e.setUserIdentity),[w,N]=(0,t.useState)(""),[C,M]=(0,t.useState)(""),[A,R]=(0,t.useState)(!0),[$,_]=(0,t.useState)(""),z=(0,t.useRef)("");return(0,t.useEffect)(()=>{let n=e.get("token"),t=e.get("pub");if(!n){M("缺少 token 参数"),R(!1);return}if(!t){M("缺少 pub 参数"),R(!1);return}if(null===g)return void _("正在检测后端连接...");let a=`${n}:${t}`;async function i(e){var n;if(!g&&e.node_url){if(_("正在连接远程节点..."),!(await (0,m.checkBackendConnectionTarget)({url:e.node_url,invite:e.node_invite||""})).ok)throw Error("远程节点连接失败");(0,m.configureBackend)({url:e.node_url,invite:e.node_invite||""}),h.useAppStore.setState({hasBackend:!0})}else if(!g)throw Error("未连接后端,邀请中也没有 node_url");_("正在登录邀请账号...");let t=(0,p.createLoginIdentity)(e.uid,"");for(let n of(S({...t,displayName:e.name||t.displayName,avatar:e.avatar}),_("正在加入频道..."),e.channels)){await j.channelApi.createChannel(n.id,"public");let e=String(n.name||"").trim().slice(0,50);e&&await j.channelApi.setChannelRemark(n.id,e)}let a=e.channels[0];_("加入成功,正在打开频道..."),window.location.href=(n=a.id,`/chat?channel=${encodeURIComponent(n)}`)}async function s(){try{_("正在解密邀请...");let e=await fetch("https://api.most.box/api/chat.join.decrypt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:n,pub:t})}),a=await e.text(),s=x(a);if(e.ok){N(null===s?a:JSON.stringify(s,null,2));let e=function(e){let n="string"!=typeof e?e:x(e);if(!y(n))return null;let t=v(n.uid),a=(Array.isArray(n.channels)?n.channels:[]).filter(y).map(e=>({id:v(e.id),name:v(e.name)||void 0})).filter(e=>e.id);return t&&0!==a.length?{node_url:v(n.node_url)||void 0,node_invite:v(n.node_invite)||void 0,locale:v(n.locale)||void 0,uid:t,avatar:v(n.avatar)||void 0,name:v(n.name)||void 0,channels:a}:null}(s);if(!e)return void M("邀请内容缺少 uid 或 channels[].id");await i(e)}else M(function(e,n){if(n&&"object"==typeof n&&"error"in n){let e=n.error;if("string"==typeof e)return e}return e||"解密失败"}(a,s))}catch(e){M(`请求出错: ${e instanceof Error?e.message:String(e)}`)}finally{R(!1)}}z.current!==a&&(z.current=a,s())},[g,e,S]),(0,n.jsx)(o.default,{sidebar:()=>(0,n.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>window.location.href="/chat",children:[(0,n.jsx)(d.ArrowLeft,{size:18}),(0,n.jsx)("h1",{children:"MOST PEOPLE"})]}),headerTitle:(0,n.jsx)("h2",{className:"header-title",children:"加入频道"}),headerRight:(0,n.jsx)("button",{className:"btn btn-icon",onClick:()=>b(!k),title:"切换主题",children:k?(0,n.jsx)(l.Sun,{size:16}):(0,n.jsx)(c.Moon,{size:16})}),children:(0,n.jsx)("div",{className:"chat-join-container",children:(0,n.jsxs)("div",{className:"chat-join-panel",children:[A?(0,n.jsxs)("div",{className:"chat-join-loading",children:[(0,n.jsx)(i.KeyRound,{size:32}),(0,n.jsx)("p",{children:$||"正在解密..."})]}):C?(0,n.jsxs)("div",{className:"chat-join-error",children:[(0,n.jsx)(r,{size:32}),(0,n.jsx)("p",{children:C}),$&&(0,n.jsx)("p",{className:"chat-join-status",children:$}),w&&(0,n.jsx)("pre",{className:"chat-join-result",children:w})]}):(0,n.jsxs)("div",{className:"chat-join-success",children:[(0,n.jsx)(s.Check,{size:32}),(0,n.jsx)("p",{children:$||"解密成功"}),(0,n.jsx)("pre",{className:"chat-join-result",children:w})]}),(0,n.jsxs)("section",{className:"chat-join-spec","aria-labelledby":"chat-join-spec-title",children:[(0,n.jsxs)("div",{className:"chat-join-helper-title",children:[(0,n.jsx)(i.KeyRound,{size:18}),(0,n.jsx)("h3",{id:"chat-join-spec-title",children:"支持字段"})]}),(0,n.jsx)("div",{className:"chat-join-field-list",children:f.map(e=>(0,n.jsxs)("div",{className:"chat-join-field",children:[(0,n.jsxs)("div",{className:"chat-join-field-meta",children:[(0,n.jsx)("code",{className:"chat-join-field-name",children:e.name}),(0,n.jsx)("span",{children:e.required?"必填":"可选"})]}),(0,n.jsx)("p",{children:e.description})]},e.name))})]}),(0,n.jsxs)("section",{className:"chat-join-helper","aria-labelledby":"ea-test-title",children:[(0,n.jsxs)("div",{className:"chat-join-helper-title",children:[(0,n.jsx)(i.KeyRound,{size:18}),(0,n.jsx)("h3",{id:"ea-test-title",children:"测试公钥"})]}),(0,n.jsx)("code",{className:"chat-join-public-key",children:"0x955fe80bdb8312165471fcacd6a8f83df88a770dda6f38657ca4e62ec28d5b54"}),(0,n.jsx)("a",{className:"btn",href:"/web3/#EA",target:"_blank",children:"前往 Web3 工具箱"})]})]})})})}e.s(["default",0,function(){return(0,n.jsx)(t.Suspense,{children:(0,n.jsx)(k,{})})}],90165)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95057,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return d}};for(var n in r)Object.defineProperty(a,n,{enumerable:!0,get:r[n]});let s=e.r(90809)._(e.r(98183)),i=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:a}=e,r=e.protocol||"",n=e.pathname||"",l=e.hash||"",d=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:a&&(c=t+(~a.indexOf(":")?`[${a}]`:a),e.port&&(c+=":"+e.port)),d&&"object"==typeof d&&(d=String(s.urlQueryToSearchParams(d)));let o=e.search||d&&`?${d}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||i.test(r))&&!1!==c?(c="//"+(c||""),n&&"/"!==n[0]&&(n="/"+n)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),o&&"?"!==o[0]&&(o="?"+o),n=n.replace(/[?#]/g,encodeURIComponent),o=o.replace("#","%23"),`${r}${c}${n}${o}${l}`}let d=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},18581,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"useMergedRef",{enumerable:!0,get:function(){return n}});let r=e.r(71645);function n(e,t){let a=(0,r.useRef)(null),n=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=a.current;e&&(a.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(a.current=s(e,r)),t&&(n.current=s(t,r))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let a=e(t);return"function"==typeof a?a:()=>e(null)}}("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},73668,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"isLocalURL",{enumerable:!0,get:function(){return s}});let r=e.r(18967),n=e.r(52817);function s(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),a=new URL(e,t);return a.origin===t&&(0,n.hasBasePath)(a.pathname)}catch(e){return!1}}},84508,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},22016,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r={default:function(){return v},useLinkStatus:function(){return x}};for(var n in r)Object.defineProperty(a,n,{enumerable:!0,get:r[n]});let s=e.r(90809),i=e.r(18050),l=s._(e.r(71645)),d=e.r(95057),c=e.r(8372),o=e.r(18581),u=e.r(18967),h=e.r(5550);e.r(33525);let f=e.r(88540),p=e.r(91949),m=e.r(73668),y=e.r(9396);function v(t){var a,r;let n,s,v,[x,g]=(0,l.useOptimistic)(p.IDLE_LINK_STATUS),b=(0,l.useRef)(null),{href:M,as:$,children:w,prefetch:S=null,passHref:k,replace:_,shallow:N,scroll:D,onClick:C,onMouseEnter:O,onTouchStart:z,legacyBehavior:T=!1,onNavigate:L,transitionTypes:Y,ref:A,unstable_dynamicOnHover:B,...P}=t;n=w,T&&("string"==typeof n||"number"==typeof n)&&(n=(0,i.jsx)("a",{children:n}));let H=l.default.useContext(c.AppRouterContext),I=!1!==S,E=!1!==S?null===(r=S)||"auto"===r?y.FetchStrategy.PPR:y.FetchStrategy.Full:y.FetchStrategy.PPR,F="string"==typeof(a=$||M)?a:(0,d.formatUrl)(a);if(T){if(n?.$$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});s=l.default.Children.only(n)}let U=T?s&&"object"==typeof s&&s.ref:A,R=l.default.useCallback(e=>(null!==H&&(b.current=(0,p.mountLinkInstance)(e,F,H,E,I,g)),()=>{b.current&&((0,p.unmountLinkForCurrentNavigation)(b.current),b.current=null),(0,p.unmountPrefetchableInstance)(e)}),[I,F,H,E,g]),V={ref:(0,o.useMergedRef)(R,U),onClick(t){T||"function"!=typeof C||C(t),T&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!H||t.defaultPrevented||function(t,a,r,n,s,i,d){if("u">typeof window){let c,{nodeName:o}=t.currentTarget;if("A"===o.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)(a)){n&&(t.preventDefault(),location.replace(a));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);l.default.startTransition(()=>{u(a,n?"replace":"push",!1===s?f.ScrollBehavior.NoScroll:f.ScrollBehavior.Default,r.current,d)})}}(t,F,b,_,D,L,Y)},onMouseEnter(e){T||"function"!=typeof O||O(e),T&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),H&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===B)},onTouchStart:function(e){T||"function"!=typeof z||z(e),T&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),H&&I&&(0,p.onNavigationIntent)(e.currentTarget,!0===B)}};return(0,u.isAbsoluteUrl)(F)?V.href=F:T&&!k&&("a"!==s.type||"href"in s.props)||(V.href=(0,h.addBasePath)(F)),v=T?l.default.cloneElement(s,V):(0,i.jsx)("a",{...P,...V,children:n}),(0,i.jsx)(j.Provider,{value:x,children:v})}e.r(84508);let j=(0,l.createContext)(p.IDLE_LINK_STATUS),x=()=>(0,l.useContext)(j);("function"==typeof a.default||"object"==typeof a.default&&null!==a.default)&&void 0===a.default.__esModule&&(Object.defineProperty(a.default,"__esModule",{value:!0}),Object.assign(a.default,a),t.exports=a.default)},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)},50285,e=>{"use strict";let t=(0,e.i(56420).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,t],50285)},22315,(e,t,a)=>{e.e,t.exports=function(){"use strict";var e="millisecond",t="second",a="minute",r="hour",n="week",s="month",i="quarter",l="year",d="date",c="Invalid Date",o=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h=function(e,t,a){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(a)+e},f="en",p={};p[f]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],a=e%100;return"["+e+(t[(a-20)%10]||t[a]||t[0])+"]"}};var m="$isDayjsObject",y=function(e){return e instanceof g||!(!e||!e[m])},v=function e(t,a,r){var n;if(!t)return f;if("string"==typeof t){var s=t.toLowerCase();p[s]&&(n=s),a&&(p[s]=a,n=s);var i=t.split("-");if(!n&&i.length>1)return e(i[0])}else{var l=t.name;p[l]=t,n=l}return!r&&n&&(f=n),n||!r&&f},j=function(e,t){if(y(e))return e.clone();var a="object"==typeof t?t:{};return a.date=e,a.args=arguments,new g(a)},x={s:h,z:function(e){var t=-e.utcOffset(),a=Math.abs(t);return(t<=0?"+":"-")+h(Math.floor(a/60),2,"0")+":"+h(a%60,2,"0")},m:function e(t,a){if(t.date()<a.date())return-e(a,t);var r=12*(a.year()-t.year())+(a.month()-t.month()),n=t.clone().add(r,s),i=a-n<0,l=t.clone().add(r+(i?-1:1),s);return+(-(r+(a-n)/(i?n-l:l-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(c){return({M:s,y:l,w:n,d:"day",D:d,h:r,m:a,s:t,ms:e,Q:i})[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};x.l=v,x.i=y,x.w=function(e,t){return j(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var g=function(){function h(e){this.$L=v(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[m]=!0}var f=h.prototype;return f.parse=function(e){this.$d=function(e){var t=e.date,a=e.utc;if(null===t)return new Date(NaN);if(x.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(o);if(r){var n=r[2]-1||0,s=(r[7]||"0").substring(0,3);return a?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(t)}(e),this.init()},f.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},f.$utils=function(){return x},f.isValid=function(){return this.$d.toString()!==c},f.isSame=function(e,t){var a=j(e);return this.startOf(t)<=a&&a<=this.endOf(t)},f.isAfter=function(e,t){return j(e)<this.startOf(t)},f.isBefore=function(e,t){return this.endOf(t)<j(e)},f.$g=function(e,t,a){return x.u(e)?this[t]:this.set(a,e)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(e,i){var c=this,o=!!x.u(i)||i,u=x.p(e),h=function(e,t){var a=x.w(c.$u?Date.UTC(c.$y,t,e):new Date(c.$y,t,e),c);return o?a:a.endOf("day")},f=function(e,t){return x.w(c.toDate()[e].apply(c.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(t)),c)},p=this.$W,m=this.$M,y=this.$D,v="set"+(this.$u?"UTC":"");switch(u){case l:return o?h(1,0):h(31,11);case s:return o?h(1,m):h(0,m+1);case n:var j=this.$locale().weekStart||0,g=(p<j?p+7:p)-j;return h(o?y-g:y+(6-g),m);case"day":case d:return f(v+"Hours",0);case r:return f(v+"Minutes",1);case a:return f(v+"Seconds",2);case t:return f(v+"Milliseconds",3);default:return this.clone()}},f.endOf=function(e){return this.startOf(e,!1)},f.$set=function(n,i){var c,o=x.p(n),u="set"+(this.$u?"UTC":""),h=((c={}).day=u+"Date",c[d]=u+"Date",c[s]=u+"Month",c[l]=u+"FullYear",c[r]=u+"Hours",c[a]=u+"Minutes",c[t]=u+"Seconds",c[e]=u+"Milliseconds",c)[o],f="day"===o?this.$D+(i-this.$W):i;if(o===s||o===l){var p=this.clone().set(d,1);p.$d[h](f),p.init(),this.$d=p.set(d,Math.min(this.$D,p.daysInMonth())).$d}else h&&this.$d[h](f);return this.init(),this},f.set=function(e,t){return this.clone().$set(e,t)},f.get=function(e){return this[x.p(e)]()},f.add=function(e,i){var d,c=this;e=Number(e);var o=x.p(i),u=function(t){var a=j(c);return x.w(a.date(a.date()+Math.round(t*e)),c)};if(o===s)return this.set(s,this.$M+e);if(o===l)return this.set(l,this.$y+e);if("day"===o)return u(1);if(o===n)return u(7);var h=((d={})[a]=6e4,d[r]=36e5,d[t]=1e3,d)[o]||1,f=this.$d.getTime()+e*h;return x.w(f,this)},f.subtract=function(e,t){return this.add(-1*e,t)},f.format=function(e){var t=this,a=this.$locale();if(!this.isValid())return a.invalidDate||c;var r=e||"YYYY-MM-DDTHH:mm:ssZ",n=x.z(this),s=this.$H,i=this.$m,l=this.$M,d=a.weekdays,o=a.months,h=a.meridiem,f=function(e,a,n,s){return e&&(e[a]||e(t,r))||n[a].slice(0,s)},p=function(e){return x.s(s%12||12,e,"0")},m=h||function(e,t,a){var r=e<12?"AM":"PM";return a?r.toLowerCase():r};return r.replace(u,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return x.s(t.$y,4,"0");case"M":return l+1;case"MM":return x.s(l+1,2,"0");case"MMM":return f(a.monthsShort,l,o,3);case"MMMM":return f(o,l);case"D":return t.$D;case"DD":return x.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(a.weekdaysMin,t.$W,d,2);case"ddd":return f(a.weekdaysShort,t.$W,d,3);case"dddd":return d[t.$W];case"H":return String(s);case"HH":return x.s(s,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return m(s,i,!0);case"A":return m(s,i,!1);case"m":return String(i);case"mm":return x.s(i,2,"0");case"s":return String(t.$s);case"ss":return x.s(t.$s,2,"0");case"SSS":return x.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")})},f.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},f.diff=function(e,d,c){var o,u=this,h=x.p(d),f=j(e),p=(f.utcOffset()-this.utcOffset())*6e4,m=this-f,y=function(){return x.m(u,f)};switch(h){case l:o=y()/12;break;case s:o=y();break;case i:o=y()/3;break;case n:o=(m-p)/6048e5;break;case"day":o=(m-p)/864e5;break;case r:o=m/36e5;break;case a:o=m/6e4;break;case t:o=m/1e3;break;default:o=m}return c?o:x.a(o)},f.daysInMonth=function(){return this.endOf(s).$D},f.$locale=function(){return p[this.$L]},f.locale=function(e,t){if(!e)return this.$L;var a=this.clone(),r=v(e,t,!0);return r&&(a.$L=r),a},f.clone=function(){return x.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},h}(),b=g.prototype;return j.prototype=b,[["$ms",e],["$s",t],["$m",a],["$H",r],["$W","day"],["$M",s],["$y",l],["$D",d]].forEach(function(e){b[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),j.extend=function(e,t){return e.$i||(e(t,g,j),e.$i=!0),j},j.locale=v,j.isDayjs=y,j.unix=function(e){return j(1e3*e)},j.en=p[f],j.Ls=p,j.p={},j}()},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)},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)},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)},53138,51757,e=>{"use strict";var t=e.i(56420);let a=(0,t.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"}]]);e.s(["AlertTriangle",0,a],53138);let r=(0,t.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,r],51757)},56522,e=>{"use strict";let t=(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,t],56522)},72856,(e,t,a)=>{e.e,t.exports=function(e,t,a){e=e||{};var r=t.prototype,n={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(e,t,a,n){return r.fromToBase(e,t,a,n)}a.en.relativeTime=n,r.fromToBase=function(t,r,s,i,l){for(var d,c,o,u=s.$locale().relativeTime||n,h=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],f=h.length,p=0;p<f;p+=1){var m=h[p];m.d&&(d=i?a(t).diff(s,m.d,!0):s.diff(t,m.d,!0));var y=(e.rounding||Math.round)(Math.abs(d));if(o=d>0,y<=m.r||!m.r){y<=1&&p>0&&(m=h[p-1]);var v=u[m.l];l&&(y=l(""+y)),c="string"==typeof v?v.replace("%d",y):v(y,r,m.l,o);break}}if(r)return c;var j=o?u.future:u.past;return"function"==typeof j?j(c):j.replace("%s",c)},r.to=function(e,t){return s(e,t,this,!0)},r.from=function(e,t){return s(e,t,this)};var i=function(e){return e.$u?a.utc():a()};r.toNow=function(e){return this.to(i(this),e)},r.fromNow=function(e){return this.from(i(this),e)}}},56331,(e,t,a)=>{e.e,t.exports=function(e){"use strict";var t={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,t){return"W"===t?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,t){var a=100*e+t;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return(e&&"object"==typeof e&&"default"in e?e:{default:e}).default.locale(t,null,!0),t}(e.r(22315))},23261,e=>{"use strict";var t=e.i(18050),a=e.i(71645),r=e.i(22016),n=e.i(22315),s=e.i(72856);e.i(56331);var i=e.i(56420);let l=(0,i.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(53138),c=e.i(11241),o=e.i(51757);let u=(0,i.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"}]]),h=(0,i.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 f=e.i(62368),p=e.i(26091),m=e.i(50285);let y=(0,i.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 v=e.i(56522),j=e.i(41220);let x=(0,i.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 g=e.i(73474),b=e.i(66627),M=e.i(26913),$=e.i(3593);function w(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 S(e){return Number.isFinite(e)?String(Math.round(e/0x40000000*100)/100):"0"}function k(e){let t=Number(e);return!Number.isFinite(t)||t<0?0:Math.round(1024*t*1048576)}function _(e,t=12,a=8){return e?e.length<=t+a+3?e:`${e.slice(0,t)}...${e.slice(-a)}`:"-"}n.default.extend(s.default),n.default.locale("zh-cn");let N=[{label:"做种中",tone:"active",desc:"已加入 CID topic,可被其他节点发现并提供完整副本。"},{label:"队列中 / 加入中",tone:"pending",desc:"正在等待或重连 topic,通常会自动进入做种中。"},{label:"已暂停 / 未 join",tone:"muted",desc:"本机仍持有文件,但当前不会对外提供下载。"},{label:"错误",tone:"error",desc:"加入或做种失败,请查看下方节点日志里的 seed 事件。"}],D=[{value:"all",label:"全部"},{value:"join",label:"Join"},{value:"pull",label:"Pull"},{value:"verify",label:"Verify"},{value:"serve",label:"Serve"},{value:"error",label:"Error"}],C={join:["join","joined","topic"],pull:["pull","p2p"],verify:["verify","verified","integrity","download:success"],serve:["seed","seeding","holding","publish:success","topic:joined"],error:["error","failed","fail"]};e.s(["default",0,function(){let e,s,i,O,z=(0,$.useAppStore)(e=>e.hasBackend),T=(0,$.useAppStore)(e=>e.addToast),[L,Y]=(0,a.useState)(null),[A,B]=(0,a.useState)([]),[P,H]=(0,a.useState)(""),[I,E]=(0,a.useState)(!1),[F,U]=(0,a.useState)(!1),[R,V]=(0,a.useState)(!1),[W,G]=(0,a.useState)("all"),[K,J]=(0,a.useState)([]),[q,Z]=(0,a.useState)(""),[Q,X]=(0,a.useState)({dataPath:"",capacityGiB:"100",maxFileSizeGiB:"10",remoteInvites:""}),ee=!0===z;function et(){return!!ee||(T(null===z?"正在检测后端连接,请稍后再试":"未连接后端","warning"),!1)}let ea=(0,a.useMemo)(()=>!L||L.capacity.configuredBytes<=0?0:Math.min(100,Math.round(L.capacity.usedBytes/L.capacity.configuredBytes*100)),[L]),er=(0,a.useMemo)(()=>(L?.holdings||[]).slice(0,100),[L]),en=Math.max(0,(L?.holdings.length||0)-100),es=(0,M.getBackendUrlExport)(),ei=!!es&&!es.includes("localhost")&&!es.includes("127.0.0.1"),el=async()=>{if(!ee)return!1;try{let e=await M.api.get("/api/node/status").json(),t=await M.api.get("/api/node/config").json();return Y(e),X({dataPath:t.dataPath||e.dataPath||"",capacityGiB:S(t.capacityBytes),maxFileSizeGiB:S(t.maxFileSizeBytes),remoteInvites:(t.remoteInvites||[]).join("\n")}),H(""),!0}catch(t){let e=await (0,M.getApiErrorMessage)(t,"无法读取节点状态");return H(e),T(e,"error"),!1}},ed=async()=>{et()&&await el()&&T("节点状态已刷新","success")},ec=async(e=W)=>{if(ee)try{let t=new URLSearchParams({limit:"80",filter:e}),a=await M.api.get(`/api/node/logs?${t.toString()}`).json();B(a.logs||[])}catch{}},eo=async()=>{if(ee)try{let e=await M.api.get("/api/admin/users").json();J(e.users||[])}catch{}},eu=async()=>{if(et()){E(!0);try{var e;await M.api.post("/api/node/config",{json:{dataPath:Q.dataPath,capacityBytes:k(Q.capacityGiB),maxFileSizeBytes:k(Q.maxFileSizeGiB),remoteInvites:(e=Q.remoteInvites,Array.from(new Set(String(e||"").split(/[\n,]/).map(e=>e.trim()).filter(Boolean))))}}).json();let t=Q.dataPath!==(L?.dataPath||"");T(t?"节点配置已保存。修改了数据目录,需要重启 daemon 生效。":"节点配置已保存","success"),await el(),await ec()}catch(t){let e=await (0,M.getApiErrorMessage)(t,"保存配置失败");T(e,"error"),H(e)}finally{E(!1)}}},eh=async()=>{L?.nodeId&&(await navigator.clipboard.writeText(L.nodeId),T("节点 ID 已复制","success"))},ef=async()=>{if(et()){U(!0);try{await M.api.delete("/api/node/logs").json(),B([]),T("节点日志已清空","success")}catch(t){let e=await (0,M.getApiErrorMessage)(t,"清空日志失败");T(e,"error"),H(e)}finally{U(!1)}}},ep=async()=>{if(et()){V(!0);try{let e=await M.api.get("/api/node/diagnostics").json(),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),a=URL.createObjectURL(t),r=document.createElement("a"),n=new Date().toISOString().replace(/[:.]/g,"-");r.href=a,r.download=`mostbox-diagnostics-${n}.json`,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(a),T("诊断已导出","success")}catch(t){let e=await (0,M.getApiErrorMessage)(t,"导出诊断失败");T(e,"error"),H(e)}finally{V(!1)}}},em=async e=>{if(et()&&window.confirm(`确定清除用户 ${e.slice(0,6)}...${e.slice(-4)} 的文件记录和回收站吗?无人引用的副本也会被清理。`)){Z(e);try{await M.api.delete(`/api/admin/users/${e}/data`).json(),T("用户数据已清除","success"),await eo(),await el()}catch(t){let e=await (0,M.getApiErrorMessage)(t,"清除用户数据失败");T(e,"error"),H(e)}finally{Z("")}}};return(0,a.useEffect)(()=>{if(!ee||ei)return;el(),ec(),eo();let e=null,t=!1;return(async()=>{if(e=new WebSocket(await (0,M.getAuthenticatedWebSocketUrl)("/ws")),t)return e.close();e.onmessage=e=>{try{let t=JSON.parse(e.data);"node:status"===t.event&&Y(t.data),"node:log"===t.event&&function(e,t){let a=String(t||"all").trim().toLowerCase();if(!a||"all"===a)return!0;let r=function(e){let t="";try{t=JSON.stringify(e.data||{})}catch{}return[e.level,e.event,e.message,t].map(e=>String(e||"").toLowerCase()).join(" ")}(e);return"error"===a?"error"===e.level||C.error.some(e=>r.includes(e)):(C[a]||[a]).some(e=>r.includes(e))}(t.data,W)&&B(e=>[t.data,...e].slice(0,80)),"node:logs:cleared"===t.event&&B([]),("publish:success"===t.event||"download:success"===t.event||"network:status"===t.event)&&el()}catch{}}})(),()=>{t=!0,e?.close()}},[ee,ei,W]),(0,t.jsxs)("main",{className:"admin-page",children:[(0,t.jsxs)("header",{className:"admin-topbar",children:[(0,t.jsxs)("div",{className:"admin-title-group",children:[(0,t.jsx)(r.default,{href:"/",className:"btn btn-icon","aria-label":"返回首页",children:(0,t.jsx)(c.ArrowLeft,{size:16})}),(0,t.jsx)("div",{children:(0,t.jsx)("h1",{children:"节点管理"})})]}),(0,t.jsxs)("div",{className:"admin-topbar-actions",children:[(0,t.jsxs)("span",{className:`admin-status-pill ${L?.status==="online"?"online":""}`,children:[(0,t.jsx)(l,{size:14}),L?.status==="online"?"在线":"等待"]}),(0,t.jsxs)("button",{className:"btn btn-secondary",onClick:ed,children:[(0,t.jsx)(y,{size:16}),"刷新"]})]})]}),!1===z&&(0,t.jsxs)("section",{className:"admin-panel admin-error",children:[(0,t.jsx)(j.Server,{size:20}),(0,t.jsx)("span",{children:"未连接本地 daemon"})]}),ei&&(0,t.jsxs)("section",{className:"admin-panel admin-error",children:[(0,t.jsx)(d.AlertTriangle,{size:18}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{children:"远程节点管理不可用"}),(0,t.jsx)("p",{children:"当前连接的是别人部署的远程节点,普通邀请码不能查看或修改节点管理数据。"})]})]}),!ei&&P&&(0,t.jsxs)("section",{className:"admin-panel admin-error",children:[(0,t.jsx)(p.FileText,{size:20}),(0,t.jsx)("span",{children:P})]}),!ei&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"admin-overview",children:[(0,t.jsxs)("div",{className:"admin-metric",children:[(0,t.jsx)("div",{className:"admin-metric-icon",children:(0,t.jsx)(x,{size:18})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"节点 ID"}),(0,t.jsx)("strong",{children:_(L?.nodeId||"")})]}),(0,t.jsx)("button",{className:"btn btn-icon admin-metric-action",onClick:eh,"aria-label":"复制节点 ID",children:(0,t.jsx)(u,{size:15})})]}),(0,t.jsxs)("div",{className:"admin-metric",children:[(0,t.jsx)("div",{className:"admin-metric-icon",children:(0,t.jsx)(b.Wifi,{size:18})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"连接"}),(0,t.jsx)("strong",{children:L?`${L.network.peers} peers`:"-"})]})]}),(0,t.jsxs)("div",{className:"admin-metric",children:[(0,t.jsx)("div",{className:"admin-metric-icon",children:(0,t.jsx)(m.HardDrive,{size:18})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"容量"}),(0,t.jsxs)("strong",{children:[ea,"%"]})]})]}),(0,t.jsxs)("div",{className:"admin-metric",children:[(0,t.jsx)("div",{className:"admin-metric-icon",children:(0,t.jsx)(j.Server,{size:18})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"运行"}),(0,t.jsx)("strong",{children:L?(s=Math.floor((e=Math.max(0,Number(L.uptimeSeconds)||0))/86400),i=Math.floor(e%86400/3600),O=Math.floor(e%3600/60),s>0?`${s} 天 ${i} 小时`:i>0?`${i} 小时 ${O} 分钟`:`${O} 分钟`):"-"})]})]})]}),(0,t.jsxs)("section",{className:"admin-grid",children:[(0,t.jsxs)("div",{className:"admin-panel admin-span-2",children:[(0,t.jsxs)("div",{className:"admin-panel-header",children:[(0,t.jsx)("div",{children:(0,t.jsx)("h2",{children:"节点状态"})}),(0,t.jsx)(o.CheckCircle2,{size:18})]}),(0,t.jsxs)("div",{className:"admin-status-grid",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"版本"}),(0,t.jsx)("strong",{children:L?.version||"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"监听"}),(0,t.jsx)("strong",{children:L?`${L.host}:${L.port}`:"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{children:"数据目录"}),(0,t.jsx)("strong",{children:L?.dataPath||"-"})]})]}),(0,t.jsx)("div",{className:"admin-address-list",children:(L?.listen.addresses||[]).map(e=>(0,t.jsxs)("span",{children:[e.label,": ",e.ip,":",L?.port]},`${e.type}-${e.ip}`))})]}),(0,t.jsxs)("div",{className:"admin-panel admin-span-2",children:[(0,t.jsxs)("div",{className:"admin-panel-header",children:[(0,t.jsx)("div",{children:(0,t.jsx)("h2",{children:"用户数据"})}),(0,t.jsx)(h,{size:18})]}),(0,t.jsxs)("div",{className:"admin-table",children:[(0,t.jsxs)("div",{className:"admin-table-row admin-table-head",children:[(0,t.jsx)("span",{children:"用户"}),(0,t.jsx)("span",{children:"文件"}),(0,t.jsx)("span",{children:"回收站"}),(0,t.jsx)("span",{children:"操作"})]}),K.map(e=>(0,t.jsxs)("div",{className:"admin-table-row",children:[(0,t.jsx)("span",{title:e.address,children:_(e.address)}),(0,t.jsx)("span",{children:e.fileCount}),(0,t.jsx)("span",{children:e.trashCount}),(0,t.jsx)("span",{children:(0,t.jsxs)("button",{className:"btn btn-ghost",onClick:()=>em(e.address),disabled:q===e.address,children:[(0,t.jsx)(g.Trash2,{size:16}),"清除"]})})]},e.address)),0===K.length&&(0,t.jsx)("div",{className:"admin-empty-row",children:"暂无用户数据"})]})]}),(0,t.jsxs)("div",{className:"admin-panel admin-span-2",children:[(0,t.jsxs)("div",{className:"admin-panel-header",children:[(0,t.jsx)("div",{children:(0,t.jsx)("h2",{children:"节点设置"})}),(0,t.jsx)(h,{size:18})]}),(0,t.jsxs)("div",{className:"admin-settings-fields",children:[(0,t.jsxs)("label",{className:"admin-field admin-field-wide",children:[(0,t.jsx)("span",{children:"数据目录"}),(0,t.jsx)("input",{className:"input",value:Q.dataPath,onChange:e=>X(t=>({...t,dataPath:e.target.value}))})]}),(0,t.jsxs)("label",{className:"admin-field",children:[(0,t.jsx)("span",{children:"容量上限 GiB"}),(0,t.jsx)("input",{className:"input",type:"number",min:"0",step:"1",value:Q.capacityGiB,onChange:e=>X(t=>({...t,capacityGiB:e.target.value}))})]}),(0,t.jsxs)("label",{className:"admin-field",children:[(0,t.jsx)("span",{children:"单文件最大 GiB"}),(0,t.jsx)("input",{className:"input",type:"number",min:"0",step:"1",value:Q.maxFileSizeGiB,onChange:e=>X(t=>({...t,maxFileSizeGiB:e.target.value}))})]}),(0,t.jsxs)("label",{className:"admin-field admin-field-wide",children:[(0,t.jsx)("span",{children:"远程访问邀请码"}),(0,t.jsx)("textarea",{className:"input admin-textarea",value:Q.remoteInvites,placeholder:"每行一个,或用英文逗号分隔",onChange:e=>X(t=>({...t,remoteInvites:e.target.value}))})]})]}),(0,t.jsx)("p",{className:"admin-field-hint",children:"数据目录变更保存后需要重启 daemon。修改邀请码后新请求立即生效。 发布和下载成功后会固定做种;MostBox 不设同时做种数或传输限速。"}),(0,t.jsxs)("button",{className:"btn btn-primary btn-full",onClick:eu,disabled:I,children:[(0,t.jsx)(v.Save,{size:16}),"保存配置"]})]}),(0,t.jsxs)("div",{className:"admin-panel admin-span-2",children:[(0,t.jsxs)("div",{className:"admin-panel-header",children:[(0,t.jsx)("div",{children:(0,t.jsx)("h2",{children:"持有副本"})}),(0,t.jsx)(m.HardDrive,{size:18})]}),(0,t.jsxs)("div",{className:"admin-capacity-row",children:[(0,t.jsx)("progress",{value:ea,max:"100"}),(0,t.jsxs)("span",{children:[w(L?.capacity.usedBytes||0)," /"," ",w(L?.capacity.configuredBytes||0)]})]}),(0,t.jsx)("div",{className:"admin-seed-help","aria-label":"做种状态说明",children:N.map(e=>(0,t.jsxs)("div",{className:"admin-seed-help-item",children:[(0,t.jsx)("span",{className:`admin-seed-dot ${e.tone}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:e.label}),(0,t.jsx)("span",{children:e.desc})]})]},e.label))}),en>0&&(0,t.jsxs)("p",{className:"admin-table-note",children:["当前仅展示前 100 个副本,另有 ",en," ","个仍在后台做种。"]}),(0,t.jsxs)("div",{className:"admin-table",children:[(0,t.jsxs)("div",{className:"admin-table-row admin-table-head",children:[(0,t.jsx)("span",{children:"文件"}),(0,t.jsx)("span",{children:"CID"}),(0,t.jsx)("span",{children:"大小"}),(0,t.jsx)("span",{children:"Peer"}),(0,t.jsx)("span",{children:"最近服务"}),(0,t.jsx)("span",{children:"状态"})]}),er.map(e=>(0,t.jsxs)("div",{className:"admin-table-row",children:[(0,t.jsx)("span",{children:e.fileName||"-"}),(0,t.jsx)("span",{title:e.cid,children:_(e.cid)}),(0,t.jsx)("span",{children:w(e.size)}),(0,t.jsx)("span",{children:e.peerCount??0}),(0,t.jsx)("span",{title:e.lastServedAt||"",children:function(e){if(!e)return"从未";let t=(0,n.default)(e);return t.isValid()?t.isAfter((0,n.default)())?"刚刚":t.fromNow():"从未"}(e.lastServedAt)}),(0,t.jsx)("span",{className:`admin-seed-pill ${"error"===e.seedStatus?"error":"active"===e.seedStatus||e.joined?"active":""}`,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)),(!L||0===L.holdings.length)&&(0,t.jsx)("div",{className:"admin-empty-row",children:"暂无持有副本"})]})]}),(0,t.jsxs)("div",{className:"admin-panel admin-span-2",children:[(0,t.jsxs)("div",{className:"admin-panel-header",children:[(0,t.jsx)("div",{children:(0,t.jsx)("h2",{children:"节点日志"})}),(0,t.jsxs)("div",{className:"admin-panel-actions",children:[(0,t.jsxs)("button",{className:"btn btn-secondary",onClick:ep,disabled:R,children:[(0,t.jsx)(f.Download,{size:16}),"导出诊断"]}),(0,t.jsxs)("button",{className:"btn btn-ghost",onClick:ef,disabled:F||0===A.length,children:[(0,t.jsx)(g.Trash2,{size:16}),"清空日志"]}),(0,t.jsx)(p.FileText,{size:18})]})]}),(0,t.jsx)("div",{className:"admin-log-filter","aria-label":"日志筛选",children:D.map(e=>(0,t.jsx)("button",{type:"button",className:W===e.value?"active":"",onClick:()=>{G(e.value),ec(e.value)},children:e.label},e.value))}),(0,t.jsxs)("div",{className:"admin-log-list",children:[A.map(e=>(0,t.jsxs)("div",{className:"admin-log-row",children:[(0,t.jsx)("time",{children:new Date(e.ts).toLocaleTimeString("zh-CN")}),(0,t.jsx)("span",{className:`admin-log-level ${e.level}`,children:e.level}),(0,t.jsx)("strong",{children:e.event}),(0,t.jsx)("span",{children:e.message})]},e.id)),0===A.length&&(0,t.jsx)("div",{className:"admin-empty-row",children:"暂无日志"})]})]})]})]})]})}],23261)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89664,e=>{"use strict";let a=(0,e.i(56420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,a],89664)},8734,e=>{"use strict";let a=(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,a],8734)},51921,e=>{"use strict";let a=(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,a],51921)},15170,80796,e=>{"use strict";var a=e.i(56420);let s=(0,a.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["Image",0,s],15170);let t=(0,a.default)("film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);e.s(["Film",0,t],80796)},79490,e=>{"use strict";let a=(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,a],79490)},12796,11028,6933,e=>{"use strict";let a=(0,e.i(56420).default)("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);e.s(["Loader",0,a],12796);var s=e.i(18050),t=e.i(71645),i=e.i(26091),r=e.i(51921),l=e.i(63676),n=e.i(26913);e.s(["default",0,function({item:e,isBackendReady:o,getFileDownloadUrl:c,onClose:d}){let[u,m]=(0,t.useState)(""),[h,p]=(0,t.useState)(!1),[f,x]=(0,t.useState)(""),[j,g]=(0,t.useState)("");return(0,t.useEffect)(()=>{if("text"!==e.subtype)return;let a=!1;return(m(""),g(""),o)?(p(!0),(async()=>{try{let s=await fetch(c(e.cid),{headers:{...await (0,n.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`),Range:"bytes=0-9999"}});if(!s.ok)throw Error("加载失败");let t=await s.text();a||m(t||"(文件为空)")}catch{a||m("加载失败")}finally{a||p(!1)}})(),()=>{a=!0}):void m("加载失败")},[c,o,e.cid,e.subtype]),(0,t.useEffect)(()=>{var a;if("image"!==(a=e.subtype)&&"video"!==a&&"audio"!==a)return void x("");if(x(""),g(""),!o)return void g("加载失败");let s="",t=!1;return(async()=>{try{let a=await fetch(c(e.cid),{headers:await (0,n.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`)});if(!a.ok)throw Error("加载失败");let i=URL.createObjectURL(await a.blob());s=i,t||x(i)}catch{t||g("加载失败")}})(),()=>{t=!0,s&&URL.revokeObjectURL(s)}},[c,o,e.cid,e.subtype]),(0,s.jsxs)("div",{className:"preview-overlay",onClick:d,children:[(0,s.jsx)("button",{type:"button",className:"preview-close",onClick:d,"aria-label":"关闭预览",children:(0,s.jsx)(l.X,{size:20})}),(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),children:["image"===e.subtype&&(0,s.jsx)("div",{className:"preview-media-wrapper",children:f?(0,s.jsx)("img",{src:f,alt:e.fileName}):j?(0,s.jsxs)("div",{className:"preview-unsupported",children:[(0,s.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,s.jsx)("p",{children:e.fileName}),(0,s.jsx)("p",{className:"preview-unsupported-hint",children:j})]}):(0,s.jsx)("div",{className:"preview-loading",children:(0,s.jsx)("div",{className:"preview-loading-spinner"})})}),"video"===e.subtype&&(0,s.jsx)("div",{className:"preview-media-wrapper",children:f?(0,s.jsx)("video",{src:f,controls:!0}):j?(0,s.jsxs)("div",{className:"preview-unsupported",children:[(0,s.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,s.jsx)("p",{children:e.fileName}),(0,s.jsx)("p",{className:"preview-unsupported-hint",children:j})]}):(0,s.jsx)("div",{className:"preview-loading",children:(0,s.jsx)("div",{className:"preview-loading-spinner"})})}),"audio"===e.subtype&&(0,s.jsxs)("div",{className:"preview-audio",children:[(0,s.jsx)("div",{className:"preview-audio-icon",children:(0,s.jsx)(r.Music,{size:36,color:"var(--accent)"})}),(0,s.jsx)("p",{className:"preview-audio-filename",children:e.fileName}),f?(0,s.jsx)("audio",{className:"preview-audio-player",src:f,controls:!0}):(0,s.jsx)("div",{className:"preview-text-loading",children:j?(0,s.jsx)("p",{children:j}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{size:24,className:"preview-text-spinner"}),(0,s.jsx)("p",{children:"正在加载音频预览..."})]})})]}),"file"===e.subtype&&(0,s.jsxs)("div",{className:"preview-unsupported",children:[(0,s.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,s.jsx)("p",{children:e.fileName}),(0,s.jsx)("p",{className:"preview-unsupported-hint",children:"无法预览"})]}),"text"===e.subtype&&(0,s.jsxs)("div",{className:"preview-text-container",children:[(0,s.jsx)("div",{className:"preview-text-header",children:(0,s.jsx)("span",{children:e.fileName})}),h?(0,s.jsxs)("div",{className:"preview-text-loading",children:[(0,s.jsx)(a,{size:24,className:"preview-text-spinner"}),(0,s.jsx)("p",{children:"正在加载文本预览..."}),(0,s.jsx)("p",{className:"preview-text-loading-hint",children:"如果是初次预览,可能需要等待 P2P 网络同步"})]}):(0,s.jsx)("pre",{className:"preview-text",children:u||"(文件为空)"})]})]})]})}],11028),e.s(["getFileSubtype",0,function(e){let a=String(e||"").split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","heic","heif"].includes(a)?"image":["mp4","webm","mov","avi","mkv","flv","wmv","m4v","mpeg","3gp"].includes(a)?"video":["mp3","wav","ogg","flac","aac","m4a","wma","opus"].includes(a)?"audio":["txt","md","js","ts","jsx","tsx","css","scss","less","json","xml","html","htm","yaml","yml","toml","ini","cfg","conf","log","sh","bash","py","rb","go","rs","java","c","cpp","h","hpp","cs","php","sql","graphql","env","gitignore","dockerfile","readme"].includes(a)?"text":"file"}],6933)},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)},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)},59665,5142,e=>{"use strict";var a=e.i(18050),s=e.i(71645);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"}]]);function i(e=!1,a={}){let[t,r]=(0,s.useState)(e),l=(0,s.useCallback)(()=>{r(e=>e||(a.onOpen?.(),!0))},[a.onOpen]),n=(0,s.useCallback)(()=>{r(e=>e?(a.onClose?.(),!1):e)},[a.onClose]);return[t,{open:l,close:n,toggle:(0,s.useCallback)(()=>{t?n():l()},[n,l,t]),set:r}]}e.s(["useDisclosure",0,i],5142);let r=(0,s.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:l,headerRight:n,children:o}){let[c,d]=i(!1),[u,m]=(0,s.useState)(!1),h=function(e,{getInitialValueInEffect:a}={getInitialValueInEffect:!0}){let[t,i]=(0,s.useState)(a?void 0:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,s.useEffect)(()=>{try{if("matchMedia"in window){let a=window.matchMedia(e);i(a.matches);let s=e=>i(e.matches);return a.addEventListener("change",s),()=>{a.removeEventListener("change",s)}}}catch(e){return}},[e]),t||!1}("(max-width: 768px)"),p=()=>{h?d.open():m(!1)};return(0,a.jsx)(r.Provider,{value:{closeSidebar:d.close,openSidebar:p,isSidebarVisible:h?c:!u},children:(0,a.jsxs)("div",{className:"app-layout",children:[(0,a.jsx)("div",{className:`sidebar-overlay ${c?"visible":""}`,onClick:()=>d.close()}),(0,a.jsx)("div",{className:`sidebar ${c?"open":""} ${u?"collapsed":""}`,children:e({closeSidebar:d.close,openSidebar:p})}),(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:()=>{h?d.toggle():m(!u)},className:"btn btn-icon sidebar-toggle-btn","aria-label":h?"打开菜单":u?"展开侧边栏":"收起侧边栏",children:(0,a.jsx)(t,{size:16})}),l]}),(0,a.jsx)("div",{className:"header-right",children:n})]}),o]})]})})},"useAppShell",0,function(){let e=(0,s.useContext)(r);if(!e)throw Error("useAppShell must be used within AppShell");return e}],59665)},27648,e=>{"use strict";var a=e.i(18050),s=e.i(93957),t=e.i(71192);e.s(["default",0,function({className:e=""}){let i=(0,t.useUserStore)(e=>e.identity),r=(0,t.useUserStore)(e=>e.openLoginModal),l=(0,t.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,s.generateAvatar)(i?.address,i?.avatar),alt:"avatar"}),(0,a.jsx)("span",{className:"user-name",title:i?.address,children:i?.displayName||"未登录"})]}),i?(0,a.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:l,children:"退出"}):(0,a.jsx)("button",{className:"btn btn-primary login-btn",onClick:r,children:"登录"})]})}])},39626,e=>{"use strict";var a=e.i(18050);let s=(0,e.i(56420).default)("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);var t=e.i(59665);e.s(["default",0,function({label:e="打开侧边栏",className:i="",variant:r="primary"}){let{isSidebarVisible:l,openSidebar:n}=(0,t.useAppShell)();return l?null:(0,a.jsxs)("button",{type:"button",className:`btn ${"primary"===r?"btn-primary":""} sidebar-open-hint ${i}`.trim(),onClick:n,children:[(0,a.jsx)(s,{size:16}),e]})}],39626)},62368,e=>{"use strict";let a=(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,a],62368)},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)},66595,e=>{"use strict";let a=(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,a],66595)},25981,e=>{"use strict";let a=(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,a],25981)},26067,e=>{"use strict";let a=(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,a],26067)},67927,e=>{"use strict";let a=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,a],67927)},27627,e=>{"use strict";var a=e.i(18050),s=e.i(71645),t=e.i(25981),i=e.i(35965),r=e.i(96699),l=e.i(15170),n=e.i(73474),o=e.i(26067),c=e.i(80796),d=e.i(51921),u=e.i(67927),m=e.i(26091),h=e.i(63676),p=e.i(89664),f=e.i(8734),x=e.i(62368),j=e.i(56420);let g=(0,j.default)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),v=(0,j.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),b=(0,j.default)("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);var y=e.i(66595),w=e.i(79490),N=e.i(12796),k=e.i(11241);let C=(0,j.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var M=e.i(59665),S=e.i(39626),$=e.i(27648),z=e.i(11028);e.i(4121);var F=e.i(57667),E=e.i(88361),L=e.i(47910),D=e.i(26913),T=e.i(64621);let I="链接格式不正确,请粘贴完整的 most://<cid>?filename=... 分享链接。",A="暂时没有发现在线种子。请确认分享者或其他下载者仍在线做种,稍后再检测。",R={"Link must be a valid most:// URL":"链接无法解析,请粘贴完整的 most://<cid>?filename=... 分享链接。","Link must use most:// protocol":"链接协议不正确,应以 most:// 开头。","Link path is not supported":"链接里不应包含路径,请使用 most://<cid>?filename=... 格式。","Invalid CID format":"CID 无效,请确认 most:// 后面的内容没有缺失或被截断。","Invalid CID format: CID v1 required":"CID 格式不符合 MostBox 要求,请确认分享链接完整。","CID digest must be 32 bytes":"CID 格式不符合 MostBox 要求,请确认分享链接完整。","filename is required":"链接缺少 filename 参数,请复制完整分享链接后再检测。"};function U(e=""){let a=String(e||"").trim();if(!a)return"请先粘贴 most:// 分享链接。";let s=function(e){let a;if(!e||"string"!=typeof e)return{cid:"",error:"Link must be a non-empty string"};try{a=new URL(e)}catch{return{cid:"",error:"Link must be a valid most:// URL"}}if("most:"!==a.protocol)return{cid:"",error:"Link must use most:// protocol"};if(a.pathname&&"/"!==a.pathname)return{cid:"",error:"Link path is not supported"};let s=a.hostname,t=a.searchParams.get("filename"),i=[...a.searchParams.keys()].find(e=>"filename"!==e),r=function(e){let a;if(!e||"string"!=typeof e)return{valid:!1,error:"CID must be a non-empty string"};try{a=T.CID.parse(e)}catch{return{valid:!1,error:"Invalid CID format"}}return 1!==a.version?{valid:!1,error:"Invalid CID format: CID v1 required"}:32!==a.multihash.digest.length?{valid:!1,error:"CID digest must be 32 bytes"}:{valid:!0}}(s);return r.valid?t?i?{cid:"",error:`Unsupported query parameter: ${i}`}:{cid:s,fileName:t}:{cid:"",error:"filename is required"}:{cid:"",error:r.error}}(a);if(!s.error)return s.fileName?.trim()?null:R["filename is required"];if(s.error.startsWith("Unsupported query parameter: ")){let e=s.error.slice(29);return`链接包含暂不支持的参数 ${e},请只保留 filename。`}return R[s.error]||I}var O=e.i(3593),P=e.i(71192),q=e.i(5142),B=e.i(6933);async function V(e){return function(e={},a=""){if("TimeoutError"===a)return"检测等待超时,暂时没有等到在线种子响应。请确认分享者或其他下载者仍在线做种,稍后再检测。";if(!e.status)return"无法连接本地节点,请确认 MostBox 后端正在运行后再检测。";if(404===e.status)return"当前后端还没有检测接口,请重启 MostBox 后端后再试。";switch(e.code){case"VALIDATION_ERROR":return I;case"CONFLICT":return e.error?`${e.error},请先处理同名文件后再下载。`:"下载目录已有同名文件,请先重命名或移走后再检测。";case"PEER_NOT_FOUND":return A;case"PERMISSION_ERROR":return e.error?`下载目录不可写:${e.error}`:"下载目录不可写,请检查目录权限后再检测。";case"ENGINE_NOT_INITIALIZED":return"本地节点还没有启动完成,请稍等几秒后重新检测。"}return 503===e.status?A:e.status>=500?"本地节点检测时出错,请稍后重试或查看节点日志。":e.error?`检测未通过:${e.error}`:"检测未通过,请确认链接完整、发布者在线且本机网络正常。"}(await (0,D.getApiErrorPayload)(e),e&&"object"==typeof e&&"name"in e?String(e.name):"")}let H={listPublishedFiles:()=>D.api.get("/api/files").json(),listTrashFiles:()=>D.api.get("/api/trash").json(),deletePublishedFile:e=>D.api.delete(`/api/files/${e}`).json(),restoreTrashFile:e=>D.api.post(`/api/trash/${e}/restore`).json(),permanentDeleteTrashFile:e=>D.api.delete(`/api/trash/${e}`).json(),emptyTrash:()=>D.api.delete("/api/trash").json(),toggleStar:e=>D.api.post(`/api/files/${e}/star`).json(),getConfig:()=>D.api.get("/api/config").json(),getDataPath:()=>D.api.get("/api/config/data-path").json(),getNetworkAddresses:()=>D.api.get("/api/network").json(),saveConfig:e=>D.api.post("/api/config",{json:e}).json(),async publishFile(e,a){let s=new FormData;s.append("file",e,a||e.name);let t=await D.api.post("/api/publish",{body:s});if(!t.ok)throw Error((await t.json().catch(()=>({error:t.statusText}))).error||"Request failed");return t.json()},checkDownload:e=>D.api.post("/api/download/check",{json:{link:e},timeout:15e3}).json(),downloadFile:e=>D.api.post("/api/download",{json:{link:e}}).json(),cancelDownload:e=>D.api.post("/api/download/cancel",{json:{taskId:e}}).json(),getFileDownloadUrl:e=>(0,D.getApiUrl)(`/api/files/${e}/download`),moveFile:(e,a)=>D.api.post("/api/move",{json:{cid:e,newFileName:a}}).json(),renameFolder:(e,a)=>D.api.post("/api/folder/rename",{json:{oldPath:e,newPath:a}}).json()};function _(e){return!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 W(e){let a=e.lastIndexOf("/");return -1===a?{folder:"",name:e}:{folder:e.substring(0,a),name:e.substring(a+1)}}function X(e){return e?[{path:"",name:"全部内容"},...e.split("/").filter(Boolean).map((e,a,s)=>({path:s.slice(0,a+1).join("/"),name:e}))]:[]}function G({file:e,isSelected:s,onSelect:t,onPreview:i}){let r=(0,B.getFileSubtype)(e.fileName),n=(0,a.jsx)(m.FileText,{size:24,color:"#fff"});return"image"===r?n=(0,a.jsx)(l.Image,{size:24,color:"#fff"}):"video"===r?n=(0,a.jsx)(c.Film,{size:24,color:"#fff"}):"audio"===r&&(n=(0,a.jsx)(d.Music,{size:24,color:"#fff"})),(0,a.jsxs)("div",{"data-id":e.cid,onClick:()=>t(e.cid),onDoubleClick:()=>i(e),className:`card ${s?"selected":""}`,children:[(0,a.jsx)("div",{className:`card-icon ${e.starred?"starred":"file"}`,children:n}),(0,a.jsx)("p",{className:"card-name",children:W(e.fileName).name})]})}function K({folder:e,onClick:s}){return(0,a.jsxs)("div",{onClick:s,className:"card",children:[(0,a.jsx)("div",{className:"card-icon folder",children:(0,a.jsx)(o.Folder,{size:28,color:"#fff"})}),(0,a.jsx)("p",{className:"card-name",children:e.name})]})}function Z({items:e,allFolders:t,currentPath:i,onMove:r,onClose:l}){let[n,c]=(0,s.useState)(""),[d,u]=(0,s.useState)(i),m=X(n);return(0,a.jsx)(F.ModalOverlay,{onClose:l,children:(0,a.jsxs)("div",{className:"move-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsx)("h3",{children:"移动到"}),(0,a.jsx)("button",{onClick:l,className:"btn btn-icon",children:(0,a.jsx)(h.X,{size:18})})]}),(0,a.jsxs)("p",{className:"move-modal-desc",children:["已选 ",e.length," 个项目"]}),(0,a.jsx)("div",{className:"move-new-folder",children:(0,a.jsx)("input",{type:"text",className:"input",value:d,onChange:e=>u(e.target.value),placeholder:"输入路径创建嵌套文件夹"})}),(0,a.jsx)("p",{className:"move-modal-hint",children:"如 图片/壁纸"}),(0,a.jsx)("div",{className:"move-breadcrumb",children:m.map((e,t)=>(0,a.jsxs)(s.default.Fragment,{children:[t>0&&(0,a.jsx)("span",{className:"breadcrumb-separator",children:"/"}),(0,a.jsx)("button",{onClick:()=>{c(e.path),u(e.path)},className:`move-breadcrumb-btn ${n===e.path&&!d?"active":""}`,children:e.name},e.path)]},e.path))}),(0,a.jsxs)("div",{className:"move-folder-list",children:[0===t.filter(e=>{if(""===n)return!e.path.includes("/");let a=n+"/";return!!e.path.startsWith(a)&&!e.path.substring(a.length).includes("/")}).length&&(0,a.jsx)("p",{className:"move-modal-empty",children:"该目录下没有子文件夹"}),t.filter(e=>{if(""===n)return!e.path.includes("/");let a=n+"/";return!!e.path.startsWith(a)&&!e.path.substring(a.length).includes("/")}).map(e=>(0,a.jsxs)("button",{onClick:()=>c(e.path),className:`move-folder-item ${n===e.path&&!d?"selected":""}`,children:[(0,a.jsx)(o.Folder,{size:16}),(0,a.jsx)("span",{children:e.name})]},e.path))]}),(0,a.jsxs)("div",{className:"modal-actions",children:[(0,a.jsx)("button",{onClick:l,className:"btn btn-secondary",children:"取消"}),(0,a.jsx)("button",{onClick:()=>{r(n||d.trim())},className:"btn btn-primary",children:"移动"})]})]})})}e.s(["default",0,function(){let e,l,o,c=(0,O.useAppStore)(e=>e.isDarkMode),d=(0,O.useAppStore)(e=>e.setIsDarkMode),j=(0,O.useAppStore)(e=>e.addToast),T=(0,O.useAppStore)(e=>e.hasBackend),I=(0,O.useAppStore)(e=>e.openConnectModal),A=(0,P.useUserStore)(e=>e.identity),R=(0,P.useUserStore)(e=>e.openLoginModal),[J,Q]=(0,s.useState)([]),[Y,ee]=(0,s.useState)([]),[ea,es]=(0,s.useState)(null),[et,ei]=(0,s.useState)("all"),[er,el]=(0,s.useState)(!1),[en,eo]=(0,s.useState)([]),[ec,ed]=(0,s.useState)(null),[eu,em]=(0,s.useState)(null),[eh,ep]=(0,q.useDisclosure)(!1),[ef,ex]=(0,s.useState)(""),[ej,eg]=(0,s.useState)(null),[ev,eb]=(0,s.useState)(!1),[ey,ew]=(0,s.useState)([]),[eN,ek]=(0,q.useDisclosure)(!1),[eC,eM]=(0,s.useState)(""),{copy:eS,copied:e$}=function(e={}){let a=e.timeout??2e3,[t,i]=(0,s.useState)(null),[r,l]=(0,s.useState)(!1),n=(0,s.useRef)(null);return(0,s.useEffect)(()=>()=>{window.clearTimeout(n.current)},[]),{copy:e=>{"clipboard"in navigator?navigator.clipboard.writeText(e).then(()=>{i(null),window.clearTimeout(n.current),n.current=window.setTimeout(()=>l(!1),a),l(!0)}).catch(e=>i(e)):i(Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{l(!1),i(null),window.clearTimeout(n.current)},error:t,copied:r}}({timeout:2e3}),[ez,eF]=(0,q.useDisclosure)(!1),[eE,eL]=(0,s.useState)(null),[eD,eT]=(0,s.useState)(null),[eI,eA]=(0,s.useState)(!1),eR=!0===T,eU=ea||"",eO=(e=new Set,J.forEach(a=>{let{folder:s}=W(a.fileName),t=s.split("/").filter(Boolean),i="";for(let a of t)i+=(i?"/":"")+a,e.add(i)}),[...e].sort()),{folders:eP,files:eq}={folders:(l=eU?eU+"/":"",eO.filter(e=>{let a=e.toLowerCase().startsWith(l.toLowerCase()),s=e.substring(l.length);return a&&!s.includes("/")}).map(e=>({name:e.substring(l.length),path:e}))),files:J.filter(e=>W(e.fileName).folder===eU)};function eB(){return!!eR||(I(),!1)}function eV(){return!!A||(R(),!1)}let eH=eC?J.filter(e=>W(e.fileName).name.toLowerCase().includes(eC.toLowerCase())):eq,e_=async()=>{if(!eR||!A)return void Q([]);try{let e=await H.listPublishedFiles();Q(e||[])}catch{Q([])}},eW=async()=>{if(!eR||!A)return void ee([]);try{let e=await H.listTrashFiles();ee(e||[])}catch{ee([])}},eX=e=>{eo(a=>a.includes(e)?a.filter(a=>a!==e):[...a,e])},eG=async e=>{if(eV()&&eB())try{await H.restoreTrashFile(e),j("已恢复","success"),e_(),eW()}catch(e){j(await (0,D.getApiErrorMessage)(e,"恢复失败"),"error")}},eK=async()=>{!eV()||eB()&&eL({title:"清空回收站",message:"确定要清空回收站吗?此操作不可恢复!",confirmText:"清空",danger:!0,onConfirm:async()=>{eL(null);try{await H.emptyTrash(),j("回收站已清空","success"),eW()}catch(e){j(await (0,D.getApiErrorMessage)(e,"清空失败"),"error")}}})},eZ=async e=>{if(eV()&&eB())try{let a=await H.toggleStar(e);Q(s=>s.map(s=>s.cid===e?{...s,starred:a.starred}:s)),j(a.starred?"已收藏":"已取消收藏","success")}catch(e){j(await (0,D.getApiErrorMessage)(e,"操作失败"),"error")}},eJ=async()=>{if(!eV()||!eB())return;let e="trash"===et;eL({title:e?"永久删除":"批量删除",message:e?`确定要永久删除选中的 ${en.length} 个项目吗?此操作不可恢复!`:`确定要删除选中的 ${en.length} 个项目吗?`,confirmText:e?"永久删除":"删除",danger:!0,onConfirm:async()=>{eL(null);try{for(let a of en)e?await H.permanentDeleteTrashFile(a):a.startsWith("__")||await H.deletePublishedFile(a);eo([]),j(e?"已永久删除":"已删除","success"),e_(),eW()}catch(e){j(await (0,D.getApiErrorMessage)(e,"删除失败"),"error")}}})},eQ=async e=>{if(eV()&&eB())try{for(let a of en){let s=J.find(e=>e.cid===a);if(!s)continue;let{name:t}=W(s.fileName),i=e?`${e}/${t}`:t;s.fileName!==i&&await H.moveFile(a,i)}eo([]),eF.close(),j("已移动","success"),e_()}catch(e){j(await (0,D.getApiErrorMessage)(e,"移动失败"),"error")}},eY=e=>{let a=!!e.path,s=a?e.name:W(e.fileName).name;eT({title:a?"重命名文件夹":"重命名文件",placeholder:"请输入新名称",defaultValue:s,confirmText:"重命名",onConfirm:async t=>{if(t!==s&&eV()&&eB()){eA(!0);try{if(a){let a=e.path.lastIndexOf("/"),s=-1!==a?e.path.substring(0,a):"",i=s?`${s}/${t}`:t;await H.renameFolder(e.path,i),j("已重命名","success"),e_(),ae(i)}else{let{folder:a}=W(e.fileName),s=a?`${a}/${t}`:t;await H.moveFile(e.cid,s),j("已重命名","success"),e_()}eT(null)}catch(e){j(await (0,D.getApiErrorMessage)(e,"重命名失败"),"error")}finally{eA(!1)}}}})},e0=async e=>{if(!A){R(),j("请先登录后发布文件","warning");return}if(!eB())return;let a=eU?eU+"/":"",s=[];for(let t of Array.from(e)){let e=a+t.name;if(J.some(a=>a.fileName===e)){j(`${t.name} 已存在`,"warning");continue}let i=`upload_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,r={id:i,fileName:t.name,progress:0,type:"upload",status:"uploading"};s.push(r),ew(e=>[...e,r]),s.length>0&&ek.open();try{(await H.publishFile(t,e)).alreadyExists?(ew(e=>e.map(e=>e.id===i?{...e,status:"completed"}:e)),j(`${t.name} 已存在`,"warning")):(ew(e=>e.map(e=>e.id===i?{...e,progress:100,status:"completed"}:e)),j(`${t.name} 已添加到本地`,"success"))}catch(e){ew(e=>e.map(e=>e.id===i?{...e,status:"error"}:e)),j(await (0,D.getApiErrorMessage)(e,`发布失败: ${t.name}`),"error")}}setTimeout(()=>{ew(e=>e.filter(e=>"completed"!==e.status&&"error"!==e.status&&"cancelled"!==e.status))},3e3),e_()},[e1,e2]=(0,s.useState)(!1),e6=ef.trim(),e4=ej?.status==="success"&&ej.link===e6,e5=()=>{ep.close(),eg(null)},e9=async()=>{let e=U(e6);if(e){eg({status:"error",link:e6,message:e}),j(e,"warning");return}if(!ev&&!e1&&eV()&&eB()){eb(!0),eg(null);try{let e=await H.checkDownload(e6),a=e.alreadyExists?`${e.fileName} 已在本机`:`${e.fileName} 可下载`;eg({status:"success",link:e6,message:a}),j(e.alreadyExists?`${e.fileName} 已存在`:"检测通过",e.alreadyExists?"warning":"success")}catch(a){let e=await V(a);eg({status:"error",link:e6,message:e}),j(e,"error")}finally{eb(!1)}}},e3=async()=>{if(!A){R(),j("请先登录后下载文件","warning");return}if(!eB())return;let e=U(e6);if(e)return void j(e,"warning");if(!e4)return void j("请先检测链接可用性","warning");if(!e1){e2(!0);try{let e=await H.downloadFile(e6);if(ex(""),eg(null),e5(),e.alreadyExists)j(`${e.fileName} 已存在`,"warning");else{let a={id:e.taskId,fileName:"下载文件",progress:0,type:"download",status:"downloading"};ew(e=>[...e,a]),ek.open(),j("下载已开始","info")}}catch(e){j(await (0,D.getApiErrorMessage)(e,"下载失败"),"error")}finally{e2(!1)}}},e7=async e=>{if(eV()&&eB()&&"download"===e.type&&"downloading"===e.status){ew(a=>a.map(a=>a.id===e.id?{...a,status:"cancelling"}:a));try{await H.cancelDownload(e.id)}catch(a){ew(a=>a.map(a=>a.id===e.id?{...a,status:"downloading"}:a)),j(await (0,D.getApiErrorMessage)(a,"取消失败"),"error")}}},e8=async e=>{if(eV()&&eB())try{let a=await fetch(H.getFileDownloadUrl(e.cid),{headers:await (0,D.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`)});if(!a.ok)throw Error("获取文件失败");let s=await a.blob(),t=window.showSaveFilePicker;if(t){let a=await t({suggestedName:e.fileName}),i=await a.createWritable();await i.write(s),await i.close(),j("文件已保存","success")}else{let a=URL.createObjectURL(s),t=document.createElement("a");t.href=a,t.download=e.fileName,document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(a),j("文件已下载","success")}}catch(e){"AbortError"!==e.name&&j("保存失败: "+e.message,"error")}},ae=e=>{es(e||null),eo([])};(0,s.useEffect)(()=>{if(!0!==T)return;let e=null,a=!1;return(async()=>{if(e=new WebSocket(await (0,D.getAuthenticatedWebSocketUrl)("/ws")),a)return e.close();e.onmessage=e=>{try{let{event:a,data:s}=JSON.parse(e.data);if("publish:success"===a||"download:success"===a){e_();let e=s.taskId||s.fileName;ew(a=>a.map(a=>a.id===e||a.fileName===s.fileName?{...a,progress:100,status:"completed"}:a)),"download:success"===a&&(s.alreadyExists?j(`${s.fileName} 已存在`,"warning"):j(`${s.fileName} 下载完成`,"success"),setTimeout(()=>{ew(a=>a.filter(a=>a.id!==e||"completed"!==a.status))},3e3))}"publish:progress"===a&&ew(e=>e.map(e=>{if(s.file&&e.fileName===s.file&&"upload"===e.type){let a=50;return"calculating-cid"===s.stage?a=25:"uploading"===s.stage?a=75:"complete"===s.stage&&(a=100),{...e,progress:a}}return e})),"download:progress"===a&&ew(e=>e.map(e=>e.id===s.taskId?{...e,progress:s.percent||0,loaded:s.loaded,total:s.total}:e)),"download:error"===a&&(ew(e=>e.map(e=>e.id===s.taskId?{...e,status:"error"}:e)),j(`下载失败: ${s.error}`,"error")),"download:status"===a&&ew(e=>e.map(e=>e.id===s.taskId?{...e,fileName:s.file||e.fileName}:e)),"download:cancelled"===a&&(ew(e=>e.map(e=>e.id===s.taskId?{...e,status:"cancelled"}:e)),j("下载已取消","warning"))}catch(e){console.warn("[App WS] Failed to parse message:",e.message)}}})(),()=>{a=!0,e?.close()}},[T,A?.address]),(0,s.useEffect)(()=>{if(!0===T&&A){e_(),eW();return}!1===T&&(Q([]),ee([]))},[T,A?.address]),(0,s.useEffect)(()=>{A||(eo([]),ed(null),em(null),ex(""),eg(null),ew([]),eM(""),es(null),ei("all"))},[A?.address]);let aa="all"===et?eH:"starred"===et?J.filter(e=>e.starred&&W(e.fileName).name.toLowerCase().includes(eC.toLowerCase())):Y.filter(e=>W(e.fileName).name.toLowerCase().includes(eC.toLowerCase())),as="starred"===et?[]:eP.filter(e=>e.name.toLowerCase().includes(eC.toLowerCase())),at=X(eU);return(0,a.jsxs)(M.default,{sidebar:({closeSidebar:e})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>window.location.href="/",children:[(0,a.jsx)(k.ArrowLeft,{size:18}),(0,a.jsx)("h1",{children:"MOST PEOPLE"})]}),(0,a.jsx)("nav",{className:"sidebar-nav",children:[{id:"all",icon:(0,a.jsx)(b,{size:18}),label:"本地"},{id:"starred",icon:(0,a.jsx)(v,{size:18}),label:"收藏"},{id:"trash",icon:(0,a.jsx)(n.Trash2,{size:18}),label:"回收站"}].map(s=>(0,a.jsxs)("button",{onClick:()=>{ei(s.id),es(null),eo([]),eM(""),e()},className:`sidebar-nav-btn ${et===s.id?"active":""}`,children:[s.icon,(0,a.jsx)("span",{children:s.label})]},s.id))}),(0,a.jsx)($.default,{})]}),headerTitle:(0,a.jsx)("h2",{className:"header-title",children:"all"===et?"本地":"starred"===et?"收藏":"回收站"}),headerRight:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"search-box",children:[(0,a.jsx)(y.Search,{size:14}),(0,a.jsx)("input",{type:"text",value:eC,onChange:e=>eM(e.target.value),placeholder:"搜索..."}),eC&&(0,a.jsx)("button",{onClick:()=>eM(""),children:(0,a.jsx)(h.X,{size:12})})]}),"trash"===et&&Y.length>0&&(0,a.jsx)("button",{onClick:eK,className:"btn btn-sm btn-empty-trash",children:"清空回收站"}),(0,a.jsx)("button",{onClick:()=>ek.open(),className:"btn btn-icon",children:(0,a.jsx)(g,{size:16})}),(0,a.jsx)("button",{onClick:()=>d(!c),className:"btn btn-icon",children:c?(0,a.jsx)(i.Sun,{size:16}):(0,a.jsx)(r.Moon,{size:16})})]}),children:["all"===et&&(0,a.jsxs)("div",{className:"action-grid",children:[(0,a.jsxs)("div",{className:`action-card upload ${er?"drag-over":""}`,onDragOver:e=>{e.preventDefault(),el(!0)},onDragLeave:()=>el(!1),onDrop:e=>{e.preventDefault(),el(!1),eV()&&eB()&&e0(e.dataTransfer.files)},children:[(0,a.jsx)("input",{type:"file",multiple:!0,onClick:e=>{eV()&&eB()||e.preventDefault()},onChange:e=>e0(e.target.files),className:"action-card-input"}),(0,a.jsx)(t.Upload,{size:20,className:"action-grid-icon"}),(0,a.jsx)("p",{children:"发布文件"})]}),(0,a.jsxs)("div",{className:"action-card action-card-download",onClick:()=>{eV()&&eB()&&ep.open()},children:[(0,a.jsx)(x.Download,{size:20,className:"action-grid-icon"}),(0,a.jsx)("p",{children:"下载文件"})]})]}),"all"===et&&(0,a.jsx)("div",{className:"breadcrumb",children:eU?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>ae(""),children:"全部内容"}),at.slice(1).map((e,t)=>(0,a.jsxs)(s.default.Fragment,{children:[(0,a.jsx)(u.ChevronRight,{size:12}),(0,a.jsx)("button",{onClick:()=>ae(e.path),className:t===at.length-2?"current":"",children:e.name}),t===at.length-2&&(0,a.jsx)("button",{onClick:()=>eY(e),className:"breadcrumb-edit-btn",children:(0,a.jsx)(w.Edit2,{size:12})})]},e.path))]}):null}),(0,a.jsxs)("div",{className:"content-grid",children:["trash"===et&&(0===aa.length?(0,a.jsxs)("div",{className:"empty-state app-empty-state",children:[(0,a.jsx)("p",{children:eC?"未找到相关文件":"回收站是空的"}),(0,a.jsx)(S.default,{label:"打开文件导航"})]}):(0,a.jsx)("div",{className:"file-grid",children:aa.map(e=>{var s;return(0,a.jsxs)("div",{onClick:()=>eo(a=>a.includes(e.cid)?a.filter(a=>a!==e.cid):[...a,e.cid]),onDoubleClick:()=>eG(e.cid),className:`card ${en.includes(e.cid)?"selected":""}`,children:[(0,a.jsx)("div",{className:"card-icon trash",children:(0,a.jsx)(m.FileText,{size:24,color:"#fff"})}),(0,a.jsx)("p",{className:"card-name",children:W(e.fileName).name}),(0,a.jsxs)("p",{className:"card-date",children:["删除于 ",(s=e.deletedAt)?new Date(s).toLocaleDateString("zh-CN"):""]})]},e.cid)})})),"trash"!==et&&(0===aa.length&&0===as.length?(0,a.jsxs)("div",{className:"empty-state app-empty-state",children:[(0,a.jsx)("p",{children:eC?"未找到相关文件":"starred"===et?"暂无的收藏":"暂无本地文件"}),(0,a.jsx)(S.default,{label:"打开文件导航"})]}):(0,a.jsxs)("div",{className:"file-grid",children:[as.map(e=>(0,a.jsx)(K,{folder:e,onClick:()=>ae(e.path)},e.path)),aa.map(e=>(0,a.jsx)(G,{file:e,isSelected:en.includes(e.cid),onSelect:eX,onPreview:e=>ed({...e,subtype:(0,B.getFileSubtype)(e.fileName)})},e.cid))]}))]}),eE&&(0,a.jsx)(E.ConfirmModal,{title:eE.title,message:eE.message,confirmText:eE.confirmText,danger:eE.danger,closeOnOverlayClick:eE.danger,onConfirm:eE.onConfirm,onClose:()=>eL(null)}),eD&&(0,a.jsx)(L.InputModal,{title:eD.title,placeholder:eD.placeholder,defaultValue:eD.defaultValue,confirmText:eD.confirmText,isLoading:eI,onConfirm:eD.onConfirm,onClose:()=>eT(null)}),ez&&(0,a.jsx)(Z,{items:en.map(e=>J.find(a=>a.cid===e)).filter(Boolean),allFolders:eO.map(e=>({path:e,name:e.split("/").pop()})),currentPath:eU,onMove:eQ,onClose:()=>eF.close()}),eu&&(0,a.jsx)(F.ModalOverlay,{onClose:()=>em(null),children:(0,a.jsxs)("div",{className:"share-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsx)("h3",{children:"分享链接"}),(0,a.jsx)("button",{onClick:()=>em(null),className:"btn btn-icon",children:(0,a.jsx)(h.X,{size:18})})]}),(0,a.jsxs)("div",{className:"share-link-box",children:[(0,a.jsx)("div",{className:"share-link-text",children:`most://${eu.cid}?filename=${encodeURIComponent(eu.fileName)}`}),(0,a.jsx)("button",{onClick:()=>{eS(`most://${eu.cid}?filename=${encodeURIComponent(eu.fileName)}`)},className:`btn btn-circle btn-primary ${e$?"copied":""}`,children:e$?(0,a.jsx)(p.Check,{size:18}):(0,a.jsx)(f.Copy,{size:18})})]}),(0,a.jsx)("div",{className:"share-storage-note",children:(0,a.jsx)("span",{children:"本机在线时可下载;下载者完成后会默认继续做种。"})})]})}),eh&&(0,a.jsx)(F.ModalOverlay,{onClose:e5,children:(0,a.jsxs)("div",{className:"download-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsx)("h3",{children:"下载文件"}),(0,a.jsx)("button",{onClick:e5,className:"btn btn-icon",children:(0,a.jsx)(h.X,{size:18})})]}),(0,a.jsxs)("div",{className:"download-link-row",children:[(0,a.jsx)("input",{type:"text",className:"input",value:ef,onChange:e=>{ex(e.target.value),eg(null)},placeholder:"输入 most:// 链接"}),(0,a.jsxs)("button",{type:"button",onClick:e9,disabled:!e6||ev||e1,className:"btn btn-secondary download-check-btn",children:[ev?(0,a.jsx)(N.Loader,{size:14,className:"spin"}):e4?(0,a.jsx)(p.Check,{size:14}):(0,a.jsx)(y.Search,{size:14}),ev?"检测中...":e4?"已通过":"检测"]})]}),ej&&(0,a.jsxs)("div",{className:`download-check-status ${ej.status}`,children:["success"===ej.status?(0,a.jsx)(p.Check,{size:14}):(0,a.jsx)(C,{size:14}),(0,a.jsx)("span",{children:ej.message})]}),(0,a.jsxs)("button",{onClick:e3,disabled:!e4||e1||ev,className:"btn btn-info btn-full",children:[e1?(0,a.jsx)(N.Loader,{size:14,className:"spin"}):(0,a.jsx)(x.Download,{size:14}),e1?"下载中...":"开始下载"]})]})}),ec&&(0,a.jsx)(z.default,{item:ec,isBackendReady:eR,getFileDownloadUrl:H.getFileDownloadUrl,onClose:()=>ed(null)}),en.length>0&&(0,a.jsxs)("div",{className:"batch-bar",children:[(0,a.jsxs)("span",{className:"batch-info",children:["已选 ",en.length," 项"]}),(0,a.jsx)("button",{onClick:()=>eo([]),className:"batch-dismiss",children:(0,a.jsx)(h.X,{size:16})}),(0,a.jsx)("div",{className:"batch-divider"}),"trash"===et?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:async()=>{!eV()||eB()&&(await Promise.all(en.map(e=>H.restoreTrashFile(e))),eo([]),j("已恢复","success"),e_(),eW())},className:"btn btn-sm",children:"恢复"}),(0,a.jsx)("button",{onClick:eJ,className:"btn btn-sm btn-danger",children:"永久删除"})]}):(0,a.jsxs)(a.Fragment,{children:[1===en.length&&(o=J.find(e=>e.cid===en[0]))&&"file"!==(0,B.getFileSubtype)(o.fileName)&&(0,a.jsx)("button",{onClick:()=>{let e=J.find(e=>e.cid===en[0]);if(e){let a=(0,B.getFileSubtype)(e.fileName);ed({...e,subtype:a})}},className:"btn btn-sm",children:"预览"}),(0,a.jsx)("button",{onClick:()=>{let e=en.some(e=>{let a=J.find(a=>a.cid===e);return a&&!a.starred});en.forEach(a=>{let s=J.find(e=>e.cid===a);s&&(e?!s.starred:s.starred)&&eZ(a)})},className:"btn btn-sm btn-star",children:"收藏"}),1===en.length&&(0,a.jsx)("button",{onClick:()=>{let e=J.find(e=>e.cid===en[0]);e&&eY(e)},className:"btn btn-sm",children:"重命名"}),(0,a.jsx)("button",{onClick:()=>eF.open(),className:"btn btn-sm btn-move",children:"移动"}),(0,a.jsx)("button",{onClick:eJ,className:"btn btn-sm btn-danger",children:"删除"}),1===en.length&&(0,a.jsx)("button",{onClick:()=>em(J.find(e=>e.cid===en[0])),className:"btn btn-sm",children:"分享"}),1===en.length&&(0,a.jsx)("button",{onClick:()=>{let e=J.find(e=>e.cid===en[0]);e&&e8(e)},className:"btn btn-sm",children:"另存为"})]})]}),eN&&(0,a.jsx)(F.ModalOverlay,{onClose:()=>ek.close(),closeOnOverlayClick:!0,children:(0,a.jsxs)("div",{className:"transfer-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsx)("h3",{children:"传输"}),(0,a.jsx)("button",{onClick:()=>ek.close(),className:"btn btn-icon",children:(0,a.jsx)(h.X,{size:18})})]}),0===ey.length?(0,a.jsx)("div",{className:"empty-transfer",children:"暂无传输"}):ey.map(e=>(0,a.jsxs)("div",{className:"transfer-item",children:[(0,a.jsxs)("div",{className:"transfer-item-header",children:["upload"===e.type?(0,a.jsx)(t.Upload,{size:14}):(0,a.jsx)(x.Download,{size:14}),(0,a.jsx)("span",{className:"transfer-item-name",children:e.fileName}),"downloading"===e.status&&"download"===e.type&&(0,a.jsx)("button",{onClick:()=>e7(e),className:"transfer-item-cancel",children:(0,a.jsx)(h.X,{size:14})})]}),(0,a.jsxs)("div",{className:"transfer-progress-row",children:[(0,a.jsx)("progress",{className:`transfer-progress-meter ${"download"===e.type?"download":""} ${"error"===e.status?"error":""} ${"cancelled"===e.status?"cancelled":""}`,value:Math.max(0,Math.min(100,e.progress)),max:100,"aria-label":`${e.fileName} 传输进度`}),(0,a.jsx)("span",{className:"transfer-progress-text",children:"completed"===e.status?"完成":"error"===e.status?"失败":"cancelled"===e.status?"已取消":"cancelling"===e.status?"取消中":e.loaded&&e.total?`${_(e.loaded)}/${_(e.total)}`:`${e.progress}%`})]})]},e.id))]})})]})}],27627)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let s=e.r(32061);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new s.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,n)=>{"use strict";function s(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return s}})},52157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return o}});let s=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 n=[];if(t.reactLoadableManifest&&e){let s=t.reactLoadableManifest;for(let t of e){if(!s[t])continue;let e=s[t].files;n.push(...e)}}if(0===n.length)return null;let c=(0,l.getAssetTokenQuery)();return(0,s.jsx)(s.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,s.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return c}});let s=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},n=(0,a.lazy)(()=>t.loader().then(l)),c=t.loading;function d(e){let l=c?(0,s.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,d=o?a.Suspense:a.Fragment,u=t.ssr?(0,s.jsxs)(s.Fragment,{children:["u"<typeof window?(0,s.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,s.jsx)(n,{...e})]}):(0,s.jsx)(r.BailoutToCSR,{reason:"next/dynamic",children:(0,s.jsx)(n,{...e})});return(0,s.jsx)(d,{...o?{fallback:l}:{},children:u})}return d.displayName="LoadableComponent",d}},70703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let s=e.r(55682)._(e.r(69093));function a(e,t){let n={};"function"==typeof e&&(n.loader=e);let a={...n,...t};return(0,s.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},58559,e=>{"use strict";var t=e.i(18050),n=e.i(71645),s=e.i(70703),a=e.i(18566),r=e.i(16327),i=e.i(67927),l=e.i(56420);let o=(0,l.default)("pencil-ruler",[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["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 c=e.i(72382),d=e.i(26091),u=e.i(26067);let h=(0,l.default)("move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);var p=e.i(6537),m=e.i(96699),f=e.i(10566),x=e.i(77071),j=e.i(56522),b=e.i(66595),y=e.i(35965),g=e.i(73474),N=e.i(63676),v=e.i(59665),w=e.i(39626);e.i(4121);var S=e.i(88361),k=e.i(47910),C=e.i(57667),P=e.i(3593),z=e.i(71192),M=e.i(66112),$=e.i(77816),E=e.i(3789),T=e.i(53138),A=e.i(51757),R=e.i(31214),O=e.i(62368);let L=(0,l.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 U=e.i(25981);function _({sync:e}){let s=(0,n.useRef)(null),[a,r]=(0,n.useState)(!1),i=(0,z.useUserStore)(e=>e.wallet),l=null!==e.action;async function o(e){r(!1),await e()}return(0,n.useEffect)(()=>{if(a)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){s.current?.contains(e.target)||r(!1)}},[a]),(0,t.jsxs)("div",{className:"note-more",ref:s,children:[(0,t.jsx)("button",{className:"btn btn-icon note-more-trigger",onClick:()=>r(e=>!e),title:"更多","aria-label":"更多",children:(0,t.jsx)(L,{size:16})}),a&&(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)(T.AlertTriangle,{size:16}):"synced"===e.status?(0,t.jsx)(A.CheckCircle2,{size:16}):(0,t.jsx)(R.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:()=>o(e.exportLocalBackup),disabled:!i||l,children:[(0,t.jsx)(U.Upload,{size:16}),"本地导出"]}),(0,t.jsxs)("button",{className:"note-more-item",onClick:()=>o(e.importLocalBackup),disabled:!i||l,children:[(0,t.jsx)(O.Download,{size:16}),"本地导入"]})]})]})}var D=e.i(11241),F=e.i(27648);function B({children:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>{window.location.href="/"},children:[(0,t.jsx)(D.ArrowLeft,{size:18}),(0,t.jsx)("h1",{children:"MOST PEOPLE"})]}),e,(0,t.jsx)(F.default,{})]})}let W="https://api.most.box/auth/backup";async function I(e,t){let n=await e.clone().json().catch(()=>null);return n?.error||t}function G(e,t){return(0,M.mostEncode)(JSON.stringify({notes:e||[]}),t)}function J(e,t){if(!String(e||"").startsWith("mp://1"))throw Error("无效的备份数据格式");let n=(0,M.mostDecode)(e,t);if(!n)throw Error("解密失败,请确认当前 Web3 登录账号正确");let s=JSON.parse(n);if(!Array.isArray(s.notes))throw Error("备份数据缺少 notes");return s}async function K(e){return(0,E.calculateNoteCid)(JSON.stringify({notes:e||[]}))}async function X(e,t,n=W){let s=Date.now().toString(),a=new URL(n).pathname,r=`${s}:${String(t).toUpperCase()}:${a}`,{address:i,signature:l}=await (0,M.mostSignMessage)(e.danger,r);return{Authorization:`${i},${s},${l}`}}async function V(e,t){let n=JSON.stringify({notes:t||[]}),s=await (0,E.calculateNoteCid)(n);return{cid:s,body:G(t,e.danger),headers:{"Content-Type":"text/plain","x-backup-cid":s,...await X(e,"PUT",W)}}}async function q(e,t,n=W){let s=await V(e,t),a=await fetch(n,{method:"PUT",headers:s.headers,body:s.body});if(!a.ok)throw Error(await I(a,"云备份失败"));return{cid:s.cid}}async function Q(e,t=W){let n=await fetch(t,{method:"GET",headers:await X(e,"GET",t)});if(404===n.status)return{found:!1,cid:"",time:0,notes:[]};if(!n.ok)throw Error(await I(n,"云端恢复失败"));let s=await n.text();if(!s)throw Error("云端无备份数据");let a=J(s,e.danger);return{found:!0,cid:n.headers.get("x-backup-cid")||"",time:Number(n.headers.get("x-backup-time")||0),notes:a.notes}}let H=!1,Y="",Z="";function ee(e,t){return e instanceof Error?e.message:t}let et=(0,s.default)(()=>e.A(71504).then(e=>e.MilkdownEditor),{loadableGenerated:{modules:[36975]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"note-editor-loading",children:"加载编辑器..."})});function en(e,t){return e instanceof Error?e.message:t}function es(e){return"directory"===e.type?(0,E.normalizeNotePath)(e.path?`${e.path}/${e.name}`:e.name):(0,E.getNoteFullPath)(e)}function ea(){let e=(0,a.useRouter)(),s=(0,a.useSearchParams)(),r=(0,n.useRef)(null),i=function(){let e=(0,z.useUserStore)(e=>e.wallet),t=(0,z.useUserStore)(e=>e.openLoginModal),s=(0,P.useAppStore)(e=>e.addToast),a=(0,P.useAppStore)(e=>e.notes),r=(0,P.useAppStore)(e=>e.importNotes),i=(0,P.useAppStore)(e=>e.localDataReady),[l,o]=(0,n.useState)(null),[c,d]=(0,n.useState)(e?"idle":"disabled"),[u,h]=(0,n.useState)(H),[p,m]=(0,n.useState)(!1),f=(0,n.useRef)(0),x=(0,n.useCallback)(e=>{H=e,h(e)},[]),j=(0,n.useCallback)((e=!1)=>{let n=z.useUserStore.getState().wallet;return n||(e||t(),null)},[s,t]),b=(0,n.useCallback)(async(e={})=>{let{silent:t=!1,confirmConflict:n=!0}=e,a=j(t);if(!a)return d("disabled"),!1;if(H&&n&&!window.confirm("本地数据与云端不一致,本地修改将会覆盖云端数据,是否继续?"))return t||s("已取消同步","info"),d("conflict"),!1;o("save"),d("uploading");try{let e=P.useAppStore.getState().notes;return Y=(await q(a,e)).cid,Z=a.address,x(!1),d("synced"),t||s("云端备份已更新","success"),!0}catch(e){return d("error"),t?console.info(ee(e,"云备份失败")):s(ee(e,"云备份失败"),"error"),!1}finally{o(null)}},[s,j,x]),y=(0,n.useCallback)(async(e={})=>{let{manual:t=!1,uploadWhenMissing:n=!1}=e,a=j(!t);if(!a)return d("disabled"),!1;o(t?"restore":"sync"),d(t?"restoring":"checking");try{let e=await Q(a),i=P.useAppStore.getState().notes;if(!e.found){if(x(!1),Z=a.address,n&&i.length>0)return o(null),b({silent:!0,confirmConflict:!1});return d(i.length>0?"idle":"synced"),t&&s("云端暂无备份","info"),!1}let l=e.notes||[],c=await K(i),u=e.cid||await K(l);if(i.length>0&&c!==u&&!window.confirm("云端备份与本地笔记不一致。恢复会覆盖本地笔记,是否继续?"))return x(!0),d("conflict"),t&&s("已取消恢复","info"),!1;return c!==u&&r(l),Y=u,Z=a.address,x(!1),d("synced"),t&&s("已从云端恢复","success"),!0}catch(e){return d("error"),t?s(ee(e,"云端恢复失败"),"error"):console.info(ee(e,"云端恢复失败")),!1}finally{o(null)}},[s,r,j,x,b]),g=(0,n.useCallback)(()=>{let e=j(!1);if(e)try{let t=P.useAppStore.getState().notes,n=G(t,e.danger),a=new Blob([n],{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),s("笔记已导出到本地","success")}catch(e){s(ee(e,"导出失败"),"error")}},[s,j]),N=(0,n.useCallback)(()=>{let e=j(!1);if(!e)return;let t=document.createElement("input");t.type="file",t.accept=".txt",t.onchange=t=>{let n=t.target.files?.[0];if(!n)return;let a=new FileReader;a.onload=async()=>{try{let t=a.result,n=J(t,e.danger);if(P.useAppStore.getState().notes.length>0&&!window.confirm("恢复将覆盖当前本地笔记,是否继续?"))return void s("已取消恢复","info");r(n.notes),s("已从本地恢复笔记","success"),await b({silent:!0})}catch(e){s(ee(e,"导入失败"),"error")}},a.readAsText(n)},t.click()},[s,r,j,b]);(0,n.useEffect)(()=>{if(!i)return;if(!e){Z="",Y="",m(!1),x(!1),d("disabled");return}if(Z===e.address){m(!0),d(H?"conflict":"synced");return}let t=!1;return m(!1),y({manual:!1,uploadWhenMissing:!0}).finally(()=>{t||m(!0)}),()=>{t=!0}},[i,y,x,e]),(0,n.useEffect)(()=>{if(!e||!i||!p||(f.current+=1,f.current<=1))return;let t=window.setTimeout(async()=>{let e=P.useAppStore.getState().notes;await K(e)!==Y&&await b({silent:!0})},900);return()=>window.clearTimeout(t)},[p,i,a,b,e]);let v=(0,n.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:v,hasConflict:u,uploadNow:b,restoreFromCloud:y,exportLocalBackup:g,importLocalBackup:N}}(),l=(0,P.useAppStore)(e=>e.addToast),C=(0,P.useAppStore)(e=>e.isDarkMode),T=(0,P.useAppStore)(e=>e.setIsDarkMode),A=(0,z.useUserStore)(e=>e.wallet),R=(0,z.useUserStore)(e=>e.openLoginModal),O=(0,P.useAppStore)(e=>e.notes),L=(0,P.useAppStore)(e=>e.notesPath),U=(0,P.useAppStore)(e=>e.setNotesPath),D=(0,P.useAppStore)(e=>e.saveNote),F=(0,P.useAppStore)(e=>e.deleteNote),W=(0,P.useAppStore)(e=>e.renameNote),I=(0,P.useAppStore)(e=>e.localDataReady),X=s.get("cid")||"",V=O.find(e=>e.cid===X),ea=!!X,ei=ea&&"edit"===s.get("mode"),[el,eo]=(0,n.useState)(""),[ec,ed]=(0,n.useState)(null),[eu,eh]=(0,n.useState)(null),[ep,em]=(0,n.useState)(null),[ef,ex]=(0,n.useState)(""),[ej,eb]=(0,n.useState)(""),[ey,eg]=(0,n.useState)(""),[eN,ev]=(0,n.useState)(""),[ew,eS]=(0,n.useState)(""),[ek,eC]=(0,n.useState)(""),[eP,ez]=(0,n.useState)(!1),[eM,e$]=(0,n.useState)(""),[eE,eT]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!X){ex(""),eb("");return}if(!V){ex(""),eb(I?"笔记不存在":"");return}if(V.content.startsWith("mp://1")){if(!A){ex(""),eb("请先登录 Web3 账号以解密此笔记");return}let e=(0,M.mostDecode)(V.content,A.danger);if(!e){ex(""),eb("无法解密,请确认当前 Web3 账号正确");return}ex(e),eb("");return}ex(V.content||""),eb("")},[X,I,V,A]),(0,n.useEffect)(()=>{if(!ei)return void eT(!1);if(!X||!V){ev(""),eS(""),eC(""),ez(!1),e$(I?"笔记不存在":"");return}if(ev(V.name),eS(V.path||""),ez(!0===V.isSecret||V.content.startsWith("mp://1")),V.content.startsWith("mp://1")){if(!A){eC(""),e$("请先登录 Web3 账号以解密此笔记");return}let e=(0,M.mostDecode)(V.content,A.danger);if(!e){eC(""),e$("无法解密,请确认当前 Web3 账号正确");return}eC(e),e$("");return}eC(V.content||""),e$("")},[X,ei,I,V,A]),(0,n.useEffect)(()=>{eg(V?.name||"")},[V?.cid,V?.name]);let eA=(0,n.useMemo)(()=>(0,E.filterNotesByPath)(O,L,el),[O,L,el]),eR=eA.filter(e=>"file"===e.type).length,eO=V?.isSecret===!0||V?.content.startsWith("mp://1")===!0,eL=(0,n.useMemo)(()=>{let e=L.split("/").filter(Boolean);return[{label:"全部笔记",path:""},...e.map((t,n)=>({label:t,path:e.slice(0,n+1).join("/")}))]},[L]),eU=(0,n.useMemo)(()=>(function(e){let t=new Set;for(let n of e){let e=(0,E.normalizeNotePath)(n.path).split("/").filter(Boolean);for(let n=0;n<e.length;n+=1)t.add(e.slice(0,n+1).join("/"))}return Array.from(t).sort((e,t)=>e.localeCompare(t,"zh-CN")).map(e=>{let t=e.split("/");return{path:e,name:t[t.length-1]||e,parentPath:t.slice(0,-1).join("/"),depth:Math.max(t.length-1,0)}})})(O),[O]);function e_(){return!!A||(R(),!1)}async function eD(){if(e_()){if(!V)return void l("笔记不存在","error");if(!eN.trim())return void l("请输入笔记名称","warning");eT(!0);try{let t=r.current?.getMarkdown()??ek,n=eP?(0,M.mostEncode)(t,A.danger):t,s=await D({cid:V.cid,name:eN,path:ew,content:n,isSecret:eP});eC(t),l("笔记已保存","success"),await i.uploadNow({silent:!0}),e.replace(`/note/?cid=${encodeURIComponent(s)}`)}catch(e){l(en(e,"保存失败"),"error")}finally{eT(!1)}}}async function eF(){if(!e_()||!V)return;let e=ey.trim();if(!e){eg(V.name),l("请输入笔记名称","warning");return}if(e!==V.name)try{W((0,E.getNoteFullPath)(V),V.path,e),l("已重命名","success"),await i.uploadNow({silent:!0})}catch(e){eg(V.name),l(en(e,"重命名失败"),"error")}}async function eB(e){if(ep)try{W(es(ep),e,ep.name),em(null),l("已移动","success"),await i.uploadNow({silent:!0})}catch(e){l(en(e,"移动失败"),"error")}}let eW=(0,t.jsxs)("div",{className:"note-header-title",children:[(0,t.jsx)("h2",{className:"header-title",children:"笔记"}),(0,t.jsxs)("span",{children:[O.length," 篇"]})]}),eI=(0,t.jsxs)("div",{className:"note-theme-wrap",children:[(0,t.jsx)("button",{className:"btn btn-icon",onClick:()=>T(!C),title:"切换主题","aria-label":"切换主题",children:C?(0,t.jsx)(y.Sun,{size:16}):(0,t.jsx)(m.Moon,{size:16})}),(0,t.jsx)(_,{sync:i})]}),eG=(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.jsx)("div",{className:"note-current-location",children:(0,t.jsx)("div",{className:"note-breadcrumbs",children:eL.map((e,s)=>(0,t.jsxs)(n.default.Fragment,{children:[s>0&&(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("button",{onClick:()=>U(e.path),children:e.label})]},e.path||"root"))})}),(0,t.jsxs)("span",{className:"note-count",children:[eR," 篇"]})]}),(0,t.jsxs)("div",{className:"note-search",children:[(0,t.jsx)(b.Search,{size:16}),(0,t.jsx)("input",{className:"input input-flex",value:el,onChange:e=>eo(e.target.value),placeholder:"搜索笔记"})]}),0===eA.length?(0,t.jsxs)("div",{className:"note-empty-state",children:[(0,t.jsx)(f.NotebookPen,{size:32}),(0,t.jsx)("p",{children:el?"未找到笔记":"还没有笔记"})]}):(0,t.jsx)("div",{className:"note-list",children:eA.map(n=>(0,t.jsx)("article",{className:`note-list-item ${"file"===n.type&&n.cid===X?"active":""}`,children:(0,t.jsxs)("button",{className:`note-list-item-main ${"directory"===n.type?"folder":""}`,onClick:()=>{if("directory"===n.type)U((0,E.normalizeNotePath)(n.path?`${n.path}/${n.name}`:n.name));else e.push(`/note/?cid=${encodeURIComponent(n.cid)}`)},children:[(0,t.jsx)("span",{className:"note-list-icon",children:"directory"===n.type?(0,t.jsx)(u.Folder,{size:18}):n.isSecret?(0,t.jsx)(p.Lock,{size:18}):(0,t.jsx)(d.FileText,{size:18})}),(0,t.jsxs)("span",{className:"note-list-copy",children:[(0,t.jsx)("span",{className:"note-list-name",children:n.name}),"file"===n.type?(0,t.jsx)("span",{className:"note-list-preview",children:n.isSecret||n.content.startsWith("mp://1")?"私密内容已加密":String(n.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"===n.type&&(0,t.jsx)("span",{className:"note-list-date",children:(0,$.formatDate)(n.updated_at)})]})},`${n.cid}:${n.path}:${n.name}`))}),(0,t.jsx)("div",{className:"note-create-btn",children:(0,t.jsxs)("button",{className:"btn",onClick:function(){e_()&&ed({title:"新建笔记",placeholder:"笔记名称",confirmText:"创建",onConfirm:async t=>{if(e_())try{let n=await D({name:t,path:L,content:"",isSecret:!1});ed(null),l("笔记已创建","success"),await i.uploadNow({silent:!0}),e.push(`/note/?cid=${encodeURIComponent(n)}&mode=edit`)}catch(e){l(en(e,"创建失败"),"error")}}})},children:[(0,t.jsx)(x.Plus,{size:16}),"新笔记"]})})]});return(0,t.jsxs)(v.default,{sidebar:()=>(0,t.jsx)(B,{children:eG}),headerTitle:eW,headerRight:eI,children:[(0,t.jsx)("main",{className:`note-page note-browser-page ${ea?"has-editor":""}`,children:(0,t.jsx)("section",{className:"note-workspace",children:(0,t.jsx)("section",{className:"note-editor-panel","aria-label":ei?"笔记编辑器":"笔记阅读器",children:ea?(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:[ei?(0,t.jsx)("input",{className:"note-title-input",value:eN,onChange:e=>ev(e.target.value),placeholder:"笔记名称",disabled:!V}):V?(0,t.jsx)("input",{className:"note-title-input",value:ey,onBlur:eF,onChange:e=>eg(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(eg(V.name),e.currentTarget.blur())},placeholder:"笔记名称",title:"重命名"}):(0,t.jsx)("h3",{children:"未命名笔记"}),V&&(0,t.jsxs)("div",{className:"note-editor-info",children:[(0,t.jsx)("span",{children:ei?"编辑模式":"阅读模式"}),(0,t.jsx)("span",{children:ei?eP?"私密":"公开":eO?"私密":"公开"}),(0,t.jsx)("span",{children:(0,$.formatDate)(V.updated_at)})]})]}),(0,t.jsxs)("div",{className:"note-editor-actions",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-icon",onClick:ei?function(){e.push(V?`/note/?cid=${encodeURIComponent(V.cid)}`:"/note/")}:()=>e.push("/note/"),title:ei?"取消":"关闭","aria-label":ei?"取消":"关闭",children:(0,t.jsx)(N.X,{size:16})}),ei?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{className:`btn btn-sm ${eP?"btn-warning":"btn-secondary"}`,onClick:()=>ez(!eP),disabled:!V,children:[eP?(0,t.jsx)(p.Lock,{size:16}):(0,t.jsx)(c.Eye,{size:16}),eP?"私密":"公开"]}),(0,t.jsxs)("button",{className:"btn btn-sm btn-primary",onClick:eD,disabled:eE||!!eM||!V,children:[(0,t.jsx)(j.Save,{size:16}),eE?"保存中":"保存"]})]}):V&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"btn btn-icon",onClick:()=>{e_()&&em(V)},title:"移动","aria-label":"移动",children:(0,t.jsx)(h,{size:16})}),(0,t.jsx)("button",{type:"button",className:"btn btn-icon note-editor-action-danger",onClick:()=>(function(t){if(!e_())return;let n="directory"===t.type;eh({title:n?"删除文件夹":"删除笔记",message:`确定要删除「${t.name}」吗?此操作不可撤销。`,confirmText:"删除",onConfirm:async()=>{F(n?void 0:t.cid,t.path,t.name),eh(null),l("已删除","success"),await i.uploadNow({silent:!0}),"file"===t.type&&t.cid===X&&e.push("/note/")}})})(V),title:"删除","aria-label":"删除",children:(0,t.jsx)(g.Trash2,{size:16})}),(0,t.jsxs)("button",{type:"button",className:"btn btn-sm btn-primary",onClick:()=>{e.push(`/note/?cid=${encodeURIComponent(V.cid)}&mode=edit`)},disabled:!!ej,title:"编辑","aria-label":"编辑",children:[(0,t.jsx)(o,{size:16}),"编辑"]})]})]})]}),ei?eM?(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(p.Lock,{size:36}),(0,t.jsx)("p",{children:eM})]}):V?(0,t.jsx)("div",{className:"note-editor-frame editing",children:(0,t.jsx)(et,{ref:r,content:ek,onChange:eC,className:"milkdown-editor"})}):(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(f.NotebookPen,{size:36}),(0,t.jsx)("p",{children:I?"笔记不存在":"加载中..."})]}):ej?(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(p.Lock,{size:36}),(0,t.jsx)("p",{children:ej})]}):V?(0,t.jsx)("div",{className:"note-editor-frame reading",children:(0,t.jsx)(et,{content:ef,readOnly:!0,className:"milkdown-editor"})}):(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(f.NotebookPen,{size:36}),(0,t.jsx)("p",{children:I?"笔记不存在":"加载中..."})]})]}):(0,t.jsxs)("div",{className:"note-editor-empty",children:[(0,t.jsx)("div",{className:"note-editor-empty-icon",children:(0,t.jsx)(f.NotebookPen,{size:32})}),(0,t.jsx)("h3",{children:"没有打开的笔记"}),(0,t.jsx)("p",{children:O.length>0?"选择一篇笔记继续":"创建第一篇笔记"}),(0,t.jsx)(w.default,{label:"打开笔记列表",variant:"default"})]})})})}),ec&&(0,t.jsx)(k.InputModal,{title:ec.title,placeholder:ec.placeholder,defaultValue:ec.defaultValue,confirmText:ec.confirmText,onConfirm:ec.onConfirm,onClose:()=>ed(null)}),eu&&(0,t.jsx)(S.ConfirmModal,{title:eu.title,message:eu.message,confirmText:eu.confirmText,danger:!0,onConfirm:eu.onConfirm,onClose:()=>eh(null)}),ep&&(0,t.jsx)(er,{target:ep,directories:eU,onMove:eB,onClose:()=>em(null)})]})}function er({target:e,directories:s,onMove:a,onClose:l}){let o=(0,E.normalizeNotePath)(e.path||""),c=es(e),d=s.filter(t=>"directory"!==e.type||t.path!==c&&!t.path.startsWith(`${c}/`)),[h,p]=(0,n.useState)(o),[m,f]=(0,n.useState)(""),[x,j]=(0,n.useState)(new Set),b=(0,E.normalizeNotePath)(m),y=m.trim()?b:h,g=(0,E.normalizeNotePath)(y)===o,v=new Map;for(let e of d){let t=v.get(e.parentPath)||[];t.push(e),v.set(e.parentPath,t)}let w=d.filter(e=>{if(!e.parentPath)return!0;let t=e.parentPath.split("/").filter(Boolean);return t.every((e,n)=>x.has(t.slice(0,n+1).join("/")))}),S=[{label:"全部笔记",path:""},...h.split("/").filter(Boolean).map((e,t,n)=>({label:e,path:n.slice(0,t+1).join("/")}))];function k(e){p((0,E.normalizeNotePath)(e)),f("")}return(0,t.jsx)(C.ModalOverlay,{onClose:l,children:(0,t.jsxs)("div",{className:"note-move-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:l,children:(0,t.jsx)(N.X,{size:18})})]}),(0,t.jsxs)("div",{className:"note-move-target",children:[(0,t.jsx)("span",{children:"正在移动"}),(0,t.jsx)("strong",{children:e.name})]}),(0,t.jsx)("div",{className:"note-move-path",children:S.map((e,s)=>(0,t.jsxs)(n.default.Fragment,{children:[s>0&&(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("button",{type:"button",onClick:()=>k(e.path),children:e.label})]},e.path||"root"))}),(0,t.jsxs)("div",{className:"note-move-folder-list",children:[(0,t.jsxs)("button",{type:"button",className:`note-move-folder-item ${""===h?"selected":""}`,onClick:()=>k(""),children:[(0,t.jsx)("span",{className:"note-move-folder-spacer"}),(0,t.jsx)(u.Folder,{className:"note-move-folder-icon",size:16}),(0,t.jsx)("span",{children:"全部笔记"})]}),0===d.length?(0,t.jsx)("p",{className:"note-move-empty",children:"还没有可选文件夹"}):w.map(e=>{let n=v.has(e.path),s=x.has(e.path);return(0,t.jsxs)("button",{type:"button",className:`note-move-folder-item note-move-depth-${Math.min(e.depth,4)} ${h===e.path?"selected":""}`,onClick:()=>{var t;k(t=e.path),v.has(t)&&j(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},children:[n?s?(0,t.jsx)(r.ChevronDown,{className:"note-move-expander",size:14}):(0,t.jsx)(i.ChevronRight,{className:"note-move-expander",size:14}):(0,t.jsx)("span",{className:"note-move-folder-spacer"}),(0,t.jsx)(u.Folder,{className:"note-move-folder-icon",size:16}),(0,t.jsx)("span",{children:e.name}),e.parentPath&&(0,t.jsx)("small",{children:e.parentPath})]},e.path)})]}),(0,t.jsx)("input",{className:"input input-compact",value:m,onChange:e=>f(e.target.value),placeholder:"或输入新目录路径,如 文章/摘录"}),(0,t.jsxs)("div",{className:"note-move-destination",children:["目标位置:",y||"全部笔记"]}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"btn btn-secondary",onClick:l,children:"取消"}),(0,t.jsx)("button",{className:"btn btn-primary",onClick:function(){g||a(y)},disabled:g,children:"移动"})]})]})})}e.s(["default",0,function(){return(0,t.jsx)(n.Suspense,{fallback:(0,t.jsx)("div",{className:"note-editor-loading",children:"加载中..."}),children:(0,t.jsx)(ea,{})})}],58559)}]);
@@ -0,0 +1 @@
1
+ .admin-page{max-width:1280px;min-height:100dvh;color:var(--text-primary);margin:0 auto;padding:24px}.admin-topbar,.admin-title-group,.admin-topbar-actions,.admin-panel-header,.admin-metric,.admin-capacity-row,.admin-address-list,.admin-log-row{align-items:center;display:flex}.admin-topbar{justify-content:space-between;gap:16px;margin-bottom:18px}.admin-title-group{gap:12px;min-width:0}.admin-title-group h1{letter-spacing:0;font-size:24px;line-height:1.2}.admin-kicker{color:var(--text-secondary);text-transform:uppercase;letter-spacing:0;font-size:12px;font-weight:700}.admin-topbar-actions{flex-wrap:wrap;justify-content:flex-end;gap:10px}.admin-status-pill{border:1px solid var(--glass-border);background:var(--glass-bg-solid);min-height:34px;color:var(--warning);border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:13px;font-weight:700;display:inline-flex}.admin-status-pill.online{color:var(--success)}.admin-metric,.admin-panel{border:1px solid var(--glass-border);background:var(--glass-bg-heavy);box-shadow:var(--shadow-sm);-webkit-backdrop-filter:var(--blur-md);border-radius:8px}.admin-panel-header h2{color:var(--text-primary);letter-spacing:0;font-size:17px;line-height:1.25}.admin-panel-header{justify-content:space-between;gap:12px;margin-bottom:14px}.admin-panel-header.compact{margin-bottom:10px}.admin-overview{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:12px;display:grid}.admin-metric{gap:12px;min-width:0;padding:14px}.admin-metric-icon{width:34px;height:34px;color:var(--accent);background:#5e6ad224;border-radius:8px;flex:none;justify-content:center;align-items:center;display:flex}.admin-metric:nth-child(2) .admin-metric-icon{color:var(--info);background:#5ac8fa24}.admin-metric:nth-child(3) .admin-metric-icon{color:var(--success);background:#34c75924}.admin-metric:nth-child(4) .admin-metric-icon{color:var(--warning);background:#ff950024}.admin-metric span,.admin-status-grid span,.admin-field span{color:var(--text-secondary);font-size:12px;display:block}.admin-metric strong,.admin-status-grid strong{min-width:0;color:var(--text-primary);overflow-wrap:anywhere;margin-top:3px;font-size:15px;display:block}.admin-metric-action{margin-left:auto}.admin-grid{grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);gap:12px;display:grid}.admin-panel{min-width:0;padding:16px}.admin-span-2{grid-column:span 2}.admin-panel-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px;display:flex}.admin-panel-actions .btn{min-height:34px;padding:7px 12px;font-size:13px}.admin-status-grid{border-bottom:1px solid var(--glass-border);grid-template-columns:120px 160px minmax(0,1fr);gap:14px;margin-bottom:14px;padding-bottom:14px;display:grid}.admin-address-list{flex-wrap:wrap;gap:8px}.admin-address-list span{border:1px solid var(--glass-border);background:var(--glass-bg-subtle);color:var(--text-secondary);font-family:var(--font-mono);border-radius:8px;padding:6px 8px;font-size:12px}.admin-field{gap:6px;margin-bottom:12px;display:grid}.admin-settings-fields{grid-template-columns:minmax(0,1.4fr) minmax(160px,.8fr) minmax(160px,.8fr);gap:12px;display:grid}.admin-settings-fields .admin-field{margin-bottom:0}.admin-settings-fields .admin-field-wide{grid-column:span 3}.admin-textarea{resize:vertical;min-height:92px;line-height:1.5}.admin-field-hint,.admin-table-note{color:var(--text-secondary);margin:0;font-size:12px;line-height:1.5}.admin-field-hint{margin-top:2px;margin-bottom:14px}.admin-table-note{margin-bottom:10px}.admin-seed-help{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px;display:grid}.admin-seed-help-item{border:1px solid var(--glass-border);background:var(--glass-bg-subtle);border-radius:8px;align-items:flex-start;gap:8px;min-width:0;padding:10px;display:flex}.admin-seed-help-item div{gap:3px;min-width:0;display:grid}.admin-seed-help-item strong{color:var(--text-primary);font-size:12px;line-height:1.35}.admin-seed-help-item span:last-child{color:var(--text-secondary);font-size:12px;line-height:1.45}.admin-seed-dot{background:var(--text-muted);border-radius:999px;flex:none;width:8px;height:8px;margin-top:5px}.admin-seed-dot.active{background:var(--success)}.admin-seed-dot.pending{background:var(--info)}.admin-seed-dot.error{background:var(--danger)}.admin-capacity-row{gap:12px;margin-bottom:12px}.admin-capacity-row progress{background:var(--glass-bg-subtle);border:none;border-radius:999px;width:100%;height:10px;overflow:hidden}.admin-capacity-row progress::-webkit-progress-bar{background:var(--glass-bg-subtle)}.admin-capacity-row progress::-webkit-progress-value{background:linear-gradient(90deg, var(--success), var(--info));border-radius:999px}.admin-capacity-row progress::-moz-progress-bar{background:linear-gradient(90deg, var(--success), var(--info));border-radius:999px}.admin-capacity-row span{color:var(--text-secondary);flex:none;font-size:12px}.admin-table{border:1px solid var(--glass-border);border-radius:8px;overflow-x:auto}.admin-table-row{border-bottom:1px solid var(--glass-border);grid-template-columns:minmax(160px,1.4fr) minmax(150px,1fr) minmax(120px,.8fr) minmax(72px,.45fr) minmax(120px,.8fr) 130px;gap:12px;min-width:900px;padding:10px 12px;font-size:13px;display:grid}.admin-table-row:last-child{border-bottom:none}.admin-table-row span{overflow-wrap:anywhere;min-width:0}.admin-table-head{color:var(--text-secondary);background:var(--glass-bg-subtle);font-size:12px;font-weight:700}.admin-seed-pill{background:var(--glass-bg-subtle);width:fit-content;min-height:24px;color:var(--text-secondary);border-radius:999px;justify-content:center;align-items:center;padding:0 8px;font-size:12px;font-weight:700;display:inline-flex}.admin-seed-pill.active{color:var(--success);background:#34c75924}.admin-seed-pill.error{color:var(--danger);background:#ff3b3024}.admin-log-list{gap:8px;max-height:360px;display:grid;overflow:auto}.admin-log-filter{border:1px solid var(--glass-border);background:var(--glass-bg-subtle);border-radius:8px;width:fit-content;max-width:100%;margin-bottom:12px;padding:3px;display:inline-flex;overflow-x:auto}.admin-log-filter button{min-width:64px;min-height:30px;color:var(--text-secondary);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:0 10px;font-size:12px;font-weight:800}.admin-log-filter button.active{background:var(--glass-bg-solid);color:var(--text-primary);box-shadow:var(--shadow-sm)}.admin-log-row{border:1px solid var(--glass-border);background:var(--glass-bg-subtle);border-radius:8px;gap:10px;min-width:0;padding:10px 12px;font-size:13px}.admin-log-row time{color:var(--text-secondary);font-family:var(--font-mono);flex:0 0 76px;font-size:12px}.admin-log-row strong{overflow-wrap:anywhere;flex:0 210px;min-width:0}.admin-log-row span:last-child{min-width:0;color:var(--text-secondary);overflow-wrap:anywhere}.admin-log-level{color:#2563eb;text-transform:uppercase;background:#3b82f624;border-radius:999px;flex:none;padding:3px 7px;font-size:11px;font-weight:800}.admin-log-level.error{color:var(--danger);background:#ff3b3024}.admin-empty-row{color:var(--text-secondary);text-align:center;padding:18px 12px;font-size:13px}.admin-error{color:var(--danger);align-items:center;gap:10px;margin-bottom:12px;display:flex}.admin-warning{color:var(--warning);align-items:flex-start;gap:10px;margin-bottom:12px;display:flex}.admin-security-warning{background:#ff950014;border-color:#ff950059}.admin-warning svg{flex:none}.admin-warning div{gap:4px;min-width:0;display:grid}.admin-warning strong{color:var(--text-primary);font-size:14px}.admin-warning span{color:var(--text-secondary);font-size:13px;line-height:1.5}.admin-warning-list{color:var(--text-secondary);gap:4px;margin:2px 0 0;padding-left:18px;font-size:13px;line-height:1.5;display:grid}.admin-warning-list code{background:var(--glass-bg-subtle);color:var(--text-primary);font-family:var(--font-mono);border-radius:6px;padding:2px 5px;font-size:12px}@media (max-width:1040px){.admin-overview,.admin-grid,.admin-settings-fields,.admin-status-grid,.admin-seed-help{grid-template-columns:1fr}.admin-settings-fields .admin-field-wide,.admin-span-2{grid-column:span 1}}@media (max-width:640px){.admin-page{padding:14px}.admin-topbar,.admin-title-group,.admin-topbar-actions{align-items:stretch}.admin-topbar{flex-direction:column}.admin-title-group h1{font-size:21px}.admin-capacity-row{flex-direction:column;align-items:flex-start}.admin-log-row{grid-template-columns:72px 56px minmax(0,1fr);display:grid}.admin-log-row span:last-child{grid-column:1/-1}}