efficient-shell 7.70.0 → 7.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/{Browser-XDIOSJS4.js → Browser-5XJ3XNPZ.js} +14 -14
  2. package/dist/Calculator-GQGK6DO3.js +29 -0
  3. package/dist/ConfirmDialog-YVFPLUQH.js +1 -0
  4. package/dist/{CurrencyConverter-YEG2OFM7.js → CurrencyConverter-UPCIPOFS.js} +8 -8
  5. package/dist/{Documents-MRYWQZ6F.js → Documents-VNXTKUCK.js} +30 -30
  6. package/dist/Files-UROUCEP6.js +87 -0
  7. package/dist/{Notepad-PWMJWNUE.js → Notepad-NZNQ4LN5.js} +15 -15
  8. package/dist/PdfViewer-YELEO346.js +1 -0
  9. package/dist/{PomodoroTimer-7PWB2HLD.js → PomodoroTimer-JPWZ4DDT.js} +8 -8
  10. package/dist/{Preview-XMWD3UNB.js → Preview-Q46CQBXU.js} +56 -56
  11. package/dist/Sidebar-FS2PX6DU.js +43 -0
  12. package/dist/{Spreadsheet-M2KRJ7BF.js → Spreadsheet-2UFPQX3D.js} +14 -14
  13. package/dist/{Stock-EO7DOEEF.js → Stock-FRUP3BIN.js} +3 -3
  14. package/dist/{Weather-Y6E3HASC.js → Weather-MQOSCQQR.js} +16 -16
  15. package/dist/{WorldClock-HXGPRRQZ.js → WorldClock-7GQYAE4T.js} +6 -6
  16. package/dist/ai/index.js +18 -18
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/{chunk-RDLWLATO.js → chunk-3E27HV76.js} +2 -2
  20. package/dist/{chunk-BIR6UUSP.js → chunk-3NYPZO4K.js} +4 -4
  21. package/dist/{chunk-Q2A75VYD.js → chunk-43TOBCP4.js} +5 -5
  22. package/dist/{chunk-YSJA274H.js → chunk-5G76CZPP.js} +2 -2
  23. package/dist/{chunk-I7OLF2FL.js → chunk-5MCD5KGU.js} +8 -8
  24. package/dist/chunk-7FA25555.js +466 -0
  25. package/dist/{chunk-JVSFX53V.js → chunk-A5UR5LGU.js} +7 -7
  26. package/dist/chunk-A7XLRGZQ.js +1040 -0
  27. package/dist/chunk-EJ4RMSQB.js +1 -0
  28. package/dist/chunk-F6FTF37T.js +46 -0
  29. package/dist/chunk-G5GERM76.js +2 -0
  30. package/dist/{chunk-4EOL3HTG.js → chunk-IF3ZX46R.js} +13 -13
  31. package/dist/{chunk-XMSL2GJP.js → chunk-L5X6V677.js} +1 -1
  32. package/dist/{chunk-XA4APY3B.js → chunk-MY4HINJT.js} +1 -1
  33. package/dist/{chunk-2WZP2RMC.js → chunk-MYUJDXQC.js} +1 -1
  34. package/dist/chunk-N55MVC2J.js +1 -0
  35. package/dist/{chunk-PZ53QKHH.js → chunk-OKFO3XYS.js} +3 -3
  36. package/dist/{chunk-EU4BCXGA.js → chunk-RWNNFCSA.js} +1 -1
  37. package/dist/{chunk-4ZBKHQVW.js → chunk-RZHHSQDO.js} +13 -13
  38. package/dist/{chunk-WS3P7QXT.js → chunk-SBA7JZ72.js} +65 -65
  39. package/dist/{chunk-44BJ3XGZ.js → chunk-USHLHGAH.js} +8 -8
  40. package/dist/chunk-UULKUZAG.js +1 -0
  41. package/dist/{chunk-6I4ZV67D.js → chunk-VB2Q65XD.js} +2 -2
  42. package/dist/{chunk-CCCVRRC7.js → chunk-WLGJ7OCM.js} +1 -1
  43. package/dist/{chunk-YJIG2KT3.js → chunk-YIC644QO.js} +3 -3
  44. package/dist/format/index.d.ts +1 -1
  45. package/dist/format/index.js +1 -1
  46. package/dist/icons/efficient-glyphs.d.ts +486 -0
  47. package/dist/icons/efficient-glyphs.js +1 -0
  48. package/dist/icons/efficient-looks.d.ts +1007 -6
  49. package/dist/icons/efficient-looks.js +915 -915
  50. package/dist/icons/efficient-meanings.d.ts +425 -0
  51. package/dist/icons/efficient-meanings.js +1 -0
  52. package/dist/icons/efficient.d.ts +5 -897
  53. package/dist/icons/efficient.js +1 -466
  54. package/dist/{index-BpCIWxCw.d.ts → index-CZGuHIbF.d.ts} +2 -86
  55. package/dist/{index-CHufemKB.d.ts → index-aXJMK0gn.d.ts} +85 -1
  56. package/dist/index.d.ts +3 -3
  57. package/dist/index.js +274 -274
  58. package/dist/map/index.d.ts +9 -3
  59. package/dist/map/index.js +13 -13
  60. package/dist/map-site.css +4 -3
  61. package/dist/page-tabs/index.js +5 -5
  62. package/dist/pdf/index.js +1 -1
  63. package/dist/telemetry/index.js +1 -1
  64. package/dist/ui/index.d.ts +2 -2
  65. package/dist/ui/index.js +1 -1
  66. package/package.json +11 -1
  67. package/dist/Calculator-TTFPAPP7.js +0 -29
  68. package/dist/ConfirmDialog-JP35CDMP.js +0 -1
  69. package/dist/Files-MJPDM7I3.js +0 -87
  70. package/dist/PdfViewer-LALOZLBP.js +0 -1
  71. package/dist/Sidebar-NWSMRAIE.js +0 -43
  72. package/dist/chunk-6MZFPE5S.js +0 -1040
  73. package/dist/chunk-7AQUUDJL.js +0 -1
  74. package/dist/chunk-AA5RO6ER.js +0 -47
  75. package/dist/chunk-AP2QEJXQ.js +0 -1
  76. package/dist/chunk-DELNCIUK.js +0 -2
