efficient-shell 10.17.0 → 10.17.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 (254) hide show
  1. package/dist/{Browser-Q5BYSSW3.js → Browser-4B76MFTG.js} +13 -13
  2. package/dist/Calculator-AXFKAC7G.js +29 -0
  3. package/dist/{CurrencyConverter-42IHLJVV.js → CurrencyConverter-36BFSFRS.js} +8 -8
  4. package/dist/{Documents-GGEPMWB5.js → Documents-VKAMBKSP.js} +23 -23
  5. package/dist/Files-NRYZG4KY.js +88 -0
  6. package/dist/{Notepad-L2LOWTSE.js → Notepad-AQXGH6VP.js} +9 -9
  7. package/dist/{PomodoroTimer-PD7POYX5.js → PomodoroTimer-RHDLKJBY.js} +20 -20
  8. package/dist/{Preview-HM2Z3EJO.js → Preview-DEBTZQP5.js} +41 -41
  9. package/dist/Sidebar-CB6KRPW2.js +44 -0
  10. package/dist/{Spreadsheet-2E4TQ64O.js → Spreadsheet-FSHLWXYP.js} +11 -11
  11. package/dist/{Stock-IABQRSXZ.js → Stock-CV53A432.js} +3 -3
  12. package/dist/{Weather-4QPYOENN.js → Weather-R4MCLH7F.js} +22 -22
  13. package/dist/{WorldClock-3ZVRBLEW.js → WorldClock-CSFPCZHU.js} +6 -6
  14. package/dist/ai/index.js +63 -62
  15. package/dist/ai.css +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/charts/BoxPlotChart.js +1 -1
  20. package/dist/charts/CandlestickChart.js +1 -1
  21. package/dist/charts/ChartTooltip.js +1 -1
  22. package/dist/charts/ChordChart.js +1 -1
  23. package/dist/charts/ColumnChart.js +1 -1
  24. package/dist/charts/FunnelChart.js +1 -1
  25. package/dist/charts/HeatmapChart.js +1 -1
  26. package/dist/charts/HistogramChart.js +1 -1
  27. package/dist/charts/PieChart.js +1 -1
  28. package/dist/charts/RadarChart.js +1 -1
  29. package/dist/charts/RadialBarChart.js +1 -1
  30. package/dist/charts/RangeChart.js +1 -1
  31. package/dist/charts/SankeyChart.js +1 -1
  32. package/dist/charts/ScatterChart.js +1 -1
  33. package/dist/charts/SpecChart.js +1 -1
  34. package/dist/charts/SunburstChart.js +1 -1
  35. package/dist/charts/TimeSeriesChart.js +1 -1
  36. package/dist/charts/TreemapChart.js +1 -1
  37. package/dist/charts/WaterfallChart.js +1 -1
  38. package/dist/{chunk-K4JQ3FQI.js → chunk-2EVTN26H.js} +2 -2
  39. package/dist/{chunk-7VBXIIEC.js → chunk-3PR7FLTZ.js} +2 -2
  40. package/dist/{chunk-N6CS2FO2.js → chunk-3TKMH5VR.js} +1 -1
  41. package/dist/{chunk-4WEFGKJL.js → chunk-3VLG6LR3.js} +4 -4
  42. package/dist/{chunk-UYRMW5MO.js → chunk-4D66DUU5.js} +5 -5
  43. package/dist/{chunk-YJXS7BR5.js → chunk-4MJA2SPJ.js} +13 -13
  44. package/dist/chunk-4Q25UHWB.js +22 -0
  45. package/dist/{chunk-VIQ6OME2.js → chunk-4V73LGZG.js} +8 -8
  46. package/dist/{chunk-HJW67KA7.js → chunk-5IPFQV34.js} +1 -1
  47. package/dist/{chunk-3ELLBQPS.js → chunk-5LCDCO46.js} +1 -1
  48. package/dist/{chunk-GISDIVFK.js → chunk-5N5AAYQV.js} +1 -1
  49. package/dist/{chunk-2YSGXZOL.js → chunk-5VAIVRK6.js} +48 -48
  50. package/dist/{chunk-V6Y4OC6K.js → chunk-5W2OEDUD.js} +8 -8
  51. package/dist/chunk-6ACS4S4P.js +15 -0
  52. package/dist/{chunk-VWIYC2NB.js → chunk-7AZAMDGG.js} +7 -7
  53. package/dist/chunk-7RPYVQEV.js +2 -0
  54. package/dist/{chunk-XLWMM53L.js → chunk-7X4QNWA7.js} +2 -2
  55. package/dist/{chunk-5WYRAJ5F.js → chunk-AEJYSUVQ.js} +1 -1
  56. package/dist/{chunk-NVD4AI5Y.js → chunk-AFINCNY3.js} +1 -1
  57. package/dist/{chunk-UDKTAG57.js → chunk-B4HSNEBK.js} +1 -1
  58. package/dist/{chunk-5SIOCKCK.js → chunk-BE777IO7.js} +2 -2
  59. package/dist/{chunk-NNZFC4O7.js → chunk-BVIOCAEU.js} +1 -1
  60. package/dist/{chunk-4UKGVLFP.js → chunk-BZUA5F33.js} +1 -1
  61. package/dist/{chunk-QHPVAXHR.js → chunk-CCIGAU5Y.js} +3 -3
  62. package/dist/{chunk-SDDV3UCN.js → chunk-CF7BMDU3.js} +3 -3
  63. package/dist/{chunk-EPY34L26.js → chunk-CNUHLJYD.js} +1 -1
  64. package/dist/{chunk-SLU45G5J.js → chunk-CUKDQPEN.js} +3 -3
  65. package/dist/{chunk-5TDQPZDB.js → chunk-D6OYQM4V.js} +5 -5
  66. package/dist/chunk-DOC52JBV.js +20 -0
  67. package/dist/{chunk-DCRLJMQ6.js → chunk-EC527NE3.js} +1 -1
  68. package/dist/chunk-EDMDKQNO.js +4 -0
  69. package/dist/{chunk-RVRDDTEG.js → chunk-ENDCV7B3.js} +9 -9
  70. package/dist/{chunk-YSDPFDAG.js → chunk-EQCFPRKJ.js} +1 -1
  71. package/dist/{chunk-TXDA7TTP.js → chunk-EQZZ4V5X.js} +1 -1
  72. package/dist/{chunk-OORL6BIG.js → chunk-EZUQ5NXE.js} +1 -1
  73. package/dist/chunk-F7Z47OIF.js +12 -0
  74. package/dist/{chunk-NFB7PARJ.js → chunk-FEATDGFD.js} +1 -1
  75. package/dist/chunk-FX6DBXXD.js +1 -0
  76. package/dist/{chunk-7JGR7WPD.js → chunk-G4JTO5PB.js} +1 -1
  77. package/dist/{chunk-RUGQO7YF.js → chunk-G4PGEQOX.js} +9 -9
  78. package/dist/{chunk-W3OWPBQL.js → chunk-GD7ILVPF.js} +2 -2
  79. package/dist/chunk-GLBLKHYA.js +5 -0
  80. package/dist/{chunk-VDUXPMOQ.js → chunk-H7BKSATJ.js} +1 -1
  81. package/dist/{chunk-RT4WOEVS.js → chunk-HJ2BDUO6.js} +4 -4
  82. package/dist/{chunk-RBBIAIPH.js → chunk-HLQVB7FG.js} +8 -8
  83. package/dist/{chunk-VQCSHJEF.js → chunk-HLVOHOBC.js} +5 -5
  84. package/dist/{chunk-FOFZI62F.js → chunk-HS2E7DVI.js} +1 -1
  85. package/dist/chunk-HXNMRJQ4.js +2 -0
  86. package/dist/chunk-HXZ5XPBS.js +3 -0
  87. package/dist/{chunk-WTYQF7XJ.js → chunk-HYDVHGVT.js} +2 -2
  88. package/dist/chunk-IDV32UV7.js +29 -0
  89. package/dist/chunk-IHFZ7OXO.js +14 -0
  90. package/dist/{chunk-3UXXA2CS.js → chunk-ILP7QVW5.js} +8 -8
  91. package/dist/{chunk-3PR5YMWZ.js → chunk-IX7QXMNJ.js} +1 -1
  92. package/dist/{chunk-ZQKA2XKH.js → chunk-JFH5HW2G.js} +7 -7
  93. package/dist/{chunk-GEP4FROW.js → chunk-K7L3ZCPB.js} +3 -3
  94. package/dist/chunk-KLBJ646Z.js +8 -0
  95. package/dist/{chunk-77AQNJE2.js → chunk-L2RS2UQM.js} +1 -1
  96. package/dist/{chunk-MNNZGO2E.js → chunk-LAMRQE2P.js} +1 -1
  97. package/dist/{chunk-O6JJIR4H.js → chunk-M5LR7ZZX.js} +1 -1
  98. package/dist/{chunk-A42MKJA3.js → chunk-MAFSELZK.js} +1 -1
  99. package/dist/{chunk-N67QX3WW.js → chunk-MMQ6ETRD.js} +2 -2
  100. package/dist/{chunk-WYFMSL4Q.js → chunk-N4ZEB4UD.js} +9 -9
  101. package/dist/{chunk-4HBSQGRI.js → chunk-NRI26RYC.js} +2 -2
  102. package/dist/{chunk-QRYSL6QU.js → chunk-NVFYLTJ6.js} +2 -2
  103. package/dist/chunk-NXVFY22L.js +9 -0
  104. package/dist/{chunk-PW52RXPI.js → chunk-NYEMGKAE.js} +1 -1
  105. package/dist/{chunk-ZHAWOZA7.js → chunk-NZGNOMWX.js} +12 -12
  106. package/dist/{chunk-3NW5LD7D.js → chunk-NZQCDFDG.js} +3 -3
  107. package/dist/{chunk-XCHAU2UN.js → chunk-OUIE2N2Z.js} +5 -5
  108. package/dist/{chunk-6XBWM453.js → chunk-Q3IR5SKD.js} +1 -1
  109. package/dist/{chunk-FS6EOU4G.js → chunk-Q5QS5MFX.js} +1 -1
  110. package/dist/{chunk-JYIH2EBG.js → chunk-QEB2UTHO.js} +7 -7
  111. package/dist/{chunk-LYHJHUQH.js → chunk-QJLBBDX2.js} +1 -1
  112. package/dist/{chunk-O47HKK6E.js → chunk-QLVJ5W4G.js} +1 -1
  113. package/dist/chunk-RAAH4TQU.js +1 -0
  114. package/dist/{chunk-CXYHFGUY.js → chunk-RBEI4CKX.js} +5 -5
  115. package/dist/{chunk-MVZRZTQP.js → chunk-S5SRXI4V.js} +1 -1
  116. package/dist/{chunk-OP5DOO3K.js → chunk-SDATPJM2.js} +4 -4
  117. package/dist/{chunk-S74LKSUB.js → chunk-SOBGCIPF.js} +1 -1
  118. package/dist/{chunk-AYDW63LV.js → chunk-SOJEQHZ2.js} +1 -1
  119. package/dist/{chunk-34URULVW.js → chunk-SQCUN2DX.js} +1 -1
  120. package/dist/chunk-SRWZE3WA.js +6 -0
  121. package/dist/{chunk-I33SVQ7P.js → chunk-TIGTIT3L.js} +6 -6
  122. package/dist/{chunk-DHIQ46C5.js → chunk-TLWGOQI3.js} +3 -3
  123. package/dist/chunk-TNDRHHKN.js +14 -0
  124. package/dist/{chunk-YILGAEW3.js → chunk-TXDBOSSB.js} +1 -1
  125. package/dist/{chunk-5QGBVTGS.js → chunk-U32J7D4Q.js} +2 -2
  126. package/dist/{chunk-54NMFQMW.js → chunk-UABVKJK7.js} +1 -1
  127. package/dist/{chunk-Z5A4EY2R.js → chunk-UG6RI525.js} +1 -1
  128. package/dist/chunk-UXPBVRSE.js +7 -0
  129. package/dist/{chunk-HV47GP2C.js → chunk-VHPT7ZS5.js} +5 -5
  130. package/dist/{chunk-NU5HN3FZ.js → chunk-WON5GBJY.js} +7 -7
  131. package/dist/{chunk-RXCGE2AY.js → chunk-WS7XIJS6.js} +1 -1
  132. package/dist/{chunk-DGZAQXTW.js → chunk-WWLKVGV7.js} +4 -4
  133. package/dist/{chunk-G4GVLK44.js → chunk-WZ5QSSUM.js} +6 -6
  134. package/dist/{chunk-Y62TTKSY.js → chunk-X2KMUHBB.js} +3 -3
  135. package/dist/{chunk-C6Y7B73Q.js → chunk-XCAO2F3H.js} +1 -1
  136. package/dist/{chunk-FACWYKL6.js → chunk-XKJ7GEVA.js} +6 -6
  137. package/dist/chunk-XPTOKPUM.js +11 -0
  138. package/dist/{chunk-PLK2WHZG.js → chunk-XQMPLXGG.js} +16 -16
  139. package/dist/{chunk-2VGQS6CW.js → chunk-XTV3CAV7.js} +1 -1
  140. package/dist/{chunk-JNQKBN5M.js → chunk-YG6Y5X7S.js} +5 -5
  141. package/dist/chunk-YUECA3XB.js +8 -0
  142. package/dist/chunk-YYZ73H64.js +7 -0
  143. package/dist/{chunk-VN4KSRZ5.js → chunk-ZF2MNQXY.js} +1 -1
  144. package/dist/{chunk-FKRPQDFX.js → chunk-ZI3DGOW6.js} +16 -16
  145. package/dist/{chunk-TKJBZIHT.js → chunk-ZMRGHVKS.js} +1 -1
  146. package/dist/data/DataTable.js +1 -1
  147. package/dist/data/Kanban.js +1 -1
  148. package/dist/data/ListLoadError.js +1 -1
  149. package/dist/forms/AlignmentGrid.js +1 -1
  150. package/dist/forms/BorderInput.js +1 -1
  151. package/dist/forms/BrandAssetEditor.js +1 -1
  152. package/dist/forms/Button.js +1 -1
  153. package/dist/forms/ColorPicker.js +1 -1
  154. package/dist/forms/ComposerAttachments.js +1 -1
  155. package/dist/forms/CornersInput.js +1 -1
  156. package/dist/forms/DatePicker.js +1 -1
  157. package/dist/forms/DateRangePicker.js +1 -1
  158. package/dist/forms/DisplayChips.js +1 -1
  159. package/dist/forms/FilePicker.js +1 -1
  160. package/dist/forms/IconButton.js +1 -1
  161. package/dist/forms/IconPicker.js +1 -1
  162. package/dist/forms/InputNumber.js +1 -1
  163. package/dist/forms/LinkPicker.js +1 -1
  164. package/dist/forms/MediaLibrary.js +1 -1
  165. package/dist/forms/MediaUploadField.js +1 -1
  166. package/dist/forms/MediaUploadGrid.js +1 -1
  167. package/dist/forms/MediaUsedInList.js +1 -1
  168. package/dist/forms/NumericKeypad.js +1 -1
  169. package/dist/forms/PictureTiles.js +1 -1
  170. package/dist/forms/PositionInput.js +1 -1
  171. package/dist/forms/Segmented.js +1 -1
  172. package/dist/forms/Select.js +1 -1
  173. package/dist/forms/SidesInput.js +1 -1
  174. package/dist/forms/Slider.js +1 -1
  175. package/dist/forms/Snippet.js +1 -1
  176. package/dist/forms/SplitButton.js +1 -1
  177. package/dist/forms/TagInput.js +1 -1
  178. package/dist/forms/TextToolbar.js +1 -1
  179. package/dist/forms/WidthsBar.js +1 -1
  180. package/dist/index.js +249 -249
  181. package/dist/map/index.js +7 -7
  182. package/dist/page-tabs/index.js +5 -5
  183. package/dist/shell/AppUpdateBanner.js +1 -1
  184. package/dist/shell/ColoredBadge.js +1 -1
  185. package/dist/shell/ConfirmDialog.js +1 -1
  186. package/dist/shell/ContextMenu.js +1 -1
  187. package/dist/shell/Dialog.js +1 -1
  188. package/dist/shell/Drawer.js +1 -1
  189. package/dist/shell/DropdownMenu.js +1 -1
  190. package/dist/shell/EditableGrid.js +1 -1
  191. package/dist/shell/FloatingBar.js +1 -1
  192. package/dist/shell/GlobalSearch.js +1 -1
  193. package/dist/shell/HelpCenter.js +1 -1
  194. package/dist/shell/IconRail.js +1 -1
  195. package/dist/shell/ImageLightbox.js +1 -1
  196. package/dist/shell/ItemCount.js +1 -1
  197. package/dist/shell/LanguageSelect.js +1 -1
  198. package/dist/shell/Markdown.js +1 -1
  199. package/dist/shell/MilestoneTimeline.js +1 -1
  200. package/dist/shell/Popover.js +1 -1
  201. package/dist/shell/PopupMenu.js +1 -1
  202. package/dist/shell/ProductionTimeline.js +1 -1
  203. package/dist/shell/ResizeHandle.js +1 -1
  204. package/dist/shell/SearchableSelect.js +1 -1
  205. package/dist/shell/SettingReset.js +1 -1
  206. package/dist/shell/SidebarLayout.js +1 -1
  207. package/dist/shell/SidebarNav.js +1 -1
  208. package/dist/shell/SortableList.js +1 -1
  209. package/dist/shell/StatusBadge.js +1 -1
  210. package/dist/shell/Tabs.js +1 -1
  211. package/dist/shell/TimelineTrack.js +1 -1
  212. package/dist/shell/Tooltip.js +1 -1
  213. package/dist/shell/TopNav.js +1 -1
  214. package/dist/shell/TransferProgress.js +1 -1
  215. package/dist/shell/Tree.js +1 -1
  216. package/dist/shell/discardGuard.js +1 -1
  217. package/dist/telemetry/index.js +1 -1
  218. package/dist/templates/AuthScreen.js +1 -1
  219. package/dist/templates/ChatTemplate.js +1 -1
  220. package/dist/templates/CheckoutTemplate.js +1 -1
  221. package/dist/templates/DashboardTemplate.js +1 -1
  222. package/dist/templates/DataTablePage.js +1 -1
  223. package/dist/templates/EmailTemplate.js +1 -1
  224. package/dist/templates/ErrorBoundary.js +1 -1
  225. package/dist/templates/FormLayoutPage.js +1 -1
  226. package/dist/templates/GalleryTemplate.js +1 -1
  227. package/dist/ui/index.js +1 -1
  228. package/dist/version.js +1 -1
  229. package/package.json +1 -1
  230. package/dist/Calculator-6NJNSIRN.js +0 -29
  231. package/dist/Files-OVNXUYOV.js +0 -88
  232. package/dist/Sidebar-2HHICMZZ.js +0 -44
  233. package/dist/chunk-22RQC4EW.js +0 -20
  234. package/dist/chunk-2H6YNMBE.js +0 -14
  235. package/dist/chunk-5TQLUPZD.js +0 -6
  236. package/dist/chunk-67MQ5S32.js +0 -8
  237. package/dist/chunk-6JSXIEH2.js +0 -4
  238. package/dist/chunk-77MOYIQW.js +0 -15
  239. package/dist/chunk-7INZ7O3A.js +0 -5
  240. package/dist/chunk-B23RG53S.js +0 -14
  241. package/dist/chunk-CUHUZBFH.js +0 -29
  242. package/dist/chunk-DESWIPOZ.js +0 -3
  243. package/dist/chunk-DYNJ2H6R.js +0 -8
  244. package/dist/chunk-EJUNGVK2.js +0 -22
  245. package/dist/chunk-I4VIEGCX.js +0 -2
  246. package/dist/chunk-JIGFR7Z3.js +0 -11
  247. package/dist/chunk-MJGK6QTO.js +0 -7
  248. package/dist/chunk-PN5FQVMB.js +0 -7
  249. package/dist/chunk-PUF75SMJ.js +0 -1
  250. package/dist/chunk-QDKAA3HR.js +0 -2
  251. package/dist/chunk-TLMFVEMC.js +0 -9
  252. package/dist/chunk-WRQ4A5QY.js +0 -1
  253. package/dist/chunk-XYBI57KO.js +0 -12
  254. /package/dist/{chunk-ECJKIPWU.js → chunk-3J2PO3KW.js} +0 -0
