efficient-shell 7.21.0 → 7.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +47 -0
  2. package/dist/{Browser-CMG4E355.js → Browser-CHVGSLN7.js} +15 -15
  3. package/dist/{Calculator-QLVWIU4C.js → Calculator-RKOELZ6W.js} +12 -12
  4. package/dist/ConfirmDialog-JSVEON35.js +1 -0
  5. package/dist/{CurrencyConverter-7UT6W5OA.js → CurrencyConverter-PLQ664ZV.js} +9 -9
  6. package/dist/{Documents-3HI2X2CW.js → Documents-CKQCMALX.js} +15 -15
  7. package/dist/{Files-R25E77W4.js → Files-XSUFZ7ZR.js} +80 -80
  8. package/dist/{Notepad-XMDF3VX7.js → Notepad-3EGD2WCN.js} +11 -11
  9. package/dist/PdfViewer-VIX2NDCO.js +1 -0
  10. package/dist/PomodoroTimer-N7L7HBYO.js +91 -0
  11. package/dist/{Preview-VQOOKLO5.js → Preview-RRXQS5BI.js} +25 -25
  12. package/dist/Sidebar-77VZQLKP.js +44 -0
  13. package/dist/{Spreadsheet-25C2SXPH.js → Spreadsheet-X677FCIY.js} +14 -14
  14. package/dist/{Stock-5RQ2JXWL.js → Stock-UOPST3LH.js} +7 -7
  15. package/dist/{Weather-3AMX2QSU.js → Weather-HXZK2AYT.js} +17 -17
  16. package/dist/{WorldClock-JNHPO3ZQ.js → WorldClock-MCDW7P6Q.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-4EIZZYLK.js +1 -0
  21. package/dist/{chunk-7LRJBINZ.js → chunk-4M7DEG4E.js} +32 -32
  22. package/dist/chunk-5VNBEMZQ.js +1 -0
  23. package/dist/{chunk-RBKIYZ7H.js → chunk-6J7HKGHL.js} +1 -1
  24. package/dist/{chunk-ITCBLL72.js → chunk-AKEMYW3H.js} +2 -2
  25. package/dist/{chunk-Z2TTHY7G.js → chunk-ARB5MUWA.js} +1 -1
  26. package/dist/{chunk-BVYOUFSW.js → chunk-AV5XPUKR.js} +9 -9
  27. package/dist/{chunk-ZGUQLVY4.js → chunk-B427NVDP.js} +28 -12
  28. package/dist/{chunk-Y6KFHPIP.js → chunk-BZD3UC4R.js} +1 -1
  29. package/dist/{chunk-BQ7GR7H6.js → chunk-E7WPTZE3.js} +11 -11
  30. package/dist/{chunk-RUHUTZN4.js → chunk-EA7QO447.js} +1 -1
  31. package/dist/{chunk-JQRIAZDP.js → chunk-FM6TPY42.js} +30 -30
  32. package/dist/{chunk-SCJT2XXU.js → chunk-FS27CODA.js} +1 -1
  33. package/dist/{chunk-IQDY2YFN.js → chunk-GNW45MGV.js} +10 -10
  34. package/dist/{chunk-OA7DQ77U.js → chunk-J65OSKCY.js} +493 -486
  35. package/dist/chunk-K7PQXJO7.js +1 -0
  36. package/dist/{chunk-GNCH3JEH.js → chunk-MBHQQFSZ.js} +7 -7
  37. package/dist/{chunk-5V3IFQ7F.js → chunk-MRE4Y2YJ.js} +1 -1
  38. package/dist/{chunk-7HLTPMQV.js → chunk-MZHH3MC7.js} +1 -1
  39. package/dist/{chunk-M4TRVJTO.js → chunk-N2OO2ZYF.js} +1 -1
  40. package/dist/{chunk-B4PGVDB6.js → chunk-OALCYDHN.js} +1 -1
  41. package/dist/{chunk-ZAKN5MPN.js → chunk-OFHMRWST.js} +1 -1
  42. package/dist/{chunk-FTJ2G343.js → chunk-ONDFYXHG.js} +13 -13
  43. package/dist/{chunk-VOFDPOB6.js → chunk-RVPQRXC4.js} +1 -1
  44. package/dist/{chunk-IJ7RXIWX.js → chunk-SZTKBF3D.js} +8 -8
  45. package/dist/{chunk-KBOYLXAT.js → chunk-TTUVL25O.js} +1 -1
  46. package/dist/{chunk-76VCH7N6.js → chunk-XFE43ZU5.js} +19 -19
  47. package/dist/{chunk-XN7CAWSZ.js → chunk-Y6UUDJNU.js} +2 -2
  48. package/dist/{chunk-HMCE2MKM.js → chunk-Y7T3OW2A.js} +1 -1
  49. package/dist/{chunk-ZRU5F2XT.js → chunk-ZMQ3GBEX.js} +4 -4
  50. package/dist/{chunk-GIWC2ZTG.js → chunk-ZU47TGM3.js} +2 -2
  51. package/dist/file-intake/index.js +1 -1
  52. package/dist/i18n/index.d.ts +1 -1
  53. package/dist/icons/efficient-looks.js +189 -177
  54. package/dist/icons/efficient.d.ts +16 -1
  55. package/dist/icons/efficient.js +92 -86
  56. package/dist/icons/index.d.ts +1 -1
  57. package/dist/icons/index.js +1 -1
  58. package/dist/{index-DbNqOkOy.d.ts → index-CMwbvwiY.d.ts} +73 -2
  59. package/dist/index.d.ts +3 -3
  60. package/dist/index.js +119 -119
  61. package/dist/locales/zh-Hans.d.ts +1 -1
  62. package/dist/locales/zh-Hans.js +1 -1
  63. package/dist/map/index.js +8 -8
  64. package/dist/markdown/index.js +1 -1
  65. package/dist/page-tabs/index.js +5 -5
  66. package/dist/pdf/index.js +1 -1
  67. package/dist/{strings-BQtq9300.d.ts → strings-BfHOx-Bl.d.ts} +26 -0
  68. package/dist/telemetry/index.js +1 -1
  69. package/dist/themes.css +20 -20
  70. package/dist/ui/index.d.ts +2 -2
  71. package/dist/ui/index.js +1 -1
  72. package/dist/ui.css +122 -7
  73. package/package.json +1 -1
  74. package/dist/ConfirmDialog-AVFQGXKL.js +0 -1
  75. package/dist/PdfViewer-PHABUM7K.js +0 -1
  76. package/dist/PomodoroTimer-3OJYMVX7.js +0 -91
  77. package/dist/Sidebar-PYURV2S2.js +0 -44
  78. package/dist/chunk-JTNKC4CR.js +0 -1
  79. package/dist/chunk-QRCDQPJA.js +0 -1
  80. package/dist/chunk-YLWIEEDW.js +0 -1
@@ -0,0 +1 @@
1
+ var o="aria-disabled:cursor-not-allowed aria-disabled:opacity-60",r="inline-flex items-center justify-center rounded-(--radius-control) font-medium transition-colors rosh-focus-ring focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-60 "+o,e={primary:"bg-blue-600 text-white shadow-sm not-disabled:not-aria-disabled:hover:bg-blue-700 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",secondary:"border border-gray-300 bg-white text-gray-700 shadow-sm not-disabled:not-aria-disabled:hover:bg-gray-50 focus-visible:ring-[color:var(--rosh-focus-ring)]","secondary-danger":"border border-red-300 bg-white text-red-600 shadow-sm not-disabled:not-aria-disabled:hover:bg-red-50 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]",ghost:"text-gray-700 not-disabled:not-aria-disabled:hover:bg-gray-100 focus-visible:ring-[color:var(--rosh-focus-ring)]","ghost-danger":"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]",danger:"bg-red-600 text-white shadow-sm not-disabled:not-aria-disabled:hover:bg-red-700 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-strong)]",warning:"bg-amber-700 text-white shadow-sm not-disabled:not-aria-disabled:hover:bg-amber-800 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",link:"text-blue-600 underline-offset-4 not-disabled:not-aria-disabled:hover:underline focus-visible:ring-[color:var(--rosh-focus-ring)]"},s={sm:"gap-1 h-6 px-2 text-xs",md:"gap-2 h-8 px-3 text-sm",lg:"gap-2 h-10 px-4 text-sm","touch-sm":"gap-2 h-11 px-4 text-base",touch:"gap-2 h-14 px-5 text-base","touch-lg":"gap-2 h-16 px-6 text-lg","touch-xl":"gap-3 h-20 px-8 text-2xl"},i="inline-flex items-center font-medium transition-colors rosh-focus-ring focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-60 "+o,a={sm:"gap-1 text-xs",md:"gap-2 text-sm",lg:"gap-2 text-sm","touch-sm":"gap-2 text-base",touch:"gap-2 text-base","touch-lg":"gap-2 text-lg","touch-xl":"gap-3 text-2xl"},t={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10","touch-sm":"h-11 w-11",touch:"h-14 w-14","touch-lg":"h-16 w-16","touch-xl":"h-20 w-20"},n="bg-blue-50 text-blue-700 not-disabled:not-aria-disabled:hover:bg-blue-100 focus-visible:ring-[color:var(--rosh-focus-ring)]";function l({variant:o="primary",size:t="md",block:l=!1,pressed:d=!1,className:g=""}={}){const b="link"===o;return[b?i:r,d&&"secondary"===o?"border border-blue-200 bg-blue-50 text-blue-700 shadow-sm not-disabled:not-aria-disabled:hover:bg-blue-100 focus-visible:ring-[color:var(--rosh-focus-ring)]":d&&"ghost"===o?n:e[o],b?a[t]:s[t],l?"w-full":"",g].filter(Boolean).join(" ")}function d({variant:o="ghost",size:s="md",pressed:i=!1,ink:a="own",className:l=""}={}){return[r,!i||"ghost"!==o&&"secondary"!==o?"inherit"===a&&"ghost"===o?"text-inherit not-disabled:not-aria-disabled:hover:bg-gray-100 focus-visible:ring-[color:var(--rosh-focus-ring)]":e[o]:n,t[s],"shrink-0 p-0",l].filter(Boolean).join(" ")}export{l as buttonClasses,d as iconButtonClasses};
@@ -1,6 +1,6 @@
1
- import{useCopyText as e,CopyGlyph as t}from"./chunk-SCJT2XXU.js";import{PopupMenu as n,PopupMenuItem as r,PopupMenuDivider as l}from"./chunk-IQDY2YFN.js";import{useShellStrings as i}from"./chunk-QRCDQPJA.js";import{Icon as a}from"./chunk-ZGUQLVY4.js";import{useState as o,useEffect as s,Fragment as c}from"react";import{jsxs as d,jsx as m,Fragment as u}from"react/jsx-runtime";var y="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function p(){/* @__PURE__ */
1
+ import{useCopyText as e,CopyGlyph as t}from"./chunk-FS27CODA.js";import{PopupMenu as n,PopupMenuItem as r,PopupMenuDivider as l}from"./chunk-GNW45MGV.js";import{useShellStrings as i}from"./chunk-4EIZZYLK.js";import{Icon as a}from"./chunk-B427NVDP.js";import{useState as o,useEffect as s,Fragment as c}from"react";import{jsxs as d,jsx as m,Fragment as u}from"react/jsx-runtime";var y="outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500";function p(){/* @__PURE__ */
2
2
  return m(a,{name:"close",look:"mini","aria-hidden":"true",className:"size-3.5"})}function h({text:n,label:r,copiedLabel:l}){const{copied:i,copy:a}=e(n);/* @__PURE__ */
3
- return m("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */m(t,{copied:i,className:"size-3.5"})})}function b({tabs:e,activeKey:t,idFor:a,panelMounted:b,onActivate:f,onClose:g,onCloseMany:x,label:k,className:v,activeClassName:N,end:w,onIconMenu:C,menuItems:j}){const $=i().pageTabs,[I,z]=o(null),D=e.length;s(()=>{if(!t)return;const e=document.getElementById(a(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[a,t,D]);const M=e.some(e=>e.key===t)?t:e[0]?.key,A=t=>{const n=e[(t+e.length)%e.length];n&&document.getElementById(a(n.key,"tab"))?.focus()},_=I?e.find(e=>e.key===I.key):void 0,B=_&&j?j(_.key):[],E=_?e.indexOf(_):-1,L=e=>e.some(e=>!e.pinned),Q=e=>()=>{z(null),e()};/* @__PURE__ */
3
+ return m("button",{type:"button",tabIndex:-1,"aria-label":i?l:r,title:i?l:r,onClick:a,className:"flex size-5 shrink-0 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 @max-[10rem]:hidden",children:/* @__PURE__ */m(t,{copied:i,className:"size-3.5"})})}function b({tabs:e,activeKey:t,idFor:a,panelMounted:b,onActivate:f,onClose:g,onCloseMany:x,label:k,className:v,activeClassName:N,end:w,onIconMenu:C,menuItems:j}){const $=i().pageTabs,[I,z]=o(null),D=e.length;s(()=>{if(!t)return;const e=document.getElementById(a(t,"tab"));e?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[a,t,D]);const M=e.some(e=>e.key===t)?t:e[0]?.key,A=t=>{const n=e[(t+e.length)%e.length];n&&document.getElementById(a(n.key,"tab"))?.focus()},_=I?e.find(e=>e.key===I.key):void 0,B=_&&j?j(_.key):[],E=_?e.indexOf(_):-1,L=e=>e.some(e=>!e.pinned),F=e=>()=>{z(null),e()};/* @__PURE__ */
4
4
  return d("div",{className:v??"relative flex h-10 shrink-0 items-end gap-3 bg-gray-100 px-3",children:[
5
5
  /* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-x-0 bottom-0 h-px bg-gray-200"}),
6
6
  /* @__PURE__ */m("div",{role:"tablist","aria-label":k,onKeyDown:t=>{const n=e.findIndex(e=>document.getElementById(a(e.key,"tab"))===t.target);if(!(n<0)){if("ArrowRight"===t.key)A(n+1);else if("ArrowLeft"===t.key)A(n-1);else if("Home"===t.key)A(0);else if("End"===t.key)A(e.length-1);else{if("Delete"!==t.key||e[n].pinned)return;g(e[n].key)}t.preventDefault()}},className:"flex min-w-0 flex-1 items-end overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:e.map((n,r)=>{const l=n.key===t,i=!!n.dirty,o=n.icon,s=l?N??"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",u=r>0&&!l&&e[r-1].key!==t,x={type:"button",role:"tab",id:a(n.key,"tab"),"aria-selected":l,"aria-controls":b?.(n.key)?a(n.key,"panel"):void 0,tabIndex:n.key===M?0:-1,title:n.title,onClick:()=>f(n.key)},k={onContextMenu:e=>((e,t)=>{e.preventDefault(),z({x:e.clientX,y:e.clientY,key:t.key})})(e,n),onAuxClick:e=>((e,t)=>{1!==e.button||t.pinned||(e.preventDefault(),g(t.key))})(e,n),onMouseDown:e=>{1===e.button&&e.preventDefault()}},v=o&&
@@ -12,10 +12,10 @@ return d("div",{className:v??"relative flex h-10 shrink-0 items-end gap-3 bg-gra
12
12
  /* @__PURE__ */d("button",{...x,className:`flex h-full min-w-0 flex-1 items-center gap-2 rounded-t-md pr-1 text-left ${w?"pl-2":"pl-3"} ${y} ${l?w?"":"@max-[5rem]:pl-3":"@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-2"}`,children:[!w&&v,
13
13
  /* @__PURE__ */m("span",{className:"min-w-0 flex-1 overflow-hidden whitespace-nowrap [mask-image:linear-gradient(to_right,#000_calc(100%-1rem),transparent)] "+(o?l?"@max-[5rem]:sr-only":"@max-[4.5rem]:sr-only":""),children:n.title})]}),l&&n.copy&&/* @__PURE__ */m(h,{text:n.copy,label:$.copy(n.copy),copiedLabel:$.copied}),
14
14
  /* @__PURE__ */d("span",{className:"mr-2 flex size-5 shrink-0 items-center justify-center "+(l?"":"@max-[6.5rem]:hidden @max-[6.5rem]:group-hover:flex"),children:[i&&/* @__PURE__ */m("span",{role:"img","aria-label":$.unsaved,className:"size-2 rounded-full bg-gray-500 group-hover:hidden"}),
15
- /* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-label":$.closeTab?.(n.title)??`${$.close} ${n.title}`,onClick:()=>g(n.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":l?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */m(p,{})})]})]})]},n.key)})}),w&&/* @__PURE__ */m("div",{className:"flex shrink-0 items-center gap-2 self-center",children:w}),I&&_&&/* @__PURE__ */d(n,{portal:!0,style:{left:I.x,top:I.y},onClose:()=>z(null),children:[B.length>0&&/* @__PURE__ */d(u,{children:[B.map((e,t)=>/* @__PURE__ */d(r,{onClick:Q(e.onSelect),children:[e.icon,e.label]},t)),
15
+ /* @__PURE__ */m("button",{type:"button",tabIndex:-1,"aria-label":$.closeTab?.(n.title)??`${$.close} ${n.title}`,onClick:()=>g(n.key),className:"size-5 items-center justify-center rounded text-gray-400 hover:bg-gray-200 hover:text-gray-700 "+(i?"hidden group-hover:flex":l?"flex":"flex opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),children:/* @__PURE__ */m(p,{})})]})]})]},n.key)})}),w&&/* @__PURE__ */m("div",{className:"flex shrink-0 items-center gap-2 self-center",children:w}),I&&_&&/* @__PURE__ */d(n,{portal:!0,style:{left:I.x,top:I.y},onClose:()=>z(null),children:[B.length>0&&/* @__PURE__ */d(u,{children:[B.map((e,t)=>/* @__PURE__ */d(r,{onClick:F(e.onSelect),children:[e.icon,e.label]},t)),
16
16
  /* @__PURE__ */m(l,{})]}),
17
- /* @__PURE__ */m(r,{disabled:_.pinned,onClick:Q(()=>g(_.key)),children:$.close}),
17
+ /* @__PURE__ */m(r,{disabled:_.pinned,onClick:F(()=>g(_.key)),children:$.close}),
18
18
  /* @__PURE__ */m(l,{}),
19
- /* @__PURE__ */m(r,{disabled:!L(e.filter(e=>e.key!==_.key)),onClick:Q(()=>x("others",_.key)),children:$.closeOthers}),
20
- /* @__PURE__ */m(r,{disabled:!L(e.slice(E+1)),onClick:Q(()=>x("right",_.key)),children:$.closeRight}),
21
- /* @__PURE__ */m(r,{disabled:!L(e),onClick:Q(()=>x("all",null)),children:$.closeAll})]})]})}export{b as TabStrip};
19
+ /* @__PURE__ */m(r,{disabled:!L(e.filter(e=>e.key!==_.key)),onClick:F(()=>x("others",_.key)),children:$.closeOthers}),
20
+ /* @__PURE__ */m(r,{disabled:!L(e.slice(E+1)),onClick:F(()=>x("right",_.key)),children:$.closeRight}),
21
+ /* @__PURE__ */m(r,{disabled:!L(e),onClick:F(()=>x("all",null)),children:$.closeAll})]})]})}export{b as TabStrip};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-7LRJBINZ.js";var e=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),t="uploaded:wallpaper";function r(a,e){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===t?e||"":a}var p=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=e=>{const t=new FormData;return t.append("wallpaper",e),a.post("/auth/me/wallpaper/",t).then(a=>a.data)},l=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function s(a){const e=a?.response?.status,t=a?.response?.data,r=Array.isArray(t?.wallpaper)?t.wallpaper[0]:void 0;return r||(413===e?"That picture is too large to use as a wallpaper.":415===e?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{t as WALLPAPER_PREF_TOKEN,l as deleteWallpaper,e as getNumberingConfigs,p as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,s as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-4M7DEG4E.js";var e=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),t="uploaded:wallpaper";function r(a,e){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===t?e||"":a}var p=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=e=>{const t=new FormData;return t.append("wallpaper",e),a.post("/auth/me/wallpaper/",t).then(a=>a.data)},l=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function s(a){const e=a?.response?.status,t=a?.response?.data,r=Array.isArray(t?.wallpaper)?t.wallpaper[0]:void 0;return r||(413===e?"That picture is too large to use as a wallpaper.":415===e?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{t as WALLPAPER_PREF_TOKEN,l as deleteWallpaper,e as getNumberingConfigs,p as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,s as wallpaperUploadError};
@@ -1 +1 @@
1
- import{requestFilesTrashView as n}from"./chunk-XN7CAWSZ.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-Y6UUDJNU.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 +1 @@
1
- import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-QRCDQPJA.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([]),A=r(0),L="string"==typeof m?m:"",b=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,L)});D(s),n.length&&e(n),g.current&&(g.current.value="")},[d,f,a,L,c,u,p,e,h]),C=s(()=>{d||g.current?.click()},[d]),j=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=>b(e.target.files)},zoneProps:d?{}:{onDragEnter:e=>{i(e)&&(e.preventDefault(),A.current+=1,x(!0))},onDragOver:e=>{i(e)&&(e.preventDefault(),y||x(!0))},onDragLeave:e=>{i(e)&&(A.current=Math.max(0,A.current-1),0===A.current&&x(!1))},onDrop:e=>{i(e)&&(e.preventDefault(),A.current=0,x(!1),b(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(),b(t))}},open:C,take:b,dragOver:y,rejections:v,clearRejections:j}}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-4EIZZYLK.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{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-RUHUTZN4.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
1
+ import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-EA7QO447.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
@@ -1 +1 @@
1
- import{VERSION as e}from"./chunk-YLWIEEDW.js";import{setBoundaryErrorReporter as t}from"./chunk-KNUR2UEG.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},Z=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{Z(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},x=class{p;l;h(e){this.p?.(e)}},j=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?C(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},W=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,J=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,K=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,D=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,V=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Y=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Q=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function X(e,t,n){const i=e.replace(Y,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Q.exec(n.trim()),i=e&&X(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Y,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=t.getAccessToken();i&&n(t.endpoint??"/api/client-telemetry/web-batches/",{method:"POST",keepalive:!0,credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const d=n.fetch??window.fetch.bind(window),l=new q({app:n.app,release:n.release,shell_version:H.test(e)?e:""}),u=ne(n.routeKey()),f=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let v=!1;const m=()=>{for(const e of l.drain())oe(e,n,d)},E=e=>{v||(l.addError(e),l.size>=50&&m())},L=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(W,"[redacted]").replace(J,"[redacted]").replace(K,"[url]").replace(D,"[id]").replace(V,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a},k=e=>{v||(l.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,u,()=>ne(n.routeKey()),f)),l.size>=50&&m())},S=n.vitalsSampleRate??1;S>0&&(S>=1||(n.random??Math.random)()<S)&&(((e,t={})=>{let n=!1;const s=w(t);C(()=>{let d,l=h(),u=g("LCP");const f=p(t,x),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,j,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,j,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;Z(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,j,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(k),R(k),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(k),P(k),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(k));const z=e=>{const{error:t,message:n,filename:i,lineno:a,colno:r}=e;if(null!=t)return void E(L(t,"onerror"));const o=i?ee(`at ${i}:${a??0}:${r??0}`):[];E({...L(n??"","onerror"),frames:o})},M=e=>E(L(e.reason,"unhandledrejection")),$=()=>{"hidden"===document.visibilityState&&m()};window.addEventListener("error",z),window.addEventListener("unhandledrejection",M),document.addEventListener("visibilitychange",$),window.addEventListener("pagehide",m);const _=window.setInterval(m,n.flushIntervalMs??6e4),F=t(e=>E(L(e,"boundary"))),U={flush:m,reportError:e=>E(L(e,"boundary")),stop(){v||(m(),v=!0,window.removeEventListener("error",z),window.removeEventListener("unhandledrejection",M),document.removeEventListener("visibilitychange",$),window.removeEventListener("pagehide",m),window.clearInterval(_),F(),ae===U&&(ae=null))}};return ae=U,U}export{se as startClientTelemetry};
1
+ import{VERSION as e}from"./chunk-5VNBEMZQ.js";import{setBoundaryErrorReporter as t}from"./chunk-KNUR2UEG.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,Z=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},_=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{_(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,F,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},x=class{p;l;h(e){this.p?.(e)}},B=[2500,4e3],N=[800,1800],j=e=>{document.prerendering?C(()=>j(e)):"complete"!==document.readyState?addEventListener("load",()=>j(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=t.getAccessToken();i&&n(t.endpoint??"/api/client-telemetry/web-batches/",{method:"POST",keepalive:!0,credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const d=n.fetch??window.fetch.bind(window),l=new q({app:n.app,release:n.release,shell_version:H.test(e)?e:""}),u=ne(n.routeKey()),f=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let v=!1;const m=()=>{for(const e of l.drain())oe(e,n,d)},E=e=>{v||(l.addError(e),l.size>=50&&m())},L=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a},k=e=>{v||(l.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,u,()=>ne(n.routeKey()),f)),l.size>=50&&m())},S=n.vitalsSampleRate??1;S>0&&(S>=1||(n.random??Math.random)()<S)&&(((e,t={})=>{let n=!1;const s=w(t);C(()=>{let d,l=h(),u=g("LCP");const f=p(t,x),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,B,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,B,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;_(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,B,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(k),R(k),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(k),P(k),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,N,t.reportAllChanges);j(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,N,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,N,t.reportAllChanges),d(!0))})},t)}})})(k));const z=e=>{const{error:t,message:n,filename:i,lineno:a,colno:r}=e;if(null!=t)return void E(L(t,"onerror"));const o=i?ee(`at ${i}:${a??0}:${r??0}`):[];E({...L(n??"","onerror"),frames:o})},M=e=>E(L(e.reason,"unhandledrejection")),$=()=>{"hidden"===document.visibilityState&&m()};window.addEventListener("error",z),window.addEventListener("unhandledrejection",M),document.addEventListener("visibilitychange",$),window.addEventListener("pagehide",m);const Z=window.setInterval(m,n.flushIntervalMs??6e4),F=t(e=>E(L(e,"boundary"))),U={flush:m,reportError:e=>E(L(e,"boundary")),stop(){v||(m(),v=!0,window.removeEventListener("error",z),window.removeEventListener("unhandledrejection",M),document.removeEventListener("visibilitychange",$),window.removeEventListener("pagehide",m),window.clearInterval(Z),F(),ae===U&&(ae=null))}};return ae=U,U}export{se as startClientTelemetry};
@@ -1,23 +1,23 @@
1
- import{toast_default as e}from"./chunk-RUHUTZN4.js";import{useShellStrings as t}from"./chunk-QRCDQPJA.js";import{Icon as n}from"./chunk-ZGUQLVY4.js";import{createContext as r,useContext as a,useRef as o,useState as i,useEffect as s}from"react";import*as l from"pdfjs-dist";import{createPortal as c}from"react-dom";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var h=r(null);function p({children:e}){const t=a(h);return t?c(e,t):
2
- /* @__PURE__ */d("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||l.GlobalWorkerOptions.workerSrc||(l.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${l.version}/build/pdf.worker.min.mjs`);var f={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},g=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=f[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw m(n,t,a);return a}};function w(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:g}}var y=[50,75,100,125,150,200,300,400];function v(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function b({url:r,filename:a,fit:c="width",onDownload:m,onEmail:h,workerSrc:f,wasmUrl:g}){const b=t().pdf,x=o(null),k=o(null),C=o(null),[N,j]=i(null),[M,E]=i(1),[P,_]=i(0),[z,D]=i(1),[L,W]=i(!0),[S,T]=i(!0),$=o(b.loadFailed);$.current=b.loadFailed,s(()=>{let t=!1;return T(!0),E(1),f&&(l.GlobalWorkerOptions.workerSrc=f),l.getDocument({url:r,...w(g)}).promise.then(e=>{t||(j(e),_(e.numPages),T(!1))}).catch(()=>{t||(e.error($.current),T(!1))}),()=>{t=!0}},[r,f,g]),s(()=>{if(!N||!L||!C.current)return;const e=()=>{const e=C.current;e&&N.getPage(M).then(t=>{if(!C.current)return;const n=t.getViewport({scale:1}),r=v(c,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});D(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(C.current),()=>t.disconnect()},[N,M,L,c]),s(()=>{if(!N||!x.current)return;let e=!1,t=null,n=null;return N.getPage(M).then(r=>{if(e||!x.current)return;const a=r.getViewport({scale:z}),o=x.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=k.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new l.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[N,M,z]),s(()=>{const e=()=>k.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const A="page"===c?b.fitPage:b.fitWidth,O="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-EA7QO447.js";import{useShellStrings as t}from"./chunk-4EIZZYLK.js";import{Icon as n}from"./chunk-B427NVDP.js";import{createContext as r,useContext as a,useRef as o,useState as i,useEffect as s}from"react";import*as l from"pdfjs-dist";import{createPortal as c}from"react-dom";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var h=r(null);function p({children:e}){const t=a(h);return t?c(e,t):
2
+ /* @__PURE__ */d("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||l.GlobalWorkerOptions.workerSrc||(l.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${l.version}/build/pdf.worker.min.mjs`);var f={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},g=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=f[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw m(n,t,a);return a}};function w(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:g}}var y=[50,75,100,125,150,200,300,400];function v(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function b({url:r,filename:a,fit:c="width",onDownload:m,onEmail:h,workerSrc:f,wasmUrl:g}){const b=t().pdf,x=o(null),k=o(null),C=o(null),[N,j]=i(null),[E,M]=i(1),[P,_]=i(0),[z,D]=i(1),[L,W]=i(!0),[S,$]=i(!0),A=o(b.loadFailed);A.current=b.loadFailed,s(()=>{let t=!1;return $(!0),M(1),f&&(l.GlobalWorkerOptions.workerSrc=f),l.getDocument({url:r,...w(g)}).promise.then(e=>{t||(j(e),_(e.numPages),$(!1))}).catch(()=>{t||(e.error(A.current),$(!1))}),()=>{t=!0}},[r,f,g]),s(()=>{if(!N||!L||!C.current)return;const e=()=>{const e=C.current;e&&N.getPage(E).then(t=>{if(!C.current)return;const n=t.getViewport({scale:1}),r=v(c,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});D(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(C.current),()=>t.disconnect()},[N,E,L,c]),s(()=>{if(!N||!x.current)return;let e=!1,t=null,n=null;return N.getPage(E).then(r=>{if(e||!x.current)return;const a=r.getViewport({scale:z}),o=x.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=k.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new l.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[N,E,z]),s(()=>{const e=()=>k.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const O="page"===c?b.fitPage:b.fitWidth,T="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
3
3
  return u("div",{className:"flex flex-col h-full",children:[
4
4
  /* @__PURE__ */u(p,{children:[
5
- /* @__PURE__ */d("button",{type:"button","aria-label":b.previousPage,onClick:()=>E(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__ */d(n,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
- /* @__PURE__ */d("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:b.pageOf(M,P)}),
7
- /* @__PURE__ */d("button",{type:"button","aria-label":b.nextPage,onClick:()=>E(e=>Math.min(P,e+1)),disabled:M>=P,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */d(n,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
5
+ /* @__PURE__ */d("button",{type:"button","aria-label":b.previousPage,onClick:()=>M(e=>Math.max(1,e-1)),disabled:E<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */d(n,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
6
+ /* @__PURE__ */d("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:b.pageOf(E,P)}),
7
+ /* @__PURE__ */d("button",{type:"button","aria-label":b.nextPage,onClick:()=>M(e=>Math.min(P,e+1)),disabled:E>=P,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */d(n,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
8
8
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
9
- /* @__PURE__ */d("button",{type:"button","aria-label":b.zoomOut,title:b.zoomOut,onClick:()=>{W(!1),D(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:O,children:/* @__PURE__ */d("span",{"aria-hidden":"true",children:"−"})}),
9
+ /* @__PURE__ */d("button",{type:"button","aria-label":b.zoomOut,title:b.zoomOut,onClick:()=>{W(!1),D(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:T,children:/* @__PURE__ */d("span",{"aria-hidden":"true",children:"−"})}),
10
10
  /* @__PURE__ */u("select",{value:L?"fit":y.includes(Math.round(100*z))?Math.round(100*z):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(W(!1),D(Number(t)/100)):W(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":b.zoom,title:b.zoom,children:[
11
- /* @__PURE__ */d("option",{value:"fit",children:A}),!L&&!y.includes(Math.round(100*z))&&/* @__PURE__ */u("option",{value:"custom",children:[Math.round(100*z),"%"]}),y.map(e=>/* @__PURE__ */u("option",{value:e,children:[e,"%"]},e))]}),
12
- /* @__PURE__ */d("button",{type:"button","aria-label":b.zoomIn,title:b.zoomIn,onClick:()=>{W(!1),D(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:O,children:/* @__PURE__ */d("span",{"aria-hidden":"true",children:"+"})}),
13
- /* @__PURE__ */d("button",{type:"button",onClick:()=>W(!0),"aria-pressed":L,className:O+(L?" bg-gray-200 text-gray-900":""),title:b.fitHint,children:b.fit}),
11
+ /* @__PURE__ */d("option",{value:"fit",children:O}),!L&&!y.includes(Math.round(100*z))&&/* @__PURE__ */u("option",{value:"custom",children:[Math.round(100*z),"%"]}),y.map(e=>/* @__PURE__ */u("option",{value:e,children:[e,"%"]},e))]}),
12
+ /* @__PURE__ */d("button",{type:"button","aria-label":b.zoomIn,title:b.zoomIn,onClick:()=>{W(!1),D(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:T,children:/* @__PURE__ */d("span",{"aria-hidden":"true",children:"+"})}),
13
+ /* @__PURE__ */d("button",{type:"button",onClick:()=>W(!0),"aria-pressed":L,className:T+(L?" bg-gray-200 text-gray-900":""),title:b.fitHint,children:b.fit}),
14
14
  /* @__PURE__ */d("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
15
- /* @__PURE__ */u("button",{type:"button",onClick:()=>{if(!N)return;const t=window.open("","_blank");if(!t)return void e.error(b.allowPopups);const n=[];for(let e=1;e<=P;e++)n.push(N.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=a,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:O,children:[
15
+ /* @__PURE__ */u("button",{type:"button",onClick:()=>{if(!N)return;const t=window.open("","_blank");if(!t)return void e.error(b.allowPopups);const n=[];for(let e=1;e<=P;e++)n.push(N.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(n).then(e=>{var n;t.document.write(`<html><head><title>${n=a,n.replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),t.document.write(e.map(e=>`<img src="${e}"/>`).join("")),t.document.write("</body></html>"),t.document.close(),setTimeout(()=>{t.print(),t.close()},300)})},className:T,children:[
16
16
  /* @__PURE__ */d(n,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),b.print]}),
17
- /* @__PURE__ */u("button",{type:"button",onClick:m??(()=>{const e=document.createElement("a");e.href=r,e.download=a,e.click()}),className:O,children:[
18
- /* @__PURE__ */d(n,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),b.download]}),h&&/* @__PURE__ */u("button",{type:"button",onClick:h,className:O,children:[
17
+ /* @__PURE__ */u("button",{type:"button",onClick:m??(()=>{const e=document.createElement("a");e.href=r,e.download=a,e.click()}),className:T,children:[
18
+ /* @__PURE__ */d(n,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),b.download]}),h&&/* @__PURE__ */u("button",{type:"button",onClick:h,className:T,children:[
19
19
  /* @__PURE__ */d(n,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),b.email]})]}),
20
- /* @__PURE__ */d("div",{ref:C,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!N)return;if(e.ctrlKey||e.metaKey)return;const t=C.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&M<P?(e.preventDefault(),E(e=>Math.min(P,e+1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})):e.deltaY<0&&n&&M>1&&(e.preventDefault(),E(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)}))},onKeyDown:e=>{if(!N)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?M<P&&(e.preventDefault(),E(e=>Math.min(P,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?M>1&&(e.preventDefault(),E(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),E(1)):"End"===e.key&&(e.preventDefault(),E(P)))},children:S?/* @__PURE__ */d("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:b.loading}):/* @__PURE__ */u("div",{className:"min-h-full flex items-center justify-center p-4",children:[
20
+ /* @__PURE__ */d("div",{ref:C,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!N)return;if(e.ctrlKey||e.metaKey)return;const t=C.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&E<P?(e.preventDefault(),M(e=>Math.min(P,e+1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})):e.deltaY<0&&n&&E>1&&(e.preventDefault(),M(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)}))},onKeyDown:e=>{if(!N)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?E<P&&(e.preventDefault(),M(e=>Math.min(P,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?E>1&&(e.preventDefault(),M(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),M(1)):"End"===e.key&&(e.preventDefault(),M(P)))},children:S?/* @__PURE__ */d("div",{className:"flex items-center justify-center h-full text-gray-500 text-sm",role:"status",children:b.loading}):/* @__PURE__ */u("div",{className:"min-h-full flex items-center justify-center p-4",children:[
21
21
  /* @__PURE__ */d("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
22
22
  /* @__PURE__ */u("div",{className:"relative shadow-lg rounded",children:[
23
23
  /* @__PURE__ */d("canvas",{ref:x,className:"block rounded"}),
@@ -1 +1 @@
1
- import{useInsideTooltip as e,Tooltip as n}from"./chunk-IJ7RXIWX.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
1
+ import{useInsideTooltip as e,Tooltip as n}from"./chunk-SZTKBF3D.js";import{useRef as r,useState as t}from"react";import{jsx as c}from"react/jsx-runtime";var i="whitespace-nowrap";function l({children:i}){const l=e(),o=r(null),[a,s]=t(!1),m=/* @__PURE__ */c("span",{ref:o,className:"min-w-0 truncate",onMouseEnter:()=>{const e=o.current;s(!!e&&e.scrollWidth>e.clientWidth+1)},children:i});return l?m:/* @__PURE__ */c(n,{content:a?i:null,describe:!1,className:"relative inline-flex min-w-0 max-w-full",children:m})}export{l as OneLineLabel,i as TH_ONE_LINE};
@@ -1,13 +1,13 @@
1
- import{buttonClasses as t}from"./chunk-JTNKC4CR.js";import{solidSurfaceStyle as e}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as o,escapeSurfaceAbove as i,onOverlayOpen as r,Z_LAYERS as n}from"./chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as l,forwardRef as h,useId as s,useState as d,useRef as c,useEffect as m,isValidElement as f,cloneElement as u,useContext as p}from"react";import{createPortal as g}from"react-dom";import{jsxs as b,jsx as x,Fragment as w}from"react/jsx-runtime";var v=448,M=240,N=8,y=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function W(t){const e=y(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var k=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var C={top:"bottom",bottom:"top",left:"right",right:"left"},H={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function B(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var E=(t,e,o)=>Math.max(e,Math.min(t,o));function R(t,e,o){return z(()=>t()?.getBoundingClientRect(),e,o)}function z(t,e,o){let i=NaN,r=NaN,n=NaN,a=NaN,l=NaN;const h=()=>{const e=t();if(!e)return!1;const h=o?o():NaN,s=e.left!==i||e.top!==r||e.right!==n||e.bottom!==a||h!==l&&!(Number.isNaN(h)&&Number.isNaN(l));return i=e.left,r=e.top,n=e.right,a=e.bottom,l=h,s};h();const s=()=>{h(),e()};let d=requestAnimationFrame(function t(){h()&&e(),d=requestAnimationFrame(t)});return window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}}function j({trigger:t,menu:e,bounds:o,align:i,side:r}){const n=B(t,o,4),a="bottom"===r?"top":"bottom",l=e.height>n[r]&&(e.height<=n[a]||n[a]>n[r])?a:r,h=Math.max(Math.min(e.height,96),n[l]),s=Math.min(e.height,h),d=E("bottom"===l?t.bottom+4:t.top-4-s,o.top+8,o.bottom-8-s),c=Math.max(0,o.right-o.left-16),m=Math.min(e.width,c);return{left:E("start"===i?t.left:t.right-m,o.left+8,o.right-8-m),top:d,side:l,maxHeight:h,maxWidth:c}}function T(t,e,o={}){const{matchTriggerWidth:i=!1,preferredMaxWidth:r=v,preferredMaxHeight:n=M,popupRef:l}=o,[h,s]=d(null);return a(()=>{if(!e)return void s(null);const o=()=>{const e=t.current,o=e?.getBoundingClientRect();if(!o)return;const a=W(e),h=a.bottom-o.bottom-4-8,d=o.top-a.top-4-8,c=h<Math.min(n,160)&&d>h,m=Math.max(96,Math.min(n,c?d:h)),f=Math.max(0,a.right-a.left-16),u={minWidth:o.width,maxWidth:Math.min(r,f),maxHeight:m};if(i){const t=Math.min(o.width,f);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(a.left+8,o.left),a.right-8-t)}else if(l&&a.right-8-o.left<u.maxWidth&&Math.min(o.right,a.right-8)-a.left-8<u.maxWidth){const t=l.current?.offsetWidth??0,e=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(a.left+8,Math.min(o.left,a.right-8-e))}else if(a.right-8-o.left<u.maxWidth){const t=Math.min(o.right,a.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-a.left-8))}else u.left=Math.max(a.left+8,o.left);c?u.bottom=window.innerHeight-o.top+4:u.top=o.bottom+4,s(u)};return o(),R(()=>t.current,o,l?()=>l.current?.offsetWidth??NaN:void 0)},[e,t,i,r,n,l]),h}function F({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},r=o.right-8-t.x,n=t.x-(o.left+8);return j({trigger:i,menu:e,bounds:o,align:e.width<=r||r>=n?"start":"end",side:"bottom"})}var I=l(!1),L=()=>p(I),A={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function D({content:t,side:l="top",delay:h=200,children:p,className:w="relative inline-flex",describe:v=!0}){const[M,N]=d(!1),z=M&&!(null==t||!1===t||""===t),[j,T]=d(null),F=c(void 0),L=c(null),D=c(null),P=s(),S=c(!1),$=()=>{window.clearTimeout(F.current),S.current||(F.current=window.setTimeout(()=>N(!0),h))},q=()=>{window.clearTimeout(F.current),N(!1)},J=()=>{S.current=!0,q()},G=()=>{S.current=!1,q()};m(()=>()=>window.clearTimeout(F.current),[]),a(()=>{if(!z)return void T(null);const t=()=>{const t=L.current,e=D.current;if(!t||!e)return;const o=W(t),i=Math.max(0,o.right-o.left-16),r=Math.max(0,o.bottom-o.top-16);e.style.maxWidth=`${i}px`,e.style.maxHeight=`${r}px`;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return;const a=t.getBoundingClientRect();if(!function(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=y(),i={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let r=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==r;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===r&&"static"===t.position)continue;r=t.position;const o=k.has(t.overflowX),n=k.has(t.overflowY);if(!o&&!n)continue;const a=e.getBoundingClientRect();a.width<=0&&a.height<=0||(o&&(i.left=Math.max(i.left,a.left),i.right=Math.min(i.right,a.right)),n&&(i.top=Math.max(i.top,a.top),i.bottom=Math.min(i.bottom,a.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}(t))return void q();const h=function(t,e,o,i,r){const n=B(t,i,r),a=t=>n[t]-("top"===t||"bottom"===t?e.height:e.width),l=[o,C[o],...H[o]],h=l.find(t=>a(t)>=0)??l.reduce((t,e)=>a(e)>a(t)?e:t),s=(t.left+t.right)/2,d=(t.top+t.bottom)/2;let c,m;switch(h){case"top":c=s-e.width/2,m=t.top-r-e.height;break;case"bottom":c=s-e.width/2,m=t.bottom+r;break;case"left":c=t.left-r-e.width,m=d-e.height/2;break;case"right":c=t.right+r,m=d-e.height/2}return{side:h,left:E(c,i.left+8,i.right-8-e.width),top:E(m,i.top+8,i.bottom-8-e.height)}}(a,n,l,o,12),s=function(t,e,o,i,r){const{side:n,left:a,top:l}=e,h=a+o.width,s=l+o.height;if({top:t.top-s,bottom:l-t.bottom,left:t.left-h,right:a-t.right}[n]<r)return null;const d=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),c=(t.left+t.right)/2,m=(t.top+t.bottom)/2;switch(n){case"top":return{side:n,x:d(c,a,o.width),y:s};case"bottom":return{side:n,x:d(c,a,o.width),y:l};case"left":return{side:n,x:h,y:d(m,l,o.height)};case"right":return{side:n,x:a,y:d(m,l,o.height)}}}(a,h,n,16,6),d={anchor:{left:a.left,top:a.top,width:a.width,height:a.height},left:h.left-a.left,top:h.top-a.top,maxWidth:i,maxHeight:r,side:h.side,arrow:s&&{left:s.x-a.left,top:s.y-a.top}};T(t=>{return t&&(o=d,(e=t).anchor.left===o.anchor.left&&e.anchor.top===o.anchor.top&&e.anchor.width===o.anchor.width&&e.anchor.height===o.anchor.height&&e.left===o.left&&e.top===o.top&&e.maxWidth===o.maxWidth&&e.maxHeight===o.maxHeight&&e.side===o.side&&e.arrow?.left===o.arrow?.left&&e.arrow?.top===o.arrow?.top)?t:d;var e,o})};return t(),R(()=>L.current,t)},[z,l,t]),m(()=>{if(!z)return;const t=o(t=>"Escape"===t.key&&(q(),!i(L.current))),e=r(q);return()=>{t(),e()}},[z]);const K=z&&v?P:void 0,Q=f(p)?u(p,{"aria-describedby":[p.props["aria-describedby"],K].filter(Boolean).join(" ")||void 0}):p,X=z?e():void 0;/* @__PURE__ */
2
- return b("span",{ref:L,className:w,"aria-describedby":f(p)?void 0:K,onMouseEnter:$,onMouseLeave:G,onFocus:$,onBlur:G,onPointerDown:J,onClick:J,children:[
3
- /* @__PURE__ */x(I.Provider,{value:!0,children:Q}),z&&g(
1
+ import{buttonClasses as t}from"./chunk-K7PQXJO7.js";import{solidSurfaceStyle as e}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as o,escapeSurfaceAbove as i,onOverlayOpen as r,Z_LAYERS as n}from"./chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as l,forwardRef as h,useId as s,useState as d,useRef as c,useEffect as m,isValidElement as f,cloneElement as u,useContext as p}from"react";import{createPortal as g}from"react-dom";import{jsxs as b,jsx as x,Fragment as w}from"react/jsx-runtime";var v=448,M=240,N=8,y=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function W(t){const e=y(),o=t?.closest?.("[data-modal-panel]");if(!o)return e;const i=o.getBoundingClientRect();return i.width<=0||i.height<=0?e:{left:Math.max(e.left,i.left),right:Math.min(e.right,i.right),top:Math.max(e.top,i.top),bottom:Math.min(e.bottom,i.bottom)}}var k=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var C={top:"bottom",bottom:"top",left:"right",right:"left"},H={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function B(t,e,o){return{top:t.top-o-(e.top+8),bottom:e.bottom-8-(t.bottom+o),left:t.left-o-(e.left+8),right:e.right-8-(t.right+o)}}var E=(t,e,o)=>Math.max(e,Math.min(t,o));function R(t,e,o){return z(()=>t()?.getBoundingClientRect(),e,o)}function z(t,e,o){let i=NaN,r=NaN,n=NaN,a=NaN,l=NaN;const h=()=>{const e=t();if(!e)return!1;const h=o?o():NaN,s=e.left!==i||e.top!==r||e.right!==n||e.bottom!==a||h!==l&&!(Number.isNaN(h)&&Number.isNaN(l));return i=e.left,r=e.top,n=e.right,a=e.bottom,l=h,s};h();const s=()=>{h(),e()};let d=requestAnimationFrame(function t(){h()&&e(),d=requestAnimationFrame(t)});return window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}}function j({trigger:t,menu:e,bounds:o,align:i,side:r}){const n=B(t,o,4),a="bottom"===r?"top":"bottom",l=e.height>n[r]&&(e.height<=n[a]||n[a]>n[r])?a:r,h=Math.max(Math.min(e.height,96),n[l]),s=Math.min(e.height,h),d=E("bottom"===l?t.bottom+4:t.top-4-s,o.top+8,o.bottom-8-s),c=Math.max(0,o.right-o.left-16),m=Math.min(e.width,c);return{left:E("start"===i?t.left:t.right-m,o.left+8,o.right-8-m),top:d,side:l,maxHeight:h,maxWidth:c}}function T(t,e,o={}){const{matchTriggerWidth:i=!1,preferredMaxWidth:r=v,preferredMaxHeight:n=M,popupRef:l}=o,[h,s]=d(null);return a(()=>{if(!e)return void s(null);const o=()=>{const e=t.current,o=e?.getBoundingClientRect();if(!o)return;const a=W(e),h=a.bottom-o.bottom-4-8,d=o.top-a.top-4-8,c=h<Math.min(n,160)&&d>h,m=Math.max(96,Math.min(n,c?d:h)),f=Math.max(0,a.right-a.left-16),u={minWidth:o.width,maxWidth:Math.min(r,f),maxHeight:m};if(i){const t=Math.min(o.width,f);u.width=t,u.maxWidth=t,u.left=Math.min(Math.max(a.left+8,o.left),a.right-8-t)}else if(l&&a.right-8-o.left<u.maxWidth&&Math.min(o.right,a.right-8)-a.left-8<u.maxWidth){const t=l.current?.offsetWidth??0,e=t>0?Math.min(t,u.maxWidth):u.maxWidth;u.left=Math.max(a.left+8,Math.min(o.left,a.right-8-e))}else if(a.right-8-o.left<u.maxWidth){const t=Math.min(o.right,a.right-8);u.right=window.innerWidth-t,u.maxWidth=Math.min(u.maxWidth,Math.max(0,t-a.left-8))}else u.left=Math.max(a.left+8,o.left);c?u.bottom=window.innerHeight-o.top+4:u.top=o.bottom+4,s(u)};return o(),R(()=>t.current,o,l?()=>l.current?.offsetWidth??NaN:void 0)},[e,t,i,r,n,l]),h}function F({point:t,menu:e,bounds:o}){const i={left:t.x,right:t.x,top:t.y,bottom:t.y},r=o.right-8-t.x,n=t.x-(o.left+8);return j({trigger:i,menu:e,bounds:o,align:e.width<=r||r>=n?"start":"end",side:"bottom"})}var I=l(!1),L=()=>p(I),A={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function P({content:t,side:l="top",delay:h=200,children:p,className:w="relative inline-flex",describe:v=!0}){const[M,N]=d(!1),z=M&&!(null==t||!1===t||""===t),[j,T]=d(null),F=c(void 0),L=c(null),P=c(null),D=s(),S=c(!1),$=()=>{window.clearTimeout(F.current),S.current||(F.current=window.setTimeout(()=>N(!0),h))},q=()=>{window.clearTimeout(F.current),N(!1)},J=()=>{S.current=!0,q()},Q=()=>{S.current=!1,q()};m(()=>()=>window.clearTimeout(F.current),[]),a(()=>{if(!z)return void T(null);const t=()=>{const t=L.current,e=P.current;if(!t||!e)return;const o=W(t),i=Math.max(0,o.right-o.left-16),r=Math.max(0,o.bottom-o.top-16);e.style.maxWidth=`${i}px`,e.style.maxHeight=`${r}px`;const n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return;const a=t.getBoundingClientRect();if(!function(t){const e=t.getBoundingClientRect();if(e.width<=0&&e.height<=0&&0===e.left&&0===e.top)return null;const o=y(),i={left:Math.max(o.left,e.left),right:Math.min(o.right,e.right),top:Math.max(o.top,e.top),bottom:Math.min(o.bottom,e.bottom)};let r=getComputedStyle(t).position;for(let e=t.parentElement;e&&e!==document.documentElement&&"fixed"!==r;e=e.parentElement){const t=getComputedStyle(e);if("absolute"===r&&"static"===t.position)continue;r=t.position;const o=k.has(t.overflowX),n=k.has(t.overflowY);if(!o&&!n)continue;const a=e.getBoundingClientRect();a.width<=0&&a.height<=0||(o&&(i.left=Math.max(i.left,a.left),i.right=Math.min(i.right,a.right)),n&&(i.top=Math.max(i.top,a.top),i.bottom=Math.min(i.bottom,a.bottom)))}return i.right>=i.left&&i.bottom>=i.top?i:null}(t))return void q();const h=function(t,e,o,i,r){const n=B(t,i,r),a=t=>n[t]-("top"===t||"bottom"===t?e.height:e.width),l=[o,C[o],...H[o]],h=l.find(t=>a(t)>=0)??l.reduce((t,e)=>a(e)>a(t)?e:t),s=(t.left+t.right)/2,d=(t.top+t.bottom)/2;let c,m;switch(h){case"top":c=s-e.width/2,m=t.top-r-e.height;break;case"bottom":c=s-e.width/2,m=t.bottom+r;break;case"left":c=t.left-r-e.width,m=d-e.height/2;break;case"right":c=t.right+r,m=d-e.height/2}return{side:h,left:E(c,i.left+8,i.right-8-e.width),top:E(m,i.top+8,i.bottom-8-e.height)}}(a,n,l,o,12),s=function(t,e,o,i,r){const{side:n,left:a,top:l}=e,h=a+o.width,s=l+o.height;if({top:t.top-s,bottom:l-t.bottom,left:t.left-h,right:a-t.right}[n]<r)return null;const d=(t,e,o)=>o<2*i?e+o/2:Math.max(e+i,Math.min(t,e+o-i)),c=(t.left+t.right)/2,m=(t.top+t.bottom)/2;switch(n){case"top":return{side:n,x:d(c,a,o.width),y:s};case"bottom":return{side:n,x:d(c,a,o.width),y:l};case"left":return{side:n,x:h,y:d(m,l,o.height)};case"right":return{side:n,x:a,y:d(m,l,o.height)}}}(a,h,n,16,6),d={anchor:{left:a.left,top:a.top,width:a.width,height:a.height},left:h.left-a.left,top:h.top-a.top,maxWidth:i,maxHeight:r,side:h.side,arrow:s&&{left:s.x-a.left,top:s.y-a.top}};T(t=>{return t&&(o=d,(e=t).anchor.left===o.anchor.left&&e.anchor.top===o.anchor.top&&e.anchor.width===o.anchor.width&&e.anchor.height===o.anchor.height&&e.left===o.left&&e.top===o.top&&e.maxWidth===o.maxWidth&&e.maxHeight===o.maxHeight&&e.side===o.side&&e.arrow?.left===o.arrow?.left&&e.arrow?.top===o.arrow?.top)?t:d;var e,o})};return t(),R(()=>L.current,t)},[z,l,t]),m(()=>{if(!z)return;const t=o(t=>"Escape"===t.key&&(q(),!i(L.current))),e=r(q);return()=>{t(),e()}},[z]);const X=z&&v?D:void 0,G=f(p)?u(p,{"aria-describedby":[p.props["aria-describedby"],X].filter(Boolean).join(" ")||void 0}):p,K=z?e():void 0;/* @__PURE__ */
2
+ return b("span",{ref:L,className:w,"aria-describedby":f(p)?void 0:X,onMouseEnter:$,onMouseLeave:Q,onFocus:$,onBlur:Q,onPointerDown:J,onClick:J,children:[
3
+ /* @__PURE__ */x(I.Provider,{value:!0,children:G}),z&&g(
4
4
  /* @__PURE__ */b("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:n.hint,...j?.anchor},children:[
5
- /* @__PURE__ */x("span",{ref:D,id:P,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-gray-800 ${j?"":A[l]}`,style:{...X,...j&&{left:j.left,top:j.top,maxWidth:j.maxWidth,maxHeight:j.maxHeight}},children:t}),(!j||j.arrow)&&
6
- /* @__PURE__ */x("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":j?.side??l,style:{background:X?.background,"--rosh-tooltip-edge":X?.border,...j?.arrow&&{left:j.arrow.left,top:j.arrow.top}}})]}),document.body)]})}var P=t=>!0===t||"true"===t;function S(t){t.preventDefault(),t.stopPropagation()}var $=(t,e)=>[t,e].filter(Boolean).join(" ")||void 0;function q({reason:t,id:e,block:o=!1,children:i}){/* @__PURE__ */
5
+ /* @__PURE__ */x("span",{ref:P,id:D,role:"tooltip",className:`pointer-events-none absolute z-(--z-hint) box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-gray-800 ${j?"":A[l]}`,style:{...K,...j&&{left:j.left,top:j.top,maxWidth:j.maxWidth,maxHeight:j.maxHeight}},children:t}),(!j||j.arrow)&&
6
+ /* @__PURE__ */x("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":j?.side??l,style:{background:K?.background,"--rosh-tooltip-edge":K?.border,...j?.arrow&&{left:j.arrow.left,top:j.arrow.top}}})]}),document.body)]})}var D=t=>!0===t||"true"===t;function S(t){t.preventDefault(),t.stopPropagation()}var $=(t,e)=>[t,e].filter(Boolean).join(" ")||void 0;function q({reason:t,id:e,block:o=!1,children:i}){/* @__PURE__ */
7
7
  return b(w,{children:[
8
- /* @__PURE__ */x(D,{content:t,describe:!1,className:o?"relative flex w-full":"relative inline-flex",children:i}),
8
+ /* @__PURE__ */x(P,{content:t,describe:!1,className:o?"relative flex w-full":"relative inline-flex",children:i}),
9
9
  /* @__PURE__ */x("span",{id:e,className:"sr-only",children:t})]})}function J(){/* @__PURE__ */
10
10
  return b("svg",{className:"h-3.5 w-3.5 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
11
11
  /* @__PURE__ */x("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
12
- /* @__PURE__ */x("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}var G=h(function({variant:e="primary",size:o="md",loading:i=!1,leftIcon:r,rightIcon:n,block:a=!1,disabled:l,type:h="button",children:d,className:c="",disabledReason:m,onClick:f,pressed:u,"aria-disabled":p,"aria-describedby":g,...w},v){const M=s(),N=l||i,y=null!=m&&""!==m,W=N&&y,k=!N&&P(p),C=k&&y,H=W||C?M:void 0,B=/* @__PURE__ */b("button",{ref:v,type:h,disabled:N,"aria-busy":i||void 0,"aria-disabled":!!k||p,"aria-describedby":$(g,H),onClick:k?S:f,className:t({variant:e,size:o,block:a,pressed:u??(!0===w["aria-pressed"]||"true"===w["aria-pressed"]),className:c}),...w,children:[i?/* @__PURE__ */x(J,{}):r,d,!i&&n]});return C?/* @__PURE__ */x(q,{reason:m,id:M,block:a,children:B}):W?/* @__PURE__ */b("span",{className:a?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[B,
13
- /* @__PURE__ */x("span",{id:H,className:"text-xs text-red-600",children:m})]}):B});export{G as Button_default,M as MENU_MAX_HEIGHT,q as OffWithReason,v as POPUP_MAX_WIDTH,D as Tooltip,N as VIEWPORT_MARGIN,$ as describedByWith,R as followAnchor,z as followRect,P as isAriaDisabled,F as placeAtPoint,j as placeMenu,W as popupBounds,S as swallowPress,T as useDropdownPosition,L as useInsideTooltip};
12
+ /* @__PURE__ */x("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}var Q=h(function({variant:e="primary",size:o="md",loading:i=!1,leftIcon:r,rightIcon:n,block:a=!1,disabled:l,type:h="button",children:d,className:c="",disabledReason:m,onClick:f,pressed:u,"aria-disabled":p,"aria-describedby":g,...w},v){const M=s(),N=l||i,y=null!=m&&""!==m,W=N&&y,k=!N&&D(p),C=k&&y,H=W||C?M:void 0,B=/* @__PURE__ */b("button",{ref:v,type:h,disabled:N,"aria-busy":i||void 0,"aria-disabled":!!k||p,"aria-describedby":$(g,H),onClick:k?S:f,className:t({variant:e,size:o,block:a,pressed:u??(!0===w["aria-pressed"]||"true"===w["aria-pressed"]),className:c}),...w,children:[i?/* @__PURE__ */x(J,{}):r,d,!i&&n]});return C?/* @__PURE__ */x(q,{reason:m,id:M,block:a,children:B}):W?/* @__PURE__ */b("span",{className:a?"flex w-full flex-col gap-1":"inline-flex flex-col items-start gap-1",children:[B,
13
+ /* @__PURE__ */x("span",{id:H,className:"text-xs text-red-600",children:m})]}):B});export{Q as Button_default,M as MENU_MAX_HEIGHT,q as OffWithReason,v as POPUP_MAX_WIDTH,P as Tooltip,N as VIEWPORT_MARGIN,$ as describedByWith,R as followAnchor,z as followRect,D as isAriaDisabled,F as placeAtPoint,j as placeMenu,W as popupBounds,S as swallowPress,T as useDropdownPosition,L as useInsideTooltip};
@@ -1 +1 @@
1
- var e=["academic-cap","accent","account","account-circle","add","add-circle","add-person","adjust","align-center","align-justify","align-left","align-right","align-separate","anchor","animation","apps","archive-box","arrow","arrow-down","arrow-left","arrow-left-end-on-rectangle","arrow-long-right","arrow-right","arrow-trending-down","arrow-trending-up","arrow-up","arrow-up-right","at-symbol","attach","background","bag","bank","bars-3-bottom-left","battery","beaker","bell","bell-alert","bell-plus","billing","black-and-white","block-badge","block-banner","block-box","block-button","block-column","block-coupon","block-divider","block-footer","block-heading","block-image","block-included-list","block-layered-images","block-product","block-product-title","block-section","block-social","block-spacer","block-text","block-video","blog-post","bold","bolt","book-open","bookmark","bookmark-square","braces","breadcrumb","briefcase","bug","bug-ant","building-library","building-office-2","button","button-arrow","calculator","calendar","calendar-check","camera","caption","car","card-payment","caret","cart","case","case-lower","case-normal","case-upper","category","chart","chart-bar","chart-bar-square","chart-line","chat","chat-bubble-left-right","chat-bubble-oval-left-ellipsis","check","check-circle","checkbox","chevron","chevron-double","chevron-double-left","chevron-double-right","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle-stack","clear-marks","clipboard","clipboard-check","clipboard-document-list","clipboard-list","clock","close","close-circle","cloud","cloud-download","code","code-bracket","collapse","collapse-all","column-gap","column-widths","columns","company","compose","contrast","cookie","copied","copy","copy-style","copy-to-page","corner","crop","cube-transparent","cursor","cursor-arrow-rays","cursor-click","dashboard","date","desktop","diagram","direction","direction-down","direction-left","direction-right","direction-up","document","document-check","document-magnifying-glass","dollar","dot","download","drag","drop","duplicate","edit","email","emphasis","eraser","error","expand","external","eye","eye-off","face-smile","filter","finish","fire","flag","folder","folder-open","folder-plus","forward","full-width","gap","gem","gift","globe","grid","ground","hand","hand-thumb-up","hash","headquarters","heart","height","help","help-off","hexagon","home","hover","identification","image","image-off","images","inbox","info","italic","key","layers","layout","letter-spacing","lightbulb","line-between","line-style","link","link-slash","list","location","lock","logo","logout","map","media","megaphone","menu","meta","microphone","money","moon","more","more-vertical","move-down","move-up","newspaper","no-symbol","note","nudge","numbered-list","opacity","own-text","package","package-open","padding-bottom","padding-left","padding-right","padding-top","padding-x","padding-y","page","paint-brush","panel-left","panel-right","paragraph-spacing","parcel","paste","paste-style","pause","pen","people","percent","phone","phone-hidden","placement","play","plus-minus","power","presentation-chart-bar","print","product","product-field","product-size","progress","quiet","radio-dot","radius","receipt","receipt-percent","receipt-refund","rectangle-group","redo","refresh","remove","remove-circle","rename","reply","reply-all","revert","robot","rotate","scale","scroll-point","scroll-text","search","select-all","send","server","settings","shadow","shape-ellipse","shape-rect","share","shield-check","shield-exclamation","signal","signal-slash","sitemap","sort","sparkles","speaker","speaker-wave","spec-table","spinner","split","square","star","state","status-circle","status-dot","sticky","stop-circle","store","strike","styles","subscript","success-burst","sun","superscript","swap","swatch","table","tablet","tabs","tag","target","team","telephone","template","text-color","text-lines","text-size","text-small","text-value","theme","ticket","title","trash","trigger","truck","tv","type","tyre","underline","undo","upload","v-align","verified","video-off","view-columns","wallet","warning","weight","wheel","widgets","width","window","windows","words-from","wrap","wrench","wrench-screwdriver","zoom-in"],r=new Set(e),a=e=>"string"==typeof e&&r.has(e);export{e as ICON_NAMES,a as isIconName};
1
+ var e=["academic-cap","accent","account","account-circle","add","add-circle","add-person","adjust","align-center","align-justify","align-left","align-right","align-separate","anchor","animation","apps","archive-box","arrow","arrow-down","arrow-left","arrow-left-end-on-rectangle","arrow-long-right","arrow-right","arrow-trending-down","arrow-trending-up","arrow-up","arrow-up-right","at-symbol","attach","background","bag","bank","bars-3-bottom-left","battery","beaker","bell","bell-alert","bell-plus","billing","black-and-white","block-badge","block-banner","block-box","block-button","block-column","block-coupon","block-divider","block-footer","block-heading","block-image","block-included-list","block-layered-images","block-product","block-product-title","block-section","block-social","block-spacer","block-text","block-video","blog-post","bold","bolt","book-open","bookmark","bookmark-square","braces","breadcrumb","briefcase","bug","bug-ant","building-library","building-office-2","button","button-arrow","calculator","calendar","calendar-check","camera","caption","car","card-payment","caret","cart","case","case-lower","case-normal","case-upper","category","chart","chart-bar","chart-bar-square","chart-line","chat","chat-bubble-left-right","chat-bubble-oval-left-ellipsis","check","check-circle","checkbox","chevron","chevron-double","chevron-double-left","chevron-double-right","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle-stack","clear-marks","clipboard","clipboard-check","clipboard-document-list","clipboard-list","clock","close","close-circle","cloud","cloud-download","code","code-bracket","collapse","collapse-all","column-gap","column-widths","columns","company","compose","contrast","cookie","copied","copy","copy-style","copy-to-page","corner","crop","cube-transparent","cursor","cursor-arrow-rays","cursor-click","dashboard","date","desktop","diagram","direction","direction-down","direction-left","direction-right","direction-up","document","document-check","document-magnifying-glass","dollar","dot","download","drag","drop","duplicate","edit","email","emphasis","eraser","error","expand","external","eye","eye-off","face-smile","filter","finish","fire","flag","folder","folder-open","folder-plus","forward","full-width","gap","gem","gift","globe","grid","ground","hand","hand-thumb-up","hash","headquarters","heart","height","help","help-off","hexagon","home","hover","identification","image","image-off","images","inbox","info","italic","key","layers","layout","letter-spacing","lightbulb","line-between","line-style","link","link-slash","list","location","lock","logo","logout","map","media","megaphone","menu","meta","microphone","money","moon","more","more-vertical","move-down","move-up","newspaper","no-symbol","note","nudge","numbered-list","opacity","own-text","package","package-open","padding-bottom","padding-left","padding-right","padding-top","padding-x","padding-y","page","paint-brush","panel-left","panel-right","paragraph-spacing","parcel","paste","paste-style","pause","pen","people","percent","phone","phone-hidden","placement","play","plus-minus","power","presentation-chart-bar","print","product","product-field","product-size","progress","quiet","radio-dot","radius","receipt","receipt-percent","receipt-refund","rectangle-group","redo","refresh","remove","remove-circle","rename","reply","reply-all","revert","robot","rotate","scale","scroll-point","scroll-text","search","select-all","send","server","settings","shadow","shape-ellipse","shape-rect","share","shield-check","shield-exclamation","signal","signal-slash","sitemap","slide-arrows-bare","slide-arrows-round","slide-arrows-square","slide-picker-bar","slide-picker-cards","slide-picker-dots","slide-picker-numbers","sort","sparkles","speaker","speaker-wave","spec-table","spinner","split","square","star","state","status-circle","status-dot","sticky","stop-circle","store","strike","styles","subscript","success-burst","sun","superscript","swap","swatch","table","tablet","tabs","tag","target","team","telephone","template","text-color","text-lines","text-size","text-small","text-value","theme","ticket","title","trash","trigger","truck","tv","type","tyre","underline","undo","upload","v-align","verified","video-off","view-columns","wallet","warning","weight","wheel","widgets","width","window","windows","words-from","wrap","wrench","wrench-screwdriver","zoom-in"],r=new Set(e),a=e=>"string"==typeof e&&r.has(e);export{e as ICON_NAMES,a as isIconName};
@@ -1,29 +1,29 @@
1
- import{useDismissPopupsOnOpen as e}from"./chunk-UVBK6YSR.js";import{buttonClasses as t}from"./chunk-JTNKC4CR.js";import{registerModalEscapeInterceptor as n,Z_LAYERS as r}from"./chunk-FIEA5CGB.js";import{useShellStrings as l,splitAround as o}from"./chunk-QRCDQPJA.js";import{Icon as i}from"./chunk-ZGUQLVY4.js";import{createContext as a,useEffect as s,useRef as c,useId as d,useContext as u,useState as m,useCallback as f}from"react";import{jsxs as h,jsx as b,Fragment as g}from"react/jsx-runtime";var v=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function p(e){return Array.from(e.querySelectorAll(v)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var y=[];function x(e){const t=y.findIndex(t=>t!==e&&e.contains(t));-1===t?y.push(e):y.splice(t,0,e)}function w(e){const t=y.lastIndexOf(e);-1!==t&&y.splice(t,1)}var N=/* @__PURE__ */new WeakSet;function k(e){return p(e)}function C(e,t){s(()=>{if(!t)return;const n=e.current;return n?(N.add(n),x(n),()=>{w(n),N.delete(n)}):void 0},[e,t])}function E(e,t){const n=y.lastIndexOf(t),r=n>0?y[n-1]:-1===n?y[y.length-1]??null:null,l=p(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),o=l.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return o||(r&&!N.has(r)?l[0]??null:null)}function L(e,t,n){s(()=>{if(!t)return;const r=e.current;if(!r)return;const l=document.activeElement,o=n?.current??p(r)[0]??r;o!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),o.focus();const i=e=>{if("Tab"!==e.key)return;if(y[y.length-1]!==r)return;const t=p(r);if(0===t.length)return void e.preventDefault();const n=t[0],l=t[t.length-1],o=document.activeElement;!e.shiftKey||o!==n&&r.contains(o)?e.shiftKey||o!==l&&r.contains(o)||(e.preventDefault(),n.focus()):(e.preventDefault(),l.focus())};return x(r),document.addEventListener("keydown",i,!0),()=>{w(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&l?.focus?.()}},[e,t,n])}var P=0,j=null;function I(e){s(()=>{if(!e)return;const t=document.body;if(0===P){j={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return P+=1,()=>{0===(P-=1)&&j&&(t.style.overflow=j.overflow,t.style.paddingRight=j.paddingRight,j=null)}},[e])}function D({role:e="dialog",modal:t,titleId:n,labelledBy:r,label:l}){const o=n??r;return{role:e,"aria-modal":!!t||void 0,"aria-labelledby":o,"aria-label":o?void 0:l}}var T={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function F({open:t,onClose:o,title:a,description:u,role:m="dialog",children:f,footer:g,blocking:v=!1,size:p="md",initialFocus:y,"aria-label":x,"aria-labelledby":w,"aria-describedby":N,className:k=""}){const C=c(null),E=d(),P=d(),j=!v&&!g,F=d(),R=l().dialog;return e(t),L(C,t,y),I(t),s(()=>{if(t)return n(()=>(v||o(),!0),()=>C.current)},[t,v,o]),t?/* @__PURE__ */h("div",{className:"fixed inset-0",style:{zIndex:r.overlay},role:"presentation",children:[
1
+ import{useDismissPopupsOnOpen as e}from"./chunk-UVBK6YSR.js";import{buttonClasses as t}from"./chunk-K7PQXJO7.js";import{registerModalEscapeInterceptor as n,Z_LAYERS as r}from"./chunk-FIEA5CGB.js";import{useShellStrings as l,splitAround as o}from"./chunk-4EIZZYLK.js";import{Icon as i}from"./chunk-B427NVDP.js";import{createContext as a,useEffect as s,useRef as c,useId as d,useContext as u,useState as m,useCallback as f}from"react";import{jsxs as h,jsx as b,Fragment as g}from"react/jsx-runtime";var v=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function p(e){return Array.from(e.querySelectorAll(v)).filter(e=>null!==e.offsetParent||e===document.activeElement)}var y=[];function x(e){const t=y.findIndex(t=>t!==e&&e.contains(t));-1===t?y.push(e):y.splice(t,0,e)}function w(e){const t=y.lastIndexOf(e);-1!==t&&y.splice(t,1)}var N=/* @__PURE__ */new WeakSet;function k(e){return p(e)}function C(e,t){s(()=>{if(!t)return;const n=e.current;return n?(N.add(n),x(n),()=>{w(n),N.delete(n)}):void 0},[e,t])}function E(e,t){const n=y.lastIndexOf(t),r=n>0?y[n-1]:-1===n?y[y.length-1]??null:null,l=p(r??e.ownerDocument.body).filter(n=>!t.contains(n)&&!e.contains(n)),o=l.find(t=>0!==(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING));return o||(r&&!N.has(r)?l[0]??null:null)}function L(e,t,n){s(()=>{if(!t)return;const r=e.current;if(!r)return;const l=document.activeElement,o=n?.current??p(r)[0]??r;o!==r||r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),o.focus();const i=e=>{if("Tab"!==e.key)return;if(y[y.length-1]!==r)return;const t=p(r);if(0===t.length)return void e.preventDefault();const n=t[0],l=t[t.length-1],o=document.activeElement;!e.shiftKey||o!==n&&r.contains(o)?e.shiftKey||o!==l&&r.contains(o)||(e.preventDefault(),n.focus()):(e.preventDefault(),l.focus())};return x(r),document.addEventListener("keydown",i,!0),()=>{w(r),document.removeEventListener("keydown",i,!0),(r.contains(document.activeElement)||document.activeElement===document.body)&&l?.focus?.()}},[e,t,n])}var P=0,j=null;function I(e){s(()=>{if(!e)return;const t=document.body;if(0===P){j={overflow:t.style.overflow,paddingRight:t.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;t.style.overflow="hidden",e>0&&(t.style.paddingRight=`${e}px`)}return P+=1,()=>{0===(P-=1)&&j&&(t.style.overflow=j.overflow,t.style.paddingRight=j.paddingRight,j=null)}},[e])}function D({role:e="dialog",modal:t,titleId:n,labelledBy:r,label:l}){const o=n??r;return{role:e,"aria-modal":!!t||void 0,"aria-labelledby":o,"aria-label":o?void 0:l}}var F={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl"};function O({open:t,onClose:o,title:a,description:u,role:m="dialog",children:f,footer:g,blocking:v=!1,size:p="md",initialFocus:y,"aria-label":x,"aria-labelledby":w,"aria-describedby":N,className:k=""}){const C=c(null),E=d(),P=d(),j=!v&&!g,O=d(),T=l().dialog;return e(t),L(C,t,y),I(t),s(()=>{if(t)return n(()=>(v||o(),!0),()=>C.current)},[t,v,o]),t?/* @__PURE__ */h("div",{className:"fixed inset-0",style:{zIndex:r.overlay},role:"presentation",children:[
2
2
  /* @__PURE__ */b("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
3
- /* @__PURE__ */b("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:v?void 0:e=>{e.target===e.currentTarget&&o()},children:/* @__PURE__ */h("div",{ref:C,...D({role:m,modal:!0,titleId:a?F:void 0,labelledBy:w,label:x}),"aria-describedby":N??(u?P:f?E:void 0),className:`relative max-h-full w-full ${T[p]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${k}`.trim(),children:[a&&/* @__PURE__ */b("h2",{id:F,className:(j?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:a}),u&&/* @__PURE__ */b("p",{id:P,className:((a?"mt-1":j?"pr-8":"")+" text-sm text-gray-500").trim(),children:u}),f&&/* @__PURE__ */b("div",{id:E,className:"mt-2 text-sm text-gray-600",children:f}),g&&/* @__PURE__ */b("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:g}),j&&/* @__PURE__ */b("button",{type:"button",onClick:o,"aria-label":R.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */b(i,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}var R=a(()=>Promise.resolve(!1)),W=()=>u(R),O=()=>Promise.resolve(!1),$=e=>O(e),A=()=>Promise.resolve(!1),K=e=>A(e),B=()=>Promise.resolve(null),S=e=>B(e),G={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-blue-100",button:t({variant:"primary"})}},Q=t({variant:"secondary"}),U=t({variant:"primary"}),V="w-full rounded-md border border-gray-300 h-8 px-3 text-sm";function z(){/* @__PURE__ */
4
- return b(i,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function J(){/* @__PURE__ */
5
- return b(i,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function Y({children:e}){const[t,n]=m(!1),[r,i]=m({message:""}),[a,d]=m(0),u=c(),v=c(null),p=c(0),y=c([]),x=c(null),w=c(null),N=f(e=>{v.current=e.id,u.current=e.resolve,d(e.id),i(e.options),n(!0)},[]),k=f(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++p.current,options:t,resolve:e};null===v.current?N(n):y.current.push(n)})},[N]),[C,E]=m(!1),[L,P]=m({message:""}),[j,I]=m(""),D=c(),T=f(e=>(P(e),I(""),E(!0),new Promise(e=>{D.current=e})),[]),[W,$]=m(!1),[K,S]=m({}),[Y,_]=m(""),q=c(),M=f(e=>{const t="string"==typeof e?{message:e}:e;return S(t),_(t.defaultValue??""),$(!0),new Promise(e=>{q.current=e})},[]);s(()=>{O=k,A=T,B=M},[k,T,M]);const Z=(e,t)=>{if(v.current!==e)return;const r=u.current,l=y.current.shift();l?N(l):(v.current=null,u.current=void 0,n(!1)),r?.(t)},H=e=>{E(!1),I(""),D.current?.(e)},X=e=>{if(e){const e=Y.trim();if(!e&&!K.allowEmpty)return $(!1),void q.current?.(null);$(!1),q.current?.(e)}else $(!1),q.current?.(null)},ee=r.variant||(r.confirmLabel?.toLowerCase().includes("delete")||r.message.toLowerCase().includes("delete")?"danger":"info"),te=G[ee],ne=G["warning"===L.variant?"warning":"danger"],re=L.confirmWord,le=null==re||j===re,oe=l().dialog,[ie,ae]=o(oe.typeToConfirm);/* @__PURE__ */
6
- return h(R.Provider,{value:k,children:[e,
7
- /* @__PURE__ */b(F,{open:t,onClose:()=>Z(a,!1),initialFocus:x,footer:/* @__PURE__ */h(g,{children:[
8
- /* @__PURE__ */b("button",{ref:x,type:"button",onClick:()=>Z(a,!1),className:Q,children:r.cancelLabel||oe.cancel}),
9
- /* @__PURE__ */b("button",{type:"button",onClick:()=>Z(a,!0),className:te.button,children:r.confirmLabel||oe.ok})]}),children:/* @__PURE__ */h("div",{className:"flex gap-4",children:[
10
- /* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */b(z,{})}),
3
+ /* @__PURE__ */b("div",{className:"fixed inset-0 flex items-center justify-center p-4",onClick:v?void 0:e=>{e.target===e.currentTarget&&o()},children:/* @__PURE__ */h("div",{ref:C,...D({role:m,modal:!0,titleId:a?O:void 0,labelledBy:w,label:x}),"aria-describedby":N??(u?P:f?E:void 0),className:`relative max-h-full w-full ${F[p]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${k}`.trim(),children:[a&&/* @__PURE__ */b("h2",{id:O,className:(j?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:a}),u&&/* @__PURE__ */b("p",{id:P,className:((a?"mt-1":j?"pr-8":"")+" text-sm text-gray-500").trim(),children:u}),f&&/* @__PURE__ */b("div",{id:E,className:"mt-2 text-sm text-gray-600",children:f}),g&&/* @__PURE__ */b("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:g}),j&&/* @__PURE__ */b("button",{type:"button",onClick:o,"aria-label":T.close,className:"absolute right-3 top-3 rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */b(i,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]}):null}var T=a(()=>Promise.resolve(!1)),W=()=>u(T),K=()=>Promise.resolve(!1),$=e=>K(e),R=()=>Promise.resolve(!1),A=e=>R(e),B=()=>Promise.resolve(null),S=e=>B(e),V={danger:{icon:"text-red-600 bg-red-100",button:t({variant:"danger"})},warning:{icon:"text-yellow-600 bg-yellow-100",button:t({variant:"warning"})},info:{icon:"text-blue-600 bg-blue-100",button:t({variant:"primary"})}},z=t({variant:"secondary"}),G=t({variant:"primary"}),U="w-full rounded-md border border-gray-300 h-8 px-3 text-sm";function Y(){/* @__PURE__ */
4
+ return b(i,{name:"warning",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function Z(){/* @__PURE__ */
5
+ return b(i,{name:"close",className:"h-5 w-5",strokeWidth:1.5,"aria-hidden":"true"})}function _({children:e}){const[t,n]=m(!1),[r,i]=m({message:""}),[a,d]=m(0),u=c(),v=c(null),p=c(0),y=c([]),x=c(null),w=c(null),N=f(e=>{v.current=e.id,u.current=e.resolve,d(e.id),i(e.options),n(!0)},[]),k=f(e=>{const t="string"==typeof e?{message:e}:e;return new Promise(e=>{const n={id:++p.current,options:t,resolve:e};null===v.current?N(n):y.current.push(n)})},[N]),[C,E]=m(!1),[L,P]=m({message:""}),[j,I]=m(""),D=c(),F=f(e=>(P(e),I(""),E(!0),new Promise(e=>{D.current=e})),[]),[W,$]=m(!1),[A,S]=m({}),[_,q]=m(""),J=c(),M=f(e=>{const t="string"==typeof e?{message:e}:e;return S(t),q(t.defaultValue??""),$(!0),new Promise(e=>{J.current=e})},[]);s(()=>{K=k,R=F,B=M},[k,F,M]);const Q=(e,t)=>{if(v.current!==e)return;const r=u.current,l=y.current.shift();l?N(l):(v.current=null,u.current=void 0,n(!1)),r?.(t)},X=e=>{E(!1),I(""),D.current?.(e)},H=e=>{if(e){const e=_.trim();if(!e&&!A.allowEmpty)return $(!1),void J.current?.(null);$(!1),J.current?.(e)}else $(!1),J.current?.(null)},ee=r.variant||(r.confirmLabel?.toLowerCase().includes("delete")||r.message.toLowerCase().includes("delete")?"danger":"info"),te=V[ee],ne=V["warning"===L.variant?"warning":"danger"],re=L.confirmWord,le=null==re||j===re,oe=l().dialog,[ie,ae]=o(oe.typeToConfirm);/* @__PURE__ */
6
+ return h(T.Provider,{value:k,children:[e,
7
+ /* @__PURE__ */b(O,{open:t,onClose:()=>Q(a,!1),initialFocus:x,footer:/* @__PURE__ */h(g,{children:[
8
+ /* @__PURE__ */b("button",{ref:x,type:"button",onClick:()=>Q(a,!1),className:z,children:r.cancelLabel||oe.cancel}),
9
+ /* @__PURE__ */b("button",{type:"button",onClick:()=>Q(a,!0),className:te.button,children:r.confirmLabel||oe.ok})]}),children:/* @__PURE__ */h("div",{className:"flex gap-4",children:[
10
+ /* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${te.icon}`,children:/* @__PURE__ */b(Y,{})}),
11
11
  /* @__PURE__ */h("div",{className:"flex-1",children:[
12
12
  /* @__PURE__ */b("h2",{className:"text-base font-semibold text-gray-900",children:r.title||oe.confirmTitle}),
13
13
  /* @__PURE__ */b("p",{className:"mt-2 text-sm text-gray-600",children:r.message})]})]})}),
14
- /* @__PURE__ */h(F,{open:C,onClose:()=>H(!1),initialFocus:null!=re?void 0:w,footer:/* @__PURE__ */h(g,{children:[
15
- /* @__PURE__ */b("button",{ref:w,type:"button",onClick:()=>H(!1),className:Q,children:L.cancelLabel||oe.destructiveCancel}),
16
- /* @__PURE__ */b("button",{type:"button",onClick:()=>H(!0),disabled:!le,className:ne.button,children:re??L.confirmLabel??oe.destructiveConfirm})]}),children:[
17
- /* @__PURE__ */b("button",{type:"button",onClick:()=>H(!1),"aria-label":oe.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */b(J,{})}),
14
+ /* @__PURE__ */h(O,{open:C,onClose:()=>X(!1),initialFocus:null!=re?void 0:w,footer:/* @__PURE__ */h(g,{children:[
15
+ /* @__PURE__ */b("button",{ref:w,type:"button",onClick:()=>X(!1),className:z,children:L.cancelLabel||oe.destructiveCancel}),
16
+ /* @__PURE__ */b("button",{type:"button",onClick:()=>X(!0),disabled:!le,className:ne.button,children:re??L.confirmLabel??oe.destructiveConfirm})]}),children:[
17
+ /* @__PURE__ */b("button",{type:"button",onClick:()=>X(!1),"aria-label":oe.close,className:"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:/* @__PURE__ */b(Z,{})}),
18
18
  /* @__PURE__ */h("div",{className:"flex gap-4",children:[
19
- /* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */b(z,{})}),
19
+ /* @__PURE__ */b("div",{className:`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${ne.icon}`,children:/* @__PURE__ */b(Y,{})}),
20
20
  /* @__PURE__ */h("div",{className:"flex-1",children:[
21
21
  /* @__PURE__ */b("h2",{className:"text-base font-semibold text-gray-900 pr-6",children:L.title||oe.destructiveTitle}),
22
22
  /* @__PURE__ */b("p",{className:"mt-2 text-sm text-gray-600",children:L.message}),null!=re&&/* @__PURE__ */h(g,{children:[
23
23
  /* @__PURE__ */h("p",{className:"mt-3 text-sm text-gray-700",children:[ie,
24
24
  /* @__PURE__ */b("kbd",{className:"rounded border border-gray-300 bg-gray-50 px-2 py-0.5 text-xs font-bold text-red-600 font-mono",children:re}),ae]}),
25
- /* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:j,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===re&&H(!0)},placeholder:re,className:`mt-2 ${V} focus:border-red-500`})]})]})]})]}),
26
- /* @__PURE__ */h(F,{open:W,onClose:()=>X(!1),title:K.title||oe.promptTitle,footer:/* @__PURE__ */h(g,{children:[
27
- /* @__PURE__ */b("button",{type:"button",onClick:()=>X(!1),className:Q,children:K.cancelLabel||oe.cancel}),
28
- /* @__PURE__ */b("button",{type:"button",onClick:()=>X(!0),disabled:!K.allowEmpty&&!Y.trim(),className:U,children:K.confirmLabel||oe.ok})]}),children:[K.message&&/* @__PURE__ */b("p",{className:"text-sm text-gray-600",children:K.message}),
29
- /* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:Y,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"===e.key?X(!0):"Escape"===e.key&&X(!1)},onFocus:e=>e.target.select(),placeholder:K.placeholder,className:`mt-3 ${V} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{Y as ConfirmProvider,F as Dialog,$ as confirm,K as confirmDestructive,D as dialogA11y,k as focusableIn,S as prompt,E as stopAfter,W as useConfirm,L as useFocusTrap,I as useScrollLock,C as useTabLayer};
25
+ /* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:j,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key&&j===re&&X(!0)},placeholder:re,className:`mt-2 ${U} focus:border-red-500`})]})]})]})]}),
26
+ /* @__PURE__ */h(O,{open:W,onClose:()=>H(!1),title:A.title||oe.promptTitle,footer:/* @__PURE__ */h(g,{children:[
27
+ /* @__PURE__ */b("button",{type:"button",onClick:()=>H(!1),className:z,children:A.cancelLabel||oe.cancel}),
28
+ /* @__PURE__ */b("button",{type:"button",onClick:()=>H(!0),disabled:!A.allowEmpty&&!_.trim(),className:G,children:A.confirmLabel||oe.ok})]}),children:[A.message&&/* @__PURE__ */b("p",{className:"text-sm text-gray-600",children:A.message}),
29
+ /* @__PURE__ */b("input",{autoFocus:!0,type:"text",value:_,onChange:e=>q(e.target.value),onKeyDown:e=>{"Enter"===e.key?H(!0):"Escape"===e.key&&H(!1)},onFocus:e=>e.target.select(),placeholder:A.placeholder,className:`mt-3 ${U} focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]`})]})]})}export{_ as ConfirmProvider,O as Dialog,$ as confirm,A as confirmDestructive,D as dialogA11y,k as focusableIn,S as prompt,E as stopAfter,W as useConfirm,L as useFocusTrap,I as useScrollLock,C as useTabLayer};
@@ -1,4 +1,4 @@
1
- import{navIcons as e}from"./chunk-DSSLOQDW.js";import{Icon as t}from"./chunk-ZGUQLVY4.js";import{isValidElement as r,cloneElement as n}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var l=["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 a(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return l[Math.abs(t)%l.length]}var d={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"},s={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"},c={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},f={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
1
+ import{navIcons as e}from"./chunk-DSSLOQDW.js";import{Icon as t}from"./chunk-B427NVDP.js";import{isValidElement as r,cloneElement as n}from"react";import{jsx as o,jsxs as i}from"react/jsx-runtime";var l=["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 a(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r);return l[Math.abs(t)%l.length]}var d={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"},s={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"},c={pdf:"PDF",dxf:"DXF","3d":"STP",image:"IMG",csv:"CSV"},f={pdf:"text-red-600",dxf:"text-blue-600","3d":"text-purple-600",image:"text-emerald-600",csv:"text-green-600"};function p({className:e}){/* @__PURE__ */
2
2
  return o(t,{name:"folder",look:"solid",className:e})}function u(t,r){return r&&e[r]||(t?e[t]:void 0)}var m=/* @__PURE__ */o("svg",{className:"h-7 w-7",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */o("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 h({entityType:e,isSelected:t,entityId:l,label:h,fileKind:w}){const g="preview-file"===e&&w,y=g?f[w]:null,x=g?c[w]:null;if("folder"===e)/* @__PURE__ */
3
3
  return o("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__ */o(p,{className:"h-12 w-12 text-amber-500 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]"})});if("page"===e){const e=u(l,h),i=a(l||h||"page");/* @__PURE__ */
4
4
  return o("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__ */o("span",{className:`h-11 w-11 rounded-xl bg-gradient-to-br ${i} flex items-center justify-center text-white border border-white/30 drop-shadow-[0_2px_3px_rgba(0,0,0,0.3)]`,children:e&&r(e)?n(e,{className:"h-7 w-7 text-white"}):m})})}/* @__PURE__ */
@@ -10,4 +10,4 @@ return i("div",{className:"w-12 h-12 relative flex items-center justify-center "
10
10
  /* @__PURE__ */o("span",{className:`absolute inset-0 flex items-center justify-center text-3xs font-bold pt-2 ${y??d[e]??"text-gray-600"}`,children:x??s[e]??e.slice(0,3).toUpperCase()})]})}function w({item:e}){if("folder"===e.entityType)/* @__PURE__ */
11
11
  return o(p,{className:"h-4 w-4 shrink-0 text-amber-500"});if("page"===e.entityType){const t=u(e.entityId,e.label);/* @__PURE__ */
12
12
  return o("span",{className:`h-4 w-4 rounded bg-gradient-to-br ${a(e.entityId||e.label||"page")} flex items-center justify-center text-white shrink-0`,children:t&&r(t)?n(t,{className:"h-3 w-3 text-white"}):/* @__PURE__ */o("span",{className:"h-1.5 w-1.5 rounded-[2px] border border-white/80"})})}const i=("preview-file"===e.entityType&&e.fileKind?f[e.fileKind]:d[e.entityType])??"text-gray-400";/* @__PURE__ */
13
- return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",j="react-os-shell:files-open-desktop-folder";function C(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function S(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(j,{detail:{folderId:e}})))}function I(){if("undefined"==typeof window)return null;const e=window[k];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function T(){const e=I();return"undefined"!=typeof window&&(window[k]=null),e}export{w as DesktopItemMiniIcon,j as FILES_OPEN_DESKTOP_FOLDER_EVENT,N as FILES_SHOW_TRASH_EVENT,h as FileIconTile,p as FolderGlyph,T as consumeFilesViewRequest,g as desktopItemTypeLabel,_ as getDesktopFoldersSnapshot,I as peekFilesViewRequest,b as publishDesktopFolders,S as requestFilesDesktopFolderView,C as requestFilesTrashView,v as subscribeDesktopFolders};
13
+ return o(t,{name:"page",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:1.5})}function g(e){return"preview-file"===e.entityType&&e.fileKind?c[e.fileKind]:"page"===e.entityType?"App":"folder"===e.entityType?"Folder":s[e.entityType]??e.entityType.slice(0,3).toUpperCase()}var y=null,x=/* @__PURE__ */new Set;function b(e){y=e,x.forEach(e=>e())}function v(e){return x.add(e),()=>{x.delete(e)}}function _(){return y}var k="__REACT_OS_SHELL_FILES_VIEW__",N="react-os-shell:files-show-trash",j="react-os-shell:files-open-desktop-folder";function C(){"undefined"!=typeof window&&(window[k]="trash",window.dispatchEvent(new CustomEvent(N)))}function S(e){"undefined"!=typeof window&&(window[k]={view:"desktop-folder",folderId:e},window.dispatchEvent(new CustomEvent(j,{detail:{folderId:e}})))}function I(){if("undefined"==typeof window)return null;const e=window[k];return"trash"===e?"trash":e&&"object"==typeof e&&"desktop-folder"===e.view&&"string"==typeof e.folderId?e:null}function P(){const e=I();return"undefined"!=typeof window&&(window[k]=null),e}export{w as DesktopItemMiniIcon,j as FILES_OPEN_DESKTOP_FOLDER_EVENT,N as FILES_SHOW_TRASH_EVENT,h as FileIconTile,p as FolderGlyph,P as consumeFilesViewRequest,g as desktopItemTypeLabel,_ as getDesktopFoldersSnapshot,I as peekFilesViewRequest,b as publishDesktopFolders,S as requestFilesDesktopFolderView,C as requestFilesTrashView,v as subscribeDesktopFolders};
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-7LRJBINZ.js";import{keepsNativeMenu as a}from"./chunk-IQDY2YFN.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
1
+ import{Modal as e}from"./chunk-4M7DEG4E.js";import{keepsNativeMenu as a}from"./chunk-GNW45MGV.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
2
2
  return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
3
3
  /* @__PURE__ */n("div",{children:[
4
4
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
@@ -1,4 +1,4 @@
1
- import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-QRCDQPJA.js";import{Icon as n}from"./chunk-ZGUQLVY4.js";import{createContext as o,useSyncExternalStore as i,useCallback as a,useContext as s,useMemo as c}from"react";import{jsxs as l,jsx as u}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)";function f(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function m(){return!1}function h(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(d);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function w(){return i(h,f,m)}var g={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},p={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},y={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function v({tone:e}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
1
+ import{useHydrated as e,useBrowserState as t}from"./chunk-D65T4H6J.js";import{useShellStrings as r}from"./chunk-4EIZZYLK.js";import{Icon as n}from"./chunk-B427NVDP.js";import{createContext as o,useSyncExternalStore as i,useCallback as a,useContext as s,useMemo as c}from"react";import{jsxs as l,jsx as u}from"react/jsx-runtime";var d="(max-width: 767px), (pointer: coarse)";function f(){return!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia(d).matches}function m(){return!1}function h(e){if("undefined"==typeof window||!window.matchMedia)return()=>{};const t=window.matchMedia(d);return t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function w(){return i(h,f,m)}var g={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},p={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},y={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function v({tone:e}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
2
2
  return u(n,{name:"check",...t});case"error":/* @__PURE__ */
3
3
  return u(n,{name:"close",...t});case"warning":/* @__PURE__ */
4
4
  return u(n,{name:"error",...t});default:/* @__PURE__ */
@@ -6,6 +6,6 @@ return u(n,{name:"info",...t})}}function x({status:e="info",title:t,subTitle:n,e
6
6
  return l("div",{role:"error"===c?"alert":void 0,className:`flex flex-col items-center justify-center px-6 py-12 text-center ${s}`.trim(),children:[
7
7
  /* @__PURE__ */u("div",{className:`flex h-14 w-14 items-center justify-center rounded-full ${p[c]}`,children:i??/* @__PURE__ */u(v,{tone:c})}),
8
8
  /* @__PURE__ */u("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t??y[e]?.(d)??""}),n&&/* @__PURE__ */u("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:n}),a&&/* @__PURE__ */u("div",{className:"mt-4 w-full max-w-md text-left",children:a}),o&&/* @__PURE__ */u("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:o})]})}function b({size:e="md",padding:t="py-12",label:r,className:n=""}){const o=/* @__PURE__ */u("div",{className:`${"sm"===e?"h-5 w-5":"lg"===e?"h-12 w-12":"h-8 w-8"} animate-spin rounded-full border-2 border-gray-200 border-t-blue-600`});return null==r?/* @__PURE__ */u("div",{className:`flex items-center justify-center ${t} ${n}`,children:o}):/* @__PURE__ */l("div",{role:"status",className:`flex flex-col items-center justify-center gap-3 ${t} ${n}`,children:[o,
9
- /* @__PURE__ */u("p",{className:"text-sm text-gray-500",children:r})]})}var _="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),C={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},D=_?0:1,N=C.MOD[D],S=C.ALT[D],E="⇧",L="⏎",M=C.CMD_ENTER[D],T=C.CMD_S[D],A=C.CMD_K[D],k=C.CMD_DOT[D],j=C.CMD_A[D],I=C.CMD_Z[D],H=C.CMD_SHIFT_Z[D],F=C.ALT_SHIFT_D[D],Z=C.ALT_SHIFT_E[D],P=C.ALT_SHIFT_N[D],O=new Map(_?Object.values(C).map(([e,t])=>[e,t]):[]);function $(t){return e()?t:O.get(t)??t}var R={neutral:"inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},z={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function J({keys:e,size:t="md",tone:r="neutral",className:n=""}){const o=$(e);/* @__PURE__ */
10
- return u("kbd",{className:[R[r],z[t],n].filter(Boolean).join(" "),children:o})}var K=o(null);function U({value:e,children:t}){/* @__PURE__ */
11
- return u(K.Provider,{value:e,children:t})}function Q(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:a(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var W={prefs:{},save:()=>{}};function B(){return s(K)??W}function G(){const{prefs:e,save:t}=B(),r=a(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return c(()=>({prefs:e,save:r}),[e,r])}var V="react-os-shell:stale-chunk-reload-at",Y=3e4,q="vite:preloadError",X="/_next/static/",ee=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function te(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return ee.test(t)}function re(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(V),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?X:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(V),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(V,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;te(t)&&a(t)&&(e.preventDefault(),r())};let c=!0,l=!1;const u=/* @__PURE__ */new Set,d=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||l||u.has(t)||(u.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{u.delete(t),e&&c&&!l&&a(t)&&(l=!0,r())}))};return window.addEventListener(q,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(q,s),d&&window.removeEventListener("error",d,!0)}}export{S as ALT,F as ALT_SHIFT_D,Z as ALT_SHIFT_E,P as ALT_SHIFT_N,j as CMD_A,k as CMD_DOT,M as CMD_ENTER,A as CMD_K,T as CMD_S,H as CMD_SHIFT_Z,I as CMD_Z,L as ENTER,J as Kbd,b as LoadingSpinner,N as MOD,X as NEXT_CHUNK_PATH_PREFIX,x as Result,E as SHIFT,Y as STALE_CHUNK_RELOAD_COOLDOWN_MS,V as STALE_CHUNK_RELOAD_KEY,U as ShellPrefsProvider,q as VITE_PRELOAD_ERROR_EVENT,re as installStaleChunkReload,_ as isMac,te as isStaleChunkError,w as useIsMobile,Q as useLocalStoragePrefs,G as useShellPrefs,B as useShellPrefsAdapter,$ as useShortcutLabel};
9
+ /* @__PURE__ */u("p",{className:"text-sm text-gray-500",children:r})]})}var _="undefined"!=typeof window&&"undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),N={MOD:["⌘","Ctrl"],ALT:["⌥","Alt"],CMD_ENTER:["⌘⏎","Ctrl⏎"],CMD_S:["⌘S","Ctrl+S"],CMD_K:["⌘K","Ctrl+K"],CMD_DOT:["⌘.","Ctrl+."],CMD_A:["⌘A","Ctrl+A"],CMD_Z:["⌘Z","Ctrl+Z"],CMD_SHIFT_Z:["⌘⇧Z","Ctrl+Shift+Z"],ALT_SHIFT_D:["⌥⇧D","Alt+Shift+D"],ALT_SHIFT_E:["⌥⇧E","Alt+Shift+E"],ALT_SHIFT_N:["⌥⇧N","Alt+Shift+N"]},D=_?0:1,E=N.MOD[D],S=N.ALT[D],C="⇧",L="⏎",M=N.CMD_ENTER[D],T=N.CMD_S[D],A=N.CMD_K[D],k=N.CMD_DOT[D],I=N.CMD_A[D],j=N.CMD_Z[D],H=N.CMD_SHIFT_Z[D],F=N.ALT_SHIFT_D[D],Z=N.ALT_SHIFT_E[D],P=N.ALT_SHIFT_N[D],O=new Map(_?Object.values(N).map(([e,t])=>[e,t]):[]);function $(t){return e()?t:O.get(t)??t}var K={neutral:"inline-flex items-center justify-center rounded border border-gray-200 bg-gray-50 font-medium text-gray-500",accent:"inline-flex items-center justify-center rounded border kbd-submit font-medium",warning:"inline-flex items-center justify-center rounded border border-amber-300 bg-amber-100 font-medium"},z={sm:"px-1 py-0.5 text-2xs",md:"px-2 py-0.5 text-2xs"};function R({keys:e,size:t="md",tone:r="neutral",className:n=""}){const o=$(e);/* @__PURE__ */
10
+ return u("kbd",{className:[K[r],z[t],n].filter(Boolean).join(" "),children:o})}var J=o(null);function U({value:e,children:t}){/* @__PURE__ */
11
+ return u(J.Provider,{value:e,children:t})}function B(e="react-os-shell:prefs",r){const[n,o]=t(()=>{try{const t=JSON.parse(localStorage.getItem(e)||"{}");return{...r??{},...t}}catch{return{...r??{}}}},{...r??{}});return{prefs:n,save:a(t=>{o(r=>{const n={...r,...t};try{localStorage.setItem(e,JSON.stringify(n))}catch{}return n})},[e])}}var W={prefs:{},save:()=>{}};function V(){return s(J)??W}function Y(){const{prefs:e,save:t}=V(),r=a(e=>{const r=t(e);return r&&"function"==typeof r.then?r.catch(()=>{}):r},[t]);return c(()=>({prefs:e,save:r}),[e,r])}var q="react-os-shell:stale-chunk-reload-at",G=3e4,Q="vite:preloadError",X="/_next/static/",ee=/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed|Unable to preload CSS/i;function te(e){if(e instanceof Error&&"ChunkLoadError"===e.name)return!0;const t=e instanceof Error?e.message:"string"==typeof e?e:"";return ee.test(t)}function re(e={}){if("undefined"==typeof window)return()=>{};const t=e.cooldownMs??3e4,r=e.reload??(()=>window.location.reload()),n=e.now??Date.now,o=void 0===e.storage?function(){try{const e=window.sessionStorage;return e.getItem(q),e}catch{return null}}():e.storage,i=void 0===e.chunkPathPrefix?X:e.chunkPathPrefix,a=e=>{const r=n(),i=function(e){if(!e)return null;try{const t=e.getItem(q),r=null===t?NaN:Number(t);return Number.isFinite(r)?r:null}catch{return null}}(o);return null!==i&&r-i<t?(console.error("[efficient-shell] a lazy chunk is still missing after a reload; letting the failure through:",e),!1):(function(e,t){if(e)try{e.setItem(q,String(t))}catch{}}(o,r),console.warn("[efficient-shell] a lazy chunk is no longer on the server (new deploy?); reloading onto the current build:",e),!0)},s=e=>{const t=e.payload;te(t)&&a(t)&&(e.preventDefault(),r())};let c=!0,l=!1;const u=/* @__PURE__ */new Set,d=null===i?null:e=>{const t=function(e,t){const r=e.target;let n="";if(r instanceof window.HTMLScriptElement?n=r.src:r instanceof window.HTMLLinkElement&&function(e){const t=e.rel.toLowerCase().split(/\s+/);if(t.includes("stylesheet")||t.includes("modulepreload"))return!0;const r=(e.getAttribute("as")??"").toLowerCase();return t.includes("preload")&&("script"===r||"style"===r)}(r)?n=r.href:e instanceof window.ErrorEvent&&"SyntaxError"===e.error?.name&&(n=e.filename),!n)return null;try{const e=new URL(t,window.location.origin).href,r=new URL(n,window.location.href).href;return r.startsWith(e)?r:null}catch{return null}}(e,i);!t||l||u.has(t)||(u.add(t),async function(e){try{const t=await fetch(e,{method:"HEAD",cache:"no-store"});return 404===t.status||410===t.status||t.ok&&/\btext\/html\b/i.test(t.headers.get("content-type")??"")}catch{return!1}}(t).then(e=>{u.delete(t),e&&c&&!l&&a(t)&&(l=!0,r())}))};return window.addEventListener(Q,s),d&&window.addEventListener("error",d,!0),()=>{c=!1,window.removeEventListener(Q,s),d&&window.removeEventListener("error",d,!0)}}export{S as ALT,F as ALT_SHIFT_D,Z as ALT_SHIFT_E,P as ALT_SHIFT_N,I as CMD_A,k as CMD_DOT,M as CMD_ENTER,A as CMD_K,T as CMD_S,H as CMD_SHIFT_Z,j as CMD_Z,L as ENTER,R as Kbd,b as LoadingSpinner,E as MOD,X as NEXT_CHUNK_PATH_PREFIX,x as Result,C as SHIFT,G as STALE_CHUNK_RELOAD_COOLDOWN_MS,q as STALE_CHUNK_RELOAD_KEY,U as ShellPrefsProvider,Q as VITE_PRELOAD_ERROR_EVENT,re as installStaleChunkReload,_ as isMac,te as isStaleChunkError,w as useIsMobile,B as useLocalStoragePrefs,Y as useShellPrefs,V as useShellPrefsAdapter,$ as useShortcutLabel};