efficient-shell 8.34.0 → 8.35.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 (225) hide show
  1. package/README.md +9 -0
  2. package/dist/{Browser-QBAMRKYI.js → Browser-F67PEY2U.js} +14 -14
  3. package/dist/Calculator-6ZU5MKTQ.js +29 -0
  4. package/dist/CurrencyConverter-Z6L7QAZU.js +21 -0
  5. package/dist/{Documents-E3GMXALJ.js → Documents-MQDSI27F.js} +25 -25
  6. package/dist/{Files-2DWPYRM5.js → Files-DEC4KVQM.js} +43 -43
  7. package/dist/Notepad-2IRVJ7MB.js +25 -0
  8. package/dist/PdfViewer-KSLOYXMD.js +1 -0
  9. package/dist/{PomodoroTimer-2HPCAEI5.js → PomodoroTimer-TRGMI4YT.js} +44 -44
  10. package/dist/{Preview-VZYFOH2U.js → Preview-PXOEKXSR.js} +17 -17
  11. package/dist/Sidebar-QQFJJWE2.js +43 -0
  12. package/dist/Spreadsheet-WROI4P6D.js +37 -0
  13. package/dist/Stock-SUDCDSUL.js +16 -0
  14. package/dist/{Weather-DS4YZ6SH.js → Weather-WQE4ZQAL.js} +18 -18
  15. package/dist/{WorldClock-7S4TITSF.js → WorldClock-2AGEYLZP.js} +6 -6
  16. package/dist/ai/index.d.ts +47 -9
  17. package/dist/ai/index.js +38 -33
  18. package/dist/ai.css +1 -1
  19. package/dist/apps/index.js +1 -1
  20. package/dist/bin/media-host-check.js +1 -1
  21. package/dist/bin/ui-check.js +1 -1
  22. package/dist/charts/BoxPlotChart.js +1 -1
  23. package/dist/charts/CandlestickChart.js +1 -1
  24. package/dist/charts/CartesianPlot.js +1 -1
  25. package/dist/charts/ChordChart.js +1 -1
  26. package/dist/charts/ColumnChart.js +1 -1
  27. package/dist/charts/HeatmapChart.js +1 -1
  28. package/dist/charts/HistogramChart.js +1 -1
  29. package/dist/charts/RadarChart.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-Z2YGQBLZ.js → chunk-2C6IG7LG.js} +1 -1
  39. package/dist/chunk-2EOQDYGM.js +29 -0
  40. package/dist/{chunk-7CFH6Y4T.js → chunk-2F7ZOMKK.js} +1 -1
  41. package/dist/chunk-2PWZNFFP.js +19 -0
  42. package/dist/{chunk-KIBL6M3T.js → chunk-2SHYR3RA.js} +4 -3
  43. package/dist/{chunk-G433MKIN.js → chunk-2U2GJCSP.js} +5 -5
  44. package/dist/{chunk-EYX6KLCZ.js → chunk-37CCKGHU.js} +1 -1
  45. package/dist/{chunk-BQ2IPQNR.js → chunk-3RPIPYLU.js} +1 -1
  46. package/dist/chunk-4AJRHTTB.js +1 -0
  47. package/dist/{chunk-XWLWG4HS.js → chunk-4GVH4ZUH.js} +1 -1
  48. package/dist/{chunk-GIM2422N.js → chunk-4HCRZHIX.js} +1 -1
  49. package/dist/{chunk-MXHEREC6.js → chunk-4MO375G3.js} +3 -3
  50. package/dist/chunk-5FCEBKT2.js +7 -0
  51. package/dist/{chunk-DGLCMYSQ.js → chunk-5N5DBTTF.js} +11 -11
  52. package/dist/{chunk-PNQ4EYYM.js → chunk-5YELPBUT.js} +3 -3
  53. package/dist/{chunk-QDOTMA3W.js → chunk-64ZHCEZN.js} +1 -1
  54. package/dist/{chunk-Y2D2YMFY.js → chunk-6ANFVX4M.js} +12 -12
  55. package/dist/{chunk-T5SEGUCJ.js → chunk-7ACSSYEZ.js} +13 -13
  56. package/dist/{chunk-GI7FOLDX.js → chunk-ACW3J77L.js} +1 -1
  57. package/dist/{chunk-ERMZ75FO.js → chunk-AF7R2MV4.js} +1 -1
  58. package/dist/{chunk-QQK3XS6H.js → chunk-AZU7YOES.js} +8 -8
  59. package/dist/{chunk-NFR4QZL2.js → chunk-BHMUOWAE.js} +4 -4
  60. package/dist/{chunk-TFMC2WAS.js → chunk-BKZGI76S.js} +1 -1
  61. package/dist/{chunk-UB4BTRSB.js → chunk-BYCOB6WT.js} +1 -1
  62. package/dist/{chunk-LCM5U6BY.js → chunk-CCPNMYCK.js} +1 -1
  63. package/dist/{chunk-RAAUW5OZ.js → chunk-DG2WU3BU.js} +2 -2
  64. package/dist/chunk-DIN3EFOM.js +14 -0
  65. package/dist/{chunk-WJ3XSJ6B.js → chunk-EBC4XFL2.js} +1 -1
  66. package/dist/{chunk-37JDUDCO.js → chunk-ECCUEG3J.js} +1 -1
  67. package/dist/{chunk-4C4SQ4YW.js → chunk-EM6BEHAD.js} +8 -8
  68. package/dist/{chunk-W5M6P4DZ.js → chunk-ETF7LAYZ.js} +5 -5
  69. package/dist/{chunk-LEC4SZIV.js → chunk-EVB35JP5.js} +1 -1
  70. package/dist/{chunk-FL2PUQX7.js → chunk-EW6FRPFJ.js} +1 -1
  71. package/dist/{chunk-JCMP5KMS.js → chunk-EZY4CO4A.js} +6 -6
  72. package/dist/chunk-F2AEP37B.js +4 -0
  73. package/dist/{chunk-PJCVNFWM.js → chunk-FKZEGBLK.js} +10 -10
  74. package/dist/{chunk-DTSCO7VM.js → chunk-FMKTVZAO.js} +1 -1
  75. package/dist/{chunk-IZCODCSC.js → chunk-FTKKGGOQ.js} +1 -1
  76. package/dist/{chunk-FFJVCLGH.js → chunk-G2MJTE6X.js} +11 -11
  77. package/dist/{chunk-3BPF6PP3.js → chunk-G2V2ADJQ.js} +2 -2
  78. package/dist/{chunk-EZGY6CFN.js → chunk-GK3QH63P.js} +1 -1
  79. package/dist/{chunk-3WC6ITJ3.js → chunk-H33Z4ZIY.js} +6 -6
  80. package/dist/{chunk-CPXHU3Y2.js → chunk-HAIMJAI4.js} +2 -2
  81. package/dist/chunk-HMHL27AU.js +6 -0
  82. package/dist/{chunk-RSO67DWS.js → chunk-I4VD5D43.js} +4 -4
  83. package/dist/{chunk-BIYL7CEI.js → chunk-IFDW5QW6.js} +2 -2
  84. package/dist/{chunk-4AAGZQX7.js → chunk-IHEEJO5S.js} +1 -1
  85. package/dist/{chunk-WQNIXV4T.js → chunk-IUCIYWTT.js} +8 -8
  86. package/dist/chunk-JBQWR4SX.js +8 -0
  87. package/dist/{chunk-AX7KPMDV.js → chunk-JDKRQG7X.js} +2 -2
  88. package/dist/chunk-JE6TBZGY.js +8 -0
  89. package/dist/{chunk-LBLV64XG.js → chunk-JUGPTBMS.js} +1 -1
  90. package/dist/{chunk-BUGAWNOC.js → chunk-JVIOAZHW.js} +4 -4
  91. package/dist/{chunk-B2XDNBR3.js → chunk-L3G3YHVN.js} +1 -1
  92. package/dist/{chunk-ZEKM6HAA.js → chunk-M2AIC7IK.js} +2 -2
  93. package/dist/{chunk-KDZUWQEG.js → chunk-M2KV4WKR.js} +1 -1
  94. package/dist/{chunk-H3BC4KDE.js → chunk-M2LLVSBR.js} +1 -1
  95. package/dist/{chunk-SAKHGHF5.js → chunk-MC43PRTL.js} +1 -1
  96. package/dist/{chunk-USYNZGY4.js → chunk-MICWRC72.js} +7 -7
  97. package/dist/{chunk-ZN3O2KJ7.js → chunk-MOD4PGVF.js} +10 -10
  98. package/dist/{chunk-WTY3SXO7.js → chunk-MY755PTJ.js} +1 -1
  99. package/dist/chunk-NKZNPYDB.js +3 -0
  100. package/dist/{chunk-YSFLXPUS.js → chunk-NUSSZJF2.js} +5 -5
  101. package/dist/{chunk-RGBX3EVC.js → chunk-O2YAB6WK.js} +8 -8
  102. package/dist/{chunk-3J5QUHPO.js → chunk-OFKWTOXK.js} +3 -3
  103. package/dist/{chunk-ZT5Y5JZB.js → chunk-P42YNSKI.js} +4 -4
  104. package/dist/{chunk-L3NYH4QV.js → chunk-PAB2ZU4F.js} +37 -37
  105. package/dist/{chunk-KKSW5IZ7.js → chunk-PCKYNZ5Y.js} +5 -5
  106. package/dist/{chunk-RUQEB2ZC.js → chunk-R4C3GGCS.js} +3 -3
  107. package/dist/{chunk-3V5Z2BJY.js → chunk-RB2F65YJ.js} +12 -12
  108. package/dist/{chunk-KNVE7CMS.js → chunk-RJZYORCR.js} +1 -1
  109. package/dist/{chunk-BZV4K6GR.js → chunk-RPJ2GC3K.js} +20 -20
  110. package/dist/{chunk-PBMZJXSZ.js → chunk-S4J4B7LY.js} +5 -5
  111. package/dist/{chunk-HVX37PKU.js → chunk-SEXLHFMR.js} +1 -1
  112. package/dist/{chunk-NWP6IJYK.js → chunk-TANR67XF.js} +2 -2
  113. package/dist/{chunk-4F3IKYUO.js → chunk-TOVHLONK.js} +6 -6
  114. package/dist/{chunk-JOIWDQRJ.js → chunk-TRD22FC7.js} +6 -6
  115. package/dist/{chunk-YGZMD6TZ.js → chunk-TTY62G5D.js} +16 -16
  116. package/dist/{chunk-B55IXYDR.js → chunk-TZHWF3P5.js} +2 -2
  117. package/dist/{chunk-IAQC775L.js → chunk-UZ3CZQA4.js} +1 -1
  118. package/dist/chunk-WAZTGEMG.js +1 -0
  119. package/dist/{chunk-V4KQUOUP.js → chunk-WKRFD4E4.js} +8 -8
  120. package/dist/{chunk-PDXD6DT7.js → chunk-WME5DFB6.js} +1 -1
  121. package/dist/{chunk-OSA24YH6.js → chunk-WSPO4N72.js} +14 -14
  122. package/dist/{chunk-3C67XRVJ.js → chunk-XB2YPUKR.js} +8 -8
  123. package/dist/{chunk-VB7Z3HXO.js → chunk-XDDTFV32.js} +1 -1
  124. package/dist/{chunk-XC55NMXR.js → chunk-XNJMLHGK.js} +1 -1
  125. package/dist/{chunk-UQBPKZUR.js → chunk-XZL3HCWH.js} +1 -1
  126. package/dist/{chunk-CRYEG7OT.js → chunk-YBB56N6X.js} +1 -1
  127. package/dist/{chunk-FRPNTDP4.js → chunk-ZNCU3UIW.js} +4 -4
  128. package/dist/{chunk-ZOSIPTXM.js → chunk-ZNXBKFV7.js} +5 -5
  129. package/dist/{chunk-RCMP37VO.js → chunk-ZRHQGFO5.js} +3 -3
  130. package/dist/{chunk-MEFXMUWI.js → chunk-ZXSMSVLU.js} +3 -3
  131. package/dist/data/ListLoadError.js +1 -1
  132. package/dist/format/index.js +1 -1
  133. package/dist/forms/BorderInput.js +1 -1
  134. package/dist/forms/BrandAssetEditor.js +1 -1
  135. package/dist/forms/Calendar.js +1 -1
  136. package/dist/forms/ColorPicker.js +1 -1
  137. package/dist/forms/ComposerAttachments.js +1 -1
  138. package/dist/forms/CornersInput.js +1 -1
  139. package/dist/forms/DatePicker.js +1 -1
  140. package/dist/forms/DateRangePicker.js +1 -1
  141. package/dist/forms/DisplayChips.js +1 -1
  142. package/dist/forms/FilePicker.js +1 -1
  143. package/dist/forms/IconPicker.js +1 -1
  144. package/dist/forms/InputNumber.js +1 -1
  145. package/dist/forms/LinkPicker.js +1 -1
  146. package/dist/forms/MediaLibrary.js +1 -1
  147. package/dist/forms/MediaUploadField.js +1 -1
  148. package/dist/forms/MediaUploadGrid.js +1 -1
  149. package/dist/forms/MediaUsedInList.js +1 -1
  150. package/dist/forms/PositionInput.js +1 -1
  151. package/dist/forms/Select.js +1 -1
  152. package/dist/forms/SidesInput.js +1 -1
  153. package/dist/forms/Slider.js +1 -1
  154. package/dist/forms/Snippet.js +1 -1
  155. package/dist/forms/SplitButton.js +1 -1
  156. package/dist/forms/TagInput.js +1 -1
  157. package/dist/forms/TextToolbar.js +1 -1
  158. package/dist/forms/WidthsBar.js +1 -1
  159. package/dist/forms/mediaLibraryMenu.js +1 -1
  160. package/dist/forms/textAlign.js +1 -1
  161. package/dist/icons/index.js +1 -1
  162. package/dist/index.js +136 -136
  163. package/dist/map/index.js +6 -6
  164. package/dist/markdown/index.js +1 -1
  165. package/dist/page-tabs/index.js +5 -5
  166. package/dist/pdf/index.js +1 -1
  167. package/dist/shell/Accordion.js +1 -1
  168. package/dist/shell/AppUpdateBanner.js +1 -1
  169. package/dist/shell/Banner.js +1 -1
  170. package/dist/shell/Breadcrumbs.js +1 -1
  171. package/dist/shell/ColoredBadge.js +1 -1
  172. package/dist/shell/ConfirmDialog.js +1 -1
  173. package/dist/shell/ContextMenu.js +1 -1
  174. package/dist/shell/Dialog.d.ts +2 -2
  175. package/dist/shell/Dialog.js +1 -1
  176. package/dist/shell/Drawer.d.ts +2 -2
  177. package/dist/shell/Drawer.js +1 -1
  178. package/dist/shell/DropdownMenu.js +1 -1
  179. package/dist/shell/EmptyState.js +1 -1
  180. package/dist/shell/HelpCenter.js +1 -1
  181. package/dist/shell/ImageLightbox.js +1 -1
  182. package/dist/shell/LanguageSelect.js +1 -1
  183. package/dist/shell/Markdown.js +1 -1
  184. package/dist/shell/PageHeader.js +1 -1
  185. package/dist/shell/PopupMenu.js +1 -1
  186. package/dist/shell/ProductionTimeline.js +1 -1
  187. package/dist/shell/Result.js +1 -1
  188. package/dist/shell/SearchableSelect.js +1 -1
  189. package/dist/shell/SettingReset.js +1 -1
  190. package/dist/shell/SettingRow.js +1 -1
  191. package/dist/shell/SidebarLayout.js +1 -1
  192. package/dist/shell/SidebarNav.js +1 -1
  193. package/dist/shell/SortableList.js +1 -1
  194. package/dist/shell/StepChain.js +1 -1
  195. package/dist/shell/Stepper.js +1 -1
  196. package/dist/shell/TopNav.js +1 -1
  197. package/dist/shell/Tree.js +1 -1
  198. package/dist/telemetry/index.js +1 -1
  199. package/dist/templates/AuthScreen.js +1 -1
  200. package/dist/templates/ChatTemplate.js +1 -1
  201. package/dist/templates/CheckoutTemplate.js +1 -1
  202. package/dist/templates/DashboardTemplate.js +1 -1
  203. package/dist/templates/DataTablePage.js +1 -1
  204. package/dist/templates/EmailTemplate.js +1 -1
  205. package/dist/templates/FormLayoutPage.js +1 -1
  206. package/dist/ui/index.js +1 -1
  207. package/dist/version.js +1 -1
  208. package/package.json +1 -1
  209. package/dist/Calculator-4JDJKSA7.js +0 -29
  210. package/dist/CurrencyConverter-S7LG5PMX.js +0 -21
  211. package/dist/Notepad-VQ66RWLT.js +0 -25
  212. package/dist/PdfViewer-67VBUIRD.js +0 -1
  213. package/dist/Sidebar-YB4OVUG5.js +0 -43
  214. package/dist/Spreadsheet-4KXRJSHT.js +0 -37
  215. package/dist/Stock-VNFYS73L.js +0 -16
  216. package/dist/chunk-3JJFBUK6.js +0 -3
  217. package/dist/chunk-57SJKYA4.js +0 -29
  218. package/dist/chunk-AS4CTEZD.js +0 -8
  219. package/dist/chunk-HSOREHQB.js +0 -1
  220. package/dist/chunk-JJXFPGX4.js +0 -6
  221. package/dist/chunk-LYYR5DSP.js +0 -14
  222. package/dist/chunk-RERNKFEW.js +0 -19
  223. package/dist/chunk-W7S56JZ7.js +0 -7
  224. package/dist/chunk-YCQVEJOT.js +0 -3
  225. package/dist/chunk-YW2DH6YQ.js +0 -8
