efficient-shell 4.137.0 → 4.137.1

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 (166) hide show
  1. package/LICENSE +6 -17
  2. package/README.md +3 -1
  3. package/dist/Browser-ZX5OTOKK.js +43 -0
  4. package/dist/Calculator-4SQGOQFQ.js +29 -0
  5. package/dist/ConfirmDialog-NPKW2XHM.js +1 -0
  6. package/dist/CurrencyConverter-2KOM7L6V.js +21 -0
  7. package/dist/Documents-IZTIQYPG.js +52 -0
  8. package/dist/Files-B63KKXGZ.js +89 -0
  9. package/dist/Notepad-WA77V45J.js +25 -0
  10. package/dist/PdfViewer-RBRGEKWF.js +1 -0
  11. package/dist/PomodoroTimer-SDUBKXUS.js +99 -0
  12. package/dist/Preview-D4KOA4OI.js +187 -0
  13. package/dist/Sidebar-Y57LYXXI.js +23 -0
  14. package/dist/Spreadsheet-JX5E6WH6.js +37 -0
  15. package/dist/Stock-XAQ5WMUZ.js +16 -0
  16. package/dist/Weather-HLAGJ5LV.js +60 -0
  17. package/dist/WorldClock-IRI4VCTA.js +32 -0
  18. package/dist/apps/index.js +1 -151
  19. package/dist/chunk-3A46NCXK.js +29 -0
  20. package/dist/chunk-44UO7FYU.js +11 -0
  21. package/dist/chunk-466CM2TJ.js +1 -0
  22. package/dist/chunk-57MIENLJ.js +1 -0
  23. package/dist/chunk-5CRAF2AD.js +2 -0
  24. package/dist/chunk-A2OQLLYK.js +6 -0
  25. package/dist/chunk-B43AGQET.js +4 -0
  26. package/dist/chunk-BR22X7E5.js +1 -0
  27. package/dist/chunk-BUTSU7FO.js +1 -0
  28. package/dist/chunk-D65T4H6J.js +1 -0
  29. package/dist/chunk-ESL5TDNA.js +1 -0
  30. package/dist/chunk-FBDZGO3V.js +1 -0
  31. package/dist/chunk-FHTLC7HH.js +1 -0
  32. package/dist/chunk-FQLMX3IE.js +948 -0
  33. package/dist/chunk-H562R4GX.js +34 -0
  34. package/dist/chunk-JN4WXTWJ.js +106 -0
  35. package/dist/chunk-LVDRBRYU.js +1 -0
  36. package/dist/chunk-LWLCNQY7.js +1 -0
  37. package/dist/chunk-MAIHBBWT.js +1 -0
  38. package/dist/chunk-NPJH5MD7.js +13 -0
  39. package/dist/chunk-OCSOMMY2.js +1 -0
  40. package/dist/chunk-OQDWLHZI.js +1 -0
  41. package/dist/chunk-OWSAMA3I.js +23 -0
  42. package/dist/chunk-PH3PRIFP.js +5 -0
  43. package/dist/chunk-TAWKWSPN.js +9 -0
  44. package/dist/chunk-U4GTZPXP.js +1 -0
  45. package/dist/chunk-UB4JIOLD.js +2 -0
  46. package/dist/chunk-UZAJ5BF6.js +9 -0
  47. package/dist/chunk-VEGMDXT4.js +1 -0
  48. package/dist/chunk-VTVSMRFX.js +1 -0
  49. package/dist/chunk-VVAGSKW7.js +1 -0
  50. package/dist/chunk-XO43FJRM.js +19 -0
  51. package/dist/chunk-Y7BOLDRM.js +69 -0
  52. package/dist/file-intake/index.js +1 -4
  53. package/dist/index.js +639 -7473
  54. package/dist/map/index.js +20 -540
  55. package/dist/markdown/index.js +6 -184
  56. package/dist/markup/index.js +1 -135
  57. package/dist/page-tabs/index.js +21 -709
  58. package/dist/sounds-OMHXVVQ4.js +1 -0
  59. package/dist/ui/index.js +1 -19
  60. package/package.json +4 -3
  61. package/dist/Browser-ZNX4WFUH.js +0 -482
  62. package/dist/Browser-ZNX4WFUH.js.map +0 -1
  63. package/dist/Calculator-6FGNKOXU.js +0 -192
  64. package/dist/Calculator-6FGNKOXU.js.map +0 -1
  65. package/dist/ConfirmDialog-NPQMIGUR.js +0 -4
  66. package/dist/ConfirmDialog-NPQMIGUR.js.map +0 -1
  67. package/dist/CurrencyConverter-FF7EXRYL.js +0 -236
  68. package/dist/CurrencyConverter-FF7EXRYL.js.map +0 -1
  69. package/dist/Documents-H3R7XSBH.js +0 -441
  70. package/dist/Documents-H3R7XSBH.js.map +0 -1
  71. package/dist/Files-ZHJIAUC2.js +0 -805
  72. package/dist/Files-ZHJIAUC2.js.map +0 -1
  73. package/dist/Notepad-VE7ISWRQ.js +0 -410
  74. package/dist/Notepad-VE7ISWRQ.js.map +0 -1
  75. package/dist/PdfViewer-SQBFYAGW.js +0 -5
  76. package/dist/PdfViewer-SQBFYAGW.js.map +0 -1
  77. package/dist/PomodoroTimer-IR3WREED.js +0 -633
  78. package/dist/PomodoroTimer-IR3WREED.js.map +0 -1
  79. package/dist/Preview-DAQGRNRM.js +0 -2959
  80. package/dist/Preview-DAQGRNRM.js.map +0 -1
  81. package/dist/Sidebar-YW6H4NDJ.js +0 -291
  82. package/dist/Sidebar-YW6H4NDJ.js.map +0 -1
  83. package/dist/Spreadsheet-HOCPHJOC.js +0 -519
  84. package/dist/Spreadsheet-HOCPHJOC.js.map +0 -1
  85. package/dist/Stock-LVRQPURG.js +0 -158
  86. package/dist/Stock-LVRQPURG.js.map +0 -1
  87. package/dist/Weather-LZQGVDJL.js +0 -431
  88. package/dist/Weather-LZQGVDJL.js.map +0 -1
  89. package/dist/WorldClock-XPD7WOZT.js +0 -202
  90. package/dist/WorldClock-XPD7WOZT.js.map +0 -1
  91. package/dist/apps/index.js.map +0 -1
  92. package/dist/chunk-5O42JXQE.js +0 -26
  93. package/dist/chunk-5O42JXQE.js.map +0 -1
  94. package/dist/chunk-5RPTS3BT.js +0 -70
  95. package/dist/chunk-5RPTS3BT.js.map +0 -1
  96. package/dist/chunk-6XJEJWNJ.js +0 -61
  97. package/dist/chunk-6XJEJWNJ.js.map +0 -1
  98. package/dist/chunk-7CCHEEYC.js +0 -94
  99. package/dist/chunk-7CCHEEYC.js.map +0 -1
  100. package/dist/chunk-BE7FZOFU.js +0 -17
  101. package/dist/chunk-BE7FZOFU.js.map +0 -1
  102. package/dist/chunk-COWYSHG2.js +0 -79
  103. package/dist/chunk-COWYSHG2.js.map +0 -1
  104. package/dist/chunk-D7PYW2QS.js +0 -265
  105. package/dist/chunk-D7PYW2QS.js.map +0 -1
  106. package/dist/chunk-DVZWYWSD.js +0 -26
  107. package/dist/chunk-DVZWYWSD.js.map +0 -1
  108. package/dist/chunk-E7TB6WD2.js +0 -153
  109. package/dist/chunk-E7TB6WD2.js.map +0 -1
  110. package/dist/chunk-FIHOGVUP.js +0 -416
  111. package/dist/chunk-FIHOGVUP.js.map +0 -1
  112. package/dist/chunk-GA35NEND.js +0 -56
  113. package/dist/chunk-GA35NEND.js.map +0 -1
  114. package/dist/chunk-HUBJAUGG.js +0 -316
  115. package/dist/chunk-HUBJAUGG.js.map +0 -1
  116. package/dist/chunk-I2TAAJHS.js +0 -465
  117. package/dist/chunk-I2TAAJHS.js.map +0 -1
  118. package/dist/chunk-ICTRCKUE.js +0 -3710
  119. package/dist/chunk-ICTRCKUE.js.map +0 -1
  120. package/dist/chunk-IPXN646P.js +0 -14
  121. package/dist/chunk-IPXN646P.js.map +0 -1
  122. package/dist/chunk-IRWSRJ4K.js +0 -48
  123. package/dist/chunk-IRWSRJ4K.js.map +0 -1
  124. package/dist/chunk-JOPU6WPY.js +0 -504
  125. package/dist/chunk-JOPU6WPY.js.map +0 -1
  126. package/dist/chunk-MGGY74RY.js +0 -14
  127. package/dist/chunk-MGGY74RY.js.map +0 -1
  128. package/dist/chunk-PVPPAWVM.js +0 -46
  129. package/dist/chunk-PVPPAWVM.js.map +0 -1
  130. package/dist/chunk-R7QGMK6N.js +0 -102
  131. package/dist/chunk-R7QGMK6N.js.map +0 -1
  132. package/dist/chunk-RT6DSB5Y.js +0 -143
  133. package/dist/chunk-RT6DSB5Y.js.map +0 -1
  134. package/dist/chunk-TRCWINHF.js +0 -105
  135. package/dist/chunk-TRCWINHF.js.map +0 -1
  136. package/dist/chunk-TW7LPMVR.js +0 -16
  137. package/dist/chunk-TW7LPMVR.js.map +0 -1
  138. package/dist/chunk-UTYKLGGT.js +0 -195
  139. package/dist/chunk-UTYKLGGT.js.map +0 -1
  140. package/dist/chunk-VNJJCH5A.js +0 -822
  141. package/dist/chunk-VNJJCH5A.js.map +0 -1
  142. package/dist/chunk-XJHZWSKV.js +0 -1103
  143. package/dist/chunk-XJHZWSKV.js.map +0 -1
  144. package/dist/chunk-Y3GYJ7YR.js +0 -549
  145. package/dist/chunk-Y3GYJ7YR.js.map +0 -1
  146. package/dist/chunk-YA4EE7ST.js +0 -14107
  147. package/dist/chunk-YA4EE7ST.js.map +0 -1
  148. package/dist/chunk-YDHXWCCJ.js +0 -145
  149. package/dist/chunk-YDHXWCCJ.js.map +0 -1
  150. package/dist/chunk-YE6GUDGP.js +0 -548
  151. package/dist/chunk-YE6GUDGP.js.map +0 -1
  152. package/dist/chunk-YNKK7NE3.js +0 -171
  153. package/dist/chunk-YNKK7NE3.js.map +0 -1
  154. package/dist/chunk-YPO6RDMX.js +0 -20
  155. package/dist/chunk-YPO6RDMX.js.map +0 -1
  156. package/dist/chunk-ZS7PMGUW.js +0 -7
  157. package/dist/chunk-ZS7PMGUW.js.map +0 -1
  158. package/dist/file-intake/index.js.map +0 -1
  159. package/dist/index.js.map +0 -1
  160. package/dist/map/index.js.map +0 -1
  161. package/dist/markdown/index.js.map +0 -1
  162. package/dist/markup/index.js.map +0 -1
  163. package/dist/page-tabs/index.js.map +0 -1
  164. package/dist/sounds-NT4DEZGD.js +0 -3
  165. package/dist/sounds-NT4DEZGD.js.map +0 -1
  166. package/dist/ui/index.js.map +0 -1