@@ -1,9 +1,9 @@
1
- import{useOverlayTarget as e,usePopupAnchor as r,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as i}from"./chunk-ECJKIPWU.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as l}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as a}from"./chunk-CDAJKLGL.js";import{Icon as s}from"./chunk-2UO47XB4.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useHydrated as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as m}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-GDQJBQ5B.js";import{useRef as f,useId as u,useState as p,useEffect as b}from"react";import{createPortal as g}from"react-dom";import{jsxs as x,Fragment as y,jsx as v}from"react/jsx-runtime";var w={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},k={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function N(e,r){const t=window.innerHeight-(r.top+r.height);if("bottom"===e)return{left:r.left,width:r.width,bottom:t};const i={top:r.top,height:r.height};return"left"===e?{...i,left:r.left}:{...i,right:window.innerWidth-(r.left+r.width)}}function j({onClose:e}){const r=h().dialog;/* @__PURE__ */
2
- return v("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */v(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function C({open:s,onClose:h,side:C="right",size:W="md",title:D,description:B,footer:J,children:U,blocking:L=!1,dirty:Q=!1,initialFocus:z,"aria-label":G,"aria-labelledby":H,"aria-describedby":I,className:P=""}){const T=f(null),V=u(),X=u(),A=u(),F=e(c()),[K,S]=p(null),E=i({open:s,dirty:Q,onClose:h,title:D,layer:K}),O=f(null),Y=r(s&&null!==F,O);if(l(s),n(T,s&&null!==F,z),a(s),b(()=>{if(s)return m(()=>(L||E(),!0),()=>T.current)},[s,L,E]),!s||!F)return null;const Z="bottom"===C,$={...Z?{maxHeight:"85vh"}:{},...Y?N(C,Y):{}};/* @__PURE__ */
3
- return x(y,{children:[/* @__PURE__ */v("span",{ref:O,hidden:!0,"data-popup-anchor":""}),g(
4
- /* @__PURE__ */v(t,{value:K,children:/* @__PURE__ */x("div",{ref:S,className:"fixed inset-0",style:{zIndex:d.overlay},role:"presentation","data-overlay-layer":"",children:[
5
- /* @__PURE__ */v("div",{className:"fixed inset-0 bg-black/30",onClick:L?void 0:E,"aria-hidden":"true"}),
6
- /* @__PURE__ */x("div",{ref:T,...o({modal:!0,titleId:D?A:void 0,labelledBy:H,label:G}),"aria-describedby":I??(B?X:U?V:void 0),"data-drawer-side":C,"data-popup-panel":"",style:$,className:["fixed flex flex-col bg-white shadow-xl",Z?"":`w-full max-w-full ${w[W]}`,Y?"":k[C],Z?"rounded-t-xl":"",P].filter(Boolean).join(" "),children:[D?/* @__PURE__ */x("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
1
+ import{useOverlayTarget as e,usePopupAnchor as r,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as i}from"./chunk-3J2PO3KW.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as l}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as a}from"./chunk-CDAJKLGL.js";import{Icon as s}from"./chunk-2UO47XB4.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useHydrated as m}from"./chunk-D65T4H6J.js";import{useShellStrings as h}from"./chunk-GDQJBQ5B.js";import{useRef as f,useId as u,useState as p,useEffect as b}from"react";import{createPortal as g}from"react-dom";import{jsxs as x,Fragment as y,jsx as v}from"react/jsx-runtime";var w={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},k={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function N(e,r){const t=window.innerHeight-(r.top+r.height);if("bottom"===e)return{left:r.left,width:r.width,bottom:t};const i={top:r.top,height:r.height};return"left"===e?{...i,left:r.left}:{...i,right:window.innerWidth-(r.left+r.width)}}function j({onClose:e}){const r=h().dialog;/* @__PURE__ */
2
+ return v("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */v(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function C({open:s,onClose:h,side:C="right",size:W="md",title:D,description:B,footer:J,children:L,blocking:Q=!1,dirty:U=!1,initialFocus:z,"aria-label":G,"aria-labelledby":H,"aria-describedby":P,className:T=""}){const V=f(null),X=u(),A=u(),F=u(),I=e(m()),[K,O]=p(null),S=i({open:s,dirty:U,onClose:h,title:D,layer:K}),Y=f(null),Z=r(s&&null!==I,Y);if(l(s),n(V,s&&null!==I,z),a(s),b(()=>{if(s)return c(()=>(Q||S(),!0),()=>V.current)},[s,Q,S]),!s||!I)return null;const $="bottom"===C,q={...$?{maxHeight:"85vh"}:{},...Z?N(C,Z):{}};/* @__PURE__ */
3
+ return x(y,{children:[/* @__PURE__ */v("span",{ref:Y,hidden:!0,"data-popup-anchor":""}),g(
4
+ /* @__PURE__ */v(t,{value:K,children:/* @__PURE__ */x("div",{ref:O,className:"fixed inset-0",style:{zIndex:d.overlay},role:"presentation","data-overlay-layer":"",children:[
5
+ /* @__PURE__ */v("div",{className:"fixed inset-0 bg-black/30",onClick:Q?void 0:S,"aria-hidden":"true"}),
6
+ /* @__PURE__ */x("div",{ref:V,...o({modal:!0,titleId:D?F:void 0,labelledBy:H,label:G}),"aria-describedby":P??(B?A:L?X:void 0),"data-drawer-side":C,"data-popup-panel":"",style:q,className:["fixed flex flex-col bg-white shadow-xl",$?"":`w-full max-w-full ${w[W]}`,Z?"":k[C],$?"rounded-t-xl":"",T].filter(Boolean).join(" "),children:[D?/* @__PURE__ */x("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
7
7
  /* @__PURE__ */x("div",{className:"min-w-0",children:[
8
- /* @__PURE__ */v("h2",{id:A,className:"text-base font-semibold text-gray-900",children:D}),B&&/* @__PURE__ */v("p",{id:X,className:"mt-0.5 text-sm text-gray-500",children:B})]}),!L&&/* @__PURE__ */v(j,{onClose:E})]}):!L&&/* @__PURE__ */v("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */v(j,{onClose:E})}),
9
- /* @__PURE__ */x("div",{id:V,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[B&&!D&&/* @__PURE__ */v("p",{id:X,className:("mb-3 text-sm text-gray-500 "+(L?"":"pr-8")).trim(),children:B}),U]}),J&&/* @__PURE__ */v("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:J})]})]})}),F)]})}export{C as Drawer};
8
+ /* @__PURE__ */v("h2",{id:F,className:"text-base font-semibold text-gray-900",children:D}),B&&/* @__PURE__ */v("p",{id:A,className:"mt-0.5 text-sm text-gray-500",children:B})]}),!Q&&/* @__PURE__ */v(j,{onClose:S})]}):!Q&&/* @__PURE__ */v("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */v(j,{onClose:S})}),
9
+ /* @__PURE__ */x("div",{id:X,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[B&&!D&&/* @__PURE__ */v("p",{id:A,className:("mb-3 text-sm text-gray-500 "+(Q?"":"pr-8")).trim(),children:B}),L]}),J&&/* @__PURE__ */v("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:J})]})]})}),I)]})}export{C as Drawer};
@@ -0,0 +1,15 @@
1
+ import{AccessibleTable as e}from"./chunk-ZMRGHVKS.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-WZ5QSSUM.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:W}){const C=m().charts,F=c(),R=N??(e=>h(e,F)),w=W??C.nothingToCompare,Q=p(),[S,A]=u(null),{highlighted:B}=a(),L=x;if(k.length<3||0===L.length)/* @__PURE__ */
2
+ return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:w});const U=y/2,Z=y/2,z=y/2-46,E=n(k.length),H=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...L.map(e=>e.values[t]??0).filter(Number.isFinite))),T=(e,t)=>{const r=Math.max(0,Math.min(1,t/H[e])),l=E.center(e)-E.step/2;return[U+z*r*Math.cos(l),Z+z*r*Math.sin(l)]},V=(e,t)=>null!==S?S!==e:null!==B&&B!==t,Y=null!==S?L[S]:void 0;/* @__PURE__ */
3
+ return f("div",{className:`relative ${$??""}`,children:[
4
+ /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":Q,onMouseLeave:()=>A(null),children:[
5
+ /* @__PURE__ */d("title",{id:Q,children:C.acrossMeasures(L.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=z*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:U,cy:Z,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(U,Z,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=T(t,H[t]);/* @__PURE__ */
6
+ return f("g",{children:[
7
+ /* @__PURE__ */d("line",{x1:U,y1:Z,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
+ /* @__PURE__ */d("text",{x:U+(z+18)*Math.cos(E.center(t)-E.step/2),y:Z+(z+18)*Math.sin(E.center(t)-E.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
+ /* @__PURE__ */d(r,{id:Q,reveal:!!j&&"center-out"}),L.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>T(r,e.values[r]??0));/* @__PURE__ */
10
+ return f("g",{opacity:V(t,e.key)?.3:1,onMouseEnter:()=>A(t),mask:j?`url(#${l(Q)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
11
+ /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),Y&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:Y.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(S,3,Y.color,Y.tone),value:R(Y.values[t]??0)}))})}),
12
+ /* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:L.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
13
+ /* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
14
+ /* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
15
+ /* @__PURE__ */d(e,{caption:C.acrossMeasures(L.map(e=>e.label),k.length),head:[C.tableSeries,...k.map(e=>e.label)],rows:L.map(e=>[e.label,...k.map((t,r)=>R(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
@@ -1,13 +1,13 @@
1
- import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-G4GVLK44.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:$,formatValue:j,centerLabel:I,animate:w=!0,labels:F="none",labelMinShare:P=.04,className:S,emptyLabel:A}){const C=h().charts,R=c(),W=j??(e=>u(e,R)),z=$??C.other,B=A??C.nothingToBreakDown,E=d(),[L,T]=f(null),{highlighted:V}=a(),_=y(null),Q=o(_,Number.POSITIVE_INFINITY),U=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===U.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${S??""}`,children:B});const Y=[...U].sort((e,t)=>t.value-e.value),G=Y.slice(0,N),O=Y.slice(N),D=O.length>0?[...G,{key:"__other__",label:z,value:O.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:G,H=e=>i(e.slot,e.color,e.tone),J=D.reduce((e,t)=>e+t.value,0),Z=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,q="outside"===F&&Q>=120+2*Z,K=q?Z:0,X=q?Math.max(120,Math.min(k,Q-2*K)):k,ee=X+2*K,te=K+X/2,le=X/2,ae=X/2-12,re=M??("ring"===v?.58*ae:0),ne=n(D.length,b),oe=Math.max(...D.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!q)return[];let e=-Math.PI/2;const t=D.map((t,l)=>{const a="rose"===v?n(D.length,b).step:t.value/J*Math.PI*2,r="rose"===v?n(D.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/J,right:Math.cos(r)>=0,anchor:[te+o*Math.cos(r),le+o*Math.sin(r)],y:le+(o+14)*Math.sin(r),index:l}}).filter(e=>e.share>=P),l=Math.max(1,Math.floor((X-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?X-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==L?L!==e:null!==V&&V!==t,me=null!==L?D[L]:void 0;/* @__PURE__ */
2
- return g("div",{className:`relative ${S??""}`,ref:_,children:[
3
- /* @__PURE__ */g("svg",{width:"100%",height:X,viewBox:`0 0 ${ee} ${X}`,role:"img","aria-labelledby":E,onMouseLeave:()=>T(null),children:[
4
- /* @__PURE__ */p("title",{id:E,children:C.breakdown(W(J),D.length)}),D.map((a,r)=>{const n=H(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/J*Math.PI*2-b;"rose"!==v&&(ie+=a.value/J*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
5
- return p("path",{d:e(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:w?t.sweep:void 0,style:w?l(r,55):void 0,onMouseEnter:()=>T(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
1
+ import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-WZ5QSSUM.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:$,formatValue:j,centerLabel:I,animate:S=!0,labels:w="none",labelMinShare:F=.04,className:P,emptyLabel:A}){const C=h().charts,W=c(),R=j??(e=>u(e,W)),z=$??C.other,B=A??C.nothingToBreakDown,E=d(),[Q,T]=f(null),{highlighted:U}=a(),_=y(null),L=o(_,Number.POSITIVE_INFINITY),V=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===V.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${P??""}`,children:B});const Y=[...V].sort((e,t)=>t.value-e.value),O=Y.slice(0,N),Z=Y.slice(N),D=Z.length>0?[...O,{key:"__other__",label:z,value:Z.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:O,H=e=>i(e.slot,e.color,e.tone),J=D.reduce((e,t)=>e+t.value,0),q=Math.ceil(.62*Math.max(...D.map(e=>String(e.label).length),4)*11)+24,G="outside"===w&&L>=120+2*q,X=G?q:0,K=G?Math.max(120,Math.min(k,L-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=n(D.length,b),oe=Math.max(...D.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!G)return[];let e=-Math.PI/2;const t=D.map((t,l)=>{const a="rose"===v?n(D.length,b).step:t.value/J*Math.PI*2,r="rose"===v?n(D.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/J,right:Math.cos(r)>=0,anchor:[te+o*Math.cos(r),le+o*Math.sin(r)],y:le+(o+14)*Math.sin(r),index:l}}).filter(e=>e.share>=F),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==Q?Q!==e:null!==U&&U!==t,me=null!==Q?D[Q]:void 0;/* @__PURE__ */
2
+ return g("div",{className:`relative ${P??""}`,ref:_,children:[
3
+ /* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":E,onMouseLeave:()=>T(null),children:[
4
+ /* @__PURE__ */p("title",{id:E,children:C.breakdown(R(J),D.length)}),D.map((a,r)=>{const n=H(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/J*Math.PI*2-b;"rose"!==v&&(ie+=a.value/J*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
5
+ return p("path",{d:e(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:S?t.sweep:void 0,style:S?l(r,55):void 0,onMouseEnter:()=>T(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
6
6
  return g("g",{children:[
7
7
  /* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:s.grid,strokeWidth:1}),
8
8
  /* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:s.label,textAnchor:e.right?"end":"start",children:e.label}),
9
- /* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,R)})]},`lbl-${e.key}`)}),I&&re>0&&/* @__PURE__ */p("text",{x:te,y:le+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:s.label,children:I})]}),me&&null!==L&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:me.label,rows:[{key:"value",label:C.value,color:H(me),value:W(me.value)},{key:"share",label:C.share,color:s.muted,value:m(me.value/J*100,1,R)}]})}),
9
+ /* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,W)})]},`lbl-${e.key}`)}),I&&re>0&&/* @__PURE__ */p("text",{x:te,y:le+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:s.label,children:I})]}),me&&null!==Q&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:me.label,rows:[{key:"value",label:C.value,color:H(me),value:R(me.value)},{key:"share",label:C.share,color:s.muted,value:m(me.value/J*100,1,W)}]})}),
10
10
  /* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:D.map((e,t)=>/* @__PURE__ */g("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
11
11
  /* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:H(e)}}),
12
12
  /* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
13
- /* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/J*100,1,R)})]},e.key))})]})}export{x as PieChart};
13
+ /* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/J*100,1,W)})]},e.key))})]})}export{x as PieChart};
@@ -0,0 +1,2 @@
1
+ import{ChartTooltip as t}from"./chunk-WZ5QSSUM.js";import{CartesianPlot as o}from"./chunk-QO5E33DH.js";import{binValues as r}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as e,useShellLocale as i}from"./chunk-GDQJBQ5B.js";import{formatPlain as m,formatFixed as n}from"./chunk-C3QOHMR6.js";import{jsx as l}from"react/jsx-runtime";function c({values:c,bins:s=10,precomputed:h,height:u=220,width:p,color:b,tone:f,formatBound:d,formatCount:x,yAxisLabel:g,label:k,className:y,emptyLabel:j}){const v=e().charts,w=i(),A=d??(t=>Number.isInteger(t)?m(t,w):n(t,1,w)),L=x??(t=>m(t,w)),M=g??v.countAxis,Q=k??v.distribution,N=h??r(c??[],s),B=a(0,b,f),C=N.map(t=>A(t.from)),O=N.map(t=>t.count);/* @__PURE__ */
2
+ return l(o,{labels:C,values:O,height:u,width:p,bandPadding:0,xTickAnchor:"start",formatValue:L,yAxisLabel:M,className:y,emptyLabel:j,ariaLabel:v.histogram(Q,N.length,(c??[]).length),tooltip:o=>/* @__PURE__ */l(t,{title:`${A(N[o].from)} – ${A(N[o].to)}`,rows:[{key:"count",label:v.observations,color:B,value:L(N[o].count)}]}),children:({x:t,y:o,bottom:r,active:a})=>/* @__PURE__ */l("g",{children:N.map((e,i)=>/* @__PURE__ */l("rect",{x:t(i)+.5,y:o(e.count),width:Math.max(1,t.bandwidth-1),height:Math.max(0,r-o(e.count)),fill:B,fillOpacity:null===a||a===i?.85:.42},i))})})}export{c as HistogramChart};
@@ -1,5 +1,5 @@
1
- import{ChartTooltip as e}from"./chunk-G4GVLK44.js";import{CartesianPlot as l}from"./chunk-QO5E33DH.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-GDQJBQ5B.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),L=Math.max(...v),A=.08*(L-j)||1;/* @__PURE__ */
2
- return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-A,max:L+A,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
1
+ import{ChartTooltip as e}from"./chunk-WZ5QSSUM.js";import{CartesianPlot as l}from"./chunk-QO5E33DH.js";import{STATUS_VARS as o}from"./chunk-TZFACUMR.js";import{useShellStrings as t,useShellLocale as a}from"./chunk-GDQJBQ5B.js";import{formatPlain as i,formatFixed as r}from"./chunk-C3QOHMR6.js";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";function h({candles:h,variant:m="candle",height:p=260,width:d,formatValue:u,yAxisLabel:b,label:y,className:x,emptyLabel:k}){const g=t().charts,f=a(),w=u??(e=>Number.isInteger(e)?i(e,f):r(e,2,f)),M=y??g.price,v=h.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),j=Math.min(...v),L=Math.max(...v),Q=.08*(L-j)||1;/* @__PURE__ */
2
+ return c(l,{labels:h.map(e=>e.label),values:v,height:p,width:d,min:j-Q,max:L+Q,bandPadding:.42,formatValue:w,yAxisLabel:b,className:x,emptyLabel:k,ariaLabel:g.ohlc(M,h.length),tooltip:l=>{const t=h[l],a=t.close>=t.open,i=a?o.good:o.critical;/* @__PURE__ */
3
3
  return c(e,{title:t.label,rows:[{key:"open",label:g.open,color:i,value:w(t.open)},{key:"high",label:g.high,color:i,value:w(t.high)},{key:"low",label:g.low,color:i,value:w(t.low)},{key:"close",label:g.close,color:i,value:w(t.close)}],emphasisKey:"close",footnote:a?g.closedAbove:g.closedBelow})},children:({x:e,y:l,active:t})=>/* @__PURE__ */c("g",{children:h.map((a,i)=>{const r=a.close>=a.open,h=r?o.good:o.critical,p=e.center(i),d=Math.max(3,e.bandwidth),u=null!==t&&t!==i,b=l(Math.max(a.open,a.close)),y=Math.max(1,Math.abs(l(a.close)-l(a.open)));/* @__PURE__ */
4
4
  return n("g",{opacity:u?.45:1,children:[
5
5
  /* @__PURE__ */c("line",{x1:p,y1:l(a.high),x2:p,y2:l(a.low),stroke:h,strokeWidth:1.5}),"candle"===m?/* @__PURE__ */c("rect",{x:p-d/2,y:b,width:d,height:y,rx:1,fill:r?h:"transparent",fillOpacity:r?.85:1,stroke:h,strokeWidth:1.5}):/* @__PURE__ */n(s,{children:[
@@ -1,4 +1,4 @@
1
- import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-CLTRQ7AQ.js";import{Tooltip as n}from"./chunk-6XBWM453.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.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-CLTRQ7AQ.js";import{Tooltip as n}from"./chunk-Q3IR5SKD.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.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-1 ${"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 +1 @@
1
- import{client_default as a}from"./chunk-2YSGXZOL.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
1
+ import{client_default as a}from"./chunk-5VAIVRK6.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
@@ -1,3 +1,3 @@
1
- import{ColoredBadge as e}from"./chunk-EPY34L26.js";import{Button_default as n}from"./chunk-I4VIEGCX.js";import{useShellStrings as i}from"./chunk-GDQJBQ5B.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
1
+ import{ColoredBadge as e}from"./chunk-CNUHLJYD.js";import{Button_default as n}from"./chunk-HXNMRJQ4.js";import{useShellStrings as i}from"./chunk-GDQJBQ5B.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
2
2
  /* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
3
3
  /* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
@@ -1,3 +1,3 @@
1
- import{useSettingAuto as e}from"./chunk-2NMW66P5.js";import{IconButton_default as r}from"./chunk-PUF75SMJ.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as o}from"./chunk-TWVUQUUD.js";import{useShellStrings as a}from"./chunk-GDQJBQ5B.js";import{forwardRef as l,useId as c,useState as u,useRef as s,useCallback as d,useEffect as p}from"react";import{jsx as m,jsxs as f,Fragment as v}from"react/jsx-runtime";function h(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}var b=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e);function y({dir:e,compact:t,label:i,disabled:o,onStep:a}){const l=s(a);l.current=a;const c=s({}),u=d(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);p(()=>u,[u]),p(()=>{o&&u()},[o,u]);const f=/* @__PURE__ */m(n,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),v={tabIndex:-1,"aria-label":i,disabled:o,onPointerDown:e=>{if(0!==e.button||o)return;e.preventDefault(),u();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",u),c.current={off:()=>t.removeEventListener("pointerup",u),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:u,onPointerCancel:u,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__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:f}):/* @__PURE__ */m(r,{size:"sm",...v,children:f})}var g=l(function({value:r,onChange:n,min:l,max:g,precision:x,step:w,shiftStep:k,disabled:N,readOnly:j,invalid:E,placeholder:D,size:B,prefix:C,suffix:F,id:M,name:O,className:S="",onBlur:U,onFocus:P,steppers:W,stepFrom:K,snap:T=!1,allowEmpty:$=!0,appearance:z="box",display:L,reportWhileTyping:R=!0,onRevert:Y,"aria-label":A,"aria-labelledby":I,"aria-describedby":J,auto:Q,...V},X){const G="bare"===z,H=e(),Z=Q??H,q=c(),_="string"==typeof F&&""!==F.trim()?F.trim():void 0,ee=e=>function(e,r){let t=e.trim();if(r&&t.endsWith(r)&&(t=t.slice(0,-r.length).trim()),t=t.replace(",","."),""===t||"-"===t||"."===t||"-."===t)return null;const n=Number(t);return Number.isFinite(n)?n:null}(e,_),re=Object.fromEntries(Object.entries(V).filter(([e])=>e.startsWith("data-"))),te=a(),[ne,ie]=u(()=>b(r,x)),oe=s(ne);oe.current=ne;const ae=s(null),le=d(e=>{ae.current=e,"function"==typeof X?X(e):X&&(X.current=e)},[X]),ce=s(r),ue=s(r);ue.current=r;const se=Boolean(N||j),de=W??!1,pe="compact"===de,me=s(null),[fe,ve]=u(0);i(()=>{const e=me.current;if(!e)return;const r=()=>ve(Math.ceil(e.getBoundingClientRect().width));if(r(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(r);return t.observe(e),()=>t.disconnect()},[C]),p(()=>{ee(oe.current)!==r&&ie(b(r,x))},[r,x]);const he=e=>{if(se)return;let r=(ee(oe.current)??K??(D?ee(D):null)??0)+e;null!=l&&r<l&&(r=l),null!=g&&r>g&&(r=g);const t=x??String(w??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const i=b(r,x);oe.current=i,ie(i),n(r),Ne()},be=s(he);be.current=he;const ye=s({unit:w??1,big:k??10*(w??1),locked:se});ye.current={unit:w??1,big:k??10*(w??1),locked:se},p(()=>{const e=ae.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:i}=ye.current;if(i||e.ownerDocument.activeElement!==e)return;const o=r.deltaY||r.deltaX;o&&(r.preventDefault(),be.current((o<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[ge,xe]=u(!1),[we,ke]=u(0),Ne=()=>{G&&ke(e=>e+1)};p(()=>{G&&ge&&document.activeElement===ae.current&&ae.current?.select()},[G,ge,we]);const je=s(!1);p(()=>{if(ge&&!se)return o(e=>{if("Escape"!==e.key||document.activeElement!==ae.current)return!1;const r=ce.current;if(ee(oe.current)===r)return!1;const t=b(r,x);return oe.current=t,ie(t),ue.current!==r&&(Y??n)(r),Ne(),!0})},[ge,se,x,n,Y]);const Ee=()=>{const e=ee(oe.current);if(null==e){if(!$){const e=b(ue.current,x);return oe.current=e,ie(e),ue.current}return oe.current="",ie(""),null!==ue.current&&n(null),null}let r=e;const t=x??(T?Math.max(h(w??1),h(l??0)):void 0);T&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,w??1,l??0)),null!=l&&r<l&&(r=l),null!=g&&r>g&&(r=g),null!=t&&(r=Number(r.toFixed(t)));const i=b(r,x);return oe.current=i,ie(i),r===e&&r===ue.current||n(r),r},De=/* @__PURE__ */m("input",{ref:le,id:M,"data-number-input":"",name:O,type:"text",inputMode:0===x?"numeric":"decimal",value:!ge&&L?L(r):ne,disabled:N,readOnly:j,placeholder:D,step:w,role:"spinbutton","aria-valuenow":r??void 0,"aria-valuemin":l,"aria-valuemax":g,"aria-valuetext":null==r?D||void 0:`${b(r,x)}${G&&_?_:""}`,"aria-describedby":[J,Z?q:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":G?"bare":void 0,...re,autoComplete:G?"off":void 0,spellCheck:!G&&void 0,"aria-invalid":E||void 0,"aria-label":A,"aria-labelledby":I,onChange:e=>(e=>{if(j)return;const r=_&&e.trimEnd().endsWith(_)?e.trimEnd().slice(0,-_.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(ie(e),!R)return;const t=ee(e);(null!==t||$)&&n(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!se)return ce.current=Ee(),void Ne();const r=w??1,t=k??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||se||(e.preventDefault(),he(n))},onFocus:()=>{ce.current=ue.current,xe(!0),je.current=!0,P?.()},onMouseUp:G?e=>{je.current&&(je.current=!1,e.preventDefault())}:void 0,onBlur:()=>{xe(!1),je.current=!1,Ee(),U?.()},className:G?["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)]",ge?"bg-surface":"bg-transparent",se?"cursor-default":"cursor-text",S].filter(Boolean).join(" "):t({invalid:E,size:B,readOnly:j,auto:Z,className:[C?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",pe?F?"pr-10":"pr-6":de?F?"pr-24":"pr-16":F?"pr-10":"","text-left tabular-nums",S].filter(Boolean).join(" ")})}),Be=Z?/* @__PURE__ */m("span",{id:q,hidden:!0,children:te.settingView.auto}):null;if(G||!C&&!F&&!de)return Be?/* @__PURE__ */f(v,{children:[De,Be]}):De;const Ce=ee(ne);/* @__PURE__ */
2
- return f("div",{className:"relative","data-number-box":"",style:C?{"--rosh-number-prefix-width":`${fe}px`}:void 0,children:[C&&/* @__PURE__ */m("span",{ref:me,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:C}),De,Be,F&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${pe?"right-6":de?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:F}),de&&(()=>{const e=/* @__PURE__ */m(y,{dir:-1,compact:pe,label:te.number.decrease,disabled:se||null!=l&&null!=Ce&&Ce<=l,onStep:e=>be.current(-(e?k??10*(w??1):w??1))}),r=/* @__PURE__ */m(y,{dir:1,compact:pe,label:te.number.increase,disabled:se||null!=g&&null!=Ce&&Ce>=g,onStep:e=>be.current(e?k??10*(w??1):w??1)});/* @__PURE__ */
1
+ import{useSettingAuto as e}from"./chunk-2NMW66P5.js";import{IconButton_default as r}from"./chunk-FX6DBXXD.js";import{inputClasses as t}from"./chunk-AYZY3YNC.js";import{Icon as n}from"./chunk-2UO47XB4.js";import{registerModalEscapeInterceptor as i}from"./chunk-TWVUQUUD.js";import{useBrowserLayoutEffect as o}from"./chunk-D65T4H6J.js";import{useShellStrings as a}from"./chunk-GDQJBQ5B.js";import{forwardRef as l,useId as c,useState as u,useRef as s,useCallback as d,useEffect as p}from"react";import{jsx as m,jsxs as f,Fragment as v}from"react/jsx-runtime";function h(e){const r=String(e),t=/e-(\d+)$/.exec(r);return t?Number(t[1]):r.split(".")[1]?.length??0}var b=(e,r)=>null==e?"":null!=r?e.toFixed(r):String(e);function y({dir:e,compact:t,label:i,disabled:o,onStep:a}){const l=s(a);l.current=a;const c=s({}),u=d(()=>{const e=c.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),c.current={}},[]);p(()=>u,[u]),p(()=>{o&&u()},[o,u]);const f=/* @__PURE__ */m(n,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),v={tabIndex:-1,"aria-label":i,disabled:o,onPointerDown:e=>{if(0!==e.button||o)return;e.preventDefault(),u();const r=e.shiftKey;l.current(r);const t=e.currentTarget.ownerDocument.defaultView??window;t.addEventListener("pointerup",u),c.current={off:()=>t.removeEventListener("pointerup",u),wait:setTimeout(()=>{c.current.every=setInterval(()=>l.current(r),60)},400)}},onPointerLeave:u,onPointerCancel:u,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__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:f}):/* @__PURE__ */m(r,{size:"sm",...v,children:f})}var g=l(function({value:r,onChange:n,min:l,max:g,precision:x,step:w,shiftStep:k,disabled:N,readOnly:D,invalid:j,placeholder:E,size:B,prefix:C,suffix:F,id:O,name:M,className:S="",onBlur:U,onFocus:W,steppers:K,stepFrom:P,snap:T=!1,allowEmpty:$=!0,appearance:z="box",display:L,reportWhileTyping:X=!0,onRevert:R,"aria-label":Y,"aria-labelledby":A,"aria-describedby":I,auto:Q,...V},J){const G="bare"===z,H=e(),Z=Q??H,q=c(),_="string"==typeof F&&""!==F.trim()?F.trim():void 0,ee=e=>function(e,r){let t=e.trim();if(r&&t.endsWith(r)&&(t=t.slice(0,-r.length).trim()),t=t.replace(",","."),""===t||"-"===t||"."===t||"-."===t)return null;const n=Number(t);return Number.isFinite(n)?n:null}(e,_),re=Object.fromEntries(Object.entries(V).filter(([e])=>e.startsWith("data-"))),te=a(),[ne,ie]=u(()=>b(r,x)),oe=s(ne);oe.current=ne;const ae=s(null),le=d(e=>{ae.current=e,"function"==typeof J?J(e):J&&(J.current=e)},[J]),ce=s(r),ue=s(r);ue.current=r;const se=Boolean(N||D),de=K??!1,pe="compact"===de,me=s(null),[fe,ve]=u(0);o(()=>{const e=me.current;if(!e)return;const r=()=>ve(Math.ceil(e.getBoundingClientRect().width));if(r(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(r);return t.observe(e),()=>t.disconnect()},[C]),p(()=>{ee(oe.current)!==r&&ie(b(r,x))},[r,x]);const he=e=>{if(se)return;let r=(ee(oe.current)??P??(E?ee(E):null)??0)+e;null!=l&&r<l&&(r=l),null!=g&&r>g&&(r=g);const t=x??String(w??1).split(".")[1]?.length??0;r=Number(r.toFixed(t));const i=b(r,x);oe.current=i,ie(i),n(r),Ne()},be=s(he);be.current=he;const ye=s({unit:w??1,big:k??10*(w??1),locked:se});ye.current={unit:w??1,big:k??10*(w??1),locked:se},p(()=>{const e=ae.current;if(!e)return;const r=r=>{const{unit:t,big:n,locked:i}=ye.current;if(i||e.ownerDocument.activeElement!==e)return;const o=r.deltaY||r.deltaX;o&&(r.preventDefault(),be.current((o<0?1:-1)*(r.shiftKey?n:t)))};return e.addEventListener("wheel",r,{passive:!1}),()=>e.removeEventListener("wheel",r)},[]);const[ge,xe]=u(!1),[we,ke]=u(0),Ne=()=>{G&&ke(e=>e+1)};p(()=>{G&&ge&&document.activeElement===ae.current&&ae.current?.select()},[G,ge,we]);const De=s(!1);p(()=>{if(ge&&!se)return i(e=>{if("Escape"!==e.key||document.activeElement!==ae.current)return!1;const r=ce.current;if(ee(oe.current)===r)return!1;const t=b(r,x);return oe.current=t,ie(t),ue.current!==r&&(R??n)(r),Ne(),!0})},[ge,se,x,n,R]);const je=()=>{const e=ee(oe.current);if(null==e){if(!$){const e=b(ue.current,x);return oe.current=e,ie(e),ue.current}return oe.current="",ie(""),null!==ue.current&&n(null),null}let r=e;const t=x??(T?Math.max(h(w??1),h(l??0)):void 0);T&&(r=function(e,r,t){const n=(e-t)/r;return t+Math.round(n+1e-9*Math.sign(e))*r}(r,w??1,l??0)),null!=l&&r<l&&(r=l),null!=g&&r>g&&(r=g),null!=t&&(r=Number(r.toFixed(t)));const i=b(r,x);return oe.current=i,ie(i),r===e&&r===ue.current||n(r),r},Ee=/* @__PURE__ */m("input",{ref:le,id:O,"data-number-input":"",name:M,type:"text",inputMode:0===x?"numeric":"decimal",value:!ge&&L?L(r):ne,disabled:N,readOnly:D,placeholder:E,step:w,role:"spinbutton","aria-valuenow":r??void 0,"aria-valuemin":l,"aria-valuemax":g,"aria-valuetext":null==r?E||void 0:`${b(r,x)}${G&&_?_:""}`,"aria-describedby":[I,Z?q:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":G?"bare":void 0,...re,autoComplete:G?"off":void 0,spellCheck:!G&&void 0,"aria-invalid":j||void 0,"aria-label":Y,"aria-labelledby":A,onChange:e=>(e=>{if(D)return;const r=_&&e.trimEnd().endsWith(_)?e.trimEnd().slice(0,-_.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(ie(e),!X)return;const t=ee(e);(null!==t||$)&&n(t)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!se)return ce.current=je(),void Ne();const r=w??1,t=k??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||se||(e.preventDefault(),he(n))},onFocus:()=>{ce.current=ue.current,xe(!0),De.current=!0,W?.()},onMouseUp:G?e=>{De.current&&(De.current=!1,e.preventDefault())}:void 0,onBlur:()=>{xe(!1),De.current=!1,je(),U?.()},className:G?["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)]",ge?"bg-surface":"bg-transparent",se?"cursor-default":"cursor-text",S].filter(Boolean).join(" "):t({invalid:j,size:B,readOnly:D,auto:Z,className:[C?"pl-[max(var(--space-24),calc(var(--space-control-x-sm)+var(--rosh-number-prefix-width)+var(--space-icon-gap-sm)))]":"",pe?F?"pr-10":"pr-6":de?F?"pr-24":"pr-16":F?"pr-10":"","text-left tabular-nums",S].filter(Boolean).join(" ")})}),Be=Z?/* @__PURE__ */m("span",{id:q,hidden:!0,children:te.settingView.auto}):null;if(G||!C&&!F&&!de)return Be?/* @__PURE__ */f(v,{children:[Ee,Be]}):Ee;const Ce=ee(ne);/* @__PURE__ */
2
+ return f("div",{className:"relative","data-number-box":"",style:C?{"--rosh-number-prefix-width":`${fe}px`}:void 0,children:[C&&/* @__PURE__ */m("span",{ref:me,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:C}),Ee,Be,F&&/* @__PURE__ */m("span",{className:`pointer-events-none absolute ${pe?"right-6":de?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-ink-faint`,children:F}),de&&(()=>{const e=/* @__PURE__ */m(y,{dir:-1,compact:pe,label:te.number.decrease,disabled:se||null!=l&&null!=Ce&&Ce<=l,onStep:e=>be.current(-(e?k??10*(w??1):w??1))}),r=/* @__PURE__ */m(y,{dir:1,compact:pe,label:te.number.increase,disabled:se||null!=g&&null!=Ce&&Ce>=g,onStep:e=>be.current(e?k??10*(w??1):w??1)});/* @__PURE__ */
3
3
  return f("span",pe?{"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{g as InputNumber_default};
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-WRQ4A5QY.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},A=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},R=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},Z=[200,500],F=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,Z,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{R(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,Z,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],B=[800,1800],N=e=>{document.prerendering?E(()=>N(e)):"complete"!==document.readyState?addEventListener("load",()=>N(e),!0):setTimeout(e)};var U=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,H=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,W=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,V=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,Q=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,G=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,Y=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function X(e,t,n){const i=e.replace(G,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=Y.exec(n.trim()),i=e&&X(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(G,"").split(/[?#]/,1)[0].replace(Q,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&U.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;R(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),F(e),((e,t={})=>{const n=h();P(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,A,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,A,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),P(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,B,t.reportAllChanges);N(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,B,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,B,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&H.test(e.app),n="string"==typeof e.release&&H.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:H.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(W,"[url]").replace(V,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
1
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-RAAH4TQU.js";var n=-1,i=()=>n,a=e=>{addEventListener("pageshow",t=>{t.persisted&&(n=t.timeStamp,e(t))},!0)},r=(e,t,n,i)=>{let a,r;return o=>{var s,c;t.value>=0&&(o||i)&&(r=t.value-(a??0),(r||void 0===a)&&(a=t.value,t.delta=r,t.rating=(s=t.value)>(c=n)[1]?"poor":s>c[0]?"needs-improvement":"good",e(t)))}},o=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},c=()=>s()?.activationStart??0,d=-1,l=/* @__PURE__ */new Set,u=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,f=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l)e();isFinite(d)||(d="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",f,!0))}},h=(e=!1)=>{if(e&&(d=1/0),d<0){const e=c(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=e)?.startTime;d=t??u(),addEventListener("visibilitychange",f,!0),addEventListener("prerenderingchange",f,!0),a(()=>{setTimeout(()=>{d=u()})})}return{get firstHiddenTime(){return d},onHidden(e){l.add(e)}}},g=(e,t=-1,n,a=0,r,o,d)=>{const l=s(),u=l?.navigationId||0;let f="navigate";return n?f=n:i()>=0?f="back-forward-cache":l&&(document.prerendering||c()>0?f="prerender":document.wasDiscarded?f="restore":l.type&&(f=l.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v6-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:f,navigationId:a||u,navigationInteractionId:r,navigationURL:o||l?.name,navigationStartTime:d||0}},v=/* @__PURE__ */new WeakMap;function p(e,t){let n=v.get(t);return n||(n=/* @__PURE__ */new WeakMap,v.set(t,n)),n.get(e)||n.set(e,new t),n.get(e)}var m,y=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}},T=(e,t,n={})=>{try{const i=e.filter(e=>PerformanceObserver.supportedEntryTypes.includes(e));if(i.length>0){const e=new PerformanceObserver(e=>{queueMicrotask(()=>{const n=e.getEntries();i.length>1&&n.sort((e,t)=>e.startTime+e.duration-(t.startTime+t.duration)),t(n)})});for(const t of i)e.observe({type:t,buffered:!0,...n});return e}}catch{}},w=e=>globalThis.PerformanceObserver?.supportedEntryTypes?.includes("soft-navigation")&&"function"==typeof globalThis.PerformanceSoftNavigation?.prototype?.getLargestInteractionContentfulPaint&&e&&e.reportSoftNavs,I=(e,t)=>{if(e.set(t.navigationId,t),e.size>2){const t=e.keys().next().value;void 0!==t&&e.delete(t)}},b=e=>{let t=!1;return()=>{t||(e(),t=!0)}},C=class{l},E=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],A=(e,t={})=>{const n=w(t);E(()=>{const s=p(t,C),d=h();let l,u=g("FCP");const f=T(["paint"],e=>{for(const t of e)"first-contentful-paint"===t.name&&(f.disconnect(),t.startTime<d.firstHiddenTime&&(u.value=Math.max(t.startTime-c(),0),u.entries.push(t),u.navigationId=t.navigationId||u.navigationId,l(!0)))});f&&(l=r(e,u,L,t.reportAllChanges),a(n=>{u=g("FCP",-1,"back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),l=r(e,u,L,t.reportAllChanges),o(()=>{u.value=performance.now()-n.timeStamp,l(!0)})})),n&&T(["soft-navigation"],n=>{n.forEach(n=>{s.l&&n.navigationId&&I(s.l,n);const i=Math.max((n.presentationTime||n.paintTime||0)-n.startTime,0);u=g("FCP",i,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),l=r(e,u,L,t.reportAllChanges),l(!0)})},t)})},P=[.1,.25],k=0,S=1/0,z=0,M=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),z=Math.max(z,t.interactionId),k=z?(z-S)/7+1:0)},$=()=>m?k:performance.interactionCount??0,_=class{u=0;v=[];m=/* @__PURE__ */new Map;p;T;_(){return $()-this.u}M(){this.u=$(),this.v.length=0,this.m.clear()}L(e){const t=this._(),n=Math.min(this.v.length-1,Math.floor(t/50));return!t||-1!==n||"soft-navigation"!==e&&"back-forward-cache"!==e?this.v[n]:{P:8,id:-1,entries:[]}}h(e){if(this.p?.(e),!e.interactionId)return;const t=this.v.at(-1);let n=this.m.get(e.interactionId);if(n||this.v.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.m.set(n.id,n),this.v.push(n)),this.v.sort((e,t)=>t.P-e.P),this.v.length>10){const e=this.v.splice(10);for(const t of e)this.m.delete(t.id)}this.T?.(n)}}},R=e=>{const t="requestIdleCallback"in globalThis?1e3:0,n=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)e();else{const a=b(e);let r=-1;const o=()=>{i(r),a()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),r=n(()=>{removeEventListener("visibilitychange",o,{capture:!0}),a()},{timeout:t})}},Z=[200,500],F=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();E(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,_),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,Z,t.reportAllChanges)},l=()=>{const e=c.L(s.navigationType);e&&e.P!==s.value&&(s.value=e.P,s.entries=e.entries,o())},u=e=>{l(),o(!0),d("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},f=(e,t=!1)=>{R(()=>{for(const t of e)"soft-navigation"!==t.entryType?c.h(t):u(t);l(),t&&o(!0)})},h=["event","first-input"];w(t)&&h.push("soft-navigation");const v=T(h,f,{...t,durationThreshold:t.durationThreshold??40});o=r(e,s,Z,t.reportAllChanges),v&&(n.onHidden(()=>{f(v.takeRecords(),!0)}),a(()=>{d("back-forward-cache",s.navigationId,s.navigationInteractionId,s.navigationURL,i())}))})},j=class{p;l;h(e){this.p?.(e)}},x=[2500,4e3],U=[800,1800],B=e=>{document.prerendering?E(()=>B(e)):"complete"!==document.readyState?addEventListener("load",()=>B(e),!0):setTimeout(e)};var N=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,H=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,O=/^[A-Za-z0-9][A-Za-z0-9.+_-]*$/;var q=class{constructor(e){this.head=e}head;events=[];waiting=/* @__PURE__ */new Map;seen=/* @__PURE__ */new Set;get size(){return this.events.length}addVital(e){this.events.push(e)}addError(e){const t=function(e){return e.frames.length?`${e.name}|${e.frames.join("|")}`:`${e.name}|${e.message.replace(/\d/g,"0")}`}(e),n=this.waiting.get(t);return n?(n.count=Math.min(1e3,n.count+e.count),!0):!(this.seen.has(t)||this.seen.size>=20)&&(this.seen.add(t),this.waiting.set(t,e),this.events.push(e),!0)}drain(){const e=this.events;this.events=[],this.waiting.clear();const t=[],n=JSON.stringify({...this.head,events:[]}).length;let i=[],a=n;for(const r of e){const e=JSON.stringify(r).length+1;n+e>30720||((50===i.length||a+e>30720)&&(t.push({...this.head,events:i}),i=[],a=n),i.push(r),a+=e)}return i.length&&t.push({...this.head,events:i}),t}},J=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,K=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}(?:\.[A-Za-z0-9_-]*)?|\b[Bb]earer\s+[A-Za-z0-9._~+/=-]{8,}/g,V=/\b[a-z][a-z0-9+.-]*:\/\/\S+/gi,W=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,D=/\d{4,}/g,G=/(^|[/:])(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{16,})(?=$|[/:])/gi,Q=/^[a-z][a-z0-9+.-]*:\/\/[^/]*/i,X=/(?:\(|@|\bat\s+)?((?:[a-z][a-z0-9+.-]*:\/\/|\/)[^\s()@]*?):(\d+):(\d+)\)?\s*$/i;function Y(e,t,n){const i=e.replace(Q,"").split(/[?#]/,1)[0];return i?`${i}:${t}:${n}`.slice(0,256):null}function ee(e){if("string"!=typeof e)return[];const t=[];for(const n of e.split("\n")){const e=X.exec(n.trim()),i=e&&Y(e[1],e[2],e[3]);if(i&&t.push(i),5===t.length)break}return t}function te(e){const t=e instanceof Error?e.name:void 0;return"string"==typeof t&&t.length<=64&&H.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(G,(e,t)=>":"===t?":id":`${t}:id`);return t&&t.length<=128&&!t.includes("//")&&N.test(t)?t:"unknown"}var ie={flush(){},reportError(){},stop(){}},ae=null,re=/* @__PURE__ */new Set(["LCP","FCP","TTFB"]);function oe(e,t,n){const i=function(e){if(e.anonymous)return{credentials:"omit",headers:{"Content-Type":"application/json"}};const t=e.getAccessToken();return t?{credentials:"same-origin",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}}:null}(t);if(!i)return;const a=t.anonymous?"/api/storefront-analytics/web-vitals/":"/api/client-telemetry/web-batches/";n(t.endpoint??a,{...i,method:"POST",keepalive:!0,body:JSON.stringify(e)}).catch(e=>{console.debug("[efficient-shell] client telemetry batch dropped:",e)})}function se(e){((e,t={})=>{let n=!1;const s=w(t);E(()=>{let d,l=h(),u=g("LCP");const f=p(t,j),v=(i,a,o,s,c)=>{u=g("LCP",-1,i,a,o,s,c),d=r(e,u,x,t.reportAllChanges),n=!1,"soft-navigation"===i&&(l=h(!0))},m=e=>{f.l&&e.navigationId&&I(f.l,e),n||d(!0),v("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime);const t=e.getLargestInteractionContentfulPaint?.();t&&y([t])},y=e=>{t.reportAllChanges||s||(e=e.slice(-1));for(const t of e){if(!t)continue;if("soft-navigation"===t.entryType){m(t);continue}let e=0,n=[],i=t.startTime;if("largest-contentful-paint"===t.entryType)e=Math.max(t.startTime-c(),0),f.h(t),n=[t];else if("interaction-contentful-paint"===t.entryType){const a=t;if(!u.navigationId)continue;if("interactionId"in a&&a.interactionId!=u.navigationInteractionId)continue;i=a.largestContentfulPaint?.renderTime||0,e=Math.max(i-t.startTime,0),a.largestContentfulPaint&&(f.h(a.largestContentfulPaint),n=[a.largestContentfulPaint])}i<l.firstHiddenTime&&(u.value=e,u.entries=n,d())}},w=["largest-contentful-paint"];s&&w.push("interaction-contentful-paint","soft-navigation");const b=T(w,y);if(b){d=r(e,u,x,t.reportAllChanges);const c=["keydown","click","visibilitychange"],l=e=>{if(e.isTrusted&&!n){const e=u.id;R(()=>{if(!n){if(!s){b.disconnect();for(const e of c)removeEventListener(e,l,{capture:!0})}e===u.id&&(n=!0,d(!0))}})}};for(const e of c)addEventListener(e,l,{capture:!0});a(a=>{v("back-forward-cache",u.navigationId,u.navigationInteractionId,u.navigationURL,i()),d=r(e,u,x,t.reportAllChanges),o(()=>{u.value=performance.now()-a.timeStamp,n=!0,d(!0)})})}})})(e),F(e),((e,t={})=>{const n=h();A(b(()=>{let s,c=g("CLS",0);const d=p(t,y),l=(n,i,a,o,l)=>{c=g("CLS",0,n,i,a,o,l),d.i=0,s=r(e,c,P,t.reportAllChanges)},u=(e=!1)=>{d.i>c.value&&(c.value=d.i,c.entries=d.o),s(e)},f=e=>{u(!0),l("soft-navigation",e.navigationId,e.interactionId,e.name,e.startTime)},h=e=>{for(const t of e)"soft-navigation"!==t.entryType?d.h(t):f(t);u()},v=["layout-shift"];w(t)&&v.push("soft-navigation");const m=T(v,h);m&&(s=r(e,c,P,t.reportAllChanges),n.onHidden(()=>{h(m.takeRecords()),s(!0)}),a(()=>{l("back-forward-cache",c.navigationId,c.navigationInteractionId,c.navigationURL,i()),o(s)}),setTimeout(s))}))})(e),A(e),((e,t={})=>{const n=w(t);let o=g("TTFB"),d=r(e,o,U,t.reportAllChanges);B(()=>{const l=s();if(l){const s=l.responseStart;o.value=Math.max(s-c(),0),o.entries=[l],d(!0),a(()=>{o=g("TTFB",0,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,i()),d=r(e,o,U,t.reportAllChanges),d(!0)}),n&&T(["soft-navigation"],n=>{n.forEach(n=>{n.navigationId&&(o=g("TTFB",0,"soft-navigation",n.navigationId,n.interactionId,n.name,n.startTime),o.entries=[n],d=r(e,o,U,t.reportAllChanges),d(!0))})},t)}})})(e)}function ce(n){if(ae?.stop(),ae=null,!1===n.enabled||"undefined"==typeof window||"undefined"==typeof document)return ie;if(!function(e){const t="string"==typeof e.app&&O.test(e.app),n="string"==typeof e.release&&O.test(e.release);return t&&n||console.warn("[efficient-shell] client telemetry not started: `app` and `release` must be version-like strings."),t&&n}(n))return ie;const i=function(e){const t=e.vitalsSampleRate??1;return t>0&&(t>=1||(e.random??Math.random)()<t)}(n);if(n.anonymous&&!i)return ie;const a=n.fetch??window.fetch.bind(window),r=new q({app:n.app,release:n.release,shell_version:O.test(t)?t:""}),o=ne(n.routeKey()),s=function(e=("undefined"==typeof window?void 0:window)){if(!e)return"desktop";const t="function"==typeof e.matchMedia&&e.matchMedia("(pointer: coarse)").matches,n=e.innerWidth;return n<600?"mobile":t&&n<1280?"tablet":"desktop"}(window);let c=!1;const d=()=>{for(const e of r.drain())oe(e,n,a)},l=e=>{c||n.anonymous||(r.addError(e),r.size>=50&&d())},u=(e,t)=>{return{type:"error",source:t,name:te(e),message:(a=e,i=a instanceof Error?a.message:"string"==typeof a?a:a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",i.slice(0,640).replace(J,"[redacted]").replace(K,"[redacted]").replace(V,"[url]").replace(W,"[id]").replace(D,"[n]").replace(/\s+/g," ").trim().slice(0,160)),frames:ee(e instanceof Error?e.stack:void 0),route:ne(n.routeKey()),count:1};var i,a};i&&(n.observeVitals??se)(e=>{c||(r.addVital(function(e,t,n,i){return{type:"vital",name:e.name,value:e.value,route:re.has(e.name)?t:n(),navigation:e.navigationType??"navigate",device:i}}(e,o,()=>ne(n.routeKey()),s)),r.size>=50&&d())});const f=n.anonymous?()=>{}:function(t,n){const i=e=>{const{error:i,message:a,filename:r,lineno:o,colno:s}=e;if(null!=i)return void t(n(i,"onerror"));const c=r?ee(`at ${r}:${o??0}:${s??0}`):[];t({...n(a??"","onerror"),frames:c})},a=e=>t(n(e.reason,"unhandledrejection"));window.addEventListener("error",i),window.addEventListener("unhandledrejection",a);const r=e(e=>t(n(e,"boundary")));return()=>{window.removeEventListener("error",i),window.removeEventListener("unhandledrejection",a),r()}}(l,u),h=()=>{"hidden"===document.visibilityState&&d()};document.addEventListener("visibilitychange",h),window.addEventListener("pagehide",d);const g=window.setInterval(d,n.flushIntervalMs??6e4),v={flush:d,reportError:e=>l(u(e,"boundary")),stop(){c||(d(),c=!0,f(),document.removeEventListener("visibilitychange",h),window.removeEventListener("pagehide",d),window.clearInterval(g),ae===v&&(ae=null))}};return ae=v,v}export{ce as startClientTelemetry};
@@ -1,4 +1,4 @@
1
- import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-4WEFGKJL.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var d=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,c=(e,l)=>`${e}-status-${l}`;function o(e,l){return e.flatMap((e,t)=>"status"===e.type?[c(l,t)]:[]).join(" ")||void 0}function u(d,o){const{menuId:y,choose:b,toggle:h,followLink:p,rowProps:m=()=>({}),linkAs:k}=o,f=k??"a",v=(d,k)=>{if("divider"===d.type)/* @__PURE__ */
1
+ import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-3VLG6LR3.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var d=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,c=(e,l)=>`${e}-status-${l}`;function o(e,l){return e.flatMap((e,t)=>"status"===e.type?[c(l,t)]:[]).join(" ")||void 0}function u(d,o){const{menuId:y,choose:b,toggle:h,followLink:p,rowProps:m=()=>({}),linkAs:k}=o,f=k??"a",v=(d,k)=>{if("divider"===d.type)/* @__PURE__ */
2
2
  return n("div",{role:"separator",children:/* @__PURE__ */n(e,{})},d.key);if("label"===d.type)/* @__PURE__ */
3
3
  return n("div",{id:`${y}-label-${k}`,children:/* @__PURE__ */n(l,{children:d.label})},d.key);if("status"===d.type)/* @__PURE__ */
4
4
  return n("div",{id:c(y,k),className:"text-xs",style:t(),children:d.label},d.key);if("submenu"===d.type)/* @__PURE__ */
@@ -1,6 +1,6 @@
1
- import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-5SIOCKCK.js";import{Tooltip as i}from"./chunk-6XBWM453.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:M=!1,className:B=""}){const j=l().widths,R=a(),z=m(Math.round(x)||1,1,n),K=e($,z),S=K??[...t[z]??[]],A=[...S,100-p(S)],D=P||M,O=s(null),T=s({onChange:k,shown:S,locked:D,n:z,stored:K});T.current={onChange:k,shown:S,locked:D,n:z,stored:K};const E=t=>{const{onChange:r,shown:n,locked:o,n:i}=T.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},I=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],E(i.slice(0,-1))&&(ne.current=null)},G=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=A[e]+A[e+1],i="ArrowRight"===t.key?A[e]+n:"ArrowLeft"===t.key?A[e]-n:"PageUp"===t.key?A[e]+10:"PageDown"===t.key?A[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),I(A,e,i))},H=s(null),[L,W]=c(null),X=()=>{H.current=null,W(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>X,[]);const F=e=>t=>{if(0!==t.button||D)return;t.preventDefault();const r=O.current?.getBoundingClientRect().width??0;r<=0||(H.current={i:e,x:t.clientX,width:r,from:A,moved:!1,pointer:t.pointerId},W(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},J=e=>{const t=H.current;if(!t)return;if(0===e.buttons)return void X();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}I(t.from,t.i,t.from[t.i]+r/t.width*100)},Q=e=>{const t=H.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),X())},U=(e,t)=>{const{shown:n}=T.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return E(o.slice(0,-1))?o:null},[q,V]=c(0);u(()=>{const e=O.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=T.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=A.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,q]);const le=j.hint(z,r),ae=A.slice(0,-1).map((e,t)=>p(A.slice(0,t+1)));/* @__PURE__ */
2
- return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?R:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${M?"opacity-60":""} ${B}`.trim(),children:[
1
+ import{resolveColumnShares as e,COLUMN_SHARES_EQUAL as t,COLUMN_SHARE_MIN as r,COLUMN_COUNT_MAX as n}from"./chunk-PLGJOHEG.js";import{InputNumber_default as o}from"./chunk-BE777IO7.js";import{Tooltip as i}from"./chunk-Q3IR5SKD.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{useId as a,useRef as s,useState as c,useEffect as u,Fragment as d}from"react";import{jsxs as h,jsx as f}from"react/jsx-runtime";var m=(e,t,r)=>Math.min(r,Math.max(t,e)),p=e=>e.reduce((e,t)=>e+t,0),v=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var g,b="w-0.5",y=`${b} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var w=["text-blue-700","text-gray-600"];function x({count:x,value:$,onChange:k,label:C,"aria-labelledby":N,readOnly:P=!1,disabled:B=!1,className:M=""}){const R=l().widths,j=a(),z=m(Math.round(x)||1,1,n),D=e($,z),S=D??[...t[z]??[]],A=[...S,100-p(S)],K=P||B,O=s(null),E=s({onChange:k,shown:S,locked:K,n:z,stored:D});E.current={onChange:k,shown:S,locked:K,n:z,stored:D};const I=t=>{const{onChange:r,shown:n,locked:o,n:i}=E.current;if(o)return!1;const l=e(t,i);return!(!l||v(l,n))&&(r(l),!0)},T=(e,t,n)=>{const o=e[t]+e[t+1],i=[...e];i[t]=m(Math.round(n),r,o-r),i[t+1]=o-i[t],I(i.slice(0,-1))&&(ne.current=null)},G=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const n=t.shiftKey?10:1,o=A[e]+A[e+1],i="ArrowRight"===t.key?A[e]+n:"ArrowLeft"===t.key?A[e]-n:"PageUp"===t.key?A[e]+10:"PageDown"===t.key?A[e]-10:"Home"===t.key?r:"End"===t.key?o-r:null;null!==i&&(t.preventDefault(),T(A,e,i))},H=s(null),[L,Q]=c(null),F=()=>{H.current=null,Q(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};u(()=>F,[]);const J=e=>t=>{if(0!==t.button||K)return;t.preventDefault();const r=O.current?.getBoundingClientRect().width??0;r<=0||(H.current={i:e,x:t.clientX,width:r,from:A,moved:!1,pointer:t.pointerId},Q(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},U=e=>{const t=H.current;if(!t)return;if(0===e.buttons)return void F();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}T(t.from,t.i,t.from[t.i]+r/t.width*100)},W=e=>{const t=H.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),F())},X=(e,t)=>{const{shown:n}=E.current,o=function(e,t,n){const o=e.length,i=[...e];if(o<2)return i;const l=m(Math.round(n),r,100-(o-1)*r);let a=l-i[t];i[t]=l;const s=[...Array.from({length:o-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(a<0)return i[s[0]]-=a,i;for(const e of s){if(a<=0)break;const t=Math.min(a,i[e]-r);i[e]-=t,a-=t}return i}([...n,100-p(n)],e,t);return I(o.slice(0,-1))?o:null},[q,V]=c(0);u(()=>{const e=O.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>V(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const Y=s(null),[Z,_]=c(null),[ee,te]=c([]),re=(e,t)=>_(r=>t?e:r===e?null:r),ne=s(null),oe=(e,t)=>{const r=ne.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:o,stored:i}=E.current;var l,a;return o||(l=i,a=r.stored,void 0===l||void 0===a?l===a:v(l,a))||n(r.stored),!0},ie=A.join(",");u(()=>{const e=null===Z?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===g&&(g=document.createElement("canvas").getContext("2d")),!g)return[];const o=g;return r.flatMap((e,r)=>{if(r===t)return[];const i=e.getBoundingClientRect(),l=getComputedStyle(e);o.font=`${l.fontWeight} ${l.fontSize} ${l.fontFamily}`;const a=o.measureText(e.value).width/2,s=(i.left+i.right)/2;return s+a>n.left&&s-a<n.right?[r]:[]})}(Y.current,Z);te(t=>v(t,e)?t:e)},[Z,ie,q]);const le=R.hint(z,r),ae=A.slice(0,-1).map((e,t)=>p(A.slice(0,t+1)));/* @__PURE__ */
2
+ return h("div",{role:"group","aria-label":N?void 0:C,"aria-labelledby":N,"aria-describedby":z>1?j:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${B?"opacity-60":""} ${M}`.trim(),children:[
3
3
  /* @__PURE__ */h("div",{ref:Y,"data-widths-bar":"",className:"relative h-8",children:[
4
4
  /* @__PURE__ */f("div",{ref:O,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-surface",children:A.map((e,t)=>/* @__PURE__ */f("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${w[t%2]} ${t%2==0?"bg-accent-tint":""}`,children:1===z&&/* @__PURE__ */f("span",{"data-widths-label":"",children:`${e}%`})},t))}),
5
5
  /* @__PURE__ */f("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-line-strong"}),z>1&&A.map((e,t)=>/* @__PURE__ */h(d,{children:[(()=>{const n=Z===t,l=p(A.slice(0,t)),a=n?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
6
- return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(z-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:M,"aria-label":j.column(t+1),"aria-describedby":R,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||U(t,e)},onRevert:e=>((e,t)=>{T.current.locked||null===t||oe(e,t)||U(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:T.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<z-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:j.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:M?-1:0,"aria-orientation":"vertical","aria-label":j.divider(t+1,t+2),"aria-valuenow":A[t],"aria-valuemin":r,"aria-valuemax":A[t]+A[t+1]-r,"aria-valuetext":j.dividerValue(t+1,A[t],t+2,A[t+1]),"aria-disabled":D||void 0,onKeyDown:D?void 0:G(t),onPointerDown:F(t),onPointerMove:J,onPointerUp:Q,onPointerCancel:Q,onLostPointerCapture:()=>{H.current&&X()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(D?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(D?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${L===t?"w-1":y}`)})})})})]},t))]}),z>1&&/* @__PURE__ */f("span",{id:R,className:"sr-only",children:le})]})}export{x as WidthsBar};
6
+ return f("div",{"data-widths-tip":"",className:"absolute inset-y-0 "+(n?"z-20":""),style:{left:`clamp(0px, calc(${l+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */f(i,{content:le,delay:600,describe:!1,className:"absolute inset-0",children:/* @__PURE__ */f(o,{appearance:"bare",value:e,display:()=>(e=>q>0&&q*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:r,max:100-(z-1)*r,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:P,disabled:B,"aria-label":R.column(t+1),"aria-describedby":j,"data-widths-label":"",onChange:e=>{null===e||oe(t,e)||X(t,e)},onRevert:e=>((e,t)=>{E.current.locked||null===t||oe(e,t)||X(e,t)})(t,e),onFocus:()=>{ne.current={column:t,share:e,stored:E.current.stored},re(t,!0)},onBlur:()=>re(t,!1),className:`absolute inset-0 text-xs font-medium ${w[t%2]} ${ee.includes(t)&&!n?"opacity-0":""}`})})})})(),t<z-1&&/* @__PURE__ */f("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${ae[t]}%`},children:/* @__PURE__ */f(i,{content:R.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */f("div",{role:"separator",tabIndex:B?-1:0,"aria-orientation":"vertical","aria-label":R.divider(t+1,t+2),"aria-valuenow":A[t],"aria-valuemin":r,"aria-valuemax":A[t]+A[t+1]-r,"aria-valuetext":R.dividerValue(t+1,A[t],t+2,A[t+1]),"aria-disabled":K||void 0,onKeyDown:K?void 0:G(t),onPointerDown:J(t),onPointerMove:U,onPointerUp:W,onPointerCancel:W,onLostPointerCapture:()=>{H.current&&F()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(K?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */f("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(K?`${b} bg-gray-300`:`bg-accent-fill transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${L===t?"w-1":y}`)})})})})]},t))]}),z>1&&/* @__PURE__ */f("span",{id:j,className:"sr-only",children:le})]})}export{x as WidthsBar};
@@ -1,4 +1,4 @@
1
- import{DAY_MS as e,fmtSliderDate as t}from"./chunk-7TC3LJQM.js";import{calendarNames as n}from"./chunk-Y3JW2GW5.js";import{stagger as r}from"./chunk-465RRWBY.js";import{popupBounds as l}from"./chunk-GLUJS42B.js";import{useBrowserValueOnce as a,useBrowserLayoutEffect as s}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as i}from"./chunk-TWVUQUUD.js";import{useShellStrings as o,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{useRef as u,useState as d,useId as m,useEffect as h,useCallback as p}from"react";import{jsx as x,jsxs as f,Fragment as y}from"react/jsx-runtime";var k={receipt:/* @__PURE__ */f(y,{children:[
1
+ import{DAY_MS as e,fmtSliderDate as t}from"./chunk-7TC3LJQM.js";import{calendarNames as n}from"./chunk-Y3JW2GW5.js";import{stagger as r}from"./chunk-465RRWBY.js";import{popupBounds as l}from"./chunk-GLUJS42B.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{useBrowserValueOnce as s,useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as o,useShellLocale as c}from"./chunk-GDQJBQ5B.js";import{useRef as u,useState as d,useId as m,useEffect as h,useCallback as p}from"react";import{jsx as x,jsxs as f,Fragment as y}from"react/jsx-runtime";var k={receipt:/* @__PURE__ */f(y,{children:[
2
2
  /* @__PURE__ */x("path",{d:"M3.4 1.9h5.2v7.2l-1.3-.9-1.3.9-1.3-.9-1.3.9z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
3
3
  /* @__PURE__ */x("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */x("path",{d:"M2.6 6.3 4.9 8.6 9.4 3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"}),doc:/* @__PURE__ */f(y,{children:[
4
4
  /* @__PURE__ */x("path",{d:"M3.5 1.9h3.4l2 2v6.2H3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
@@ -13,7 +13,7 @@ return x("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:k[e]})}functio
13
13
  return f("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
14
14
  /* @__PURE__ */x("path",{d:"M4.2 2.2v11.6"}),
15
15
  /* @__PURE__ */x("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function v(){/* @__PURE__ */
16
- return x("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */x("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var b=1e-6;function $(e,t,n={}){const r=Number.isFinite(t)&&t>0?t:0,l=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(r<=0||l.length<2){const e=l[0]??0;return{anchorsMs:l,xs:l.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const a=l[l.length-1]-l[0],s=n.maxTimeShare??.3,i=Math.min(n.breakPx??48,r),o=n.minGapPx??48,c=[],u=[],d=[];for(let e=0;e+1<l.length;e++){const t=l[e+1]-l[e];c.push(t),u.push(a>0?t/a*r:0),d.push(a>0&&t/a>s)}const m=d.filter(Boolean).length,h=Math.max(0,r-m*i);let p=0,x=0;for(let e=0;e<c.length;e++)d[e]||(p+=c[e],x+=1);const f=c.map((e,t)=>d[t]?i:0===x?0:p>0?h*e/p:h/x),y=function(e,t,n){const r=e.slice();let l=0;for(let e=0;e<r.length;e++)t[e]||r[e]>=n-b||(l+=n-r[e],r[e]=n);if(l<=b)return r;let a=0;for(let e=0;e<r.length;e++)!t[e]&&r[e]>n+b&&(a+=r[e]-n);if(a<=b)return r;const s=Math.min(l,a);for(let e=0;e<r.length;e++)t[e]||r[e]<=n+b||(r[e]-=s*(r[e]-n)/a);return r}(f,d,o),k=y.reduce((e,t,n)=>d[n]?e:e+t,0),g=y.map((e,t)=>d[t]?e:k>0?e*h/k:e),M=[0];for(let e=0;e<g.length;e++)M.push(M[e]+g[e]);M[M.length-1]=r;const v=M.slice(0,-1).map((e,t)=>({fromMs:l[t],toMs:l[t+1],gapMs:c[t],fromPx:e,toPx:M[t+1],wantPx:u[t],clampedPx:f[t],px:M[t+1]-e,compressed:d[t]}));return{anchorsMs:l,xs:M,gaps:v,xByMs:e=>{if(!Number.isFinite(e)||e<=l[0])return 0;if(e>=l[l.length-1])return r;for(let t=0;t+1<l.length;t++){if(e>l[t+1])continue;const n=l[t+1]-l[t],r=n>0?(e-l[t])/n:0;return M[t]+r*(M[t+1]-M[t])}return r},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),r);for(let e=0;e+1<l.length;e++){if(t>M[e+1]&&e+2<l.length)continue;const n=M[e+1]-M[e],r=n>0?(t-M[e])/n:0;return l[e]+r*(l[e+1]-l[e])}return l[l.length-1]},inCut:e=>v.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function w(e,t,n){return Math.max(0,Math.min(e-t/2,Math.max(0,n-t)))}var P="mixed";function N(e,t){return 5.6*Math.max(e.length,t.length)+8}var C=(e,t,n)=>Math.min(Math.max(e,t),n),T=e=>-(Math.cos(Math.PI*e)-1)/2;function B(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const n=e.fromPx+(e.toPx-e.fromPx)*T(t);return{px:n,ms:e.msByPx(n)}}var L={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function D(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var K=e=>5.6*e.length,A={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},F={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function j(e,t,n){if("none"!==e.glyph)return e.glyph?e.glyph:A[t].glyph??(n?"flag":void 0)}function R(e,t,n=!1){const r=A[e],l=["rosh-tl-node","rosh-tl-mark",`is-${t}`];r.diamond&&l.push("is-diamond"),n&&l.push("is-provisional");const a="current"===t?"var(--tl-accent)":r.token??"var(--tl-accent)",s="dot"===t||n?{borderColor:a,color:a}:{backgroundColor:a,color:"var(--tl-on-kind)"};return{className:l.join(" "),style:s}}function U(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}function H(e,t){const[n,r]=d(0);return s(()=>{const n=t?e.current:null;if(!n)return;const l=()=>{const e=n.getBoundingClientRect().width;e>0&&r(e)};if(l(),"undefined"==typeof ResizeObserver)return;const a=new ResizeObserver(l);return a.observe(n),()=>{a.disconnect()}},[e,t]),n}function O(e,t,n){const r=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&r.set(e.x,Math.max(r.get(e.x)??0,e.widthPx));const l=[...r.keys()].sort((e,t)=>e-t);if(n<=0||l.length<2)return e;const a=Math.max(0,l[0]),s=Math.min(n,l[l.length-1]),i=s-a,o=[];for(let e=0;e+1<l.length;e++){const t=(r.get(l[e])??0)/2+(r.get(l[e+1])??0)/2+8;o.push(Math.max(28,t,l[e+1]-l[e]))}const c=o.reduce((e,t)=>e+t,0),u=Math.min(Math.max(c,i),.8*n);if(u<=i+.5)return e;const d=a,m=n-s,h=d+m,p=Math.max(0,n-u),x=h>0?p*d/h:0,f=x,y=x+u,k=o.map(e=>c>0?e*u/c:0),g=e=>{if(e<=a)return d>0?e*x/d:f;if(e>=s)return m>0?y+(e-s)*(n-y)/m:y;let t=f;for(let n=0;n+1<l.length;n++){if(e>l[n+1]){t+=k[n];continue}const r=l[n+1]-l[n];return t+(r>0?(e-l[n])/r*k[n]:0)}return y};return{anchorsMs:e.anchorsMs,xs:e.xs.map(g),gaps:e.gaps.map(e=>({...e,fromPx:g(e.fromPx),toPx:g(e.toPx),px:g(e.toPx)-g(e.fromPx)})),xByMs:t=>g(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=f)return x>0?e*d/x:a;if(e>=y)return n-y>0?s+(e-y)*m/(n-y):s;let t=f;for(let n=0;n+1<l.length;n++){if(!(e>t+k[n]))return l[n]+(k[n]>0?(e-t)/k[n]*(l[n+1]-l[n]):0);t+=k[n]}return s})(t)),inCut:e.inCut}}function I(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function W({marks:e,innerRef:t}){/* @__PURE__ */
16
+ return x("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */x("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var b=1e-6;function $(e,t,n={}){const r=Number.isFinite(t)&&t>0?t:0,l=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(r<=0||l.length<2){const e=l[0]??0;return{anchorsMs:l,xs:l.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const a=l[l.length-1]-l[0],s=n.maxTimeShare??.3,i=Math.min(n.breakPx??48,r),o=n.minGapPx??48,c=[],u=[],d=[];for(let e=0;e+1<l.length;e++){const t=l[e+1]-l[e];c.push(t),u.push(a>0?t/a*r:0),d.push(a>0&&t/a>s)}const m=d.filter(Boolean).length,h=Math.max(0,r-m*i);let p=0,x=0;for(let e=0;e<c.length;e++)d[e]||(p+=c[e],x+=1);const f=c.map((e,t)=>d[t]?i:0===x?0:p>0?h*e/p:h/x),y=function(e,t,n){const r=e.slice();let l=0;for(let e=0;e<r.length;e++)t[e]||r[e]>=n-b||(l+=n-r[e],r[e]=n);if(l<=b)return r;let a=0;for(let e=0;e<r.length;e++)!t[e]&&r[e]>n+b&&(a+=r[e]-n);if(a<=b)return r;const s=Math.min(l,a);for(let e=0;e<r.length;e++)t[e]||r[e]<=n+b||(r[e]-=s*(r[e]-n)/a);return r}(f,d,o),k=y.reduce((e,t,n)=>d[n]?e:e+t,0),g=y.map((e,t)=>d[t]?e:k>0?e*h/k:e),M=[0];for(let e=0;e<g.length;e++)M.push(M[e]+g[e]);M[M.length-1]=r;const v=M.slice(0,-1).map((e,t)=>({fromMs:l[t],toMs:l[t+1],gapMs:c[t],fromPx:e,toPx:M[t+1],wantPx:u[t],clampedPx:f[t],px:M[t+1]-e,compressed:d[t]}));return{anchorsMs:l,xs:M,gaps:v,xByMs:e=>{if(!Number.isFinite(e)||e<=l[0])return 0;if(e>=l[l.length-1])return r;for(let t=0;t+1<l.length;t++){if(e>l[t+1])continue;const n=l[t+1]-l[t],r=n>0?(e-l[t])/n:0;return M[t]+r*(M[t+1]-M[t])}return r},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),r);for(let e=0;e+1<l.length;e++){if(t>M[e+1]&&e+2<l.length)continue;const n=M[e+1]-M[e],r=n>0?(t-M[e])/n:0;return l[e]+r*(l[e+1]-l[e])}return l[l.length-1]},inCut:e=>v.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function w(e,t,n){return Math.max(0,Math.min(e-t/2,Math.max(0,n-t)))}var P="mixed";function N(e,t){return 5.6*Math.max(e.length,t.length)+8}var C=(e,t,n)=>Math.min(Math.max(e,t),n),T=e=>-(Math.cos(Math.PI*e)-1)/2;function B(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const n=e.fromPx+(e.toPx-e.fromPx)*T(t);return{px:n,ms:e.msByPx(n)}}var L={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function D(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var K=e=>5.6*e.length,A={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},F={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function j(e,t,n){if("none"!==e.glyph)return e.glyph?e.glyph:A[t].glyph??(n?"flag":void 0)}function R(e,t,n=!1){const r=A[e],l=["rosh-tl-node","rosh-tl-mark",`is-${t}`];r.diamond&&l.push("is-diamond"),n&&l.push("is-provisional");const a="current"===t?"var(--tl-accent)":r.token??"var(--tl-accent)",s="dot"===t||n?{borderColor:a,color:a}:{backgroundColor:a,color:"var(--tl-on-kind)"};return{className:l.join(" "),style:s}}function U(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}function H(e,t){const[n,r]=d(0);return i(()=>{const n=t?e.current:null;if(!n)return;const l=()=>{const e=n.getBoundingClientRect().width;e>0&&r(e)};if(l(),"undefined"==typeof ResizeObserver)return;const a=new ResizeObserver(l);return a.observe(n),()=>{a.disconnect()}},[e,t]),n}function O(e,t,n){const r=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&r.set(e.x,Math.max(r.get(e.x)??0,e.widthPx));const l=[...r.keys()].sort((e,t)=>e-t);if(n<=0||l.length<2)return e;const a=Math.max(0,l[0]),s=Math.min(n,l[l.length-1]),i=s-a,o=[];for(let e=0;e+1<l.length;e++){const t=(r.get(l[e])??0)/2+(r.get(l[e+1])??0)/2+8;o.push(Math.max(28,t,l[e+1]-l[e]))}const c=o.reduce((e,t)=>e+t,0),u=Math.min(Math.max(c,i),.8*n);if(u<=i+.5)return e;const d=a,m=n-s,h=d+m,p=Math.max(0,n-u),x=h>0?p*d/h:0,f=x,y=x+u,k=o.map(e=>c>0?e*u/c:0),g=e=>{if(e<=a)return d>0?e*x/d:f;if(e>=s)return m>0?y+(e-s)*(n-y)/m:y;let t=f;for(let n=0;n+1<l.length;n++){if(e>l[n+1]){t+=k[n];continue}const r=l[n+1]-l[n];return t+(r>0?(e-l[n])/r*k[n]:0)}return y};return{anchorsMs:e.anchorsMs,xs:e.xs.map(g),gaps:e.gaps.map(e=>({...e,fromPx:g(e.fromPx),toPx:g(e.toPx),px:g(e.toPx)-g(e.fromPx)})),xByMs:t=>g(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=f)return x>0?e*d/x:a;if(e>=y)return n-y>0?s+(e-y)*m/(n-y):s;let t=f;for(let n=0;n+1<l.length;n++){if(!(e>t+k[n]))return l[n]+(k[n]>0?(e-t)/k[n]*(l[n+1]-l[n]):0);t+=k[n]}return s})(t)),inCut:e.inCut}}function I(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function W({marks:e,innerRef:t}){/* @__PURE__ */
17
17
  return x("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */f("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
18
18
  /* @__PURE__ */x("span",{className:"rosh-tl-name",children:e.label}),
19
19
  /* @__PURE__ */x("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function z({startMs:t,endMs:r,axis:l,geo:a,reveal:s}){const i=o().timeline,u=n(c()),d=a.ruler,m=[],h=[],p=l.gaps.filter(e=>e.compressed),y=new Date(t);y.setUTCDate(y.getUTCDate()+(8-y.getUTCDay())%7);for(let t=y.getTime();t<r;t+=7*e){if(l.inCut(t))continue;const n=l.xByMs(t);l.xByMs(t+7*e)-n<14||m.push(
@@ -74,7 +74,7 @@ return f("div",{children:[
74
74
  return f(y,{children:[
75
75
  /* @__PURE__ */x("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:s.rail-9+"px",height:"24px"},onPointerDown:e=>{K(e),D(L(e.clientX))},onPointerMove:F,onPointerUp:A,onPointerCancel:A}),
76
76
  /* @__PURE__ */x("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${w(P,88,m)+44}px`,top:`${s.tag}px`},children:n.chip?n.chip(N):t(N,b)}),
77
- /* @__PURE__ */x("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":n.ariaLabel??v.scrub,"aria-valuemin":0,"aria-valuemax":T&&T.length>0?T.length-1:R,"aria-valuenow":T&&T.length>0?Math.max(0,B):Math.round((r-i)/e),"aria-valuetext":j,style:{left:`${P}px`,top:`${s.rail+3}px`},onPointerDown:K,onPointerMove:F,onPointerUp:A,onPointerCancel:A,onKeyDown:t=>{const n=(t=>{const{key:n}=t;if(T&&T.length>0){const e=B<0?0:B;return"ArrowRight"===n||"ArrowUp"===n?T[Math.min(e+1,T.length-1)]:"ArrowLeft"===n||"ArrowDown"===n?T[Math.max(e-1,0)]:"Home"===n?T[0]:"End"===n?T[T.length-1]:null}const l=(t.shiftKey?7:1)*e;return"ArrowRight"===n||"ArrowUp"===n?r+l:"ArrowLeft"===n||"ArrowDown"===n?r-l:"Home"===n?i:"End"===n?d:null})(t);null!==n&&(t.preventDefault(),k?.(),D(n))}})]})}function Z(e,t,n){return(t?e.height:e.ruler+26)+(n?22:0)}function ee({startMs:n,endMs:k,axis:M="linear",items:v,markers:b=[],pending:w=[],fillToMs:ee,todayMs:te,labels:ne="lanes",activeKey:re=null,onActivate:le,thumb:ae,playback:se,edgeCaptions:ie,phases:oe=[],currentKey:ce,zoomRange:ue=null,motion:de=!0,ariaLabel:me,highlightKeys:he=null,onHoverChange:pe,endMark:xe=null}){const fe="none"===ne,ye=a(Date.now,null),ke=a(D,!1),ge=te??ye,Me=u(null),ve=o().timeline,be=c(),$e=e=>t(e,be),we=u(null),Pe=u(null),Ne=u(null),Ce=u(/* @__PURE__ */new Map),Te=u(void 0),Be=u(void 0),Le=u(null),[De,Ke]=d({}),[Ae,Fe]=d(null),[je,Re]=d(null),[Ue,He]=d(null),[Oe,Ie]=d(null),[We,ze]=d(null),[Se,Ee]=d(null),Xe=m(),Ve=m(),Ge=H(Me,!0),Je=Ge>0?Ge-(w.length>0&&!fe?176:0):0,Qe=Je>0&&Je-20<320,Ye=H(we,!Qe),_e=Ye>0?Ye:600,qe=L[ne],Ze=fe&&w.length>0,et=Ze?Math.max(0,_e-36):_e,tt=t=>t>=n-e&&t<=k+e,nt=v.filter(e=>Number.isFinite(e.ms)&&tt(e.ms)).slice().sort((e,t)=>e.ms-t.ms),rt="spread"===M?b.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],lt=$([n,...[...nt.map(e=>e.ms),...rt].filter(e=>e>n&&e<k),k],et,"compressed"===(at=M)?{}:"spread"===at?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var at;const st=lt.xByMs,it=nt.filter(e=>!e.provisional),ot=ce??(it.length>0?it[it.length-1].key:null),ct=nt.map((e,t)=>{const n=e.date??$e(e.ms),r=(e.priority??0)>0||"report"===e.kind,l=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?F[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:st(e.ms),baseX:st(e.ms),kind:l,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:j(e,l,0===t&&"default"===l),role:e.key===ot?"current":r?"dot":"key",widthPx:fe?Math.max(16,K(e.caption??"")+6):De[e.key]||N(e.label,n),collapsible:r,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),ut=b.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&tt(e)).map(({marker:e,ms:t})=>{const n=`marker-${e.id}`,r=$e(t);return{key:n,ms:t,x:st(t),baseX:st(t),kind:e.kind,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:e.glyph??A[e.kind].glyph,role:"key",widthPx:De[n]||N(e.label,r),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),dt=Ze?(()=>{const t=w[w.length-1],n=w.slice(0,-1).map(e=>e.label);return[{key:t.key,ms:k+e,x:_e,baseX:_e,kind:t.kind??"default",label:t.label,dateText:ve.notReached,detail:n.length>0?ve.alsoToCome(n):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],mt=fe&&xe&&!Ze?[{key:xe.key,ms:k,x:et,baseX:et,kind:"default",label:xe.label,dateText:xe.dateText??$e(k),detail:xe.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],ht=[...ct,...ut,...dt,...mt].sort((e,t)=>e.x-t.x||e.ms-t.ms),pt=ie?.start??ve.start($e(n)),xt=null==pt||!1===pt?0:"string"==typeof pt?Math.ceil(K(pt)):96,ft="lanes"===ne?function(e,t={}){const n=t.minPitchPx??40,r=[];let l=0;for(;l<e.length;){const t=e[l];if(!t.collapsible){r.push({type:"item",mark:t}),l+=1;continue}let a=l+1;for(;a<e.length&&e[a].collapsible&&e[a].kind===t.kind;)a+=1;const s=e.slice(l,a),i=s.length>1&&s.every((e,t)=>{if(0===t)return!0;const r=s[t-1],l=Math.max(n,Math.max(e.widthPx,r.widthPx)+8);return e.x-r.x<l});if(s.length>=3||i)r.push({type:"cluster",kind:t.kind,members:s});else for(const e of s)r.push({type:"item",mark:e});l=a}return r}(ht):[],yt=function(e,t=16){const n=[];let r=0;for(;r<e.length;){let l=r+1;for(;l<e.length&&e[l].x-e[l-1].x<t;)l+=1;if(l-r===1)n.push({type:"item",mark:e[r]});else{const t=e.slice(r,l),a=new Set(t.map(e=>e.kind));n.push({type:"cluster",kind:1===a.size?t[0].kind:P,members:t})}r=l}return n}(ht),kt=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,gt=/* @__PURE__ */new Map;for(const e of yt)if("cluster"===e.type)for(const t of e.members)gt.set(t.key,kt(e));const Mt=Ue??Oe??We,vt=ft.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Mt)??yt.find(e=>"cluster"===e.type&&kt(e)===Mt),bt=e=>({x:e.baseX,widthPx:e.widthPx}),$t=vt&&"cluster"===vt.type?vt.members.map(bt):ue?ht.filter(e=>e.ms>=ue[0]&&e.ms<=ue[1]).map(bt):[],wt=$t.length>1?O(lt,$t,et):lt,Pt=wt!==lt;if(Pt)for(const e of ht)e.isCap||(e.x=wt.xByMs(e.ms));const Nt=ht.some(e=>e.x<14),Ct=Pt&&vt?Mt:null,Tt=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Bt=Qe?ht.map(Tt):yt.flatMap(e=>{if("item"===e.type)return[Tt(e.mark)];const t=kt(e);if(t===Ct&&(n=e.members).every((e,t)=>0===t||e.x-n[t-1].x>=16))return e.members.map(Tt);var n;const r=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:r.reduce((e,t)=>e+t,0)/r.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Lt=/* @__PURE__ */new Map;for(const e of Bt)for(const t of e.members)Lt.set(t.key,e.key);const Dt=yt.find(e=>"cluster"===e.type&&kt(e)===Ct),Kt=Dt&&"cluster"===Dt.type?{from:Math.min(...Dt.members.map(e=>e.x))-16,to:Math.max(...Dt.members.map(e=>e.x))+16}:null,At=u(Ct),[Ft,jt]=d(!1);h(()=>{if(At.current===Ct)return;At.current=Ct,jt(!0);const e=setTimeout(()=>jt(!1),240);return()=>clearTimeout(e)},[Ct]);const Rt=ht.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");s(()=>{const e=Pe.current;if(!e)return;const t={};for(const n of Array.from(e.children)){const e=n.dataset.laneKey,r=n.getBoundingClientRect().width;e&&r>0&&(t[e]=r)}Ke(e=>function(e,t){const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Math.abs((e[n]??0)-(t[n]??0))<.5)}(e,t)?e:t)},[Rt]);const Ut=`${ne}|${M}|${ht.map(e=>`${e.key}@${e.ms}`).join("|")}`,[Ht,Ot]=d(Ut),It=de&&Ht===Ut;h(()=>{Ht!==Ut&&Ot(Ut)},[Ht,Ut]);const Wt=Math.min(28,340/Math.max(1,ht.length-1)),zt=I(ae?.stops),St=e=>{const t=Math.min(Math.max(e,n),k);if(!zt)return t;let r=zt[0];for(const e of zt)Math.abs(e-t)<Math.abs(r-t)&&(r=e);return r},Et=ae?St(ae.valueMs):null,Xt=se&&ae?ct.filter(e=>!zt||zt.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],Vt=function(e,t,n={}){const r=Number.isFinite(n.speed)&&(n.speed??0)>0?n.speed:1,l=Math.max(0,n.dwellMs??700)/r,a=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),s=[];for(let t=0;t+1<a.length;t++){const i=a[t],o=a[t+1],c=e.xByMs(i.ms),u=e.xByMs(o.ms),d=Math.max(0,u-c),m=d<=.5||n.reducedMotion?0:C(350*d/100,450,1400)/r;s.push({fromKey:i.key,toKey:o.key,fromMs:i.ms,toMs:o.ms,fromPx:c,toPx:u,lengthPx:d,durationMs:m,dwellMs:l,msByPx:e.msByPx})}return s}(wt,Xt,{speed:se?.speed,reducedMotion:ke}),[Gt,Jt]=d(null),Qt=u(null),Yt=u({segments:Vt,value:Et,playback:se});h(()=>{Yt.current={segments:Vt,value:Et,playback:se}});const _t=u(null),qt=p(e=>{null===e&&null===_t.current||(_t.current=e,Yt.current.playback?.onProgress?.(e))},[]),Zt=p(()=>{Qt.current=null,Jt(null),qt(null),Yt.current.playback?.onStop?.()},[qt]),en=!!se?.playing&&!!ae;h(()=>{if(!en)return;const e=Yt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void Zt();Qt.current&&Qt.current.index===t||(Qt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let n,r=0;const l=e=>Jt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),a=()=>{clearTimeout(n);const e=Qt.current;"rest"===e?.phase&&(n=setTimeout(s,Math.max(0,e.restLeftMs)))},s=()=>{const e=Qt.current;if("rest"!==e?.phase)return;const t=Yt.current.segments[e.index];t?(Qt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},l(B(t,0))):Zt()},i=e=>{const t=Yt.current,n=Qt.current;if(!n)return;const s=function(e,t,n){const r=e[t.index];if(!r)return{cursor:null,at:null,arrived:null,progress:null};const l=null===t.sinceMs?0:Math.max(0,n-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-l;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:n},at:B(r,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:n},at:B(r,0),arrived:null,progress:null}}const a=r.durationMs>0?Math.min(1,t.t+l/r.durationMs):1,s=B(r,a);if(a<1)return{cursor:{...t,t:a,sinceMs:n},at:s,arrived:null,progress:{fromKey:r.fromKey,toKey:r.toKey,t:T(a),ms:s.ms}};const i=e[t.index+1];return{cursor:i?{index:t.index+1,phase:"rest",t:0,restLeftMs:i.dwellMs,sinceMs:n}:null,at:s,arrived:{key:r.toKey,ms:r.toMs},progress:null}}(t.segments,n,e);Qt.current=s.cursor,s.at&&l(s.at),qt(s.progress),s.arrived&&t.playback?.onArrive(s.arrived.key,s.arrived.ms),s.cursor?(s.cursor.phase===n.phase&&s.cursor.index===n.index||a(),r=requestAnimationFrame(i)):Zt()};return a(),r=requestAnimationFrame(i),()=>{cancelAnimationFrame(r),clearTimeout(n),Qt.current&&(Qt.current.sinceMs=null,qt(null))}},[en,Zt,qt]);const tn=ct.filter(e=>!e.provisional),nn=ae?Gt?Gt.ms:Et:void 0!==ee?ee:tn.length>0?null===ge?tn[tn.length-1].ms:Math.min(tn[tn.length-1].ms,ge):null,rn=new Set(he??[]),ln=ht.filter(e=>rn.has(e.key)).map(e=>e.x),an=ln.length>0?{from:Math.min(...ln),to:Math.max(...ln)}:null,sn=p(()=>{clearTimeout(Te.current),clearTimeout(Be.current),Fe(null),Re(null),He(null),Ie(null),ze(null)},[]);h(()=>()=>{clearTimeout(Te.current),clearTimeout(Be.current)},[]),h(()=>{const e=Le.current;e&&(Le.current=null,Ce.current.get(e)?.focus())});const on=null!==je||null!==Ue||null!==Oe||null!==We;h(()=>{if(on)return i(e=>"Escape"===e.key&&(sn(),!0))},[on,sn]);const cn=p((e,t)=>{if(!e)return;const n=e.offsetWidth/2;let r=n>0?Math.max(n,Math.min(t,_e-n)):t;const a=e.parentElement;if(n>0&&a){const t=l(e),s=a.getBoundingClientRect().left,i=t.left+8+n-s,o=t.right-8-n-s;i<=o&&(r=Math.max(i,Math.min(r,o)))}e.style.left=`${r}px`,e.style.setProperty("--rosh-tl-arrow",`${n+(t-r)}px`)},[_e]),un=Bt.find(e=>e.key===je)??null,dn=un?un.x:0;s(()=>{cn(Ne.current,dn)},[cn,je,dn]);const mn=Et??void 0,hn=u(null);h(()=>{if(void 0===mn)return;const e=wt.xByMs(mn),t=hn.current;if(hn.current=e,null===t||e<=t)return;const n=[];for(const r of ht){if(r.x<=t||r.x>e)continue;const l=Ce.current.get(Lt.get(r.key)??r.key);l&&(l.classList.add("is-hit"),n.push(setTimeout(()=>l.classList.remove("is-hit"),460)))}return()=>{for(const e of n)clearTimeout(e)}},[mn]);const pn=Bt.map(e=>e.key),xn=ot?Lt.get(ot)??null:null,fn=Se&&pn.includes(Se)?Se:xn&&pn.includes(xn)?xn:pn[0],yn=e=>{const t=pn.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const n="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?pn.length-1:-1;n<0||n>pn.length-1||(e.preventDefault(),Ee(pn[n]),Ce.current.get(pn[n])?.focus())},kn=()=>clearTimeout(Be.current),gn=e=>{kn(),ze(e)},Mn=()=>{clearTimeout(Be.current),Be.current=setTimeout(()=>ze(null),260)},vn=e=>{Ct&&gt.get(e)===Ct?kn():(kn(),ze(null))},bn=e=>{clearTimeout(Te.current),Fe(e),Re(e),pe?.((e=>{const t=Bt.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},$n=e=>{Fe(t=>t===e?null:t),clearTimeout(Te.current),Te.current=setTimeout(()=>Re(t=>t===e?null:t),160),pe?.(null)},wn=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":U(e),"aria-describedby":je===e.key?Xe:void 0,tabIndex:e.key===fn?0:-1,ref:t=>{t?Ce.current.set(e.key,t):Ce.current.delete(e.key)},onMouseEnter:()=>{vn(e.key),bn(e.key)},onMouseLeave:()=>{Mn(),$n(e.key)},onFocus:()=>{vn(e.key),bn(e.key),Ee(e.key)},onBlur:()=>{Mn(),$n(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&le?.(e.key)}}),Pn=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,n=ve,n.events(t.length,t.map(U))),"aria-describedby":je===e.key?Xe:void 0,tabIndex:e.key===fn?0:-1,ref:t=>{t?Ce.current.set(e.key,t):Ce.current.delete(e.key)},onMouseEnter:()=>{e.openable?gn(e.key):bn(e.key)},onMouseLeave:()=>{Mn(),$n(e.key)},onFocus:()=>{kn(),bn(e.key),Ee(e.key)},onBlur:()=>{Mn(),$n(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void bn(e.key);gn(e.key);const n=e.members[0];Ee(n.key),Le.current=n.key}};var t,n},Nn="lanes"!==ne||ht.length>1;if(Qe)/* @__PURE__ */
77
+ /* @__PURE__ */x("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":n.ariaLabel??v.scrub,"aria-valuemin":0,"aria-valuemax":T&&T.length>0?T.length-1:R,"aria-valuenow":T&&T.length>0?Math.max(0,B):Math.round((r-i)/e),"aria-valuetext":j,style:{left:`${P}px`,top:`${s.rail+3}px`},onPointerDown:K,onPointerMove:F,onPointerUp:A,onPointerCancel:A,onKeyDown:t=>{const n=(t=>{const{key:n}=t;if(T&&T.length>0){const e=B<0?0:B;return"ArrowRight"===n||"ArrowUp"===n?T[Math.min(e+1,T.length-1)]:"ArrowLeft"===n||"ArrowDown"===n?T[Math.max(e-1,0)]:"Home"===n?T[0]:"End"===n?T[T.length-1]:null}const l=(t.shiftKey?7:1)*e;return"ArrowRight"===n||"ArrowUp"===n?r+l:"ArrowLeft"===n||"ArrowDown"===n?r-l:"Home"===n?i:"End"===n?d:null})(t);null!==n&&(t.preventDefault(),k?.(),D(n))}})]})}function Z(e,t,n){return(t?e.height:e.ruler+26)+(n?22:0)}function ee({startMs:n,endMs:k,axis:M="linear",items:v,markers:b=[],pending:w=[],fillToMs:ee,todayMs:te,labels:ne="lanes",activeKey:re=null,onActivate:le,thumb:ae,playback:se,edgeCaptions:ie,phases:oe=[],currentKey:ce,zoomRange:ue=null,motion:de=!0,ariaLabel:me,highlightKeys:he=null,onHoverChange:pe,endMark:xe=null}){const fe="none"===ne,ye=s(Date.now,null),ke=s(D,!1),ge=te??ye,Me=u(null),ve=o().timeline,be=c(),$e=e=>t(e,be),we=u(null),Pe=u(null),Ne=u(null),Ce=u(/* @__PURE__ */new Map),Te=u(void 0),Be=u(void 0),Le=u(null),[De,Ke]=d({}),[Ae,Fe]=d(null),[je,Re]=d(null),[Ue,He]=d(null),[Oe,Ie]=d(null),[We,ze]=d(null),[Se,Ee]=d(null),Xe=m(),Ve=m(),Ge=H(Me,!0),Je=Ge>0?Ge-(w.length>0&&!fe?176:0):0,Qe=Je>0&&Je-20<320,Ye=H(we,!Qe),_e=Ye>0?Ye:600,qe=L[ne],Ze=fe&&w.length>0,et=Ze?Math.max(0,_e-36):_e,tt=t=>t>=n-e&&t<=k+e,nt=v.filter(e=>Number.isFinite(e.ms)&&tt(e.ms)).slice().sort((e,t)=>e.ms-t.ms),rt="spread"===M?b.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],lt=$([n,...[...nt.map(e=>e.ms),...rt].filter(e=>e>n&&e<k),k],et,"compressed"===(at=M)?{}:"spread"===at?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var at;const st=lt.xByMs,it=nt.filter(e=>!e.provisional),ot=ce??(it.length>0?it[it.length-1].key:null),ct=nt.map((e,t)=>{const n=e.date??$e(e.ms),r=(e.priority??0)>0||"report"===e.kind,l=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?F[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:st(e.ms),baseX:st(e.ms),kind:l,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:j(e,l,0===t&&"default"===l),role:e.key===ot?"current":r?"dot":"key",widthPx:fe?Math.max(16,K(e.caption??"")+6):De[e.key]||N(e.label,n),collapsible:r,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),ut=b.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&tt(e)).map(({marker:e,ms:t})=>{const n=`marker-${e.id}`,r=$e(t);return{key:n,ms:t,x:st(t),baseX:st(t),kind:e.kind,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:e.glyph??A[e.kind].glyph,role:"key",widthPx:De[n]||N(e.label,r),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),dt=Ze?(()=>{const t=w[w.length-1],n=w.slice(0,-1).map(e=>e.label);return[{key:t.key,ms:k+e,x:_e,baseX:_e,kind:t.kind??"default",label:t.label,dateText:ve.notReached,detail:n.length>0?ve.alsoToCome(n):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],mt=fe&&xe&&!Ze?[{key:xe.key,ms:k,x:et,baseX:et,kind:"default",label:xe.label,dateText:xe.dateText??$e(k),detail:xe.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],ht=[...ct,...ut,...dt,...mt].sort((e,t)=>e.x-t.x||e.ms-t.ms),pt=ie?.start??ve.start($e(n)),xt=null==pt||!1===pt?0:"string"==typeof pt?Math.ceil(K(pt)):96,ft="lanes"===ne?function(e,t={}){const n=t.minPitchPx??40,r=[];let l=0;for(;l<e.length;){const t=e[l];if(!t.collapsible){r.push({type:"item",mark:t}),l+=1;continue}let a=l+1;for(;a<e.length&&e[a].collapsible&&e[a].kind===t.kind;)a+=1;const s=e.slice(l,a),i=s.length>1&&s.every((e,t)=>{if(0===t)return!0;const r=s[t-1],l=Math.max(n,Math.max(e.widthPx,r.widthPx)+8);return e.x-r.x<l});if(s.length>=3||i)r.push({type:"cluster",kind:t.kind,members:s});else for(const e of s)r.push({type:"item",mark:e});l=a}return r}(ht):[],yt=function(e,t=16){const n=[];let r=0;for(;r<e.length;){let l=r+1;for(;l<e.length&&e[l].x-e[l-1].x<t;)l+=1;if(l-r===1)n.push({type:"item",mark:e[r]});else{const t=e.slice(r,l),a=new Set(t.map(e=>e.kind));n.push({type:"cluster",kind:1===a.size?t[0].kind:P,members:t})}r=l}return n}(ht),kt=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,gt=/* @__PURE__ */new Map;for(const e of yt)if("cluster"===e.type)for(const t of e.members)gt.set(t.key,kt(e));const Mt=Ue??Oe??We,vt=ft.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Mt)??yt.find(e=>"cluster"===e.type&&kt(e)===Mt),bt=e=>({x:e.baseX,widthPx:e.widthPx}),$t=vt&&"cluster"===vt.type?vt.members.map(bt):ue?ht.filter(e=>e.ms>=ue[0]&&e.ms<=ue[1]).map(bt):[],wt=$t.length>1?O(lt,$t,et):lt,Pt=wt!==lt;if(Pt)for(const e of ht)e.isCap||(e.x=wt.xByMs(e.ms));const Nt=ht.some(e=>e.x<14),Ct=Pt&&vt?Mt:null,Tt=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Bt=Qe?ht.map(Tt):yt.flatMap(e=>{if("item"===e.type)return[Tt(e.mark)];const t=kt(e);if(t===Ct&&(n=e.members).every((e,t)=>0===t||e.x-n[t-1].x>=16))return e.members.map(Tt);var n;const r=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:r.reduce((e,t)=>e+t,0)/r.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Lt=/* @__PURE__ */new Map;for(const e of Bt)for(const t of e.members)Lt.set(t.key,e.key);const Dt=yt.find(e=>"cluster"===e.type&&kt(e)===Ct),Kt=Dt&&"cluster"===Dt.type?{from:Math.min(...Dt.members.map(e=>e.x))-16,to:Math.max(...Dt.members.map(e=>e.x))+16}:null,At=u(Ct),[Ft,jt]=d(!1);h(()=>{if(At.current===Ct)return;At.current=Ct,jt(!0);const e=setTimeout(()=>jt(!1),240);return()=>clearTimeout(e)},[Ct]);const Rt=ht.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");i(()=>{const e=Pe.current;if(!e)return;const t={};for(const n of Array.from(e.children)){const e=n.dataset.laneKey,r=n.getBoundingClientRect().width;e&&r>0&&(t[e]=r)}Ke(e=>function(e,t){const n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Math.abs((e[n]??0)-(t[n]??0))<.5)}(e,t)?e:t)},[Rt]);const Ut=`${ne}|${M}|${ht.map(e=>`${e.key}@${e.ms}`).join("|")}`,[Ht,Ot]=d(Ut),It=de&&Ht===Ut;h(()=>{Ht!==Ut&&Ot(Ut)},[Ht,Ut]);const Wt=Math.min(28,340/Math.max(1,ht.length-1)),zt=I(ae?.stops),St=e=>{const t=Math.min(Math.max(e,n),k);if(!zt)return t;let r=zt[0];for(const e of zt)Math.abs(e-t)<Math.abs(r-t)&&(r=e);return r},Et=ae?St(ae.valueMs):null,Xt=se&&ae?ct.filter(e=>!zt||zt.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],Vt=function(e,t,n={}){const r=Number.isFinite(n.speed)&&(n.speed??0)>0?n.speed:1,l=Math.max(0,n.dwellMs??700)/r,a=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),s=[];for(let t=0;t+1<a.length;t++){const i=a[t],o=a[t+1],c=e.xByMs(i.ms),u=e.xByMs(o.ms),d=Math.max(0,u-c),m=d<=.5||n.reducedMotion?0:C(350*d/100,450,1400)/r;s.push({fromKey:i.key,toKey:o.key,fromMs:i.ms,toMs:o.ms,fromPx:c,toPx:u,lengthPx:d,durationMs:m,dwellMs:l,msByPx:e.msByPx})}return s}(wt,Xt,{speed:se?.speed,reducedMotion:ke}),[Gt,Jt]=d(null),Qt=u(null),Yt=u({segments:Vt,value:Et,playback:se});h(()=>{Yt.current={segments:Vt,value:Et,playback:se}});const _t=u(null),qt=p(e=>{null===e&&null===_t.current||(_t.current=e,Yt.current.playback?.onProgress?.(e))},[]),Zt=p(()=>{Qt.current=null,Jt(null),qt(null),Yt.current.playback?.onStop?.()},[qt]),en=!!se?.playing&&!!ae;h(()=>{if(!en)return;const e=Yt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void Zt();Qt.current&&Qt.current.index===t||(Qt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let n,r=0;const l=e=>Jt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),a=()=>{clearTimeout(n);const e=Qt.current;"rest"===e?.phase&&(n=setTimeout(s,Math.max(0,e.restLeftMs)))},s=()=>{const e=Qt.current;if("rest"!==e?.phase)return;const t=Yt.current.segments[e.index];t?(Qt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},l(B(t,0))):Zt()},i=e=>{const t=Yt.current,n=Qt.current;if(!n)return;const s=function(e,t,n){const r=e[t.index];if(!r)return{cursor:null,at:null,arrived:null,progress:null};const l=null===t.sinceMs?0:Math.max(0,n-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-l;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:n},at:B(r,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:n},at:B(r,0),arrived:null,progress:null}}const a=r.durationMs>0?Math.min(1,t.t+l/r.durationMs):1,s=B(r,a);if(a<1)return{cursor:{...t,t:a,sinceMs:n},at:s,arrived:null,progress:{fromKey:r.fromKey,toKey:r.toKey,t:T(a),ms:s.ms}};const i=e[t.index+1];return{cursor:i?{index:t.index+1,phase:"rest",t:0,restLeftMs:i.dwellMs,sinceMs:n}:null,at:s,arrived:{key:r.toKey,ms:r.toMs},progress:null}}(t.segments,n,e);Qt.current=s.cursor,s.at&&l(s.at),qt(s.progress),s.arrived&&t.playback?.onArrive(s.arrived.key,s.arrived.ms),s.cursor?(s.cursor.phase===n.phase&&s.cursor.index===n.index||a(),r=requestAnimationFrame(i)):Zt()};return a(),r=requestAnimationFrame(i),()=>{cancelAnimationFrame(r),clearTimeout(n),Qt.current&&(Qt.current.sinceMs=null,qt(null))}},[en,Zt,qt]);const tn=ct.filter(e=>!e.provisional),nn=ae?Gt?Gt.ms:Et:void 0!==ee?ee:tn.length>0?null===ge?tn[tn.length-1].ms:Math.min(tn[tn.length-1].ms,ge):null,rn=new Set(he??[]),ln=ht.filter(e=>rn.has(e.key)).map(e=>e.x),an=ln.length>0?{from:Math.min(...ln),to:Math.max(...ln)}:null,sn=p(()=>{clearTimeout(Te.current),clearTimeout(Be.current),Fe(null),Re(null),He(null),Ie(null),ze(null)},[]);h(()=>()=>{clearTimeout(Te.current),clearTimeout(Be.current)},[]),h(()=>{const e=Le.current;e&&(Le.current=null,Ce.current.get(e)?.focus())});const on=null!==je||null!==Ue||null!==Oe||null!==We;h(()=>{if(on)return a(e=>"Escape"===e.key&&(sn(),!0))},[on,sn]);const cn=p((e,t)=>{if(!e)return;const n=e.offsetWidth/2;let r=n>0?Math.max(n,Math.min(t,_e-n)):t;const a=e.parentElement;if(n>0&&a){const t=l(e),s=a.getBoundingClientRect().left,i=t.left+8+n-s,o=t.right-8-n-s;i<=o&&(r=Math.max(i,Math.min(r,o)))}e.style.left=`${r}px`,e.style.setProperty("--rosh-tl-arrow",`${n+(t-r)}px`)},[_e]),un=Bt.find(e=>e.key===je)??null,dn=un?un.x:0;i(()=>{cn(Ne.current,dn)},[cn,je,dn]);const mn=Et??void 0,hn=u(null);h(()=>{if(void 0===mn)return;const e=wt.xByMs(mn),t=hn.current;if(hn.current=e,null===t||e<=t)return;const n=[];for(const r of ht){if(r.x<=t||r.x>e)continue;const l=Ce.current.get(Lt.get(r.key)??r.key);l&&(l.classList.add("is-hit"),n.push(setTimeout(()=>l.classList.remove("is-hit"),460)))}return()=>{for(const e of n)clearTimeout(e)}},[mn]);const pn=Bt.map(e=>e.key),xn=ot?Lt.get(ot)??null:null,fn=Se&&pn.includes(Se)?Se:xn&&pn.includes(xn)?xn:pn[0],yn=e=>{const t=pn.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const n="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?pn.length-1:-1;n<0||n>pn.length-1||(e.preventDefault(),Ee(pn[n]),Ce.current.get(pn[n])?.focus())},kn=()=>clearTimeout(Be.current),gn=e=>{kn(),ze(e)},Mn=()=>{clearTimeout(Be.current),Be.current=setTimeout(()=>ze(null),260)},vn=e=>{Ct&&gt.get(e)===Ct?kn():(kn(),ze(null))},bn=e=>{clearTimeout(Te.current),Fe(e),Re(e),pe?.((e=>{const t=Bt.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},$n=e=>{Fe(t=>t===e?null:t),clearTimeout(Te.current),Te.current=setTimeout(()=>Re(t=>t===e?null:t),160),pe?.(null)},wn=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":U(e),"aria-describedby":je===e.key?Xe:void 0,tabIndex:e.key===fn?0:-1,ref:t=>{t?Ce.current.set(e.key,t):Ce.current.delete(e.key)},onMouseEnter:()=>{vn(e.key),bn(e.key)},onMouseLeave:()=>{Mn(),$n(e.key)},onFocus:()=>{vn(e.key),bn(e.key),Ee(e.key)},onBlur:()=>{Mn(),$n(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&le?.(e.key)}}),Pn=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,n=ve,n.events(t.length,t.map(U))),"aria-describedby":je===e.key?Xe:void 0,tabIndex:e.key===fn?0:-1,ref:t=>{t?Ce.current.set(e.key,t):Ce.current.delete(e.key)},onMouseEnter:()=>{e.openable?gn(e.key):bn(e.key)},onMouseLeave:()=>{Mn(),$n(e.key)},onFocus:()=>{kn(),bn(e.key),Ee(e.key)},onBlur:()=>{Mn(),$n(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void bn(e.key);gn(e.key);const n=e.members[0];Ee(n.key),Le.current=n.key}};var t,n},Nn="lanes"!==ne||ht.length>1;if(Qe)/* @__PURE__ */
78
78
  return x("div",{ref:Me,children:/* @__PURE__ */x(E,{marks:ht.filter(e=>!e.isCap),pending:w,currentKey:ot,todayMs:ge,reveal:It,ariaLabel:me,step:Wt,nodeProps:wn,onKeyDown:yn})});const Cn=(e,t)=>null==e||!1===e?null:/* @__PURE__ */x("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:qe.rail-3+"px"},children:e});/* @__PURE__ */
79
79
  return f("div",{ref:Me,className:"rosh-tl-body"+(w.length>0&&!fe?"":" is-solo"),children:[
80
80
  /* @__PURE__ */f("div",{className:"flex items-stretch gap-3",children:[fe&&Cn(pt,!1),
@@ -1,3 +1,3 @@
1
- import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-TXDA7TTP.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{OneLineLabel as r}from"./chunk-MVZRZTQP.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
1
+ import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-EQZZ4V5X.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{OneLineLabel as r}from"./chunk-S5SRXI4V.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
2
2
  return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
3
3
  /* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
@@ -1,14 +1,14 @@
1
- import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-LJN77RG6.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-2UO47XB4.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as y}from"./chunk-F27JJHNJ.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{useShellStrings as k}from"./chunk-GDQJBQ5B.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as H,useEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as O}from"react/jsx-runtime";var I=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),j=f??D,H=w(),S=/* @__PURE__ */C("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?H:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
1
+ import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-LJN77RG6.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-2UO47XB4.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-F27JJHNJ.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useBrowserLayoutEffect as x}from"./chunk-D65T4H6J.js";import{useShellStrings as k}from"./chunk-GDQJBQ5B.js";import{forwardRef as N,useId as w,useState as $,useRef as D,useMemo as j,useCallback as H,useEffect as S}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as O}from"react/jsx-runtime";var I=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=N(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const N=t,$=k(),D=d(),j=f??D,H=w(),S=/* @__PURE__ */C("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?H:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
2
2
  /* @__PURE__ */E(B,{items:r})]});return j?/* @__PURE__ */C(O,{children:[S,
3
3
  /* @__PURE__ */E("span",{id:H,hidden:!0,children:$.settingView.auto})]}):S});function B({items:e}){const t=e=>/* @__PURE__ */E("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
- return E(O,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var U=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:U,className:A="",id:J,disabled:R,size:K,touchSize:V,title:G,multiple:L,renderOption:P,renderValue:W,valueText:F,readOnly:M=!1,footer:Y,changed:Q=!1,auto:X,"aria-describedby":q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!Y?.length,me="sm"===K,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=J??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),He=X??je,Se=`${ke}-auto`,Te=[q,Q?De:void 0,He?Se:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(N),[N]),Ee=L?l:[],Oe=u,Ie=f(oe,re,{matchTriggerWidth:!0,...Y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Ie?.top}|${Ie?.bottom}|${Ie?.maxHeight}|${N.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Be=L?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ue=L?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:Be>=0?Ce[Be].label:void 0,Ae=!L&&Be>=0?Ce[Be].lang:void 0,Je=L?Ce.filter(e=>Ee.includes(e.value)):Be>=0?[Ce[Be]]:[],Re=W&&Je.length?W(Je):void 0,Ke=void 0!==Re&&F?F(Je):void 0,Ve=H((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Ge=H(()=>{R||M||(ae(Be>=0?Be:e(Ce)),ie(!0))},[R,M,Ce,Be]),Le=H(e=>{const t=Ce[e];if(t&&!t.disabled){if(L){const r=l;return Oe(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Oe(t.value),Ve()}},[Ce,L,l,Oe,Ve]);S(()=>{if(!re)return;return x(e=>!("Escape"!==e.key||!ye.current)&&(Ve(),!0),ue)},[re,Ve]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Ve(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ve(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Ve]),S(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Pe=H(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Be,n=t(Ce,r.buffer,i);n<0||(re?ae(n):L?(ae(n),ie(!0)):Le(n))},[re,ne,Be,Ce,Le,L]),We=re?a(N,(e,t)=>{const r=(i=e.value,L?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
4
+ return E(O,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var U=N(function({value:l,onChange:u,options:N,placeholder:z,invalid:U,className:A="",id:J,disabled:R,size:K,touchSize:V,title:G,multiple:L,renderOption:P,renderValue:W,valueText:F,readOnly:M=!1,footer:Y,changed:Q=!1,auto:X,"aria-describedby":q,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!Y?.length,me="sm"===K,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=k(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),ke=w(),Ne=`${ke}-listbox`,we=J??`${ke}-trigger`,$e=e=>`${ke}-opt-${e}`,De=`${ke}-changed`,je=d(),He=X??je,Se=`${ke}-auto`,Te=[q,Q?De:void 0,He?Se:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(N),[N]),Ee=L?l:[],Oe=u,Ie=f(oe,re,{matchTriggerWidth:!0,...Y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Ie?.top}|${Ie?.bottom}|${Ie?.maxHeight}|${N.length}`;x(()=>{be(null)},[ze]),x(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Be=L?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ue=L?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:Be>=0?Ce[Be].label:void 0,Ae=!L&&Be>=0?Ce[Be].lang:void 0,Je=L?Ce.filter(e=>Ee.includes(e.value)):Be>=0?[Ce[Be]]:[],Re=W&&Je.length?W(Je):void 0,Ke=void 0!==Re&&F?F(Je):void 0,Ve=H((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Ge=H(()=>{R||M||(ae(Be>=0?Be:e(Ce)),ie(!0))},[R,M,Ce,Be]),Le=H(e=>{const t=Ce[e];if(t&&!t.disabled){if(L){const r=l;return Oe(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Oe(t.value),Ve()}},[Ce,L,l,Oe,Ve]);S(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Ve(),!0),ue)},[re,Ve]),S(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Ve(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Ve(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Ve]),S(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Pe=H(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Be,n=t(Ce,r.buffer,i);n<0||(re?ae(n):L?(ae(n),ie(!0)):Le(n))},[re,ne,Be,Ce,Le,L]),We=re?a(N,(e,t)=>{const r=(i=e.value,L?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
5
5
  return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||P?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>Le(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${L?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[L&&/* @__PURE__ */E(o,{selected:r}),P?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1 truncate",children:P(e,{selected:r,active:n})}):L?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
6
6
  /* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
7
  /* @__PURE__ */C(O,{children:[
8
8
  /* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:I(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.label]},e.value)},ke,"mx-1"):null,Fe=void 0!==Re?
9
9
  /* @__PURE__ */C("span",{className:"relative block min-w-0 truncate",children:[
10
10
  /* @__PURE__ */E("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Re}),
11
- /* @__PURE__ */E("span",{lang:void 0===Ke?Ae:void 0,className:"sr-only",children:Ke??Ue})]}):/* @__PURE__ */E("span",{lang:Ae,className:`block truncate ${void 0===Ue?c:""}`,children:Ue??z??" "}),Me={zIndex:h.popup,left:Ie?.left,top:Ie?.top,bottom:Ie?.bottom,width:Ie?.width,maxHeight:Ie?.maxHeight??b,visibility:Ie?void 0:"hidden",...y()},Ye=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":L||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Me,maxHeight:fe}:Me,children:We}),Qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Me,children:[Ye,
11
+ /* @__PURE__ */E("span",{lang:void 0===Ke?Ae:void 0,className:"sr-only",children:Ke??Ue})]}):/* @__PURE__ */E("span",{lang:Ae,className:`block truncate ${void 0===Ue?c:""}`,children:Ue??z??" "}),Me={zIndex:h.popup,left:Ie?.left,top:Ie?.top,bottom:Ie?.bottom,width:Ie?.width,maxHeight:Ie?.maxHeight??b,visibility:Ie?void 0:"hidden",...g()},Ye=/* @__PURE__ */E("div",{ref:de,id:Ne,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":L||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Me,maxHeight:fe}:Me,children:We}),Qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Me,children:[Ye,
12
12
  /* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:Y.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Ve(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(Y?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Ve());case"Escape":return e.preventDefault(),e.stopPropagation(),void Ve()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */E(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
13
  /* @__PURE__ */E("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Ye;/* @__PURE__ */
14
14
  return C("div",{ref:le,className:"relative",children:[