efficient-shell 13.22.1 → 13.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +48 -0
  2. package/dist/{Browser-ZNJ3OZSE.js → Browser-I2UVUUVV.js} +13 -13
  3. package/dist/{Calculator-BPQPQUZN.js → Calculator-PHIOJNTS.js} +20 -20
  4. package/dist/CodeEditor-VN76K3MD.js +1 -0
  5. package/dist/{CurrencyConverter-M4UJI6VQ.js → CurrencyConverter-WZXN6WTD.js} +5 -5
  6. package/dist/{Files-4HACSJ7C.js → Files-KA5Y6G4P.js} +62 -62
  7. package/dist/{Notepad-SK2E5VOK.js → Notepad-RSEI2F3I.js} +8 -8
  8. package/dist/{PomodoroTimer-BR5NOA24.js → PomodoroTimer-WVIAWG5E.js} +39 -39
  9. package/dist/{Preview-CLV2ZAU5.js → Preview-EPATSSFI.js} +7 -7
  10. package/dist/{Stock-LZ2QHPU4.js → Stock-SHKXRWJQ.js} +3 -3
  11. package/dist/{Weather-Q22ZW7ZQ.js → Weather-WMKWOPBU.js} +16 -16
  12. package/dist/{WorldClock-4MSSRLC7.js → WorldClock-GZYOF4B2.js} +4 -4
  13. package/dist/ai/index.js +52 -52
  14. package/dist/apps/index.js +1 -1
  15. package/dist/bin/browser-check.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/brand.css +1 -1
  19. package/dist/charts/PieChart.js +1 -1
  20. package/dist/charts/RadarChart.js +1 -1
  21. package/dist/charts/RadialBarChart.js +1 -1
  22. package/dist/charts/SpecChart.js +1 -1
  23. package/dist/charts/TimeSeriesChart.js +1 -1
  24. package/dist/{chunk-GPU7LLTJ.js → chunk-2L4IOLOT.js} +1 -1
  25. package/dist/{chunk-7G5HKAGV.js → chunk-3WUVYXCF.js} +5 -5
  26. package/dist/{chunk-7N42VDGT.js → chunk-4L5YRMJ4.js} +12 -12
  27. package/dist/{chunk-P3JPSO3E.js → chunk-5CHJA4RL.js} +3 -3
  28. package/dist/{chunk-FE7H6RXE.js → chunk-65BW43PF.js} +2 -2
  29. package/dist/{chunk-UJY5RUZ5.js → chunk-6AETKYCP.js} +1 -1
  30. package/dist/{chunk-QRPPWLKU.js → chunk-6EGZ4PV4.js} +2 -2
  31. package/dist/{chunk-FMBUR4EU.js → chunk-7PYJEJDT.js} +1 -1
  32. package/dist/{chunk-JJYTN72U.js → chunk-CCZHSISF.js} +3 -3
  33. package/dist/{chunk-RM2I6DIF.js → chunk-CZS5UHOU.js} +1 -1
  34. package/dist/{chunk-3AMCLA5Q.js → chunk-GAEQYCLS.js} +1 -1
  35. package/dist/{chunk-DEE6FKE7.js → chunk-H2Q7G5D6.js} +33 -33
  36. package/dist/{chunk-QJUMBOL2.js → chunk-IMH5H47S.js} +6 -6
  37. package/dist/{chunk-R7CYBBJY.js → chunk-JIJZBM25.js} +6 -6
  38. package/dist/{chunk-LRMDLZMM.js → chunk-JVENCUUG.js} +4 -4
  39. package/dist/chunk-KH4AMHSI.js +1 -0
  40. package/dist/{chunk-BUMY4LIP.js → chunk-L4W5X3Q4.js} +3 -3
  41. package/dist/{chunk-PHYHKDSW.js → chunk-LM6MSGDW.js} +1 -1
  42. package/dist/chunk-M3HBGN5K.js +1 -0
  43. package/dist/chunk-MRFFOJCS.js +28 -0
  44. package/dist/chunk-N4FUMDAI.js +1 -0
  45. package/dist/{chunk-ZBGPAUOH.js → chunk-N4LMFGRI.js} +5 -5
  46. package/dist/{chunk-23YQNCZ4.js → chunk-NF5HSFZ3.js} +16 -16
  47. package/dist/{chunk-E4GF7M4S.js → chunk-OOND66P2.js} +5 -5
  48. package/dist/{chunk-EJJTDUN3.js → chunk-P5TSGXL4.js} +13 -13
  49. package/dist/{chunk-7N6CVTWO.js → chunk-P6H2B635.js} +1 -1
  50. package/dist/{chunk-6UGMQZTF.js → chunk-PI2W6MML.js} +1 -1
  51. package/dist/{chunk-3SKXWFGG.js → chunk-PP3WUT2G.js} +5 -5
  52. package/dist/{chunk-Z6J4KXY3.js → chunk-PWOVSR7N.js} +6 -6
  53. package/dist/{chunk-F3EBYHIE.js → chunk-S5MTTJ3F.js} +10 -10
  54. package/dist/{chunk-SAHRIE35.js → chunk-T7A3Y64S.js} +1 -1
  55. package/dist/{chunk-J5OAQAAD.js → chunk-TJBHFUWV.js} +4 -4
  56. package/dist/{chunk-LUARJHUK.js → chunk-TJG76Y7I.js} +8 -8
  57. package/dist/{chunk-SKVLTYGN.js → chunk-TT7KXS2Q.js} +1 -1
  58. package/dist/{chunk-JZ43635V.js → chunk-TTRLYWP4.js} +1 -1
  59. package/dist/{chunk-OFMZ6JM6.js → chunk-UR3J4WP6.js} +12 -12
  60. package/dist/{chunk-AFYLMXOJ.js → chunk-UU42O5ON.js} +5 -5
  61. package/dist/{chunk-QPVYBN4J.js → chunk-VLBLDSA6.js} +1 -1
  62. package/dist/{chunk-L744YF4X.js → chunk-VMAIZU5S.js} +1 -1
  63. package/dist/{chunk-6CFI4YGI.js → chunk-VP2IQJUD.js} +4 -4
  64. package/dist/{chunk-ONWFKCMB.js → chunk-VT5HWPE2.js} +9 -9
  65. package/dist/{chunk-5JUXMNUC.js → chunk-ZKILZFUI.js} +1 -1
  66. package/dist/{chunk-TSCJG6UM.js → chunk-ZMBGMEN5.js} +1 -1
  67. package/dist/code/index.d.ts +20 -0
  68. package/dist/code/index.js +2 -0
  69. package/dist/data/DataTable.js +1 -1
  70. package/dist/data/EntityList.js +1 -1
  71. package/dist/data/ResizableTable.js +1 -1
  72. package/dist/format/index.js +1 -1
  73. package/dist/forms/BorderInput.js +1 -1
  74. package/dist/forms/BrandAssetEditor.js +1 -1
  75. package/dist/forms/ColorPicker.js +1 -1
  76. package/dist/forms/ComposerAttachments.js +1 -1
  77. package/dist/forms/CornersInput.js +1 -1
  78. package/dist/forms/DateRangePicker.js +1 -1
  79. package/dist/forms/Input.js +1 -1
  80. package/dist/forms/InputNumber.js +1 -1
  81. package/dist/forms/LinkPicker.js +1 -1
  82. package/dist/forms/MediaLibrary.js +1 -1
  83. package/dist/forms/MediaUploadField.js +1 -1
  84. package/dist/forms/MediaUploadGrid.js +1 -1
  85. package/dist/forms/PositionInput.js +1 -1
  86. package/dist/forms/RenameField.js +1 -1
  87. package/dist/forms/SidesInput.js +1 -1
  88. package/dist/forms/Slider.js +1 -1
  89. package/dist/forms/WidthsBar.js +1 -1
  90. package/dist/icons/brands.node.js +1 -1
  91. package/dist/icons/efficient-glyphs.js +1 -1
  92. package/dist/icons/efficient-looks.js +1 -1
  93. package/dist/icons/efficient.js +1 -1
  94. package/dist/icons/index.js +1 -1
  95. package/dist/icons/looks/map.js +1 -1
  96. package/dist/icons/payment.js +1 -1
  97. package/dist/icons/sets.js +1 -1
  98. package/dist/index.js +125 -125
  99. package/dist/shell/EditableGrid.js +1 -1
  100. package/dist/shell/IconRail.js +1 -1
  101. package/dist/shell/LanguageSelect.js +1 -1
  102. package/dist/shell/SearchableSelect.js +1 -1
  103. package/dist/shell/SettingRow.js +1 -1
  104. package/dist/telemetry/index.js +1 -1
  105. package/dist/templates/AuthScreen.js +1 -1
  106. package/dist/templates/ChatTemplate.js +1 -1
  107. package/dist/templates/CheckoutTemplate.js +1 -1
  108. package/dist/templates/DashboardTemplate.js +1 -1
  109. package/dist/templates/DataTablePage.js +1 -1
  110. package/dist/templates/FormLayoutPage.js +1 -1
  111. package/dist/ui/index.js +1 -1
  112. package/dist/ui.css +44 -0
  113. package/dist/version.js +1 -1
  114. package/package.json +46 -1
  115. package/dist/chunk-3SIHJWR2.js +0 -28
  116. package/dist/chunk-KBQXXPFK.js +0 -1
  117. package/dist/chunk-KUPN5WRE.js +0 -1
  118. package/dist/chunk-OTEAWX2C.js +0 -1
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{PieChart as default}from"../chunk-QRPPWLKU.js";import"../chunk-465RRWBY.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
2
+ export{PieChart as default}from"../chunk-6EGZ4PV4.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-3SKXWFGG.js";import"../chunk-ZDFMYAQB.js";import"../chunk-465RRWBY.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-TD3ZQD5R.js";import"../chunk-F2RAIGCG.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-VY3UA6AR.js";import"../chunk-WCCS4VFE.js";import"../chunk-ZDXRSY2Y.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
2
+ export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-PP3WUT2G.js";import"../chunk-ZDFMYAQB.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-TD3ZQD5R.js";import"../chunk-F2RAIGCG.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-VY3UA6AR.js";import"../chunk-WCCS4VFE.js";import"../chunk-ZDXRSY2Y.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{RadialBarChart as default}from"../chunk-E4GF7M4S.js";import"../chunk-465RRWBY.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
2
+ export{RadialBarChart as default}from"../chunk-OOND66P2.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
@@ -1 +1 @@
1
- export{SpecChart as default}from"../chunk-FE7H6RXE.js";import"../chunk-OJI4ROSD.js";import"../chunk-NHKT5IH6.js";import"../chunk-36BRD5J3.js";import"../chunk-JRQMX4PK.js";import"../chunk-LF27WIN2.js";import"../chunk-EJJTDUN3.js";import"../chunk-AQVPWUJ3.js";import"../chunk-465RRWBY.js";import"../chunk-SAMPXZF3.js";import"../chunk-CK2YOGUS.js";import"../chunk-A6TOHNJY.js";import"../chunk-MEFB2KGF.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-BWJZTHZ6.js";import"../chunk-TD3ZQD5R.js";import"../chunk-F2RAIGCG.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-VY3UA6AR.js";import"../chunk-WCCS4VFE.js";import"../chunk-ZDXRSY2Y.js";import"../chunk-S4RD6UJU.js";import"../chunk-LLSGIMLG.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
1
+ export{SpecChart as default}from"../chunk-65BW43PF.js";import"../chunk-OJI4ROSD.js";import"../chunk-NHKT5IH6.js";import"../chunk-36BRD5J3.js";import"../chunk-JRQMX4PK.js";import"../chunk-LF27WIN2.js";import"../chunk-P5TSGXL4.js";import"../chunk-SAMPXZF3.js";import"../chunk-CK2YOGUS.js";import"../chunk-A6TOHNJY.js";import"../chunk-VFC6QUEN.js";import"../chunk-AQVPWUJ3.js";import"../chunk-465RRWBY.js";import"../chunk-MEFB2KGF.js";import"../chunk-CNYAHYE6.js";import"../chunk-BWJZTHZ6.js";import"../chunk-TD3ZQD5R.js";import"../chunk-F2RAIGCG.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-VY3UA6AR.js";import"../chunk-WCCS4VFE.js";import"../chunk-ZDXRSY2Y.js";import"../chunk-S4RD6UJU.js";import"../chunk-LLSGIMLG.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{TimeSeriesChart as default}from"../chunk-EJJTDUN3.js";import"../chunk-465RRWBY.js";import"../chunk-SAMPXZF3.js";import"../chunk-CK2YOGUS.js";import"../chunk-MEFB2KGF.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-LLSGIMLG.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
2
+ export{TimeSeriesChart as default}from"../chunk-P5TSGXL4.js";import"../chunk-SAMPXZF3.js";import"../chunk-CK2YOGUS.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-MEFB2KGF.js";import"../chunk-CNYAHYE6.js";import"../chunk-LLSGIMLG.js";import"../chunk-2JWPNR2U.js";import"../chunk-WDQI3FV6.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";
@@ -1,2 +1,2 @@
1
- import{Input_default as e}from"./chunk-J5OAQAAD.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
1
+ import{Input_default as e}from"./chunk-TJBHFUWV.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
2
2
  return o(e,{size:"sm",autoFocus:!0,"aria-label":a,value:l,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),p(l.trim()||n)):"Escape"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(l.trim()||n),onClick:e=>e.stopPropagation()})}export{n as RenameField};