@@ -0,0 +1,37 @@
1
+ import{AboutApp as e}from"./chunk-TAWKWSPN.js";import{peekSpreadsheetPreviewStage as t,claimSpreadsheetPreviewStage as r,SPREADSHEET_PREVIEW_UPDATE_EVENT as n}from"./chunk-VTVSMRFX.js";import{WindowTitle as o}from"./chunk-JN4WXTWJ.js";import"./chunk-UB4JIOLD.js";import{EditableGrid as a}from"./chunk-XO43FJRM.js";import"./chunk-BR22X7E5.js";import"./chunk-U4GTZPXP.js";import"./chunk-44UO7FYU.js";import"./chunk-PH3PRIFP.js";import"./chunk-UZAJ5BF6.js";import"./chunk-3A46NCXK.js";import"./chunk-57MIENLJ.js";import"./chunk-OQDWLHZI.js";import"./chunk-MAIHBBWT.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=t());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,U]=s(0),$=l([]),M=l(C),A=l(!1);c(()=>{A.current?A.current=!1:M.current!==C&&($.current.push(M.current),$.current.length>50&&$.current.shift()),M.current=C},[C]);const E=i(()=>{const e=$.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(),E())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[E]);const[L,D]=s(N?.title??"Untitled"),[F,I]=s(()=>g.current?.data.onEmail),B=i(e=>{const t=w(e.csv,"Sheet 1");t&&(S([t]),U(0),D(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),I(()=>e.onEmail))},[]);c(()=>{const e=g.current;null!=e&&(r(e),e.data!==k.current&&B(e.data))},[]),c(()=>{const e=g.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&B(r.data)};return window.addEventListener(n,t),()=>window.removeEventListener(n,t)},[]);const[R,J]=s(!1),[K,O]=s(null),[P,X]=s(""),T=l(null),[W,H]=s("1"),[Z,z]=s("10"),V=C[j]||C[0],_=V.data,G=V.columns,Q=V.cellStyles??{},[Y,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 Y?[Y]:[]},[ee,Y]),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}:Y,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!==G.length?se({data:e,columns:y(t)}):se({data:e})},[se,G.length]),ie=(e,t)=>{S(r=>r.map((r,n)=>n===e?{...r,name:t}:r)),O(null)},ue=()=>_.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=[];_.forEach(e=>e.forEach(e=>{const t=parseFloat(e);!isNaN(t)&&e.trim()&&de.push(t)}));const he=_.reduce((e,t)=>e+t.filter(e=>e.trim()).length,0);/* @__PURE__ */
2
+ return u("div",{ref:m,className:"flex flex-col h-full",children:[
3
+ /* @__PURE__ */d(o,{title:`${me=L||"Untitled",me.length>24?`${me.slice(0,23)}…`:me} - Spreadsheets`}),
4
+ /* @__PURE__ */d(e,{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:L,onChange:e=>D(e.target.value),onBlur:()=>J(!1),onKeyDown:e=>{"Enter"===e.key&&J(!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:()=>J(!0),className:"text-sm font-medium text-gray-900 hover:text-blue-600 truncate max-w-[200px]",title:"Click to rename",children:L||"Untitled"}),
6
+ /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
7
+ /* @__PURE__ */d("input",{ref:T,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),U(0),D(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}),D(r)}T.current&&(T.current.value="")},className:"hidden"}),
8
+ /* @__PURE__ */d("button",{onClick:()=>T.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=`${L||"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"}),F&&/* @__PURE__ */d("button",{onClick:()=>F(ue(),`${L||"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
+ /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
11
+ /* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
12
+ /* @__PURE__ */d("input",{type:"number",min:"1",max:"50",value:W,onChange:e=>H(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=G.length+e;se({columns:y(t),data:_.map(t=>[...t,...Array(e).fill("")])})})(parseInt(W)||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
+ /* @__PURE__ */u("div",{className:"flex items-center gap-1",children:[
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:[..._,...Array.from({length:e},()=>Array(G.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
+ /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
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
+ /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300"}),
20
+ /* @__PURE__ */u("div",{className:"flex items-center gap-0.5",title:le?"":"Click a cell first",children:[
21
+ /* @__PURE__ */d("button",{onClick:()=>ne("bold"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors font-bold ${ae.bold?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"B"}),
22
+ /* @__PURE__ */d("button",{onClick:()=>ne("italic"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors italic ${ae.italic?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"I"}),
23
+ /* @__PURE__ */d("button",{onClick:()=>ne("underline"),disabled:!le,className:`px-2 py-1 text-xs rounded transition-colors underline ${ae.underline?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-200"} disabled:opacity-40 disabled:cursor-not-allowed`,children:"U"}),
24
+ /* @__PURE__ */u("select",{value:ae.fontSize??"base",onChange:e=>ne("fontSize",e.target.value),disabled:!le,className:"ml-1 text-xs border border-gray-300 rounded px-1 py-0.5 bg-white disabled:opacity-40 disabled:cursor-not-allowed",children:[
25
+ /* @__PURE__ */d("option",{value:"sm",children:"XS"}),
26
+ /* @__PURE__ */d("option",{value:"base",children:"S"}),
27
+ /* @__PURE__ */d("option",{value:"lg",children:"M"}),
28
+ /* @__PURE__ */d("option",{value:"xl",children:"L"})]})]})]}),
29
+ /* @__PURE__ */d("div",{className:"flex-1 min-h-0",children:/* @__PURE__ */d(a,{columns:G,data:_,onChange:ce,onColumnsChange:e=>se({columns:e}),cellStyles:Q,onFocusChange:q,onSelectionChange:te,minRows:x,maxHeight:"100%"})}),
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:()=>U(t),onDoubleClick:()=>{O(t),X(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&&U(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=>X(e.target.value),onBlur:()=>ie(t,P||e.name),onKeyDown:r=>{"Enter"===r.key&&ie(t,P||e.name),"Escape"===r.key&&O(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
+ /* @__PURE__ */d("button",{onClick:()=>{const e=`Sheet ${C.length+1}`;S(t=>[...t,f(e)]),U(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
+ /* @__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
+ /* @__PURE__ */u("span",{children:[he," cells"]}),de.length>0&&/* @__PURE__ */u(h,{children:[
35
+ /* @__PURE__ */u("span",{children:["Sum: ",de.reduce((e,t)=>e+t,0).toLocaleString(void 0,{maximumFractionDigits:2})]}),
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:[_.length," × ",G.length]})]})]})]});var me}export{k as default};
@@ -0,0 +1,16 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-H562R4GX.js";import{useWidgetSettings as a}from"./chunk-JN4WXTWJ.js";import"./chunk-UB4JIOLD.js";import"./chunk-44UO7FYU.js";import"./chunk-PH3PRIFP.js";import"./chunk-UZAJ5BF6.js";import"./chunk-3A46NCXK.js";import"./chunk-57MIENLJ.js";import"./chunk-OQDWLHZI.js";import"./chunk-MAIHBBWT.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),[j,S]=r(""),P=n(()=>{v([...l]),A({...u}),S(""),f(!0)},[l,u]);a(P);const O=()=>{const e=j.trim().toUpperCase();!e||N.includes(e)||N.length>=8||(v(t=>[...t,e]),S(""))},C=g.filter(e=>!N.includes(e));/* @__PURE__ */
2
+ return c(s,{children:[
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
+ return c("div",{className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0",children:[
5
+ /* @__PURE__ */i("span",{className:"text-sm font-bold text-gray-800 tracking-tight",children:e}),t?/* @__PURE__ */c("div",{className:"flex flex-col items-end leading-tight",children:[
6
+ /* @__PURE__ */i("span",{className:"text-sm font-mono font-semibold text-gray-900 tabular-nums",children:(n=t.price,`$${n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`)}),
7
+ /* @__PURE__ */c("span",{className:`text-[11px] font-medium tabular-nums ${r}`,children:[a?"▲":"▼"," ",h(t.change)," (",h(t.changePct),"%)"]})]}):/* @__PURE__ */i("span",{className:"text-sm font-mono text-gray-400 tabular-nums",children:"—"})]},e);var n})})})}),
8
+ /* @__PURE__ */i(t,{open:b,onClose:()=>f(!1),title:"Stock Settings",appearance:k,onAppearanceChange:A,onSave:()=>{const e=N.map(e=>e.toUpperCase()).slice(0,8);x(e),y(k),localStorage.setItem(o,JSON.stringify(e)),localStorage.setItem(m,JSON.stringify(k)),f(!1)},children:/* @__PURE__ */c("div",{children:[
9
+ /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:["Symbols ",
10
+ /* @__PURE__ */c("span",{className:"text-[11px] font-normal text-gray-400",children:["(",N.length,"/",8,")"]})]}),
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
+ /* @__PURE__ */i("span",{className:"text-sm font-semibold text-gray-700",children:e}),
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:j,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&O()},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:O,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))}),
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};
@@ -0,0 +1,60 @@
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-H562R4GX.js";import{useWidgetSettings as s}from"./chunk-JN4WXTWJ.js";import"./chunk-UB4JIOLD.js";import{useShellPrefs as o}from"./chunk-44UO7FYU.js";import"./chunk-PH3PRIFP.js";import"./chunk-UZAJ5BF6.js";import"./chunk-3A46NCXK.js";import"./chunk-57MIENLJ.js";import"./chunk-OQDWLHZI.js";import"./chunk-MAIHBBWT.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
+ return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
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
+ /* @__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__ */
5
+ return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
6
+ /* @__PURE__ */m("div",{className:"absolute top-1 right-1",children:/* @__PURE__ */p("svg",{viewBox:"0 0 40 40",className:"w-9 h-9",style:{filter:"drop-shadow(0 0 6px rgba(255,250,220,0.4))"},children:[
7
+ /* @__PURE__ */m("defs",{children:/* @__PURE__ */p("radialGradient",{id:"wx-moon-grad",cx:"35%",cy:"35%",children:[
8
+ /* @__PURE__ */m("stop",{offset:"0",stopColor:"#fffae0"}),
9
+ /* @__PURE__ */m("stop",{offset:"1",stopColor:"#d4c98a"})]})}),
10
+ /* @__PURE__ */m("circle",{cx:20,cy:20,r:13,fill:"url(#wx-moon-grad)"}),
11
+ /* @__PURE__ */m("circle",{cx:26,cy:16,r:11,fill:"rgba(15,23,42,1)"})]})}),e.map((e,t)=>/* @__PURE__ */m("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:e.top,width:e.size,height:e.size,animation:`wx-twinkle ${e.duration} ease-in-out ${e.delay} infinite`}},t)),
12
+ /* @__PURE__ */m("div",{className:"absolute",style:{left:"15%",top:"20%",animation:"wx-shooting-star 12s ease-out infinite"},children:/* @__PURE__ */m("div",{className:"w-12 h-px",style:{background:"linear-gradient(to right, transparent, rgba(255,255,255,0.95))",boxShadow:"0 0 4px rgba(255,255,255,0.8)"}})})]})}function N({tone:e="light"}){const t="light"===e?"rgba(255,255,255,0.78)":"rgba(220,228,240,0.45)",a=({scale:e=1})=>/* @__PURE__ */p("svg",{viewBox:"0 0 120 50",className:"w-32 h-12",style:{transform:`scale(${e})`,filter:"blur(0.6px)"},children:[
13
+ /* @__PURE__ */m("ellipse",{cx:28,cy:36,rx:18,ry:11,fill:t}),
14
+ /* @__PURE__ */m("ellipse",{cx:50,cy:28,rx:22,ry:15,fill:t}),
15
+ /* @__PURE__ */m("ellipse",{cx:75,cy:32,rx:20,ry:12,fill:t}),
16
+ /* @__PURE__ */m("ellipse",{cx:95,cy:38,rx:15,ry:9,fill:t})]});/* @__PURE__ */
17
+ return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
18
+ /* @__PURE__ */m("div",{className:"absolute",style:{top:"8%",animation:"wx-drift-cloud 42s linear infinite"},children:/* @__PURE__ */m(a,{scale:.9})}),
19
+ /* @__PURE__ */m("div",{className:"absolute",style:{top:"40%",animation:"wx-drift-cloud 60s linear -22s infinite",opacity:.85},children:/* @__PURE__ */m(a,{scale:1.25})}),
20
+ /* @__PURE__ */m("div",{className:"absolute",style:{top:"68%",animation:"wx-drift-cloud 78s linear -45s infinite",opacity:.7},children:/* @__PURE__ */m(a,{scale:.75})})]})}function k({heavy:e=!1}){const t=e?26:16,a=["wx-rain-a","wx-rain-b","wx-rain-c"],r=Array.from({length:t}).map((e,r)=>({left:(100*r/t+11*r%7)%100+"%",delay:.087*r%1.3+"s",height:12+r%4*5+"px",duration:.7+r%3*.18+"s",variant:a[r%a.length]}));/* @__PURE__ */
21
+ return m("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:r.map((e,t)=>/* @__PURE__ */m("div",{className:"absolute",style:{left:e.left,top:"-20px",width:"1px",height:e.height,background:"linear-gradient(180deg, rgba(180,210,255,0) 0%, rgba(220,235,255,0.85) 90%, rgba(255,255,255,0.95) 100%)",transform:"rotate(8deg)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`,transformOrigin:"top"}},t))})}function S(){const e=["wx-snow-a","wx-snow-b","wx-snow-c"],t=Array.from({length:16}).map((t,a)=>({left:(100*a/16+13*a%5)%100+"%",delay:.43*a%5+"s",duration:4.5+a%5+"s",size:3+a%4*1.4,opacity:.65+7*a%4*.08,variant:e[a%e.length]}));/* @__PURE__ */
22
+ return m("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:t.map((e,t)=>/* @__PURE__ */m("div",{className:"absolute rounded-full bg-white",style:{left:e.left,top:"-12px",width:e.size,height:e.size,opacity:e.opacity,boxShadow:"0 0 4px rgba(255,255,255,0.65)",animation:`${e.variant} ${e.duration} linear ${e.delay} infinite`}},t))})}function $(){/* @__PURE__ */
23
+ return p("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[
24
+ /* @__PURE__ */m(k,{heavy:!0}),
25
+ /* @__PURE__ */m("div",{className:"absolute inset-0 bg-white",style:{animation:"wx-flash 6s ease-out infinite"}}),
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 F(){const[r,w]=l(g),[v,N]=l(()=>n(u)),[k,S]=l(null),[$,j]=l(!0),[,F]=l(0);c(()=>{const e=setInterval(()=>F(e=>e+1),6e4);return()=>clearInterval(e)},[]);const[L,D]=l(!1),[T,A]=l(r),[C,H]=l(v),{prefs:B,save:O}=o(),z={...y,...B.weather_prefs??{}},[J,P]=l(z);s(d(()=>{A(r),H({...v}),P({...z}),D(!0)},[r,v,z])),c(()=>{let t=!1;return j(!0),e(r).then(e=>{t||(S(e),j(!1))}),()=>{t=!0}},[r]);const X=e=>z.useFahrenheit?`${x(e)}°F`:`${e}°`;if($&&!k)/* @__PURE__ */
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[Z,U,W]=t(k.code,k.isDay);/* @__PURE__ */
31
+ return p(h,{children:[
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 ${W}`,style:{height:110},children:[
34
+ /* @__PURE__ */m(I,{code:k.code,isDay:k.isDay}),
35
+ /* @__PURE__ */p("div",{className:"relative z-10 px-3 py-2.5 flex flex-col h-full justify-between",children:[
36
+ /* @__PURE__ */p("div",{className:"flex items-start justify-between gap-2",children:[
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}),z.showLocalTime&&/* @__PURE__ */m("div",{className:"text-[10px] opacity-90 leading-tight tabular-nums drop-shadow-sm",children:b(k.timezone,z.use24Hour)})]}),
39
+ /* @__PURE__ */m("div",{className:"text-3xl font-extralight leading-none tracking-tight tabular-nums shrink-0 drop-shadow-sm",children:X(k.temp)})]}),
40
+ /* @__PURE__ */p("div",{className:"flex items-end justify-between gap-2",children:[
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:U}),
43
+ /* @__PURE__ */m("span",{className:"text-[11px] font-medium drop-shadow-sm truncate",children:Z})]}),
44
+ /* @__PURE__ */p("span",{className:"text-[10px] opacity-90 tabular-nums drop-shadow-sm shrink-0",children:["H:",X(k.high)," L:",X(k.low)]})]})]})]})}),
45
+ /* @__PURE__ */p(i,{open:L,onClose:()=>D(!1),title:"Weather Settings",appearance:C,onAppearanceChange:H,onSave:()=>{w(T),N(C),O({weather_prefs:J}),localStorage.setItem(f,T),localStorage.setItem(u,JSON.stringify(C)),D(!1)},children:[
46
+ /* @__PURE__ */m("div",{className:"space-y-3",children:/* @__PURE__ */p("div",{children:[
47
+ /* @__PURE__ */m("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
48
+ /* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
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:()=>P(t=>({...t,useFahrenheit:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(J.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
+ /* @__PURE__ */p("div",{className:"flex items-center gap-3 mb-2",children:[
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:()=>P(t=>({...t,use24Hour:e.key})),className:"px-3 py-1 text-xs font-medium rounded-lg border transition-colors "+(J.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
+ /* @__PURE__ */p("label",{className:"flex items-center gap-2 cursor-pointer",children:[
55
+ /* @__PURE__ */m("input",{type:"checkbox",checked:J.showLocalTime,onChange:e=>P(t=>({...t,showLocalTime:e.target.checked})),className:"rounded border-gray-300 text-blue-600 h-3.5 w-3.5"}),
56
+ /* @__PURE__ */m("span",{className:"text-sm text-gray-600",children:"Show local time"})]})]})}),
57
+ /* @__PURE__ */p("div",{children:[
58
+ /* @__PURE__ */m("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"City"}),
59
+ /* @__PURE__ */m("select",{value:T,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{F as default};
@@ -0,0 +1,32 @@
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-H562R4GX.js";import{useWidgetSettings as s}from"./chunk-JN4WXTWJ.js";import"./chunk-UB4JIOLD.js";import{useShellPrefs as c}from"./chunk-44UO7FYU.js";import"./chunk-PH3PRIFP.js";import"./chunk-UZAJ5BF6.js";import"./chunk-3A46NCXK.js";import"./chunk-57MIENLJ.js";import"./chunk-OQDWLHZI.js";import"./chunk-MAIHBBWT.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,N]=l(!1),[v,w]=l([]),[j,F]=l(b),C={useFahrenheit:!!x.weather_prefs?.useFahrenheit},[D,I]=l(C),[O,S]=l(()=>/* @__PURE__ */new Date);o(()=>{const e=setInterval(()=>S(/* @__PURE__ */new Date),3e4);return()=>clearInterval(e)},[]);const B=Object.fromEntries(Object.entries(e).map(([e,t])=>[t.tz,e])),J=x.world_clocks,L=(()=>{if(!Array.isArray(J)||0===J.length)return g;const t=[];for(const a of J){const r=e[a]?a:B[a];r&&!t.includes(r)&&t.push(r)}return t.length?t:g})(),[T,U]=l({}),[_,A]=l(!0);o(()=>{let e=!1;return A(!0),(async()=>{const a={};await Promise.all(L.map(async e=>{const r=await t(e);r&&(a[e]=r)})),e||(U(a),A(!1))})(),()=>{e=!0}},[L.join(",")]),s(m(()=>{w([...L]),F({...b}),I({...C}),N(!0)},[L.join(","),b,C.useFahrenheit]));const H=e=>C.useFahrenheit?`${r(e)}°`:`${e}°`;/* @__PURE__ */
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:[_&&L.every(e=>!T[e])&&/* @__PURE__ */p("div",{className:"px-3 py-6 text-center text-xs text-gray-500",children:"Loading…"}),L.map(t=>{const r=T[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,O);if(!r)/* @__PURE__ */
4
+ return h("div",{className:"px-4 py-3",children:[
5
+ /* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-2",children:[
6
+ /* @__PURE__ */p("span",{className:"text-[15px] font-semibold tracking-tight text-gray-900 truncate",children:t}),
7
+ /* @__PURE__ */h("span",{className:"tabular-nums text-[13px] font-medium text-gray-500",children:[i,
8
+ /* @__PURE__ */p("span",{className:"text-[9px] ml-0.5 opacity-70",children:s})]})]}),
9
+ /* @__PURE__ */p("div",{className:"text-[11px] text-gray-400 mt-1",children:"Loading weather…"})]},t);const[c,l]=a(r.code,r.isDay);/* @__PURE__ */
10
+ return h("div",{className:"px-4 py-3",children:[
11
+ /* @__PURE__ */h("div",{className:"flex items-baseline justify-between gap-2",children:[
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:H(r.temp)})]}),
14
+ /* @__PURE__ */h("div",{className:"flex items-center justify-between gap-2 mt-1.5 text-[11px]",children:[
15
+ /* @__PURE__ */h("div",{className:"flex items-center gap-1.5 min-w-0 text-gray-500",children:[
16
+ /* @__PURE__ */p("span",{className:"text-base leading-none shrink-0",children:l}),
17
+ /* @__PURE__ */h("span",{className:"tabular-nums font-semibold text-gray-700 shrink-0",children:[i,
18
+ /* @__PURE__ */p("span",{className:"text-[9px] font-medium ml-0.5 opacity-70",children:s})]}),
19
+ /* @__PURE__ */p("span",{className:"text-gray-300 shrink-0",children:"·"}),
20
+ /* @__PURE__ */p("span",{className:"truncate",children:c})]}),
21
+ /* @__PURE__ */h("span",{className:"tabular-nums text-gray-500 shrink-0",children:["H:",H(r.high)," L:",H(r.low)]})]})]},t)})]})}),
22
+ /* @__PURE__ */h(i,{open:k,onClose:()=>N(!1),title:"World Clock Settings",appearance:j,onAppearanceChange:F,onSave:()=>{0!==v.length&&(y({world_clocks:v,weather_prefs:{...x.weather_prefs??{},useFahrenheit:D.useFahrenheit}}),f(j),localStorage.setItem(u,JSON.stringify(j)),N(!1))},children:[
23
+ /* @__PURE__ */h("div",{children:[
24
+ /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Display"}),
25
+ /* @__PURE__ */h("div",{className:"flex items-center gap-3 mb-2",children:[
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:()=>I(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)))})]}),
28
+ /* @__PURE__ */p("p",{className:"text-[10px] text-gray-400 mt-1",children:"Shared with the Weather widget."})]}),
29
+ /* @__PURE__ */h("div",{children:[
30
+ /* @__PURE__ */p("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Cities"}),
31
+ /* @__PURE__ */p("div",{className:"grid grid-cols-2 gap-1 max-h-56 overflow-y-auto",children:Object.keys(e).map(e=>/* @__PURE__ */h("label",{className:"flex items-center gap-2 text-sm py-1 cursor-pointer hover:bg-gray-50 rounded px-2",children:[
32
+ /* @__PURE__ */p("input",{type:"checkbox",checked:v.includes(e),onChange:()=>w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500 h-3.5 w-3.5"}),e]},e))})]})]})]})}export{x as default};
@@ -1,152 +1,2 @@
1
1
  "use client";
2
- export { openFilesInTrashMode, setFilesDemoTree } from '../chunk-BE7FZOFU.js';
3
- export { setBrowserStartUrl } from '../chunk-TW7LPMVR.js';
4
- export { BUILTIN_APP_INFO } from '../chunk-COWYSHG2.js';
5
- import '../chunk-YNKK7NE3.js';
6
- import { setPdfPreview } from '../chunk-DVZWYWSD.js';
7
- export { setPdfPreview } from '../chunk-DVZWYWSD.js';
8
- import { setSpreadsheetPreview } from '../chunk-5O42JXQE.js';
9
- export { setSpreadsheetPreview } from '../chunk-5O42JXQE.js';
10
- import '../chunk-ICTRCKUE.js';
11
- import '../chunk-GA35NEND.js';
12
- import '../chunk-ZS7PMGUW.js';
13
- import { toast_default } from '../chunk-UTYKLGGT.js';
14
- import '../chunk-HUBJAUGG.js';
15
- import '../chunk-RT6DSB5Y.js';
16
- import '../chunk-JOPU6WPY.js';
17
- import '../chunk-I2TAAJHS.js';
18
- import '../chunk-6XJEJWNJ.js';
19
- import '../chunk-YE6GUDGP.js';
20
- import '../chunk-IPXN646P.js';
21
- import '../chunk-IRWSRJ4K.js';
22
- import { lazy } from 'react';
23
-
24
- // src/apps/openAttachment.ts
25
- function extOf(name) {
26
- const m = /\.([a-z0-9]+)(?:[?#].*)?$/i.exec((name || "").trim());
27
- return m ? m[1].toLowerCase() : "";
28
- }
29
- var DELIMITED_TEXT_EXT = /* @__PURE__ */ new Set(["csv", "tsv"]);
30
- var BINARY_WORKBOOK_EXT = /* @__PURE__ */ new Set(["xlsx", "xls", "xlsm", "ods"]);
31
- var IMAGE_EXT = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg", "avif"]);
32
- var THREED_EXT = /* @__PURE__ */ new Set(["step", "stp", "stl", "obj", "gltf", "glb", "3mf", "iges", "igs"]);
33
- function attachmentKind(nameOrUrl) {
34
- const ext = extOf(nameOrUrl);
35
- if (ext === "pdf") return "pdf";
36
- if (ext === "dxf") return "dxf";
37
- if (DELIMITED_TEXT_EXT.has(ext)) return "csv";
38
- if (IMAGE_EXT.has(ext)) return "image";
39
- if (THREED_EXT.has(ext)) return "3d";
40
- return null;
41
- }
42
- function openInNewTab(url) {
43
- window.open(url, "_blank", "noopener,noreferrer");
44
- }
45
- async function readText(url, opts, att) {
46
- if (opts.fetchBlob) return (await opts.fetchBlob(att)).text();
47
- const res = await fetch(url);
48
- if (!res.ok) throw new Error(`fetch failed: ${res.status}`);
49
- return res.text();
50
- }
51
- function errorText(err, fallback) {
52
- const message = err instanceof Error ? err.message : "";
53
- return message || fallback;
54
- }
55
- async function openAttachment(att, openPage, opts = {}) {
56
- const url = att?.url || "";
57
- const filename = att?.filename || "attachment";
58
- if (!url && !opts.fetchBlob) {
59
- toast_default.error("This attachment has no download link.");
60
- return;
61
- }
62
- const kind = attachmentKind(filename) ?? attachmentKind(url);
63
- if (kind === "csv") {
64
- try {
65
- setSpreadsheetPreview({ csv: await readText(url, opts, att), filename });
66
- openPage("/spreadsheet");
67
- } catch {
68
- toast_default.error("Could not open the spreadsheet \u2014 opening the file instead.");
69
- if (url) openInNewTab(url);
70
- }
71
- return;
72
- }
73
- if (BINARY_WORKBOOK_EXT.has(extOf(filename) || extOf(url))) {
74
- toast_default.error("Spreadsheet preview is unavailable for this file type. Opening the file instead.");
75
- if (url) openInNewTab(url);
76
- return;
77
- }
78
- if (!kind) {
79
- if (!url) {
80
- toast_default.error("This attachment has no download link.");
81
- return;
82
- }
83
- toast_default.info("Opening this file outside the app \u2014 no viewer can show it here.");
84
- openInNewTab(url);
85
- return;
86
- }
87
- if (!opts.fetchBlob) {
88
- setPdfPreview({ url, filename, kind });
89
- openPage("/preview");
90
- return;
91
- }
92
- const handle = setPdfPreview({
93
- filename,
94
- kind,
95
- converting: true,
96
- convertingMessage: opts.loadingMessage || "LOADING FILE"
97
- });
98
- openPage("/preview");
99
- try {
100
- const blob = await opts.fetchBlob(att);
101
- handle.update({ url: URL.createObjectURL(blob), filename, kind });
102
- } catch (err) {
103
- handle.update({
104
- filename,
105
- kind,
106
- converting: false,
107
- convertingMessage: errorText(err, "Failed to load this file.")
108
- });
109
- }
110
- }
111
-
112
- // src/apps/index.ts
113
- var Calculator = lazy(() => import('../Calculator-6FGNKOXU.js'));
114
- var Spreadsheet = lazy(() => import('../Spreadsheet-HOCPHJOC.js'));
115
- var Weather = lazy(() => import('../Weather-LZQGVDJL.js'));
116
- var CurrencyConverter = lazy(() => import('../CurrencyConverter-FF7EXRYL.js'));
117
- var PomodoroTimer = lazy(() => import('../PomodoroTimer-IR3WREED.js'));
118
- var Notepad = lazy(() => import('../Notepad-VE7ISWRQ.js'));
119
- var WorldClock = lazy(() => import('../WorldClock-XPD7WOZT.js'));
120
- var Stock = lazy(() => import('../Stock-LVRQPURG.js'));
121
- var Preview = lazy(() => import('../Preview-DAQGRNRM.js'));
122
- var PdfViewer = lazy(() => import('../PdfViewer-SQBFYAGW.js'));
123
- var Documents = lazy(() => import('../Documents-H3R7XSBH.js'));
124
- var Files = lazy(() => import('../Files-ZHJIAUC2.js'));
125
- var Browser = lazy(() => import('../Browser-ZNX4WFUH.js'));
126
- var utilityApps = {
127
- "/calculator": { component: Calculator, label: "Calculator", size: "sm", allowPinOnTop: true, utility: true, widget: true, dimensions: [280, 420] },
128
- "/spreadsheet": { component: Spreadsheet, label: "Spreadsheets", size: "2xl", appStyle: true, multiInstance: true },
129
- "/notepad": { component: Notepad, label: "Notepad", size: "lg", allowPinOnTop: true, flushBody: true },
130
- "/weather": { component: Weather, label: "Weather", size: "sm", utility: true, widget: true, autoHeight: true, dimensions: [320, 400] },
131
- "/currency": { component: CurrencyConverter, label: "Currency Converter", size: "sm", utility: true, widget: true, autoHeight: true, dimensions: [320, 480] },
132
- "/pomodoro": { component: PomodoroTimer, label: "Pomodoro Timer", size: "sm", utility: true, widget: true, dimensions: [320, 600] },
133
- "/world-clock": { component: WorldClock, label: "World Clock", size: "sm", utility: true, widget: true, autoHeight: true, dimensions: [320, 480] },
134
- "/stock": { component: Stock, label: "Stocks", size: "sm", utility: true, widget: true, autoHeight: true, dimensions: [320, 360] }
135
- };
136
- var documentApps = {
137
- "/preview": { component: Preview, label: "Preview", size: "2xl", appStyle: true, multiInstance: true },
138
- "/documents": { component: Documents, label: "Documents", size: "xl", appStyle: true, multiInstance: true },
139
- "/files": { component: Files, label: "Files", size: "xl", appStyle: true }
140
- };
141
- var webApps = {
142
- "/browser": { component: Browser, label: "Browser", size: "2xl", appStyle: true, multiInstance: true }
143
- };
144
- var bundledApps = {
145
- ...utilityApps,
146
- ...documentApps,
147
- ...webApps
148
- };
149
-
150
- export { Browser, Calculator, CurrencyConverter, Documents, Files, Notepad, PdfViewer, PomodoroTimer, Preview, Spreadsheet, Stock, Weather, WorldClock, attachmentKind, bundledApps, documentApps, openAttachment, utilityApps, webApps };
151
- //# sourceMappingURL=index.js.map
152
- //# sourceMappingURL=index.js.map
2
+ export{openFilesInTrashMode,setFilesDemoTree}from"../chunk-FHTLC7HH.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-TAWKWSPN.js";import"../chunk-NPJH5MD7.js";import{setPdfPreview as e}from"../chunk-ESL5TDNA.js";export{setPdfPreview}from"../chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"../chunk-VTVSMRFX.js";export{setSpreadsheetPreview}from"../chunk-VTVSMRFX.js";import"../chunk-JN4WXTWJ.js";import"../chunk-UB4JIOLD.js";import"../chunk-U4GTZPXP.js";import{toast_default as o}from"../chunk-VEGMDXT4.js";import"../chunk-44UO7FYU.js";import"../chunk-PH3PRIFP.js";import"../chunk-UZAJ5BF6.js";import"../chunk-3A46NCXK.js";import"../chunk-57MIENLJ.js";import"../chunk-OQDWLHZI.js";import"../chunk-MAIHBBWT.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 o.error("This attachment has no download link.");const d=c(h)??c(l);if("csv"===d){try{t({csv:await m(l,a,i),filename:h}),r("/spreadsheet")}catch{o.error("Could not open the spreadsheet — opening the file instead."),l&&p(l)}return}if(s.has(n(h)||n(l)))return o.error("Spreadsheet preview is unavailable for this file type. Opening the file instead."),void(l&&p(l));if(!d)return l?(o.info("Opening this file outside the app — no viewer can show it here."),void p(l)):void o.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-4SQGOQFQ.js")),f=i(()=>import("../Spreadsheet-JX5E6WH6.js")),w=i(()=>import("../Weather-HLAGJ5LV.js")),j=i(()=>import("../CurrencyConverter-2KOM7L6V.js")),k=i(()=>import("../PomodoroTimer-SDUBKXUS.js")),g=i(()=>import("../Notepad-WA77V45J.js")),v=i(()=>import("../WorldClock-IRI4VCTA.js")),b=i(()=>import("../Stock-XAQ5WMUZ.js")),S=i(()=>import("../Preview-D4KOA4OI.js")),T=i(()=>import("../PdfViewer-RBRGEKWF.js")),x=i(()=>import("../Documents-IZTIQYPG.js")),y=i(()=>import("../Files-B63KKXGZ.js")),I=i(()=>import("../Browser-ZX5OTOKK.js")),P={"/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]}},B={"/preview":{component:S,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/documents":{component:x,label:"Documents",size:"xl",appStyle:!0,multiInstance:!0},"/files":{component:y,label:"Files",size:"xl",appStyle:!0}},L={"/browser":{component:I,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},O={...P,...B,...L};export{I as Browser,d as Calculator,j as CurrencyConverter,x as Documents,y as Files,g as Notepad,T as PdfViewer,k as PomodoroTimer,S as Preview,f as Spreadsheet,b as Stock,w as Weather,v as WorldClock,c as attachmentKind,O as bundledApps,B as documentApps,h as openAttachment,P as utilityApps,L as webApps};
@@ -0,0 +1,29 @@
1
+ import{useShellStrings as e,splitAround as t}from"./chunk-OQDWLHZI.js";import{createContext as n,useEffect as r,useRef as o,useId as i,useContext as l,useState as a,useCallback as s,useLayoutEffect as d}from"react";import{jsxs as c,jsx as u,Fragment as m}from"react/jsx-runtime";var f=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function h(e){return Array.from(e.querySelectorAll(f)).filter(e=>null!==e.offsetParent||e===document.activeElement)}function b(e,t,n){r(()=>{if(!t)return;const r=e.current;if(!r)return;const o=document.activeElement,i=n?.current??h(r)[0]??r;i!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),i.focus();const l=e=>{if("Tab"!==e.key)return;const t=h(r);if(0===t.length)return void e.preventDefault();const n=t[0],o=t[t.length-1],i=document.activeElement;!e.shiftKey||i!==n&&r.contains(i)?e.shiftKey||i!==o&&r.contains(i)||(e.preventDefault(),n.focus()):(e.preventDefault(),o.focus())};return document.addEventListener("keydown",l,!0),()=>{document.removeEventListener("keydown",l,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&o?.focus?.()}},[e,t,n])}var g=0,p=null;function v(e){r(()=>{if(!e)return;const t=document.body;if(0===g){p={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return g+=1,()=>{0===(g-=1)&&p&&(t.style.overflow=p.overflow,t.style.paddingRight=p.paddingRight,p=null)}},[e])}var y=/* @__PURE__ */new Set,x=null;function w(e){return y.add(e),function(){if(x||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&k(e)&&(e.preventDefault(),e.stopPropagation())};document.addEventListener("keydown",e,!0),x=()=>document.removeEventListener("keydown",e,!0)}(),()=>{y.delete(e),0===y.size&&x&&(x(),x=null)}}function k(e){const t=Array.from(y);for(let n=t.length-1;n>=0;n--)try{if(t[n](e))return!0}catch{}return!1}var N="react-os-shell:overlay-open";function L(){"undefined"!=typeof window&&window.dispatchEvent(new Event(N))}function C(e){return"undefined"==typeof window?()=>{}:(window.addEventListener(N,e),()=>window.removeEventListener(N,e))}var E="undefined"==typeof document?r:d;function P(e){E(()=>{e&&L()},[e])}var j={window:50,windowStep:10,menu:400,pinnedWindow:999,overlay:9999,popup:1e4},W={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"};function D({open:t,onClose:n,title:l,children:a,footer:s,blocking:d=!1,size:m="md",initialFocus:f,"aria-label":h,className:g=""}){const p=o(null),y=i(),x=!d&&!s,k=i(),N=e().dialog;return P(t),b(p,t,f),v(t),r(()=>{if(t)return w(()=>(d||n(),!0))},[t,d,n]),t?/* @__PURE__ */c("div",{className:"fixed inset-0",style:{zIndex:j.overlay},role:"presentation",children:[
2
+ /* @__PURE__ */u("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
3
+ /* @__PURE__ */u("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:d?void 0:e=>{e.target===e.currentTarget&&n()},children:/* @__PURE__ */c("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":l?k:void 0,"aria-label":l?void 0:h,"aria-describedby":a?y:void 0,className:`relative w-full ${W[m]} rounded-lg bg-white p-6 shadow-xl ${g}`.trim(),children:[l&&/* @__PURE__ */u("h2",{id:k,className:(x?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:l}),a&&/* @__PURE__ */u("div",{id:y,className:"mt-2 text-sm text-gray-600",children:a}),s&&/* @__PURE__ */u("div",{className:"mt-6 flex justify-end gap-3",children:s}),x&&/* @__PURE__ */u("button",{type:"button",onClick:n,"aria-label":N.close,className:"absolute right-3 top-3 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */u("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */u("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})})]}):null}var $=n(()=>Promise.resolve(!1)),F=()=>l($),M=()=>Promise.resolve(!1),T=e=>M(e),z=()=>Promise.resolve(!1),A=e=>z(e),R=()=>Promise.resolve(null),K=e=>R(e),B={danger:{icon:"text-red-600 bg-red-100",button:"bg-red-600 hover:bg-red-700 text-white"},warning:{icon:"text-yellow-600 bg-yellow-100",button:"bg-yellow-600 hover:bg-yellow-700 text-white"},info:{icon:"text-blue-600 bg-blue-100",button:"bg-blue-600 hover:bg-blue-700 text-white"}},S="bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50";function H(){/* @__PURE__ */
4
+ return u("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */u("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"})})}function I(){/* @__PURE__ */
5
+ return u("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */u("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}function q({children:n}){const[i,l]=a(!1),[d,f]=a({message:""}),[h,b]=a(0),g=o(),p=o(null),v=o(0),y=o([]),x=o(null),w=o(null),k=s(e=>{p.current=e.id,g.current=e.resolve,b(e.id),f(e.options),l(!0)},[]),N=s(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++v.current,options:t,resolve:e};null===p.current?k(n):y.current.push(n)})},[k]),[L,C]=a(!1),[E,P]=a({message:""}),[j,W]=a(""),F=o(),T=s(e=>(P(e),W(""),C(!0),new Promise(e=>{F.current=e})),[]),[A,K]=a(!1),[q,O]=a({}),[Q,V]=a(""),Z=o(),G=s(e=>{const t="string"==typeof e?{message:e}:e;return O(t),V(t.defaultValue??""),K(!0),new Promise(e=>{Z.current=e})},[]);r(()=>{M=N,z=T,R=G},[N,T,G]);const J=(e,t)=>{if(p.current!==e)return;const n=g.current,r=y.current.shift();r?k(r):(p.current=null,g.current=void 0,l(!1)),n?.(t)},U=e=>{C(!1),W(""),F.current?.(e)},X=e=>{if(e){const e=Q.trim();if(!e&&!q.allowEmpty)return K(!1),void Z.current?.(null);K(!1),Z.current?.(e)}else K(!1),Z.current?.(null)},Y=d.variant||(d.confirmLabel?.toLowerCase().includes("delete")||d.message.toLowerCase().includes("delete")?"danger":"info"),_=B[Y],ee=B["warning"===E.variant?"warning":"danger"],te=E.confirmWord,ne=null==te||j===te,re=e().dialog,[oe,ie]=t(re.typeToConfirm);/* @__PURE__ */
6
+ return c($.Provider,{value:N,children:[n,
7
+ /* @__PURE__ */u(D,{open:i,onClose:()=>J(h,!1),initialFocus:x,footer:/* @__PURE__ */c(m,{children:[
8
+ /* @__PURE__ */u("button",{ref:x,type:"button",onClick:()=>J(h,!1),className:S,children:d.cancelLabel||re.cancel}),
9
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>J(h,!0),className:`px-4 py-2 text-sm font-medium rounded-lg ${_.button}`,children:d.confirmLabel||re.ok})]}),children:/* @__PURE__ */c("div",{className:"flex gap-4",children:[
10
+ /* @__PURE__ */u("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${_.icon}`,children:/* @__PURE__ */u(H,{})}),
11
+ /* @__PURE__ */c("div",{className:"flex-1",children:[
12
+ /* @__PURE__ */u("h2",{className:"text-base font-semibold text-gray-900",children:d.title||re.confirmTitle}),
13
+ /* @__PURE__ */u("p",{className:"mt-2 text-sm text-gray-600",children:d.message})]})]})}),
14
+ /* @__PURE__ */c(D,{open:L,onClose:()=>U(!1),initialFocus:null!=te?void 0:w,footer:/* @__PURE__ */c(m,{children:[
15
+ /* @__PURE__ */u("button",{ref:w,type:"button",onClick:()=>U(!1),className:S,children:E.cancelLabel||re.destructiveCancel}),
16
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>U(!0),disabled:!ne,className:`px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40 ${ee.button}`,children:te??E.confirmLabel??re.destructiveConfirm})]}),children:[
17
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>U(!1),"aria-label":re.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */u(I,{})}),
18
+ /* @__PURE__ */c("div",{className:"flex gap-4",children:[
19
+ /* @__PURE__ */u("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ee.icon}`,children:/* @__PURE__ */u(H,{})}),
20
+ /* @__PURE__ */c("div",{className:"flex-1",children:[
21
+ /* @__PURE__ */u("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:E.title||re.destructiveTitle}),
22
+ /* @__PURE__ */u("p",{className:"mt-2 text-sm text-gray-600",children:E.message}),null!=te&&/* @__PURE__ */c(m,{children:[
23
+ /* @__PURE__ */c("p",{className:"mt-3 text-sm text-gray-700",children:[oe,
24
+ /* @__PURE__ */u("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-1.5 py-0.5 text-xs font-bold text-red-600 font-mono",children:te}),ie]}),
25
+ /* @__PURE__ */u("input",{autoFocus:!0,type:"text",value:j,onChange:e=>W(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===te&&U(!0)},placeholder:te,className:"mt-2 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-red-500"})]})]})]})]}),
26
+ /* @__PURE__ */c(D,{open:A,onClose:()=>X(!1),title:q.title||re.promptTitle,footer:/* @__PURE__ */c(m,{children:[
27
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>X(!1),className:S,children:q.cancelLabel||re.cancel}),
28
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>X(!0),disabled:!q.allowEmpty&&!Q.trim(),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40",children:q.confirmLabel||re.ok})]}),children:[q.message&&/* @__PURE__ */u("p",{className:"text-sm text-gray-600",children:q.message}),
29
+ /* @__PURE__ */u("input",{autoFocus:!0,type:"text",value:Q,onChange:e=>V(e.target.value),onKeyDown:e=>{"Enter"===e.key?X(!0):"Escape"===e.key&&X(!1)},onFocus:e=>e.target.select(),placeholder:q.placeholder,className:"mt-3 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})]})}export{q as ConfirmProvider,D as Dialog,N as OVERLAY_OPEN_EVENT,j as Z_LAYERS,T as confirm,A as confirmDestructive,L as dismissPopups,C as onOverlayOpen,K as prompt,w as registerModalEscapeInterceptor,k as runEscapeInterceptors,F as useConfirm,P as useDismissPopupsOnOpen,b as useFocusTrap,v as useScrollLock};
@@ -0,0 +1,11 @@
1
+ import{useShellStrings as e}from"./chunk-OQDWLHZI.js";import{useHydrated as t,useBrowserState as r}from"./chunk-D65T4H6J.js";import{createContext as n,useSyncExternalStore as o,useCallback as i,useContext as a,useMemo as s}from"react";import{jsxs as l,jsx as c}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)";function u(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function f(){return!1}function m(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(d);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function h(){return o(m,u,f)}var w={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},p={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},g={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function v({tone:e}){const t={className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
2
+ return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});case"error":/* @__PURE__ */
3
+ return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});case"warning":/* @__PURE__ */
4
+ return c("svg",{...t,children:/* @__PURE__ */c("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"})});default:/* @__PURE__ */
5
+ return c("svg",{...t,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"})})}}function y({status:t="info",title:r,subTitle:n,extra:o,icon:i,children:a,className:s=""}){const d=w[t],u=e().errors;/* @__PURE__ */
6
+ return l("div",{role:"error"===d?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
7
+ /* @__PURE__ */c("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${p[d]}`,children:i??/* @__PURE__ */c(v,{tone:d})}),
8
+ /* @__PURE__ */c("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:r??g[t]?.(u)??""}),n&&/* @__PURE__ */c("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:n}),a&&/* @__PURE__ */c("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */c("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}function x({size:e="md",padding:t="py-12",label:r,className:n=""}){const o=/* @__PURE__ */c("div",{className:`${"sm"===e?"h-5 w-5":"lg"===e?"h-12 w-12":"h-8 w-8"} animate-spin rounded-full border-2 border-gray-200 border-t-blue-600`});return null==r?/* @__PURE__ */c("div",{className:`flex items-center justify-center ${t} ${n}`,children:o}):/* @__PURE__ */l("div",{role:"status",className:`flex flex-col items-center justify-center gap-3 ${t} ${n}`,children:[o,
9
+ /* @__PURE__ */c("p",{className:"text-sm text-gray-500",children:r})]})}var L="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),M={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},_=L?0:1,b=M.MOD[_],C=M.ALT[_],D="⇧",N="⏎",S=M.CMD_ENTER[_],E=M.CMD_S[_],T=M.CMD_K[_],k=M.CMD_DOT[_],A=M.CMD_A[_],j=M.CMD_Z[_],H=M.CMD_SHIFT_Z[_],I=M.ALT_SHIFT_D[_],F=M.ALT_SHIFT_E[_],Z=M.ALT_SHIFT_N[_],z=new Map(L?Object.values(M).map(([e,t])=>[e,t]):[]);function O(e){return t()?e:z.get(e)??e}var P="inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",$={sm:"px-1 py-0.5 text-[10px]",md:"px-1.5 py-0.5 text-[11px]"};function K({keys:e,size:t="md",className:r=""}){const n=O(e);/* @__PURE__ */
10
+ return c("kbd",{className:[P,$[t],r].filter(Boolean).join(" "),children:n})}var R=n(null);function J({value:e,children:t}){/* @__PURE__ */
11
+ return c(R.Provider,{value:e,children:t})}function U(e="react-os-shell:prefs",t){const[n,o]=r(()=>{try{const r=JSON.parse(localStorage.getItem(e)||"{}");return{...t??{},...r}}catch{return{...t??{}}}},{...t??{}});return{prefs:n,save:i(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var W={prefs:{},save:()=>{}};function B(){return a(R)??W}function Q(){const{prefs:e,save:t}=B(),r=i(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return s(()=>({prefs:e,save:r}),[e,r])}var V="react-os-shell:stale-chunk-reload-at",q=3e4,G="vite:preloadError",X="/_next/static/",Y=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function ee(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return Y.test(t)}function te(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(V),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?X:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(V),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(V,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;ee(t)&&a(t)&&(e.preventDefault(),r())};let l=!0,c=!1;const d=/* @__PURE__ */new Set,u=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||c||d.has(t)||(d.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{d.delete(t),e&&l&&!c&&a(t)&&(c=!0,r())}))};return window.addEventListener(G,s),u&&window.addEventListener("error",u,!0),()=>{l=!1,window.removeEventListener(G,s),u&&window.removeEventListener("error",u,!0)}}export{C as ALT,I as ALT_SHIFT_D,F as ALT_SHIFT_E,Z as ALT_SHIFT_N,A as CMD_A,k as CMD_DOT,S as CMD_ENTER,T as CMD_K,E as CMD_S,H as CMD_SHIFT_Z,j as CMD_Z,N as ENTER,K as Kbd,x as LoadingSpinner,b as MOD,X as NEXT_CHUNK_PATH_PREFIX,y as Result,D as SHIFT,q as STALE_CHUNK_RELOAD_COOLDOWN_MS,V as STALE_CHUNK_RELOAD_KEY,J as ShellPrefsProvider,G as VITE_PRELOAD_ERROR_EVENT,te as installStaleChunkReload,L as isMac,ee as isStaleChunkError,h as useIsMobile,U as useLocalStoragePrefs,Q as useShellPrefs,B as useShellPrefsAdapter,O as useShortcutLabel};
@@ -0,0 +1 @@
1
+ import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-VEGMDXT4.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
@@ -0,0 +1 @@
1
+ import{rootIsDark as r}from"./chunk-MAIHBBWT.js";function a(){try{const r=getComputedStyle(document.documentElement).getPropertyValue("--menu-opacity")?.trim();if(r)return parseFloat(r)}catch{}return.95}var s=r;function o(){try{return document.documentElement.classList.contains("rosh-reduce-transparency")}catch{return!1}}function t(r,a){return`color-mix(in srgb, ${r} ${+(Math.round(255*Math.min(1,Math.max(0,a)))/255*100).toFixed(4)}%, transparent)`}function e(r){const e=r??a();if(o())return{background:"var(--rosh-glass-surface)",border:"1px solid var(--rosh-glass-solid-border)",boxShadow:"var(--rosh-glass-solid-shadow)"};const n="var(--rosh-glass-surface)",u="var(--rosh-glass-surface-mid)";return s()?{background:`linear-gradient(135deg in srgb, ${t(n,.85*e)} 0%, ${t(u,.75*e)} 50%, ${t(n,.85*e)} 100%)`,backdropFilter:"blur(40px) saturate(1.6)",WebkitBackdropFilter:"blur(40px) saturate(1.6)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}:{background:`linear-gradient(135deg in srgb, ${t(n,.85*e)} 0%, ${t(u,.65*e)} 50%, ${t(n,.75*e)} 100%)`,backdropFilter:"blur(40px) saturate(1.8)",WebkitBackdropFilter:"blur(40px) saturate(1.8)",border:"1px solid var(--rosh-glass-border)",boxShadow:"var(--rosh-glass-shadow)"}}function n(r){return o()?"var(--rosh-glass-surface)":t("var(--rosh-glass-surface)",.85*(r??a()))}var u="border-white/20",d="glass-input-bg";export{u as GLASS_DIVIDER,d as GLASS_INPUT_BG,n as glassFill,e as glassStyle};
@@ -0,0 +1,2 @@
1
+ import{toast_default as t}from"./chunk-VEGMDXT4.js";import{useShellPrefs as e}from"./chunk-44UO7FYU.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(G(),F()):"none"!==t&&0!==m||G()}function I(){g.running||(w({running:!0}),p=setInterval(C,1e3),"focus"===g.mode&&F())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),G())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function C(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);G(),N(s,{volume:u,repeat:d});const e="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(e)}catch{}try{t.info(e)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function N(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,O={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function _(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function F(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=_(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*O[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function G(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function R(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=_(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*O[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var V="pomodoro_tasks",j="pomodoro_tasks_migrated";function E(){return Math.random().toString(36).slice(2,11)}function U(){/* @__PURE__ */
2
+ return(new Date).toISOString()}var W=null,q=[],J=!1,L=null,X=/* @__PURE__ */new Set;function Y(){for(const t of X)t()}function $(t){q=t,Y()}function z(){const t=W;return t?L=t.list().then(e=>{W===t&&(q=e,J=!0,Y())}).catch(()=>{W===t&&(J=!0,Y())}).finally(()=>{L=null}):(q=[],J=!0,Y(),Promise.resolve())}function H(t){W=t,q=[],J=!1,t?z():Y()}function K(t){return X.add(t),!W||J||L||z(),()=>{X.delete(t)}}function Q(){return q}function Z(){const t=function(){const{prefs:t,save:n}=e(),r=a(()=>{const e=t.todo_tasks;return Array.isArray(e)?e:[]},[t.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=E(),n=U(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:U()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(K,Q,Q),i=o(e=>{const n=W;if(!n)return t.addTask(e);const o="tmp-"+E(),a=U(),r={done:!1,...e,name:e.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...q,r]),n.create({...e,name:e.name.trim()}).then(t=>$(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(q.filter(t=>t.id!==o))),o},[t]),c=o((e,n)=>{const o=W;if(!o)return t.updateTask(e,n);$(q.map(t=>t.id===e?{...t,...n,id:e,updatedAt:U()}:t)),o.update(e,n).catch(()=>{z()})},[t]),l=o(e=>{const n=W;if(!n)return t.removeTask(e);const o=q;$(q.filter(t=>t.id!==e)),n.remove(e).catch(()=>$(o))},[t]),s=o(e=>{if(!W)return t.toggleDone(e);const n=q.find(t=>t.id===e);n&&c(e,{done:!n.done})},[t,c]),u=o(e=>{W||t.setAllTasks(e)},[t]);return null===W?t:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(j))return;const n=localStorage.getItem(V);if(!n)return void localStorage.setItem(j,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(V),void localStorage.setItem(j,"1");const a=U(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||E(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(V),localStorage.setItem(j,"1")}catch{try{localStorage.setItem(j,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,N as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,R as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
@@ -0,0 +1,6 @@
1
+ import{useShellStrings as e}from"./chunk-OQDWLHZI.js";import{Fragment as i}from"react";import{jsx as t,jsxs as a}from"react/jsx-runtime";var n=/* @__PURE__ */t("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-300",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})}),l="inline-flex min-w-0 items-center gap-1 truncate rounded px-1 -mx-1 text-gray-500 transition-colors hover:text-gray-900 hover:underline rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]";function s({items:s,separator:r,maxItems:c=0,className:m}){const o=e().breadcrumbs;if(0===s.length)return null;const h=r??n,d=[],u=s.length-1;if(c>0&&s.length>c&&c>=2){const e=Math.max(1,c-1);d.push({kind:"item",item:s[0],isLast:!1}),d.push({kind:"ellipsis"});for(let i=s.length-e;i<=u;i++)d.push({kind:"item",item:s[i],isLast:i===u})}else s.forEach((e,i)=>d.push({kind:"item",item:e,isLast:i===u}));/* @__PURE__ */
2
+ return t("nav",{"aria-label":o.label,className:`min-w-0 ${m??""}`,children:/* @__PURE__ */t("ol",{className:"flex items-center gap-1.5 text-sm",children:d.map((e,n)=>/* @__PURE__ */a(i,{children:[n>0&&/* @__PURE__ */t("li",{"aria-hidden":!0,className:"flex items-center",children:h}),
3
+ /* @__PURE__ */t("li",{className:"flex min-w-0 items-center",children:"ellipsis"===e.kind?/* @__PURE__ */t("span",{className:"px-0.5 text-gray-400 select-none","aria-label":o.hidden,children:"…"}):e.isLast||!e.item.href&&!e.item.onClick?/* @__PURE__ */a("span",{"aria-current":e.isLast?"page":void 0,className:"inline-flex min-w-0 items-center gap-1 truncate "+(e.isLast?"font-medium text-gray-900":"text-gray-500"),children:[e.item.icon,
4
+ /* @__PURE__ */t("span",{className:"truncate",children:e.item.label})]}):e.item.href?/* @__PURE__ */a("a",{href:e.item.href,onClick:e.item.onClick,className:l,children:[e.item.icon,
5
+ /* @__PURE__ */t("span",{className:"truncate",children:e.item.label})]}):/* @__PURE__ */a("button",{type:"button",onClick:e.item.onClick,className:l,children:[e.item.icon,
6
+ /* @__PURE__ */t("span",{className:"truncate",children:e.item.label})]})})]},n))})})}export{s as Breadcrumbs};
@@ -0,0 +1,4 @@
1
+ import{useShellStrings as e}from"./chunk-OQDWLHZI.js";import{useBrowserState as r}from"./chunk-D65T4H6J.js";import{useRef as t,useCallback as o,useEffect as n}from"react";import{jsxs as i,jsx as l,Fragment as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(Math.max(e,r),t);function d({sidebar:d,sidebarTop:c,sidebarBottom:u,children:m,side:h="left",storageKey:v,defaultWidth:w=256,minWidth:f=180,maxWidth:p=480,className:b="",sidebarClassName:y=("right"===h?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:g="bg-white"}){const N="right"===h,x=e().sidebar,[z,L]=r(()=>{if(v){let e=null;try{e=window.localStorage.getItem(v)}catch{}const r=e?parseInt(e,10):NaN;if(!Number.isNaN(r))return a(r,f,p)}return a(w,f,p)},a(w,f,p)),k=t(null),E=o(e=>{const r=k.current;if(!r)return;const t=(e.clientX-r.startX)*(N?-1:1);L(a(r.startWidth+t,f,p))},[f,p,N]),W=o(()=>{k.current=null,window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",W),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[E]),$=o(e=>{e.preventDefault(),k.current={startX:e.clientX,startWidth:z},window.addEventListener("pointermove",E),window.addEventListener("pointerup",W),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[z,E,W]);n(()=>{if(!v)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(v,String(Math.round(z)))}catch{}},200);return()=>window.clearTimeout(e)},[z,v]),n(()=>()=>{window.removeEventListener("pointermove",E),window.removeEventListener("pointerup",W)},[E,W]);const D=N?"left-0":"right-0",I=null!=c||null!=u,S=/* @__PURE__ */i("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:z},children:[
2
+ /* @__PURE__ */i("div",{className:`flex h-full flex-col ${I?"overflow-hidden":"overflow-y-auto"} ${y}`,children:[null!=c&&/* @__PURE__ */l("div",{className:"shrink-0 px-2 pt-3 pb-2",children:c}),I?/* @__PURE__ */l("div",{className:"min-h-0 flex-1 overflow-y-auto",children:d}):d,null!=u&&/* @__PURE__ */l("div",{className:"mt-auto shrink-0 border-t border-gray-200 px-2 py-3",children:u})]}),
3
+ /* @__PURE__ */l("div",{onPointerDown:$,onDoubleClick:()=>L(a(w,f,p)),title:x.resize,className:`group/resize absolute inset-y-0 ${D} z-10 w-2 cursor-col-resize`,children:/* @__PURE__ */l("div",{className:`absolute inset-y-0 ${D} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})]}),T=/* @__PURE__ */l("div",{className:`flex min-w-0 flex-1 flex-col ${g}`,children:m});/* @__PURE__ */
4
+ return l("div",{className:`flex h-full w-full overflow-hidden ${b}`,children:/* @__PURE__ */i(s,N?{children:[T,S]}:{children:[S,T]})})}export{d as SidebarLayout};
@@ -0,0 +1 @@
1
+ function t(t){return t.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[t]||t))}export{t as escapeHtml};
@@ -0,0 +1 @@
1
+ var e=null;function t(t,s,i="sine",o=.15){try{const n=(e||(e=new AudioContext),e),c=n.createOscillator(),r=n.createGain();c.type=i,c.frequency.value=t,r.gain.value=o,r.gain.exponentialRampToValueAtTime(.001,n.currentTime+s),c.connect(r),r.connect(n.destination),c.start(),c.stop(n.currentTime+s)}catch{}}var s={label:"Classic",success:()=>{t(523,.1,"sine",.1),setTimeout(()=>t(659,.1,"sine",.1),100),setTimeout(()=>t(784,.15,"sine",.1),200)},error:()=>{t(200,.15,"sawtooth",.08),setTimeout(()=>t(180,.15,"sawtooth",.08),150)},notification:()=>{t(880,.08,"sine",.12),setTimeout(()=>t(1100,.12,"sine",.1),100)},startup:()=>{t(392,.15,"sine",.08),setTimeout(()=>t(523,.15,"sine",.08),150),setTimeout(()=>t(659,.15,"sine",.08),300),setTimeout(()=>t(784,.25,"sine",.1),450)},logout:()=>{t(784,.15,"sine",.08),setTimeout(()=>t(659,.15,"sine",.08),150),setTimeout(()=>t(523,.15,"sine",.08),300),setTimeout(()=>t(392,.25,"sine",.06),450)},click:()=>{t(800,.05,"square",.05)},timerDone:()=>{for(let e=0;e<3;e++)setTimeout(()=>t(1e3,.15,"sine",.12),300*e),setTimeout(()=>t(800,.15,"sine",.1),300*e+150)}},i={classic:s,minimal:{label:"Minimal",success:()=>{t(1200,.06,"sine",.08)},error:()=>{t(300,.1,"triangle",.06)},notification:()=>{t(900,.06,"sine",.08)},startup:()=>{t(600,.12,"sine",.06),setTimeout(()=>t(900,.15,"sine",.06),120)},click:()=>{t(1e3,.03,"sine",.03)},timerDone:()=>{t(1e3,.2,"sine",.1),setTimeout(()=>t(1e3,.2,"sine",.1),400)},logout:()=>{t(900,.1,"sine",.06),setTimeout(()=>t(600,.15,"sine",.05),120)}},retro:{label:"Retro",success:()=>{t(440,.08,"square",.08),setTimeout(()=>t(550,.08,"square",.08),80),setTimeout(()=>t(660,.08,"square",.08),160),setTimeout(()=>t(880,.12,"square",.1),240)},error:()=>{t(150,.2,"square",.06),setTimeout(()=>t(100,.3,"square",.06),200)},notification:()=>{t(660,.06,"square",.08),setTimeout(()=>t(880,.06,"square",.08),80),setTimeout(()=>t(660,.06,"square",.08),160)},startup:()=>{[262,330,392,523].forEach((e,s)=>setTimeout(()=>t(e,.1,"square",.07),100*s))},click:()=>{t(600,.03,"square",.06)},timerDone:()=>{for(let e=0;e<4;e++)setTimeout(()=>t(880,.1,"square",.1),200*e)},logout:()=>{[523,392,330,262].forEach((e,s)=>setTimeout(()=>t(e,.1,"square",.07),100*s))}},soft:{label:"Soft",success:()=>{t(700,.2,"sine",.06),setTimeout(()=>t(900,.25,"sine",.06),200)},error:()=>{t(250,.2,"sine",.05)},notification:()=>{t(600,.15,"triangle",.06),setTimeout(()=>t(800,.2,"triangle",.05),180)},startup:()=>{t(400,.3,"sine",.05),setTimeout(()=>t(500,.3,"sine",.05),300),setTimeout(()=>t(600,.4,"sine",.06),600)},click:()=>{t(500,.04,"triangle",.03)},timerDone:()=>{t(700,.3,"triangle",.08),setTimeout(()=>t(700,.3,"triangle",.08),500),setTimeout(()=>t(900,.4,"triangle",.08),1e3)},logout:()=>{t(600,.3,"sine",.05),setTimeout(()=>t(400,.4,"sine",.04),300)}},arcade:{label:"Arcade",success:()=>{[523,659,784,1047].forEach((e,s)=>setTimeout(()=>t(e,.06,"square",.07),60*s))},error:()=>{t(100,.3,"sawtooth",.06),setTimeout(()=>t(80,.4,"sawtooth",.05),200)},notification:()=>{t(1047,.05,"square",.08),setTimeout(()=>t(784,.05,"square",.08),60),setTimeout(()=>t(1047,.08,"square",.1),120)},startup:()=>{[262,330,392,523,659,784].forEach((e,s)=>setTimeout(()=>t(e,.08,"square",.06),80*s))},click:()=>{t(1200,.02,"square",.05)},timerDone:()=>{for(let e=0;e<5;e++)setTimeout(()=>t(1200,.05,"square",.1),120*e)},logout:()=>{[784,659,523,392,262].forEach((e,s)=>setTimeout(()=>t(e,.06,"square",.06),60*s))}},silent:{label:"Silent",success:()=>{},error:()=>{},notification:()=>{},startup:()=>{},click:()=>{},timerDone:()=>{},logout:()=>{}}},o=Object.keys(i),n=["click","success","error","notification","startup","timerDone","logout"],c={click:"Click",success:"Success",error:"Error",notification:"Notification",startup:"Startup",timerDone:"Timer",logout:"Logout"},r="erp_sound_config";function u(){return"false"!==localStorage.getItem("erp_sounds")}function a(){const e=!u();return localStorage.setItem("erp_sounds",String(e)),e}function l(){try{const e=JSON.parse(localStorage.getItem(r)||"");if(e&&"object"==typeof e)return{click:"classic",success:"classic",error:"classic",notification:"classic",startup:"classic",timerDone:"classic",logout:"classic",...e}}catch{}return{click:"classic",success:"classic",error:"classic",notification:"classic",startup:"classic",timerDone:"classic",logout:"classic"}}function m(e,t){const s=l();s[e]=t,localStorage.setItem(r,JSON.stringify(s))}function f(e){const t={};n.forEach(s=>{t[s]=e}),localStorage.setItem(r,JSON.stringify(t))}function T(e){const t=l();return i[t[e]]||s}function g(){u()&&T("click").click()}function p(){u()&&T("success").success()}function q(){u()&&T("error").error()}function k(){u()&&T("notification").notification()}function S(){u()&&T("startup").startup()}function h(){u()&&T("timerDone").timerDone()}function D(){u()&&T("logout").logout()}function y(e,t){const s=i[e];s&&"function"==typeof s[t]&&s[t]()}export{i as SOUND_PACKS,o as SOUND_PACK_KEYS,n as SOUND_TYPES,c as SOUND_TYPE_LABELS,l as getSoundConfig,g as playClick,q as playError,D as playLogout,k as playNotification,S as playStartup,p as playSuccess,h as playTimerDone,y as previewSound,f as setAllSounds,m as setSoundForType,u as soundsEnabled,a as toggleSounds};
@@ -0,0 +1 @@
1
+ import{useLayoutEffect as n,useEffect as r,useSyncExternalStore as t,useRef as e,useState as u,useCallback as c}from"react";var o="undefined"!=typeof window&&"undefined"!=typeof document?n:r,f=()=>()=>{},i=()=>!0,d=()=>!1;function p(){return t(f,i,d)}function a(n,r,e=f){return t(e,n,()=>r)}function l(n,r){const u=e(null);return t(f,()=>(u.current??={value:n()}).value,()=>r)}function m(n,r){const t=p(),[f,i]=u(()=>t?n():r),d=e(t),a=e(n);a.current=n,o(()=>{t&&!d.current&&(d.current=!0,i(a.current()))},[t]);return[f,c(n=>{d.current?i(n):(d.current=!0,i("function"==typeof n?n(a.current()):n))},[])]}export{o as useBrowserLayoutEffect,m as useBrowserState,a as useBrowserValue,l as useBrowserValueOnce,p as useHydrated};
@@ -0,0 +1 @@
1
+ var t="react-os-shell:pdf-preview-update",n=null,e=0;function a(a){const d=++e,o={token:d,data:a};return n=o,{update(e){n===o&&(o.data=e),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(t,{detail:{token:d,data:e}}))}}}function d(){return n}function o(t){n===t&&(n=null)}export{t as PDF_PREVIEW_UPDATE_EVENT,o as claimPdfPreviewStage,d as peekPdfPreviewStage,a as setPdfPreview};
@@ -0,0 +1 @@
1
+ var o={0:["Clear Sky","☀️","🌙","from-sky-400 to-blue-500","from-indigo-900 to-slate-950"],1:["Mainly Clear","🌤️","🌙","from-sky-400 to-blue-500","from-indigo-900 to-slate-950"],2:["Partly Cloudy","⛅","☁️","from-sky-400 to-blue-400","from-indigo-800 to-slate-900"],3:["Overcast","☁️","☁️","from-gray-400 to-gray-500","from-gray-700 to-slate-900"],45:["Foggy","🌫️","🌫️","from-gray-400 to-gray-500","from-gray-700 to-slate-800"],48:["Foggy","🌫️","🌫️","from-gray-400 to-gray-500","from-gray-700 to-slate-800"],51:["Light Drizzle","🌦️","🌧️","from-gray-400 to-blue-500","from-gray-700 to-indigo-900"],53:["Drizzle","🌧️","🌧️","from-gray-500 to-blue-600","from-gray-700 to-indigo-900"],55:["Heavy Drizzle","🌧️","🌧️","from-gray-500 to-blue-600","from-gray-700 to-indigo-900"],61:["Light Rain","🌦️","🌧️","from-gray-400 to-blue-500","from-gray-700 to-indigo-900"],63:["Rain","🌧️","🌧️","from-gray-500 to-blue-600","from-gray-700 to-indigo-900"],65:["Heavy Rain","🌧️","🌧️","from-gray-600 to-blue-700","from-gray-700 to-indigo-950"],71:["Light Snow","🌨️","🌨️","from-blue-200 to-blue-400","from-blue-800 to-slate-900"],73:["Snow","❄️","❄️","from-blue-300 to-blue-500","from-blue-800 to-slate-900"],75:["Heavy Snow","❄️","❄️","from-blue-400 to-blue-600","from-blue-800 to-slate-900"],80:["Rain Showers","🌧️","🌧️","from-gray-500 to-blue-600","from-gray-700 to-indigo-900"],82:["Heavy Showers","🌧️","🌧️","from-gray-600 to-blue-700","from-gray-700 to-indigo-950"],95:["Thunderstorm","⛈️","⛈️","from-gray-700 to-indigo-800","from-gray-800 to-indigo-950"],96:["Thunderstorm","⛈️","⛈️","from-gray-700 to-indigo-800","from-gray-800 to-indigo-950"],99:["Thunderstorm","⛈️","⛈️","from-gray-700 to-indigo-900","from-gray-800 to-indigo-950"]},t=(t,r=!0)=>{const a=o[t]||["Unknown","❓","❓","from-gray-400 to-gray-500","from-gray-700 to-slate-800"];return[a[0],r?a[1]:a[2],r?a[3]:a[4]]},r={Sydney:{lat:-33.8688,lon:151.2093,tz:"Australia/Sydney"},Melbourne:{lat:-37.8136,lon:144.9631,tz:"Australia/Melbourne"},Auckland:{lat:-36.8485,lon:174.7633,tz:"Pacific/Auckland"},Tokyo:{lat:35.6762,lon:139.6503,tz:"Asia/Tokyo"},Shanghai:{lat:31.2304,lon:121.4737,tz:"Asia/Shanghai"},"Hong Kong":{lat:22.3193,lon:114.1694,tz:"Asia/Hong_Kong"},Singapore:{lat:1.3521,lon:103.8198,tz:"Asia/Singapore"},Bangkok:{lat:13.7563,lon:100.5018,tz:"Asia/Bangkok"},Mumbai:{lat:19.076,lon:72.8777,tz:"Asia/Kolkata"},Dubai:{lat:25.2048,lon:55.2708,tz:"Asia/Dubai"},Berlin:{lat:52.52,lon:13.405,tz:"Europe/Berlin"},Paris:{lat:48.8566,lon:2.3522,tz:"Europe/Paris"},London:{lat:51.5074,lon:-.1278,tz:"Europe/London"},"New York":{lat:40.7128,lon:-74.006,tz:"America/New_York"},Miami:{lat:25.7617,lon:-80.1918,tz:"America/New_York"},Toronto:{lat:43.6532,lon:-79.3832,tz:"America/Toronto"},Chicago:{lat:41.8781,lon:-87.6298,tz:"America/Chicago"},"Los Angeles":{lat:34.0522,lon:-118.2437,tz:"America/Los_Angeles"}},a="weather_local_cache";function e(){try{return JSON.parse(localStorage.getItem(a)||"{}")}catch{return{}}}async function n(o,t=!1){const n=r[o];if(!n)return null;if(!t){const t=e()[o];if(t&&Date.now()-t.ts<18e5)return t.data}try{const t=await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${n.lat}&longitude=${n.lon}&current=temperature_2m,weather_code,is_day&daily=temperature_2m_max,temperature_2m_min&forecast_days=1&timezone=auto`),r=await t.json(),l={city:o,temp:Math.round(r.current.temperature_2m),code:r.current.weather_code,high:Math.round(r.daily.temperature_2m_max[0]),low:Math.round(r.daily.temperature_2m_min[0]),isDay:1===r.current.is_day,timezone:r.timezone||"UTC"},i=e();return i[o]={data:l,ts:Date.now()},function(o){try{localStorage.setItem(a,JSON.stringify(o))}catch{}}(i),l}catch{return null}}var l=o=>Math.round(9*o/5+32);export{r as AVAILABLE_CITIES,n as fetchCityWeather,t as getCondition,l as toFahrenheit};
@@ -0,0 +1 @@
1
+ import{requestFilesTrashView as n}from"./chunk-NPJH5MD7.js";var o=null;function r(n){o=n}function t(){return o}function u(){n()}export{t as getFilesDemoTree,u as openFilesInTrashMode,r as setFilesDemoTree};