efficient-shell 7.22.1 → 7.23.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 (76) hide show
  1. package/README.md +2 -1
  2. package/dist/{Browser-CHVGSLN7.js → Browser-AD3RE7T2.js} +13 -13
  3. package/dist/Calculator-S4SULQZG.js +29 -0
  4. package/dist/ConfirmDialog-TGAPFTMU.js +1 -0
  5. package/dist/CurrencyConverter-6A5U4LH3.js +21 -0
  6. package/dist/Documents-7QQ4YCEI.js +52 -0
  7. package/dist/Files-RZCHDHS3.js +87 -0
  8. package/dist/Notepad-BNO4WRTV.js +25 -0
  9. package/dist/PdfViewer-2OHHAS7B.js +1 -0
  10. package/dist/{PomodoroTimer-N7L7HBYO.js → PomodoroTimer-F7BGUOY2.js} +13 -13
  11. package/dist/Preview-TZHSJXTW.js +179 -0
  12. package/dist/Sidebar-PU6MUQEQ.js +44 -0
  13. package/dist/Spreadsheet-OU5ZRWKW.js +37 -0
  14. package/dist/{Stock-UOPST3LH.js → Stock-EC62JSPA.js} +7 -7
  15. package/dist/Weather-VHHULAGC.js +60 -0
  16. package/dist/WorldClock-AM54TQZB.js +32 -0
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/brand.css +1 -1
  20. package/dist/{chunk-MRE4Y2YJ.js → chunk-6CC3IJ7Y.js} +1 -1
  21. package/dist/{chunk-N2OO2ZYF.js → chunk-75BDNIYU.js} +1 -1
  22. package/dist/{chunk-ZU47TGM3.js → chunk-AW7GP54G.js} +4 -4
  23. package/dist/chunk-BSCGC2HA.js +1 -0
  24. package/dist/{chunk-FM6TPY42.js → chunk-CZZYMC7P.js} +27 -27
  25. package/dist/{chunk-4M7DEG4E.js → chunk-D5CGXUQK.js} +33 -33
  26. package/dist/{chunk-OFHMRWST.js → chunk-E6XEPPFY.js} +1 -1
  27. package/dist/{chunk-AKEMYW3H.js → chunk-EEXHZUG5.js} +2 -2
  28. package/dist/{chunk-EA7QO447.js → chunk-G6LV5Z2W.js} +1 -1
  29. package/dist/chunk-HAVGHJ7A.js +1 -0
  30. package/dist/{chunk-6J7HKGHL.js → chunk-ISEM2MNY.js} +1 -1
  31. package/dist/{chunk-AV5XPUKR.js → chunk-ISN4DJJ7.js} +9 -9
  32. package/dist/{chunk-FS27CODA.js → chunk-JI2JL7ZQ.js} +1 -1
  33. package/dist/chunk-LISZ45TA.js +1034 -0
  34. package/dist/chunk-MMHI7WBL.js +24 -0
  35. package/dist/{chunk-MBHQQFSZ.js → chunk-MUDY7BV4.js} +7 -7
  36. package/dist/chunk-NVFKXL52.js +2 -0
  37. package/dist/chunk-ODGCVNYP.js +10 -0
  38. package/dist/{chunk-Y7T3OW2A.js → chunk-R3IJQGAB.js} +1 -1
  39. package/dist/{chunk-BZD3UC4R.js → chunk-S2HHOX7O.js} +2 -2
  40. package/dist/{chunk-XFE43ZU5.js → chunk-U5H3Q5JM.js} +18 -18
  41. package/dist/{chunk-ARB5MUWA.js → chunk-UQOFRZMX.js} +1 -1
  42. package/dist/{chunk-OALCYDHN.js → chunk-W77WLTTH.js} +1 -1
  43. package/dist/chunk-YJRAJD27.js +27 -0
  44. package/dist/file-intake/index.js +1 -1
  45. package/dist/i18n/index.d.ts +1 -1
  46. package/dist/{index-CMwbvwiY.d.ts → index--nXViytT.d.ts} +11 -8
  47. package/dist/index.d.ts +3 -3
  48. package/dist/index.js +631 -631
  49. package/dist/locales/zh-Hans.d.ts +1 -1
  50. package/dist/locales/zh-Hans.js +1 -1
  51. package/dist/map/index.js +6 -6
  52. package/dist/page-tabs/index.js +5 -5
  53. package/dist/pdf/index.js +1 -1
  54. package/dist/{strings-BfHOx-Bl.d.ts → strings-D9AIYTbE.d.ts} +2 -2
  55. package/dist/telemetry/index.js +1 -1
  56. package/dist/ui/index.d.ts +2 -2
  57. package/dist/ui/index.js +1 -1
  58. package/package.json +1 -1
  59. package/dist/Calculator-RKOELZ6W.js +0 -29
  60. package/dist/ConfirmDialog-JSVEON35.js +0 -1
  61. package/dist/CurrencyConverter-PLQ664ZV.js +0 -21
  62. package/dist/Documents-CKQCMALX.js +0 -52
  63. package/dist/Files-XSUFZ7ZR.js +0 -87
  64. package/dist/Notepad-3EGD2WCN.js +0 -25
  65. package/dist/PdfViewer-VIX2NDCO.js +0 -1
  66. package/dist/Preview-RRXQS5BI.js +0 -182
  67. package/dist/Sidebar-77VZQLKP.js +0 -44
  68. package/dist/Spreadsheet-X677FCIY.js +0 -37
  69. package/dist/Weather-HXZK2AYT.js +0 -60
  70. package/dist/WorldClock-MCDW7P6Q.js +0 -32
  71. package/dist/chunk-4EIZZYLK.js +0 -1
  72. package/dist/chunk-5VNBEMZQ.js +0 -1
  73. package/dist/chunk-E7WPTZE3.js +0 -27
  74. package/dist/chunk-J65OSKCY.js +0 -1032
  75. package/dist/chunk-ONDFYXHG.js +0 -24
  76. package/dist/chunk-ZMQ3GBEX.js +0 -11
