efficient-shell 11.11.0 → 11.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/dist/{Browser-NRGJ53ST.js → Browser-LPGSKKLU.js} +14 -14
  2. package/dist/Calculator-XUV5JV3O.js +29 -0
  3. package/dist/{CurrencyConverter-CJQMDBQW.js → CurrencyConverter-N2HQT7IR.js} +9 -9
  4. package/dist/{Documents-FIGKS36O.js → Documents-IRPS3N5T.js} +23 -23
  5. package/dist/Files-VN2IOPHX.js +88 -0
  6. package/dist/{Notepad-2XW63REV.js → Notepad-JCWNOQET.js} +9 -9
  7. package/dist/{PomodoroTimer-Y5GQX37J.js → PomodoroTimer-356JUEM3.js} +21 -21
  8. package/dist/{Preview-K7KDM4XK.js → Preview-X7XNDI6X.js} +23 -23
  9. package/dist/Sidebar-OZMJNAXN.js +44 -0
  10. package/dist/{Spreadsheet-RQE4OCEK.js → Spreadsheet-YQOVGIU7.js} +33 -33
  11. package/dist/{Stock-IHAG62QV.js → Stock-2XOOZNRR.js} +3 -3
  12. package/dist/{Weather-EQDFEBIH.js → Weather-ZDU2722T.js} +16 -16
  13. package/dist/{WorldClock-VQG7G2Z2.js → WorldClock-PQGERFCH.js} +5 -5
  14. package/dist/ai/index.js +91 -91
  15. package/dist/apps/index.d.ts +21 -2
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/charts/BoxPlotChart.js +1 -1
  20. package/dist/charts/CandlestickChart.js +1 -1
  21. package/dist/charts/CartesianPlot.js +1 -1
  22. package/dist/charts/ChartTooltip.js +1 -1
  23. package/dist/charts/ChordChart.js +1 -1
  24. package/dist/charts/ColumnChart.js +1 -1
  25. package/dist/charts/FunnelChart.js +1 -1
  26. package/dist/charts/HeatmapChart.js +1 -1
  27. package/dist/charts/HistogramChart.js +1 -1
  28. package/dist/charts/PieChart.js +1 -1
  29. package/dist/charts/RadarChart.js +1 -1
  30. package/dist/charts/RadialBarChart.js +1 -1
  31. package/dist/charts/RangeChart.js +1 -1
  32. package/dist/charts/SankeyChart.js +1 -1
  33. package/dist/charts/ScatterChart.js +1 -1
  34. package/dist/charts/SpecChart.js +1 -1
  35. package/dist/charts/SunburstChart.js +1 -1
  36. package/dist/charts/TimeSeriesChart.js +1 -1
  37. package/dist/charts/TreemapChart.js +1 -1
  38. package/dist/charts/WaterfallChart.js +1 -1
  39. package/dist/{chunk-QOJ2UNS5.js → chunk-34AHNPW7.js} +1 -1
  40. package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
  41. package/dist/{chunk-PDXOGPWH.js → chunk-3N2MNOV5.js} +1 -1
  42. package/dist/{chunk-3JCOD5L2.js → chunk-4APQHXLI.js} +2 -2
  43. package/dist/{chunk-IEOCUEJK.js → chunk-4EVYK6DR.js} +7 -7
  44. package/dist/{chunk-7IVTGOGM.js → chunk-4JJ5WT4D.js} +1 -1
  45. package/dist/{chunk-3ZRYKZGI.js → chunk-4TB4CSLB.js} +4 -4
  46. package/dist/{chunk-KZEIQO3V.js → chunk-5IESW4PM.js} +5 -5
  47. package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
  48. package/dist/chunk-5W3U3EVG.js +7 -0
  49. package/dist/chunk-64KZ74CS.js +8 -0
  50. package/dist/{chunk-QAIMZN7M.js → chunk-6ETRVCMH.js} +13 -13
  51. package/dist/{chunk-SGBR443F.js → chunk-6S6FJJKP.js} +6 -6
  52. package/dist/{chunk-M57KX3OM.js → chunk-6UJYRGWY.js} +1 -1
  53. package/dist/{chunk-K6D7OSKZ.js → chunk-6WPKLF6G.js} +14 -14
  54. package/dist/{chunk-UWJNQH2X.js → chunk-7A2Y3W55.js} +1 -1
  55. package/dist/{chunk-ZOQXFS3R.js → chunk-7FCIFHO7.js} +1 -1
  56. package/dist/chunk-7TVGP2SX.js +8 -0
  57. package/dist/{chunk-2HAJ33HM.js → chunk-AD27M3ZH.js} +2 -2
  58. package/dist/{chunk-AQGIK2CV.js → chunk-AO7XAAGG.js} +1 -1
  59. package/dist/chunk-AQ7CNPEE.js +15 -0
  60. package/dist/chunk-BOJEZKYS.js +14 -0
  61. package/dist/{chunk-3X2W7R5B.js → chunk-BPJ3CQH7.js} +9 -9
  62. package/dist/chunk-CGA6RTVI.js +9 -0
  63. package/dist/{chunk-CT7AU2TA.js → chunk-CR3YDABU.js} +1 -1
  64. package/dist/{chunk-TXKTITMF.js → chunk-CR42APAY.js} +5 -5
  65. package/dist/{chunk-MQE2FBJU.js → chunk-CXZ7PHHF.js} +5 -5
  66. package/dist/{chunk-V64CJHMY.js → chunk-D5MN3LXC.js} +19 -19
  67. package/dist/{chunk-6LK2BBCC.js → chunk-DMBA6KYQ.js} +5 -5
  68. package/dist/{chunk-ALJS3SYS.js → chunk-DXKXETTT.js} +1 -1
  69. package/dist/chunk-EBGOENC3.js +3 -0
  70. package/dist/{chunk-6DQANKTL.js → chunk-ELIWGIR7.js} +7 -7
  71. package/dist/chunk-EOVXFXVV.js +2 -0
  72. package/dist/{chunk-CSLMWGFS.js → chunk-EQ72AP5E.js} +1 -1
  73. package/dist/chunk-ES2LUEPN.js +22 -0
  74. package/dist/{chunk-62BDGAML.js → chunk-F33L4J3P.js} +6 -6
  75. package/dist/{chunk-QEDVXD3L.js → chunk-FD6XZRWA.js} +1 -1
  76. package/dist/{chunk-X2DUOIJP.js → chunk-FEUTN4GK.js} +1 -1
  77. package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
  78. package/dist/chunk-FZWSP7KJ.js +28 -0
  79. package/dist/chunk-G3FHFWC2.js +4 -0
  80. package/dist/{chunk-42TLGG33.js → chunk-GJFTO7D4.js} +1 -1
  81. package/dist/{chunk-VEGZVUHE.js → chunk-GJVGGYQ2.js} +1 -1
  82. package/dist/{chunk-LGTYPLJM.js → chunk-GS74BABV.js} +3 -3
  83. package/dist/{chunk-LXOX5FGH.js → chunk-HGMQOHMK.js} +2 -2
  84. package/dist/{chunk-CG5X5ZLV.js → chunk-HJM4LSMM.js} +1 -1
  85. package/dist/{chunk-E3EHHR73.js → chunk-HOEEFFE3.js} +9 -9
  86. package/dist/{chunk-32EKHIAZ.js → chunk-HT7SOOMD.js} +12 -12
  87. package/dist/{chunk-R72ZKZDP.js → chunk-I5GDAQYL.js} +2 -2
  88. package/dist/{chunk-TA4JGC5C.js → chunk-IFWXC323.js} +1 -1
  89. package/dist/{chunk-5B4GRLAA.js → chunk-IJ6HZXZY.js} +1 -1
  90. package/dist/{chunk-UG42KUCT.js → chunk-IKKR2TYY.js} +4 -4
  91. package/dist/{chunk-OXCFRH33.js → chunk-JFCCI5L2.js} +1 -1
  92. package/dist/{chunk-CLAKVFOB.js → chunk-JGWUSJDD.js} +31 -31
  93. package/dist/{chunk-I5XNADZ3.js → chunk-JJLAI6GL.js} +8 -8
  94. package/dist/{chunk-F636NDAU.js → chunk-K3IUUZO5.js} +7 -7
  95. package/dist/{chunk-ZOQVYSTB.js → chunk-KV4QPU6U.js} +18 -18
  96. package/dist/{chunk-RNBC6V2D.js → chunk-L2IPWMLI.js} +3 -3
  97. package/dist/chunk-L74WV4RJ.js +6 -0
  98. package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
  99. package/dist/chunk-LJJ7FDAQ.js +6 -0
  100. package/dist/{chunk-3OHADZYV.js → chunk-LLSLY6BT.js} +1 -1
  101. package/dist/{chunk-CDQUOCXO.js → chunk-LP45EML2.js} +1 -1
  102. package/dist/{chunk-HRG4FYVU.js → chunk-LWFH5QTJ.js} +1 -1
  103. package/dist/{chunk-Q7DVGUML.js → chunk-LXBBJNBQ.js} +1 -1
  104. package/dist/{chunk-SWJXWDKX.js → chunk-M4AOQYSP.js} +1 -1
  105. package/dist/{chunk-RQBQETXQ.js → chunk-MD6EPKOR.js} +8 -8
  106. package/dist/{chunk-S43DAIIB.js → chunk-MFP5KOQW.js} +5 -5
  107. package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
  108. package/dist/{chunk-IUMFOSFJ.js → chunk-N75MPMLD.js} +3 -3
  109. package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
  110. package/dist/{chunk-C3UY34DC.js → chunk-NPT6EXHK.js} +4 -4
  111. package/dist/{chunk-57WQVUBX.js → chunk-OCWWEHNR.js} +2 -2
  112. package/dist/{chunk-PVOTOUJG.js → chunk-OMROEVOP.js} +1 -1
  113. package/dist/{chunk-VPEH3THH.js → chunk-P75N466Z.js} +3 -3
  114. package/dist/{chunk-AHITTM6W.js → chunk-PTVTNCD6.js} +1 -1
  115. package/dist/chunk-Q7UTGO73.js +11 -0
  116. package/dist/{chunk-3VR5BOD4.js → chunk-QDL2FNP7.js} +2 -2
  117. package/dist/{chunk-ATKFIHDP.js → chunk-RBAC26J7.js} +4 -4
  118. package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
  119. package/dist/{chunk-63545Z3N.js → chunk-RXVFAFEB.js} +1 -1
  120. package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
  121. package/dist/chunk-SI33IE7G.js +2 -0
  122. package/dist/{chunk-ESWR7YNY.js → chunk-SPMD7UZO.js} +3 -3
  123. package/dist/{chunk-A4YTWDKD.js → chunk-SSM6P43S.js} +1 -1
  124. package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
  125. package/dist/{chunk-EV7VAXMO.js → chunk-TTQJQKCE.js} +9 -9
  126. package/dist/chunk-UBQUXUD2.js +7 -0
  127. package/dist/{chunk-YUAF3FDE.js → chunk-UCAMOW53.js} +4 -4
  128. package/dist/{chunk-JG26ICX6.js → chunk-UEWB6IOD.js} +2 -2
  129. package/dist/{chunk-KKJ55GUZ.js → chunk-UHGAT5MH.js} +1 -1
  130. package/dist/{chunk-PZHO4FEN.js → chunk-UOGF37Z4.js} +1 -1
  131. package/dist/chunk-UZTKBA7Z.js +13 -0
  132. package/dist/{chunk-6LITLCVV.js → chunk-VEATEVMV.js} +3 -3
  133. package/dist/{chunk-K6LW2QLI.js → chunk-VIDT4JLR.js} +1 -1
  134. package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
  135. package/dist/chunk-WZJPASST.js +6 -0
  136. package/dist/{chunk-B2SLXCMY.js → chunk-XOH6QERF.js} +8 -8
  137. package/dist/chunk-YXSGMPNW.js +1 -0
  138. package/dist/{chunk-7R23EKON.js → chunk-ZA2RBNRA.js} +1 -1
  139. package/dist/{chunk-BDUXF7BT.js → chunk-ZHS2VQU7.js} +3 -3
  140. package/dist/{chunk-7HLBVMMQ.js → chunk-ZMC25LRC.js} +1 -1
  141. package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
  142. package/dist/data/DataTable.js +1 -1
  143. package/dist/data/EntityList.js +1 -1
  144. package/dist/data/ListLoadError.js +1 -1
  145. package/dist/data/ResizableTable.js +1 -1
  146. package/dist/forms/AlignmentGrid.js +1 -1
  147. package/dist/forms/BorderInput.js +1 -1
  148. package/dist/forms/BrandAssetEditor.js +1 -1
  149. package/dist/forms/Button.js +1 -1
  150. package/dist/forms/ColorPicker.js +1 -1
  151. package/dist/forms/ComposerAttachments.js +1 -1
  152. package/dist/forms/CornersInput.js +1 -1
  153. package/dist/forms/DateRangePicker.js +1 -1
  154. package/dist/forms/DisplayChips.js +1 -1
  155. package/dist/forms/FilePicker.js +1 -1
  156. package/dist/forms/IconButton.js +1 -1
  157. package/dist/forms/IconPicker.js +1 -1
  158. package/dist/forms/Input.js +1 -1
  159. package/dist/forms/InputNumber.js +1 -1
  160. package/dist/forms/LinkPicker.js +1 -1
  161. package/dist/forms/MediaLibrary.js +1 -1
  162. package/dist/forms/MediaUploadField.js +1 -1
  163. package/dist/forms/MediaUploadGrid.js +1 -1
  164. package/dist/forms/MediaUsedInList.js +1 -1
  165. package/dist/forms/NumericKeypad.js +1 -1
  166. package/dist/forms/PictureTiles.js +1 -1
  167. package/dist/forms/PositionInput.js +1 -1
  168. package/dist/forms/RenameField.js +1 -1
  169. package/dist/forms/Segmented.js +1 -1
  170. package/dist/forms/Select.js +1 -1
  171. package/dist/forms/SidesInput.js +1 -1
  172. package/dist/forms/Slider.js +1 -1
  173. package/dist/forms/Snippet.js +1 -1
  174. package/dist/forms/SplitButton.js +1 -1
  175. package/dist/forms/TagInput.js +1 -1
  176. package/dist/forms/TextToolbar.js +1 -1
  177. package/dist/forms/WidthsBar.js +1 -1
  178. package/dist/index.js +378 -378
  179. package/dist/map/index.js +3 -3
  180. package/dist/page-tabs/index.js +5 -5
  181. package/dist/shell/AppUpdateBanner.js +1 -1
  182. package/dist/shell/ColoredBadge.js +1 -1
  183. package/dist/shell/ContextMenu.js +1 -1
  184. package/dist/shell/DropdownMenu.js +1 -1
  185. package/dist/shell/EditableGrid.js +1 -1
  186. package/dist/shell/GlobalSearch.js +1 -1
  187. package/dist/shell/HelpCenter.js +1 -1
  188. package/dist/shell/IconRail.js +1 -1
  189. package/dist/shell/ImageLightbox.js +1 -1
  190. package/dist/shell/ItemCount.js +1 -1
  191. package/dist/shell/LanguageSelect.js +1 -1
  192. package/dist/shell/Markdown.js +1 -1
  193. package/dist/shell/PopupMenu.js +1 -1
  194. package/dist/shell/ResizeHandle.js +1 -1
  195. package/dist/shell/SearchableSelect.js +1 -1
  196. package/dist/shell/SettingReset.js +1 -1
  197. package/dist/shell/SidebarLayout.js +1 -1
  198. package/dist/shell/SidebarNav.js +1 -1
  199. package/dist/shell/SortableList.js +1 -1
  200. package/dist/shell/StatusBadge.js +1 -1
  201. package/dist/shell/Tabs.js +1 -1
  202. package/dist/shell/Tooltip.js +1 -1
  203. package/dist/shell/TopNav.js +1 -1
  204. package/dist/shell/TransferProgress.js +1 -1
  205. package/dist/shell/Tree.js +1 -1
  206. package/dist/telemetry/index.js +1 -1
  207. package/dist/templates/AuthScreen.js +1 -1
  208. package/dist/templates/ChatTemplate.js +1 -1
  209. package/dist/templates/CheckoutTemplate.js +1 -1
  210. package/dist/templates/DashboardTemplate.js +1 -1
  211. package/dist/templates/DataTablePage.js +1 -1
  212. package/dist/templates/EmailTemplate.js +1 -1
  213. package/dist/templates/ErrorBoundary.js +1 -1
  214. package/dist/templates/FormLayoutPage.js +1 -1
  215. package/dist/templates/GalleryTemplate.js +1 -1
  216. package/dist/ui/index.js +1 -1
  217. package/dist/version.js +1 -1
  218. package/package.json +1 -1
  219. package/dist/Calculator-YZEGVEQ7.js +0 -29
  220. package/dist/Files-FPNJ46XY.js +0 -88
  221. package/dist/Sidebar-QP5Y7RBV.js +0 -44
  222. package/dist/chunk-2EPAXWZZ.js +0 -14
  223. package/dist/chunk-6FIYG7IH.js +0 -28
  224. package/dist/chunk-6R32KKIS.js +0 -22
  225. package/dist/chunk-7DI3VQCF.js +0 -2
  226. package/dist/chunk-B2MD232O.js +0 -6
  227. package/dist/chunk-EC22ACQZ.js +0 -11
  228. package/dist/chunk-FJBJUFD7.js +0 -4
  229. package/dist/chunk-GO6HU2O3.js +0 -7
  230. package/dist/chunk-H56TNUV4.js +0 -1
  231. package/dist/chunk-IGQZANYE.js +0 -15
  232. package/dist/chunk-MQ445O4X.js +0 -6
  233. package/dist/chunk-NMTS2L2B.js +0 -8
  234. package/dist/chunk-ODQYWMDF.js +0 -3
  235. package/dist/chunk-OPZXVXX5.js +0 -7
  236. package/dist/chunk-OZM6DE7A.js +0 -8
  237. package/dist/chunk-PMA6DZ4Q.js +0 -6
  238. package/dist/chunk-SCZUDGRZ.js +0 -2
  239. package/dist/chunk-SUYQ7QYB.js +0 -13
  240. package/dist/chunk-VEZHFONL.js +0 -9
