efficient-shell 15.1.0 → 15.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/dist/Browser-QK2CCZTR.js +44 -0
  2. package/dist/Calculator-DB4U2KXJ.js +29 -0
  3. package/dist/CurrencyConverter-D5MWU2M2.js +21 -0
  4. package/dist/{Files-QNAN5FCH.js → Files-6WMIQAVD.js} +93 -93
  5. package/dist/Notepad-FKSRP7R6.js +24 -0
  6. package/dist/PdfViewer-AIAVQYZ6.js +1 -0
  7. package/dist/{PomodoroTimer-LJ6VBFGX.js → PomodoroTimer-U62N64F6.js} +22 -22
  8. package/dist/{Preview-I35MWZBC.js → Preview-2GS2CWRA.js} +15 -15
  9. package/dist/Sidebar-KAALEIIX.js +44 -0
  10. package/dist/{Stock-USRT7FDU.js → Stock-DUXAE4DY.js} +4 -4
  11. package/dist/{Weather-CMA5QQYM.js → Weather-XXPZTLY7.js} +22 -22
  12. package/dist/{WorldClock-WQ3XGK2J.js → WorldClock-6ANSNTXU.js} +7 -7
  13. package/dist/ai/index.js +118 -118
  14. package/dist/apps/index.js +1 -1
  15. package/dist/bin/browser-check.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/charts/ChordChart.js +1 -1
  19. package/dist/charts/FlowChart.js +1 -1
  20. package/dist/charts/RadarChart.js +1 -1
  21. package/dist/charts/SankeyChart.js +1 -1
  22. package/dist/charts/SpecChart.js +1 -1
  23. package/dist/charts/SunburstChart.js +1 -1
  24. package/dist/charts/TreemapChart.js +1 -1
  25. package/dist/{chunk-ULSVYSVN.js → chunk-26ZOXLE6.js} +1 -1
  26. package/dist/chunk-2RLUG5ID.js +1 -0
  27. package/dist/chunk-345FP3IX.js +4 -0
  28. package/dist/{chunk-HTBACICQ.js → chunk-35Q7ZMQD.js} +6 -6
  29. package/dist/{chunk-IZ6D4KGR.js → chunk-3AVXNZY5.js} +3 -3
  30. package/dist/chunk-3FININUU.js +1 -0
  31. package/dist/{chunk-ZEGCKIAL.js → chunk-3H476JWK.js} +3 -3
  32. package/dist/chunk-422SFOQU.js +28 -0
  33. package/dist/chunk-4KPOTWYF.js +92 -0
  34. package/dist/{chunk-GVAVIYE6.js → chunk-4MDSZSLC.js} +1 -1
  35. package/dist/{chunk-UYUNREAL.js → chunk-4NTAZLT3.js} +3 -3
  36. package/dist/{chunk-NC5FIFAY.js → chunk-52RSW6TO.js} +1 -1
  37. package/dist/{chunk-P5J7G7OV.js → chunk-5B7CLXHC.js} +1 -1
  38. package/dist/{chunk-Y5YVKUM4.js → chunk-5LB7LCEG.js} +17 -17
  39. package/dist/{chunk-JPVD3VS7.js → chunk-5LG6TOV6.js} +6 -6
  40. package/dist/{chunk-7D2QZ6JA.js → chunk-5OXQ5M5S.js} +1 -1
  41. package/dist/{chunk-AH5MLH54.js → chunk-5QHNDAZ6.js} +1 -1
  42. package/dist/chunk-5QRHQCRG.js +2 -0
  43. package/dist/chunk-5RCKE4X2.js +6 -0
  44. package/dist/{chunk-2RLWGWOU.js → chunk-5Y2JZL3I.js} +13 -13
  45. package/dist/{chunk-DO6P6LYU.js → chunk-62UNBUTU.js} +1 -1
  46. package/dist/chunk-A4ROXNUF.js +2 -0
  47. package/dist/{chunk-EDRELF6L.js → chunk-ABIWAS5K.js} +1 -1
  48. package/dist/{chunk-TBDILJ6G.js → chunk-AKEED2BC.js} +1 -1
  49. package/dist/chunk-APFDZ2HG.js +1 -0
  50. package/dist/{chunk-XJK6VNXV.js → chunk-ASNRA3ZL.js} +1 -1
  51. package/dist/{chunk-Y5RTVKMB.js → chunk-B4Y5NGHR.js} +8 -8
  52. package/dist/{chunk-CXEELIRW.js → chunk-BTMZ5MUY.js} +10 -10
  53. package/dist/chunk-C4TG6XS4.js +19 -0
  54. package/dist/chunk-C75ICYHF.js +2 -0
  55. package/dist/{chunk-EHPY3BFC.js → chunk-CGX2IGQO.js} +1 -1
  56. package/dist/chunk-CIZAUBWA.js +6 -0
  57. package/dist/{chunk-DNPAYNNU.js → chunk-CMEPDSYB.js} +1 -1
  58. package/dist/chunk-D7MRZZVV.js +5 -0
  59. package/dist/chunk-DEV3ZHPP.js +8 -0
  60. package/dist/chunk-DN6NGGP5.js +8 -0
  61. package/dist/{chunk-UGA5NGW4.js → chunk-E43VGO66.js} +1 -1
  62. package/dist/{chunk-O7A7PH3R.js → chunk-EJ5NIA42.js} +1 -1
  63. package/dist/{chunk-NHALP3MW.js → chunk-EJMCK7E3.js} +4 -4
  64. package/dist/{chunk-U75MSD4F.js → chunk-EULBBS5L.js} +1 -1
  65. package/dist/{chunk-G3TC2GIA.js → chunk-FAPZFMS3.js} +1 -1
  66. package/dist/chunk-FGP2IOFN.js +15 -0
  67. package/dist/{chunk-DBBOD5QW.js → chunk-FHTL7ZZR.js} +1 -1
  68. package/dist/chunk-GGNQEZ2D.js +9 -0
  69. package/dist/{chunk-XFN4DOXP.js → chunk-GL3D5EOZ.js} +3 -3
  70. package/dist/{chunk-2SOGTOUQ.js → chunk-GUOAPXUY.js} +4 -4
  71. package/dist/{chunk-EHNW3UNC.js → chunk-HU5FTTW2.js} +8 -8
  72. package/dist/{chunk-HAEZUUDT.js → chunk-INQQUAIO.js} +3 -3
  73. package/dist/{chunk-6RU2PGQK.js → chunk-JA4I5BEB.js} +1 -1
  74. package/dist/{chunk-SP4S4HUJ.js → chunk-JGN27L4Q.js} +3 -3
  75. package/dist/{chunk-QCLKRFL4.js → chunk-JIHDUZJZ.js} +3 -3
  76. package/dist/chunk-JRKD7SD3.js +24 -0
  77. package/dist/{chunk-RA5G4K3N.js → chunk-JWS77LQE.js} +1 -1
  78. package/dist/{chunk-T46I4YOI.js → chunk-KERCZSIA.js} +1 -1
  79. package/dist/{chunk-ZA6ANC2D.js → chunk-KIIZNION.js} +4 -4
  80. package/dist/{chunk-Y6FULJWJ.js → chunk-KJ4CHRRC.js} +7 -7
  81. package/dist/{chunk-6X32SWQI.js → chunk-L2WQOJ3T.js} +1 -1
  82. package/dist/{chunk-OYQWBJ37.js → chunk-LFUXWZV7.js} +1 -1
  83. package/dist/{chunk-7OVMWXFM.js → chunk-LGVVXYW7.js} +1 -1
  84. package/dist/{chunk-5O4HMXPQ.js → chunk-MF7OELXP.js} +2 -2
  85. package/dist/chunk-MQNSKFZY.js +11 -0
  86. package/dist/chunk-NJY4HPNB.js +7 -0
  87. package/dist/{chunk-2TNG32QT.js → chunk-NM7U42KL.js} +8 -8
  88. package/dist/{chunk-F7J7XRVI.js → chunk-NZNPU2GD.js} +1 -1
  89. package/dist/{chunk-BUUAALHH.js → chunk-OEWBWKKD.js} +20 -20
  90. package/dist/{chunk-3L7BEEBW.js → chunk-OHWP24DL.js} +1 -1
  91. package/dist/{chunk-WYAKASF3.js → chunk-OK2J6WSC.js} +1 -1
  92. package/dist/chunk-P56YLT73.js +15 -0
  93. package/dist/{chunk-EEAOFYW5.js → chunk-PCNFY6EK.js} +10 -10
  94. package/dist/{chunk-XNKNX5L3.js → chunk-PM6HY5BH.js} +1 -1
  95. package/dist/{chunk-7WF6LFOJ.js → chunk-PO2KNVCC.js} +1 -1
  96. package/dist/chunk-PRN2QDX6.js +7 -0
  97. package/dist/{chunk-YX3JD6PA.js → chunk-QE2F4YQQ.js} +7 -7
  98. package/dist/{chunk-4BRVZAIW.js → chunk-QSFQTMWV.js} +1 -1
  99. package/dist/{chunk-6AYAB5FN.js → chunk-QSOBETAI.js} +5 -5
  100. package/dist/chunk-QXEZBS3H.js +6 -0
  101. package/dist/{chunk-3ZJAQSFS.js → chunk-QYOIS4BN.js} +3 -3
  102. package/dist/chunk-R6YVKP6D.js +3 -0
  103. package/dist/chunk-R72SBGYR.js +9 -0
  104. package/dist/{chunk-R36VZ35L.js → chunk-RIA6KKIB.js} +5 -5
  105. package/dist/{chunk-24BF22NF.js → chunk-RTZFWH5U.js} +1 -1
  106. package/dist/chunk-S6C7X6CR.js +23 -0
  107. package/dist/{chunk-XIX72C7K.js → chunk-SJUEGYT2.js} +1 -1
  108. package/dist/{chunk-ION3XGLN.js → chunk-TAB3K2WF.js} +1 -1
  109. package/dist/{chunk-MPC3CHAO.js → chunk-TAIH2VIW.js} +1 -1
  110. package/dist/chunk-TALQMTCE.js +4 -0
  111. package/dist/{chunk-I7WAOKU2.js → chunk-TEYG2W7A.js} +2 -2
  112. package/dist/{chunk-JU722M5V.js → chunk-TMXMIRWG.js} +8 -8
  113. package/dist/{chunk-IVEM2BPC.js → chunk-TSZPGDU3.js} +1 -1
  114. package/dist/{chunk-EOYKUV2U.js → chunk-TTUUXGEW.js} +1 -1
  115. package/dist/{chunk-4SFWQPOB.js → chunk-TXGVSWH6.js} +13 -13
  116. package/dist/{chunk-EHSK43WG.js → chunk-U7PA4KNZ.js} +8 -8
  117. package/dist/{chunk-RXCBSQA2.js → chunk-UYM7562M.js} +2 -2
  118. package/dist/chunk-V4BA3FGC.js +14 -0
  119. package/dist/{chunk-P3XXFQG5.js → chunk-V62FEHS4.js} +1 -1
  120. package/dist/{chunk-MKHOXO5O.js → chunk-VB4ZPIZF.js} +1 -1
  121. package/dist/{chunk-PTLVNC3V.js → chunk-VHBRVW5O.js} +6 -6
  122. package/dist/{chunk-5SQHRDFC.js → chunk-WNHDYTTI.js} +2 -2
  123. package/dist/chunk-WR3SULZW.js +13 -0
  124. package/dist/chunk-WSQ73CRR.js +2 -0
  125. package/dist/{chunk-GY7MJTIZ.js → chunk-XMBMI27I.js} +1 -1
  126. package/dist/{chunk-4RF3C523.js → chunk-XSMVWJV3.js} +1 -1
  127. package/dist/{chunk-EN3GYSCE.js → chunk-YEDAXZYO.js} +1 -1
  128. package/dist/{chunk-TFQC67XR.js → chunk-YGNJIOOH.js} +9 -9
  129. package/dist/{chunk-47BGAQWD.js → chunk-YXMXATYP.js} +1 -1
  130. package/dist/data/DataTable.js +1 -1
  131. package/dist/data/EntityList.js +1 -1
  132. package/dist/data/Gantt.js +1 -1
  133. package/dist/data/ListLoadError.js +1 -1
  134. package/dist/data/ListToolbar.js +1 -1
  135. package/dist/data/ResizableTable.js +1 -1
  136. package/dist/data/statusColumn.js +1 -1
  137. package/dist/forms/AlignmentGrid.js +1 -1
  138. package/dist/forms/BorderInput.js +1 -1
  139. package/dist/forms/BrandAssetEditor.js +1 -1
  140. package/dist/forms/Button.js +1 -1
  141. package/dist/forms/ColorPicker.js +1 -1
  142. package/dist/forms/ComposerAttachments.js +1 -1
  143. package/dist/forms/CornersInput.js +1 -1
  144. package/dist/forms/DatePicker.js +1 -1
  145. package/dist/forms/DateRangePicker.js +1 -1
  146. package/dist/forms/DisplayChips.js +1 -1
  147. package/dist/forms/FilePicker.js +1 -1
  148. package/dist/forms/IconButton.js +1 -1
  149. package/dist/forms/IconPicker.js +1 -1
  150. package/dist/forms/Input.js +1 -1
  151. package/dist/forms/InputNumber.js +1 -1
  152. package/dist/forms/LinkPicker.js +1 -1
  153. package/dist/forms/MediaLibrary.js +1 -1
  154. package/dist/forms/MediaUploadField.js +1 -1
  155. package/dist/forms/MediaUploadGrid.js +1 -1
  156. package/dist/forms/MediaUsedInList.js +1 -1
  157. package/dist/forms/NumericKeypad.js +1 -1
  158. package/dist/forms/PictureTiles.js +1 -1
  159. package/dist/forms/PositionInput.js +1 -1
  160. package/dist/forms/RenameField.js +1 -1
  161. package/dist/forms/SearchInput.js +1 -1
  162. package/dist/forms/Segmented.d.ts +1 -1
  163. package/dist/forms/Segmented.js +1 -1
  164. package/dist/forms/Select.js +1 -1
  165. package/dist/forms/SidesInput.js +1 -1
  166. package/dist/forms/Slider.js +1 -1
  167. package/dist/forms/Snippet.js +1 -1
  168. package/dist/forms/SplitButton.js +1 -1
  169. package/dist/forms/TagInput.js +1 -1
  170. package/dist/forms/TextToolbar.js +1 -1
  171. package/dist/forms/UnitMenu.js +1 -1
  172. package/dist/forms/WidthsBar.js +1 -1
  173. package/dist/index.d.ts +1 -1
  174. package/dist/index.js +511 -511
  175. package/dist/map/index.js +11 -11
  176. package/dist/page-tabs/index.js +5 -5
  177. package/dist/pdf/index.js +1 -1
  178. package/dist/routine-index.json +1 -1
  179. package/dist/shell/AppUpdateBanner.js +1 -1
  180. package/dist/shell/ColoredBadge.js +1 -1
  181. package/dist/shell/ConfirmDialog.js +1 -1
  182. package/dist/shell/ContextMenu.js +1 -1
  183. package/dist/shell/Dialog.js +1 -1
  184. package/dist/shell/Drawer.js +1 -1
  185. package/dist/shell/DropdownMenu.js +1 -1
  186. package/dist/shell/EditableGrid.js +1 -1
  187. package/dist/shell/FloatingBar.js +1 -1
  188. package/dist/shell/GlobalSearch.js +1 -1
  189. package/dist/shell/HelpCenter.js +1 -1
  190. package/dist/shell/IconRail.js +1 -1
  191. package/dist/shell/ImageLightbox.js +1 -1
  192. package/dist/shell/ItemCount.js +1 -1
  193. package/dist/shell/LanguageSelect.js +1 -1
  194. package/dist/shell/Markdown.js +1 -1
  195. package/dist/shell/Popover.js +1 -1
  196. package/dist/shell/PopupMenu.js +1 -1
  197. package/dist/shell/ResizeHandle.js +1 -1
  198. package/dist/shell/SearchableSelect.js +1 -1
  199. package/dist/shell/SettingReset.js +1 -1
  200. package/dist/shell/SidebarLayout.js +1 -1
  201. package/dist/shell/SidebarNav.js +1 -1
  202. package/dist/shell/SortableList.js +1 -1
  203. package/dist/shell/StatusBadge.js +1 -1
  204. package/dist/shell/Tabs.js +1 -1
  205. package/dist/shell/Tooltip.js +1 -1
  206. package/dist/shell/TopNav.js +1 -1
  207. package/dist/shell/TransferProgress.js +1 -1
  208. package/dist/shell/Tree.js +1 -1
  209. package/dist/shell/discardGuard.js +1 -1
  210. package/dist/telemetry/index.js +1 -1
  211. package/dist/templates/AuthScreen.js +1 -1
  212. package/dist/templates/ChatTemplate.js +1 -1
  213. package/dist/templates/CheckoutTemplate.js +1 -1
  214. package/dist/templates/DashboardTemplate.js +1 -1
  215. package/dist/templates/DataTablePage.js +1 -1
  216. package/dist/templates/EmailTemplate.js +1 -1
  217. package/dist/templates/ErrorBoundary.d.ts +1 -1
  218. package/dist/templates/ErrorBoundary.js +1 -1
  219. package/dist/templates/FormLayoutPage.js +1 -1
  220. package/dist/templates/GalleryTemplate.js +1 -1
  221. package/dist/ui/index.js +1 -1
  222. package/dist/value-index.json +1 -1
  223. package/dist/version.js +1 -1
  224. package/package.json +1 -1
  225. package/dist/Browser-MILMPZK2.js +0 -44
  226. package/dist/Calculator-MW7S4UKX.js +0 -29
  227. package/dist/CurrencyConverter-P3HQXUX2.js +0 -21
  228. package/dist/Notepad-VXENTPT2.js +0 -24
  229. package/dist/PdfViewer-FWGHFO4N.js +0 -1
  230. package/dist/Sidebar-2TYZENQL.js +0 -44
  231. package/dist/chunk-2XDO7FZC.js +0 -24
  232. package/dist/chunk-4DNPUG3T.js +0 -7
  233. package/dist/chunk-A3VLZZHJ.js +0 -9
  234. package/dist/chunk-AJPQJ7TC.js +0 -6
  235. package/dist/chunk-ALZHFQRX.js +0 -4
  236. package/dist/chunk-B34UWI47.js +0 -1
  237. package/dist/chunk-CHDGSJLV.js +0 -8
  238. package/dist/chunk-DOJSWVBX.js +0 -6
  239. package/dist/chunk-EBODRYXS.js +0 -19
  240. package/dist/chunk-FFPIT2LB.js +0 -3
  241. package/dist/chunk-HX5QSQ2C.js +0 -2
  242. package/dist/chunk-KETNB4NQ.js +0 -2
  243. package/dist/chunk-M5IZ7QLQ.js +0 -7
  244. package/dist/chunk-MEP6CZJ3.js +0 -2
  245. package/dist/chunk-MNZAAQLH.js +0 -15
  246. package/dist/chunk-MYH5H43C.js +0 -1
  247. package/dist/chunk-NDCS4COQ.js +0 -11
  248. package/dist/chunk-OJYEGB74.js +0 -28
  249. package/dist/chunk-PWON7O3N.js +0 -9
  250. package/dist/chunk-RTK77DMP.js +0 -15
  251. package/dist/chunk-SYUCEN76.js +0 -92
  252. package/dist/chunk-VUBDHFG5.js +0 -4
  253. package/dist/chunk-W4IH3BE3.js +0 -23
  254. package/dist/chunk-W6REY3SV.js +0 -5
  255. package/dist/chunk-WBZO6WRU.js +0 -8
  256. package/dist/chunk-Y7D2CZ4H.js +0 -13
  257. package/dist/chunk-YTLUSBDY.js +0 -14
  258. package/dist/chunk-ZSVU44OB.js +0 -6
  259. /package/dist/{chunk-5YTZBYG4.js → chunk-TEQ5ZPAL.js} +0 -0
