efficient-shell 5.0.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +98 -2
  2. package/dist/{Browser-5F5LWXYQ.js → Browser-FKZ6M2MK.js} +18 -18
  3. package/dist/Calculator-LBFBTFSD.js +29 -0
  4. package/dist/ConfirmDialog-JAEFVRJM.js +1 -0
  5. package/dist/{CurrencyConverter-QEG6RFAS.js → CurrencyConverter-OV5ZQIAJ.js} +7 -7
  6. package/dist/{Documents-6DEUZVVA.js → Documents-HGGL3AWI.js} +24 -24
  7. package/dist/Files-DAQKIF6W.js +87 -0
  8. package/dist/{Notepad-KNJRTYXR.js → Notepad-PO724TVP.js} +10 -10
  9. package/dist/PdfViewer-6ALXGVTV.js +1 -0
  10. package/dist/{PomodoroTimer-T6YAQFIE.js → PomodoroTimer-LN5MYRZO.js} +49 -49
  11. package/dist/{Preview-KEIDYSHF.js → Preview-CUOO5WQ7.js} +126 -126
  12. package/dist/Sidebar-T4ABK2WV.js +44 -0
  13. package/dist/{Spreadsheet-HKXSYD5B.js → Spreadsheet-2N2JXBCY.js} +14 -14
  14. package/dist/{Stock-BZFC2ROU.js → Stock-65WVUGLI.js} +4 -4
  15. package/dist/{Weather-S3N5OWYF.js → Weather-TXJICMJN.js} +18 -18
  16. package/dist/{WorldClock-ACC3S6OA.js → WorldClock-RIHLKZGC.js} +6 -6
  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-WNEO7TSP.js → chunk-3PTA2C74.js} +1 -1
  21. package/dist/chunk-4QBLTEFU.js +1 -0
  22. package/dist/{chunk-TKUNR5KP.js → chunk-6GV4467L.js} +2 -2
  23. package/dist/chunk-AJB5G52B.js +1 -0
  24. package/dist/{chunk-2DX65GOO.js → chunk-ASSDCWKP.js} +1 -1
  25. package/dist/{chunk-MIAJQGWE.js → chunk-BFFXVA53.js} +1 -1
  26. package/dist/{chunk-R7EBJKN2.js → chunk-BFUBBDU6.js} +30 -30
  27. package/dist/{chunk-NHIGOEZF.js → chunk-H3UEYXRA.js} +1 -1
  28. package/dist/{chunk-ZDF5AR5W.js → chunk-HIAHERCD.js} +7 -7
  29. package/dist/{chunk-XUF7VW4U.js → chunk-JJIPGAXI.js} +29 -28
  30. package/dist/{chunk-T4CFSGSL.js → chunk-KHJ5XSEH.js} +8 -8
  31. package/dist/{chunk-KDRAU4XQ.js → chunk-M4OGNYOM.js} +8 -8
  32. package/dist/{chunk-P4SGJTK3.js → chunk-ML22KF7T.js} +1 -1
  33. package/dist/{chunk-ZZKIKW62.js → chunk-MTH7EAH3.js} +21 -21
  34. package/dist/{chunk-FOEVG7RT.js → chunk-OTP5WPI4.js} +8 -8
  35. package/dist/chunk-PS6PSCOR.js +1018 -0
  36. package/dist/{chunk-5IWSOLLY.js → chunk-QZNRMJE6.js} +2 -2
  37. package/dist/{chunk-VJP3R52B.js → chunk-R3622MOL.js} +1 -1
  38. package/dist/{chunk-PQLVWCUI.js → chunk-SSBOC52S.js} +4 -4
  39. package/dist/{chunk-3DGTIWZP.js → chunk-TKFAFZRY.js} +1 -1
  40. package/dist/{chunk-SBDIHKLU.js → chunk-TLTFS2D6.js} +51 -51
  41. package/dist/{chunk-GMMTTWHB.js → chunk-UAJQB45Y.js} +1 -1
  42. package/dist/{chunk-LK7V32MR.js → chunk-UG4ZPXXU.js} +1 -1
  43. package/dist/{chunk-QRV7RNQX.js → chunk-Y553QKEH.js} +14 -14
  44. package/dist/{chunk-PE4F4MJE.js → chunk-YJ6JMGMS.js} +4 -4
  45. package/dist/{chunk-LMIQV3NB.js → chunk-YQI7KXX3.js} +2 -2
  46. package/dist/file-intake/index.js +1 -1
  47. package/dist/i18n/index.d.ts +1 -1
  48. package/dist/{index-HMDUOPnX.d.ts → index-Dk5VKml6.d.ts} +401 -3
  49. package/dist/index.d.ts +3 -3
  50. package/dist/index.js +112 -112
  51. package/dist/locales/zh-Hans.d.ts +1 -1
  52. package/dist/locales/zh-Hans.js +1 -1
  53. package/dist/map/index.js +5 -5
  54. package/dist/markdown/index.js +1 -1
  55. package/dist/page-tabs/index.js +5 -5
  56. package/dist/pdf/index.js +1 -1
  57. package/dist/{strings-ZbotP_I6.d.ts → strings-aKfRDZWB.d.ts} +56 -0
  58. package/dist/ui/index.d.ts +2 -2
  59. package/dist/ui/index.js +1 -1
  60. package/dist/ui.css +63 -0
  61. package/package.json +1 -1
  62. package/dist/Calculator-4K53PFBL.js +0 -29
  63. package/dist/ConfirmDialog-X2DPOYWO.js +0 -1
  64. package/dist/Files-2VSFXA45.js +0 -87
  65. package/dist/PdfViewer-UZGDE4HD.js +0 -1
  66. package/dist/Sidebar-3NZRIL7F.js +0 -44
  67. package/dist/chunk-67PNFBCW.js +0 -993
  68. package/dist/chunk-J3LIIIHJ.js +0 -1
  69. package/dist/chunk-YKHMAGEM.js +0 -1
