most-box 0.3.0 → 0.3.2

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 (176) hide show
  1. package/README.md +45 -24
  2. package/electron/main.js +19 -2
  3. package/electron/preload.cjs +8 -0
  4. package/out/admin/index.html +0 -0
  5. package/out/app/index.html +0 -0
  6. package/out/assets/AccountMenu-BgbcUc0m.js +1 -0
  7. package/out/assets/AppTop-DZFTO9-m.js +1 -0
  8. package/out/assets/CopyButton-B03fpFFc.js +1 -0
  9. package/out/assets/FilePreviewOverlay-CA04_Ved.js +1 -0
  10. package/out/assets/MarketingHeader-BVJy8hXd.js +1 -0
  11. package/out/assets/MarketingLayout-Cltu-DRw.js +1 -0
  12. package/out/assets/{MilkdownEditor-BTq9bDAf.js → MilkdownEditor-Dw_ze7EE.js} +92 -92
  13. package/out/assets/OpenSidebarButton-C2UJYXKh.js +1 -0
  14. package/out/assets/arrow-right-CXzRt0Fp.js +1 -0
  15. package/out/assets/chatJoinInvite-BcPz_IV5.js +1 -0
  16. package/out/assets/chatNoteDraft-CYbvcEvC.js +1 -0
  17. package/out/assets/check-iBCQl0yr.js +1 -0
  18. package/out/assets/circle-alert-dfN4T6Nq.js +1 -0
  19. package/out/assets/cobol-DHLQUbN7.js +1 -0
  20. package/out/assets/copy-B7pPZ2MP.js +1 -0
  21. package/out/assets/{dist-DCX0ws1K.js → dist-1jNICPWO.js} +1 -1
  22. package/out/assets/{dist-BAJKKN4w.js → dist-B3unnv5t.js} +1 -1
  23. package/out/assets/{dist-DJdv-Ma3.js → dist-B5MBMmGa.js} +1 -1
  24. package/out/assets/{dist-CMmmtl3f.js → dist-BAqJdUtV.js} +1 -1
  25. package/out/assets/{dist-C3lbe8SW.js → dist-BBJOmVU3.js} +1 -1
  26. package/out/assets/{dist-IN8WN7NI.js → dist-BV5CqsJD.js} +1 -1
  27. package/out/assets/{dist-DBnWo8ZP.js → dist-Ba7fxbV-.js} +1 -1
  28. package/out/assets/{dist-BzqqCPi2.js → dist-BxxtNKuo.js} +1 -1
  29. package/out/assets/{dist-DvWZsW-D.js → dist-C8Ue2rSs.js} +1 -1
  30. package/out/assets/{dist-C-Tg23jc.js → dist-CIn7Xx5U.js} +1 -1
  31. package/out/assets/{dist-CbTzBiwL.js → dist-CSyRxrry.js} +3 -3
  32. package/out/assets/{dist-DTL5jL08.js → dist-CZIuQqmV.js} +1 -1
  33. package/out/assets/{dist-8QDHqrPN.js → dist-CaaBTHCc.js} +1 -1
  34. package/out/assets/{dist-yZ96GF-e.js → dist-CgReC0ZE.js} +1 -1
  35. package/out/assets/{dist-D94V9Zlh.js → dist-Ct90qYA2.js} +1 -1
  36. package/out/assets/{dist-IGpXmkFm.js → dist-DIFFjNuO.js} +1 -1
  37. package/out/assets/{dist-CqQavSZV.js → dist-DUB2IhWu.js} +1 -1
  38. package/out/assets/{dist-B0JrbG7f.js → dist-DheA_Tyz.js} +1 -1
  39. package/out/assets/{dist-Br_5lLVO.js → dist-DyZh1ncm.js} +1 -1
  40. package/out/assets/{dist-BPs0Xns9.js → dist-E74uGTy3.js} +1 -1
  41. package/out/assets/{dist-BFSyuOuw.js → dist-K2s-Uj08.js} +1 -1
  42. package/out/assets/{dist-zyJb88Zz.js → dist-RU_cpjXQ.js} +1 -1
  43. package/out/assets/{dist-chOCTzB2.js → dist-eIeCvp_6.js} +1 -1
  44. package/out/assets/{dist-CfU9fwWz.js → dist-hEE2Ub__.js} +1 -1
  45. package/out/assets/download-COQOcPqI.js +1 -0
  46. package/out/assets/downloadValidation-Zvllo2SZ.js +1 -0
  47. package/out/assets/external-link-D6tHlYgS.js +1 -0
  48. package/out/assets/file-text-DiyIGL1I.js +1 -0
  49. package/out/assets/folder-DAcox9xz.js +1 -0
  50. package/out/assets/folder-open-Di0oALaC.js +1 -0
  51. package/out/assets/hard-drive-Cqa7Rstj.js +1 -0
  52. package/out/assets/index-B6acG3-t.css +1 -0
  53. package/out/assets/index-DjBN7bZV.js +31 -0
  54. package/out/assets/index.lazy-BUODxlbz.js +1 -0
  55. package/out/assets/index.lazy-Ba2rqd32.js +3 -0
  56. package/out/assets/index.lazy-Bdh8QUOx.js +1 -0
  57. package/out/assets/index.lazy-BfAHB94y.js +1 -0
  58. package/out/assets/index.lazy-Bo0LfJNK.js +2 -0
  59. package/out/assets/index.lazy-C9-w4fAF.js +3 -0
  60. package/out/assets/index.lazy-CNQbNKyf.js +1 -0
  61. package/out/assets/index.lazy-Cd0znkpY.js +1 -0
  62. package/out/assets/index.lazy-CtUrBLS0.js +1 -0
  63. package/out/assets/index.lazy-CyNgk0ta.js +1 -0
  64. package/out/assets/index.lazy-D3HxQTg_.js +1 -0
  65. package/out/assets/index.lazy-DSsE3iyf.js +1 -0
  66. package/out/assets/index.lazy-DWXndrGa.js +1 -0
  67. package/out/assets/index.lazy-Dk7cmQ-j.js +2 -0
  68. package/out/assets/key-round-JR8M3aHl.js +1 -0
  69. package/out/assets/loader-CwyHYZdX.js +1 -0
  70. package/out/assets/lock-CuwwlXlx.js +1 -0
  71. package/out/assets/message-square-BgsNXPft.js +1 -0
  72. package/out/assets/mp-Dv12gDTx.js +1 -0
  73. package/out/assets/music-Dn9nm9Qb.js +1 -0
  74. package/out/assets/notebook-pen-SWT-zZ4v.js +1 -0
  75. package/out/assets/play-CvWKSMwY.js +1 -0
  76. package/out/assets/refresh-cw-D4BsHvhi.js +1 -0
  77. package/out/assets/save-B02sbO9Y.js +1 -0
  78. package/out/assets/scheme-tChLYBuY.js +1 -0
  79. package/out/assets/search-HW4oPOBP.js +1 -0
  80. package/out/assets/send-4dhnJGuS.js +1 -0
  81. package/out/assets/shield-check-Boae7Nc6.js +1 -0
  82. package/out/assets/smartphone-JXH-zQXB.js +1 -0
  83. package/out/assets/textile-CyzeGT9J.js +1 -0
  84. package/out/assets/trash-2-BLwoM0ME.js +1 -0
  85. package/out/assets/triangle-alert-B9sMiA9l.js +1 -0
  86. package/out/assets/upload-DVuXJt_o.js +1 -0
  87. package/out/assets/useAppStore-DOnk608w.js +4 -0
  88. package/out/assets/{useChannelMessages-DOaWHdAP.js → useChannelMessages-CDvw-f_x.js} +1 -1
  89. package/out/assets/useGameRoom-B1_r6bc7.js +1 -0
  90. package/out/assets/userProfile-BZvkCuet.js +1 -0
  91. package/out/assets/wallet-D9Iw4YWE.js +1 -0
  92. package/out/assets/wifi-ljEI_ySA.js +1 -0
  93. package/out/chat/index.html +0 -0
  94. package/out/chat/join/demo/index.html +0 -0
  95. package/out/chat/join/index.html +0 -0
  96. package/out/download/index.html +2 -2
  97. package/out/game/gandengyan/index.html +0 -0
  98. package/out/game/index.html +0 -0
  99. package/out/game/zhajinhua/index.html +0 -0
  100. package/out/index.html +2 -2
  101. package/out/note/index.html +0 -0
  102. package/out/ping/index.html +2 -2
  103. package/out/profile/index.html +0 -0
  104. package/out/web3/index.html +0 -0
  105. package/package.json +28 -28
  106. package/server/index.js +3 -0
  107. package/server/src/config.js +0 -1
  108. package/server/src/core/gameRoom.js +12 -19
  109. package/server/src/http/app.js +2 -0
  110. package/server/src/http/routePolicy.js +1 -0
  111. package/server/src/http/routes/noteVaultRoutes.js +155 -0
  112. package/server/src/index.js +9 -0
  113. package/server/src/utils/accountBackup.js +8 -0
  114. package/server/src/utils/api.js +0 -14
  115. package/server/src/utils/auth.js +0 -7
  116. package/server/src/utils/avatar.js +6 -6
  117. package/server/src/utils/noteVault.js +522 -0
  118. package/electron/preload.js +0 -6
  119. package/out/assets/FilePreviewOverlay-CM5IqnZD.js +0 -1
  120. package/out/assets/LanguageToggle-CSQtRZ3A.js +0 -1
  121. package/out/assets/MarketingHeader-B45AaM29.js +0 -1
  122. package/out/assets/MarketingLayout-A00pEOa2.js +0 -1
  123. package/out/assets/MarketingThemeToggle-CIKP8x9W.js +0 -1
  124. package/out/assets/OpenSidebarButton-D8qfUGzU.js +0 -1
  125. package/out/assets/SidebarAccount-_RBE5K_o.js +0 -1
  126. package/out/assets/SidebarHomeLink-qMFEGjZt.js +0 -1
  127. package/out/assets/arrow-right-BU9c_SL4.js +0 -1
  128. package/out/assets/circle-alert-iuHzciph.js +0 -1
  129. package/out/assets/cobol-B_OZ4V-R.js +0 -1
  130. package/out/assets/copy-DEzFUzeX.js +0 -1
  131. package/out/assets/download-jEPn2njL.js +0 -1
  132. package/out/assets/downloadValidation-CSXwoQKW.js +0 -1
  133. package/out/assets/external-link-BFaoZeK0.js +0 -1
  134. package/out/assets/file-text-DPA1riJ_.js +0 -1
  135. package/out/assets/folder-Cfgc70_F.js +0 -1
  136. package/out/assets/hard-drive-Dar_AZEq.js +0 -1
  137. package/out/assets/i18n-NjvOSuV6.js +0 -1
  138. package/out/assets/index-BHZhApbo.css +0 -1
  139. package/out/assets/index-C-_ZwxuN.js +0 -31
  140. package/out/assets/index.lazy-0YYV0CR3.js +0 -1
  141. package/out/assets/index.lazy-BTYGr9Vb.js +0 -1
  142. package/out/assets/index.lazy-BVAtQtTa.js +0 -3
  143. package/out/assets/index.lazy-BbdLA2L-.js +0 -1
  144. package/out/assets/index.lazy-CbiLtziY.js +0 -1
  145. package/out/assets/index.lazy-CcEdBg3i.js +0 -2
  146. package/out/assets/index.lazy-CePHsLXG.js +0 -1
  147. package/out/assets/index.lazy-DG_3_VdF.js +0 -1
  148. package/out/assets/index.lazy-DR0rWEWZ.js +0 -2
  149. package/out/assets/index.lazy-DSyTSCJD.js +0 -1
  150. package/out/assets/index.lazy-DUhsuPLv.js +0 -1
  151. package/out/assets/index.lazy-DVnhWbzH.js +0 -1
  152. package/out/assets/index.lazy-DZpkg1DJ.js +0 -1
  153. package/out/assets/key-round-DNcpSuMw.js +0 -1
  154. package/out/assets/loader-BXQtdens.js +0 -1
  155. package/out/assets/lock-CLIE8cct.js +0 -1
  156. package/out/assets/message-square-Dp09WY1I.js +0 -1
  157. package/out/assets/mp-B6kdA94c.js +0 -1
  158. package/out/assets/music-B19Tg557.js +0 -1
  159. package/out/assets/notebook-pen-C8TlK5sB.js +0 -1
  160. package/out/assets/play-B-BjsTZz.js +0 -1
  161. package/out/assets/plus-4hygj-1Z.js +0 -1
  162. package/out/assets/save-BjrbPwhJ.js +0 -1
  163. package/out/assets/scheme-CyDdOh7e.js +0 -1
  164. package/out/assets/search-DSkiWdvX.js +0 -1
  165. package/out/assets/send-BL4d5iOt.js +0 -1
  166. package/out/assets/shield-check-DzDuWO8r.js +0 -1
  167. package/out/assets/smartphone-tRRFFO0a.js +0 -1
  168. package/out/assets/textile-DWBqthVk.js +0 -1
  169. package/out/assets/trash-2-V12tJ8lI.js +0 -1
  170. package/out/assets/triangle-alert-DGWc8ZHu.js +0 -1
  171. package/out/assets/ui-BpDGD3IR.js +0 -4
  172. package/out/assets/upload-CoCptKya.js +0 -1
  173. package/out/assets/useGameRoom-hHkV65ii.js +0 -1
  174. package/out/assets/userProfile-DwZip0Dt.js +0 -1
  175. package/out/assets/wallet-T7ONZ3Kg.js +0 -1
  176. package/out/assets/wifi-Bgo8eHY0.js +0 -1
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,H as a,c as o,o as s,t as c,u as l}from"./useAppStore-DOnk608w.js";import{t as u}from"./OpenSidebarButton-C2UJYXKh.js";import{a as ee,i as d,n as f,r as p,t as te}from"./FilePreviewOverlay-CA04_Ved.js";import{t as ne}from"./check-iBCQl0yr.js";import{n as re,t as m}from"./folder-DAcox9xz.js";import{t as ie}from"./copy-B7pPZ2MP.js";import{t as ae}from"./download-COQOcPqI.js";import{t as oe}from"./file-text-DiyIGL1I.js";import{t as se}from"./loader-CwyHYZdX.js";import{i as ce,n as le,t as ue}from"./AppTop-DZFTO9-m.js";import{t as h}from"./music-Dn9nm9Qb.js";import{t as de}from"./search-HW4oPOBP.js";import{t as fe}from"./trash-2-BLwoM0ME.js";import{t as pe}from"./upload-DVuXJt_o.js";import{A as me,S as g,_ as he,v as ge,y as _}from"./index-DjBN7bZV.js";import{t as _e}from"./format-CR8oUWq6.js";import{n as v,r as ve,t as ye}from"./downloadValidation-Zvllo2SZ.js";var be=r(`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`}]]),xe=r(`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`}]]),Se=r(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Ce=r(`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`}]]),y=t(e(),1);function we(e={}){let t=e.timeout??2e3,[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!1),o=(0,y.useRef)(null);(0,y.useEffect)(()=>()=>{window.clearTimeout(o.current)},[]);let s=e=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(!1),t),a(e)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>{r(null),s(!0)}).catch(e=>r(e)):r(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{a(!1),r(null),window.clearTimeout(o.current)},error:n,copied:i}}var b=n();function x(e){let t=e.lastIndexOf(`/`);return t===-1?{folder:``,name:e}:{folder:e.substring(0,t),name:e.substring(t+1)}}function Te({file:e,isSelected:t,onSelect:n,onPreview:r}){let i=f(e.fileName),a=(0,b.jsx)(oe,{size:24,color:`#fff`});return i===`image`?a=(0,b.jsx)(p,{size:24,color:`#fff`}):i===`video`?a=(0,b.jsx)(d,{size:24,color:`#fff`}):i===`audio`&&(a=(0,b.jsx)(h,{size:24,color:`#fff`})),(0,b.jsxs)(`div`,{"data-id":e.cid,onClick:()=>n(e.cid),onDoubleClick:()=>r(e),className:`card ${t?`selected`:``}`,children:[(0,b.jsx)(`div`,{className:`card-icon ${e.starred?`starred`:`file`}`,children:a}),(0,b.jsx)(`p`,{className:`card-name`,translate:`no`,children:x(e.fileName).name})]})}function Ee({folder:e,onClick:t}){return(0,b.jsxs)(`div`,{onClick:t,className:`card`,children:[(0,b.jsx)(`div`,{className:`card-icon folder`,children:(0,b.jsx)(m,{size:28,color:`#fff`})}),(0,b.jsx)(`p`,{className:`card-name`,translate:`no`,children:e.name})]})}function S(e,t){return e?[{path:``,name:t},...e.split(`/`).filter(Boolean).map((e,t,n)=>({path:n.slice(0,t+1).join(`/`),name:e}))]:[]}function De({items:e,allFolders:t,currentPath:n,onMove:r,onClose:i}){let[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)(n),{t:l}=me(),u=S(a,l(`move.root`));function ee(){r(a||s.trim())}let d=t.filter(e=>{if(a===``)return!e.path.includes(`/`);let t=a+`/`;return e.path.startsWith(t)?!e.path.substring(t.length).includes(`/`):!1});return(0,b.jsx)(_,{onClose:i,children:(0,b.jsxs)(`div`,{className:`move-modal`,onClick:e=>e.stopPropagation(),children:[(0,b.jsxs)(`div`,{className:`modal-header`,children:[(0,b.jsx)(`h3`,{children:l(`move.title`)}),(0,b.jsx)(`button`,{type:`button`,onClick:i,className:`btn btn-icon`,children:(0,b.jsx)(g,{size:18})})]}),(0,b.jsx)(`p`,{className:`move-modal-desc`,children:l(`move.selectedCount`,{count:e.length})}),(0,b.jsx)(`div`,{className:`move-new-folder`,children:(0,b.jsx)(`input`,{type:`text`,className:`input`,value:s,onChange:e=>c(e.target.value),placeholder:l(`move.pathPlaceholder`),translate:`no`})}),(0,b.jsx)(`p`,{className:`move-modal-hint`,children:l(`move.pathExample`)}),(0,b.jsx)(`div`,{className:`move-breadcrumb`,children:u.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t>0&&(0,b.jsx)(`span`,{className:`breadcrumb-separator`,children:`/`}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>{o(e.path),c(e.path)},className:`move-breadcrumb-btn ${a===e.path&&!s?`active`:``}`,children:(0,b.jsx)(`span`,{translate:e.path?`no`:`yes`,children:e.name})})]},e.path))}),(0,b.jsxs)(`div`,{className:`move-folder-list`,children:[d.length===0&&(0,b.jsx)(`p`,{className:`move-modal-empty`,children:l(`move.noSubfolders`)}),d.map(e=>(0,b.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:`move-folder-item ${a===e.path&&!s?`selected`:``}`,children:[(0,b.jsx)(m,{size:16}),(0,b.jsx)(`span`,{translate:`no`,children:e.name})]},e.path))]}),(0,b.jsxs)(`div`,{className:`modal-actions`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:i,className:`btn btn-secondary`,children:l(`common.cancel`)}),(0,b.jsx)(`button`,{type:`button`,onClick:ee,className:`btn btn-primary`,children:l(`move.action`)})]})]})})}var C=`https://most.box`;function Oe(e,t){let n=String(t||``).trim(),r=`${C}/cid/${encodeURIComponent(e)}`;return n?`${r}?filename=${encodeURIComponent(n)}`:r}function w(e){return x(e)}function ke(e){let t=new Set;return e.forEach(e=>{let{folder:n}=w(e.fileName),r=n.split(`/`).filter(Boolean),i=``;for(let e of r)i+=(i?`/`:``)+e,t.add(i)}),[...t].sort()}function Ae(e,t){let n=t?t+`/`:``;return e.filter(e=>{let t=e.toLowerCase().startsWith(n.toLowerCase()),r=e.substring(n.length);return t&&!r.includes(`/`)}).map(e=>({name:e.substring(n.length),path:e}))}function je(e,t,n){return{folders:Ae(t,n),files:e.filter(e=>w(e.fileName).folder===n)}}function Me(e,t){return e?[{path:``,name:t},...e.split(`/`).filter(Boolean).map((e,t,n)=>({path:n.slice(0,t+1).join(`/`),name:e}))]:[]}function Ne(){let e=c(e=>e.addToast),t=c(e=>e.hasBackend),n=c(e=>e.openConnectModal),r=i(e=>e.identity),a=i(e=>e.openLoginModal),[d,p]=(0,y.useState)([]),[m,h]=(0,y.useState)([]),[x,S]=(0,y.useState)(null),[C,Ae]=(0,y.useState)(`all`),[Ne,T]=(0,y.useState)(!1),[E,D]=(0,y.useState)([]),[Pe,O]=(0,y.useState)(null),[k,A]=(0,y.useState)(null),[Fe,Ie]=ce(!1),[Le,Re]=(0,y.useState)(``),[j,M]=(0,y.useState)(null),[N,ze]=(0,y.useState)(!1),[Be,P]=(0,y.useState)([]),[Ve,F]=ce(!1),[I,L]=(0,y.useState)(``),{copy:He,copied:Ue}=we({timeout:2e3}),[We,Ge]=ce(!1),[R,z]=(0,y.useState)(null),[B,Ke]=(0,y.useState)(null),[qe,Je]=(0,y.useState)(!1),{t:V,formatDate:Ye}=me(),H=t===!0,Xe=e=>e?Ye(e):``,U=x||``,Ze=ke(d),{folders:Qe,files:$e}=je(d,Ze,U);function W(){return H?!0:(n(),!1)}function G(){return r?!0:(a(),!1)}let et=I?d.filter(e=>w(e.fileName).name.toLowerCase().includes(I.toLowerCase())):$e,K=async()=>{if(!H||!r){p([]);return}try{p(await v.listPublishedFiles()||[])}catch{p([])}},q=async()=>{if(!H||!r){h([]);return}try{h(await v.listTrashFiles()||[])}catch{h([])}},tt=e=>{D(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},nt=async t=>{if(G()&&W())try{await v.restoreTrashFile(t),e(V(`app.toast.restored`),`success`),K(),q()}catch(t){e(await s(t,V(`app.toast.restoreFailed`)),`error`)}},rt=async()=>{G()&&W()&&z({title:V(`app.clearTrash.title`),message:V(`app.clearTrash.message`),confirmText:V(`app.clear`),danger:!0,onConfirm:async()=>{z(null);try{await v.emptyTrash(),e(V(`app.toast.trashEmptied`),`success`),q()}catch(t){e(await s(t,V(`app.toast.emptyFailed`)),`error`)}}})},it=async t=>{if(G()&&W())try{let n=await v.toggleStar(t);p(e=>e.map(e=>e.cid===t?{...e,starred:n.starred}:e)),e(n.starred?V(`app.toast.favorited`):V(`app.toast.unfavorited`),`success`)}catch(t){e(await s(t,V(`app.toast.actionFailed`)),`error`)}},at=async()=>{if(!G()||!W())return;let t=C===`trash`;z({title:V(t?`app.permanentDelete`:`app.batchDelete`),message:V(t?`app.deleteSelectedPermanent`:`app.deleteSelected`,{count:E.length}),confirmText:V(t?`app.permanentDelete`:`app.delete`),danger:!0,onConfirm:async()=>{z(null);try{for(let e of E)t?await v.permanentDeleteTrashFile(e):e.startsWith(`__`)||await v.deletePublishedFile(e);D([]),e(V(t?`app.toast.deletedPermanently`:`app.toast.deleted`),`success`),K(),q()}catch(t){e(await s(t,V(`app.toast.deleteFailed`)),`error`)}}})},ot=async t=>{if(G()&&W())try{for(let e of E){let n=d.find(t=>t.cid===e);if(!n)continue;let{name:r}=w(n.fileName),i=t?`${t}/${r}`:r;n.fileName!==i&&await v.moveFile(e,i)}D([]),Ge.close(),e(V(`app.toast.moved`),`success`),K()}catch(t){e(await s(t,V(`app.toast.moveFailed`)),`error`)}},st=t=>{let n=!!t.path,r=n?t.name:w(t.fileName).name;Ke({title:V(n?`app.renameFolder`:`app.renameFile`),placeholder:V(`app.enterNewName`),defaultValue:r,confirmText:V(`app.rename`),onConfirm:async i=>{if(i!==r&&G()&&W()){Je(!0);try{if(n){let n=t.path.lastIndexOf(`/`),r=n===-1?``:t.path.substring(0,n),a=r?`${r}/${i}`:i;await v.renameFolder(t.path,a),e(V(`app.toast.renamed`),`success`),K(),Z(a)}else{let{folder:n}=w(t.fileName),r=n?`${n}/${i}`:i;await v.moveFile(t.cid,r),e(V(`app.toast.renamed`),`success`),K()}Ke(null)}catch(t){e(await s(t,V(`app.toast.renameFailed`)),`error`)}finally{Je(!1)}}}})},ct=async t=>{if(!r){a(),e(V(`app.toast.signInBeforePublish`),`warning`);return}if(!W())return;let n=U?U+`/`:``,i=[];for(let r of Array.from(t)){let t=n+r.name;if(d.some(e=>e.fileName===t)){e(V(`app.fileAlreadyExists`,{fileName:r.name}),`warning`);continue}let a=`upload_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,o={id:a,fileName:r.name,progress:0,type:`upload`,status:`uploading`};i.push(o),P(e=>[...e,o]),i.length>0&&F.open();try{(await v.publishFile(r,t)).alreadyExists?(P(e=>e.map(e=>e.id===a?{...e,status:`completed`}:e)),e(V(`app.fileAlreadyExists`,{fileName:r.name}),`warning`)):(P(e=>e.map(e=>e.id===a?{...e,progress:100,status:`completed`}:e)),e(V(`app.fileAddedLocal`,{fileName:r.name}),`success`))}catch(t){P(e=>e.map(e=>e.id===a?{...e,status:`error`}:e)),e(await s(t,V(`app.publishFailedWithFile`,{fileName:r.name})),`error`)}}setTimeout(()=>{P(e=>e.filter(e=>e.status!==`completed`&&e.status!==`error`&&e.status!==`cancelled`))},3e3),K()},lt=k?Oe(k.cid,k.fileName):``,ut=()=>{lt&&He(lt)},[J,dt]=(0,y.useState)(!1),Y=Le.trim(),X=j?.status===`success`&&j.link===Y,ft=()=>{Ie.close(),M(null)},pt=e=>{Re(e.target.value),M(null)},mt=async()=>{let t=ye(Y,V);if(t){M({status:`error`,link:Y,message:t}),e(t,`warning`);return}if(!(N||J)&&G()&&W()){ze(!0),M(null);try{let t=await v.checkDownload(Y);M({status:`success`,link:Y,message:t.alreadyExists?V(`app.fileAlreadyLocal`,{fileName:t.fileName}):V(`app.fileAvailable`,{fileName:t.fileName})}),e(t.alreadyExists?V(`app.fileAlreadyExists`,{fileName:t.fileName}):V(`app.toast.checkPassed`),t.alreadyExists?`warning`:`success`)}catch(t){let n=await ve(t);M({status:`error`,link:Y,message:n}),e(n,`error`)}finally{ze(!1)}}},ht=async()=>{if(!r){a(),e(V(`app.toast.signInBeforeDownload`),`warning`);return}if(!W())return;let t=ye(Y,V);if(t){e(t,`warning`);return}if(!X){e(V(`app.toast.checkLinkFirst`),`warning`);return}if(!J){dt(!0);try{let t=await v.downloadFile(Y);if(Re(``),M(null),ft(),t.alreadyExists)e(V(`app.fileAlreadyExists`,{fileName:t.fileName}),`warning`);else{let n={id:t.taskId,fileName:V(`app.downloadFallbackName`),progress:0,type:`download`,status:`downloading`};P(e=>[...e,n]),F.open(),e(V(`app.toast.downloadStarted`),`info`)}}catch(t){e(await s(t,V(`app.toast.downloadFailed`)),`error`)}finally{dt(!1)}}},gt=async t=>{if(G()&&W()&&t.type===`download`&&t.status===`downloading`){P(e=>e.map(e=>e.id===t.id?{...e,status:`cancelling`}:e));try{await v.cancelDownload(t.id)}catch(n){P(e=>e.map(e=>e.id===t.id?{...e,status:`downloading`}:e)),e(await s(n,V(`app.toast.cancelFailed`)),`error`)}}},_t=async t=>{if(G()&&W()){if(t.localAvailable===!1){e(V(`app.toast.fileNotLocal`),`warning`);return}try{let n=await fetch(v.getFileDownloadUrl(t.cid),{headers:await o(`GET`,`/api/files/${t.cid}/download`)});if(!n.ok)throw Error(V(`app.toast.getFileFailed`));let r=await n.blob(),i=window.showSaveFilePicker;if(i){let n=await(await i({suggestedName:t.fileName})).createWritable();await n.write(r),await n.close(),e(V(`app.toast.fileSaved`),`success`)}else{let n=URL.createObjectURL(r),i=document.createElement(`a`);i.href=n,i.download=t.fileName,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n),e(V(`app.toast.fileDownloaded`),`success`)}}catch(t){t.name!==`AbortError`&&e(V(`app.saveFailedWithError`,{error:t.message}),`error`)}}},vt=async t=>{if(G()&&W())try{e(V(`app.toast.startPullLocal`),`info`),await v.cacheFile(t.cid),e(V(`app.toast.pulledAndSeeding`),`success`),K()}catch(t){e(await s(t,V(`app.toast.pullFailed`)),`error`)}},Z=e=>{S(e||null),D([])};(0,y.useEffect)(()=>{if(t!==!0)return;let n=null,r=!1;return(async()=>{if(n=new WebSocket(await l(`/ws`)),r){n.close();return}n.onmessage=t=>{try{let{event:n,data:r}=JSON.parse(t.data);if(n===`publish:success`||n===`download:success`){K();let t=r.taskId||r.fileName;P(e=>e.map(e=>e.id===t||e.fileName===r.fileName?{...e,progress:100,status:`completed`}:e)),n===`download:success`&&(r.alreadyExists?e(V(`app.fileAlreadyExists`,{fileName:r.fileName}),`warning`):e(V(`app.fileDownloadCompleted`,{fileName:r.fileName}),`success`),setTimeout(()=>{P(e=>e.filter(e=>!(e.id===t&&e.status===`completed`)))},3e3))}n===`publish:progress`&&P(e=>e.map(e=>{if(r.file&&e.fileName===r.file&&e.type===`upload`){let t=50;return r.stage===`calculating-cid`?t=25:r.stage===`uploading`?t=75:r.stage===`complete`&&(t=100),{...e,progress:t}}return e})),n===`download:progress`&&P(e=>e.map(e=>e.id===r.taskId?{...e,progress:r.percent||0,loaded:r.loaded,total:r.total}:e)),n===`download:error`&&(P(e=>e.map(e=>e.id===r.taskId?{...e,status:`error`}:e)),e(V(`app.downloadFailedWithError`,{error:r.error}),`error`)),n===`download:status`&&P(e=>e.map(e=>e.id===r.taskId?{...e,fileName:r.file||e.fileName}:e)),n===`download:cancelled`&&(P(e=>e.map(e=>e.id===r.taskId?{...e,status:`cancelled`}:e)),e(V(`app.toast.downloadCancelled`),`warning`)),n===`user:metadata:updated`&&(K(),q())}catch(e){console.warn(`[App WS] Failed to parse message:`,e.message)}}})(),()=>{r=!0,n?.close()}},[t,r?.address]),(0,y.useEffect)(()=>{if(t===!0&&r){K(),q();return}t===!1&&(p([]),h([]))},[t,r?.address]),(0,y.useEffect)(()=>{r||(D([]),O(null),A(null),Re(``),M(null),P([]),L(``),S(null),Ae(`all`))},[r?.address]);let yt=V(C===`all`?`app.nav.local`:C===`starred`?`app.nav.favorites`:`app.nav.trash`),Q=C===`all`?et:C===`starred`?d.filter(e=>e.starred&&w(e.fileName).name.toLowerCase().includes(I.toLowerCase())):m.filter(e=>w(e.fileName).name.toLowerCase().includes(I.toLowerCase())),bt=C===`starred`?[]:Qe.filter(e=>e.name.toLowerCase().includes(I.toLowerCase())),$=Me(U,V(`app.allContent`));return(0,b.jsxs)(le,{sidebar:({closeSidebar:e})=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ue,{onNavigate:e}),(0,b.jsx)(`nav`,{className:`sidebar-nav`,children:[{id:`all`,icon:(0,b.jsx)(xe,{size:18}),label:V(`app.nav.local`)},{id:`starred`,icon:(0,b.jsx)(Ce,{size:18}),label:V(`app.nav.favorites`)},{id:`trash`,icon:(0,b.jsx)(fe,{size:18}),label:V(`app.nav.trash`)}].map(t=>(0,b.jsxs)(`button`,{onClick:()=>{Ae(t.id),S(null),D([]),L(``),e()},className:`sidebar-nav-btn ${C===t.id?`active`:``}`,children:[t.icon,(0,b.jsx)(`span`,{children:t.label})]},t.id))})]}),headerTitle:(0,b.jsx)(`h2`,{className:`header-title`,children:yt}),headerRight:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`search-box`,children:[(0,b.jsx)(de,{size:14}),(0,b.jsx)(`input`,{type:`text`,value:I,onChange:e=>L(e.target.value),placeholder:V(`app.search.placeholder`)}),I&&(0,b.jsx)(`button`,{onClick:()=>L(``),children:(0,b.jsx)(g,{size:12})})]}),C===`trash`&&m.length>0&&(0,b.jsx)(`button`,{onClick:rt,className:`btn btn-sm btn-empty-trash`,children:V(`app.emptyTrash`)}),(0,b.jsx)(`button`,{onClick:()=>F.open(),className:`btn btn-icon`,children:(0,b.jsx)(be,{size:16})})]}),children:[C===`all`&&(0,b.jsxs)(`div`,{className:`action-grid`,children:[(0,b.jsxs)(`div`,{className:`action-card upload ${Ne?`drag-over`:``}`,onDragOver:e=>{e.preventDefault(),T(!0)},onDragLeave:()=>T(!1),onDrop:e=>{e.preventDefault(),T(!1),!(!G()||!W())&&ct(e.dataTransfer.files)},children:[(0,b.jsx)(`input`,{type:`file`,multiple:!0,onClick:e=>{(!G()||!W())&&e.preventDefault()},onChange:e=>ct(e.target.files),className:`action-card-input`}),(0,b.jsx)(pe,{size:20,className:`action-grid-icon`}),(0,b.jsx)(`p`,{children:V(`app.publishFile`)})]}),(0,b.jsxs)(`div`,{className:`action-card action-card-download`,onClick:()=>{!G()||!W()||Ie.open()},children:[(0,b.jsx)(ae,{size:20,className:`action-grid-icon`}),(0,b.jsx)(`p`,{children:V(`app.downloadFile`)})]})]}),C===`all`&&(0,b.jsx)(`div`,{className:`breadcrumb`,children:U?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`button`,{onClick:()=>Z(``),children:V(`app.allContent`)}),$.slice(1).map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(re,{size:12}),(0,b.jsx)(`button`,{onClick:()=>Z(e.path),className:t===$.length-2?`current`:``,children:(0,b.jsx)(`span`,{translate:`no`,children:e.name})}),t===$.length-2&&(0,b.jsx)(`button`,{onClick:()=>st(e),className:`breadcrumb-edit-btn`,children:(0,b.jsx)(ee,{size:12})})]},e.path))]}):null}),(0,b.jsxs)(`div`,{className:`content-grid`,children:[C===`trash`&&(Q.length===0?(0,b.jsxs)(`div`,{className:`empty-state app-empty-state`,children:[(0,b.jsx)(`p`,{children:V(I?`app.noMatches`:`app.trashEmpty`)}),(0,b.jsx)(u,{label:V(`app.openFileNavigation`)})]}):(0,b.jsx)(`div`,{className:`file-grid`,children:Q.map(e=>(0,b.jsxs)(`div`,{onClick:()=>D(t=>t.includes(e.cid)?t.filter(t=>t!==e.cid):[...t,e.cid]),onDoubleClick:()=>nt(e.cid),className:`card ${E.includes(e.cid)?`selected`:``}`,children:[(0,b.jsx)(`div`,{className:`card-icon trash`,children:(0,b.jsx)(oe,{size:24,color:`#fff`})}),(0,b.jsx)(`p`,{className:`card-name`,translate:`no`,children:w(e.fileName).name}),(0,b.jsx)(`p`,{className:`card-date`,children:V(`app.deletedOn`,{date:Xe(e.deletedAt)})})]},e.cid))})),C!==`trash`&&(Q.length===0&&bt.length===0?(0,b.jsxs)(`div`,{className:`empty-state app-empty-state`,children:[(0,b.jsx)(`p`,{children:V(I?`app.noMatches`:C===`starred`?`app.noFavorites`:`app.noLocalFiles`)}),(0,b.jsx)(u,{label:V(`app.openFileNavigation`)})]}):(0,b.jsxs)(`div`,{className:`file-grid`,children:[bt.map(e=>(0,b.jsx)(Ee,{folder:e,onClick:()=>Z(e.path)},e.path)),Q.map(t=>(0,b.jsx)(Te,{file:t,isSelected:E.includes(t.cid),onSelect:tt,onPreview:t=>{if(t.localAvailable===!1){e(V(`app.toast.fileNotLocal`),`warning`);return}O({...t,subtype:f(t.fileName)})}},t.cid))]}))]}),R&&(0,b.jsx)(ge,{title:R.title,message:R.message,confirmText:R.confirmText,danger:R.danger,onConfirm:R.onConfirm,onClose:()=>z(null)}),B&&(0,b.jsx)(he,{title:B.title,placeholder:B.placeholder,defaultValue:B.defaultValue,confirmText:B.confirmText,isLoading:qe,onConfirm:B.onConfirm,onClose:()=>Ke(null)}),We&&(0,b.jsx)(De,{items:E.map(e=>d.find(t=>t.cid===e)).filter(Boolean),allFolders:Ze.map(e=>({path:e,name:e.split(`/`).pop()})),currentPath:U,onMove:ot,onClose:()=>Ge.close()}),k&&(0,b.jsx)(_,{onClose:()=>A(null),children:(0,b.jsxs)(`div`,{className:`share-modal`,onClick:e=>e.stopPropagation(),children:[(0,b.jsxs)(`div`,{className:`modal-header`,children:[(0,b.jsx)(`h3`,{children:V(`app.shareLink`)}),(0,b.jsx)(`button`,{onClick:()=>A(null),className:`btn btn-icon`,children:(0,b.jsx)(g,{size:18})})]}),(0,b.jsxs)(`div`,{className:`share-link-box`,children:[(0,b.jsx)(`div`,{className:`share-link-text`,translate:`no`,children:lt}),(0,b.jsx)(`button`,{onClick:ut,className:`btn btn-circle btn-primary ${Ue?`copied`:``}`,children:Ue?(0,b.jsx)(ne,{size:18}):(0,b.jsx)(ie,{size:18})})]}),(0,b.jsx)(`div`,{className:`share-storage-note`,children:(0,b.jsx)(`span`,{children:V(`app.shareSeedNote`)})})]})}),Fe&&(0,b.jsx)(_,{onClose:ft,children:(0,b.jsxs)(`div`,{className:`download-modal`,onClick:e=>e.stopPropagation(),children:[(0,b.jsxs)(`div`,{className:`modal-header`,children:[(0,b.jsx)(`h3`,{children:V(`app.downloadFile`)}),(0,b.jsx)(`button`,{onClick:ft,className:`btn btn-icon`,children:(0,b.jsx)(g,{size:18})})]}),(0,b.jsxs)(`div`,{className:`download-link-row`,children:[(0,b.jsx)(`input`,{type:`text`,className:`input`,value:Le,onChange:pt,placeholder:V(`app.downloadLink.placeholder`)}),(0,b.jsxs)(`button`,{type:`button`,onClick:mt,disabled:!Y||N||J,className:`btn btn-secondary download-check-btn`,children:[N?(0,b.jsx)(se,{size:14,className:`spin`}):X?(0,b.jsx)(ne,{size:14}):(0,b.jsx)(de,{size:14}),V(N?`app.checking`:X?`app.passed`:`app.check`)]})]}),j&&(0,b.jsxs)(`div`,{className:`download-check-status ${j.status}`,children:[j.status===`success`?(0,b.jsx)(ne,{size:14}):(0,b.jsx)(Se,{size:14}),(0,b.jsx)(`span`,{children:j.message})]}),(0,b.jsxs)(`button`,{onClick:ht,disabled:!X||J||N,className:`btn btn-info btn-full`,children:[J?(0,b.jsx)(se,{size:14,className:`spin`}):(0,b.jsx)(ae,{size:14}),V(J?`app.downloading`:`app.startDownload`)]})]})}),Pe&&(0,b.jsx)(te,{item:Pe,isBackendReady:H,getFileDownloadUrl:v.getFileDownloadUrl,onClose:()=>O(null)}),E.length>0&&(0,b.jsxs)(`div`,{className:`batch-bar`,children:[(0,b.jsx)(`span`,{className:`batch-info`,children:V(`app.selectedItems`,{count:E.length})}),(0,b.jsx)(`button`,{onClick:()=>D([]),className:`batch-dismiss`,children:(0,b.jsx)(g,{size:16})}),(0,b.jsx)(`div`,{className:`batch-divider`}),C===`trash`?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`button`,{onClick:async()=>{G()&&W()&&(await Promise.all(E.map(e=>v.restoreTrashFile(e))),D([]),e(V(`app.toast.restored`),`success`),K(),q())},className:`btn btn-sm`,children:V(`app.restore`)}),(0,b.jsx)(`button`,{onClick:at,className:`btn btn-sm btn-danger`,children:V(`app.permanentDelete`)})]}):(0,b.jsxs)(b.Fragment,{children:[E.length===1&&(()=>{let e=d.find(e=>e.cid===E[0]);return e&&f(e.fileName)!==`file`})()&&(0,b.jsx)(`button`,{onClick:()=>{let t=d.find(e=>e.cid===E[0]);if(t){if(t.localAvailable===!1){e(V(`app.toast.fileNotLocal`),`warning`);return}let n=f(t.fileName);O({...t,subtype:n})}},className:`btn btn-sm`,children:V(`app.preview`)}),(0,b.jsx)(`button`,{onClick:()=>{let e=E.some(e=>{let t=d.find(t=>t.cid===e);return t&&!t.starred});E.forEach(t=>{let n=d.find(e=>e.cid===t);n&&(e?!n.starred:n.starred)&&it(t)})},className:`btn btn-sm btn-star`,children:V(`app.favorite`)}),E.length===1&&(0,b.jsx)(`button`,{onClick:()=>{let e=d.find(e=>e.cid===E[0]);e&&st(e)},className:`btn btn-sm`,children:V(`app.rename`)}),(0,b.jsx)(`button`,{onClick:()=>Ge.open(),className:`btn btn-sm btn-move`,children:V(`app.move`)}),(0,b.jsx)(`button`,{onClick:at,className:`btn btn-sm btn-danger`,children:V(`app.delete`)}),E.length===1&&(()=>{let e=d.find(e=>e.cid===E[0]);return e&&e.localAvailable===!1})()&&(0,b.jsx)(`button`,{onClick:()=>{let e=d.find(e=>e.cid===E[0]);e&&vt(e)},className:`btn btn-sm`,children:V(`app.pullToLocal`)}),E.length===1&&(0,b.jsx)(`button`,{onClick:()=>A(d.find(e=>e.cid===E[0])),className:`btn btn-sm`,children:V(`app.share`)}),E.length===1&&(0,b.jsx)(`button`,{onClick:()=>{let e=d.find(e=>e.cid===E[0]);e&&_t(e)},className:`btn btn-sm`,children:V(`app.saveAs`)})]})]}),Ve&&(0,b.jsx)(_,{onClose:()=>F.close(),children:(0,b.jsxs)(`div`,{className:`transfer-modal`,onClick:e=>e.stopPropagation(),children:[(0,b.jsxs)(`div`,{className:`modal-header`,children:[(0,b.jsx)(`h3`,{children:V(`app.transfers`)}),(0,b.jsx)(`button`,{onClick:()=>F.close(),className:`btn btn-icon`,children:(0,b.jsx)(g,{size:18})})]}),Be.length===0?(0,b.jsx)(`div`,{className:`empty-transfer`,children:V(`app.noTransfers`)}):Be.map(e=>(0,b.jsxs)(`div`,{className:`transfer-item`,children:[(0,b.jsxs)(`div`,{className:`transfer-item-header`,children:[e.type===`upload`?(0,b.jsx)(pe,{size:14}):(0,b.jsx)(ae,{size:14}),(0,b.jsx)(`span`,{className:`transfer-item-name`,translate:`no`,children:e.fileName}),e.status===`downloading`&&e.type===`download`&&(0,b.jsx)(`button`,{onClick:()=>gt(e),className:`transfer-item-cancel`,children:(0,b.jsx)(g,{size:14})})]}),(0,b.jsxs)(`div`,{className:`transfer-progress-row`,children:[(0,b.jsx)(`progress`,{className:`transfer-progress-meter ${e.type===`download`?`download`:``} ${e.status===`error`?`error`:``} ${e.status===`cancelled`?`cancelled`:``}`,value:Math.max(0,Math.min(100,e.progress)),max:100,"aria-label":V(`app.transferProgress`,{fileName:e.fileName})}),(0,b.jsx)(`span`,{className:`transfer-progress-text`,children:e.status===`completed`?V(`app.completed`):e.status===`error`?V(`app.failed`):e.status===`cancelled`?V(`app.cancelled`):e.status===`cancelling`?V(`app.cancelling`):e.loaded&&e.total?`${_e(e.loaded)}/${_e(e.total)}`:`${e.progress}%`})]})]},e.id))]})})]})}var T=a(`/app/`)({component:Ne});export{T as Route};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i,W as a}from"./useAppStore-DOnk608w.js";import{n as o,t as s}from"./smartphone-JXH-zQXB.js";import{t as c}from"./download-COQOcPqI.js";import{A as l,D as u}from"./index-DjBN7bZV.js";import{t as d}from"./MarketingHeader-BVJy8hXd.js";import{n as f}from"./format-CR8oUWq6.js";var p=r(`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`}]]),m=r(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),h=r(`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`}]]),g=r(`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`}]]),_=r(`tablet-smartphone`,[[`rect`,{width:`10`,height:`14`,x:`3`,y:`8`,rx:`2`,key:`1vrsiq`}],[`path`,{d:`M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4`,key:`1j4zmg`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),v=t(e(),1),y=[`windows`,`macos`,`linux`],b=[`x64`,`arm64`],x=[`installer`];Object.freeze([{platform:`windows`,arch:`x64`},{platform:`windows`,arch:`arm64`},{platform:`macos`,arch:`x64`},{platform:`macos`,arch:`arm64`},{platform:`linux`,arch:`x64`},{platform:`linux`,arch:`arm64`}]);var S=new Set(y),C=new Set(b),w=new Set(x);function T(e){return typeof e==`object`&&!!e}function E(e){return typeof e==`string`&&e.trim().length>0}function D(e){return Number.isFinite(e)&&e>0}function O(e){return e===void 0||E(e)}function k(e){return T(e)?S.has(e.platform)&&C.has(e.arch)&&w.has(e.kind)&&E(e.filename)&&D(e.size)&&E(e.cid)&&E(e.githubUrl)&&O(e.r2Url):!1}function A(e){return!T(e)||!E(e.version)||!E(e.publishedAt)||!Array.isArray(e.assets)?!1:e.assets.every(k)}function j(e){return`${e.platform}:${e.arch}`}function M(e){return A(e)?e.assets.filter(e=>e.kind===`installer`):[]}function N(e){return Array.isArray(e)?e.some(e=>T(e)&&E(e.r2Url)):!1}function P(e,t=`r2`){return t===`r2`&&T(e)&&E(e.r2Url)?{source:`r2`,url:e.r2Url}:{source:`github`,url:T(e)&&E(e.githubUrl)?e.githubUrl:``}}var F=`https://github.com/most-people/most/releases/latest`,I=[{platform:`windows`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`windows`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`macos`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`macos`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`linux`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`linux`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F}];function L(e){return e.VITE_RELEASE_MANIFEST_URL||`${(e.VITE_R2_PUBLIC_BASE_URL||`https://download.most.box`).replace(/\/+$/,``)}/releases/latest.json`}function R({manifest:e,currentKey:t,requestedSource:n}){let r=e?M(e):[],i=r.length?r:I,a=N(i),o=n===`r2`&&a?`r2`:`github`,s=i.find(e=>j(e)===t)||null;return{assets:i,currentAsset:s,otherAssets:s?i.filter(e=>j(e)!==t):i,hasR2Assets:a,activeSource:o,currentDownload:s?P(s,o):null}}function z(e,t){return P(e,t)}var B=n(),V=L({VITE_RELEASE_MANIFEST_URL:void 0,VITE_R2_PUBLIC_BASE_URL:void 0}),H={windows:{name:`Windows`,ext:`.exe`,descKey:`download.platform.windows.desc`,icon:g},macos:{name:`macOS`,ext:`.dmg`,descKey:`download.platform.macos.desc`,icon:p},linux:{name:`Linux`,ext:`.AppImage`,descKey:`download.platform.linux.desc`,icon:h}},U=[{key:`ios`,nameKey:`download.platform.ios.name`,descKey:`download.platform.ios.desc`,icon:s},{key:`android`,nameKey:`download.platform.android.name`,descKey:`download.platform.android.desc`,icon:_}];function W(){return[navigator.userAgentData?.platform,navigator.platform,navigator.userAgent].filter(Boolean).join(` `).toLowerCase()}function G(){if(typeof navigator>`u`)return`windows:x64`;let e=W(),t=/arm|aarch64/.test(e)?`arm64`:`x64`;return/mac|darwin/.test(e)?`macos:${t}`:/linux/.test(e)?`linux:${t}`:`windows:${t}`}function K(){let{t:e}=l(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(V?`loading`:`fallback`),[a,s]=(0,v.useState)(`windows:x64`),[d,p]=(0,v.useState)(`r2`);(0,v.useEffect)(()=>{s(G())},[]),(0,v.useEffect)(()=>{if(!V)return;let e=new AbortController;return fetch(V,{cache:`no-store`,signal:e.signal}).then(e=>{if(!e.ok)throw Error(`Manifest request failed: ${e.status}`);return e.json()}).then(e=>{if(!A(e))throw Error(`Invalid download manifest`);n(e),i(`ready`)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||(n(null),i(`fallback`))}),()=>e.abort()},[]),(0,v.useEffect)(()=>{r===`fallback`&&p(`github`)},[r]);let{currentAsset:h,otherAssets:g,hasR2Assets:_,activeSource:y}=R({manifest:t,currentKey:a,requestedSource:d}),b=t=>z(t,y).source===`r2`?e(`download.source.r2Mirror`):`GitHub Releases`,x=e=>z(e,y).url,S=t=>{let n=H[t.platform],r=n.icon;return(0,B.jsxs)(`article`,{className:`download-current-card`,children:[(0,B.jsxs)(`div`,{className:`download-current-main`,children:[(0,B.jsx)(`div`,{className:`download-current-icon`,children:(0,B.jsx)(r,{size:34})}),(0,B.jsxs)(`div`,{className:`download-current-copy`,children:[(0,B.jsxs)(`div`,{className:`download-current-labels`,children:[(0,B.jsxs)(`span`,{className:`download-current-kicker`,children:[(0,B.jsx)(u,{size:14}),e(`download.platform.currentSystem`)]}),(0,B.jsx)(`span`,{className:`download-current-recommended`,children:e(`download.platform.recommended`)})]}),(0,B.jsxs)(`div`,{className:`download-current-heading`,children:[(0,B.jsx)(`h3`,{children:n.name}),(0,B.jsx)(`span`,{children:t.arch})]}),(0,B.jsx)(`p`,{children:e(n.descKey)}),(0,B.jsxs)(`dl`,{className:`download-current-meta`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,B.jsx)(`dd`,{children:b(t)})]}),t.size?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,B.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`CID`}),(0,B.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]})]})]}),(0,B.jsxs)(`div`,{className:`download-current-actions`,children:[(0,B.jsx)(`span`,{children:e(`download.platform.matchedSystem`)}),(0,B.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,B.jsx)(c,{size:17}),e(`download.platform.action`,{ext:n.ext})]}),(0,B.jsx)(`p`,{children:b(t)})]})]})},C=t=>{let n=H[t.platform],r=n.icon,i=j(t),o=i===a;return(0,B.jsxs)(`article`,{className:[`download-platform-card`,o?`is-recommended`:``].filter(Boolean).join(` `),children:[(0,B.jsx)(`div`,{className:`download-platform-icon`,children:(0,B.jsx)(r,{size:32})}),(0,B.jsxs)(`div`,{className:`download-platform-content`,children:[(0,B.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,B.jsx)(`h3`,{children:n.name}),(0,B.jsx)(`span`,{children:t.arch})]}),(0,B.jsx)(`p`,{children:e(n.descKey)}),(0,B.jsxs)(`dl`,{className:`download-platform-meta`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,B.jsx)(`dd`,{children:b(t)})]}),t.size?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,B.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`CID`}),(0,B.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]}),(0,B.jsx)(`div`,{className:`download-platform-actions`,children:(0,B.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,B.jsx)(c,{size:16}),e(`download.platform.action`,{ext:n.ext})]})})]}),o?(0,B.jsx)(`span`,{className:`download-recommended-badge`,children:e(`download.platform.current`)}):null]},i)},w=t=>{let n=t.icon;return(0,B.jsxs)(`article`,{className:`download-coming-soon-card`,children:[(0,B.jsx)(`div`,{className:`download-platform-icon download-coming-soon-icon`,children:(0,B.jsx)(n,{size:32})}),(0,B.jsxs)(`div`,{className:`download-platform-content`,children:[(0,B.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,B.jsx)(`h3`,{children:e(t.nameKey)}),(0,B.jsx)(`span`,{children:e(`download.platform.comingSoon`)})]}),(0,B.jsx)(`p`,{children:e(t.descKey)})]})]},t.key)};return(0,B.jsxs)(`div`,{className:`download-options`,children:[(0,B.jsxs)(`div`,{className:`ui-segmented-control download-source-tabs`,role:`tablist`,"aria-label":e(`download.source.label`),children:[(0,B.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`r2`,disabled:!_,className:y===`r2`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`r2`),children:[(0,B.jsx)(o,{size:15}),`Cloudflare R2`]}),(0,B.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`github`,className:y===`github`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`github`),children:[(0,B.jsx)(m,{size:15}),`GitHub Releases`]})]}),(0,B.jsx)(`p`,{className:`download-source-note`,children:r===`loading`?e(`download.source.loading`):r===`ready`&&t?e(`download.source.ready`,{version:t.version}):e(`download.source.fallback`)}),h?(0,B.jsx)(`div`,{className:`download-current-platform`,"aria-label":e(`download.platform.currentSystem`),children:S(h)}):null,g.length?(0,B.jsxs)(`div`,{className:`download-other-platforms`,children:[(0,B.jsx)(`p`,{className:`download-other-platforms-title`,children:e(`download.platform.otherPlatforms`)}),(0,B.jsx)(`div`,{className:`download-platform-grid`,children:g.map(e=>C(e))}),(0,B.jsxs)(`div`,{className:`download-coming-soon`,children:[(0,B.jsx)(`p`,{className:`download-coming-soon-title`,children:e(`download.platform.mobilePlatforms`)}),(0,B.jsx)(`div`,{className:`download-coming-soon-grid`,children:U.map(e=>w(e))})]})]}):null]})}var q=[{featureKey:`download.comparison.node`,webKey:`download.comparison.webConnectsNode`,desktopKey:`download.comparison.desktopBuiltinNode`},{featureKey:`download.comparison.fileSharing`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.verification`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.seeding`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopDefaultOn`},{featureKey:`download.comparison.largeFiles`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktop10gb`}];function J(){let{t:e}=l();return(0,v.useEffect)(()=>{document.title=e(`download.meta.title`)},[e]),(0,B.jsxs)(`div`,{className:`download-page`,children:[(0,B.jsx)(d,{}),(0,B.jsx)(`section`,{className:`download-hero`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`div`,{className:`download-hero-icon`,children:(0,B.jsx)(c,{size:40})}),(0,B.jsx)(`h1`,{className:`download-hero-title`,children:e(`download.hero.title`)}),(0,B.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.hero.desc`)})]})}),(0,B.jsx)(`section`,{className:`download-platforms`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`h2`,{className:`download-section-title`,children:e(`download.platforms.title`)}),(0,B.jsx)(K,{})]})}),(0,B.jsx)(`section`,{className:`download-comparison`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`h2`,{className:`download-section-title`,children:e(`download.comparison.title`)}),(0,B.jsx)(`div`,{className:`download-table-wrap`,children:(0,B.jsxs)(`table`,{className:`download-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:e(`download.comparison.feature`)}),(0,B.jsx)(`th`,{children:e(`download.comparison.web`)}),(0,B.jsx)(`th`,{children:e(`download.comparison.desktop`)})]})}),(0,B.jsx)(`tbody`,{children:q.map(t=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:e(t.featureKey)}),(0,B.jsx)(`td`,{className:`col-web`,children:e(t.webKey)}),(0,B.jsx)(`td`,{className:`col-desktop`,children:e(t.desktopKey)})]},t.featureKey))})]})})]})}),(0,B.jsx)(`section`,{className:`download-cta`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.npmNote`)})})}),(0,B.jsx)(`section`,{className:`download-cta`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(a,{to:`/`,className:`btn btn-primary`,children:e(`common.backHome`)})})}),(0,B.jsx)(`footer`,{className:`mkt-footer`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(`div`,{className:`mkt-footer-inner`,children:(0,B.jsx)(`p`,{className:`mkt-footer-copy`,children:`MostBox`})})})})]})}var Y=i(`/download/`)({component:J});export{Y as Route};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i,W as a,t as o}from"./useAppStore-DOnk608w.js";import{t as s}from"./arrow-right-CXzRt0Fp.js";import{t as c}from"./check-iBCQl0yr.js";import{t as l}from"./download-COQOcPqI.js";import{t as u}from"./external-link-D6tHlYgS.js";import{t as d}from"./folder-open-Di0oALaC.js";import{t as f}from"./hard-drive-Cqa7Rstj.js";import{t as p}from"./message-square-BgsNXPft.js";import{t as m}from"./notebook-pen-SWT-zZ4v.js";import{t as h}from"./wallet-D9Iw4YWE.js";import{A as g,C as _,b as v}from"./index-DjBN7bZV.js";import{t as y}from"./MarketingLayout-Cltu-DRw.js";var b=r(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),x=r(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),S=t(e(),1),C=n(),w=[{id:`app`,titleKey:`portal.feature.app.title`,subtitleKey:`portal.feature.app.subtitle`,icon:(0,C.jsx)(d,{size:28}),path:`/app/`,requiresBackend:!0,heroKey:`portal.feature.app.hero`,descKey:`portal.feature.app.desc`,featureKeys:[`portal.feature.app.bullet.localIdentity`,`portal.feature.app.bullet.hyperswarm`,`portal.feature.app.bullet.largeFiles`,`portal.feature.app.bullet.cid`,`portal.feature.app.bullet.seedAfterDownload`,`portal.feature.app.bullet.noCloud`,`portal.feature.app.bullet.desktop`,`portal.feature.app.bullet.openSource`],steps:[{num:`1`,titleKey:`portal.feature.app.step.download.title`,descKey:`portal.feature.app.step.download.desc`,link:`/download/`,linkTextKey:`portal.feature.app.step.download.link`,hideInDesktopClient:!0},{num:`2`,titleKey:`portal.feature.app.step.install.title`,descKey:`portal.feature.app.step.install.desc`,hideInDesktopClient:!0},{num:`3`,titleKey:`portal.feature.app.step.share.title`,descKey:`portal.feature.app.step.share.desc`}]},{id:`chat`,titleKey:`portal.feature.chat.title`,subtitleKey:`portal.feature.chat.subtitle`,icon:(0,C.jsx)(p,{size:28}),path:`/chat/`,requiresBackend:!0,heroKey:`portal.feature.chat.hero`,descKey:`portal.feature.chat.desc`,featureKeys:[`portal.feature.chat.bullet.encrypted`,`portal.feature.chat.bullet.identity`,`portal.feature.chat.bullet.sync`,`portal.feature.chat.bullet.offline`,`portal.feature.chat.bullet.noAccount`],steps:[{num:`1`,titleKey:`portal.feature.chat.step.download.title`,descKey:`portal.feature.chat.step.download.desc`,link:`/download/`,linkTextKey:`portal.feature.chat.step.download.link`,hideInDesktopClient:!0},{num:`2`,titleKey:`portal.feature.chat.step.create.title`,descKey:`portal.feature.chat.step.create.desc`},{num:`3`,titleKey:`portal.feature.chat.step.send.title`,descKey:`portal.feature.chat.step.send.desc`}]},{id:`note`,titleKey:`portal.feature.note.title`,subtitleKey:`portal.feature.note.subtitle`,icon:(0,C.jsx)(m,{size:28}),path:`/note/`,requiresBackend:!1,heroKey:`portal.feature.note.hero`,descKey:`portal.feature.note.desc`,featureKeys:[`portal.feature.note.bullet.markdown`,`portal.feature.note.bullet.privacy`,`portal.feature.note.bullet.folders`,`portal.feature.note.bullet.web3`,`portal.feature.note.bullet.backup`,`portal.feature.note.bullet.independent`],steps:[{num:`1`,titleKey:`portal.feature.note.step.account.title`,descKey:`portal.feature.note.step.account.desc`},{num:`2`,titleKey:`portal.feature.note.step.create.title`,descKey:`portal.feature.note.step.create.desc`},{num:`3`,titleKey:`portal.feature.note.step.backup.title`,descKey:`portal.feature.note.step.backup.desc`}]},{id:`gandengyan`,titleKey:`portal.feature.game.title`,subtitleKey:`portal.feature.game.subtitle`,icon:(0,C.jsx)(x,{size:28}),path:`/game/gandengyan/`,requiresBackend:!0,heroKey:`portal.feature.game.hero`,descKey:`portal.feature.game.desc`,featureKeys:[`portal.feature.game.bullet.account`,`portal.feature.game.bullet.channel`,`portal.feature.game.bullet.link`,`portal.feature.game.bullet.rules`,`portal.feature.game.bullet.maintain`],steps:[{num:`1`,titleKey:`portal.feature.game.step.login.title`,descKey:`portal.feature.game.step.login.desc`},{num:`2`,titleKey:`portal.feature.game.step.create.title`,descKey:`portal.feature.game.step.create.desc`},{num:`3`,titleKey:`portal.feature.game.step.test.title`,descKey:`portal.feature.game.step.test.desc`}]},{id:`web3`,titleKey:`portal.feature.web3.title`,subtitleKey:`portal.feature.web3.subtitle`,icon:(0,C.jsx)(h,{size:28}),path:`/web3/`,requiresBackend:!1,heroKey:`portal.feature.web3.hero`,descKey:`portal.feature.web3.desc`,featureKeys:[`portal.feature.web3.bullet.frontend`,`portal.feature.web3.bullet.keys`,`portal.feature.web3.bullet.mnemonic`,`portal.feature.web3.bullet.eth`,`portal.feature.web3.bullet.pem`,`portal.feature.web3.bullet.qr`],steps:[{num:`1`,titleKey:`portal.feature.web3.step.username.title`,descKey:`portal.feature.web3.step.username.desc`},{num:`2`,titleKey:`portal.feature.web3.step.keys.title`,descKey:`portal.feature.web3.step.keys.desc`},{num:`3`,titleKey:`portal.feature.web3.step.export.title`,descKey:`portal.feature.web3.step.export.desc`}]}],T=[`chat`,`app`,`note`,`gandengyan`,`web3`];function E(){let e=o(e=>e.hasBackend),t=o(e=>e.openConnectModal),[n,r]=(0,S.useState)(`chat`),{t:i}=g(),d=v(),p=T.map(e=>w.find(t=>t.id===e)).filter(e=>!!e),m=p.find(e=>e.id===n)||p[0],h=i(m.titleKey),y=m.steps.filter(e=>!(d&&e.hideInDesktopClient));return(0,C.jsxs)(`div`,{className:`portal-page`,children:[(0,C.jsx)(`section`,{className:`portal-hero`,children:(0,C.jsxs)(`div`,{className:`mkt-container`,children:[(0,C.jsx)(`h1`,{className:`portal-hero-title`,children:i(`common.brand`)}),(0,C.jsx)(`p`,{className:`portal-hero-subtitle`,children:i(`portal.hero.subtitle`)})]})}),(0,C.jsx)(`section`,{className:`portal-cards-section`,children:(0,C.jsxs)(`div`,{className:`mkt-container`,children:[(0,C.jsx)(`div`,{className:`portal-cards`,children:p.map(t=>{let o=n===t.id,s=t.requiresBackend,c=s?e===!0?`connected`:e===!1?`disconnected`:`checking`:`none`,l=i(t.titleKey);return(0,C.jsxs)(`button`,{className:`portal-card ${o?`active`:``}`,onClick:()=>r(t.id),children:[(0,C.jsx)(a,{to:t.path,className:`btn btn-icon portal-card-open-btn`,onClick:e=>e.stopPropagation(),title:i(`portal.openFeature`,{title:l}),children:(0,C.jsx)(b,{size:16})}),(0,C.jsx)(`div`,{className:`portal-card-icon`,children:t.icon}),(0,C.jsx)(`div`,{className:`portal-card-title`,children:l}),(0,C.jsx)(`div`,{className:`portal-card-subtitle`,children:i(t.subtitleKey)}),s?(0,C.jsxs)(`div`,{className:`ui-badge portal-card-status ${c}`,children:[c===`checking`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot checking`}),i(`common.status.checking`)]}),c===`connected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot connected`}),i(`common.status.connected`)]}),c===`disconnected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot disconnected`}),i(`common.status.needsConnection`)]})]}):(0,C.jsxs)(`div`,{className:`ui-badge portal-card-status ready`,children:[(0,C.jsx)(`span`,{className:`status-dot ready`}),i(`common.status.ready`)]})]},t.id)})}),(0,C.jsxs)(`div`,{className:`portal-node-actions`,"aria-label":i(`portal.nodeEntry`),children:[(0,C.jsxs)(`button`,{onClick:t,className:`btn btn-secondary`,children:[(0,C.jsx)(_,{size:16}),i(`portal.webConnectNode`)]}),(0,C.jsxs)(a,{to:`/admin/`,className:`btn btn-secondary`,children:[(0,C.jsx)(f,{size:16}),i(`portal.nodeAdmin`)]})]})]})}),(0,C.jsx)(`section`,{className:`portal-marketing`,children:(0,C.jsx)(`div`,{className:`mkt-container`,children:(0,C.jsxs)(`div`,{className:`portal-marketing-inner`,children:[(0,C.jsxs)(`div`,{className:`portal-marketing-header`,children:[(0,C.jsx)(`h2`,{children:i(m.heroKey)}),(0,C.jsx)(`p`,{children:i(m.descKey)})]}),(0,C.jsx)(`div`,{className:`portal-marketing-features`,children:m.featureKeys.map(e=>(0,C.jsxs)(`div`,{className:`portal-feature-item`,children:[(0,C.jsx)(`span`,{className:`portal-feature-icon`,children:(0,C.jsx)(c,{size:14,strokeWidth:3})}),(0,C.jsx)(`span`,{children:i(e)})]},e))}),(0,C.jsx)(`div`,{className:`portal-marketing-steps`,children:y.map((e,t)=>(0,C.jsxs)(`div`,{className:`portal-step`,children:[(0,C.jsx)(`span`,{className:`portal-step-num`,children:t+1}),(0,C.jsxs)(`div`,{className:`portal-step-content`,children:[(0,C.jsx)(`strong`,{children:i(e.titleKey)}),(0,C.jsx)(`p`,{children:i(e.descKey)}),e.code&&(0,C.jsx)(`code`,{className:`portal-step-code`,translate:`no`,children:e.code}),e.link&&e.linkTextKey&&(0,C.jsx)(`p`,{className:`portal-step-link`,children:(0,C.jsxs)(a,{to:e.link,children:[i(e.linkTextKey),` `,(0,C.jsx)(u,{size:12})]})})]})]},e.num))}),(0,C.jsxs)(`div`,{className:`portal-actions`,children:[(0,C.jsxs)(a,{to:m.path,className:`btn btn-primary`,children:[i(`portal.enterFeature`,{title:h}),(0,C.jsx)(s,{size:16})]}),m.requiresBackend&&e===!1&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`button`,{onClick:t,className:`btn btn-secondary`,children:[(0,C.jsx)(_,{size:16}),i(`portal.webConnectNode`)]}),!d&&(0,C.jsxs)(a,{to:`/download/`,className:`btn btn-secondary`,children:[(0,C.jsx)(l,{size:16}),i(`nav.downloadClient`)]})]})]})]})})})]})}function D(){return(0,C.jsx)(y,{children:(0,C.jsx)(E,{})})}var O=i(`/`)({component:D});export{O as Route};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MilkdownEditor-Dw_ze7EE.js","assets/jsx-runtime-Bt-cYkS5.js","assets/index-DjBN7bZV.js","assets/useAppStore-DOnk608w.js","assets/useNavigate-DWlBD_-b.js","assets/index-B6acG3-t.css","assets/dist-CSyRxrry.js","assets/dist-RU_cpjXQ.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,C as i,E as a,H as o,M as s,d as c,j as l,o as u,t as d,w as f}from"./useAppStore-DOnk608w.js";import{n as ee}from"./useNavigate-DWlBD_-b.js";import{a as te,i as ne,n as re,o as p}from"./chatNoteDraft-CYbvcEvC.js";import{t as ie}from"./OpenSidebarButton-C2UJYXKh.js";import{n as m,t as h}from"./lock-CuwwlXlx.js";import{n as g,t as _}from"./folder-DAcox9xz.js";import{t as v}from"./folder-open-Di0oALaC.js";import{n as ae,t as y}from"./AppTop-DZFTO9-m.js";import{t as b}from"./notebook-pen-SWT-zZ4v.js";import{t as oe}from"./save-B02sbO9Y.js";import{t as se}from"./search-HW4oPOBP.js";import{t as ce}from"./trash-2-BLwoM0ME.js";import{A as le,N as ue,S as de,_ as fe,a as pe,b as x,c as S,g as C,i as w,l as me,o as T,r as he,s as ge,t as E,u as _e,v as ve,w as D,y as O}from"./index-DjBN7bZV.js";var ye=r(`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`}]]),be=r(`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`}]]),k=t(e(),1),A=n();function j(e){return e.type===`directory`?f(e.path?`${e.path}/${e.name}`:e.name):i(e)}function xe({target:e,targetLabel:t,directories:n,onMove:r,onClose:i}){let{t:a}=le(),o=f(e.path||``),s=j(e),c=n.filter(t=>e.type===`directory`?t.path!==s&&!t.path.startsWith(`${s}/`):!0),[l,u]=(0,k.useState)(o),[d,ee]=(0,k.useState)(``),[te,ne]=(0,k.useState)(new Set),re=f(d),p=d.trim()?re:l,ie=f(p)===o,h=a(`note.move.rootDirectory`),v=new Map;for(let e of c){let t=v.get(e.parentPath)||[];t.push(e),v.set(e.parentPath,t)}let ae=c.filter(e=>{if(!e.parentPath)return!0;let t=e.parentPath.split(`/`).filter(Boolean);return t.every((e,n)=>te.has(t.slice(0,n+1).join(`/`)))}),y=[{label:h,path:``},...l.split(`/`).filter(Boolean).map((e,t,n)=>({label:e,path:n.slice(0,t+1).join(`/`)}))];function b(e){u(f(e)),ee(``)}function oe(e){b(e),v.has(e)&&ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function se(){ie||r(p)}return(0,A.jsx)(O,{onClose:i,children:(0,A.jsxs)(`div`,{className:`note-move-modal`,onClick:e=>e.stopPropagation(),children:[(0,A.jsxs)(`div`,{className:`modal-header`,children:[(0,A.jsx)(`h3`,{children:a(`note.move.title`)}),(0,A.jsx)(`button`,{className:`btn btn-icon`,onClick:i,children:(0,A.jsx)(de,{size:18})})]}),(0,A.jsxs)(`div`,{className:`note-move-target`,children:[(0,A.jsx)(`span`,{children:a(`note.move.moving`)}),(0,A.jsx)(`strong`,{translate:`no`,children:t||e.name})]}),(0,A.jsx)(`div`,{className:`note-move-path`,children:y.map((e,t)=>(0,A.jsxs)(k.Fragment,{children:[t>0&&(0,A.jsx)(`span`,{children:`/`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>b(e.path),children:(0,A.jsx)(`span`,{translate:e.path?`no`:`yes`,children:e.label})})]},e.path||`root`))}),(0,A.jsxs)(`div`,{className:`note-move-folder-list`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`note-move-folder-item ${l===``?`selected`:``}`,onClick:()=>b(``),children:[(0,A.jsx)(`span`,{className:`note-move-folder-spacer`}),(0,A.jsx)(_,{className:`note-move-folder-icon`,size:16}),(0,A.jsx)(`span`,{children:h})]}),c.length===0?(0,A.jsx)(`p`,{className:`note-move-empty`,children:a(`note.move.noFolders`)}):ae.map(e=>{let t=v.has(e.path),n=te.has(e.path);return(0,A.jsxs)(`button`,{type:`button`,className:`note-move-folder-item note-move-depth-${Math.min(e.depth,4)} ${l===e.path?`selected`:``}`,onClick:()=>oe(e.path),children:[t?n?(0,A.jsx)(m,{className:`note-move-expander`,size:14}):(0,A.jsx)(g,{className:`note-move-expander`,size:14}):(0,A.jsx)(`span`,{className:`note-move-folder-spacer`}),(0,A.jsx)(_,{className:`note-move-folder-icon`,size:16}),(0,A.jsx)(`span`,{translate:`no`,children:e.name}),e.parentPath&&(0,A.jsx)(`small`,{translate:`no`,children:e.parentPath})]},e.path)})]}),(0,A.jsx)(`input`,{className:`input input-compact`,value:d,onChange:e=>ee(e.target.value),placeholder:a(`note.move.pathPlaceholder`),translate:`no`}),(0,A.jsxs)(`div`,{className:`note-move-destination`,children:[(0,A.jsx)(`span`,{children:a(`note.move.destinationLabel`)}),(0,A.jsx)(`span`,{translate:p?`no`:`yes`,children:p||h})]}),(0,A.jsxs)(`div`,{className:`modal-actions`,children:[(0,A.jsx)(`button`,{className:`btn btn-secondary`,onClick:i,children:a(`common.cancel`)}),(0,A.jsx)(`button`,{className:`btn btn-primary`,onClick:se,disabled:ie,children:a(`note.action.move`)})]})]})})}function Se({children:e}){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(y,{}),e]})}var Ce=(0,k.lazy)(async()=>({default:(await E(()=>import(`./MilkdownEditor-Dw_ze7EE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))).MilkdownEditor})),M=/\[\[([^\]\n]+?)\]\]/g,we=/(```[\s\S]*?```)/g;function Te(e){let t=new URLSearchParams(e),n=t.get(`mode`);return{cid:t.get(`cid`)||void 0,file:t.get(`file`)||void 0,path:t.get(`path`)||void 0,chatDraft:t.get(`chatDraft`)||void 0,mode:n===`edit`?`edit`:void 0}}function N(e={}){let t=new URLSearchParams;e.cid&&t.set(`cid`,e.cid),e.file&&t.set(`file`,e.file),e.path&&t.set(`path`,e.path),e.chatDraft&&t.set(`chatDraft`,e.chatDraft),e.mode&&t.set(`mode`,e.mode);let n=t.toString();return n?`/note/?${n}`:`/note/`}function Ee(e){let t=e.indexOf(`?`),n=t>=0?e.slice(t):``;if(typeof window>`u`)return Te(n);try{return Te(new URL(e,window.location.origin).search)}catch{return Te(n)}}var P={"note.error.nameRequired":`note.error.nameRequired`,"note.error.nameNoSlash":`note.error.nameNoSlash`,"note.error.nameNoBackslash":`note.error.nameNoBackslash`,"note.error.nameInvalid":`note.error.nameInvalid`,"note.error.nameConflict":`note.error.nameConflict`,"note.error.moveIntoSelf":`note.error.moveIntoSelf`};function De(e,t,n){let r=e instanceof Error?e.message:``,i=P[r];return i?n(i):r||t}function Oe(e){return e.type===`directory`?f(e.path?`${e.path}/${e.name}`:e.name):i(e)}function F(e=``){return String(e).trim().replace(/\.md$/i,``)}function I(e){let t=F(e);return t?`${t}.md`:``}function ke(e,t,n){let r=F(e)||t;for(let e=0;e<1e3;e+=1){let t=I(e===0?r:`${r} ${e+1}`);if(t&&!n(t))return t}return I(`${r} ${Date.now()}`)}function Ae(e=``){let t=f(e).split(`/`).filter(Boolean);if(t.length===0)return``;let n=t.length-1;return t[n]=I(t[n]),t.join(`/`)}function je(e=``){let t=f(e).split(`/`).filter(Boolean);if(t.length===0)return``;let n=t.length-1;return t[n]=F(t[n]),t.join(`/`)}function Me(e){return je(i(e))}function L(e){let t=e.trim().replace(/^\/+/,``),n=t.search(/[#^]/);return je(n>=0?t.slice(0,n):t)}function Ne(e,t){let n=t?.trim();if(n)return n;let r=e.split(`/`).filter(Boolean);return r[r.length-1]||e}function R(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`)}function Pe(e,t){return`[${R(e)}](<${t.replace(/>/g,`%3E`)}>)`}function Fe(e,t,n=``){let r=L(t);if(!r)return null;let i=r.toLowerCase(),a=e=>Me(e).toLowerCase();if(r.includes(`/`))return e.find(e=>a(e)===i)||null;let o=f(n);if(o){let t=f(`${o}/${r}`).toLowerCase(),n=e.find(e=>a(e)===t);if(n)return n}return e.find(e=>F(e.name).toLowerCase()===i)||null}function Ie(e,t,n,r=``,i){let a=e.indexOf(`|`),o=a>=0?e.slice(0,a):e,s=a>=0?e.slice(a+1):void 0,c=L(o);if(!c)return null;let l=Fe(t,o,r),u=l?n(l):i?.(c);return u?{label:Ne(c,s),href:u}:null}function Le(e,t,n,r=``,i){return e.includes(`[[`)?e.split(we).map(e=>e.startsWith("```")?e:e.replace(M,(e,a)=>{let o=Ie(a,t,n,r,i);return o?Pe(o.label,o.href):e})).join(``):e}function z(e){return e.type===`file`?F(e.name):e.name}function B(e){return e.type===`file`?je(e.fullPath):e.fullPath}function Re(e){return e.type===`file`?F(e.name):e.name}function ze(e=``){let t=f(e).split(`/`).filter(Boolean);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function Be(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function Ve(e,t){if(t.length===0)return e;let n=!1,r=new Set(e);for(let e of t)r.has(e)||(r.add(e),n=!0);return n?r:e}function He(e){return{name:e.name,cid:`__dir__${e.fullPath}`,path:e.path,type:`directory`,size:0,created_at:e.updatedAt,updated_at:e.updatedAt}}function Ue(e,t){let n=[],r=new Map;function a(e){return e&&r.get(e)?.children||n}function o(e,t,n){let i=f(t?`${t}/${e}`:e),o=r.get(i);if(o)return o.updatedAt=Math.max(o.updatedAt,n),o;let s={id:`directory:${i}`,type:`directory`,name:e,path:t,fullPath:i,updatedAt:n,children:[]};return r.set(i,s),a(t).push(s),s}for(let t of e){let e=f(t.path||``),n=e.split(`/`).filter(Boolean),r=t.updated_at||t.created_at||0,s=``;for(let e of n)s=o(e,s,r).fullPath;a(s).push({id:`file:${t.cid}:${i(t)}`,type:`file`,name:t.name,path:e,fullPath:i(t),updatedAt:r,note:t,children:[]})}function s(e){e.sort((e,n)=>{if(e.type!==n.type)return e.type===`directory`?-1:1;let r=t(z(e),z(n));return r===0?t(B(e),B(n)):r});for(let t of e)t.type===`directory`&&s(t.children)}return s(n),n}function We(e,t){let n=t.trim().toLowerCase();return n?e.flatMap(e=>{let t=z(e).toLowerCase(),r=B(e).toLowerCase(),i=t.includes(n)||r.includes(n);if(e.type===`file`)return i?[e]:[];let a=i?e.children:We(e.children,n);return!i&&a.length===0?[]:[{...e,children:a}]}):e}function Ge({nodes:e,searchQuery:t,expandedPaths:n,activeFileId:r,activeFolderPath:i,onToggleDirectory:a,onOpenFile:o,renderActions:s}){let c=t.trim().length>0;return(0,A.jsx)(`div`,{className:`note-tree`,role:`tree`,children:e.map(e=>(0,A.jsx)(V,{node:e,forceExpanded:c,expandedPaths:n,activeFileId:r,activeFolderPath:i,onToggleDirectory:a,onOpenFile:o,renderActions:s},e.id))})}function V({node:e,forceExpanded:t,expandedPaths:n,activeFileId:r,activeFolderPath:i,onToggleDirectory:a,onOpenFile:o,renderActions:s}){let c=e.type===`directory`,l=c&&(t||n.has(e.fullPath)),u=e.type===`file`&&e.note?.cid===r,d=c&&f(i)===e.fullPath,ee=c?He(e):e.note||null,te=ee&&s?s(ee):null;return(0,A.jsxs)(`div`,{className:`note-tree-node`,role:`none`,children:[(0,A.jsxs)(`div`,{className:`note-tree-row ${c?`is-directory`:`is-file`} ${u?`is-active`:``} ${d?`is-folder-active`:``} ${te?`has-actions`:``}`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`note-tree-item`,role:`treeitem`,"aria-expanded":c?l:void 0,onClick:()=>{if(c){a(e);return}e.note&&o(e.note)},children:[(0,A.jsx)(`span`,{className:`note-tree-toggle`,"aria-hidden":`true`,children:c?l?(0,A.jsx)(m,{size:16}):(0,A.jsx)(g,{size:16}):(0,A.jsx)(`span`,{className:`note-tree-toggle-placeholder`})}),(0,A.jsx)(`span`,{className:`note-tree-label`,translate:`no`,children:z(e)}),e.note?.isSecret&&(0,A.jsx)(h,{className:`note-tree-lock`,size:14,"aria-hidden":`true`})]}),te]}),c&&l&&e.children.length>0&&(0,A.jsx)(`div`,{className:`note-tree-children`,role:`group`,children:e.children.map(e=>(0,A.jsx)(V,{node:e,forceExpanded:t,expandedPaths:n,activeFileId:r,activeFolderPath:i,onToggleDirectory:a,onOpenFile:o,renderActions:s},e.id))})]})}function Ke(e,t){let n=new Set;for(let t of e){let e=f(t.path).split(`/`).filter(Boolean);for(let t=0;t<e.length;t+=1)n.add(e.slice(0,t+1).join(`/`))}return Array.from(n).sort(t).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)}})}function H(e){return e.map(e=>({name:e.name,cid:e.path,path:f(e.directory),content:``,size:e.size,type:`file`,created_at:Number(e.mtimeMs)||Date.now(),updated_at:Number(e.mtimeMs)||Date.now(),isSecret:!1}))}function U(e,t){let n=I(t);return f(e?`${e}/${n}`:n)}function qe(e){let t=e||typeof window<`u`&&window.location.origin||``;if(!t)return!1;try{let e=new URL(t).hostname.toLowerCase();return e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`||e.startsWith(`127.`)}catch{return!1}}function W(e,t=``){let[n,r]=(0,k.useState)(!1);return(0,k.useEffect)(()=>{let n=!1;return!e||!t?(r(!1),()=>{n=!0}):(T().then(e=>{n||r(e.configured===!0)}).catch(()=>{n||r(!1)}),()=>{n=!0})},[e,t]),n}function G(){let{t:e,formatDate:t,compareStrings:n}=le(),r=ee(),i=ue({select:e=>e.searchStr}),o=(0,k.useMemo)(()=>Te(i),[i]),c=(0,k.useRef)(null),u=d(e=>e.addToast),p=a(e=>e.wallet),m=a(e=>e.openLoginModal),g=d(e=>e.notes),_=d(e=>e.notesPath),v=d(e=>e.setNotesPath),y=d(e=>e.saveNote),pe=d(e=>e.deleteNote),x=d(e=>e.renameNote),S=d(e=>e.localDataReady),C=o.cid||``,w=g.find(e=>e.cid===C),me=!!C,T=me&&o.mode===`edit`,[he,ge]=(0,k.useState)(``),[E,_e]=(0,k.useState)(null),[O,j]=(0,k.useState)(null),[M,we]=(0,k.useState)(null),P=(0,k.useRef)(``),je=(0,k.useRef)(``),[Me,L]=(0,k.useState)(``),[Ne,R]=(0,k.useState)(``),[Pe,z]=(0,k.useState)(``),[B,He]=(0,k.useState)(``),[V,H]=(0,k.useState)(``),[U,qe]=(0,k.useState)(!1),[W,G]=(0,k.useState)(``),[K,q]=(0,k.useState)(!1),[Je,Ye]=(0,k.useState)(()=>new Set(ze(_)));(0,k.useEffect)(()=>{if(!C){L(``),R(``);return}if(!w){L(``),R(S?e(`note.error.notFound`):``);return}if(w.content.startsWith(`mp://1`)){if(!p){L(``),R(e(`note.error.loginToDecrypt`));return}let t=l(w.content,p.danger);if(!t){L(``),R(e(`note.error.decryptFailed`));return}L(t),R(``);return}L(w.content||``),R(``)},[C,S,w,e,p]),(0,k.useEffect)(()=>{if(!T){q(!1);return}if(!C||!w){z(``),He(``),H(``),qe(!1),G(S?e(`note.error.notFound`):``);return}if(z(F(w.name)),He(w.path||``),qe(w.isSecret===!0||w.content.startsWith(`mp://1`)),w.content.startsWith(`mp://1`)){if(!p){H(``),G(e(`note.error.loginToDecrypt`));return}let t=l(w.content,p.danger);if(!t){H(``),G(e(`note.error.decryptFailed`));return}H(t),G(``);return}H(w.content||``),G(``)},[C,T,S,w,e,p]);let Xe=(0,k.useMemo)(()=>Ue(g,n),[n,g]),Ze=(0,k.useMemo)(()=>We(Xe,he),[Xe,he]),Qe=w?.isSecret===!0||w?.content.startsWith(`mp://1`)===!0,J=e(T?U?`note.privacy.secret`:`note.privacy.public`:Qe?`note.privacy.secret`:`note.privacy.public`),$e=(0,k.useMemo)(()=>Ke(g,n),[n,g]),et=(0,k.useMemo)(()=>Le(Me,g,e=>N({cid:e.cid}),w?.path||``,e=>N({path:Ae(e)})),[g,Me,w?.path]),tt=(0,k.useCallback)(e=>Ie(e,g,e=>N({cid:e.cid}),w?.path||``,e=>N({path:Ae(e)})),[g,w?.path]);(0,k.useEffect)(()=>{w?.path&&Ye(e=>Ve(e,ze(w.path)))},[w?.path]),(0,k.useEffect)(()=>{if(!o.path||C||g.length===0)return;let e=Fe(g,o.path);e&&(v(f(e.path||``)),r({href:N({cid:e.cid}),replace:!0}))},[C,r,g,o.path,v]),(0,k.useEffect)(()=>{let t=o.chatDraft||``;if(!t||P.current===t||!S)return;if(!p){let e=`${t}:auth`;je.current!==e&&(je.current=e,m());return}let n=ne(t);if(!n){P.current=t,u(e(`note.chatDraft.missing`),`warning`),Y({},!0);return}P.current=t,at(n)},[u,S,o.chatDraft,e,p]);function Y(e={},t=!1){r({href:N(e),replace:t})}function nt(e){Y(Ee(e))}function rt(e){v(f(e.path||``)),Y({cid:e.cid})}function it(e){v(e.fullPath),Ye(t=>Be(t,e.fullPath))}function X(e){Y({cid:e.cid,mode:`edit`})}function Z(){return p?!0:(m(),!1)}async function at(t){if(p)try{let n=await y({name:ke(t.title,e(`note.chatDraft.defaultTitle`),e=>g.some(t=>f(t.path||``)===f(_)&&t.name===e)),path:_,content:t.content,isSecret:!1});re(t.id),u(e(`note.chatDraft.created`),`success`),Y({cid:n,mode:`edit`},!0)}catch(t){P.current=``,u(De(t,e(`note.toast.createFailed`),e),`error`)}}function ot(){Y(w?{cid:w.cid}:{})}async function st(){if(!Z())return;if(!w){u(e(`note.toast.notFound`),`error`);return}let t=I(Pe);if(!t){u(e(`note.toast.nameRequired`),`warning`);return}q(!0);try{let n=c.current?.getMarkdown()??V,r=U?s(n,p.danger):n,i=await y({cid:w.cid,name:t,path:B,content:r,isSecret:U});H(n),Y({cid:i},!0),u(e(`note.toast.saved`),`success`)}catch(t){u(De(t,e(`note.toast.saveFailed`),e),`error`)}finally{q(!1)}}function ct(){Z()&&_e({title:e(`note.create.title`),placeholder:e(`note.namePlaceholder`),confirmText:e(`note.create.action`),onConfirm:async t=>{if(Z())try{let n=await y({name:I(t),path:_,content:``,isSecret:!1});_e(null),u(e(`note.toast.created`),`success`),Y({cid:n,mode:`edit`})}catch(t){u(De(t,e(`note.toast.createFailed`),e),`error`)}}})}function lt(e){Z()&&we(e)}async function Q(t){if(M)try{x(Oe(M),t,M.name),we(null),u(e(`note.toast.moved`),`success`)}catch(t){u(De(t,e(`note.toast.moveFailed`),e),`error`)}}function $(t){if(!Z())return;let n=t.type===`directory`;j({title:e(n?`note.delete.folderTitle`:`note.delete.noteTitle`),message:e(`note.delete.message`,{name:Re(t)}),confirmText:e(`note.action.delete`),onConfirm:async()=>{pe(n?void 0:t.cid,t.path,t.name),j(null),u(e(`note.toast.deleted`),`success`),t.type===`file`&&t.cid===C&&Y()}})}let ut=(0,A.jsxs)(`div`,{className:`note-header-title`,children:[(0,A.jsx)(`h2`,{className:`header-title`,children:e(`note.title`)}),(0,A.jsx)(`span`,{children:e(`note.count`,{count:g.length})})]}),dt=(0,A.jsx)(`div`,{className:`note-theme-wrap`}),ft=(0,A.jsxs)(`section`,{className:`note-list-panel note-sidebar-list`,"aria-label":e(`note.listLabel`),children:[(0,A.jsxs)(`div`,{className:`note-search`,children:[(0,A.jsx)(se,{size:16}),(0,A.jsx)(`input`,{className:`input input-flex`,value:he,onChange:e=>ge(e.target.value),placeholder:e(`note.search.placeholder`)})]}),Ze.length===0?(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,A.jsx)(b,{size:32}),(0,A.jsx)(`p`,{children:e(he?`note.empty.noMatches`:`note.empty.noNotes`)})]}):(0,A.jsx)(Ge,{nodes:Ze,searchQuery:he,expandedPaths:Je,activeFileId:C,activeFolderPath:C?``:_,onToggleDirectory:it,onOpenFile:rt}),(0,A.jsx)(`div`,{className:`note-create-btn`,children:(0,A.jsxs)(`button`,{className:`btn`,onClick:ct,children:[(0,A.jsx)(te,{size:16}),e(`note.newNote`)]})})]});return(0,A.jsxs)(ae,{sidebar:()=>(0,A.jsx)(Se,{children:ft}),headerTitle:ut,headerRight:dt,children:[(0,A.jsx)(`main`,{className:`note-page note-browser-page ${me?`has-editor`:``}`,children:(0,A.jsx)(`section`,{className:`note-workspace`,children:(0,A.jsx)(`section`,{className:`note-editor-panel`,"aria-label":e(T?`note.editorLabel.edit`:`note.editorLabel.read`),children:me?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`note-editor-panel-header`,children:[(0,A.jsxs)(`div`,{className:`note-editor-title-area`,children:[T?(0,A.jsx)(`input`,{className:`note-title-input`,value:Pe,onChange:e=>z(e.target.value),placeholder:e(`note.namePlaceholder`),translate:`no`,disabled:!w}):w?(0,A.jsx)(`h3`,{translate:`no`,children:F(w.name)}):(0,A.jsx)(`h3`,{children:e(`note.untitled`)}),w&&(0,A.jsxs)(`div`,{className:`note-editor-info`,children:[(0,A.jsx)(`span`,{children:e(T?`note.mode.edit`:`note.mode.read`)}),(0,A.jsx)(`span`,{children:J}),(0,A.jsx)(`span`,{children:t(w.updated_at)})]})]}),(0,A.jsxs)(`div`,{className:`note-editor-actions`,children:[(0,A.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:T?ot:()=>Y(),title:e(T?`common.cancel`:`common.close`),"aria-label":e(T?`common.cancel`:`common.close`),children:(0,A.jsx)(de,{size:16})}),T?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{className:`btn btn-sm ${U?`btn-warning`:`btn-secondary`}`,onClick:()=>qe(!U),disabled:!w,children:[U?(0,A.jsx)(h,{size:16}):(0,A.jsx)(D,{size:16}),e(U?`note.privacy.secret`:`note.privacy.public`)]}),(0,A.jsxs)(`button`,{className:`btn btn-sm btn-primary`,onClick:st,disabled:K||!!W||!w,children:[(0,A.jsx)(oe,{size:16}),e(K?`note.action.saving`:`note.action.save`)]})]}):w&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:()=>lt(w),title:e(`note.action.move`),"aria-label":e(`note.action.move`),children:(0,A.jsx)(ye,{size:16})}),(0,A.jsx)(`button`,{type:`button`,className:`btn btn-icon note-editor-action-danger`,onClick:()=>$(w),title:e(`note.action.delete`),"aria-label":e(`note.action.delete`),children:(0,A.jsx)(ce,{size:16})}),(0,A.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,onClick:()=>X(w),disabled:!!Ne,title:e(`note.action.edit`),"aria-label":e(`note.action.edit`),children:[(0,A.jsx)(be,{size:16}),e(`note.action.edit`)]})]})]})]}),T?W?(0,A.jsxs)(`div`,{className:`note-empty-state editor-error`,children:[(0,A.jsx)(h,{size:36}),(0,A.jsx)(`p`,{children:W})]}):w?(0,A.jsx)(`div`,{className:`note-editor-frame editing`,children:(0,A.jsx)(Ce,{ref:c,content:V,onChange:H,className:`milkdown-editor`})}):(0,A.jsxs)(`div`,{className:`note-empty-state editor-error`,children:[(0,A.jsx)(b,{size:36}),(0,A.jsx)(`p`,{children:e(S?`note.error.notFound`:`note.loading`)})]}):Ne?(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,A.jsx)(h,{size:36}),(0,A.jsx)(`p`,{children:Ne})]}):w?(0,A.jsx)(`div`,{className:`note-editor-frame reading`,children:(0,A.jsx)(Ce,{content:et,readOnly:!0,onInternalNoteLinkOpen:nt,resolveWikiNoteLink:tt,className:`milkdown-editor`})}):(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,A.jsx)(b,{size:36}),(0,A.jsx)(`p`,{children:e(S?`note.error.notFound`:`note.loading`)})]})]}):(0,A.jsxs)(`div`,{className:`ui-empty-state note-editor-empty`,children:[(0,A.jsx)(`div`,{className:`ui-empty-icon note-editor-empty-icon`,children:(0,A.jsx)(b,{size:32})}),(0,A.jsx)(`h3`,{className:`ui-empty-title`,children:e(`note.noOpen.title`)}),(0,A.jsx)(`p`,{className:`ui-empty-desc`,children:g.length>0?e(`note.noOpen.select`):e(`note.noOpen.createFirst`)}),(0,A.jsx)(ie,{label:e(`note.openList`),variant:`default`})]})})})}),E&&(0,A.jsx)(fe,{title:E.title,placeholder:E.placeholder,defaultValue:E.defaultValue,confirmText:E.confirmText,onConfirm:E.onConfirm,onClose:()=>_e(null)}),O&&(0,A.jsx)(ve,{title:O.title,message:O.message,confirmText:O.confirmText,danger:!0,onConfirm:O.onConfirm,onClose:()=>j(null)}),M&&(0,A.jsx)(xe,{target:M,targetLabel:Re(M),directories:$e,onMove:Q,onClose:()=>we(null)})]})}function K(){let{t:e,formatDate:t,compareStrings:n}=le(),r=ee(),i=ue({select:e=>e.searchStr}),o=(0,k.useMemo)(()=>Te(i),[i]),s=(0,k.useRef)(null),c=d(e=>e.addToast),l=a(e=>e.wallet),m=a(e=>e.openLoginModal),g=o.file||``,_=!!g,y=_&&o.mode===`edit`,[x,E]=(0,k.useState)(null),[D,O]=(0,k.useState)([]),[j,M]=(0,k.useState)(``),[we,P]=(0,k.useState)(!0),[De,Me]=(0,k.useState)(``),[L,Ne]=(0,k.useState)(``),[R,Pe]=(0,k.useState)(!1),[z,B]=(0,k.useState)(null),[He,V]=(0,k.useState)(``),[qe,W]=(0,k.useState)(``),[G,K]=(0,k.useState)(!1),[q,Je]=(0,k.useState)(``),[Ye,Xe]=(0,k.useState)(!1),[Ze,Qe]=(0,k.useState)(()=>new Set(ze(j))),[J,$e]=(0,k.useState)(null),[et,tt]=(0,k.useState)(null),[Y,nt]=(0,k.useState)(null),rt=(0,k.useRef)(``),it=(0,k.useRef)(``),X=(0,k.useMemo)(()=>H(D),[D]),Z=X.find(e=>e.cid===g),at=(0,k.useMemo)(()=>Ke(X,n),[n,X]),ot=(0,k.useMemo)(()=>Ue(X,n),[n,X]),st=(0,k.useMemo)(()=>We(ot,L),[ot,L]),ct=(0,k.useMemo)(()=>Le(z?.content||``,X,e=>N({file:e.cid}),Z?.path||z?.directory||``,e=>N({path:Ae(e)})),[z?.content,z?.directory,Z?.path,X]),lt=(0,k.useCallback)(e=>Ie(e,X,e=>N({file:e.cid}),Z?.path||z?.directory||``,e=>N({path:Ae(e)})),[z?.directory,Z?.path,X]);(0,k.useEffect)(()=>{Z?.path&&Qe(e=>Ve(e,ze(Z.path)))},[Z?.path]),(0,k.useEffect)(()=>{if(!o.path||g||X.length===0)return;let e=Fe(X,o.path);e&&(M(f(e.path||``)),r({href:N({file:e.cid}),replace:!0}))},[g,r,o.path,X]),(0,k.useEffect)(()=>{let t=o.chatDraft||``;if(!t||rt.current===t||we)return;if(!l){let e=`${t}:auth`;it.current!==e&&(it.current=e,m());return}if(x?.configured!==!0){let n=`${t}:vault`;it.current!==n&&(it.current=n,c(e(`note.chatDraft.openVaultFirst`),`warning`));return}let n=ne(t);if(!n){rt.current=t,c(e(`note.chatDraft.missing`),`warning`),$({},!0);return}rt.current=t,_t(n)},[c,o.chatDraft,e,we,x?.configured,l]);let Q=(0,k.useCallback)(async()=>{if(!l){E(null),O([]),Me(e(`note.vault.loginRequired`)),P(!1);return}P(!0),Me(``);try{let e=await T();E(e),e.configured?O(await ge()):O([])}catch(t){E(null),O([]),Me(await u(t,e(`note.vault.loadFailed`)))}finally{P(!1)}},[e,l]);(0,k.useEffect)(()=>{Q()},[Q]),(0,k.useEffect)(()=>{V(F(z?.name||Z?.name||``))},[z?.name,Z?.name]),(0,k.useEffect)(()=>{let t=!1;async function n(){if(!g){B(null),W(``),Je(``),K(!1);return}if(!l){B(null),W(``),Je(e(`note.vault.loginRequired`)),K(!1);return}if(x?.configured!==!0){B(null),W(``),Je(``),K(!1);return}K(!0),Je(``);try{let e=await me(g);if(t)return;B(e),W(e.content)}catch(n){if(t)return;B(null),W(``),Je(await u(n,e(`note.error.notFound`)))}finally{t||K(!1)}}return n(),()=>{t=!0}},[g,e,x?.configured,l]);function $(e={},t=!1){r({href:N(e),replace:t})}function ut(e){$(Ee(e))}function dt(e){M(f(e.path||``)),$({file:e.cid})}function ft(e){M(e.fullPath),Qe(t=>Be(t,e.fullPath))}function pt(){g&&$({file:g,mode:`edit`})}function mt(){V(F(z?.name||Z?.name||``)),$(g?{file:g}:{})}async function ht(){if(!l){m();return}let t=window.electronAPI?.selectNoteVaultDirectory;if(!t){c(e(`note.vault.selectFailed`),`error`);return}Pe(!0);try{let n=await t();if(!n)return;await he(n),await Q(),$({},!0),c(e(`note.vault.opened`),`success`)}catch(t){c(await u(t,e(`note.vault.selectFailed`)),`error`)}finally{Pe(!1)}}function gt(){return l?x?.configured===!0?!0:(c(e(`note.vault.emptyPrompt`),`warning`),!1):(m(),!1)}async function _t(t){if(gt())try{let n=ke(t.title,e(`note.chatDraft.defaultTitle`),e=>D.some(t=>f(t.directory)===f(j)&&t.name===e)),r=await w(f(j?`${j}/${n}`:n),t.content);re(t.id),await Q(),c(e(`note.chatDraft.created`),`success`),$({file:r.path,mode:`edit`},!0)}catch(t){rt.current=``,c(await u(t,e(`note.toast.createFailed`)),`error`)}}function vt(){gt()&&$e({title:e(`note.create.title`),placeholder:e(`note.namePlaceholder`),confirmText:e(`note.create.action`),onConfirm:async t=>{if(!gt())return;let n=U(j,t);if(!n){c(e(`note.toast.nameRequired`),`warning`);return}try{let t=await w(n,``);$e(null),await Q(),$({file:t.path,mode:`edit`}),c(e(`note.toast.created`),`success`)}catch(t){c(await u(t,e(`note.toast.createFailed`)),`error`)}}})}function yt(e){gt()&&nt(e)}async function bt(t){if(!(!Y||!gt()))try{let n=g;if(Y.type===`directory`){let e=Oe(Y),r=f(t?`${t}/${Y.name}`:Y.name),i=D.filter(t=>t.path.startsWith(`${e}/`));for(let t of i){let i=f(`${r}/${t.path.slice(e.length+1)}`);await S(t.path,i),g===t.path&&(n=i)}}else{let e=f(t?`${t}/${Y.name}`:Y.name),r=await S(Y.cid,e);g===Y.cid&&(n=r.path)}nt(null),await Q(),$(n?{file:n}:{},!0),c(e(`note.toast.moved`),`success`)}catch(t){c(await u(t,e(`note.toast.moveFailed`)),`error`)}}function xt(t){gt()&&tt({title:t.type===`directory`?e(`note.delete.folderTitle`):e(`note.delete.noteTitle`),message:e(`note.delete.message`,{name:Re(t)}),confirmText:e(`note.action.delete`),onConfirm:async()=>{try{if(t.type===`directory`){let e=Oe(t),n=D.filter(t=>t.path.startsWith(`${e}/`));for(let e of n)await pe(e.path);g.startsWith(`${e}/`)&&$({},!0)}else await pe(t.cid),g===t.cid&&$({},!0);tt(null),await Q(),c(e(`note.toast.deleted`),`success`)}catch(t){c(await u(t,e(`note.toast.deleteFailed`)),`error`)}}})}async function St(){if(!l){m();return}if(!g||!z){c(e(`note.toast.notFound`),`error`);return}let t=I(He);if(!t){c(e(`note.toast.nameRequired`),`warning`);return}Xe(!0);try{let n=s.current?.getMarkdown()??qe,r=z.path;if(t!==z.name){r=f(z.directory?`${z.directory}/${t}`:t);let e=await S(z.path,r);B(e),V(F(e.name)),r=e.path}let i=await _e(r,n);B(i),V(F(i.name)),W(i.content),await Q(),$({file:i.path},!0),c(e(`note.toast.saved`),`success`)}catch(t){c(await u(t,e(`note.toast.saveFailed`)),`error`)}finally{Xe(!1)}}let Ct=(0,A.jsxs)(`div`,{className:`note-header-title`,children:[(0,A.jsx)(`h2`,{className:`header-title`,children:e(`note.title`)}),(0,A.jsx)(`span`,{children:e(`note.count`,{count:D.length})})]}),wt=(0,A.jsx)(`div`,{className:`note-theme-wrap`,children:(0,A.jsxs)(`button`,{className:`btn btn-sm`,onClick:ht,disabled:R,title:e(`note.vault.open`),"aria-label":e(`note.vault.open`),children:[(0,A.jsx)(v,{size:16}),e(R?`note.vault.opening`:`note.vault.open`)]})}),Tt=(0,A.jsxs)(`section`,{className:`note-list-panel note-sidebar-list`,"aria-label":e(`note.listLabel`),children:[(0,A.jsxs)(`div`,{className:`note-search`,children:[(0,A.jsx)(se,{size:16}),(0,A.jsx)(`input`,{className:`input input-flex`,value:L,onChange:e=>Ne(e.target.value),placeholder:e(`note.search.placeholder`)})]}),we?(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,A.jsx)(b,{size:32}),(0,A.jsx)(`p`,{children:e(`note.loading`)})]}):De?(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,A.jsx)(h,{size:32}),(0,A.jsx)(`p`,{children:De})]}):x?.configured===!0?st.length===0?(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,A.jsx)(b,{size:32}),(0,A.jsx)(`p`,{children:e(L?`note.empty.noMatches`:`note.vault.noFiles`)})]}):(0,A.jsx)(Ge,{nodes:st,searchQuery:L,expandedPaths:Ze,activeFileId:g,activeFolderPath:g?``:j,onToggleDirectory:ft,onOpenFile:dt,renderActions:t=>(0,A.jsx)(C,{ariaLabel:e(`common.moreActions`),className:`note-list-actions-anchor`,placement:`bottom-end`,items:[{key:`move`,label:e(`note.action.move`),icon:(0,A.jsx)(ye,{size:16}),onSelect:()=>yt(t)},{key:`delete`,label:e(`note.action.delete`),icon:(0,A.jsx)(ce,{size:16}),danger:!0,onSelect:()=>xt(t)}],renderTrigger:t=>(0,A.jsx)(`button`,{...t,className:`note-list-actions-trigger`,title:e(`common.moreActions`),"aria-label":e(`common.moreActions`),children:(0,A.jsx)(p,{size:16})})})}):(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,A.jsx)(v,{size:32}),(0,A.jsxs)(`button`,{className:`btn btn-primary`,onClick:ht,disabled:R,children:[(0,A.jsx)(v,{size:16}),e(R?`note.vault.opening`:`note.vault.open`)]})]}),x?.configured===!0&&(0,A.jsx)(`div`,{className:`note-create-btn`,children:(0,A.jsxs)(`button`,{className:`btn`,onClick:vt,children:[(0,A.jsx)(te,{size:16}),e(`note.newNote`)]})})]}),Et=z?.mtimeMs||Z?.updated_at||Date.now(),Dt=F(z?.name||Z?.name||``)||e(`note.untitled`);return(0,A.jsxs)(ae,{sidebar:()=>(0,A.jsx)(Se,{children:Tt}),headerTitle:Ct,headerRight:wt,children:[(0,A.jsx)(`main`,{className:`note-page note-browser-page ${_?`has-editor`:``}`,children:(0,A.jsx)(`section`,{className:`note-workspace`,children:(0,A.jsx)(`section`,{className:`note-editor-panel`,"aria-label":e(y?`note.editorLabel.edit`:`note.editorLabel.read`),children:_?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`note-editor-panel-header`,children:[(0,A.jsxs)(`div`,{className:`note-editor-title-area`,children:[y&&z?(0,A.jsx)(`input`,{className:`note-title-input`,value:He,onChange:e=>V(e.target.value),onKeyDown:e=>{if(e.key===`Enter`){e.currentTarget.blur();return}e.key===`Escape`&&(V(F(z.name)),e.currentTarget.blur())},placeholder:e(`note.namePlaceholder`),translate:`no`}):(0,A.jsx)(`h3`,{translate:`no`,children:Dt}),(0,A.jsxs)(`div`,{className:`note-editor-info`,children:[(0,A.jsx)(`span`,{children:e(y?`note.mode.edit`:`note.mode.read`)}),(0,A.jsx)(`span`,{translate:`no`,children:je(g)}),(0,A.jsx)(`span`,{children:t(Et)})]})]}),(0,A.jsxs)(`div`,{className:`note-editor-actions`,children:[(0,A.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:y?mt:()=>$(),title:e(y?`common.cancel`:`common.close`),"aria-label":e(y?`common.cancel`:`common.close`),children:(0,A.jsx)(de,{size:16})}),y?(0,A.jsxs)(`button`,{className:`btn btn-sm btn-primary`,onClick:St,disabled:Ye||!!q||!z,children:[(0,A.jsx)(oe,{size:16}),e(Ye?`note.action.saving`:`note.action.save`)]}):Z&&(0,A.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,onClick:pt,disabled:!!q||!z,title:e(`note.action.edit`),"aria-label":e(`note.action.edit`),children:[(0,A.jsx)(be,{size:16}),e(`note.action.edit`)]})]})]}),G?(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,A.jsx)(b,{size:36}),(0,A.jsx)(`p`,{children:e(`note.loading`)})]}):q?(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,A.jsx)(h,{size:36}),(0,A.jsx)(`p`,{children:q})]}):y?(0,A.jsx)(`div`,{className:`note-editor-frame editing`,children:(0,A.jsx)(Ce,{ref:s,content:qe,onChange:W,className:`milkdown-editor`})}):z?(0,A.jsx)(`div`,{className:`note-editor-frame reading`,children:(0,A.jsx)(Ce,{content:ct,readOnly:!0,onInternalNoteLinkOpen:ut,resolveWikiNoteLink:lt,className:`milkdown-editor`})}):(0,A.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,A.jsx)(b,{size:36}),(0,A.jsx)(`p`,{children:e(`note.error.notFound`)})]})]}):(0,A.jsxs)(`div`,{className:`ui-empty-state note-editor-empty`,children:[(0,A.jsx)(`div`,{className:`ui-empty-icon note-editor-empty-icon`,children:(0,A.jsx)(b,{size:32})}),(0,A.jsx)(`h3`,{className:`ui-empty-title`,children:x?.configured?e(`note.noOpen.title`):e(`note.vault.open`)}),(0,A.jsx)(`p`,{className:`ui-empty-desc`,children:x?.configured?e(`note.noOpen.select`):e(`note.vault.emptyPrompt`)}),x?.configured?(0,A.jsx)(ie,{label:e(`note.openList`),variant:`default`}):(0,A.jsxs)(`button`,{className:`btn btn-primary`,onClick:ht,disabled:R,children:[(0,A.jsx)(v,{size:16}),e(R?`note.vault.opening`:`note.vault.open`)]})]})})})}),J&&(0,A.jsx)(fe,{title:J.title,placeholder:J.placeholder,defaultValue:J.defaultValue,confirmText:J.confirmText,onConfirm:J.onConfirm,onClose:()=>$e(null)}),et&&(0,A.jsx)(ve,{title:et.title,message:et.message,confirmText:et.confirmText,danger:!0,onConfirm:et.onConfirm,onClose:()=>tt(null)}),Y&&(0,A.jsx)(xe,{target:Y,targetLabel:Re(Y),directories:at,onMove:bt,onClose:()=>nt(null)})]})}function q(){let{t:e}=le(),t=d(e=>e.hasBackend),n=a(e=>e.wallet),r=x(),i=t===!0&&qe(c()),o=W(i,n?.address||``),s=i&&(r||o);return(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(`div`,{className:`note-editor-loading`,children:e(`note.loading`)}),children:s?(0,A.jsx)(K,{}):(0,A.jsx)(G,{})})}var Je=o(`/note/`)({component:q});export{Je as Route};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),n=e(`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`}]]);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./jsx-runtime-Bt-cYkS5.js";import{B as t,L as n,z as r}from"./useAppStore-DOnk608w.js";import{t as i}from"./dayjs.min-Dcc0B6Je.js";var a=t(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),o=e(n(),1);i();var s=`0123456789abcdefghijklmnopqrstuvwxyz`,c=e=>{let t=[];for(;e>=128;)t.push(e&127|128),e>>=7;return t.push(e),t},l=e=>{let t=new Uint8Array([8,1,18,...c(e.length)]),n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},u=(e,t)=>{if(e.length===0)return``;let n=t.length,r=0;for(;r<e.length&&e[r]===0;)r++;let i=[0];for(let t=r;t<e.length;t++){let r=e[t];for(let e=0;e<i.length;e++){let t=i[e]*256+r;i[e]=t%n,r=Math.floor(t/n)}for(;r>0;)i.push(r%n),r=Math.floor(r/n)}let a=``;for(let e=0;e<r;e++)a+=t[0];for(let e=i.length-1;e>=0;e--)a+=t[i[e]];return a},d=(e,t)=>{let n=t.slice(2),i=new Uint8Array(r(e+n));return o.default.sign.keyPair.fromSecretKey(i)},f=(e,t)=>{let n=l(d(e,t).publicKey),r=new Uint8Array(2+n.length);r[0]=0,r[1]=36,r.set(n,2);let i=new Uint8Array([1,114]),a=new Uint8Array(i.length+r.length);return a.set(i,0),a.set(r,i.length),`k`+u(a,s)};export{f as n,a as r,d as t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ var e=`comment`,t=`string`,n=`symbol`,r=`atom`,i=`number`,a=`bracket`;function o(e){for(var t={},n=e.split(` `),r=0;r<n.length;++r)t[n[r]]=!0;return t}var s=o(`λ case-lambda call/cc class cond-expand define-class define-values exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax define-macro defmacro delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?`),c=o(`define let letrec let* lambda define-macro defmacro let-syntax letrec-syntax let-values let*-values define-syntax syntax-rules define-values when unless`);function l(e,t,n){this.indent=e,this.type=t,this.prev=n}function u(e,t,n){e.indentStack=new l(t,n,e.indentStack)}function d(e){e.indentStack=e.indentStack.prev}var f=new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i),p=new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i),m=new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i),h=new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);function g(e){return e.match(f)}function _(e){return e.match(p)}function v(e,t){return t===!0&&e.backUp(1),e.match(h)}function y(e){return e.match(m)}function b(e,t){for(var n,r=!1;(n=e.next())!=null;){if(n==t.token&&!r){t.state.mode=!1;break}r=!r&&n==`\\`}}var x={name:`scheme`,startState:function(){return{indentStack:null,indentation:0,mode:!1,sExprComment:!1,sExprQuote:!1}},token:function(o,l){if(l.indentStack==null&&o.sol()&&(l.indentation=o.indentation()),o.eatSpace())return null;var f=null;switch(l.mode){case`string`:b(o,{token:`"`,state:l}),f=t;break;case`symbol`:b(o,{token:`|`,state:l}),f=n;break;case`comment`:for(var p,m=!1;(p=o.next())!=null;){if(p==`#`&&m){l.mode=!1;break}m=p==`|`}f=e;break;case`s-expr-comment`:if(l.mode=!1,o.peek()==`(`||o.peek()==`[`)l.sExprComment=0;else{o.eatWhile(/[^\s\(\)\[\]]/),f=e;break}default:var h=o.next();if(h==`"`)l.mode=`string`,f=t;else if(h==`'`)o.peek()==`(`||o.peek()==`[`?(typeof l.sExprQuote!=`number`&&(l.sExprQuote=0),f=r):(o.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),f=r);else if(h==`|`)l.mode=`symbol`,f=n;else if(h==`#`)if(o.eat(`|`))l.mode=`comment`,f=e;else if(o.eat(/[tf]/i))f=r;else if(o.eat(`;`))l.mode=`s-expr-comment`,f=e;else{var x=null,S=!1,C=!0;o.eat(/[ei]/i)?S=!0:o.backUp(1),o.match(/^#b/i)?x=g:o.match(/^#o/i)?x=_:o.match(/^#x/i)?x=y:o.match(/^#d/i)?x=v:o.match(/^[-+0-9.]/,!1)?(C=!1,x=v):S||o.eat(`#`),x!=null&&(C&&!S&&o.match(/^#[ei]/i),x(o)&&(f=i))}else if(/^[-+0-9.]/.test(h)&&v(o,!0))f=i;else if(h==`;`)o.skipToEnd(),f=e;else if(h==`(`||h==`[`){for(var w=``,T=o.column(),E;(E=o.eat(/[^\s\(\[\;\)\]]/))!=null;)w+=E;w.length>0&&c.propertyIsEnumerable(w)?u(l,T+2,h):(o.eatSpace(),o.eol()||o.peek()==`;`?u(l,T+1,h):u(l,T+o.current().length,h)),o.backUp(o.current().length-1),typeof l.sExprComment==`number`&&l.sExprComment++,typeof l.sExprQuote==`number`&&l.sExprQuote++,f=a}else h==`)`||h==`]`?(f=a,l.indentStack!=null&&l.indentStack.type==(h==`)`?`(`:`[`)&&(d(l),typeof l.sExprComment==`number`&&--l.sExprComment==0&&(f=e,l.sExprComment=!1),typeof l.sExprQuote==`number`&&--l.sExprQuote==0&&(f=r,l.sExprQuote=!1))):(o.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/),f=s&&s.propertyIsEnumerable(o.current())?`builtin`:`variable`)}return typeof l.sExprComment==`number`?e:typeof l.sExprQuote==`number`?r:f},indent:function(e){return e.indentStack==null?e.indentation:e.indentStack.indent},languageData:{closeBrackets:{brackets:[`(`,`[`,`{`,`"`]},commentTokens:{line:`;;`}}};export{x as scheme};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),n=e(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]);export{t as n,n as t};
@@ -0,0 +1 @@
1
+ var e={addition:`inserted`,attributes:`propertyName`,bold:`strong`,cite:`keyword`,code:`monospace`,definitionList:`list`,deletion:`deleted`,div:`punctuation`,em:`emphasis`,footnote:`variable`,footCite:`qualifier`,header:`heading`,html:`comment`,image:`atom`,italic:`emphasis`,link:`link`,linkDefinition:`link`,list1:`list`,list2:`list.special`,list3:`list`,notextile:`string.special`,pre:`operator`,p:`content`,quote:`bracket`,span:`quote`,specialChar:`character`,strong:`strong`,sub:`content.special`,sup:`content.special`,table:`variableName.special`,tableHeading:`operator`};function t(e,t){t.mode=u.newLayout,t.tableHeading=!1,t.layoutType===`definitionList`&&t.spanningLayout&&e.match(l(`definitionListEnd`),!1)&&(t.spanningLayout=!1)}function n(t,n,a){if(a===`_`)return t.eat(`_`)?r(t,n,`italic`,/__/,2):r(t,n,`em`,/_/,1);if(a===`*`)return t.eat(`*`)?r(t,n,`bold`,/\*\*/,2):r(t,n,`strong`,/\*/,1);if(a===`[`)return t.match(/\d+\]/)&&(n.footCite=!0),i(n);if(a===`(`&&t.match(/^(r|tm|c)\)/))return e.specialChar;if(a===`<`&&t.match(/(\w+)[^>]+>[^<]+<\/\1>/))return e.html;if(a===`?`&&t.eat(`?`))return r(t,n,`cite`,/\?\?/,2);if(a===`=`&&t.eat(`=`))return r(t,n,`notextile`,/==/,2);if(a===`-`&&!t.eat(`-`))return r(t,n,`deletion`,/-/,1);if(a===`+`)return r(t,n,`addition`,/\+/,1);if(a===`~`)return r(t,n,`sub`,/~/,1);if(a===`^`)return r(t,n,`sup`,/\^/,1);if(a===`%`)return r(t,n,`span`,/%/,1);if(a===`@`)return r(t,n,`code`,/@/,1);if(a===`!`){var o=r(t,n,`image`,/(?:\([^\)]+\))?!/,1);return t.match(/^:\S+/),o}return i(n)}function r(e,t,n,r,a){var o=e.pos>a?e.string.charAt(e.pos-a-1):null,s=e.peek();if(t[n]){if((!s||/\W/.test(s))&&o&&/\S/.test(o)){var c=i(t);return t[n]=!1,c}}else(!o||/\W/.test(o))&&s&&/\S/.test(s)&&e.match(RegExp(`^.*\\S`+r.source+`(?:\\W|$)`),!1)&&(t[n]=!0,t.mode=u.attributes);return i(t)}function i(t){var n=a(t);if(n)return n;var r=[];return t.layoutType&&r.push(e[t.layoutType]),r=r.concat(o(t,`addition`,`bold`,`cite`,`code`,`deletion`,`em`,`footCite`,`image`,`italic`,`link`,`span`,`strong`,`sub`,`sup`,`table`,`tableHeading`)),t.layoutType===`header`&&r.push(e.header+`-`+t.header),r.length?r.join(` `):null}function a(t){var n=t.layoutType;switch(n){case`notextile`:case`code`:case`pre`:return e[n];default:return t.notextile?e.notextile+(n?` `+e[n]:``):null}}function o(t){for(var n=[],r=1;r<arguments.length;++r)t[arguments[r]]&&n.push(e[arguments[r]]);return n}function s(e){var t=e.spanningLayout,n=e.layoutType;for(var r in e)e.hasOwnProperty(r)&&delete e[r];e.mode=u.newLayout,t&&(e.layoutType=n,e.spanningLayout=!0)}var c={cache:{},single:{bc:`bc`,bq:`bq`,definitionList:/- .*?:=+/,definitionListEnd:/.*=:\s*$/,div:`div`,drawTable:/\|.*\|/,foot:/fn\d+/,header:/h[1-6]/,html:/\s*<(?:\/)?(\w+)(?:[^>]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:`notextile`,para:`p`,pre:`pre`,table:`table`,tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(e){switch(e){case`drawTable`:return c.makeRe(`^`,c.single.drawTable,`$`);case`html`:return c.makeRe(`^`,c.single.html,`(?:`,c.single.html,`)*`,`$`);case`linkDefinition`:return c.makeRe(`^`,c.single.linkDefinition,`$`);case`listLayout`:return c.makeRe(`^`,c.single.list,l(`allAttributes`),`*\\s+`);case`tableCellAttributes`:return c.makeRe(`^`,c.choiceRe(c.single.tableCellAttributes,l(`allAttributes`)),`+\\.`);case`type`:return c.makeRe(`^`,l(`allTypes`));case`typeLayout`:return c.makeRe(`^`,l(`allTypes`),l(`allAttributes`),`*\\.\\.?`,`(\\s+|$)`);case`attributes`:return c.makeRe(`^`,l(`allAttributes`),`+`);case`allTypes`:return c.choiceRe(c.single.div,c.single.foot,c.single.header,c.single.bc,c.single.bq,c.single.notextile,c.single.pre,c.single.table,c.single.para);case`allAttributes`:return c.choiceRe(c.attributes.selector,c.attributes.css,c.attributes.lang,c.attributes.align,c.attributes.pad);default:return c.makeRe(`^`,c.single[e])}},makeRe:function(){for(var e=``,t=0;t<arguments.length;++t){var n=arguments[t];e+=typeof n==`string`?n:n.source}return new RegExp(e)},choiceRe:function(){for(var e=[arguments[0]],t=1;t<arguments.length;++t)e[t*2-1]=`|`,e[t*2]=arguments[t];return e.unshift(`(?:`),e.push(`)`),c.makeRe.apply(null,e)}};function l(e){return c.cache[e]||(c.cache[e]=c.createRe(e))}var u={newLayout:function(e,t){if(e.match(l(`typeLayout`),!1))return t.spanningLayout=!1,(t.mode=u.blockType)(e,t);var n;return a(t)||(e.match(l(`listLayout`),!1)?n=u.list:e.match(l(`drawTable`),!1)?n=u.table:e.match(l(`linkDefinition`),!1)?n=u.linkDefinition:e.match(l(`definitionList`))?n=u.definitionList:e.match(l(`html`),!1)&&(n=u.html)),(t.mode=n||u.text)(e,t)},blockType:function(e,t){var n,r;if(t.layoutType=null,n=e.match(l(`type`)))r=n[0];else return(t.mode=u.text)(e,t);return(n=r.match(l(`header`)))?(t.layoutType=`header`,t.header=parseInt(n[0][1])):r.match(l(`bq`))?t.layoutType=`quote`:r.match(l(`bc`))?t.layoutType=`code`:r.match(l(`foot`))?t.layoutType=`footnote`:r.match(l(`notextile`))?t.layoutType=`notextile`:r.match(l(`pre`))?t.layoutType=`pre`:r.match(l(`div`))?t.layoutType=`div`:r.match(l(`table`))&&(t.layoutType=`table`),t.mode=u.attributes,i(t)},text:function(e,t){if(e.match(l(`text`)))return i(t);var r=e.next();return r===`"`?(t.mode=u.link)(e,t):n(e,t,r)},attributes:function(t,n){return n.mode=u.layoutLength,t.match(l(`attributes`))?e.attributes:i(n)},layoutLength:function(e,t){return e.eat(`.`)&&e.eat(`.`)&&(t.spanningLayout=!0),t.mode=u.text,i(t)},list:function(e,t){t.listDepth=e.match(l(`list`))[0].length;var n=(t.listDepth-1)%3;return n?n===1?t.layoutType=`list2`:t.layoutType=`list3`:t.layoutType=`list1`,t.mode=u.attributes,i(t)},link:function(t,n){return n.mode=u.text,t.match(l(`link`))?(t.match(/\S+/),e.link):i(n)},linkDefinition:function(t){return t.skipToEnd(),e.linkDefinition},definitionList:function(e,t){return e.match(l(`definitionList`)),t.layoutType=`definitionList`,e.match(/\s*$/)?t.spanningLayout=!0:t.mode=u.attributes,i(t)},html:function(t){return t.skipToEnd(),e.html},table:function(e,t){return t.layoutType=`table`,(t.mode=u.tableCell)(e,t)},tableCell:function(e,t){return e.match(l(`tableHeading`))?t.tableHeading=!0:e.eat(`|`),t.mode=u.tableCellAttributes,i(t)},tableCellAttributes:function(t,n){return n.mode=u.tableText,t.match(l(`tableCellAttributes`))?e.attributes:i(n)},tableText:function(e,t){return e.match(l(`tableText`))?i(t):e.peek()===`|`?(t.mode=u.tableCell,i(t)):n(e,t,e.next())}},d={name:`textile`,startState:function(){return{mode:u.newLayout}},token:function(e,n){return e.sol()&&t(e,n),n.mode(e,n)},blankLine:s};export{d as textile};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`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`}]]);export{t};