efficient-shell 11.11.0 → 11.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/dist/{Browser-NRGJ53ST.js → Browser-LPGSKKLU.js} +14 -14
  2. package/dist/Calculator-XUV5JV3O.js +29 -0
  3. package/dist/{CurrencyConverter-CJQMDBQW.js → CurrencyConverter-N2HQT7IR.js} +9 -9
  4. package/dist/{Documents-FIGKS36O.js → Documents-IRPS3N5T.js} +23 -23
  5. package/dist/Files-VN2IOPHX.js +88 -0
  6. package/dist/{Notepad-2XW63REV.js → Notepad-JCWNOQET.js} +9 -9
  7. package/dist/{PomodoroTimer-Y5GQX37J.js → PomodoroTimer-356JUEM3.js} +21 -21
  8. package/dist/{Preview-K7KDM4XK.js → Preview-X7XNDI6X.js} +23 -23
  9. package/dist/Sidebar-OZMJNAXN.js +44 -0
  10. package/dist/{Spreadsheet-RQE4OCEK.js → Spreadsheet-YQOVGIU7.js} +33 -33
  11. package/dist/{Stock-IHAG62QV.js → Stock-2XOOZNRR.js} +3 -3
  12. package/dist/{Weather-EQDFEBIH.js → Weather-ZDU2722T.js} +16 -16
  13. package/dist/{WorldClock-VQG7G2Z2.js → WorldClock-PQGERFCH.js} +5 -5
  14. package/dist/ai/index.js +91 -91
  15. package/dist/apps/index.d.ts +21 -2
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/media-host-check.js +1 -1
  18. package/dist/bin/ui-check.js +1 -1
  19. package/dist/charts/BoxPlotChart.js +1 -1
  20. package/dist/charts/CandlestickChart.js +1 -1
  21. package/dist/charts/CartesianPlot.js +1 -1
  22. package/dist/charts/ChartTooltip.js +1 -1
  23. package/dist/charts/ChordChart.js +1 -1
  24. package/dist/charts/ColumnChart.js +1 -1
  25. package/dist/charts/FunnelChart.js +1 -1
  26. package/dist/charts/HeatmapChart.js +1 -1
  27. package/dist/charts/HistogramChart.js +1 -1
  28. package/dist/charts/PieChart.js +1 -1
  29. package/dist/charts/RadarChart.js +1 -1
  30. package/dist/charts/RadialBarChart.js +1 -1
  31. package/dist/charts/RangeChart.js +1 -1
  32. package/dist/charts/SankeyChart.js +1 -1
  33. package/dist/charts/ScatterChart.js +1 -1
  34. package/dist/charts/SpecChart.js +1 -1
  35. package/dist/charts/SunburstChart.js +1 -1
  36. package/dist/charts/TimeSeriesChart.js +1 -1
  37. package/dist/charts/TreemapChart.js +1 -1
  38. package/dist/charts/WaterfallChart.js +1 -1
  39. package/dist/{chunk-QOJ2UNS5.js → chunk-34AHNPW7.js} +1 -1
  40. package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
  41. package/dist/{chunk-PDXOGPWH.js → chunk-3N2MNOV5.js} +1 -1
  42. package/dist/{chunk-3JCOD5L2.js → chunk-4APQHXLI.js} +2 -2
  43. package/dist/{chunk-IEOCUEJK.js → chunk-4EVYK6DR.js} +7 -7
  44. package/dist/{chunk-7IVTGOGM.js → chunk-4JJ5WT4D.js} +1 -1
  45. package/dist/{chunk-3ZRYKZGI.js → chunk-4TB4CSLB.js} +4 -4
  46. package/dist/{chunk-KZEIQO3V.js → chunk-5IESW4PM.js} +5 -5
  47. package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
  48. package/dist/chunk-5W3U3EVG.js +7 -0
  49. package/dist/chunk-64KZ74CS.js +8 -0
  50. package/dist/{chunk-QAIMZN7M.js → chunk-6ETRVCMH.js} +13 -13
  51. package/dist/{chunk-SGBR443F.js → chunk-6S6FJJKP.js} +6 -6
  52. package/dist/{chunk-M57KX3OM.js → chunk-6UJYRGWY.js} +1 -1
  53. package/dist/{chunk-K6D7OSKZ.js → chunk-6WPKLF6G.js} +14 -14
  54. package/dist/{chunk-UWJNQH2X.js → chunk-7A2Y3W55.js} +1 -1
  55. package/dist/{chunk-ZOQXFS3R.js → chunk-7FCIFHO7.js} +1 -1
  56. package/dist/chunk-7TVGP2SX.js +8 -0
  57. package/dist/{chunk-2HAJ33HM.js → chunk-AD27M3ZH.js} +2 -2
  58. package/dist/{chunk-AQGIK2CV.js → chunk-AO7XAAGG.js} +1 -1
  59. package/dist/chunk-AQ7CNPEE.js +15 -0
  60. package/dist/chunk-BOJEZKYS.js +14 -0
  61. package/dist/{chunk-3X2W7R5B.js → chunk-BPJ3CQH7.js} +9 -9
  62. package/dist/chunk-CGA6RTVI.js +9 -0
  63. package/dist/{chunk-CT7AU2TA.js → chunk-CR3YDABU.js} +1 -1
  64. package/dist/{chunk-TXKTITMF.js → chunk-CR42APAY.js} +5 -5
  65. package/dist/{chunk-MQE2FBJU.js → chunk-CXZ7PHHF.js} +5 -5
  66. package/dist/{chunk-V64CJHMY.js → chunk-D5MN3LXC.js} +19 -19
  67. package/dist/{chunk-6LK2BBCC.js → chunk-DMBA6KYQ.js} +5 -5
  68. package/dist/{chunk-ALJS3SYS.js → chunk-DXKXETTT.js} +1 -1
  69. package/dist/chunk-EBGOENC3.js +3 -0
  70. package/dist/{chunk-6DQANKTL.js → chunk-ELIWGIR7.js} +7 -7
  71. package/dist/chunk-EOVXFXVV.js +2 -0
  72. package/dist/{chunk-CSLMWGFS.js → chunk-EQ72AP5E.js} +1 -1
  73. package/dist/chunk-ES2LUEPN.js +22 -0
  74. package/dist/{chunk-62BDGAML.js → chunk-F33L4J3P.js} +6 -6
  75. package/dist/{chunk-QEDVXD3L.js → chunk-FD6XZRWA.js} +1 -1
  76. package/dist/{chunk-X2DUOIJP.js → chunk-FEUTN4GK.js} +1 -1
  77. package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
  78. package/dist/chunk-FZWSP7KJ.js +28 -0
  79. package/dist/chunk-G3FHFWC2.js +4 -0
  80. package/dist/{chunk-42TLGG33.js → chunk-GJFTO7D4.js} +1 -1
  81. package/dist/{chunk-VEGZVUHE.js → chunk-GJVGGYQ2.js} +1 -1
  82. package/dist/{chunk-LGTYPLJM.js → chunk-GS74BABV.js} +3 -3
  83. package/dist/{chunk-LXOX5FGH.js → chunk-HGMQOHMK.js} +2 -2
  84. package/dist/{chunk-CG5X5ZLV.js → chunk-HJM4LSMM.js} +1 -1
  85. package/dist/{chunk-E3EHHR73.js → chunk-HOEEFFE3.js} +9 -9
  86. package/dist/{chunk-32EKHIAZ.js → chunk-HT7SOOMD.js} +12 -12
  87. package/dist/{chunk-R72ZKZDP.js → chunk-I5GDAQYL.js} +2 -2
  88. package/dist/{chunk-TA4JGC5C.js → chunk-IFWXC323.js} +1 -1
  89. package/dist/{chunk-5B4GRLAA.js → chunk-IJ6HZXZY.js} +1 -1
  90. package/dist/{chunk-UG42KUCT.js → chunk-IKKR2TYY.js} +4 -4
  91. package/dist/{chunk-OXCFRH33.js → chunk-JFCCI5L2.js} +1 -1
  92. package/dist/{chunk-CLAKVFOB.js → chunk-JGWUSJDD.js} +31 -31
  93. package/dist/{chunk-I5XNADZ3.js → chunk-JJLAI6GL.js} +8 -8
  94. package/dist/{chunk-F636NDAU.js → chunk-K3IUUZO5.js} +7 -7
  95. package/dist/{chunk-ZOQVYSTB.js → chunk-KV4QPU6U.js} +18 -18
  96. package/dist/{chunk-RNBC6V2D.js → chunk-L2IPWMLI.js} +3 -3
  97. package/dist/chunk-L74WV4RJ.js +6 -0
  98. package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
  99. package/dist/chunk-LJJ7FDAQ.js +6 -0
  100. package/dist/{chunk-3OHADZYV.js → chunk-LLSLY6BT.js} +1 -1
  101. package/dist/{chunk-CDQUOCXO.js → chunk-LP45EML2.js} +1 -1
  102. package/dist/{chunk-HRG4FYVU.js → chunk-LWFH5QTJ.js} +1 -1
  103. package/dist/{chunk-Q7DVGUML.js → chunk-LXBBJNBQ.js} +1 -1
  104. package/dist/{chunk-SWJXWDKX.js → chunk-M4AOQYSP.js} +1 -1
  105. package/dist/{chunk-RQBQETXQ.js → chunk-MD6EPKOR.js} +8 -8
  106. package/dist/{chunk-S43DAIIB.js → chunk-MFP5KOQW.js} +5 -5
  107. package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
  108. package/dist/{chunk-IUMFOSFJ.js → chunk-N75MPMLD.js} +3 -3
  109. package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
  110. package/dist/{chunk-C3UY34DC.js → chunk-NPT6EXHK.js} +4 -4
  111. package/dist/{chunk-57WQVUBX.js → chunk-OCWWEHNR.js} +2 -2
  112. package/dist/{chunk-PVOTOUJG.js → chunk-OMROEVOP.js} +1 -1
  113. package/dist/{chunk-VPEH3THH.js → chunk-P75N466Z.js} +3 -3
  114. package/dist/{chunk-AHITTM6W.js → chunk-PTVTNCD6.js} +1 -1
  115. package/dist/chunk-Q7UTGO73.js +11 -0
  116. package/dist/{chunk-3VR5BOD4.js → chunk-QDL2FNP7.js} +2 -2
  117. package/dist/{chunk-ATKFIHDP.js → chunk-RBAC26J7.js} +4 -4
  118. package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
  119. package/dist/{chunk-63545Z3N.js → chunk-RXVFAFEB.js} +1 -1
  120. package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
  121. package/dist/chunk-SI33IE7G.js +2 -0
  122. package/dist/{chunk-ESWR7YNY.js → chunk-SPMD7UZO.js} +3 -3
  123. package/dist/{chunk-A4YTWDKD.js → chunk-SSM6P43S.js} +1 -1
  124. package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
  125. package/dist/{chunk-EV7VAXMO.js → chunk-TTQJQKCE.js} +9 -9
  126. package/dist/chunk-UBQUXUD2.js +7 -0
  127. package/dist/{chunk-YUAF3FDE.js → chunk-UCAMOW53.js} +4 -4
  128. package/dist/{chunk-JG26ICX6.js → chunk-UEWB6IOD.js} +2 -2
  129. package/dist/{chunk-KKJ55GUZ.js → chunk-UHGAT5MH.js} +1 -1
  130. package/dist/{chunk-PZHO4FEN.js → chunk-UOGF37Z4.js} +1 -1
  131. package/dist/chunk-UZTKBA7Z.js +13 -0
  132. package/dist/{chunk-6LITLCVV.js → chunk-VEATEVMV.js} +3 -3
  133. package/dist/{chunk-K6LW2QLI.js → chunk-VIDT4JLR.js} +1 -1
  134. package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
  135. package/dist/chunk-WZJPASST.js +6 -0
  136. package/dist/{chunk-B2SLXCMY.js → chunk-XOH6QERF.js} +8 -8
  137. package/dist/chunk-YXSGMPNW.js +1 -0
  138. package/dist/{chunk-7R23EKON.js → chunk-ZA2RBNRA.js} +1 -1
  139. package/dist/{chunk-BDUXF7BT.js → chunk-ZHS2VQU7.js} +3 -3
  140. package/dist/{chunk-7HLBVMMQ.js → chunk-ZMC25LRC.js} +1 -1
  141. package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
  142. package/dist/data/DataTable.js +1 -1
  143. package/dist/data/EntityList.js +1 -1
  144. package/dist/data/ListLoadError.js +1 -1
  145. package/dist/data/ResizableTable.js +1 -1
  146. package/dist/forms/AlignmentGrid.js +1 -1
  147. package/dist/forms/BorderInput.js +1 -1
  148. package/dist/forms/BrandAssetEditor.js +1 -1
  149. package/dist/forms/Button.js +1 -1
  150. package/dist/forms/ColorPicker.js +1 -1
  151. package/dist/forms/ComposerAttachments.js +1 -1
  152. package/dist/forms/CornersInput.js +1 -1
  153. package/dist/forms/DateRangePicker.js +1 -1
  154. package/dist/forms/DisplayChips.js +1 -1
  155. package/dist/forms/FilePicker.js +1 -1
  156. package/dist/forms/IconButton.js +1 -1
  157. package/dist/forms/IconPicker.js +1 -1
  158. package/dist/forms/Input.js +1 -1
  159. package/dist/forms/InputNumber.js +1 -1
  160. package/dist/forms/LinkPicker.js +1 -1
  161. package/dist/forms/MediaLibrary.js +1 -1
  162. package/dist/forms/MediaUploadField.js +1 -1
  163. package/dist/forms/MediaUploadGrid.js +1 -1
  164. package/dist/forms/MediaUsedInList.js +1 -1
  165. package/dist/forms/NumericKeypad.js +1 -1
  166. package/dist/forms/PictureTiles.js +1 -1
  167. package/dist/forms/PositionInput.js +1 -1
  168. package/dist/forms/RenameField.js +1 -1
  169. package/dist/forms/Segmented.js +1 -1
  170. package/dist/forms/Select.js +1 -1
  171. package/dist/forms/SidesInput.js +1 -1
  172. package/dist/forms/Slider.js +1 -1
  173. package/dist/forms/Snippet.js +1 -1
  174. package/dist/forms/SplitButton.js +1 -1
  175. package/dist/forms/TagInput.js +1 -1
  176. package/dist/forms/TextToolbar.js +1 -1
  177. package/dist/forms/WidthsBar.js +1 -1
  178. package/dist/index.js +378 -378
  179. package/dist/map/index.js +3 -3
  180. package/dist/page-tabs/index.js +5 -5
  181. package/dist/shell/AppUpdateBanner.js +1 -1
  182. package/dist/shell/ColoredBadge.js +1 -1
  183. package/dist/shell/ContextMenu.js +1 -1
  184. package/dist/shell/DropdownMenu.js +1 -1
  185. package/dist/shell/EditableGrid.js +1 -1
  186. package/dist/shell/GlobalSearch.js +1 -1
  187. package/dist/shell/HelpCenter.js +1 -1
  188. package/dist/shell/IconRail.js +1 -1
  189. package/dist/shell/ImageLightbox.js +1 -1
  190. package/dist/shell/ItemCount.js +1 -1
  191. package/dist/shell/LanguageSelect.js +1 -1
  192. package/dist/shell/Markdown.js +1 -1
  193. package/dist/shell/PopupMenu.js +1 -1
  194. package/dist/shell/ResizeHandle.js +1 -1
  195. package/dist/shell/SearchableSelect.js +1 -1
  196. package/dist/shell/SettingReset.js +1 -1
  197. package/dist/shell/SidebarLayout.js +1 -1
  198. package/dist/shell/SidebarNav.js +1 -1
  199. package/dist/shell/SortableList.js +1 -1
  200. package/dist/shell/StatusBadge.js +1 -1
  201. package/dist/shell/Tabs.js +1 -1
  202. package/dist/shell/Tooltip.js +1 -1
  203. package/dist/shell/TopNav.js +1 -1
  204. package/dist/shell/TransferProgress.js +1 -1
  205. package/dist/shell/Tree.js +1 -1
  206. package/dist/telemetry/index.js +1 -1
  207. package/dist/templates/AuthScreen.js +1 -1
  208. package/dist/templates/ChatTemplate.js +1 -1
  209. package/dist/templates/CheckoutTemplate.js +1 -1
  210. package/dist/templates/DashboardTemplate.js +1 -1
  211. package/dist/templates/DataTablePage.js +1 -1
  212. package/dist/templates/EmailTemplate.js +1 -1
  213. package/dist/templates/ErrorBoundary.js +1 -1
  214. package/dist/templates/FormLayoutPage.js +1 -1
  215. package/dist/templates/GalleryTemplate.js +1 -1
  216. package/dist/ui/index.js +1 -1
  217. package/dist/version.js +1 -1
  218. package/package.json +1 -1
  219. package/dist/Calculator-YZEGVEQ7.js +0 -29
  220. package/dist/Files-FPNJ46XY.js +0 -88
  221. package/dist/Sidebar-QP5Y7RBV.js +0 -44
  222. package/dist/chunk-2EPAXWZZ.js +0 -14
  223. package/dist/chunk-6FIYG7IH.js +0 -28
  224. package/dist/chunk-6R32KKIS.js +0 -22
  225. package/dist/chunk-7DI3VQCF.js +0 -2
  226. package/dist/chunk-B2MD232O.js +0 -6
  227. package/dist/chunk-EC22ACQZ.js +0 -11
  228. package/dist/chunk-FJBJUFD7.js +0 -4
  229. package/dist/chunk-GO6HU2O3.js +0 -7
  230. package/dist/chunk-H56TNUV4.js +0 -1
  231. package/dist/chunk-IGQZANYE.js +0 -15
  232. package/dist/chunk-MQ445O4X.js +0 -6
  233. package/dist/chunk-NMTS2L2B.js +0 -8
  234. package/dist/chunk-ODQYWMDF.js +0 -3
  235. package/dist/chunk-OPZXVXX5.js +0 -7
  236. package/dist/chunk-OZM6DE7A.js +0 -8
  237. package/dist/chunk-PMA6DZ4Q.js +0 -6
  238. package/dist/chunk-SCZUDGRZ.js +0 -2
  239. package/dist/chunk-SUYQ7QYB.js +0 -13
  240. package/dist/chunk-VEZHFONL.js +0 -9
