efficient-shell 4.134.0 → 4.137.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/LICENSE +6 -17
  2. package/README.md +84 -8
  3. package/dist/Browser-ZX5OTOKK.js +43 -0
  4. package/dist/Calculator-4SQGOQFQ.js +29 -0
  5. package/dist/ConfirmDialog-NPKW2XHM.js +1 -0
  6. package/dist/CurrencyConverter-2KOM7L6V.js +21 -0
  7. package/dist/Documents-IZTIQYPG.js +52 -0
  8. package/dist/Files-B63KKXGZ.js +89 -0
  9. package/dist/Notepad-WA77V45J.js +25 -0
  10. package/dist/PdfViewer-RBRGEKWF.js +1 -0
  11. package/dist/PomodoroTimer-SDUBKXUS.js +99 -0
  12. package/dist/Preview-D4KOA4OI.js +187 -0
  13. package/dist/Sidebar-Y57LYXXI.js +23 -0
  14. package/dist/Spreadsheet-JX5E6WH6.js +37 -0
  15. package/dist/Stock-XAQ5WMUZ.js +16 -0
  16. package/dist/Weather-HLAGJ5LV.js +60 -0
  17. package/dist/WorldClock-IRI4VCTA.js +32 -0
  18. package/dist/apps/index.js +1 -151
  19. package/dist/brand.css +1 -1
  20. package/dist/chunk-3A46NCXK.js +29 -0
  21. package/dist/chunk-44UO7FYU.js +11 -0
  22. package/dist/chunk-466CM2TJ.js +1 -0
  23. package/dist/chunk-57MIENLJ.js +1 -0
  24. package/dist/chunk-5CRAF2AD.js +2 -0
  25. package/dist/chunk-A2OQLLYK.js +6 -0
  26. package/dist/chunk-B43AGQET.js +4 -0
  27. package/dist/chunk-BR22X7E5.js +1 -0
  28. package/dist/chunk-BUTSU7FO.js +1 -0
  29. package/dist/chunk-D65T4H6J.js +1 -0
  30. package/dist/chunk-ESL5TDNA.js +1 -0
  31. package/dist/chunk-FBDZGO3V.js +1 -0
  32. package/dist/chunk-FHTLC7HH.js +1 -0
  33. package/dist/chunk-FQLMX3IE.js +948 -0
  34. package/dist/chunk-H562R4GX.js +34 -0
  35. package/dist/chunk-JN4WXTWJ.js +106 -0
  36. package/dist/chunk-LVDRBRYU.js +1 -0
  37. package/dist/chunk-LWLCNQY7.js +1 -0
  38. package/dist/chunk-MAIHBBWT.js +1 -0
  39. package/dist/chunk-NPJH5MD7.js +13 -0
  40. package/dist/chunk-OCSOMMY2.js +1 -0
  41. package/dist/chunk-OQDWLHZI.js +1 -0
  42. package/dist/chunk-OWSAMA3I.js +23 -0
  43. package/dist/chunk-PH3PRIFP.js +5 -0
  44. package/dist/chunk-TAWKWSPN.js +9 -0
  45. package/dist/chunk-U4GTZPXP.js +1 -0
  46. package/dist/chunk-UB4JIOLD.js +2 -0
  47. package/dist/chunk-UZAJ5BF6.js +9 -0
  48. package/dist/chunk-VEGMDXT4.js +1 -0
  49. package/dist/chunk-VTVSMRFX.js +1 -0
  50. package/dist/chunk-VVAGSKW7.js +1 -0
  51. package/dist/chunk-XO43FJRM.js +19 -0
  52. package/dist/chunk-Y7BOLDRM.js +69 -0
  53. package/dist/file-intake/index.js +1 -4
  54. package/dist/{index-DZ7E7bCl.d.ts → index-DVI9DMSu.d.ts} +189 -18
  55. package/dist/index.d.ts +2 -2
  56. package/dist/index.js +639 -7473
  57. package/dist/map/index.js +20 -540
  58. package/dist/markdown/index.js +6 -184
  59. package/dist/markup/index.js +1 -135
  60. package/dist/page-tabs/index.js +21 -709
  61. package/dist/sounds-OMHXVVQ4.js +1 -0
  62. package/dist/ui/index.d.ts +1 -1
  63. package/dist/ui/index.js +1 -19
  64. package/dist/ui.css +78 -10
  65. package/package.json +4 -3
  66. package/dist/Browser-O3QZGUF2.js +0 -482
  67. package/dist/Browser-O3QZGUF2.js.map +0 -1
  68. package/dist/Calculator-L6N5X3KU.js +0 -192
  69. package/dist/Calculator-L6N5X3KU.js.map +0 -1
  70. package/dist/ConfirmDialog-LYSSZSUD.js +0 -4
  71. package/dist/ConfirmDialog-LYSSZSUD.js.map +0 -1
  72. package/dist/CurrencyConverter-64MKXB3D.js +0 -236
  73. package/dist/CurrencyConverter-64MKXB3D.js.map +0 -1
  74. package/dist/Documents-5WXXYCLI.js +0 -441
  75. package/dist/Documents-5WXXYCLI.js.map +0 -1
  76. package/dist/Files-AUURUUDN.js +0 -805
  77. package/dist/Files-AUURUUDN.js.map +0 -1
  78. package/dist/Notepad-GPXJVPB7.js +0 -410
  79. package/dist/Notepad-GPXJVPB7.js.map +0 -1
  80. package/dist/PdfViewer-HKO6P4SR.js +0 -5
  81. package/dist/PdfViewer-HKO6P4SR.js.map +0 -1
  82. package/dist/PomodoroTimer-4TQBWLP2.js +0 -633
  83. package/dist/PomodoroTimer-4TQBWLP2.js.map +0 -1
  84. package/dist/Preview-FOZYPKM2.js +0 -2959
  85. package/dist/Preview-FOZYPKM2.js.map +0 -1
  86. package/dist/Sidebar-BPU7RCZP.js +0 -291
  87. package/dist/Sidebar-BPU7RCZP.js.map +0 -1
  88. package/dist/Spreadsheet-3C66BBBF.js +0 -519
  89. package/dist/Spreadsheet-3C66BBBF.js.map +0 -1
  90. package/dist/Stock-IF4IHYLU.js +0 -158
  91. package/dist/Stock-IF4IHYLU.js.map +0 -1
  92. package/dist/Weather-725PFR7T.js +0 -431
  93. package/dist/Weather-725PFR7T.js.map +0 -1
  94. package/dist/WorldClock-UU4NZIQ7.js +0 -202
  95. package/dist/WorldClock-UU4NZIQ7.js.map +0 -1
  96. package/dist/apps/index.js.map +0 -1
  97. package/dist/chunk-2TPTHAKI.js +0 -316
  98. package/dist/chunk-2TPTHAKI.js.map +0 -1
  99. package/dist/chunk-4P44JXDS.js +0 -195
  100. package/dist/chunk-4P44JXDS.js.map +0 -1
  101. package/dist/chunk-5O42JXQE.js +0 -26
  102. package/dist/chunk-5O42JXQE.js.map +0 -1
  103. package/dist/chunk-72CQWN7O.js +0 -547
  104. package/dist/chunk-72CQWN7O.js.map +0 -1
  105. package/dist/chunk-7CCHEEYC.js +0 -94
  106. package/dist/chunk-7CCHEEYC.js.map +0 -1
  107. package/dist/chunk-BE7FZOFU.js +0 -17
  108. package/dist/chunk-BE7FZOFU.js.map +0 -1
  109. package/dist/chunk-D276EMXS.js +0 -57
  110. package/dist/chunk-D276EMXS.js.map +0 -1
  111. package/dist/chunk-D7PYW2QS.js +0 -265
  112. package/dist/chunk-D7PYW2QS.js.map +0 -1
  113. package/dist/chunk-DVZWYWSD.js +0 -26
  114. package/dist/chunk-DVZWYWSD.js.map +0 -1
  115. package/dist/chunk-ET6ID4LP.js +0 -102
  116. package/dist/chunk-ET6ID4LP.js.map +0 -1
  117. package/dist/chunk-GA35NEND.js +0 -56
  118. package/dist/chunk-GA35NEND.js.map +0 -1
  119. package/dist/chunk-GIGV2ZRW.js +0 -70
  120. package/dist/chunk-GIGV2ZRW.js.map +0 -1
  121. package/dist/chunk-IPXN646P.js +0 -14
  122. package/dist/chunk-IPXN646P.js.map +0 -1
  123. package/dist/chunk-IRWSRJ4K.js +0 -48
  124. package/dist/chunk-IRWSRJ4K.js.map +0 -1
  125. package/dist/chunk-IULP5BCD.js +0 -79
  126. package/dist/chunk-IULP5BCD.js.map +0 -1
  127. package/dist/chunk-MGGY74RY.js +0 -14
  128. package/dist/chunk-MGGY74RY.js.map +0 -1
  129. package/dist/chunk-OLJDJYSU.js +0 -13678
  130. package/dist/chunk-OLJDJYSU.js.map +0 -1
  131. package/dist/chunk-PIGDNN5F.js +0 -46
  132. package/dist/chunk-PIGDNN5F.js.map +0 -1
  133. package/dist/chunk-Q2MJVSJT.js +0 -7
  134. package/dist/chunk-Q2MJVSJT.js.map +0 -1
  135. package/dist/chunk-Q3LT745N.js +0 -3710
  136. package/dist/chunk-Q3LT745N.js.map +0 -1
  137. package/dist/chunk-QAGQRNKI.js +0 -145
  138. package/dist/chunk-QAGQRNKI.js.map +0 -1
  139. package/dist/chunk-QRL64J5F.js +0 -503
  140. package/dist/chunk-QRL64J5F.js.map +0 -1
  141. package/dist/chunk-QSKCQUZE.js +0 -1103
  142. package/dist/chunk-QSKCQUZE.js.map +0 -1
  143. package/dist/chunk-R4OQIQYX.js +0 -153
  144. package/dist/chunk-R4OQIQYX.js.map +0 -1
  145. package/dist/chunk-RT6DSB5Y.js +0 -143
  146. package/dist/chunk-RT6DSB5Y.js.map +0 -1
  147. package/dist/chunk-SHQM5CK3.js +0 -549
  148. package/dist/chunk-SHQM5CK3.js.map +0 -1
  149. package/dist/chunk-T4VQHMG4.js +0 -822
  150. package/dist/chunk-T4VQHMG4.js.map +0 -1
  151. package/dist/chunk-TRCWINHF.js +0 -105
  152. package/dist/chunk-TRCWINHF.js.map +0 -1
  153. package/dist/chunk-TW7LPMVR.js +0 -16
  154. package/dist/chunk-TW7LPMVR.js.map +0 -1
  155. package/dist/chunk-W622KQTD.js +0 -465
  156. package/dist/chunk-W622KQTD.js.map +0 -1
  157. package/dist/chunk-X4Q6G253.js +0 -416
  158. package/dist/chunk-X4Q6G253.js.map +0 -1
  159. package/dist/chunk-YNKK7NE3.js +0 -171
  160. package/dist/chunk-YNKK7NE3.js.map +0 -1
  161. package/dist/chunk-YPO6RDMX.js +0 -20
  162. package/dist/chunk-YPO6RDMX.js.map +0 -1
  163. package/dist/file-intake/index.js.map +0 -1
  164. package/dist/index.js.map +0 -1
  165. package/dist/map/index.js.map +0 -1
  166. package/dist/markdown/index.js.map +0 -1
  167. package/dist/markup/index.js.map +0 -1
  168. package/dist/page-tabs/index.js.map +0 -1
  169. package/dist/sounds-NT4DEZGD.js +0 -3
  170. package/dist/sounds-NT4DEZGD.js.map +0 -1
  171. package/dist/ui/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ import{currentShellStrings as t}from"./chunk-OQDWLHZI.js";var e="http://www.w3.org/2000/svg",n={},o=/* @__PURE__ */new Map;function s(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var r={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",loading:"M12 3a9 9 0 019 9",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function i(t,n){const o=document.createElementNS(e,"svg");o.setAttribute("class",n),o.setAttribute("fill","none"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2");const s=document.createElementNS(e,"path");return s.setAttribute("stroke-linecap","round"),"loading"!==t&&s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",r[t]),o.appendChild(s),o}function a(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function c(t,e,r){const c={...n,...r},l=c.placement??"top",d=c.sticky??!1,u=`${l}|${t}|${e}`;if(c.dedupe){const t=o.get(u);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==t&&import("./sounds-OMHXVVQ4.js").then(e=>{"success"===t?e.playSuccess():"error"===t?e.playError():e.playNotification()}).catch(()=>{});const m="bottom"===l?s("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col-reverse gap-2 items-center pointer-events-none"):s("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col gap-2 items-center pointer-events-none"),p="bottom"===l?"translateY(10px)":"translateY(-10px)",f=a("pointer-events-auto cursor-pointer rosh-toast");f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,f.setAttribute("role","error"===t?"alert":"status"),f.setAttribute("aria-atomic","true"),f.appendChild(i(t,`h-4 w-4 rosh-tone-${t}${"loading"===t?" animate-spin":""}`));const h=document.createElement("span");let y;h.textContent=e,f.appendChild(h),m.appendChild(f),requestAnimationFrame(()=>{f.style.opacity="1",f.style.transform="translateY(0) scale(1)"});let v=!1;const g=()=>{v||(v=!0,y&&clearTimeout(y),o.delete(u),f.style.opacity="0",f.style.transform=`${p} scale(0.95)`,setTimeout(()=>f.remove(),300))},b=c.duration??("info"===t?4500:3e3),x=()=>{y&&clearTimeout(y),d||(y=setTimeout(g,b))};return x(),f.addEventListener("mouseenter",()=>{y&&clearTimeout(y)}),f.addEventListener("mouseleave",()=>{v||x()}),f.addEventListener("click",g),o.set(u,{el:f,restart:x,dismiss:g}),{dismiss:g}}var l={success:(t,e)=>c("success",t,e),error:(t,e)=>c("error",t,e),warning:(t,e)=>c("warning",t,e),info:(t,e)=>c("info",t,e),notify:(e,n)=>function(e,n){import("./sounds-OMHXVVQ4.js").then(t=>t.playNotification()).catch(()=>{});const o=s("notif-container","fixed top-4 right-4 z-[9999] flex flex-col gap-3 items-end pointer-events-none"),r=a("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const c=a("rosh-notif-badge");c.appendChild(i("bell","h-5 w-5"));const l=a("rosh-notif-body");l.append(a("rosh-notif-title",t().toast.notification),a("notif-msg rosh-notif-msg",e));const d=document.createElement("button");d.className="rosh-notif-close",d.textContent="×",r.append(c,l,d);const u=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};d.addEventListener("click",t=>{t.stopPropagation(),u()}),r.addEventListener("click",u),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(u,n?.duration??1e4)}(e,n),promise:(t,e,n)=>{const o=c("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),c("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),c("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{n={...t}}};export{l as toast_default};
@@ -0,0 +1 @@
1
+ var t="react-os-shell:spreadsheet-preview-update",e=null,n=0;function a(a){const d=++n,o={token:d,data:a};return e=o,{update(n){e===o&&(o.data=n),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(t,{detail:{token:d,data:n}}))}}}function d(){return e}function o(t){e===t&&(e=null)}export{t as SPREADSHEET_PREVIEW_UPDATE_EVENT,o as claimSpreadsheetPreviewStage,d as peekSpreadsheetPreviewStage,a as setSpreadsheetPreview};
@@ -0,0 +1 @@
1
+ import{DEFAULT_SHELL_STRINGS as e,useShellStrings as t}from"./chunk-OQDWLHZI.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};
@@ -0,0 +1,19 @@
1
+ import{escapeHtml as e}from"./chunk-BR22X7E5.js";import{useShellStrings as t}from"./chunk-OQDWLHZI.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useRef as r,useState as o,useEffect as l,useCallback as c,useMemo as a}from"react";import{createPortal as s}from"react-dom";import{jsxs as i,jsx as u,Fragment as d}from"react/jsx-runtime";function h(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function w({text:t,...n}){const r=a(()=>({__html:e(t)}),[t]);/* @__PURE__ */
2
+ return u("div",{...n,dangerouslySetInnerHTML:r})}function g({columns:e,data:g,onChange:m,onColumnsChange:f,fixedRows:p=!1,minRows:y=15,maxHeight:b="260px",cellStyles:v,onFocusChange:x,onSelectionChange:M}){const D=r(null),k=t().grid,[C,E]=o(null);l(()=>{x?.(C)},[C,x]);const[L,S]=o({}),$=r(null),[N,A]=o({}),z=r(null),[O,T]=o(null),[R,K]=o(null),[P,F]=o(null),[I,H]=o(null),[X,Y]=o(null),j=r(null);n(()=>{const e=j.current;if(!e||e.row!==X?.row||e.col!==X?.col)return;j.current=null;const t=D.current?.querySelector(`[data-row="${e.row}"][data-col="${e.col}"]`);if(!t)return;t.focus();const n=document.createRange();n.selectNodeContents(t),n.collapse(!1);const r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)},[X]);const[W,q]=o(null),[B,_]=o(null);l(()=>{M?.(W&&B?{anchor:W,end:B}:null)},[W,B,M]);const J=r(!1),[Q,U]=o(null),V=r(!1),Z=r({a:null,e:null});Z.current={a:W,e:B};const G=W&&B&&(W.row!==B.row||W.col!==B.col),ee=[...g];if(!p)for(;ee.length<y;)ee.push(Array(e.length).fill(""));const te=c((t,n,r)=>{const o=ee.map(e=>[...e]);for(;o.length<=t;)o.push(Array(e.length).fill(""));for(;o[t].length<e.length;)o[t].push("");o[t][n]=r,m(o)},[ee,e.length,m]),ne=c((e,t,n)=>{if(0!==e.button)return;const r=document.activeElement;if(r?.dataset?.row&&r?.dataset?.col){const e=parseInt(r.dataset.row),t=parseInt(r.dataset.col),n=r.textContent||"";if(n!==(ee[e]?.[t]||"")){const r=ee.map(e=>[...e]);r[e]&&(r[e][t]=n,m(r))}}J.current=!0,e.shiftKey&&W||q({row:t,col:n}),_({row:t,col:n})},[ee,m,W]),re=c((e,t)=>{J.current&&_({row:e,col:t})},[]);l(()=>{const e=()=>{J.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),l(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!W||!B)return;const t=window.getSelection();if(t&&t.toString().length>0&&!G)return;const n=Math.min(W.row,B.row),r=Math.max(W.row,B.row),o=Math.min(W.col,B.col),l=Math.max(W.col,B.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(ee[e]?.[n]||"");c.push(t.join("\t"))}const a=c.join("\n");a&&(e.preventDefault(),navigator.clipboard.writeText(a))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[W,B,ee,G]),l(()=>{const t=t=>{if(!C)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!D.current?.contains(n))return;const r=t.clipboardData?.getData("text/plain");if(!r)return;t.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=ee.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=C.row+t;for(;l.length<=n;)l.push(Array(e.length).fill(""));for(;l[n].length<e.length;)l[n].push("");for(let r=0;r<o[t].length;r++){const c=C.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}m(p?l:h(l,e.length)),q({row:C.row,col:C.col}),_({row:Math.min(C.row+o.length-1,l.length-1),col:Math.min(C.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[C,ee,e,m,p]);const oe=c((t,n,r)=>{const o=t.clipboardData.getData("text/plain");if(!o)return;const l=o.split("\n").map(e=>e.split("\t"));if(l.length<=1&&l[0]?.length<=1)return;t.preventDefault();const c=ee.map(e=>[...e]);for(let t=0;t<l.length;t++){const o=n+t;for(;c.length<=o;)c.push(Array(e.length).fill(""));for(;c[o].length<e.length;)c[o].push("");for(let n=0;n<l[t].length;n++){const a=r+n;if(a>=e.length)break;e[a].readOnly||(c[o][a]=l[t][n].trim())}}m(p?c:h(c,e.length))},[ee,e,m,p]),le=c((t,n,r)=>{let o=n,l=r;if("Tab"===t.key)t.preventDefault(),l=t.shiftKey?r-1:r+1,l>=e.length&&(l=0,o=n+1),l<0&&(l=e.length-1,o=n-1);else if("Enter"===t.key)t.preventDefault(),o=t.shiftKey?n-1:n+1;else if("ArrowDown"===t.key)t.preventDefault(),o=n+1;else if("ArrowUp"===t.key)t.preventDefault(),o=n-1;else if("ArrowLeft"===t.key)t.preventDefault(),l=r-1;else{if("ArrowRight"!==t.key){if("Delete"===t.key||"Backspace"===t.key){const o=t.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(t.preventDefault(),te(n,r,"")));if(t.preventDefault(),W&&B){const t=Math.min(W.row,B.row),n=Math.max(W.row,B.row),r=Math.min(W.col,B.col),o=Math.max(W.col,B.col),l=ee.map(e=>[...e]);for(let c=t;c<=n;c++)for(let t=r;t<=o;t++)l[c]&&!e[t]?.readOnly&&(l[c][t]="");m(l)}else te(n,r,"");return}return}t.preventDefault(),l=r+1}for(;l>=0&&l<e.length&&e[l].readOnly;)l+="Tab"===t.key&&t.shiftKey?-1:1;if(o>=0&&o<ee.length&&l>=0&&l<e.length){const e=D.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),E({row:o,col:l}),Y(null),q({row:o,col:l}),_({row:o,col:l}))}},[e,ee,ee.length,te,W,B,m]),ce=c(t=>{if(!p&&t>=ee.length-2){const t=ee.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));m(t)}},[p,ee,e.length,m]),[ae,se]=o(null);l(()=>{if(!ae)return;const e=()=>se(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[ae]);const ie=c(t=>{const n=ee.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),m(n)},[ee,e.length,m]),ue=c(e=>{if(ee.length<=1)return;const t=ee.filter((t,n)=>n!==e);m(t)},[ee,m]),de=c(e=>{const t=ee.map(t=>{const n=[...t];return n.splice(e,0,""),n});m(t)},[ee,m]),he=c(t=>{if(e.length<=1)return;const n=ee.map(e=>{const n=[...e];return n.splice(t,1),n});m(n)},[ee,e.length,m]),we=c((e,t)=>{e.preventDefault(),p||se({x:e.clientX,y:e.clientY,items:[{label:k.insertRowAbove,onClick:()=>{ie(t),se(null)}},{label:k.insertRowBelow,onClick:()=>{ie(t+1),se(null)}},{label:k.deleteRow(t+1),onClick:()=>{ue(t),se(null)}}]})},[p,ie,ue,k]),ge=c((t,n)=>{t.preventDefault(),p||se({x:t.clientX,y:t.clientY,items:[{label:k.insertColumnLeft,onClick:()=>{de(n),se(null)}},{label:k.insertColumnRight,onClick:()=>{de(n+1),se(null)}},{label:k.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{he(n),se(null)}}]})},[p,e,de,he,k]),me=t=>L[t]??e[t]?.width??150;l(()=>{const t=e=>{if(!$.current)return;const t=e.clientX-$.current.startX,n=Math.max(40,$.current.startW+t);S(e=>({...e,[$.current.col]:n}))},n=()=>{if($.current&&f){const t=e.map((e,t)=>({...e,width:L[t]??e.width}));t[$.current.col]={...t[$.current.col],width:L[$.current.col]??e[$.current.col].width},f(t)}$.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,L,f]);const fe=e=>N[e]??28;l(()=>{const e=e=>{if(!z.current)return;const t=e.clientY-z.current.startY,n=Math.max(20,z.current.startH+t);A(e=>({...e,[z.current.row]:n}))},t=()=>{z.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const pe=c(t=>{const n=document.createElement("canvas").getContext("2d");if(!n)return;n.font="12px ui-monospace, SFMono-Regular, Menlo, monospace";let r=0;for(const e of ee){const o=String(e[t]??"").replace(/<[^>]*>/g,""),l=n.measureText(o).width;l>r&&(r=l)}const o=n.measureText(e[t]?.title??"").width;o>r&&(r=o);const l=Math.max(40,Math.ceil(r+24));if(S(e=>({...e,[t]:l})),f){const n=e.map((e,n)=>({...e,width:n===t?l:L[n]??e.width}));f(n)}},[ee,e,L,f]),ye=c(e=>{A(t=>{const n={...t};return delete n[e],n})},[]),be=c(t=>{const{a:n,e:r}=Z.current;if(!n||!r)return;const o=Math.min(n.row,r.row),l=Math.max(n.row,r.row),c=Math.min(n.col,r.col),a=Math.max(n.col,r.col);let s=o,i=l,u=c,d=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?d=t.col:t.col<c&&(u=t.col);const h=l-o+1,w=a-c+1,g=ee.map(e=>[...e]);for(;g.length<=i;)g.push(Array(e.length).fill(""));for(const e of g)for(;e.length<=d;)e.push("");function f(e){const t=e.map(e=>parseFloat(e));if(t.length<2||t.some(e=>Number.isNaN(e)))return null;const n=t[1]-t[0];for(let e=2;e<t.length;e++)if(Math.abs(t[e]-t[e-1]-n)>1e-9)return null;return{step:n}}for(let e=s;e<=i;e++)for(let t=u;t<=d;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&d===a){const r=f(Array.from({length:h},(e,n)=>g[o+n]?.[t]??""));if(r){const c=parseFloat(g[l]?.[t]??"0"),a=parseFloat(g[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%h+h)%h;n=g[o+r]?.[t]??""}}else if(1===h&&s===o&&i===l){const r=f(Array.from({length:w},(t,n)=>g[e]?.[c+n]??""));if(r){const o=parseFloat(g[e]?.[a]??"0"),l=parseFloat(g[e]?.[c]??"0"),s=t>a?t-a:-(c-t);n=String((t>a?o:l)+r.step*s)}else{const r=((t-c)%w+w)%w;n=g[e]?.[c+r]??""}}else{const r=((e-o)%h+h)%h,l=((t-c)%w+w)%w;n=g[o+r]?.[c+l]??""}g[e][t]=n}m(g),q({row:s,col:u}),_({row:i,col:d})},[ee,e.length,m]);l(()=>{const e=e=>{if(!V.current)return;const t=document.elementFromPoint(e.clientX,e.clientY),n=t?.closest?.("[data-row][data-col]");if(!n)return;const r=parseInt(n.dataset.row),o=parseInt(n.dataset.col);U({row:r,col:o})},t=()=>{V.current&&Q&&be(Q),V.current=!1,U(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[Q,be]);const ve=e=>{e.preventDefault(),e.stopPropagation(),V.current=!0,document.body.style.cursor="crosshair"},xe=r(null),[Me,De]=o(0),[ke,Ce]=o(800);l(()=>{const e=xe.current;if(!e)return;const t=()=>Ce(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Ee=ee.length>100,Le=Ee?Math.max(0,Math.floor(Me/28)-20):0,Se=Ee?Math.min(ee.length,Math.ceil((Me+ke)/28)+20):ee.length,$e=a(()=>ee.slice(Le,Se),[ee,Le,Se]),Ne=28*Le,Ae=28*(ee.length-Se),ze="px-2 py-1.5 text-left text-xs font-medium text-gray-500 uppercase bg-gray-100 border-b border-r border-gray-200 select-none";/* @__PURE__ */
3
+ return i("div",{ref:xe,className:"border border-gray-300 rounded overflow-scroll grid-scroll",style:{maxHeight:b,height:b},onScroll:e=>De(e.target.scrollTop),children:[
4
+ /* @__PURE__ */i("table",{ref:D,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+e.reduce((t,n)=>t+me(e.indexOf(n)),0)},children:[
5
+ /* @__PURE__ */i("colgroup",{children:[
6
+ /* @__PURE__ */u("col",{style:{width:36}}),e.map((e,t)=>/* @__PURE__ */u("col",{style:{width:me(t)}},e.key))]}),
7
+ /* @__PURE__ */u("thead",{className:"sticky top-0 z-10",children:/* @__PURE__ */i("tr",{children:[
8
+ /* @__PURE__ */u("th",{className:ze+" text-center w-9 cursor-pointer hover:bg-gray-200",onClick:()=>{q({row:0,col:0}),_({row:ee.length-1,col:e.length-1})},title:k.selectAll,children:"#"}),e.map((t,n)=>{const r=W&&B&&Math.min(W.col,B.col)<=n&&n<=Math.max(W.col,B.col)&&0===Math.min(W.row,B.row)&&Math.max(W.row,B.row)===ee.length-1;/* @__PURE__ */
9
+ return i("th",{className:`${ze} cursor-pointer hover:bg-gray-200 relative${r?" !bg-blue-200":""}${I===n?" !bg-blue-100":""}`,style:{width:me(n)},draggable:!0,onDragStart:()=>(e=>F(e))(n),onDragOver:e=>((e,t)=>{e.preventDefault(),H(t)})(e,n),onDrop:()=>(t=>{if(null===P||P===t)return F(null),void H(null);const n=ee.map(e=>{const n=[...e],[r]=n.splice(P,1);return n.splice(t,0,r),n});if(m(n),f){const n=[...e],[r]=n.splice(P,1);n.splice(t,0,r),f(n)}F(null),H(null)})(n),onDragEnd:()=>{F(null),H(null)},onClick:e=>{e.shiftKey&&W||q({row:0,col:n}),_({row:ee.length-1,col:n})},onContextMenu:e=>ge(e,n),children:[t.title,
10
+ /* @__PURE__ */u("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),$.current={col:t,startX:e.clientX,startW:me(t)},document.body.style.cursor="col-resize"})(e,n),onDoubleClick:e=>{e.stopPropagation(),pe(n)},title:k.resize})]},t.key)})]})}),
11
+ /* @__PURE__ */i("tbody",{children:[Ne>0&&/* @__PURE__ */u("tr",{style:{height:Ne}}),$e.map((t,n)=>{const r=Le+n,o=W&&B&&Math.min(W.row,B.row)<=r&&r<=Math.max(W.row,B.row)&&0===Math.min(W.col,B.col)&&Math.max(W.col,B.col)===e.length-1;/* @__PURE__ */
12
+ return i("tr",{style:{height:fe(r)},children:[
13
+ /* @__PURE__ */i("td",{className:`relative px-1 py-1 text-center text-[10px] text-gray-400 border-b border-r border-gray-200 bg-gray-50 select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${R===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>T(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),K(t)})(e,r),onDrop:()=>(e=>{if(null===O||O===e)return T(null),void K(null);const t=ee.map(e=>[...e]),[n]=t.splice(O,1);t.splice(e,0,n),m(t),T(null),K(null)})(r),onDragEnd:()=>{T(null),K(null)},onClick:t=>{t.shiftKey&&W||q({row:r,col:0}),_({row:r,col:e.length-1})},onContextMenu:e=>we(e,r),children:[r+1,
14
+ /* @__PURE__ */u("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),z.current={row:t,startY:e.clientY,startH:fe(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:k.resize})]}),e.map((e,n)=>{const o=W&&B&&function(e,t,n,r){const o=Math.min(e.row,t.row),l=Math.max(e.row,t.row),c=Math.min(e.col,t.col),a=Math.max(e.col,t.col);return n>=o&&n<=l&&r>=c&&r<=a}(W,B,r,n),l=X?.row===r&&X?.col===n&&!e.readOnly,c=C?.row===r&&C?.col===n,a=v?.[`${r}:${n}`],s=W&&B?Math.max(W.row,B.row):-1,d=W&&B?Math.max(W.col,B.col):-1,h=W&&B&&r===s&&n===d,g=V.current&&Q&&W&&B&&(()=>{const e=Math.min(W.row,B.row),t=Math.max(W.row,B.row),o=Math.min(W.col,B.col),l=Math.max(W.col,B.col);let c=e,a=t,s=o,i=l;return Q.row>t?a=Q.row:Q.row<e&&(c=Q.row),Q.col>l?i=Q.col:Q.col<o&&(s=Q.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),m="sm"===a?.fontSize?"text-[11px]":"lg"===a?.fontSize?"text-sm":"xl"===a?.fontSize?"text-base":"text-xs",f=`${a?.bold?" font-bold":""}${a?.italic?" italic":""}${a?.underline?" underline":""}`;/* @__PURE__ */
15
+ return i("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${e.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${g?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){ne(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>re(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:t=>{t.target!==t.currentTarget||e.readOnly||Y({row:r,col:n})},children:[
16
+ /* @__PURE__ */u(w,{contentEditable:l,suppressContentEditableWarning:!0,tabIndex:0,"data-row":r,"data-col":n,className:`w-full h-full px-2 py-1 rosh-focus-ring whitespace-nowrap overflow-hidden ${"right"===e.align?"text-right":"center"===e.align?"text-center":""} ${e.readOnly?"cursor-default":"cursor-cell"} font-mono ${m}${f}`,onMouseDown:e=>ne(e,r,n),onMouseEnter:()=>re(r,n),onDoubleClick:()=>{e.readOnly||Y({row:r,col:n})},onFocus:()=>{E({row:r,col:n}),J.current||(q({row:r,col:n}),_({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&te(r,n,o),Y(null)},onInput:()=>ce(r),onPaste:e=>oe(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),te(r,n,t.key),j.current={row:r,col:n},void Y({row:r,col:n});le(t,r,n)},text:t[n]||""}),h&&/* @__PURE__ */u("div",{onMouseDown:ve,title:k.fill,className:"absolute -bottom-[3px] -right-[3px] w-[7px] h-[7px] bg-blue-500 border border-white cursor-crosshair z-30 hover:bg-blue-600"})]},n)})]},r)}),Ae>0&&/* @__PURE__ */u("tr",{style:{height:Ae}})]})]}),ae&&s(
17
+ /* @__PURE__ */i(d,{children:[
18
+ /* @__PURE__ */u("div",{className:"fixed inset-0 z-[200]",onPointerDown:()=>se(null)}),
19
+ /* @__PURE__ */u("div",{className:"fixed z-[201] bg-white rounded-lg shadow-lg border border-gray-200 py-1 min-w-[160px]",style:{left:ae.x,top:ae.y},children:ae.items.map((e,t)=>/* @__PURE__ */u("button",{onPointerDown:t=>{t.stopPropagation(),e.onClick()},className:"w-full text-left px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",children:e.label},t))})]}),document.body)]})}export{g as EditableGrid,h as withSpareRow};
@@ -0,0 +1,69 @@
1
+ import{toast_default as e}from"./chunk-VEGMDXT4.js";import{forwardRef as t,useRef as r,useState as n,useMemo as o,useEffect as i,useImperativeHandle as a}from"react";import{jsx as l,jsxs as s,Fragment as c}from"react/jsx-runtime";var d=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{id:"system",label:"System",css:"-apple-system, system-ui, sans-serif"},{id:"serif",label:"Serif",css:'Georgia, "Times New Roman", serif'},{id:"mono",label:"Mono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",label:"Cursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],u=()=>Math.random().toString(36).slice(2,9),p=t(function({src:t,filename:p,onApply:x,onCancel:m},M){const N=r(null),L=r(null),D=r(null),z=r(null),[E,P]=n("select"),[$,I]=n(d[0]),[W,B]=n(4),[S,R]=n(24),[T,j]=n(h[0].id),[A,F]=n(!0),[U,H]=n(!1),[O,Z]=n(!1),[K,V]=n(null),[X,G]=n(null),[q,Y]=n(6),[_,J]=n(12),[Q,ee]=n([]),[te,re]=n(null),[ne,oe]=n(null),[ie,ae]=n(null),[le,se]=n(1),[ce,de]=n(null),[he,ue]=n(null),[pe,ye]=n(null),xe=r(null),[me,ge]=n(!1),we=o(()=>ie?{w:ie.w*le,h:ie.h*le}:null,[ie,le]),fe=we&&ne?we.w/ne.w:1,be=o(()=>Q.find(e=>e.id===te)??null,[Q,te]);i(()=>{"select"===E&&be&&("color"in be&&I(be.color),"stroke"in be&&B(be.stroke),"rect"===be.type&&J(be.radius),"text"===be.type&&(R(be.size),j(be.font),F(be.bold),H(be.italic),Z(be.underline),V(be.borderColor),G(be.background),Y(be.padding)))},[te]),i(()=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{z.current=r,oe({w:r.naturalWidth,h:r.naturalHeight}),ee([]),re(null)},r.onerror=()=>e.error("Failed to load image"),r.src=t},[t]),i(()=>{if(!ne)return;const e=()=>{const e=N.current;if(!e)return;const t=e.getBoundingClientRect(),r=Math.max(0,t.width-32),n=Math.max(0,t.height-32);if(0===r||0===n)return;const o=ne.w/ne.h;let i=ne.w,a=ne.h;i>r&&(i=r,a=i/o),a>n&&(a=n,i=a*o),ae({w:i,h:a})};e();const t=new ResizeObserver(e);return N.current&&t.observe(N.current),()=>t.disconnect()},[ne]);const ve=o(()=>Q.filter(e=>"mosaic"===e.type),[Q]);i(()=>{const e=z.current,t=L.current;if(!e||!t||!ne)return;t.width=ne.w,t.height=ne.h;const r=t.getContext("2d");r.drawImage(e,0,0);for(const e of ve)C(r,e)},[ne,ve,ie]);const ke=e=>{const t=D.current;if(!t)return{x:0,y:0};const r=t.createSVGPoint();r.x=e.clientX,r.y=e.clientY;const n=t.getScreenCTM();if(!n)return{x:0,y:0};const o=r.matrixTransform(n.inverse());return{x:o.x,y:o.y}},Me=e=>{xe.current=e,ge(!0)};i(()=>{if(!me)return;const e=e=>{const t=xe.current;if(!t)return;const r=ke(e);if("draw"===t.kind)de(f(E,t.start,r,$,W,_));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(r.x-e.x)>1||Math.abs(r.y-e.y)>1)&&(t.points.push(r),de({id:"",type:"draw",points:t.points.slice(),color:$,stroke:W}))}else if("crop"===t.kind)ye(k(t.start,r));else if("move"===t.kind){const e=r.x-t.start.x,n=r.y-t.start.y;ee(r=>r.map(r=>r.id===t.id?b(t.original,e,n):r))}else"resize"===t.kind&&ee(e=>e.map(e=>e.id===t.id?function(e,t,r){if("arrow"===e.type)return"start"===t?{...e,x1:r.x,y1:r.y}:"end"===t?{...e,x2:r.x,y2:r.y}:e;if("text"===e.type||"draw"===e.type)return e;const n=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=n,s=i,c=o,d=a;"nw"===t&&(l=r.x,s=r.y);"ne"===t&&(c=r.x,s=r.y);"se"===t&&(c=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=k({x:l,y:s},{x:c,y:d});return{...e,x:h.x,y:h.y,w:h.w,h:h.h}}(t.original,t.corner,r):e))},t=()=>{const e=xe.current;if(xe.current=null,ge(!1),"draw"===e?.kind)de(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const r={...e,id:u()};return ee(e=>[...e,r]),re(r.id),P("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void de(null);const t={id:u(),type:"draw",points:e.points,color:$,stroke:W};ee(e=>[...e,t]),re(t.id),P("select"),de(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[me,E,$,W,_]);i(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(te&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),ee(e=>e.filter(e=>e.id!==te)),re(null)):"Escape"===e.key&&re(null))):(e.preventDefault(),ee(e=>e.slice(0,-1)),void re(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[te]);const Ce=e=>{const t=!{bold:A,italic:U,underline:O}[e];"bold"===e&&F(t),"italic"===e&&H(t),"underline"===e&&Z(t),te&&ee(r=>r.map(r=>r.id===te&&"text"===r.type?{...r,[e]:t}:r))},Ne=e=>{V(e),te&&ee(t=>t.map(t=>t.id===te&&"text"===t.type?{...t,borderColor:e}:t))},Le=e=>{G(e),te&&ee(t=>t.map(t=>t.id===te&&"text"===t.type?{...t,background:e}:t))},De=e=>{if(!he)return;const t=e??he.value;if(!t.trim())return he.editingId&&ee(e=>e.filter(e=>e.id!==he.editingId)),void ue(null);if(he.editingId)ee(e=>e.map(e=>e.id===he.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:u(),type:"text",x:he.x,y:he.y,text:t,color:$,size:S,font:T,bold:A,italic:U,underline:O,borderColor:K,background:X,padding:q};ee(t=>[...t,e]),re(e.id),P("select")}ue(null)},ze=async()=>{const e=L.current,t=D.current;if(!e||!t||!ne)return null;const r=document.createElement("canvas");r.width=ne.w,r.height=ne.h;const n=r.getContext("2d");n.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),s=new Image;return await new Promise(e=>{s.onload=()=>e(),s.onerror=()=>e(),s.src=l}),n.drawImage(s,0,0,ne.w,ne.h),URL.revokeObjectURL(l),r};a(M,()=>({save:async()=>{const t=await ze();t&&t.toBlob(t=>{if(!t)return void e.error("Failed to export");const r=URL.createObjectURL(t),n=document.createElement("a");n.href=r;const o=p.replace(/\.[^.]+$/,"");n.download=`${o}-annotated.png`,n.click(),URL.revokeObjectURL(r)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error("Clipboard images not supported in this browser");const t=await ze();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success("Copied to clipboard")}catch{e.error("Copy failed (clipboard permission?)")}else e.error("Failed to copy")},"image/png")}}),[ne,p]);const Ee=o(()=>[{id:"select",label:"Select / Move",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:"Pen / Draw",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:"Rectangle",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:"Ellipse",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:"Arrow",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:"Mosaic",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:"Text",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:"Crop",icon:/* @__PURE__ */l("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */l("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[]),Pe=e=>"p-1.5 rounded transition-colors "+(e?"bg-blue-500 text-white":"text-gray-700 hover:bg-gray-200"),$e=be?.type??("select"===E?null:E),Ie="rect"===$e||"circle"===$e||"arrow"===$e||"draw"===$e,We="rect"===$e,Be="text"===$e;/* @__PURE__ */
2
+ return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
3
+ /* @__PURE__ */s("div",{className:"flex items-center gap-1.5 px-3 py-2 border-b border-gray-200 bg-white shrink-0 flex-wrap text-[12px]",children:[Ee.map(e=>/* @__PURE__ */l("button",{onClick:()=>{P(e.id),re(null)},title:e.label,className:Pe(E===e.id),children:e.icon},e.id)),
4
+ /* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
5
+ /* @__PURE__ */l("div",{className:"flex items-center gap-1",children:d.map(e=>/* @__PURE__ */l("button",{onClick:()=>(e=>{I(e),te&&ee(t=>t.map(t=>t.id!==te||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+($===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Ie&&/* @__PURE__ */s(c,{children:[
6
+ /* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
7
+ /* @__PURE__ */s("label",{className:"flex items-center gap-1.5 text-gray-600",children:[
8
+ /* @__PURE__ */l("span",{children:"Weight"}),
9
+ /* @__PURE__ */l("input",{type:"range",min:1,max:20,step:1,value:W,onChange:e=>{return t=Number(e.target.value),B(t),void(te&&ee(e=>e.map(e=>e.id!==te?e:"rect"===e.type||"circle"===e.type||"arrow"===e.type||"draw"===e.type?{...e,stroke:t}:e)));var t},className:"w-16 accent-blue-500"}),
10
+ /* @__PURE__ */l("span",{className:"tabular-nums w-5 text-right",children:W})]})]}),We&&/* @__PURE__ */s(c,{children:[
11
+ /* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
12
+ /* @__PURE__ */s("label",{className:"flex items-center gap-1.5 text-gray-600",children:[
13
+ /* @__PURE__ */l("span",{children:"Radius"}),
14
+ /* @__PURE__ */l("input",{type:"range",min:0,max:48,step:1,value:_,onChange:e=>{return t=Number(e.target.value),J(t),void(te&&ee(e=>e.map(e=>e.id===te&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
15
+ /* @__PURE__ */l("span",{className:"tabular-nums w-6 text-right",children:_})]})]}),Be&&/* @__PURE__ */s(c,{children:[
16
+ /* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
17
+ /* @__PURE__ */l("select",{value:T,onChange:e=>{return t=e.target.value,j(t),void(te&&ee(e=>e.map(e=>e.id===te&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */l("option",{value:e.id,children:e.label},e.id))}),
18
+ /* @__PURE__ */l("button",{onClick:()=>Ce("bold"),className:Pe(A),title:"Bold",children:/* @__PURE__ */l("span",{className:"font-bold",children:"B"})}),
19
+ /* @__PURE__ */l("button",{onClick:()=>Ce("italic"),className:Pe(U),title:"Italic",children:/* @__PURE__ */l("span",{className:"italic",children:"I"})}),
20
+ /* @__PURE__ */l("button",{onClick:()=>Ce("underline"),className:Pe(O),title:"Underline",children:/* @__PURE__ */l("span",{className:"underline",children:"U"})}),
21
+ /* @__PURE__ */s("label",{className:"flex items-center gap-1.5 text-gray-600",children:[
22
+ /* @__PURE__ */l("span",{children:"Size"}),
23
+ /* @__PURE__ */l("input",{type:"range",min:10,max:96,step:1,value:S,onChange:e=>{return t=Number(e.target.value),R(t),void(te&&ee(e=>e.map(e=>e.id===te&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
24
+ /* @__PURE__ */l("span",{className:"tabular-nums w-7 text-right",children:S})]}),
25
+ /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
26
+ /* @__PURE__ */l("span",{children:"Border"}),K?/* @__PURE__ */s(c,{children:[
27
+ /* @__PURE__ */l("input",{type:"color",value:K,onChange:e=>Ne(e.target.value),title:"Text-box border color",className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
28
+ /* @__PURE__ */l("button",{onClick:()=>Ne(null),title:"Remove border",className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */l("button",{onClick:()=>Ne($),title:"Add a border",className:"px-1.5 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:"Add"})]}),
29
+ /* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
30
+ /* @__PURE__ */l("span",{children:"Fill"}),X?/* @__PURE__ */s(c,{children:[
31
+ /* @__PURE__ */l("input",{type:"color",value:X,onChange:e=>Le(e.target.value),title:"Text-box background color",className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
32
+ /* @__PURE__ */l("button",{onClick:()=>Le(null),title:"Remove fill",className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */l("button",{onClick:()=>Le("#ffffff"),title:"Add a background fill",className:"px-1.5 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:"Add"})]}),
33
+ /* @__PURE__ */s("label",{className:"flex items-center gap-1.5 text-gray-600",children:[
34
+ /* @__PURE__ */l("span",{children:"Pad"}),
35
+ /* @__PURE__ */l("input",{type:"range",min:0,max:40,step:1,value:q,onChange:e=>{return t=Number(e.target.value),Y(t),void(te&&ee(e=>e.map(e=>e.id===te&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
36
+ /* @__PURE__ */l("span",{className:"tabular-nums w-6 text-right",children:q})]})]}),
37
+ /* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
38
+ /* @__PURE__ */l("button",{onClick:()=>se(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:"Zoom out",children:"−"}),
39
+ /* @__PURE__ */s("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*le),"%"]}),
40
+ /* @__PURE__ */l("button",{onClick:()=>se(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:"Zoom in",children:"+"}),
41
+ /* @__PURE__ */l("button",{onClick:()=>se(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:"Fit to area",children:"Fit"}),
42
+ /* @__PURE__ */l("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
43
+ /* @__PURE__ */l("button",{onClick:()=>{ee(e=>e.slice(0,-1)),re(null)},disabled:0===Q.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:"Undo"}),
44
+ /* @__PURE__ */s("div",{className:"ml-auto flex items-center gap-2",children:[pe&&/* @__PURE__ */s(c,{children:[
45
+ /* @__PURE__ */l("button",{onClick:()=>{if(!pe||!z.current||!ne)return;const e=pe,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const r=t.getContext("2d"),n=document.createElement("canvas");n.width=ne.w,n.height=ne.h;const o=n.getContext("2d");o.drawImage(z.current,0,0);for(const e of ve)C(o,e);r.drawImage(n,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{z.current=i,oe({w:i.naturalWidth,h:i.naturalHeight}),ee(t=>t.filter(e=>"mosaic"!==e.type).map(t=>b(t,-e.x,-e.y)).filter(e=>function(e,t,r){const n=v(e);return n.x+n.w>0&&n.y+n.h>0&&n.x<t&&n.y<r}(e,i.naturalWidth,i.naturalHeight))),ye(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:"Apply Crop"}),
46
+ /* @__PURE__ */l("button",{onClick:()=>ye(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:"Cancel"})]}),x&&!pe&&/* @__PURE__ */s(c,{children:[m&&/* @__PURE__ */l("button",{onClick:m,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:"Cancel"}),
47
+ /* @__PURE__ */l("button",{onClick:async()=>{const t=await ze();t?t.toBlob(t=>{t?x(t):e.error("Failed to export")},"image/png"):e.error("Failed to export")},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:"Apply"})]})]})]}),
48
+ /* @__PURE__ */l("div",{ref:N,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:we&&ne&&/* @__PURE__ */s("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:we.w,height:we.h},children:[
49
+ /* @__PURE__ */l("canvas",{ref:L,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
50
+ /* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ne.w} ${ne.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===E?"default":"text"===E?"text":"crosshair"},onPointerDown:e=>{if("select"===E)return void re(null);if("text"===E){if(he)return void De();const t=ke(e);return void ue({x:t.x,y:t.y,value:""})}const t=ke(e);if("crop"!==E){if("draw"===E)return Me({kind:"pen",points:[t]}),void de({id:"",type:"draw",points:[t],color:$,stroke:W});de(f(E,t,t,$,W,_)),Me({kind:"draw",start:t})}else Me({kind:"crop",start:t})},children:[Q.map(e=>/* @__PURE__ */l(y,{anno:e,selected:te===e.id,zoom:le,onPointerDown:t=>((e,t)=>{"select"===E&&(e.stopPropagation(),re(t.id),Me({kind:"move",id:t.id,start:ke(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&ue({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,r)=>((e,t,r)=>{e.stopPropagation(),Me({kind:"resize",id:t.id,corner:r,start:ke(e),original:t})})(t,e,r)},e.id)),ce&&/* @__PURE__ */l(y,{anno:{...ce,id:"__preview"},preview:!0}),pe&&/* @__PURE__ */l(g,{rect:pe,imageSize:ne})]}),he&&/* @__PURE__ */l(w,{pendingText:he,color:$,size:S,font:h.find(e=>e.id===T)?.css??h[0].css,bold:A,italic:U,underline:O,borderColor:K,background:X,padding:q,scale:fe,onChange:e=>ue({...he,value:e}),onCommit:De,onCancel:()=>ue(null)})]})}),
51
+ /* @__PURE__ */l("div",{className:"px-3 py-1.5 border-t border-gray-200 bg-white text-[11px] text-gray-500 shrink-0",children:"select"===E?te?"Drag to move. Drag a corner to resize. Delete / Backspace removes. Click outside to deselect.":"Tap a shape to select. Double-click text to edit.":"text"===E?"Click to drop a text label.":"crop"===E?"Drag a rectangle to set the crop region.":"draw"===E?"Drag to draw freehand.":"Drag on the image to draw."})]})});function y({anno:e,selected:t,preview:r,zoom:n=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const d=v(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let y;if("rect"===e.type)y=/* @__PURE__ */l("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("circle"===e.type)y=/* @__PURE__ */l("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...u});else if("arrow"===e.type)y=/* @__PURE__ */l(m,{anno:e,interactive:u});else if("draw"===e.type)y=/* @__PURE__ */l("path",{d:M(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)y=/* @__PURE__ */l("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,r=e.padding??0,n=!!e.borderColor||!!e.background,o=v(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;y=/* @__PURE__ */s("g",{...u,...p,children:[n&&/* @__PURE__ */l("rect",{x:o.x-r,y:o.y-r,width:Math.max(0,o.w)+2*r,height:Math.max(0,o.h)+2*r,rx:Math.min(8,r),ry:Math.min(8,r),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
52
+ /* @__PURE__ */l("text",{x:e.x,y:e.y+e.size,fill:e.color,fontSize:e.size,fontWeight:e.bold?700:400,fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":void 0,fontFamily:t,style:{userSelect:"none"},children:e.text.split("\n").map((t,r)=>/* @__PURE__ */l("tspan",{x:e.x,dy:0===r?0:1.2*e.size,children:t},r))})]})}/* @__PURE__ */
53
+ return s("g",{children:[y,t&&!r&&/* @__PURE__ */s(c,{children:[
54
+ /* @__PURE__ */l("rect",{"data-chrome":"selection",x:d.x-4,y:d.y-4,width:d.w+8,height:d.h+8,fill:"none",stroke:"#3b82f6",strokeWidth:2/n,strokeDasharray:`${6/n},${4/n}`,pointerEvents:"none"}),a&&/* @__PURE__ */l(x,{anno:e,zoom:n,onHandlePointerDown:a})]})]})}function x({anno:e,zoom:t,onHandlePointerDown:r}){const n=6/t,o=1.5/t,i=e=>({fill:"#fff",stroke:"#3b82f6",strokeWidth:o,pointerEvents:"all",style:{cursor:e},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
55
+ return s(c,{children:[
56
+ /* @__PURE__ */l("circle",{cx:e.x1,cy:e.y1,r:n,...i("grab"),onPointerDown:e=>r(e,"start")}),
57
+ /* @__PURE__ */l("circle",{cx:e.x2,cy:e.y2,r:n,...i("grab"),onPointerDown:e=>r(e,"end")})]});if("text"===e.type||"draw"===e.type)return null;const a=e.x,d=e.y,h=e.w,u=e.h;/* @__PURE__ */
58
+ return s(c,{children:[
59
+ /* @__PURE__ */l("circle",{cx:a,cy:d,r:n,...i("nwse-resize"),onPointerDown:e=>r(e,"nw")}),
60
+ /* @__PURE__ */l("circle",{cx:a+h,cy:d,r:n,...i("nesw-resize"),onPointerDown:e=>r(e,"ne")}),
61
+ /* @__PURE__ */l("circle",{cx:a+h,cy:d+u,r:n,...i("nwse-resize"),onPointerDown:e=>r(e,"se")}),
62
+ /* @__PURE__ */l("circle",{cx:a,cy:d+u,r:n,...i("nesw-resize"),onPointerDown:e=>r(e,"sw")})]})}function m({anno:e,interactive:t}){const r=Math.max(12,4*e.stroke),n=Math.atan2(e.y2-e.y1,e.x2-e.x1),o=n+Math.PI-Math.PI/7,i=n+Math.PI+Math.PI/7,a=`M${e.x2},${e.y2} L${e.x2+r*Math.cos(o)},${e.y2+r*Math.sin(o)} L${e.x2+r*Math.cos(i)},${e.y2+r*Math.sin(i)} Z`;/* @__PURE__ */
63
+ return s("g",{...t,children:[
64
+ /* @__PURE__ */l("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round"}),
65
+ /* @__PURE__ */l("path",{d:a,fill:e.color})]})}function g({rect:e,imageSize:t}){/* @__PURE__ */
66
+ return s("g",{pointerEvents:"none",children:[
67
+ /* @__PURE__ */l("path",{d:`M0,0 H${t.w} V${t.h} H0 Z M${e.x},${e.y} V${e.y+e.h} H${e.x+e.w} V${e.y} Z`,fill:"rgba(0,0,0,0.45)",fillRule:"evenodd"}),
68
+ /* @__PURE__ */l("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"none",stroke:"#fff",strokeWidth:2,strokeDasharray:"8,6"})]})}function w({pendingText:e,color:t,size:n,font:o,bold:a,italic:s,underline:c,borderColor:d,background:h,padding:u,scale:p,onChange:y,onCommit:x,onCancel:m}){const g=r(null);i(()=>{const e=requestAnimationFrame(()=>{g.current?.focus(),g.current?.select?.()});return()=>cancelAnimationFrame(e)},[]);const w=()=>x(g.current?.value),f=d?Math.max(1,Math.round(n/12)):0;/* @__PURE__ */
69
+ return l("div",{style:{position:"absolute",left:e.x*p+"px",top:e.y*p+"px",transform:"translateY(-2px)",zIndex:5},onPointerDown:e=>e.stopPropagation(),children:/* @__PURE__ */l("textarea",{ref:g,value:e.value,onChange:e=>y(e.target.value),onBlur:w,onKeyDown:e=>{"Escape"===e.key?(e.preventDefault(),m()):"Enter"!==e.key||e.shiftKey||(e.preventDefault(),w())},placeholder:"Type then Enter…",rows:1,className:"outline-none resize-none shadow-md",style:{color:t,fontSize:n*p+"px",fontFamily:o,fontWeight:a?700:400,fontStyle:s?"italic":"normal",textDecoration:c?"underline":void 0,minWidth:80,padding:u*p+"px",borderRadius:Math.min(8,u)*p+"px",border:d?`${f*p}px solid ${d}`:"1px dashed #60a5fa",background:h??"rgba(255,255,255,0.95)"}})})}function f(e,t,r,n,o,i){if("rect"===e){const e=k(t,r);return{id:"",type:"rect",x:e.x,y:e.y,w:e.w,h:e.h,color:n,stroke:o,radius:i}}if("circle"===e){const e=k(t,r);return{id:"",type:"circle",x:e.x,y:e.y,w:e.w,h:e.h,color:n,stroke:o}}if("arrow"===e)return{id:"",type:"arrow",x1:t.x,y1:t.y,x2:r.x,y2:r.y,color:n,stroke:o};if("mosaic"===e){const e=k(t,r);return{id:"",type:"mosaic",x:e.x,y:e.y,w:e.w,h:e.h}}return null}function b(e,t,r){return"arrow"===e.type?{...e,x1:e.x1+t,y1:e.y1+r,x2:e.x2+t,y2:e.y2+r}:"draw"===e.type?{...e,points:e.points.map(e=>({x:e.x+t,y:e.y+r}))}:(e.type,{...e,x:e.x+t,y:e.y+r})}function v(e){if("arrow"===e.type){return{x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)}}if("draw"===e.type){if(0===e.points.length)return{x:0,y:0,w:0,h:0};let t=e.points[0].x,r=e.points[0].x,n=e.points[0].y,o=e.points[0].y;for(const i of e.points)i.x<t&&(t=i.x),i.x>r&&(r=i.x),i.y<n&&(n=i.y),i.y>o&&(o=i.y);return{x:t,y:n,w:r-t,h:o-n}}if("text"===e.type){const t=e.text.split("\n"),r=t.reduce((e,t)=>Math.max(e,t.length),0);return{x:e.x,y:e.y,w:r*e.size*.55,h:t.length*e.size*1.2}}return{x:e.x,y:e.y,w:e.w,h:e.h}}function k(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),w:Math.abs(e.x-t.x),h:Math.abs(e.y-t.y)}}function M(e){if(0===e.length)return"";let t=`M ${e[0].x} ${e[0].y}`;for(let r=1;r<e.length;r++)t+=` L ${e[r].x} ${e[r].y}`;return t}function C(e,t){const r=Math.round(Math.max(0,t.x)),n=Math.round(Math.max(0,t.y)),o=Math.round(Math.min(e.canvas.width-r,t.w)),i=Math.round(Math.min(e.canvas.height-n,t.h));if(o<2||i<2)return;const a=e.getImageData(r,n,o,i);for(let e=0;e<i;e+=12)for(let t=0;t<o;t+=12){let r=0,n=0,l=0,s=0,c=0;const d=Math.min(12,o-t),h=Math.min(12,i-e);for(let i=0;i<h;i++)for(let h=0;h<d;h++){const d=4*((e+i)*o+(t+h));r+=a.data[d],n+=a.data[d+1],l+=a.data[d+2],s+=a.data[d+3],c++}r=Math.round(r/c),n=Math.round(n/c),l=Math.round(l/c),s=Math.round(s/c);for(let i=0;i<h;i++)for(let c=0;c<d;c++){const d=4*((e+i)*o+(t+c));a.data[d]=r,a.data[d+1]=n,a.data[d+2]=l,a.data[d+3]=s}}e.putImageData(a,r,n)}export{p as ImageAnnotator_default};
@@ -1,5 +1,2 @@
1
1
  "use client";
2
- export { FileIntakeAlert, acceptsFile, useFileIntake } from '../chunk-QAGQRNKI.js';
3
- import '../chunk-72CQWN7O.js';
4
- //# sourceMappingURL=index.js.map
5
- //# sourceMappingURL=index.js.map
2
+ export{FileIntakeAlert,acceptsFile,useFileIntake}from"../chunk-VVAGSKW7.js";import"../chunk-OQDWLHZI.js";
@@ -677,6 +677,12 @@ interface ShellStrings {
677
677
  /** The trigger with only one end of the range set. */
678
678
  fromOnly: (date: string) => string;
679
679
  toOnly: (date: string) => string;
680
+ /**
681
+ * The whole range as a sentence — what a labelled trigger is DESCRIBED
682
+ * as, after its label names it ("Period, button, 1 August 2026 to
683
+ * 3 October 2026"). Both dates arrive spelled out in the locale.
684
+ */
685
+ range: (from: string, to: string) => string;
680
686
  last2Weeks: string;
681
687
  lastMonth: string;
682
688
  last3Months: string;
@@ -1359,9 +1365,46 @@ interface DateRangePickerProps {
1359
1365
  /**
1360
1366
  * Offer the Clear affordances. Pass `false` where a range is REQUIRED — an
1361
1367
  * accounting report seeded with a period has nothing sensible to show for an
1362
- * empty one, so it should not offer to empty it.
1368
+ * empty one, so it should not offer to empty it. Defaults to `!required`.
1363
1369
  */
1364
1370
  clearable?: boolean;
1371
+ /**
1372
+ * The range must be set. Marks the trigger `aria-required`, and — unless
1373
+ * `clearable` is given — takes the Clear affordances away, because offering
1374
+ * to empty a field that may not be empty is offering a mistake.
1375
+ *
1376
+ * It does not stop a form being submitted: the value travels in hidden
1377
+ * inputs (`name`), and a browser never validates a hidden input. A form that
1378
+ * must refuse an empty range checks the two values itself, as it would for
1379
+ * any custom control.
1380
+ */
1381
+ required?: boolean;
1382
+ /**
1383
+ * Post the range with the form it sits in: two hidden inputs, named `from`
1384
+ * and `to` here, carrying the APPLIED range as `YYYY-MM-DD` (or '' when
1385
+ * unset) — what two `<input type="date">` would have posted, so a plain GET
1386
+ * form or a server action reads the range the way it read the two dates.
1387
+ * The pending range in an open panel is not posted; Apply is what commits.
1388
+ */
1389
+ name?: {
1390
+ from: string;
1391
+ to: string;
1392
+ };
1393
+ /**
1394
+ * Put on the trigger BUTTON, so a form's visible `<label htmlFor>` names it
1395
+ * — a button is a labelable element, and clicking the label focuses it.
1396
+ */
1397
+ id?: string;
1398
+ /** Names the trigger by another element's id — a heading, a column head. */
1399
+ 'aria-labelledby'?: string;
1400
+ /** Names the trigger where there is no visible label to point at. */
1401
+ 'aria-label'?: string;
1402
+ /**
1403
+ * 0 = Sunday, 1 = Monday. Without it the week starts where the provider's
1404
+ * locale says (Monday for `en-AU`), and on Sunday with no locale — see
1405
+ * `Calendar`.
1406
+ */
1407
+ weekStartsOn?: 0 | 1;
1365
1408
  /** Trigger text when no range is set. */
1366
1409
  placeholder?: string;
1367
1410
  /**
@@ -1385,7 +1428,7 @@ interface DateRangePickerProps {
1385
1428
  * back one day for every user east of Greenwich.
1386
1429
  */
1387
1430
  declare function toISODate(d: Date): string;
1388
- declare function DateRangePicker({ from, to, onChange, formatDisplay: formatDisplayProp, clearable, placeholder: placeholderProp, fullWidth, }: DateRangePickerProps): react_jsx_runtime.JSX.Element;
1431
+ declare function DateRangePicker({ from, to, onChange, formatDisplay: formatDisplayProp, clearable: clearableProp, required, name, id, 'aria-labelledby': ariaLabelledBy, 'aria-label': ariaLabel, weekStartsOn, placeholder: placeholderProp, fullWidth, }: DateRangePickerProps): react_jsx_runtime.JSX.Element;
1389
1432
 
1390
1433
  type CalendarMode = 'single' | 'range';
1391
1434
  interface CalendarProps {
@@ -1409,8 +1452,10 @@ interface CalendarProps {
1409
1452
  defaultMonth?: string;
1410
1453
  onMonthChange?: (month: string) => void;
1411
1454
  /**
1412
- * 0 = Sunday, 1 = Monday. Defaults to Sunday, matching what the kit's pickers
1413
- * showed before this existed; a consumer outside the US will want 1.
1455
+ * 0 = Sunday, 1 = Monday. Without it, the week starts where the
1456
+ * `ShellStringsProvider` locale says (`en-AU` and `de` on Monday, `en-US`
1457
+ * and `ja` on Sunday — see `firstDayOfWeek`), and on Sunday where there is no
1458
+ * locale, as it always has. Given, it wins over the locale.
1414
1459
  */
1415
1460
  weekStartsOn?: 0 | 1;
1416
1461
  /**
@@ -1426,7 +1471,7 @@ interface CalendarProps {
1426
1471
  declare function toKey(d: Date): string;
1427
1472
  /** The local Date for a `YYYY-MM-DD`, or null. Never `new Date(string)`. */
1428
1473
  declare function fromKey(key: string | null | undefined): Date | null;
1429
- declare function Calendar({ value, endValue, mode, onSelect, min, max, month, defaultMonth, onMonthChange, weekStartsOn, quickJump, 'aria-label': ariaLabel, className, }: CalendarProps): react_jsx_runtime.JSX.Element;
1474
+ declare function Calendar({ value, endValue, mode, onSelect, min, max, month, defaultMonth, onMonthChange, weekStartsOn: weekStartsOnProp, quickJump, 'aria-label': ariaLabel, className, }: CalendarProps): react_jsx_runtime.JSX.Element;
1430
1475
 
1431
1476
  interface TimePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'size' | 'type' | 'value' | 'onChange' | 'min' | 'max'> {
1432
1477
  /** An `HH:MM` / `HH:MM:SS` string, a Date (local wall-clock time is read), or nothing. */
@@ -1473,8 +1518,24 @@ interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'c
1473
1518
  * cost is that the field then looks like the browser rather than the kit.
1474
1519
  */
1475
1520
  native?: boolean;
1476
- /** 0 = Sunday, 1 = Monday. Passed through to the calendar. */
1521
+ /**
1522
+ * 0 = Sunday, 1 = Monday. Without it the week starts where the provider's
1523
+ * locale says (Monday for `en-AU`), and on Sunday with no locale — see
1524
+ * `Calendar`.
1525
+ */
1477
1526
  weekStartsOn?: 0 | 1;
1527
+ /**
1528
+ * The date must be set: `aria-required` on the trigger, and — unless
1529
+ * `clearable` is given — no Clear in the calendar's footer. It does not block
1530
+ * a submit in the popover: the value posts from a hidden input, which a
1531
+ * browser never validates. With `native` it is the input's own `required`.
1532
+ */
1533
+ required?: boolean;
1534
+ /**
1535
+ * Offer Clear in the calendar's footer. Defaults to `!required` — offering
1536
+ * to empty a field that may not be empty is offering a mistake.
1537
+ */
1538
+ clearable?: boolean;
1478
1539
  className?: string;
1479
1540
  }
1480
1541
  declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLInputElement>>;
@@ -1576,7 +1637,8 @@ declare function Snippet({ value, children, symbol, label, size, variant, hideCo
1576
1637
  * was under it.
1577
1638
  *
1578
1639
  * `placeBeside` is the same rule for a popup centred on one side of its
1579
- * anchor rather than hanging from it (`Tooltip`).
1640
+ * anchor rather than hanging from it, and `placeArrow` where such a popup's
1641
+ * arrow goes (`Tooltip`).
1580
1642
  */
1581
1643
 
1582
1644
  /** `max-w-[28rem]` on the menu, as a number for the fit math. */
@@ -1610,6 +1672,26 @@ interface DropdownPositionOptions {
1610
1672
  */
1611
1673
  preferredMaxWidth?: number;
1612
1674
  preferredMaxHeight?: number;
1675
+ /**
1676
+ * The popup itself — given, a popup that fits on NEITHER side of its
1677
+ * trigger is shifted along to fit, rather than squeezed.
1678
+ *
1679
+ * Without it, a popup that cannot grow rightward from the trigger's left
1680
+ * edge hangs off its right edge, capped at whatever room lies to the left of
1681
+ * that edge. Right for an option list, which reads as belonging to its
1682
+ * field. Wrong for a composition that lays itself out for the width it gets
1683
+ * (`DateRangePicker`): on a 375 px phone a 250 px field at x = 27 left the
1684
+ * range panel 298 px of the 359 the screen allows, and its desktop layout
1685
+ * did not fit in that. Given the popup, the cramped case caps it at the
1686
+ * width the BOX allows and places it as near the trigger's left edge as its
1687
+ * measured width lets it — on a phone, the full width between the margins.
1688
+ *
1689
+ * The two cases where an alignment already gives the popup all the room it
1690
+ * wants are untouched, so a desktop places it exactly as before. The
1691
+ * popup's width is polled with the trigger's, so a popup that changes
1692
+ * layout after it opens is placed again.
1693
+ */
1694
+ popupRef?: RefObject<HTMLElement | null>;
1613
1695
  }
1614
1696
  interface Bounds {
1615
1697
  left: number;
@@ -1637,9 +1719,8 @@ interface Bounds {
1637
1719
  declare function popupBounds(trigger: Element | null | undefined): Bounds;
1638
1720
  /**
1639
1721
  * Compute the menu's fixed-viewport position from the trigger rect while the
1640
- * dropdown is open, re-running on scroll (capture, so nested form-scroll
1641
- * containers count), resize, and every animation frame the trigger moves so it
1642
- * tracks a moving trigger. Anchors below the trigger by default, flips above
1722
+ * dropdown is open, re-running whenever the trigger may have moved
1723
+ * (`followAnchor`). Anchors below the trigger by default, flips above
1643
1724
  * when below is cramped and above has more room, and flips to right-aligned
1644
1725
  * when the max width wouldn't fit to the right of the trigger's left edge.
1645
1726
  *
@@ -3966,7 +4047,11 @@ declare function TopNav({ items, activeKey, onSelect, brand, actions, className
3966
4047
 
3967
4048
  type DropdownMenuAlign = 'start' | 'end';
3968
4049
  type DropdownMenuSide = 'top' | 'bottom';
4050
+ /** An action: choosing it runs `onSelect`. An entry with neither a `type` nor
4051
+ * an `href` is one, so every item written before the other kinds existed
4052
+ * still is. */
3969
4053
  interface DropdownMenuItem {
4054
+ type?: 'item';
3970
4055
  key: string;
3971
4056
  label: ReactNode;
3972
4057
  icon?: ReactNode;
@@ -3974,23 +4059,79 @@ interface DropdownMenuItem {
3974
4059
  danger?: boolean;
3975
4060
  disabled?: boolean;
3976
4061
  onSelect: () => void;
4062
+ href?: never;
3977
4063
  }
4064
+ /** A link: a real `<a href>` (or the host's router link, `linkAs`), so a
4065
+ * middle-click, "Open in new tab" and the status bar all work. */
4066
+ interface DropdownMenuLinkItem {
4067
+ type?: 'link';
4068
+ key: string;
4069
+ label: ReactNode;
4070
+ href: string;
4071
+ icon?: ReactNode;
4072
+ /** The page this link is for is the one open: `aria-current="page"`. */
4073
+ current?: boolean;
4074
+ /** Drawn, announced as unavailable, and not a link at all — no `href`. */
4075
+ disabled?: boolean;
4076
+ onSelect?: never;
4077
+ }
4078
+ /** A heading inside the menu: not focusable, skipped by the arrows. Names the
4079
+ * group of radios that follows it, if one does. */
4080
+ interface DropdownMenuLabelItem {
4081
+ type: 'label';
4082
+ key: string;
4083
+ label: ReactNode;
4084
+ }
4085
+ /** A line between entries (`role="separator"`). */
4086
+ interface DropdownMenuDividerItem {
4087
+ type: 'divider';
4088
+ key: string;
4089
+ }
4090
+ /** One choice of several — a theme, a language. Consecutive radios form one
4091
+ * group (`role="group"`); the checked one carries a check. */
4092
+ interface DropdownMenuRadioItem {
4093
+ type: 'radio';
4094
+ key: string;
4095
+ label: ReactNode;
4096
+ checked: boolean;
4097
+ onSelect: () => void;
4098
+ icon?: ReactNode;
4099
+ disabled?: boolean;
4100
+ }
4101
+ type DropdownMenuEntry = DropdownMenuItem | DropdownMenuLinkItem | DropdownMenuLabelItem | DropdownMenuDividerItem | DropdownMenuRadioItem;
3978
4102
  interface DropdownMenuProps {
3979
4103
  /** What opens the menu. Rendered inside the trigger button. */
3980
4104
  trigger: ReactNode;
3981
- items: DropdownMenuItem[];
3982
- /** Which edge the menu lines up with. `end` (the default) suits a menu at
3983
- * the right of a row, where a left-aligned one would run off the card. */
4105
+ items: DropdownMenuEntry[];
4106
+ /** Which edge the menu lines up with: `start` puts its left edge on the
4107
+ * trigger's left edge, `end` (the default) its right edge on the trigger's
4108
+ * right edge — which suits a menu at the right of a row, where a
4109
+ * left-aligned one would run off the card. Near the edge of the screen or
4110
+ * of its window the menu moves along rather than run off. */
3984
4111
  align?: DropdownMenuAlign;
3985
4112
  /** Which side of the trigger receives the menu. `bottom` is the default;
3986
- * footer action bars should use `top` so the menu stays inside the window. */
4113
+ * footer action bars should use `top`. Either way it opens on the other
4114
+ * side when there is no room on this one. */
3987
4115
  side?: DropdownMenuSide;
3988
- /** Names the trigger. Required in practice — the trigger is usually an icon. */
4116
+ /** Names the trigger, and the menu. Needed when the trigger is an icon;
4117
+ * without it both are named by the trigger's content. */
3989
4118
  'aria-label'?: string;
4119
+ /** On the element around the trigger. */
3990
4120
  className?: string;
4121
+ /** REPLACES the trigger button's own classes, for a trigger drawn as the
4122
+ * host's nav link or button. It stays a `<button aria-haspopup="menu">`. */
4123
+ triggerClassName?: string;
4124
+ /** Added to the menu's surface. */
4125
+ menuClassName?: string;
4126
+ /** The menu's narrowest: a number of pixels, or any CSS length. 180 px. */
4127
+ minWidth?: number | string;
4128
+ /** What a link entry is drawn as — a router's link (Next's `Link`) in place
4129
+ * of `<a>`. It receives `href`, `role`, `tabIndex`, `aria-current`,
4130
+ * `className`, `style`, the handlers and the label as children. */
4131
+ linkAs?: ElementType;
3991
4132
  disabled?: boolean;
3992
4133
  }
3993
- declare function DropdownMenu({ trigger, items, align, side, 'aria-label': ariaLabel, className, disabled, }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
4134
+ declare function DropdownMenu({ trigger, items, align, side, 'aria-label': ariaLabel, className, triggerClassName, menuClassName, minWidth, linkAs, disabled, }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
3994
4135
 
3995
4136
  /**
3996
4137
  * Unified popup menu component — used for all context menus, dropdowns, and flyouts.
@@ -4063,7 +4204,21 @@ interface PopupSubmenuProps {
4063
4204
  declare function PopupSubmenu({ label, icon, children, disabled, className, minWidth, maxHeight }: PopupSubmenuProps): react_jsx_runtime.JSX.Element;
4064
4205
  /** A divider line between menu items */
4065
4206
  declare function PopupMenuDivider(): react_jsx_runtime.JSX.Element;
4066
- /** A section header label */
4207
+ /**
4208
+ * A section header label.
4209
+ *
4210
+ * It was 10px `text-gray-400`: 2.5:1 on a white menu, under WCAG AA's 4.5:1
4211
+ * for text of any size, so an axe sweep with a menu open failed on every
4212
+ * label — and it was the smallest, faintest text in the menu, which is the
4213
+ * wrong way round for the words that say what the rows below are.
4214
+ *
4215
+ * Now 12px in `--ink-muted`, read as a token rather than through a grey
4216
+ * utility so it needs no dark remap: #4b5563 on white (7.6:1) and #9399b2 on
4217
+ * the dark `--surface` (5.8:1). The frosted glass is held to the same 4.5:1 at
4218
+ * its thinnest stop over the theme's `--line-strong` — `tests/menuLabelContrast`
4219
+ * does the sums from ui.css, so a ramp change that breaks it fails there. Still
4220
+ * a quieter voice than the rows: smaller, uppercase, a step lighter.
4221
+ */
4067
4222
  declare function PopupMenuLabel({ children }: {
4068
4223
  children: ReactNode;
4069
4224
  }): react_jsx_runtime.JSX.Element;
@@ -6135,6 +6290,22 @@ interface FormatDateOptions {
6135
6290
  * midnight and formats it in UTC for the same reason.
6136
6291
  */
6137
6292
  declare function formatDate(value: string | null | undefined, options?: FormatDateOptions): string;
6293
+ /**
6294
+ * The day a locale's weeks start on, as a calendar grid's `weekStartsOn`:
6295
+ * 1 for Monday (`en-AU`, `en-GB`, `de`), 0 for Sunday (`en-US`, `ja`) — and 0
6296
+ * without a locale, which is what every grid in the kit drew before it asked.
6297
+ *
6298
+ * `Intl.Locale` knows, where the runtime has the week data: `getWeekInfo()` in
6299
+ * current V8, the `weekInfo` getter it shipped as first (Chromium 99–129),
6300
+ * Safari's `weekInfo`. A runtime with neither — Firefox, an old Node — answers
6301
+ * 0, as does a tag `Intl.Locale` refuses. A locale whose week starts on
6302
+ * Saturday (`ar-EG`, `fa-IR`) also answers 0: the grid draws a Sunday- or a
6303
+ * Monday-first week and nothing else, and Sunday is the nearer.
6304
+ *
6305
+ * Bare languages are read the way `Intl` maximises them: `en` is `en-US`, so
6306
+ * Sunday. A host serving Australians says `en-AU`.
6307
+ */
6308
+ declare function firstDayOfWeek(locale?: string): 0 | 1;
6138
6309
 
6139
6310
  declare function useClickOutside(ref: RefObject<HTMLElement | null>, onClose: () => void): void;
6140
6311
 
@@ -6593,4 +6764,4 @@ declare function ChordChart({ labels, matrix, size, maxNodes, padAngle, arcWidth
6593
6764
  * string when the source is consumed without a build (e.g. tests). */
6594
6765
  declare const VERSION: string;
6595
6766
 
6596
- export { type BudgetBarProps as $, ALT as A, type BackgroundVariant as B, type ColumnDef as C, type BandScale as D, Banner as E, type BannerEmphasis as F, type BannerProps as G, type BannerTone as H, BarChart as I, type BarChartProps as J, type BoxPlotBox as K, BoxPlotChart as L, type BoxPlotChartProps as M, BrandAssetEditor as N, type BrandAssetEditorProps as O, type PaginatedResponse as P, type BrandAssetPreview as Q, BrandMark as R, type SearchConfig as S, type BrandMarkProps as T, type BrandMarkSlot as U, type BrandMarkSurface as V, type BrandMarkTreatment as W, type BreadcrumbItem as X, Breadcrumbs as Y, type BreadcrumbsProps as Z, BudgetBar as _, type SortState as a, ContainerFillChart as a$, type BudgetState as a0, Button as a1, type ButtonClassesOptions as a2, type ButtonProps as a3, type ButtonSize as a4, type ButtonVariant as a5, CHART_INK as a6, CMD_A as a7, CMD_DOT as a8, CMD_ENTER as a9, ChartHighlightProvider as aA, type ChartLegendEntry as aB, type ChartLegendSwatch as aC, type ChartRange as aD, type ChartReferenceLine as aE, type ChartRevealDirection as aF, ChartSkeleton as aG, type ChartSkeletonProps as aH, type ChartStatusTone as aI, type ChartStrokeVariant as aJ, ChartTooltip as aK, type ChartTooltipProps as aL, type ChartTooltipRow as aM, ChatTemplate as aN, Checkbox as aO, type CheckboxProps as aP, CheckoutTemplate as aQ, ChordChart as aR, type ChordChartProps as aS, ColoredBadge as aT, type ColoredBadgeProps as aU, ColumnChart as aV, type ColumnChartProps as aW, type ColumnSeries as aX, ComposerAttachments as aY, type ComposerAttachmentsProps as aZ, ConfirmProvider as a_, CMD_K as aa, CMD_S as ab, Calendar as ac, type CalendarMode as ad, type CalendarProps as ae, type Candle as af, CandlestickChart as ag, type CandlestickChartProps as ah, Card as ai, type CardPadding as aj, type CardProps as ak, CartesianPlot as al, type CartesianPlotProps as am, type CellStyle as an, type ChartBackgroundVariant as ao, ChartBrush as ap, type ChartBrushProps as aq, type ChartCurve as ar, ChartDefs as as, type ChartDefsProps as at, ChartDot as au, type ChartDotProps as av, type ChartDotVariant as aw, type ChartFillVariant as ax, ChartFrame as ay, type ChartFrameProps as az, ALT_SHIFT_D as b, FormLayoutPage as b$, type ContainerFillChartProps as b0, type ContainerFillItem as b1, CountBadge as b2, type CountBadgeProps as b3, type CountBadgeTone as b4, type Curve as b5, DAY_MS as b6, DEFAULT_SHELL_STRINGS as b7, DashboardTemplate as b8, DataTable as b9, type DrawerSide as bA, type DrawerSize as bB, DropdownMenu as bC, type DropdownMenuAlign as bD, type DropdownMenuItem as bE, type DropdownMenuProps as bF, type DropdownMenuSide as bG, type DropdownPositionOptions as bH, ENTER as bI, EditableGrid as bJ, type EditableGridProps as bK, EmailTemplate as bL, EmptyState as bM, type EmptyStateProps as bN, ErrorBoundary as bO, type ErrorBoundaryProps as bP, ErrorPage as bQ, type ErrorPageProps as bR, type FileIntake as bS, FilePicker as bT, type FilePickerProps as bU, type FillVariant as bV, type FormError as bW, FormErrorSummary as bX, type FormErrorSummaryProps as bY, FormField as bZ, type FormFieldProps as b_, type DataTableColumn as ba, type DataTableColumnGroup as bb, type DataTableHeader as bc, DataTablePage as bd, type DataTableProps as be, DatePicker as bf, type DatePickerProps as bg, DateRangePicker as bh, type DateRangePickerProps as bi, DateTimePicker as bj, type DateTimePickerProps as bk, type DescriptionColumns as bl, type DescriptionItem as bm, DescriptionList as bn, type DescriptionListProps as bo, Dialog as bp, type DialogProps as bq, type DialogSize as br, Divider as bs, type DividerProps as bt, type DividerSpacing as bu, DonutChart as bv, type DonutChartProps as bw, type DonutSegment as bx, Drawer as by, type DrawerProps as bz, ALT_SHIFT_E as c, MediaUploadGrid as c$, type FormatDateOptions as c0, FunnelChart as c1, type FunnelChartProps as c2, type FunnelStage as c3, GLASS_DIVIDER as c4, GLASS_INPUT_BG as c5, GROUP_COLORS as c6, GROUP_COLORS_SOLID as c7, GalleryTemplate as c8, type Gap as c9, type Justify as cA, Kanban as cB, type KanbanColumn as cC, type KanbanProps as cD, Kbd as cE, type KbdProps as cF, type KbdSize as cG, Label as cH, type LabelProps as cI, type LadderScale as cJ, LineChart as cK, type LineChartProps as cL, type LineChartSeries as cM, type LinearScale as cN, ListFooter as cO, ListLoadError as cP, type ListLoadErrorProps as cQ, LoadingSpinner as cR, type LoadingSpinnerProps as cS, MAX_FRACTION_DIGITS as cT, MENU_MAX_HEIGHT as cU, MOD as cV, MOTION as cW, Markdown as cX, type MarkdownProps as cY, MediaUploadField as cZ, type MediaUploadFieldProps as c_, GlobalSearch as ca, type GlobalSearchProps as cb, Grid as cc, type GridCols as cd, type GridColumn as ce, type GridProps as cf, HeatmapChart as cg, type HeatmapChartProps as ch, HelpCenter as ci, type HelpCenterDoc as cj, type HelpCenterProps as ck, type HistogramBin as cl, HistogramChart as cm, type HistogramChartProps as cn, INPUT_BASE as co, INPUT_SIZES as cp, IconButton as cq, type IconButtonClassesOptions as cr, type IconButtonProps as cs, Inline as ct, type InlineProps as cu, Input as cv, InputNumber as cw, type InputNumberProps as cx, type InputProps as cy, type InputSize as cz, ALT_SHIFT_N as d, RangeChart as d$, type MediaUploadGridItem as d0, type MediaUploadGridProps as d1, type MenuPos as d2, Meter as d3, type MeterProps as d4, MetricBar as d5, type MetricBarProps as d6, type Milestone as d7, type MilestoneKind as d8, MilestoneTimeline as d9, type PopupMenuProps as dA, PopupSubmenu as dB, type PopupSubmenuProps as dC, type PortalBrandingContextValue as dD, PortalBrandingProvider as dE, type PortalBrandingProviderProps as dF, ProductionTimeline as dG, type ProductionTimelineProps as dH, type ProductionTimelineSnapshot as dI, type ProgressItem as dJ, type PublicPortal as dK, type PublicPortalBranding as dL, RADAR_SERIES_CAP as dM, type RadarAxis as dN, RadarChart as dO, type RadarChartProps as dP, type RadarSeries as dQ, RadialBarChart as dR, type RadialBarChartProps as dS, type RadialBarRow as dT, Radio as dU, RadioGroup as dV, type RadioGroupOption as dW, type RadioGroupOrientation as dX, type RadioGroupProps as dY, type RadioProps as dZ, type Range as d_, type MilestoneTimelineProps as da, NEXT_CHUNK_PATH_PREFIX as db, NativeSelect as dc, NumericKeypad as dd, type NumericKeypadProps as de, OVERLAY_OPEN_EVENT as df, POPUP_MAX_WIDTH as dg, POST_PRODUCTION_STATUSES as dh, PageHeader as di, type PageHeaderProps as dj, Pagination as dk, type PaginationProps as dl, PaperclipGlyph as dm, Paragraph as dn, type ParagraphProps as dp, PieChart as dq, type PieChartProps as dr, type PieSegment as ds, type PlotGeometry as dt, type Point as du, PopupMenu as dv, PopupMenuDivider as dw, PopupMenuItem as dx, type PopupMenuItemProps as dy, PopupMenuLabel as dz, APP_UPDATE_POLL_MS as e, Stack as e$, type RangeChartProps as e0, type RangeRow as e1, RankedBars as e2, type RankedBarsProps as e3, type RankedBarsRow as e4, type ResolvedPortalBrandAsset as e5, Result as e6, type ResultProps as e7, type ResultStatus as e8, type RevealDirection as e9, type SelectOption as eA, type SelectProps as eB, type SemanticGroup as eC, SettingRow as eD, type SettingRowProps as eE, type SeverityTone as eF, type ShellPrefsAdapter as eG, ShellPrefsProvider as eH, type ShellStrings as eI, type ShellStringsOverride as eJ, ShellStringsProvider as eK, SidebarActionButton as eL, type SidebarActionButtonProps as eM, SidebarGroupLabel as eN, SidebarLayout as eO, type SidebarLayoutProps as eP, SidebarNavItem as eQ, type SidebarNavItemProps as eR, Skeleton as eS, type SkeletonProps as eT, type SkeletonVariant as eU, Snippet as eV, type SnippetProps as eW, type SnippetSize as eX, type SnippetVariant as eY, Sparkline as eZ, type SparklineProps as e_, SCATTER_SERIES_CAP as ea, SERIES_SLOT_COUNT as eb, SERIES_VARS as ec, SHIFT as ed, STAGES as ee, STALE_CHUNK_RELOAD_COOLDOWN_MS as ef, STALE_CHUNK_RELOAD_KEY as eg, STATUS_VARS as eh, SankeyChart as ei, type SankeyChartProps as ej, type SankeyLink as ek, type SankeyNode as el, ScatterChart as em, type ScatterChartProps as en, type ScatterPoint as eo, type ScatterSeries as ep, type SearchProvider as eq, type SearchResult as er, type SearchableOption as es, SearchableSelect as et, type SearchableSelectProps as eu, Segmented as ev, type SegmentedOption as ew, type SegmentedProps as ex, type SegmentedSize as ey, Select as ez, Accordion as f, type TooltipProps as f$, type StackProps as f0, type StaleChunkReloadOptions as f1, StatCard as f2, type StatCardProps as f3, StatTile as f4, type StatTileProps as f5, Statistic as f6, type StatisticProps as f7, type StatisticSize as f8, type StatisticTone as f9, type Theme as fA, TileButton as fB, type TileButtonProps as fC, type TileSize as fD, TimePicker as fE, type TimePickerProps as fF, TimeSeriesChart as fG, type TimeSeriesChartProps as fH, type TimeSeriesSeries as fI, type TimelineMarker as fJ, type TimelineMarkerKind as fK, type TimelineReport as fL, type TimelineScrubProgress as fM, TimelineTrack as fN, type TimelineTrackItem as fO, type TimelineTrackKind as fP, type TimelineTrackPending as fQ, type TimelineTrackPhase as fR, type TimelineTrackPlayback as fS, type TimelineTrackProps as fT, type TimelineTrackThumb as fU, Title as fV, type TitleLevel as fW, type TitleProps as fX, type ToastOptions as fY, type ToastPlacement as fZ, Tooltip as f_, StatusBadge as fa, StatusBadgeProvider as fb, type StatusEmphasis as fc, type StepItem as fd, Stepper as fe, type StepperProps as ff, type StrokeVariant as fg, SunburstChart as fh, type SunburstChartProps as fi, type SunburstNode as fj, Switch as fk, type SwitchProps as fl, type SwitchSize as fm, type TabItem as fn, Tabs as fo, type TabsProps as fp, TagInput as fq, type TagInputOption as fr, type TagInputProps as fs, Text as ft, type TextProps as fu, type TextSize as fv, type TextTone as fw, type TextWeight as fx, Textarea as fy, type TextareaProps as fz, type AccordionItem as g, radiusScale as g$, TopNav as g0, type TopNavItem as g1, type TopNavProps as g2, TreemapChart as g3, type TreemapChartProps as g4, type TreemapItem as g5, type TreemapTile as g6, type UseAppUpdateOptions as g7, type UseProductionTimelineOpts as g8, VERSION as g9, fillFor as gA, fillId as gB, fmtSliderDate as gC, formatDate as gD, fromKey as gE, glassStyle as gF, glowId as gG, groundId as gH, groupColors as gI, highlightOpacity as gJ, iconButtonClasses as gK, inputClasses as gL, installStaleChunkReload as gM, isMac as gN, isSeverityTone as gO, isStaleChunkError as gP, ladderScale as gQ, linearPath as gR, linearScale as gS, logScale as gT, maskId as gU, mediaFileName as gV, monotonePath as gW, niceMax as gX, polygonPoints as gY, popupBounds as gZ, prompt as g_, VITE_PRELOAD_ERROR_EVENT as ga, WaterfallChart as gb, type WaterfallChartProps as gc, type WaterfallStep as gd, type ZLayer as ge, Z_LAYERS as gf, angleScale as gg, appendKey as gh, applyThemePrefs as gi, arcPath as gj, areaBetween as gk, areaFrom as gl, autoHighlightIndex as gm, backspace as gn, bandScale as go, binValues as gp, budgetState as gq, bumpPath as gr, buttonClasses as gs, calcOverall as gt, calcReportOverall as gu, confirm as gv, confirmDestructive as gw, curvePath as gx, dashFor as gy, dismissPopups as gz, type AccordionProps as h, resolveBrandMarkTreatment as h0, resolvePortalBrandAsset as h1, resolveSeriesColor as h2, resolveTheme as h3, seriesColor as h4, severityOf as h5, splinePath as h6, squarify as h7, stagger as h8, stepPath as h9, tabButtonId as ha, tabPanelId as hb, toKey as hc, toDayMs as hd, toISODate as he, toast as hf, useAppUpdate as hg, useClickOutside as hh, useConfirm as hi, useDropdownPosition as hj, useFocusTrap as hk, useHighlight as hl, useIsMobile as hm, useLocalStoragePrefs as hn, usePlotWidth as ho, usePortalBranding as hp, useProductionTimeline as hq, useScrollLock as hr, useShellLocale as hs, useShellPrefs as ht, useShellStrings as hu, useTheme as hv, type Align as i, type AngleScale as j, AppUpdateBanner as k, type AppUpdateBannerProps as l, AttachButton as m, type AttachButtonProps as n, AttachmentDropZone as o, type AttachmentDropZoneProps as p, AttachmentList as q, type AttachmentListProps as r, AuthScreen as s, type AuthScreenProps as t, Avatar as u, AvatarGroup as v, type AvatarGroupProps as w, type AvatarProps as x, type AvatarSize as y, type AvatarStatus as z };
6767
+ export { type BudgetBarProps as $, ALT as A, type BackgroundVariant as B, type ColumnDef as C, type BandScale as D, Banner as E, type BannerEmphasis as F, type BannerProps as G, type BannerTone as H, BarChart as I, type BarChartProps as J, type BoxPlotBox as K, BoxPlotChart as L, type BoxPlotChartProps as M, BrandAssetEditor as N, type BrandAssetEditorProps as O, type PaginatedResponse as P, type BrandAssetPreview as Q, BrandMark as R, type SearchConfig as S, type BrandMarkProps as T, type BrandMarkSlot as U, type BrandMarkSurface as V, type BrandMarkTreatment as W, type BreadcrumbItem as X, Breadcrumbs as Y, type BreadcrumbsProps as Z, BudgetBar as _, type SortState as a, ContainerFillChart as a$, type BudgetState as a0, Button as a1, type ButtonClassesOptions as a2, type ButtonProps as a3, type ButtonSize as a4, type ButtonVariant as a5, CHART_INK as a6, CMD_A as a7, CMD_DOT as a8, CMD_ENTER as a9, ChartHighlightProvider as aA, type ChartLegendEntry as aB, type ChartLegendSwatch as aC, type ChartRange as aD, type ChartReferenceLine as aE, type ChartRevealDirection as aF, ChartSkeleton as aG, type ChartSkeletonProps as aH, type ChartStatusTone as aI, type ChartStrokeVariant as aJ, ChartTooltip as aK, type ChartTooltipProps as aL, type ChartTooltipRow as aM, ChatTemplate as aN, Checkbox as aO, type CheckboxProps as aP, CheckoutTemplate as aQ, ChordChart as aR, type ChordChartProps as aS, ColoredBadge as aT, type ColoredBadgeProps as aU, ColumnChart as aV, type ColumnChartProps as aW, type ColumnSeries as aX, ComposerAttachments as aY, type ComposerAttachmentsProps as aZ, ConfirmProvider as a_, CMD_K as aa, CMD_S as ab, Calendar as ac, type CalendarMode as ad, type CalendarProps as ae, type Candle as af, CandlestickChart as ag, type CandlestickChartProps as ah, Card as ai, type CardPadding as aj, type CardProps as ak, CartesianPlot as al, type CartesianPlotProps as am, type CellStyle as an, type ChartBackgroundVariant as ao, ChartBrush as ap, type ChartBrushProps as aq, type ChartCurve as ar, ChartDefs as as, type ChartDefsProps as at, ChartDot as au, type ChartDotProps as av, type ChartDotVariant as aw, type ChartFillVariant as ax, ChartFrame as ay, type ChartFrameProps as az, ALT_SHIFT_D as b, type FormError as b$, type ContainerFillChartProps as b0, type ContainerFillItem as b1, CountBadge as b2, type CountBadgeProps as b3, type CountBadgeTone as b4, type Curve as b5, DAY_MS as b6, DEFAULT_SHELL_STRINGS as b7, DashboardTemplate as b8, DataTable as b9, type DrawerSide as bA, type DrawerSize as bB, DropdownMenu as bC, type DropdownMenuAlign as bD, type DropdownMenuDividerItem as bE, type DropdownMenuEntry as bF, type DropdownMenuItem as bG, type DropdownMenuLabelItem as bH, type DropdownMenuLinkItem as bI, type DropdownMenuProps as bJ, type DropdownMenuRadioItem as bK, type DropdownMenuSide as bL, type DropdownPositionOptions as bM, ENTER as bN, EditableGrid as bO, type EditableGridProps as bP, EmailTemplate as bQ, EmptyState as bR, type EmptyStateProps as bS, ErrorBoundary as bT, type ErrorBoundaryProps as bU, ErrorPage as bV, type ErrorPageProps as bW, type FileIntake as bX, FilePicker as bY, type FilePickerProps as bZ, type FillVariant as b_, type DataTableColumn as ba, type DataTableColumnGroup as bb, type DataTableHeader as bc, DataTablePage as bd, type DataTableProps as be, DatePicker as bf, type DatePickerProps as bg, DateRangePicker as bh, type DateRangePickerProps as bi, DateTimePicker as bj, type DateTimePickerProps as bk, type DescriptionColumns as bl, type DescriptionItem as bm, DescriptionList as bn, type DescriptionListProps as bo, Dialog as bp, type DialogProps as bq, type DialogSize as br, Divider as bs, type DividerProps as bt, type DividerSpacing as bu, DonutChart as bv, type DonutChartProps as bw, type DonutSegment as bx, Drawer as by, type DrawerProps as bz, ALT_SHIFT_E as c, MOTION as c$, FormErrorSummary as c0, type FormErrorSummaryProps as c1, FormField as c2, type FormFieldProps as c3, FormLayoutPage as c4, type FormatDateOptions as c5, FunnelChart as c6, type FunnelChartProps as c7, type FunnelStage as c8, GLASS_DIVIDER as c9, Input as cA, InputNumber as cB, type InputNumberProps as cC, type InputProps as cD, type InputSize as cE, type Justify as cF, Kanban as cG, type KanbanColumn as cH, type KanbanProps as cI, Kbd as cJ, type KbdProps as cK, type KbdSize as cL, Label as cM, type LabelProps as cN, type LadderScale as cO, LineChart as cP, type LineChartProps as cQ, type LineChartSeries as cR, type LinearScale as cS, ListFooter as cT, ListLoadError as cU, type ListLoadErrorProps as cV, LoadingSpinner as cW, type LoadingSpinnerProps as cX, MAX_FRACTION_DIGITS as cY, MENU_MAX_HEIGHT as cZ, MOD as c_, GLASS_INPUT_BG as ca, GROUP_COLORS as cb, GROUP_COLORS_SOLID as cc, GalleryTemplate as cd, type Gap as ce, GlobalSearch as cf, type GlobalSearchProps as cg, Grid as ch, type GridCols as ci, type GridColumn as cj, type GridProps as ck, HeatmapChart as cl, type HeatmapChartProps as cm, HelpCenter as cn, type HelpCenterDoc as co, type HelpCenterProps as cp, type HistogramBin as cq, HistogramChart as cr, type HistogramChartProps as cs, INPUT_BASE as ct, INPUT_SIZES as cu, IconButton as cv, type IconButtonClassesOptions as cw, type IconButtonProps as cx, Inline as cy, type InlineProps as cz, ALT_SHIFT_N as d, type RadioGroupOption as d$, Markdown as d0, type MarkdownProps as d1, MediaUploadField as d2, type MediaUploadFieldProps as d3, MediaUploadGrid as d4, type MediaUploadGridItem as d5, type MediaUploadGridProps as d6, type MenuPos as d7, Meter as d8, type MeterProps as d9, PopupMenu as dA, PopupMenuDivider as dB, PopupMenuItem as dC, type PopupMenuItemProps as dD, PopupMenuLabel as dE, type PopupMenuProps as dF, PopupSubmenu as dG, type PopupSubmenuProps as dH, type PortalBrandingContextValue as dI, PortalBrandingProvider as dJ, type PortalBrandingProviderProps as dK, ProductionTimeline as dL, type ProductionTimelineProps as dM, type ProductionTimelineSnapshot as dN, type ProgressItem as dO, type PublicPortal as dP, type PublicPortalBranding as dQ, RADAR_SERIES_CAP as dR, type RadarAxis as dS, RadarChart as dT, type RadarChartProps as dU, type RadarSeries as dV, RadialBarChart as dW, type RadialBarChartProps as dX, type RadialBarRow as dY, Radio as dZ, RadioGroup as d_, MetricBar as da, type MetricBarProps as db, type Milestone as dc, type MilestoneKind as dd, MilestoneTimeline as de, type MilestoneTimelineProps as df, NEXT_CHUNK_PATH_PREFIX as dg, NativeSelect as dh, NumericKeypad as di, type NumericKeypadProps as dj, OVERLAY_OPEN_EVENT as dk, POPUP_MAX_WIDTH as dl, POST_PRODUCTION_STATUSES as dm, PageHeader as dn, type PageHeaderProps as dp, Pagination as dq, type PaginationProps as dr, PaperclipGlyph as ds, Paragraph as dt, type ParagraphProps as du, PieChart as dv, type PieChartProps as dw, type PieSegment as dx, type PlotGeometry as dy, type Point as dz, APP_UPDATE_POLL_MS as e, type SnippetProps as e$, type RadioGroupOrientation as e0, type RadioGroupProps as e1, type RadioProps as e2, type Range as e3, RangeChart as e4, type RangeChartProps as e5, type RangeRow as e6, RankedBars as e7, type RankedBarsProps as e8, type RankedBarsRow as e9, Segmented as eA, type SegmentedOption as eB, type SegmentedProps as eC, type SegmentedSize as eD, Select as eE, type SelectOption as eF, type SelectProps as eG, type SemanticGroup as eH, SettingRow as eI, type SettingRowProps as eJ, type SeverityTone as eK, type ShellPrefsAdapter as eL, ShellPrefsProvider as eM, type ShellStrings as eN, type ShellStringsOverride as eO, ShellStringsProvider as eP, SidebarActionButton as eQ, type SidebarActionButtonProps as eR, SidebarGroupLabel as eS, SidebarLayout as eT, type SidebarLayoutProps as eU, SidebarNavItem as eV, type SidebarNavItemProps as eW, Skeleton as eX, type SkeletonProps as eY, type SkeletonVariant as eZ, Snippet as e_, type ResolvedPortalBrandAsset as ea, Result as eb, type ResultProps as ec, type ResultStatus as ed, type RevealDirection as ee, SCATTER_SERIES_CAP as ef, SERIES_SLOT_COUNT as eg, SERIES_VARS as eh, SHIFT as ei, STAGES as ej, STALE_CHUNK_RELOAD_COOLDOWN_MS as ek, STALE_CHUNK_RELOAD_KEY as el, STATUS_VARS as em, SankeyChart as en, type SankeyChartProps as eo, type SankeyLink as ep, type SankeyNode as eq, ScatterChart as er, type ScatterChartProps as es, type ScatterPoint as et, type ScatterSeries as eu, type SearchProvider as ev, type SearchResult as ew, type SearchableOption as ex, SearchableSelect as ey, type SearchableSelectProps as ez, Accordion as f, type TitleLevel as f$, type SnippetSize as f0, type SnippetVariant as f1, Sparkline as f2, type SparklineProps as f3, Stack as f4, type StackProps as f5, type StaleChunkReloadOptions as f6, StatCard as f7, type StatCardProps as f8, StatTile as f9, type TextSize as fA, type TextTone as fB, type TextWeight as fC, Textarea as fD, type TextareaProps as fE, type Theme as fF, TileButton as fG, type TileButtonProps as fH, type TileSize as fI, TimePicker as fJ, type TimePickerProps as fK, TimeSeriesChart as fL, type TimeSeriesChartProps as fM, type TimeSeriesSeries as fN, type TimelineMarker as fO, type TimelineMarkerKind as fP, type TimelineReport as fQ, type TimelineScrubProgress as fR, TimelineTrack as fS, type TimelineTrackItem as fT, type TimelineTrackKind as fU, type TimelineTrackPending as fV, type TimelineTrackPhase as fW, type TimelineTrackPlayback as fX, type TimelineTrackProps as fY, type TimelineTrackThumb as fZ, Title as f_, type StatTileProps as fa, Statistic as fb, type StatisticProps as fc, type StatisticSize as fd, type StatisticTone as fe, StatusBadge as ff, StatusBadgeProvider as fg, type StatusEmphasis as fh, type StepItem as fi, Stepper as fj, type StepperProps as fk, type StrokeVariant as fl, SunburstChart as fm, type SunburstChartProps as fn, type SunburstNode as fo, Switch as fp, type SwitchProps as fq, type SwitchSize as fr, type TabItem as fs, Tabs as ft, type TabsProps as fu, TagInput as fv, type TagInputOption as fw, type TagInputProps as fx, Text as fy, type TextProps as fz, type AccordionItem as g, mediaFileName as g$, type TitleProps as g0, type ToastOptions as g1, type ToastPlacement as g2, Tooltip as g3, type TooltipProps as g4, TopNav as g5, type TopNavItem as g6, type TopNavProps as g7, TreemapChart as g8, type TreemapChartProps as g9, confirm as gA, confirmDestructive as gB, curvePath as gC, dashFor as gD, dismissPopups as gE, fillFor as gF, fillId as gG, firstDayOfWeek as gH, fmtSliderDate as gI, formatDate as gJ, fromKey as gK, glassStyle as gL, glowId as gM, groundId as gN, groupColors as gO, highlightOpacity as gP, iconButtonClasses as gQ, inputClasses as gR, installStaleChunkReload as gS, isMac as gT, isSeverityTone as gU, isStaleChunkError as gV, ladderScale as gW, linearPath as gX, linearScale as gY, logScale as gZ, maskId as g_, type TreemapItem as ga, type TreemapTile as gb, type UseAppUpdateOptions as gc, type UseProductionTimelineOpts as gd, VERSION as ge, VITE_PRELOAD_ERROR_EVENT as gf, WaterfallChart as gg, type WaterfallChartProps as gh, type WaterfallStep as gi, type ZLayer as gj, Z_LAYERS as gk, angleScale as gl, appendKey as gm, applyThemePrefs as gn, arcPath as go, areaBetween as gp, areaFrom as gq, autoHighlightIndex as gr, backspace as gs, bandScale as gt, binValues as gu, budgetState as gv, bumpPath as gw, buttonClasses as gx, calcOverall as gy, calcReportOverall as gz, type AccordionProps as h, monotonePath as h0, niceMax as h1, polygonPoints as h2, popupBounds as h3, prompt as h4, radiusScale as h5, resolveBrandMarkTreatment as h6, resolvePortalBrandAsset as h7, resolveSeriesColor as h8, resolveTheme as h9, useShellStrings as hA, useTheme as hB, seriesColor as ha, severityOf as hb, splinePath as hc, squarify as hd, stagger as he, stepPath as hf, tabButtonId as hg, tabPanelId as hh, toKey as hi, toDayMs as hj, toISODate as hk, toast as hl, useAppUpdate as hm, useClickOutside as hn, useConfirm as ho, useDropdownPosition as hp, useFocusTrap as hq, useHighlight as hr, useIsMobile as hs, useLocalStoragePrefs as ht, usePlotWidth as hu, usePortalBranding as hv, useProductionTimeline as hw, useScrollLock as hx, useShellLocale as hy, useShellPrefs as hz, type Align as i, type AngleScale as j, AppUpdateBanner as k, type AppUpdateBannerProps as l, AttachButton as m, type AttachButtonProps as n, AttachmentDropZone as o, type AttachmentDropZoneProps as p, AttachmentList as q, type AttachmentListProps as r, AuthScreen as s, type AuthScreenProps as t, Avatar as u, AvatarGroup as v, type AvatarGroupProps as w, type AvatarProps as x, type AvatarSize as y, type AvatarStatus as z };