efficient-shell 4.156.1 → 4.159.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 (42) hide show
  1. package/README.md +29 -4
  2. package/dist/{Browser-WBZPCS6W.js → Browser-OQCHLKM3.js} +12 -12
  3. package/dist/{Calculator-5DF4PSEG.js → Calculator-YBL65JNM.js} +22 -22
  4. package/dist/{CurrencyConverter-BEI6UUDD.js → CurrencyConverter-6VFY4GF6.js} +7 -7
  5. package/dist/{Documents-5WGBDLTF.js → Documents-IPXRU4CT.js} +5 -5
  6. package/dist/Files-3MGL4ZT7.js +89 -0
  7. package/dist/Notepad-RJ2DYW2O.js +25 -0
  8. package/dist/{PomodoroTimer-3BDFGHC6.js → PomodoroTimer-6OQ33FY3.js} +26 -26
  9. package/dist/{Preview-O52DJFV6.js → Preview-3WRPZWDU.js} +14 -14
  10. package/dist/{Sidebar-H6R3AK5G.js → Sidebar-FUPFF7BT.js} +23 -23
  11. package/dist/{Spreadsheet-7PMGYBO6.js → Spreadsheet-6NK53IZV.js} +13 -13
  12. package/dist/{Stock-PEZB3WXV.js → Stock-ZFLDG6TT.js} +3 -3
  13. package/dist/{Weather-6EJFJQIX.js → Weather-BBPTXGQA.js} +17 -17
  14. package/dist/{WorldClock-5BMGEL2A.js → WorldClock-CQGQ2Y6N.js} +6 -6
  15. package/dist/apps/index.js +1 -1
  16. package/dist/brand.css +1 -1
  17. package/dist/{chunk-ELCH5NDO.js → chunk-CK245P3T.js} +4 -4
  18. package/dist/{chunk-XC64WV33.js → chunk-DLD4AKVT.js} +36 -36
  19. package/dist/{chunk-5DVD4E4P.js → chunk-EI4WZOP3.js} +1 -1
  20. package/dist/chunk-J7AAGG7P.js +942 -0
  21. package/dist/chunk-L4KRS7N3.js +1 -0
  22. package/dist/{chunk-DRN636EP.js → chunk-M4AKWGQM.js} +1 -1
  23. package/dist/chunk-S2AZZGFF.js +1 -0
  24. package/dist/chunk-VNEH2Y6H.js +9 -0
  25. package/dist/{chunk-LGDG4YMF.js → chunk-VRW5JNMR.js} +6 -6
  26. package/dist/{chunk-KAESEFKM.js → chunk-Z3LPT4HB.js} +1 -1
  27. package/dist/format/index.d.ts +1 -0
  28. package/dist/format/index.js +1 -0
  29. package/dist/{index-C-inEe7F.d.ts → index-D0K5U1Pb.d.ts} +80 -49
  30. package/dist/index-DCUzlKPZ.d.ts +194 -0
  31. package/dist/index.d.ts +3 -2
  32. package/dist/index.js +645 -645
  33. package/dist/page-tabs/index.js +5 -5
  34. package/dist/ui/index.d.ts +2 -1
  35. package/dist/ui/index.js +1 -1
  36. package/dist/ui.css +7 -0
  37. package/package.json +6 -1
  38. package/dist/Files-62DPJ4NN.js +0 -89
  39. package/dist/Notepad-U67M72JS.js +0 -25
  40. package/dist/chunk-ESXQJ7YI.js +0 -934
  41. package/dist/chunk-J7LKJIZC.js +0 -9
  42. package/dist/chunk-O5BOGWO3.js +0 -1