@@ -0,0 +1,23 @@
1
+ import{Calendar as e}from"./chunk-PPHGBEJA.js";import{gridColumnCount as t}from"./chunk-VNNVG4NR.js";import{END_ACTIONS_PAD as r,InputEndActionSlot as n,InputEndActionButton as a}from"./chunk-D7MRZZVV.js";import{FILTER_ON as o,FILTER_ON_INK as i,FILTER_OFF as l}from"./chunk-AYZY3YNC.js";import{userToday as s,calendarNames as c}from"./chunk-NHKT5IH6.js";import{toDateKey as d,fromDateKey as m,toMonthKey as u}from"./chunk-JRQMX4PK.js";import{pad2 as h}from"./chunk-LF27WIN2.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{onOverlayOpen as f}from"./chunk-PGN5ME7B.js";import{createShellPortal as g}from"./chunk-5QRHQCRG.js";import{Z_LAYERS as b}from"./chunk-62LW225J.js";import{useDropdownPosition as x}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as v}from"./chunk-PU2GJVMG.js";import{buttonClasses as y}from"./chunk-UQYNPYF4.js";import{glassStyle as w}from"./chunk-5FYDNH4Y.js";import{useShellStrings as N,useShellLocale as k}from"./chunk-NRHG4R2Q.js";import{useState as C,useRef as M,useId as j,useEffect as D}from"react";import{jsxs as W,Fragment as $,jsx as H}from"react/jsx-runtime";var R=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Y=d;function F(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:d(new Date(r,n,t.getDate()-14)),to:d(a)};case"lastMonth":return{from:d(i(1)),to:d(o)};case"last3Months":return{from:d(i(3)),to:d(o)};case"last6Months":return{from:d(i(6)),to:d(o)};case"last12Months":return{from:d(i(12)),to:d(o)}}}function S(e,t,r){const n=u(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function G(e){const t=m(e);return t?`${h(t.getDate())}/${h(t.getMonth()+1)}/${t.getFullYear()}`:e}var O=/* @__PURE__ */new Map;function P({from:d,to:u,onChange:h,formatDisplay:Y,clearable:P,required:V=!1,name:T,id:A,"aria-labelledby":E,"aria-label":I,weekStartsOn:L,placeholder:Q,fullWidth:Z=!1,min:B,max:J,disabled:U=!1,allowOpenEnd:q=!1}){const K=N().dateRange,z=k(),X=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 r=t;return e=>{const t=m(e);return t?r.format(new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()))):e}}(z):G),_=Q??K.placeholder,ee=P??!V,[te,re]=C(!1),[ne,ae]=C(d),[oe,ie]=C(u),[le,se]=C(null),[ce,de]=C("from"),me=M(null),ue=M(null),he=M(null),pe=j(),fe=j(),ge=j(),[be,xe]=C(!1),ve=x(me,te,{preferredMaxWidth:520,preferredMaxHeight:be?720:560,popupRef:he}),ye=M(null),we=M(null),[Ne,ke]=C(!0);v(()=>{const e=we.current;if(!te||!be||!e)return;const r=t(getComputedStyle(e).gridTemplateColumns)||1,n=parseFloat(getComputedStyle(e).columnGap)||0,a=(e.clientWidth-n*(r-1))/r,o=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=a+.5;o!==Ne&&ke(o)});const Ce=M(null);v(()=>{const e=he.current;if(!te||!ve||!e)return;const t=getComputedStyle(e),r=ve.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(be)null!==Ce.current&&Ce.current<=r&&xe(!1);else{const e=ye.current?.offsetWidth??0;if(0===e)return;Ce.current=e,e>r+.5&&xe(!0)}});const[Me,je]=C(!1);v(()=>{const e=!!A&&(ue.current?.labels?.length??0)>0;e!==Me&&je(e)});const De=!!I||!!E||Me,We=m(s())??/* @__PURE__ */new Date(0),[$e,He]=C(()=>d?d.slice(0,7):S(We,B,J)),Re=R.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(F(e,We),B,J)),Ye=e=>e?X(e):"";D(()=>{if(!te)return;const e=e=>{const t=e.target;me.current?.contains(t)||he.current?.contains(t)||re(!1)};document.addEventListener("mousedown",e);const t=f(()=>re(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[te]),D(()=>{U&&re(!1)},[U]);const Fe=()=>{h("",""),re(!1)},Se=ee&&!U&&Boolean(d||u),Ge=d&&u?`${Ye(d)} — ${Ye(u)}`:d?K.fromOnly(Ye(d)):u?K.toOnly(Ye(u)):"",Oe=c(z),Pe=e=>{const t=m(e);return t?Oe.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},Ve=d&&u?K.range(Pe(d),Pe(u)):d?K.fromOnly(Pe(d)):u?K.toOnly(Pe(u)):_,Te=e=>be?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(le===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 "+(le===e?"bg-accent-tint text-blue-700 font-medium":"text-ink hover:bg-row-hover"),Ae=/* @__PURE__ */W($,{children:[Re.map(e=>/* @__PURE__ */H("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=F(e,We);ae(t.from),ie(t.to),se(e),He(t.from.slice(0,7))})(e),className:Te(e),"aria-label":be?K[e]:void 0,children:be?Ne?K[e]:K[`${e}Short`]:K[e]},e)),
2
+ /* @__PURE__ */H("button",{type:"button",onClick:()=>se("Custom"),className:Te("Custom"),children:K.custom})]}),Ee=(e,t)=>q?/* @__PURE__ */H("button",{type:"button","data-range-end":e,"aria-pressed":ce===e,onClick:()=>de(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */H("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ie=e=>q&&ce===e?" ring-1 ring-blue-400":"",Le=
3
+ /* @__PURE__ */H(e,{mode:"range",min:B,max:J,value:ne||null,endValue:oe||null,month:$e,onMonthChange:He,onSelect:e=>{se("Custom"),q?"from"===ce?(oe&&e>oe?(ae(oe),ie(e)):ae(e),de("to")):ne&&e<ne?(ie(ne),ae(e)):ie(e):!ne||ne&&oe?(ae(e),ie("")):e<ne?(ie(ne),ae(e)):ie(e)},weekStartsOn:L,"aria-label":K.dialog});/* @__PURE__ */
4
+ return W("div",{className:"relative"+(Z?" w-full":""),ref:me,children:[
5
+ /* @__PURE__ */W("div",{className:`relative ${Z?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 ${Se?r[1]:""} text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${d||u?`${o} ${i}`:l}${U?" cursor-not-allowed opacity-60":""}`,children:[
6
+ /* @__PURE__ */W("button",{ref:ue,type:"button",onClick:()=>{U||(ae(d),ie(u),se(null),de(d&&!u?"to":"from"),He(d?d.slice(0,7):S(We,B,J)),re(!0))},"aria-haspopup":"dialog","aria-expanded":te,id:A,disabled:U||void 0,"aria-label":I,"aria-labelledby":E,"aria-describedby":[De?fe:void 0,V?ge:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":te?pe:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(Z?" min-w-0 flex-1 justify-start":""),children:[
7
+ /* @__PURE__ */H(p,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
8
+ /* @__PURE__ */H("span",{className:"truncate",children:Ge||_})]}),Se&&/* @__PURE__ */H(n,{children:/* @__PURE__ */H(a,{action:{label:K.clearRange,icon:/* @__PURE__ */H(p,{name:"close"}),onClick:Fe}})})]}),De&&/* @__PURE__ */H("span",{id:fe,className:"sr-only",children:Ve}),V&&/* @__PURE__ */H("span",{id:ge,className:"sr-only",children:K.required}),T&&/* @__PURE__ */W($,{children:[
9
+ /* @__PURE__ */H("input",{type:"hidden",name:T.from,value:d,disabled:U||void 0}),
10
+ /* @__PURE__ */H("input",{type:"hidden",name:T.to,value:u,disabled:U||void 0})]}),te&&g(
11
+ /* @__PURE__ */W("div",{ref:he,id:pe,role:"dialog","aria-label":K.dialog,"data-layout":be?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:b.popup,left:ve?.left,right:ve?.right,top:ve?.top,bottom:ve?.bottom,width:be&&ve?ve.maxWidth:"max-content",maxWidth:ve?.maxWidth,maxHeight:ve?.maxHeight,overflowY:"auto",visibility:ve?void 0:"hidden",...w()},children:[
12
+ /* @__PURE__ */W("div",{className:be?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ee("from",/* @__PURE__ */W($,{children:[
13
+ /* @__PURE__ */H("span",{className:"text-xs font-medium text-gray-500",children:K.from}),
14
+ /* @__PURE__ */H("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"}${Ie("from")}`,children:ne?Ye(ne):K.start})]})),!be&&/* @__PURE__ */H("span",{className:"text-gray-300",children:"—"}),Ee("to",/* @__PURE__ */W($,{children:[
15
+ /* @__PURE__ */H("span",{className:"text-xs font-medium text-gray-500",children:K.to}),
16
+ /* @__PURE__ */H("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${oe?"border-blue-300 bg-accent-tint text-blue-700":"border-line bg-surface-sunken text-ink-faintest"}${Ie("to")}`,children:oe?Ye(oe):K.end})]}))]}),be?/* @__PURE__ */W($,{children:[Re.length>0&&/* @__PURE__ */W("div",{className:"mb-3 @container",children:[!Ne&&/* @__PURE__ */H("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-ink-faint",children:K.lastHeading}),
17
+ /* @__PURE__ */W("div",{ref:we,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Ae,Re.map(e=>/* @__PURE__ */H("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:K[e]},e))]})]}),
18
+ /* @__PURE__ */H("div",{className:"w-full",children:Le})]}):
19
+ /* @__PURE__ */W("div",{ref:ye,className:"flex w-max gap-4",children:[
20
+ /* @__PURE__ */H("div",{className:"w-64",children:Le}),Re.length>0&&/* @__PURE__ */H("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Ae})]}),
21
+ /* @__PURE__ */W("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[ee&&/* @__PURE__ */H("button",{type:"button",onClick:Fe,className:y({variant:"ghost"}),children:K.clear}),
22
+ /* @__PURE__ */H("button",{type:"button",onClick:()=>re(!1),className:y({variant:"secondary"}),children:K.cancel}),
23
+ /* @__PURE__ */H("button",{type:"button",onClick:()=>{h(ne,oe),re(!1)},disabled:q?!ne&&!oe:!ne||!oe,className:y({variant:"primary"}),children:K.apply})]})]}),document.body)]})}export{P as DateRangePicker,F as presetRange,Y as toISODate};
@@ -1,4 +1,4 @@
1
- import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-PFOTEDSQ.js";import{Tooltip as n}from"./chunk-AJPQJ7TC.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";import{createContext as o,useRef as a,useState as i,useEffect as l,useContext as s}from"react";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";var h=o({labels:"none",shown:"none"}),f="button[data-icon-rail-button]:not([disabled])";function b(e,t,n){const r=getComputedStyle(e),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a="horizontal"===t?(parseFloat(r.columnGap)||0)*Math.max(0,n-1):0,i=e.parentElement;let l=1/0;if(i){const e=getComputedStyle(i);l=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:o+a,room:l}}function m({"aria-label":t,orientation:n="vertical",children:o,className:s="",labels:d="none",labelsFit:u=!1,onLabelsShown:m}){const p=a(null),g="none"!==d&&u,[v,y]=i(null),w="none"===d?"none":g?v??"none":"all",x=a(()=>{});x.current=()=>{const t=p.current;if(!t||!g)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=parseFloat(n.minWidth)||0,a=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(o,r+a),worded:"below"===t?Math.max(o,r+Math.max(a,i)):Math.max(o,r+a+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(t,d);y(e({buttons:r,orientation:n,...b(t,n,r.length)}))},r(()=>{x.current()}),l(()=>{const e=p.current?.parentElement;if(!g||!e)return;let t=!0;const n=()=>{t&&x.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()}},[g]);const F=a(null),k=a(m);k.current=m,l(()=>{g&&null!==v&&F.current!==v&&(F.current=v,k.current?.(v))},[g,v]),r(()=>{const e=p.current;if(!e)return;const t=[...e.querySelectorAll(f)];if(0===t.length)return;const n=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===n?0:-1});/* @__PURE__ */
1
+ import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-PFOTEDSQ.js";import{Tooltip as n}from"./chunk-CIZAUBWA.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";import{createContext as o,useRef as a,useState as i,useEffect as l,useContext as s}from"react";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";var h=o({labels:"none",shown:"none"}),f="button[data-icon-rail-button]:not([disabled])";function b(e,t,n){const r=getComputedStyle(e),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a="horizontal"===t?(parseFloat(r.columnGap)||0)*Math.max(0,n-1):0,i=e.parentElement;let l=1/0;if(i){const e=getComputedStyle(i);l=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:o+a,room:l}}function m({"aria-label":t,orientation:n="vertical",children:o,className:s="",labels:d="none",labelsFit:u=!1,onLabelsShown:m}){const p=a(null),g="none"!==d&&u,[v,y]=i(null),w="none"===d?"none":g?v??"none":"all",x=a(()=>{});x.current=()=>{const t=p.current;if(!t||!g)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=parseFloat(n.minWidth)||0,a=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(o,r+a),worded:"below"===t?Math.max(o,r+Math.max(a,i)):Math.max(o,r+a+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(t,d);y(e({buttons:r,orientation:n,...b(t,n,r.length)}))},r(()=>{x.current()}),l(()=>{const e=p.current?.parentElement;if(!g||!e)return;let t=!0;const n=()=>{t&&x.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()}},[g]);const F=a(null),k=a(m);k.current=m,l(()=>{g&&null!==v&&F.current!==v&&(F.current=v,k.current?.(v))},[g,v]),r(()=>{const e=p.current;if(!e)return;const t=[...e.querySelectorAll(f)];if(0===t.length)return;const n=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===n?0:-1});/* @__PURE__ */
2
2
  return c("div",{ref:p,role:"toolbar","aria-label":t,"aria-orientation":n,"data-orientation":n,onKeyDown:e=>{const t=p.current;if(!t)return;const r=[...t.querySelectorAll(f)],o=r.indexOf(e.target);if(o<0)return;const a="vertical"===n?"ArrowUp":"ArrowLeft",i="vertical"===n?"ArrowDown":"ArrowRight",l=e.key===i?(o+1)%r.length:e.key===a?(o-1+r.length)%r.length:"Home"===e.key?0:"End"===e.key?r.length-1:-1;if(!(l<0)){e.preventDefault();for(const e of r)e.tabIndex=e===r[l]?0:-1;r[l].focus()}},"data-labels":"none"===d?void 0:d,"data-labels-shown":"none"===d?void 0:w,className:`flex gap-2 ${"vertical"===n?"flex-col items-center":"flex-row items-center"} ${s}`.trim(),children:/* @__PURE__ */c(h.Provider,{value:{labels:d,shown:w},children:o})})}function p({label:e,icon:r,active:o,disabled:a,onClick:i,badge:l,tooltipSide:f="right",className:b=""}){const m=!0===o,{labels:p,shown:g}=s(h),v=void 0===l||!1===l||0===l?r:/* @__PURE__ */c(t,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:r}),y="none"!==p,w=y&&("all"===g||"chosen"===g&&m),x=/* @__PURE__ */c("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof o?o:void 0,disabled:a,onClick:a?void 0:i,className:[`relative inline-flex ${y?"beside"===p?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",m?"bg-accent-tint text-blue-700":"text-gray-600 not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest",b].filter(Boolean).join(" "),children:y?/* @__PURE__ */d(u,{children:[
3
3
  /* @__PURE__ */c("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:v}),
4
4
  /* @__PURE__ */c("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",w?"beside"===p?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):v});/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{GROUP_COLORS as e}from"./chunk-EDRELF6L.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-AJPQJ7TC.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.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-ABIWAS5K.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-CIZAUBWA.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.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,$=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),k="string"==typeof y?g.cancelVerb(y.toLowerCase()):g.cancel,N=e=>[e,m,null==$?"":`${$}%`].filter(Boolean).join(" ");/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{TransferProgress as e}from"./chunk-ION3XGLN.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-NRHG4R2Q.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
1
+ import{TransferProgress as e}from"./chunk-TAB3K2WF.js";import{Icon as r}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-NRHG4R2Q.js";import{jsx as o}from"react/jsx-runtime";var n=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function i(e){if(/^data:/i.test(e||""))return function(e){const r=n.exec(e);if(!r)return"media";const[,t,o]=r,i=o.split("+")[0].split(".").pop().replace(/^x-/i,"");return i?`${t.toLowerCase()}.${i.toLowerCase()}`:"media"}(e);const r=(e||"").split("?")[0].split("#")[0],t=r.substring(r.lastIndexOf("/")+1);try{return decodeURIComponent(t.replace(/^[0-9a-f]{32}_/i,""))||t||"media"}catch{return t||"media"}}var s=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function a(e,r=t.media){const o=function(e){const r=e.includes("video"),t=e.includes("image")||"*"===e||""===e;return r&&!t?"video":t&&!r?"image":"file"}(e);return"image"===o?r.uploadImage:"video"===o?r.uploadVideo:r.uploadFile}function c(e,r,t="",o="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",o,r?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",t].filter(Boolean).join(" ")}function u(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function d({label:r,progress:t,rounded:n="rounded-lg"}){/* @__PURE__ */
2
2
  return o("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${n}`,children:/* @__PURE__ */o(e,{state:"busy",verb:r,pct:t})})}function l({children:e}){/* @__PURE__ */
3
3
  return o("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e})}function m(e,r=""){if(!e)return!1;const t=n.exec(e);if(t)return"video"===t[1].toLowerCase();const o=r.includes("video"),i=r.includes("image")||"*"===r||""===r;return s.test(e)||o&&!i}function f({className:e="h-4 w-4"}){/* @__PURE__ */
4
4
  return o(r,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function p({className:e="h-6 w-6"}){/* @__PURE__ */
@@ -0,0 +1,4 @@
1
+ import{choiceTrackClass as e,choiceTipClass as l,ChoiceContent as a,choiceItemClass as i}from"./chunk-EFKJLUYP.js";import{Tooltip as r}from"./chunk-CIZAUBWA.js";import{useRowTrackItemSize as s}from"./chunk-3FININUU.js";import{useId as o}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";function c({value:c,onChange:d,options:b,name:u,size:m="md",block:h=!1,label:p,className:v="","aria-labelledby":f,"aria-describedby":N}){const g=s(m)??"md",k={"aria-label":f?void 0:p,"aria-labelledby":f,"aria-describedby":N},y=o(),j=e(h,v),C=l(h);/* @__PURE__ */
2
+ return n("div",u?{role:"radiogroup",...k,className:j,children:b.map(e=>{const l=`${y}-${e.value}`,s=e.value===c,o=/* @__PURE__ */t("label",{htmlFor:l,className:i({size:g,selected:s,disabled:e.disabled,block:h}),children:[
3
+ /* @__PURE__ */n("input",{id:l,type:"radio",name:u,value:e.value,checked:s,disabled:e.disabled,"aria-describedby":e.title?`${l}-note`:void 0,onChange:()=>d(e.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
4
+ /* @__PURE__ */n(a,{icon:e.icon,label:e.label}),e.title&&/* @__PURE__ */n("span",{id:`${l}-note`,className:"sr-only",children:e.title})]},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:C,children:o},e.value):o})}:{role:"group",...k,className:j,children:b.map(e=>{const l=e.value===c,s=/* @__PURE__ */n("button",{type:"button","aria-pressed":l,disabled:e.disabled,onClick:()=>d(e.value),className:i({size:g,selected:l,disabled:e.disabled,block:h}),children:/* @__PURE__ */n(a,{icon:e.icon,label:e.label})},e.value);return e.title?/* @__PURE__ */n(r,{content:e.title,className:C,children:s},e.value):s})})}export{c as Segmented};
@@ -1,3 +1,3 @@
1
- import{unitBox as e}from"./chunk-GVAVIYE6.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{IconButton_default as n}from"./chunk-MYH5H43C.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:t,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":t,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(n,{size:"sm",...v,children:u})}var j=c(function({value:n,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:E,disabled:D,readOnly:B,invalid:C,placeholder:M,size:S,prefix:$,suffix:O,suffixControl:P,units:F,id:R,name:U,className:V="",onBlur:K,onFocus:W,steppers:Y,stepFrom:z,snap:I=!1,allowEmpty:L=!0,appearance:T="box",display:A,reportWhileTyping:G=!0,onRevert:H,"aria-label":Q,"aria-labelledby":J,"aria-describedby":X,auto:Z,...q},_){const ee="bare"===T,re=P??("string"==typeof O?e(O,F,D||B):void 0),te=r(),ne=Z??te,oe=s(),ie="string"==typeof O&&""!==O.trim()?O.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean(O||re),ce=Object.fromEntries(Object.entries(q).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(n,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(n),he=d(n);he.current=n;const be=Boolean(D||B),ge=Y??!1,xe="compact"===ge,[ye,we]=w($),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==n&&de(x(n,g))},[n,g]);const Ee=e=>{if(be)return;let r=(ae(pe.current)??z??(M?ae(M):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),Oe()},De=d(Ee);De.current=Ee;const Be=d({unit:j??1,big:E??10*(j??1),locked:be});Be.current={unit:j??1,big:E??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=Be.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),De.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Ce,Me]=u(!1),[Se,$e]=u(0),Oe=()=>{ee&&$e(e=>e+1)};f(()=>{ee&&Ce&&document.activeElement===fe.current&&fe.current?.select()},[ee,Ce,Se]);const Pe=d(!1);f(()=>{if(Ce&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(H??o)(r),Oe(),!0})},[Ce,be,g,o,H]);const Fe=()=>{const e=ae(pe.current);if(null==e){if(!L){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(I?Math.max(b(j??1),b(i??0)):void 0);I&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Re=/* @__PURE__ */m("input",{ref:me,id:R,"data-number-input":"",name:U,type:"text",inputMode:0===g?"numeric":"decimal",value:!Ce&&A?A(n):ue,disabled:D,readOnly:B,placeholder:M,step:j,role:"spinbutton","aria-valuenow":n??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==n?M||void 0:`${x(n,g)}${ee&&ie?ie:""}`,"aria-describedby":[X,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":C||void 0,"aria-label":Q,"aria-labelledby":J,onChange:e=>(e=>{if(B)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!G)return;const t=ae(e);(null!==t||L)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Fe(),void Oe();const r=j??1,t=E??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),Ee(n))},onFocus:()=>{ve.current=he.current,Me(!0),Pe.current=!0,W?.()},onMouseUp:ee?e=>{Pe.current&&(Pe.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Me(!1),Pe.current=!1,Fe(),K?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Ce?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",V].filter(Boolean).join(" "):t({invalid:C,size:S,readOnly:B,auto:ne,className:[$?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Ce?"text-ellipsis":"",V].filter(Boolean).join(" ")})}),Ue=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!$&&!le&&!ge)return Ue?/* @__PURE__ */v(h,{children:[Re,Ue]}):Re;const Ve=ae(ue);/* @__PURE__ */
2
- return v("div",{className:"relative","data-number-box":"",style:$||re?{...$?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[$&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:$}),Re,Ue,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):O&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:O}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=Ve&&Ve<=i,onStep:e=>De.current(-(e?E??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=Ve&&Ve>=c,onStep:e=>De.current(e?E??10*(j??1):j??1)});/* @__PURE__ */
1
+ import{unitBox as e}from"./chunk-4MDSZSLC.js";import{useSettingAuto as r}from"./chunk-2NMW66P5.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{IconButton_default as n}from"./chunk-APFDZ2HG.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as i}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{forwardRef as c,useId as s,useState as u,useRef as d,useCallback as p,useEffect as f}from"react";import{jsx as m,jsxs as v,Fragment as h}from"react/jsx-runtime";function b(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}function g(e){return 0===b(e)?{precision:0}:{snap:!0}}var x=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e),y={compact:{right:"var(--space-16)",least:"var(--space-32)"},steppers:{right:"calc(var(--space-40) + var(--space-20))",least:"calc(var(--space-48) * 2)"},plain:{right:"var(--space-8)",least:"var(--space-40)"}};function w(e){const r=d(null),[t,n]=u(0);return i(()=>{const e=r.current;if(!e)return;const t=()=>n(Math.ceil(e.getBoundingClientRect().width));if(t(),"undefined"==typeof ResizeObserver)return;const o=new ResizeObserver(t);return o.observe(e),()=>o.disconnect()},[e]),[r,t]}function k(e,r,t){if(!r)return e;const n=e.trimEnd();for(let e=r.length;e>(t?0:r.length-1);e--)if(n.endsWith(r.slice(0,e)))return n.slice(0,-e).trimEnd();return e}function N({dir:e,compact:r,label:t,disabled:i,onStep:a}){const l=d(a);l.current=a;const c=d({}),s=p(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);f(()=>s,[s]),f(()=>{i&&s()},[i,s]);const u=/* @__PURE__ */m(o,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:r?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:r?2.6:2}),v={tabIndex:-1,"aria-label":t,disabled:i,onPointerDown:e=>{if(0!==e.button||i)return;e.preventDefault(),s();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",s),c.current={off:()=>t.removeEventListener("pointerup",s),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return r?/* @__PURE__ */m("button",{type:"button",...v,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:u}):/* @__PURE__ */m(n,{size:"sm",...v,children:u})}var j=c(function({value:n,onChange:o,min:i,max:c,precision:g,step:j,shiftStep:D,disabled:E,readOnly:B,invalid:S,placeholder:C,size:M,prefix:P,suffix:$,suffixControl:F,units:O,id:R,name:U,className:K="",onBlur:L,onFocus:W,steppers:z,stepFrom:T,snap:V=!1,allowEmpty:A=!0,appearance:G="box",display:I,reportWhileTyping:Y=!0,onRevert:Z,"aria-label":H,"aria-labelledby":Q,"aria-describedby":J,auto:X,...q},_){const ee="bare"===G,re=F??("string"==typeof $?e($,O,E||B):void 0),te=r(),ne=X??te,oe=s(),ie="string"==typeof $&&""!==$.trim()?$.trim():void 0,ae=e=>function(e,r,t=!1){let n=k(e.trim(),r,t);if(n=n.replace(",","."),""===n||"-"===n||"."===n||"-."===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}(e,ie,Boolean(re)),le=Boolean($||re),ce=Object.fromEntries(Object.entries(q).filter(([e])=>e.startsWith("data-"))),se=l(),[ue,de]=u(()=>x(n,g)),pe=d(ue);pe.current=ue;const fe=d(null),me=p(e=>{fe.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]),ve=d(n),he=d(n);he.current=n;const be=Boolean(E||B),ge=z??!1,xe="compact"===ge,[ye,we]=w(P),[ke,Ne]=w(Boolean(re)),je=xe?y.compact:ge?y.steppers:y.plain;f(()=>{ae(pe.current)!==n&&de(x(n,g))},[n,g]);const De=e=>{if(be)return;let r=(ae(pe.current)??T??(C?ae(C):null)??0)+e;null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c);const t=g??String(j??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const n=x(r,g);pe.current=n,de(n),o(r),$e()},Ee=d(De);Ee.current=De;const Be=d({unit:j??1,big:D??10*(j??1),locked:be});Be.current={unit:j??1,big:D??10*(j??1),locked:be},f(()=>{const e=fe.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:o}=Be.current;if(o||e.ownerDocument.activeElement!==e)return;const i=r.deltaY||r.deltaX;i&&(r.preventDefault(),Ee.current((i<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[Se,Ce]=u(!1),[Me,Pe]=u(0),$e=()=>{ee&&Pe(e=>e+1)};f(()=>{ee&&Se&&document.activeElement===fe.current&&fe.current?.select()},[ee,Se,Me]);const Fe=d(!1);f(()=>{if(Se&&!be)return a(e=>{if("Escape"!==e.key||document.activeElement!==fe.current)return!1;const r=ve.current;if(ae(pe.current)===r)return!1;const t=x(r,g);return pe.current=t,de(t),he.current!==r&&(Z??o)(r),$e(),!0})},[Se,be,g,o,Z]);const Oe=()=>{const e=ae(pe.current);if(null==e){if(!A){const e=x(he.current,g);return pe.current=e,de(e),he.current}return pe.current="",de(""),null!==he.current&&o(null),null}let r=e;const t=g??(V?Math.max(b(j??1),b(i??0)):void 0);V&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,j??1,i??0)),null!=i&&r<i&&(r=i),null!=c&&r>c&&(r=c),null!=t&&(r=Number(r.toFixed(t)));const n=x(r,g);return pe.current=n,de(n),r===e&&r===he.current||o(r),r},Re=/* @__PURE__ */m("input",{ref:me,id:R,"data-number-input":"",name:U,type:"text",inputMode:0===g?"numeric":"decimal",value:!Se&&I?I(n):ue,disabled:E,readOnly:B,placeholder:C,step:j,role:"spinbutton","aria-valuenow":n??void 0,"aria-valuemin":i,"aria-valuemax":c,"aria-valuetext":null==n?C||void 0:`${x(n,g)}${ee&&ie?ie:""}`,"aria-describedby":[J,ne?oe:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":ee?"bare":void 0,...ce,autoComplete:ee?"off":void 0,spellCheck:!ee&&void 0,"aria-invalid":S||void 0,"aria-label":H,"aria-labelledby":Q,onChange:e=>(e=>{if(B)return;const r=k(e,ie,Boolean(re));if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(de(e),!Y)return;const t=ae(e);(null!==t||A)&&o(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!be)return ve.current=Oe(),void $e();const r=j??1,t=D??10*r,n="ArrowUp"===e.key?e.shiftKey?t:r:"ArrowDown"===e.key?-(e.shiftKey?t:r):"PageUp"===e.key?10*r:"PageDown"===e.key?10*-r:null;null===n||be||(e.preventDefault(),De(n))},onFocus:()=>{ve.current=he.current,Ce(!0),Fe.current=!0,W?.()},onMouseUp:ee?e=>{Fe.current&&(Fe.current=!1,e.preventDefault())}:void 0,onBlur:()=>{Ce(!1),Fe.current=!1,Oe(),L?.()},className:ee?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",Se?"bg-surface":"bg-transparent",be?"cursor-default":"cursor-text",K].filter(Boolean).join(" "):t({invalid:S,size:M,readOnly:B,auto:ne,className:[P?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",re?"pr-(--rosh-number-suffix-room)":xe?le?"pr-10":"pr-6":ge?le?"pr-24":"pr-16":le?"pr-10":"","text-left tabular-nums",re&&!Se?"text-ellipsis":"",K].filter(Boolean).join(" ")})}),Ue=ne?/* @__PURE__ */m("span",{id:oe,hidden:!0,children:se.settingView.auto}):null;if(ee||!P&&!le&&!ge)return Ue?/* @__PURE__ */v(h,{children:[Re,Ue]}):Re;const Ke=ae(ue);/* @__PURE__ */
2
+ return v("div",{className:"relative","data-number-box":"",style:P||re?{...P?{"--rosh-number-prefix-width":`${we}px`}:{},...re?{"--rosh-number-suffix-room":`max(${je.least}, calc(${je.right} + ${Ne}px))`}:{}}:void 0,children:[P&&/* @__PURE__ */m("span",{ref:ye,className:"pointer-events-none absolute left-(--space-control-x-sm) top-1/2 -translate-y-1/2 whitespace-nowrap text-sm text-ink-faint",children:P}),Re,Ue,re?/* @__PURE__ */m("span",{ref:ke,className:"absolute top-1/2 flex -translate-y-1/2",style:{right:je.right},children:re}):$&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${xe?"right-6":ge?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:$}),ge&&(()=>{const e=/* @__PURE__ */m(N,{dir:-1,compact:xe,label:se.number.decrease,disabled:be||null!=i&&null!=Ke&&Ke<=i,onStep:e=>Ee.current(-(e?D??10*(j??1):j??1))}),r=/* @__PURE__ */m(N,{dir:1,compact:xe,label:se.number.increase,disabled:be||null!=c&&null!=Ke&&Ke>=c,onStep:e=>Ee.current(e?D??10*(j??1):j??1)});/* @__PURE__ */
3
3
  return v("span",xe?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[r,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,r]})})()]})});export{j as InputNumber_default,g as stepRounding};
@@ -1,11 +1,11 @@
1
- import{SidebarBarContext as e,SidebarSheetContext as r}from"./chunk-QWK6DRSN.js";import{readStoredWidth as l,ResizeHandle as a}from"./chunk-5SQHRDFC.js";import{WindowInsetContext as n}from"./chunk-YI4T5I5D.js";import{useIsPhone as t}from"./chunk-UGTRSRIW.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{PANEL_SURFACE as o}from"./chunk-BWJZTHZ6.js";import{useBrowserState as s}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as c}from"./chunk-PU2GJVMG.js";import{useShellStrings as d}from"./chunk-NRHG4R2Q.js";import{useContext as h,useRef as m,useState as u,useReducer as f,useMemo as p,Fragment as b,useEffect as x}from"react";import{jsxs as g,jsx as v,Fragment as w}from"react/jsx-runtime";var N=(e,r,l)=>Math.min(Math.max(e,r),l);function k({sidebar:e,sidebarTop:r,sidebarBottom:i,rail:o,railClassName:b="border-r border-line px-1 pb-2",children:x,side:k="left",storageKey:$,defaultWidth:C=256,minWidth:R=180,maxWidth:D=480,className:I="",sidebarClassName:P=("right"===k?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:W="bg-white"}){const z="right"===k,E=d().sidebar,O=t(),S=function(){const[e,r]=u(!1),l=m(null),a=m(/* @__PURE__ */new Map),[,n]=f(e=>e+1,0),t=p(()=>({report(e,r,l){const t={label:r,el:l};return a.current.set(e,t),n(),()=>{a.current.get(e)===t&&(a.current.delete(e),n())}}}),[]);return{api:t,open:e,setOpen:r,current:()=>[...a.current.values()].sort((e,r)=>e.el&&r.el&&e.el.compareDocumentPosition(r.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:l}}(),[T,G]=s(()=>($?l($,R,D):null)??N(C,R,D),N(C,R,D)),K=null!=r||null!=i,M=h(n),Q=m(null),[F,H]=u(!1),U=M?.claim;c(()=>{if(!U||z||O||!Q.current)return;const e=U(Q.current);return e?(H(!0),()=>{H(!1),e()}):void 0},[U,z,O]);const Z=F&&!!M?.over,B=K||Z,J=M?.compact?"min-h-(--row-height-compact-bar)":"min-h-(--row-height-window-bar)",L="shrink-0 "+(M?.compact?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)"),V=null!=o&&!z,_=Z&&V,A=/* @__PURE__ */g("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:T},children:[
2
- /* @__PURE__ */g("div",{className:`flex h-full flex-col ${B?"overflow-hidden":"overflow-y-auto"} ${P}`,children:[Z&&!V&&/* @__PURE__ */v("div",{"data-window-strip":"","aria-hidden":"true",className:L}),null!=r&&/* @__PURE__ */v("div",{className:"flex shrink-0 flex-col gap-2 px-2 "+(_?`${J} justify-center py-1`:"pb-2 "+(Z?"pt-1":"pt-3")),children:r}),B?/* @__PURE__ */v("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=i&&/* @__PURE__ */v("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:i})]}),
3
- /* @__PURE__ */v(a,{side:k,width:T,onResize:G,min:R,max:D,defaultWidth:N(C,R,D),storageKey:$,hint:E.resize})]}),X=V?/* @__PURE__ */g("div",{"data-sidebar-rail":"",className:`flex h-full shrink-0 flex-col ${b}`,children:[/* @__PURE__ */v("div",Z?{"data-window-strip":"","aria-hidden":"true",className:L}:{"aria-hidden":"true",className:"h-2 shrink-0"}),o]}):null,Y=
4
- /* @__PURE__ */v("div",{className:`flex min-w-0 flex-1 flex-col ${W}${F?" pr-1":""}`,children:x});if(!O)/* @__PURE__ */
5
- return v("div",{ref:Q,className:`flex h-full w-full overflow-hidden ${I}`,children:/* @__PURE__ */g(w,X?{children:[X,
6
- /* @__PURE__ */g("div",{className:"flex h-full min-w-0 flex-1 overflow-hidden",children:[A,Y,null]})]}:{children:[z?null:A,Y,z?A:null]})});const q=/* @__PURE__ */g("div",{className:"relative flex h-full min-w-0 flex-col overflow-hidden "+(X?"flex-1":`w-full ${I}`),children:[
7
- /* @__PURE__ */v(y,{phone:S,top:r,fallback:E.sections}),Y,
8
- /* @__PURE__ */v(j,{phone:S,bottom:i,label:E.sections,closeLabel:E.closeSections,children:e})]});return X?/* @__PURE__ */v("div",{className:`flex h-full w-full overflow-hidden ${I}`,children:/* @__PURE__ */g(w,{children:[X,q]})}):q}function y({phone:r,top:l,fallback:a}){const n=r.current();/* @__PURE__ */
1
+ import{SidebarBarContext as e,SidebarSheetContext as r}from"./chunk-QWK6DRSN.js";import{readStoredWidth as l,ResizeHandle as a}from"./chunk-WNHDYTTI.js";import{WindowInsetContext as n}from"./chunk-YI4T5I5D.js";import{useIsPhone as t}from"./chunk-UGTRSRIW.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{PANEL_SURFACE as o}from"./chunk-BWJZTHZ6.js";import{useBrowserState as s}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as c}from"./chunk-PU2GJVMG.js";import{useShellStrings as d}from"./chunk-NRHG4R2Q.js";import{useContext as h,useRef as m,useState as u,useReducer as f,useMemo as p,Fragment as b,useEffect as x}from"react";import{jsxs as g,jsx as v,Fragment as w}from"react/jsx-runtime";var N=(e,r,l)=>Math.min(Math.max(e,r),l);function k({sidebar:e,sidebarTop:r,sidebarBottom:i,rail:o,railClassName:b="border-r border-line px-1 pb-2",children:x,side:k="left",storageKey:$,defaultWidth:I=256,minWidth:W=180,maxWidth:C=480,className:D="",sidebarClassName:P=("right"===k?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:R="bg-white"}){const T="right"===k,z=d().sidebar,E=t(),O=function(){const[e,r]=u(!1),l=m(null),a=m(/* @__PURE__ */new Map),[,n]=f(e=>e+1,0),t=p(()=>({report(e,r,l){const t={label:r,el:l};return a.current.set(e,t),n(),()=>{a.current.get(e)===t&&(a.current.delete(e),n())}}}),[]);return{api:t,open:e,setOpen:r,current:()=>[...a.current.values()].sort((e,r)=>e.el&&r.el&&e.el.compareDocumentPosition(r.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:l}}(),[S,G]=s(()=>($?l($,W,C):null)??N(I,W,C),N(I,W,C)),K=null!=r||null!=i,M=h(n),H=m(null),[Q,U]=u(!1),Z=M?.claim;c(()=>{if(!Z||T||E||!H.current)return;const e=Z(H.current);return e?(U(!0),()=>{U(!1),e()}):void 0},[Z,T,E]);const B=Q&&!!M?.over,F=K||B,J=M?.compact?"min-h-(--row-height-compact-bar)":"min-h-(--row-height-window-bar)",L="shrink-0 "+(M?.compact?"h-(--row-height-compact-bar)":"h-(--row-height-window-bar)"),V=null!=o&&!T,Y=B&&V,_=/* @__PURE__ */g("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:S},children:[
2
+ /* @__PURE__ */g("div",{className:`flex h-full flex-col ${F?"overflow-hidden":"overflow-y-auto"} ${P}`,children:[B&&!V&&/* @__PURE__ */v("div",{"data-window-strip":"","aria-hidden":"true",className:L}),null!=r&&/* @__PURE__ */v("div",{className:"flex shrink-0 flex-col gap-2 px-2 "+(Y?`${J} justify-center py-1`:"pb-2 "+(B?"pt-1":"pt-3")),children:r}),F?/* @__PURE__ */v("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=i&&/* @__PURE__ */v("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:i})]}),
3
+ /* @__PURE__ */v(a,{side:k,width:S,onResize:G,min:W,max:C,defaultWidth:N(I,W,C),storageKey:$,hint:z.resize})]}),A=V?/* @__PURE__ */g("div",{"data-sidebar-rail":"",className:`flex h-full shrink-0 flex-col ${b}`,children:[/* @__PURE__ */v("div",B?{"data-window-strip":"","aria-hidden":"true",className:L}:{"aria-hidden":"true",className:"h-2 shrink-0"}),o]}):null,X=
4
+ /* @__PURE__ */v("div",{className:`flex min-w-0 flex-1 flex-col ${R}${Q?" pr-1":""}`,children:x});if(!E)/* @__PURE__ */
5
+ return v("div",{ref:H,className:`flex h-full w-full overflow-hidden ${D}`,children:/* @__PURE__ */g(w,A?{children:[A,
6
+ /* @__PURE__ */g("div",{className:"flex h-full min-w-0 flex-1 overflow-hidden",children:[_,X,null]})]}:{children:[T?null:_,X,T?_:null]})});const q=/* @__PURE__ */g("div",{className:"relative flex h-full min-w-0 flex-col overflow-hidden "+(A?"flex-1":`w-full ${D}`),children:[
7
+ /* @__PURE__ */v(y,{phone:O,top:r,fallback:z.sections}),X,
8
+ /* @__PURE__ */v(j,{phone:O,bottom:i,label:z.sections,closeLabel:z.closeSections,children:e})]});return A?/* @__PURE__ */v("div",{className:`flex h-full w-full overflow-hidden ${D}`,children:/* @__PURE__ */g(w,{children:[A,q]})}):q}function y({phone:r,top:l,fallback:a}){const n=r.current();/* @__PURE__ */
9
9
  return g("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
10
10
  /* @__PURE__ */g("button",{ref:r.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":r.open,onClick:()=>r.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
11
11
  /* @__PURE__ */v("span",{className:"min-w-0 truncate",children:0===n.length?a:n.map((e,r)=>/* @__PURE__ */g(b,{children:[r>0&&" · ",e]},r))}),
@@ -1,4 +1,4 @@
1
- import{Tooltip as e}from"./chunk-AJPQJ7TC.js";import{jsxs as r,Fragment as n,jsx as i}from"react/jsx-runtime";var l=e=>!0===e||"true"===e;function o(e){e.preventDefault(),e.stopPropagation()}var t=(e,r)=>[e,r].filter(Boolean).join(" ")||void 0;function a({reason:l,id:o,block:t=!1,children:a}){/* @__PURE__ */
1
+ import{Tooltip as e}from"./chunk-CIZAUBWA.js";import{jsxs as r,Fragment as n,jsx as i}from"react/jsx-runtime";var l=e=>!0===e||"true"===e;function o(e){e.preventDefault(),e.stopPropagation()}var t=(e,r)=>[e,r].filter(Boolean).join(" ")||void 0;function a({reason:l,id:o,block:t=!1,children:a}){/* @__PURE__ */
2
2
  return r(n,{children:[
3
3
  /* @__PURE__ */i(e,{content:l,describe:!1,className:t?"relative flex w-full":"relative inline-flex",children:a}),
4
4
  /* @__PURE__ */i("span",{id:o,className:"sr-only",children:l})]})}export{a as OffWithReason,t as describedByWith,l as isAriaDisabled,o as swallowPress};
@@ -1,4 +1,4 @@
1
- import{useShellLanguage as e}from"./chunk-GKYGPCGL.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-EBODRYXS.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
1
+ import{useShellLanguage as e}from"./chunk-GKYGPCGL.js";import{RadioGroup as a}from"./chunk-32VV2J22.js";import{Select_default as n}from"./chunk-C4TG6XS4.js";import{Icon as t}from"./chunk-ISVODSRP.js";import{useShellStrings as l}from"./chunk-NRHG4R2Q.js";import{jsxs as s,jsx as i}from"react/jsx-runtime";function r(e){const a=Math.max(0,...e.map(e=>[...e].reduce((e,a)=>e+((a.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(a+3.5))/10}function m({size:a="sm",className:m=""}){const{language:o,languages:c,setLanguage:g}=e(),u=l().language;return c.length<2?null:/* @__PURE__ */s("span",{className:`inline-flex items-center gap-2 text-ink-faint ${m}`.trim(),children:[
2
2
  /* @__PURE__ */i(t,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
3
3
  /* @__PURE__ */i("span",{className:"block",style:{width:`${r(c.map(e=>e.name))}em`},children:/* @__PURE__ */i(n,{size:a,touchSize:a,"aria-label":u.title,value:o,onChange:e=>{g(e)},options:c.map(({tag:e,name:a})=>({value:e,label:a,lang:e}))})})]})}function o({description:n,className:t=""}){const{language:r,languages:m,setLanguage:o}=e(),c=l().language;return m.length<2?null:/* @__PURE__ */s("div",{className:`space-y-4 ${t}`.trim(),children:[
4
4
  /* @__PURE__ */s("div",{children:[
@@ -1,17 +1,17 @@
1
- import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-XGEN76DG.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-G3TC2GIA.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:y,onSort:x,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:G,onDragOver:R,onDrop:I,onDragEnd:$,toggleColumn:P,resetColumns:T,draggedIdx:A,dropGap:E}=t(f,S),{hasAnyPerm:L}=r(),O=i().columns,[W,Y]=c(!1),[B,F]=c(!1),[H,J]=c(!1),K=m(null),Q=k.length>0&&L(k);e(K,h(()=>{W&&Y(!1)},[W]));const U=C.reduce((e,t)=>e+t.width,0),V=C.map(e=>`${e.width}px`),M={tableLayout:"fixed",width:U,minWidth:"100%"},X=m(null),q=h(e=>{const t=X.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),Z=d(()=>g.some(e=>"_select"===e.key),[g]);
1
+ import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-XGEN76DG.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{TH_ONE_LINE as n}from"./chunk-FAPZFMS3.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-NRHG4R2Q.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:y,onSort:x,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,S]=c(!1),j=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:R,onDragOver:P,onDrop:$,onDragEnd:G,toggleColumn:I,resetColumns:A,draggedIdx:E,dropGap:F}=t(f,j),{hasAnyPerm:L}=r(),T=i().columns,[O,W]=c(!1),[Y,B]=c(!1),[H,J]=c(!1),K=m(null),M=k.length>0&&L(k);e(K,h(()=>{O&&W(!1)},[O]));const Q=C.reduce((e,t)=>e+t.width,0),U=C.map(e=>`${e.width}px`),V={tableLayout:"fixed",width:Q,minWidth:"100%"},X=m(null),Z=h(e=>{const t=X.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);
2
2
  /* @__PURE__ */
3
3
  return u("div",{className:"flex flex-col flex-1 min-h-0",children:[
4
- /* @__PURE__ */p("div",{ref:X,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
5
- /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[t]}},e.key))}),
4
+ /* @__PURE__ */p("div",{ref:X,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
5
+ /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:U[t]}},e.key))}),
6
6
  /* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=y&&o&&y.field===o,a="_select"===e.key;/* @__PURE__ */
7
- return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${A===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>G(t),onDragOver:a?void 0:e=>R(t,e),onDrop:a?void 0:e=>I(t,e),onDragEnd:a?void 0:$,style:a?void 0:{cursor:"grab"},children:[
8
- /* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&x?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&x?e=>{e.stopPropagation(),x(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===y.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),E===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&E===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
9
- /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:q,children:[
10
- /* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:M,children:[
11
- /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:V[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
7
+ return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${E===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>R(t),onDragOver:a?void 0:e=>P(t,e),onDrop:a?void 0:e=>$(t,e),onDragEnd:a?void 0:G,style:a?void 0:{cursor:"grab"},children:[
8
+ /* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&x?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&x?e=>{e.stopPropagation(),x(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===y.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),F===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&F===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
9
+ /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:Z,children:[
10
+ /* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
11
+ /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:U[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
12
12
  /* @__PURE__ */p("span",{children:b}),
13
- /* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:K,children:[w&&Z&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?O.hideSelection:O.showSelection,children:D?O.selectDone:O.select}),
14
- /* @__PURE__ */p("button",{onClick:T,className:"text-2xs text-ink-faintest hover:text-gray-600",children:O.reset}),
15
- /* @__PURE__ */p("button",{onClick:()=>Y(!W),className:"text-gray-400 hover:text-gray-600",title:O.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),W&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
16
- /* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:O.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
17
- /* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>P(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),Q&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{F(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};y&&(r.sort=y);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),J(!0),setTimeout(()=>J(!1),2e3)}catch{}F(!1)},disabled:B,className:"text-2xs w-full text-center py-1 rounded "+(H?"text-green-600":"text-ink-faint hover:text-blue-600"),children:B?"...":H?O.savedDefault:O.saveDefault})})]})]})]})]})}export{f as ResizableTable};
13
+ /* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:K,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>S(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?T.hideSelection:T.showSelection,children:D?T.selectDone:T.select}),
14
+ /* @__PURE__ */p("button",{onClick:A,className:"text-2xs text-ink-faintest hover:text-gray-600",children:T.reset}),
15
+ /* @__PURE__ */p("button",{onClick:()=>W(!O),className:"text-gray-400 hover:text-gray-600",title:T.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),O&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
16
+ /* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:T.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
17
+ /* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>I(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),M&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{B(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};y&&(r.sort=y);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),J(!0),setTimeout(()=>J(!1),2e3)}catch{}B(!1)},disabled:Y,className:"text-2xs w-full text-center py-1 rounded "+(H?"text-green-600":"text-ink-faint hover:text-blue-600"),children:Y?"...":H?T.savedDefault:T.saveDefault})})]})]})]})]})}export{f as ResizableTable};
@@ -1,4 +1,4 @@
1
- import{Markdown as e}from"./chunk-IZ6D4KGR.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),R=N.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!R||e.title.toLowerCase().includes(R)||e.body.toLowerCase().includes(R)||e.category_label.toLowerCase().includes(R),L=n(()=>M.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[M,R]),A=n(()=>L.flatMap(e=>e.docs),[L]),E=(w?A.find(e=>e.slug===w):void 0)??A[0]??null,Y=e=>!!R||(C[e]??e===E?.category);/* @__PURE__ */
1
+ import{Markdown as e}from"./chunk-3AVXNZY5.js";import{PLACEHOLDER_INK as t}from"./chunk-AYZY3YNC.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{LoadingSpinner as r}from"./chunk-R2VKEMZH.js";import{useShellStrings as s}from"./chunk-NRHG4R2Q.js";import{useState as a,useMemo as n}from"react";import{jsxs as i,jsx as o,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */o(l,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:f,emptyMessage:b}){const y=s(),[N,v]=a(""),[w,k]=a(null),[C,j]=a({}),M=N.trim().toLowerCase(),R=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let l=e.get(t.category);l||(l={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,l)),l.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,l)=>(t.get(e.key)??1/0)-(t.get(l.key)??1/0))},[h,p]),_=e=>!M||e.title.toLowerCase().includes(M)||e.body.toLowerCase().includes(M)||e.category_label.toLowerCase().includes(M),A=n(()=>R.map(e=>({...e,docs:e.docs.filter(_)})).filter(e=>e.docs.length>0),[R,M]),L=n(()=>A.flatMap(e=>e.docs),[A]),Y=(w?L.find(e=>e.slug===w):void 0)??L[0]??null,E=e=>!!M||(C[e]??e===Y?.category);/* @__PURE__ */
2
2
  return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
3
3
  /* @__PURE__ */i("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
4
4
  /* @__PURE__ */i("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
@@ -6,16 +6,16 @@ return i("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
6
6
  /* @__PURE__ */o("div",{className:"px-3 py-2 border-b border-line-subtle shrink-0",children:/* @__PURE__ */i("div",{className:"relative",children:[
7
7
  /* @__PURE__ */o(l,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
8
8
  /* @__PURE__ */o("input",{type:"text",value:N,onChange:e=>v(e.target.value),placeholder:y.help.searchPlaceholder,className:"w-full rounded-md border border-line-strong bg-surface h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
9
- /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===L.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:R?y.help.noResults:b??y.help.empty}):L.map(e=>{const t=Y(e.key);/* @__PURE__ */
9
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"py-6",label:y.help.loading}):0===A.length?/* @__PURE__ */o("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:M?y.help.noResults:b??y.help.empty}):A.map(e=>{const t=E(e.key);/* @__PURE__ */
10
10
  return i("div",{className:"py-0.5",children:[
11
- /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!Y(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
11
+ /* @__PURE__ */i("button",{type:"button",onClick:()=>{return t=e.key,j(e=>({...e,[t]:!E(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-ink-faintest hover:text-gray-600",children:[
12
12
  /* @__PURE__ */o(d,{open:t}),
13
- /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=E?.slug===e.slug;/* @__PURE__ */
13
+ /* @__PURE__ */o("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=Y?.slug===e.slug;/* @__PURE__ */
14
14
  return i("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
15
15
  /* @__PURE__ */o("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */o("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:y.help.draft})]},e.slug)})]},e.key)})})]}),
16
- /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:E?/* @__PURE__ */i(c,{children:[
16
+ /* @__PURE__ */o("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:Y?/* @__PURE__ */i(c,{children:[
17
17
  /* @__PURE__ */i("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
18
18
  /* @__PURE__ */i("div",{className:"min-w-0",children:[
19
- /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:E.title}),
20
- /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[E.category_label,!1===E.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(E),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
- /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(E):E.body?/* @__PURE__ */o(e,{children:E.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
19
+ /* @__PURE__ */o("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:Y.title}),
20
+ /* @__PURE__ */i("p",{className:"text-xs text-gray-500 mt-0.5",children:[Y.category_label,!1===Y.is_published&&/* @__PURE__ */i("span",{className:"ml-2 text-amber-600",children:["· ",y.help.draft]})]})]}),u&&x&&/* @__PURE__ */o("button",{type:"button",onClick:()=>x(Y),className:"shrink-0 text-sm text-blue-600 hover:underline",children:y.help.edit})]}),
21
+ /* @__PURE__ */o("div",{className:"flex-1 overflow-auto px-5 py-4",children:f?f(Y):Y.body?/* @__PURE__ */o(e,{children:Y.body}):/* @__PURE__ */o("p",{className:"text-sm text-gray-500 italic",children:y.help.noBody})})]}):/* @__PURE__ */o("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:m?/* @__PURE__ */o(r,{size:"sm",padding:"",label:y.help.loading}):/* @__PURE__ */o("p",{className:"text-sm text-ink-faint",children:y.help.pickArticle})})})]})}export{h as HelpCenter};
@@ -1,4 +1,4 @@
1
- import{CloseGlyph as e}from"./chunk-MPC3CHAO.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-TNGIXSTM.js";import{IconButton_default as a}from"./chunk-MYH5H43C.js";import{Button_default as s}from"./chunk-MEP6CZJ3.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-NRHG4R2Q.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
1
+ import{CloseGlyph as e}from"./chunk-TAIH2VIW.js";import{humanSize as t,useFileIntake as n,FileIntakeAlert as r}from"./chunk-TNGIXSTM.js";import{IconButton_default as a}from"./chunk-APFDZ2HG.js";import{Button_default as s}from"./chunk-A4ROXNUF.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useShellStrings as c}from"./chunk-NRHG4R2Q.js";import{useRef as l,useEffect as o}from"react";import{jsx as d,jsxs as u}from"react/jsx-runtime";function m({className:e="h-4 w-4"}){/* @__PURE__ */
2
2
  return d(i,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function p({className:e="h-4 w-4"}){/* @__PURE__ */
3
3
  return d(i,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function h({intake:e,dropLabel:t,className:n="",children:r}){const a=c().files;/* @__PURE__ */
4
4
  return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,children:[r,
@@ -6,7 +6,7 @@ return u("div",{...e.zoneProps,...e.pasteProps,className:`relative ${n}`,childre
6
6
  return u("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-line bg-surface-sunken py-1 pl-2 pr-1 text-xs text-ink",children:[c?/* @__PURE__ */d("img",{src:c,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */d("span",{className:"text-gray-400",children:/* @__PURE__ */d(p,{})}),
7
7
  /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:n.name,children:n.name}),
8
8
  /* @__PURE__ */d("span",{className:"shrink-0 tabular-nums text-gray-400",children:t(n.size,i)}),r&&/* @__PURE__ */d("button",{type:"button",disabled:a,onClick:()=>r(s),"aria-label":i.remove(n.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */d(e,{className:"h-3.5 w-3.5"})})]},`${n.name}-${n.size}-${s}`)})})}function b({onClick:e,count:t=0,variant:n="button",label:r,disabled:i=!1}){const l=c().files,o=r??l.attach,p=t>0?`${o} (${t})`:o;return"icon"===n?/* @__PURE__ */u("span",{className:"relative inline-flex",children:[
9
- /* @__PURE__ */d(a,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),t>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:t})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:j,className:N="",children:v}){const L=n({accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),R=l([]);return o(()=>{j&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,j(L.rejections))},[L.rejections,j]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:N,children:[v,
9
+ /* @__PURE__ */d(a,{"aria-label":p,onClick:e,disabled:i,size:"sm",children:/* @__PURE__ */d(m,{})}),t>0&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-accent-fill px-1 text-center text-2xs font-semibold leading-4 text-on-accent",children:t})]}):/* @__PURE__ */d(s,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:i,leftIcon:/* @__PURE__ */d(m,{}),children:p})}function x({files:e,onChange:t,accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m=!1,dropLabel:p,attachLabel:x,trigger:g="button",actions:k,onReject:N,className:j="",children:v}){const L=n({accept:a,maxSizeBytes:s,maxFiles:i,acceptHint:c,disabled:m,multiple:!0,currentCount:e.length,onAccept:n=>t([...e,...n])}),R=l([]);return o(()=>{N&&L.rejections.length>0&&L.rejections!==R.current&&(R.current=L.rejections,N(L.rejections))},[L.rejections,N]),/* @__PURE__ */u(h,{intake:L,dropLabel:p,className:j,children:[v,
10
10
  /* @__PURE__ */d(f,{files:e,disabled:m,onRemove:n=>{L.clearRejections(),t(e.filter((e,t)=>t!==n))},className:"mt-2"}),
11
11
  /* @__PURE__ */u("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
12
12
  /* @__PURE__ */d(b,{onClick:L.open,count:e.length,variant:g,label:x,disabled:m}),k]}),
@@ -0,0 +1,14 @@
1
+ import{SearchableSelect as e}from"./chunk-WR3SULZW.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-C4TG6XS4.js";import{isSafeLinkHref as t}from"./chunk-Z5TE3MEG.js";import{Input_default as r}from"./chunk-D7MRZZVV.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-A4ROXNUF.js";import{Icon as o}from"./chunk-ISVODSRP.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-NRHG4R2Q.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O="",tidyAddress:j,addressAddon:E}=t,R=void 0!==t.onApply,$=u().link,A=y.isSafe??k,T=d(),z=c(null),D=c(null),[S,U]=p({url:n}),W=R?S.url:n,[Z,M]=p(!1),[P,V]=p(null),[Y,G]=p(null),[K,L]=p(!1),Q=c(null),X=c(()=>{});X.current=R?t.onCancel:()=>{},m(()=>{if(R)return s(e=>{const a=z.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(X.current(),!0)},()=>z.current)},[R]),m(()=>{if(!R)return;const e=D.current;e?(e.focus(),e.select()):z.current?.querySelector("button, input")?.focus()},[]);const B=o??[{value:b,label:$.address,target:{type:"text"}}],H=P&&P.against===W?P.kind:y.kindOf(W),q=B.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===H),I=q.find(e=>"text"===e.target.type),J=q.find(e=>e.value===H)??I??q[0];if(!J)return null;const _="text"!==J.target.type,ee=_?y.targetOf(W):W,ae=h(J.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:$.unavailable(e)}),re="select"===J.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(W):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=Y&&Y.against===W?Y.text:W,se=_?W:j?j(oe.trim()).trim():oe.trim(),ue=R&&j?se:oe,de=!_&&""!==ue.trim()&&!A(ue),ce=de&&(!R||Z);_&&K&&L(!1);const pe=(e,a)=>{R?U({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{V(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{M(!1);const a=e.trim();a?A(e)?(G({text:e,against:a}),me(a)):G({text:e,against:W}):(G({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===D.current||Q.current?.contains(a)))return;if(L(!1),R||!j||C)return;const l=j(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!R||!se)return;if(!_&&de)return void M(!0);const e=_&&S.url===se?S.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
2
+ return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
3
+ return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===J.target.type)ke=/* @__PURE__ */f(r,{ref:D,id:`${T}-address`,size:"sm",type:"text",invalid:ce,"aria-label":$.address,"aria-describedby":ce?`${T}-why`:void 0,placeholder:F??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>L(!0),onBlur:ge,onKeyDown:j&&!R?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===J.target.type?J.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):J.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:J.target.placeholder},...be(e,ee)];ke=xe(J.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe($.linkType,J.value,q.map(e=>({value:e.value,label:e.label})),e=>{G(null),M(!1);const a=q.find(a=>a.value===e);if(!a||"text"===a.target.type)return void V({kind:e,against:W});const l=h(a.target)[0];V({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,E&&K&&!C&&"text"===J.target.type&&/* @__PURE__ */f("div",{ref:Q,onBlur:ge,children:E({url:oe,onChange:ve})}),re&&xe($.filter,ne?.param??"",[{value:"",label:$.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe($.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${T}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),J.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:J.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:$.filterHint})]});if(!R)/* @__PURE__ */
4
+ return f("div",{ref:z,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
5
+ return v("div",{ref:z,role:"dialog","aria-label":N??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${T}-address`,className:a({inline:!0}),children:$.title}),ye,
6
+ /* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:$.remove}):null,
7
+ /* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
8
+ /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>X.current(),children:$.cancel}),
9
+ /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
10
+ return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
11
+ /* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
12
+ /* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
13
+ /* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
14
+ /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),O()},onRemove:t?()=>{i(""),O()}:void 0,onCancel:O})})]})}export{y as LinkPicker,w as TextLinkField};
@@ -1,4 +1,4 @@
1
- import{InputNumber_default as e,stepRounding as a}from"./chunk-I7WAOKU2.js";import{IconButton_default as r}from"./chunk-MYH5H43C.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-AJPQJ7TC.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */n(i,{name:"padding-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"padding-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"padding-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"padding-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"padding-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"padding-left-right","aria-hidden":"true",className:l})},crop:{top:/* @__PURE__ */n(i,{name:"crop-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"crop-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"crop-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"crop-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"crop-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"crop-left-right","aria-hidden":"true",className:l})}},m=/* @__PURE__ */new Set(["ArrowUp","ArrowDown","PageUp","PageDown"]),p=e=>{m.has(e.key)&&(e.preventDefault(),e.stopPropagation())},c=e=>e.stopPropagation(),h=/* @__PURE__ */n(i,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var u=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function g(e,a){const r=r=>u(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function f({label:r,value:i,onChange:t,each:l,placeholder:m,words:h,min:g=0,max:f=200,step:b=4,readOnly:v,glyphs:N="padding",units:y,sideDisplay:w}){const x=s[N],C=(e,a)=>{const r={...i};for(const i of e)r[i]=a;t(r)},j=(r,t,o)=>{const d=r.map(e=>w?.[e]?.word),l=d[0]&&d.every(e=>e===d[0])?d[0]:void 0;if(l)/* @__PURE__ */
1
+ import{InputNumber_default as e,stepRounding as a}from"./chunk-TEYG2W7A.js";import{IconButton_default as r}from"./chunk-APFDZ2HG.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{Tooltip as t}from"./chunk-CIZAUBWA.js";import{jsx as n,jsxs as o,Fragment as d}from"react/jsx-runtime";var l="h-3.5 w-3.5",s={padding:{top:/* @__PURE__ */n(i,{name:"padding-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"padding-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"padding-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"padding-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"padding-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"padding-left-right","aria-hidden":"true",className:l})},crop:{top:/* @__PURE__ */n(i,{name:"crop-top","aria-hidden":"true",className:l}),right:/* @__PURE__ */n(i,{name:"crop-right","aria-hidden":"true",className:l}),bottom:/* @__PURE__ */n(i,{name:"crop-bottom","aria-hidden":"true",className:l}),left:/* @__PURE__ */n(i,{name:"crop-left","aria-hidden":"true",className:l}),vertical:/* @__PURE__ */n(i,{name:"crop-y","aria-hidden":"true",className:l}),horizontal:/* @__PURE__ */n(i,{name:"crop-left-right","aria-hidden":"true",className:l})}},m=/* @__PURE__ */new Set(["ArrowUp","ArrowDown","PageUp","PageDown"]),p=e=>{m.has(e.key)&&(e.preventDefault(),e.stopPropagation())},c=e=>e.stopPropagation(),h=/* @__PURE__ */n(i,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"});var u=(e,a,r)=>null===e[r]?a[r]:String(e[r]);function g(e,a){const r=r=>u(e,a,r);return r("left")!==r("right")||r("top")!==r("bottom")}function f({label:r,value:i,onChange:t,each:l,placeholder:m,words:h,min:g=0,max:f=200,step:b=4,readOnly:v,glyphs:N="padding",units:y,sideDisplay:w}){const x=s[N],C=(e,a)=>{const r={...i};for(const i of e)r[i]=a;t(r)},j=(r,t,o)=>{const d=r.map(e=>w?.[e]?.word),l=d[0]&&d.every(e=>e===d[0])?d[0]:void 0;if(l)/* @__PURE__ */
2
2
  return n("div",{"data-side":r.join("-"),className:"min-w-0",onKeyDownCapture:p,onWheelCapture:c,children:/* @__PURE__ */n(e,{value:null,onChange:e=>C(r,e),min:g,max:f,step:b,snap:!0,...a(b),readOnly:v,placeholder:l,display:()=>l,reportWhileTyping:!1,prefix:o,"aria-label":t})});const s=d.some(Boolean)?"mixed":function(e,a){const r=a.map(a=>e[a]);return r.every(e=>e===r[0])?r[0]:"mixed"}(i,r),N=r.map(e=>u(i,m,e)),x="mixed"!==s&&N.every(e=>e===N[0])?N[0]:"–";/* @__PURE__ */
3
3
  return n("div",{"data-side":r.join("-"),className:"min-w-0",children:/* @__PURE__ */n(e,{value:"mixed"===s?null:s,onChange:e=>C(r,e),min:g,max:f,step:b,snap:!0,...a(b),steppers:"compact",readOnly:v,placeholder:x,prefix:o,suffix:h.unit,units:y,"aria-label":t})})};/* @__PURE__ */
4
4
  return n("div",{role:"group","aria-label":r,"data-sides":l?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */o(d,l?{children:[j(["left"],h.sides.left,x.left),j(["top"],h.sides.top,x.top),j(["right"],h.sides.right,x.right),j(["bottom"],h.sides.bottom,x.bottom)]}:{children:[j(["left","right"],h.horizontal,x.horizontal),j(["top","bottom"],h.vertical,x.vertical)]})})}function b({each:e,onChange:a,label:i,disabled:o}){/* @__PURE__ */
@@ -1,2 +1,2 @@
1
- import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-IVEM2BPC.js";import{Tooltip as o}from"./chunk-AJPQJ7TC.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
1
+ import{swallowPress as e,describedByWith as r,OffWithReason as i}from"./chunk-TSZPGDU3.js";import{Tooltip as o}from"./chunk-CIZAUBWA.js";import{useId as a,useRef as n}from"react";import{jsx as t}from"react/jsx-runtime";var l={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function s({label:s,value:d,points:c,onChange:u,disabled:b=!1,disabledReason:v,id:f,className:g=""}){const h=a(),m=n([]),p=c.findIndex(e=>e.value===d),x=c.findIndex(e=>!b&&!0!==e.disabled),w=p>=0?p:Math.max(0,x);/* @__PURE__ */
2
2
  return t("div",{id:f,role:"radiogroup","aria-label":s,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-line bg-gray-200 ${g}`.trim(),children:c.map((a,n)=>{const s=d===a.value,f=b||!0===a.disabled,g=f&&(!0===a.disabled&&a.title||(b?v:void 0))||void 0,p=`${h}-${n}`,x=/* @__PURE__ */t("button",{type:"button",role:"radio","aria-checked":s,"aria-label":a.label,"aria-disabled":f||void 0,"aria-describedby":r(void 0,g?p:void 0),ref:e=>{m.current[n]=e},tabIndex:n===w?0:-1,onKeyDown:e=>((e,r)=>{const i=l[r.key];if(!i)return;r.preventDefault();const o=Math.floor(e/3)+i[0],a=e%3+i[1];if(o<0||a<0||a>=3)return;const n=3*o+a;if(n>=c.length)return;m.current[n]?.focus();const t=c[n];b||!0===t.disabled||t.value===d||u(t.value)})(n,e),onClick:f?e:()=>u(a.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(s?"bg-accent-tint hover:bg-blue-100":"bg-surface hover:bg-row-hover"),children:a.icon?/* @__PURE__ */t("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(s?"text-blue-700":"text-ink-faint group-hover:text-gray-700"),children:a.icon}):/* @__PURE__ */t("span",{"data-dot":"","aria-hidden":"true",className:s?"size-3 rounded-sm bg-accent-fill":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},a.value);return g?/* @__PURE__ */t(i,{reason:g,id:p,block:!0,children:x},a.value):/* @__PURE__ */t(o,{content:a.title??a.label,className:"relative flex",children:x},a.value)})})}export{s as AlignmentGrid};
@@ -1,11 +1,11 @@
1
- import{MediaUploadField as e}from"./chunk-Y6FULJWJ.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-MEP6CZJ3.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const j=i(null),[L,R]=l(null),[U,C]=l(""),[H,F]=l(""),[I,A]=l(!1),[E,G]=l(!1),J=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),O=t().brandAsset,P=U||d||g||"",B=L?null:d?o:h,S=L?null:d?m:u;s(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const $=()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null)};/* @__PURE__ */
2
- return n("section",{"aria-label":O.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
1
+ import{MediaUploadField as e}from"./chunk-KJ4CHRRC.js";import{BrandMark as r}from"./chunk-MI67DI3H.js";import{Button_default as a}from"./chunk-A4ROXNUF.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as i,useState as l,useEffect as s}from"react";import{jsxs as n,jsx as c}from"react/jsx-runtime";function d({committedUrl:d,committedHasAlpha:o=null,committedIsLight:m=null,fallbackUrl:g,fallbackHasAlpha:h=null,fallbackIsLight:u=null,subjectName:b,assetName:p,onSave:x,onRemove:f,accept:v="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:y="PNG · ICO · SVG · JPG · WEBP",maxBytes:N=5242880,previews:w=[],disabled:k=!1}){const R=i(null),[j,L]=l(null),[U,C]=l(""),[H,A]=l(""),[F,I]=l(!1),[O,G]=l(!1),B=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(p),E=t().brandAsset,P=U||d||g||"",S=j?null:d?o:h,$=j?null:d?m:u;s(()=>()=>{R.current&&URL.revokeObjectURL(R.current)},[]);const z=()=>{R.current&&(URL.revokeObjectURL(R.current),R.current=null)};/* @__PURE__ */
2
+ return n("section",{"aria-label":E.region(p,b),className:"grid gap-4 lg:grid-cols-2",children:[
3
3
  /* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
4
- /* @__PURE__ */c(e,{value:P,onChange:()=>{},onFile:e=>{if(k)return;$();const r=URL.createObjectURL(e);j.current=r,R(e),C(r),F("")},label:p,hint:H||O.usedFor(b),error:H||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:I||E,disabled:k}),
4
+ /* @__PURE__ */c(e,{value:P,onChange:()=>{},onFile:e=>{if(k)return;z();const r=URL.createObjectURL(e);R.current=r,L(e),C(r),A("")},label:p,hint:H||E.usedFor(b),error:H||void 0,accept:v,acceptHint:y,maxSizeBytes:N,fit:"contain",height:180,allowRemove:!1,busy:F||O,disabled:k}),
5
5
  /* @__PURE__ */n("div",{className:"mt-3 flex flex-wrap gap-2",children:[
6
- /* @__PURE__ */c(a,{onClick:async()=>{if(L&&!k&&!I){A(!0),F("");try{await x(L),$(),R(null),C("")}catch(e){F(e instanceof Error?e.message:O.saveFailed(J,p))}finally{A(!1)}}},disabled:!L||k,loading:I,children:O.save(J,p)}),(L||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!E){if(L)return $(),R(null),C(""),void F("");if(d){G(!0),F("");try{await f()}catch(e){F(e instanceof Error?e.message:O.removeFailed(J,p))}finally{G(!1)}}}},disabled:k,loading:E,children:L?O.discard:O.remove(J,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":O.previews(p),children:[
7
- /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:O.preview}),
8
- /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:P,alt:O.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:B,isLight:S,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
6
+ /* @__PURE__ */c(a,{onClick:async()=>{if(j&&!k&&!F){I(!0),A("");try{await x(j),z(),L(null),C("")}catch(e){A(e instanceof Error?e.message:E.saveFailed(B,p))}finally{I(!1)}}},disabled:!j||k,loading:F,children:E.save(B,p)}),(j||d)&&/* @__PURE__ */c(a,{variant:"ghost-danger",onClick:async()=>{if(!k&&!O){if(j)return z(),L(null),C(""),void A("");if(d){G(!0),A("");try{await f()}catch(e){A(e instanceof Error?e.message:E.removeFailed(B,p))}finally{G(!1)}}}},disabled:k,loading:O,children:j?E.discard:E.remove(B,p)})]})]}),w.length>0&&/* @__PURE__ */n("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":E.previews(p),children:[
7
+ /* @__PURE__ */c("h3",{className:"text-sm font-semibold text-gray-900",children:E.preview}),
8
+ /* @__PURE__ */c("div",{className:"mt-3 grid gap-3",children:w.map(e=>{const a=/* @__PURE__ */c(r,{src:P,alt:E.alt(b,p),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:$,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
9
9
  return n("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
10
10
  /* @__PURE__ */c("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */n("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
11
11
  /* @__PURE__ */n("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[a,
@@ -1,2 +1,2 @@
1
- import{Tooltip as e}from"./chunk-AJPQJ7TC.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,N=t().resizeHandle,k=o(null),M=o({onResize:d,min:f,max:p,side:m});M.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const C=i(()=>{k.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>C,[C]);const R=e=>{k.current&&(e.currentTarget.hasPointerCapture?.(k.current.pointer)&&e.currentTarget.releasePointerCapture(k.current.pointer),C())},D="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",I="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",T=P?`absolute inset-x-0 ${D} z-10 flex h-2`:`absolute inset-y-0 ${D} z-10 flex w-2`;/* @__PURE__ */
2
- return s(e,{content:z??N.hint,side:I,delay:600,className:`${T} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??N.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),k.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=k.current;if(!r)return;if(0===e.buttons)return void C();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=M.current;o(l(r.width,t,s,n,i))},onPointerUp:R,onPointerCancel:R,onLostPointerCapture:()=>{k.current&&C()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${D} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${D} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
1
+ import{Tooltip as e}from"./chunk-CIZAUBWA.js";import{useBrowserLayoutEffect as r}from"./chunk-PU2GJVMG.js";import{useShellStrings as t}from"./chunk-NRHG4R2Q.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,N=t().resizeHandle,k=o(null),M=o({onResize:d,min:f,max:p,side:m});M.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const C=i(()=>{k.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>C,[C]);const I=e=>{k.current&&(e.currentTarget.hasPointerCapture?.(k.current.pointer)&&e.currentTarget.releasePointerCapture(k.current.pointer),C())},R="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",A="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",D=P?`absolute inset-x-0 ${R} z-10 flex h-2`:`absolute inset-y-0 ${R} z-10 flex w-2`;/* @__PURE__ */
2
+ return s(e,{content:z??N.hint,side:A,delay:600,className:`${D} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??N.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),k.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=k.current;if(!r)return;if(0===e.buttons)return void C();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=M.current;o(l(r.width,t,s,n,i))},onPointerUp:I,onPointerCancel:I,onLostPointerCapture:()=>{k.current&&C()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${R} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${R} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
@@ -0,0 +1,13 @@
1
+ import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-K5YT5PMJ.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-D7MRZZVV.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-A4ROXNUF.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-CIZAUBWA.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{createShellPortal as g}from"./chunk-5QRHQCRG.js";import{Z_LAYERS as v}from"./chunk-62LW225J.js";import{useDropdownPosition as w,MENU_MAX_HEIGHT as y}from"./chunk-TAHHZGRH.js";import{useBrowserLayoutEffect as x}from"./chunk-PU2GJVMG.js";import{registerModalEscapeInterceptor as k}from"./chunk-TWVUQUUD.js";import{GLASS_DIVIDER as j,glassStyle as N}from"./chunk-5FYDNH4Y.js";import{useShellStrings as $}from"./chunk-NRHG4R2Q.js";import{useState as D,useId as C,useRef as R,useMemo as S,useEffect as M}from"react";import{jsxs as W,jsx as A}from"react/jsx-runtime";function F(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var E=["right-2","right-8","right-16"],H=[8,32,64];function T(T){const{options:z,placeholder:O,emptyOptionLabel:L,className:U="",disabled:G,id:I,filter:V=!1,allowFreeText:Y=!1,freeTextOption:Z,onSearchChange:B,loading:P=!1,error:Q,onRetry:J,rightAdornment:K,endAction:X,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=T,re=!0===T.multiple,le=T.multiple?T.value:T.value?[T.value]:[],oe=T.multiple?"":T.value,ie=e=>{T.multiple?T.onChange(e):T.onChange(e[0]??"")},ae=le.length>0,se=V&&ae&&!G,ce=re||V,ue=null!=Z,de=Y||ue,[he,pe]=D(!1),[me,fe]=D(-1),be=C(),ge=I??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=D(""),ke=$(),je=L??ke.select.none,Ne=e=>{xe(e),fe(-1),B?.(e)},$e=R(null),De=R(null),Ce=R(null),Re=R(null),Se=R(he);Se.current=he;const Me=R(!1),We=e=>{Se.current&&(Se.current=!1,e&&Y&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),Ne(""))},Ae=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?Ne(""):fe(t));ie([e.value]),We(!1)}},[Fe,Ee]=D(null);x(()=>{if(!K||he)return void Ee(null);const e=Re.current?.offsetWidth??0;Ee(e?e+H[Ge]+6:null)});const He=w(De,he,ce?{popupRef:Ce}:{matchTriggerWidth:!0}),Te=S(()=>t(z),[z]),ze=le.join("\0"),Oe=S(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Te)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[Te,ze,de]),Le=Oe.join(", "),Ue=_&&ae&&!G,Ge=(Ue?1:0)+(X?1:0),[Ie,Ve]=D(null),Ye=R(null),Ze=R(""),Be=R(()=>{});Be.current=()=>{const e=De.current,t=Ye.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Oe.join("\0")}`;if(o===Ze.current)return;Ze.current=o;let i=null;r>0&&Oe.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=F(Oe,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Ve(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},x(()=>{Be.current()}),M(()=>{const e=De.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Be.current());return t.observe(e),()=>t.disconnect()},[re]);const Pe=Oe.length,Qe=!re||!Ie||Ie.shown>=Pe?Le:0===Ie.shown?ke.select.selectedCount(Pe):`${Oe.slice(0,Ie.shown).join(", ")} +${Pe-Ie.shown}`,Je=re&&null!==Ie&&(Ie.shown<Pe||Ie.cut),Ke=he&&ae&&ce;M(()=>{if(!he)return;const e=e=>{const t=e.target;$e.current?.contains(t)||Ce.current?.contains(t)||We(!0)};document.addEventListener("mousedown",e);const t=b(()=>We(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,Y,ye,ze,T.onChange]),M(()=>{if(he)return k(e=>!("Escape"!==e.key||!Se.current)&&(We(!1),De.current?.blur(),!0),()=>Ce.current)},[he]);const Xe=S(()=>{const e=/* @__PURE__ */new Set;return n(z,t=>!e.has(t.value)&&(e.add(t.value),!0))},[z]),qe=S(()=>{if(B)return Xe;const e=ye.trim().toLowerCase();return e?n(Xe,t=>r(t,e)):Xe},[Xe,ye,B]),_e=S(()=>t(qe),[qe]),et=ye.trim(),tt=S(()=>ue&&et?Te.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,Te,ze]),nt=S(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
2
+ return W("div",{ref:$e,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&($e.current?.contains(t)||Ce.current?.contains(t))||Me.current||document.activeElement!==De.current&&We(!0)},children:[(rt=/* @__PURE__ */A("input",{id:ge,ref:De,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Qe,onChange:e=>{Ne(e.target.value),pe(!0)},onFocus:()=>{G||(Ne(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(G)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Ae(nt[me],me):1!==_e.length||_e[0].disabled?Y&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),Ne("")):(ie([et]),We(!1),De.current?.blur())):Ae(_e[0],0)):"Escape"===t.key?(We(!1),De.current?.blur()):"Tab"===t.key&&We(!0)},placeholder:Ke?Qe:O||je,className:`${se?u:d} ${U} ${a[Ge]}${G?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Ke?" rosh-field-shows-choice":""}`,style:Fe?{paddingRight:Fe}:void 0,disabled:G}),re?/* @__PURE__ */A(f,{content:!he&&Je?Le:null,className:"block",children:rt}):rt),re&&
3
+ /* @__PURE__ */A("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */A("span",{ref:Ye,className:"whitespace-pre"})}),Ge>0&&
4
+ /* @__PURE__ */W(s,{children:[Ue&&
5
+ /* @__PURE__ */A("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */A(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */A(p,{name:"close"}),onClick:()=>{ie([]),We(!1)}}})}),X&&/* @__PURE__ */A("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */A(c,{action:X})})]}),K&&!he&&/* @__PURE__ */A("div",{ref:Re,className:`absolute top-1/2 -translate-y-1/2 ${E[Ge]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:K}),he&&g(
6
+ /* @__PURE__ */W("div",{ref:Ce,onMouseDownCapture:()=>{Me.current=!0,setTimeout(()=>{Me.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:v.popup,left:He?.left,right:He?.right,top:He?.top,bottom:He?.bottom,minWidth:He?.minWidth,width:He?.width,...ce&&{maxWidth:He?.maxWidth},visibility:He?void 0:"hidden",...N()},children:[re&&ae&&_&&!G&&
7
+ /* @__PURE__ */A("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${j}`,children:ke.select.clearAll}),P?
8
+ /* @__PURE__ */A(m,{size:"sm",padding:"py-2",label:ke.search.searching}):Q?/* @__PURE__ */W("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
9
+ /* @__PURE__ */A("span",{className:"min-w-0 flex-1",children:Q}),J&&/* @__PURE__ */A(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:J,className:"shrink-0",children:ke.list.retry})]}):null,
10
+ /* @__PURE__ */W("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:He?.maxHeight??y},children:[0===nt.length?P||Q?null:/* @__PURE__ */A("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
11
+ return W("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Ae(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */A(o,{selected:n}),
12
+ /* @__PURE__ */A("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */A(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&Z&&
13
+ /* @__PURE__ */A("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Ae(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${j}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */A("span",{className:"min-w-0 flex-1 truncate",children:Z(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{T as SearchableSelect,F as fitChoice};
@@ -0,0 +1,2 @@
1
+ import{createShellPortal as t}from"./chunk-5QRHQCRG.js";import{Z_LAYERS as e}from"./chunk-62LW225J.js";import{VIEWPORT_MARGIN as r,placeMenu as n,followRect as o}from"./chunk-TAHHZGRH.js";import{useHydrated as i}from"./chunk-KEFNQEXZ.js";import{useBrowserLayoutEffect as s}from"./chunk-PU2GJVMG.js";import{solidSurfaceStyle as c}from"./chunk-5FYDNH4Y.js";import{useRef as u,useCallback as a,useEffect as d}from"react";import{jsx as f}from"react/jsx-runtime";var l=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function p({anchor:p,bounds:m,side:h="top",align:b="start","aria-label":g,children:x,className:j=""}){const w=i(),H=u(null),k=u(p);k.current=p;const v=u(m);v.current=m;const R=a(()=>{const t=H.current,e=k.current();if(!t||!e)return;const o=(v.current??l)(),i=t.style;i.maxWidth=`${Math.max(0,o.right-o.left-2*r)}px`;const s=n({trigger:e,menu:{width:t.offsetWidth,height:t.offsetHeight},bounds:o,align:b,side:h});i.left=`${s.left}px`,i.top=`${s.top}px`,t.dataset.side=s.side},[b,h]);s(()=>{w&&R()}),d(()=>{if(!w)return;const t=o(()=>k.current(),R),e=H.current;if(!e||"undefined"==typeof ResizeObserver)return t;const r=new ResizeObserver(()=>R());return r.observe(e),()=>{t(),r.disconnect()}},[w,R]);return w&&p()?t(
2
+ /* @__PURE__ */f("div",{ref:H,role:"group","aria-label":g,"data-floating-bar":"",onMouseDown:t=>{const e=t.target;e?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||t.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${j}`.trim(),style:{...c(),position:"fixed",left:0,top:0,zIndex:e.popup},children:x}),document.body):null}export{p as FloatingBar};
@@ -1,4 +1,4 @@
1
- import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-EBODRYXS.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-OSMRYND3.js";import{Input_default as c}from"./chunk-W6REY3SV.js";import{Button_default as s}from"./chunk-MEP6CZJ3.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
1
+ import{Card as e}from"./chunk-RKSCB5BJ.js";import{Select_default as l}from"./chunk-C4TG6XS4.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Banner as i}from"./chunk-OSMRYND3.js";import{Input_default as c}from"./chunk-D7MRZZVV.js";import{Button_default as s}from"./chunk-A4ROXNUF.js";import{useState as d}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";var h=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function m(){const[m,o]=d(!0),[p,u]=d("us"),y=h.reduce((e,l)=>e+l.qty*l.price,0),g=y+9;/* @__PURE__ */
2
2
  return n("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */t("div",{className:"mx-auto max-w-5xl space-y-5",children:[
3
3
  /* @__PURE__ */n("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
4
4
  /* @__PURE__ */t("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[