@@ -1,24 +0,0 @@
1
- import{toast_default as e}from"./chunk-EA7QO447.js";import{useShellStrings as t}from"./chunk-4EIZZYLK.js";import{Icon as n}from"./chunk-B427NVDP.js";import{createContext as r,useContext as a,useRef as o,useState as i,useEffect as s}from"react";import*as l from"pdfjs-dist";import{createPortal as c}from"react-dom";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var h=r(null);function p({children:e}){const t=a(h);return t?c(e,t):
2
- /* @__PURE__ */d("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||l.GlobalWorkerOptions.workerSrc||(l.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${l.version}/build/pdf.worker.min.mjs`);var f={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},g=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=f[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw m(n,t,a);return a}};function w(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:g}}var y=[50,75,100,125,150,200,300,400];function v(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function b({url:r,filename:a,fit:c="width",onDownload:m,onEmail:h,workerSrc:f,wasmUrl:g}){const b=t().pdf,x=o(null),k=o(null),C=o(null),[N,j]=i(null),[E,M]=i(1),[P,_]=i(0),[z,D]=i(1),[L,W]=i(!0),[S,$]=i(!0),A=o(b.loadFailed);A.current=b.loadFailed,s(()=>{let t=!1;return $(!0),M(1),f&&(l.GlobalWorkerOptions.workerSrc=f),l.getDocument({url:r,...w(g)}).promise.then(e=>{t||(j(e),_(e.numPages),$(!1))}).catch(()=>{t||(e.error(A.current),$(!1))}),()=>{t=!0}},[r,f,g]),s(()=>{if(!N||!L||!C.current)return;const e=()=>{const e=C.current;e&&N.getPage(E).then(t=>{if(!C.current)return;const n=t.getViewport({scale:1}),r=v(c,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});D(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(C.current),()=>t.disconnect()},[N,E,L,c]),s(()=>{if(!N||!x.current)return;let e=!1,t=null,n=null;return N.getPage(E).then(r=>{if(e||!x.current)return;const a=r.getViewport({scale:z}),o=x.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=k.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new l.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[N,E,z]),s(()=>{const e=()=>k.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const O="page"===c?b.fitPage:b.fitWidth,T="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
- return u("div",{className:"flex flex-col h-full",children:[
4
- /* @__PURE__ */u(p,{children:[
5
- /* @__PURE__ */d("button",{type:"button","aria-label":b.previousPage,onClick:()=>M(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */d(n,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
- /* @__PURE__ */d("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:b.pageOf(E,P)}),
7
- /* @__PURE__ */d("button",{type:"button","aria-label":b.nextPage,onClick:()=>M(e=>Math.min(P,e+1)),disabled:E>=P,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */d(n,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
8
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */d("button",{type:"button","aria-label":b.zoomOut,title:b.zoomOut,onClick:()=>{W(!1),D(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:T,children:/* @__PURE__ */d("span",{"aria-hidden":"true",children:"−"})}),
10
- /* @__PURE__ */u("select",{value:L?"fit":y.includes(Math.round(100*z))?Math.round(100*z):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(W(!1),D(Number(t)/100)):W(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":b.zoom,title:b.zoom,children:[
11
- /* @__PURE__ */d("option",{value:"fit",children:O}),!L&&!y.includes(Math.round(100*z))&&/* @__PURE__ */u("option",{value:"custom",children:[Math.round(100*z),"%"]}),y.map(e=>/* @__PURE__ */u("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */d("button",{type:"button","aria-label":b.zoomIn,title:b.zoomIn,onClick:()=>{W(!1),D(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:T,children:/* @__PURE__ */d("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */d("button",{type:"button",onClick:()=>W(!0),"aria-pressed":L,className:T+(L?" bg-gray-200 text-gray-900":""),title:b.fitHint,children:b.fit}),
14
- /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */u("button",{type:"button",onClick:()=>{if(!N)return;const t=window.open("","_blank");if(!t)return void e.error(b.allowPopups);const n=[];for(let e=1;e<=P;e++)n.push(N.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=a,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:T,children:[
16
- /* @__PURE__ */d(n,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),b.print]}),
17
- /* @__PURE__ */u("button",{type:"button",onClick:m??(()=>{const e=document.createElement("a");e.href=r,e.download=a,e.click()}),className:T,children:[
18
- /* @__PURE__ */d(n,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),b.download]}),h&&/* @__PURE__ */u("button",{type:"button",onClick:h,className:T,children:[
19
- /* @__PURE__ */d(n,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),b.email]})]}),
20
- /* @__PURE__ */d("div",{ref:C,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!N)return;if(e.ctrlKey||e.metaKey)return;const t=C.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<P?(e.preventDefault(),M(e=>Math.min(P,e+1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),M(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)}))},onKeyDown:e=>{if(!N)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<P&&(e.preventDefault(),M(e=>Math.min(P,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),M(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),M(1)):"End"===e.key&&(e.preventDefault(),M(P)))},children:S?/* @__PURE__ */d("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:b.loading}):/* @__PURE__ */u("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
- /* @__PURE__ */d("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
22
- /* @__PURE__ */u("div",{className:"relative shadow-lg rounded",children:[
23
- /* @__PURE__ */d("canvas",{ref:x,className:"block rounded"}),
24
- /* @__PURE__ */d("div",{ref:k,className:"preview-pdf-textlayer",onPointerDown:e=>e.currentTarget.classList.add("selecting")})]})]})})]})}export{p as PanelActions,b as PdfViewer,h as ToolbarSlotContext,v as fitScale,w as pdfWasmParams};
@@ -1,11 +0,0 @@
1
- import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-4EIZZYLK.js";import{Icon as n}from"./chunk-B427NVDP.js";import{createContext as o,useSyncExternalStore as i,useCallback as a,useContext as s,useMemo as c}from"react";import{jsxs as l,jsx as u}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)";function f(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function m(){return!1}function h(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 w(){return i(h,f,m)}var g={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"},y={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function v({tone:e}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
2
- return u(n,{name:"check",...t});case"error":/* @__PURE__ */
3
- return u(n,{name:"close",...t});case"warning":/* @__PURE__ */
4
- return u(n,{name:"error",...t});default:/* @__PURE__ */
5
- return u(n,{name:"info",...t})}}function x({status:e="info",title:t,subTitle:n,extra:o,icon:i,children:a,className:s=""}){const c=g[e],d=r().errors;/* @__PURE__ */
6
- return l("div",{role:"error"===c?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
7
- /* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${p[c]}`,children:i??/* @__PURE__ */u(v,{tone:c})}),
8
- /* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??y[e]?.(d)??""}),n&&/* @__PURE__ */u("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:n}),a&&/* @__PURE__ */u("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}function b({size:e="md",padding:t="py-12",label:r,className:n=""}){const o=/* @__PURE__ */u("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__ */u("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__ */u("p",{className:"text-sm text-gray-500",children:r})]})}var _="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),N={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"]},D=_?0:1,E=N.MOD[D],S=N.ALT[D],C="⇧",L="⏎",M=N.CMD_ENTER[D],T=N.CMD_S[D],A=N.CMD_K[D],k=N.CMD_DOT[D],I=N.CMD_A[D],j=N.CMD_Z[D],H=N.CMD_SHIFT_Z[D],F=N.ALT_SHIFT_D[D],Z=N.ALT_SHIFT_E[D],P=N.ALT_SHIFT_N[D],O=new Map(_?Object.values(N).map(([e,t])=>[e,t]):[]);function $(t){return e()?t:O.get(t)??t}var K={neutral:"inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},z={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function R({keys:e,size:t="md",tone:r="neutral",className:n=""}){const o=$(e);/* @__PURE__ */
10
- return u("kbd",{className:[K[r],z[t],n].filter(Boolean).join(" "),children:o})}var J=o(null);function U({value:e,children:t}){/* @__PURE__ */
11
- return u(J.Provider,{value:e,children:t})}function B(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:a(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var W={prefs:{},save:()=>{}};function V(){return s(J)??W}function Y(){const{prefs:e,save:t}=V(),r=a(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return c(()=>({prefs:e,save:r}),[e,r])}var q="react-os-shell:stale-chunk-reload-at",G=3e4,Q="vite:preloadError",X="/_next/static/",ee=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function te(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return ee.test(t)}function re(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(q),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(q),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(q,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;te(t)&&a(t)&&(e.preventDefault(),r())};let c=!0,l=!1;const u=/* @__PURE__ */new Set,d=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||l||u.has(t)||(u.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=>{u.delete(t),e&&c&&!l&&a(t)&&(l=!0,r())}))};return window.addEventListener(Q,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(Q,s),d&&window.removeEventListener("error",d,!0)}}export{S as ALT,F as ALT_SHIFT_D,Z as ALT_SHIFT_E,P as ALT_SHIFT_N,I as CMD_A,k as CMD_DOT,M as CMD_ENTER,A as CMD_K,T as CMD_S,H as CMD_SHIFT_Z,j as CMD_Z,L as ENTER,R as Kbd,b as LoadingSpinner,E as MOD,X as NEXT_CHUNK_PATH_PREFIX,x as Result,C as SHIFT,G as STALE_CHUNK_RELOAD_COOLDOWN_MS,q as STALE_CHUNK_RELOAD_KEY,U as ShellPrefsProvider,Q as VITE_PRELOAD_ERROR_EVENT,re as installStaleChunkReload,_ as isMac,te as isStaleChunkError,w as useIsMobile,B as useLocalStoragePrefs,Y as useShellPrefs,V as useShellPrefsAdapter,$ as useShortcutLabel};