@@ -0,0 +1,29 @@
1
+ import{Tree as e,TreeRow as l,TreeGroup as n}from"./chunk-2U2GJCSP.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as r}from"./chunk-M2KV4WKR.js";import{ImageLightbox as i}from"./chunk-O2YAB6WK.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-JE6TBZGY.js";import{Breadcrumbs as d}from"./chunk-EBC4XFL2.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-2F7ZOMKK.js";import{useMediaMoveItems as m}from"./chunk-DFDDRKIJ.js";import{copyToClipboard as u}from"./chunk-5PY4H4ZJ.js";import{DropdownMenu as h}from"./chunk-5FCEBKT2.js";import{MediaUploadGrid as p}from"./chunk-WKRFD4E4.js";import{MediaUsedInList as f}from"./chunk-GK3QH63P.js";import{NativeSelect as g}from"./chunk-2PWZNFFP.js";import{Segmented as v}from"./chunk-N6DTTOB6.js";import{useFileIntake as y,FileIntakeAlert as k}from"./chunk-YDYDR72S.js";import{useGridSelection as b}from"./chunk-VLKDWKVR.js";import{useMarquee as w}from"./chunk-OLFYNMTD.js";import{Checkbox_default as x}from"./chunk-CGZBDI6C.js";import{useContextMenu as C,ContextMenu as N}from"./chunk-JDKRQG7X.js";import{Banner as I}from"./chunk-MY755PTJ.js";import{Input_default as D}from"./chunk-GX2GSDJP.js";import{IconButton_default as S}from"./chunk-4CANQ3B3.js";import{ColoredBadge as j}from"./chunk-4GVH4ZUH.js";import{Button_default as z}from"./chunk-4IU5BSVE.js";import{buttonClasses as F}from"./chunk-K7U4RWXJ.js";import{Icon as T}from"./chunk-2SHYR3RA.js";import{Tooltip as O}from"./chunk-22S6LG6D.js";import{usePlotWidth as P}from"./chunk-MAFUXCPZ.js";import{useShellStrings as E}from"./chunk-E6UCGCOC.js";import{useRef as K,useMemo as L,useCallback as A,useState as M,useEffect as R}from"react";import{jsxs as B,Fragment as U,jsx as G}from"react/jsx-runtime";var J="application/x-efficient-media-files",H="application/x-efficient-media-folder",W={type:"all",use:"any",sort:"newest"},V={lock:/* @__PURE__ */G(T,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */G(T,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */G(T,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */G(T,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */G(T,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */G(T,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */G(T,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */G(T,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */G(T,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */G(T,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */G(T,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */G(T,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */G(T,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */G(T,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */G(T,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */G(T,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},Y={link:/* @__PURE__ */G(T,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */G(T,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */G(T,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */G(T,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function Z({value:e,label:l,onDone:n}){const[a,r]=M(e),i=K(!1),t=e=>{i.current||(i.current=!0,n(e))};/* @__PURE__ */
2
+ return G(D,{size:"sm",autoFocus:!0,"aria-label":l,value:a,onChange:e=>r(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:l=>{l.stopPropagation(),"Enter"===l.key?(l.preventDefault(),t(a.trim()||e)):"Escape"===l.key&&(l.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function $(T){const{mode:$="manage",layout:X="auto",location:q,onLocationChange:Q,folders:_,products:ee,allFilesCount:le,trashCount:ne,files:ae,query:re,onQueryChange:ie,filters:te=W,onFiltersChange:oe,extraFilters:de,view:se="grid",onViewChange:ce,selectedIds:me,onSelectionChange:ue,usedIn:he,denied:pe={},accept:fe="image/*,video/*",maxSizeBytes:ge,busy:ve,progress:ye,onUpload:ke,onNewFolder:be,onRename:we,onMove:xe,onTrash:Ce,onDeleteFolder:Ne,onRestore:Ie,onDeleteForever:De,onEmptyTrash:Se,onReplace:je,onCropEdit:ze,onOpenInDesign:Fe,onChoose:Te,onCancel:Oe,pickNote:Pe,className:Ee=""}=T,Ke=E().mediaLibrary,Le=E().media,Ae="pick"===$,Me=!Ae,Re=K(null),Be=P(Re,"phone"===X?343:1200),Ue="phone"===X||"auto"===X&&Be<640,Ge=L(()=>function(e=[]){const l=/* @__PURE__ */new Map,n=(e,a)=>{for(const r of e){const e=[...a,r];l.set(r.id,{node:r,path:e}),r.children&&n(r.children,e)}};return n(e,[]),l}(ee),[ee]),Je=L(()=>new Map(_.map(e=>[e.id,e])),[_]),He=L(()=>{const e=/* @__PURE__ */new Map;for(const l of _){const n=l.parentId&&Je.has(l.parentId)?l.parentId:null;e.set(n,[...e.get(n)??[],l])}return e},[_,Je]),We=A(e=>{const l=[];for(let n=e?Je.get(e):void 0;n&&(l.unshift(n),!(l.length>_.length));n=n.parentId?Je.get(n.parentId):void 0);return l},[Je,_.length]),Ve=A((e,l)=>We(e).some(e=>e.id===l),[We]),[Ye,Ze]=M(()=>/* @__PURE__ */new Set(["@files"])),$e=e=>Ze(l=>{const n=new Set(l);return n.has(e)?n.delete(e):n.add(e),n}),Xe=A(e=>{Ze(l=>e.every(e=>l.has(e))?l:/* @__PURE__ */new Set([...l,...e]))},[]),qe="files"===(Qe=q).place?`files:${Qe.folderId??""}`:"products"===Qe.place?`products:${Qe.nodeId??""}`:"trash";var Qe;R(()=>{if("files"===q.place)Xe(["@files",...We(q.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===q.place){const e=q.nodeId?Ge.get(q.nodeId)?.path??[]:[];Xe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[qe]);const _e="products"===q.place,el="trash"===q.place,ll="files"===q.place,nl=ll?q.folderId:null,al=_e&&q.nodeId?Ge.get(q.nodeId)?.path[0]:void 0,rl=e=>e?.sharedFrom?`${Ke.readOnly} ${Ke.editedAtHq(e.sharedFrom)}`:Ke.readOnly,il=L(()=>ae.map(e=>e.id),[ae]),tl=L(()=>new Map(ae.map(e=>[e.id,e])),[ae]),ol=b(il),dl=L(()=>il.filter(e=>ol.selected.has(e)),[il,ol.selected]),sl=1===dl.length?tl.get(dl[0]):void 0,cl=K(!0);R(()=>{cl.current?cl.current=!1:ol.clear()},[qe]);const ml=me?.join("\0");R(()=>{me&&ol.setSelection(me)},[ml]);const ul=K(ml??""),hl=dl.join("\0");R(()=>{ul.current!==hl&&(ul.current=hl,ue?.(dl))},[hl]);const pl=(e,l={})=>{Ae?ol.select(e):ol.select(e,{ctrl:!(!l.ctrlKey&&!l.metaKey),shift:!!l.shiftKey})},[fl,gl]=M(null),vl=e=>{const l=fl;if(gl(null),!l||null==e)return;e!==("folder"===l.kind?Je.get(l.id)?.name:tl.get(l.id)?.name)&&we?.(l,e)},yl=async e=>{if(!be)return;const l=await be(e);Xe(["@files",...e?[e]:[]]),"string"==typeof l&&gl({kind:"folder",id:l})},kl=A(e=>{const l=[],n=l=>{if("files"===e.kind)return l===nl&&ll?Ke.alreadyHere:void 0;const n=Je.get(e.id);return l===e.id||l&&Ve(l,e.id)?Ke.notIntoItself:(n?.parentId??null)===l?Ke.folderAlreadyHere:void 0};l.push({key:s,label:Ke.allFiles,disabledReason:n(null)});const a=(e,r)=>{for(const i of He.get(e)??[])l.push({key:i.id,label:i.name,depth:r,disabledReason:n(i.id)}),a(i.id,r+1)};return a(null,1),l},[He,Je,ll,Ve,nl,Ke]),bl=A(e=>{const l=new Set(e.map(e=>tl.get(e)?.kind??"image"));return 1===l.size?[...l][0]:"file"},[tl]),[wl,xl]=M(null),Cl={words:Ke,media:Le,denied:pe,moveTargets:kl,kindOf:bl,urlOf:e=>tl.get(e)?.url,newSubfolder:be&&Me?e=>{yl(e)}:void 0,rename:we&&Me?e=>{"file"!==e.kind||ol.isSelected(e.id)||ol.select(e.id),gl(e)}:void 0,move:xe&&Me?xe:void 0,trash:Ce&&Me?Ce:void 0,deleteFolder:Ne&&Me?Ne:void 0,folderNotEmpty:e=>!!Je.get(e)?.notEmpty,replace:je&&Me?je:void 0,copyUrl:e=>{const l=tl.get(e)?.url;l&&u(Ke.urlLabel,l)},openInDesign:Fe,restore:Ie,deleteForever:De},Nl=e=>c(e,Cl),Il=C(),Dl=(e,l)=>{Ae||(ol.isSelected(e)||ol.select(e),Il.open(l,(e=>{const l=ol.isSelected(e)?dl:[e];return _e?{kind:"render",id:e}:el?{kind:"trashed",ids:l}:{kind:"files",ids:l}})(e)))},[Sl,jl]=M(null),[zl,Fl]=M(null),[Tl,Ol]=M(null);R(()=>{if(!zl&&!Sl)return;const e=()=>{Fl(null),jl(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[zl,Sl]);const Pl=(e,l)=>Array.from(e.dataTransfer?.types??[]).includes(l),El=(e,l)=>!(!xe||pe.move||Ae)&&(!!Pl(e,J)||!(!Pl(e,H)||!Tl)&&(l!==Tl&&!(l&&Ve(l,Tl)))),Kl=(e,l)=>({onDragEnter:n=>{El(n,l)&&(n.preventDefault(),jl(e))},onDragOver:n=>{El(n,l)&&(n.preventDefault(),n.dataTransfer.dropEffect="move",Sl!==e&&jl(e))},onDragLeave:l=>{const n=l.relatedTarget;n&&l.currentTarget.contains(n)||jl(l=>l===e?null:l)},onDrop:e=>{if(El(e,l))if(e.preventDefault(),jl(null),Pl(e,J)){let n;try{n=JSON.parse(e.dataTransfer.getData(J))}catch{n=null}Array.isArray(n)&&n.length&&xe({kind:"files",ids:n.map(String)},l)}else Tl&&(xe({kind:"folder",id:Tl},l),Ol(null))}}),Ll=e=>{const l=e=>Pl(e,J)||Pl(e,H)||Pl(e,"Files");return{onDragEnter:n=>{l(n)&&Fl(e)},onDragOver:n=>{l(n)&&zl!==e&&Fl(e)},onDragLeave:l=>{const n=l.relatedTarget;n&&l.currentTarget.contains(n)||Fl(l=>l===e?null:l)}}},Al=(e,l,n)=>/* @__PURE__ */G(O,{side:"right",content:zl===e?Ke.noDropProducts:rl(n),open:zl===e||!zl&&void 0,children:/* @__PURE__ */G("span",{children:l})}),Ml=e=>({onContextMenu:l=>{Il.open(l,e)}}),Rl=(e,a,r)=>e.map(e=>{const i=`p:${e.id}`,t=r??e,o=Ye.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
3
+ return B("div",{role:"none",className:"contents",children:[
4
+ /* @__PURE__ */G(l,{label:Al(i,e.name,t),level:a,icon:d&&o?V.folderOpen:V.folder,badge:null!=e.count?e.count:void 0,selected:_e&&q.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>$e(i):void 0,onSelect:()=>Q({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Ll(i),...Me?Ml({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */G(n,{children:Rl(d,a+1,t)})]},e.id)}),Bl=(e,a)=>(He.get(e)??[]).map(e=>{const r=He.get(e.id),i=Ye.has(e.id),t="folder"===fl?.kind&&fl.id===e.id,o=Nl({kind:"folder",id:e.id});/* @__PURE__ */
5
+ return B("div",{role:"none",className:"contents",children:[
6
+ /* @__PURE__ */G(l,{label:e.name,level:a,icon:r&&i?V.folderOpen:V.folder,badge:null!=e.count?e.count:void 0,selected:t||ll&&q.folderId===e.id,expanded:r?i:void 0,onToggle:r?()=>$e(e.id):void 0,onSelect:()=>Q({place:"files",folderId:e.id}),drop:Sl===e.id?"into":void 0,dragging:Tl===e.id,draggable:Me&&!!xe&&!pe.move,rename:t?/* @__PURE__ */G(Z,{value:e.name,label:Ke.folderName,onDone:vl}):void 0,actions:Me&&o.length?/* @__PURE__ */G(h,{align:"end","aria-label":Ke.folderActions,trigger:V.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Kl(e.id,e.id),...Me?Ml({kind:"folder",id:e.id}):{},...Me&&xe&&!pe.move?{draggable:!0,onDragStart:l=>{l.dataTransfer.effectAllowed="move",l.dataTransfer.setData(H,e.id),Ol(e.id)},onDragEnd:()=>{Ol(null),jl(null)}}:{}}}),r&&i&&/* @__PURE__ */G(n,{children:Bl(e.id,a+1)})]},e.id)}),Ul=Ye.has("@files"),Gl=Ye.has("@products"),Jl=/* @__PURE__ */B(e,{"aria-label":Ke.folders,children:[ee&&/* @__PURE__ */B(U,{children:[
7
+ /* @__PURE__ */G(l,{label:Al("@products",Ke.products),level:1,icon:V.lock,badge:{label:Ke.readOnlyBadge,tone:"neutral"},expanded:ee.length?Gl:void 0,onToggle:()=>$e("@products"),selected:_e&&null==q.nodeId,onSelect:()=>Q({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Ll("@products")}}),Gl&&ee.length>0&&/* @__PURE__ */G(n,{children:Rl(ee,2)})]}),
8
+ /* @__PURE__ */G(l,{label:Ke.allFiles,level:1,icon:Ul?V.folderOpen:V.folder,badge:null!=le?le:void 0,expanded:He.get(null)?.length?Ul:void 0,onToggle:()=>$e("@files"),selected:ll&&null==q.folderId,onSelect:()=>Q({place:"files",folderId:null}),drop:"@files"===Sl?"into":void 0,rowProps:{"data-media-row":"@files",...Kl("@files",null)}}),Ul&&(He.get(null)?.length??0)>0&&/* @__PURE__ */G(n,{children:Bl(null,2)}),Me&&/* @__PURE__ */G(l,{label:Ke.trash,level:1,icon:V.trash,badge:null!=ne?ne:void 0,selected:el,onSelect:()=>Q({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Hl=(()=>{if(el)return[{label:Ke.trash}];if(_e){const e=q.nodeId?Ge.get(q.nodeId)?.path??[]:[];return[{label:Ke.products,onClick:e.length?()=>Q({place:"products",nodeId:null}):void 0},...e.map((l,n)=>({label:l.name,onClick:n<e.length-1?()=>Q({place:"products",nodeId:l.id}):void 0}))]}const e=We(nl);return[{label:Ke.allFiles,onClick:e.length?()=>Q({place:"files",folderId:null}):void 0},...e.map((l,n)=>({label:l.name,onClick:n<e.length-1?()=>Q({place:"files",folderId:l.id}):void 0}))]})(),Wl=_e?Ke.readOnly:pe.upload,Vl=!!ke&&!el&&!Wl,Yl=y({accept:fe,maxSizeBytes:ge,multiple:!0,disabled:!Vl,onAccept:e=>ke?.(e,nl)}),Zl=_e?Ke.noProductFolder:pe.newFolder,$l=e=>e?{"aria-disabled":!0,disabledReason:e}:{},Xl=/* @__PURE__ */B("div",{className:"flex flex-wrap items-center gap-2",children:[Me&&be&&!el&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.folderPlus,onClick:()=>{yl(nl)},...$l(Zl),children:Ke.newFolder}),ke&&!el&&/* @__PURE__ */G(z,{variant:"primary",size:"sm",leftIcon:V.upload,onClick:()=>Yl.open(),...$l(Wl),children:Ke.upload}),Me&&el&&Se&&ae.length>0&&/* @__PURE__ */G(z,{variant:"danger",size:"sm",onClick:Se,...$l(pe.deleteForever),children:Ke.emptyTrash})]}),ql=(e,l,n,a,r)=>/* @__PURE__ */G("div",{style:{width:Ue?void 0:r,flex:Ue?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */G(g,{size:"sm","aria-label":e,value:l,onChange:a,options:n})},e),Ql=e=>l=>oe?.({...te,[e]:l}),_l=/* @__PURE__ */B("div",{className:"flex flex-wrap items-center gap-2",children:[ie&&/* @__PURE__ */G("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */G(D,{size:"sm",type:"search",leftIcon:V.search,placeholder:_e?Ke.searchProducts:Ke.search,"aria-label":_e?Ke.searchProducts:Ke.search,value:re??"",onChange:e=>ie(e.target.value)})}),oe&&ql(Ke.mediaType,te.type,[{value:"all",label:Ke.allTypes},{value:"image",label:Ke.images},{value:"video",label:Ke.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],Ql("type"),130),oe&&!_e&&!el&&ql(Ke.use,te.use,[{value:"any",label:Ke.anyUse},{value:"email",label:Ke.emailOnly},{value:"website",label:Ke.websiteOnly},{value:"unused",label:Ke.notUsed}],Ql("use"),130),oe&&Me&&ql(Ke.sort,te.sort,[{value:"newest",label:Ke.newest},{value:"name",label:Ke.byName},{value:"size",label:Ke.bySize}],Ql("sort"),110),de?.map(e=>ql(e.label,e.value,e.options,e.onChange,120)),ce&&/* @__PURE__ */G(v,{size:"sm",label:Ke.view,value:se,onChange:ce,options:[{value:"grid",label:Ke.grid,icon:V.grid},{value:"list",label:Ke.list,icon:V.list}]})]}),en=e=>{const l=[];return null!=e.trashedDaysAgo&&l.push({key:"t",label:Ke.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:Y.clock,tone:"neutral"}),e.usedCount&&l.push({key:"u",label:Ke.used(e.usedCount),count:e.usedCount,icon:Y.link,tone:"active"}),e.email&&l.push({key:"e",label:Ke.email,icon:Y.email,tone:"queued"}),e.private&&l.push({key:"p",label:Ke.private,icon:Y.lock,tone:"neutral"}),l},ln=e=>en(e).map(e=>/* @__PURE__ */G(j,{tone:e.tone,size:"xs",children:e.label},e.key)),nn=Me&&ll&&!!xe&&!pe.move,an=ae.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:en(e),dragData:nn?JSON.stringify(ol.isSelected(e.id)?dl:[e.id]):void 0})),rn=Ue?Math.max(72,Math.floor((Be-24-16-1)/3)):112,tn=K(null),on=w({containerRef:tn,enabled:Me&&!Ue&&ae.length>0,selected:ol.selected,setSelection:e=>ol.setSelection(e),clearSelection:ol.clear}),dn=e=>{if(Ae){const l=tl.get(e);return void(!l||l.private||l.pickDisabledReason||Te?.(l))}const l=il.indexOf(e);l>=0&&xl(l)},sn=ae.length?null:re?/* @__PURE__ */G(r,{variant:"dashed",title:Ke.noMatches}):_e?/* @__PURE__ */G(r,{variant:"dashed",title:Ke.emptyProducts,description:rl(al)}):el?/* @__PURE__ */G(r,{variant:"dashed",title:Ke.trashEmpty}):!Vl||Ae?/* @__PURE__ */G(r,{variant:"dashed",title:Ke.emptyFolder}):null,cn="list"===se&&ae.length>0,mn=sn??(cn?/* @__PURE__ */G("ul",{role:"listbox","aria-multiselectable":Me||void 0,"aria-label":Ke.folders,className:"flex flex-col gap-1",children:ae.map(e=>/* @__PURE__ */B("li",{role:"option","aria-selected":ol.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:l=>pl(e.id,l),onDoubleClick:()=>dn(e.id),onContextMenu:l=>Dl(e.id,l),onKeyDown:l=>{"Enter"!==l.key&&" "!==l.key||(l.preventDefault(),pl(e.id,l))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(ol.isSelected(e.id)?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
9
+ /* @__PURE__ */G("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
10
+ /* @__PURE__ */G("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
11
+ /* @__PURE__ */G("span",{className:"flex shrink-0 items-center gap-1",children:ln(e)}),e.sizeLabel&&/* @__PURE__ */G("span",{className:"w-16 shrink-0 text-right text-xs text-gray-500",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */G(p,{items:an,readOnly:!Vl||Ae,onFiles:Vl&&!Ae?e=>ke(e,nl):void 0,accept:fe,maxSizeBytes:ge,busy:ve,progress:ye,fit:"contain",thumbSize:rn,dragType:nn?J:void 0,selected:ol.selected,onItemClick:pl,onItemDoubleClick:dn,onItemContextMenu:Me?Dl:void 0,menuOnMedia:Me})),un=m({count:dl.length,kind:bl(dl),targets:kl({kind:"files",ids:dl}),onPick:e=>xe?.({kind:"files",ids:dl},e.key===s?null:e.key)}),hn=F({variant:"secondary",size:"sm"}),pn=/* @__PURE__ */G(h,{align:"start",triggerClassName:hn,trigger:/* @__PURE__ */B(U,{children:[V.folder,Ke.moveTo]}),items:un,disabled:!!pe.move}),fn=Me&&dl.length>1&&!_e?/* @__PURE__ */B("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-gray-200 px-3 py-2",children:[
12
+ /* @__PURE__ */G(x,{checked:dl.length===ae.length,indeterminate:dl.length<ae.length,onChange:e=>e?ol.selectAll():ol.clear(),label:Ke.selected(dl.length)}),/* @__PURE__ */B(U,el?{children:[Ie&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.undo,onClick:()=>Ie(dl),...$l(pe.restore),children:Ke.restore}),De&&/* @__PURE__ */G(z,{variant:"secondary-danger",size:"sm",onClick:()=>De(dl),...$l(pe.deleteForever),children:Ke.deleteForever})]}:{children:[xe&&pn,we&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.edit,disabled:!0,children:Ke.rename}),Ce&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.trash,onClick:()=>Ce({kind:"files",ids:dl}),...$l(pe.trash),children:Ke.moveFilesToTrash(dl.length)})]}),
13
+ /* @__PURE__ */G(z,{variant:"ghost",size:"sm",onClick:ol.clear,children:Ke.clearSelection})]}):null,gn=e=>{const l=[],n=(e,n,a)=>{null!=a&&""!==a&&l.push({key:e,label:n,value:a})},a="file"===fl?.kind&&fl.id===e.id;n("name",Ke.name,a?/* @__PURE__ */G(Z,{value:e.name,label:Ke.fileName,onDone:vl}):e.name),n("type",Ke.type,e.typeLabel),n("size",Ke.size,e.sizeLabel),n("resolution",Ke.resolution,e.resolution),_e?(n("design",Ke.design,e.design),n("finish",Ke.finish,e.finish),n("angle",Ke.angleLug,e.angleLug),n("owner",Ke.owner,e.owner)):(n("added",Ke.addedBy,e.addedBy),n("folder",Ke.folder,e.folderPath)),n("used",Ke.usedIn,null!=e.usedCount?Ke.places(e.usedCount):void 0);const r=c({kind:"files",ids:[e.id]},Cl).find(e=>"submenu"===e.type);/* @__PURE__ */
14
+ return B("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
15
+ /* @__PURE__ */G("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),_e&&/* @__PURE__ */G(I,{tone:"neutral",title:Ke.readOnlyBadge,children:rl(al)}),
16
+ /* @__PURE__ */G(t,{size:"sm",columns:1,items:l}),!el&&/* @__PURE__ */B("div",{className:"flex gap-2",children:[
17
+ /* @__PURE__ */G("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */G(D,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ke.fileUrl,onFocus:e=>e.currentTarget.select()})}),
18
+ /* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.copy,onClick:()=>Cl.copyUrl(e.id),children:Ke.copyUrl})]}),ll&&Me&&/* @__PURE__ */B("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.swap,onClick:()=>je(e.id),...$l(pe.replace),children:Ke.replace}),ze&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.crop,onClick:()=>ze(e.id),children:Ke.cropEdit}),xe&&"submenu"===r?.type&&/* @__PURE__ */G(h,{align:"start",triggerClassName:hn,trigger:/* @__PURE__ */B(U,{children:[V.folder,Ke.moveTo]}),items:r.items,disabled:!!pe.move}),we&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.edit,onClick:()=>gl({kind:"file",id:e.id}),...$l(pe.rename),children:Ke.rename}),Ce&&/* @__PURE__ */G(S,{"aria-label":Ke.moveToTrash,size:"sm",onClick:()=>Ce({kind:"files",ids:[e.id]}),disabledReason:pe.trash,"aria-disabled":!!pe.trash||void 0,children:V.trash})]}),el&&Me&&/* @__PURE__ */B("div",{className:"flex flex-wrap gap-2",children:[Ie&&/* @__PURE__ */G(z,{variant:"primary",size:"sm",leftIcon:V.undo,onClick:()=>Ie([e.id]),...$l(pe.restore),children:Ke.restore}),De&&/* @__PURE__ */G(z,{variant:"danger",size:"sm",onClick:()=>De([e.id]),...$l(pe.deleteForever),children:Ke.deleteForever})]}),_e&&Fe&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:V.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Ke.openInDesign}),he&&/* @__PURE__ */G(f,{items:he})]})},vn=sl?sl.private?Ke.privateNoPick:sl.pickDisabledReason:void 0,yn=Ae?/* @__PURE__ */B("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-gray-200 px-3 py-2",children:[
19
+ /* @__PURE__ */G("span",{className:"min-w-0 truncate text-sm text-gray-500",children:sl?Ke.oneChosen(sl.name):Ke.noneChosen}),
20
+ /* @__PURE__ */B("div",{className:"flex gap-2",children:[Oe&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",onClick:Oe,children:Ke.cancel}),
21
+ /* @__PURE__ */G(z,{variant:"primary",size:"sm",disabled:!sl,...$l(vn),onClick:()=>{sl&&!vn&&Te?.(sl)},children:Ke.chooseImage})]})]}):null,kn=Me&&!!sl,bn=/* @__PURE__ */B("div",{className:"flex min-w-0 flex-col gap-3",children:[Pe&&/* @__PURE__ */G(I,{tone:"neutral",children:Pe}),
22
+ /* @__PURE__ */B("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
23
+ /* @__PURE__ */G(d,{items:Hl}),Xl]}),_l,fn,
24
+ /* @__PURE__ */B("div",{ref:tn,className:"relative",onPointerDown:on.onPointerDown,onKeyDown:e=>{Me&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),ol.selectAll()):"Escape"===e.key&&ol.size&&ol.clear()},children:[mn,
25
+ /* @__PURE__ */G(a,{rect:on.rect})]}),Vl&&/* @__PURE__ */G("input",{...Yl.inputProps}),
26
+ /* @__PURE__ */G(k,{rejections:Yl.rejections})]});/* @__PURE__ */
27
+ return B("div",{ref:Re,"data-media-library":"","data-layout":Ue?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Ee}`.trim(),children:[/* @__PURE__ */B("div",Ue?{className:"flex flex-col gap-3 p-3",children:[Jl,bn]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
28
+ /* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-r border-gray-200 p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Jl}),
29
+ /* @__PURE__ */G("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:bn}),kn&&/* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-l border-gray-200 p-3",style:{width:300},children:gn(sl)})]}),yn,Ue&&/* @__PURE__ */G(o,{open:kn,onClose:ol.clear,side:"bottom",title:sl?.name,children:sl&&gn(sl)}),Il.state&&/* @__PURE__ */G(N,{...Il.props,items:Nl(Il.state.data)}),null!=wl&&ae.length>0&&/* @__PURE__ */G(i,{images:ae.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(wl,ae.length-1),onClose:()=>xl(null)})]})}export{J as MEDIA_FILES_DRAG_TYPE,H as MEDIA_FOLDER_DRAG_TYPE,$ as MediaLibrary};
@@ -1,3 +1,3 @@
1
- import{mediaMoveSubmenu as e}from"./chunk-DFDDRKIJ.js";import{optionNoteClass as n}from"./chunk-QR4RM7PO.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
1
+ import{mediaMoveSubmenu as e}from"./chunk-DFDDRKIJ.js";import{optionNoteClass as n}from"./chunk-QR4RM7PO.js";import{Icon as r}from"./chunk-2SHYR3RA.js";import{jsxs as d,jsx as l}from"react/jsx-runtime";var a={folder:/* @__PURE__ */l(r,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),"folder-plus":/* @__PURE__ */l(r,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */l(r,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */l(r,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */l(r,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */l(r,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */l(r,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */l(r,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},o=e=>a[e];function i(e,r){return r?/* @__PURE__ */d("span",{className:"flex min-w-0 flex-col",children:[
2
2
  /* @__PURE__ */l("span",{children:e}),
3
3
  /* @__PURE__ */l("span",{className:n(),children:r})]}):e}function t(n,r){const{words:d,denied:l}=r,a=[],t=(e,n,r,d={})=>{if(!r)return;const o=d.deny?l[d.deny]:void 0;a.push({key:e,label:i(n,o),icon:d.icon,danger:d.danger,disabled:!!o||!!d.off,onSelect:r})},c=(n,d,i,t)=>{const c=r.move;c&&a.push(e({count:d,kind:i,head:t,icon:o("folder"),disabled:!!l.move,targets:r.moveTargets(n),onPick:e=>c(n,e.key===s?null:e.key)},r.media))},h=e=>{a.length&&a.push({type:"divider",key:e})};switch(n.kind){case"folder":{const e={kind:"folder",id:n.id};if(t("new",d.newSubfolder,r.newSubfolder&&(()=>r.newSubfolder(n.id)),{icon:o("folder-plus"),deny:"newFolder"}),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"folder",id:n.id})),{icon:o("edit"),deny:"rename"}),c(e,1,"file",!1),r.deleteFolder){h("d-delete");const e=!l.deleteFolder&&!!r.folderNotEmpty?.(n.id);a.push({key:"delete-folder",label:i(d.deleteFolder,l.deleteFolder??(e?d.folderNotEmpty:void 0)),icon:o("trash"),danger:!0,disabled:!!l.deleteFolder||e,onSelect:()=>r.deleteFolder(n.id)})}return a}case"files":{const{ids:e}=n,l=1===e.length,i={kind:"files",ids:e};l||a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),c(i,e.length,r.kindOf(e),!0),t("rename",d.rename,r.rename&&(()=>r.rename({kind:"file",id:e[0]})),{icon:o("edit"),deny:"rename",off:!l}),t("replace",d.replace,r.replace&&(()=>r.replace(e[0])),{icon:o("swap"),deny:"replace",off:!l}),t("copy",d.copyUrl,()=>r.copyUrl(e[0]),{icon:o("copy"),off:!l});const s=l?r.urlOf(e[0]):void 0;return s&&a.push({type:"link",key:"open",label:d.openOriginal,href:s,icon:o("external")}),r.trash&&(h("d-trash"),t("trash",l?d.moveToTrash:d.moveFilesToTrash(e.length),()=>r.trash(i),{icon:o("trash"),danger:!0,deny:"trash"})),a}case"trashed":{const{ids:e}=n;return e.length>1&&a.push({type:"label",key:"count",label:d.filesSelected(e.length)}),t("restore",d.restore,r.restore&&(()=>r.restore(e)),{icon:o("undo"),deny:"restore"}),r.deleteForever&&(h("d-delete"),t("delete",d.deleteForever,()=>r.deleteForever(e),{icon:o("trash"),danger:!0,deny:"deleteForever"})),a}case"product-node":case"render":return a.push({type:"label",key:"read-only",label:d.readOnlyMenu}),t("design",d.openInDesign,r.openInDesign&&(()=>r.openInDesign({kind:n.kind,id:n.id})),{icon:o("external")}),"render"===n.kind&&t("copy",d.copyUrl,()=>r.copyUrl(n.id),{icon:o("copy")}),a;default:return a}}var s="__all-files__";export{s as ROOT_KEY,t as mediaLibraryMenu};
@@ -0,0 +1,19 @@
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-XZL3HCWH.js";import{useSettingAuto as d}from"./chunk-L65BESIE.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-PF3ANJFI.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-2SHYR3RA.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-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-E6UCGCOC.js";import{forwardRef as w,useId as k,useState as N,useRef as $,useMemo as D,useCallback as S,useEffect as j,useLayoutEffect as C}from"react";import{createPortal as E}from"react-dom";import{jsxs as H,jsx as I,Fragment as T}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,R=w(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},w){const N=t,$=x(),D=d(),S=f??D,j=k(),C=/* @__PURE__ */H("select",{ref:w,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,S?j:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:S,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:i}),
2
+ /* @__PURE__ */I(z,{items:r})]});return S?/* @__PURE__ */H(T,{children:[C,
3
+ /* @__PURE__ */I("span",{id:j,hidden:!0,children:$.settingView.auto})]}):C});function z({items:e}){const t=e=>/* @__PURE__ */I("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
4
+ return I(T,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */I("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var A=w(function({value:l,onChange:u,options:w,placeholder:R,invalid:A,className:B="",id:U,disabled:F,size:K,touchSize:L,title:P,multiple:V,renderOption:W,renderValue:M,valueText:G,readOnly:J=!1,footer:q,changed:Q=!1,auto:X,"aria-describedby":Y,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=N(!1),[ne,ae]=N(-1),le=$(null),oe=$(null),de=$(null),se=$(null),ce=$([]),ue=()=>se.current??de.current,pe=!!q?.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]=N(null),ge=x(),ye=$(re);ye.current=re;const xe=$({buffer:"",timer:null}),we=k(),ke=`${we}-listbox`,Ne=U??`${we}-trigger`,$e=e=>`${we}-opt-${e}`,De=`${we}-changed`,Se=d(),je=X??Se,Ce=`${we}-auto`,Ee=[Y,Q?De:void 0,je?Ce:void 0].filter(Boolean).join(" ")||void 0,He=D(()=>n(w),[w]),Ie=V?l:[],Te=u,Oe=f(oe,re,{matchTriggerWidth:!0,...q?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Re="undefined"==typeof window?j:C,ze=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${w.length}`;Re(()=>{be(null)},[ze]),Re(()=>{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 Ae=V?He.findIndex(e=>Ie.includes(e.value)):He.findIndex(e=>e.value===l),Be=V?He.filter(e=>Ie.includes(e.value)).map(e=>e.label).join(", ")||void 0:Ae>=0?He[Ae].label:void 0,Ue=!V&&Ae>=0?He[Ae].lang:void 0,Fe=V?He.filter(e=>Ie.includes(e.value)):Ae>=0?[He[Ae]]:[],Ke=M&&Fe.length?M(Fe):void 0,Le=void 0!==Ke&&G?G(Fe):void 0,Pe=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Ve=S(()=>{F||J||(ae(Ae>=0?Ae:e(He)),ie(!0))},[F,J,He,Ae]),We=S(e=>{const t=He[e];if(t&&!t.disabled){if(V){const r=l;return Te(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Te(t.value),Pe()}},[He,V,l,Te,Pe]);j(()=>{if(!re)return;return y(e=>!("Escape"!==e.key||!ye.current)&&(Pe(),!0),ue)},[re,Pe]),j(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Pe(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Pe(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Pe]),j(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Me=S(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:Ae,n=t(He,r.buffer,i);n<0||(re?ae(n):V?(ae(n),ie(!0)):We(n))},[re,ne,Ae,He,We,V]),Ge=re?a(w,(e,t)=>{const r=(i=e.value,V?Ie.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
5
+ return H("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>We(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${V?" 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:[V&&/* @__PURE__ */I(o,{selected:r}),W?/* @__PURE__ */I("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:n})}):V?/* @__PURE__ */H("span",{className:"block min-w-0 flex-1",children:[
6
+ /* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */I("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
7
+ /* @__PURE__ */H(T,{children:[
8
+ /* @__PURE__ */I("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */I("span",{className:he,children:e.description})]}):e.label]},e.value)},we,"mx-1"):null,Je=void 0!==Ke?
9
+ /* @__PURE__ */H("span",{className:"relative block min-w-0 truncate",children:[
10
+ /* @__PURE__ */I("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ke}),
11
+ /* @__PURE__ */I("span",{lang:void 0===Le?Ue:void 0,className:"sr-only",children:Le??Be})]}):/* @__PURE__ */I("span",{lang:Ue,className:`block truncate ${void 0===Be?c:""}`,children:Be??R??" "}),qe={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...g()},Qe=/* @__PURE__ */I("div",{ref:de,id:ke,role:"listbox","aria-labelledby":_??(Z?void 0:Ne),"aria-label":_?void 0:Z,"aria-multiselectable":V||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?{...qe,maxHeight:fe}:qe,children:Ge}),Xe=pe?/* @__PURE__ */H("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:qe,children:[Qe,
12
+ /* @__PURE__ */I("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:q.map((e,t)=>/* @__PURE__ */H("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Pe(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(q?.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 Pe());case"Escape":return e.preventDefault(),e.stopPropagation(),void Pe()}})(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-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */I(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
13
+ /* @__PURE__ */I("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Qe;/* @__PURE__ */
14
+ return H("div",{ref:le,className:"relative",children:[
15
+ /* @__PURE__ */I("button",{ref:oe,id:Ne,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?ke:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Ee,"aria-label":Z,"aria-labelledby":_,title:P,disabled:F,"aria-readonly":J||void 0,onClick:()=>re?Pe():Ve(),onKeyDown:t=>{if(!F&&!J)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(He,e,1)):Ve());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(He,e,-1)):Ve());case"Home":return void(re&&(t.preventDefault(),ae(e(He))));case"End":return void(re&&(t.preventDefault(),ae(r(He))));case"Enter":return void(re&&(t.preventDefault(),We(ne)));case" ":return t.preventDefault(),void(re?We(ne):Ve());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Pe()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Pe(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Me(t.key))}},className:s({invalid:A,size:K,readOnly:J,auto:je,className:`${J?"":"pr-8 "}text-left ${B}`.trim()}),children:Q?
16
+ /* @__PURE__ */H("span",{className:"flex min-w-0 items-center gap-1",children:[Je,
17
+ /* @__PURE__ */I("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Je}),Q&&/* @__PURE__ */I("span",{id:De,hidden:!0,children:ge.select.changed}),je&&/* @__PURE__ */I("span",{id:Ce,hidden:!0,children:ge.settingView.auto}),!J&&/* @__PURE__ */I(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
18
+ /* @__PURE__ */H("select",{ref:te,value:l,multiple:V||void 0,onChange:e=>Te(V?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:F,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==R&&!V&&/* @__PURE__ */I("option",{value:"",disabled:!0,children:R}),
19
+ /* @__PURE__ */I(z,{items:w})]}),re&&E(Xe,document.body)]})}),B=w(function({touchSize:e="touch",...t},r){const i=u();return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */I(R,{ref:r,...t,size:e}):/* @__PURE__ */I(A,{ref:r,...t}):/* @__PURE__ */I(A,{ref:r,...t,size:e})});export{R as NativeSelect,B as Select_default};
@@ -87,7 +87,8 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
87
87
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})})},"folder:solid":function({size:e=18,...r}){/* @__PURE__ */
88
88
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"})})},globe:function({size:e=18,...r}){/* @__PURE__ */
89
89
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"})})},grid:function({size:e=18,...r}){/* @__PURE__ */
90
- return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"})})},help:function({size:e=18,...r}){/* @__PURE__ */
90
+ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"})})},"hand-thumb-up":function({size:e=18,...r}){/* @__PURE__ */
91
+ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z"})})},help:function({size:e=18,...r}){/* @__PURE__ */
91
92
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})})},home:function({size:e=18,...r}){/* @__PURE__ */
92
93
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})},image:function({size:e=18,...r}){/* @__PURE__ */
93
94
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{d:"M6 3.75h12a2.25 2.25 0 0 1 2.25 2.25v12a2.25 2.25 0 0 1 -2.25 2.25h-12a2.25 2.25 0 0 1 -2.25 -2.25v-12a2.25 2.25 0 0 1 2.25 -2.25ZM3.75 17.075L8.114 12.71A1.903 1.903 0 0 1 10.806 12.71L15.171 17.075M13.902 15.806L15.094 14.613A1.903 1.903 0 0 1 17.785 14.613L20.247 17.075M14.995 8.255a0.75 0.75 0 1 0 1.5 0a0.75 0.75 0 1 0 -1.5 0Z"})})},inbox:function({size:e=18,...r}){/* @__PURE__ */
@@ -165,5 +166,5 @@ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"current
165
166
  return t("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"})})},widgets:function({size:e=18,...r}){/* @__PURE__ */
166
167
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})})},window:function({size:e=18,...r}){/* @__PURE__ */
167
168
  return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8.25V18a2.25 2.25 0 0 0 2.25 2.25h13.5A2.25 2.25 0 0 0 21 18V8.25m-18 0V6a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 6v2.25m-18 0h18M5.25 6h.008v.008H5.25V6ZM7.5 6h.008v.008H7.5V6Zm2.25 0h.008v.008H9.75V6Z"})})},"zoom-in":function({size:e=18,...r}){/* @__PURE__ */
168
- return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"})})}};function h(e,r){return(r?d[`${e}:${r}`]:void 0)??d[e]}var a={muted:"text-gray-500",accent:"text-blue-600",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600"},s=/* @__PURE__ */new Set;function u({name:o,glyph:d,size:u,tone:l,look:c,title:L,fallback:k,className:M,...v}){n(e,r,r);const p=o??d,f=i(p,c)??k??h(p,c);if(!f)return s.has(p)||(s.add(p),console.warn(`efficient-shell/icons: no registered icon set draws "${p}". Register one at startup, for example registerIconSet(efficient) from 'efficient-shell/icons/efficient'.`)),null;const g=void 0!==L||void 0!==v["aria-label"]||void 0!==v["aria-labelledby"],w=[l?a[l]:"",M??""].filter(Boolean).join(" ");/* @__PURE__ */
169
- return t(f,{width:u??"1em",height:u??"1em","data-icon":p,"aria-hidden":!g||void 0,role:g?"img":void 0,"aria-label":L,...v,className:w||void 0})}export{u as Icon,h as kitDrawing};
169
+ return t("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",...r,children:/* @__PURE__ */t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"})})}};function h(e,r){return(r?d[`${e}:${r}`]:void 0)??d[e]}var a={muted:"text-gray-500",accent:"text-blue-600",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600"},u=/* @__PURE__ */new Set;function s({name:o,glyph:d,size:s,tone:l,look:c,title:L,fallback:k,className:M,...v}){n(e,r,r);const p=o??d,f=i(p,c)??k??h(p,c);if(!f)return u.has(p)||(u.add(p),console.warn(`efficient-shell/icons: no registered icon set draws "${p}". Register one at startup, for example registerIconSet(efficient) from 'efficient-shell/icons/efficient'.`)),null;const g=void 0!==L||void 0!==v["aria-label"]||void 0!==v["aria-labelledby"],w=[l?a[l]:"",M??""].filter(Boolean).join(" ");/* @__PURE__ */
170
+ return t(f,{width:s??"1em",height:s??"1em","data-icon":p,"aria-hidden":!g||void 0,role:g?"img":void 0,"aria-label":L,...v,className:w||void 0})}export{s as Icon,h as kitDrawing};
@@ -1,18 +1,18 @@
1
- import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-3PGK3VFS.js";import{GROUP_COLORS as n}from"./chunk-D323R2FT.js";import{Icon as o}from"./chunk-KIBL6M3T.js";import{OneLineLabel as i}from"./chunk-6KO5VTL7.js";import{Tooltip as s}from"./chunk-22S6LG6D.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as d,useCallback as u,useId as p,isValidElement as m}from"react";import{jsx as g,jsxs as h}from"react/jsx-runtime";var f='[role="treeitem"]';function b(e){return[...e.querySelectorAll(f)].filter(r=>{for(let t=r.parentElement?.closest('[role="group"]');t&&e.contains(t);t=t.parentElement?.closest('[role="group"]')??null)if(t.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":r,children:t,className:a="",rootProps:n}){const o=d(null);l(()=>{const e=o.current;if(!e)return;const r=[...e.querySelectorAll(f)];if(0===r.length)return;const t=r.find(e=>e===document.activeElement)??r.find(e=>"true"===e.getAttribute("aria-selected"))??b(e)[0]??r[0];for(const e of r)e.tabIndex=e===t?0:-1});const i=u(e=>{n?.onKeyDown?.(e);const r=o.current,t=e.target.closest?.(f);if(!r||!t||e.target!==t||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=b(r),i=a.indexOf(t),s=Number(t.getAttribute("aria-level")??"1"),l=t=>{e.preventDefault(),function(e,r){if(r){for(const t of e.querySelectorAll(f))t.tabIndex=t===r?0:-1;r.focus()}}(r,t)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===t.getAttribute("aria-expanded")){const r=a[i+1];r&&Number(r.getAttribute("aria-level")??"1")>s?l(r):e.preventDefault()}break;case"ArrowLeft":if("true"!==t.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
1
+ import{MOVE_KEYS as e,MoveGrip as r,MoveHint as t,moveFromKey as a}from"./chunk-3PGK3VFS.js";import{GROUP_COLORS as n}from"./chunk-D323R2FT.js";import{Icon as o}from"./chunk-2SHYR3RA.js";import{OneLineLabel as i}from"./chunk-6KO5VTL7.js";import{Tooltip as s}from"./chunk-22S6LG6D.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as c}from"./chunk-E6UCGCOC.js";import{useRef as d,useCallback as u,useId as p,isValidElement as m}from"react";import{jsx as g,jsxs as h}from"react/jsx-runtime";var f='[role="treeitem"]';function b(e){return[...e.querySelectorAll(f)].filter(r=>{for(let t=r.parentElement?.closest('[role="group"]');t&&e.contains(t);t=t.parentElement?.closest('[role="group"]')??null)if(t.hasAttribute("hidden"))return!1;return!0})}function y({"aria-label":e,"aria-labelledby":r,children:t,className:a="",rootProps:n}){const o=d(null);l(()=>{const e=o.current;if(!e)return;const r=[...e.querySelectorAll(f)];if(0===r.length)return;const t=r.find(e=>e===document.activeElement)??r.find(e=>"true"===e.getAttribute("aria-selected"))??b(e)[0]??r[0];for(const e of r)e.tabIndex=e===t?0:-1});const i=u(e=>{n?.onKeyDown?.(e);const r=o.current,t=e.target.closest?.(f);if(!r||!t||e.target!==t||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const a=b(r),i=a.indexOf(t),s=Number(t.getAttribute("aria-level")??"1"),l=t=>{e.preventDefault(),function(e,r){if(r){for(const t of e.querySelectorAll(f))t.tabIndex=t===r?0:-1;r.focus()}}(r,t)};switch(e.key){case"ArrowDown":l(a[i+1]);break;case"ArrowUp":l(a[i-1]);break;case"Home":l(a[0]);break;case"End":l(a[a.length-1]);break;case"ArrowRight":if("true"===t.getAttribute("aria-expanded")){const r=a[i+1];r&&Number(r.getAttribute("aria-level")??"1")>s?l(r):e.preventDefault()}break;case"ArrowLeft":if("true"!==t.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(a[e].getAttribute("aria-level")??"1")<s){l(a[e]);break}}},[n]);/* @__PURE__ */
2
2
  return g("div",{...n,ref:o,role:"tree","aria-label":r?void 0:e,"aria-labelledby":r,onKeyDown:i,className:`flex flex-col gap-1 ${a}`.trim(),children:t})}function v({children:e,hidden:r,className:t=""}){/* @__PURE__ */
3
3
  return g("div",{role:"group",hidden:r,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${t}`.trim(),children:e})}var x=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),k=`${x} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function w(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!m(e)&&"label"in e}function N(e){if(null==e||!1===e)return null;const r=Array.isArray(e)&&e.length>0&&e.every(w)?e:w(e)?[e]:null;return r?r.map((e,r)=>/* @__PURE__ */g("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${x} ${n[e.tone]}`:k,children:e.label},r)):/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:e})}function A({children:e,count:r,expanded:t,onToggle:a}){const n=void 0!==t,o=
4
4
  /* @__PURE__ */g("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */g(i,{children:e})}),s=null!=r&&!1!==r&&/* @__PURE__ */g("span",{"data-tree-count":"",className:k,children:r}),l="text-xs font-semibold uppercase tracking-wide text-gray-500";return n?/* @__PURE__ */g("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */h("button",{type:"button","aria-expanded":t,onClick:a,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",l].join(" "),children:[
5
5
  /* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:j(!!t)}),o,s]})}):/* @__PURE__ */h("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${l}`,children:[
6
- /* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),o,s]})}var j=e=>/* @__PURE__ */g(o,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),D={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function C({label:n,level:o=1,icon:s,preview:l,selected:c=!1,tone:d,expanded:u,onToggle:m,onSelect:f,muted:b=!1,badge:y,actions:v,actionsPinned:x=!1,actionsOverlay:k=!0,rename:w,drop:A,dragging:C=!1,draggable:P=!1,dragHint:$,onMove:K,rowProps:I,className:T=""}){const E=void 0!==u,S=p(),H=[I?.["aria-describedby"],K?S:void 0].filter(Boolean).join(" ")||void 0,L="shared"===d?"text-[color:var(--status-success-soft-ink)]":null,O=c?L?`bg-[var(--status-success-soft)] ${L}`:"bg-blue-50 text-blue-700":"into"===A?`bg-blue-50 ${L??"text-gray-900"}`:`${L??"text-gray-700"} hover:bg-gray-100`;/* @__PURE__ */
7
- return h("div",{...I,role:"treeitem","aria-level":o,"aria-selected":c,"aria-expanded":E?u:void 0,"data-tone":d,tabIndex:c?0:-1,"aria-keyshortcuts":I?.["aria-keyshortcuts"]??(K?e:void 0),"aria-describedby":H,"data-drop":A,"data-draggable":P||void 0,onKeyDown:e=>{if(I?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const r=a(e);r&&K?(e.preventDefault(),K(r)):"Enter"!==e.key&&" "!==e.key||!f?("ArrowRight"===e.key&&E&&!u&&m||"ArrowLeft"===e.key&&E&&u&&m)&&(e.preventDefault(),m()):(e.preventDefault(),f())},onClick:e=>{I?.onClick?.(e),e.defaultPrevented||f?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",P?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",O,"into"===A?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",C?"opacity-40":"",T].filter(Boolean).join(" "),children:["before"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),P&&
6
+ /* @__PURE__ */g("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),o,s]})}var j=e=>/* @__PURE__ */g(o,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),D={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function C({label:n,level:o=1,icon:s,preview:l,selected:c=!1,tone:d,expanded:u,onToggle:m,onSelect:f,muted:b=!1,badge:y,actions:v,actionsPinned:x=!1,actionsOverlay:k=!0,rename:w,drop:A,dragging:C=!1,draggable:P=!1,dragHint:$,onMove:K,rowProps:S,className:E=""}){const H=void 0!==u,I=p(),T=[S?.["aria-describedby"],K?I:void 0].filter(Boolean).join(" ")||void 0,R="shared"===d?"text-[color:var(--status-success-soft-ink)]":null,L=c?R?`bg-[var(--status-success-soft)] ${R}`:"bg-blue-50 text-blue-700":"into"===A?`bg-blue-50 ${R??"text-gray-900"}`:`${R??"text-gray-700"} hover:bg-gray-100`;/* @__PURE__ */
7
+ return h("div",{...S,role:"treeitem","aria-level":o,"aria-selected":c,"aria-expanded":H?u:void 0,"data-tone":d,tabIndex:c?0:-1,"aria-keyshortcuts":S?.["aria-keyshortcuts"]??(K?e:void 0),"aria-describedby":T,"data-drop":A,"data-draggable":P||void 0,onKeyDown:e=>{if(S?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const r=a(e);r&&K?(e.preventDefault(),K(r)):"Enter"!==e.key&&" "!==e.key||!f?("ArrowRight"===e.key&&H&&!u&&m||"ArrowLeft"===e.key&&H&&u&&m)&&(e.preventDefault(),m()):(e.preventDefault(),f())},onClick:e=>{S?.onClick?.(e),e.defaultPrevented||f?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",P?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",L,"into"===A?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",C?"opacity-40":"",E].filter(Boolean).join(" "),children:["before"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===A&&/* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),P&&
8
8
  /* @__PURE__ */g(r,{marker:"tree",hint:$,dragging:C,revealClassName:"group-hover/treerow:opacity-100"}),
9
- /* @__PURE__ */g("span",E?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),m?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:j(!!u)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=s&&/* @__PURE__ */g("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(b?"text-gray-400":""),children:s}),
9
+ /* @__PURE__ */g("span",H?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),m?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:j(!!u)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=s&&/* @__PURE__ */g("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(b?"text-gray-400":""),children:s}),
10
10
  /* @__PURE__ */h("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[w??
11
11
  /* @__PURE__ */g("span",{className:`flex min-w-0 ${c?"font-semibold":"font-medium"} ${b?"text-gray-400 line-through":""}`,children:/* @__PURE__ */h(i,{children:[n,null!=l&&/* @__PURE__ */g("span",{className:"ml-2 font-normal text-gray-500",children:l})]})}),N(y),null!=v&&!k&&/* @__PURE__ */g("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(x||b?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:v})]}),null!=v&&k&&
12
12
  /* @__PURE__ */h("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:D,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(x||b||c?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
13
13
  /* @__PURE__ */g("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
14
14
  /* @__PURE__ */g("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
15
- /* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:v})]}),K&&/* @__PURE__ */g(t,{id:S})]})}function P({onAdd:e,label:r,drop:t=!1,slotProps:a}){const n=c().tree,o=t?n.dropHere:r??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(t?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
15
+ /* @__PURE__ */g("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:v})]}),K&&/* @__PURE__ */g(t,{id:I})]})}function P({onAdd:e,label:r,drop:t=!1,slotProps:a}){const n=c().tree,o=t?n.dropHere:r??n.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(t?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
16
16
  return g("div",{...a,role:"presentation","data-drop":t||void 0,children:e?/* @__PURE__ */h("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
17
17
  /* @__PURE__ */g("span",{"aria-hidden":"true",children:"+"}),o]}):/* @__PURE__ */g("span",{className:i,children:o})})}function $({onInsert:e,label:r,drop:t=!1,seamProps:a}){const n=c().tree,i=r??n.insertHere,l=t?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
18
18
  return h("div",{...a,role:"presentation","data-tree-seam":"","data-drop":t||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
@@ -1,4 +1,4 @@
1
- import{ChartTooltip as e}from"./chunk-P5BOTIJU.js";import{CartesianPlot as t}from"./chunk-RSO67DWS.js";import{resolveSeriesColor as i,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as a}from"./chunk-E6UCGCOC.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{jsx as m,jsxs as n}from"react/jsx-runtime";function s({boxes:s,height:c=240,width:h,color:u,tone:x,formatValue:d,yAxisLabel:y,label:k,className:b,emptyLabel:f}){const p=r().charts,q=a(),g=d??(e=>o(e,q)),v=k??p.distribution,W=i(0,u,x),j=s.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
1
+ import{ChartTooltip as e}from"./chunk-P5BOTIJU.js";import{CartesianPlot as t}from"./chunk-I4VD5D43.js";import{resolveSeriesColor as i,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as a}from"./chunk-E6UCGCOC.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{jsx as m,jsxs as n}from"react/jsx-runtime";function s({boxes:s,height:c=240,width:h,color:u,tone:x,formatValue:d,yAxisLabel:y,label:k,className:b,emptyLabel:f}){const p=r().charts,q=a(),g=d??(e=>o(e,q)),v=k??p.distribution,W=i(0,u,x),j=s.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
2
2
  return m(t,{labels:s.map(e=>e.label),values:j,height:c,width:h,bandPadding:.5,formatValue:g,yAxisLabel:y,className:b,emptyLabel:f,ariaLabel:p.fiveNumber(v,s.length),tooltip:t=>{const i=s[t];/* @__PURE__ */
3
3
  return m(e,{title:i.label,rows:[{key:"max",label:p.maximum,color:W,value:g(i.max)},{key:"q3",label:p.q3,color:W,value:g(i.q3)},{key:"median",label:p.median,color:W,value:g(i.median)},{key:"q1",label:p.q1,color:W,value:g(i.q1)},{key:"min",label:p.minimum,color:W,value:g(i.min)}],emphasisKey:"median",footnote:i.outliers?.length?p.outliers(i.outliers.length):void 0})},children:({x:e,y:t,active:i})=>/* @__PURE__ */m("g",{children:s.map((r,a)=>{const o=e.center(a),s=Math.max(6,e.bandwidth);/* @__PURE__ */
4
4
  return n("g",{opacity:null!==i&&i!==a?.45:1,children:[
@@ -1 +1 @@
1
- import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-HSOREHQB.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)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),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();C(()=>{"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],H=e=>{document.prerendering?C(()=>H(e)):"complete"!==document.readyState?addEventListener("load",()=>H(e),!0):setTimeout(e)};var N=/^[A-Za-z0-9/_:.\-[\]{}*@~]+$/,O=/^[A-Za-z_$][A-Za-z0-9_$.]*$/,U=/^[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&&O.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);C(()=>{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);H(()=>{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&&U.test(e.app),n="string"==typeof e.release&&U.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:U.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
+ import{setBoundaryErrorReporter as e}from"./chunk-KNUR2UEG.js";import{VERSION as t}from"./chunk-WAZTGEMG.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)}},E=class{l},C=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},L=[1800,3e3],P=(e,t={})=>{const n=w(t);C(()=>{const s=p(t,E),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,Z=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)}}},_=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})}},F=[200,500],R=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=h();C(()=>{"interactionCount"in performance||m||(m=T(["event"],M,{durationThreshold:0}));let o,s=g("INP");const c=p(t,Z),d=(n,i,a,d,l)=>{c.M(),s=g("INP",-1,n,i,a,d,l),o=r(e,s,F,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)=>{_(()=>{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,F,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?C(()=>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,G=/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,V=/\d{4,}/g,D=/(^|[/:])(?:\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&&O.test(t)?t:"Error"}function ne(e){if("string"!=typeof e)return"unknown";const t=e.trim().replace(Q,"").split(/[?#]/,1)[0].replace(D,(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);C(()=>{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;_(()=>{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),R(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(G,"[id]").replace(V,"[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};
@@ -0,0 +1 @@
1
+ import{createContext as o,useContext as r}from"react";var t=o(void 0),n=t.Provider;function d(o){const n=r(t);return o?void 0===n?document.body:n:null}export{n as OverlayLayerProvider,d as useOverlayTarget};
@@ -1,3 +1,3 @@
1
- import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-D323R2FT.js";import{Icon as i}from"./chunk-KIBL6M3T.js";import{OneLineLabel as r}from"./chunk-6KO5VTL7.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.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-D323R2FT.js";import{Icon as i}from"./chunk-2SHYR3RA.js";import{OneLineLabel as r}from"./chunk-6KO5VTL7.js";import{useShellStrings as s}from"./chunk-E6UCGCOC.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,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-KKSW5IZ7.js";import{Avatar as r}from"./chunk-MMFJBWJC.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useState as a}from"react";import{jsx as i,jsxs as l}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],n=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function d(){const[d,c]=a(1),o=n.find(e=>e.id===d)??n[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-PCKYNZ5Y.js";import{Avatar as r}from"./chunk-MMFJBWJC.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useState as a}from"react";import{jsx as i,jsxs as l}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],n=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function d(){const[d,c]=a(1),o=n.find(e=>e.id===d)??n[0];/* @__PURE__ */
2
2
  return i("div",{className:"h-full",children:/* @__PURE__ */i(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */l("div",{className:"flex h-full flex-col p-2",children:[
3
3
  /* @__PURE__ */i(t,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,r)=>/* @__PURE__ */l("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
4
4
  /* @__PURE__ */i("span",{children:e.label}),null!=e.count&&/* @__PURE__ */i("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */l("div",{className:"flex h-full",children:[
@@ -1,7 +1,7 @@
1
- import{CountBadge as e}from"./chunk-MAOJENIB.js";import{Icon as n}from"./chunk-KIBL6M3T.js";import{useShellStrings as i,useShellLocale as t}from"./chunk-E6UCGCOC.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useState as a,useId as s}from"react";import{jsx as o,jsxs as c,Fragment as l}from"react/jsx-runtime";var d="px-4 @max-[260px]/acc:px-3",h={band:{head:`${d} py-3 bg-(--rosh-fold-band)`,press:"hover:bg-(--rosh-fold-band-hover)",title:"text-base font-semibold text-(--ink-strongest)",chev:"text-(--ink-strongest)",body:`${d} pb-2`},row:{head:`${d} py-2`,press:"hover:bg-gray-50",title:"text-sm font-medium text-(--ink-strong)",chev:"text-(--ink-strong)",body:`${d} pb-2`}},m=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join(""),u="m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]";function f({items:d,defaultOpenIds:f=[],openIds:p,onOpenChange:b,allowMultiple:v=!1,level:x=3,tier:$="band",className:g=""}){const N=h[$],y=i(),k=t(),[w,j]=a(f),C=s(),O=`h${x}`,I=p??w;/* @__PURE__ */
2
- return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=I.includes(i.id),a=`${C}-${m(i.id)}-head`,s=`${C}-${m(i.id)}-panel`;/* @__PURE__ */
1
+ import{CountBadge as e}from"./chunk-MAOJENIB.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useShellStrings as i,useShellLocale as t}from"./chunk-E6UCGCOC.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useState as a,useId as s}from"react";import{jsx as o,jsxs as c,Fragment as l}from"react/jsx-runtime";var d="px-4 @max-[260px]/acc:px-3",h={band:{head:`${d} py-3 bg-(--rosh-fold-band)`,press:"hover:bg-(--rosh-fold-band-hover)",title:"text-base font-semibold text-(--ink-strongest)",chev:"text-(--ink-strongest)",body:`${d} pb-2`},row:{head:`${d} py-2`,press:"hover:bg-gray-50",title:"text-sm font-medium text-(--ink-strong)",chev:"text-(--ink-strong)",body:`${d} pb-2`}},m=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join(""),u="m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]";function f({items:d,defaultOpenIds:f=[],openIds:p,onOpenChange:b,allowMultiple:v=!1,level:x=3,tier:$="band",className:g=""}){const N=h[$],y=i(),k=t(),[w,j]=a(f),C=s(),O=`h${x}`,A=p??w;/* @__PURE__ */
2
+ return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=A.includes(i.id),a=`${C}-${m(i.id)}-head`,s=`${C}-${m(i.id)}-panel`;/* @__PURE__ */
3
3
  return c("div",{children:[
4
- /* @__PURE__ */o(O,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?s:void 0,onClick:()=>(e=>{const n=I.includes(e)?I.filter(n=>n!==e):v?[...I,e]:[e];void 0===p&&j(n),b?.(n)})(i.id),className:`flex w-full items-center gap-2 text-left transition-colors duration-(--motion-fast) disabled:cursor-not-allowed disabled:opacity-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${N.head} ${N.press}`,children:[null!=i.icon&&/* @__PURE__ */o("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${N.chev}`,children:i.icon}),
4
+ /* @__PURE__ */o(O,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?s:void 0,onClick:()=>(e=>{const n=A.includes(e)?A.filter(n=>n!==e):v?[...A,e]:[e];void 0===p&&j(n),b?.(n)})(i.id),className:`flex w-full items-center gap-2 text-left transition-colors duration-(--motion-fast) disabled:cursor-not-allowed disabled:opacity-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${N.head} ${N.press}`,children:[null!=i.icon&&/* @__PURE__ */o("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${N.chev}`,children:i.icon}),
5
5
  /* @__PURE__ */o("span",{className:`min-w-0 flex-1 ${N.title}`,children:i.title}),"number"==typeof i.count&&i.count>0&&
6
6
  /* @__PURE__ */c(l,{children:[
7
7
  /* @__PURE__ */o("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */o(e,{count:i.count,tone:"accent"})}),
@@ -0,0 +1,7 @@
1
+ import{isFocusableEntry as e,menuStatusIds as t,renderMenuEntries as r}from"./chunk-TZHWF3P5.js";import{useTabLayer as n,focusableIn as o}from"./chunk-CDAJKLGL.js";import{PopupMenu as i,PopupMenuDivider as a}from"./chunk-FKZEGBLK.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as s}from"./chunk-62LW225J.js";import{placeMenu as d,popupBounds as c,followAnchor as u}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useState as m,useRef as h,useId as g,useCallback as v,useEffect as b}from"react";import{jsxs as y,jsx as x}from"react/jsx-runtime";var k=/(^|[\s:])!?z-/,w={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"};function D({trigger:D,items:L,align:K="end",side:j="bottom","aria-label":E,className:W="",triggerClassName:A,menuClassName:C="",minWidth:S=180,linkAs:H,disabled:$,id:N,"aria-describedby":T,"aria-disabled":U=!1,onOpenChange:B,footer:G,footerLabel:I}){const[J,q]=m(!1),[M,P]=m(-1),z=h(null),F=h(null),R=h(null),Z=h(null),O=h(null),Q=null!=G&&!1!==G,V=h({text:"",at:0}),Y=g(),X=g(),_=N??X,ee=h(B);ee.current=B;const te=h(J);te.current=J;const re=v(e=>{q(!1),te.current&&(te.current=!1,ee.current?.(!1)),e&&F.current?.focus()},[]),ne=(t,r)=>{const n=L.length;for(let o=0;o<n;o+=1){const i=((t+r*o)%n+n)%n;if(e(L[i]))return i}return-1},oe=()=>R.current?.closest("[data-popup-menu-tree]")??null;b(()=>{if(!J)return;const e=e=>{const t=e.target;if(z.current?.contains(t)||oe()?.contains(t))return;const r=oe()?.getAttribute("data-popup-menu-tree"),n=t.closest?.("[data-popup-menu-tree]");r&&n?.getAttribute("data-popup-menu-tree")===r||re(!1)};document.addEventListener("pointerdown",e,!0);const t=l(()=>re(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[J,re]);const ie=v(()=>{const e=oe(),t=F.current;if(!e||!t)return;const r=e.style;r.left="0px",r.top="0px",r.maxWidth="none",r.maxHeight="none";const n={width:e.offsetWidth,height:e.offsetHeight},o=d({trigger:t.getBoundingClientRect(),menu:n,bounds:c(t),align:K,side:j});r.left=`${o.left}px`,r.top=`${o.top}px`,r.maxWidth=`${o.maxWidth}px`,r.maxHeight=`${o.maxHeight}px`,r.overflowY=n.height>o.maxHeight?"auto":"",e.dataset.side=o.side,e.dataset.align=K},[K,j]);p(()=>{J&&ie()}),b(()=>{if(J)return u(()=>F.current,ie)},[J,ie]),b(()=>{if(!J)return;const t=R.current,r=e(L[M])?t?.querySelector(`[data-dropdown-index="${M}"]`):null;(r??t)?.focus({preventScroll:!0})},[J,M]),b(()=>{if(J)return f(e=>"Escape"===e.key&&(re(!0),!0),()=>Z.current)},[J,re]),n(Z,J&&Q);const ae=h(null),le=e=>"first"===e?ne(0,1):ne(L.length-1,-1),se=e=>{P(le(e)),q(!0),te.current||(te.current=!0,ae.current=e,B?.(!0))};p(()=>{const e=ae.current;if(!J||!e)return;ae.current=null;const t=le(e);t!==M&&P(t)});const de=t(L,Y),ce="function"==typeof G?G({close:()=>re(!0)}):G,ue={...k.test(C)?{}:{zIndex:s.popup},minWidth:S};/* @__PURE__ */
2
+ return y("div",{ref:z,className:`relative inline-flex ${W}`.trim(),children:[
3
+ /* @__PURE__ */x("button",{ref:F,id:_,type:"button","aria-haspopup":"menu","aria-expanded":J,"aria-controls":J?Y:void 0,"aria-label":E,"aria-describedby":T,"aria-disabled":U||void 0,disabled:$,onClick:()=>{U||(J?re(!1):se("first"))},onKeyDown:e=>{U||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),se("first")):"ArrowUp"===e.key&&(e.preventDefault(),se("last")))},className:A??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(E?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:D}),J&&
4
+ /* @__PURE__ */x(i,{portal:!0,className:C,style:ue,children:/* @__PURE__ */y("div",{ref:Z,children:[
5
+ /* @__PURE__ */x("div",{ref:R,id:Y,role:"menu","aria-orientation":"vertical","aria-label":E,"aria-labelledby":E?void 0:_,"aria-describedby":de,tabIndex:-1,onKeyDown:t=>{if(!t.target.closest?.("[data-popup-submenu-panel]")||"Tab"===t.key)if("ArrowDown"===t.key)t.preventDefault(),P(ne(M+1,1));else if("ArrowUp"===t.key)t.preventDefault(),P(ne(M-1,-1));else if("Home"===t.key)t.preventDefault(),P(ne(0,1));else if("End"===t.key)t.preventDefault(),P(ne(L.length-1,-1));else if("Tab"===t.key){t.preventDefault();const e=!t.shiftKey&&O.current?o(O.current)[0]:void 0;e?e.focus({preventScroll:!0}):re(!0)}else if(" "===t.key){const e=t.target;e.matches?.("a[href]")&&(t.preventDefault(),e.click())}else 1!==t.key.length||t.ctrlKey||t.metaKey||t.altKey||(t=>{const r=Date.now(),n=t.key.toLowerCase(),o=r-V.current.at<500?V.current.text+n:n;V.current={text:o,at:r};const i=[...o].every(e=>e===o[0]),a=i?o[0]:o,l=i?M+1:Math.max(M,0),s=R.current,d=L.length;for(let r=0;r<d;r+=1){const n=((l+r)%d+d)%d;if(e(L[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(a))return t.preventDefault(),void P(n)}})(t)},children:r(L,{menuId:Y,choose:e=>{e.disabled||(re(!0),e.onSelect())},toggle:e=>{e.disabled||e.onSelect()},followLink:()=>re(!0),rowProps:(e,t)=>({"data-dropdown-index":e,tabIndex:e===M?0:-1,onMouseEnter:()=>{t.disabled||O.current?.contains(document.activeElement)||P(e)}}),linkAs:H})}),Q&&/* @__PURE__ */y("div",{ref:O,role:"group","aria-label":I,"data-dropdown-footer":"",onKeyDown:e=>{const t=O.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=o(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=R.current?.querySelector(`[data-dropdown-index="${M}"]`);return void(t??R.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),re(!0))},children:[
6
+ /* @__PURE__ */x("div",{"aria-hidden":"true",children:/* @__PURE__ */x(a,{})}),
7
+ /* @__PURE__ */x("div",{style:w,children:ce})]})]})})]})}export{D as DropdownMenu};
@@ -1,12 +1,12 @@
1
- import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as a}from"./chunk-UQBPKZUR.js";import{INPUT_BASE_ON as i,INPUT_BASE as s}from"./chunk-PF3ANJFI.js";import{Button_default as u}from"./chunk-4IU5BSVE.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import{Tooltip as d}from"./chunk-22S6LG6D.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as m,MENU_MAX_HEIGHT as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as b,glassStyle as v}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as w}from"./chunk-E6UCGCOC.js";import{useState as x,useId as k,useRef as $,useMemo as j,useEffect as D}from"react";import{createPortal as N}from"react-dom";import{jsxs as C,jsx as S}from"react/jsx-runtime";function W(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}function R({onClear:e,ariaLabel:t}){/* @__PURE__ */
2
- return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function F(F){const{options:L,placeholder:E,emptyOptionLabel:M,className:T="",disabled:U,id:z,filter:I=!1,allowFreeText:O=!1,freeTextOption:A,onSearchChange:B,loading:J=!1,error:G,onRetry:P,rightAdornment:H,renderOption:Q,clearable:V=!0,"aria-label":K,"aria-labelledby":X,"aria-describedby":Y}=F,Z=!0===F.multiple,q=F.multiple?F.value:F.value?[F.value]:[],_=F.multiple?"":F.value,ee=e=>{F.multiple?F.onChange(e):F.onChange(e[0]??"")},te=q.length>0,ne=I&&te&&!U,re=Z||I,le=null!=A,oe=O||le,[ae,ie]=x(!1),[se,ue]=x(-1),ce=k(),de=z??`${ce}-input`,he=`${ce}-listbox`,pe=e=>`${ce}-opt-${e}`,[me,fe]=x(""),ge=w(),be=M??ge.select.none,ve=e=>{fe(e),ue(-1),B?.(e)},ye=$(null),we=$(null),xe=$(null),ke=$(null),$e=$(ae);$e.current=ae;const je=$(!1),De=e=>{$e.current&&($e.current=!1,e&&O&&!le&&Ve&&(Z?q.includes(Ve)||ee([...q,Ve]):Ve!==_&&ee([Ve])),ie(!1),ve(""))},Ne=(e,t)=>{if(!e.disabled){if(Z)return ee(q.includes(e.value)?q.filter(t=>t!==e.value):[...q,e.value]),void(e===Ke?ve(""):ue(t));ee([e.value]),De(!1)}},[Ce,Se]=x(null);g(()=>{if(!H||ae)return void Se(null);const e=ke.current?.offsetWidth??0;Se(e?e+(Me?32:8)+6:null)});const We=m(we,ae,re?{popupRef:xe}:{matchTriggerWidth:!0}),Re=j(()=>t(L),[L]),Fe=q.join("\0"),Le=j(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Re)q.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(oe)for(const n of q)t.has(n)||e.push(n);return e},[Re,Fe,oe]),Ee=Le.join(", "),Me=V&&te&&!U,[Te,Ue]=x(null),ze=$(null),Ie=$(""),Oe=$(()=>{});Oe.current=()=>{const e=we.current,t=ze.current;if(!Z||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Le.join("\0")}`;if(o===Ie.current)return;Ie.current=o;let a=null;r>0&&Le.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,a=W(Le,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),Ue(e=>e?.shown===a?.shown&&e?.cut===a?.cut?e:a)},g(()=>{Oe.current()}),D(()=>{const e=we.current;if(!Z||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Oe.current());return t.observe(e),()=>t.disconnect()},[Z]);const Ae=Le.length,Be=!Z||!Te||Te.shown>=Ae?Ee:0===Te.shown?ge.select.selectedCount(Ae):`${Le.slice(0,Te.shown).join(", ")} +${Ae-Te.shown}`,Je=Z&&null!==Te&&(Te.shown<Ae||Te.cut),Ge=ae&&te&&re;D(()=>{if(!ae)return;const e=e=>{const t=e.target;ye.current?.contains(t)||xe.current?.contains(t)||De(!0)};document.addEventListener("mousedown",e);const t=h(()=>De(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[ae,O,me,Fe,F.onChange]),D(()=>{if(ae)return y(e=>!("Escape"!==e.key||!$e.current)&&(De(!1),we.current?.blur(),!0),()=>xe.current)},[ae]);const Pe=j(()=>{const e=/* @__PURE__ */new Set;return n(L,t=>!e.has(t.value)&&(e.add(t.value),!0))},[L]),He=j(()=>{if(B)return Pe;const e=me.trim().toLowerCase();return e?n(Pe,t=>r(t,e)):Pe},[Pe,me,B]),Qe=j(()=>t(He),[He]),Ve=me.trim(),Ke=j(()=>le&&Ve?Re.some(e=>e.label===Ve)||q.includes(Ve)?null:{value:Ve,label:Ve}:null,[le,Ve,Re,Fe]),Xe=j(()=>Ke?[...Qe,Ke]:Qe,[Qe,Ke]);/* @__PURE__ */
3
- return C("div",{ref:ye,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ye.current?.contains(t)||xe.current?.contains(t))||je.current||document.activeElement!==we.current&&De(!0)},children:[(Ye=/* @__PURE__ */S("input",{id:de,ref:we,type:"text",autoComplete:"off",role:"combobox","aria-expanded":ae,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":ae?he:void 0,"aria-activedescendant":ae&&se>=0&&se<Xe.length?pe(se):void 0,"aria-label":X?void 0:K,"aria-labelledby":X,"aria-describedby":Y,value:ae?me:Be,onChange:e=>{ve(e.target.value),ie(!0)},onFocus:()=>{U||(ve(""),ie(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(U)return;if(t.preventDefault(),!ae)return void ie(!0);if(0===Xe.length)return;const n="ArrowDown"===t.key?1:-1;return void ue(t=>e(Xe,t,n))}"Enter"===t.key?(t.preventDefault(),ae&&se>=0&&se<Xe.length?Ne(Xe[se],se):1!==Qe.length||Qe[0].disabled?O&&!le&&Ve&&(Z?(q.includes(Ve)||ee([...q,Ve]),ve("")):(ee([Ve]),De(!1),we.current?.blur())):Ne(Qe[0],0)):"Escape"===t.key?(De(!1),we.current?.blur()):"Tab"===t.key&&De(!0)},placeholder:Ge?Be:E||be,className:`${ne?i:s} ${T} ${Me?"pr-8":""} ${U?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Ge?" rosh-field-shows-choice":""}`,style:Ce?{paddingRight:Ce}:void 0,disabled:U}),Z?/* @__PURE__ */S(d,{content:!ae&&Je?Ee:null,className:"block",children:Ye}):Ye),Z&&
4
- /* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:ze,className:"whitespace-pre"})}),Me&&/* @__PURE__ */S(R,{ariaLabel:ge.select.clear,onClear:()=>{ee([]),De(!1)}}),H&&!ae&&/* @__PURE__ */S("div",{ref:ke,className:`absolute top-1/2 -translate-y-1/2 ${Me?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:H}),ae&&N(
5
- /* @__PURE__ */C("div",{ref:xe,onMouseDownCapture:()=>{je.current=!0,setTimeout(()=>{je.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:p.popup,left:We?.left,right:We?.right,top:We?.top,bottom:We?.bottom,minWidth:We?.minWidth,width:We?.width,...re&&{maxWidth:We?.maxWidth},visibility:We?void 0:"hidden",...v()},children:[Z&&te&&V&&!U&&
6
- /* @__PURE__ */S("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ee([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${b}`,children:ge.select.clearAll}),J?
7
- /* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:ge.search.searching}):G?/* @__PURE__ */C("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
8
- /* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:G}),P&&/* @__PURE__ */S(u,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:P,className:"shrink-0",children:ge.list.retry})]}):null,
9
- /* @__PURE__ */C("div",{id:he,role:Xe.length?"listbox":void 0,"aria-labelledby":Xe.length?X??(K?void 0:de):void 0,"aria-label":Xe.length&&!X?K:void 0,"aria-multiselectable":!(!Xe.length||!Z)||void 0,className:"overflow-y-auto",style:{maxHeight:We?.maxHeight??f},children:[0===Xe.length?J||G?null:/* @__PURE__ */S("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:ge.select.noMatches}):0===Qe.length?null:l(He,(e,t)=>{const n=q.includes(e.value);/* @__PURE__ */
1
+ import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as a}from"./chunk-XZL3HCWH.js";import{INPUT_BASE_ON as i,INPUT_BASE as s}from"./chunk-PF3ANJFI.js";import{Button_default as u}from"./chunk-4IU5BSVE.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import{Tooltip as d}from"./chunk-22S6LG6D.js";import{onOverlayOpen as h}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as p}from"./chunk-62LW225J.js";import{useDropdownPosition as m,MENU_MAX_HEIGHT as f}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{GLASS_DIVIDER as b,glassStyle as v}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as w}from"./chunk-E6UCGCOC.js";import{useState as x,useId as k,useRef as $,useMemo as j,useEffect as D}from"react";import{createPortal as N}from"react-dom";import{jsxs as C,jsx as S}from"react/jsx-runtime";function W(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}function L({onClear:e,ariaLabel:t}){/* @__PURE__ */
2
+ return S("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function F(F){const{options:R,placeholder:E,emptyOptionLabel:M,className:T="",disabled:z,id:I,filter:O=!1,allowFreeText:U=!1,freeTextOption:A,onSearchChange:B,loading:H=!1,error:J,onRetry:G,rightAdornment:P,renderOption:V,clearable:Q=!0,"aria-label":X,"aria-labelledby":K,"aria-describedby":Y}=F,Z=!0===F.multiple,q=F.multiple?F.value:F.value?[F.value]:[],_=F.multiple?"":F.value,ee=e=>{F.multiple?F.onChange(e):F.onChange(e[0]??"")},te=q.length>0,ne=O&&te&&!z,re=Z||O,le=null!=A,oe=U||le,[ae,ie]=x(!1),[se,ue]=x(-1),ce=k(),de=I??`${ce}-input`,he=`${ce}-listbox`,pe=e=>`${ce}-opt-${e}`,[me,fe]=x(""),ge=w(),be=M??ge.select.none,ve=e=>{fe(e),ue(-1),B?.(e)},ye=$(null),we=$(null),xe=$(null),ke=$(null),$e=$(ae);$e.current=ae;const je=$(!1),De=e=>{$e.current&&($e.current=!1,e&&U&&!le&&Qe&&(Z?q.includes(Qe)||ee([...q,Qe]):Qe!==_&&ee([Qe])),ie(!1),ve(""))},Ne=(e,t)=>{if(!e.disabled){if(Z)return ee(q.includes(e.value)?q.filter(t=>t!==e.value):[...q,e.value]),void(e===Xe?ve(""):ue(t));ee([e.value]),De(!1)}},[Ce,Se]=x(null);g(()=>{if(!P||ae)return void Se(null);const e=ke.current?.offsetWidth??0;Se(e?e+(Me?32:8)+6:null)});const We=m(we,ae,re?{popupRef:xe}:{matchTriggerWidth:!0}),Le=j(()=>t(R),[R]),Fe=q.join("\0"),Re=j(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Le)q.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(oe)for(const n of q)t.has(n)||e.push(n);return e},[Le,Fe,oe]),Ee=Re.join(", "),Me=Q&&te&&!z,[Te,ze]=x(null),Ie=$(null),Oe=$(""),Ue=$(()=>{});Ue.current=()=>{const e=we.current,t=Ie.current;if(!Z||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Re.join("\0")}`;if(o===Oe.current)return;Oe.current=o;let a=null;r>0&&Re.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,a=W(Re,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),ze(e=>e?.shown===a?.shown&&e?.cut===a?.cut?e:a)},g(()=>{Ue.current()}),D(()=>{const e=we.current;if(!Z||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ue.current());return t.observe(e),()=>t.disconnect()},[Z]);const Ae=Re.length,Be=!Z||!Te||Te.shown>=Ae?Ee:0===Te.shown?ge.select.selectedCount(Ae):`${Re.slice(0,Te.shown).join(", ")} +${Ae-Te.shown}`,He=Z&&null!==Te&&(Te.shown<Ae||Te.cut),Je=ae&&te&&re;D(()=>{if(!ae)return;const e=e=>{const t=e.target;ye.current?.contains(t)||xe.current?.contains(t)||De(!0)};document.addEventListener("mousedown",e);const t=h(()=>De(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[ae,U,me,Fe,F.onChange]),D(()=>{if(ae)return y(e=>!("Escape"!==e.key||!$e.current)&&(De(!1),we.current?.blur(),!0),()=>xe.current)},[ae]);const Ge=j(()=>{const e=/* @__PURE__ */new Set;return n(R,t=>!e.has(t.value)&&(e.add(t.value),!0))},[R]),Pe=j(()=>{if(B)return Ge;const e=me.trim().toLowerCase();return e?n(Ge,t=>r(t,e)):Ge},[Ge,me,B]),Ve=j(()=>t(Pe),[Pe]),Qe=me.trim(),Xe=j(()=>le&&Qe?Le.some(e=>e.label===Qe)||q.includes(Qe)?null:{value:Qe,label:Qe}:null,[le,Qe,Le,Fe]),Ke=j(()=>Xe?[...Ve,Xe]:Ve,[Ve,Xe]);/* @__PURE__ */
3
+ return C("div",{ref:ye,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(ye.current?.contains(t)||xe.current?.contains(t))||je.current||document.activeElement!==we.current&&De(!0)},children:[(Ye=/* @__PURE__ */S("input",{id:de,ref:we,type:"text",autoComplete:"off",role:"combobox","aria-expanded":ae,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":ae?he:void 0,"aria-activedescendant":ae&&se>=0&&se<Ke.length?pe(se):void 0,"aria-label":K?void 0:X,"aria-labelledby":K,"aria-describedby":Y,value:ae?me:Be,onChange:e=>{ve(e.target.value),ie(!0)},onFocus:()=>{z||(ve(""),ie(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(z)return;if(t.preventDefault(),!ae)return void ie(!0);if(0===Ke.length)return;const n="ArrowDown"===t.key?1:-1;return void ue(t=>e(Ke,t,n))}"Enter"===t.key?(t.preventDefault(),ae&&se>=0&&se<Ke.length?Ne(Ke[se],se):1!==Ve.length||Ve[0].disabled?U&&!le&&Qe&&(Z?(q.includes(Qe)||ee([...q,Qe]),ve("")):(ee([Qe]),De(!1),we.current?.blur())):Ne(Ve[0],0)):"Escape"===t.key?(De(!1),we.current?.blur()):"Tab"===t.key&&De(!0)},placeholder:Je?Be:E||be,className:`${ne?i:s} ${T} ${Me?"pr-8":""} ${z?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Je?" rosh-field-shows-choice":""}`,style:Ce?{paddingRight:Ce}:void 0,disabled:z}),Z?/* @__PURE__ */S(d,{content:!ae&&He?Ee:null,className:"block",children:Ye}):Ye),Z&&
4
+ /* @__PURE__ */S("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */S("span",{ref:Ie,className:"whitespace-pre"})}),Me&&/* @__PURE__ */S(L,{ariaLabel:ge.select.clear,onClear:()=>{ee([]),De(!1)}}),P&&!ae&&/* @__PURE__ */S("div",{ref:ke,className:`absolute top-1/2 -translate-y-1/2 ${Me?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:P}),ae&&N(
5
+ /* @__PURE__ */C("div",{ref:xe,onMouseDownCapture:()=>{je.current=!0,setTimeout(()=>{je.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:p.popup,left:We?.left,right:We?.right,top:We?.top,bottom:We?.bottom,minWidth:We?.minWidth,width:We?.width,...re&&{maxWidth:We?.maxWidth},visibility:We?void 0:"hidden",...v()},children:[Z&&te&&Q&&!z&&
6
+ /* @__PURE__ */S("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ee([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${b}`,children:ge.select.clearAll}),H?
7
+ /* @__PURE__ */S(c,{size:"sm",padding:"py-2",label:ge.search.searching}):J?/* @__PURE__ */C("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
8
+ /* @__PURE__ */S("span",{className:"min-w-0 flex-1",children:J}),G&&/* @__PURE__ */S(u,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:G,className:"shrink-0",children:ge.list.retry})]}):null,
9
+ /* @__PURE__ */C("div",{id:he,role:Ke.length?"listbox":void 0,"aria-labelledby":Ke.length?K??(X?void 0:de):void 0,"aria-label":Ke.length&&!K?X:void 0,"aria-multiselectable":!(!Ke.length||!Z)||void 0,className:"overflow-y-auto",style:{maxHeight:We?.maxHeight??f},children:[0===Ke.length?H||J?null:/* @__PURE__ */S("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:ge.select.noMatches}):0===Ve.length?null:l(Pe,(e,t)=>{const n=q.includes(e.value);/* @__PURE__ */
10
10
  return C("button",{id:pe(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||Z)&&n.preventDefault(),Ne(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===se?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[Z&&/* @__PURE__ */S(o,{selected:n}),
11
- /* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:Q?Q(e,{selected:n,active:t===se}):e.label}),e.sublabel&&/* @__PURE__ */S(a,{grows:re,children:e.sublabel})]},e.value)},ce),Ke&&A&&
12
- /* @__PURE__ */S("button",{id:pe(Qe.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{Z&&e.preventDefault(),Ne(Ke,Qe.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Qe.length?`border-t ${b}`:""} ${se===Qe.length?"bg-gray-100":""}`,children:/* @__PURE__ */S("span",{className:"min-w-0 flex-1 truncate",children:A(Ke.value)})},`${ce}-typed`)]})]}),document.body)]});var Ye}export{F as SearchableSelect,W as fitChoice};
11
+ /* @__PURE__ */S("span",{className:`min-w-0 ${re?"flex-auto":"flex-1"} truncate`,children:V?V(e,{selected:n,active:t===se}):e.label}),e.sublabel&&/* @__PURE__ */S(a,{grows:re,children:e.sublabel})]},e.value)},ce),Xe&&A&&
12
+ /* @__PURE__ */S("button",{id:pe(Ve.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{Z&&e.preventDefault(),Ne(Xe,Ve.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Ve.length?`border-t ${b}`:""} ${se===Ve.length?"bg-gray-100":""}`,children:/* @__PURE__ */S("span",{className:"min-w-0 flex-1 truncate",children:A(Xe.value)})},`${ce}-typed`)]})]}),document.body)]});var Ye}export{F as SearchableSelect,W as fitChoice};
@@ -1,9 +1,9 @@
1
- import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as r}from"./chunk-TZFNWAED.js";import{Icon as n}from"./chunk-KIBL6M3T.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{useId as i,useRef as s,useEffect as c,Children as o,isValidElement as u}from"react";import{jsx as d,jsxs as m,Fragment as h}from"react/jsx-runtime";function p(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-2 h-5 rounded-full text-2xs font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function f({children:e,count:t}){return null==t?/* @__PURE__ */d("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */m("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
1
+ import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as r}from"./chunk-TZFNWAED.js";import{Icon as n}from"./chunk-2SHYR3RA.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as l}from"./chunk-E6UCGCOC.js";import{useId as i,useRef as s,useEffect as c,Children as o,isValidElement as u}from"react";import{jsx as d,jsxs as m,Fragment as h}from"react/jsx-runtime";function p(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-2 h-5 rounded-full text-2xs font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function f({children:e,count:t}){return null==t?/* @__PURE__ */d("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */m("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
2
2
  /* @__PURE__ */d("span",{className:"min-w-0 truncate",children:e}),
3
- /* @__PURE__ */d("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function g(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function x({label:n,count:a,active:o,onClick:u,icon:f,trailing:x,severity:b,depth:y=0}){const w=t(b,"SidebarNavItem"),k=l().severity,N=w?r(w,k):void 0,v=e(),j=i(),C=s(null),I=s(n);I.current=n,c(()=>{if(v&&o)return v.report(j,()=>I.current,C.current)},[v,o,j]);const S=/* @__PURE__ */m(h,{children:[null!=f&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:f}),w&&
3
+ /* @__PURE__ */d("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function g(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function x({label:n,count:a,active:o,onClick:u,icon:f,trailing:x,severity:b,depth:y=0}){const w=t(b,"SidebarNavItem"),k=l().severity,N=w?r(w,k):void 0,v=e(),j=i(),C=s(null),S=s(n);S.current=n,c(()=>{if(v&&o)return v.report(j,()=>S.current,C.current)},[v,o,j]);const I=/* @__PURE__ */m(h,{children:[null!=f&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:f}),w&&
4
4
  /* @__PURE__ */d("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${w.fill}`}),
5
5
  /* @__PURE__ */d("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof n?n:void 0,children:n}),w&&/* @__PURE__ */d("span",{className:"sr-only",children:N}),null!=a&&a>0&&/* @__PURE__ */d("span",{className:p(o),children:a}),null!=x&&/* @__PURE__ */d("span",{className:"shrink-0",children:x})]});/* @__PURE__ */
6
- return d("button",1===y?{ref:C,type:"button",onClick:u,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */d("span",{className:g(o),children:S})}:{ref:C,type:"button",onClick:u,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(o?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:S})}function b({label:e,count:t,children:r,defaultExpanded:l=!0,storageKey:s}){const c=i(),[h,f]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return l},l),g=!h&&o.toArray(r).some(e=>u(e)&&!0===e.props.active);/* @__PURE__ */
6
+ return d("button",1===y?{ref:C,type:"button",onClick:u,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */d("span",{className:g(o),children:I})}:{ref:C,type:"button",onClick:u,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(o?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:I})}function b({label:e,count:t,children:r,defaultExpanded:l=!0,storageKey:s}){const c=i(),[h,f]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return l},l),g=!h&&o.toArray(r).some(e=>u(e)&&!0===e.props.active);/* @__PURE__ */
7
7
  return m("div",{children:[
8
8
  /* @__PURE__ */m("button",{type:"button",onClick:()=>{const e=!h;if(f(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":h,"aria-controls":c,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(g?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
9
9
  /* @__PURE__ */d("span",{className:"min-w-0 truncate",title:e,children:e}),
@@ -1,4 +1,4 @@
1
- import{Icon as e}from"./chunk-KIBL6M3T.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-E6UCGCOC.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
1
+ import{Icon as e}from"./chunk-2SHYR3RA.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-E6UCGCOC.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
2
2
  return r(e,{name:"align-left"});case"center":/* @__PURE__ */
3
3
  return r(e,{name:"align-center"});case"right":/* @__PURE__ */
4
4
  return r(e,{name:"align-right"});case"justify":/* @__PURE__ */