@@ -1,6 +1,6 @@
1
- import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-QPVYBN4J.js";import{textWidth as l}from"./chunk-UVCMV2TL.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useId as s,useRef as c,useState as u,useEffect as d,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,r,t)=>Math.min(t,Math.max(r,e)),g=e=>e.reduce((e,r)=>e+r,0),v=(e,r)=>e.length===r.length&&e.every((e,t)=>e===r[t]);var b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:R=!1,className:M=""}){const j=a().widths,z=s(),A=p(Math.round(x)||1,1,n),B=e($,A),S=B??[...r[A]??[]],D=[...S,100-g(S)],G=P||R,K=c(null),O=c({onChange:k,shown:S,locked:G,n:A,stored:B});O.current={onChange:k,shown:S,locked:G,n:A,stored:B};const T=r=>{const{onChange:t,shown:n,locked:o,n:l}=O.current;if(o)return!1;const i=e(r,l);return!(!i||v(i,n))&&(t(i),!0)},H=(e,r,n)=>{const o=e[r]+e[r+1],l=[...e];l[r]=p(Math.round(n),t,o-t),l[r+1]=o-l[r],T(l.slice(0,-1))&&(ne.current=null)},I=e=>r=>{if(r.altKey||r.ctrlKey||r.metaKey)return;const n=r.shiftKey?10:1,o=D[e]+D[e+1],l="ArrowRight"===r.key?D[e]+n:"ArrowLeft"===r.key?D[e]-n:"PageUp"===r.key?D[e]+10:"PageDown"===r.key?D[e]-10:"Home"===r.key?t:"End"===r.key?o-t:null;null!==l&&(r.preventDefault(),H(D,e,l))},L=c(null),[V,E]=u(null),F=()=>{L.current=null,E(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};d(()=>F,[]);const U=e=>r=>{if(0!==r.button||G)return;r.preventDefault();const t=K.current?.getBoundingClientRect().width??0;t<=0||(L.current={i:e,x:r.clientX,width:t,from:D,moved:!1,pointer:r.pointerId},E(e),r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},J=e=>{const r=L.current;if(!r)return;if(0===e.buttons)return void F();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}H(r.from,r.i,r.from[r.i]+t/r.width*100)},Q=e=>{const r=L.current;r&&(e.currentTarget.hasPointerCapture?.(r.pointer)&&e.currentTarget.releasePointerCapture(r.pointer),F())},W=(e,r)=>{const{shown:n}=O.current,o=function(e,r,n){const o=e.length,l=[...e];if(o<2)return l;const i=p(Math.round(n),t,100-(o-1)*t);let a=i-l[r];l[r]=i;const s=[...Array.from({length:o-1-r},(e,t)=>r+1+t),...Array.from({length:r},(e,t)=>r-1-t)];if(a<0)return l[s[0]]-=a,l;for(const e of s){if(a<=0)break;const r=Math.min(a,l[e]-t);l[e]-=r,a-=r}return l}([...n,100-g(n)],e,r);return T(o.slice(0,-1))?o:null},[X,q]=u(0);d(()=>{const e=K.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>q(e.getBoundingClientRect().width));return r.observe(e),()=>r.disconnect()},[]);const Y=c(null),[Z,_]=u(null),[ee,re]=u([]),te=(e,r)=>_(t=>r?e:t===e?null:t),ne=c(null),oe=(e,r)=>{const t=ne.current;if(!t||t.column!==e||t.share!==r)return!1;const{onChange:n,locked:o,stored:l}=O.current;var i,a;return o||(i=l,a=t.stored,void 0===i||void 0===a?i===a:v(i,a))||n(t.stored),!0},le=D.join(",");d(()=>{const e=null===Z?[]:function(e,r){if(!e)return[];const t=Array.from(e.querySelectorAll("input[data-widths-label]")),n=t[r]?.getBoundingClientRect();return n&&0!==n.width?null===l("","12px sans-serif")?[]:t.flatMap((e,t)=>{if(t===r)return[];const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=(l(e.value,`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`)??0)/2,s=(o.left+o.right)/2;return s+a>n.left&&s-a<n.right?[t]:[]}):[]}(Y.current,Z);re(r=>v(r,e)?r:e)},[Z,le,X]);const ie=j.hint(A,t),ae=D.slice(0,-1).map((e,r)=>g(D.slice(0,r+1)));/* @__PURE__ */
2
- return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":A>1?z:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${R?"opacity-60":""} ${M}`.trim(),children:[
1
+ import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as r,COLUMN_SHARE_MIN as t,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-VLBLDSA6.js";import{textWidth as l}from"./chunk-UVCMV2TL.js";import{Tooltip as i}from"./chunk-F2RAIGCG.js";import{useShellStrings as a}from"./chunk-NRHG4R2Q.js";import{useId as s,useRef as c,useState as u,useEffect as d,Fragment as h}from"react";import{jsxs as f,jsx as m}from"react/jsx-runtime";var p=(e,r,t)=>Math.min(t,Math.max(r,e)),g=e=>e.reduce((e,r)=>e+r,0),v=(e,r)=>e.length===r.length&&e.every((e,t)=>e===r[t]);var b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:R=!1,className:M=""}){const j=a().widths,A=s(),z=p(Math.round(x)||1,1,n),B=e($,z),S=B??[...r[z]??[]],D=[...S,100-g(S)],L=P||R,G=c(null),K=c({onChange:k,shown:S,locked:L,n:z,stored:B});K.current={onChange:k,shown:S,locked:L,n:z,stored:B};const O=r=>{const{onChange:t,shown:n,locked:o,n:l}=K.current;if(o)return!1;const i=e(r,l);return!(!i||v(i,n))&&(t(i),!0)},T=(e,r,n)=>{const o=e[r]+e[r+1],l=[...e];l[r]=p(Math.round(n),t,o-t),l[r+1]=o-l[r],O(l.slice(0,-1))&&(ne.current=null)},H=e=>r=>{if(r.altKey||r.ctrlKey||r.metaKey)return;const n=r.shiftKey?10:1,o=D[e]+D[e+1],l="ArrowRight"===r.key?D[e]+n:"ArrowLeft"===r.key?D[e]-n:"PageUp"===r.key?D[e]+10:"PageDown"===r.key?D[e]-10:"Home"===r.key?t:"End"===r.key?o-t:null;null!==l&&(r.preventDefault(),T(D,e,l))},I=c(null),[V,E]=u(null),F=()=>{I.current=null,E(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};d(()=>F,[]);const U=e=>r=>{if(0!==r.button||L)return;r.preventDefault();const t=G.current?.getBoundingClientRect().width??0;t<=0||(I.current={i:e,x:r.clientX,width:t,from:D,moved:!1,pointer:r.pointerId},E(e),r.currentTarget.setPointerCapture?.(r.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},W=e=>{const r=I.current;if(!r)return;if(0===e.buttons)return void F();const t=e.clientX-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}T(r.from,r.i,r.from[r.i]+t/r.width*100)},X=e=>{const r=I.current;r&&(e.currentTarget.hasPointerCapture?.(r.pointer)&&e.currentTarget.releasePointerCapture(r.pointer),F())},q=(e,r)=>{const{shown:n}=K.current,o=function(e,r,n){const o=e.length,l=[...e];if(o<2)return l;const i=p(Math.round(n),t,100-(o-1)*t);let a=i-l[r];l[r]=i;const s=[...Array.from({length:o-1-r},(e,t)=>r+1+t),...Array.from({length:r},(e,t)=>r-1-t)];if(a<0)return l[s[0]]-=a,l;for(const e of s){if(a<=0)break;const r=Math.min(a,l[e]-t);l[e]-=r,a-=r}return l}([...n,100-g(n)],e,r);return O(o.slice(0,-1))?o:null},[J,Q]=u(0);d(()=>{const e=G.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>Q(e.getBoundingClientRect().width));return r.observe(e),()=>r.disconnect()},[]);const Y=c(null),[Z,_]=u(null),[ee,re]=u([]),te=(e,r)=>_(t=>r?e:t===e?null:t),ne=c(null),oe=(e,r)=>{const t=ne.current;if(!t||t.column!==e||t.share!==r)return!1;const{onChange:n,locked:o,stored:l}=K.current;var i,a;return o||(i=l,a=t.stored,void 0===i||void 0===a?i===a:v(i,a))||n(t.stored),!0},le=D.join(",");d(()=>{const e=null===Z?[]:function(e,r){if(!e)return[];const t=Array.from(e.querySelectorAll("input[data-widths-label]")),n=t[r]?.getBoundingClientRect();return n&&0!==n.width?null===l("","12px sans-serif")?[]:t.flatMap((e,t)=>{if(t===r)return[];const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=(l(e.value,`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`)??0)/2,s=(o.left+o.right)/2;return s+a>n.left&&s-a<n.right?[t]:[]}):[]}(Y.current,Z);re(r=>v(r,e)?r:e)},[Z,le,J]);const ie=j.hint(z,t),ae=D.slice(0,-1).map((e,r)=>g(D.slice(0,r+1)));/* @__PURE__ */
2
+ return f("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?A:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${R?"opacity-60":""} ${M}`.trim(),children:[
3
3
  /* @__PURE__ */f("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
4
- /* @__PURE__ */m("div",{ref:K,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:D.map((e,r)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[r%2]} ${r%2==0?"bg-accent-tint":""}`,children:1===A&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},r))}),
5
- /* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),A>1&&D.map((e,r)=>/* @__PURE__ */f(h,{children:[(()=>{const n=Z===r,l=g(D.slice(0,r)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
- return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>X>0&&X*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:t,max:100-(A-1)*t,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:R,"aria-label":j.column(r+1),"aria-describedby":z,"data-widths-label":"",onChange:e=>{null===e||oe(r,e)||W(r,e)},onRevert:e=>((e,r)=>{O.current.locked||null===r||oe(e,r)||W(e,r)})(r,e),onFocus:()=>{ne.current={column:r,share:e,stored:O.current.stored},te(r,!0)},onBlur:()=>te(r,!1),className:`absolute inset-0 text-xs font-medium ${w[r%2]} ${ee.includes(r)&&!n?"opacity-0":""}`})})})})(),r<A-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[r]}%`},children:/* @__PURE__ */m(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:R?-1:0,"aria-orientation":"vertical","aria-label":j.divider(r+1,r+2),"aria-valuenow":D[r],"aria-valuemin":t,"aria-valuemax":D[r]+D[r+1]-t,"aria-valuetext":j.dividerValue(r+1,D[r],r+2,D[r+1]),"aria-disabled":G||void 0,onKeyDown:G?void 0:I(r),onPointerDown:U(r),onPointerMove:J,onPointerUp:Q,onPointerCancel:Q,onLostPointerCapture:()=>{L.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(G?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(G?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${V===r?"w-1":y}`)})})})})]},r))]}),A>1&&/* @__PURE__ */m("span",{id:z,className:"sr-only",children:ie})]})}export{x as WidthsBar};
4
+ /* @__PURE__ */m("div",{ref:G,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:D.map((e,r)=>/* @__PURE__ */m("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[r%2]} ${r%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */m("span",{"data-widths-label":"",children:`${e}%`})},r))}),
5
+ /* @__PURE__ */m("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&D.map((e,r)=>/* @__PURE__ */f(h,{children:[(()=>{const n=Z===r,l=g(D.slice(0,r)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
+ return m("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */m(i,{content:ie,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */m(o,{appearance:"bare",value:e,display:()=>(e=>J>0&&J*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:t,max:100-(z-1)*t,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:R,"aria-label":j.column(r+1),"aria-describedby":A,"data-widths-label":"",onChange:e=>{null===e||oe(r,e)||q(r,e)},onRevert:e=>((e,r)=>{K.current.locked||null===r||oe(e,r)||q(e,r)})(r,e),onFocus:()=>{ne.current={column:r,share:e,stored:K.current.stored},te(r,!0)},onBlur:()=>te(r,!1),className:`absolute inset-0 text-xs font-medium ${w[r%2]} ${ee.includes(r)&&!n?"opacity-0":""}`})})})})(),r<z-1&&/* @__PURE__ */m("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[r]}%`},children:/* @__PURE__ */m(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */m("div",{role:"separator",tabIndex:R?-1:0,"aria-orientation":"vertical","aria-label":j.divider(r+1,r+2),"aria-valuenow":D[r],"aria-valuemin":t,"aria-valuemax":D[r]+D[r+1]-t,"aria-valuetext":j.dividerValue(r+1,D[r],r+2,D[r+1]),"aria-disabled":L||void 0,onKeyDown:L?void 0:H(r),onPointerDown:U(r),onPointerMove:W,onPointerUp:X,onPointerCancel:X,onLostPointerCapture:()=>{I.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(L?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */m("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(L?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${V===r?"w-1":y}`)})})})})]},r))]}),z>1&&/* @__PURE__ */m("span",{id:A,className:"sr-only",children:ie})]})}export{x as WidthsBar};
@@ -1,19 +1,19 @@
1
- import{textWidth as e}from"./chunk-UVCMV2TL.js";import{escapeHtml as t}from"./chunk-G6DKCCWH.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as o}from"./chunk-NRHG4R2Q.js";import{useRef as l,useState as c,useEffect as a,useCallback as s,useMemo as i}from"react";import{createPortal as u}from"react-dom";import{jsxs as h,jsx as d,Fragment as w}from"react/jsx-runtime";function m(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function g({text:e,...n}){const r=i(()=>({__html:t(e)}),[e]);/* @__PURE__ */
2
- return d("div",{...n,dangerouslySetInnerHTML:r})}function f({columns:t,data:f,onChange:p,onColumnsChange:b,fixedRows:y=!1,minRows:v=15,maxHeight:x="260px",cellStyles:M,onFocusChange:D,onSelectionChange:k}){const C=l(null),E=o().grid,[L,S]=c(null);a(()=>{D?.(L)},[L,D]);const[$,N]=c({}),z=l(null),[A,R]=c({}),O=l(null),[K,T]=c(null),[P,F]=c(null),[Y,j]=c(null),[H,I]=c(null),[X,W]=c(null),q=l(null);r(()=>{const e=q.current;if(!e||e.row!==X?.row||e.col!==X?.col)return;q.current=null;const t=C.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[B,V]=c(null),[G,Q]=c(null);a(()=>{k?.(B&&G?{anchor:B,end:G}:null)},[B,G,k]);const U=l(!1),[Z,_]=c(null),J=l(!1),ee=l({a:null,e:null});ee.current={a:B,e:G};const te=B&&G&&(B.row!==G.row||B.col!==G.col),ne=[...f];if(!y)for(;ne.length<v;)ne.push(Array(t.length).fill(""));const re=s((e,n,r)=>{const o=ne.map(e=>[...e]);for(;o.length<=e;)o.push(Array(t.length).fill(""));for(;o[e].length<t.length;)o[e].push("");o[e][n]=r,p(o)},[ne,t.length,p]),oe=s((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!==(ne[e]?.[t]||"")){const r=ne.map(e=>[...e]);r[e]&&(r[e][t]=n,p(r))}}U.current=!0,e.shiftKey&&B||V({row:t,col:n}),Q({row:t,col:n})},[ne,p,B]),le=s((e,t)=>{U.current&&Q({row:e,col:t})},[]);a(()=>{const e=()=>{U.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),a(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!B||!G)return;const t=window.getSelection();if(t&&t.toString().length>0&&!te)return;const n=Math.min(B.row,G.row),r=Math.max(B.row,G.row),o=Math.min(B.col,G.col),l=Math.max(B.col,G.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(ne[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)},[B,G,ne,te]),a(()=>{const e=e=>{if(!L)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!C.current?.contains(n))return;const r=e.clipboardData?.getData("text/plain");if(!r)return;e.preventDefault();const o=r.split("\n").filter(e=>e).map(e=>e.split("\t")),l=ne.map(e=>[...e]);for(let e=0;e<o.length;e++){const n=L.row+e;for(;l.length<=n;)l.push(Array(t.length).fill(""));for(;l[n].length<t.length;)l[n].push("");for(let r=0;r<o[e].length;r++){const c=L.col+r;if(c>=t.length)break;t[c].readOnly||(l[n][c]=o[e][r].trim())}}p(y?l:m(l,t.length)),V({row:L.row,col:L.col}),Q({row:Math.min(L.row+o.length-1,l.length-1),col:Math.min(L.col+(o[0]?.length||1)-1,t.length-1)})};return window.addEventListener("paste",e),()=>window.removeEventListener("paste",e)},[L,ne,t,p,y]);const ce=s((e,n,r)=>{const o=e.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;e.preventDefault();const c=ne.map(e=>[...e]);for(let e=0;e<l.length;e++){const o=n+e;for(;c.length<=o;)c.push(Array(t.length).fill(""));for(;c[o].length<t.length;)c[o].push("");for(let n=0;n<l[e].length;n++){const a=r+n;if(a>=t.length)break;t[a].readOnly||(c[o][a]=l[e][n].trim())}}p(y?c:m(c,t.length))},[ne,t,p,y]),ae=s((e,n,r)=>{let o=n,l=r;if("Tab"===e.key)e.preventDefault(),l=e.shiftKey?r-1:r+1,l>=t.length&&(l=0,o=n+1),l<0&&(l=t.length-1,o=n-1);else if("Enter"===e.key)e.preventDefault(),o=e.shiftKey?n-1:n+1;else if("ArrowDown"===e.key)e.preventDefault(),o=n+1;else if("ArrowUp"===e.key)e.preventDefault(),o=n-1;else if("ArrowLeft"===e.key)e.preventDefault(),l=r-1;else{if("ArrowRight"!==e.key){if("Delete"===e.key||"Backspace"===e.key){const o=e.target;if(o.isContentEditable)return void(o.textContent&&window.getSelection()?.toString()===o.textContent&&(e.preventDefault(),re(n,r,"")));if(e.preventDefault(),B&&G){const e=Math.min(B.row,G.row),n=Math.max(B.row,G.row),r=Math.min(B.col,G.col),o=Math.max(B.col,G.col),l=ne.map(e=>[...e]);for(let c=e;c<=n;c++)for(let e=r;e<=o;e++)l[c]&&!t[e]?.readOnly&&(l[c][e]="");p(l)}else re(n,r,"");return}return}e.preventDefault(),l=r+1}for(;l>=0&&l<t.length&&t[l].readOnly;)l+="Tab"===e.key&&e.shiftKey?-1:1;if(o>=0&&o<ne.length&&l>=0&&l<t.length){const e=C.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),S({row:o,col:l}),W(null),V({row:o,col:l}),Q({row:o,col:l}))}},[t,ne,ne.length,re,B,G,p]),se=s(e=>{if(!y&&e>=ne.length-2){const e=ne.map(e=>[...e]);for(let n=0;n<5;n++)e.push(Array(t.length).fill(""));p(e)}},[y,ne,t.length,p]),[ie,ue]=c(null);a(()=>{if(!ie)return;const e=()=>ue(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[ie]);const he=s(e=>{const n=ne.map(e=>[...e]);n.splice(e,0,Array(t.length).fill("")),p(n)},[ne,t.length,p]),de=s(e=>{if(ne.length<=1)return;const t=ne.filter((t,n)=>n!==e);p(t)},[ne,p]),we=s(e=>{const t=ne.map(t=>{const n=[...t];return n.splice(e,0,""),n});p(t)},[ne,p]),me=s(e=>{if(t.length<=1)return;const n=ne.map(t=>{const n=[...t];return n.splice(e,1),n});p(n)},[ne,t.length,p]),ge=s((e,t)=>{e.preventDefault(),y||ue({x:e.clientX,y:e.clientY,items:[{label:E.insertRowAbove,onClick:()=>{he(t),ue(null)}},{label:E.insertRowBelow,onClick:()=>{he(t+1),ue(null)}},{label:E.deleteRow(t+1),onClick:()=>{de(t),ue(null)}}]})},[y,he,de,E]),fe=s((e,n)=>{e.preventDefault(),y||ue({x:e.clientX,y:e.clientY,items:[{label:E.insertColumnLeft,onClick:()=>{we(n),ue(null)}},{label:E.insertColumnRight,onClick:()=>{we(n+1),ue(null)}},{label:E.deleteColumn(String(t[n]?.title||n+1)),onClick:()=>{me(n),ue(null)}}]})},[y,t,we,me,E]),pe=e=>$[e]??t[e]?.width??150;a(()=>{const e=e=>{if(!z.current)return;const t=e.clientX-z.current.startX,n=Math.max(40,z.current.startW+t);N(e=>({...e,[z.current.col]:n}))},n=()=>{if(z.current&&b){const e=t.map((e,t)=>({...e,width:$[t]??e.width}));e[z.current.col]={...e[z.current.col],width:$[z.current.col]??t[z.current.col].width},b(e)}z.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n)}},[t,$,b]);const be=e=>A[e]??28;a(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);R(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const ye=s(n=>{const r="12px ui-monospace, SFMono-Regular, Menlo, monospace";if(null===e("",r))return;let o=0;for(const t of ne){const l=String(t[n]??"").replace(/<[^>]*>/g,""),c=e(l,r)??0;c>o&&(o=c)}const l=e(t[n]?.title??"",r)??0;l>o&&(o=l);const c=Math.max(40,Math.ceil(o+24));if(N(e=>({...e,[n]:c})),b){const e=t.map((e,t)=>({...e,width:t===n?c:$[t]??e.width}));b(e)}},[ne,t,$,b]),ve=s(e=>{R(t=>{const n={...t};return delete n[e],n})},[]),xe=s(e=>{const{a:n,e:r}=ee.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,h=a;e.row>l?i=e.row:e.row<o&&(s=e.row),e.col>a?h=e.col:e.col<c&&(u=e.col);const d=l-o+1,w=a-c+1,m=ne.map(e=>[...e]);for(;m.length<=i;)m.push(Array(t.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(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<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[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=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}p(m),V({row:s,col:u}),Q({row:i,col:h})},[ne,t.length,p]);a(()=>{const e=e=>{if(!J.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);_({row:r,col:o})},t=()=>{J.current&&Z&&xe(Z),J.current=!1,_(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[Z,xe]);const Me=e=>{e.preventDefault(),e.stopPropagation(),J.current=!0,document.body.style.cursor="crosshair"},De=l(null),[ke,Ce]=c(0),[Ee,Le]=c(800);a(()=>{const e=De.current;if(!e)return;const t=()=>Le(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Se=ne.length>100,$e=Se?Math.max(0,Math.floor(ke/28)-20):0,Ne=Se?Math.min(ne.length,Math.ceil((ke+Ee)/28)+20):ne.length,ze=i(()=>ne.slice($e,Ne),[ne,$e,Ne]),Ae=28*$e,Re=28*(ne.length-Ne),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
1
+ import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{textWidth as t}from"./chunk-UVCMV2TL.js";import{TH_ONE_LINE as n}from"./chunk-TD3ZQD5R.js";import{useBrowserLayoutEffect as r}from"./chunk-ZDXRSY2Y.js";import{useShellStrings as o}from"./chunk-NRHG4R2Q.js";import{useRef as l,useState as c,useEffect as a,useCallback as s,useMemo as i}from"react";import{createPortal as u}from"react-dom";import{jsxs as h,jsx as d,Fragment as w}from"react/jsx-runtime";function m(e,t){const n=e[e.length-1];return n&&!n.some(e=>e.trim())?e:[...e,Array(t).fill("")]}function g({text:t,...n}){const r=i(()=>({__html:e(t)}),[t]);/* @__PURE__ */
2
+ return d("div",{...n,dangerouslySetInnerHTML:r})}function f({columns:e,data:f,onChange:p,onColumnsChange:b,fixedRows:y=!1,minRows:v=15,maxHeight:x="260px",cellStyles:M,onFocusChange:D,onSelectionChange:k}){const C=l(null),E=o().grid,[L,S]=c(null);a(()=>{D?.(L)},[L,D]);const[$,N]=c({}),z=l(null),[A,R]=c({}),O=l(null),[K,T]=c(null),[P,F]=c(null),[Y,j]=c(null),[H,I]=c(null),[X,W]=c(null),q=l(null);r(()=>{const e=q.current;if(!e||e.row!==X?.row||e.col!==X?.col)return;q.current=null;const t=C.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[B,V]=c(null),[G,Q]=c(null);a(()=>{k?.(B&&G?{anchor:B,end:G}:null)},[B,G,k]);const U=l(!1),[Z,_]=c(null),J=l(!1),ee=l({a:null,e:null});ee.current={a:B,e:G};const te=B&&G&&(B.row!==G.row||B.col!==G.col),ne=[...f];if(!y)for(;ne.length<v;)ne.push(Array(e.length).fill(""));const re=s((t,n,r)=>{const o=ne.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,p(o)},[ne,e.length,p]),oe=s((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!==(ne[e]?.[t]||"")){const r=ne.map(e=>[...e]);r[e]&&(r[e][t]=n,p(r))}}U.current=!0,e.shiftKey&&B||V({row:t,col:n}),Q({row:t,col:n})},[ne,p,B]),le=s((e,t)=>{U.current&&Q({row:e,col:t})},[]);a(()=>{const e=()=>{U.current=!1};return window.addEventListener("mouseup",e),()=>window.removeEventListener("mouseup",e)},[]),a(()=>{const e=e=>{if(!e.ctrlKey&&!e.metaKey||"c"!==e.key)return;if(!B||!G)return;const t=window.getSelection();if(t&&t.toString().length>0&&!te)return;const n=Math.min(B.row,G.row),r=Math.max(B.row,G.row),o=Math.min(B.col,G.col),l=Math.max(B.col,G.col),c=[];for(let e=n;e<=r;e++){const t=[];for(let n=o;n<=l;n++)t.push(ne[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)},[B,G,ne,te]),a(()=>{const t=t=>{if(!L)return;const n=document.activeElement;if(n?.isContentEditable)return;if(!C.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=ne.map(e=>[...e]);for(let t=0;t<o.length;t++){const n=L.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=L.col+r;if(c>=e.length)break;e[c].readOnly||(l[n][c]=o[t][r].trim())}}p(y?l:m(l,e.length)),V({row:L.row,col:L.col}),Q({row:Math.min(L.row+o.length-1,l.length-1),col:Math.min(L.col+(o[0]?.length||1)-1,e.length-1)})};return window.addEventListener("paste",t),()=>window.removeEventListener("paste",t)},[L,ne,e,p,y]);const ce=s((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=ne.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())}}p(y?c:m(c,e.length))},[ne,e,p,y]),ae=s((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(),re(n,r,"")));if(t.preventDefault(),B&&G){const t=Math.min(B.row,G.row),n=Math.max(B.row,G.row),r=Math.min(B.col,G.col),o=Math.max(B.col,G.col),l=ne.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]="");p(l)}else re(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<ne.length&&l>=0&&l<e.length){const e=C.current?.querySelector(`[data-row="${o}"][data-col="${l}"]`);e&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}),S({row:o,col:l}),W(null),V({row:o,col:l}),Q({row:o,col:l}))}},[e,ne,ne.length,re,B,G,p]),se=s(t=>{if(!y&&t>=ne.length-2){const t=ne.map(e=>[...e]);for(let n=0;n<5;n++)t.push(Array(e.length).fill(""));p(t)}},[y,ne,e.length,p]),[ie,ue]=c(null);a(()=>{if(!ie)return;const e=()=>ue(null);return window.addEventListener("pointerdown",e),()=>window.removeEventListener("pointerdown",e)},[ie]);const he=s(t=>{const n=ne.map(e=>[...e]);n.splice(t,0,Array(e.length).fill("")),p(n)},[ne,e.length,p]),de=s(e=>{if(ne.length<=1)return;const t=ne.filter((t,n)=>n!==e);p(t)},[ne,p]),we=s(e=>{const t=ne.map(t=>{const n=[...t];return n.splice(e,0,""),n});p(t)},[ne,p]),me=s(t=>{if(e.length<=1)return;const n=ne.map(e=>{const n=[...e];return n.splice(t,1),n});p(n)},[ne,e.length,p]),ge=s((e,t)=>{e.preventDefault(),y||ue({x:e.clientX,y:e.clientY,items:[{label:E.insertRowAbove,onClick:()=>{he(t),ue(null)}},{label:E.insertRowBelow,onClick:()=>{he(t+1),ue(null)}},{label:E.deleteRow(t+1),onClick:()=>{de(t),ue(null)}}]})},[y,he,de,E]),fe=s((t,n)=>{t.preventDefault(),y||ue({x:t.clientX,y:t.clientY,items:[{label:E.insertColumnLeft,onClick:()=>{we(n),ue(null)}},{label:E.insertColumnRight,onClick:()=>{we(n+1),ue(null)}},{label:E.deleteColumn(String(e[n]?.title||n+1)),onClick:()=>{me(n),ue(null)}}]})},[y,e,we,me,E]),pe=t=>$[t]??e[t]?.width??150;a(()=>{const t=e=>{if(!z.current)return;const t=e.clientX-z.current.startX,n=Math.max(40,z.current.startW+t);N(e=>({...e,[z.current.col]:n}))},n=()=>{if(z.current&&b){const t=e.map((e,t)=>({...e,width:$[t]??e.width}));t[z.current.col]={...t[z.current.col],width:$[z.current.col]??e[z.current.col].width},b(t)}z.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",t),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)}},[e,$,b]);const be=e=>A[e]??28;a(()=>{const e=e=>{if(!O.current)return;const t=e.clientY-O.current.startY,n=Math.max(20,O.current.startH+t);R(e=>({...e,[O.current.row]:n}))},t=()=>{O.current=null,document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[]);const ye=s(n=>{const r="12px ui-monospace, SFMono-Regular, Menlo, monospace";if(null===t("",r))return;let o=0;for(const e of ne){const l=String(e[n]??"").replace(/<[^>]*>/g,""),c=t(l,r)??0;c>o&&(o=c)}const l=t(e[n]?.title??"",r)??0;l>o&&(o=l);const c=Math.max(40,Math.ceil(o+24));if(N(e=>({...e,[n]:c})),b){const t=e.map((e,t)=>({...e,width:t===n?c:$[t]??e.width}));b(t)}},[ne,e,$,b]),ve=s(e=>{R(t=>{const n={...t};return delete n[e],n})},[]),xe=s(t=>{const{a:n,e:r}=ee.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,h=a;t.row>l?i=t.row:t.row<o&&(s=t.row),t.col>a?h=t.col:t.col<c&&(u=t.col);const d=l-o+1,w=a-c+1,m=ne.map(e=>[...e]);for(;m.length<=i;)m.push(Array(e.length).fill(""));for(const e of m)for(;e.length<=h;)e.push("");function g(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<=h;t++){if(e>=o&&e<=l&&t>=c&&t<=a)continue;let n;if(1===w&&u===c&&h===a){const r=g(Array.from({length:d},(e,n)=>m[o+n]?.[t]??""));if(r){const c=parseFloat(m[l]?.[t]??"0"),a=parseFloat(m[o]?.[t]??"0"),s=e>l?e-l:-(o-e);n=String((e>l?c:a)+r.step*s)}else{const r=((e-o)%d+d)%d;n=m[o+r]?.[t]??""}}else if(1===d&&s===o&&i===l){const r=g(Array.from({length:w},(t,n)=>m[e]?.[c+n]??""));if(r){const o=parseFloat(m[e]?.[a]??"0"),l=parseFloat(m[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=m[e]?.[c+r]??""}}else{const r=((e-o)%d+d)%d,l=((t-c)%w+w)%w;n=m[o+r]?.[c+l]??""}m[e][t]=n}p(m),V({row:s,col:u}),Q({row:i,col:h})},[ne,e.length,p]);a(()=>{const e=e=>{if(!J.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);_({row:r,col:o})},t=()=>{J.current&&Z&&xe(Z),J.current=!1,_(null),document.body.style.cursor=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)}},[Z,xe]);const Me=e=>{e.preventDefault(),e.stopPropagation(),J.current=!0,document.body.style.cursor="crosshair"},De=l(null),[ke,Ce]=c(0),[Ee,Le]=c(800);a(()=>{const e=De.current;if(!e)return;const t=()=>Le(e.clientHeight||800);t();const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);const Se=ne.length>100,$e=Se?Math.max(0,Math.floor(ke/28)-20):0,Ne=Se?Math.min(ne.length,Math.ceil((ke+Ee)/28)+20):ne.length,ze=i(()=>ne.slice($e,Ne),[ne,$e,Ne]),Ae=28*$e,Re=28*(ne.length-Ne),Oe="px-2 h-8 text-left text-xs font-medium text-ink-faint uppercase bg-gray-100 border-b border-r border-line select-none";/* @__PURE__ */
3
3
  return h("div",{ref:De,className:"border border-gray-300 rounded overflow-scroll grid-scroll",style:{maxHeight:x,height:x},onScroll:e=>Ce(e.target.scrollTop),children:[
4
- /* @__PURE__ */h("table",{ref:C,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+t.reduce((e,n)=>e+pe(t.indexOf(n)),0)},children:[
4
+ /* @__PURE__ */h("table",{ref:C,className:"border-collapse select-none",style:{tableLayout:"fixed",minWidth:36+e.reduce((t,n)=>t+pe(e.indexOf(n)),0)},children:[
5
5
  /* @__PURE__ */h("colgroup",{children:[
6
- /* @__PURE__ */d("col",{style:{width:36}}),t.map((e,t)=>/* @__PURE__ */d("col",{style:{width:pe(t)}},e.key))]}),
6
+ /* @__PURE__ */d("col",{style:{width:36}}),e.map((e,t)=>/* @__PURE__ */d("col",{style:{width:pe(t)}},e.key))]}),
7
7
  /* @__PURE__ */d("thead",{className:"sticky top-0 z-10",children:/* @__PURE__ */h("tr",{children:[
8
- /* @__PURE__ */d("th",{className:`${n} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{V({row:0,col:0}),Q({row:ne.length-1,col:t.length-1})},title:E.selectAll,children:"#"}),t.map((e,r)=>{const o=B&&G&&Math.min(B.col,G.col)<=r&&r<=Math.max(B.col,G.col)&&0===Math.min(B.row,G.row)&&Math.max(B.row,G.row)===ne.length-1;/* @__PURE__ */
9
- return h("th",{className:`${n} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${H===r?" !bg-blue-100":""}`,style:{width:pe(r)},draggable:!0,onDragStart:()=>(e=>j(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),I(t)})(e,r),onDrop:()=>(e=>{if(null===Y||Y===e)return j(null),void I(null);const n=ne.map(t=>{const n=[...t],[r]=n.splice(Y,1);return n.splice(e,0,r),n});if(p(n),b){const n=[...t],[r]=n.splice(Y,1);n.splice(e,0,r),b(n)}j(null),I(null)})(r),onDragEnd:()=>{j(null),I(null)},onClick:e=>{e.shiftKey&&B||V({row:0,col:r}),Q({row:ne.length-1,col:r})},onContextMenu:e=>fe(e,r),children:[e.title,
10
- /* @__PURE__ */d("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),z.current={col:t,startX:e.clientX,startW:pe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:E.resize})]},e.key)})]})}),
11
- /* @__PURE__ */h("tbody",{children:[Ae>0&&/* @__PURE__ */d("tr",{style:{height:Ae}}),ze.map((e,n)=>{const r=$e+n,o=B&&G&&Math.min(B.row,G.row)<=r&&r<=Math.max(B.row,G.row)&&0===Math.min(B.col,G.col)&&Math.max(B.col,G.col)===t.length-1;/* @__PURE__ */
8
+ /* @__PURE__ */d("th",{className:`${n} ${Oe} text-center w-9 cursor-pointer hover:bg-gray-200`,onClick:()=>{V({row:0,col:0}),Q({row:ne.length-1,col:e.length-1})},title:E.selectAll,children:"#"}),e.map((t,r)=>{const o=B&&G&&Math.min(B.col,G.col)<=r&&r<=Math.max(B.col,G.col)&&0===Math.min(B.row,G.row)&&Math.max(B.row,G.row)===ne.length-1;/* @__PURE__ */
9
+ return h("th",{className:`${n} ${Oe} cursor-pointer hover:bg-gray-200 relative${o?" !bg-blue-200":""}${H===r?" !bg-blue-100":""}`,style:{width:pe(r)},draggable:!0,onDragStart:()=>(e=>j(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),I(t)})(e,r),onDrop:()=>(t=>{if(null===Y||Y===t)return j(null),void I(null);const n=ne.map(e=>{const n=[...e],[r]=n.splice(Y,1);return n.splice(t,0,r),n});if(p(n),b){const n=[...e],[r]=n.splice(Y,1);n.splice(t,0,r),b(n)}j(null),I(null)})(r),onDragEnd:()=>{j(null),I(null)},onClick:e=>{e.shiftKey&&B||V({row:0,col:r}),Q({row:ne.length-1,col:r})},onContextMenu:e=>fe(e,r),children:[t.title,
10
+ /* @__PURE__ */d("div",{className:"absolute -right-1 top-0 bottom-0 w-2 cursor-col-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),z.current={col:t,startX:e.clientX,startW:pe(t)},document.body.style.cursor="col-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ye(r)},title:E.resize})]},t.key)})]})}),
11
+ /* @__PURE__ */h("tbody",{children:[Ae>0&&/* @__PURE__ */d("tr",{style:{height:Ae}}),ze.map((t,n)=>{const r=$e+n,o=B&&G&&Math.min(B.row,G.row)<=r&&r<=Math.max(B.row,G.row)&&0===Math.min(B.col,G.col)&&Math.max(B.col,G.col)===e.length-1;/* @__PURE__ */
12
12
  return h("tr",{style:{height:be(r)},children:[
13
- /* @__PURE__ */h("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${P===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>T(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),F(t)})(e,r),onDrop:()=>(e=>{if(null===K||K===e)return T(null),void F(null);const t=ne.map(e=>[...e]),[n]=t.splice(K,1);t.splice(e,0,n),p(t),T(null),F(null)})(r),onDragEnd:()=>{T(null),F(null)},onClick:e=>{e.shiftKey&&B||V({row:r,col:0}),Q({row:r,col:t.length-1})},onContextMenu:e=>ge(e,r),children:[r+1,
14
- /* @__PURE__ */d("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:be(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ve(r)},title:E.resize})]}),t.map((t,n)=>{const o=B&&G&&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}(B,G,r,n),l=X?.row===r&&X?.col===n&&!t.readOnly,c=L?.row===r&&L?.col===n,a=M?.[`${r}:${n}`],s=B&&G?Math.max(B.row,G.row):-1,i=B&&G?Math.max(B.col,G.col):-1,u=B&&G&&r===s&&n===i,w=J.current&&Z&&B&&G&&(()=>{const e=Math.min(B.row,G.row),t=Math.max(B.row,G.row),o=Math.min(B.col,G.col),l=Math.max(B.col,G.col);let c=e,a=t,s=o,i=l;return Z.row>t?a=Z.row:Z.row<e&&(c=Z.row),Z.col>l?i=Z.col:Z.col<o&&(s=Z.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),m="sm"===a?.fontSize?"text-2xs":"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 h("td",{className:`relative px-0 py-0 border-b border-r border-gray-200 text-sm${t.readOnly?" bg-gray-50 text-gray-500 cursor-default":" cursor-cell"}${o?" !bg-blue-100":""}${c&&!o?" ring-2 ring-inset ring-blue-400":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){oe(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>le(r,n),onClick:e=>{if(e.target===e.currentTarget){const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onDoubleClick:e=>{e.target!==e.currentTarget||t.readOnly||W({row:r,col:n})},children:[
16
- /* @__PURE__ */d(g,{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"===t.align?"text-right":"center"===t.align?"text-center":""} ${t.readOnly?"cursor-default":"cursor-cell"} font-mono ${m}${f}`,onMouseDown:e=>oe(e,r,n),onMouseEnter:()=>le(r,n),onDoubleClick:()=>{t.readOnly||W({row:r,col:n})},onFocus:()=>{S({row:r,col:n}),U.current||(V({row:r,col:n}),Q({row:r,col:n}))},onBlur:t=>{const o=t.currentTarget.textContent||"";o!==(e[n]||"")&&re(r,n,o),W(null)},onInput:()=>se(r),onPaste:e=>ce(e,r,n),onKeyDown:e=>{if(!(l||t.readOnly||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey))return e.preventDefault(),re(r,n,e.key),q.current={row:r,col:n},void W({row:r,col:n});ae(e,r,n)},text:e[n]||""}),u&&/* @__PURE__ */d("div",{onMouseDown:Me,title:E.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)}),Re>0&&/* @__PURE__ */d("tr",{style:{height:Re}})]})]}),ie&&u(
13
+ /* @__PURE__ */h("td",{className:`relative px-1 py-1 text-center text-2xs text-ink-faintest border-b border-r border-line bg-surface-sunken select-none cursor-pointer hover:bg-gray-200${o?" !bg-blue-200 !text-gray-700":""}${P===r?" !bg-blue-100":""}`,draggable:!0,onDragStart:()=>(e=>T(e))(r),onDragOver:e=>((e,t)=>{e.preventDefault(),F(t)})(e,r),onDrop:()=>(e=>{if(null===K||K===e)return T(null),void F(null);const t=ne.map(e=>[...e]),[n]=t.splice(K,1);t.splice(e,0,n),p(t),T(null),F(null)})(r),onDragEnd:()=>{T(null),F(null)},onClick:t=>{t.shiftKey&&B||V({row:r,col:0}),Q({row:r,col:e.length-1})},onContextMenu:e=>ge(e,r),children:[r+1,
14
+ /* @__PURE__ */d("div",{className:"absolute -bottom-1 left-0 right-0 h-2 cursor-row-resize z-20",onMouseDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation(),O.current={row:t,startY:e.clientY,startH:be(t)},document.body.style.cursor="row-resize"})(e,r),onDoubleClick:e=>{e.stopPropagation(),ve(r)},title:E.resize})]}),e.map((e,n)=>{const o=B&&G&&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}(B,G,r,n),l=X?.row===r&&X?.col===n&&!e.readOnly,c=L?.row===r&&L?.col===n,a=M?.[`${r}:${n}`],s=B&&G?Math.max(B.row,G.row):-1,i=B&&G?Math.max(B.col,G.col):-1,u=B&&G&&r===s&&n===i,w=J.current&&Z&&B&&G&&(()=>{const e=Math.min(B.row,G.row),t=Math.max(B.row,G.row),o=Math.min(B.col,G.col),l=Math.max(B.col,G.col);let c=e,a=t,s=o,i=l;return Z.row>t?a=Z.row:Z.row<e&&(c=Z.row),Z.col>l?i=Z.col:Z.col<o&&(s=Z.col),r>=c&&r<=a&&n>=s&&n<=i&&!(r>=e&&r<=t&&n>=o&&n<=l)})(),m="sm"===a?.fontSize?"text-2xs":"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 h("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":""}${w?" !bg-blue-50 ring-1 ring-inset ring-blue-300":""}`,onMouseDown:e=>{if(e.target===e.currentTarget){oe(e,r,n);const t=e.currentTarget.querySelector("[data-row][data-col]");t?.focus()}},onMouseEnter:()=>le(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||W({row:r,col:n})},children:[
16
+ /* @__PURE__ */d(g,{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=>oe(e,r,n),onMouseEnter:()=>le(r,n),onDoubleClick:()=>{e.readOnly||W({row:r,col:n})},onFocus:()=>{S({row:r,col:n}),U.current||(V({row:r,col:n}),Q({row:r,col:n}))},onBlur:e=>{const o=e.currentTarget.textContent||"";o!==(t[n]||"")&&re(r,n,o),W(null)},onInput:()=>se(r),onPaste:e=>ce(e,r,n),onKeyDown:t=>{if(!(l||e.readOnly||1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey))return t.preventDefault(),re(r,n,t.key),q.current={row:r,col:n},void W({row:r,col:n});ae(t,r,n)},text:t[n]||""}),u&&/* @__PURE__ */d("div",{onMouseDown:Me,title:E.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)}),Re>0&&/* @__PURE__ */d("tr",{style:{height:Re}})]})]}),ie&&u(
17
17
  /* @__PURE__ */h(w,{children:[
18
18
  /* @__PURE__ */d("div",{className:"fixed inset-0 z-(--z-popup)",onPointerDown:()=>ue(null)}),
19
19
  /* @__PURE__ */d("div",{className:"fixed z-(--z-popup) bg-surface rounded-lg shadow-lg border border-line py-1 min-w-[160px]",style:{left:ie.x,top:ie.y},children:ie.items.map((e,t)=>/* @__PURE__ */d("button",{onPointerDown:t=>{t.stopPropagation(),e.onClick()},className:"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-ink hover:bg-gray-100",children:e.label},t))})]}),document.body)]})}export{f as EditableGrid,m as withSpareRow};
@@ -1,11 +1,11 @@
1
- import{FormField as e}from"./chunk-6KBDNYRW.js";import{ImageFocusPoint as i}from"./chunk-CUJ537IY.js";import{Segmented as a}from"./chunk-TNALBYLY.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-DTRJLQWO.js";import{TransferProgress as u}from"./chunk-LLDGRPLF.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-TNGIXSTM.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{useShellStrings as b}from"./chunk-NRHG4R2Q.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as N}from"react/jsx-runtime";var j=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:$,hint:F,error:U,required:z,className:P,accept:O="image/*",maxSizeBytes:I,fit:S="cover",height:q,shape:B="rect",placeholder:D,cta:H,acceptHint:T,showFilename:Y=!0,allowReplace:G=!0,allowRemove:W=!0,replaceLabel:A,removeLabel:J,busy:K=!1,busyLabel:Q,choosingLabel:V,pickFailedLabel:_,progress:M,disabled:X=!1,kind:E,onKindChange:Z,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===B,oe=q??(re?96:112),ne=H??te.cta,se=E??(/video/.test(O)&&!/image/.test(O)?"video":"image"),le="string"==typeof J&&J?J:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=K||ce,be=ce&&!K?V??te.choosing:Q??te.uploading,fe=U??(ue?_??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const Ne=X||pe,je=!!w&&(t(w,O)||w===ke),we=D??r(O,te),Le=A??(je||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):C?C(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Ce=m({accept:O,maxSizeBytes:I,acceptHint:T,multiple:!1,disabled:Ne,onAccept:([e])=>Re(e)}),{dragOver:$e}=Ce,Fe=()=>{Ne||(R?ge():Ce.open())},Ue=w?o(w):"",ze=!re&&!je&&!!ie,Pe=X||!G&&!W?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[G&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>Fe(),disabled:pe,className:re?`w-8 shrink-0 ${j}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${j}`,children:[
1
+ import{ImageFocusPoint as e}from"./chunk-CUJ537IY.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{Segmented as a}from"./chunk-TNALBYLY.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-DTRJLQWO.js";import{TransferProgress as u}from"./chunk-LLDGRPLF.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-TNGIXSTM.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{useShellStrings as b}from"./chunk-NRHG4R2Q.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as N}from"react/jsx-runtime";var j=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function w({value:w,onChange:L,onPick:R,onFile:C,label:$,hint:F,error:U,required:z,className:P,accept:O="image/*",maxSizeBytes:I,fit:S="cover",height:q,shape:B="rect",placeholder:D,cta:H,acceptHint:T,showFilename:Y=!0,allowReplace:G=!0,allowRemove:W=!0,replaceLabel:A,removeLabel:J,busy:K=!1,busyLabel:Q,choosingLabel:V,pickFailedLabel:_,progress:M,disabled:X=!1,kind:E,onKindChange:Z,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===B,oe=q??(re?96:112),ne=H??te.cta,se=E??(/video/.test(O)&&!/image/.test(O)?"video":"image"),le="string"==typeof J&&J?J:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=K||ce,be=ce&&!K?V??te.choosing:Q??te.uploading,fe=U??(ue?_??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const Ne=X||pe,je=!!w&&(t(w,O)||w===ke),we=D??r(O,te),Le=A??(je||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):C?C(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Ce=m({accept:O,maxSizeBytes:I,acceptHint:T,multiple:!1,disabled:Ne,onAccept:([e])=>Re(e)}),{dragOver:$e}=Ce,Fe=()=>{Ne||(R?ge():Ce.open())},Ue=w?o(w):"",ze=!re&&!je&&!!ie,Pe=X||!G&&!W?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[G&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>Fe(),disabled:pe,className:re?`w-8 shrink-0 ${j}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${j}`,children:[
2
2
  /* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),W&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${j}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Oe=/* @__PURE__ */k("div",{...Ce.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",ze?"":"bg-gray-100",$e?"border-blue-500":"border-line"].join(" "),style:ze?void 0:re?{height:oe,width:oe}:{height:oe},children:[ze?
4
- /* @__PURE__ */x(i,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:Ne,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):je?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:S}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:S,objectPosition:ee||void 0}}),Y&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Pe,pe&&/* @__PURE__ */x(s,{label:be,progress:M,rounded:re?"rounded-full":"rounded-md"})]}),Ie=/* @__PURE__ */k(N,{children:[
4
+ /* @__PURE__ */x(e,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:Ne,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):je?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:S}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:S,objectPosition:ee||void 0}}),Y&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Pe,pe&&/* @__PURE__ */x(s,{label:be,progress:M,rounded:re?"rounded-full":"rounded-md"})]}),Ie=/* @__PURE__ */k(N,{children:[
5
5
  /* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
6
6
  /* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),T&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:T})]}),Se=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>Fe(),disabled:Ne,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:F?`${ve}-hint`:void 0,...Ce.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",Ne?"cursor-not-allowed opacity-60":"cursor-pointer",c(Ne)].join(" "),children:[
7
7
  /* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",$e?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
8
8
  /* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:M}):Ie})]}),qe=re?Se:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>Fe(),disabled:Ne,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:F?`${ve}-hint`:void 0,...Ce.zoneProps,className:d($e,Ne,c(Ne)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:M}):/* @__PURE__ */k(N,{children:[
9
9
  /* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),Ie]})});/* @__PURE__ */
10
- return k(e,{label:$,htmlFor:ve,hint:F,error:fe,required:z,className:P,children:[Z&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(a,{value:se,onChange:e=>Z(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne}],block:!0,size:"md",label:"string"==typeof $&&$?$:te.upload})}),w?Oe:qe,!R&&/* @__PURE__ */x("input",{...Ce.inputProps}),
10
+ return k(i,{label:$,htmlFor:ve,hint:F,error:fe,required:z,className:P,children:[Z&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(a,{value:se,onChange:e=>Z(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:Ne}],block:!0,size:"md",label:"string"==typeof $&&$?$:te.upload})}),w?Oe:qe,!R&&/* @__PURE__ */x("input",{...Ce.inputProps}),
11
11
  /* @__PURE__ */x(h,{rejections:Ce.rejections})]})}export{w as MediaUploadField};
@@ -1,7 +1,7 @@
1
- import{formatMoney as e}from"./chunk-OJI4ROSD.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-EJJTDUN3.js";import{ColumnChart as a}from"./chunk-AQVPWUJ3.js";import{ChartFrame as l}from"./chunk-A6TOHNJY.js";import{TH_ONE_LINE as s}from"./chunk-TD3ZQD5R.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
1
+ import{formatMoney as e}from"./chunk-OJI4ROSD.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-P5TSGXL4.js";import{ChartFrame as a}from"./chunk-A6TOHNJY.js";import{ColumnChart as l}from"./chunk-AQVPWUJ3.js";import{TH_ONE_LINE as s}from"./chunk-TD3ZQD5R.js";import{jsxs as o,jsx as i}from"react/jsx-runtime";function n({spec:n,height:c=200,width:m,animate:d=!0,className:h}){const u=function(r){if(r.currency)return t=>e(t,r.currency);const t=r.unit?` ${r.unit}`:"";return e=>`${e.toLocaleString("en-US",{maximumFractionDigits:2})}${t}`}(n),p=n.currency?r=>e(r,n.currency,{whole:!0}):u,b=n.series.map((e,r)=>({key:`s${r}`,label:e.name,data:e.values})),y=n.title??n.series.map(e=>e.name).join(", "),f=/* @__PURE__ */o("table",{className:"w-full border-collapse text-sm",children:[
2
2
  /* @__PURE__ */i("thead",{children:/* @__PURE__ */o("tr",{children:[
3
3
  /* @__PURE__ */i("td",{className:"border-b border-gray-200"}),n.series.map((e,r)=>/* @__PURE__ */i("th",{scope:"col",className:`${s} border-b border-gray-200 px-2 py-1 text-right font-semibold text-gray-700`,children:e.name},r))]})}),
4
4
  /* @__PURE__ */i("tbody",{children:n.x.map((e,t)=>/* @__PURE__ */o("tr",{children:[
5
5
  /* @__PURE__ */i("th",{scope:"row",className:`${s} border-t border-gray-100 px-2 py-1 text-left font-normal text-gray-700`,children:e}),n.series.map((e,a)=>{const l=e.values[t];/* @__PURE__ */
6
6
  return i("td",{className:"border-t border-gray-100 px-2 py-1 text-right tabular-nums text-gray-700",children:null===l?r:u(l)},a)})]},t))})]});/* @__PURE__ */
7
- return i(l,{title:y,legend:b.map(e=>({key:e.key,label:e.label,swatch:"line"===n.type?"bar":"square"})),table:f,className:h,children:"line"===n.type?/* @__PURE__ */i(t,{series:b,labels:n.x,height:c,width:m,animate:d,dots:"all",formatValue:p,formatTooltipValue:u}):/* @__PURE__ */i(a,{series:b,labels:n.x,stacked:n.stacked,height:c,width:m,animate:d,formatValue:p,formatTooltipValue:u})})}export{n as SpecChart};
7
+ return i(a,{title:y,legend:b.map(e=>({key:e.key,label:e.label,swatch:"line"===n.type?"bar":"square"})),table:f,className:h,children:"line"===n.type?/* @__PURE__ */i(t,{series:b,labels:n.x,height:c,width:m,animate:d,dots:"all",formatValue:p,formatTooltipValue:u}):/* @__PURE__ */i(l,{series:b,labels:n.x,stacked:n.stacked,height:c,width:m,animate:d,formatValue:p,formatTooltipValue:u})})}export{n as SpecChart};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-J5OAQAAD.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
1
+ import{Card as e}from"./chunk-RKSCB5BJ.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-TJBHFUWV.js";import{Button_default as a}from"./chunk-UTISUEO4.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
2
2
  return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
3
3
  /* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
4
4
  /* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
@@ -1,8 +1,8 @@
1
- import{MOTION as e,stagger as t}from"./chunk-465RRWBY.js";import{arcPath as l}from"./chunk-VFC6QUEN.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as r}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as o,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{usePlotWidth as i}from"./chunk-MAFUXCPZ.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-NRHG4R2Q.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:F=!0,labels:w="none",labelMinShare:P=.04,className:R,emptyLabel:S}){const A=h().charts,C=c(),W=$??(e=>u(e,C)),z=I??A.other,E=S??A.nothingToBreakDown,T=d(),[V,_]=f(null),{highlighted:L}=a(),Q=y(null),U=i(Q,Number.POSITIVE_INFINITY),Y=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===Y.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${R??""}`,children:E});const B=[...Y].sort((e,t)=>t.value-e.value),H=B.slice(0,N),O=B.slice(N),D=O.length>0?[...H,{key:"__other__",label:z,value:O.reduce((e,t)=>e+t.value,0),slot:-1,color:o.muted}]:H,Z=e=>s(e.slot,e.color,e.tone),q=D.reduce((e,t)=>e+t.value,0),G=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,J="outside"===w&&U>=120+2*G,X=J?G:0,K=J?Math.max(120,Math.min(k,U-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=r(D.length,b),oe=Math.max(...D.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!J)return[];let e=-Math.PI/2;const t=D.map((t,l)=>{const a="rose"===v?r(D.length,b).step:t.value/q*Math.PI*2,n="rose"===v?r(D.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/q,right:Math.cos(n)>=0,anchor:[te+o*Math.cos(n),le+o*Math.sin(n)],y:le+(o+14)*Math.sin(n),index:l}}).filter(e=>e.share>=P),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==V?V!==e:null!==L&&L!==t,me=null!==V?D[V]:void 0;/* @__PURE__ */
1
+ import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{angleScale as r}from"./chunk-2JWPNR2U.js";import{ChartTooltip as n}from"./chunk-WDQI3FV6.js";import{CHART_INK as o,resolveSeriesColor as s}from"./chunk-TZFACUMR.js";import{usePlotWidth as i}from"./chunk-MAFUXCPZ.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-NRHG4R2Q.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:F=!0,labels:w="none",labelMinShare:P=.04,className:R,emptyLabel:S}){const A=h().charts,C=c(),W=$??(e=>u(e,C)),z=I??A.other,E=S??A.nothingToBreakDown,T=d(),[V,_]=f(null),{highlighted:L}=a(),Q=y(null),U=i(Q,Number.POSITIVE_INFINITY),Y=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===Y.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${R??""}`,children:E});const B=[...Y].sort((e,t)=>t.value-e.value),H=B.slice(0,N),O=B.slice(N),D=O.length>0?[...H,{key:"__other__",label:z,value:O.reduce((e,t)=>e+t.value,0),slot:-1,color:o.muted}]:H,Z=e=>s(e.slot,e.color,e.tone),q=D.reduce((e,t)=>e+t.value,0),G=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,J="outside"===w&&U>=120+2*G,X=J?G:0,K=J?Math.max(120,Math.min(k,U-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=r(D.length,b),oe=Math.max(...D.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!J)return[];let e=-Math.PI/2;const t=D.map((t,l)=>{const a="rose"===v?r(D.length,b).step:t.value/q*Math.PI*2,n="rose"===v?r(D.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/q,right:Math.cos(n)>=0,anchor:[te+o*Math.cos(n),le+o*Math.sin(n)],y:le+(o+14)*Math.sin(n),index:l}}).filter(e=>e.share>=P),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==V?V!==e:null!==L&&L!==t,me=null!==V?D[V]:void 0;/* @__PURE__ */
2
2
  return g("div",{className:`relative ${R??""}`,ref:Q,children:[
3
3
  /* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":T,onMouseLeave:()=>_(null),children:[
4
4
  /* @__PURE__ */p("title",{id:T,children:A.breakdown(W(q),D.length)}),D.map((a,r)=>{const n=Z(a),s="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/q*Math.PI*2-b;"rose"!==v&&(ie+=a.value/q*Math.PI*2);const h=s+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
5
- return p("path",{d:l(te,le,re,c,s,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:o.surface,strokeWidth:1,className:F?e.sweep:void 0,style:F?t(r,55):void 0,onMouseEnter:()=>_(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
5
+ return p("path",{d:e(te,le,re,c,s,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:o.surface,strokeWidth:1,className:F?t.sweep:void 0,style:F?l(r,55):void 0,onMouseEnter:()=>_(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
6
6
  return g("g",{children:[
7
7
  /* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:o.grid,strokeWidth:1}),
8
8
  /* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:o.label,textAnchor:e.right?"end":"start",children:e.label}),
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as a}from"./chunk-D5PXRJHA.js";import{Pagination as r}from"./chunk-Q2RNFBYS.js";import{Input_default as t}from"./chunk-J5OAQAAD.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-YDJ5IZOU.js";import{Button_default as l}from"./chunk-UTISUEO4.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as m}from"./chunk-TD3ZQD5R.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
1
+ import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as a}from"./chunk-D5PXRJHA.js";import{Pagination as r}from"./chunk-Q2RNFBYS.js";import{Input_default as t}from"./chunk-TJBHFUWV.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-YDJ5IZOU.js";import{Button_default as l}from"./chunk-UTISUEO4.js";import{Icon as c}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as m}from"./chunk-TD3ZQD5R.js";import{useState as n}from"react";import{jsx as d,jsxs as o}from"react/jsx-runtime";var h={active:"success",invited:"queued",suspended:"danger",pending:"pending"},p=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function u(){const[c,u]=n(1),[g,f]=n(""),[y,v]=n("");/* @__PURE__ */
2
2
  return d(i,{groups:h,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */o("div",{className:"mx-auto max-w-5xl space-y-4",children:[
3
3
  /* @__PURE__ */o("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
@@ -1,3 +1,3 @@
1
- import{IconPicker as e}from"./chunk-GZRNOIEE.js";import{ColorPicker as t}from"./chunk-F3EBYHIE.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-QPVYBN4J.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:x=1,readOnly:j,units:S}){const k=e=>"number"==typeof m[e]?m[e]:null,O=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},E=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:x,...l(x),steppers:"compact",readOnly:j,placeholder:i,prefix:o,suffix:w.unit,units:S,"aria-label":t})}),C=d.map(k),I="number"==typeof m.width?m.width:C.every(e=>null!==e&&e===C[0])?C[0]:null,B=null===I&&C.some(e=>null!==e),H=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",J=e=>k(e)??("number"==typeof m.width?m.width:null),P=m.style??f.style;/* @__PURE__ */
2
- return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[E("left",w.sides.left,u.left,J("left"),String(f.sides.left),e=>O("left",e)),E("top",w.sides.top,u.top,J("top"),String(f.sides.top),e=>O("top",e)),E("right",w.sides.right,u.right,J("right"),String(f.sides.right),e=>O("right",e)),E("bottom",w.sides.bottom,u.bottom,J("bottom"),String(f.sides.bottom),e=>O("bottom",e))]}):E("all",w.width,u.all,I,B?"–":H,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:P,disabled:j,onChange:e=>{j||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
3
- /* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{j||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:j})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
1
+ import{IconPicker as e}from"./chunk-GZRNOIEE.js";import{ColorPicker as t}from"./chunk-S5MTTJ3F.js";import{InputNumber_default as r,stepRounding as l}from"./chunk-VLBLDSA6.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as a}from"./chunk-ISVODSRP.js";import{jsxs as i,Fragment as s,jsx as n}from"react/jsx-runtime";var d=["top","right","bottom","left"];function m(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(d.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function h(e,t){const r=e??{},l=m(t),o=d.some(e=>"number"==typeof r[e]),a=d.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:o?0:l[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",u={all:/* @__PURE__ */n(a,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */n(a,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */n(a,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */n(a,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */n(a,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */n(a,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */n(a,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */n(a,{name:"line-dotted","aria-hidden":"true",className:c})};function f({label:a,value:m,onChange:h,each:c,placeholder:f,presets:b,words:w,widths:g=!0,styles:y=!0,min:N=0,max:v=20,step:S=1,readOnly:x,units:j}){const k=e=>"number"==typeof m[e]?m[e]:null,O=(e,t)=>{const r={...m};if("number"==typeof m.width)for(const e of d)null===k(e)&&(r[e]=m.width);r[e]=t,delete r.width,h(r)},C=(e,t,o,a,i,s)=>/* @__PURE__ */n("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */n(r,{value:a,onChange:s,min:N,max:v,step:S,...l(S),steppers:"compact",readOnly:x,placeholder:i,prefix:o,suffix:w.unit,units:j,"aria-label":t})}),E=d.map(k),I="number"==typeof m.width?m.width:E.every(e=>null!==e&&e===E[0])?E[0]:null,T=null===I&&E.some(e=>null!==e),D=d.every(e=>f.sides[e]===f.sides.top)?String(f.sides.top):"–",J=e=>k(e)??("number"==typeof m.width?m.width:null),L=m.style??f.style;/* @__PURE__ */
2
+ return i("div",{role:"group","aria-label":a,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[g?c?/* @__PURE__ */i(s,{children:[C("left",w.sides.left,u.left,J("left"),String(f.sides.left),e=>O("left",e)),C("top",w.sides.top,u.top,J("top"),String(f.sides.top),e=>O("top",e)),C("right",w.sides.right,u.right,J("right"),String(f.sides.right),e=>O("right",e)),C("bottom",w.sides.bottom,u.bottom,J("bottom"),String(f.sides.bottom),e=>O("bottom",e))]}):C("all",w.width,u.all,I,T?"–":D,e=>{const t={...m,width:e};for(const e of d)delete t[e];h(t)}):null,y&&/* @__PURE__ */n("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */n(e,{label:w.style,value:L,disabled:x,onChange:e=>{x||h({...m,style:e})},options:o.map(e=>({value:e,label:w.styles[e],icon:p[e]}))})}),
3
+ /* @__PURE__ */n("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */n(t,{value:m.color??"",onChange:e=>{x||h({...m,color:e})},label:w.color,presets:b,fallback:f.color,showHexInput:!0,size:"md",disabled:x})})]})}export{f as BorderInput,m as borderSides,h as borderStartEach};
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-W24THMLI.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{Input_default as a}from"./chunk-J5OAQAAD.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-W24THMLI.js";import{Avatar as t}from"./chunk-SCNQK5NF.js";import{Input_default as a}from"./chunk-TJBHFUWV.js";import{Button_default as i}from"./chunk-UTISUEO4.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
2
2
  return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
3
3
  /* @__PURE__ */n(t,{name:e.name,status:e.status}),
4
4
  /* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
@@ -1,4 +1,4 @@
1
- import{Modal as e}from"./chunk-DEE6FKE7.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
1
+ import{Modal as e}from"./chunk-H2Q7G5D6.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
2
2
  return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
3
3
  /* @__PURE__ */n("div",{children:[
4
4
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),