@@ -1,14 +1,14 @@
1
- import{SearchableSelect as e}from"./chunk-SUYQ7QYB.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-ESWR7YNY.js";import{isSafeLinkHref as t}from"./chunk-Q5Z3KHT2.js";import{Input_default as r}from"./chunk-LGTYPLJM.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-7DI3VQCF.js";import{Icon as o}from"./chunk-7V32O5NF.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-5YP7MFPK.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:j="",tidyAddress:O,addressAddon:Y}=t,$=void 0!==t.onApply,E=u().link,T=y.isSafe??k,z=d(),A=c(null),P=c(null),[Q,D]=p({url:n}),K=$?Q.url:n,[U,L]=p(!1),[M,S]=p(null),[W,B]=p(null),[R,V]=p(!1),H=c(null),Z=c(()=>{});Z.current=$?t.onCancel:()=>{},m(()=>{if($)return s(e=>{const a=A.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(Z.current(),!0)},()=>A.current)},[$]),m(()=>{if(!$)return;const e=P.current;e?(e.focus(),e.select()):A.current?.querySelector("button, input")?.focus()},[]);const q=o??[{value:b,label:E.address,target:{type:"text"}}],G=M&&M.against===K?M.kind:y.kindOf(K),I=q.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===G),J=I.find(e=>"text"===e.target.type),X=I.find(e=>e.value===G)??J??I[0];if(!X)return null;const _="text"!==X.target.type,ee=_?y.targetOf(K):K,ae=h(X.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:E.unavailable(e)}),re="select"===X.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(K):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=W&&W.against===K?W.text:K,se=_?K:O?O(oe.trim()).trim():oe.trim(),ue=$&&O?se:oe,de=!_&&""!==ue.trim()&&!T(ue),ce=de&&(!$||U);_&&R&&V(!1);const pe=(e,a)=>{$?D({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{S(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{L(!1);const a=e.trim();a?T(e)?(B({text:e,against:a}),me(a)):B({text:e,against:K}):(B({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===P.current||H.current?.contains(a)))return;if(V(!1),$||!O||C)return;const l=O(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!$||!se)return;if(!_&&de)return void L(!0);const e=_&&Q.url===se?Q.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
1
+ import{SearchableSelect as e}from"./chunk-UZTKBA7Z.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-SPMD7UZO.js";import{isSafeLinkHref as t}from"./chunk-Q5Z3KHT2.js";import{Input_default as r}from"./chunk-GS74BABV.js";import{INPUT_SIZES as n}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-EOVXFXVV.js";import{Icon as o}from"./chunk-7V32O5NF.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-5YP7MFPK.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:n,kinds:o,rules:y=x,filtersFor:w,label:N,readOnly:C,placeholder:F,className:O="",tidyAddress:j,addressAddon:A}=t,$=void 0!==t.onApply,E=u().link,T=y.isSafe??k,z=d(),K=c(null),P=c(null),[U,V]=p({url:n}),B=$?U.url:n,[D,Y]=p(!1),[Z,M]=p(null),[S,Q]=p(null),[W,X]=p(!1),H=c(null),L=c(()=>{});L.current=$?t.onCancel:()=>{},m(()=>{if($)return s(e=>{const a=K.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(L.current(),!0)},()=>K.current)},[$]),m(()=>{if(!$)return;const e=P.current;e?(e.focus(),e.select()):K.current?.querySelector("button, input")?.focus()},[]);const R=o??[{value:b,label:E.address,target:{type:"text"}}],q=Z&&Z.against===B?Z.kind:y.kindOf(B),G=R.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===q),I=G.find(e=>"text"===e.target.type),J=G.find(e=>e.value===q)??I??G[0];if(!J)return null;const _="text"!==J.target.type,ee=_?y.targetOf(B):B,ae=h(J.target),le=ae.find(e=>e.value===ee),te=e=>({value:e,label:E.unavailable(e)}),re="select"===J.target.type&&ee&&w?w(ee):null,ne=re?y.readFilter(B):null,ie=ne?re?.find(e=>e.param===ne.param):void 0,oe=S&&S.against===B?S.text:B,se=_?B:j?j(oe.trim()).trim():oe.trim(),ue=$&&j?se:oe,de=!_&&""!==ue.trim()&&!T(ue),ce=de&&(!$||D);_&&W&&X(!1);const pe=(e,a)=>{$?V({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},me=(e,a)=>{M(a=>a?{...a,against:e}:a),pe(e,a)},fe=e=>{if(!e)return me("");const a=ae.find(a=>a.value===e);me(e,a?.label)},ve=e=>{Y(!1);const a=e.trim();a?T(e)?(Q({text:e,against:a}),me(a)):Q({text:e,against:B}):(Q({text:e,against:""}),me(""))},ge=e=>{const a=e.relatedTarget;if(a&&(a===P.current||H.current?.contains(a)))return;if(X(!1),$||!j||C)return;const l=j(oe.trim());l.trim()!==oe.trim()&&ve(l)},he=()=>{if(!$||!se)return;if(!_&&de)return void Y(!0);const e=_&&U.url===se?U.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},be=(e,a)=>a&&!e.some(e=>e.value===a)?[te(a),...e]:[...e],xe=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
2
2
  return f(e,{"aria-label":a,value:t,options:o,disabled:C,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
3
- return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===X.target.type)ke=/* @__PURE__ */f(r,{ref:P,id:`${z}-address`,size:"sm",type:"text",invalid:ce,"aria-label":E.address,"aria-describedby":ce?`${z}-why`:void 0,placeholder:F??E.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>V(!0),onBlur:ge,onKeyDown:O&&!$?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===X.target.type?X.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):X.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:X.target.placeholder},...be(e,ee)];ke=xe(X.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(E.linkType,X.value,I.map(e=>({value:e.value,label:e.label})),e=>{B(null),L(!1);const a=I.find(a=>a.value===e);if(!a||"text"===a.target.type)return void S({kind:e,against:K});const l=h(a.target)[0];S({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,Y&&R&&!C&&"text"===X.target.type&&/* @__PURE__ */f("div",{ref:H,onBlur:ge,children:Y({url:oe,onChange:ve})}),re&&xe(E.filter,ne?.param??"",[{value:"",label:E.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(E.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${z}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:E.unsafe}),X.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:X.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:E.filterHint})]});if(!$)/* @__PURE__ */
4
- return f("div",{ref:A,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
5
- return v("div",{ref:A,role:"dialog","aria-label":N??E.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:E.title}):/* @__PURE__ */f("label",{htmlFor:`${z}-address`,className:a({inline:!0}),children:E.title}),ye,
3
+ return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:C,onChange:n})};let ke;if("text"===J.target.type)ke=/* @__PURE__ */f(r,{ref:P,id:`${z}-address`,size:"sm",type:"text",invalid:ce,"aria-label":E.address,"aria-describedby":ce?`${z}-why`:void 0,placeholder:F??E.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:oe,readOnly:C,onChange:e=>ve(e.target.value),onFocus:()=>X(!0),onBlur:ge,onKeyDown:j&&!$?e=>{"Enter"===e.key&&e.currentTarget.blur()}:void 0});else{const e="groups"===J.target.type?J.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):J.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:J.target.placeholder},...be(e,ee)];ke=xe(J.label,ee,a,fe,e.length>10)}const ye=/* @__PURE__ */v(g,{children:[o&&xe(E.linkType,J.value,G.map(e=>({value:e.value,label:e.label})),e=>{Q(null),Y(!1);const a=G.find(a=>a.value===e);if(!a||"text"===a.target.type)return void M({kind:e,against:B});const l=h(a.target)[0];M({kind:e,against:l?l.value:""}),l?pe(l.value,l.label):pe("")},!1),ke,A&&W&&!C&&"text"===J.target.type&&/* @__PURE__ */f("div",{ref:H,onBlur:ge,children:A({url:oe,onChange:ve})}),re&&xe(E.filter,ne?.param??"",[{value:"",label:E.noFilter},...ne&&!ie?[te(ne.param)]:[],...re.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return me(ee,le?.label);const a=re?.find(a=>a.param===e),l=a?.values[0];l&&me(y.withFilter(ee,{param:e,value:l.value}),l.label)},!1),re&&ne&&xe(E.value,ne.value,be((ie?.values??[]).map(e=>({value:e.value,label:e.label})),ne.value),e=>{if(!ne)return;const a=ie?.values.find(a=>a.value===e);me(y.withFilter(ee,{param:ne.param,value:e}),a?.label)},(ie?.values.length??0)>10),ce&&/* @__PURE__ */f("p",{id:`${z}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:E.unsafe}),J.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:J.hint}),re&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:E.filterHint})]});if(!$)/* @__PURE__ */
4
+ return f("div",{ref:K,className:`flex min-w-0 flex-auto flex-col gap-2 ${O}`.trim(),role:N?"group":void 0,"aria-label":N,children:ye});const we=t.onRemove;/* @__PURE__ */
5
+ return v("div",{ref:K,role:"dialog","aria-label":N??E.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${O}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),he())},children:[_?/* @__PURE__ */f("span",{className:a({inline:!0}),children:E.title}):/* @__PURE__ */f("label",{htmlFor:`${z}-address`,className:a({inline:!0}),children:E.title}),ye,
6
6
  /* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[we?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:we,children:E.remove}):null,
7
7
  /* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
8
- /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>Z.current(),children:E.cancel}),
9
- /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:E.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),j=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
8
+ /* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>L.current(),children:E.cancel}),
9
+ /* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:he,disabled:C||""===se,children:E.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,N]=p(!1),C=c(null),F=d(),O=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
10
10
  return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
11
11
  /* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
12
12
  /* @__PURE__ */v("button",{ref:C,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
13
13
  /* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
14
- /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:t?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{y as LinkPicker,w as TextLinkField};
14
+ /* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),O()},onRemove:t?()=>{i(""),O()}:void 0,onCancel:O})})]})}export{y as LinkPicker,w as TextLinkField};
@@ -1,4 +1,4 @@
1
- import{SidebarLayout as e}from"./chunk-SGBR443F.js";import{Avatar as t}from"./chunk-SEP35R2E.js";import{ItemCount as r}from"./chunk-PDXOGPWH.js";import{Button_default as a}from"./chunk-7DI3VQCF.js";import{useState as i}from"react";import{jsx as l,jsxs as n}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"}],d=[{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 c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
1
+ import{SidebarLayout as e}from"./chunk-6S6FJJKP.js";import{Avatar as t}from"./chunk-SEP35R2E.js";import{ItemCount as r}from"./chunk-3N2MNOV5.js";import{Button_default as a}from"./chunk-EOVXFXVV.js";import{useState as i}from"react";import{jsx as l,jsxs as n}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"}],d=[{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 c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
2
2
  return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
3
3
  /* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
4
4
  /* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
@@ -1,15 +1,15 @@
1
- import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{keepsNativeMenu as t}from"./chunk-5QFPTDQF.js";import{Icon as n}from"./chunk-7V32O5NF.js";import{onOverlayOpen as r}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as l}from"./chunk-TWVUQUUD.js";import{glassStyle as c,GLASS_DIVIDER as s}from"./chunk-5FYDNH4Y.js";import{createContext as d,forwardRef as u,useContext as p,useId as m,useRef as h,useState as f,useEffect as g,useMemo as y,useCallback as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as k,Fragment as v}from"react/jsx-runtime";function N(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function C(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function E(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function T(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function M(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,s=c>=a;return i&&s?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:s?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function W(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var $=d(null),L=d(!1);function j({children:e,style:n,className:a="",onClose:s,minWidth:d=180,portal:u=!1}){const p=h(null),b=m(),[x,v]=f([]),E=h();g(()=>()=>clearTimeout(E.current),[]);const T=i(),M=y(()=>{const e=()=>clearTimeout(E.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>N(e,t,n))},scheduleClose:t=>{e(),E.current=setTimeout(()=>v(e=>C(e,t)),200)},closeBelow:t=>{e(),v(e=>C(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),s?.()},root:p}},[b,x,s]);g(()=>{if(!s)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||p.current&&!p.current.contains(e.target)&&s()},t=e=>{"Escape"===e.key&&s()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=r(s),o=l(()=>!1,()=>p.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),o()}},[s,b]),g(()=>{const e=p.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const L=W(),j=/(^|[\s:])!?z-/.test(a),B=/* @__PURE__ */k("div",{ref:p,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===L?"py-1":"large"===L?"py-2":"py-1"} ${a}`,onContextMenu:e=>{t(e.target)||e.preventDefault()},style:{...j?{}:{zIndex:o.menu},minWidth:d,animation:"popup-in 0.12s ease-out",...c(),...n},children:/* @__PURE__ */k($.Provider,{value:M,children:e})});return u?T?w(B,document.body):null:B}function B(e,t,n,r=!1){const o=W(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-accent-tint text-blue-700":"text-ink not-disabled:not-aria-disabled:hover:bg-accent-tint not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i,..."normal"===o?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var D=/* @__PURE__ */k(n,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function H({kind:e,checked:t}){/* @__PURE__ */
1
+ import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{keepsNativeMenu as t}from"./chunk-5QFPTDQF.js";import{Icon as n}from"./chunk-7V32O5NF.js";import{onOverlayOpen as r}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as o}from"./chunk-62LW225J.js";import{useHydrated as i,useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{glassStyle as l,GLASS_DIVIDER as c}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{createContext as d,forwardRef as u,useContext as p,useId as m,useRef as h,useState as f,useEffect as g,useMemo as y,useCallback as b}from"react";import{createPortal as w}from"react-dom";import{jsxs as x,jsx as k,Fragment as v}from"react/jsx-runtime";function N(e,t,n){return e.length===t+1&&e[t].key===n.key?e:[...e.slice(0,t),n]}function C(e,t){const n=Math.max(0,t);return e.length>n?e.slice(0,n):e}function E(e,t,n){if(0===t.length||0===e.length)return[];const r=[e];for(let e=1;e<t.length;e++){const o=r[e-1].find(n=>n.to===t[e].key),i=o?n(o):[];if(0===i.length)break;r.push(i)}return r}function T(e,t,n,r){const o=Math.max(0,r-n),i=Math.min(t,o),a=e-i/2;return a<n?n:a+i>r?Math.max(n,r-i):a}function M(e,t,n,r,o,i=!1,a=8){const l=t+o,c=e-o-n,s=c>=a;return i&&s?{left:c,flipped:!0}:l+n<=r-a?{left:l,flipped:!1}:s?{left:c,flipped:!0}:i?{left:a,flipped:!0}:{left:Math.max(a,r-a-n),flipped:!1}}function W(){try{return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim()||"normal"}catch{return"normal"}}var $=d(null),L=d(!1);function j({children:e,style:n,className:a="",onClose:c,minWidth:d=180,portal:u=!1}){const p=h(null),b=m(),[x,v]=f([]),E=h();g(()=>()=>clearTimeout(E.current),[]);const T=i(),M=y(()=>{const e=()=>clearTimeout(E.current);return{id:b,depth:0,path:x,open:(t,n)=>{e(),v(e=>N(e,t,n))},scheduleClose:t=>{e(),E.current=setTimeout(()=>v(e=>C(e,t)),200)},closeBelow:t=>{e(),v(e=>C(e,t))},cancelClose:e,closeTree:()=>{e(),v([]),c?.()},root:p}},[b,x,c]);g(()=>{if(!c)return;const e=e=>{e.target.closest("[data-menu-toggle]")||e.target.closest?.(`[data-popup-menu-tree="${b}"]`)||p.current&&!p.current.contains(e.target)&&c()},t=e=>{"Escape"===e.key&&c()};window.addEventListener("pointerdown",e),window.addEventListener("keydown",t);const n=r(c),o=s(()=>!1,()=>p.current);return()=>{window.removeEventListener("pointerdown",e),window.removeEventListener("keydown",t),n(),o()}},[c,b]),g(()=>{const e=p.current;e&&requestAnimationFrame(()=>{const t=e.getBoundingClientRect();if(t.right>window.innerWidth-8){const n=t.right-window.innerWidth+8;e.style.left?e.style.left=parseFloat(e.style.left)-n+"px":e.style.right||(e.style.left=t.left-n+"px")}if(t.left<8&&(e.style.left?e.style.left="8px":e.style.right&&(e.style.right=window.innerWidth-t.width-8+"px")),t.bottom>window.innerHeight-8){const n=t.bottom-window.innerHeight+8;e.style.top?e.style.top=parseFloat(e.style.top)-n+"px":e.style.bottom?e.style.bottom="8px":e.style.top=t.top-n+"px"}t.top<8&&(e.style.top?e.style.top="8px":e.style.bottom&&(e.style.bottom=window.innerHeight-t.height-8+"px"))})});const L=W(),j=/(^|[\s:])!?z-/.test(a),B=/* @__PURE__ */k("div",{ref:p,"data-popup-menu-tree":b,className:`fixed rounded-(--radius-popup) ${"tight"===L?"py-1":"large"===L?"py-2":"py-1"} ${a}`,onContextMenu:e=>{t(e.target)||e.preventDefault()},style:{...j?{}:{zIndex:o.menu},minWidth:d,animation:"popup-in 0.12s ease-out",...l(),...n},children:/* @__PURE__ */k($.Provider,{value:M,children:e})});return u?T?w(B,document.body):null:B}function B(e,t,n,r=!1){const o=W(),i="tight"===o?"0.25rem":"large"===o?"0.6rem":0;return{className:`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${e?"text-red-600 not-disabled:not-aria-disabled:hover:bg-red-50":r?"bg-accent-tint text-blue-700":"text-ink not-disabled:not-aria-disabled:hover:bg-accent-tint not-disabled:not-aria-disabled:hover:text-blue-700"}\n ${t?"opacity-40 cursor-not-allowed":""}\n ${n}`,style:{width:"calc(100% - 8px)",marginLeft:4,marginRight:4,fontSize:"var(--menu-font-size, 14px)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:i,paddingBottom:i,..."normal"===o?{minHeight:"calc(var(--row-height-menu, 2.25rem) + 2 * (var(--menu-padding-y, 0.5rem) - 0.5rem))"}:{}}}}var D=/* @__PURE__ */k(n,{name:"check","aria-hidden":!0,className:"h-4 w-4",strokeWidth:2});function H({kind:e,checked:t}){/* @__PURE__ */
2
2
  return k("span","checkbox"===e?{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(t?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:t&&D}:{"aria-hidden":!0,"data-menu-check":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:t&&D})}var F=u(function({onClick:t,children:n,className:r="",danger:o,disabled:i,role:a,checked:l,icon:c,description:s,tabIndex:d,id:u,onMouseEnter:h},f){const g=p($),y=m(),b=null!=s&&!1!==s,w=`${u??y}-label`,N=`${u??y}-note`,C=p(L),E=B(o,i,r),T=void 0===l?null:"menuitemradio"===a?"radio":"checkbox";/* @__PURE__ */
3
3
  return x("button",{ref:f,id:u,role:"radio"===T?"menuitemradio":"checkbox"===T?"menuitemcheckbox":a??(C?"menuitem":void 0),"aria-checked":T?l:void 0,"aria-labelledby":b?w:void 0,"aria-describedby":b?N:void 0,tabIndex:d,onClick:()=>{t?.(),g&&g.depth>0&&"checkbox"!==T&&g.closeTree()},onMouseEnter:()=>{g?.scheduleClose(g.depth),h?.()},disabled:i,className:E.className,style:E.style,children:[T&&/* @__PURE__ */k(H,{kind:T,checked:!!l}),b?
4
4
  /* @__PURE__ */x("span",{className:"block min-w-0 flex-1 py-2",children:[
5
5
  /* @__PURE__ */x("span",{className:"flex items-center gap-2",children:[null!=c&&/* @__PURE__ */k(P,{children:c}),
6
6
  /* @__PURE__ */k("span",{id:w,className:"min-w-0",children:n})]}),
7
7
  /* @__PURE__ */k("span",{id:N,"data-menu-note":"",className:e(),style:null!=c?{paddingLeft:"1.5rem"}:void 0,children:s})]}):/* @__PURE__ */x(v,{children:[null!=c&&/* @__PURE__ */k(P,{children:c}),n]})]})});function P({children:e}){/* @__PURE__ */
8
- return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var R=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function A(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function z(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function I({label:e,icon:n,children:r,disabled:o,className:i="",minWidth:s=180,maxHeight:d,rowProps:u}){const f=p($),N=m(),C=h(null),E=h(null),L=h(),j=h(!1),D=`${N}-menu`;g(()=>()=>clearTimeout(L.current),[]);const H=f?.depth??0,F=f?.path[H],P=!!F&&F.key===N&&!o,I=b(e=>{if(!f||o||!C.current)return;clearTimeout(L.current),j.current=e;const t=C.current.getBoundingClientRect(),n=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=H>0&&(f.path[H-1]?.flipped??!1),a=M(r.left,r.right,s,window.innerWidth,4,i);f.open(H,{key:N,y:t.top,...a})},[f,o,H,N,s]),S=e=>{f?.closeBelow(H),C.current?.focus()};g(()=>{if(P)return l(e=>"Escape"===e.key&&(!(f&&f.path.length>H+1)&&(S(),!0)),()=>E.current)}),a(()=>{if(!P||!F)return;const e=()=>{const e=E.current;if(!e||!C.current)return;const t=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??C.current.getBoundingClientRect(),r=H>0&&(f?.path[H-1]?.flipped??!1),o=e.offsetWidth||s,i=M(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=T(C.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{P&&j.current&&(j.current=!1,z(E.current)[0]?.focus())},[P]);const U=y(()=>f&&{...f,depth:H+1},[f,H]);if(!f)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=B(!1,o,i,P),Q=W();/* @__PURE__ */
8
+ return k("span",{"aria-hidden":"true","data-menu-icon":"",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e})}var R=/* @__PURE__ */k(n,{name:"chevron-right","aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 ml-auto",strokeWidth:2});function A(e){let t=o.menu;for(let n=e;n&&n!==document.body;n=n.parentElement){const e=parseInt(getComputedStyle(n).zIndex,10);Number.isNaN(e)||(t=e)}return t}function z(e){return e?[...e.querySelectorAll("button:not([disabled]), a[href]")].filter(t=>t.closest("[data-popup-submenu-panel]")===e):[]}function I({label:e,icon:n,children:r,disabled:o,className:i="",minWidth:c=180,maxHeight:d,rowProps:u}){const f=p($),N=m(),C=h(null),E=h(null),L=h(),j=h(!1),D=`${N}-menu`;g(()=>()=>clearTimeout(L.current),[]);const H=f?.depth??0,F=f?.path[H],P=!!F&&F.key===N&&!o,I=b(e=>{if(!f||o||!C.current)return;clearTimeout(L.current),j.current=e;const t=C.current.getBoundingClientRect(),n=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),r=n?.getBoundingClientRect()??t,i=H>0&&(f.path[H-1]?.flipped??!1),a=M(r.left,r.right,c,window.innerWidth,4,i);f.open(H,{key:N,y:t.top,...a})},[f,o,H,N,c]),S=e=>{f?.closeBelow(H),C.current?.focus()};g(()=>{if(P)return s(e=>"Escape"===e.key&&(!(f&&f.path.length>H+1)&&(S(),!0)),()=>E.current)}),a(()=>{if(!P||!F)return;const e=()=>{const e=E.current;if(!e||!C.current)return;const t=C.current.closest("[data-popup-submenu-panel]")??C.current.closest("[data-popup-menu-tree]"),n=t?.getBoundingClientRect()??C.current.getBoundingClientRect(),r=H>0&&(f?.path[H-1]?.flipped??!1),o=e.offsetWidth||c,i=M(n.left,n.right,o,window.innerWidth,4,r,8),a=e.offsetHeight,l=T(C.current.getBoundingClientRect().top+a/2,a,8,window.innerHeight-8);e.style.left=`${i.left}px`,e.style.top=`${l}px`,e.dataset.flipped=String(i.flipped)};e();let t=0;const n=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>{cancelAnimationFrame(n),cancelAnimationFrame(t)}}),g(()=>{P&&j.current&&(j.current=!1,z(E.current)[0]?.focus())},[P]);const U=y(()=>f&&{...f,depth:H+1},[f,H]);if(!f)throw new Error("PopupSubmenu must be rendered inside a PopupMenu");const q=B(!1,o,i,P),Q=W();/* @__PURE__ */
9
9
  return x(v,{children:[
10
10
  /* @__PURE__ */x("button",{ref:C,type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":P,"aria-controls":P?D:void 0,disabled:o,"data-popup-submenu-row":!0,className:q.className,style:q.style,onClick:e=>{const t=0===e.detail;P?t&&z(E.current)[0]?.focus():I(t)},...u,onKeyDown:e=>{"ArrowRight"===e.key&&(e.preventDefault(),e.stopPropagation(),I(!0))},onMouseEnter:()=>{u?.onMouseEnter?.(),o||(f.cancelClose(),P?f.closeBelow(H+1):(clearTimeout(L.current),L.current=setTimeout(()=>I(!1),120)))},onMouseLeave:()=>{clearTimeout(L.current),f.scheduleClose(H)},children:[n,
11
11
  /* @__PURE__ */k("span",{className:"min-w-0 flex-1 truncate",children:e}),R]}),P&&w(
12
- /* @__PURE__ */k("div",{ref:E,id:D,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===Q?"py-1":"large"===Q?"py-2":"py-1"),style:{left:F.left,top:F.y,minWidth:s,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:A(f.root.current)+H+1,animation:(F.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...c()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=z(E.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),S())},onMouseEnter:()=>{f.cancelClose(),clearTimeout(L.current)},onMouseLeave:()=>f.scheduleClose(H+1),onContextMenu:e=>{t(e.target)||e.preventDefault()},children:/* @__PURE__ */k($.Provider,{value:U,children:r})}),document.body)]})}function S(){const e=W();/* @__PURE__ */
13
- return k("div",{className:`border-t ${s} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function U(){const e=W(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function q({children:e}){/* @__PURE__ */
12
+ /* @__PURE__ */k("div",{ref:E,id:D,role:"menu","data-popup-menu-tree":f.id,"data-popup-submenu-panel":!0,className:"fixed rounded-(--radius-popup) overflow-x-hidden overflow-y-auto overscroll-contain "+("tight"===Q?"py-1":"large"===Q?"py-2":"py-1"),style:{left:F.left,top:F.y,minWidth:c,maxHeight:void 0===d?"calc(100vh - 16px)":`min(${"number"==typeof d?`${d}px`:d}, calc(100vh - 16px))`,zIndex:A(f.root.current)+H+1,animation:(F.flipped?"popup-submenu-in-left":"popup-submenu-in")+" 0.1s ease-out",...l()},onKeyDown:e=>{if(e.target.closest("[data-popup-submenu-panel]")!==e.currentTarget)return;const t=z(E.current),n=t.indexOf(document.activeElement),r=n=>{e.preventDefault(),e.stopPropagation(),t[(n+t.length)%t.length]?.focus()};"ArrowDown"===e.key?r(n+1):"ArrowUp"===e.key?r(n<0?t.length-1:n-1):"Home"===e.key?r(0):"End"===e.key?r(t.length-1):"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),S())},onMouseEnter:()=>{f.cancelClose(),clearTimeout(L.current)},onMouseLeave:()=>f.scheduleClose(H+1),onContextMenu:e=>{t(e.target)||e.preventDefault()},children:/* @__PURE__ */k($.Provider,{value:U,children:r})}),document.body)]})}function S(){const e=W();/* @__PURE__ */
13
+ return k("div",{className:`border-t ${c} ${"tight"===e?"my-0.5":"large"===e?"my-2":"my-1"} mx-3`})}function U(){const e=W(),t="tight"===e?"0.125rem":"large"===e?"0.375rem":"0.25rem";return{color:"var(--ink-muted)",paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:t,paddingBottom:t}}function q({children:e}){/* @__PURE__ */
14
14
  return k("div",{className:"text-xs font-medium uppercase tracking-wide",style:U(),children:e})}function Q({d:e,className:t="h-4 w-4"}){/* @__PURE__ */
15
15
  return k("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */k("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})})}export{H as MenuCheckMark,Q as MenuIcon,L as MenuSemanticsContext,j as PopupMenu,S as PopupMenuDivider,F as PopupMenuItem,q as PopupMenuLabel,I as PopupSubmenu,T as clampMenuTop,C as closeMenuBelow,B as itemLook,M as menuPanelLeft,U as menuTextRowStyle,N as openMenuLevel,E as resolveMenuLevels};
@@ -1,9 +1,9 @@
1
- import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-PDXOGPWH.js";import{Icon as l}from"./chunk-7V32O5NF.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-5YP7MFPK.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("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 n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-3N2MNOV5.js";import{Icon as l}from"./chunk-7V32O5NF.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-5YP7MFPK.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("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__ */m("span",{className:"min-w-0 truncate",children:e}),
3
- /* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(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-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),C=c(null),I=c(l);I.current=l,s(()=>{if(j&&d)return j.report(S,()=>I.current,C.current)},[j,d,S]);const W=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
4
- /* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
5
- /* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:N}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
6
- return m("button",1===k?{ref:C,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:W})}:{ref:C,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:W})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
3
+ /* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(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-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),N=i().severity,v=y?n(y,N):void 0,j=e(),S=o(),C=c(null),I=c(l);I.current=l,s(()=>{if(j&&d)return j.report(S,()=>I.current,C.current)},[j,d,S]);const K=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
4
+ /* @__PURE__ */m("span",{"aria-hidden":"true",title:v,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
5
+ /* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:v}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
6
+ return m("button",1===k?{ref:C,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:K})}:{ref:C,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:K})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
7
7
  return h("div",{children:[
8
8
  /* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
9
9
  /* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
@@ -1,4 +1,4 @@
1
- import{TH_ONE_LINE as r}from"./chunk-CJH2BGXY.js";import{jsxs as e,jsx as c}from"react/jsx-runtime";function n({caption:n,head:t,rows:i}){/* @__PURE__ */
1
+ import{TH_ONE_LINE as r}from"./chunk-WGLHB6WE.js";import{jsxs as e,jsx as c}from"react/jsx-runtime";function n({caption:n,head:t,rows:i}){/* @__PURE__ */
2
2
  return e("table",{className:"sr-only",children:[
3
3
  /* @__PURE__ */c("caption",{children:n}),
4
4
  /* @__PURE__ */c("thead",{children:/* @__PURE__ */c("tr",{children:t.map(e=>/* @__PURE__ */c("th",{className:r,scope:"col",children:e},e))})}),
@@ -0,0 +1,7 @@
1
+ import{squarify as e}from"./chunk-46BYGPGD.js";import{AccessibleTable as t}from"./chunk-5PP435FL.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as a}from"./chunk-36VIGB6J.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as i,CHART_INK as o}from"./chunk-TZFACUMR.js";import{useShellStrings as n,useShellLocale as m}from"./chunk-5YP7MFPK.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useRef as c,useState as u}from"react";import{jsx as s,jsxs as f}from"react/jsx-runtime";function p({items:p,height:d=320,width:v,gap:x=2,radius:g=3,formatValue:y,color:k,className:b,emptyLabel:j}){const M=n().charts,w=m(),N=y??(e=>h(e,w)),P=j??M.nothingToBreakDown,$=c(null),F=r($),B=v??F,[C,Y]=u(null),{highlighted:z}=l(),A=e(p,B,d);if(0===A.length)/* @__PURE__ */
2
+ return s("div",{className:b,ref:$,children:/* @__PURE__ */s("p",{className:"py-8 text-center text-sm text-gray-500",children:P})});const G=k??i(0),L=Math.max(...A.map(e=>e.value),1),V=e=>34+e/L*62,D=e=>`color-mix(in oklab, ${G} ${V(e).toFixed(0)}%, ${o.surface})`,E=e=>V(e)>=55?o.surface:o.label,H=C??z,I=C?A.find(e=>e.key===C):void 0;/* @__PURE__ */
3
+ return f("div",{className:`relative ${b??""}`,ref:$,children:[
4
+ /* @__PURE__ */s("svg",{width:"100%",height:d,viewBox:`0 0 ${B} ${d}`,role:"img","aria-label":M.treemap(p.length),onMouseLeave:()=>Y(null),children:A.map(e=>{const t=Math.max(0,e.width-x),l=Math.max(0,e.height-x),a=t>6.2*e.label.length+12&&l>30,r=a&&l>44;/* @__PURE__ */
5
+ return f("g",{opacity:H&&H!==e.key?.55:1,onMouseEnter:()=>Y(e.key),children:[
6
+ /* @__PURE__ */s("rect",{x:e.x+x/2,y:e.y+x/2,width:t,height:l,rx:g,fill:D(e.value)}),a&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+18,fontSize:12,fontWeight:600,fill:E(e.value),children:e.label}),r&&/* @__PURE__ */s("text",{x:e.x+x/2+8,y:e.y+x/2+34,fontSize:11,fill:E(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:N(e.value)})]},e.key)})}),I&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(a,{title:I.label,rows:[{key:"value",label:M.value,color:D(I.value),value:N(I.value)}]})}),
7
+ /* @__PURE__ */s(t,{caption:M.treemap(p.length),head:[M.tableItem,M.value],rows:A.map(e=>[e.label,N(e.value)])})]})}export{p as TreemapChart};
@@ -0,0 +1,8 @@
1
+ import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-5YP7MFPK.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:$,xDomain:j,yDomain:w,xScale:N="linear",yScale:R="linear",radiusRange:P=[4,22],className:S,emptyLabel:U}){const D=m().charts,L=h(),V=z??(e=>f(e,L)),W=$??(e=>f(e,L)),B=U??D.noObservations,C=u(null),E=n(C),F=v??E,I=p(),[O,J]=d(null);x(()=>{if(null!==O)return c(e=>"Escape"===e.key&&(J(null),!0))},[O]);const K=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),Q=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),T=j||w?Q.map(e=>({...e,points:e.points.filter(e=>K(e.x,j)&&K(e.y,w))})).filter(e=>e.points.length>0):Q,X=Q.reduce((e,t)=>e+t.points.length,0)-T.reduce((e,t)=>e+t.points.length,0);if(0===T.length)/* @__PURE__ */
2
+ return y("div",{className:S,ref:C,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:B})});const Y=T.flatMap(e=>e.points),Z=Y.some(e=>null!=e.size),G=14,H=20,q=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(Y.map(e=>e.y),w,R,{from:k-q,to:G}),ie=t(te.ticks(5).map(W),_),le=Math.max(ie+1,F-H),re=ee(Y.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...Y.map(e=>e.size??1))],{from:P[0],to:P[1]}),ne=O?T[O.s]:void 0,ae=O&&ne?ne.points[O.i]:void 0,se=T.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
3
+ return g("div",{className:`relative ${S??""}`,ref:C,children:[
4
+ /* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${F} ${k}`,role:"img","aria-label":D.scatter(T.map(e=>e.label),A??D.yAxis,M??D.xAxis)+(X>0?`. ${D.outsideRange(X)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>J(null),onBlur:()=>J(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=O?se.findIndex(e=>e.s===O.s&&e.i===O.i):0;J(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
5
+ /* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:I,children:/* @__PURE__ */y("rect",{x:ie-P[1],y:G-P[1],width:le-ie+2*P[1],height:k-q-G+2*P[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
6
+ /* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
7
+ /* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:W(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:V(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
8
+ /* @__PURE__ */y("g",{clipPath:`url(#${I})`,children:T.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:Z?oe(l.size??0):P[0]+1,fill:i,fillOpacity:O&&O.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>J({s:t,i:r})},`${e.key}-${r}`))})})]}),O&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??D.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:V(ae.x)},{key:"y",label:A??D.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:W(ae.y)},...null!=ae.size?[{key:"size",label:D.size,color:a.muted,value:f(ae.size,L)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
@@ -1,16 +1,16 @@
1
- import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-7V32O5NF.js";import{TH_ONE_LINE as n}from"./chunk-CJH2BGXY.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{glassStyle as i}from"./chunk-5FYDNH4Y.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),C=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:S,allColumns:_,onResizeStart:z,onDragStart:P,onDragOver:$,onDrop:Y,onDragEnd:B,toggleColumn:F,resetColumns:I,draggedIdx:K,dropGap:L}=t(f,C),{hasAnyPerm:R}=r(),T=s().columns,[A,E]=c(!1),[G,J]=c(!1),[O,U]=c(!1),W=m(null),X=k.length>0&&R(k);e(W,h(()=>{A&&E(!1)},[A]));const H=S.reduce((e,t)=>e+t.width,0),M=S.map(e=>`${e.width}px`),Q={tableLayout:"fixed",width:H,minWidth:"100%"},V=m(null),Z=h(e=>{const t=V.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
1
+ import{useClickOutside as e}from"./chunk-SI26KESU.js";import{useColumnConfig as t}from"./chunk-UKBXQXDZ.js";import{useShellAuth as r}from"./chunk-2QY5BJLA.js";import{useIsMobile as o}from"./chunk-UGTRSRIW.js";import{Icon as l}from"./chunk-7V32O5NF.js";import{TH_ONE_LINE as n}from"./chunk-WGLHB6WE.js";import{shellHttp as a}from"./chunk-STKJA4PV.js";import{glassStyle as s}from"./chunk-5FYDNH4Y.js";import{useShellStrings as i}from"./chunk-5YP7MFPK.js";import{useState as c,useMemo as d,useRef as m,useCallback as h}from"react";import{jsxs as u,jsx as p}from"react/jsx-runtime";function f({tableId:f,columns:g,sort:x,onSort:y,footer:b,afterBody:v,saveDefaultPerms:k=["change_numberingconfig"],children:N}){const w=o(),[D,j]=c(!1),S=d(()=>w&&!D?g.filter(e=>"_select"!==e.key):g,[g,w,D]),{orderedColumns:C,allColumns:_,onResizeStart:z,onDragStart:P,onDragOver:$,onDrop:L,onDragEnd:W,toggleColumn:B,resetColumns:E,draggedIdx:F,dropGap:I}=t(f,S),{hasAnyPerm:K}=r(),R=i().columns,[T,Y]=c(!1),[A,G]=c(!1),[O,U]=c(!1),H=m(null),J=k.length>0&&K(k);e(H,h(()=>{T&&Y(!1)},[T]));const M=C.reduce((e,t)=>e+t.width,0),Q=C.map(e=>`${e.width}px`),V={tableLayout:"fixed",width:M,minWidth:"100%"},X=m(null),Z=h(e=>{const t=X.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft)},[]),q=d(()=>g.some(e=>"_select"===e.key),[g]);/* @__PURE__ */
2
2
  return u("div",{className:"flex flex-col flex-1 min-h-0 "+(w?"-mx-4":""),children:[
3
- /* @__PURE__ */p("div",{ref:V,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:Q,children:[
4
- /* @__PURE__ */p("colgroup",{children:S.map((e,t)=>/* @__PURE__ */p("col",{style:{width:M[t]}},e.key))}),
5
- /* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:S.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
6
- return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${K===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>P(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>Y(t,e),onDragEnd:a?void 0:B,style:a?void 0:{cursor:"grab"},children:[
7
- /* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),L===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===S.length-1&&L===S.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
3
+ /* @__PURE__ */p("div",{ref:X,className:"shrink-0 overflow-x-hidden",children:/* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
4
+ /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:Q[t]}},e.key))}),
5
+ /* @__PURE__ */p("thead",{className:"bg-gray-50",children:/* @__PURE__ */p("tr",{children:C.map((e,t)=>{const r=g.find(t=>t.key===e.key),o=r?.sortField??("_select"!==e.key?e.key:void 0),l=x&&o&&x.field===o,a="_select"===e.key;/* @__PURE__ */
6
+ return u("th",{className:`${n} px-4 py-3 text-left text-xs font-medium text-ink-faint uppercase select-none relative ${F===t?"bg-accent-tint":""}`,draggable:!a,onDragStart:a?void 0:()=>P(t),onDragOver:a?void 0:e=>$(t,e),onDrop:a?void 0:e=>L(t,e),onDragEnd:a?void 0:W,style:a?void 0:{cursor:"grab"},children:[
7
+ /* @__PURE__ */u("span",{className:`${a?"":"truncate pr-3"} block ${o&&y?"cursor-pointer hover:text-gray-700":""}`,onClick:o&&y?e=>{e.stopPropagation(),y(o)}:void 0,children:[e.headerNode??e.label,l&&/* @__PURE__ */p("span",{className:"ml-1",children:"asc"===x.direction?"▲":"▼"})]}),!a&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-4 cursor-col-resize flex items-center justify-center z-10",onMouseDown:e=>z(t,e),style:{marginRight:-8},children:/* @__PURE__ */p("div",{className:"w-0.5 h-full bg-gray-200 hover:bg-blue-500 transition-colors"})}),I===t&&/* @__PURE__ */p("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"}),t===C.length-1&&I===C.length&&/* @__PURE__ */p("div",{className:"absolute right-0 top-0 bottom-0 w-0.5 bg-blue-500 z-20 pointer-events-none"})]},e.key)})})})]})}),
8
8
  /* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto overflow-x-auto min-h-0",onScroll:Z,children:[
9
- /* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:Q,children:[
10
- /* @__PURE__ */p("colgroup",{children:S.map((e,t)=>/* @__PURE__ */p("col",{style:{width:M[t]}},e.key))}),N(S)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
9
+ /* @__PURE__ */u("table",{className:"divide-y divide-gray-200",style:V,children:[
10
+ /* @__PURE__ */p("colgroup",{children:C.map((e,t)=>/* @__PURE__ */p("col",{style:{width:Q[t]}},e.key))}),N(C)]}),v]}),void 0!==b&&/* @__PURE__ */u("div",{className:"border-t border-gray-200 px-4 py-2 text-sm text-gray-500 shrink-0 flex items-center justify-between",children:[
11
11
  /* @__PURE__ */p("span",{children:b}),
12
- /* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:W,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?T.hideSelection:T.showSelection,children:D?T.selectDone:T.select}),
13
- /* @__PURE__ */p("button",{onClick:I,className:"text-2xs text-ink-faintest hover:text-gray-600",children:T.reset}),
14
- /* @__PURE__ */p("button",{onClick:()=>E(!A),className:"text-gray-400 hover:text-gray-600",title:T.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),A&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:i(),children:[
15
- /* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:T.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
16
- /* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>F(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),X&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{J(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),U(!0),setTimeout(()=>U(!1),2e3)}catch{}J(!1)},disabled:G,className:"text-2xs w-full text-center py-1 rounded "+(O?"text-green-600":"text-ink-faint hover:text-blue-600"),children:G?"...":O?T.savedDefault:T.saveDefault})})]})]})]})]})}export{f as ResizableTable};
12
+ /* @__PURE__ */u("div",{className:"flex items-center gap-3 relative",ref:H,children:[w&&q&&/* @__PURE__ */p("button",{onClick:()=>j(e=>!e),className:"text-2xs px-2 py-0.5 rounded "+(D?"bg-accent-fill text-on-accent":"text-ink-faint hover:text-ink border border-line-strong"),title:D?R.hideSelection:R.showSelection,children:D?R.selectDone:R.select}),
13
+ /* @__PURE__ */p("button",{onClick:E,className:"text-2xs text-ink-faintest hover:text-gray-600",children:R.reset}),
14
+ /* @__PURE__ */p("button",{onClick:()=>Y(!T),className:"text-gray-400 hover:text-gray-600",title:R.choose,children:/* @__PURE__ */p(l,{name:"adjust",className:"w-4 h-4",strokeWidth:"1.5"})}),T&&/* @__PURE__ */u("div",{className:"absolute bottom-full right-0 mb-1 w-52 rounded-(--radius-popup) z-(--z-popup) py-1 max-h-80 overflow-y-auto",style:s(),children:[
15
+ /* @__PURE__ */p("p",{className:"px-3 py-2 text-3xs font-semibold text-ink-faintest uppercase",children:R.heading}),_.filter(e=>"_select"!==e.key).map(e=>/* @__PURE__ */u("label",{className:"flex items-center gap-2 px-3 py-1 text-sm text-gray-700 hover:bg-gray-50 cursor-pointer",children:[
16
+ /* @__PURE__ */p("input",{type:"checkbox",checked:!e.hidden,onChange:()=>B(e.key),className:"h-3.5 w-3.5 rounded border-gray-300 text-blue-600"}),e.label]},e.key)),J&&/* @__PURE__ */p("div",{className:"border-t border-gray-100 mt-1 pt-1 px-3 pb-1",children:/* @__PURE__ */p("button",{onClick:async()=>{G(!0);const e=_.filter(e=>!e.hidden).map(e=>e.key),t=w?"mobile":"desktop",r={visible_columns:e};x&&(r.sort=x);try{await a.patch(`/auth/default-columns/${f}/`,r,{params:{viewport:t}}).catch(()=>a.post("/auth/default-columns/",{table_id:f,viewport:t,...r})),U(!0),setTimeout(()=>U(!1),2e3)}catch{}G(!1)},disabled:A,className:"text-2xs w-full text-center py-1 rounded "+(O?"text-green-600":"text-ink-faint hover:text-blue-600"),children:A?"...":O?R.savedDefault:R.saveDefault})})]})]})]})]})}export{f as ResizableTable};
@@ -1,9 +1,9 @@
1
- import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-JG26ICX6.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-7V32O5NF.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-5YP7MFPK.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:C=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:P="bg-white"}){const j="right"===m,z=i().sidebar,O=a(),W=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[D,I]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),E=null!=l||null!=n,K=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:D},children:[
2
- /* @__PURE__ */f("div",{className:`flex h-full flex-col ${E?"overflow-hidden":"overflow-y-auto"} ${C}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),E?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
- /* @__PURE__ */p(t,{side:m,width:D,onResize:I,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:z.resize})]}),M=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${P}`,children:u});/* @__PURE__ */
4
- return f("div",O?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
- /* @__PURE__ */p(g,{phone:W,top:l,fallback:z.sections}),M,
6
- /* @__PURE__ */p(v,{phone:W,bottom:n,label:z.sections,closeLabel:z.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[j?null:K,M,j?K:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
1
+ import{SidebarBarContext as e,SidebarSheetContext as l}from"./chunk-QWK6DRSN.js";import{readStoredWidth as r,ResizeHandle as t}from"./chunk-UEWB6IOD.js";import{useIsPhone as a}from"./chunk-UGTRSRIW.js";import{Icon as n}from"./chunk-7V32O5NF.js";import{useBrowserState as o}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-5YP7MFPK.js";import{useState as s,useRef as c,useReducer as d,useMemo as h,Fragment as u,useEffect as m}from"react";import{jsxs as f,jsx as p}from"react/jsx-runtime";var b=(e,l,r)=>Math.min(Math.max(e,l),r);function x({sidebar:e,sidebarTop:l,sidebarBottom:n,children:u,side:m="left",storageKey:x,defaultWidth:N=256,minWidth:w=180,maxWidth:k=480,className:y="",sidebarClassName:O=("right"===m?"border-l border-gray-200 bg-gray-50":"border-r border-gray-200 bg-gray-50"),contentClassName:P="bg-white"}){const W="right"===m,j=i().sidebar,z=a(),C=function(){const[e,l]=s(!1),r=c(null),t=c(/* @__PURE__ */new Map),[,a]=d(e=>e+1,0),n=h(()=>({report(e,l,r){const n={label:l,el:r};return t.current.set(e,n),a(),()=>{t.current.get(e)===n&&(t.current.delete(e),a())}}}),[]);return{api:n,open:e,setOpen:l,current:()=>[...t.current.values()].sort((e,l)=>e.el&&l.el&&e.el.compareDocumentPosition(l.el)&Node.DOCUMENT_POSITION_PRECEDING?1:-1).map(e=>e.label()),trigger:r}}(),[D,E]=o(()=>(x?r(x,w,k):null)??b(N,w,k),b(N,w,k)),I=null!=l||null!=n,K=/* @__PURE__ */f("div",{className:"relative flex h-full shrink-0 flex-col",style:{width:D},children:[
2
+ /* @__PURE__ */f("div",{className:`flex h-full flex-col ${I?"overflow-hidden":"overflow-y-auto"} ${O}`,children:[null!=l&&/* @__PURE__ */p("div",{className:"flex shrink-0 flex-col gap-2 px-2 pt-3 pb-2",children:l}),I?/* @__PURE__ */p("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e}):e,null!=n&&/* @__PURE__ */p("div",{className:"mt-auto flex shrink-0 flex-col gap-2 border-t border-gray-200 px-2 py-3",children:n})]}),
3
+ /* @__PURE__ */p(t,{side:m,width:D,onResize:E,min:w,max:k,defaultWidth:b(N,w,k),storageKey:x,hint:j.resize})]}),M=/* @__PURE__ */p("div",{className:`flex min-w-0 flex-1 flex-col ${P}`,children:u});/* @__PURE__ */
4
+ return f("div",z?{className:`relative flex h-full w-full flex-col overflow-hidden ${y}`,children:[
5
+ /* @__PURE__ */p(g,{phone:C,top:l,fallback:j.sections}),M,
6
+ /* @__PURE__ */p(v,{phone:C,bottom:n,label:j.sections,closeLabel:j.closeSections,children:e})]}:{className:`flex h-full w-full overflow-hidden ${y}`,children:[W?null:K,M,W?K:null]})}function g({phone:l,top:r,fallback:t}){const a=l.current();/* @__PURE__ */
7
7
  return f("div",{"data-sidebar-section-bar":!0,className:"flex h-11 shrink-0 items-center gap-2 border-b border-gray-200 bg-white px-3",children:[
8
8
  /* @__PURE__ */f("button",{ref:l.trigger,type:"button","aria-haspopup":"dialog","aria-expanded":l.open,onClick:()=>l.setOpen(!0),className:"flex h-8 min-w-0 flex-1 items-center gap-1 text-left text-sm font-semibold text-gray-900",children:[
9
9
  /* @__PURE__ */p("span",{className:"min-w-0 truncate",children:0===a.length?t:a.map((e,l)=>/* @__PURE__ */f(u,{children:[l>0&&" · ",e]},l))}),
@@ -1,4 +1,4 @@
1
- import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-VVDK7XPH.js";import{Tooltip as n}from"./chunk-QQ2LDC6C.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{createContext as o,useRef as a,useState as i,useEffect as l,useContext as s}from"react";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";var h=o({labels:"none",shown:"none"}),f="button[data-icon-rail-button]:not([disabled])";function b(e,t,n){const r=getComputedStyle(e),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a="horizontal"===t?(parseFloat(r.columnGap)||0)*Math.max(0,n-1):0,i=e.parentElement;let l=1/0;if(i){const e=getComputedStyle(i);l=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:o+a,room:l}}function m({"aria-label":t,orientation:n="vertical",children:o,className:s="",labels:d="none",labelsFit:u=!1,onLabelsShown:m}){const p=a(null),g="none"!==d&&u,[v,y]=i(null),w="none"===d?"none":g?v??"none":"all",x=a(()=>{});x.current=()=>{const t=p.current;if(!t||!g)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=parseFloat(n.minWidth)||0,a=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(o,r+a),worded:"below"===t?Math.max(o,r+Math.max(a,i)):Math.max(o,r+a+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(t,d);y(e({buttons:r,orientation:n,...b(t,n,r.length)}))},r(()=>{x.current()}),l(()=>{const e=p.current?.parentElement;if(!g||!e)return;let t=!0;const n=()=>{t&&x.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[g]);const F=a(null),k=a(m);k.current=m,l(()=>{g&&null!==v&&F.current!==v&&(F.current=v,k.current?.(v))},[g,v]),r(()=>{const e=p.current;if(!e)return;const t=[...e.querySelectorAll(f)];if(0===t.length)return;const n=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===n?0:-1});/* @__PURE__ */
1
+ import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-VVDK7XPH.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{createContext as o,useRef as a,useState as i,useEffect as l,useContext as s}from"react";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";var h=o({labels:"none",shown:"none"}),f="button[data-icon-rail-button]:not([disabled])";function b(e,t,n){const r=getComputedStyle(e),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a="horizontal"===t?(parseFloat(r.columnGap)||0)*Math.max(0,n-1):0,i=e.parentElement;let l=1/0;if(i){const e=getComputedStyle(i);l=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:o+a,room:l}}function m({"aria-label":t,orientation:n="vertical",children:o,className:s="",labels:d="none",labelsFit:u=!1,onLabelsShown:m}){const p=a(null),g="none"!==d&&u,[v,y]=i(null),w="none"===d?"none":g?v??"none":"all",x=a(()=>{});x.current=()=>{const t=p.current;if(!t||!g)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=parseFloat(n.minWidth)||0,a=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(o,r+a),worded:"below"===t?Math.max(o,r+Math.max(a,i)):Math.max(o,r+a+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(t,d);y(e({buttons:r,orientation:n,...b(t,n,r.length)}))},r(()=>{x.current()}),l(()=>{const e=p.current?.parentElement;if(!g||!e)return;let t=!0;const n=()=>{t&&x.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[g]);const F=a(null),k=a(m);k.current=m,l(()=>{g&&null!==v&&F.current!==v&&(F.current=v,k.current?.(v))},[g,v]),r(()=>{const e=p.current;if(!e)return;const t=[...e.querySelectorAll(f)];if(0===t.length)return;const n=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===n?0:-1});/* @__PURE__ */
2
2
  return c("div",{ref:p,role:"toolbar","aria-label":t,"aria-orientation":n,"data-orientation":n,onKeyDown:e=>{const t=p.current;if(!t)return;const r=[...t.querySelectorAll(f)],o=r.indexOf(e.target);if(o<0)return;const a="vertical"===n?"ArrowUp":"ArrowLeft",i="vertical"===n?"ArrowDown":"ArrowRight",l=e.key===i?(o+1)%r.length:e.key===a?(o-1+r.length)%r.length:"Home"===e.key?0:"End"===e.key?r.length-1:-1;if(!(l<0)){e.preventDefault();for(const e of r)e.tabIndex=e===r[l]?0:-1;r[l].focus()}},"data-labels":"none"===d?void 0:d,"data-labels-shown":"none"===d?void 0:w,className:`flex gap-1 ${"vertical"===n?"flex-col items-center":"flex-row items-center"} ${s}`.trim(),children:/* @__PURE__ */c(h.Provider,{value:{labels:d,shown:w},children:o})})}function p({label:e,icon:r,active:o,disabled:a,onClick:i,badge:l,tooltipSide:f="right",className:b=""}){const m=!0===o,{labels:p,shown:g}=s(h),v=void 0===l||!1===l||0===l?r:/* @__PURE__ */c(t,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:r}),y="none"!==p,w=y&&("all"===g||"chosen"===g&&m),x=/* @__PURE__ */c("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof o?o:void 0,disabled:a,onClick:a?void 0:i,className:[`relative inline-flex ${y?"beside"===p?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",m?"bg-accent-tint text-blue-700":"text-gray-600 not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest",b].filter(Boolean).join(" "),children:y?/* @__PURE__ */d(u,{children:[
3
3
  /* @__PURE__ */c("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:v}),
4
4
  /* @__PURE__ */c("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",w?"beside"===p?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):v});/* @__PURE__ */
@@ -1,20 +1,20 @@
1
- import{Pagination as e}from"./chunk-225LCPO7.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-CJH2BGXY.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
1
+ import{Pagination as e}from"./chunk-225LCPO7.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-WGLHB6WE.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
2
2
  return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
3
3
  /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
4
- /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:$=!1,size:S="md",minWidth:z,rowClassName:H,onRow:P,rowHref:T,onRowPress:I,linkAs:F,emptyText:L,selection:O,footer:A,virtualized:D,stackOnNarrow:E=!1,stackBelow:K,className:R=""}){const W=s(),G=L??W.table.empty,J=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),Y=E&&!D,Z=Y?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),V=e=>Y?{role:e}:{},X=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[q,Q]=i(0),U=D?.overscan??6,_=D?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/D.rowHeight)-U);Q(e=>e===t?e:t)}:void 0,ee=D?Math.ceil(D.height/D.rowHeight)+2*U:v.length,te=D?Math.min(q,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=D?te*D.rowHeight:0,ne=D?(v.length-re)*D.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!D)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=Z.flatMap(e=>m(e)?e.columns:[e]),he=Z.some(m),ue=/* @__PURE__ */new Map;if(Y)for(const e of Z)if(m(e))for(const t of e.columns)ue.set(t,X(e.title,e.label));const me=e=>{const t=X(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(O?.selected??[]),ge=O?v.map((e,t)=>J(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=O?36:0,we=de.length+(O?1:0),xe=de.some(e=>"left"===e.fixed),ve=Y&&!O&&de.some(e=>e.cardCorner),ke=F??"a",Ne=`${p[S]} ${"sm"===S?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
5
- return h("th",{scope:"col",...V("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...D?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs",a?D?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":D?"sticky z-10 bg-gray-50":"",Y&&d?"rosh-dt-sort":"",Y?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":Y?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
4
+ /* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:$=!1,size:S="md",minWidth:z,rowClassName:H,onRow:P,rowHref:T,onRowPress:I,linkAs:L,emptyText:E,selection:F,footer:O,virtualized:W,stackOnNarrow:A=!1,stackBelow:D,className:K=""}){const R=s(),G=E??R.table.empty,Z=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),J=A&&!W,V=J?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),Y=e=>J?{role:e}:{},q=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[Q,U]=i(0),X=W?.overscan??6,_=W?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/W.rowHeight)-X);U(e=>e===t?e:t)}:void 0,ee=W?Math.ceil(W.height/W.rowHeight)+2*X:v.length,te=W?Math.min(Q,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=W?te*W.rowHeight:0,ne=W?(v.length-re)*W.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!W)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=V.flatMap(e=>m(e)?e.columns:[e]),he=V.some(m),ue=/* @__PURE__ */new Map;if(J)for(const e of V)if(m(e))for(const t of e.columns)ue.set(t,q(e.title,e.label));const me=e=>{const t=q(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(F?.selected??[]),ge=F?v.map((e,t)=>Z(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=F?36:0,we=de.length+(F?1:0),xe=de.some(e=>"left"===e.fixed),ve=J&&!F&&de.some(e=>e.cardCorner),ke=L??"a",Ne=`${p[S]} ${"sm"===S?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
5
+ return h("th",{scope:"col",...Y("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...W?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs",a?W?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":W?"sticky z-10 bg-gray-50":"",J&&d?"rosh-dt-sort":"",J?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":J?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
6
6
  /* @__PURE__ */h(n,{children:e.title}),
7
7
  /* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),$e=/* @__PURE__ */c(d,{children:[
8
- /* @__PURE__ */c("div",{onScroll:_,style:D?{maxHeight:D.height}:void 0,className:`relative overflow-x-auto ${D?"overflow-y-auto":""} ${$?"rounded-lg border border-gray-200":""}${Y?" rosh-dt-scroll":""}`.trim(),children:[B&&
8
+ /* @__PURE__ */c("div",{onScroll:_,style:W?{maxHeight:W.height}:void 0,className:`relative overflow-x-auto ${W?"overflow-y-auto":""} ${$?"rounded-lg border border-gray-200":""}${J?" rosh-dt-scroll":""}`.trim(),children:[B&&
9
9
  /* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
10
10
  /* @__PURE__ */h(r,{className:"h-6 w-6"}),
11
- /* @__PURE__ */h("span",{className:"sr-only",children:W.table.loading})]}),
12
- /* @__PURE__ */c("table",{...V("table"),className:(Y?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
13
- /* @__PURE__ */c("thead",{...V("rowgroup"),className:Y?"rosh-dt-head":void 0,children:[
14
- /* @__PURE__ */c("tr",{ref:le,...V("row"),className:"border-b border-gray-200 bg-gray-50",children:[O&&/* @__PURE__ */h("th",{scope:"col",...V("columnheader"),rowSpan:he?2:void 0,style:{width:36,...D?{top:0}:{}},className:[Ne,o,xe||D?"sticky z-20 bg-gray-50":"",xe?"left-0":"",Y?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":W.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!O)return;const e=new Set(ge);O.onChange(pe?O.selected.filter(t=>!e.has(t)):[...O.selected,...ge.filter(e=>!fe.has(e))])}})}),Z.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...V("columnheader"),colSpan:e.columns.length,style:D?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs","border-b border-gray-200",D?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...V("row"),className:"border-b border-gray-200 bg-gray-50",children:Z.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
15
- /* @__PURE__ */h("tbody",{...V("rowgroup"),className:Y?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=P?.(e,o),l=!!n?.current,s=T?.(e,o),i=void 0===s&&I?()=>I(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
16
- return c("tr",{...u(n),...V("row"),style:D?{height:D.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[Y?O?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",Y&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[O&&(()=>{const r=J(e,o);/* @__PURE__ */
17
- return h("td",{...V("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",Y?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":W.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{O&&O.onChange(fe.has(e)?O.selected.filter(t=>t!==e):[...O.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=Y&&!n&&"wide"!==e.only;/* @__PURE__ */
18
- return h("td",{...V("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",Y?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],Y?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:Y?
19
- /* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},J(e,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...V("row"),className:Y?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...V("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:G})})})]}),A]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:Y?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(e,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
20
- return h("div",Y?void 0!==K&&K>0&&40!==K?{className:`rosh-dt-at ${R}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/K*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:K/40*100+"%"},children:$e})})}:{className:`rosh-dt-stack ${R}`.trim(),children:$e}:{className:R,children:$e})}export{x as DataTable};
11
+ /* @__PURE__ */h("span",{className:"sr-only",children:R.table.loading})]}),
12
+ /* @__PURE__ */c("table",{...Y("table"),className:(J?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
13
+ /* @__PURE__ */c("thead",{...Y("rowgroup"),className:J?"rosh-dt-head":void 0,children:[
14
+ /* @__PURE__ */c("tr",{ref:le,...Y("row"),className:"border-b border-gray-200 bg-gray-50",children:[F&&/* @__PURE__ */h("th",{scope:"col",...Y("columnheader"),rowSpan:he?2:void 0,style:{width:36,...W?{top:0}:{}},className:[Ne,o,xe||W?"sticky z-20 bg-gray-50":"",xe?"left-0":"",J?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":R.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!F)return;const e=new Set(ge);F.onChange(pe?F.selected.filter(t=>!e.has(t)):[...F.selected,...ge.filter(e=>!fe.has(e))])}})}),V.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...Y("columnheader"),colSpan:e.columns.length,style:W?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===S?"text-2xs":"text-xs","border-b border-gray-200",W?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...Y("row"),className:"border-b border-gray-200 bg-gray-50",children:V.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
15
+ /* @__PURE__ */h("tbody",{...Y("rowgroup"),className:J?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=P?.(e,o),l=!!n?.current,s=T?.(e,o),i=void 0===s&&I?()=>I(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
16
+ return c("tr",{...u(n),...Y("row"),style:W?{height:W.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[J?F?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",J&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[F&&(()=>{const r=Z(e,o);/* @__PURE__ */
17
+ return h("td",{...Y("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",J?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":R.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{F&&F.onChange(fe.has(e)?F.selected.filter(t=>t!==e):[...F.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=J&&!n&&"wide"!==e.only;/* @__PURE__ */
18
+ return h("td",{...Y("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",J?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],J?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:J?
19
+ /* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},Z(e,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...Y("row"),className:J?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...Y("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:G})})})]}),O]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:J?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(e,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
20
+ return h("div",J?void 0!==D&&D>0&&40!==D?{className:`rosh-dt-at ${K}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/D*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:D/40*100+"%"},children:$e})})}:{className:`rosh-dt-stack ${K}`.trim(),children:$e}:{className:K,children:$e})}export{x as DataTable};
@@ -1,4 +1,4 @@
1
- import{Tabs as e}from"./chunk-RQDVAUXD.js";import{Card as a}from"./chunk-WEEQDPU3.js";import{StatusBadgeProvider as r,StatusBadge as t}from"./chunk-JPNAEN53.js";import{Button_default as l}from"./chunk-7DI3VQCF.js";import{useState as i}from"react";import{jsx as d,jsxs as s}from"react/jsx-runtime";var n={featured:"success",new:"active",draft:"draft"},c=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,a)=>({id:a,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][a],tag:["featured","new","draft"][a%3],bg:e}));function m(){const[m,g]=i("all"),f="all"===m?c:c.filter(e=>e.tag===m);/* @__PURE__ */
1
+ import{Tabs as e}from"./chunk-N5KO2IHG.js";import{Card as a}from"./chunk-WEEQDPU3.js";import{StatusBadgeProvider as r,StatusBadge as t}from"./chunk-FZM3ZPW3.js";import{Button_default as l}from"./chunk-EOVXFXVV.js";import{useState as i}from"react";import{jsx as d,jsxs as s}from"react/jsx-runtime";var n={featured:"success",new:"active",draft:"draft"},c=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,a)=>({id:a,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][a],tag:["featured","new","draft"][a%3],bg:e}));function m(){const[m,g]=i("all"),f="all"===m?c:c.filter(e=>e.tag===m);/* @__PURE__ */
2
2
  return d(r,{groups:n,children:/* @__PURE__ */d("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */s("div",{className:"mx-auto max-w-5xl space-y-4",children:[
3
3
  /* @__PURE__ */s("div",{className:"flex items-center justify-between gap-4",children:[
4
4
  /* @__PURE__ */d("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
@@ -1,4 +1,4 @@
1
- import{DropdownMenu as e}from"./chunk-GO6HU2O3.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
1
+ import{DropdownMenu as e}from"./chunk-UBQUXUD2.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
2
2
  return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
3
3
  return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
4
4
  /* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
@@ -0,0 +1,8 @@
1
+ import{AccessibleTable as t}from"./chunk-5PP435FL.js";import{arcPath as e}from"./chunk-VFC6QUEN.js";import{useHighlight as o}from"./chunk-CNYAHYE6.js";import{ChartTooltip as n}from"./chunk-36VIGB6J.js";import{CHART_INK as r,resolveSeriesColor as a}from"./chunk-TZFACUMR.js";import{useShellStrings as l,useShellLocale as i}from"./chunk-5YP7MFPK.js";import{formatPlain as s}from"./chunk-C3QOHMR6.js";import{useState as c}from"react";import{jsx as d,jsxs as m}from"react/jsx-runtime";function h(t,e,o,n){const r=(t,o)=>{const n=e[t]?.[o];return"number"==typeof n&&Number.isFinite(n)?n:0},a=t.map((e,o)=>t.reduce((t,e,n)=>t+r(o,n)+r(n,o),0)),l=Math.max(2,o),i=t.length>l,s=i?t.map((t,e)=>e).sort((t,e)=>a[e]-a[t]).slice(0,l-1).sort((t,e)=>t-e):t.map((t,e)=>e),c=new Map(s.map((t,e)=>[t,e])),d=i?s.length:-1,m=i?[...s.map(e=>t[e]),n]:[...t],h=m.map(()=>m.map(()=>0));let u=0;t.forEach((e,o)=>t.forEach((t,e)=>{const n=c.get(o)??d,a=c.get(e)??d;n!==d||a!==d?h[n][a]+=r(o,e):u+=r(o,e)}));const f=m.map((t,e)=>m.reduce((t,o,n)=>t+h[e][n]+h[n][e],0));return d>=0&&(f[d]+=u),{labels:m,matrix:h,totals:f,otherIndex:d,foldedCount:i?t.length-s.length:0}}function u({labels:u,matrix:f,size:p=340,maxNodes:x=8,padAngle:g=.04,arcWidth:b=12,formatValue:k,className:v,emptyLabel:M}){const $=l().charts,w=i(),N=k??(t=>s(t,w)),F=M??$.noFlows,[j,y]=c(null),{highlighted:E}=o(),C=h(u,f,x,$.other),{labels:P,matrix:I,otherIndex:z,foldedCount:A}=C,L=(t,e)=>I[t]?.[e]??0,O=t=>t===z?r.muted:a(t),Q=C.totals,V=P.map((t,e)=>e).sort((t,e)=>Q[e]-Q[t]),Y=V.reduce((t,e)=>t+Q[e],0);if(Y<=0)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${v??""}`,children:F});const B=p/2,H=p/2,R=p/2-44,T=R-b,U=g*V.length,W=/* @__PURE__ */new Map;let G=-Math.PI/2;V.forEach((t,e)=>{const o=Q[t]/Y*(2*Math.PI-U);W.set(t,{start:G,end:G+o,slot:e}),G+=o+g});const J=/* @__PURE__ */new Map,K=[];for(const t of V)for(const e of V){const o=L(t,e);if(o<=0)continue;const n=W.get(t),r=o/Math.max(1,Q[t])*(n.end-n.start),a=J.get(t)??0;J.set(t,a+r),K.push({from:t,to:e,value:o,a:n.start+a+r/2,b:W.get(e).start+(W.get(e).end-W.get(e).start)/2})}const S=(t,e)=>[B+e*Math.cos(t),H+e*Math.sin(t)],Z="arc"===j?.kind?j.index:void 0,q="ribbon"===j?.kind?K[j.index]:void 0;/* @__PURE__ */
2
+ return m("div",{className:`relative ${v??""}`,children:[
3
+ /* @__PURE__ */m("svg",{width:"100%",height:p,viewBox:`0 0 ${p} ${p}`,role:"img","aria-label":$.chord(V.length),onMouseLeave:()=>y(null),children:[K.map((t,e)=>{const[o,n]=S(t.a,T),[r,a]=S(t.b,T),l=O(t.from),i=((t,e)=>j?"ribbon"===j.kind?j.index===e:j.index===t.from||j.index===t.to:null!==E?P[t.from]===E||P[t.to]===E:null)(t,e);/* @__PURE__ */
4
+ return d("path",{d:`M${o},${n} Q${B},${H} ${r},${a}`,fill:"none",stroke:l,strokeWidth:Math.max(1,t.value/Y*p*.9),strokeOpacity:null===i||i?.34:.07,strokeLinecap:"round",onMouseEnter:()=>y({kind:"ribbon",index:e})},`${P[t.from]}→${P[t.to]}`)}),V.map(t=>{const o=W.get(t),n=(o.start+o.end)/2,[a,l]=S(n,R+16),i=(t=>j?"arc"===j.kind?j.index===t:K[j.index].from===t||K[j.index].to===t:null!==E?P[t]===E:null)(t);/* @__PURE__ */
5
+ return m("g",{onMouseEnter:()=>y({kind:"arc",index:t}),children:[
6
+ /* @__PURE__ */d("path",{d:e(B,H,T,R,o.start,o.end),fill:O(t),fillOpacity:null===i||i?1:.45}),
7
+ /* @__PURE__ */d("text",{x:a,y:l+4,fontSize:11,fill:r.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:P[t]})]},t)})]}),A>0&&/* @__PURE__ */d("p",{className:"mt-1 text-xs text-ink-faint",children:$.chordFolded(A)}),void 0!==Z&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:P[Z],rows:[{key:"total",label:$.totalFlow,color:O(Z),value:N(Q[Z])}]})}),q&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(n,{title:`${P[q.from]} → ${P[q.to]}`,rows:[{key:"value",label:$.flow,color:O(q.from),value:N(q.value)}]})}),
8
+ /* @__PURE__ */d(t,{caption:$.chord(V.length),head:[$.tableFrom,$.tableTo,$.value],rows:K.map(t=>[P[t.from],P[t.to],N(t.value)])})]})}export{u as ChordChart,h as foldChord};
@@ -1,4 +1,4 @@
1
- import{useWindowMenuItem as e,Modal as t}from"./chunk-CLAKVFOB.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as s}from"./chunk-H56TNUV4.js";import{Icon as n}from"./chunk-7V32O5NF.js";import{DEFAULT_SHELL_STRINGS as o,useShellStrings as i,splitAround as a}from"./chunk-5YP7MFPK.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var f=o.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"2.0.0",route:"/spreadsheet",description:f.spreadsheet},notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:f.notepad},documents:{name:"Documents",version:"2.0.0",route:"/documents",description:f.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:f.preview},files:{name:"Files",version:"1.1.4",route:"/files",description:f.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:f.browser}},x=/* @__PURE__ */p(n,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(n,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:n}){const o=u[n],[f,w]=m(!1),N=c(()=>w(!0),[]),b=i().aboutApp,k=b.title(o.name);if(e(k,N,x),!f)return null;const g=r[o.route],y=l(g)?d(g,{className:"h-9 w-9"}):v,[j,C]=a(b.partOf);/* @__PURE__ */
1
+ import{useWindowMenuItem as e,Modal as t}from"./chunk-JGWUSJDD.js";import{navIcons as r}from"./chunk-4LXCCZDM.js";import{VERSION as s}from"./chunk-YXSGMPNW.js";import{Icon as n}from"./chunk-7V32O5NF.js";import{DEFAULT_SHELL_STRINGS as o,useShellStrings as i,splitAround as a}from"./chunk-5YP7MFPK.js";import{useState as m,useCallback as c,isValidElement as l,cloneElement as d}from"react";import{jsx as p,jsxs as h}from"react/jsx-runtime";var f=o.aboutApp,u={spreadsheet:{name:"Spreadsheets",version:"2.0.0",route:"/spreadsheet",description:f.spreadsheet},notepad:{name:"Notepad",version:"1.1.0",route:"/notepad",description:f.notepad},documents:{name:"Documents",version:"2.0.0",route:"/documents",description:f.documents},preview:{name:"Preview",version:"1.4.3",route:"/preview",description:f.preview},files:{name:"Files",version:"1.1.4",route:"/files",description:f.files},browser:{name:"Browser",version:"1.0.3",route:"/browser",description:f.browser}},x=/* @__PURE__ */p(n,{name:"info",className:"h-4 w-4",strokeWidth:1.5}),v=/* @__PURE__ */p(n,{name:"window",className:"h-9 w-9",strokeWidth:1.5});function w({app:n}){const o=u[n],[f,w]=m(!1),N=c(()=>w(!0),[]),b=i().aboutApp,k=b.title(o.name);if(e(k,N,x),!f)return null;const g=r[o.route],y=l(g)?d(g,{className:"h-9 w-9"}):v,[j,D]=a(b.partOf);/* @__PURE__ */
2
2
  return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1,autoHeight:!0,dimensions:[320,320],children:/* @__PURE__ */h("div",{className:"flex flex-col items-center text-center px-5 pt-5 pb-4",children:[
3
3
  /* @__PURE__ */p("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-gray-100 text-gray-600 shrink-0",children:y}),
4
4
  /* @__PURE__ */p("h2",{className:"mt-3 text-lg font-bold text-gray-900",children:o.name}),
@@ -6,4 +6,4 @@ return p(t,{open:!0,onClose:()=>w(!1),title:k,size:"sm",compact:!0,bodyScroll:!1
6
6
  /* @__PURE__ */p("p",{className:"mt-2 text-xs text-gray-500 leading-relaxed",children:b[n]}),
7
7
  /* @__PURE__ */h("div",{className:"mt-4 pt-3 border-t border-gray-200 w-full",children:[
8
8
  /* @__PURE__ */h("p",{className:"text-2xs text-ink-faint",children:[j,
9
- /* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),C]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(s)})]})]})})}export{w as AboutApp,u as BUILTIN_APP_INFO};
9
+ /* @__PURE__ */p("span",{className:"font-medium text-gray-700",children:"efficient-shell"}),D]}),s&&/* @__PURE__ */p("p",{className:"mt-0.5 text-2xs font-mono text-ink-faintest",children:b.shellVersion(s)})]})]})})}export{w as AboutApp,u as BUILTIN_APP_INFO};
@@ -1,4 +1,4 @@
1
- import{ErrorPage as r}from"./chunk-O6VIHWYU.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-7DI3VQCF.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
1
+ import{ErrorPage as r}from"./chunk-O6VIHWYU.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-EOVXFXVV.js";import{useShellStrings as s}from"./chunk-5YP7MFPK.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
2
2
  return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
3
3
  /* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
4
4
  /* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
@@ -0,0 +1,15 @@
1
+ import{AccessibleTable as e}from"./chunk-5PP435FL.js";import{polygonPoints as t}from"./chunk-VFC6QUEN.js";import{ChartDefs as r,maskId as l}from"./chunk-465RRWBY.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{ChartTooltip as o}from"./chunk-36VIGB6J.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{CHART_INK as i,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{useShellStrings as m,useShellLocale as c}from"./chunk-5YP7MFPK.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as p,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";var k=3,g=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function x({axes:k,series:x,size:y=300,mode:b="area",grid:v="polygon",rings:M=4,formatValue:N,animate:j=!0,className:$,emptyLabel:F}){const C=m().charts,W=c(),w=N??(e=>h(e,W)),L=F??C.nothingToCompare,P=p(),[R,A]=u(null),{highlighted:Y}=a(),z=x;if(k.length<3||0===z.length)/* @__PURE__ */
2
+ return d("p",{className:`text-sm text-gray-500 ${$??""}`,children:L});const B=y/2,E=y/2,T=y/2-46,U=n(k.length),V=k.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...z.map(e=>e.values[t]??0).filter(Number.isFinite))),H=(e,t)=>{const r=Math.max(0,Math.min(1,t/V[e])),l=U.center(e)-U.step/2;return[B+T*r*Math.cos(l),E+T*r*Math.sin(l)]},J=(e,t)=>null!==R?R!==e:null!==Y&&Y!==t,O=null!==R?z[R]:void 0;/* @__PURE__ */
3
+ return f("div",{className:`relative ${$??""}`,children:[
4
+ /* @__PURE__ */f("svg",{width:"100%",height:y,viewBox:`0 0 ${y} ${y}`,role:"img","aria-labelledby":P,onMouseLeave:()=>A(null),children:[
5
+ /* @__PURE__ */d("title",{id:P,children:C.acrossMeasures(z.map(e=>e.label),k.length)}),Array.from({length:M},(e,r)=>{const l=T*(r+1)/M;return"circle"===v?/* @__PURE__ */d("circle",{cx:B,cy:E,r:l,fill:"none",stroke:i.grid,strokeWidth:1},r):/* @__PURE__ */d("path",{d:g(t(B,E,l,k.length)),fill:"none",stroke:i.grid,strokeWidth:1},r)}),k.map((e,t)=>{const[r,l]=H(t,V[t]);/* @__PURE__ */
6
+ return f("g",{children:[
7
+ /* @__PURE__ */d("line",{x1:B,y1:E,x2:r,y2:l,stroke:i.grid,strokeWidth:1}),
8
+ /* @__PURE__ */d("text",{x:B+(T+18)*Math.cos(U.center(t)-U.step/2),y:E+(T+18)*Math.sin(U.center(t)-U.step/2)+4,textAnchor:"middle",fontSize:11,fill:i.label,children:e.label})]},e.key)}),
9
+ /* @__PURE__ */d(r,{id:P,reveal:!!j&&"center-out"}),z.map((e,t)=>{const r=s(t,3,e.color,e.tone),a=k.map((t,r)=>H(r,e.values[r]??0));/* @__PURE__ */
10
+ return f("g",{opacity:J(t,e.key)?.3:1,onMouseEnter:()=>A(t),mask:j?`url(#${l(P)})`:void 0,children:["area"===b&&/* @__PURE__ */d("path",{d:g(a),fill:r,fillOpacity:.18,stroke:"none"}),
11
+ /* @__PURE__ */d("path",{d:g(a),fill:"none",stroke:r,strokeWidth:2,strokeLinejoin:"round"}),a.map(([e,t],l)=>/* @__PURE__ */d("circle",{cx:e,cy:t,r:3.5,fill:r,stroke:i.surface,strokeWidth:1.5},l))]},e.key)})]}),O&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(o,{title:O.label,rows:k.map((e,t)=>({key:e.key,label:e.label,color:s(R,3,O.color,O.tone),value:w(O.values[t]??0)}))})}),
12
+ /* @__PURE__ */d("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:z.map((e,t)=>/* @__PURE__ */f("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
13
+ /* @__PURE__ */d("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:s(t,3,e.color,e.tone)}}),
14
+ /* @__PURE__ */d("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
15
+ /* @__PURE__ */d(e,{caption:C.acrossMeasures(z.map(e=>e.label),k.length),head:[C.tableSeries,...k.map(e=>e.label)],rows:z.map(e=>[e.label,...k.map((t,r)=>w(e.values[r]??0))])})]})}export{k as RADAR_SERIES_CAP,x as RadarChart};
@@ -0,0 +1,14 @@
1
+ import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{ChartTooltip as t}from"./chunk-36VIGB6J.js";import{usePlotWidth as l}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-5YP7MFPK.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:A}){const N=o().charts,L=i(),S=y??(e=>h(e,L)),j=A??N.noStages,z=c(),[V,F]=m(null),{highlighted:w}=e(),C=s(null),W=l(C,560),Z=$??W;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const B=b??a(0),E=p??54*x.length,H=Math.max(...x.map(e=>e.value),1),P="bars"===v,Y=P?Math.round(Math.min(132,Math.max(80,.24*Z))):Math.round(Math.min(168,Math.max(104,.38*Z))),R=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},U=e=>{const t=R(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,L)}`:""}},G=P?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=U(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,I=Z-Y-G,J=Math.max(P?2:0,Math.min(M,I)),K=e=>Math.max(J,I*Math.max(0,e/H)),O=e=>K(e)/2,Q=Y+I/2,T=e=>46+e/Math.max(1,x.length-1)*54,X=e=>`color-mix(in oklab, ${B} ${T(e).toFixed(0)}%, ${n.surface})`,q=e=>T(e)>=55?n.surface:n.label,D=(e,t)=>null!==V?V!==e:null!==w&&w!==t,_=null!==V?x[V]:void 0;/* @__PURE__ */
2
+ return f("div",{className:`relative ${k??""}`,ref:C,children:[
3
+ /* @__PURE__ */f("svg",{width:"100%",height:E,viewBox:`0 0 ${Z} ${E}`,role:"img","aria-labelledby":z,onMouseLeave:()=>F(null),children:[
4
+ /* @__PURE__ */d("title",{id:z,children:N.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*E/x.length+g/2,a=(t+1)*E/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,L),i=.62*o.length*12+12;if(P){const u=Y,h=u+K(e.value),{count:c,drop:m}=U(t);/* @__PURE__ */
5
+ return f("g",{opacity:D(t,e.key)?.45:1,onMouseEnter:()=>F(t),children:[
6
+ /* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:X(t)}),
7
+ /* @__PURE__ */d("text",{x:Y-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:q(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
8
+ /* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
9
+ /* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=O(e.value),c="cone"===v?O(x[t+1]?.value??e.value):h,m=R(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
10
+ return f("g",{opacity:D(t,e.key)?.45:1,onMouseEnter:()=>F(t),children:[
11
+ /* @__PURE__ */d("path",{d:`M${Q-h},${l} L${Q+h},${l} L${Q+c},${a} L${Q-c},${a} Z`,fill:X(t)}),
12
+ /* @__PURE__ */d("text",{x:Y-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
13
+ /* @__PURE__ */f("text",{x:Y-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,L)}`:""]}),
14
+ /* @__PURE__ */d("text",{x:s?Q:Q+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?q(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(t,{title:_.label,rows:[{key:"value",label:N.count,color:X(V),value:S(_.value)},{key:"share",label:N.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,L)},...V>0&&x[V-1].value>0?[{key:"drop",label:N.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[V-1].value),1,L)}`}]:[]]})})]})}export{x as FunnelChart};