efficient-shell 4.160.0 → 4.161.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 (62) hide show
  1. package/README.md +13 -2
  2. package/dist/{Browser-3KOGROX7.js → Browser-56UAG7EF.js} +24 -24
  3. package/dist/Calculator-MDKSVQWZ.js +29 -0
  4. package/dist/ConfirmDialog-JRHVCPKS.js +1 -0
  5. package/dist/{CurrencyConverter-3GTKDKHH.js → CurrencyConverter-XT37LTUQ.js} +7 -7
  6. package/dist/{Documents-FDGF7QBQ.js → Documents-6DCVHA5H.js} +10 -10
  7. package/dist/{Files-TTSYOPVB.js → Files-R5QVRKMV.js} +27 -27
  8. package/dist/{Notepad-ITHIATP2.js → Notepad-5IVPFPDK.js} +10 -10
  9. package/dist/PdfViewer-7YLJE5RU.js +1 -0
  10. package/dist/{PomodoroTimer-CRKL26PP.js → PomodoroTimer-DBOGYNE4.js} +25 -25
  11. package/dist/{Preview-GZTTEZWS.js → Preview-ZW6SHMLE.js} +16 -16
  12. package/dist/{Sidebar-ECJEQXFK.js → Sidebar-PS3KIZNN.js} +35 -35
  13. package/dist/Spreadsheet-HUJKMGJK.js +37 -0
  14. package/dist/{Stock-NAHSVLAJ.js → Stock-ZDS7COTN.js} +5 -5
  15. package/dist/{Weather-AY3QWBQT.js → Weather-X6QGZVE6.js} +19 -19
  16. package/dist/{WorldClock-AXNMA4PG.js → WorldClock-5MWMG2UP.js} +5 -5
  17. package/dist/apps/index.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/chunk-5A7MWTXX.js +1 -0
  20. package/dist/{chunk-XN76YBX3.js → chunk-65HF6TOM.js} +8 -8
  21. package/dist/{chunk-XPSADW6W.js → chunk-753UFF7V.js} +1 -1
  22. package/dist/{chunk-A6FPBD7W.js → chunk-7B5HMN5K.js} +1 -1
  23. package/dist/{chunk-PDTZTADH.js → chunk-7U37VFLE.js} +17 -17
  24. package/dist/{chunk-36QR65KW.js → chunk-A3XBNDFH.js} +2 -2
  25. package/dist/{chunk-KZPQW6UL.js → chunk-C2A4PIGZ.js} +2 -2
  26. package/dist/{chunk-ZJ66QFOH.js → chunk-C3BIYUIZ.js} +1 -1
  27. package/dist/{chunk-X6E6UULK.js → chunk-CFZRCRHL.js} +67 -67
  28. package/dist/chunk-DSSLOQDW.js +2 -0
  29. package/dist/{chunk-26RS37FG.js → chunk-GAXAMRUZ.js} +1 -1
  30. package/dist/{chunk-FHIF6IUV.js → chunk-HGALBDOZ.js} +1 -1
  31. package/dist/{chunk-JGHRZYNV.js → chunk-ILTSTULF.js} +1 -1
  32. package/dist/chunk-JIHTLW46.js +27 -0
  33. package/dist/{chunk-VRW5JNMR.js → chunk-KCCRQ3Z4.js} +7 -7
  34. package/dist/chunk-LID5IFAT.js +1 -0
  35. package/dist/{chunk-HF4IZFFX.js → chunk-M74BPJXH.js} +13 -13
  36. package/dist/chunk-RQ6BKTSJ.js +1 -0
  37. package/dist/chunk-S2PS4IOT.js +2 -0
  38. package/dist/{chunk-LCB4IVEL.js → chunk-SJZN26D3.js} +191 -191
  39. package/dist/{chunk-HQTSPK5Q.js → chunk-TOENMGDE.js} +1 -1
  40. package/dist/{chunk-B2TBCVHH.js → chunk-VBQOHZEM.js} +1 -1
  41. package/dist/{chunk-UPI2GKKD.js → chunk-X4VJWQTO.js} +10 -10
  42. package/dist/{chunk-T6MKFQRH.js → chunk-YNBAOTST.js} +4 -4
  43. package/dist/{chunk-KASHUEJV.js → chunk-ZP7WIUAR.js} +4 -4
  44. package/dist/file-intake/index.js +1 -1
  45. package/dist/{index-Brl0XepS.d.ts → index-D-KwOzhB.d.ts} +80 -3
  46. package/dist/index.d.ts +2 -2
  47. package/dist/index.js +645 -645
  48. package/dist/map/index.js +3 -3
  49. package/dist/page-tabs/index.js +5 -5
  50. package/dist/pdf/index.js +1 -1
  51. package/dist/ui/index.d.ts +1 -1
  52. package/dist/ui/index.js +1 -1
  53. package/package.json +1 -1
  54. package/dist/Calculator-QLJJ3ICT.js +0 -29
  55. package/dist/ConfirmDialog-7Q2OOU4W.js +0 -1
  56. package/dist/PdfViewer-VIT7Y55M.js +0 -1
  57. package/dist/Spreadsheet-PFKZTLSI.js +0 -37
  58. package/dist/chunk-6UXY7MPY.js +0 -2
  59. package/dist/chunk-GF2XCISN.js +0 -1
  60. package/dist/chunk-JK3IIJN5.js +0 -22
  61. package/dist/chunk-VVI77XNV.js +0 -1
  62. package/dist/chunk-YKZGKYVT.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{createContext as t,useContext as e}from"react";import{jsx as r}from"react/jsx-runtime";var n={},o=new Proxy(n,{get:(t,e)=>n[e],has:(t,e)=>e in n,ownKeys:()=>Object.keys(n),getOwnPropertyDescriptor(t,e){if(e in n)return{configurable:!0,enumerable:!0,value:n[e]}}});function a(t){for(const t of Object.keys(n))delete n[t];Object.assign(n,t)}var u={},i=[],c={erp:[],system:[],virtual:[],footer:[]},s=t({hasAnyPerm:()=>!0});function d({value:t,children:e}){/* @__PURE__ */
2
+ return r(s.Provider,{value:t,children:e})}function m(){return e(s)}var l=240,h=68,f=52,p="react-os-shell:work-area-changed";function w(){const t=getComputedStyle(document.documentElement),e=parseInt(t.getPropertyValue("--taskbar-height"))||0,r=parseInt(t.getPropertyValue("--taskbar-width"))||0,n=t.getPropertyValue("--taskbar-position")?.trim()||"bottom",o=parseInt(t.getPropertyValue("--sidebar-width"))||0;return{x:("left"===n?r:0)+o,y:"top"===n?e:0,w:window.innerWidth-("left"===n||"right"===n?r:0)-o,h:window.innerHeight-("top"===n||"bottom"===n?e:0)}}function y(t,e,r){const n=r?e.w+280:e.w-280,o=Math.abs(t.w-e.w)<=4||Math.abs(t.w-n)<=4;return Math.abs(t.h-e.h)<=4&&o}function g({over:t,residual:e},r){return e<=1||t-e>=r-2}function b(t,e,r){let n=t;for(const o of r)g(o,e)&&(n=Math.max(n,t+o.over));return Math.ceil(n)}function v(t,e,r,n){const o=Math.min(e,r.w-2*n);if(o<=t.w+1)return t;const a=r.x+n,u=r.x+r.w-n-o,i=Math.min(Math.max(t.x-(o-t.w)/2,a),u);return{...t,x:Math.round(i),w:Math.round(o)}}function x(){return(parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width"))||0)>0}function M(){return"undefined"!=typeof document&&"sidebar"===getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim()}export{h as RAIL_COLLAPSED_W,l as RAIL_W,d as ShellAuthProvider,f as TAB_STRIP_H,p as WORK_AREA_CHANGED_EVENT,y as boxFillsWorkArea,w as computeMaximizedBox,v as growBoxToWidth,x as isSidebarStripReserved,o as navIcons,i as navSections,M as readAlwaysMaximizedFlag,g as scrollerIsFluid,u as sectionIcons,a as setShellNavIcons,c as startMenuCategories,m as useShellAuth,b as widthToFit};
@@ -1,4 +1,4 @@
1
- import{useShellStrings as e}from"./chunk-VVI77XNV.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__ */
1
+ import{useShellStrings as e}from"./chunk-RQ6BKTSJ.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
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
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
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,
@@ -1 +1 @@
1
- import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-VVI77XNV.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c({onAccept:e,accept:a,maxSizeBytes:c,maxFiles:u,multiple:f=!0,currentCount:p=0,acceptHint:m,disabled:d=!1}){const h=t().files,g=r(null),[y,x]=n(!1),[v,D]=n([]),L=r(0),b="string"==typeof m?m:"",A=s(t=>{if(d||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of f?r:r.slice(0,1))o(e,a)?null!=c&&e.size>c?s.push({file:e,reason:"size",message:h.tooLarge(e.name,l(e.size,h),l(c,h))}):f&&null!=u&&p+n.length>=u?s.push({file:e,reason:"count",message:h.tooMany(e.name,u)}):n.push(e):s.push({file:e,reason:"type",message:h.notAccepted(e.name,b)});D(s),n.length&&e(n),g.current&&(g.current.value="")},[d,f,a,b,c,u,p,e,h]),j=s(()=>{d||g.current?.click()},[d]),k=s(()=>D([]),[]);return{inputRef:g,inputProps:{ref:g,type:"file",accept:a||void 0,multiple:f,disabled:d,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>A(e.target.files)},zoneProps:d?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),L.current+=1,x(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),y||x(!0))},onDragLeave:e=>{i(e)&&(L.current=Math.max(0,L.current-1),0===L.current&&x(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),L.current=0,x(!1),A(e.dataTransfer.files))}},pasteProps:d?{}:{onPaste:e=>{const t=function(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}(e);0!==t.length&&(e.preventDefault(),A(t))}},open:j,take:A,dragOver:y,rejections:v,clearRejections:k}}function u({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{u as FileIntakeAlert,o as acceptsFile,l as humanSize,c as useFileIntake};
1
+ import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-RQ6BKTSJ.js";import{useRef as r,useState as n,useCallback as s}from"react";import{jsx as a}from"react/jsx-runtime";function o(e,t){const r=(t??"").split(",").map(e=>e.trim().toLocaleLowerCase()).filter(Boolean);if(0===r.length||r.includes("*")||r.includes("*/*"))return!0;const n=e.name.toLocaleLowerCase(),s=e.type.toLocaleLowerCase();return r.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?s.startsWith(e.slice(0,-1)):s===e)}var l=(t,r=e.files)=>t<1024?r.bytes(t):t<1048576?r.kilobytes(Math.round(t/1024)):r.megabytes(t/1048576),i=e=>Array.from(e.dataTransfer?.types??[]).includes("Files");function c({onAccept:e,accept:a,maxSizeBytes:c,maxFiles:u,multiple:f=!0,currentCount:p=0,acceptHint:m,disabled:d=!1}){const h=t().files,g=r(null),[y,x]=n(!1),[v,D]=n([]),L=r(0),b="string"==typeof m?m:"",A=s(t=>{if(d||!t)return;const r=Array.from(t);if(0===r.length)return;const n=[],s=[];for(const e of f?r:r.slice(0,1))o(e,a)?null!=c&&e.size>c?s.push({file:e,reason:"size",message:h.tooLarge(e.name,l(e.size,h),l(c,h))}):f&&null!=u&&p+n.length>=u?s.push({file:e,reason:"count",message:h.tooMany(e.name,u)}):n.push(e):s.push({file:e,reason:"type",message:h.notAccepted(e.name,b)});D(s),n.length&&e(n),g.current&&(g.current.value="")},[d,f,a,b,c,u,p,e,h]),j=s(()=>{d||g.current?.click()},[d]),k=s(()=>D([]),[]);return{inputRef:g,inputProps:{ref:g,type:"file",accept:a||void 0,multiple:f,disabled:d,tabIndex:-1,"aria-hidden":!0,className:"hidden",onChange:e=>A(e.target.files)},zoneProps:d?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),L.current+=1,x(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),y||x(!0))},onDragLeave:e=>{i(e)&&(L.current=Math.max(0,L.current-1),0===L.current&&x(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),L.current=0,x(!1),A(e.dataTransfer.files))}},pasteProps:d?{}:{onPaste:e=>{const t=function(e){const t=e.clipboardData;if(!t)return[];if(t.files&&t.files.length>0)return Array.from(t.files);const r=[];for(const e of Array.from(t.items??[]))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}return r}(e);0!==t.length&&(e.preventDefault(),A(t))}},open:j,take:A,dragOver:y,rejections:v,clearRejections:k}}function u({rejections:e,className:t="mt-2"}){return 0===e.length?null:/* @__PURE__ */a("ul",{role:"alert",className:`${t} flex flex-col gap-0.5`,children:e.map(({file:e,message:t},r)=>/* @__PURE__ */a("li",{className:"text-xs text-red-600",children:t},`${e.name}-${r}`))})}export{u as FileIntakeAlert,o as acceptsFile,l as humanSize,c as useFileIntake};
@@ -1 +1 @@
1
- import{requestFilesTrashView as n}from"./chunk-KZPQW6UL.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};
1
+ import{requestFilesTrashView as n}from"./chunk-C2A4PIGZ.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};
@@ -0,0 +1,27 @@
1
+ import{navVisible as e,isReachable as t,visibleChildren as n,isSection as r}from"./chunk-5A7MWTXX.js";import{glassStyle as a}from"./chunk-VNEH2Y6H.js";import{useDismissPopupsOnOpen as l,Z_LAYERS as o}from"./chunk-OSJ3ADF2.js";import{useShellStrings as s}from"./chunk-RQ6BKTSJ.js";import{useState as i,useEffect as c,useRef as d,useMemo as u,useId as p,useCallback as y}from"react";import{jsx as f,jsxs as m}from"react/jsx-runtime";import{createPortal as h}from"react-dom";var b={favicon:"h-8 w-8",compact:"h-10 w-10",wordmark:"h-10 w-40"};function g(e){return e.trim().charAt(0).toLocaleUpperCase()||"·"}function x(e,t,n){return!1===e?"framed":null==e||null==t?"plate-light":t?"light"===n?"plate-dark":"bare":"dark"===n?"plate-light":"bare"}var v={"plate-light":"bg-white shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]","plate-dark":"bg-neutral-900 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow-strong)]",framed:"border border-black/10 shadow-[0_2px_12px_var(--rosh-mark-plate-shadow)]",bare:""};function k(e,t,n){return"bare"===e?{}:"framed"===e?{borderRadius:t}:{borderRadius:t,padding:n}}function w({src:e,fallbackSrc:t,fallbackHasAlpha:n=null,fallbackIsLight:r=null,fallbackAdaptive:a,alt:l,slot:o="compact",surface:s="light",size:d,width:u,height:p,decorative:y=!1,fallbackMode:m="monogram",adaptive:h=!1,hasAlpha:w=null,isLight:N=null,treatmentPadding:_=4,treatmentRadius:A=8,className:L="",style:C}){const[$,E]=i(e||t||"");c(()=>{E(e||t||"")},[e,t]);const T=Boolean(t&&$===t&&$!==e),I=(T?a??h:h)?x(T?n:w,T?r:N,s):"bare",S=["inline-flex shrink-0 items-center justify-center overflow-hidden",null==d&&null==u&&null==p?b[o]:"","dark"===s?"text-white":"text-gray-700",v[I],L].filter(Boolean).join(" "),j={...k(I,A,_),...null==d?{width:u,height:p}:{width:d,height:d},...C};return $?/* @__PURE__ */f("span",{className:S,"data-brand-treatment":I,style:j,children:/* @__PURE__ */f("img",{src:$,alt:y?"":l,"data-brand-slot":o,className:"block max-h-full max-w-full",style:{objectFit:"contain"},onError:()=>E(e=>t&&e!==t?t:"")})}):"none"===m?null:/* @__PURE__ */f("span",{"data-brand-fallback":!0,"data-brand-slot":o,"aria-label":y?void 0:l,"aria-hidden":y||void 0,role:y?void 0:"img",className:`${S} rounded-md bg-gray-100 font-semibold`,style:j,children:y?null:g(l)})}function N(n,r){return e(n,r)?n.items.filter(n=>e(n,r)&&t(n,r)):[]}function _(e,r){return n(e,r).filter(e=>t(e,r))}function A(n,a,l){const o=new Set(a.erp),s=new Set(a.system),i=new Set(a.footer??[]),c=n.filter(r),d=e=>c.filter(t=>e.has(t.label)&&N(t,l).length>0);return{topItems:n.filter(e=>!r(e)).filter(n=>e(n,l)&&t(n,l)),erpSections:d(o),systemSections:d(s),virtualSections:(a.virtual??[]).filter(e=>e.items.length>0),footerSections:d(i),footerItems:(a.footerItems??[]).filter(n=>e(n,l)&&t(n,l))}}function L(e,t,n){return!!t&&e.some(e=>e.to===t||L(_(e,n),t,n))}var C="__page__";function $(e){const t=e.indexOf("?");if(t<0)return{path:e,search:""};const n=new URLSearchParams(e.slice(t+1));return{path:e.slice(0,t),search:n.get("search")??""}}function E(e,t,n){const r=function(e,t){const n=[],r=e=>{const a=_(e,t);0===a.length?n.push(e):a.forEach(r)};e.topItems.forEach(r);for(const n of[...e.erpSections,...e.systemSections,...e.footerSections])N(n,t).forEach(r);for(const t of e.virtualSections)t.items.forEach(r);return e.footerItems.forEach(r),n}(e,t);return Object.assign(async e=>{const t=e.trim().toLowerCase();if(!t)return[];const a=/* @__PURE__ */new Set,l=[];for(const e of r){const r=e.menuLabel??e.label;a.has(e.to)||!e.label.toLowerCase().includes(t)&&!r.toLowerCase().includes(t)||(a.add(e.to),l.push({type:n,label:e.label,entity_type:C,entity_id:e.to}))}return l.slice(0,8)},{destinations:r})}function T(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){if(!r||"string"!=typeof r.entityType||"string"!=typeof r.entityId||"string"!=typeof r.label)continue;if("preview-file"===r.entityType)continue;const e="page"===r.entityType;n.push({type:e?t:"",label:r.label,entity_type:e?C:r.entityType,entity_id:r.entityId})}return n}var I="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function S(e,t,n){return 0===n.length?null:{key:e,title:t,rows:n.map((e,t)=>({kind:"action",key:`action:${t}:${e.label}`,label:e.label,icon:e.icon,action:e})),count:n.length}}function j(e,t,n,r){return{type:e,label:t,entity_type:C,entity_id:`${n}?search=${encodeURIComponent(r.trim())}`}}function M(e,t,n,r,a){const l=function(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=t.get(n.type);e?e.push(n):t.set(n.type,[n])}return Array.from(t,([e,t])=>({type:e,results:t}))}(e).map(e=>{const t=e.results.map((t,n)=>({kind:"result",key:`result:${e.type}:${t.entity_type}:${t.entity_id}:${n}`,label:t.label,sub:t.sub,result:t})),r=!!a?.truncatedTypes?.includes(e.type),l=r?a?.listRoutes?.[e.type]:void 0;if(a&&l){const r=a.seeAllLabel(l.label);t.push({kind:"seeAll",key:`seeall:${e.type}`,label:r,result:j(e.type,r,l.path,n)})}return{key:`type:${e.type}`,title:e.type,rows:t,count:e.results.length,truncated:r}}),o=S("actions",r,function(e,t){const n=t.trim().toLowerCase();return e&&n?e.filter(e=>e.label.toLowerCase().includes(n)||(e.keywords??[]).some(e=>e.toLowerCase().includes(n))):[]}(t,n));return o?[...l,o]:l}function R(e,t,n){return 0===n?0:Math.min(Math.max(e+t,0),n-1)}var D=(e,t)=>e.entity_type===t.entity_type&&e.entity_id===t.entity_id;function K(e,t,n=8){return[t,...e.filter(e=>!D(e,t))].slice(0,n)}function B(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(!n||"object"!=typeof n)continue;const e=n;if("string"!=typeof e.type||"string"!=typeof e.label||"string"!=typeof e.entity_type||"string"!=typeof e.entity_id)continue;const r={type:e.type,label:e.label,entity_type:e.entity_type,entity_id:e.entity_id};"string"==typeof e.sub&&(r.sub=e.sub),t.some(e=>D(e,r))||t.push(r)}return t.slice(0,8)}function H(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:n}=e;return{results:t,truncatedTypes:Array.isArray(n)?n:[]}}return{results:[],truncatedTypes:[]}}var P=[];function z(e,t,n){const[r,a]=i([]),[l,o]=i(P),[s,u]=i(!1),[p,f]=i("none"),m=d(function(){let e=0,t=null;const n=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{n();const r=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>r===e}},cancel:n}}());c(()=>{const r=m.current;if(e.length<n||!t||0===t.length)return r.cancel(),a(e=>0===e.length?e:[]),o(P),f("none"),void u(!1);u(!0);const l=setTimeout(async()=>{const n=r.begin(),l=await async function(e,t,n){const r=await Promise.all(e.map(async e=>{try{return{failed:!1,...H(await e(t,{signal:n}))}}catch(e){const t=n.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:n}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===n}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:r.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(r.flatMap(e=>e.truncatedTypes))),failed:r.filter(e=>e.failed).length}}(t,e,n.signal);n.isCurrent()&&(a(l.results),o(l.truncatedTypes),f(0===l.failed?"none":l.failed>=t.length?"all":"some"),u(!1))},250);return()=>{clearTimeout(l),r.cancel()}},[e,t,n]);return{results:r,truncatedTypes:l,loading:s,failure:p,reset:y(()=>{m.current.cancel(),a(e=>0===e.length?e:[]),o(P),f("none"),u(!1)},[])}}var F=(e,t)=>`${e}-opt-${t}`;function U(e,t){return"seeAll"===e.kind?"M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3":"action"===e.kind?e.icon??I:e.icon?e.icon:t?.[e.result.type]?t[e.result.type]:I}function O({sections:e,activeIdx:t,listId:n,label:r,typeIcons:a,groupCount:l,groupLabel:o,onHover:s,onPick:i}){let c=0;/* @__PURE__ */
2
+ return f("div",{id:n,role:"listbox","aria-label":r,className:"py-1",children:e.map(e=>/* @__PURE__ */m("div",{role:"group","aria-label":o(e.title,e.count,!!e.truncated),children:[
3
+ /* @__PURE__ */m("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
4
+ /* @__PURE__ */f("span",{children:e.title}),
5
+ /* @__PURE__ */f("span",{className:"font-medium normal-case tracking-normal",children:l(e.count,!!e.truncated)})]}),e.rows.map(e=>{const r=c++,l=r===t,o="action"===e.kind||"seeAll"===e.kind?void 0:e.badge,d="action"===e.kind||"seeAll"===e.kind?void 0:e.sub,u="seeAll"===e.kind;/* @__PURE__ */
6
+ return m("div",{id:F(n,r),role:"option","aria-selected":l,className:"flex items-center gap-3 w-full px-4 py-2.5 text-left cursor-pointer transition-colors "+(l?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>s(r),children:[
7
+ /* @__PURE__ */f("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:U(e,a)})}),
8
+ /* @__PURE__ */m("div",{className:"flex-1 min-w-0",children:[
9
+ /* @__PURE__ */f("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */f("p",{className:"text-xs text-gray-400 truncate",children:d})]}),o&&/* @__PURE__ */f("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-500",children:o})]},e.key)})]},e.key))})}var W="react-os-shell:open-global-search";function J(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(W))}function V({providers:e,typeIcons:t,listRoutes:n,placeholder:r,quickActions:b,onSelect:g,recent:x,onRecord:v,favorites:k}={}){const w=s().search,N=r??w.placeholder,[_,A]=i(!1),[L,C]=i(""),[$,E]=i(0),T=d(null),{results:j,truncatedTypes:D,loading:K,failure:B,reset:H}=z(L,e,2);c(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),A(e=>!e)),"Escape"===e.key&&_&&A(!1)},t=()=>A(!0);return window.addEventListener("keydown",e),window.addEventListener(W,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(W,t)}},[_]),l(_);const[P,U]=i(!1);_!==P&&(U(_),_&&(C(""),E(0),H())),c(()=>{_?setTimeout(()=>T.current?.focus(),50):C("")},[_]),c(()=>{E(0)},[j]);const J=L.length>=2,V=u(()=>J?M(j,b,L,w.actions,{truncatedTypes:D,listRoutes:n,seeAllLabel:w.seeAll}):function(e,t){const n=[];e.recent?.length&&n.push({key:"recent",title:t.recent,rows:e.recent.map((e,t)=>({kind:"recent",key:`recent:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type,result:e})),count:e.recent.length}),e.favorites?.length&&n.push({key:"favorites",title:t.favorites,rows:e.favorites.map((e,t)=>({kind:"favorite",key:`favorite:${e.entity_type}:${e.entity_id}:${t}`,label:e.label,sub:e.sub,badge:e.type||void 0,icon:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",result:e})),count:e.favorites.length});const r=S("actions",t.actions,e.actions??[]);return r&&n.push(r),n}({recent:x,favorites:k,actions:b},w),[J,j,D,n,b,L,x,k,w]),X=u(()=>function(e){return e.flatMap(e=>e.rows)}(V),[V]),q=Math.min($,Math.max(X.length-1,0)),G=p(),Q=X.length>0;c(()=>{_&&0!==X.length&&document.getElementById(F(G,q))?.scrollIntoView?.({block:"nearest"})},[_,q,X.length,G]);const Y=y(e=>{A(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||v?.(e.result),g?.(e.result)):e.action.onSelect()},[g,v]);return _?h(
10
+ /* @__PURE__ */m("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:o.overlay},onClick:()=>A(!1),children:[
11
+ /* @__PURE__ */f("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
12
+ /* @__PURE__ */m("div",{className:"relative z-10 w-full max-w-xl rounded-2xl overflow-hidden",onClick:e=>e.stopPropagation(),style:a(),children:[
13
+ /* @__PURE__ */m("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
14
+ /* @__PURE__ */f("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */f("path",{strokeLinecap:"round",strokeLinejoin:"round",d:I})}),
15
+ /* @__PURE__ */f("input",{ref:T,type:"text",value:L,onChange:e=>{C(e.target.value),E(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),E(R(q,1,X.length))):"ArrowUp"===e.key?(e.preventDefault(),E(R(q,-1,X.length))):"Tab"===e.key&&X.length>0?(e.preventDefault(),E(function(e,t,n){const r=e.length;if(0===r)return 0;const a=[];let l=0;for(const t of e)a.push(l),l+=t;let o=0;for(let e=0;e<r;e++)t>=a[e]&&(o=e);return a[(o+n+r)%r]}(V.map(e=>e.rows.length),q,e.shiftKey?-1:1))):"Enter"===e.key&&X[q]&&Y(X[q])},placeholder:N,role:"combobox","aria-expanded":Q,"aria-controls":Q?G:void 0,"aria-activedescendant":Q?F(G,q):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),K&&/* @__PURE__ */f("span",{"data-global-search-spinner":"",role:"status","aria-label":w.searching,className:"h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-500"}),
16
+ /* @__PURE__ */f("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:w.escBadge})]}),
17
+ /* @__PURE__ */m("div",{className:"max-h-[50vh] overflow-y-auto",children:[K&&0===X.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.searching}),!K&&"all"===B&&J&&/* @__PURE__ */f("div",{role:"alert",className:"px-4 py-3 text-center text-sm text-red-600",children:w.searchFailed}),!K&&J&&0===X.length&&"all"!==B&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.noResults}),Q&&/* @__PURE__ */f(O,{sections:V,activeIdx:q,listId:G,label:w.listLabel,typeIcons:t,groupCount:w.groupCount,groupLabel:w.groupLabel,onHover:E,onPick:Y}),!K&&"some"===B&&J&&/* @__PURE__ */f("div",{role:"status",className:"px-4 py-2 text-xs text-amber-600",children:w.partialFailure}),!K&&!J&&0===X.length&&/* @__PURE__ */f("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:w.minChars(2)})]}),
18
+ /* @__PURE__ */m("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-[11px] text-gray-400",children:[
19
+ /* @__PURE__ */m("div",{className:"flex items-center gap-3",children:[
20
+ /* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
21
+ /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
22
+ /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${w.navigate}`]}),
23
+ /* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
24
+ /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.enterKey}),` ${w.open}`]}),V.length>1&&/* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
25
+ /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.tabKey}),` ${w.nextGroup}`]})]}),
26
+ /* @__PURE__ */m("span",{className:"flex items-center gap-1",children:[
27
+ /* @__PURE__ */f("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:w.escKey}),` ${w.close}`]})]})]})]}),document.body):null}export{w as BrandMark,V as GlobalSearch,C as PAGE_RESULT_ENTITY,T as favoritesToResults,E as navPagesProvider,J as openGlobalSearch,$ as parsePageResultTarget,A as partitionNav,K as pushRecent,x as resolveBrandMarkTreatment,L as rowsContainRoute,B as sanitizeRecent,_ as visibleNavChildren,N as visibleSectionItems};
@@ -1,5 +1,5 @@
1
- import{PopupMenu as e,PopupMenuItem as r,PopupMenuDivider as n}from"./chunk-VNEH2Y6H.js";import{useShellStrings as t}from"./chunk-VVI77XNV.js";import{useState as l,useEffect as i,Fragment as a}from"react";import{jsxs as o,jsx as s}from"react/jsx-runtime";var d="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function c(){/* @__PURE__ */
2
- return s("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"size-3.5",children:/* @__PURE__ */s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function m({tabs:m,activeKey:u,idFor:h,panelMounted:y,onActivate:p,onClose:f,onCloseMany:g,label:x,className:b,activeClassName:k,end:v}){const w=t().pageTabs,[N,C]=l(null),$=m.length;i(()=>{if(!u)return;const e=document.getElementById(h(u,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[h,u,$]);const j=m.some(e=>e.key===u)?u:m[0]?.key,z=e=>{const r=m[(e+m.length)%m.length];r&&document.getElementById(h(r.key,"tab"))?.focus()},I=N?m.find(e=>e.key===N.key):void 0,D=I?m.indexOf(I):-1,A=e=>e.some(e=>!e.pinned),E=e=>()=>{C(null),e()};/* @__PURE__ */
1
+ import{PopupMenu as e,PopupMenuItem as r,PopupMenuDivider as n}from"./chunk-VNEH2Y6H.js";import{useShellStrings as t}from"./chunk-RQ6BKTSJ.js";import{useState as l,useEffect as i,Fragment as a}from"react";import{jsxs as o,jsx as s}from"react/jsx-runtime";var d="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function c(){/* @__PURE__ */
2
+ return s("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:"size-3.5",children:/* @__PURE__ */s("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function m({tabs:m,activeKey:u,idFor:h,panelMounted:y,onActivate:p,onClose:f,onCloseMany:g,label:x,className:b,activeClassName:k,end:v}){const w=t().pageTabs,[N,C]=l(null),$=m.length;i(()=>{if(!u)return;const e=document.getElementById(h(u,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[h,u,$]);const j=m.some(e=>e.key===u)?u:m[0]?.key,z=e=>{const r=m[(e+m.length)%m.length];r&&document.getElementById(h(r.key,"tab"))?.focus()},D=N?m.find(e=>e.key===N.key):void 0,I=D?m.indexOf(D):-1,A=e=>e.some(e=>!e.pinned),B=e=>()=>{C(null),e()};/* @__PURE__ */
3
3
  return o("div",{className:b??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
4
4
  /* @__PURE__ */s("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
5
5
  /* @__PURE__ */s("div",{role:"tablist","aria-label":x,onKeyDown:e=>{const r=m.findIndex(r=>document.getElementById(h(r.key,"tab"))===e.target);if(!(r<0)){if("ArrowRight"===e.key)z(r+1);else if("ArrowLeft"===e.key)z(r-1);else if("Home"===e.key)z(0);else if("End"===e.key)z(m.length-1);else{if("Delete"!==e.key||m[r].pinned)return;f(m[r].key)}e.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:m.map((e,r)=>{const n=e.key===u,t=!!e.dirty,l=e.icon,i=n?k??"z-[1] border-gray-200 bg-gray-50 text-gray-900":"border-transparent text-gray-600 hover:bg-gray-200/70 hover:text-gray-900",g=r>0&&!n&&m[r-1].key!==u,x={type:"button",role:"tab",id:h(e.key,"tab"),"aria-selected":n,"aria-controls":y?.(e.key)?h(e.key,"panel"):void 0,tabIndex:e.key===j?0:-1,title:e.title,onClick:()=>p(e.key)},b={onContextMenu:r=>((e,r)=>{e.preventDefault(),C({x:e.clientX,y:e.clientY,key:r.key})})(r,e),onAuxClick:r=>((e,r)=>{1!==e.button||r.pinned||(e.preventDefault(),f(r.key))})(r,e),onMouseDown:e=>{1===e.button&&e.preventDefault()}},v=l&&
@@ -10,9 +10,9 @@ return o("div",{className:b??"relative flex h-10 shrink-0 items-end gap-3 bg-gra
10
10
  /* @__PURE__ */o("button",{...x,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pl-3 pr-1 text-left ${d} ${n?"@max-[5rem]:pl-2.5":"@max-[6.5rem]:pr-3 @max-[6.5rem]:group-hover:pr-1 @max-[4.5rem]:justify-center @max-[4.5rem]:px-0 @max-[4.5rem]:group-hover:pl-1.5"}`,children:[v,
11
11
  /* @__PURE__ */s("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(l?n?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:e.title})]}),
12
12
  /* @__PURE__ */o("span",{className:"mr-1.5 flex size-5 shrink-0 items-center justify-center "+(n?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[t&&/* @__PURE__ */s("span",{role:"img","aria-label":w.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
13
- /* @__PURE__ */s("button",{type:"button",tabIndex:-1,"aria-label":w.closeTab?.(e.title)??`${w.close} ${e.title}`,onClick:()=>f(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(t?"hidden group-hover:flex":n?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */s(c,{})})]})]})]},e.key)})}),v&&/* @__PURE__ */s("div",{className:"flex shrink-0 items-center gap-2 self-center",children:v}),N&&I&&/* @__PURE__ */o(e,{portal:!0,style:{left:N.x,top:N.y},onClose:()=>C(null),children:[
14
- /* @__PURE__ */s(r,{disabled:I.pinned,onClick:E(()=>f(I.key)),children:w.close}),
13
+ /* @__PURE__ */s("button",{type:"button",tabIndex:-1,"aria-label":w.closeTab?.(e.title)??`${w.close} ${e.title}`,onClick:()=>f(e.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(t?"hidden group-hover:flex":n?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */s(c,{})})]})]})]},e.key)})}),v&&/* @__PURE__ */s("div",{className:"flex shrink-0 items-center gap-2 self-center",children:v}),N&&D&&/* @__PURE__ */o(e,{portal:!0,style:{left:N.x,top:N.y},onClose:()=>C(null),children:[
14
+ /* @__PURE__ */s(r,{disabled:D.pinned,onClick:B(()=>f(D.key)),children:w.close}),
15
15
  /* @__PURE__ */s(n,{}),
16
- /* @__PURE__ */s(r,{disabled:!A(m.filter(e=>e.key!==I.key)),onClick:E(()=>g("others",I.key)),children:w.closeOthers}),
17
- /* @__PURE__ */s(r,{disabled:!A(m.slice(D+1)),onClick:E(()=>g("right",I.key)),children:w.closeRight}),
18
- /* @__PURE__ */s(r,{disabled:!A(m),onClick:E(()=>g("all",null)),children:w.closeAll})]})]})}export{m as TabStrip};
16
+ /* @__PURE__ */s(r,{disabled:!A(m.filter(e=>e.key!==D.key)),onClick:B(()=>g("others",D.key)),children:w.closeOthers}),
17
+ /* @__PURE__ */s(r,{disabled:!A(m.slice(I+1)),onClick:B(()=>g("right",D.key)),children:w.closeRight}),
18
+ /* @__PURE__ */s(r,{disabled:!A(m),onClick:B(()=>g("all",null)),children:w.closeAll})]})]})}export{m as TabStrip};
@@ -0,0 +1 @@
1
+ var r="4.161.0",a=r;export{a as APP_VERSION,r as VERSION};
@@ -1,23 +1,23 @@
1
- import{toast_default as e}from"./chunk-B2TBCVHH.js";import{useShellStrings as t}from"./chunk-VVI77XNV.js";import{createContext as n,useContext as r,useRef as a,useState as o,useEffect as i}from"react";import*as s from"pdfjs-dist";import{createPortal as l}from"react-dom";import{jsx as c,jsxs as d}from"react/jsx-runtime";function u(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=n(null);function m({children:e}){const t=r(h);return t?l(e,t):
2
- /* @__PURE__ */c("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||s.GlobalWorkerOptions.workerSrc||(s.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${s.version}/build/pdf.worker.min.mjs`);var p={"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},f=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=p[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 u(n,t,a);return a}};function g(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:f}}var w=[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 y({url:n,filename:r,fit:l="width",onDownload:u,onEmail:h,workerSrc:p,wasmUrl:f}){const y=t().pdf,b=a(null),x=a(null),k=a(null),[C,L]=o(null),[N,M]=o(1),[j,E]=o(0),[z,A]=o(1),[_,P]=o(!0),[V,D]=o(!0),W=a(y.loadFailed);W.current=y.loadFailed,i(()=>{let t=!1;return D(!0),M(1),p&&(s.GlobalWorkerOptions.workerSrc=p),s.getDocument({url:n,...g(f)}).promise.then(e=>{t||(L(e),E(e.numPages),D(!1))}).catch(()=>{t||(e.error(W.current),D(!1))}),()=>{t=!0}},[n,p,f]),i(()=>{if(!C||!_||!k.current)return;const e=()=>{const e=k.current;e&&C.getPage(N).then(t=>{if(!k.current)return;const n=t.getViewport({scale:1}),r=v(l,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});A(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(k.current),()=>t.disconnect()},[C,N,_,l]),i(()=>{if(!C||!b.current)return;let e=!1,t=null,n=null;return C.getPage(N).then(r=>{if(e||!b.current)return;const a=r.getViewport({scale:z}),o=b.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=x.current;l&&(l.replaceChildren(),l.style.setProperty("--total-scale-factor",String(a.scale)),n=new s.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()}},[C,N,z]),i(()=>{const e=()=>x.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const H="page"===l?y.fitPage:y.fitWidth,S="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-VBQOHZEM.js";import{useShellStrings as t}from"./chunk-RQ6BKTSJ.js";import{createContext as n,useContext as r,useRef as a,useState as o,useEffect as i}from"react";import*as s from"pdfjs-dist";import{createPortal as l}from"react-dom";import{jsx as c,jsxs as d}from"react/jsx-runtime";function u(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=n(null);function m({children:e}){const t=r(h);return t?l(e,t):
2
+ /* @__PURE__ */c("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||s.GlobalWorkerOptions.workerSrc||(s.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${s.version}/build/pdf.worker.min.mjs`);var p={"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},f=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=p[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 u(n,t,a);return a}};function g(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:f}}var w=[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 y({url:n,filename:r,fit:l="width",onDownload:u,onEmail:h,workerSrc:p,wasmUrl:f}){const y=t().pdf,b=a(null),x=a(null),k=a(null),[C,L]=o(null),[M,N]=o(1),[j,E]=o(0),[z,A]=o(1),[_,P]=o(!0),[D,S]=o(!0),W=a(y.loadFailed);W.current=y.loadFailed,i(()=>{let t=!1;return S(!0),N(1),p&&(s.GlobalWorkerOptions.workerSrc=p),s.getDocument({url:n,...g(f)}).promise.then(e=>{t||(L(e),E(e.numPages),S(!1))}).catch(()=>{t||(e.error(W.current),S(!1))}),()=>{t=!0}},[n,p,f]),i(()=>{if(!C||!_||!k.current)return;const e=()=>{const e=k.current;e&&C.getPage(M).then(t=>{if(!k.current)return;const n=t.getViewport({scale:1}),r=v(l,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});A(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(k.current),()=>t.disconnect()},[C,M,_,l]),i(()=>{if(!C||!b.current)return;let e=!1,t=null,n=null;return C.getPage(M).then(r=>{if(e||!b.current)return;const a=r.getViewport({scale:z}),o=b.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=x.current;l&&(l.replaceChildren(),l.style.setProperty("--total-scale-factor",String(a.scale)),n=new s.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()}},[C,M,z]),i(()=>{const e=()=>x.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const T="page"===l?y.fitPage:y.fitWidth,$="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
3
  return d("div",{className:"flex flex-col h-full",children:[
4
4
  /* @__PURE__ */d(m,{children:[
5
- /* @__PURE__ */c("button",{type:"button","aria-label":y.previousPage,onClick:()=>M(e=>Math.max(1,e-1)),disabled:N<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),
6
- /* @__PURE__ */c("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:y.pageOf(N,j)}),
7
- /* @__PURE__ */c("button",{type:"button","aria-label":y.nextPage,onClick:()=>M(e=>Math.min(j,e+1)),disabled:N>=j,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})}),
5
+ /* @__PURE__ */c("button",{type:"button","aria-label":y.previousPage,onClick:()=>N(e=>Math.max(1,e-1)),disabled:M<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})})}),
6
+ /* @__PURE__ */c("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:y.pageOf(M,j)}),
7
+ /* @__PURE__ */c("button",{type:"button","aria-label":y.nextPage,onClick:()=>N(e=>Math.min(j,e+1)),disabled:M>=j,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})}),
8
8
  /* @__PURE__ */c("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomOut,title:y.zoomOut,onClick:()=>{P(!1),A(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:S,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"−"})}),
9
+ /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomOut,title:y.zoomOut,onClick:()=>{P(!1),A(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:$,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"−"})}),
10
10
  /* @__PURE__ */d("select",{value:_?"fit":w.includes(Math.round(100*z))?Math.round(100*z):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(P(!1),A(Number(t)/100)):P(!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":y.zoom,title:y.zoom,children:[
11
- /* @__PURE__ */c("option",{value:"fit",children:H}),!_&&!w.includes(Math.round(100*z))&&/* @__PURE__ */d("option",{value:"custom",children:[Math.round(100*z),"%"]}),w.map(e=>/* @__PURE__ */d("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomIn,title:y.zoomIn,onClick:()=>{P(!1),A(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:S,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */c("button",{type:"button",onClick:()=>P(!0),"aria-pressed":_,className:S+(_?" bg-gray-200 text-gray-900":""),title:y.fitHint,children:y.fit}),
11
+ /* @__PURE__ */c("option",{value:"fit",children:T}),!_&&!w.includes(Math.round(100*z))&&/* @__PURE__ */d("option",{value:"custom",children:[Math.round(100*z),"%"]}),w.map(e=>/* @__PURE__ */d("option",{value:e,children:[e,"%"]},e))]}),
12
+ /* @__PURE__ */c("button",{type:"button","aria-label":y.zoomIn,title:y.zoomIn,onClick:()=>{P(!1),A(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:$,children:/* @__PURE__ */c("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */c("button",{type:"button",onClick:()=>P(!0),"aria-pressed":_,className:$+(_?" bg-gray-200 text-gray-900":""),title:y.fitHint,children:y.fit}),
14
14
  /* @__PURE__ */c("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */d("button",{type:"button",onClick:()=>{if(!C)return;const t=window.open("","_blank");if(!t)return void e.error(y.allowPopups);const n=[];for(let e=1;e<=j;e++)n.push(C.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=r,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:S,children:[
15
+ /* @__PURE__ */d("button",{type:"button",onClick:()=>{if(!C)return;const t=window.open("","_blank");if(!t)return void e.error(y.allowPopups);const n=[];for(let e=1;e<=j;e++)n.push(C.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=r,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:$,children:[
16
16
  /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0110.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0l.229 2.523a1.125 1.125 0 01-1.12 1.227H7.231c-.662 0-1.18-.568-1.12-1.227L6.34 18m11.318 0h1.091A2.25 2.25 0 0021 15.75V9.456c0-1.081-.768-2.015-1.837-2.175a48.055 48.055 0 00-1.913-.247M6.34 18H5.25A2.25 2.25 0 013 15.75V9.456c0-1.081.768-2.015 1.837-2.175a48.041 48.041 0 011.913-.247m10.5 0a48.536 48.536 0 00-10.5 0m10.5 0V3.375c0-.621-.504-1.125-1.125-1.125h-8.25c-.621 0-1.125.504-1.125 1.125v3.659M18 10.5h.008v.008H18V10.5zm-3 0h.008v.008H15V10.5z"})}),y.print]}),
17
- /* @__PURE__ */d("button",{type:"button",onClick:u??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:S,children:[
18
- /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),y.download]}),h&&/* @__PURE__ */d("button",{type:"button",onClick:h,className:S,children:[
17
+ /* @__PURE__ */d("button",{type:"button",onClick:u??(()=>{const e=document.createElement("a");e.href=n,e.download=r,e.click()}),className:$,children:[
18
+ /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),y.download]}),h&&/* @__PURE__ */d("button",{type:"button",onClick:h,className:$,children:[
19
19
  /* @__PURE__ */c("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})}),y.email]})]}),
20
- /* @__PURE__ */c("div",{ref:k,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!C)return;if(e.ctrlKey||e.metaKey)return;const t=k.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&N<j?(e.preventDefault(),M(e=>Math.min(j,e+1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=0)})):e.deltaY<0&&n&&N>1&&(e.preventDefault(),M(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)}))},onKeyDown:e=>{if(!C)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?N<j&&(e.preventDefault(),M(e=>Math.min(j,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?N>1&&(e.preventDefault(),M(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),M(1)):"End"===e.key&&(e.preventDefault(),M(j)))},children:V?/* @__PURE__ */c("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:y.loading}):/* @__PURE__ */d("div",{className:"min-h-full flex items-center justify-center p-4",children:[
20
+ /* @__PURE__ */c("div",{ref:k,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!C)return;if(e.ctrlKey||e.metaKey)return;const t=k.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&M<j?(e.preventDefault(),N(e=>Math.min(j,e+1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=0)})):e.deltaY<0&&n&&M>1&&(e.preventDefault(),N(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)}))},onKeyDown:e=>{if(!C)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?M<j&&(e.preventDefault(),N(e=>Math.min(j,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?M>1&&(e.preventDefault(),N(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),N(1)):"End"===e.key&&(e.preventDefault(),N(j)))},children:D?/* @__PURE__ */c("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:y.loading}):/* @__PURE__ */d("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
21
  /* @__PURE__ */c("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__ */d("div",{className:"relative shadow-lg rounded",children:[
23
23
  /* @__PURE__ */c("canvas",{ref:b,className:"block rounded"}),
@@ -0,0 +1 @@
1
+ import{createContext as e,useContext as o,useMemo as t,useEffect as a}from"react";import{jsx as n}from"react/jsx-runtime";var i=/* @__PURE__ */new Map;function r(e,o){const t=`${e}|${JSON.stringify(o)}`;let a=i.get(t);return a||(a=new Intl.NumberFormat(e,o),i.set(t,a)),a}function s(e,o){return o?r(o,{maximumFractionDigits:20}).format(e):String(e)}function l(e,o,t){return t?r(t,{minimumFractionDigits:o,maximumFractionDigits:o}).format(e):e.toFixed(o)}function d(e,o,t){return t?r(t,{style:"percent",minimumFractionDigits:o,maximumFractionDigits:o}).format(e/100):`${e.toFixed(o)}%`}function c(e){const o=o=>s(o,e),t=o=>function(e,o){return o?r(o,{}).format(e):e.toLocaleString()}(o,e),a=(o,t)=>l(o,t,e);return{window:{minimize:"Minimize",restore:"Restore",maximize:"Maximize",windowed:"Windowed",pinOnTop:"Pin on top",unpin:"Unpin from top",close:"Close",windowSuffix:"window",prev:"Prev",next:"Next",snapLayouts:"Snap layouts",snapLeft:"Snap left half",snapRight:"Snap right half",snapTopLeft:"Snap top-left quarter",snapTopRight:"Snap top-right quarter",snapBottomLeft:"Snap bottom-left quarter",snapBottomRight:"Snap bottom-right quarter"},taskbar:{closeWindow:"Close window",offscreenHint:"This window is off screen — click to bring it back",offscreenDot:"Off screen — click to bring this window back",expose:"Exposé — show all open windows as thumbnails",addToDesktop:"Add to desktop",removeFromDesktop:"Remove from desktop",minimizeAllWindows:"Minimize all",restoreAllWindows:"Restore all",closeAllWindows:"Close all"},logout:{goodbye:"Goodbye",seeYou:"See you next time"},about:{aboutPrefix:"About",thisApp:"this app",openSourceLicenses:"Open Source Licenses",whatsNew:"What's New",noChangelog:"No changelog available."},table:{empty:"Nothing to show",loading:"Loading",selectAll:"Select all rows",selectRow:"Select row"},select:{none:"— None —",noMatches:"No matches",allSelected:"All options selected",clear:"Clear selection",remove:"Remove"},notifications:{title:"Notifications",markAllRead:"Mark all read",dnd:"Do not disturb",dndOn:"Do not disturb is on",caughtUp:"All caught up",empty:"No notifications yet",viewAll:"View all notifications",cardLabel:"Notification",dismiss:"Dismiss notification"},form:{errorSummaryTitle:"There is a problem"},help:{title:"Help",searchPlaceholder:"Search help…",empty:"No help articles yet.",noResults:"No articles match your search.",loading:"Loading…",pickArticle:"Pick a help article from the left.",noBody:"This article has no body yet.",draft:"Draft",newArticle:"+ New",edit:"Edit"},update:{available:"A new version is available.",refreshNow:"Refresh now"},pageTabs:{label:"Open pages",close:"Close",closeOthers:"Close other tabs",closeRight:"Close tabs to the right",closeAll:"Close all tabs",unsaved:"Unsaved changes",discardTitle:"Discard unsaved changes?",discardOne:"This page has changes that have not been saved. Close it anyway?",discardMany:"pages have changes that have not been saved. Close them anyway?",discardConfirm:"Discard and close",keepEditing:"Keep editing"},dialog:{close:"Close",cancel:"Cancel",ok:"OK",confirmTitle:"Confirm",destructiveTitle:"Confirm Action",destructiveCancel:"Dismiss",destructiveConfirm:"Delete",typeToConfirm:e=>`Type ${e} to confirm:`,promptTitle:"Enter a value"},calendar:{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",monthPanel:"Choose a month",yearPanel:"Choose a year",chooseMonth:e=>`Choose a month, currently ${e}`,chooseYear:e=>`Choose a year, currently ${e}`},datePicker:{placeholder:"Select a date",dialog:"Choose a date",clear:"Clear",today:"Today",required:"Required"},dateRange:{placeholder:"Date Range",clearRange:"Clear date range",dialog:"Date range",from:"From",to:"To",start:"Start",end:"End",fromOnly:e=>`From ${e}`,toOnly:e=>`To ${e}`,range:(e,o)=>`${e} to ${o}`,required:"Required",last2Weeks:"Last 2 Weeks",lastMonth:"Last Month",last3Months:"Last 3 Months",last6Months:"Last 6 Months",last12Months:"Last 12 Months",custom:"Custom",clear:"Clear",cancel:"Cancel",apply:"Apply"},pagination:{label:"Pagination",first:"First page",previous:"Previous page",next:"Next page",last:"Last page"},list:{selected:e=>`${o(e)} selected`,selectedNotShown:(e,t)=>`${o(e)} selected, ${o(t)} not shown`,allLoaded:(e,o)=>`All ${t(e)} ${o} loaded`,count:(e,o)=>`${t(e)} ${o}`,loadedOf:(e,o,a)=>`${t(e)} of ${t(o)} ${a}`,loadingMore:"Loading more...",loadError:"Couldn't load this list",loadErrorMessage:"Something went wrong fetching these records. Check your connection and try again.",retry:"Try again"},kanban:{loading:"Loading…",empty:"No items.",dropHere:"Drop here",addItem:"Add item"},files:{attach:"Attach files",drop:"Drop files to attach",remove:e=>`Remove ${e}`,chooseMany:"Choose files",chooseOne:"Choose a file",dragMany:"or drag them here",dragOne:"or drag it here",notAccepted:(e,o)=>`${e} is not an accepted file type${o?` (${o})`:""}`,tooLarge:(e,o,t)=>`${e} is ${o} — the limit is ${t}`,tooMany:(e,t)=>`${e} was not added — ${o(t)} ${1===t?"file":"files"} is the limit`,bytes:e=>`${o(e)} B`,kilobytes:e=>`${o(e)} KB`,megabytes:e=>`${a(e,1)} MB`},media:{uploadImage:"Upload an image",uploadVideo:"Upload a video",uploadFile:"Upload a file",upload:"Upload media",cta:"Choose from library or upload",replace:"Replace",remove:"Remove",uploading:"Uploading…",cover:"Cover",add:"Add",addMedia:"Add media",empty:"No media.",removeItem:e=>`Remove ${e}`,reorder:(e,t,a)=>`${e}, item ${o(t)} of ${o(a)}. Use arrow keys to reorder.`},brandAsset:{save:e=>`Save ${e}`,remove:e=>`Remove ${e}`,discard:"Discard change",saveFailed:e=>`Could not save ${e}.`,removeFailed:e=>`Could not remove ${e}.`,region:(e,o)=>`${e} for ${o}`,usedFor:e=>`Used for ${e}.`,previews:e=>`${e} previews`,preview:"Preview",alt:(e,o)=>`${e} ${o}`},copy:{copy:"Copy",copyLabel:e=>`Copy ${e}`,copied:"Copied",copiedLabel:e=>`${e} copied`,failed:"Could not copy to the clipboard"},keypad:{backspace:"Backspace",enter:"Enter"},banner:{dismiss:"Dismiss"},badge:{remove:"Remove",removeItem:e=>`Remove ${e}`},breadcrumbs:{label:"Breadcrumb",hidden:"Hidden crumbs"},emptyState:{message:"Nothing here yet."},errors:{notFound:"Page not found",notFoundBody:"The page you're looking for doesn't exist or was moved.",forbidden:"Access denied",forbiddenBody:"You don't have permission to view this page.",noAccess:"You don't have access to this",serverError:"Something went wrong",serverErrorBody:"An unexpected error occurred. Please try again.",retry:"Try again",details:"Error details"},search:{placeholder:"Search...",escBadge:"ESC",searching:"Searching...",noResults:"No results found.",minChars:e=>`Type at least ${o(e)} characters to search...`,navigate:"navigate",open:"open",close:"close",enterKey:"Enter",escKey:"Esc",recent:"Recent",favorites:"Favorites",actions:"Actions",listLabel:"Search results",groupCount:(e,t)=>`${o(e)}${t?"+":""}`,groupLabel:(e,t,a)=>`${e}, ${o(t)}${a?"+":""}`,seeAll:e=>`See all ${e}`,searchFailed:"Search failed — check your connection and try again.",partialFailure:"Some results could not be loaded.",tabKey:"Tab",nextGroup:"next group"},grid:{selectAll:"Select all",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:e=>`Delete row ${e}`,insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteColumn:e=>`Delete column ${e}`,resize:"Drag to resize · double-click to auto-fit",fill:"Drag to fill"},sidebar:{resize:"Drag to resize · double-click to reset"},layout:{desktop:"Desktop",sidebar:"Sidebar",switchToDesktop:"Switch to Desktop",switchToSidebar:"Switch to Sidebar",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",search:"Search…",navLabel:"Main menu",openWindows:"Open windows",pageResult:"Page",accountMenu:e=>`Account menu for ${e}`,profile:"My Profile",notifications:"Notifications",reportIssue:"Suggestion or Bug",signOut:"Sign Out",signOutTitle:"Sign Out",signOutMessage:"Do you want to log out? All windows will reopen when you log back in."},markdown:{screenshot:"Screenshot"},severity:{success:"ok",warning:"warning",danger:"critical",unrecognised:e=>`unrecognised severity ${e}`},meter:{noData:"no data",warningAt:e=>`warning ≥ ${o(e)}`,criticalAt:e=>`critical ≥ ${o(e)}`,noReading:"no reading",noBudget:"no budget",ofBudget:e=>`${e} of budget`,budget:"budget",hoursMinutes:(e,t)=>`${o(e)}h ${o(t)}m`,minutesSeconds:(e,t)=>`${o(e)}m ${o(t)}s`,seconds:e=>`${o(e)}s`},charts:{showTable:"Show the data as a table",loading:"Loading chart data",noData:"No data in this window.",windowStart:"Window start",windowEnd:"Window end",window:(e,t,a)=>`Time window — showing ${e} to ${t} of ${o(a)} intervals`,overIntervals:(e,t)=>`${e.join(", ")} over ${o(t)} intervals`,acrossCategories:(e,t)=>`${e.join(", ")} across ${o(t)} categories`,acrossMeasures:(e,t)=>`${e.join(", ")} across ${o(t)} measures`,breakdown:(e,t)=>`Breakdown of ${e} across ${o(t)} segments`,funnel:(e,t,a)=>`Funnel of ${o(e)} stages, ${t} down to ${a}`,radialTrack:e=>`${o(e)} categories, as concentric proportions`,radialCycle:e=>`${o(e)} categories, around a cycle`,tableFrom:"From",tableTo:"To",tableItem:"Item",tableLevel:"Level",tableSeries:"Series",inBucket:e=>`${e} in this bucket`,inCategory:e=>`${e} in this category`,value:"Value",share:"Share",count:"Count",flow:"Flow",totalFlow:"Total flow",throughput:"Throughput",open:"Open",high:"High",low:"Low",close:"Close",maximum:"Maximum",q3:"Q3",median:"Median",q1:"Q1",minimum:"Minimum",distribution:"Distribution",fiveNumber:(e,t)=>`${e}: five-number summary for ${o(t)} categories`,outliers:e=>`${o(e)} outlier${e>1?"s":""} beyond the whiskers`,price:"Price",ohlc:(e,t)=>`${e}: open, high, low and close across ${o(t)} periods`,closedAbove:"Closed above its open",closedBelow:"Closed below its open",noFlows:"No flows to chart.",chord:e=>`Flows between ${o(e)} participants`,noStages:"No stages to chart.",ofFirstStage:"Of first stage",droppedHere:"Dropped here",intensity:"Intensity",noActivity:"No activity in this window.",heatmap:(e,t,a)=>`${e} across ${o(t)} rows and ${o(a)} columns`,countAxis:"count",histogram:(e,t,a)=>`${e}: ${o(t)} bins over ${o(a)} observations`,observations:"Observations",notEnough:"Not enough eligible requests to judge.",objectiveMet:e=>`objective ${e} met`,objectiveMissed:e=>`objective ${e} missed`,nothingToPlot:"Nothing to plot.",nothingToCompare:"Nothing to compare.",other:"Other",nothingToBreakDown:"Nothing to break down.",range:"Range",rangeLabel:(e,t)=>`${e}: low and high across ${o(t)} categories`,nothingToRank:"Nothing to rank in this window.",emphasised:"(emphasised)",sankey:(e,t)=>`Flow between ${o(e)} nodes over ${o(t)} links`,noObservations:"No observations in this window.",xAxis:"x",yAxis:"y",size:"Size",scatter:(e,o,t)=>`${e.join(", ")}: ${o} against ${t}`,outsideRange:e=>`${o(e)} ${1===e?"point":"points"} outside the shown range`,waterfall:(e,t,a)=>`Waterfall of ${o(e)} steps from ${t} to ${a}`,balance:"Balance",increase:"Increase",decrease:"Decrease",runningTotal:"Running total",sunburst:(e,t)=>`Hierarchy of ${e} across ${o(t)} levels`,treemap:e=>`Treemap of ${o(e)} items`,trendUp:"up",trendDown:"down",trendFlat:"flat"},timeline:{days:e=>`${t(e)} days`,daysToToday:e=>`${t(e)} days to today`,notReached:"Not yet reached",next:"Next",more:e=>`+${o(e)} more`,today:"Today",todayTitle:e=>`Today — ${e}`,open:e=>`Open ${e}`,openButton:"Open",scrub:"Scrub the timeline",alsoToCome:e=>`Also to come: ${e.join(", ")}`,start:e=>`Start · ${e}`,events:(e,t)=>`${o(e)} events · ${t.join(", ")}`,started:e=>`started ${e}`,duration:e=>`${t(e)} day${1===e?"":"s"}`,reached:(e,t)=>`${o(e)} of ${o(t)} milestones`,milestones:e=>`${e} milestones`},production:{heading:"Production progress",start:"Start",estimated:"Estimated",estimatedCompletion:"Estimated completion",estDone:"Est. done",play:"Play",pause:"Pause",playTitle:"Play the timeline, report by report",backTo:e=>`Back to ${e}`,showing:e=>`Showing ${e}`,overall:o=>`${((o,t)=>d(o,t,e))(o,0)} overall`,inStock:e=>`${t(e)} pc in stock`,noReport:"No production report filed yet",leadTime:e=>`${t(e)} day${1===e?"":"s"} lead time`,report:"Production report",shipment:"Shipment",inspection:"Inspection",invoice:"Invoice",scrub:"Scrub the production timeline",label:(e,o)=>`Production reports and events, ${e} to ${o}`},containers:{items:e=>`${o(e)} items`,pieces:e=>`${o(e)} pcs`,split:(e,t)=>`(${o(e)} instr / ${o(t)} loaded)`,added:(e,t)=>`${o(e)} new (${o(t)} pcs)`,fill:(e,t)=>`${a(e,1)} / ${o(t)} m³`,total:"Total:",instructed:e=>`${a(e,2)} m³ instruction`,loaded:e=>`${a(e,2)} m³ loaded`,volume:e=>`${a(e,2)} m³`,noVolume:"Volume: N/A (no volume data for these part numbers)"},toast:{notification:"Notification"},map:{failed:"The map could not be drawn here. The list has everything it shows.",approximate:e=>`${e}, approximate location`,approximateTitle:e=>`${e} (approximate)`,places:e=>1===e?"place":"places",group:(e,t)=>`${o(e)} ${t} here`,stops:e=>`Stops ${e}`,closeBy:(e,t)=>`${o(e)} more ${t} close by, drawn when the map is closer`,spread:"Press to see them apart",cycle:"They stand on one spot: press for the next of them",fullScreen:"Full screen",leaveFullScreen:"Leave full screen",chosen:e=>`${e}, chosen on the map`,closeCard:"Close",openRecord:"Open"},pdf:{previousPage:"Previous page",nextPage:"Next page",pageOf:(e,t)=>`${o(e)} / ${o(t)}`,zoomOut:"Zoom out",zoomIn:"Zoom in",zoom:"Zoom",fitWidth:"Fit width",fitPage:"Fit page",fit:"Fit",fitHint:"Fit to the pane: follows its size until you zoom by hand",print:"Print",download:"Download",email:"Email",loading:"Loading PDF…",loadFailed:"Failed to load PDF",allowPopups:"Allow popups to print"}}}var p=c(),u=/* @__PURE__ */new Map;var m=e(p),h=e(null),g=/* @__PURE__ */new Set;var $=p,f={};function w(){return $}function y({value:e=f,locale:i,children:r}){const s=o(h),l=t(()=>function(e){if(e)try{return Intl.getCanonicalLocales(e)[0]}catch{return void(g.has(e)||(g.add(e),console.error(`[efficient-shell] ShellStringsProvider: locale="${e}" is not a BCP 47 language tag, so it is ignored and numbers and dates keep their default formatting. Pass a tag such as "de-DE" or "ja".`)))}}(i),[i]),d=void 0===i?s?.locale:l,w=t(()=>{const o=function(e){if(!e)return p;let o=u.get(e);return o||(o=c(e),u.set(e,o)),o}(d),t={};for(const a of Object.keys(o))t[a]={...o[a],...e[a]??{}};return t},[e,d]),y=t(()=>({locale:d}),[d]),v=null!==s;return a(()=>{if(!v)return $=w,()=>{$===w&&($=p)}},[w,v]),/* @__PURE__ */n(h.Provider,{value:y,children:/* @__PURE__ */n(m.Provider,{value:w,children:r})})}function v(){return o(m)}function b(){return o(h)?.locale}function S(e){const[o="",...t]=e("\0").split("\0");return[o,t.join("")]}export{p as DEFAULT_SHELL_STRINGS,y as ShellStringsProvider,w as currentShellStrings,l as formatFixed,d as formatPercent,s as formatPlain,S as splitAround,b as useShellLocale,v as useShellStrings};
@@ -0,0 +1,2 @@
1
+ import{useShellAuth as e}from"./chunk-DSSLOQDW.js";var t={};function r(e){t=e}function n(){const{hasAnyPerm:r}=e();return{user:t.user,logout:t.logout??(()=>{}),hasAnyPerm:r}}var o="react-os-shell:sidebar-collapsed",c="react-os-shell:sidebar-open-sections";function s(e,t){return"true"===e||"false"!==e&&t<1024}function a(e){if(!e)/* @__PURE__ */return new Set;try{const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e))return new Set(t)}catch{}/* @__PURE__ */
2
+ return new Set}function u(e,t){const r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r}function l(e){try{return localStorage.getItem(e)}catch{return null}}function i(e,t){try{localStorage.setItem(e,t)}catch{}}export{o as RAIL_COLLAPSED_KEY,c as RAIL_OPEN_SECTIONS_KEY,s as initialRailCollapsed,a as parseOpenSections,l as readStored,r as setShellAuthBridge,u as toggleOpenSection,n as useAuth,i as writeStored};