@@ -1,87 +0,0 @@
1
- import{openPreviewFile as e}from"./chunk-FFRODO6G.js";import{Breadcrumbs as t}from"./chunk-XMSL2GJP.js";import{SidebarLayout as a}from"./chunk-JVSFX53V.js";import"./chunk-6I4ZV67D.js";import{formatBytes as r}from"./chunk-W32SKK3D.js";import{getFilesDemoTree as n}from"./chunk-HCUSNRV3.js";import{AboutApp as s}from"./chunk-Q2A75VYD.js";import{peekFilesViewRequest as i,consumeFilesViewRequest as l,FILES_SHOW_TRASH_EVENT as o,FILES_OPEN_DESKTOP_FOLDER_EVENT as d,subscribeDesktopFolders as c,getDesktopFoldersSnapshot as m,FolderGlyph as h,DesktopItemMiniIcon as p,desktopItemTypeLabel as u}from"./chunk-I7JLCPEW.js";import"./chunk-ESL5TDNA.js";import"./chunk-VTVSMRFX.js";import{useWindowManager as f,WindowTitle as x}from"./chunk-WS3P7QXT.js";import"./chunk-TPDOOCFS.js";import"./chunk-PZ53QKHH.js";import{toast_default as g}from"./chunk-DAMBAXPA.js";import{TH_ONE_LINE as y}from"./chunk-4ZBKHQVW.js";import"./chunk-5A7MWTXX.js";import"./chunk-YJIG2KT3.js";import"./chunk-7AQUUDJL.js";import"./chunk-KNUR2UEG.js";import{confirm as b,prompt as k}from"./chunk-BIR6UUSP.js";import"./chunk-UVBK6YSR.js";import"./chunk-DELNCIUK.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import"./chunk-2EJRVQ3Y.js";import"./chunk-C3QOHMR6.js";import{LoadingSpinner as w}from"./chunk-2J6F4EE7.js";import{Icon as N}from"./chunk-76DRQSJM.js";import{useState as v,useEffect as $,useSyncExternalStore as j,useRef as C,useCallback as D}from"react";import{jsxs as L,jsx as E,Fragment as T}from"react/jsx-runtime";var R="undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000",S={pdf:"pdf",dxf:"dxf",csv:"csv",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",avif:"image",bmp:"image",stp:"3d",step:"3d",stl:"3d",obj:"3d",gltf:"3d",glb:"3d","3mf":"3d",iges:"3d",igs:"3d",ply:"3d",fbx:"3d"};function P(e,t){return"/"===e||""===e?"/"+t:e.replace(/\/$/,"")+"/"+t}function F(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?"—":t.toLocaleString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return e}}function I(){const I=R.replace(/\/$/,""),A=null!==n(),[O,U]=v("/"),[W,M]=v([]),[V,J]=v([]),[B,K]=v(null),[z,H]=v(!0),[Q,X]=v(!1),[_,G]=v(null),[Y,Z]=v(!1),[q,ee]=v(()=>{const e=i();return"trash"===e?"trash":e?{desktopFolderId:e.folderId}:"files"});$(()=>{l()},[]);const[te,ae]=v([]);$(()=>{const e=()=>{l(),ee("trash")},t=e=>{l();const t=e.detail?.folderId;t&&ee({desktopFolderId:t})};return window.addEventListener(o,e),window.addEventListener(d,t),()=>{window.removeEventListener(o,e),window.removeEventListener(d,t)}},[]);const re=j(c,m,m),ne="object"==typeof q?q.desktopFolderId:null,se=ne?re?.folders.find(e=>e.id===ne)??null:null,ie=ne&&re?.itemsByFolder[ne]||[];$(()=>{ne&&re&&!re.folders.some(e=>e.id===ne)&&ee("files")},[ne,re]);const le=C(0),oe=C(null),{openPage:de,openEntity:ce}=f(),me=t=>{"preview-file"===t.entityType&&t.filePath&&t.fileKind?e({filePath:t.filePath,filename:t.label,kind:t.fileKind,onStaged:e=>de(e)}):"page"===t.entityType?de(t.entityId):ce(t.entityType,t.entityId,null,t.label)},he=D((e,t={})=>fetch(e,{...t,credentials:"include"}),[]),pe=D(async()=>{try{const e=await he(`${I}/api/quota`);if(e.ok){const t=await e.json();G({used:t.used,limit:t.limit})}}catch{}},[he,I]),ue=D(async e=>{if(K(null),A){const t=function(e){const t=n();if(!t)return[];let a=t;for(const t of e.split("/").filter(Boolean)){const e=a.find(e=>"folder"===e.kind&&e.name===t);if(!e||!e.children)return[];a=e.children}return a.map(e=>({name:e.name,kind:e.kind,size:e.size??0,modifiedAt:e.modifiedAt??""}))}(e);return M(t),U(e),X(!1),H(!1),void("/"===e&&J(t.filter(e=>"folder"===e.kind).map(e=>e.name)))}H(!0);try{const t=await he(`${I}/api/files?path=${encodeURIComponent(e)}`);if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Failed to list (${t.status})`)}const a=await t.json(),r=a.entries||[];M(r),U(a.path||e),X(!1),"/"===(a.path||e)&&J(r.filter(e=>"folder"===e.kind).map(e=>e.name))}catch(e){X(!0)}finally{H(!1)}pe()},[he,I,pe,A]),fe=D(async()=>{if(A)return ae([]),void H(!1);H(!0),K(null);try{const e=await he(`${I}/api/trash`);if(!e.ok){const t=await e.json().catch(()=>({}));return void g.error(t.error||`Failed to list trash (${e.status})`)}const t=await e.json();ae(t.entries||[]),X(!1)}catch{X(!0)}finally{H(!1)}pe()},[he,I,pe,A]);$(()=>{"files"===q?ue(O):"trash"===q&&fe()},[O,q]);const xe=async e=>{const t=P(O,e.name);try{const a=await he(`${I}/api/file?path=${encodeURIComponent(t)}`);if(!a.ok)return void g.error(`Download failed (${a.status})`);const r=await a.blob(),n=URL.createObjectURL(r),s=document.createElement("a");s.href=n,s.download=e.name,s.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}catch(e){g.error(e?.message||"Download failed")}},ge=async e=>{const t=Array.from(e);for(const e of t){const t=new FormData;t.append("file",e);try{const a=await he(`${I}/api/upload?path=${encodeURIComponent(O)}`,{method:"POST",body:t});if(!a.ok){const t=await a.json().catch(()=>({}));if(413===a.status){const a=Math.max(0,(t.limit||0)-(t.used||0));g.error(`Quota exceeded — ${r(a)} free, ${e.name} is ${r(t.attempted||e.size)}`)}else g.error(`Upload ${e.name}: ${t.error||a.status}`)}}catch(t){g.error(`Upload ${e.name}: ${t?.message||"failed"}`)}}ue(O)},ye=()=>{le.current=0,Z(!1)};if($(()=>{const e=()=>ye();return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[]),Q)/* @__PURE__ */
2
- return L("div",{className:"flex flex-col h-full bg-white",children:[
3
- /* @__PURE__ */E(x,{title:"Files - offline"}),
4
- /* @__PURE__ */E("div",{className:"flex-1 flex items-center justify-center p-8 text-center",children:/* @__PURE__ */L("div",{className:"max-w-md",children:[
5
- /* @__PURE__ */E(N,{name:"close-circle",className:"h-12 w-12 mx-auto text-gray-300 mb-3",strokeWidth:1.4}),
6
- /* @__PURE__ */E("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:"Can't reach the file server"}),
7
- /* @__PURE__ */L("p",{className:"text-sm text-gray-500 mb-3",children:["No response from ",
8
- /* @__PURE__ */E("span",{className:"font-mono",children:I}),". Make sure the server is running — see ",
9
- /* @__PURE__ */E("span",{className:"font-mono",children:"examples/file-server/README.md"}),"."]}),
10
- /* @__PURE__ */E("button",{onClick:()=>ue(O),className:"px-3 h-8 text-sm bg-blue-500 text-white rounded hover:bg-blue-600",children:"Retry"})]})})]});const be="/"===O?[]:O.split("/").filter(Boolean),ke=_&&_.limit>0?Math.min(100,Math.round(_.used/_.limit*100)):0,we=ke>90?"bg-red-500":ke>75?"bg-amber-500":"bg-blue-500",Ne=[{label:"My files",onClick:()=>U("/")},...be.map((e,t)=>({label:e,onClick:()=>U("/"+be.slice(0,t+1).join("/"))}))],ve=e=>"flex w-full items-center gap-2 rounded-md px-3 min-h-(--row-height-menu) py-2 text-left text-sm transition-colors "+(e?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),$e=e=>/* @__PURE__ */E("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.6,children:/* @__PURE__ */E("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})}),je=/* @__PURE__ */L("nav",{className:"p-2",children:[
11
- /* @__PURE__ */E("div",{className:"px-2 py-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Locations"}),
12
- /* @__PURE__ */L("button",{onClick:()=>{ee("files"),U("/")},className:ve("files"===q&&"/"===O),children:[$e("M2.25 12l8.954-8.955a1.5 1.5 0 012.122 0L21.75 12M4.5 9.75v9.75a.75.75 0 00.75.75H9V15a.75.75 0 01.75-.75h4.5A.75.75 0 0115 15v5.25h3.75a.75.75 0 00.75-.75V9.75"),"My files"]}),V.map(e=>/* @__PURE__ */L("button",{onClick:()=>{ee("files"),U("/"+e)},className:ve("files"===q&&O==="/"+e),children:[$e("M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"),
13
- /* @__PURE__ */E("span",{className:"truncate",children:e})]},e)),!A&&/* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:ve("trash"===q),children:[$e("M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79"),"Trash"]}),re&&re.folders.length>0&&/* @__PURE__ */L(T,{children:[
14
- /* @__PURE__ */E("div",{className:"px-2 pt-3 pb-2 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:"Desktop"}),re.folders.map(e=>/* @__PURE__ */L("button",{onClick:()=>ee({desktopFolderId:e.id}),className:ve(ne===e.id),children:[
15
- /* @__PURE__ */E(h,{className:"h-4 w-4 shrink-0 text-amber-500"}),
16
- /* @__PURE__ */E("span",{className:"truncate",children:e.name}),e.itemCount>0&&/* @__PURE__ */E("span",{className:"ml-auto text-2xs text-gray-400 tabular-nums",children:e.itemCount})]},e.id))]})]});/* @__PURE__ */
17
- return L("div",{className:"relative flex flex-col h-full bg-white",onDragEnter:e=>{A||"object"==typeof q||e.dataTransfer?.types?.includes?.("Files")&&(e.preventDefault(),le.current++,Y||Z(!0))},onDragOver:e=>{e.dataTransfer?.types?.includes?.("Files")&&e.preventDefault()},onDragLeave:()=>{le.current>0&&le.current--,0===le.current&&Z(!1)},onDrop:e=>{e.preventDefault(),ye(),A||"object"==typeof q||e.dataTransfer.files?.length&&ge(e.dataTransfer.files)},children:[
18
- /* @__PURE__ */E(x,{title:se?`Files - ${se.name}`:"Files"+("/"===O?"":" - "+O)}),
19
- /* @__PURE__ */E(s,{app:"files"}),
20
- /* @__PURE__ */E("input",{ref:oe,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&ge(e.target.files),oe.current&&(oe.current.value="")}}),
21
- /* @__PURE__ */E("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */E(a,{sidebar:je,storageKey:"files.sidebarWidth",defaultWidth:200,minWidth:150,maxWidth:320,children:/* @__PURE__ */L("div",{className:"flex h-full min-w-0 flex-col",children:[
22
- /* @__PURE__ */L("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-gray-200 bg-gray-50 shrink-0 text-xs",children:[/* @__PURE__ */L(T,"files"===q?{children:[
23
- /* @__PURE__ */E("button",{onClick:()=>U(function(e){if("/"===e||""===e)return"/";const t=e.replace(/\/$/,""),a=t.lastIndexOf("/");return a<=0?"/":t.slice(0,a)}(O)),disabled:"/"===O,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",title:"Parent folder",children:/* @__PURE__ */E(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
24
- /* @__PURE__ */E("div",{className:"flex-1 min-w-0",children:/* @__PURE__ */E(t,{items:Ne,maxItems:5})}),
25
- /* @__PURE__ */E("button",{onClick:()=>ue(O),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),!A&&/* @__PURE__ */L(T,{children:[
26
- /* @__PURE__ */L("button",{onClick:()=>ee("trash"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",title:"Open trash",children:[
27
- /* @__PURE__ */E(N,{name:"trash",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Trash"]}),
28
- /* @__PURE__ */L("button",{onClick:async()=>{const e=await k({title:"New folder",placeholder:"Folder name",confirmLabel:"Create"});if(!e)return;if(/[\\/]/.test(e))return void g.error("Folder names cannot contain slashes");const t=P(O,e),a=await he(`${I}/api/folder`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!a.ok){const e=await a.json().catch(()=>({}));return void g.error(e.error||`Create folder failed (${a.status})`)}ue(O)},className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600 flex items-center gap-1",children:[
29
- /* @__PURE__ */E(N,{name:"folder-plus",className:"h-3.5 w-3.5",strokeWidth:1.5}),"New Folder"]}),
30
- /* @__PURE__ */L("button",{onClick:()=>oe.current?.click(),className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 flex items-center gap-1",children:[
31
- /* @__PURE__ */E(N,{name:"upload",className:"h-3.5 w-3.5",strokeWidth:1.8}),"Upload"]})]})]}:"trash"===q?{children:[
32
- /* @__PURE__ */E("button",{onClick:()=>ee("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
33
- /* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-2",children:"Trash"}),
34
- /* @__PURE__ */E("button",{onClick:fe,className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Refresh",children:/* @__PURE__ */E(N,{name:"refresh",className:"h-3.5 w-3.5",strokeWidth:1.8})}),
35
- /* @__PURE__ */E("button",{onClick:async()=>{if(0===te.length)return;if(!await b({title:"Empty trash",message:`${te.length} item${1===te.length?"":"s"} will be permanently removed. This can't be undone.`,confirmLabel:"Empty trash",variant:"danger"}))return;const e=await he(`${I}/api/trash`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));return void g.error(t.error||`Empty trash failed (${e.status})`)}fe()},disabled:0===te.length,className:"px-2 py-1 rounded text-red-600 hover:bg-red-50 disabled:opacity-30 flex items-center gap-1",children:"Empty trash"})]}:{children:[
36
- /* @__PURE__ */E("button",{onClick:()=>ee("files"),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-600",title:"Back to files",children:/* @__PURE__ */E(N,{name:"arrow-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
37
- /* @__PURE__ */E(h,{className:"h-4 w-4 text-amber-500 ml-1"}),
38
- /* @__PURE__ */E("span",{className:"flex-1 text-gray-700 font-medium px-1 truncate",children:se?.name??"Desktop folder"}),
39
- /* @__PURE__ */E("span",{className:"text-2xs text-gray-400 px-2",children:"Desktop shortcuts"})]}),_&&/* @__PURE__ */L(T,{children:[
40
- /* @__PURE__ */E("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
41
- /* @__PURE__ */L("div",{className:"flex items-center gap-2",title:`${r(_.used)} of ${r(_.limit)} used`,children:[
42
- /* @__PURE__ */E("div",{className:"w-20 h-1.5 rounded-full bg-gray-200 overflow-hidden",children:/* @__PURE__ */E("div",{className:`h-full ${we} transition-all`,style:{width:`${ke}%`}})}),
43
- /* @__PURE__ */L("span",{className:"text-2xs text-gray-500 tabular-nums whitespace-nowrap",children:[r(_.used)," / ",r(_.limit)]})]})]})]}),
44
- /* @__PURE__ */E("div",{className:"flex-1 overflow-auto",children:"object"==typeof q?0===ie.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"This desktop folder is empty. Drag shortcuts onto it on the desktop."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
45
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
46
- /* @__PURE__ */E("th",{className:`${y} text-left font-medium px-3 h-8`,children:"Name"}),
47
- /* @__PURE__ */E("th",{className:`${y} text-left font-medium px-3 h-8 w-28`,children:"Type"}),
48
- /* @__PURE__ */E("th",{className:`${y} w-56`})]})}),
49
- /* @__PURE__ */E("tbody",{children:ie.map(e=>{const t=`${e.entityType}|${e.entityId}`;/* @__PURE__ */
50
- return L("tr",{onClick:()=>K(t),onDoubleClick:()=>me(e),className:"cursor-default border-b border-gray-100 "+(B===t?"bg-blue-50":"hover:bg-gray-50"),children:[
51
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:[
52
- /* @__PURE__ */E(p,{item:e}),
53
- /* @__PURE__ */E("span",{className:"truncate",title:e.label,children:e.label})]}),
54
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-xs text-gray-500",children:u(e)}),
55
- /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
56
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),me(e)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Open"}),
57
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.moveToDesktop([e])},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Move to desktop"}),
58
- /* @__PURE__ */E("button",{onClick:t=>{t.stopPropagation(),re?.removeShortcuts([e])},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Remove"})]})]},t)})})]}):"trash"===q?z&&0===te.length?/* @__PURE__ */E(w,{size:"sm",padding:"p-6",label:"Loading"}):0===te.length?/* @__PURE__ */E("div",{className:"p-10 text-center text-sm text-gray-400",children:"Trash is empty."}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
59
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
60
- /* @__PURE__ */E("th",{className:`${y} text-left font-medium px-3 h-8`,children:"Name"}),
61
- /* @__PURE__ */E("th",{className:`${y} text-left font-medium px-3 h-8`,children:"Original location"}),
62
- /* @__PURE__ */E("th",{className:`${y} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
63
- /* @__PURE__ */E("th",{className:`${y} text-right font-medium px-3 h-8 w-40`,children:"Deleted"}),
64
- /* @__PURE__ */E("th",{className:`${y} w-44`})]})}),
65
- /* @__PURE__ */E("tbody",{children:te.map(e=>/* @__PURE__ */L("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[
66
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===e.kind?/* @__PURE__ */E(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(N,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
67
- /* @__PURE__ */E("span",{className:"truncate",title:e.name,children:e.name})]}),
68
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-gray-500 text-xs font-mono truncate",title:e.originalPath,children:e.originalPath||"—"}),
69
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:r(e.size)}),
70
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:e.deletedAt?F(e.deletedAt):"—"}),
71
- /* @__PURE__ */L("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:[
72
- /* @__PURE__ */E("button",{onClick:()=>(async e=>{const t=await he(`${I}/api/trash/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id})});if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Restore failed (${t.status})`)}g.success(`Restored "${e.name}"`),fe()})(e),className:"px-2 py-0.5 rounded hover:bg-gray-200 text-blue-600 text-2xs",children:"Restore"}),
73
- /* @__PURE__ */E("button",{onClick:()=>(async e=>{if(!await b({title:"Permanently delete",message:`"${e.name}" will be permanently removed. This can't be undone.`,confirmLabel:"Delete forever",variant:"danger"}))return;const t=await he(`${I}/api/trash/${encodeURIComponent(e.id)}`,{method:"DELETE"});if(!t.ok){const e=await t.json().catch(()=>({}));return void g.error(e.error||`Delete failed (${t.status})`)}fe()})(e),className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete forever"})]})]},e.id))})]}):z&&0===W.length?/* @__PURE__ */E(w,{size:"sm",padding:"p-6",label:"Loading"}):0===W.length?/* @__PURE__ */L("div",{className:"p-10 text-center text-sm text-gray-400",children:["Empty folder.",!A&&/* @__PURE__ */L(T,{children:[" Drop files here or click ",
74
- /* @__PURE__ */E("span",{className:"font-medium",children:"Upload"}),"."]})]}):/* @__PURE__ */L("table",{className:"w-full text-sm",children:[
75
- /* @__PURE__ */E("thead",{className:"bg-gray-50 text-2xs uppercase tracking-wide text-gray-500",children:/* @__PURE__ */L("tr",{children:[
76
- /* @__PURE__ */E("th",{className:`${y} text-left font-medium px-3 h-8`,children:"Name"}),
77
- /* @__PURE__ */E("th",{className:`${y} text-right font-medium px-3 h-8 w-24`,children:"Size"}),
78
- /* @__PURE__ */E("th",{className:`${y} text-right font-medium px-3 h-8 w-40`,children:"Modified"}),
79
- /* @__PURE__ */E("th",{className:`${y} w-32`})]})}),
80
- /* @__PURE__ */E("tbody",{children:W.map(t=>/* @__PURE__ */L("tr",{onClick:()=>K(t.name),onDoubleClick:()=>{"folder"===t.kind?U(P(O,t.name)):(async t=>{if(A)return;const a=P(O,t.name),r=(t.name.split(".").pop()||"").toLowerCase(),n=S[r];n?await e({filePath:a,filename:t.name,kind:n,onStaged:e=>de(e)}):xe(t)})(t)},className:"cursor-default border-b border-gray-100 "+(B===t.name?"bg-blue-50":"hover:bg-gray-50"),children:[
81
- /* @__PURE__ */L("td",{className:"px-3 h-8 flex items-center gap-2",children:["folder"===t.kind?/* @__PURE__ */E(N,{name:"folder",look:"solid",className:"h-4 w-4 text-amber-500 shrink-0"}):/* @__PURE__ */E(N,{name:"page",className:"h-4 w-4 text-gray-400 shrink-0",strokeWidth:1.5}),
82
- /* @__PURE__ */E("span",{className:"truncate",title:t.name,children:t.name})]}),
83
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right tabular-nums text-gray-500",children:"folder"===t.kind?"—":r(t.size)}),
84
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right text-gray-500 tabular-nums",children:F(t.modifiedAt)}),
85
- /* @__PURE__ */E("td",{className:"px-3 h-8 text-right whitespace-nowrap",children:!A&&/* @__PURE__ */L(T,{children:["file"===t.kind&&/* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),xe(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs",children:"Download"}),
86
- /* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{const t=await k({title:`Rename ${e.kind}`,defaultValue:e.name,confirmLabel:"Rename"});if(!t||t===e.name)return;if(/[\\/]/.test(t))return void g.error("Names cannot contain slashes");const a=P(O,e.name),r=P(O,t),n=await he(`${I}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:a,to:r})});if(!n.ok){const e=await n.json().catch(()=>({}));return void g.error(e.error||`Rename failed (${n.status})`)}ue(O)})(t)},className:"px-2 py-0.5 rounded hover:bg-gray-200 text-gray-500 text-2xs ml-1",children:"Rename"}),
87
- /* @__PURE__ */E("button",{onClick:e=>{e.stopPropagation(),(async e=>{if(!await b({title:`Delete ${e.kind}`,message:`"${e.name}"${"folder"===e.kind?" and everything inside":""} will be permanently removed.`,confirmLabel:"Delete",variant:"danger"}))return;const t=P(O,e.name),a=await he(`${I}/api/files?path=${encodeURIComponent(t)}`,{method:"DELETE"});if(!a.ok){const e=await a.json().catch(()=>({}));return void g.error(e.error||`Delete failed (${a.status})`)}ue(O)})(t)},className:"px-2 py-0.5 rounded hover:bg-red-100 text-red-600 text-2xs ml-1",children:"Delete"})]})})]},t.name))})]})})]})})}),Y&&/* @__PURE__ */E("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */E("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop to upload"})})]})}export{I as default};
@@ -1 +0,0 @@
1
- export{PdfViewer as default,fitScale,pdfWasmParams}from"./chunk-I7OLF2FL.js";import"./chunk-DAMBAXPA.js";import"./chunk-K7PQXJO7.js";import"./chunk-2EJRVQ3Y.js";import"./chunk-C3QOHMR6.js";import"./chunk-2J6F4EE7.js";import"./chunk-76DRQSJM.js";
@@ -1,43 +0,0 @@
1
- import{useAuth as e,parseOpenSections as t,readStored as a,RAIL_OPEN_SECTIONS_KEY as r,RAIL_WIDTH_KEY as n,toggleOpenSection as i,writeStored as l}from"./chunk-I74FRKHQ.js";import{partitionNav as o,openGlobalSearch as s,flyoutGroups as c,visibleSectionItems as d,rowsContainRoute as m,visibleNavChildren as h,BrandMark as u}from"./chunk-2ZRX3NRH.js";import{ResizeHandle as p}from"./chunk-6I4ZV67D.js";import{IconButton_default as b}from"./chunk-EU4BCXGA.js";import{RAIL_MENU_GAP as g,navSections as f,startMenuCategories as y,TAB_STRIP_H as x,RAIL_COLLAPSED_INSET as v,RAIL_W as k,RAIL_MAX_W as N,RAIL_MIN_W as C,navIcons as w,sectionIcons as j}from"./chunk-TPDOOCFS.js";import"./chunk-5A7MWTXX.js";import{PopupMenu as S,PopupMenuItem as z,PopupMenuDivider as L,PopupMenuLabel as $}from"./chunk-YJIG2KT3.js";import"./chunk-UVBK6YSR.js";import"./chunk-RDLWLATO.js";import"./chunk-7IQ3B77H.js";import"./chunk-D65T4H6J.js";import"./chunk-FIEA5CGB.js";import"./chunk-K7PQXJO7.js";import{useShellStrings as A}from"./chunk-2EJRVQ3Y.js";import"./chunk-C3QOHMR6.js";import"./chunk-2J6F4EE7.js";import{Icon as I}from"./chunk-76DRQSJM.js";import{useMemo as R,useState as W,useRef as H,useEffect as K,isValidElement as T,cloneElement as M}from"react";import{jsx as B,jsxs as O,Fragment as D}from"react/jsx-runtime";var J="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform);function Q(e,t,a){const r=Math.max(8,a-t.bottom);return{left:e+g,bottom:r,maxHeight:a-r-8,overflowY:"auto"}}var _=(e,t)=>["flex h-(--row-height-menu) w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium transition-colors",t?"justify-center px-0":"",e?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-100 hover:text-gray-900"].join(" "),E="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function P({open:e}){/* @__PURE__ */
2
- return B(I,{name:"chevron-down",className:"size-4 shrink-0 transition-transform "+(e?"rotate-180":""),strokeWidth:2,"aria-hidden":"true"})}function X({dir:e}){/* @__PURE__ */
3
- return B(I,"left"===e?{name:"chevron-double-left",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"}:{name:"chevron-double-right",className:"size-[18px] shrink-0",strokeWidth:1.5,"aria-hidden":"true"})}function F({className:e}){/* @__PURE__ */
4
- return B(I,{name:"search",className:e,strokeWidth:2,"aria-hidden":"true"})}var Y=e=>.75+1.75*e+"rem";function G({width:G,collapsed:U,onToggleCollapsed:V,onResize:Z,onHome:q,onOpen:ee,activeRoute:te,profile:ae,user:re,onLogout:ne,onSwitchToDesktop:ie,onReportBug:le,onClose:oe,navSections:se=f,navIcons:ce=w,sectionIcons:de=j,categories:me=y,productName:he,productIcon:ue,tagline:pe,adaptiveLogo:be=!1,logoHasAlpha:ge=null,logoIsLight:fe=null}){const ye=A().layout,{hasAnyPerm:xe}=e(),ve=R(()=>o(se,me,xe),[se,me,xe]),[ke,Ne]=W(()=>t(a(r))),Ce=e=>Ne(t=>{const a=i(t,e);return l(r,JSON.stringify([...a])),a}),[we,je]=W(null),[Se,ze]=W(!1),Le=H(null);K(()=>{U||je(null)},[U]);const $e=(e,t)=>{je(null),e.onSelect?e.onSelect():ee(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},Ae=(e,t)=>{const a=t[e];/* @__PURE__ */
5
- return B("span",{className:E,"aria-hidden":"true",children:a&&T(a)?M(a,{className:"size-[18px]"}):a})},Ie=(e,t)=>{const a=h(e,xe),r=e.menuLabel??e.label;if(a.length>0){const n=`child:${e.to}`,i=ke.has(n),l=!i&&m(a,te,xe);/* @__PURE__ */
6
- return O("div",{children:[
7
- /* @__PURE__ */O("button",{type:"button",onClick:()=>Ce(n),"aria-expanded":i,className:_(l,!1),style:t>0?{paddingLeft:Y(t)}:void 0,children:[0===t&&Ae(e.to,ce),
8
- /* @__PURE__ */B("span",{className:"min-w-0 flex-1 truncate",children:r}),
9
- /* @__PURE__ */B(P,{open:i})]}),i&&/* @__PURE__ */B("div",{className:"space-y-0.5 pt-0.5",children:a.map(e=>Ie(e,t+1))}),e.dividerAfter&&/* @__PURE__ */B("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Y(t)},"aria-hidden":"true"})]},e.to)}const n=e.to===te;/* @__PURE__ */
10
- return O("div",{children:[
11
- /* @__PURE__ */O("button",{type:"button",onClick:t=>$e(e,t),onAuxClick:t=>{1===t.button&&$e(e,t)},"aria-current":n?"page":void 0,className:_(n,!1),style:t>0?{paddingLeft:Y(t)}:void 0,children:[0===t&&Ae(e.to,ce),
12
- /* @__PURE__ */B("span",{className:"min-w-0 flex-1 truncate",children:r})]}),e.dividerAfter&&/* @__PURE__ */B("div",{className:"mx-2 my-2 border-t border-gray-200",style:{marginLeft:Y(t)},"aria-hidden":"true"})]},e.to)},Re=(e,t)=>{const a=t?e.items:d(e,xe);if(0===a.length)return null;const r="icon"in e&&e.icon?/* @__PURE__ */B("span",{className:E,"aria-hidden":"true",children:e.icon}):Ae(e.label,de),n=e.menuLabel??e.label,i=m(a,te,xe),l="dividerAfter"in e&&e.dividerAfter;if(U)/* @__PURE__ */
13
- return O("div",{children:[
14
- /* @__PURE__ */B("button",{type:"button",title:n,"aria-label":n,"aria-haspopup":"menu","aria-expanded":we?.label===e.label,onClick:t=>{const r=t.currentTarget.getBoundingClientRect();je(t=>t?.label===e.label?null:{label:e.label,items:a,top:r.top})},className:_(i||we?.label===e.label,!0),children:r}),l&&/* @__PURE__ */B("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"})]},e.label);const o=ke.has(e.label),s=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
15
- return O("div",{children:[
16
- /* @__PURE__ */O("button",{type:"button",onClick:()=>Ce(e.label),"aria-expanded":o,"aria-controls":s,className:_(!o&&i,!1),children:[r,
17
- /* @__PURE__ */B("span",{className:"min-w-0 flex-1 truncate",children:n}),
18
- /* @__PURE__ */B(P,{open:o})]}),
19
- /* @__PURE__ */B("div",{id:s,role:"group","aria-label":n,hidden:!o,className:"space-y-0.5 pt-0.5",children:o&&a.map(e=>Ie(e,1))}),l&&/* @__PURE__ */B("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"})]},e.label)},We=ae?.first_name?`${ae.first_name} ${ae.last_name||""}`.trim():re?.email||"",He=(ae?.first_name?.charAt(0)||re?.email?.charAt(0)||"?").toUpperCase(),Ke=ae?.avatar_url?/* @__PURE__ */B("img",{src:ae.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */B("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:He}),Te=Se?Le.current?.getBoundingClientRect():void 0,Me=U?"":"px-3",Be=U?{paddingInline:v}:void 0,Oe=`${U?ye.expandSidebar:ye.collapseSidebar} (${J?"⌘":"Ctrl"} .)`,De=q?{run:q,label:ye.goHome,title:ye.goHome}:oe?null:{run:V,label:U?ye.expandSidebar:ye.collapseSidebar,title:Oe},Je=/* @__PURE__ */O(D,{children:[ue&&/* @__PURE__ */B(u,{src:ue,alt:"",slot:"compact",surface:"light",adaptive:be,hasAlpha:ge,isLight:fe,size:28,decorative:!0}),!U&&/* @__PURE__ */O("span",{className:"min-w-0 text-left leading-tight",children:[
20
- /* @__PURE__ */B("span",{className:"block truncate text-base font-bold tracking-wide text-gray-900",children:he??"Apps"}),pe&&/* @__PURE__ */B("span",{className:"block truncate text-2xs font-medium text-gray-500",children:pe})]})]}),Qe=ve.erpSections.length>0||ve.systemSections.length>0||ve.virtualSections.length>0;/* @__PURE__ */
21
- return O("aside",{"aria-label":ye.navLabel,className:"fixed left-0 top-0 z-(--z-sidebar) flex h-dvh flex-col border-r border-gray-200 bg-white text-gray-800",style:{width:G},children:[
22
- /* @__PURE__ */O("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(U?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:x},children:[De?/* @__PURE__ */B("button",{type:"button",onClick:De.run,"aria-label":De.label,title:De.title,className:"flex min-w-0 items-center gap-2 rounded-md transition-colors hover:bg-gray-100 "+(U?"justify-center p-0.5":"-ml-1 p-1"),children:Je}):/* @__PURE__ */B("span",{className:"flex min-w-0 items-center gap-2",children:Je}),oe?/* @__PURE__ */B(b,{onClick:oe,"aria-label":ye.closeMenu,children:/* @__PURE__ */B(I,{name:"close",className:"size-[18px]",strokeWidth:1.5,"aria-hidden":"true"})}):!U&&/* @__PURE__ */B("button",{type:"button",onClick:V,"aria-label":ye.collapseSidebar,title:`${ye.collapseSidebar} (${J?"⌘":"Ctrl"} .)`,className:"flex size-8 shrink-0 items-center justify-center rounded-md text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900",children:/* @__PURE__ */B(X,{dir:"left"})})]}),
23
- /* @__PURE__ */B("div",{className:`shrink-0 pt-3 ${Me}`,style:Be,children:U?/* @__PURE__ */B("button",{type:"button",onClick:s,"aria-label":ye.search,title:`${ye.search} (${J?"⌘K":"Ctrl K"})`,className:_(!1,!0),children:/* @__PURE__ */B(F,{className:"size-[18px] shrink-0"})}):/* @__PURE__ */O("button",{type:"button",onClick:s,className:"flex h-(--row-height-menu) w-full items-center gap-2 rounded-md border border-gray-200 bg-white px-3 text-left transition-colors hover:bg-gray-100",children:[
24
- /* @__PURE__ */B(F,{className:"size-3.5 text-gray-500"}),
25
- /* @__PURE__ */B("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-500",children:ye.search}),
26
- /* @__PURE__ */B("kbd",{className:"rounded border border-gray-200 bg-gray-100 px-2 py-0.5 font-mono text-2xs font-semibold text-gray-500",children:J?"⌘K":"Ctrl K"})]})}),
27
- /* @__PURE__ */O("nav",{"aria-label":ye.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${Me} ${U?"space-y-1":"space-y-0.5"}`,style:Be,children:[U&&/* @__PURE__ */B("button",{type:"button",onClick:V,"aria-label":ye.expandSidebar,title:`${ye.expandSidebar} (${J?"⌘":"Ctrl"} .)`,className:`${_(!1,!0)} mb-3`,children:/* @__PURE__ */B(X,{dir:"right"})}),ve.topItems.map(e=>{if(!U)return Ie(e,0);const t=h(e,xe),a=e.to===te||m(t,te,xe),r=e.menuLabel??e.label;/* @__PURE__ */
28
- return O("div",{children:[
29
- /* @__PURE__ */B("button",{type:"button",title:r,"aria-label":r,onClick:a=>{if(0===t.length)return void $e(e,a);const r=a.currentTarget.getBoundingClientRect();je(a=>a?.label===e.to?null:{label:e.to,items:t,top:r.top})},className:_(a,!0),children:Ae(e.to,ce)}),e.dividerAfter&&/* @__PURE__ */B("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"})]},e.to)}),ve.topItems.length>0&&Qe&&!ve.topItems[ve.topItems.length-1].dividerAfter&&/* @__PURE__ */B("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"}),ve.erpSections.map(e=>Re(e,!1)),ve.systemSections.map(e=>Re(e,!1)),ve.virtualSections.map(e=>Re(e,!0)),ve.footerSections.length>0&&/* @__PURE__ */B("div",{className:"mx-2 my-2 border-t border-gray-200","aria-hidden":"true"}),ve.footerSections.map(e=>Re(e,!1))]}),
30
- /* @__PURE__ */B("div",{className:`shrink-0 border-t border-gray-200 py-2 ${Me}`,style:Be,children:/* @__PURE__ */O("button",{ref:Le,type:"button",onClick:()=>ze(e=>!e),"aria-haspopup":"menu","aria-expanded":Se,"aria-label":U?ye.accountMenu(We):void 0,className:"flex w-full items-center gap-3 rounded-md hover:bg-gray-100 "+(U?"justify-center py-2":"px-2 py-2"),children:[Ke,!U&&/* @__PURE__ */O("span",{className:"min-w-0 flex-1 text-left",children:[
31
- /* @__PURE__ */B("span",{className:"block truncate text-sm font-semibold text-gray-800",children:We}),re?.email&&We!==re.email&&/* @__PURE__ */B("span",{className:"block truncate text-2xs text-gray-500",children:re.email})]})]})}),Z&&!U&&!oe&&/* @__PURE__ */B(p,{side:"left",width:G,onResize:Z,min:C,max:N,defaultWidth:k,storageKey:n,label:ye.resizeSidebar}),Se&&Te&&/* @__PURE__ */O(S,{portal:!0,minWidth:224,onClose:()=>ze(!1),style:Q(G,Te,window.innerHeight),children:[U&&/* @__PURE__ */O("div",{className:"border-b border-gray-200 px-3 py-3",children:[
32
- /* @__PURE__ */B("p",{className:"truncate text-sm font-semibold text-gray-800",children:We}),re?.email&&/* @__PURE__ */B("p",{className:"truncate text-xs text-gray-500",children:re.email})]}),
33
- /* @__PURE__ */O(z,{onClick:()=>{ze(!1),ee("/profile",!1)},children:[
34
- /* @__PURE__ */B(I,{name:"account",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ye.profile]}),ve.footerItems.map(e=>/* @__PURE__ */O(z,{onClick:()=>{ze(!1),$e(e)},children:[
35
- /* @__PURE__ */B("span",{className:"h-4 w-4 [&>svg]:size-4","aria-hidden":"true",children:ce[e.to]}),e.menuLabel??e.label]},e.to)),le&&/* @__PURE__ */O(z,{onClick:()=>{ze(!1),le()},children:[
36
- /* @__PURE__ */B(I,{name:"error",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ye.reportIssue]}),
37
- /* @__PURE__ */B(L,{}),ie&&/* @__PURE__ */O(D,{children:[
38
- /* @__PURE__ */O(z,{onClick:()=>{ze(!1),ie()},children:[
39
- /* @__PURE__ */B(I,{name:"desktop",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ye.switchToDesktop]}),
40
- /* @__PURE__ */B(L,{})]}),
41
- /* @__PURE__ */O(z,{danger:!0,onClick:()=>{ze(!1),ne()},children:[
42
- /* @__PURE__ */B(I,{name:"logout",className:"h-4 w-4",strokeWidth:1.5,"aria-hidden":"true"}),ye.signOut]})]}),we&&U&&/* @__PURE__ */B(S,{portal:!0,minWidth:220,onClose:()=>je(null),style:{left:G+g,top:Math.min(we.top,window.innerHeight-48*Math.min(we.items.length,10)-16)},children:c(we.items,xe).map((e,t)=>/* @__PURE__ */O("div",{role:e.heading?"group":void 0,"aria-label":e.heading?e.heading.menuLabel??e.heading.label:void 0,children:[t>0&&/* @__PURE__ */B(L,{}),e.heading&&/* @__PURE__ */B($,{children:e.heading.menuLabel??e.heading.label}),e.items.map(e=>/* @__PURE__ */O(z,{onClick:()=>$e(e),children:[Ae(e.to,ce),
43
- /* @__PURE__ */B("span",{className:e.to===te?"font-semibold":"",children:e.menuLabel??e.label})]},e.to))]},e.heading?.to??`run-${t}`))})]})}export{Q as accountMenuPosition,G as default};