@@ -1,44 +1,44 @@
1
- import{useAuth as e,partitionNav as t,parseOpenSections as r,readStored as a,RAIL_OPEN_SECTIONS_KEY as n,visibleNavChildren as i,visibleSectionItems as l,rowsContainRoute as o,toggleOpenSection as s,writeStored as c}from"./chunk-MVLIXV7C.js";import{BrandMark as d,openGlobalSearch as m}from"./chunk-ELCH5NDO.js";import{navSections as h,startMenuCategories as u,TAB_STRIP_H as p,navIcons as b,sectionIcons as g}from"./chunk-6UXY7MPY.js";import{PopupMenu as x,PopupMenuItem as f,PopupMenuDivider as y}from"./chunk-J7LKJIZC.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import{useShellStrings as v}from"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useMemo as k,useState as N,useRef as C,useEffect as w,isValidElement as L,cloneElement as j}from"react";import{jsx as A,jsxs as z}from"react/jsx-runtime";var S="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),M=(e,t)=>["flex h-9 w-full items-center gap-2.5 rounded-md px-3 text-left text-[13.5px] 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(" "),$="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function B({open:e}){/* @__PURE__ */
2
- return A("svg",{className:"size-4 shrink-0 text-gray-400 transition-transform "+(e?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})}function I({dir:e}){/* @__PURE__ */
3
- return A("svg",{className:"size-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"left"===e?"M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5":"M5.25 4.5l7.5 7.5-7.5 7.5m6-15l7.5 7.5-7.5 7.5"})})}function V({className:e}){/* @__PURE__ */
4
- return A("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})})}function H({width:H,collapsed:W,onToggleCollapsed:K,onOpen:T,activeRoute:_,profile:D,user:J,onLogout:O,onSwitchToDesktop:R,onReportBug:P,navSections:X=h,navIcons:U=b,sectionIcons:Y=g,categories:E=u,productName:F,productIcon:Z,tagline:q,adaptiveLogo:G=!1,logoHasAlpha:Q=null,logoIsLight:ee=null}){const te=v().layout,{hasAnyPerm:re}=e(),ae=k(()=>t(X,E,re),[X,E,re]),[ne,ie]=N(()=>r(a(n))),le=e=>ie(t=>{const r=s(t,e);return c(n,JSON.stringify([...r])),r}),[oe,se]=N(null),[ce,de]=N(!1),me=C(null);w(()=>{W||se(null)},[W]);const he=(e,t)=>{se(null),e.onSelect?e.onSelect():T(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},ue=(e,t)=>{const r=t[e];/* @__PURE__ */
1
+ import{useAuth as e,partitionNav as t,parseOpenSections as r,readStored as a,RAIL_OPEN_SECTIONS_KEY as n,visibleNavChildren as i,visibleSectionItems as l,rowsContainRoute as o,toggleOpenSection as s,writeStored as c}from"./chunk-MVLIXV7C.js";import{BrandMark as d,openGlobalSearch as m}from"./chunk-CK245P3T.js";import{navSections as h,startMenuCategories as u,TAB_STRIP_H as p,navIcons as b,sectionIcons as g}from"./chunk-6UXY7MPY.js";import{PopupMenu as x,PopupMenuItem as f,PopupMenuDivider as y}from"./chunk-VNEH2Y6H.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import{useShellStrings as v}from"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useMemo as k,useState as N,useRef as C,useEffect as w,isValidElement as L,cloneElement as j}from"react";import{jsx as A,jsxs as z}from"react/jsx-runtime";var S="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),M=(e,t)=>["flex h-9 w-full items-center gap-2.5 rounded-md px-3 text-left text-[13.5px] 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(" "),$="flex size-[18px] shrink-0 items-center justify-center [&>svg]:size-[18px]";function B({open:e}){/* @__PURE__ */
2
+ return A("svg",{className:"size-4 shrink-0 text-gray-400 transition-transform "+(e?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})}function V({dir:e}){/* @__PURE__ */
3
+ return A("svg",{className:"size-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"left"===e?"M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5":"M5.25 4.5l7.5 7.5-7.5 7.5m6-15l7.5 7.5-7.5 7.5"})})}function H({className:e}){/* @__PURE__ */
4
+ return A("svg",{className:e,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})})}function I({width:I,collapsed:W,onToggleCollapsed:T,onOpen:K,activeRoute:_,profile:P,user:R,onLogout:D,onSwitchToDesktop:O,onReportBug:J,navSections:X=h,navIcons:Y=b,sectionIcons:U=g,categories:E=u,productName:F,productIcon:q,tagline:G,adaptiveLogo:Q=!1,logoHasAlpha:Z=null,logoIsLight:ee=null}){const te=v().layout,{hasAnyPerm:re}=e(),ae=k(()=>t(X,E,re),[X,E,re]),[ne,ie]=N(()=>r(a(n))),le=e=>ie(t=>{const r=s(t,e);return c(n,JSON.stringify([...r])),r}),[oe,se]=N(null),[ce,de]=N(!1),me=C(null);w(()=>{W||se(null)},[W]);const he=(e,t)=>{se(null),e.onSelect?e.onSelect():K(e.to,!!t&&(e=>e.metaKey||e.ctrlKey||1===e.button)(t))},ue=(e,t)=>{const r=t[e];/* @__PURE__ */
5
5
  return A("span",{className:$,"aria-hidden":"true",children:r&&L(r)?j(r,{className:"size-[18px]"}):r})},pe=(e,t)=>{const r=i(e,re),a=e.menuLabel??e.label;if(r.length>0){const n=`child:${e.to}`,i=ne.has(n),l=!i&&o(r,_,re);/* @__PURE__ */
6
6
  return z("div",{children:[
7
- /* @__PURE__ */z("button",{type:"button",onClick:()=>le(n),"aria-expanded":i,className:M(l,!1),style:t>0?{paddingLeft:.75+1.75*t+"rem"}:void 0,children:[0===t&&ue(e.to,U),
7
+ /* @__PURE__ */z("button",{type:"button",onClick:()=>le(n),"aria-expanded":i,className:M(l,!1),style:t>0?{paddingLeft:.75+1.75*t+"rem"}:void 0,children:[0===t&&ue(e.to,Y),
8
8
  /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:a}),
9
9
  /* @__PURE__ */A(B,{open:i})]}),i&&/* @__PURE__ */A("div",{className:"space-y-0.5 pt-0.5",children:r.map(e=>pe(e,t+1))}),e.dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"})]},e.to)}const n=e.to===_;/* @__PURE__ */
10
10
  return z("div",{children:[
11
- /* @__PURE__ */z("button",{type:"button",onClick:t=>he(e,t),onAuxClick:t=>{1===t.button&&he(e,t)},"aria-current":n?"page":void 0,className:M(n,!1),style:t>0?{paddingLeft:.75+1.75*t+"rem"}:void 0,children:[0===t&&ue(e.to,U),
12
- /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:a})]}),e.dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"})]},e.to)},be=(e,t)=>{const r=t?e.items:l(e,re);if(0===r.length)return null;const a="icon"in e&&e.icon?/* @__PURE__ */A("span",{className:$,"aria-hidden":"true",children:e.icon}):ue(e.label,Y),n=e.menuLabel??e.label,i=o(r,_,re),s="dividerAfter"in e&&e.dividerAfter;if(W)/* @__PURE__ */
11
+ /* @__PURE__ */z("button",{type:"button",onClick:t=>he(e,t),onAuxClick:t=>{1===t.button&&he(e,t)},"aria-current":n?"page":void 0,className:M(n,!1),style:t>0?{paddingLeft:.75+1.75*t+"rem"}:void 0,children:[0===t&&ue(e.to,Y),
12
+ /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:a})]}),e.dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"})]},e.to)},be=(e,t)=>{const r=t?e.items:l(e,re);if(0===r.length)return null;const a="icon"in e&&e.icon?/* @__PURE__ */A("span",{className:$,"aria-hidden":"true",children:e.icon}):ue(e.label,U),n=e.menuLabel??e.label,i=o(r,_,re),s="dividerAfter"in e&&e.dividerAfter;if(W)/* @__PURE__ */
13
13
  return z("div",{children:[
14
14
  /* @__PURE__ */A("button",{type:"button",title:n,"aria-label":n,"aria-haspopup":"menu","aria-expanded":oe?.label===e.label,onClick:t=>{const a=t.currentTarget.getBoundingClientRect();se(t=>t?.label===e.label?null:{label:e.label,items:r,top:a.top})},className:M(i||oe?.label===e.label,!0),children:a}),s&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"})]},e.label);const c=ne.has(e.label),d=`rosh-rail-${e.label.replace(/[^a-z0-9]+/gi,"-").toLowerCase()}`;/* @__PURE__ */
15
15
  return z("div",{children:[
16
16
  /* @__PURE__ */z("button",{type:"button",onClick:()=>le(e.label),"aria-expanded":c,"aria-controls":d,className:M(!c&&i,!1),children:[a,
17
17
  /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:n}),
18
18
  /* @__PURE__ */A(B,{open:c})]}),
19
- /* @__PURE__ */A("div",{id:d,role:"group","aria-label":n,hidden:!c,className:"space-y-0.5 pt-0.5",children:c&&r.map(e=>pe(e,1))}),s&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"})]},e.label)},ge=D?.first_name?`${D.first_name} ${D.last_name||""}`.trim():J?.email||"",xe=(D?.first_name?.charAt(0)||J?.email?.charAt(0)||"?").toUpperCase(),fe=D?.avatar_url?/* @__PURE__ */A("img",{src:D.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */A("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:xe}),ye=ce?me.current?.getBoundingClientRect():void 0,ve=W?"px-2.5":"px-3",ke=ae.erpSections.length>0||ae.systemSections.length>0||ae.virtualSections.length>0;/* @__PURE__ */
20
- return z("aside",{"aria-label":te.navLabel,className:"fixed left-0 top-0 z-[260] flex h-dvh flex-col border-r border-gray-200 bg-white text-gray-800",style:{width:H},children:[
19
+ /* @__PURE__ */A("div",{id:d,role:"group","aria-label":n,hidden:!c,className:"space-y-0.5 pt-0.5",children:c&&r.map(e=>pe(e,1))}),s&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"})]},e.label)},ge=P?.first_name?`${P.first_name} ${P.last_name||""}`.trim():R?.email||"",xe=(P?.first_name?.charAt(0)||R?.email?.charAt(0)||"?").toUpperCase(),fe=P?.avatar_url?/* @__PURE__ */A("img",{src:P.avatar_url,alt:"",className:"size-8 shrink-0 rounded-full object-cover"}):/* @__PURE__ */A("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-blue-600 text-xs font-semibold text-white",children:xe}),ye=ce?me.current?.getBoundingClientRect():void 0,ve=W?"px-2.5":"px-3",ke=ae.erpSections.length>0||ae.systemSections.length>0||ae.virtualSections.length>0;/* @__PURE__ */
20
+ return z("aside",{"aria-label":te.navLabel,className:"fixed left-0 top-0 z-[260] flex h-dvh flex-col border-r border-gray-200 bg-white text-gray-800",style:{width:I},children:[
21
21
  /* @__PURE__ */z("div",{className:"flex shrink-0 items-center border-b border-gray-200 "+(W?"justify-center":"justify-between gap-2 pl-4 pr-2"),style:{height:p},children:[
22
- /* @__PURE__ */z("span",{className:"flex min-w-0 items-center gap-2",children:[Z&&/* @__PURE__ */A(d,{src:Z,alt:"",slot:"compact",surface:"light",adaptive:G,hasAlpha:Q,isLight:ee,size:28,decorative:!0}),!W&&/* @__PURE__ */z("span",{className:"min-w-0 leading-tight",children:[
23
- /* @__PURE__ */A("span",{className:"block truncate text-[15px] font-bold tracking-wide text-gray-900",children:F??"Apps"}),q&&/* @__PURE__ */A("span",{className:"block truncate text-[11px] font-medium text-gray-500",children:q})]})]}),!W&&/* @__PURE__ */A("button",{type:"button",onClick:K,"aria-label":te.collapseSidebar,title:`${te.collapseSidebar} (${S?"⌘":"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__ */A(I,{dir:"left"})})]}),
24
- /* @__PURE__ */A("div",{className:`shrink-0 pt-3 ${ve}`,children:W?/* @__PURE__ */A("button",{type:"button",onClick:m,"aria-label":te.search,title:`${te.search} (${S?"⌘K":"Ctrl K"})`,className:M(!1,!0),children:/* @__PURE__ */A(V,{className:"size-[18px]"})}):/* @__PURE__ */z("button",{type:"button",onClick:m,className:"flex h-[34px] w-full items-center gap-2 rounded-md border border-gray-200 bg-white px-2.5 text-left transition-colors hover:bg-gray-100",children:[
25
- /* @__PURE__ */A(V,{className:"size-3.5 text-gray-500"}),
22
+ /* @__PURE__ */z("span",{className:"flex min-w-0 items-center gap-2",children:[q&&/* @__PURE__ */A(d,{src:q,alt:"",slot:"compact",surface:"light",adaptive:Q,hasAlpha:Z,isLight:ee,size:28,decorative:!0}),!W&&/* @__PURE__ */z("span",{className:"min-w-0 leading-tight",children:[
23
+ /* @__PURE__ */A("span",{className:"block truncate text-[15px] font-bold tracking-wide text-gray-900",children:F??"Apps"}),G&&/* @__PURE__ */A("span",{className:"block truncate text-[11px] font-medium text-gray-500",children:G})]})]}),!W&&/* @__PURE__ */A("button",{type:"button",onClick:T,"aria-label":te.collapseSidebar,title:`${te.collapseSidebar} (${S?"⌘":"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__ */A(V,{dir:"left"})})]}),
24
+ /* @__PURE__ */A("div",{className:`shrink-0 pt-3 ${ve}`,children:W?/* @__PURE__ */A("button",{type:"button",onClick:m,"aria-label":te.search,title:`${te.search} (${S?"⌘K":"Ctrl K"})`,className:M(!1,!0),children:/* @__PURE__ */A(H,{className:"size-[18px]"})}):/* @__PURE__ */z("button",{type:"button",onClick:m,className:"flex h-[34px] w-full items-center gap-2 rounded-md border border-gray-200 bg-white px-2.5 text-left transition-colors hover:bg-gray-100",children:[
25
+ /* @__PURE__ */A(H,{className:"size-3.5 text-gray-500"}),
26
26
  /* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate text-[13px] text-gray-500",children:te.search}),
27
27
  /* @__PURE__ */A("kbd",{className:"rounded border border-gray-200 bg-gray-100 px-1.5 py-0.5 font-mono text-[11px] font-semibold text-gray-500",children:S?"⌘K":"Ctrl K"})]})}),
28
- /* @__PURE__ */z("nav",{"aria-label":te.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${ve} ${W?"space-y-1":"space-y-0.5"}`,children:[W&&/* @__PURE__ */A("button",{type:"button",onClick:K,"aria-label":te.expandSidebar,title:`${te.expandSidebar} (${S?"⌘":"Ctrl"} .)`,className:`${M(!1,!0)} mb-3`,children:/* @__PURE__ */A(I,{dir:"right"})}),ae.topItems.map(e=>{if(!W)return pe(e,0);const t=i(e,re),r=e.to===_||o(t,_,re),a=e.menuLabel??e.label;/* @__PURE__ */
28
+ /* @__PURE__ */z("nav",{"aria-label":te.navLabel,className:`min-h-0 flex-1 overflow-y-auto pb-4 pt-3 ${ve} ${W?"space-y-1":"space-y-0.5"}`,children:[W&&/* @__PURE__ */A("button",{type:"button",onClick:T,"aria-label":te.expandSidebar,title:`${te.expandSidebar} (${S?"⌘":"Ctrl"} .)`,className:`${M(!1,!0)} mb-3`,children:/* @__PURE__ */A(V,{dir:"right"})}),ae.topItems.map(e=>{if(!W)return pe(e,0);const t=i(e,re),r=e.to===_||o(t,_,re),a=e.menuLabel??e.label;/* @__PURE__ */
29
29
  return z("div",{children:[
30
- /* @__PURE__ */A("button",{type:"button",title:a,"aria-label":a,onClick:r=>{if(0===t.length)return void he(e,r);const a=r.currentTarget.getBoundingClientRect();se(r=>r?.label===e.to?null:{label:e.to,items:t,top:a.top})},className:M(r,!0),children:ue(e.to,U)}),e.dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"})]},e.to)}),ae.topItems.length>0&&ke&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"}),ae.erpSections.map(e=>be(e,!1)),ae.systemSections.map(e=>be(e,!1)),ae.virtualSections.map(e=>be(e,!0)),ae.footerSections.length>0&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"}),ae.footerSections.map(e=>be(e,!1))]}),
30
+ /* @__PURE__ */A("button",{type:"button",title:a,"aria-label":a,onClick:r=>{if(0===t.length)return void he(e,r);const a=r.currentTarget.getBoundingClientRect();se(r=>r?.label===e.to?null:{label:e.to,items:t,top:a.top})},className:M(r,!0),children:ue(e.to,Y)}),e.dividerAfter&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"})]},e.to)}),ae.topItems.length>0&&ke&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"}),ae.erpSections.map(e=>be(e,!1)),ae.systemSections.map(e=>be(e,!1)),ae.virtualSections.map(e=>be(e,!0)),ae.footerSections.length>0&&/* @__PURE__ */A("div",{className:"mx-2 my-1.5 border-t border-gray-200","aria-hidden":"true"}),ae.footerSections.map(e=>be(e,!1))]}),
31
31
  /* @__PURE__ */A("div",{className:`shrink-0 border-t border-gray-200 py-2 ${ve}`,children:/* @__PURE__ */z("button",{ref:me,type:"button",onClick:()=>de(e=>!e),"aria-haspopup":"menu","aria-expanded":ce,"aria-label":W?te.accountMenu(ge):void 0,className:"flex w-full items-center gap-2.5 rounded-md hover:bg-gray-100 "+(W?"justify-center py-2":"px-2 py-2"),children:[fe,!W&&/* @__PURE__ */z("span",{className:"min-w-0 flex-1 text-left",children:[
32
- /* @__PURE__ */A("span",{className:"block truncate text-[13px] font-semibold text-gray-800",children:ge}),J?.email&&ge!==J.email&&/* @__PURE__ */A("span",{className:"block truncate text-[11px] text-gray-500",children:J.email})]})]})}),ce&&ye&&/* @__PURE__ */z(x,{portal:!0,minWidth:224,onClose:()=>de(!1),style:{left:ye.left,bottom:window.innerHeight-ye.top+8},children:[W&&/* @__PURE__ */z("div",{className:"border-b border-gray-200 px-3 py-2.5",children:[
33
- /* @__PURE__ */A("p",{className:"truncate text-sm font-semibold text-gray-800",children:ge}),J?.email&&/* @__PURE__ */A("p",{className:"truncate text-xs text-gray-500",children:J.email})]}),
34
- /* @__PURE__ */z(f,{onClick:()=>{de(!1),T("/profile",!1)},children:[
32
+ /* @__PURE__ */A("span",{className:"block truncate text-[13px] font-semibold text-gray-800",children:ge}),R?.email&&ge!==R.email&&/* @__PURE__ */A("span",{className:"block truncate text-[11px] text-gray-500",children:R.email})]})]})}),ce&&ye&&/* @__PURE__ */z(x,{portal:!0,minWidth:224,onClose:()=>de(!1),style:{left:ye.left,bottom:window.innerHeight-ye.top+8},children:[W&&/* @__PURE__ */z("div",{className:"border-b border-gray-200 px-3 py-2.5",children:[
33
+ /* @__PURE__ */A("p",{className:"truncate text-sm font-semibold text-gray-800",children:ge}),R?.email&&/* @__PURE__ */A("p",{className:"truncate text-xs text-gray-500",children:R.email})]}),
34
+ /* @__PURE__ */z(f,{onClick:()=>{de(!1),K("/profile",!1)},children:[
35
35
  /* @__PURE__ */A("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),te.profile]}),ae.footerItems.map(e=>/* @__PURE__ */z(f,{onClick:()=>{de(!1),he(e)},children:[
36
- /* @__PURE__ */A("span",{className:"h-4 w-4 text-gray-400 [&>svg]:size-4","aria-hidden":"true",children:U[e.to]}),e.menuLabel??e.label]},e.to)),P&&/* @__PURE__ */z(f,{onClick:()=>{de(!1),P()},children:[
36
+ /* @__PURE__ */A("span",{className:"h-4 w-4 text-gray-400 [&>svg]:size-4","aria-hidden":"true",children:Y[e.to]}),e.menuLabel??e.label]},e.to)),J&&/* @__PURE__ */z(f,{onClick:()=>{de(!1),J()},children:[
37
37
  /* @__PURE__ */A("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})}),te.reportIssue]}),
38
38
  /* @__PURE__ */A(y,{}),
39
- /* @__PURE__ */z(f,{onClick:()=>{de(!1),R()},children:[
39
+ /* @__PURE__ */z(f,{onClick:()=>{de(!1),O()},children:[
40
40
  /* @__PURE__ */A("svg",{className:"h-4 w-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),te.switchToDesktop]}),
41
41
  /* @__PURE__ */A(y,{}),
42
- /* @__PURE__ */z(f,{danger:!0,onClick:()=>{de(!1),O()},children:[
43
- /* @__PURE__ */A("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),te.signOut]})]}),oe&&W&&/* @__PURE__ */A(x,{portal:!0,minWidth:220,onClose:()=>se(null),style:{left:H+6,top:Math.min(oe.top,window.innerHeight-48*Math.min(oe.items.length,10)-16)},children:oe.items.flatMap(e=>{const t=i(e,re);return(t.length>0?t:[e]).map(e=>/* @__PURE__ */z(f,{onClick:()=>he(e),children:[ue(e.to,U),
44
- /* @__PURE__ */A("span",{className:e.to===_?"font-semibold":"",children:e.menuLabel??e.label})]},e.to))})})]})}export{H as default};
42
+ /* @__PURE__ */z(f,{danger:!0,onClick:()=>{de(!1),D()},children:[
43
+ /* @__PURE__ */A("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */A("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})}),te.signOut]})]}),oe&&W&&/* @__PURE__ */A(x,{portal:!0,minWidth:220,onClose:()=>se(null),style:{left:I+6,top:Math.min(oe.top,window.innerHeight-48*Math.min(oe.items.length,10)-16)},children:oe.items.flatMap(e=>{const t=i(e,re);return(t.length>0?t:[e]).map(e=>/* @__PURE__ */z(f,{onClick:()=>he(e),children:[ue(e.to,Y),
44
+ /* @__PURE__ */A("span",{className:e.to===_?"font-semibold":"",children:e.menuLabel??e.label})]},e.to))})})]})}export{I as default};
@@ -1,19 +1,19 @@
1
- import{EditableGrid as e}from"./chunk-XN76YBX3.js";import"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-5DVD4E4P.js";import{peekSpreadsheetPreviewStage as r,claimSpreadsheetPreviewStage as n,SPREADSHEET_PREVIEW_UPDATE_EVENT as o}from"./chunk-VTVSMRFX.js";import"./chunk-O5BOGWO3.js";import{WindowTitle as a}from"./chunk-XC64WV33.js";import"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-J7LKJIZC.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useRef as l,useState as s,useEffect as c,useCallback as i}from"react";import{jsxs as u,jsx as d,Fragment as h}from"react/jsx-runtime";var m="ABCDEFGHIJKLMNOPQRSTUVWXYZ",p=10,x=30;function g(e){return e<26?m[e]:m[Math.floor(e/26)-1]+m[e%26]}function y(e){return Array.from({length:e},(e,t)=>({key:`col_${t}`,title:g(t),width:100}))}function b(e,t){return Array.from({length:e},()=>Array(t).fill(""))}function f(e){return{id:crypto.randomUUID(),name:e,columns:y(p),data:b(x,p),cellStyles:{}}}function v(e){return e.split("\n").map(e=>{if(e.includes("\t"))return e.split("\t").map(e=>e.trim());const t=[];let r="",n=!1;for(const o of e)'"'!==o?","!==o||n?r+=o:(t.push(r.trim()),r=""):n=!n;return t.push(r.trim()),t}).filter(e=>e.some(e=>e.trim()))}function w(e,t){const r=v(e);if(0===r.length)return null;const n=Math.max(p,r.reduce((e,t)=>Math.max(e,t.length),0)),o=r.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));return{id:crypto.randomUUID(),name:t,columns:y(n),data:o,cellStyles:{}}}function k(){const m=l(null),g=l(void 0);void 0===g.current&&(g.current=r());const k=l(g.current?.data??null),N=(()=>{const e=g.current;if(!e)return null;const t=w(e.data.csv,"Sheet 1");if(!t)return null;return{sheet:t,title:e.data.filename.replace(/\.(csv|tsv|txt)$/i,"")}})(),[C,S]=s(N?[N.sheet]:[f("Sheet 1")]),[j,$]=s(0),M=l([]),D=l(C),E=l(!1);c(()=>{E.current?E.current=!1:D.current!==C&&(M.current.push(D.current),M.current.length>50&&M.current.shift()),D.current=C},[C]);const U=i(()=>{const e=M.current.pop();e&&(E.current=!0,S(e))},[]);c(()=>{const e=e=>{if(!m.current?.contains(document.activeElement)&&!m.current?.matches(":focus-within"))return;(e.ctrlKey||e.metaKey)&&!e.shiftKey&&("z"===e.key||"Z"===e.key)&&(e.preventDefault(),U())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[U]);const[A,L]=s(N?.title??"Untitled"),[B,F]=s(()=>g.current?.data.onEmail),I=i(e=>{const t=w(e.csv,"Sheet 1");t&&(S([t]),$(0),L(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),F(()=>e.onEmail))},[]);c(()=>{const e=g.current;null!=e&&(n(e),e.data!==k.current&&I(e.data))},[]),c(()=>{const e=g.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&I(r.data)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)},[]);const[R,V]=s(!1),[X,K]=s(null),[O,P]=s(""),H=l(null),[T,J]=s("1"),[z,W]=s("10"),Y=C[j]||C[0],Z=Y.data,_=Y.columns,G=Y.cellStyles??{},[Q,q]=s(null),[ee,te]=s(null),re=i(()=>{if(ee){const e=Math.min(ee.anchor.row,ee.end.row),t=Math.max(ee.anchor.row,ee.end.row),r=Math.min(ee.anchor.col,ee.end.col),n=Math.max(ee.anchor.col,ee.end.col),o=[];for(let a=e;a<=t;a++)for(let e=r;e<=n;e++)o.push({row:a,col:e});return o}return Q?[Q]:[]},[ee,Q]),ne=i((e,t)=>{const r=re();0!==r.length&&S(n=>n.map((n,o)=>{if(o!==j)return n;const a={...n.cellStyles??{}},l=`${r[0].row}:${r[0].col}`,s=void 0!==t?t:!(a[l]??{})[e];for(const{row:t,col:n}of r){const r=`${t}:${n}`;a[r]={...a[r]??{},[e]:s}}return{...n,cellStyles:a}}))},[re,j]),oe=ee?{row:ee.anchor.row,col:ee.anchor.col}:Q,ae=oe?G[`${oe.row}:${oe.col}`]??{}:{},le=!!oe,se=i(e=>{S(t=>t.map((t,r)=>r===j?{...t,...e}:t))},[j]),ce=i(e=>{const t=e.reduce((e,t)=>Math.max(e,t.length),0);t!==_.length?se({data:e,columns:y(t)}):se({data:e})},[se,_.length]),ie=(e,t)=>{S(r=>r.map((r,n)=>n===e?{...r,name:t}:r)),K(null)},ue=()=>Z.filter(e=>e.some(e=>e.trim())).map(e=>e.map(e=>e.includes(",")||e.includes('"')||e.includes("\n")?`"${e.replace(/"/g,'""')}"`:e).join(",")).join("\n"),de=[];Z.forEach(e=>e.forEach(e=>{const t=parseFloat(e);!isNaN(t)&&e.trim()&&de.push(t)}));const he=Z.reduce((e,t)=>e+t.filter(e=>e.trim()).length,0);/* @__PURE__ */
1
+ import{EditableGrid as e}from"./chunk-XN76YBX3.js";import"./chunk-BR22X7E5.js";import{AboutApp as t}from"./chunk-EI4WZOP3.js";import{peekSpreadsheetPreviewStage as r,claimSpreadsheetPreviewStage as n,SPREADSHEET_PREVIEW_UPDATE_EVENT as o}from"./chunk-VTVSMRFX.js";import"./chunk-L4KRS7N3.js";import{WindowTitle as a}from"./chunk-DLD4AKVT.js";import"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-VNEH2Y6H.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useRef as l,useState as s,useEffect as c,useCallback as i}from"react";import{jsxs as u,jsx as d,Fragment as h}from"react/jsx-runtime";var m="ABCDEFGHIJKLMNOPQRSTUVWXYZ",p=10,x=30;function g(e){return e<26?m[e]:m[Math.floor(e/26)-1]+m[e%26]}function y(e){return Array.from({length:e},(e,t)=>({key:`col_${t}`,title:g(t),width:100}))}function b(e,t){return Array.from({length:e},()=>Array(t).fill(""))}function f(e){return{id:crypto.randomUUID(),name:e,columns:y(p),data:b(x,p),cellStyles:{}}}function v(e){return e.split("\n").map(e=>{if(e.includes("\t"))return e.split("\t").map(e=>e.trim());const t=[];let r="",n=!1;for(const o of e)'"'!==o?","!==o||n?r+=o:(t.push(r.trim()),r=""):n=!n;return t.push(r.trim()),t}).filter(e=>e.some(e=>e.trim()))}function w(e,t){const r=v(e);if(0===r.length)return null;const n=Math.max(p,r.reduce((e,t)=>Math.max(e,t.length),0)),o=r.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));return{id:crypto.randomUUID(),name:t,columns:y(n),data:o,cellStyles:{}}}function k(){const m=l(null),g=l(void 0);void 0===g.current&&(g.current=r());const k=l(g.current?.data??null),N=(()=>{const e=g.current;if(!e)return null;const t=w(e.data.csv,"Sheet 1");if(!t)return null;return{sheet:t,title:e.data.filename.replace(/\.(csv|tsv|txt)$/i,"")}})(),[C,S]=s(N?[N.sheet]:[f("Sheet 1")]),[j,$]=s(0),M=l([]),E=l(C),A=l(!1);c(()=>{A.current?A.current=!1:E.current!==C&&(M.current.push(E.current),M.current.length>50&&M.current.shift()),E.current=C},[C]);const D=i(()=>{const e=M.current.pop();e&&(A.current=!0,S(e))},[]);c(()=>{const e=e=>{if(!m.current?.contains(document.activeElement)&&!m.current?.matches(":focus-within"))return;(e.ctrlKey||e.metaKey)&&!e.shiftKey&&("z"===e.key||"Z"===e.key)&&(e.preventDefault(),D())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]);const[U,L]=s(N?.title??"Untitled"),[R,F]=s(()=>g.current?.data.onEmail),I=i(e=>{const t=w(e.csv,"Sheet 1");t&&(S([t]),$(0),L(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),F(()=>e.onEmail))},[]);c(()=>{const e=g.current;null!=e&&(n(e),e.data!==k.current&&I(e.data))},[]),c(()=>{const e=g.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&I(r.data)};return window.addEventListener(o,t),()=>window.removeEventListener(o,t)},[]);const[B,H]=s(!1),[K,V]=s(null),[P,T]=s(""),X=l(null),[O,Y]=s("1"),[z,Z]=s("10"),J=C[j]||C[0],W=J.data,_=J.columns,Q=J.cellStyles??{},[G,q]=s(null),[ee,te]=s(null),re=i(()=>{if(ee){const e=Math.min(ee.anchor.row,ee.end.row),t=Math.max(ee.anchor.row,ee.end.row),r=Math.min(ee.anchor.col,ee.end.col),n=Math.max(ee.anchor.col,ee.end.col),o=[];for(let a=e;a<=t;a++)for(let e=r;e<=n;e++)o.push({row:a,col:e});return o}return G?[G]:[]},[ee,G]),ne=i((e,t)=>{const r=re();0!==r.length&&S(n=>n.map((n,o)=>{if(o!==j)return n;const a={...n.cellStyles??{}},l=`${r[0].row}:${r[0].col}`,s=void 0!==t?t:!(a[l]??{})[e];for(const{row:t,col:n}of r){const r=`${t}:${n}`;a[r]={...a[r]??{},[e]:s}}return{...n,cellStyles:a}}))},[re,j]),oe=ee?{row:ee.anchor.row,col:ee.anchor.col}:G,ae=oe?Q[`${oe.row}:${oe.col}`]??{}:{},le=!!oe,se=i(e=>{S(t=>t.map((t,r)=>r===j?{...t,...e}:t))},[j]),ce=i(e=>{const t=e.reduce((e,t)=>Math.max(e,t.length),0);t!==_.length?se({data:e,columns:y(t)}):se({data:e})},[se,_.length]),ie=(e,t)=>{S(r=>r.map((r,n)=>n===e?{...r,name:t}:r)),V(null)},ue=()=>W.filter(e=>e.some(e=>e.trim())).map(e=>e.map(e=>e.includes(",")||e.includes('"')||e.includes("\n")?`"${e.replace(/"/g,'""')}"`:e).join(",")).join("\n"),de=[];W.forEach(e=>e.forEach(e=>{const t=parseFloat(e);!isNaN(t)&&e.trim()&&de.push(t)}));const he=W.reduce((e,t)=>e+t.filter(e=>e.trim()).length,0);/* @__PURE__ */
2
2
  return u("div",{ref:m,className:"flex flex-col h-full",children:[
3
- /* @__PURE__ */d(a,{title:`${me=A||"Untitled",me.length>24?`${me.slice(0,23)}…`:me} - Spreadsheets`}),
3
+ /* @__PURE__ */d(a,{title:`${me=U||"Untitled",me.length>24?`${me.slice(0,23)}…`:me} - Spreadsheets`}),
4
4
  /* @__PURE__ */d(t,{app:"spreadsheet"}),
5
- /* @__PURE__ */u("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[R?/* @__PURE__ */d("input",{type:"text",value:A,onChange:e=>L(e.target.value),onBlur:()=>V(!1),onKeyDown:e=>{"Enter"===e.key&&V(!1)},autoFocus:!0,className:"text-sm font-medium text-gray-900 border border-gray-300 rounded px-2 py-0.5 w-40 focus:border-blue-500 focus:ring-blue-500"}):/* @__PURE__ */d("button",{onClick:()=>V(!0),className:"text-sm font-medium text-gray-900 hover:text-blue-600 truncate max-w-[200px]",title:"Click to rename",children:A||"Untitled"}),
5
+ /* @__PURE__ */u("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[B?/* @__PURE__ */d("input",{type:"text",value:U,onChange:e=>L(e.target.value),onBlur:()=>H(!1),onKeyDown:e=>{"Enter"===e.key&&H(!1)},autoFocus:!0,className:"text-sm font-medium text-gray-900 border border-gray-300 rounded px-2 py-0.5 w-40 focus:border-blue-500 focus:ring-blue-500"}):/* @__PURE__ */d("button",{onClick:()=>H(!0),className:"text-sm font-medium text-gray-900 hover:text-blue-600 truncate max-w-[200px]",title:"Click to rename",children:U||"Untitled"}),
6
6
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
7
- /* @__PURE__ */d("input",{ref:H,type:"file",accept:".csv,.tsv,.txt,.xlsx,.xls,.ods",onChange:async e=>{const t=e.target.files?.[0];if(!t)return;const r=t.name.replace(/\.(csv|tsv|txt|xlsx|xls|ods)$/i,"");if(/\.(xlsx|xls|ods)$/i.test(t.name)){const e=new Uint8Array(await t.arrayBuffer()),n=await(import("xlsx")),o=n.read(e,{type:"array"}),a=o.SheetNames.map(e=>{const t=n.utils.sheet_to_json(o.Sheets[e],{header:1,defval:""}),r=Math.max(p,t.reduce((e,t)=>Math.max(e,t.length),0)),a=t.map(e=>{const t=e.map(e=>String(e??""));for(;t.length<r;)t.push("");return t});for(;a.length<x;)a.push(Array(r).fill(""));return{id:crypto.randomUUID(),name:e,columns:y(r),data:a}});S(a),$(0),L(r)}else{const e=v(await t.text());if(0===e.length)return;const n=Math.max(p,e.reduce((e,t)=>Math.max(e,t.length),0)),o=e.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));se({columns:y(n),data:o}),L(r)}H.current&&(H.current.value="")},className:"hidden"}),
8
- /* @__PURE__ */d("button",{onClick:()=>H.current?.click(),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Open"}),
9
- /* @__PURE__ */d("button",{onClick:()=>{const e=new Blob([ue()],{type:"text/csv"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`${A||"spreadsheet"}.csv`,r.click(),URL.revokeObjectURL(t)},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save CSV"}),B&&/* @__PURE__ */d("button",{onClick:()=>B(ue(),`${A||"spreadsheet"}.csv`),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Email"}),
7
+ /* @__PURE__ */d("input",{ref:X,type:"file",accept:".csv,.tsv,.txt,.xlsx,.xls,.ods",onChange:async e=>{const t=e.target.files?.[0];if(!t)return;const r=t.name.replace(/\.(csv|tsv|txt|xlsx|xls|ods)$/i,"");if(/\.(xlsx|xls|ods)$/i.test(t.name)){const e=new Uint8Array(await t.arrayBuffer()),n=await(import("xlsx")),o=n.read(e,{type:"array"}),a=o.SheetNames.map(e=>{const t=n.utils.sheet_to_json(o.Sheets[e],{header:1,defval:""}),r=Math.max(p,t.reduce((e,t)=>Math.max(e,t.length),0)),a=t.map(e=>{const t=e.map(e=>String(e??""));for(;t.length<r;)t.push("");return t});for(;a.length<x;)a.push(Array(r).fill(""));return{id:crypto.randomUUID(),name:e,columns:y(r),data:a}});S(a),$(0),L(r)}else{const e=v(await t.text());if(0===e.length)return;const n=Math.max(p,e.reduce((e,t)=>Math.max(e,t.length),0)),o=e.map(e=>{for(;e.length<n;)e.push("");return e});for(;o.length<x;)o.push(Array(n).fill(""));se({columns:y(n),data:o}),L(r)}X.current&&(X.current.value="")},className:"hidden"}),
8
+ /* @__PURE__ */d("button",{onClick:()=>X.current?.click(),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Open"}),
9
+ /* @__PURE__ */d("button",{onClick:()=>{const e=new Blob([ue()],{type:"text/csv"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=`${U||"spreadsheet"}.csv`,r.click(),URL.revokeObjectURL(t)},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save CSV"}),R&&/* @__PURE__ */d("button",{onClick:()=>R(ue(),`${U||"spreadsheet"}.csv`),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Email"}),
10
10
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
11
11
  /* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
12
- /* @__PURE__ */d("input",{type:"number",min:"1",max:"50",value:T,onChange:e=>J(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
13
- /* @__PURE__ */d("button",{onClick:()=>(e=>{const t=_.length+e;se({columns:y(t),data:Z.map(t=>[...t,...Array(e).fill("")])})})(parseInt(T)||1),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Col"})]}),
12
+ /* @__PURE__ */d("input",{type:"number",min:"1",max:"50",value:O,onChange:e=>Y(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
13
+ /* @__PURE__ */d("button",{onClick:()=>(e=>{const t=_.length+e;se({columns:y(t),data:W.map(t=>[...t,...Array(e).fill("")])})})(parseInt(O)||1),className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Col"})]}),
14
14
  /* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
15
- /* @__PURE__ */d("input",{type:"number",min:"1",max:"500",value:z,onChange:e=>W(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
16
- /* @__PURE__ */d("button",{onClick:()=>{return e=parseInt(z)||10,void se({data:[...Z,...Array.from({length:e},()=>Array(_.length).fill(""))]});var e},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Row"})]}),
15
+ /* @__PURE__ */d("input",{type:"number",min:"1",max:"500",value:z,onChange:e=>Z(e.target.value),className:"w-10 text-xs text-center border border-gray-300 rounded px-1 py-0.5 focus:border-blue-500 focus:ring-blue-500"}),
16
+ /* @__PURE__ */d("button",{onClick:()=>{return e=parseInt(z)||10,void se({data:[...W,...Array.from({length:e},()=>Array(_.length).fill(""))]});var e},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"+ Row"})]}),
17
17
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
18
18
  /* @__PURE__ */d("button",{onClick:()=>{se({columns:y(p),data:b(x,p)})},className:"text-xs text-gray-600 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Clear"}),
19
19
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
@@ -26,12 +26,12 @@ return u("div",{ref:m,className:"flex flex-col h-full",children:[
26
26
  /* @__PURE__ */d("option",{value:"base",children:"S"}),
27
27
  /* @__PURE__ */d("option",{value:"lg",children:"M"}),
28
28
  /* @__PURE__ */d("option",{value:"xl",children:"L"})]})]})]}),
29
- /* @__PURE__ */d("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */d(e,{columns:_,data:Z,onChange:ce,onColumnsChange:e=>se({columns:e}),cellStyles:G,onFocusChange:q,onSelectionChange:te,minRows:x,maxHeight:"100%"})}),
29
+ /* @__PURE__ */d("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */d(e,{columns:_,data:W,onChange:ce,onColumnsChange:e=>se({columns:e}),cellStyles:Q,onFocusChange:q,onSelectionChange:te,minRows:x,maxHeight:"100%"})}),
30
30
  /* @__PURE__ */u("div",{className:"flex items-center border-t border-gray-200 bg-gray-50 shrink-0",children:[
31
- /* @__PURE__ */u("div",{className:"flex items-center gap-0.5 px-1 py-1 overflow-x-auto flex-1 min-w-0",children:[C.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>$(t),onDoubleClick:()=>{K(t),P(e.name)},onContextMenu:e=>{e.preventDefault(),C.length>1&&(e=>{C.length<=1||(S(t=>t.filter((t,r)=>r!==e)),j>=e&&j>0&&$(j-1))})(t)},className:"px-3 py-1 text-xs font-medium rounded-b whitespace-nowrap transition-colors "+(t===j?"bg-white text-blue-700 border border-t-0 border-gray-300 -mt-px relative z-10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:X===t?/* @__PURE__ */d("input",{type:"text",value:O,onChange:e=>P(e.target.value),onBlur:()=>ie(t,O||e.name),onKeyDown:r=>{"Enter"===r.key&&ie(t,O||e.name),"Escape"===r.key&&K(null)},onClick:e=>e.stopPropagation(),autoFocus:!0,className:"w-20 text-xs border border-blue-400 rounded px-1 py-0 focus:ring-0 focus:outline-none"}):e.name},e.id)),
31
+ /* @__PURE__ */u("div",{className:"flex items-center gap-0.5 px-1 py-1 overflow-x-auto flex-1 min-w-0",children:[C.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>$(t),onDoubleClick:()=>{V(t),T(e.name)},onContextMenu:e=>{e.preventDefault(),C.length>1&&(e=>{C.length<=1||(S(t=>t.filter((t,r)=>r!==e)),j>=e&&j>0&&$(j-1))})(t)},className:"px-3 py-1 text-xs font-medium rounded-b whitespace-nowrap transition-colors "+(t===j?"bg-white text-blue-700 border border-t-0 border-gray-300 -mt-px relative z-10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:K===t?/* @__PURE__ */d("input",{type:"text",value:P,onChange:e=>T(e.target.value),onBlur:()=>ie(t,P||e.name),onKeyDown:r=>{"Enter"===r.key&&ie(t,P||e.name),"Escape"===r.key&&V(null)},onClick:e=>e.stopPropagation(),autoFocus:!0,className:"w-20 text-xs border border-blue-400 rounded px-1 py-0 focus:ring-0 focus:outline-none"}):e.name},e.id)),
32
32
  /* @__PURE__ */d("button",{onClick:()=>{const e=`Sheet ${C.length+1}`;S(t=>[...t,f(e)]),$(C.length)},className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded",title:"Add sheet",children:"+"})]}),
33
33
  /* @__PURE__ */u("div",{className:"flex items-center gap-4 px-3 py-1 text-xs text-gray-500 shrink-0 border-l border-gray-200",children:[
34
34
  /* @__PURE__ */u("span",{children:[he," cells"]}),de.length>0&&/* @__PURE__ */u(h,{children:[
35
35
  /* @__PURE__ */u("span",{children:["Sum: ",de.reduce((e,t)=>e+t,0).toLocaleString(void 0,{maximumFractionDigits:2})]}),
36
36
  /* @__PURE__ */u("span",{children:["Avg: ",(de.reduce((e,t)=>e+t,0)/de.length).toLocaleString(void 0,{maximumFractionDigits:2})]})]}),
37
- /* @__PURE__ */u("span",{children:[Z.length," × ",_.length]})]})]})]});var me}export{k as default};
37
+ /* @__PURE__ */u("span",{children:[W.length," × ",_.length]})]})]})]});var me}export{k as default};
@@ -1,4 +1,4 @@
1
- import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-DRN636EP.js";import{useWidgetSettings as a}from"./chunk-XC64WV33.js";import"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-J7LKJIZC.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useState as r,useCallback as n}from"react";import{jsxs as c,Fragment as s,jsx as i}from"react/jsx-runtime";var l=["AAPL","MSFT","GOOGL","TSLA","NVDA"],o="stock_symbols",m="stock_appearance",d={AAPL:{price:229.87,change:1.42,changePct:.62},MSFT:{price:451.16,change:-2.31,changePct:-.51},GOOGL:{price:178.34,change:.89,changePct:.5},AMZN:{price:201.45,change:-1.08,changePct:-.53},TSLA:{price:248.92,change:6.74,changePct:2.78},NVDA:{price:134.81,change:-3.12,changePct:-2.26},META:{price:563.27,change:4.55,changePct:.81}},g=Object.keys(d);function p(){try{const e=JSON.parse(localStorage.getItem(o)||"");if(Array.isArray(e)&&e.length)return e.slice(0,8)}catch{}return l}var h=e=>`${e>=0?"+":""}${e.toFixed(2)}`;function x(){const[l,x]=r(p),[u,y]=r(()=>e(m)),[b,f]=r(!1),[N,v]=r([]),[k,A]=r(u),[P,S]=r(""),j=n(()=>{v([...l]),A({...u}),S(""),f(!0)},[l,u]);a(j);const D=()=>{const e=P.trim().toUpperCase();!e||N.includes(e)||N.length>=8||(v(t=>[...t,e]),S(""))},C=g.filter(e=>!N.includes(e));/* @__PURE__ */
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-M4AKWGQM.js";import{useWidgetSettings as a}from"./chunk-DLD4AKVT.js";import"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-VNEH2Y6H.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useState as r,useCallback as n}from"react";import{jsxs as c,Fragment as s,jsx as i}from"react/jsx-runtime";var l=["AAPL","MSFT","GOOGL","TSLA","NVDA"],o="stock_symbols",m="stock_appearance",d={AAPL:{price:229.87,change:1.42,changePct:.62},MSFT:{price:451.16,change:-2.31,changePct:-.51},GOOGL:{price:178.34,change:.89,changePct:.5},AMZN:{price:201.45,change:-1.08,changePct:-.53},TSLA:{price:248.92,change:6.74,changePct:2.78},NVDA:{price:134.81,change:-3.12,changePct:-2.26},META:{price:563.27,change:4.55,changePct:.81}},g=Object.keys(d);function p(){try{const e=JSON.parse(localStorage.getItem(o)||"");if(Array.isArray(e)&&e.length)return e.slice(0,8)}catch{}return l}var h=e=>`${e>=0?"+":""}${e.toFixed(2)}`;function x(){const[l,x]=r(p),[u,y]=r(()=>e(m)),[b,f]=r(!1),[N,v]=r([]),[k,A]=r(u),[S,j]=r(""),P=n(()=>{v([...l]),A({...u}),j(""),f(!0)},[l,u]);a(P);const D=()=>{const e=S.trim().toUpperCase();!e||N.includes(e)||N.length>=8||(v(t=>[...t,e]),j(""))},T=g.filter(e=>!N.includes(e));/* @__PURE__ */
2
2
  return c(s,{children:[
3
3
  /* @__PURE__ */i("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${u.activeOpacity/100})`,backdropFilter:u.activeBlur>0?`blur(${u.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3",children:0===l.length?/* @__PURE__ */i("div",{className:"text-xs text-gray-500 text-center py-6",children:"No symbols yet — add some in settings."}):/* @__PURE__ */i("div",{className:"space-y-0.5",children:l.map(e=>{const t=d[e],a=(t?.change??0)>=0,r=t?t.change>0?"text-green-600":t.change<0?"text-red-600":"text-gray-500":"text-gray-400";/* @__PURE__ */
4
4
  return c("div",{className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0",children:[
@@ -11,6 +11,6 @@ return c("div",{className:"flex items-center justify-between px-2 py-2 border-b
11
11
  /* @__PURE__ */c("div",{className:"space-y-1 mb-2",children:[N.map((e,t)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
12
12
  /* @__PURE__ */i("span",{className:"text-sm font-semibold text-gray-700",children:e}),
13
13
  /* @__PURE__ */i("button",{onClick:()=>v(e=>e.filter((e,a)=>a!==t)),className:"text-red-400 hover:text-red-600",children:"×"})]},t)),0===N.length&&/* @__PURE__ */i("p",{className:"text-[11px] text-gray-400 italic",children:"No symbols — add a ticker below."})]}),N.length<8?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
14
- /* @__PURE__ */i("input",{value:P,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&D()},placeholder:"e.g. NVDA",className:"flex-1 bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm uppercase focus:outline-none focus:ring-1 focus:ring-blue-500"}),
15
- /* @__PURE__ */i("button",{onClick:D,className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-[11px] text-gray-400 italic",children:["Max ",8," symbols — remove one to add another."]}),C.length>0&&N.length<8&&/* @__PURE__ */i("div",{className:"flex flex-wrap gap-1.5 mt-2",children:C.map(e=>/* @__PURE__ */i("button",{onClick:()=>v(t=>t.length<8?[...t,e]:t),className:"text-[11px] font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded px-2 py-0.5 transition-colors",children:e},e))}),
14
+ /* @__PURE__ */i("input",{value:S,onChange:e=>j(e.target.value),onKeyDown:e=>{"Enter"===e.key&&D()},placeholder:"e.g. NVDA",className:"flex-1 bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm uppercase focus:outline-none focus:ring-1 focus:ring-blue-500"}),
15
+ /* @__PURE__ */i("button",{onClick:D,className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-[11px] text-gray-400 italic",children:["Max ",8," symbols — remove one to add another."]}),T.length>0&&N.length<8&&/* @__PURE__ */i("div",{className:"flex flex-wrap gap-1.5 mt-2",children:T.map(e=>/* @__PURE__ */i("button",{onClick:()=>v(t=>t.length<8?[...t,e]:t),className:"text-[11px] font-medium text-gray-600 bg-gray-100 hover:bg-gray-200 rounded px-2 py-0.5 transition-colors",children:e},e))}),
16
16
  /* @__PURE__ */i("p",{className:"text-[11px] text-gray-400 mt-2",children:"Demo prices — static sample data, no live feed."})]})})]})}export{x as default};
@@ -1,4 +1,4 @@
1
- import{fetchCityWeather as e,getCondition as t,AVAILABLE_CITIES as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-DRN636EP.js";import{useWidgetSettings as s}from"./chunk-XC64WV33.js";import{useShellPrefs as o}from"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-J7LKJIZC.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useState as l,useEffect as c,useCallback as d}from"react";import{jsx as m,jsxs as p,Fragment as h}from"react/jsx-runtime";var f="weather_city",u="weather_appearance",y={useFahrenheit:!1,showLocalTime:!0,use24Hour:!1};function g(){const e="undefined"!=typeof localStorage?localStorage.getItem(f):null;if(e&&a[e])return e;try{const e=JSON.parse(localStorage.getItem("weather_cities")||"");if(Array.isArray(e)&&e[0]&&a[e[0]])return localStorage.setItem(f,e[0]),e[0]}catch{}return function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;for(const[t,r]of Object.entries(a))if(r.tz===e)return t}catch{}return"London"}()}var x=r;function b(e,t=!1){try{if(t){const t=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!1}).formatToParts(/* @__PURE__ */new Date),a=parseInt(t.find(e=>"hour"===e.type)?.value||"0"),r=parseInt(t.find(e=>"minute"===e.type)?.value||"0");return`${String(a).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(/* @__PURE__ */new Date),r=parseInt(a.find(e=>"hour"===e.type)?.value||"12"),n=parseInt(a.find(e=>"minute"===e.type)?.value||"0"),i=a.find(e=>"dayPeriod"===e.type)?.value||"";return`${r}:${String(n).padStart(2,"0")} ${i}`}catch{return""}}function w(){/* @__PURE__ */
1
+ import{fetchCityWeather as e,getCondition as t,AVAILABLE_CITIES as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-M4AKWGQM.js";import{useWidgetSettings as s}from"./chunk-DLD4AKVT.js";import{useShellPrefs as o}from"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-VNEH2Y6H.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useState as l,useEffect as c,useCallback as d}from"react";import{jsx as m,jsxs as p,Fragment as h}from"react/jsx-runtime";var f="weather_city",u="weather_appearance",y={useFahrenheit:!1,showLocalTime:!0,use24Hour:!1};function g(){const e="undefined"!=typeof localStorage?localStorage.getItem(f):null;if(e&&a[e])return e;try{const e=JSON.parse(localStorage.getItem("weather_cities")||"");if(Array.isArray(e)&&e[0]&&a[e[0]])return localStorage.setItem(f,e[0]),e[0]}catch{}return function(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;for(const[t,r]of Object.entries(a))if(r.tz===e)return t}catch{}return"London"}()}var x=r;function b(e,t=!1){try{if(t){const t=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!1}).formatToParts(/* @__PURE__ */new Date),a=parseInt(t.find(e=>"hour"===e.type)?.value||"0"),r=parseInt(t.find(e=>"minute"===e.type)?.value||"0");return`${String(a).padStart(2,"0")}:${String(r).padStart(2,"0")}`}const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(/* @__PURE__ */new Date),r=parseInt(a.find(e=>"hour"===e.type)?.value||"12"),n=parseInt(a.find(e=>"minute"===e.type)?.value||"0"),i=a.find(e=>"dayPeriod"===e.type)?.value||"";return`${r}:${String(n).padStart(2,"0")} ${i}`}catch{return""}}function w(){/* @__PURE__ */
2
2
  return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
3
3
  /* @__PURE__ */m("div",{className:"absolute -top-5 -right-5 w-24 h-24",style:{animation:"wx-sun-rays 70s linear infinite"},children:/* @__PURE__ */m("svg",{viewBox:"0 0 100 100",className:"w-full h-full",children:Array.from({length:12}).map((e,t)=>/* @__PURE__ */m("rect",{x:49,y:3,width:2,height:14,rx:1,fill:"rgba(255, 232, 130, 0.55)",transform:`rotate(${30*t} 50 50)`},t))})}),
4
4
  /* @__PURE__ */m("div",{className:"absolute top-1 right-1 w-10 h-10 rounded-full",style:{background:"radial-gradient(circle at 35% 35%, #fff8cc 0%, #ffd84a 55%, #ff9e2a 100%)",boxShadow:"0 0 18px 5px rgba(255, 200, 80, 0.55)",animation:"wx-sun-pulse 4.5s ease-in-out infinite"}})]})}function v(){const e=Array.from({length:16}).map((e,t)=>({left:(53*t+11)%95+"%",top:(37*t+9)%78+"%",size:1+13*t%3,delay:.41*t%4+"s",duration:2.5+7*t%5*.6+"s"}));/* @__PURE__ */
@@ -24,37 +24,37 @@ return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none"
24
24
  /* @__PURE__ */m(k,{heavy:!0}),
25
25
  /* @__PURE__ */m("div",{className:"absolute inset-0 bg-white",style:{animation:"wx-flash 6s ease-out infinite"}}),
26
26
  /* @__PURE__ */m("div",{className:"absolute inset-y-0 right-1/3 flex items-center justify-center pointer-events-none",style:{animation:"wx-bolt 6s ease-out infinite"},children:/* @__PURE__ */m("svg",{viewBox:"0 0 18 60",className:"h-4/5",style:{filter:"drop-shadow(0 0 6px rgba(255, 240, 150, 0.95)) drop-shadow(0 0 14px rgba(255, 220, 90, 0.7))"},children:/* @__PURE__ */m("path",{d:"M11 0 L2 28 L8 30 L4 60 L16 24 L9 22 Z",fill:"rgba(255, 250, 200, 0.98)",stroke:"rgba(255, 255, 255, 0.9)",strokeWidth:.3})})})]})}function j(){/* @__PURE__ */
27
- return m("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */m("div",{className:"absolute left-0 right-0",style:{top:10+22*t+"%",height:"14px",background:"linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%)",filter:"blur(2px)",animation:`wx-fog-drift ${10+3*t}s ease-in-out ${.7*t}s infinite alternate`}},t))})}function I({code:e,isDay:t}){return 0===e||1===e?/* @__PURE__ */m(t?w:v,{}):2===e?/* @__PURE__ */p(h,{children:[/* @__PURE__ */m(t?w:v,{}),
28
- /* @__PURE__ */m(N,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */m(N,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */m(j,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */m(k,{}):[55,63,65,82].includes(e)?/* @__PURE__ */m(k,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */m(S,{}):[95,96,99].includes(e)?/* @__PURE__ */m($,{}):null}function D(){const[r,w]=l(g),[v,N]=l(()=>n(u)),[k,S]=l(null),[$,j]=l(!0),[,D]=l(0);c(()=>{const e=setInterval(()=>D(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[T,F]=l(!1),[C,A]=l(r),[H,L]=l(v),{prefs:z,save:P}=o(),B={...y,...z.weather_prefs??{}},[O,X]=l(B);s(d(()=>{A(r),L({...v}),X({...B}),F(!0)},[r,v,B])),c(()=>{let t=!1;return j(!0),e(r).then(e=>{t||(S(e),j(!1))}),()=>{t=!0}},[r]);const Z=e=>B.useFahrenheit?`${x(e)}°F`:`${e}°`;if($&&!k)/* @__PURE__ */
27
+ return m("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:Array.from({length:4}).map((e,t)=>/* @__PURE__ */m("div",{className:"absolute left-0 right-0",style:{top:10+22*t+"%",height:"14px",background:"linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%)",filter:"blur(2px)",animation:`wx-fog-drift ${10+3*t}s ease-in-out ${.7*t}s infinite alternate`}},t))})}function D({code:e,isDay:t}){return 0===e||1===e?/* @__PURE__ */m(t?w:v,{}):2===e?/* @__PURE__ */p(h,{children:[/* @__PURE__ */m(t?w:v,{}),
28
+ /* @__PURE__ */m(N,{tone:t?"light":"dark"})]}):3===e?/* @__PURE__ */m(N,{tone:t?"light":"dark"}):45===e||48===e?/* @__PURE__ */m(j,{}):[51,53,61,80,81].includes(e)?/* @__PURE__ */m(k,{}):[55,63,65,82].includes(e)?/* @__PURE__ */m(k,{heavy:!0}):[71,73,75].includes(e)?/* @__PURE__ */m(S,{}):[95,96,99].includes(e)?/* @__PURE__ */m($,{}):null}function I(){const[r,w]=l(g),[v,N]=l(()=>n(u)),[k,S]=l(null),[$,j]=l(!0),[,I]=l(0);c(()=>{const e=setInterval(()=>I(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[T,A]=l(!1),[F,H]=l(r),[L,C]=l(v),{prefs:z,save:B}=o(),O={...y,...z.weather_prefs??{}},[P,M]=l(O);s(d(()=>{H(r),C({...v}),M({...O}),A(!0)},[r,v,O])),c(()=>{let t=!1;return j(!0),e(r).then(e=>{t||(S(e),j(!1))}),()=>{t=!0}},[r]);const V=e=>O.useFahrenheit?`${x(e)}°F`:`${e}°`;if($&&!k)/* @__PURE__ */
29
29
  return m("div",{className:"flex items-center justify-center h-full bg-gradient-to-b from-sky-400 to-blue-500 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Loading…"});if(!k)/* @__PURE__ */
30
- return m("div",{className:"flex items-center justify-center h-full bg-slate-700 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Couldn't load weather"});const[J,M,V]=t(k.code,k.isDay);/* @__PURE__ */
30
+ return m("div",{className:"flex items-center justify-center h-full bg-slate-700 rounded-lg text-white/80 text-xs",style:{minHeight:110},children:"Couldn't load weather"});const[X,Z,_]=t(k.code,k.isDay);/* @__PURE__ */
31
31
  return p(h,{children:[
32
32
  /* @__PURE__ */m("style",{children:"\n@keyframes wx-rain-a { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 0.95; } 100% { transform: translate(8px,140px); opacity: 0; } }\n@keyframes wx-rain-b { 0% { transform: translate(0,-20px); opacity: 0; } 12% { opacity: 0.85; } 100% { transform: translate(12px,140px); opacity: 0; } }\n@keyframes wx-rain-c { 0% { transform: translate(0,-20px); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(5px,140px); opacity: 0; } }\n@keyframes wx-snow-a { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.9; } 50% { transform: translate(10px,55px) rotate(180deg); } 100% { transform: translate(-4px,140px) rotate(360deg); opacity: 0; } }\n@keyframes wx-snow-b { 0% { transform: translate(0,-12px) rotate(0deg); opacity: 0; } 10% { opacity: 0.85; } 50% { transform: translate(-12px,55px) rotate(-180deg); } 100% { transform: translate(6px,140px) rotate(-360deg); opacity: 0; } }\n@keyframes wx-snow-c { 0% { transform: translate(0,-12px); opacity: 0; } 10% { opacity: 0.7; } 100% { transform: translate(2px,140px); opacity: 0; } }\n@keyframes wx-drift-cloud { 0% { transform: translateX(-40%); } 100% { transform: translateX(140%); } }\n@keyframes wx-twinkle { 0%, 100% { opacity: 0.25; transform: scale(1); } 50% { opacity: 1; transform: scale(1.6); } }\n@keyframes wx-flash { 0%, 86%, 100% { opacity: 0; } 87% { opacity: 0.95; } 88% { opacity: 0.15; } 89% { opacity: 0.85; } 90% { opacity: 0; } }\n@keyframes wx-bolt { 0%, 86%, 90%, 100% { opacity: 0; } 87% { opacity: 1; } 89% { opacity: 0.85; } }\n@keyframes wx-sun-pulse { 0%, 100% { transform: scale(1); opacity: 0.65; } 50% { transform: scale(1.12); opacity: 0.95; } }\n@keyframes wx-sun-rays { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }\n@keyframes wx-fog-drift { 0% { transform: translateX(-25%); opacity: 0.3; } 50% { opacity: 0.65; } 100% { transform: translateX(25%); opacity: 0.3; } }\n@keyframes wx-shooting-star { 0%, 95% { opacity: 0; transform: translate(0,0) scale(0); } 96% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(40px,30px) scale(1); } }\n"}),
33
- /* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${v.activeOpacity/100})`,backdropFilter:v.activeBlur>0?`blur(${v.activeBlur}px)`:void 0},children:/* @__PURE__ */p("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${V}`,style:{height:110},children:[
34
- /* @__PURE__ */m(I,{code:k.code,isDay:k.isDay}),
33
+ /* @__PURE__ */m("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:`rgba(15, 23, 42, ${v.activeOpacity/100})`,backdropFilter:v.activeBlur>0?`blur(${v.activeBlur}px)`:void 0},children:/* @__PURE__ */p("div",{className:`relative rounded-lg overflow-hidden text-white bg-gradient-to-br ${_}`,style:{height:110},children:[
34
+ /* @__PURE__ */m(D,{code:k.code,isDay:k.isDay}),
35
35
  /* @__PURE__ */p("div",{className:"relative z-10 px-3 py-2.5 flex flex-col h-full justify-between",children:[
36
36
  /* @__PURE__ */p("div",{className:"flex items-start justify-between gap-2",children:[
37
37
  /* @__PURE__ */p("div",{className:"min-w-0 flex-1",children:[
38
- /* @__PURE__ */m("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:k.city}),B.showLocalTime&&/* @__PURE__ */m("div",{className:"text-[10px] opacity-90 leading-tight tabular-nums drop-shadow-sm",children:b(k.timezone,B.use24Hour)})]}),
39
- /* @__PURE__ */m("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:Z(k.temp)})]}),
38
+ /* @__PURE__ */m("div",{className:"text-base font-semibold leading-tight truncate drop-shadow-sm",children:k.city}),O.showLocalTime&&/* @__PURE__ */m("div",{className:"text-[10px] opacity-90 leading-tight tabular-nums drop-shadow-sm",children:b(k.timezone,O.use24Hour)})]}),
39
+ /* @__PURE__ */m("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:V(k.temp)})]}),
40
40
  /* @__PURE__ */p("div",{className:"flex items-end justify-between gap-2",children:[
41
41
  /* @__PURE__ */p("div",{className:"flex items-center gap-1.5 min-w-0",children:[
42
- /* @__PURE__ */m("span",{className:"text-lg leading-none drop-shadow-sm",children:M}),
43
- /* @__PURE__ */m("span",{className:"text-[11px] font-medium drop-shadow-sm truncate",children:J})]}),
44
- /* @__PURE__ */p("span",{className:"text-[10px] opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",Z(k.high)," L:",Z(k.low)]})]})]})]})}),
45
- /* @__PURE__ */p(i,{open:T,onClose:()=>F(!1),title:"Weather Settings",appearance:H,onAppearanceChange:L,onSave:()=>{w(C),N(H),P({weather_prefs:O}),localStorage.setItem(f,C),localStorage.setItem(u,JSON.stringify(H)),F(!1)},children:[
42
+ /* @__PURE__ */m("span",{className:"text-lg leading-none drop-shadow-sm",children:Z}),
43
+ /* @__PURE__ */m("span",{className:"text-[11px] font-medium drop-shadow-sm truncate",children:X})]}),
44
+ /* @__PURE__ */p("span",{className:"text-[10px] opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",V(k.high)," L:",V(k.low)]})]})]})]})}),
45
+ /* @__PURE__ */p(i,{open:T,onClose:()=>A(!1),title:"Weather Settings",appearance:L,onAppearanceChange:C,onSave:()=>{w(F),N(L),B({weather_prefs:P}),localStorage.setItem(f,F),localStorage.setItem(u,JSON.stringify(L)),A(!1)},children:[
46
46
  /* @__PURE__ */m("div",{className:"space-y-3",children:/* @__PURE__ */p("div",{children:[
47
47
  /* @__PURE__ */m("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
48
48
  /* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
49
49
  /* @__PURE__ */m("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
50
- /* @__PURE__ */m("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */m("button",{onClick:()=>X(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(O.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
50
+ /* @__PURE__ */m("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */m("button",{onClick:()=>M(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(P.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
51
51
  /* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
52
52
  /* @__PURE__ */m("span",{className:"text-sm text-gray-600 w-24",children:"Time Format"}),
53
- /* @__PURE__ */m("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */m("button",{onClick:()=>X(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(O.use24Hour===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
53
+ /* @__PURE__ */m("div",{className:"flex gap-1",children:[{key:!1,label:"AM/PM"},{key:!0,label:"24H"}].map(e=>/* @__PURE__ */m("button",{onClick:()=>M(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(P.use24Hour===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
54
54
  /* @__PURE__ */p("label",{className:"flex items-center gap-2 cursor-pointer",children:[
55
- /* @__PURE__ */m("input",{type:"checkbox",checked:O.showLocalTime,onChange:e=>X(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
55
+ /* @__PURE__ */m("input",{type:"checkbox",checked:P.showLocalTime,onChange:e=>M(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
56
56
  /* @__PURE__ */m("span",{className:"text-sm text-gray-600",children:"Show local time"})]})]})}),
57
57
  /* @__PURE__ */p("div",{children:[
58
58
  /* @__PURE__ */m("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"City"}),
59
- /* @__PURE__ */m("select",{value:C,onChange:e=>A(e.target.value),className:"w-full bg-gray-50 border border-gray-200 rounded px-2 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:Object.keys(a).map(e=>/* @__PURE__ */m("option",{value:e,children:e},e))}),
60
- /* @__PURE__ */m("p",{className:"mt-1 text-[10px] text-gray-400",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{D as default};
59
+ /* @__PURE__ */m("select",{value:F,onChange:e=>H(e.target.value),className:"w-full bg-gray-50 border border-gray-200 rounded px-2 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:Object.keys(a).map(e=>/* @__PURE__ */m("option",{value:e,children:e},e))}),
60
+ /* @__PURE__ */m("p",{className:"mt-1 text-[10px] text-gray-400",children:"Auto-detected from your timezone; change if needed."})]})]})]})}export{I as default};
@@ -1,6 +1,6 @@
1
- import{AVAILABLE_CITIES as e,fetchCityWeather as t,getCondition as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-DRN636EP.js";import{useWidgetSettings as s}from"./chunk-XC64WV33.js";import{useShellPrefs as c}from"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-J7LKJIZC.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useState as l,useEffect as o,useCallback as m}from"react";import{jsxs as h,Fragment as d,jsx as p}from"react/jsx-runtime";var u="world_clock_appearance",g=["London","Shanghai","New York"];function x(){const{prefs:x,save:y}=c(),[b,f]=l(()=>n(u)),[k,v]=l(!1),[N,w]=l([]),[j,F]=l(b),C={useFahrenheit:!!x.weather_prefs?.useFahrenheit},[D,P]=l(C),[S,T]=l(()=>/* @__PURE__ */new Date);o(()=>{const e=setInterval(()=>T(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const I=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),O=x.world_clocks,_=(()=>{if(!Array.isArray(O)||0===O.length)return g;const t=[];for(const a of O){const r=e[a]?a:I[a];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[A,H]=l({}),[$,B]=l(!0);o(()=>{let e=!1;return B(!0),(async()=>{const a={};await Promise.all(_.map(async e=>{const r=await t(e);r&&(a[e]=r)})),e||(H(a),B(!1))})(),()=>{e=!0}},[_.join(",")]),s(m(()=>{w([..._]),F({...b}),P({...C}),v(!0)},[_.join(","),b,C.useFahrenheit]));const J=e=>C.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
1
+ import{AVAILABLE_CITIES as e,fetchCityWeather as t,getCondition as a,toFahrenheit as r}from"./chunk-FBDZGO3V.js";import{loadAppearance as n,WidgetSettingsModal as i}from"./chunk-M4AKWGQM.js";import{useWidgetSettings as s}from"./chunk-DLD4AKVT.js";import{useShellPrefs as c}from"./chunk-T6MKFQRH.js";import"./chunk-6UXY7MPY.js";import"./chunk-PH3PRIFP.js";import"./chunk-PDTZTADH.js";import"./chunk-VNEH2Y6H.js";import"./chunk-OSJ3ADF2.js";import"./chunk-MAIHBBWT.js";import"./chunk-VVI77XNV.js";import"./chunk-D65T4H6J.js";import{useState as l,useEffect as o,useCallback as m}from"react";import{jsxs as h,Fragment as d,jsx as p}from"react/jsx-runtime";var u="world_clock_appearance",g=["London","Shanghai","New York"];function x(){const{prefs:x,save:y}=c(),[b,f]=l(()=>n(u)),[k,v]=l(!1),[N,w]=l([]),[j,F]=l(b),D={useFahrenheit:!!x.weather_prefs?.useFahrenheit},[C,T]=l(D),[S,A]=l(()=>/* @__PURE__ */new Date);o(()=>{const e=setInterval(()=>A(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const H=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),P=x.world_clocks,I=(()=>{if(!Array.isArray(P)||0===P.length)return g;const t=[];for(const a of P){const r=e[a]?a:H[a];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[O,_]=l({}),[V,$]=l(!0);o(()=>{let e=!1;return $(!0),(async()=>{const a={};await Promise.all(I.map(async e=>{const r=await t(e);r&&(a[e]=r)})),e||(_(a),$(!1))})(),()=>{e=!0}},[I.join(",")]),s(m(()=>{w([...I]),F({...b}),T({...D}),v(!0)},[I.join(","),b,D.useFahrenheit]));const B=e=>D.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
2
2
  return h(d,{children:[
3
- /* @__PURE__ */p("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${b.activeOpacity/100})`,backdropFilter:b.activeBlur>0?`blur(${b.activeBlur}px)`:void 0},children:/* @__PURE__ */h("div",{className:"divide-y divide-gray-200",children:[$&&_.every(e=>!A[e])&&/* @__PURE__ */p("div",{className:"px-3 py-6 text-center text-xs text-gray-500",children:"Loading…"}),_.map(t=>{const r=A[t],n=e[t]?.tz??"UTC",{time:i,ampm:s}=function(e,t){try{const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(t),r=a.find(e=>"hour"===e.type)?.value||"12";return{time:`${r}:${a.find(e=>"minute"===e.type)?.value||"00"}`,ampm:(a.find(e=>"dayPeriod"===e.type)?.value||"").toUpperCase()}}catch{return{time:"",ampm:""}}}(n,S);if(!r)/* @__PURE__ */
3
+ /* @__PURE__ */p("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${b.activeOpacity/100})`,backdropFilter:b.activeBlur>0?`blur(${b.activeBlur}px)`:void 0},children:/* @__PURE__ */h("div",{className:"divide-y divide-gray-200",children:[V&&I.every(e=>!O[e])&&/* @__PURE__ */p("div",{className:"px-3 py-6 text-center text-xs text-gray-500",children:"Loading…"}),I.map(t=>{const r=O[t],n=e[t]?.tz??"UTC",{time:i,ampm:s}=function(e,t){try{const a=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",hour12:!0}).formatToParts(t),r=a.find(e=>"hour"===e.type)?.value||"12";return{time:`${r}:${a.find(e=>"minute"===e.type)?.value||"00"}`,ampm:(a.find(e=>"dayPeriod"===e.type)?.value||"").toUpperCase()}}catch{return{time:"",ampm:""}}}(n,S);if(!r)/* @__PURE__ */
4
4
  return h("div",{className:"px-4 py-3",children:[
5
5
  /* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-2",children:[
6
6
  /* @__PURE__ */p("span",{className:"text-[15px] font-semibold tracking-tight text-gray-900 truncate",children:t}),
@@ -10,7 +10,7 @@ return h("div",{className:"px-4 py-3",children:[
10
10
  return h("div",{className:"px-4 py-3",children:[
11
11
  /* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-2",children:[
12
12
  /* @__PURE__ */p("span",{className:"text-[15px] font-semibold tracking-tight text-gray-900 truncate",children:t}),
13
- /* @__PURE__ */p("span",{className:"text-[26px] font-extralight leading-none tabular-nums tracking-tight text-gray-900 shrink-0",children:J(r.temp)})]}),
13
+ /* @__PURE__ */p("span",{className:"text-[26px] font-extralight leading-none tabular-nums tracking-tight text-gray-900 shrink-0",children:B(r.temp)})]}),
14
14
  /* @__PURE__ */h("div",{className:"flex items-center justify-between gap-2 mt-1.5 text-[11px]",children:[
15
15
  /* @__PURE__ */h("div",{className:"flex items-center gap-1.5 min-w-0 text-gray-500",children:[
16
16
  /* @__PURE__ */p("span",{className:"text-base leading-none shrink-0",children:l}),
@@ -18,13 +18,13 @@ return h("div",{className:"px-4 py-3",children:[
18
18
  /* @__PURE__ */p("span",{className:"text-[9px] font-medium ml-0.5 opacity-70",children:s})]}),
19
19
  /* @__PURE__ */p("span",{className:"text-gray-300 shrink-0",children:"·"}),
20
20
  /* @__PURE__ */p("span",{className:"truncate",children:c})]}),
21
- /* @__PURE__ */h("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",J(r.high)," L:",J(r.low)]})]})]},t)})]})}),
22
- /* @__PURE__ */h(i,{open:k,onClose:()=>v(!1),title:"World Clock Settings",appearance:j,onAppearanceChange:F,onSave:()=>{0!==N.length&&(y({world_clocks:N,weather_prefs:{...x.weather_prefs??{},useFahrenheit:D.useFahrenheit}}),f(j),localStorage.setItem(u,JSON.stringify(j)),v(!1))},children:[
21
+ /* @__PURE__ */h("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",B(r.high)," L:",B(r.low)]})]})]},t)})]})}),
22
+ /* @__PURE__ */h(i,{open:k,onClose:()=>v(!1),title:"World Clock Settings",appearance:j,onAppearanceChange:F,onSave:()=>{0!==N.length&&(y({world_clocks:N,weather_prefs:{...x.weather_prefs??{},useFahrenheit:C.useFahrenheit}}),f(j),localStorage.setItem(u,JSON.stringify(j)),v(!1))},children:[
23
23
  /* @__PURE__ */h("div",{children:[
24
24
  /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
25
25
  /* @__PURE__ */h("div",{className:"flex items-center gap-3 mb-2",children:[
26
26
  /* @__PURE__ */p("span",{className:"text-sm text-gray-600 w-24",children:"Temperature"}),
27
- /* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>P(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(D.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
27
+ /* @__PURE__ */p("div",{className:"flex gap-1",children:[{key:!1,label:"°C"},{key:!0,label:"°F"}].map(e=>/* @__PURE__ */p("button",{onClick:()=>T(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(C.useFahrenheit===e.key?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:bg-gray-50"),children:e.label},String(e.key)))})]}),
28
28
  /* @__PURE__ */p("p",{className:"text-[10px] text-gray-400 mt-1",children:"Shared with the Weather widget."})]}),
29
29
  /* @__PURE__ */h("div",{children:[
30
30
  /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Cities"}),
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{openFilesInTrashMode,setFilesDemoTree}from"../chunk-JGHRZYNV.js";export{BUILTIN_APP_INFO}from"../chunk-5DVD4E4P.js";import"../chunk-KZPQW6UL.js";import{setPdfPreview as e}from"../chunk-ESL5TDNA.js";export{setPdfPreview}from"../chunk-ESL5TDNA.js";import{toast_default as t}from"../chunk-B2TBCVHH.js";import{setSpreadsheetPreview as o}from"../chunk-VTVSMRFX.js";export{setSpreadsheetPreview}from"../chunk-VTVSMRFX.js";import"../chunk-O5BOGWO3.js";import"../chunk-XC64WV33.js";import"../chunk-T6MKFQRH.js";import"../chunk-6UXY7MPY.js";import"../chunk-PH3PRIFP.js";import"../chunk-PDTZTADH.js";import"../chunk-J7LKJIZC.js";import"../chunk-OSJ3ADF2.js";import"../chunk-MAIHBBWT.js";import"../chunk-VVI77XNV.js";import"../chunk-D65T4H6J.js";import{lazy as i}from"react";function n(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var r=/* @__PURE__ */new Set(["csv","tsv"]),s=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),a=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),l=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function c(e){const t=n(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":r.has(t)?"csv":a.has(t)?"image":l.has(t)?"3d":null}function p(e){window.open(e,"_blank","noopener,noreferrer")}async function m(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const i=await fetch(e);if(!i.ok)throw new Error(`fetch failed: ${i.status}`);return i.text()}function u(e,t){return(e instanceof Error?e.message:"")||t}async function h(i,r,a={}){const l=i?.url||"",h=i?.filename||"attachment";if(!l&&!a.fetchBlob)return void t.error("This attachment has no download link.");const d=c(h)??c(l);if("csv"===d){try{o({csv:await m(l,a,i),filename:h}),r("/spreadsheet")}catch{t.error("Could not open the spreadsheet — opening the file instead."),l&&p(l)}return}if(s.has(n(h)||n(l)))return t.error("Spreadsheet preview is unavailable for this file type. Opening the file instead."),void(l&&p(l));if(!d)return l?(t.info("Opening this file outside the app — no viewer can show it here."),void p(l)):void t.error("This attachment has no download link.");if(!a.fetchBlob)return e({url:l,filename:h,kind:d}),void r("/preview");const f=e({filename:h,kind:d,converting:!0,convertingMessage:a.loadingMessage||"LOADING FILE"});r("/preview");try{const e=await a.fetchBlob(i);f.update({url:URL.createObjectURL(e),filename:h,kind:d})}catch(e){f.update({filename:h,kind:d,converting:!1,convertingMessage:u(e,"Failed to load this file.")})}}var d=i(()=>import("../Calculator-5DF4PSEG.js")),f=i(()=>import("../Spreadsheet-7PMGYBO6.js")),w=i(()=>import("../Weather-6EJFJQIX.js")),j=i(()=>import("../CurrencyConverter-BEI6UUDD.js")),k=i(()=>import("../PomodoroTimer-3BDFGHC6.js")),g=i(()=>import("../Notepad-U67M72JS.js")),v=i(()=>import("../WorldClock-5BMGEL2A.js")),b=i(()=>import("../Stock-PEZB3WXV.js")),P=i(()=>import("../Preview-O52DJFV6.js")),S=i(()=>import("../PdfViewer-VIT7Y55M.js")),B=i(()=>import("../Documents-5WGBDLTF.js")),T=i(()=>import("../Files-62DPJ4NN.js")),x=i(()=>import("../Browser-WBZPCS6W.js")),y={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/spreadsheet":{component:f,label:"Spreadsheets",size:"2xl",appStyle:!0,multiInstance:!0},"/notepad":{component:g,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:w,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:j,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:k,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:v,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:b,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},D={"/preview":{component:P,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/documents":{component:B,label:"Documents",size:"xl",appStyle:!0,multiInstance:!0},"/files":{component:T,label:"Files",size:"xl",appStyle:!0}},F={"/browser":{component:x,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},I={...y,...D,...F};export{x as Browser,d as Calculator,j as CurrencyConverter,B as Documents,T as Files,g as Notepad,S as PdfViewer,k as PomodoroTimer,P as Preview,f as Spreadsheet,b as Stock,w as Weather,v as WorldClock,c as attachmentKind,I as bundledApps,D as documentApps,h as openAttachment,y as utilityApps,F as webApps};
2
+ export{openFilesInTrashMode,setFilesDemoTree}from"../chunk-JGHRZYNV.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-EI4WZOP3.js";import"../chunk-KZPQW6UL.js";import{setPdfPreview as e}from"../chunk-ESL5TDNA.js";export{setPdfPreview}from"../chunk-ESL5TDNA.js";import{toast_default as t}from"../chunk-B2TBCVHH.js";import{setSpreadsheetPreview as o}from"../chunk-VTVSMRFX.js";export{setSpreadsheetPreview}from"../chunk-VTVSMRFX.js";import"../chunk-L4KRS7N3.js";import"../chunk-DLD4AKVT.js";import"../chunk-T6MKFQRH.js";import"../chunk-6UXY7MPY.js";import"../chunk-PH3PRIFP.js";import"../chunk-PDTZTADH.js";import"../chunk-VNEH2Y6H.js";import"../chunk-OSJ3ADF2.js";import"../chunk-MAIHBBWT.js";import"../chunk-VVI77XNV.js";import"../chunk-D65T4H6J.js";import{lazy as i}from"react";function n(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var r=/* @__PURE__ */new Set(["csv","tsv"]),s=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),a=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),l=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function c(e){const t=n(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":r.has(t)?"csv":a.has(t)?"image":l.has(t)?"3d":null}function p(e){window.open(e,"_blank","noopener,noreferrer")}async function m(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const i=await fetch(e);if(!i.ok)throw new Error(`fetch failed: ${i.status}`);return i.text()}function u(e,t){return(e instanceof Error?e.message:"")||t}async function h(i,r,a={}){const l=i?.url||"",h=i?.filename||"attachment";if(!l&&!a.fetchBlob)return void t.error("This attachment has no download link.");const d=c(h)??c(l);if("csv"===d){try{o({csv:await m(l,a,i),filename:h}),r("/spreadsheet")}catch{t.error("Could not open the spreadsheet — opening the file instead."),l&&p(l)}return}if(s.has(n(h)||n(l)))return t.error("Spreadsheet preview is unavailable for this file type. Opening the file instead."),void(l&&p(l));if(!d)return l?(t.info("Opening this file outside the app — no viewer can show it here."),void p(l)):void t.error("This attachment has no download link.");if(!a.fetchBlob)return e({url:l,filename:h,kind:d}),void r("/preview");const f=e({filename:h,kind:d,converting:!0,convertingMessage:a.loadingMessage||"LOADING FILE"});r("/preview");try{const e=await a.fetchBlob(i);f.update({url:URL.createObjectURL(e),filename:h,kind:d})}catch(e){f.update({filename:h,kind:d,converting:!1,convertingMessage:u(e,"Failed to load this file.")})}}var d=i(()=>import("../Calculator-YBL65JNM.js")),f=i(()=>import("../Spreadsheet-6NK53IZV.js")),w=i(()=>import("../Weather-BBPTXGQA.js")),j=i(()=>import("../CurrencyConverter-6VFY4GF6.js")),k=i(()=>import("../PomodoroTimer-6OQ33FY3.js")),g=i(()=>import("../Notepad-RJ2DYW2O.js")),v=i(()=>import("../WorldClock-CQGQ2Y6N.js")),T=i(()=>import("../Stock-ZFLDG6TT.js")),b=i(()=>import("../Preview-3WRPZWDU.js")),P=i(()=>import("../PdfViewer-VIT7Y55M.js")),S=i(()=>import("../Documents-IPXRU4CT.js")),x=i(()=>import("../Files-3MGL4ZT7.js")),y=i(()=>import("../Browser-OQCHLKM3.js")),B={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/spreadsheet":{component:f,label:"Spreadsheets",size:"2xl",appStyle:!0,multiInstance:!0},"/notepad":{component:g,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:w,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:j,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:k,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:v,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:T,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},I={"/preview":{component:b,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/documents":{component:S,label:"Documents",size:"xl",appStyle:!0,multiInstance:!0},"/files":{component:x,label:"Files",size:"xl",appStyle:!0}},L={"/browser":{component:y,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},F={...B,...I,...L};export{y as Browser,d as Calculator,j as CurrencyConverter,S as Documents,x as Files,g as Notepad,P as PdfViewer,k as PomodoroTimer,b as Preview,f as Spreadsheet,T as Stock,w as Weather,v as WorldClock,c as attachmentKind,F as bundledApps,I as documentApps,h as openAttachment,B as utilityApps,L as webApps};