@@ -1,23 +1,23 @@
1
- import{Calendar as e}from"./chunk-SKRFI6WB.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-LGTYPLJM.js";import{FILTER_ON as i,FILTER_ON_INK as s,FILTER_OFF as c}from"./chunk-AYZY3YNC.js";import{calendarNames as d}from"./chunk-Y3JW2GW5.js";import{pad2 as m}from"./chunk-LF27WIN2.js";import{buttonClasses as u}from"./chunk-UQYNPYF4.js";import{Icon as h}from"./chunk-7V32O5NF.js";import{onOverlayOpen as p}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as f}from"./chunk-62LW225J.js";import{useDropdownPosition as g}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as b}from"./chunk-D65T4H6J.js";import{useShellStrings as x,useShellLocale as v}from"./chunk-5YP7MFPK.js";import{glassStyle as y}from"./chunk-5FYDNH4Y.js";import{useState as w,useRef as N,useId as k,useEffect as C}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as j,jsx as D}from"react/jsx-runtime";var $=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Y=t;function F(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),l=new Date(n,a,0),i=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(i(1)),to:t(l)};case"last3Months":return{from:t(i(3)),to:t(l)};case"last6Months":return{from:t(i(6)),to:t(l)};case"last12Months":return{from:t(i(12)),to:t(l)}}}function S(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function L(e){const t=r(e);return t?`${m(t.getDate())}/${m(t.getMonth()+1)}/${t.getFullYear()}`:e}var O=/* @__PURE__ */new Map;function H({from:t,to:n,onChange:m,formatDisplay:Y,clearable:H,required:B=!1,name:T,id:G,"aria-labelledby":J,"aria-label":P,weekStartsOn:R,placeholder:E,fullWidth:I=!1,min:U,max:q,disabled:A=!1,allowOpenEnd:K=!1}){const V=x().dateRange,Z=v(),z=Y??(Z?function(e){let t=O.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),O.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(Z):L),Q=E??V.placeholder,X=H??!B,[_,ee]=w(!1),[te,re]=w(t),[ne,ae]=w(n),[oe,le]=w(null),[ie,se]=w("from"),ce=N(null),de=N(null),me=N(null),ue=k(),he=k(),pe=k(),[fe,ge]=w(!1),be=g(ce,_,{preferredMaxWidth:520,preferredMaxHeight:fe?720:560,popupRef:me}),xe=N(null),ve=N(null),[ye,we]=w(!0);b(()=>{const e=ve.current;if(!_||!fe||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&we(a)});const Ne=N(null);b(()=>{const e=me.current;if(!_||!be||!e)return;const t=getComputedStyle(e),r=be.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(fe)null!==Ne.current&&Ne.current<=r&&ge(!1);else{const e=xe.current?.offsetWidth??0;if(0===e)return;Ne.current=e,e>r+.5&&ge(!0)}});const[ke,Ce]=w(!1);b(()=>{const e=!!G&&(de.current?.labels?.length??0)>0;e!==ke&&Ce(e)});const Me=!!P||!!J||ke,We=/* @__PURE__ */new Date,[je,De]=w(()=>t?t.slice(0,7):S(We,U,q)),$e=$.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(F(e,We),U,q)),Ye=e=>e?z(e):"";C(()=>{if(!_)return;const e=e=>{const t=e.target;ce.current?.contains(t)||me.current?.contains(t)||ee(!1)};document.addEventListener("mousedown",e);const t=p(()=>ee(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[_]),C(()=>{A&&ee(!1)},[A]);const Fe=()=>{m("",""),ee(!1)},Se=X&&!A&&Boolean(t||n),Le=t&&n?`${Ye(t)} — ${Ye(n)}`:t?V.fromOnly(Ye(t)):n?V.toOnly(Ye(n)):"",Oe=d(Z),He=e=>{const t=r(e);return t?Oe.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Be=t&&n?V.range(He(t),He(n)):t?V.fromOnly(He(t)):n?V.toOnly(He(n)):Q,Te=e=>fe?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(oe===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(oe===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ge=/* @__PURE__ */W(j,{children:[$e.map(e=>/* @__PURE__ */D("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=F(e,We);re(t.from),ae(t.to),le(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":fe?V[e]:void 0,children:fe?ye?V[e]:V[`${e}Short`]:V[e]},e)),
2
- /* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:Te("Custom"),children:V.custom})]}),Je=(e,t)=>K?/* @__PURE__ */D("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>se(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */D("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Pe=e=>K&&ie===e?" ring-1 ring-blue-400":"",Re=
3
- /* @__PURE__ */D(e,{mode:"range",min:U,max:q,value:te||null,endValue:ne||null,month:je,onMonthChange:De,onSelect:e=>{le("Custom"),K?"from"===ie?(ne&&e>ne?(re(ne),ae(e)):re(e),se("to")):te&&e<te?(ae(te),re(e)):ae(e):!te||te&&ne?(re(e),ae("")):e<te?(ae(te),re(e)):ae(e)},weekStartsOn:R,"aria-label":V.dialog});/* @__PURE__ */
4
- return W("div",{className:"relative"+(I?" w-full":""),ref:ce,children:[
5
- /* @__PURE__ */W("div",{className:`relative ${I?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?a[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${i} ${s}`:c}${A?" cursor-not-allowed opacity-60":""}`,children:[
6
- /* @__PURE__ */W("button",{ref:de,type:"button",onClick:()=>{A||(re(t),ae(n),le(null),se(t&&!n?"to":"from"),De(t?t.slice(0,7):S(We,U,q)),ee(!0))},"aria-haspopup":"dialog","aria-expanded":_,id:G,disabled:A||void 0,"aria-label":P,"aria-labelledby":J,"aria-describedby":[Me?he:void 0,B?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":_?ue:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(I?" min-w-0 flex-1 justify-start":""),children:[
1
+ import{Calendar as e}from"./chunk-SKRFI6WB.js";import{toDateKey as t,fromDateKey as r,toMonthKey as n}from"./chunk-2HMNOLKX.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as o,InputEndActionButton as l}from"./chunk-GS74BABV.js";import{FILTER_ON as i,FILTER_ON_INK as s,FILTER_OFF as c}from"./chunk-AYZY3YNC.js";import{calendarNames as d}from"./chunk-Y3JW2GW5.js";import{pad2 as m}from"./chunk-LF27WIN2.js";import{buttonClasses as u}from"./chunk-UQYNPYF4.js";import{Icon as h}from"./chunk-7V32O5NF.js";import{onOverlayOpen as p}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as f}from"./chunk-62LW225J.js";import{useDropdownPosition as g}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as b}from"./chunk-D65T4H6J.js";import{glassStyle as x}from"./chunk-5FYDNH4Y.js";import{useShellStrings as v,useShellLocale as y}from"./chunk-5YP7MFPK.js";import{useState as w,useRef as N,useId as k,useEffect as C}from"react";import{createPortal as M}from"react-dom";import{jsxs as W,Fragment as j,jsx as D}from"react/jsx-runtime";var $=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],F=t;function Y(e,r){const n=r.getFullYear(),a=r.getMonth(),o=new Date(n,a,r.getDate()),l=new Date(n,a,0),i=e=>new Date(n,a-e,1);switch(e){case"last2Weeks":return{from:t(new Date(n,a,r.getDate()-14)),to:t(o)};case"lastMonth":return{from:t(i(1)),to:t(l)};case"last3Months":return{from:t(i(3)),to:t(l)};case"last6Months":return{from:t(i(6)),to:t(l)};case"last12Months":return{from:t(i(12)),to:t(l)}}}function S(e,t,r){const a=n(e);return t&&a<t.slice(0,7)?t.slice(0,7):r&&a>r.slice(0,7)?r.slice(0,7):a}function O(e){const t=r(e);return t?`${m(t.getDate())}/${m(t.getMonth()+1)}/${t.getFullYear()}`:e}var B=/* @__PURE__ */new Map;function H({from:t,to:n,onChange:m,formatDisplay:F,clearable:H,required:L=!1,name:G,id:R,"aria-labelledby":T,"aria-label":A,weekStartsOn:E,placeholder:I,fullWidth:J=!1,min:P,max:U,disabled:q=!1,allowOpenEnd:K=!1}){const V=v().dateRange,Z=y(),z=F??(Z?function(e){let t=B.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),B.set(e,t));const n=t;return e=>{const t=r(e);return t?n.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(Z):O),Q=I??V.placeholder,X=H??!L,[_,ee]=w(!1),[te,re]=w(t),[ne,ae]=w(n),[oe,le]=w(null),[ie,se]=w("from"),ce=N(null),de=N(null),me=N(null),ue=k(),he=k(),pe=k(),[fe,ge]=w(!1),be=g(ce,_,{preferredMaxWidth:520,preferredMaxHeight:fe?720:560,popupRef:me}),xe=N(null),ve=N(null),[ye,we]=w(!0);b(()=>{const e=ve.current;if(!_||!fe||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&we(a)});const Ne=N(null);b(()=>{const e=me.current;if(!_||!be||!e)return;const t=getComputedStyle(e),r=be.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(fe)null!==Ne.current&&Ne.current<=r&&ge(!1);else{const e=xe.current?.offsetWidth??0;if(0===e)return;Ne.current=e,e>r+.5&&ge(!0)}});const[ke,Ce]=w(!1);b(()=>{const e=!!R&&(de.current?.labels?.length??0)>0;e!==ke&&Ce(e)});const Me=!!A||!!T||ke,We=/* @__PURE__ */new Date,[je,De]=w(()=>t?t.slice(0,7):S(We,P,U)),$e=$.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Y(e,We),P,U)),Fe=e=>e?z(e):"";C(()=>{if(!_)return;const e=e=>{const t=e.target;ce.current?.contains(t)||me.current?.contains(t)||ee(!1)};document.addEventListener("mousedown",e);const t=p(()=>ee(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[_]),C(()=>{q&&ee(!1)},[q]);const Ye=()=>{m("",""),ee(!1)},Se=X&&!q&&Boolean(t||n),Oe=t&&n?`${Fe(t)} — ${Fe(n)}`:t?V.fromOnly(Fe(t)):n?V.toOnly(Fe(n)):"",Be=d(Z),He=e=>{const t=r(e);return t?Be.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Le=t&&n?V.range(He(t),He(n)):t?V.fromOnly(He(t)):n?V.toOnly(He(n)):Q,Ge=e=>fe?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(oe===e?"border-blue-300 bg-accent-tint text-blue-700 font-medium":"border-line text-ink hover:bg-row-hover"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(oe===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Re=/* @__PURE__ */W(j,{children:[$e.map(e=>/* @__PURE__ */D("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Y(e,We);re(t.from),ae(t.to),le(e),De(t.from.slice(0,7))})(e),className:Ge(e),"aria-label":fe?V[e]:void 0,children:fe?ye?V[e]:V[`${e}Short`]:V[e]},e)),
2
+ /* @__PURE__ */D("button",{type:"button",onClick:()=>le("Custom"),className:Ge("Custom"),children:V.custom})]}),Te=(e,t)=>K?/* @__PURE__ */D("button",{type:"button","data-range-end":e,"aria-pressed":ie===e,onClick:()=>se(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */D("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ae=e=>K&&ie===e?" ring-1 ring-blue-400":"",Ee=
3
+ /* @__PURE__ */D(e,{mode:"range",min:P,max:U,value:te||null,endValue:ne||null,month:je,onMonthChange:De,onSelect:e=>{le("Custom"),K?"from"===ie?(ne&&e>ne?(re(ne),ae(e)):re(e),se("to")):te&&e<te?(ae(te),re(e)):ae(e):!te||te&&ne?(re(e),ae("")):e<te?(ae(te),re(e)):ae(e)},weekStartsOn:E,"aria-label":V.dialog});/* @__PURE__ */
4
+ return W("div",{className:"relative"+(J?" w-full":""),ref:ce,children:[
5
+ /* @__PURE__ */W("div",{className:`relative ${J?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?a[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${t||n?`${i} ${s}`:c}${q?" cursor-not-allowed opacity-60":""}`,children:[
6
+ /* @__PURE__ */W("button",{ref:de,type:"button",onClick:()=>{q||(re(t),ae(n),le(null),se(t&&!n?"to":"from"),De(t?t.slice(0,7):S(We,P,U)),ee(!0))},"aria-haspopup":"dialog","aria-expanded":_,id:R,disabled:q||void 0,"aria-label":A,"aria-labelledby":T,"aria-describedby":[Me?he:void 0,L?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":_?ue:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(J?" min-w-0 flex-1 justify-start":""),children:[
7
7
  /* @__PURE__ */D(h,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
- /* @__PURE__ */D("span",{className:"truncate",children:Le||Q})]}),Se&&/* @__PURE__ */D(o,{children:/* @__PURE__ */D(l,{action:{label:V.clearRange,icon:/* @__PURE__ */D(h,{name:"close"}),onClick:Fe}})})]}),Me&&/* @__PURE__ */D("span",{id:he,className:"sr-only",children:Be}),B&&/* @__PURE__ */D("span",{id:pe,className:"sr-only",children:V.required}),T&&/* @__PURE__ */W(j,{children:[
9
- /* @__PURE__ */D("input",{type:"hidden",name:T.from,value:t,disabled:A||void 0}),
10
- /* @__PURE__ */D("input",{type:"hidden",name:T.to,value:n,disabled:A||void 0})]}),_&&M(
11
- /* @__PURE__ */W("div",{ref:me,id:ue,role:"dialog","aria-label":V.dialog,"data-layout":fe?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:f.popup,left:be?.left,right:be?.right,top:be?.top,bottom:be?.bottom,width:fe&&be?be.maxWidth:"max-content",maxWidth:be?.maxWidth,maxHeight:be?.maxHeight,overflowY:"auto",visibility:be?void 0:"hidden",...y()},children:[
12
- /* @__PURE__ */W("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Je("from",/* @__PURE__ */W(j,{children:[
8
+ /* @__PURE__ */D("span",{className:"truncate",children:Oe||Q})]}),Se&&/* @__PURE__ */D(o,{children:/* @__PURE__ */D(l,{action:{label:V.clearRange,icon:/* @__PURE__ */D(h,{name:"close"}),onClick:Ye}})})]}),Me&&/* @__PURE__ */D("span",{id:he,className:"sr-only",children:Le}),L&&/* @__PURE__ */D("span",{id:pe,className:"sr-only",children:V.required}),G&&/* @__PURE__ */W(j,{children:[
9
+ /* @__PURE__ */D("input",{type:"hidden",name:G.from,value:t,disabled:q||void 0}),
10
+ /* @__PURE__ */D("input",{type:"hidden",name:G.to,value:n,disabled:q||void 0})]}),_&&M(
11
+ /* @__PURE__ */W("div",{ref:me,id:ue,role:"dialog","aria-label":V.dialog,"data-layout":fe?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:f.popup,left:be?.left,right:be?.right,top:be?.top,bottom:be?.bottom,width:fe&&be?be.maxWidth:"max-content",maxWidth:be?.maxWidth,maxHeight:be?.maxHeight,overflowY:"auto",visibility:be?void 0:"hidden",...x()},children:[
12
+ /* @__PURE__ */W("div",{className:fe?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Te("from",/* @__PURE__ */W(j,{children:[
13
13
  /* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:V.from}),
14
- /* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Pe("from")}`,children:te?Ye(te):V.start})]})),!fe&&/* @__PURE__ */D("span",{className:"text-gray-300",children:"—"}),Je("to",/* @__PURE__ */W(j,{children:[
14
+ /* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${te?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ae("from")}`,children:te?Fe(te):V.start})]})),!fe&&/* @__PURE__ */D("span",{className:"text-gray-300",children:"—"}),Te("to",/* @__PURE__ */W(j,{children:[
15
15
  /* @__PURE__ */D("span",{className:"text-xs font-medium text-gray-500",children:V.to}),
16
- /* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Pe("to")}`,children:ne?Ye(ne):V.end})]}))]}),fe?/* @__PURE__ */W(j,{children:[$e.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */D("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:V.lastHeading}),
17
- /* @__PURE__ */W("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ge,$e.map(e=>/* @__PURE__ */D("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:V[e]},e))]})]}),
18
- /* @__PURE__ */D("div",{className:"w-full",children:Re})]}):
16
+ /* @__PURE__ */D("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ne?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ae("to")}`,children:ne?Fe(ne):V.end})]}))]}),fe?/* @__PURE__ */W(j,{children:[$e.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */D("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:V.lastHeading}),
17
+ /* @__PURE__ */W("div",{ref:ve,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Re,$e.map(e=>/* @__PURE__ */D("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:V[e]},e))]})]}),
18
+ /* @__PURE__ */D("div",{className:"w-full",children:Ee})]}):
19
19
  /* @__PURE__ */W("div",{ref:xe,className:"flex w-max gap-4",children:[
20
- /* @__PURE__ */D("div",{className:"w-64",children:Re}),$e.length>0&&/* @__PURE__ */D("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ge})]}),
21
- /* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */D("button",{type:"button",onClick:Fe,className:u({variant:"ghost"}),children:V.clear}),
20
+ /* @__PURE__ */D("div",{className:"w-64",children:Ee}),$e.length>0&&/* @__PURE__ */D("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Re})]}),
21
+ /* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */D("button",{type:"button",onClick:Ye,className:u({variant:"ghost"}),children:V.clear}),
22
22
  /* @__PURE__ */D("button",{type:"button",onClick:()=>ee(!1),className:u({variant:"secondary"}),children:V.cancel}),
23
- /* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:K?!te&&!ne:!te||!ne,className:u({variant:"primary"}),children:V.apply})]})]}),document.body)]})}export{H as DateRangePicker,F as presetRange,Y as toISODate};
23
+ /* @__PURE__ */D("button",{type:"button",onClick:()=>{m(te,ne),ee(!1)},disabled:K?!te&&!ne:!te||!ne,className:u({variant:"primary"}),children:V.apply})]})]}),document.body)]})}export{H as DateRangePicker,Y as presetRange,F as toISODate};
@@ -1,4 +1,4 @@
1
- import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-WGRS6QBT.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useShellStrings as p}from"./chunk-5YP7MFPK.js";import{glassStyle as m}from"./chunk-5FYDNH4Y.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
1
+ import{buildQuerySections as e,buildEmptySections as t,flattenRows as r,DEFAULT_MAGNIFIER as n,stepIndex as a,nextGroupIndex as s,SEE_ALL_ICON as l,resultTypeKey as o}from"./chunk-WGRS6QBT.js";import{useDismissPopupsOnOpen as i}from"./chunk-7QSDPSXP.js";import{SpinnerRing as c,LoadingSpinner as d}from"./chunk-R2VKEMZH.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{glassStyle as p}from"./chunk-5FYDNH4Y.js";import{useShellStrings as m}from"./chunk-5YP7MFPK.js";import{useState as h,useRef as f,useEffect as y,useMemo as g,useId as x,useCallback as b}from"react";import{createPortal as k}from"react-dom";import{jsxs as v,jsx as w}from"react/jsx-runtime";function N(e){if(Array.isArray(e))return{results:e,truncatedTypes:[]};if(e&&"object"==typeof e&&Array.isArray(e.results)){const{results:t,truncatedTypes:r}=e;return{results:t,truncatedTypes:Array.isArray(r)?r:[]}}return{results:[],truncatedTypes:[]}}var A=[];function L(e,t,r){const[n,a]=h([]),[s,l]=h(A),[o,i]=h(!1),[c,d]=h("none"),u=f(function(){let e=0,t=null;const r=()=>{e+=1,t?.abort(),t=null};return{begin:()=>{r();const n=e,a=new AbortController;return t=a,{signal:a.signal,isCurrent:()=>n===e}},cancel:r}}());y(()=>{const n=u.current;if(e.length<r||!t||0===t.length)return n.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),void i(!1);i(!0);const s=setTimeout(async()=>{const r=n.begin(),s=await async function(e,t,r){const n=await Promise.all(e.map(async e=>{try{return{failed:!1,...N(await e(t,{signal:r}))}}catch(e){const t=r.aborted||function(e){if(!e||"object"!=typeof e)return!1;const{name:t,code:r}=e;return"AbortError"===t||"CanceledError"===t||"ERR_CANCELED"===r}(e);return{failed:!t,results:[],truncatedTypes:[]}}}));return{results:n.flatMap(e=>e.results),truncatedTypes:Array.from(new Set(n.flatMap(e=>e.truncatedTypes))),failed:n.filter(e=>e.failed).length}}(t,e,r.signal);r.isCurrent()&&(a(s.results),l(s.truncatedTypes),d(0===s.failed?"none":s.failed>=t.length?"all":"some"),i(!1))},250);return()=>{clearTimeout(s),n.cancel()}},[e,t,r]);return{results:n,truncatedTypes:s,loading:o,failure:c,reset:b(()=>{u.current.cancel(),a(e=>0===e.length?e:[]),l(A),d("none"),i(!1)},[])}}var C=(e,t)=>`${e}-opt-${t}`;function E(e,t){if("seeAll"===e.kind)return l;if("action"===e.kind)return e.icon??n;if(e.icon)return e.icon;const r=t?.[o(e.result)];return r||n}function T({sections:e,activeIdx:t,listId:r,label:n,typeIcons:a,groupCount:s,groupLabel:l,onHover:o,onPick:i}){let c=0;/* @__PURE__ */
2
2
  return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.map(e=>/* @__PURE__ */v("div",{role:"group","aria-label":l(e.title,e.count,!!e.truncated),children:[
3
3
  /* @__PURE__ */v("div",{"aria-hidden":"true",className:"flex items-center justify-between px-4 pt-2 pb-1 text-2xs font-semibold uppercase tracking-wide text-ink-faintest",children:[
4
4
  /* @__PURE__ */w("span",{children:e.title}),
@@ -6,10 +6,10 @@ return w("div",{id:r,role:"listbox","aria-label":n,className:"py-1",children:e.m
6
6
  return v("div",{id:C(r,n),role:"option","aria-selected":s,className:"flex items-center gap-3 w-full px-4 py-3 text-left cursor-pointer transition-colors "+(s?"bg-blue-50":"hover:bg-gray-50"),onMouseDown:e=>e.preventDefault(),onClick:()=>i(e),onMouseEnter:()=>o(n),children:[
7
7
  /* @__PURE__ */w("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:E(e,a)})}),
8
8
  /* @__PURE__ */v("div",{className:"flex-1 min-w-0",children:[
9
- /* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:K,onRecord:P,favorites:M,hotkey:R=!0}={}){const S=p().search,$=E??S.placeholder,[B,F]=h(!1),[H,W]=h(""),[z,Y]=h(0),G=f(null),{results:Q,truncatedTypes:V,loading:q,failure:J,reset:U}=L(H,l,2);y(()=>{const e=e=>{R&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),F(e=>!e)),"Escape"===e.key&&B&&F(!1)},t=()=>F(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[B,R]),i(B);const[X,Z]=h(!1);B!==X&&(Z(B),B&&(W(""),Y(0),U())),y(()=>{B?setTimeout(()=>G.current?.focus(),50):W("")},[B]),y(()=>{Y(0)},[Q]);const _=H.length>=2,O=g(()=>_?e(Q,D,H,S.actions,{truncatedTypes:V,listRoutes:A,typeLabels:N,seeAllLabel:S.seeAll}):t({recent:K,favorites:M,actions:D,typeLabels:N},S),[_,Q,V,A,N,D,H,K,M,S]),ee=g(()=>r(O),[O]),te=Math.min(z,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{B&&0!==ee.length&&document.getElementById(C(re,te))?.scrollIntoView?.({block:"nearest"})},[B,te,ee.length,re]);const ae=b(e=>{F(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||P?.(e.result),I?.(e.result)):e.action.onSelect()},[I,P]);return B?k(
9
+ /* @__PURE__ */w("p",{className:"text-sm font-medium truncate "+(u?"text-blue-600":"text-gray-900"),children:e.label}),d&&/* @__PURE__ */w("p",{className:"text-xs text-gray-400 truncate",children:d})]}),l&&/* @__PURE__ */w("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-3xs font-medium text-ink-faint",children:l})]},e.key)})]},e.key))})}var j="react-os-shell:open-global-search";function D(){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(j))}function I({providers:l,typeIcons:o,typeLabels:N,listRoutes:A,placeholder:E,quickActions:D,onSelect:I,recent:K,onRecord:P,favorites:M,hotkey:R=!0}={}){const S=m().search,$=E??S.placeholder,[B,F]=h(!1),[H,W]=h(""),[z,Y]=h(0),G=f(null),{results:Q,truncatedTypes:V,loading:q,failure:J,reset:U}=L(H,l,2);y(()=>{const e=e=>{R&&!e.defaultPrevented&&(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),F(e=>!e)),"Escape"===e.key&&B&&F(!1)},t=()=>F(!0);return window.addEventListener("keydown",e),window.addEventListener(j,t),()=>{window.removeEventListener("keydown",e),window.removeEventListener(j,t)}},[B,R]),i(B);const[X,Z]=h(!1);B!==X&&(Z(B),B&&(W(""),Y(0),U())),y(()=>{B?setTimeout(()=>G.current?.focus(),50):W("")},[B]),y(()=>{Y(0)},[Q]);const _=H.length>=2,O=g(()=>_?e(Q,D,H,S.actions,{truncatedTypes:V,listRoutes:A,typeLabels:N,seeAllLabel:S.seeAll}):t({recent:K,favorites:M,actions:D,typeLabels:N},S),[_,Q,V,A,N,D,H,K,M,S]),ee=g(()=>r(O),[O]),te=Math.min(z,Math.max(ee.length-1,0)),re=x(),ne=ee.length>0;y(()=>{B&&0!==ee.length&&document.getElementById(C(re,te))?.scrollIntoView?.({block:"nearest"})},[B,te,ee.length,re]);const ae=b(e=>{F(!1),"action"!==e.kind?("result"!==e.kind&&"recent"!==e.kind||P?.(e.result),I?.(e.result)):e.action.onSelect()},[I,P]);return B?k(
10
10
  /* @__PURE__ */v("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:u.overlay},onClick:()=>F(!1),children:[
11
11
  /* @__PURE__ */w("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
12
- /* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:m(),children:[
12
+ /* @__PURE__ */v("div",{className:"relative z-10 w-full max-w-xl rounded-(--radius-popup) overflow-hidden",onClick:e=>e.stopPropagation(),style:p(),children:[
13
13
  /* @__PURE__ */v("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
14
14
  /* @__PURE__ */w("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */w("path",{strokeLinecap:"round",strokeLinejoin:"round",d:n})}),
15
15
  /* @__PURE__ */w("input",{ref:G,type:"text",value:H,onChange:e=>{W(e.target.value),Y(0)},onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),Y(a(te,1,ee.length))):"ArrowUp"===e.key?(e.preventDefault(),Y(a(te,-1,ee.length))):"Tab"===e.key&&ee.length>0?(e.preventDefault(),Y(s(O.map(e=>e.rows.length),te,e.shiftKey?-1:1))):"Enter"===e.key&&ee[te]&&ae(ee[te])},placeholder:$,role:"combobox","aria-expanded":ne,"aria-controls":ne?re:void 0,"aria-activedescendant":ne?C(re,te):void 0,"aria-autocomplete":"list",className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),q&&/* @__PURE__ */w("span",{"data-global-search-spinner":"",role:"status","aria-label":S.searching,className:"flex shrink-0",children:/* @__PURE__ */w(c,{className:"h-4 w-4",ink:"text-ink-faint"})}),
@@ -0,0 +1,6 @@
1
+ import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-2XORVHF2.js";import{IconButton_default as a}from"./chunk-LE5LWALR.js";import{Icon as o}from"./chunk-7V32O5NF.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
2
+ return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:M,letterCase:D,clear:x,disabled:y=!1,"aria-label":L,windows:j,className:A="",layout:R="grid"}){const q=s().textToolbar,I=w({offered:n,color:k,last:N,alignment:C,list:M,letterCase:D,clear:x});if(!I.words&&!I.paragraph)return null;const K=m(n,k,x,I.cells.paragraph),$=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,B=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:$(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:$(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,O=l(q),S=e.map(e=>[e,O[e],r(e)]),F=C?e.filter(e=>C.allow.includes(e)):[],T=C&&F.includes(C.value)?C.value:F[0],U=[["none",q.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",q.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",q.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],E=x&&K?g(q.clear,/* @__PURE__ */i(a,{className:$(!1),"aria-label":q.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,H=/* @__PURE__ */t(d,{children:[B("bold",q.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),B("italic",q.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),B("underline",q.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),B("strike",q.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(q.color,/* @__PURE__ */i(a,{pressed:k.open,className:$(k.open,"rosh-tb-color"),"aria-label":q.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,B("link",q.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),B("sup",q.sup,/* @__PURE__ */i(o,{name:"superscript"})),B("sub",q.sub,/* @__PURE__ */i(o,{name:"subscript"})),B("code",q.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===K?E:null]}),P=/* @__PURE__ */t(d,{children:[C&&F.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":q.alignment,onKeyDown:e=>p(e,F,e=>C.onChange(e)),children:S.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:$(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===T?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,M&&n.has("bullet")?g(q.bullet,/* @__PURE__ */i(a,{className:$("bullet"===M.pressed),"aria-label":q.bullet,"aria-pressed":"bullet"===M.pressed,disabled:y,onMouseDown:c,onClick:()=>M.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,M&&n.has("number")?g(q.number,/* @__PURE__ */i(a,{className:$("number"===M.pressed),"aria-label":q.number,"aria-pressed":"number"===M.pressed,disabled:y,onMouseDown:c,onClick:()=>M.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,B("quote",q.quote,/* @__PURE__ */i(o,{name:"quote"})),D?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":q.letterCase,onKeyDown:e=>p(e,U.map(([e])=>e),e=>D.onChange(e)),children:U.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:D.value===e,className:$(D.value===e),"aria-checked":D.value===e,"aria-label":l,tabIndex:e===(D.value||"none")?0:-1,disabled:y||D.disabled,onMouseDown:c,onClick:()=>D.onChange(D.value===e?"":e),children:r},e)))}):null,"paragraph"===K?E:null]}),V="row"===R,W=V?" is-row":I.flow?" is-flow":I.oneRow?" is-one-row":I.words&&void 0===N&&"words"!==K?" is-eight":"",J=b(n,Boolean(k)),X={"--rosh-tb-color-col":String(J.color),"--rosh-tb-link-col":String(J.link),...V?{"--rosh-tb-cells":String(I.cells.words+I.cells.paragraph),"--rosh-tb-groupgap":I.words&&I.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let Y;return Y=V?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[I.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:H}):null,I.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:P}):null]}):I.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[H,
3
+ /* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),P]}):I.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
4
+ /* @__PURE__ */i("div",{className:"rosh-tb-words",children:H}),
5
+ /* @__PURE__ */i("div",{className:"rosh-tb-para",children:P})]}):/* @__PURE__ */t(d,{children:[I.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==K?" is-eight":""),children:H}):null,I.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:P}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${W} ${A}`.trim(),style:X,children:[
6
+ /* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":L??q.formatting,children:Y}),j]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
@@ -1 +1 @@
1
- import{iconButtonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as r,swallowPress as a,describedByWith as i,OffWithReason as s}from"./chunk-XWFLIGDQ.js";import{forwardRef as d,useId as n}from"react";import{jsx as o}from"react/jsx-runtime";var t=d(function({children:d,variant:t="ghost",size:c="md",type:l="button",className:m="",pressed:b,disabledReason:p,ink:u,disabled:f,onClick:h,"aria-disabled":k,"aria-describedby":v,...y},N){const j=n(),x=(Boolean(f)||r(k))&&null!=p&&""!==p,z=x||r(k),C=/* @__PURE__ */o("button",{ref:N,type:l,className:e({variant:t,size:c,pressed:b??(!0===y["aria-pressed"]||"true"===y["aria-pressed"]),ink:u,className:m}),...y,disabled:x?void 0:f,"aria-disabled":!!z||k,"aria-describedby":i(v,x?j:void 0),onClick:z?a:h,children:d});return x?/* @__PURE__ */o(s,{reason:p,id:j,children:C}):C});export{t as IconButton_default};
1
+ import{iconButtonClasses as e}from"./chunk-UQYNPYF4.js";import{isAriaDisabled as r,swallowPress as a,describedByWith as i,OffWithReason as s}from"./chunk-TE6R53YD.js";import{forwardRef as d,useId as n}from"react";import{jsx as o}from"react/jsx-runtime";var t=d(function({children:d,variant:t="ghost",size:c="md",type:l="button",className:m="",pressed:b,disabledReason:p,ink:u,disabled:f,onClick:h,"aria-disabled":k,"aria-describedby":v,...y},N){const j=n(),Y=(Boolean(f)||r(k))&&null!=p&&""!==p,x=Y||r(k),z=/* @__PURE__ */o("button",{ref:N,type:l,className:e({variant:t,size:c,pressed:b??(!0===y["aria-pressed"]||"true"===y["aria-pressed"]),ink:u,className:m}),...y,disabled:Y?void 0:f,"aria-disabled":!!x||k,"aria-describedby":i(v,Y?j:void 0),onClick:x?a:h,children:d});return Y?/* @__PURE__ */o(s,{reason:p,id:j,children:z}):z});export{t as IconButton_default};
@@ -0,0 +1,6 @@
1
+ import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{ChartTooltip as l}from"./chunk-36VIGB6J.js";import{CartesianPlot as t}from"./chunk-QDL2FNP7.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-5YP7MFPK.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:j,tone:L,label:v,className:M,emptyLabel:F,radius:N=3}){const O=o().charts,P=n(),V=w??(e=>h(e,P)),A=v??O.range,C=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),Q=r(0,j,L);/* @__PURE__ */
2
+ return s(t,{labels:d,values:C,height:k,width:g,max:b,min:x,formatValue:V,yAxisLabel:y,className:M,emptyLabel:F,bandPadding:"bar"===p?.34:0,ariaLabel:O.rangeLabel(A,d.length),tooltip:e=>/* @__PURE__ */s(l,{title:d[e],rows:[{key:"high",label:O.high,color:Q,value:null==u[e]?void 0:V(u[e].high)},{key:"low",label:O.low,color:Q,value:null==u[e]?void 0:V(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:N,fill:Q,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
3
+ return m(c,{children:[
4
+ /* @__PURE__ */s("path",{d:e(i(r,f),a),fill:Q,fillOpacity:.2,stroke:"none"}),
5
+ /* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:Q,strokeWidth:2,strokeLinejoin:"round"}),
6
+ /* @__PURE__ */s("path",{d:i(a,f),fill:"none",stroke:Q,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==r&&/* @__PURE__ */s("line",{x1:l.center(r),y1:t(u[r].high),x2:l.center(r),y2:t(u[r].low),stroke:a.axis,strokeWidth:1})]})})}export{u as RangeChart};
@@ -1 +1 @@
1
- import{client_default as a}from"./chunk-CLAKVFOB.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-JGWUSJDD.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -1,4 +1,4 @@
1
- import{Tooltip as r}from"./chunk-QQ2LDC6C.js";import{useShellStrings as e}from"./chunk-5YP7MFPK.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
1
+ import{Tooltip as r}from"./chunk-NJN5IKWO.js";import{useShellStrings as e}from"./chunk-5YP7MFPK.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
2
2
  /* @__PURE__ */t("circle",{cx:"2",cy:"3",r:"1.1"}),
3
3
  /* @__PURE__ */t("circle",{cx:"2",cy:"7",r:"1.1"}),
4
4
  /* @__PURE__ */t("circle",{cx:"2",cy:"11",r:"1.1"})]});function l({hint:n,dragging:i,revealClassName:c,marker:l}){const o=e().tree;/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{formatMoney as e}from"./chunk-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-6R32KKIS.js";import{ChartFrame as a}from"./chunk-NTUZT37J.js";import{ColumnChart as l}from"./chunk-UG42KUCT.js";import{TH_ONE_LINE as s}from"./chunk-CJH2BGXY.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-GEYM4WN3.js";import{EMPTY_VALUE as r}from"./chunk-36BRD5J3.js";import{TimeSeriesChart as t}from"./chunk-ES2LUEPN.js";import{ChartFrame as a}from"./chunk-NTUZT37J.js";import{ColumnChart as l}from"./chunk-IKKR2TYY.js";import{TH_ONE_LINE as s}from"./chunk-WGLHB6WE.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:[
@@ -1,4 +1,4 @@
1
- import{Banner as e}from"./chunk-IIKPM3F4.js";import{Button_default as t}from"./chunk-7DI3VQCF.js";import{useShellStrings as n}from"./chunk-5YP7MFPK.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
1
+ import{Banner as e}from"./chunk-IIKPM3F4.js";import{Button_default as t}from"./chunk-EOVXFXVV.js";import{useShellStrings as n}from"./chunk-5YP7MFPK.js";import{useState as r,useEffect as i}from"react";import{jsx as o,jsxs as a}from"react/jsx-runtime";var s=6e4;function c({currentVersion:e,versionUrl:t="/version.json",pollMs:n=6e4}){const[o,a]=r(null);return i(()=>{if(!e||null!==o)return;let r=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const n=t.includes("?")?"&":"?",i=await fetch(`${t}${n}t=${Date.now()}`,{cache:"no-store"});if(!i.ok)return;const o=await i.json(),s=o&&"object"==typeof o&&"string"==typeof o.version?o.version:null;!r&&s&&s!==e&&a(s)}catch{}};i();const s=setInterval(()=>{i()},n),c=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",c),()=>{r=!0,clearInterval(s),document.removeEventListener("visibilitychange",c)}},[e,t,n,o]),o}function l({currentVersion:r,versionUrl:i,pollMs:s,message:l,onRefresh:m,className:u=""}){const d=c({currentVersion:r,versionUrl:i,pollMs:s}),p=n();if(null===d)return null;const f=m??(()=>window.location.reload());/* @__PURE__ */
2
2
  return o("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${u}`.trim(),children:/* @__PURE__ */a(e,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */o(t,{type:"button",variant:"primary",size:"md",onClick:f,children:p.update.refreshNow}),children:[
3
3
  /* @__PURE__ */o("span",{className:"font-medium",children:l??p.update.available}),
4
4
  /* @__PURE__ */a("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[r," → ",d]})]})})}export{s as APP_UPDATE_POLL_MS,l as AppUpdateBanner,c as useAppUpdate};
@@ -1,4 +1,4 @@
1
- import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-XWFLIGDQ.js";import{Icon as a}from"./chunk-7V32O5NF.js";import{OneLineLabel as o}from"./chunk-CJH2BGXY.js";import{Tooltip as s}from"./chunk-QQ2LDC6C.js";import{useShellStrings as n}from"./chunk-5YP7MFPK.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
1
+ import{swallowPress as e,describedByWith as i,OffWithReason as r}from"./chunk-TE6R53YD.js";import{Icon as a}from"./chunk-7V32O5NF.js";import{OneLineLabel as o}from"./chunk-WGLHB6WE.js";import{Tooltip as s}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-5YP7MFPK.js";import{useId as l,Fragment as d}from"react";import{jsx as t,jsxs as c}from"react/jsx-runtime";function b({items:b,onChange:h,label:m,className:u="","aria-labelledby":f,"aria-describedby":p}){const w=n().displayChips,g=l();/* @__PURE__ */
2
2
  return t("div",{role:"group","aria-label":f?void 0:m,"aria-labelledby":f,"aria-describedby":p,className:`flex flex-wrap gap-2 ${u}`.trim(),children:b.map((n,l)=>{const b=`${g}-${l}-state`,m=`${g}-${l}-reason`,u=Boolean(n.disabled)&&null!=n.disabledReason&&""!==n.disabledReason,f=/* @__PURE__ */c("button",{type:"button","aria-pressed":n.shown,disabled:!(!n.disabled||u)||void 0,"aria-disabled":!!u||void 0,"aria-describedby":i(b,u?m:void 0),onClick:u?e:()=>h(n.id,!n.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(n.shown?"border-blue-200 bg-accent-tint text-blue-700 hover:bg-blue-100":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink-strongest"),children:[
3
3
  /* @__PURE__ */t(a,{name:n.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
4
4
  /* @__PURE__ */t(o,{children:n.label})]}),p=/* @__PURE__ */t("span",{id:b,className:"sr-only",children:n.shown?w.shown:w.hidden});/* @__PURE__ */
@@ -1,11 +1,11 @@
1
- import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-VEGZVUHE.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-CDAJKLGL.js";import{Button_default as c}from"./chunk-7DI3VQCF.js";import{buttonClasses as s}from"./chunk-UQYNPYF4.js";import{Icon as m}from"./chunk-7V32O5NF.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-5YP7MFPK.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",F=e=>e.stopPropagation();function U({images:r,startIndex:y=0,onClose:U,onIndexChange:D,onOpenFile:L}){const P=h().lightbox,V=d(),$=p(null),z=p(null),[A,I]=x(y),E=r.length,G=V&&E>0,J=b(e=>{if(E<2)return;const t=((A+e)%E+E)%E;I(t),D?.(t)},[A,E,D]);if(a(G),l($,G,z),i(G),k(()=>{if(G)return f(()=>(U(),!0),()=>$.current)},[G,U]),k(()=>{if(!G)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),J("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[G,J]),!G)return null;const Q=r[Math.min(A,E-1)],W=j(Q),Y=Q.caption||n(Q.url);let M;return M="video"===W?/* @__PURE__ */v("video",{src:Q.url,controls:!0,playsInline:!0,"aria-label":Y,onClick:F,className:`${e} rounded-lg bg-black`}):"file"===W?/* @__PURE__ */w("div",{onClick:F,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
1
+ import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-GJVGGYQ2.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-CDAJKLGL.js";import{Button_default as c}from"./chunk-EOVXFXVV.js";import{buttonClasses as s}from"./chunk-UQYNPYF4.js";import{Icon as m}from"./chunk-7V32O5NF.js";import{Z_LAYERS as u}from"./chunk-62LW225J.js";import{useHydrated as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-5YP7MFPK.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",F=e=>e.stopPropagation();function V({images:r,startIndex:y=0,onClose:V,onIndexChange:G,onOpenFile:L}){const P=h().lightbox,U=d(),$=p(null),z=p(null),[A,D]=x(y),J=r.length,Y=U&&J>0,I=b(e=>{if(J<2)return;const t=((A+e)%J+J)%J;D(t),G?.(t)},[A,J,G]);if(a(Y),l($,Y,z),i(Y),k(()=>{if(Y)return f(()=>(V(),!0),()=>$.current)},[Y,V]),k(()=>{if(!Y)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),I("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Y,I]),!Y)return null;const O=r[Math.min(A,J-1)],Q=j(O),W=O.caption||n(O.url);let E;return E="video"===Q?/* @__PURE__ */v("video",{src:O.url,controls:!0,playsInline:!0,"aria-label":W,onClick:F,className:`${e} rounded-lg bg-black`}):"file"===Q?/* @__PURE__ */w("div",{onClick:F,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
2
2
  /* @__PURE__ */v(m,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
3
- /* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:Y}),L?/* @__PURE__ */v(c,{size:"sm",onClick:()=>L(Q),children:P.openFile}):/* @__PURE__ */v("a",{href:Q.url,target:"_blank",rel:"noopener noreferrer",className:s({size:"sm"}),children:P.openFile})]}):/* @__PURE__ */v(t,{src:Q.url,alt:Y,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
4
- /* @__PURE__ */w("div",{ref:$,...o({role:"dialog",modal:!0,label:P.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:u.overlay},onClick:U,children:[M,
3
+ /* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:W}),L?/* @__PURE__ */v(c,{size:"sm",onClick:()=>L(O),children:P.openFile}):/* @__PURE__ */v("a",{href:O.url,target:"_blank",rel:"noopener noreferrer",className:s({size:"sm"}),children:P.openFile})]}):/* @__PURE__ */v(t,{src:O.url,alt:W,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
4
+ /* @__PURE__ */w("div",{ref:$,...o({role:"dialog",modal:!0,label:P.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:u.overlay},onClick:V,children:[E,
5
5
  /* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:F,children:[
6
- /* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:P.counter(A+1,E)}),
7
- /* @__PURE__ */v("button",{ref:z,type:"button",onClick:U,"aria-label":P.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),E>1&&/* @__PURE__ */w(N,{children:[
8
- /* @__PURE__ */v("button",{type:"button",onClick:e=>{F(e),J(-1)},"aria-label":P.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
9
- /* @__PURE__ */v("button",{type:"button",onClick:e=>{F(e),J(1)},"aria-label":P.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
6
+ /* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:P.counter(A+1,J)}),
7
+ /* @__PURE__ */v("button",{ref:z,type:"button",onClick:V,"aria-label":P.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),J>1&&/* @__PURE__ */w(N,{children:[
8
+ /* @__PURE__ */v("button",{type:"button",onClick:e=>{F(e),I(-1)},"aria-label":P.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
9
+ /* @__PURE__ */v("button",{type:"button",onClick:e=>{F(e),I(1)},"aria-label":P.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(m,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
10
10
  /* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:F,children:[
11
- /* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:Y}),"file"!==W&&/* @__PURE__ */v("a",{href:Q.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:P.openOriginal})]})]}),document.body)}export{U as ImageLightbox,j as lightboxKind};
11
+ /* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:W}),"file"!==Q&&/* @__PURE__ */v("a",{href:O.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:P.openOriginal})]})]}),document.body)}export{V as ImageLightbox,j as lightboxKind};
@@ -1,9 +1,9 @@
1
- import{ImageFocusPoint as e}from"./chunk-VZ52KKNA.js";import{Segmented as a}from"./chunk-JQBVSPF5.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-VEGZVUHE.js";import{TransferProgress as u}from"./chunk-AHITTM6W.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-ZKBGUDNB.js";import{Icon as p}from"./chunk-7V32O5NF.js";import{useShellStrings as b}from"./chunk-5YP7MFPK.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as N,Fragment as j}from"react/jsx-runtime";var x=["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:F,onFile:R,label:U,hint:C,error:P,required:B,className:K,accept:O="image/*",maxSizeBytes:V,fit:$="cover",height:z=112,placeholder:H,cta:q,acceptHint:A,showFilename:I=!0,allowReplace:S=!0,allowRemove:W=!0,replaceLabel:Z,removeLabel:D,busy:E=!1,busyLabel:G,choosingLabel:M,pickFailedLabel:T,progress:Y,disabled:_=!1,kind:J,onKindChange:Q,focus:X,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=q??ie.cta,oe=J??(/video/.test(O)&&!/image/.test(O)?"video":"image"),re="string"==typeof D&&D?D:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=E||ne,me=ne&&!E?M??ie.choosing:G??ie.uploading,he=P??(se?T??ie.pickFailed:void 0),pe=e=>{if(!F)return;ce(!1);const a=F(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=_||ue,ke=!!w&&(t(w,O)||w===ve),Ne=H??o(O,ie),je=Z??(ke||"video"===oe?ie.changeVideo:ie.changeImage),xe=e=>{F?pe(e):R?R(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:O,maxSizeBytes:V,acceptHint:A,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:Le}=we,Fe=()=>{ye||(F?pe():we.open())},Re=w?r(w):"",Ue=!ke&&!!ee,Ce=_||!S&&!W?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["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:[S&&/* @__PURE__ */k("button",{id:Ue?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Fe(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
1
+ import{ImageFocusPoint as e}from"./chunk-VZ52KKNA.js";import{Segmented as a}from"./chunk-S4FPYCUU.js";import{FormField as i}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-GJVGGYQ2.js";import{TransferProgress as u}from"./chunk-PTVTNCD6.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-ZKBGUDNB.js";import{Icon as p}from"./chunk-7V32O5NF.js";import{useShellStrings as b}from"./chunk-5YP7MFPK.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as N,Fragment as j}from"react/jsx-runtime";var x=["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:F,onFile:R,label:U,hint:C,error:P,required:K,className:O,accept:$="image/*",maxSizeBytes:z,fit:B="cover",height:V=112,placeholder:G,cta:Y,acceptHint:q,showFilename:D=!0,allowReplace:H=!0,allowRemove:S=!0,replaceLabel:A,removeLabel:I,busy:T=!1,busyLabel:W,choosingLabel:Z,pickFailedLabel:_,progress:J,disabled:M=!1,kind:Q,onKindChange:E,focus:X,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=Y??ie.cta,oe=Q??(/video/.test($)&&!/image/.test($)?"video":"image"),re="string"==typeof I&&I?I:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=T||ne,me=ne&&!T?Z??ie.choosing:W??ie.uploading,he=P??(se?_??ie.pickFailed:void 0),pe=e=>{if(!F)return;ce(!1);const a=F(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&L(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=M||ue,ke=!!w&&(t(w,$)||w===ve),Ne=G??o($,ie),je=A??(ke||"video"===oe?ie.changeVideo:ie.changeImage),xe=e=>{F?pe(e):R?R(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),L(a)})(e)},we=m({accept:$,maxSizeBytes:z,acceptHint:q,multiple:!1,disabled:ye,onAccept:([e])=>xe(e)}),{dragOver:Le}=we,Fe=()=>{ye||(F?pe():we.open())},Re=w?r(w):"",Ue=!ke&&!!ee,Ce=M||!H&&!S?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["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:[H&&/* @__PURE__ */k("button",{id:Ue?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Fe(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${x}`,children:[
2
2
  /* @__PURE__ */N(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
3
- /* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),W&&/* @__PURE__ */N("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */N(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ue?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Ue?void 0:{height:z},children:[Ue?
4
- /* @__PURE__ */N(e,{value:X??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */N("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Re||void 0,className:"h-full w-full",style:{objectFit:$}}):/* @__PURE__ */N("img",{src:w??void 0,alt:Re,className:"h-full w-full",style:{objectFit:$,objectPosition:X||void 0}}),I&&w&&/* @__PURE__ */N(n,{children:Re}),Ce,ue&&/* @__PURE__ */N(l,{label:me,progress:Y,rounded:"rounded-md"})]}),Be=/* @__PURE__ */N("button",{type:"button",id:be,onClick:()=>Fe(),disabled:ye,"aria-label":"string"==typeof Ne?Ne:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":B||void 0,"aria-describedby":he?`${be}-error`:C?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:z},children:ue?/* @__PURE__ */N(u,{state:"busy",verb:me,pct:Y}):/* @__PURE__ */k(j,{children:[
3
+ /* @__PURE__ */N("span",{id:`${be}-change`,className:"truncate",children:je})]}),S&&/* @__PURE__ */N("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${x}`,children:/* @__PURE__ */N(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Ue?"":"bg-gray-100",Le?"border-blue-500":"border-line"].join(" "),style:Ue?void 0:{height:V},children:[Ue?
4
+ /* @__PURE__ */N(e,{value:X??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */N("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Re||void 0,className:"h-full w-full",style:{objectFit:B}}):/* @__PURE__ */N("img",{src:w??void 0,alt:Re,className:"h-full w-full",style:{objectFit:B,objectPosition:X||void 0}}),D&&w&&/* @__PURE__ */N(n,{children:Re}),Ce,ue&&/* @__PURE__ */N(l,{label:me,progress:J,rounded:"rounded-md"})]}),Ke=/* @__PURE__ */N("button",{type:"button",id:be,onClick:()=>Fe(),disabled:ye,"aria-label":"string"==typeof Ne?Ne:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":K||void 0,"aria-describedby":he?`${be}-error`:C?`${be}-hint`:void 0,...we.zoneProps,className:c(Le,ye,d(ye)),style:{minHeight:V},children:ue?/* @__PURE__ */N(u,{state:"busy",verb:me,pct:J}):/* @__PURE__ */k(j,{children:[
5
5
  /* @__PURE__ */N("span",{className:"text-ink-faintest",children:/* @__PURE__ */N(s,{})}),
6
6
  /* @__PURE__ */N("span",{className:"px-3 text-xs text-ink-faint",children:Ne}),
7
- /* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),A&&/* @__PURE__ */N("span",{className:"text-xs text-ink-faintest",children:A})]})});/* @__PURE__ */
8
- return k(i,{label:U,htmlFor:be,hint:C,error:he,required:B,className:K,children:[Q&&/* @__PURE__ */N("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */N(a,{value:oe,onChange:e=>Q(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */N(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */N(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof U&&U?U:ie.upload})}),w?Pe:Be,!F&&/* @__PURE__ */N("input",{...we.inputProps}),
7
+ /* @__PURE__ */N("span",{className:"text-sm font-medium text-blue-600",children:te}),q&&/* @__PURE__ */N("span",{className:"text-xs text-ink-faintest",children:q})]})});/* @__PURE__ */
8
+ return k(i,{label:U,htmlFor:be,hint:C,error:he,required:K,className:O,children:[E&&/* @__PURE__ */N("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */N(a,{value:oe,onChange:e=>E(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */N(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */N(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof U&&U?U:ie.upload})}),w?Pe:Ke,!F&&/* @__PURE__ */N("input",{...we.inputProps}),
9
9
  /* @__PURE__ */N(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
@@ -1,5 +1,5 @@
1
- import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{ChoiceContent as t,choiceItemClass as n,choiceTipClass as r,choiceTrackClass as o}from"./chunk-JDQGHQ2C.js";import{Tooltip as l}from"./chunk-QQ2LDC6C.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{useRef as i,useState as c,useEffect as d}from"react";import{jsx as s,jsxs as u,Fragment as m}from"react/jsx-runtime";var b=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function h(e,t,n="default"){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":`border-transparent ${"warning"===n?"text-amber-700":"text-gray-900"} hover:border-gray-300`}`}function f(e){if(!e||!e.startsWith("#")||e.length<2)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch{return null}}function p(e,t){const n=e.filter(e=>!e.disabled).map(e=>({id:e.id,section:f(e.href)})).filter(e=>null!=e.section);if(0===n.length)return null;const r=function(e){for(let t=e.parentElement;t;t=t.parentElement){const e=getComputedStyle(t).overflowY;if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t}return document.scrollingElement??document.documentElement}(n[0].section);if(r.scrollTop>0&&r.scrollTop+r.clientHeight>=r.scrollHeight-1)return n[n.length-1].id;const o=Math.max(0,t.getBoundingClientRect().bottom)+8;let l=n[0].id;for(const e of n)e.section.getBoundingClientRect().top<=o&&(l=e.id);return l}function g({items:e,value:n,onChange:o,block:c=!1,className:u="","aria-label":m,"aria-labelledby":g}){const v=i(null),w=function(e,t,n,r){const o=i(0),l=i({items:t,value:n,onChange:r});l.current={items:t,value:n,onChange:r};const c=i(()=>{});return c.current=()=>{const t=e.current;if(!t||Date.now()<o.current)return;const n=p(l.current.items,t);null!=n&&n!==l.current.value&&l.current.onChange(n)},a(()=>{c.current()},[t]),d(()=>{let e=0;const t=()=>{e||(e=requestAnimationFrame(()=>{e=0,c.current()}))};return document.addEventListener("scroll",t,{capture:!0,passive:!0}),window.addEventListener("resize",t),()=>{document.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("resize",t),e&&cancelAnimationFrame(e)}},[]),e=>{o.current=Date.now()+800,e!==l.current.value&&l.current.onChange(e),window.setTimeout(()=>c.current(),850)}}(v,e,n,o);/* @__PURE__ */
2
- return s("nav",{ref:v,"aria-label":m,"aria-labelledby":g,className:b(c,u),children:e.map(e=>{const o=e.id===n,a=/* @__PURE__ */s("a",{href:e.disabled?void 0:e.href,"aria-current":o?"location":void 0,"aria-disabled":e.disabled||void 0,onClick:e.disabled?void 0:t=>((e,t)=>{const n=f(t.href);n&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&(e.preventDefault(),w(t.id),n.scrollIntoView({block:"start",behavior:"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}),n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))})(t,e),className:`${h(o,c,"warning"===e.tone?"warning":"default")}${e.disabled?" cursor-not-allowed opacity-50":""}`,children:/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */s(l,{content:e.tooltip,className:c?r(c):void 0,children:a},e.id):a})})}var v=(e,t)=>`${e}-tab-${t}`,w=(e,t)=>`${e}-panel-${t}`;function y(e,t){const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=(parseFloat(n.columnGap)||0)*Math.max(0,t-1),l=e.parentElement;let a=1/0;if(l){const e=getComputedStyle(l);a=l.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:r+o,room:a}}function x(e){return e.items.some(e=>null!=e.href)?/* @__PURE__ */s(g,{...e}):/* @__PURE__ */s(k,{...e})}function k({items:f,value:p,onChange:g,variant:x="underline",block:k=!1,idPrefix:C,className:F="","aria-label":E,"aria-labelledby":L,labelsFit:R=!1}){const A=i([]),$=i(null),N="pill"===x,[D,S]=c(null),H=D??"none",W=i(()=>{});W.current=()=>{const t=$.current;if(!t||!R)return;const n=function(e){return[...e.querySelectorAll('[role="tab"]')].map(e=>{const t=getComputedStyle(e),n=(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)+(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.borderRightWidth)||0),r=e.querySelector("[data-tab-glyph]")?.getBoundingClientRect().width??0,o=e.querySelector("[data-tab-word]")?.scrollWidth??0;return{bare:n+r,worded:n+r+(r&&o?8:0)+o,active:"true"===e.getAttribute("aria-selected")}})}(t);S(function({tabs:t,block:n,chrome:r,room:o}){if(!n)return e({buttons:t,orientation:"horizontal",chrome:r,room:o});if(0===t.length)return"none";const l=e=>r+e*t.length<=o+.5;if(l(Math.max(...t.map(e=>e.worded))))return"all";const a=t.find(e=>e.active);return a&&l(Math.max(a.worded,...t.map(e=>e.bare)))?"chosen":"none"}({tabs:n,block:k,...y(t,n.length)}))},a(()=>{W.current()}),d(()=>{const e=$.current?.parentElement;if(!R||!e)return;let t=!0;const n=()=>{t&&W.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[R]);const j=(e,t)=>{for(let n=1;n<=f.length;n+=1){const r=((e+t*n)%f.length+f.length)%f.length;if(!f[r]?.disabled)return r}return null},M=e=>{const t=1===e?f.map((e,t)=>t):f.map((e,t)=>f.length-1-t);for(const e of t)if(!f[e]?.disabled)return e;return null};/* @__PURE__ */
3
- return s("div",{ref:$,role:"tablist","data-labels-shown":R?H:void 0,"aria-label":E,"aria-labelledby":L,onKeyDown:e=>{const t=f.findIndex(e=>e.id===p);let n=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)n=j(t,1);else if("ArrowLeft"===e.key||"ArrowUp"===e.key)n=j(t,-1);else if("Home"===e.key)n=M(1);else{if("End"!==e.key)return;n=M(-1)}e.preventDefault(),null!==n&&n!==t&&(g(f[n].id),A.current[n]?.focus())},className:N?o(k,F):b(k,F),children:f.map((e,o)=>{const a=e.id===p,i=R&&null!=e.icon,c="all"===H||"chosen"===H&&a,d=/* @__PURE__ */s("button",{ref:e=>{A.current[o]=e},type:"button",role:"tab",id:C?v(C,e.id):void 0,"aria-controls":C?w(C,e.id):void 0,"aria-selected":a,tabIndex:a?0:-1,disabled:e.disabled,onClick:()=>g(e.id),className:N?n({selected:a,disabled:e.disabled,block:k}):h(a,k,"warning"===e.tone?"warning":"default"),children:i?/* @__PURE__ */u(m,{children:[
1
+ import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{ChoiceContent as t,choiceItemClass as n,choiceTipClass as r,choiceTrackClass as o}from"./chunk-JDQGHQ2C.js";import{Tooltip as l}from"./chunk-NJN5IKWO.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{useRef as i,useState as c,useEffect as d}from"react";import{jsx as s,jsxs as u,Fragment as m}from"react/jsx-runtime";var b=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function h(e,t,n="default"){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":`border-transparent ${"warning"===n?"text-amber-700":"text-gray-900"} hover:border-gray-300`}`}function f(e){if(!e||!e.startsWith("#")||e.length<2)return null;try{return document.getElementById(decodeURIComponent(e.slice(1)))}catch{return null}}function p(e,t){const n=e.filter(e=>!e.disabled).map(e=>({id:e.id,section:f(e.href)})).filter(e=>null!=e.section);if(0===n.length)return null;const r=function(e){for(let t=e.parentElement;t;t=t.parentElement){const e=getComputedStyle(t).overflowY;if(("auto"===e||"scroll"===e)&&t.scrollHeight>t.clientHeight)return t}return document.scrollingElement??document.documentElement}(n[0].section);if(r.scrollTop>0&&r.scrollTop+r.clientHeight>=r.scrollHeight-1)return n[n.length-1].id;const o=Math.max(0,t.getBoundingClientRect().bottom)+8;let l=n[0].id;for(const e of n)e.section.getBoundingClientRect().top<=o&&(l=e.id);return l}function g({items:e,value:n,onChange:o,block:c=!1,className:u="","aria-label":m,"aria-labelledby":g}){const v=i(null),w=function(e,t,n,r){const o=i(0),l=i({items:t,value:n,onChange:r});l.current={items:t,value:n,onChange:r};const c=i(()=>{});return c.current=()=>{const t=e.current;if(!t||Date.now()<o.current)return;const n=p(l.current.items,t);null!=n&&n!==l.current.value&&l.current.onChange(n)},a(()=>{c.current()},[t]),d(()=>{let e=0;const t=()=>{e||(e=requestAnimationFrame(()=>{e=0,c.current()}))};return document.addEventListener("scroll",t,{capture:!0,passive:!0}),window.addEventListener("resize",t),()=>{document.removeEventListener("scroll",t,{capture:!0}),window.removeEventListener("resize",t),e&&cancelAnimationFrame(e)}},[]),e=>{o.current=Date.now()+800,e!==l.current.value&&l.current.onChange(e),window.setTimeout(()=>c.current(),850)}}(v,e,n,o);/* @__PURE__ */
2
+ return s("nav",{ref:v,"aria-label":m,"aria-labelledby":g,className:b(c,u),children:e.map(e=>{const o=e.id===n,a=/* @__PURE__ */s("a",{href:e.disabled?void 0:e.href,"aria-current":o?"location":void 0,"aria-disabled":e.disabled||void 0,onClick:e.disabled?void 0:t=>((e,t)=>{const n=f(t.href);n&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))(e)&&(e.preventDefault(),w(t.id),n.scrollIntoView({block:"start",behavior:"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}),n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))})(t,e),className:`${h(o,c,"warning"===e.tone?"warning":"default")}${e.disabled?" cursor-not-allowed opacity-50":""}`,children:/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */s(l,{content:e.tooltip,className:c?r(c):void 0,children:a},e.id):a})})}var v=(e,t)=>`${e}-tab-${t}`,w=(e,t)=>`${e}-panel-${t}`;function y(e,t){const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=(parseFloat(n.columnGap)||0)*Math.max(0,t-1),l=e.parentElement;let a=1/0;if(l){const e=getComputedStyle(l);a=l.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:r+o,room:a}}function x(e){return e.items.some(e=>null!=e.href)?/* @__PURE__ */s(g,{...e}):/* @__PURE__ */s(k,{...e})}function k({items:f,value:p,onChange:g,variant:x="underline",block:k=!1,idPrefix:C,className:F="","aria-label":E,"aria-labelledby":N,labelsFit:R=!1}){const A=i([]),L=i(null),$="pill"===x,[D,S]=c(null),W=D??"none",H=i(()=>{});H.current=()=>{const t=L.current;if(!t||!R)return;const n=function(e){return[...e.querySelectorAll('[role="tab"]')].map(e=>{const t=getComputedStyle(e),n=(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)+(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.borderRightWidth)||0),r=e.querySelector("[data-tab-glyph]")?.getBoundingClientRect().width??0,o=e.querySelector("[data-tab-word]")?.scrollWidth??0;return{bare:n+r,worded:n+r+(r&&o?8:0)+o,active:"true"===e.getAttribute("aria-selected")}})}(t);S(function({tabs:t,block:n,chrome:r,room:o}){if(!n)return e({buttons:t,orientation:"horizontal",chrome:r,room:o});if(0===t.length)return"none";const l=e=>r+e*t.length<=o+.5;if(l(Math.max(...t.map(e=>e.worded))))return"all";const a=t.find(e=>e.active);return a&&l(Math.max(a.worded,...t.map(e=>e.bare)))?"chosen":"none"}({tabs:n,block:k,...y(t,n.length)}))},a(()=>{H.current()}),d(()=>{const e=L.current?.parentElement;if(!R||!e)return;let t=!0;const n=()=>{t&&H.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[R]);const j=(e,t)=>{for(let n=1;n<=f.length;n+=1){const r=((e+t*n)%f.length+f.length)%f.length;if(!f[r]?.disabled)return r}return null},I=e=>{const t=1===e?f.map((e,t)=>t):f.map((e,t)=>f.length-1-t);for(const e of t)if(!f[e]?.disabled)return e;return null};/* @__PURE__ */
3
+ return s("div",{ref:L,role:"tablist","data-labels-shown":R?W:void 0,"aria-label":E,"aria-labelledby":N,onKeyDown:e=>{const t=f.findIndex(e=>e.id===p);let n=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)n=j(t,1);else if("ArrowLeft"===e.key||"ArrowUp"===e.key)n=j(t,-1);else if("Home"===e.key)n=I(1);else{if("End"!==e.key)return;n=I(-1)}e.preventDefault(),null!==n&&n!==t&&(g(f[n].id),A.current[n]?.focus())},className:$?o(k,F):b(k,F),children:f.map((e,o)=>{const a=e.id===p,i=R&&null!=e.icon,c="all"===W||"chosen"===W&&a,d=/* @__PURE__ */s("button",{ref:e=>{A.current[o]=e},type:"button",role:"tab",id:C?v(C,e.id):void 0,"aria-controls":C?w(C,e.id):void 0,"aria-selected":a,tabIndex:a?0:-1,disabled:e.disabled,onClick:()=>g(e.id),className:$?n({selected:a,disabled:e.disabled,block:k}):h(a,k,"warning"===e.tone?"warning":"default"),children:i?/* @__PURE__ */u(m,{children:[
4
4
  /* @__PURE__ */s("span",{"aria-hidden":"true","data-tab-glyph":"",className:"inline-flex shrink-0",children:e.icon}),
5
- /* @__PURE__ */s("span",{"data-tab-word":c?"shown":"hidden",className:c?"whitespace-nowrap":"sr-only",children:e.label})]}):/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id),b=i?e.tooltip??e.label:e.tooltip;return null!=b&&!1!==b?/* @__PURE__ */s(l,{content:b,className:N||k?r(k):void 0,children:d},e.id):d})})}export{x as Tabs,v as tabButtonId,w as tabPanelId};
5
+ /* @__PURE__ */s("span",{"data-tab-word":c?"shown":"hidden",className:c?"whitespace-nowrap":"sr-only",children:e.label})]}):/* @__PURE__ */s(t,{icon:e.icon,label:e.label})},e.id),b=i?e.tooltip??e.label:e.tooltip;return null!=b&&!1!==b?/* @__PURE__ */s(l,{content:b,className:$||k?r(k):void 0,children:d},e.id):d})})}export{x as Tabs,v as tabButtonId,w as tabPanelId};
@@ -1,5 +1,5 @@
1
- import{CartesianPlot as t}from"./chunk-3VR5BOD4.js";import{ChartTooltip as a}from"./chunk-WDQI3FV6.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-5YP7MFPK.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),j=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
2
- return i(t,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:t=>{const e=M[t],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
3
- return i(a,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
1
+ import{ChartTooltip as t}from"./chunk-36VIGB6J.js";import{CartesianPlot as a}from"./chunk-QDL2FNP7.js";import{CHART_INK as e,STATUS_VARS as l}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as r}from"./chunk-5YP7MFPK.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as s}from"react/jsx-runtime";function c({steps:c,height:u=240,width:m,formatValue:h,yAxisLabel:f,className:p,emptyLabel:d,radius:b=3,connectors:g=!0}){const v=o().charts,x=r(),y=h??(t=>n(t,x));let k=0;const M=c.map(t=>{if(t.total){const a={from:0,to:k,value:k,total:!0};return{...t,...a}}const a=k;return k+=t.value,{...t,from:a,to:k,value:t.value,total:!1}}),j=M.flatMap(t=>[t.from,t.to]);/* @__PURE__ */
2
+ return i(a,{labels:c.map(t=>t.label),values:j,height:u,width:m,formatValue:y,yAxisLabel:f,className:p,emptyLabel:d,bandPadding:.36,ariaLabel:v.waterfall(c.length,y(M[0]?.from??0),y(k)),tooltip:a=>{const e=M[a],o=e?.total?l.neutral:e.value>=0?l.good:l.critical;/* @__PURE__ */
3
+ return i(t,{title:e?.label,rows:[{key:"step",color:o,label:e?.total?v.balance:e.value>=0?v.increase:v.decrease,value:e?.total?y(e.to):`${e.value>=0?"+":"−"}${y(Math.abs(e.value))}`},...e?.total?[]:[{key:"running",label:v.runningTotal,color:l.neutral,value:y(e.to)}]]})},children:({x:t,y:a,active:o})=>/* @__PURE__ */s("g",{children:[g&&M.slice(0,-1).map((l,o)=>
4
4
  /* @__PURE__ */i("line",{x1:t.end(o),y1:a(l.to),x2:t(o+1),y2:a(l.to),stroke:e.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${o}`)),M.map((e,r)=>{const n=e.total?l.neutral:e.value>=0?l.good:l.critical,s=Math.min(a(e.from),a(e.to)),c=Math.max(1,Math.abs(a(e.to)-a(e.from)));/* @__PURE__ */
5
5
  return i("rect",{x:t(r),y:s,width:Math.max(1,t.bandwidth),height:c,rx:b,fill:n,fillOpacity:null===o||o===r?1:.45},r)})]})})}export{c as WaterfallChart};
@@ -1,4 +1,4 @@
1
- import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as s,escapeSurfaceAbove as d}from"./chunk-TWVUQUUD.js";import{solidSurfaceStyle as h}from"./chunk-5FYDNH4Y.js";import{createContext as m,useContext as u,useState as p,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var j=m(!1),H=()=>u(j),W={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function N({content:m,side:u="top",delay:H=200,children:N,className:B="relative inline-flex",describe:T=!0,open:M}){const[D,U]=p(!1),z=(M??D)&&!(null==m||!1===m||""===m),[C,E]=p(null),J=f(void 0),L=f(null),P=f(null),$=x(),F=f(!1),G=()=>{window.clearTimeout(J.current),F.current||(J.current=window.setTimeout(()=>U(!0),H))},R=()=>{window.clearTimeout(J.current),U(!1)},Y=()=>{F.current=!0,R()},I=()=>{F.current=!1,R()};w(()=>()=>window.clearTimeout(J.current),[]),c(()=>{if(!z)return void E(null);const t=()=>{const t=L.current,e=P.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void R();const m=a(h,d,u,r,12),p=l(h,m,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:m.left-h.left,top:m.top-h.top,maxWidth:c,maxHeight:s,side:m.side,arrow:p&&{left:p.x-h.left,top:p.y-h.top}};E(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>L.current,t)},[z,u,m]),w(()=>{if(!z)return;const e=s(t=>"Escape"===t.key&&(R(),!d(L.current))),r=t(R);return()=>{e(),r()}},[z]);const Q=z&&T?$:void 0,S=g(N)?b(N,{"aria-describedby":[N.props["aria-describedby"],Q].filter(Boolean).join(" ")||void 0}):N,V=z?h():void 0;/* @__PURE__ */
1
+ import{onOverlayOpen as t}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{followAnchor as r,popupBounds as o,VIEWPORT_MARGIN as n,showingBox as i,placeBeside as a,placeArrow as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as s}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as d,escapeSurfaceAbove as h}from"./chunk-TWVUQUUD.js";import{createContext as m,useContext as u,useState as p,useRef as f,useId as x,useEffect as w,isValidElement as g,cloneElement as b}from"react";import{createPortal as v}from"react-dom";import{jsxs as y,jsx as k}from"react/jsx-runtime";var j=m(!1),H=()=>u(j),W={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function N({content:m,side:u="top",delay:H=200,children:N,className:B="relative inline-flex",describe:T=!0,open:M}){const[D,U]=p(!1),z=(M??D)&&!(null==m||!1===m||""===m),[C,E]=p(null),J=f(void 0),L=f(null),P=f(null),$=x(),F=f(!1),G=()=>{window.clearTimeout(J.current),F.current||(J.current=window.setTimeout(()=>U(!0),H))},R=()=>{window.clearTimeout(J.current),U(!1)},Y=()=>{F.current=!0,R()},I=()=>{F.current=!1,R()};w(()=>()=>window.clearTimeout(J.current),[]),c(()=>{if(!z)return void E(null);const t=()=>{const t=L.current,e=P.current;if(!t||!e)return;const r=o(t),c=Math.max(0,r.right-r.left-2*n),s=Math.max(0,r.bottom-r.top-2*n);e.style.maxWidth=`${c}px`,e.style.maxHeight=`${s}px`;const d=e.getBoundingClientRect();if(d.width<=0||d.height<=0)return;const h=t.getBoundingClientRect();if(!i(t))return void R();const m=a(h,d,u,r,12),p=l(h,m,d,16,6),f={anchor:{left:h.left,top:h.top,width:h.width,height:h.height},left:m.left-h.left,top:m.top-h.top,maxWidth:c,maxHeight:s,side:m.side,arrow:p&&{left:p.x-h.left,top:p.y-h.top}};E(t=>{return t&&(r=f,(e=t).anchor.left===r.anchor.left&&e.anchor.top===r.anchor.top&&e.anchor.width===r.anchor.width&&e.anchor.height===r.anchor.height&&e.left===r.left&&e.top===r.top&&e.maxWidth===r.maxWidth&&e.maxHeight===r.maxHeight&&e.side===r.side&&e.arrow?.left===r.arrow?.left&&e.arrow?.top===r.arrow?.top)?t:f;var e,r})};return t(),r(()=>L.current,t)},[z,u,m]),w(()=>{if(!z)return;const e=d(t=>"Escape"===t.key&&(R(),!h(L.current))),r=t(R);return()=>{e(),r()}},[z]);const Q=z&&T?$:void 0,S=g(N)?b(N,{"aria-describedby":[N.props["aria-describedby"],Q].filter(Boolean).join(" ")||void 0}):N,V=z?s():void 0;/* @__PURE__ */
2
2
  return y("span",{ref:L,className:B,"aria-describedby":g(N)?void 0:Q,onMouseEnter:G,onMouseLeave:I,onFocus:t=>{let e=!0;try{e=t.target.matches(":focus-visible")}catch{}e&&G()},onBlur:I,onPointerDown:Y,onClick:Y,children:[
3
3
  /* @__PURE__ */k(j.Provider,{value:!0,children:S}),z&&v(
4
4
  /* @__PURE__ */y("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:e.hint,...C?.anchor},children:[
@@ -1,5 +1,5 @@
1
- import{Icon as e}from"./chunk-7V32O5NF.js";import{Tooltip as t}from"./chunk-QQ2LDC6C.js";import{useShellStrings as n}from"./chunk-5YP7MFPK.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,y=i(),N=["es-default-reset"];if(c&&N.push("is-changed"),k&&N.push(k),!c&&h)return N.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:N.join(" "),"aria-hidden":"true"});const x="desktop"===u,g=p??(x?j.resetName(o):j.inheritName(o)),C=b?j.backTo(b):x?j.backToDefault:j.backToAuto,T=m??(b?j.tip(g,C):g);
1
+ import{Icon as e}from"./chunk-7V32O5NF.js";import{Tooltip as t}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-5YP7MFPK.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,N=i(),y=["es-default-reset"];if(c&&y.push("is-changed"),k&&y.push(k),!c&&h)return y.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:y.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:y.join(" "),"aria-hidden":"true"});const x="desktop"===u,g=p??(x?j.resetName(o):j.inheritName(o)),T=b?j.backTo(b):x?j.backToDefault:j.backToAuto,q=m??(b?j.tip(g,T):g);
2
2
  /* @__PURE__ */
3
- return r(t,{content:T,describe:!1,children:[
4
- /* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":g,"aria-describedby":y,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
5
- /* @__PURE__ */a("span",{id:y,hidden:!0,children:C})]})}export{o as SettingReset};
3
+ return r(t,{content:q,describe:!1,children:[
4
+ /* @__PURE__ */a("button",{type:"button",className:y.join(" "),"aria-label":g,"aria-describedby":N,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
5
+ /* @__PURE__ */a("span",{id:N,hidden:!0,children:T})]})}export{o as SettingReset};
@@ -1,2 +1,2 @@
1
- import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-QOJ2UNS5.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-3ZRYKZGI.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:D=!0}){const L=s(null),S=a(),[j,A]=d(null),U=s(w);U.current=w,c(()=>{const e=L.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});A(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const C=s(null),Q=s(!1);m(()=>(C.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!L.current?.contains(e)||C.current?.focus?.({preventScroll:!0})}),[]),m(()=>{j&&!Q.current&&D&&(Q.current=!0,h(L.current)[0]?.focus({preventScroll:!0}))},[j,D]),m(()=>{if(D)return;const e=e=>{if(L.current?.contains(document.activeElement))return;const t=h(L.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[D]),m(()=>u(e=>"Escape"===e.key&&(U.current(),!0),()=>L.current),[]),m(()=>{const e=()=>U.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const T=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void U.current();const t=h(L.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),W=j?{left:j.left,top:j.top,maxHeight:j.maxHeight,...j.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
- return p(n,{portal:!0,minWidth:x,style:W,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:L,id:S,role:"menu","aria-label":b,"aria-describedby":y?t(y,S):void 0,"data-context-menu":"",onKeyDown:T,children:[y&&e(y,{menuId:S,choose:e=>{e.disabled||(U.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>U.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
1
+ import{renderMenuEntries as e,menuStatusIds as t}from"./chunk-34AHNPW7.js";import{PopupMenu as n,MenuSemanticsContext as r}from"./chunk-4TB4CSLB.js";import{leavesContextMenuAlone as o}from"./chunk-5QFPTDQF.js";import{placeAtPoint as i,popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useRef as s,useId as a,useState as d,useEffect as m,useCallback as f}from"react";import{jsx as p,jsxs as v}from"react/jsx-runtime";function h(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function w({at:o,onClose:w,items:y,linkAs:g,children:k,owner:E,"aria-label":b,minWidth:x=180,className:H="",autoFocus:L=!0}){const D=s(null),A=a(),[S,j]=d(null),C=s(w);C.current=w,c(()=>{const e=D.current?.closest("[data-popup-menu-tree]");if(!e)return;const t={width:e.offsetWidth,height:e.offsetHeight},n=i({point:o,menu:t,bounds:l(E??null)});j(e=>e&&e.left===n.left&&e.top===n.top&&e.maxHeight===n.maxHeight?e:{left:n.left,top:n.top,maxHeight:n.maxHeight,scroll:t.height>n.maxHeight})},[o.x,o.y,E]);const U=s(null),T=s(!1);m(()=>(U.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!D.current?.contains(e)||U.current?.focus?.({preventScroll:!0})}),[]),m(()=>{S&&!T.current&&L&&(T.current=!0,h(D.current)[0]?.focus({preventScroll:!0}))},[S,L]),m(()=>{if(L)return;const e=e=>{if(D.current?.contains(document.activeElement))return;const t=h(D.current),n="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;n&&(e.preventDefault(),n.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[L]),m(()=>u(e=>"Escape"===e.key&&(C.current(),!0),()=>D.current),[]),m(()=>{const e=()=>C.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const W=f(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void C.current();const t=h(D.current);if(0===t.length)return;const n=t.indexOf(document.activeElement),r="ArrowDown"===e.key?(n+1)%t.length:"ArrowUp"===e.key?n<=0?t.length-1:n-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;r<0||(e.preventDefault(),t[r].focus())},[]),B=S?{left:S.left,top:S.top,maxHeight:S.maxHeight,...S.scroll?{overflowY:"auto"}:{}}:{left:o.x,top:o.y,visibility:"hidden"};/* @__PURE__ */
2
+ return p(n,{portal:!0,minWidth:x,style:B,onClose:w,className:H,children:/* @__PURE__ */p(r.Provider,{value:!0,children:/* @__PURE__ */v("div",{ref:D,id:A,role:"menu","aria-label":b,"aria-describedby":y?t(y,A):void 0,"data-context-menu":"",onKeyDown:W,children:[y&&e(y,{menuId:A,choose:e=>{e.disabled||(C.current(),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>C.current(),linkAs:g}),k]})})})}function y(){const[e,t]=d(null),n=f(()=>t(null),[]),r=f((e,n)=>{const r="nativeEvent"in e?e.nativeEvent:e;if(o(r))return!1;e.preventDefault();const i=e.target instanceof Element?e.target:null;let{clientX:l,clientY:c}=e;if(0===l&&0===c&&i){const e=i.getBoundingClientRect();l=e.left,c=e.bottom}return t({x:l,y:c,data:n,owner:i}),!0},[]),i=f(e=>{r(e,void 0)},[r]);return{open:r,onContextMenu:i,close:n,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:n}}}export{w as ContextMenu,y as useContextMenu};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-WEEQDPU3.js";import{Select_default as a}from"./chunk-ESWR7YNY.js";import{Pagination as r}from"./chunk-225LCPO7.js";import{Input_default as t}from"./chunk-LGTYPLJM.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-JPNAEN53.js";import{Button_default as l}from"./chunk-7DI3VQCF.js";import{Icon as c}from"./chunk-7V32O5NF.js";import{TH_ONE_LINE as m}from"./chunk-CJH2BGXY.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-WEEQDPU3.js";import{Select_default as a}from"./chunk-SPMD7UZO.js";import{Pagination as r}from"./chunk-225LCPO7.js";import{Input_default as t}from"./chunk-GS74BABV.js";import{StatusBadgeProvider as i,StatusBadge as s}from"./chunk-FZM3ZPW3.js";import{Button_default as l}from"./chunk-EOVXFXVV.js";import{Icon as c}from"./chunk-7V32O5NF.js";import{TH_ONE_LINE as m}from"./chunk-WGLHB6WE.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,6 +1,6 @@
1
- import{CartesianPlot as e}from"./chunk-3VR5BOD4.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-5YP7MFPK.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),L=Math.max(...v),W=.08*(L-j)||1;/* @__PURE__ */
2
- return c(e,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-W,max:L+W,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:e=>{const t=h[e],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
3
- return c(l,{title:t.label,rows:[{key:"open",label:g.open,color:i,value:w(t.open)},{key:"high",label:g.high,color:i,value:w(t.high)},{key:"low",label:g.low,color:i,value:w(t.low)},{key:"close",label:g.close,color:i,value:w(t.close)}],emphasisKey:"close",footnote:a?g.closedAbove:g.closedBelow})},children:({x:e,y:l,active:t})=>/* @__PURE__ */c("g",{children:h.map((a,i)=>{const r=a.close>=a.open,h=r?o.good:o.critical,p=e.center(i),d=Math.max(3,e.bandwidth),u=null!==t&&t!==i,b=l(Math.max(a.open,a.close)),y=Math.max(1,Math.abs(l(a.close)-l(a.open)));/* @__PURE__ */
1
+ import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{CartesianPlot as l}from"./chunk-QDL2FNP7.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-5YP7MFPK.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),L=Math.max(...v),N=.08*(L-j)||1;/* @__PURE__ */
2
+ return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-N,max:L+N,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
3
+ return c(e,{title:t.label,rows:[{key:"open",label:g.open,color:i,value:w(t.open)},{key:"high",label:g.high,color:i,value:w(t.high)},{key:"low",label:g.low,color:i,value:w(t.low)},{key:"close",label:g.close,color:i,value:w(t.close)}],emphasisKey:"close",footnote:a?g.closedAbove:g.closedBelow})},children:({x:e,y:l,active:t})=>/* @__PURE__ */c("g",{children:h.map((a,i)=>{const r=a.close>=a.open,h=r?o.good:o.critical,p=e.center(i),d=Math.max(3,e.bandwidth),u=null!==t&&t!==i,b=l(Math.max(a.open,a.close)),y=Math.max(1,Math.abs(l(a.close)-l(a.open)));/* @__PURE__ */
4
4
  return n("g",{opacity:u?.45:1,children:[
5
5
  /* @__PURE__ */c("line",{x1:p,y1:l(a.high),x2:p,y2:l(a.low),stroke:h,strokeWidth:1.5}),"candle"===m?/* @__PURE__ */c("rect",{x:p-d/2,y:b,width:d,height:y,rx:1,fill:r?h:"transparent",fillOpacity:r?.85:1,stroke:h,strokeWidth:1.5}):/* @__PURE__ */n(s,{children:[
6
6
  /* @__PURE__ */c("line",{x1:p-d/2,y1:l(a.open),x2:p,y2:l(a.open),stroke:h,strokeWidth:2}),
@@ -1,4 +1,4 @@
1
- import{GROUP_COLORS as e}from"./chunk-JPNAEN53.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-QQ2LDC6C.js";import{useShellStrings as l}from"./chunk-5YP7MFPK.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
1
+ import{GROUP_COLORS as e}from"./chunk-FZM3ZPW3.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as l}from"./chunk-5YP7MFPK.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
2
2
  return t(n,{content:e,describe:!1,children:/* @__PURE__ */t("button",{type:"button",onClick:l,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */t("span",{"aria-hidden":"true",children:r})})})}function c({state:n,label:c,verb:u,subject:m,pct:p,onCancel:d,onRetry:h,onDismiss:f,className:b=""}){const g=l().transfer;if("idle"===n)return null==c?null:/* @__PURE__ */t("span",{className:`${s} ${e.neutral} pr-2 ${b}`.trim(),children:c});if("error"===n)/* @__PURE__ */
3
3
  return i("span",{role:"status",className:`${s} ${e.danger} ${b}`.trim(),children:[
4
4
  /* @__PURE__ */t("span",{children:g.error}),h&&/* @__PURE__ */t(o,{label:g.retry,glyph:"↻",onClick:h}),f&&/* @__PURE__ */t(o,{label:g.dismiss,glyph:"×",onClick:f})]});const y=u??g.uploading,N=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),$="string"==typeof y?g.cancelVerb(y.toLowerCase()):g.cancel,k=e=>[e,m,null==N?"":`${N}%`].filter(Boolean).join(" ");/* @__PURE__ */
@@ -0,0 +1,11 @@
1
+ import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-5YP7MFPK.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{useRef as h,useId as c,useState as s,useEffect as m}from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function x({rows:x,columns:d,cells:p,height:M,width:g,color:y,max:v,formatValue:$,label:b,className:k,emptyLabel:w,cellGap:A=2,cellRadius:N=2}){const j=i().charts,U=a(),z=$??(e=>o(e,U)),C=b??j.intensity,F=w??j.noActivity,D=h(null),R=t(D),S=g??R,V=c(),[B,G]=s(null);if(m(()=>{if(null!==B)return n(e=>"Escape"===e.key&&(G(null),!0))},[B]),0===x.length||0===d.length)/* @__PURE__ */
2
+ return f("div",{className:k,ref:D,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:F})});const L=y??l(0),P=v??Math.max(1,...p.flat().filter(Number.isFinite)),E=96,I=26*x.length,K=M??I+26+26,Q=Math.max(2,(Math.max(97,S)-E)/d.length),T=e=>{const t=P>0?Math.max(0,Math.min(1,e/P)):0;return`color-mix(in oklab, ${L} ${(8+92*t).toFixed(1)}%, ${r.surface})`};/* @__PURE__ */
3
+ return u("div",{className:`relative ${k??""}`,ref:D,children:[
4
+ /* @__PURE__ */u("svg",{width:"100%",height:K,viewBox:`0 0 ${S} ${K}`,role:"img","aria-label":j.heatmap(C,x.length,d.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>G(null),onBlur:()=>G(null),onKeyDown:e=>{const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,l="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;0===t&&0===l||(e.preventDefault(),G(e=>({r:Math.min(x.length-1,Math.max(0,(e?.r??0)+t)),c:Math.min(d.length-1,Math.max(0,(e?.c??0)+l))})))},children:[
5
+ /* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:V,x1:"0",x2:"1",children:[
6
+ /* @__PURE__ */f("stop",{offset:"0",stopColor:T(0)}),
7
+ /* @__PURE__ */f("stop",{offset:"1",stopColor:T(P)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:r.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=B&&(B.r!==t||B.c!==r);/* @__PURE__ */
8
+ return f("rect",{x:E+r*Q+A/2,y:26*t+A/2,width:Math.max(1,Q-A),height:26-A,rx:N,fill:T(n),opacity:i?.55:1,onMouseEnter:()=>G({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${z(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((S-E)/56))))===0?/* @__PURE__ */f("text",{x:E+t*Q+Q/2,y:I+15,textAnchor:"middle",fontSize:11,fill:r.label,children:e},`c${t}`):null),
9
+ /* @__PURE__ */f("rect",{x:E,y:I+26,width:Math.min(180,Math.max(40,S-E)),height:8,rx:4,fill:`url(#${V})`}),
10
+ /* @__PURE__ */f("text",{x:E,y:I+48,fontSize:11,fill:r.label,children:"0"}),
11
+ /* @__PURE__ */f("text",{x:E+Math.min(180,Math.max(40,S-E)),y:I+48,textAnchor:"end",fontSize:11,fill:r.label,style:{fontVariantNumeric:"tabular-nums"},children:z(P)})]}),B&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(e,{title:`${x[B.r]} · ${d[B.c]}`,rows:[{key:"v",label:C,color:L,value:null==p[B.r]?.[B.c]?void 0:z(p[B.r][B.c])}]})})]})}export{x as HeatmapChart};
@@ -1,5 +1,5 @@
1
- import{DragBand as e,tooltipBesideBand as t}from"./chunk-Y4RHGLXB.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{niceAxis as i,niceMax as n,linearScale as o,axisGutter as l,bandScale as a}from"./chunk-2JWPNR2U.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-5YP7MFPK.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:k=220,width:M,bandPadding:w=.24,min:N,max:A,yTickCount:P=4,formatValue:$,yAxisLabel:j,xTickAnchor:R="center",children:E,overlay:U,tooltip:z,onSelect:D,zoom:L,ariaLabel:C,className:F,emptyLabel:S}){const I=c().charts,T=m(),V=$??(e=>d(e,T)),W=S??I.noData,B=u(null),H=r(B),K=M??H,[Q,X]=f(null),Y=g();if(p(()=>{if(null!==Q)return s(e=>"Escape"===e.key&&(X(null),!0))},[Q]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
2
- return x("div",{className:F,ref:B,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:W})});const Z=b.filter(Number.isFinite),G=Z.every(Number.isInteger),J=void 0===N&&void 0===A?i(Math.min(0,...Z),Math.max(0,...Z),{intervals:P+1,integer:G}):null,O=void 0!==N&&void 0===A?i(N,Math.max(N,...Z),{intervals:P+1,integer:G,zero:!1}):null,q=J?J.lo:N??Math.min(0,...Z),_=J?J.hi:O?O.hi:A??n(Math.max(...Z,0)),ee=J?J.ticks:O?[q,...O.ticks.filter(e=>e>q)]:o([q,_],{from:0,to:1}).ticks(P+1),te={top:12,right:16,bottom:26,left:l(ee.map(V),48)+(j?10:0)},re=te.left,ie=Math.max(re+1,K-te.right),ne=te.top,oe=k-te.bottom,le=o([q,_],{from:oe,to:ne}),ae=a(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(K/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
1
+ import{DragBand as e,tooltipBesideBand as t}from"./chunk-Y4RHGLXB.js";import{niceAxis as r,niceMax as i,linearScale as n,axisGutter as o,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as a}from"./chunk-MAFUXCPZ.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-5YP7MFPK.js";import{formatPlain as d}from"./chunk-C3QOHMR6.js";import{useRef as u,useState as f,useId as g,useEffect as p}from"react";import{jsx as x,jsxs as y}from"react/jsx-runtime";function v({labels:v,values:b,height:k=220,width:M,bandPadding:w=.24,min:N,max:A,yTickCount:P=4,formatValue:$,yAxisLabel:j,xTickAnchor:R="center",children:E,overlay:U,tooltip:z,onSelect:D,zoom:L,ariaLabel:C,className:F,emptyLabel:S}){const I=c().charts,T=m(),V=$??(e=>d(e,T)),W=S??I.noData,B=u(null),H=a(B),K=M??H,[Q,X]=f(null),Y=g();if(p(()=>{if(null!==Q)return s(e=>"Escape"===e.key&&(X(null),!0))},[Q]),0===v.length||!b.some(Number.isFinite))/* @__PURE__ */
2
+ return x("div",{className:F,ref:B,children:/* @__PURE__ */x("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:W})});const Z=b.filter(Number.isFinite),G=Z.every(Number.isInteger),J=void 0===N&&void 0===A?r(Math.min(0,...Z),Math.max(0,...Z),{intervals:P+1,integer:G}):null,O=void 0!==N&&void 0===A?r(N,Math.max(N,...Z),{intervals:P+1,integer:G,zero:!1}):null,q=J?J.lo:N??Math.min(0,...Z),_=J?J.hi:O?O.hi:A??i(Math.max(...Z,0)),ee=J?J.ticks:O?[q,...O.ticks.filter(e=>e>q)]:n([q,_],{from:0,to:1}).ticks(P+1),te={top:12,right:16,bottom:26,left:o(ee.map(V),48)+(j?10:0)},re=te.left,ie=Math.max(re+1,K-te.right),ne=te.top,oe=k-te.bottom,le=n([q,_],{from:oe,to:ne}),ae=l(v.length,{from:re,to:ie},w),he=(ie-re)/Math.max(1,v.length),se=he>=48,ce=se?1:Math.max(1,Math.ceil(v.length/Math.max(1,Math.floor(K/84)))),me=Math.max(2,Math.floor((he-6)/6.6)),de=e=>se&&e.length>me?`${e.slice(0,me-1).trimEnd()}…`:e;/* @__PURE__ */
3
3
  return y("div",{className:`relative ${F??""}`,ref:B,children:[
4
4
  /* @__PURE__ */y("svg",{width:"100%",height:k,viewBox:`0 0 ${K} ${k}`,role:"img","aria-label":C,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>X(null),onBlur:()=>X(null),onKeyDown:e=>{if(D&&null!==Q&&("Enter"===e.key||" "===e.key))return e.preventDefault(),void D(Q);if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1;X(e=>Math.min(v.length-1,Math.max(0,(e??0)+t)))},style:L?{userSelect:"none",touchAction:"pan-y"}:void 0,children:[
5
5
  /* @__PURE__ */x("defs",{children:/* @__PURE__ */x("clipPath",{id:Y,children:/* @__PURE__ */x("rect",{x:re,y:ne,width:ie-re,height:oe-ne})})}),ee.map(e=>/* @__PURE__ */x("line",{x1:re,y1:le(e),x2:ie,y2:le(e),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),