@@ -1,2 +1,2 @@
1
- import{ShellStringsProvider as t}from"./chunk-J3LIIIHJ.js";import{createContext as e,useEffect as a,useCallback as n,useMemo as r,useContext as l}from"react";import{jsx as o}from"react/jsx-runtime";var g={tag:"en",name:"English",locale:null},c="react-os-shell:language",u=t=>"string"==typeof t?t:t.tag;function i(t){try{const e=new Intl.Locale(t).maximize();return{language:e.language,script:e.script}}catch{return null}}function s(t,e){const a=e.map(u),n=t.toLowerCase(),r=a.find(t=>t.toLowerCase()===n);if(r)return r;const l=i(t);if(!l)return;const o=a.map(t=>({tag:t,parts:i(t)})).filter(t=>t.parts?.language===l.language);return(o.find(t=>t.parts?.script===l.script)??o[0])?.tag}function f(){try{return globalThis.localStorage?.getItem(c)??null}catch{return null}}function m(t){try{return globalThis.localStorage?.setItem(c,t),globalThis.localStorage?.getItem(c)===t}catch{return!1}}function h({offered:t,fallback:e,saved:a=f(),preferred:n=globalThis.navigator?.languages??[]}){const r=e??(t.length>0?u(t[0]):g.tag);if(a){const e=s(a,t);if(e)return e}for(const e of n){const a=s(e,t);if(a)return a}return r}var d=e({language:g.tag,languages:[g],setLanguage:async()=>{}}),p=()=>globalThis.location?.reload();function b({languages:e,language:l,strings:g,onChange:c,reload:u=p,children:i}){const s=e.find(t=>t.tag===l),f=s?void 0===s.locale?s.tag:s.locale??void 0:void 0;a(()=>{const t=globalThis.document?.documentElement;if(!t)return;const e=t.getAttribute("lang");return t.setAttribute("lang",l),()=>{null===e?t.removeAttribute("lang"):t.setAttribute("lang",e)}},[l]);const h=n(async t=>{if(t!==l&&e.some(e=>e.tag===t)){m(t);try{await(c?.(t))}catch{}u&&u()}},[l,e,c,u]),b=r(()=>({language:l,languages:e,setLanguage:h}),[l,e,h]);/* @__PURE__ */
1
+ import{ShellStringsProvider as t}from"./chunk-AJB5G52B.js";import{createContext as e,useEffect as a,useCallback as n,useMemo as r,useContext as l}from"react";import{jsx as o}from"react/jsx-runtime";var g={tag:"en",name:"English",locale:null},c="react-os-shell:language",u=t=>"string"==typeof t?t:t.tag;function i(t){try{const e=new Intl.Locale(t).maximize();return{language:e.language,script:e.script}}catch{return null}}function s(t,e){const a=e.map(u),n=t.toLowerCase(),r=a.find(t=>t.toLowerCase()===n);if(r)return r;const l=i(t);if(!l)return;const o=a.map(t=>({tag:t,parts:i(t)})).filter(t=>t.parts?.language===l.language);return(o.find(t=>t.parts?.script===l.script)??o[0])?.tag}function f(){try{return globalThis.localStorage?.getItem(c)??null}catch{return null}}function m(t){try{return globalThis.localStorage?.setItem(c,t),globalThis.localStorage?.getItem(c)===t}catch{return!1}}function h({offered:t,fallback:e,saved:a=f(),preferred:n=globalThis.navigator?.languages??[]}){const r=e??(t.length>0?u(t[0]):g.tag);if(a){const e=s(a,t);if(e)return e}for(const e of n){const a=s(e,t);if(a)return a}return r}var d=e({language:g.tag,languages:[g],setLanguage:async()=>{}}),p=()=>globalThis.location?.reload();function b({languages:e,language:l,strings:g,onChange:c,reload:u=p,children:i}){const s=e.find(t=>t.tag===l),f=s?void 0===s.locale?s.tag:s.locale??void 0:void 0;a(()=>{const t=globalThis.document?.documentElement;if(!t)return;const e=t.getAttribute("lang");return t.setAttribute("lang",l),()=>{null===e?t.removeAttribute("lang"):t.setAttribute("lang",e)}},[l]);const h=n(async t=>{if(t!==l&&e.some(e=>e.tag===t)){m(t);try{await(c?.(t))}catch{}u&&u()}},[l,e,c,u]),b=r(()=>({language:l,languages:e,setLanguage:h}),[l,e,h]);/* @__PURE__ */
2
2
  return o(d.Provider,{value:b,children:/* @__PURE__ */o(t,{value:g,locale:f,children:i})})}function v(){return l(d)}export{g as ENGLISH,c as SHELL_LANGUAGE_STORAGE_KEY,b as ShellLanguageProvider,s as matchShellLanguage,f as readSavedShellLanguage,h as resolveShellLanguage,m as saveShellLanguage,v as useShellLanguage};
@@ -1,23 +1,23 @@
1
- import{toast_default as e}from"./chunk-3DGTIWZP.js";import{ChevronLeftFallback as t,ChevronRightFallback as n,PrintFallback as r,DownloadFallback as a,EmailFallback as o}from"./chunk-XUF7VW4U.js";import{useShellStrings as i}from"./chunk-J3LIIIHJ.js";import{Icon as l}from"./chunk-YKZHOXI4.js";import{createContext as s,useContext as c,useRef as d,useState as u,useEffect as m}from"react";import*as h from"pdfjs-dist";import{createPortal as p}from"react-dom";import{jsx as f,jsxs as g}from"react/jsx-runtime";function w(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 y=s(null);function b({children:e}){const t=c(y);return t?p(e,t):
2
- /* @__PURE__ */f("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||h.GlobalWorkerOptions.workerSrc||(h.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${h.version}/build/pdf.worker.min.mjs`);var v={"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},x=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=v[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 w(n,t,a);return a}};function k(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:x}}var C=[50,75,100,125,150,200,300,400];function N(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 j({url:s,filename:c,fit:p="width",onDownload:w,onEmail:y,workerSrc:v,wasmUrl:x}){const j=i().pdf,M=d(null),E=d(null),P=d(null),[W,_]=u(null),[z,D]=u(1),[L,S]=u(0),[T,$]=u(1),[O,A]=u(!0),[U,H]=u(!0),I=d(j.loadFailed);I.current=j.loadFailed,m(()=>{let t=!1;return H(!0),D(1),v&&(h.GlobalWorkerOptions.workerSrc=v),h.getDocument({url:s,...k(x)}).promise.then(e=>{t||(_(e),S(e.numPages),H(!1))}).catch(()=>{t||(e.error(I.current),H(!1))}),()=>{t=!0}},[s,v,x]),m(()=>{if(!W||!O||!P.current)return;const e=()=>{const e=P.current;e&&W.getPage(z).then(t=>{if(!P.current)return;const n=t.getViewport({scale:1}),r=N(p,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});$(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(P.current),()=>t.disconnect()},[W,z,O,p]),m(()=>{if(!W||!M.current)return;let e=!1,t=null,n=null;return W.getPage(z).then(r=>{if(e||!M.current)return;const a=r.getViewport({scale:T}),o=M.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 l=E.current;l&&(l.replaceChildren(),l.style.setProperty("--total-scale-factor",String(a.scale)),n=new h.TextLayer({textContentSource:r.streamTextContent(),container:l,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",l.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[W,z,T]),m(()=>{const e=()=>E.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const F="page"===p?j.fitPage:j.fitWidth,R="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
1
+ import{toast_default as e}from"./chunk-TKFAFZRY.js";import{ChevronLeftFallback as t,ChevronRightFallback as n,PrintFallback as r,DownloadFallback as a,EmailFallback as o}from"./chunk-JJIPGAXI.js";import{useShellStrings as i}from"./chunk-AJB5G52B.js";import{Icon as l}from"./chunk-YKZHOXI4.js";import{createContext as s,useContext as c,useRef as d,useState as u,useEffect as m}from"react";import*as h from"pdfjs-dist";import{createPortal as p}from"react-dom";import{jsx as f,jsxs as g}from"react/jsx-runtime";function w(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 y=s(null);function b({children:e}){const t=c(y);return t?p(e,t):
2
+ /* @__PURE__ */f("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||h.GlobalWorkerOptions.workerSrc||(h.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${h.version}/build/pdf.worker.min.mjs`);var v={"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},x=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=v[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 w(n,t,a);return a}};function k(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:x}}var C=[50,75,100,125,150,200,300,400];function N(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 j({url:s,filename:c,fit:p="width",onDownload:w,onEmail:y,workerSrc:v,wasmUrl:x}){const j=i().pdf,M=d(null),E=d(null),P=d(null),[_,z]=u(null),[A,D]=u(1),[W,L]=u(0),[S,T]=u(1),[$,O]=u(!0),[F,H]=u(!0),U=d(j.loadFailed);U.current=j.loadFailed,m(()=>{let t=!1;return H(!0),D(1),v&&(h.GlobalWorkerOptions.workerSrc=v),h.getDocument({url:s,...k(x)}).promise.then(e=>{t||(z(e),L(e.numPages),H(!1))}).catch(()=>{t||(e.error(U.current),H(!1))}),()=>{t=!0}},[s,v,x]),m(()=>{if(!_||!$||!P.current)return;const e=()=>{const e=P.current;e&&_.getPage(A).then(t=>{if(!P.current)return;const n=t.getViewport({scale:1}),r=N(p,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});T(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(P.current),()=>t.disconnect()},[_,A,$,p]),m(()=>{if(!_||!M.current)return;let e=!1,t=null,n=null;return _.getPage(A).then(r=>{if(e||!M.current)return;const a=r.getViewport({scale:S}),o=M.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 l=E.current;l&&(l.replaceChildren(),l.style.setProperty("--total-scale-factor",String(a.scale)),n=new h.TextLayer({textContentSource:r.streamTextContent(),container:l,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",l.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[_,A,S]),m(()=>{const e=()=>E.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const R="page"===p?j.fitPage:j.fitWidth,I="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
3
  return g("div",{className:"flex flex-col h-full",children:[
4
4
  /* @__PURE__ */g(b,{children:[
5
- /* @__PURE__ */f("button",{type:"button","aria-label":j.previousPage,onClick:()=>D(e=>Math.max(1,e-1)),disabled:z<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */f(l,{name:"chevron-left",fallback:t,className:"h-3.5 w-3.5",strokeWidth:2})}),
6
- /* @__PURE__ */f("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:j.pageOf(z,L)}),
7
- /* @__PURE__ */f("button",{type:"button","aria-label":j.nextPage,onClick:()=>D(e=>Math.min(L,e+1)),disabled:z>=L,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */f(l,{name:"chevron-right",fallback:n,className:"h-3.5 w-3.5",strokeWidth:2})}),
5
+ /* @__PURE__ */f("button",{type:"button","aria-label":j.previousPage,onClick:()=>D(e=>Math.max(1,e-1)),disabled:A<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */f(l,{name:"chevron-left",fallback:t,className:"h-3.5 w-3.5",strokeWidth:2})}),
6
+ /* @__PURE__ */f("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:j.pageOf(A,W)}),
7
+ /* @__PURE__ */f("button",{type:"button","aria-label":j.nextPage,onClick:()=>D(e=>Math.min(W,e+1)),disabled:A>=W,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */f(l,{name:"chevron-right",fallback:n,className:"h-3.5 w-3.5",strokeWidth:2})}),
8
8
  /* @__PURE__ */f("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */f("button",{type:"button","aria-label":j.zoomOut,title:j.zoomOut,onClick:()=>{A(!1),$(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:R,children:/* @__PURE__ */f("span",{"aria-hidden":"true",children:"−"})}),
10
- /* @__PURE__ */g("select",{value:O?"fit":C.includes(Math.round(100*T))?Math.round(100*T):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(A(!1),$(Number(t)/100)):A(!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":j.zoom,title:j.zoom,children:[
11
- /* @__PURE__ */f("option",{value:"fit",children:F}),!O&&!C.includes(Math.round(100*T))&&/* @__PURE__ */g("option",{value:"custom",children:[Math.round(100*T),"%"]}),C.map(e=>/* @__PURE__ */g("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */f("button",{type:"button","aria-label":j.zoomIn,title:j.zoomIn,onClick:()=>{A(!1),$(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:R,children:/* @__PURE__ */f("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */f("button",{type:"button",onClick:()=>A(!0),"aria-pressed":O,className:R+(O?" bg-gray-200 text-gray-900":""),title:j.fitHint,children:j.fit}),
9
+ /* @__PURE__ */f("button",{type:"button","aria-label":j.zoomOut,title:j.zoomOut,onClick:()=>{O(!1),T(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:I,children:/* @__PURE__ */f("span",{"aria-hidden":"true",children:"−"})}),
10
+ /* @__PURE__ */g("select",{value:$?"fit":C.includes(Math.round(100*S))?Math.round(100*S):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(O(!1),T(Number(t)/100)):O(!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":j.zoom,title:j.zoom,children:[
11
+ /* @__PURE__ */f("option",{value:"fit",children:R}),!$&&!C.includes(Math.round(100*S))&&/* @__PURE__ */g("option",{value:"custom",children:[Math.round(100*S),"%"]}),C.map(e=>/* @__PURE__ */g("option",{value:e,children:[e,"%"]},e))]}),
12
+ /* @__PURE__ */f("button",{type:"button","aria-label":j.zoomIn,title:j.zoomIn,onClick:()=>{O(!1),T(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:I,children:/* @__PURE__ */f("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */f("button",{type:"button",onClick:()=>O(!0),"aria-pressed":$,className:I+($?" bg-gray-200 text-gray-900":""),title:j.fitHint,children:j.fit}),
14
14
  /* @__PURE__ */f("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */g("button",{type:"button",onClick:()=>{if(!W)return;const t=window.open("","_blank");if(!t)return void e.error(j.allowPopups);const n=[];for(let e=1;e<=L;e++)n.push(W.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=c,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:R,children:[
15
+ /* @__PURE__ */g("button",{type:"button",onClick:()=>{if(!_)return;const t=window.open("","_blank");if(!t)return void e.error(j.allowPopups);const n=[];for(let e=1;e<=W;e++)n.push(_.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=c,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:I,children:[
16
16
  /* @__PURE__ */f(l,{name:"print",fallback:r,className:"h-3.5 w-3.5",strokeWidth:1.5}),j.print]}),
17
- /* @__PURE__ */g("button",{type:"button",onClick:w??(()=>{const e=document.createElement("a");e.href=s,e.download=c,e.click()}),className:R,children:[
18
- /* @__PURE__ */f(l,{name:"download",fallback:a,className:"h-3.5 w-3.5",strokeWidth:1.5}),j.download]}),y&&/* @__PURE__ */g("button",{type:"button",onClick:y,className:R,children:[
17
+ /* @__PURE__ */g("button",{type:"button",onClick:w??(()=>{const e=document.createElement("a");e.href=s,e.download=c,e.click()}),className:I,children:[
18
+ /* @__PURE__ */f(l,{name:"download",fallback:a,className:"h-3.5 w-3.5",strokeWidth:1.5}),j.download]}),y&&/* @__PURE__ */g("button",{type:"button",onClick:y,className:I,children:[
19
19
  /* @__PURE__ */f(l,{name:"email",fallback:o,className:"h-3.5 w-3.5",strokeWidth:1.5}),j.email]})]}),
20
- /* @__PURE__ */f("div",{ref:P,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!W)return;if(e.ctrlKey||e.metaKey)return;const t=P.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&z<L?(e.preventDefault(),D(e=>Math.min(L,e+1)),requestAnimationFrame(()=>{P.current&&(P.current.scrollTop=0)})):e.deltaY<0&&n&&z>1&&(e.preventDefault(),D(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{P.current&&(P.current.scrollTop=P.current.scrollHeight)}))},onKeyDown:e=>{if(!W)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?z<L&&(e.preventDefault(),D(e=>Math.min(L,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?z>1&&(e.preventDefault(),D(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),D(1)):"End"===e.key&&(e.preventDefault(),D(L)))},children:U?/* @__PURE__ */f("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:j.loading}):/* @__PURE__ */g("div",{className:"min-h-full flex items-center justify-center p-4",children:[
20
+ /* @__PURE__ */f("div",{ref:P,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!_)return;if(e.ctrlKey||e.metaKey)return;const t=P.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&A<W?(e.preventDefault(),D(e=>Math.min(W,e+1)),requestAnimationFrame(()=>{P.current&&(P.current.scrollTop=0)})):e.deltaY<0&&n&&A>1&&(e.preventDefault(),D(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{P.current&&(P.current.scrollTop=P.current.scrollHeight)}))},onKeyDown:e=>{if(!_)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?A<W&&(e.preventDefault(),D(e=>Math.min(W,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?A>1&&(e.preventDefault(),D(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),D(1)):"End"===e.key&&(e.preventDefault(),D(W)))},children:F?/* @__PURE__ */f("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:j.loading}):/* @__PURE__ */g("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
21
  /* @__PURE__ */f("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
22
  /* @__PURE__ */g("div",{className:"relative shadow-lg rounded",children:[
23
23
  /* @__PURE__ */f("canvas",{ref:M,className:"block rounded"}),
@@ -1,5 +1,5 @@
1
- import{Tooltip as e}from"./chunk-OGXU7QFW.js";import{useBrowserLayoutEffect as r,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-J3LIIIHJ.js";import{useRef as o,useEffect as i,useCallback as l}from"react";import{jsx as a,jsxs as s,Fragment as c}from"react/jsx-runtime";var u=(e,r,t)=>Math.min(t,Math.max(r,e));function d(e,r,t,n,o){return Math.round(u("left"===t?e+r:e-r,n,o))}function h(e,r,t){let n=null;try{n=window.localStorage.getItem(e)}catch{return null}const o=n?parseInt(n,10):NaN;return Number.isNaN(o)?null:u(o,r,t)}function m({width:t,onResize:s,side:c,min:m,max:f,defaultWidth:v=m,step:b=16,storageKey:g,label:p,hint:y,controls:x,className:w=""}){const N=n().resizeHandle,z=o(null),k=o({onResize:s,min:m,max:f,side:c});k.current={onResize:s,min:m,max:f,side:c},r(()=>{if(!g)return;const e=h(g,m,f);null!==e&&e!==t&&s(e)},[g]),i(()=>{if(!g)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(g,String(Math.round(t)))}catch{}},200);return()=>window.clearTimeout(e)},[t,g]);const P=l(()=>{z.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);i(()=>P,[P]);const I=e=>{z.current&&(e.currentTarget.hasPointerCapture?.(z.current.pointer)&&e.currentTarget.releasePointerCapture(z.current.pointer),P())},M="left"===c?"right-0":"left-0";/* @__PURE__ */
2
- return a(e,{content:y??N.hint,side:"left"===c?"right":"left",delay:600,className:`absolute inset-y-0 ${M} z-10 flex w-2 ${w}`.trim(),children:/* @__PURE__ */a("div",{role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":p??N.label,"aria-valuenow":Math.round(t),"aria-valuemin":m,"aria-valuemax":f,"aria-controls":x,"data-resize-handle":c,onPointerDown:e=>{0===e.button&&(e.preventDefault(),z.current={x:e.clientX,width:t,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=z.current;if(!r)return;if(0===e.buttons)return void P();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:n,min:o,max:i,side:l}=k.current;n(d(r.width,t,l,o,i))},onPointerUp:I,onPointerCancel:I,onLostPointerCapture:()=>{z.current&&P()},onDoubleClick:()=>s(u(v,m,f)),onKeyDown:e=>{const r="ArrowRight"===e.key?b:"ArrowLeft"===e.key?-b:null,n=null!==r?d(t,r,c,m,f):"Home"===e.key?m:"End"===e.key?f:"Enter"===e.key?u(v,m,f):null;null!==n&&(e.preventDefault(),n!==t&&s(n))},className:"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */a("div",{"aria-hidden":"true",className:`absolute inset-y-0 ${M} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}var f=(e,r,t)=>Math.min(Math.max(e,r),t);function v({sidebar:e,sidebarTop:r,sidebarBottom:o,children:i,side:l="left",storageKey:u,defaultWidth:d=256,minWidth:v=180,maxWidth:b=480,className:g="",sidebarClassName:p=("right"===l?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:y="bg-white"}){const x="right"===l,w=n().sidebar,[N,z]=t(()=>(u?h(u,v,b):null)??f(d,v,b),f(d,v,b)),k=null!=r||null!=o,P=/* @__PURE__ */s("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:N},children:[
1
+ import{Tooltip as e}from"./chunk-OGXU7QFW.js";import{useBrowserLayoutEffect as r,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-AJB5G52B.js";import{useRef as o,useEffect as i,useCallback as l}from"react";import{jsx as a,jsxs as s,Fragment as c}from"react/jsx-runtime";var u=(e,r,t)=>Math.min(t,Math.max(r,e));function d(e,r,t,n,o){return Math.round(u("left"===t?e+r:e-r,n,o))}function h(e,r,t){let n=null;try{n=window.localStorage.getItem(e)}catch{return null}const o=n?parseInt(n,10):NaN;return Number.isNaN(o)?null:u(o,r,t)}function m({width:t,onResize:s,side:c,min:m,max:f,defaultWidth:v=m,step:b=16,storageKey:g,label:p,hint:y,controls:x,className:w=""}){const N=n().resizeHandle,z=o(null),k=o({onResize:s,min:m,max:f,side:c});k.current={onResize:s,min:m,max:f,side:c},r(()=>{if(!g)return;const e=h(g,m,f);null!==e&&e!==t&&s(e)},[g]),i(()=>{if(!g)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(g,String(Math.round(t)))}catch{}},200);return()=>window.clearTimeout(e)},[t,g]);const P=l(()=>{z.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);i(()=>P,[P]);const M=e=>{z.current&&(e.currentTarget.hasPointerCapture?.(z.current.pointer)&&e.currentTarget.releasePointerCapture(z.current.pointer),P())},C="left"===c?"right-0":"left-0";/* @__PURE__ */
2
+ return a(e,{content:y??N.hint,side:"left"===c?"right":"left",delay:600,className:`absolute inset-y-0 ${C} z-10 flex w-2 ${w}`.trim(),children:/* @__PURE__ */a("div",{role:"separator",tabIndex:0,"aria-orientation":"vertical","aria-label":p??N.label,"aria-valuenow":Math.round(t),"aria-valuemin":m,"aria-valuemax":f,"aria-controls":x,"data-resize-handle":c,onPointerDown:e=>{0===e.button&&(e.preventDefault(),z.current={x:e.clientX,width:t,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=z.current;if(!r)return;if(0===e.buttons)return void P();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:n,min:o,max:i,side:l}=k.current;n(d(r.width,t,l,o,i))},onPointerUp:M,onPointerCancel:M,onLostPointerCapture:()=>{z.current&&P()},onDoubleClick:()=>s(u(v,m,f)),onKeyDown:e=>{const r="ArrowRight"===e.key?b:"ArrowLeft"===e.key?-b:null,n=null!==r?d(t,r,c,m,f):"Home"===e.key?m:"End"===e.key?f:"Enter"===e.key?u(v,m,f):null;null!==n&&(e.preventDefault(),n!==t&&s(n))},className:"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */a("div",{"aria-hidden":"true",className:`absolute inset-y-0 ${C} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}var f=(e,r,t)=>Math.min(Math.max(e,r),t);function v({sidebar:e,sidebarTop:r,sidebarBottom:o,children:i,side:l="left",storageKey:u,defaultWidth:d=256,minWidth:v=180,maxWidth:b=480,className:g="",sidebarClassName:p=("right"===l?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:y="bg-white"}){const x="right"===l,w=n().sidebar,[N,z]=t(()=>(u?h(u,v,b):null)??f(d,v,b),f(d,v,b)),k=null!=r||null!=o,P=/* @__PURE__ */s("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:N},children:[
3
3
  /* @__PURE__ */s("div",{className:`flex h-full flex-col ${k?"overflow-hidden":"overflow-y-auto"} ${p}`,children:[null!=r&&/* @__PURE__ */a("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:r}),k?/* @__PURE__ */a("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=o&&/* @__PURE__ */a("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:o})]}),
4
- /* @__PURE__ */a(m,{side:l,width:N,onResize:z,min:v,max:b,defaultWidth:f(d,v,b),storageKey:u,hint:w.resize})]}),I=/* @__PURE__ */a("div",{className:`flex min-w-0 flex-1 flex-col ${y}`,children:i});/* @__PURE__ */
5
- return a("div",{className:`flex h-full w-full overflow-hidden ${g}`,children:/* @__PURE__ */s(c,x?{children:[I,P]}:{children:[P,I]})})}export{m as ResizeHandle,v as SidebarLayout};
4
+ /* @__PURE__ */a(m,{side:l,width:N,onResize:z,min:v,max:b,defaultWidth:f(d,v,b),storageKey:u,hint:w.resize})]}),M=/* @__PURE__ */a("div",{className:`flex min-w-0 flex-1 flex-col ${y}`,children:i});/* @__PURE__ */
5
+ return a("div",{className:`flex h-full w-full overflow-hidden ${g}`,children:/* @__PURE__ */s(c,x?{children:[M,P]}:{children:[P,M]})})}export{m as ResizeHandle,v as SidebarLayout};
@@ -1,4 +1,4 @@
1
- import{navIcons as e}from"./chunk-DSSLOQDW.js";import{FolderFallback as t,PageFallback as r}from"./chunk-XUF7VW4U.js";import{Icon as n}from"./chunk-YKZHOXI4.js";import{isValidElement as o,cloneElement as i}from"react";import{jsx as l,jsxs as a}from"react/jsx-runtime";var d=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function s(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return d[Math.abs(t)%d.length]}var c={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},f={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},p={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},u={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function m({className:e}){/* @__PURE__ */
1
+ import{navIcons as e}from"./chunk-DSSLOQDW.js";import{FolderFallback as t,PageFallback as r}from"./chunk-JJIPGAXI.js";import{Icon as n}from"./chunk-YKZHOXI4.js";import{isValidElement as o,cloneElement as i}from"react";import{jsx as l,jsxs as a}from"react/jsx-runtime";var d=["from-blue-500 to-blue-700","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-pink-500 to-rose-600","from-red-500 to-rose-600","from-orange-500 to-red-600","from-amber-500 to-orange-600","from-yellow-500 to-amber-500","from-lime-500 to-green-600","from-green-500 to-emerald-600","from-emerald-500 to-teal-600","from-teal-500 to-cyan-600","from-cyan-500 to-sky-600","from-sky-500 to-blue-600","from-violet-500 to-fuchsia-600"];function s(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return d[Math.abs(t)%d.length]}var c={order:"text-blue-600",purchase_order:"text-purple-600",invoice:"text-green-600",client:"text-indigo-600",manufacturer:"text-orange-600",shipment:"text-teal-600",part_number:"text-gray-600",project:"text-pink-600",mould:"text-red-600",design:"text-cyan-600",brand:"text-amber-600",price_sheet:"text-emerald-600",folder:"text-yellow-600",page:"text-blue-500"},f={order:"SO",purchase_order:"PO",invoice:"INV",client:"CLI",manufacturer:"MFR",shipment:"DN",part_number:"PN",project:"PRJ",mould:"MLD",design:"DSN",brand:"BRD",price_sheet:"PS",vendor_invoice:"VI",vendor_payment:"VP",warranty_claim:"WC",qc_report:"QC",vendor_shipment:"GRN",bank_account:"BA",wheel_finish:"WF",weight_log:"WL",production_progress:"PP",vendor_price_sheet:"VPS",proposal:"PR",folder:"FLD"},p={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},u={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function m({className:e}){/* @__PURE__ */
2
2
  return l(n,{name:"folder",fallback:t,className:e})}function h(t,r){return r&&e[r]||(t?e[t]:void 0)}var w=/* @__PURE__ */l("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6z"})});function g({entityType:e,isSelected:t,entityId:r,label:n,fileKind:d}){const g="preview-file"===e&&d,y=g?u[d]:null,x=g?p[d]:null;if("folder"===e)/* @__PURE__ */
3
3
  return l("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */l(m,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=h(r,n),a=s(r||n||"page");/* @__PURE__ */
4
4
  return l("div",{className:"w-12 h-12 flex items-center justify-center "+(t?"rounded-lg bg-blue-400/30 ring-2 ring-blue-500":""),children:/* @__PURE__ */l("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${a} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&o(e)?i(e,{className:"h-7 w-7 text-white"}):w})})}/* @__PURE__ */
@@ -10,4 +10,4 @@ return a("div",{className:"w-12 h-12 relative flex items-center justify-center "
10
10
  /* @__PURE__ */l("span",{className:`absolute inset-0 flex items-center justify-center text-[9px] font-bold pt-2 ${y??c[e]??"text-gray-600"}`,children:x??f[e]??e.slice(0,3).toUpperCase()})]})}function y({item:e}){if("folder"===e.entityType)/* @__PURE__ */
11
11
  return l(m,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=h(e.entityId,e.label);/* @__PURE__ */
12
12
  return l("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${s(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&o(t)?i(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */l("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const t=("preview-file"===e.entityType&&e.fileKind?u[e.fileKind]:c[e.entityType])??"text-gray-400";/* @__PURE__ */
13
- return l(n,{name:"page",fallback:r,className:`h-4 w-4 shrink-0 ${t}`,strokeWidth:1.5})}function x(e){return"preview-file"===e.entityType&&e.fileKind?p[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":f[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var b=null,v=/* @__PURE__ */new Set;function _(e){b=e,v.forEach(e=>e())}function k(e){return v.add(e),()=>{v.delete(e)}}function N(){return b}var j="__REACT_OS_SHELL_FILES_VIEW__",C="react-os-shell:files-show-trash",I="react-os-shell:files-open-desktop-folder";function S(){"undefined"!=typeof window&&(window[j]="trash",window.dispatchEvent(new CustomEvent(C)))}function T(e){"undefined"!=typeof window&&(window[j]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(I,{detail:{folderId:e}})))}function P(){if("undefined"==typeof window)return null;const e=window[j];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function V(){const e=P();return"undefined"!=typeof window&&(window[j]=null),e}export{y as DesktopItemMiniIcon,I as FILES_OPEN_DESKTOP_FOLDER_EVENT,C as FILES_SHOW_TRASH_EVENT,g as FileIconTile,m as FolderGlyph,V as consumeFilesViewRequest,x as desktopItemTypeLabel,N as getDesktopFoldersSnapshot,P as peekFilesViewRequest,_ as publishDesktopFolders,T as requestFilesDesktopFolderView,S as requestFilesTrashView,k as subscribeDesktopFolders};
13
+ return l(n,{name:"page",fallback:r,className:`h-4 w-4 shrink-0 ${t}`,strokeWidth:1.5})}function x(e){return"preview-file"===e.entityType&&e.fileKind?p[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":f[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var b=null,v=/* @__PURE__ */new Set;function _(e){b=e,v.forEach(e=>e())}function k(e){return v.add(e),()=>{v.delete(e)}}function N(){return b}var I="__REACT_OS_SHELL_FILES_VIEW__",j="react-os-shell:files-show-trash",C="react-os-shell:files-open-desktop-folder";function S(){"undefined"!=typeof window&&(window[I]="trash",window.dispatchEvent(new CustomEvent(j)))}function P(e){"undefined"!=typeof window&&(window[I]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(C,{detail:{folderId:e}})))}function T(){if("undefined"==typeof window)return null;const e=window[I];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function L(){const e=T();return"undefined"!=typeof window&&(window[I]=null),e}export{y as DesktopItemMiniIcon,C as FILES_OPEN_DESKTOP_FOLDER_EVENT,j as FILES_SHOW_TRASH_EVENT,g as FileIconTile,m as FolderGlyph,L as consumeFilesViewRequest,x as desktopItemTypeLabel,N as getDesktopFoldersSnapshot,T as peekFilesViewRequest,_ as publishDesktopFolders,P as requestFilesDesktopFolderView,S as requestFilesTrashView,k as subscribeDesktopFolders};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-WNEO7TSP.js";import"../chunk-J3LIIIHJ.js";import"../chunk-C3QOHMR6.js";
2
+ export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-3PTA2C74.js";import"../chunk-AJB5G52B.js";import"../chunk-C3QOHMR6.js";
@@ -1,5 +1,5 @@
1
1
  import { ResourceLanguage, i18n, TFunction } from 'i18next';
2
- import { S as ShellStringsOverride } from '../strings-ZbotP_I6.js';
2
+ import { S as ShellStringsOverride } from '../strings-aKfRDZWB.js';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
5
5