boardplot 0.0.0-stage → 0.53.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 (818) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE.md +180 -0
  4. package/README.md +208 -2
  5. package/THIRD_PARTY_NOTICES.md +1110 -0
  6. package/dist/DiagnosticDetails-UNYNYCAH.js +69 -0
  7. package/dist/ReaderBox-VOJSJ66R.js +137 -0
  8. package/dist/annotateEngine-DLMFJZ67.js +30 -0
  9. package/dist/build-identity.json +6 -0
  10. package/dist/chunk-24BHMKDD.js +83 -0
  11. package/dist/chunk-263SZKIL.js +8 -0
  12. package/dist/chunk-27QADBDV.js +211 -0
  13. package/dist/chunk-2CVH5E57.js +128 -0
  14. package/dist/chunk-2DOR5SS6.js +446 -0
  15. package/dist/chunk-2EQE4E3I.js +22 -0
  16. package/dist/chunk-2FNNAPCI.js +24 -0
  17. package/dist/chunk-2L2Q53EP.js +251 -0
  18. package/dist/chunk-2LMCD3ZR.js +6 -0
  19. package/dist/chunk-2ND7ZITT.js +3069 -0
  20. package/dist/chunk-2QT5ZUHO.js +2937 -0
  21. package/dist/chunk-2RSG7JYI.js +24 -0
  22. package/dist/chunk-2V6CLH33.js +1392 -0
  23. package/dist/chunk-2VWJ5BGO.js +566 -0
  24. package/dist/chunk-2WNYRWHG.js +51 -0
  25. package/dist/chunk-323YZWYJ.js +548 -0
  26. package/dist/chunk-33PB4V6K.js +382 -0
  27. package/dist/chunk-33PLBIMA.js +176 -0
  28. package/dist/chunk-3A2IEBCN.js +195 -0
  29. package/dist/chunk-3D3D3D23.js +25 -0
  30. package/dist/chunk-3EZRM4YM.js +92 -0
  31. package/dist/chunk-3H2W76TB.js +2353 -0
  32. package/dist/chunk-3JEQGGVD.js +19 -0
  33. package/dist/chunk-3QWZAEW5.js +26 -0
  34. package/dist/chunk-3SIRPKMP.js +12 -0
  35. package/dist/chunk-3SQCCESO.js +1592 -0
  36. package/dist/chunk-3XHJHQWU.js +42 -0
  37. package/dist/chunk-4G2O2ZPJ.js +83 -0
  38. package/dist/chunk-4JLBVIGW.js +24 -0
  39. package/dist/chunk-4RRNJLCM.js +746 -0
  40. package/dist/chunk-4UVW5WU6.js +76 -0
  41. package/dist/chunk-4X66BTP5.js +344 -0
  42. package/dist/chunk-53OYF4ZT.js +687 -0
  43. package/dist/chunk-57ZGVAU3.js +179 -0
  44. package/dist/chunk-5HECRVXJ.js +62 -0
  45. package/dist/chunk-5LGSRWFC.js +63 -0
  46. package/dist/chunk-5LYXD6ME.js +1112 -0
  47. package/dist/chunk-66RFKRGO.js +28 -0
  48. package/dist/chunk-6KWIQ5KF.js +18 -0
  49. package/dist/chunk-6OCR6ITN.js +72 -0
  50. package/dist/chunk-6RBTTCQD.js +802 -0
  51. package/dist/chunk-6Y7EXYLR.js +563 -0
  52. package/dist/chunk-7CTKTIPF.js +613 -0
  53. package/dist/chunk-7EVIIADO.js +185 -0
  54. package/dist/chunk-7X2ZYVAX.js +89 -0
  55. package/dist/chunk-7X65ZQN4.js +38 -0
  56. package/dist/chunk-A4QZXLXF.js +7 -0
  57. package/dist/chunk-A6CQPJWR.js +49 -0
  58. package/dist/chunk-A7IEVBYI.js +35 -0
  59. package/dist/chunk-ACXX2JNL.js +6 -0
  60. package/dist/chunk-ADKCLH3Z.js +98 -0
  61. package/dist/chunk-ADWSGPH5.js +23 -0
  62. package/dist/chunk-AG2CJ4JY.js +203 -0
  63. package/dist/chunk-AHQ4L3BE.js +30 -0
  64. package/dist/chunk-AOQ6VF5H.js +6 -0
  65. package/dist/chunk-AQROQDLR.js +3303 -0
  66. package/dist/chunk-AWTG3RFF.js +85 -0
  67. package/dist/chunk-B54RN2FD.js +692 -0
  68. package/dist/chunk-B67K6OWJ.js +48 -0
  69. package/dist/chunk-B6GFKYBZ.js +40 -0
  70. package/dist/chunk-BBL3R5YZ.js +186 -0
  71. package/dist/chunk-BBRBCMNR.js +28 -0
  72. package/dist/chunk-BIDIGDGH.js +6 -0
  73. package/dist/chunk-BLFWUMTD.js +12 -0
  74. package/dist/chunk-BM6SFFWF.js +6 -0
  75. package/dist/chunk-BMRD6MAH.js +24 -0
  76. package/dist/chunk-BPKXEMRE.js +197 -0
  77. package/dist/chunk-BUPLB3EX.js +129 -0
  78. package/dist/chunk-BW5VLBSZ.js +15 -0
  79. package/dist/chunk-BWGRWGVA.js +295 -0
  80. package/dist/chunk-BWLOXQDV.js +131 -0
  81. package/dist/chunk-BWTX7LUG.js +203 -0
  82. package/dist/chunk-C54QLNE4.js +69 -0
  83. package/dist/chunk-CAQ5P4VN.js +296 -0
  84. package/dist/chunk-CCCEBIUZ.js +296 -0
  85. package/dist/chunk-CDZHNLO6.js +42 -0
  86. package/dist/chunk-CJGSJKPO.js +25 -0
  87. package/dist/chunk-CN7JRHST.js +25 -0
  88. package/dist/chunk-CNX7EGSU.js +266 -0
  89. package/dist/chunk-COYOTQC2.js +75 -0
  90. package/dist/chunk-CRNMNZJD.js +1161 -0
  91. package/dist/chunk-CUVUDK4O.js +68 -0
  92. package/dist/chunk-CWDHCSL2.js +2919 -0
  93. package/dist/chunk-CYOJZ3GQ.js +631 -0
  94. package/dist/chunk-D4SOADBD.js +19 -0
  95. package/dist/chunk-D7SHZDA3.js +1808 -0
  96. package/dist/chunk-DAVHGK27.js +657 -0
  97. package/dist/chunk-DCCJRLAJ.js +422 -0
  98. package/dist/chunk-DCTCUZ5L.js +51 -0
  99. package/dist/chunk-DDCB7ZA5.js +2511 -0
  100. package/dist/chunk-DDI2W4TR.js +149 -0
  101. package/dist/chunk-DIHUGBZO.js +61 -0
  102. package/dist/chunk-DJHIQWSG.js +25 -0
  103. package/dist/chunk-DO5OZJAO.js +302 -0
  104. package/dist/chunk-DOFYKPTC.js +18 -0
  105. package/dist/chunk-DRTA6JG5.js +160 -0
  106. package/dist/chunk-DRW6KGBK.js +1062 -0
  107. package/dist/chunk-DU4A5AOY.js +1156 -0
  108. package/dist/chunk-DYS7EIXY.js +294 -0
  109. package/dist/chunk-E4IQ6M4S.js +24 -0
  110. package/dist/chunk-EFUWFB64.js +24 -0
  111. package/dist/chunk-EHBB2Z4D.js +290 -0
  112. package/dist/chunk-EHVESNLV.js +30 -0
  113. package/dist/chunk-EJPVVGD7.js +67 -0
  114. package/dist/chunk-EKQK5D6G.js +14 -0
  115. package/dist/chunk-EUADDXAV.js +30 -0
  116. package/dist/chunk-F6CNPC4L.js +47 -0
  117. package/dist/chunk-FBAYZSFC.js +2806 -0
  118. package/dist/chunk-FBB4BWKN.js +30 -0
  119. package/dist/chunk-FF23FYQD.js +1269 -0
  120. package/dist/chunk-FG6EDGMI.js +53 -0
  121. package/dist/chunk-FHA3KMFC.js +43 -0
  122. package/dist/chunk-FIANWJXX.js +19 -0
  123. package/dist/chunk-FIWNDOMO.js +6 -0
  124. package/dist/chunk-FV3VF36K.js +2721 -0
  125. package/dist/chunk-G5FMTRG5.js +37 -0
  126. package/dist/chunk-GCBOHVDZ.js +229 -0
  127. package/dist/chunk-GDOW2KNP.js +19 -0
  128. package/dist/chunk-GTG3IGLF.js +2674 -0
  129. package/dist/chunk-GZTNTHSW.js +21 -0
  130. package/dist/chunk-H4H4O62O.js +46 -0
  131. package/dist/chunk-H5G7T35P.js +24 -0
  132. package/dist/chunk-H63XQ3OO.js +942 -0
  133. package/dist/chunk-H67RTX46.js +43 -0
  134. package/dist/chunk-HA4IPWMM.js +841 -0
  135. package/dist/chunk-HKYTOJLV.js +33 -0
  136. package/dist/chunk-HOAH5XBR.js +542 -0
  137. package/dist/chunk-HTYFQHRC.js +24 -0
  138. package/dist/chunk-HYY5V2KL.js +19 -0
  139. package/dist/chunk-HZI56ASJ.js +79 -0
  140. package/dist/chunk-I6VAWNNU.js +24 -0
  141. package/dist/chunk-IBXXZVG7.js +80 -0
  142. package/dist/chunk-IDDA5INB.js +60 -0
  143. package/dist/chunk-IK4BHOPZ.js +33 -0
  144. package/dist/chunk-IL5T7I2A.js +27 -0
  145. package/dist/chunk-ILSXT6KT.js +24 -0
  146. package/dist/chunk-IV2UXZXX.js +16 -0
  147. package/dist/chunk-IYEFEBRN.js +41 -0
  148. package/dist/chunk-IYMI7YI4.js +829 -0
  149. package/dist/chunk-J6I2YFJH.js +58 -0
  150. package/dist/chunk-JFBEAUJ6.js +24 -0
  151. package/dist/chunk-JR7Y5ONB.js +27 -0
  152. package/dist/chunk-JSEYUJUQ.js +836 -0
  153. package/dist/chunk-JYBT2JNY.js +61 -0
  154. package/dist/chunk-K3HSQPSM.js +24 -0
  155. package/dist/chunk-KAXJFL7N.js +43 -0
  156. package/dist/chunk-KDMKHR5A.js +32 -0
  157. package/dist/chunk-KKWZWP67.js +24 -0
  158. package/dist/chunk-KOJ5QETJ.js +8 -0
  159. package/dist/chunk-KPKXJYQH.js +19 -0
  160. package/dist/chunk-KSJVENRU.js +113 -0
  161. package/dist/chunk-KZJOV4QW.js +33 -0
  162. package/dist/chunk-KZS46KDY.js +58 -0
  163. package/dist/chunk-L3JWM7FR.js +50 -0
  164. package/dist/chunk-L4S6UFTL.js +26 -0
  165. package/dist/chunk-L6DJ4ZY5.js +2008 -0
  166. package/dist/chunk-L7RHB734.js +23 -0
  167. package/dist/chunk-LCWJS34U.js +38 -0
  168. package/dist/chunk-LFTAMH7I.js +24 -0
  169. package/dist/chunk-LFX7W4B7.js +113 -0
  170. package/dist/chunk-LINZPU5D.js +8 -0
  171. package/dist/chunk-LIWLBLCT.js +83 -0
  172. package/dist/chunk-LNKY5Z2X.js +23 -0
  173. package/dist/chunk-LS7HVBI7.js +24 -0
  174. package/dist/chunk-M4EUXOLU.js +170 -0
  175. package/dist/chunk-M4SPKUZE.js +7 -0
  176. package/dist/chunk-M4YLED7M.js +17 -0
  177. package/dist/chunk-MBKZYJRC.js +1424 -0
  178. package/dist/chunk-MCYM3RNF.js +227 -0
  179. package/dist/chunk-MF6IVSBJ.js +48 -0
  180. package/dist/chunk-MIAPBQCA.js +24 -0
  181. package/dist/chunk-MJZHFH5R.js +1075 -0
  182. package/dist/chunk-MQFCG4KS.js +1467 -0
  183. package/dist/chunk-MVV6RQMG.js +128 -0
  184. package/dist/chunk-MYMT5KJL.js +1182 -0
  185. package/dist/chunk-MZL6LGKO.js +587 -0
  186. package/dist/chunk-N23YFPPI.js +47 -0
  187. package/dist/chunk-N3G2FYDL.js +300 -0
  188. package/dist/chunk-N3TPMXS3.js +161 -0
  189. package/dist/chunk-N73IBH55.js +58 -0
  190. package/dist/chunk-N7J7CZS6.js +43 -0
  191. package/dist/chunk-NCB3YLHF.js +28 -0
  192. package/dist/chunk-NHQGRKEA.js +63 -0
  193. package/dist/chunk-NKIYLFXZ.js +2774 -0
  194. package/dist/chunk-NOSDEJ3K.js +25934 -0
  195. package/dist/chunk-NQDVMUHX.js +433 -0
  196. package/dist/chunk-NSSNYY6Y.js +58 -0
  197. package/dist/chunk-NY5NUFDZ.js +117 -0
  198. package/dist/chunk-O3S2KNIW.js +25 -0
  199. package/dist/chunk-O3VN6BTL.js +24 -0
  200. package/dist/chunk-ONZLC47B.js +88 -0
  201. package/dist/chunk-OQEBOVUO.js +30 -0
  202. package/dist/chunk-OUEGGWH7.js +24 -0
  203. package/dist/chunk-OURX73UJ.js +728 -0
  204. package/dist/chunk-P25VEGGX.js +24 -0
  205. package/dist/chunk-P26Z62UV.js +24 -0
  206. package/dist/chunk-P5RNWMZC.js +2984 -0
  207. package/dist/chunk-P6KZIZDV.js +987 -0
  208. package/dist/chunk-PEUSKIFV.js +168 -0
  209. package/dist/chunk-PFVTYFSL.js +24 -0
  210. package/dist/chunk-PWROWDZS.js +137 -0
  211. package/dist/chunk-Q3CV2JJ2.js +3650 -0
  212. package/dist/chunk-QBR6IKIX.js +50 -0
  213. package/dist/chunk-QGCEHR6S.js +13 -0
  214. package/dist/chunk-QHRE2M6V.js +26 -0
  215. package/dist/chunk-QKL7IY42.js +38 -0
  216. package/dist/chunk-QO6HEXIZ.js +272 -0
  217. package/dist/chunk-QOIVXZUF.js +24 -0
  218. package/dist/chunk-QPWRHDLZ.js +17 -0
  219. package/dist/chunk-QSXK6PJL.js +19 -0
  220. package/dist/chunk-QTZVVZ2A.js +54 -0
  221. package/dist/chunk-QWXWVPNE.js +18 -0
  222. package/dist/chunk-QY5ZKUWY.js +383 -0
  223. package/dist/chunk-QZAT46PP.js +95 -0
  224. package/dist/chunk-RA66JA3D.js +24 -0
  225. package/dist/chunk-REOPXBUR.js +600 -0
  226. package/dist/chunk-RGZGLKFB.js +648 -0
  227. package/dist/chunk-RL3NUWMY.js +3378 -0
  228. package/dist/chunk-RNOJSEES.js +16 -0
  229. package/dist/chunk-ROXO4R3J.js +16 -0
  230. package/dist/chunk-RPIW5T55.js +40 -0
  231. package/dist/chunk-RQ5DNYLG.js +10 -0
  232. package/dist/chunk-RZNYW7UP.js +133 -0
  233. package/dist/chunk-S32YYDIB.js +420 -0
  234. package/dist/chunk-S4QSJAGY.js +44 -0
  235. package/dist/chunk-S6UX7KB6.js +335 -0
  236. package/dist/chunk-SDSONLMZ.js +2546 -0
  237. package/dist/chunk-SGD3ZHID.js +250 -0
  238. package/dist/chunk-SKRSCTT5.js +28 -0
  239. package/dist/chunk-SMCDXUIO.js +24 -0
  240. package/dist/chunk-SPTPFY4S.js +528 -0
  241. package/dist/chunk-SREWFAAJ.js +90 -0
  242. package/dist/chunk-SS42FJVN.js +3875 -0
  243. package/dist/chunk-SVZDXFPX.js +891 -0
  244. package/dist/chunk-SZPTTNW7.js +16 -0
  245. package/dist/chunk-T3IGJARD.js +22 -0
  246. package/dist/chunk-TA3TFKYZ.js +86 -0
  247. package/dist/chunk-TBGUEF3M.js +939 -0
  248. package/dist/chunk-TGK6KUGN.js +331 -0
  249. package/dist/chunk-TJSND556.js +1783 -0
  250. package/dist/chunk-TKOJZQAJ.js +24 -0
  251. package/dist/chunk-TM4OC53S.js +97 -0
  252. package/dist/chunk-TNEHPP3H.js +18 -0
  253. package/dist/chunk-TWOREVKJ.js +1760 -0
  254. package/dist/chunk-TXS3U77A.js +60 -0
  255. package/dist/chunk-UB6ODJHO.js +134 -0
  256. package/dist/chunk-UBZXQIDR.js +24 -0
  257. package/dist/chunk-ULTSSIOU.js +38 -0
  258. package/dist/chunk-UMDEWWXT.js +33 -0
  259. package/dist/chunk-V6O6KVOA.js +347 -0
  260. package/dist/chunk-VABRPZVC.js +43 -0
  261. package/dist/chunk-VDAKTZQP.js +18 -0
  262. package/dist/chunk-VDAZPGR2.js +79 -0
  263. package/dist/chunk-VERLFNWR.js +25 -0
  264. package/dist/chunk-VH2UUU7K.js +24 -0
  265. package/dist/chunk-VJ3FCGQF.js +12 -0
  266. package/dist/chunk-VK5ZDV67.js +47 -0
  267. package/dist/chunk-VKQNDOAI.js +40 -0
  268. package/dist/chunk-VTEV3WVF.js +690 -0
  269. package/dist/chunk-VXZFQKBJ.js +21 -0
  270. package/dist/chunk-WI5ITCOH.js +22 -0
  271. package/dist/chunk-WLZ54FWG.js +120 -0
  272. package/dist/chunk-WYJEOMNY.js +31 -0
  273. package/dist/chunk-WZGJSQKN.js +29 -0
  274. package/dist/chunk-WZL4EEBS.js +11 -0
  275. package/dist/chunk-X4YNDLVA.js +54 -0
  276. package/dist/chunk-X6SUFTD7.js +17 -0
  277. package/dist/chunk-XB4KZ6WO.js +81 -0
  278. package/dist/chunk-XJI6SWFS.js +569 -0
  279. package/dist/chunk-XJP5DKIL.js +29 -0
  280. package/dist/chunk-XN4ARQ2W.js +47 -0
  281. package/dist/chunk-XN7MQO45.js +359 -0
  282. package/dist/chunk-XQCQZBGX.js +100 -0
  283. package/dist/chunk-XXOHXA3A.js +69 -0
  284. package/dist/chunk-XZOHR765.js +127 -0
  285. package/dist/chunk-YCNLQYTC.js +133 -0
  286. package/dist/chunk-YCRGWQBS.js +526 -0
  287. package/dist/chunk-YF2PYLC4.js +210 -0
  288. package/dist/chunk-YG5GUELW.js +935 -0
  289. package/dist/chunk-YS6KMYM4.js +91 -0
  290. package/dist/chunk-YWP7XFKD.js +12 -0
  291. package/dist/chunk-Z2MGTKDR.js +20 -0
  292. package/dist/chunk-Z6CL7AR6.js +24 -0
  293. package/dist/chunk-Z7X3RGGA.js +22 -0
  294. package/dist/chunk-ZF43WRG3.js +29 -0
  295. package/dist/chunk-ZMF7WEGG.js +60 -0
  296. package/dist/chunk-ZNHFLJSY.js +375 -0
  297. package/dist/chunk-ZQ4VFQID.js +76 -0
  298. package/dist/chunk-ZQF34VPS.js +72 -0
  299. package/dist/chunk-ZU425HNM.js +24 -0
  300. package/dist/chunk-ZZU5R5UU.js +24 -0
  301. package/dist/cli/index.js +9 -0
  302. package/dist/core-3VCCUFVX.js +32 -0
  303. package/dist/core-4BZQQSHS.js +33 -0
  304. package/dist/core-4VT4MHNB.js +38 -0
  305. package/dist/core-5535KXRD.js +40 -0
  306. package/dist/core-5HQBPCHL.js +35 -0
  307. package/dist/core-6RYHWUJO.js +35 -0
  308. package/dist/core-7BZJCIXN.js +35 -0
  309. package/dist/core-AJTVU6X7.js +37 -0
  310. package/dist/core-C6YUSTZI.js +57 -0
  311. package/dist/core-EEB7HTCL.js +33 -0
  312. package/dist/core-EFMVDWNH.js +38 -0
  313. package/dist/core-ETAGQBZO.js +34 -0
  314. package/dist/core-FVR3WZEC.js +36 -0
  315. package/dist/core-GCTFVYMH.js +29 -0
  316. package/dist/core-GES44OTS.js +33 -0
  317. package/dist/core-GGQREDSI.js +47 -0
  318. package/dist/core-HRYOV6QD.js +38 -0
  319. package/dist/core-IKD3EE3S.js +38 -0
  320. package/dist/core-JM4R426L.js +32 -0
  321. package/dist/core-KKQS3WI2.js +40 -0
  322. package/dist/core-LA6XDYG7.js +40 -0
  323. package/dist/core-MJ7JWQT5.js +37 -0
  324. package/dist/core-MLROKJ2M.js +53 -0
  325. package/dist/core-MR52YBRX.js +31 -0
  326. package/dist/core-NP4VHWXL.js +29 -0
  327. package/dist/core-NQLNZDX5.js +41 -0
  328. package/dist/core-NSIJEKLI.js +44 -0
  329. package/dist/core-OJUQLIQ5.js +35 -0
  330. package/dist/core-PB3VUQSS.js +32 -0
  331. package/dist/core-Q6VLFFYC.js +56 -0
  332. package/dist/core-QY7AVIKZ.js +51 -0
  333. package/dist/core-SBQMHWTA.js +52 -0
  334. package/dist/core-UHECQHJ2.js +38 -0
  335. package/dist/core-V5FV4NWL.js +56 -0
  336. package/dist/core-WGM4XUN3.js +58 -0
  337. package/dist/core-WUQVFARS.js +34 -0
  338. package/dist/core-Z2F3IGSR.js +42 -0
  339. package/dist/dataTable-3CPPIHB3.js +58 -0
  340. package/dist/engine-FXFBCWHB.js +961 -0
  341. package/dist/fixtures.d.ts +1 -0
  342. package/dist/fixtures.js +41 -0
  343. package/dist/fontTables-WYCZNRE7.js +18 -0
  344. package/dist/fonts.d.ts +1 -0
  345. package/dist/fonts.js +19 -0
  346. package/dist/geo/dach.d.ts +1 -0
  347. package/dist/geo/dach.js +14 -0
  348. package/dist/geo/de-states.d.ts +1 -0
  349. package/dist/geo/de-states.js +14 -0
  350. package/dist/geo/eu27.d.ts +1 -0
  351. package/dist/geo/eu27.js +14 -0
  352. package/dist/geo/europe.d.ts +1 -0
  353. package/dist/geo/europe.js +14 -0
  354. package/dist/geo/index.d.ts +1 -0
  355. package/dist/geo/index.js +41 -0
  356. package/dist/geo/us-states.d.ts +1 -0
  357. package/dist/geo/us-states.js +14 -0
  358. package/dist/geo/world.d.ts +1 -0
  359. package/dist/geo/world.js +14 -0
  360. package/dist/index.d.ts +1 -0
  361. package/dist/index.js +364 -0
  362. package/dist/main-YLKBTHJP.js +569 -0
  363. package/dist/mcp/server.js +1025 -0
  364. package/dist/module-SVEW5ZUE.js +137233 -0
  365. package/dist/react/bar.d.ts +1 -0
  366. package/dist/react/bar.js +81 -0
  367. package/dist/react/bartable.d.ts +1 -0
  368. package/dist/react/bartable.js +70 -0
  369. package/dist/react/box.d.ts +1 -0
  370. package/dist/react/box.js +65 -0
  371. package/dist/react/bullet.d.ts +1 -0
  372. package/dist/react/bullet.js +72 -0
  373. package/dist/react/butterfly.d.ts +1 -0
  374. package/dist/react/butterfly.js +66 -0
  375. package/dist/react/choropleth.d.ts +1 -0
  376. package/dist/react/choropleth.js +67 -0
  377. package/dist/react/cohort.d.ts +1 -0
  378. package/dist/react/cohort.js +70 -0
  379. package/dist/react/column.d.ts +1 -0
  380. package/dist/react/column.js +86 -0
  381. package/dist/react/combo.d.ts +1 -0
  382. package/dist/react/combo.js +86 -0
  383. package/dist/react/creative.d.ts +1 -0
  384. package/dist/react/creative.js +61 -0
  385. package/dist/react/diagram.d.ts +1 -0
  386. package/dist/react/diagram.js +60 -0
  387. package/dist/react/dimswitch.d.ts +1 -0
  388. package/dist/react/dimswitch.js +72 -0
  389. package/dist/react/dot.d.ts +1 -0
  390. package/dist/react/dot.js +70 -0
  391. package/dist/react/export.d.ts +1 -0
  392. package/dist/react/export.js +658 -0
  393. package/dist/react/funnel.d.ts +1 -0
  394. package/dist/react/funnel.js +63 -0
  395. package/dist/react/gantt.d.ts +1 -0
  396. package/dist/react/gantt.js +62 -0
  397. package/dist/react/grid.d.ts +1 -0
  398. package/dist/react/grid.js +67 -0
  399. package/dist/react/heatmap.d.ts +1 -0
  400. package/dist/react/heatmap.js +68 -0
  401. package/dist/react/histogram.d.ts +1 -0
  402. package/dist/react/histogram.js +86 -0
  403. package/dist/react/index.d.ts +1 -0
  404. package/dist/react/index.js +504 -0
  405. package/dist/react/kpi.d.ts +1 -0
  406. package/dist/react/kpi.js +67 -0
  407. package/dist/react/likert.d.ts +1 -0
  408. package/dist/react/likert.js +83 -0
  409. package/dist/react/line.d.ts +1 -0
  410. package/dist/react/line.js +81 -0
  411. package/dist/react/mekko.d.ts +1 -0
  412. package/dist/react/mekko.js +71 -0
  413. package/dist/react/pareto.d.ts +1 -0
  414. package/dist/react/pareto.js +90 -0
  415. package/dist/react/pie.d.ts +1 -0
  416. package/dist/react/pie.js +64 -0
  417. package/dist/react/prepare.d.ts +1 -0
  418. package/dist/react/prepare.js +278 -0
  419. package/dist/react/pvm.d.ts +1 -0
  420. package/dist/react/pvm.js +68 -0
  421. package/dist/react/pyramid.d.ts +1 -0
  422. package/dist/react/pyramid.js +67 -0
  423. package/dist/react/sankey.d.ts +1 -0
  424. package/dist/react/sankey.js +59 -0
  425. package/dist/react/scatter.d.ts +1 -0
  426. package/dist/react/scatter.js +63 -0
  427. package/dist/react/slope.d.ts +1 -0
  428. package/dist/react/slope.js +64 -0
  429. package/dist/react/sparkline.d.ts +1 -0
  430. package/dist/react/sparkline.js +59 -0
  431. package/dist/react/spec.d.ts +1 -0
  432. package/dist/react/spec.js +379 -0
  433. package/dist/react/status.d.ts +1 -0
  434. package/dist/react/status.js +64 -0
  435. package/dist/react/story.d.ts +1 -0
  436. package/dist/react/story.js +140 -0
  437. package/dist/react/table.d.ts +1 -0
  438. package/dist/react/table.js +69 -0
  439. package/dist/react/theme.d.ts +1 -0
  440. package/dist/react/theme.js +53 -0
  441. package/dist/react/tilemap.d.ts +1 -0
  442. package/dist/react/tilemap.js +66 -0
  443. package/dist/react/treemap.d.ts +1 -0
  444. package/dist/react/treemap.js +61 -0
  445. package/dist/react/variance.d.ts +1 -0
  446. package/dist/react/variance.js +65 -0
  447. package/dist/react/waffle.d.ts +1 -0
  448. package/dist/react/waffle.js +62 -0
  449. package/dist/react/waterfall.d.ts +1 -0
  450. package/dist/react/waterfall.js +68 -0
  451. package/dist/resvg-ZOVDIZTV.js +23 -0
  452. package/dist/rows.d.ts +1 -0
  453. package/dist/rows.js +23 -0
  454. package/dist/rowsModule-YVLAROIP.js +27 -0
  455. package/dist/schema-2K6C3U24.js +23 -0
  456. package/dist/schema-2KIHLTYI.js +23 -0
  457. package/dist/schema-4HY2MWZC.js +30 -0
  458. package/dist/schema-4S5CXHAO.js +24 -0
  459. package/dist/schema-5BKQV56C.js +27 -0
  460. package/dist/schema-5HA5DSYN.js +24 -0
  461. package/dist/schema-5NKJPSBD.js +23 -0
  462. package/dist/schema-65FOKNHK.js +43 -0
  463. package/dist/schema-6OHZWHUI.js +23 -0
  464. package/dist/schema-6RYJS2GM.js +24 -0
  465. package/dist/schema-6W4M3WJ4.js +23 -0
  466. package/dist/schema-7TLSFG6M.js +24 -0
  467. package/dist/schema-AMFRKUFS.js +27 -0
  468. package/dist/schema-B7CZPPB4.js +28 -0
  469. package/dist/schema-BNRNHGHQ.js +26 -0
  470. package/dist/schema-E4MRCGPZ.js +24 -0
  471. package/dist/schema-F3WYTR65.js +26 -0
  472. package/dist/schema-FA6XIHTW.js +23 -0
  473. package/dist/schema-GZNOW4LX.js +23 -0
  474. package/dist/schema-HEIDGCSL.js +23 -0
  475. package/dist/schema-JB2H6KPA.js +23 -0
  476. package/dist/schema-MPXZNWV3.js +23 -0
  477. package/dist/schema-NHNQK6XO.js +23 -0
  478. package/dist/schema-NN6UPDPW.js +23 -0
  479. package/dist/schema-O4YNAGIY.js +23 -0
  480. package/dist/schema-O7AKK232.js +29 -0
  481. package/dist/schema-OJCML6LV.js +24 -0
  482. package/dist/schema-ORTRMYI6.js +24 -0
  483. package/dist/schema-PJ6P52BC.js +23 -0
  484. package/dist/schema-RTWES6NR.js +24 -0
  485. package/dist/schema-S36SRYGO.js +24 -0
  486. package/dist/schema-S3TCLTYD.js +23 -0
  487. package/dist/schema-SWWMOLOR.js +54 -0
  488. package/dist/schema-WOSEZNKG.js +26 -0
  489. package/dist/schema-Y6KBWUUR.js +23 -0
  490. package/dist/schema-YQYTLKSW.js +23 -0
  491. package/dist/schema-ZUUUY3QS.js +33 -0
  492. package/dist/specValidation-VNWIKLHH.js +49 -0
  493. package/dist/theme.d.ts +1 -0
  494. package/dist/theme.js +24 -0
  495. package/dist/themeShapeRules-2D3KWSPQ.js +11 -0
  496. package/dist/types/core/a11y/accessibility.d.ts +43 -0
  497. package/dist/types/core/a11y/recordsShared.d.ts +44 -0
  498. package/dist/types/core/a11y/structuralRecords.d.ts +6 -0
  499. package/dist/types/core/a11y/types.d.ts +116 -0
  500. package/dist/types/core/annotate.d.ts +300 -0
  501. package/dist/types/core/annotateArms.d.ts +37 -0
  502. package/dist/types/core/annotateFields.d.ts +30 -0
  503. package/dist/types/core/annotateGapBracket.d.ts +66 -0
  504. package/dist/types/core/annotateLinks.d.ts +47 -0
  505. package/dist/types/core/annotateTargets.d.ts +90 -0
  506. package/dist/types/core/axis.d.ts +179 -0
  507. package/dist/types/core/bandSelect.d.ts +10 -0
  508. package/dist/types/core/bands.d.ts +14 -0
  509. package/dist/types/core/calendarLabels.d.ts +101 -0
  510. package/dist/types/core/charts/band/stacks.d.ts +155 -0
  511. package/dist/types/core/charts/bar/fixtures.d.ts +9 -0
  512. package/dist/types/core/charts/bar/layout.d.ts +95 -0
  513. package/dist/types/core/charts/bartable/fixtures.d.ts +4 -0
  514. package/dist/types/core/charts/bartable/types.d.ts +192 -0
  515. package/dist/types/core/charts/box/fixtures.d.ts +12 -0
  516. package/dist/types/core/charts/box/types.d.ts +110 -0
  517. package/dist/types/core/charts/bullet/fixtures.d.ts +11 -0
  518. package/dist/types/core/charts/butterfly/fixtures.d.ts +9 -0
  519. package/dist/types/core/charts/choropleth/fixtures.d.ts +3 -0
  520. package/dist/types/core/charts/choropleth/overlayTypes.d.ts +68 -0
  521. package/dist/types/core/charts/choropleth/types.d.ts +117 -0
  522. package/dist/types/core/charts/cohort/fixtures.d.ts +12 -0
  523. package/dist/types/core/charts/cohort/types.d.ts +165 -0
  524. package/dist/types/core/charts/column/anomaly.d.ts +204 -0
  525. package/dist/types/core/charts/column/fixtures.d.ts +12 -0
  526. package/dist/types/core/charts/column/layout.d.ts +116 -0
  527. package/dist/types/core/charts/column/model.d.ts +295 -0
  528. package/dist/types/core/charts/column/types.d.ts +56 -0
  529. package/dist/types/core/charts/combo/endpoints.d.ts +165 -0
  530. package/dist/types/core/charts/combo/fixtures.d.ts +12 -0
  531. package/dist/types/core/charts/combo/layout.d.ts +48 -0
  532. package/dist/types/core/charts/creative/fixtures.d.ts +4 -0
  533. package/dist/types/core/charts/creative/types.d.ts +73 -0
  534. package/dist/types/core/charts/diagram/fixtures.d.ts +3 -0
  535. package/dist/types/core/charts/dimswitch/compile.d.ts +20 -0
  536. package/dist/types/core/charts/dimswitch/fixtures.d.ts +3 -0
  537. package/dist/types/core/charts/dimswitch/types.d.ts +152 -0
  538. package/dist/types/core/charts/dot/fixtures.d.ts +11 -0
  539. package/dist/types/core/charts/funnel/fixtures.d.ts +11 -0
  540. package/dist/types/core/charts/gantt/fixtures.d.ts +9 -0
  541. package/dist/types/core/charts/gantt/layout.d.ts +63 -0
  542. package/dist/types/core/charts/grid/fixtures.d.ts +3 -0
  543. package/dist/types/core/charts/grid/metricStack.d.ts +108 -0
  544. package/dist/types/core/charts/grid/metricStackSchema.d.ts +74 -0
  545. package/dist/types/core/charts/grid/normalize.d.ts +99 -0
  546. package/dist/types/core/charts/grid/schema.d.ts +168 -0
  547. package/dist/types/core/charts/heatmap/fixtures.d.ts +11 -0
  548. package/dist/types/core/charts/histogram/fixtures.d.ts +15 -0
  549. package/dist/types/core/charts/histogram/types.d.ts +98 -0
  550. package/dist/types/core/charts/kpi/fixtures.d.ts +9 -0
  551. package/dist/types/core/charts/likert/fixtures.d.ts +11 -0
  552. package/dist/types/core/charts/likert/layout.d.ts +111 -0
  553. package/dist/types/core/charts/line/fixtures.d.ts +16 -0
  554. package/dist/types/core/charts/line/types.d.ts +6 -0
  555. package/dist/types/core/charts/mekko/fixtures.d.ts +13 -0
  556. package/dist/types/core/charts/pareto/fixtures.d.ts +5 -0
  557. package/dist/types/core/charts/pareto/layout.d.ts +68 -0
  558. package/dist/types/core/charts/pie/fixtures.d.ts +14 -0
  559. package/dist/types/core/charts/pvm/fixtures.d.ts +13 -0
  560. package/dist/types/core/charts/pvm/types.d.ts +118 -0
  561. package/dist/types/core/charts/pyramid/fixtures.d.ts +4 -0
  562. package/dist/types/core/charts/pyramid/types.d.ts +92 -0
  563. package/dist/types/core/charts/sankey/fixtures.d.ts +4 -0
  564. package/dist/types/core/charts/sankey/types.d.ts +116 -0
  565. package/dist/types/core/charts/scatter/fixtures.d.ts +12 -0
  566. package/dist/types/core/charts/scatter/types.d.ts +58 -0
  567. package/dist/types/core/charts/slope/fixtures.d.ts +13 -0
  568. package/dist/types/core/charts/sparkline/fixtures.d.ts +9 -0
  569. package/dist/types/core/charts/status/fixtures.d.ts +8 -0
  570. package/dist/types/core/charts/status/layout.d.ts +71 -0
  571. package/dist/types/core/charts/table/fitFormats.d.ts +67 -0
  572. package/dist/types/core/charts/table/fixtures.d.ts +7 -0
  573. package/dist/types/core/charts/table/resolve.d.ts +72 -0
  574. package/dist/types/core/charts/table/view.d.ts +156 -0
  575. package/dist/types/core/charts/tilemap/fixtures.d.ts +3 -0
  576. package/dist/types/core/charts/tilemap/types.d.ts +94 -0
  577. package/dist/types/core/charts/treemap/fixtures.d.ts +4 -0
  578. package/dist/types/core/charts/treemap/types.d.ts +78 -0
  579. package/dist/types/core/charts/variance/fixtures.d.ts +12 -0
  580. package/dist/types/core/charts/waffle/fixtures.d.ts +5 -0
  581. package/dist/types/core/charts/waffle/types.d.ts +117 -0
  582. package/dist/types/core/charts/waterfall/fixtures.d.ts +9 -0
  583. package/dist/types/core/claims/browser.d.ts +49 -0
  584. package/dist/types/core/claims/manifest.d.ts +22 -0
  585. package/dist/types/core/dateFormat.d.ts +39 -0
  586. package/dist/types/core/deferred.d.ts +121 -0
  587. package/dist/types/core/diagnostics/describe.d.ts +149 -0
  588. package/dist/types/core/diagnostics/jsonPatch.d.ts +36 -0
  589. package/dist/types/core/doc/bareChart.d.ts +2 -0
  590. package/dist/types/core/doc/diagnostics.d.ts +124 -0
  591. package/dist/types/core/doc/docExpand.d.ts +39 -0
  592. package/dist/types/core/doc/document.d.ts +43 -0
  593. package/dist/types/core/doc/ownedDocumentCopy.d.ts +5 -0
  594. package/dist/types/core/doc/specError.d.ts +6 -0
  595. package/dist/types/core/emptyData.d.ts +27 -0
  596. package/dist/types/core/eventLane.d.ts +208 -0
  597. package/dist/types/core/fontMetrics/index.d.ts +47 -0
  598. package/dist/types/core/fontMetrics/injected.d.ts +40 -0
  599. package/dist/types/core/fontMetrics/tableDocument.d.ts +73 -0
  600. package/dist/types/core/fontMetrics/tables.generated.d.ts +17 -0
  601. package/dist/types/core/footer.d.ts +59 -0
  602. package/dist/types/core/format.d.ts +149 -0
  603. package/dist/types/core/formatPrecision.d.ts +136 -0
  604. package/dist/types/core/formatSpec.d.ts +304 -0
  605. package/dist/types/core/frame.d.ts +583 -0
  606. package/dist/types/core/geo/packs/all.d.ts +7 -0
  607. package/dist/types/core/geo/packs/dach.d.ts +16 -0
  608. package/dist/types/core/geo/packs/de-states.d.ts +16 -0
  609. package/dist/types/core/geo/packs/eu27.d.ts +16 -0
  610. package/dist/types/core/geo/packs/europe.d.ts +16 -0
  611. package/dist/types/core/geo/packs/index.d.ts +22 -0
  612. package/dist/types/core/geo/packs/registry.d.ts +37 -0
  613. package/dist/types/core/geo/packs/us-states.d.ts +16 -0
  614. package/dist/types/core/geo/packs/world.d.ts +16 -0
  615. package/dist/types/core/geo/tiles/eu27.generated.d.ts +412 -0
  616. package/dist/types/core/geo/tiles/europe.generated.d.ts +842 -0
  617. package/dist/types/core/geo/tiles/index.d.ts +8 -0
  618. package/dist/types/core/geo/tiles/types.d.ts +36 -0
  619. package/dist/types/core/geo/tiles/us-states.generated.d.ts +952 -0
  620. package/dist/types/core/geo/tiles/world.generated.d.ts +968 -0
  621. package/dist/types/core/geo/types.d.ts +146 -0
  622. package/dist/types/core/geometry.d.ts +102 -0
  623. package/dist/types/core/grid/sharedScale.d.ts +82 -0
  624. package/dist/types/core/icons.d.ts +227 -0
  625. package/dist/types/core/inputError.d.ts +14 -0
  626. package/dist/types/core/isoDate.d.ts +2 -0
  627. package/dist/types/core/isoTime.d.ts +7 -0
  628. package/dist/types/core/label/categoryRow.d.ts +332 -0
  629. package/dist/types/core/label/occupied.d.ts +41 -0
  630. package/dist/types/core/label/ownership.d.ts +83 -0
  631. package/dist/types/core/label/solver.d.ts +384 -0
  632. package/dist/types/core/label/tickRow.d.ts +78 -0
  633. package/dist/types/core/live/types.d.ts +50 -0
  634. package/dist/types/core/normalize/shared.d.ts +56 -0
  635. package/dist/types/core/notes.d.ts +174 -0
  636. package/dist/types/core/othersShade.d.ts +9 -0
  637. package/dist/types/core/periodYears.d.ts +9 -0
  638. package/dist/types/core/polyline.d.ts +11 -0
  639. package/dist/types/core/rangeRules.d.ts +19 -0
  640. package/dist/types/core/ratioTier.d.ts +120 -0
  641. package/dist/types/core/readerStrings.d.ts +13 -0
  642. package/dist/types/core/reading.d.ts +120 -0
  643. package/dist/types/core/registry.d.ts +178 -0
  644. package/dist/types/core/repaintGeometry.d.ts +19 -0
  645. package/dist/types/core/request.d.ts +124 -0
  646. package/dist/types/core/rows.d.ts +47 -0
  647. package/dist/types/core/scale.d.ts +106 -0
  648. package/dist/types/core/schema/capability.d.ts +229 -0
  649. package/dist/types/core/schema/namedColumns.d.ts +45 -0
  650. package/dist/types/core/schema/reference.d.ts +31 -0
  651. package/dist/types/core/schema/refusals.d.ts +45 -0
  652. package/dist/types/core/schema/unknownKeys.d.ts +45 -0
  653. package/dist/types/core/seriesIdentity.d.ts +120 -0
  654. package/dist/types/core/shareRounding.d.ts +49 -0
  655. package/dist/types/core/sizing.d.ts +330 -0
  656. package/dist/types/core/staticFooter.d.ts +6 -0
  657. package/dist/types/core/story.d.ts +41 -0
  658. package/dist/types/core/structureCounts.d.ts +10 -0
  659. package/dist/types/core/svg/renderSvg.d.ts +51 -0
  660. package/dist/types/core/target.d.ts +89 -0
  661. package/dist/types/core/text.d.ts +113 -0
  662. package/dist/types/core/theme.d.ts +478 -0
  663. package/dist/types/core/themeFields.d.ts +11 -0
  664. package/dist/types/core/themeRules.d.ts +111 -0
  665. package/dist/types/core/themeShape.d.ts +87 -0
  666. package/dist/types/core/themeValidate.d.ts +15 -0
  667. package/dist/types/core/timeAxis.d.ts +106 -0
  668. package/dist/types/core/types/annotations.d.ts +227 -0
  669. package/dist/types/core/types/cell.d.ts +82 -0
  670. package/dist/types/core/types/data.d.ts +314 -0
  671. package/dist/types/core/types/diagram.d.ts +234 -0
  672. package/dist/types/core/types/index.d.ts +8 -0
  673. package/dist/types/core/types/options.d.ts +1583 -0
  674. package/dist/types/core/types/scene.d.ts +990 -0
  675. package/dist/types/core/types/sizing.d.ts +51 -0
  676. package/dist/types/core/types/table.d.ts +873 -0
  677. package/dist/types/core/types/theme.d.ts +806 -0
  678. package/dist/types/core/zoom.d.ts +106 -0
  679. package/dist/types/fixtures/index.d.ts +40 -0
  680. package/dist/types/fixtures/registry.d.ts +15 -0
  681. package/dist/types/fonts.d.ts +10 -0
  682. package/dist/types/index.d.ts +70 -0
  683. package/dist/types/react/BoardplotTheme.d.ts +9 -0
  684. package/dist/types/react/DimSwitchChart.d.ts +36 -0
  685. package/dist/types/react/ScaleGroup.d.ts +31 -0
  686. package/dist/types/react/SceneRenderer.d.ts +23 -0
  687. package/dist/types/react/SizePlaceholder.d.ts +51 -0
  688. package/dist/types/react/StoryFrame.d.ts +42 -0
  689. package/dist/types/react/TableChart.d.ts +220 -0
  690. package/dist/types/react/a11ySurface.d.ts +20 -0
  691. package/dist/types/react/barrelCharts.d.ts +1023 -0
  692. package/dist/types/react/charts/bar.d.ts +28 -0
  693. package/dist/types/react/charts/bartable.d.ts +27 -0
  694. package/dist/types/react/charts/box.d.ts +27 -0
  695. package/dist/types/react/charts/bullet.d.ts +28 -0
  696. package/dist/types/react/charts/butterfly.d.ts +28 -0
  697. package/dist/types/react/charts/choropleth.d.ts +27 -0
  698. package/dist/types/react/charts/cohort.d.ts +52 -0
  699. package/dist/types/react/charts/column.d.ts +27 -0
  700. package/dist/types/react/charts/combo.d.ts +7 -0
  701. package/dist/types/react/charts/creative.d.ts +27 -0
  702. package/dist/types/react/charts/diagram.d.ts +162 -0
  703. package/dist/types/react/charts/dimswitch.d.ts +6 -0
  704. package/dist/types/react/charts/dot.d.ts +28 -0
  705. package/dist/types/react/charts/funnel.d.ts +28 -0
  706. package/dist/types/react/charts/gantt.d.ts +28 -0
  707. package/dist/types/react/charts/grid.d.ts +29 -0
  708. package/dist/types/react/charts/heatmap.d.ts +28 -0
  709. package/dist/types/react/charts/histogram.d.ts +27 -0
  710. package/dist/types/react/charts/kpi.d.ts +28 -0
  711. package/dist/types/react/charts/likert.d.ts +27 -0
  712. package/dist/types/react/charts/line.d.ts +28 -0
  713. package/dist/types/react/charts/mekko.d.ts +28 -0
  714. package/dist/types/react/charts/pareto.d.ts +28 -0
  715. package/dist/types/react/charts/pie.d.ts +28 -0
  716. package/dist/types/react/charts/pvm.d.ts +27 -0
  717. package/dist/types/react/charts/pyramid.d.ts +27 -0
  718. package/dist/types/react/charts/sankey.d.ts +27 -0
  719. package/dist/types/react/charts/scatter.d.ts +28 -0
  720. package/dist/types/react/charts/slope.d.ts +28 -0
  721. package/dist/types/react/charts/sparkline.d.ts +28 -0
  722. package/dist/types/react/charts/status.d.ts +27 -0
  723. package/dist/types/react/charts/table.d.ts +6 -0
  724. package/dist/types/react/charts/tilemap.d.ts +27 -0
  725. package/dist/types/react/charts/treemap.d.ts +27 -0
  726. package/dist/types/react/charts/variance.d.ts +28 -0
  727. package/dist/types/react/charts/waffle.d.ts +28 -0
  728. package/dist/types/react/charts/waterfall.d.ts +28 -0
  729. package/dist/types/react/createChartComponent.d.ts +135 -0
  730. package/dist/types/react/export/clipboard.d.ts +8 -0
  731. package/dist/types/react/export/csv.d.ts +2 -0
  732. package/dist/types/react/export/frame.d.ts +35 -0
  733. package/dist/types/react/export/index.d.ts +7 -0
  734. package/dist/types/react/export/png.d.ts +14 -0
  735. package/dist/types/react/export/svg.d.ts +5 -0
  736. package/dist/types/react/export/types.d.ts +69 -0
  737. package/dist/types/react/export/useExport.d.ts +17 -0
  738. package/dist/types/react/exportLink.d.ts +49 -0
  739. package/dist/types/react/footerFrame.d.ts +25 -0
  740. package/dist/types/react/hover/dataTable.d.ts +13 -0
  741. package/dist/types/react/hover/engine.d.ts +210 -0
  742. package/dist/types/react/hover/keyboard.d.ts +44 -0
  743. package/dist/types/react/hover/labelCard.d.ts +170 -0
  744. package/dist/types/react/hover/placement.d.ts +49 -0
  745. package/dist/types/react/index.d.ts +16 -0
  746. package/dist/types/react/parseChartSpec.d.ts +16 -0
  747. package/dist/types/react/prepare.d.ts +32 -0
  748. package/dist/types/react/prepared.d.ts +53 -0
  749. package/dist/types/react/preparedTable.d.ts +15 -0
  750. package/dist/types/react/rowsInput.d.ts +55 -0
  751. package/dist/types/react/rowsModule.d.ts +18 -0
  752. package/dist/types/react/rowsStore.d.ts +50 -0
  753. package/dist/types/react/scale-group.d.ts +2 -0
  754. package/dist/types/react/scaleGroupContext.d.ts +22 -0
  755. package/dist/types/react/scenePaint.d.ts +10 -0
  756. package/dist/types/react/scrollState.d.ts +26 -0
  757. package/dist/types/react/spec.d.ts +82 -0
  758. package/dist/types/react/specValidation.d.ts +45 -0
  759. package/dist/types/react/story.d.ts +15 -0
  760. package/dist/types/react/theme.d.ts +9 -0
  761. package/dist/types/react/themeContext.d.ts +44 -0
  762. package/dist/types/react/useChartLayout.d.ts +22 -0
  763. package/dist/types/react/useContainerSize.d.ts +57 -0
  764. package/dist/types/react/useHover.d.ts +100 -0
  765. package/dist/types/react/useZoom.d.ts +50 -0
  766. package/dist/types/rows.d.ts +63 -0
  767. package/dist/types/tableLooks.d.ts +6 -0
  768. package/dist/types/theme.d.ts +3 -0
  769. package/dist/types/validate.d.ts +3 -0
  770. package/dist/validate.d.ts +1 -0
  771. package/dist/validate.js +223 -0
  772. package/docs/FONTS.md +68 -0
  773. package/docs/TELEMETRY.md +94 -0
  774. package/docs/manual.md +850 -0
  775. package/docs/reference/bar.md +222 -0
  776. package/docs/reference/bartable.md +143 -0
  777. package/docs/reference/box.md +93 -0
  778. package/docs/reference/bullet.md +118 -0
  779. package/docs/reference/butterfly.md +117 -0
  780. package/docs/reference/choropleth.md +148 -0
  781. package/docs/reference/cohort.md +149 -0
  782. package/docs/reference/column.md +275 -0
  783. package/docs/reference/combo.md +219 -0
  784. package/docs/reference/creative.md +147 -0
  785. package/docs/reference/diagram.md +191 -0
  786. package/docs/reference/dimswitch.md +1395 -0
  787. package/docs/reference/dot.md +117 -0
  788. package/docs/reference/fixtures.md +1089 -0
  789. package/docs/reference/funnel.md +121 -0
  790. package/docs/reference/gantt.md +138 -0
  791. package/docs/reference/grid.md +302 -0
  792. package/docs/reference/heatmap.md +127 -0
  793. package/docs/reference/histogram.md +77 -0
  794. package/docs/reference/kpi.md +115 -0
  795. package/docs/reference/likert.md +113 -0
  796. package/docs/reference/line.md +436 -0
  797. package/docs/reference/mekko.md +114 -0
  798. package/docs/reference/options.md +313 -0
  799. package/docs/reference/pareto.md +102 -0
  800. package/docs/reference/pie.md +114 -0
  801. package/docs/reference/pvm.md +114 -0
  802. package/docs/reference/pyramid.md +99 -0
  803. package/docs/reference/react.md +706 -0
  804. package/docs/reference/reading.md +28 -0
  805. package/docs/reference/sankey.md +110 -0
  806. package/docs/reference/scatter.md +211 -0
  807. package/docs/reference/slope.md +126 -0
  808. package/docs/reference/sparkline.md +74 -0
  809. package/docs/reference/status.md +107 -0
  810. package/docs/reference/table.md +673 -0
  811. package/docs/reference/theme.md +361 -0
  812. package/docs/reference/tilemap.md +121 -0
  813. package/docs/reference/treemap.md +86 -0
  814. package/docs/reference/variance.md +126 -0
  815. package/docs/reference/waffle.md +106 -0
  816. package/docs/reference/waterfall.md +164 -0
  817. package/llms.txt +57 -0
  818. package/package.json +437 -4
@@ -0,0 +1,2353 @@
1
+ import {
2
+ sharedKeys10,
3
+ sharedKeys5,
4
+ sharedKeys7,
5
+ sharedKeys9
6
+ } from "./chunk-QGCEHR6S.js";
7
+ import {
8
+ optionKeyCheck
9
+ } from "./chunk-H4H4O62O.js";
10
+ import {
11
+ LayoutRefusal,
12
+ LoadingPlaceholder,
13
+ PROBE_STYLE,
14
+ SizePlaceholder,
15
+ hoverFlags,
16
+ markScrollRegion,
17
+ rebindable,
18
+ scrollStateOf,
19
+ useContainerSize,
20
+ useDeferredModule,
21
+ useDeferredRevision,
22
+ useDisplayWarnings,
23
+ useHoverEngine,
24
+ usePrepared,
25
+ usePrinting,
26
+ useRefusalSettle,
27
+ useResolvedChartRequest,
28
+ useRowsInput,
29
+ watchPrint
30
+ } from "./chunk-6Y7EXYLR.js";
31
+ import {
32
+ useIsomorphicLayoutEffect
33
+ } from "./chunk-A4QZXLXF.js";
34
+ import {
35
+ useExportLink
36
+ } from "./chunk-KKWZWP67.js";
37
+ import {
38
+ useStableValue
39
+ } from "./chunk-FHA3KMFC.js";
40
+ import {
41
+ sceneAttributes
42
+ } from "./chunk-IV2UXZXX.js";
43
+ import {
44
+ IdPrefixContext,
45
+ checkedIdPrefix,
46
+ useScopedId
47
+ } from "./chunk-VDAKTZQP.js";
48
+ import {
49
+ useBoardplotTheme
50
+ } from "./chunk-AHQ4L3BE.js";
51
+ import {
52
+ tableCore
53
+ } from "./chunk-WI5ITCOH.js";
54
+ import {
55
+ emitSparkline,
56
+ fitTableFormats,
57
+ formatsFittedWarning,
58
+ sparklineDomains,
59
+ sparklineSourceValues
60
+ } from "./chunk-TWOREVKJ.js";
61
+ import {
62
+ heatEncodingRefusals
63
+ } from "./chunk-ZF43WRG3.js";
64
+ import {
65
+ insetTint,
66
+ tableFrame,
67
+ tableGroundTextStyle,
68
+ tablePresentation,
69
+ tableRenderTheme,
70
+ tableStylesheet
71
+ } from "./chunk-2VWJ5BGO.js";
72
+ import {
73
+ publishTableChart
74
+ } from "./chunk-OQEBOVUO.js";
75
+ import {
76
+ registeredType,
77
+ withRegistered
78
+ } from "./chunk-DOFYKPTC.js";
79
+ import {
80
+ measureResolvedRequest,
81
+ resolveChartRequest
82
+ } from "./chunk-4RRNJLCM.js";
83
+ import {
84
+ arrowGlyph,
85
+ arrowKey,
86
+ badSide,
87
+ belowTableViewportFloor,
88
+ cellDrawsTabular,
89
+ collapsedByDefault,
90
+ columnHeadLabel,
91
+ columnHeaderAffix,
92
+ emptyMessageRow,
93
+ expansionForFolds,
94
+ expansionRootsHidden,
95
+ finalClosers,
96
+ groupSpans,
97
+ heatColumn,
98
+ heatKey,
99
+ heatPaint,
100
+ heatRanges,
101
+ inCellBarMaxima,
102
+ levelLadder,
103
+ numericCell,
104
+ presetLanguage,
105
+ printsFigures,
106
+ resolveTable,
107
+ rowGrounds,
108
+ sortRows,
109
+ sortableColumnIds,
110
+ tableWidths,
111
+ treeChildCounts,
112
+ visibleColumns,
113
+ visibleInlineRows,
114
+ visibleRows
115
+ } from "./chunk-SDSONLMZ.js";
116
+ import {
117
+ tableCellNodeId
118
+ } from "./chunk-M4SPKUZE.js";
119
+ import {
120
+ lastObservedIndex
121
+ } from "./chunk-XJI6SWFS.js";
122
+ import {
123
+ ENGINE_NOTES,
124
+ LABEL_WRAP_FLOOR,
125
+ SOFT_LABEL_CAP,
126
+ browserSlack,
127
+ cellPadX,
128
+ changeLineFitFont,
129
+ kindFont,
130
+ pinnedColumns,
131
+ rowFont,
132
+ tableFonts,
133
+ trackTemplate,
134
+ trackTotal
135
+ } from "./chunk-V6O6KVOA.js";
136
+ import {
137
+ hasPolarityBadge,
138
+ isFigureCell,
139
+ polarityBadgeInk
140
+ } from "./chunk-4UVW5WU6.js";
141
+ import {
142
+ DEFAULT_EMPTY_MESSAGE,
143
+ hasNoDataRows
144
+ } from "./chunk-H67RTX46.js";
145
+ import {
146
+ resolvePaint
147
+ } from "./chunk-SS42FJVN.js";
148
+ import {
149
+ chartRefusals,
150
+ isSizeDependentRefusal,
151
+ optionRefusals,
152
+ refusalFindings
153
+ } from "./chunk-DCCJRLAJ.js";
154
+ import {
155
+ canvasMargin,
156
+ textScaleOf
157
+ } from "./chunk-CWDHCSL2.js";
158
+ import {
159
+ DeferredCoreError,
160
+ asFirstFrame
161
+ } from "./chunk-HA4IPWMM.js";
162
+ import {
163
+ resolveCanvasOptions,
164
+ resolveSize
165
+ } from "./chunk-SGD3ZHID.js";
166
+ import {
167
+ defaultMeasurer,
168
+ splitNameBreaks
169
+ } from "./chunk-AG2CJ4JY.js";
170
+
171
+ // src/react/TableChart.tsx
172
+ import {
173
+ createContext,
174
+ memo,
175
+ useCallback as useCallback2,
176
+ useContext,
177
+ useEffect as useEffect2,
178
+ useImperativeHandle,
179
+ useMemo as useMemo2,
180
+ useRef as useRef3,
181
+ useState as useState3,
182
+ useSyncExternalStore
183
+ } from "react";
184
+
185
+ // src/core/charts/table/sticky.ts
186
+ function stickySettings(value) {
187
+ if (value === void 0 || value === !1) return { on: !1, head: !1, columns: 0, top: 0, sections: !1 };
188
+ if (typeof value == "object") {
189
+ let head = value.head === void 0 ? "table" : value.head, columns2 = Math.max(0, Math.floor(value.columns ?? 1)), sections = value.sections === !0;
190
+ return { on: columns2 > 0 || head !== !1 || sections, head, columns: columns2, top: head === "page" ? Math.max(0, value.top ?? 0) : 0, sections };
191
+ }
192
+ let columns = value === !0 ? 1 : Math.max(0, Math.floor(value));
193
+ return { on: columns > 0, head: "table", columns, top: 0, sections: !1 };
194
+ }
195
+
196
+ // src/react/rowsGate.tsx
197
+ import { jsx } from "react/jsx-runtime";
198
+ function useRowsGate(spec, props, frame) {
199
+ let mapped = useRowsInput(spec, props);
200
+ if (props.rows === void 0 && props.columns === void 0) return { data: spec.data };
201
+ let options = { ...frame, size: frame.size === "container" ? frame.fallbackSize : frame.size };
202
+ return mapped.refusals.length ? { element: /* @__PURE__ */ jsx(LayoutRefusal, { refusals: mapped.refusals, theme: frame.theme, options }) } : mapped.data === void 0 ? { element: /* @__PURE__ */ jsx(LoadingPlaceholder, { theme: frame.theme, failure: mapped.failure, options }) } : { data: mapped.data };
203
+ }
204
+
205
+ // src/react/hover/TableHoverFrame.tsx
206
+ import { useEffect, useMemo, useRef, useState } from "react";
207
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
208
+ function cellKey(rowId, columnId) {
209
+ return JSON.stringify([rowId, columnId]);
210
+ }
211
+ function drawnRecords(source, rows, columns) {
212
+ let rowIds = new Set(rows.map((row) => row.id)), colIds = new Set(columns.map((column) => column.id));
213
+ return source.filter((record) => {
214
+ let { rowId, colId } = record.target.owner;
215
+ return rowId !== void 0 && colId !== void 0 && rowIds.has(rowId) && colIds.has(colId);
216
+ });
217
+ }
218
+ function portalTarget(portal) {
219
+ return portal === !1 ? void 0 : portal || (typeof document > "u" ? void 0 : document.body || void 0);
220
+ }
221
+ function clientBox(element) {
222
+ let box = element.getBoundingClientRect(), { offsetWidth, offsetHeight } = element, sx = offsetWidth ? box.width / offsetWidth : 1, sy = offsetHeight ? box.height / offsetHeight : 1, x = box.left + element.clientLeft * sx, y = box.top + element.clientTop * sy;
223
+ return {
224
+ x,
225
+ y,
226
+ right: x + element.clientWidth * sx,
227
+ bottom: y + element.clientHeight * sy,
228
+ sx,
229
+ sy
230
+ };
231
+ }
232
+ function cellPosition(cell, container, portal, visibleIds) {
233
+ let document2 = cell.ownerDocument, view = document2.defaultView, viewport = {
234
+ left: 8,
235
+ top: 8,
236
+ right: (document2.documentElement.clientWidth || view.innerWidth) - 8,
237
+ bottom: (document2.documentElement.clientHeight || view.innerHeight) - 8
238
+ }, { left, top, right, bottom } = viewport, isVisible = (element) => (!visibleIds || (element.dataset.bpRow === void 0 || visibleIds.rows.has(element.dataset.bpRow)) && (element.dataset.bpColumn === void 0 || visibleIds.columns.has(element.dataset.bpColumn))) && !element.closest('[hidden],[aria-hidden="true"]');
239
+ if (!isVisible(cell)) return;
240
+ for (let ancestor = cell.closest(".bp-scroll") ?? cell.closest(".bp-table-grid") ?? cell.parentElement; ancestor; ancestor = ancestor.parentElement) {
241
+ let style = view.getComputedStyle(ancestor);
242
+ if ([style.overflow, style.overflowX, style.overflowY].some((value) => value && value !== "visible")) {
243
+ let box2 = clientBox(ancestor);
244
+ left = Math.max(left, box2.x), top = Math.max(top, box2.y), right = Math.min(right, box2.right), bottom = Math.min(bottom, box2.bottom);
245
+ }
246
+ if (ancestor === portal) break;
247
+ }
248
+ let box = cell.getBoundingClientRect();
249
+ if (!cell.isConnected || Math.min(right - left, bottom - top, box.width, box.height) <= 0 || box.right <= left || box.left >= right || box.bottom <= top || box.top >= bottom) return;
250
+ let positioned = (element) => {
251
+ let { position, transform } = view.getComputedStyle(element);
252
+ return position && position !== "static" || transform && transform !== "none";
253
+ }, block = positioned(container) ? container : container.offsetParent, origin = { x: -view.scrollX, y: -view.scrollY, sx: 1, sy: 1 };
254
+ block && block !== document2.documentElement && (block !== document2.body || positioned(block)) && (origin = clientBox(block), origin.x -= block.scrollLeft * origin.sx, origin.y -= block.scrollTop * origin.sy), "showPopover" in cell && (origin = { x: 0, y: 0, sx: 1, sy: 1 });
255
+ let { sx, sy } = origin, cells = /* @__PURE__ */ new Map(), rowBounds = /* @__PURE__ */ new Map(), occupied = [], range = document2.createRange(), x1 = right, y1 = bottom, x2 = left, y2 = top, local = (box2) => ({
256
+ x: (box2.left - viewport.left) / sx,
257
+ y: (box2.top - viewport.top) / sy,
258
+ w: (box2.right - box2.left) / sx,
259
+ h: (box2.bottom - box2.top) / sy
260
+ });
261
+ for (let element of Array.from(cell.closest(".bp-table-grid")?.querySelectorAll('[data-bp-row][data-bp-column],[role="columnheader"]') ?? [])) {
262
+ if (!isVisible(element)) continue;
263
+ let box2 = element.getBoundingClientRect(), visible = {
264
+ left: Math.max(left, box2.left),
265
+ top: Math.max(top, box2.top),
266
+ right: Math.min(right, box2.right),
267
+ bottom: Math.min(bottom, box2.bottom)
268
+ };
269
+ if (visible.right <= visible.left || visible.bottom <= visible.top) continue;
270
+ let rect = local(visible);
271
+ cells.set(element, rect), x1 = Math.min(x1, visible.left), y1 = Math.min(y1, visible.top), x2 = Math.max(x2, visible.right), y2 = Math.max(y2, visible.bottom);
272
+ let rowId = element.dataset.bpRow;
273
+ if (rowId !== void 0) {
274
+ let row = rowBounds.get(rowId) ?? [];
275
+ row.push(rect), rowBounds.set(rowId, row);
276
+ }
277
+ let walker = document2.createTreeWalker(
278
+ element,
279
+ 4
280
+ /* SHOW_TEXT */
281
+ ), textBounds;
282
+ for (let node = walker.nextNode(); node; node = walker.nextNode())
283
+ if (node.textContent?.trim()) {
284
+ range.selectNodeContents(node);
285
+ for (let text of Array.from(range.getClientRects?.() ?? [])) {
286
+ let clipped = {
287
+ left: Math.max(visible.left, text.left),
288
+ top: Math.max(visible.top, text.top),
289
+ right: Math.min(visible.right, text.right),
290
+ bottom: Math.min(visible.bottom, text.bottom)
291
+ };
292
+ clipped.right > clipped.left && clipped.bottom > clipped.top && (textBounds = textBounds ? {
293
+ left: Math.min(textBounds.left, clipped.left),
294
+ top: Math.min(textBounds.top, clipped.top),
295
+ right: Math.max(textBounds.right, clipped.right),
296
+ bottom: Math.max(textBounds.bottom, clipped.bottom)
297
+ } : clipped);
298
+ }
299
+ }
300
+ textBounds && occupied.push({ rect: local(textBounds), kind: "label", owner: { rowId, colId: element.dataset.bpColumn } });
301
+ }
302
+ return {
303
+ cells,
304
+ rowBounds,
305
+ occupied,
306
+ tableBounds: cells.size ? local({ left: x1, top: y1, right: x2, bottom: y2 }) : void 0,
307
+ anchor: local(box),
308
+ frame: { w: (viewport.right - viewport.left) / sx, h: (viewport.bottom - viewport.top) / sy },
309
+ offset: { x: (viewport.left - origin.x) / sx, y: (viewport.top - origin.y) / sy },
310
+ scale: { x: sx, y: sy }
311
+ };
312
+ }
313
+ function tableWidth(table, request) {
314
+ if (request.options.size !== void 0) return request.size.width;
315
+ let resolved = table.columns.reduce((sum, column) => sum + (column.width ?? 0), 0);
316
+ return resolved > 0 ? resolved : request.size.width;
317
+ }
318
+ function TableHoverFrame({ table, rows, columns, request, theme, initialPrepared, refused, portal, flags, styleNonce, inlineVisibility, children }) {
319
+ let { direction } = useBoardplotTheme(), engine = useHoverEngine(), target = portalTarget(portal), frameRef = useRef(null), touch = useRef(void 0), visibleIds = useMemo(() => ({ rows: new Set(rows.map((row2) => row2.id)), columns: new Set(columns.map((column) => column.id)) }), [rows, columns]), revision = useMemo(() => ({}), [table, rows, columns, theme, request, inlineVisibility, children]), [activeCell, setActiveCell] = useState(void 0), activeRef = useRef(activeCell);
320
+ activeRef.current = activeCell, useEffect(() => {
321
+ let selectedCell = activeRef.current?.cell;
322
+ if (!selectedCell) return;
323
+ let document2 = selectedCell.ownerDocument, view = document2.defaultView, pending, close = () => {
324
+ touch.current = void 0, setActiveCell(void 0);
325
+ }, escape = (event) => {
326
+ event.key === "Escape" && close();
327
+ }, outside = (event) => {
328
+ frameRef.current?.contains(event.target) || close();
329
+ }, update = () => {
330
+ pending === void 0 && (pending = view.requestAnimationFrame(() => {
331
+ pending = void 0;
332
+ let cell2 = activeRef.current?.cell, position = cell2 && cellPosition(cell2, target ?? frameRef.current, target, visibleIds);
333
+ setActiveCell((current) => current && position ? { ...current, ...position, revision } : void 0);
334
+ }));
335
+ };
336
+ document2.addEventListener("keydown", escape), document2.addEventListener("pointerdown", outside, !0), document2.addEventListener("pointercancel", close), view.addEventListener("scroll", update, { capture: !0, passive: !0 }), view.addEventListener("resize", update);
337
+ let observer = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(update);
338
+ return frameRef.current && observer?.observe(frameRef.current), activeRef.current?.revision !== revision && update(), document2.fonts?.addEventListener("loadingdone", update), () => {
339
+ document2.removeEventListener("keydown", escape), document2.removeEventListener("pointerdown", outside, !0), document2.removeEventListener("pointercancel", close), view.removeEventListener("scroll", update, !0), view.removeEventListener("resize", update), observer?.disconnect(), document2.fonts?.removeEventListener("loadingdone", update), pending !== void 0 && view.cancelAnimationFrame(pending);
340
+ };
341
+ }, [activeCell !== void 0, target, visibleIds, revision]);
342
+ let records = useMemo(() => {
343
+ let cached;
344
+ return () => cached ??= engine ? drawnRecords(initialPrepared?.records ?? engine.tableRecords(table, request.data, request.scope, request.options), rows, columns) : [];
345
+ }, [engine, initialPrepared, table, request.data, request.scope, request.options, rows, columns]), byCell = useMemo(() => {
346
+ let cached;
347
+ return () => cached ??= new Map(records().flatMap((record) => {
348
+ let { rowId, colId } = record.target.owner;
349
+ return rowId !== void 0 && colId !== void 0 ? [[cellKey(rowId, colId), record]] : [];
350
+ }));
351
+ }, [records]), instance = useScopedId(), active = refused || activeCell === void 0 ? void 0 : records().find((record) => record.id === activeCell.id), locale = request.locale?.language, activate = (event) => openCell(event.target, event.currentTarget, { x: event.clientX, y: event.clientY }), openCell = (from, frame, at) => {
352
+ let cell2 = from instanceof Element ? from.closest("[data-bp-row][data-bp-column]") : null, rowId = cell2?.dataset.bpRow, columnId = cell2?.dataset.bpColumn, record = rowId === void 0 || columnId === void 0 ? void 0 : byCell().get(cellKey(rowId, columnId));
353
+ if (!record || !cell2) {
354
+ setActiveCell(void 0);
355
+ return;
356
+ }
357
+ if (cell2 === activeCell?.cell) return;
358
+ let cached = activeCell?.revision === revision && activeCell.cells.get(cell2), position = cached ? { ...activeCell, anchor: cached } : cellPosition(cell2, target ?? frame, target, visibleIds), box = at ? void 0 : cell2.getBoundingClientRect(), pointer = at ?? { x: box.left + box.width / 2, y: box.top + box.height / 2 };
359
+ setActiveCell(position ? { ...position, id: record.id, cell: cell2, revision, pointer } : void 0);
360
+ }, moveTouch = (event) => {
361
+ let start = touch.current;
362
+ start && start.id === event.pointerId && Math.hypot(event.clientX - start.x, event.clientY - start.y) > 8 && (touch.current = void 0, setActiveCell(void 0));
363
+ }, owner = active?.target.owner, mark = owner?.rowId !== void 0 && owner.colId !== void 0 ? `${encodeURIComponent(owner.rowId)}:${encodeURIComponent(owner.colId)}` : void 0, cell = activeCell?.cell, row = cell?.closest('[role="row"]');
364
+ useIsomorphicLayoutEffect(() => {
365
+ if (!(!row || owner?.rowId === void 0))
366
+ return row.setAttribute("data-bp-active-row", owner.rowId), () => row.removeAttribute("data-bp-active-row");
367
+ }, [row, owner?.rowId]), useIsomorphicLayoutEffect(() => {
368
+ if (!(!cell || mark === void 0))
369
+ return cell.setAttribute("data-bp-active", mark), () => cell.removeAttribute("data-bp-active");
370
+ }, [cell, mark]);
371
+ let scope = `.bp-hover-table[data-bp-instance="${instance}"]`, rowRule = `${scope} .bp-table-grid [role="row"][data-bp-active-row]>*{background:var(--bp-hover-wash)}`, cellRule = `${scope} .bp-table-grid [data-bp-active]{background:var(--bp-band)}`, css = useMemo(() => ({ __html: ((flags.highlight ? rowRule : "") + (flags.card === "sparkline" ? cellRule : "")).replace(/</g, "\\3c ") }), [flags.highlight, flags.card, rowRule, cellRule]);
372
+ return /* @__PURE__ */ jsxs(
373
+ "div",
374
+ {
375
+ ref: frameRef,
376
+ className: "bp-hover-table",
377
+ "data-bp-hover": "",
378
+ "data-bp-instance": instance,
379
+ style: { position: "relative" },
380
+ onPointerOver: (event) => {
381
+ event.pointerType !== "touch" && activate(event);
382
+ },
383
+ onPointerDown: (event) => {
384
+ event.pointerType === "touch" && (touch.current = { id: event.pointerId, x: event.clientX, y: event.clientY });
385
+ },
386
+ onPointerMove: moveTouch,
387
+ onPointerUp: (event) => {
388
+ moveTouch(event), event.pointerType === "touch" && touch.current?.id === event.pointerId && activate(event), touch.current = void 0;
389
+ },
390
+ onPointerCancel: () => {
391
+ touch.current = void 0, setActiveCell(void 0);
392
+ },
393
+ onPointerLeave: (event) => {
394
+ event.pointerType !== "touch" && setActiveCell(void 0);
395
+ },
396
+ onFocus: (event) => openCell(event.target, event.currentTarget),
397
+ onBlur: (event) => {
398
+ (!(event.relatedTarget instanceof Node) || !event.currentTarget.contains(event.relatedTarget)) && setActiveCell(void 0);
399
+ },
400
+ children: [
401
+ /* @__PURE__ */ jsx2("style", { nonce: styleNonce, dangerouslySetInnerHTML: css }),
402
+ children,
403
+ engine && active && activeCell && flags.card !== !1 ? /* @__PURE__ */ jsx2(
404
+ engine.TableCard,
405
+ {
406
+ record: active,
407
+ width: tableWidth(table, request),
408
+ theme,
409
+ palette: request.options.palette,
410
+ locale,
411
+ measure: request.fontMetrics,
412
+ direction,
413
+ anchor: activeCell.anchor,
414
+ frame: activeCell.frame,
415
+ pointer: { x: (activeCell.pointer.x - 8) / activeCell.scale.x, y: (activeCell.pointer.y - 8) / activeCell.scale.y },
416
+ occupied: activeCell.occupied,
417
+ forbidden: activeCell.rowBounds.get(owner.rowId),
418
+ tableBounds: activeCell.tableBounds,
419
+ styleNonce,
420
+ variant: flags.card,
421
+ table,
422
+ columns,
423
+ inlineVisibility,
424
+ smallValues: request.options.smallValues,
425
+ container: target ?? frameRef.current ?? void 0,
426
+ offset: activeCell.offset
427
+ }
428
+ ) : null
429
+ ]
430
+ }
431
+ );
432
+ }
433
+
434
+ // src/react/tableGrid.ts
435
+ import {
436
+ useCallback,
437
+ useRef as useRef2,
438
+ useState as useState2
439
+ } from "react";
440
+ function columnsForRow(row, columns) {
441
+ if (row.role !== "section") return columns;
442
+ let label = columns.find((column) => column.kind === "rowLabel");
443
+ return label === void 0 ? columns.slice(0, 1) : [label];
444
+ }
445
+ function initialTableGridFocus(rows, columns) {
446
+ for (let row of rows) {
447
+ let first = columnsForRow(row, columns)[0];
448
+ if (first !== void 0) return { rowId: row.id, colId: first.id };
449
+ }
450
+ }
451
+ function retainTableGridFocus(focus, rows, columns, allRows = rows) {
452
+ if (focus === void 0) return initialTableGridFocus(rows, columns);
453
+ let row = rows.find((candidate) => candidate.id === focus.rowId);
454
+ if (row === void 0) {
455
+ let parentId = allRows.find((candidate) => candidate.id === focus.rowId)?.parentId;
456
+ for (; parentId !== void 0; ) {
457
+ let id = parentId;
458
+ if (rows.some((candidate) => candidate.id === id)) return retainTableGridFocus({ rowId: id, colId: focus.colId }, rows, columns);
459
+ parentId = allRows.find((candidate) => candidate.id === id)?.parentId;
460
+ }
461
+ return initialTableGridFocus(rows, columns);
462
+ }
463
+ let cols = columnsForRow(row, columns);
464
+ if (cols.some((column) => column.id === focus.colId)) return focus;
465
+ let order = Object.keys(row.cells), from = order.indexOf(focus.colId), visible = new Set(cols.map((column) => column.id)), fallback;
466
+ for (let distance = 1; from >= 0 && fallback === void 0 && distance < order.length; distance++)
467
+ for (let id of [order[from - distance], order[from + distance]])
468
+ if (id !== void 0 && visible.has(id)) {
469
+ fallback = cols.find((column) => column.id === id);
470
+ break;
471
+ }
472
+ return fallback ??= cols[0], fallback === void 0 ? initialTableGridFocus(rows, columns) : { rowId: row.id, colId: fallback.id };
473
+ }
474
+ function stepTableGridFocus(focus, rows, columns, key, pageRows = 1, control = !1) {
475
+ let rowIndex = rows.findIndex((row2) => row2.id === focus.rowId);
476
+ if (rowIndex < 0) return focus;
477
+ let row = rows[rowIndex], cols = columnsForRow(row, columns), colIndex = cols.findIndex((column) => column.id === focus.colId);
478
+ if (colIndex < 0) return focus;
479
+ if (control && (key === "Home" || key === "End")) {
480
+ let edge = rows[key === "Home" ? 0 : rows.length - 1], edgeCols = columnsForRow(edge, columns);
481
+ return { rowId: edge.id, colId: edgeCols[key === "Home" ? 0 : edgeCols.length - 1].id };
482
+ }
483
+ if (key === "ArrowLeft" || key === "Home") {
484
+ let next = key === "Home" ? cols[0] : cols[colIndex - 1];
485
+ return next === void 0 ? focus : { rowId: row.id, colId: next.id };
486
+ }
487
+ if (key === "ArrowRight" || key === "End") {
488
+ let next = key === "End" ? cols[cols.length - 1] : cols[colIndex + 1];
489
+ return next === void 0 ? focus : { rowId: row.id, colId: next.id };
490
+ }
491
+ if (!["ArrowUp", "ArrowDown", "PageUp", "PageDown"].includes(key)) return focus;
492
+ let distance = key.startsWith("Page") ? pageRows : 1, nextRow = rows[Math.max(0, Math.min(rows.length - 1, rowIndex + (key.endsWith("Up") ? -distance : distance)))];
493
+ if (nextRow === void 0) return focus;
494
+ let nextCols = columnsForRow(nextRow, columns), same = nextCols.find((column) => column.id === focus.colId), fallback = nextCols[0];
495
+ return same === void 0 && fallback === void 0 ? focus : { rowId: nextRow.id, colId: (same ?? fallback).id };
496
+ }
497
+ function isTableGridKey(key) {
498
+ return ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"].includes(key);
499
+ }
500
+ function cellSelector(focus) {
501
+ let key = `${encodeURIComponent(focus.rowId)}:${encodeURIComponent(focus.colId)}`;
502
+ return `[data-bp-label="${key}"],[data-bp-mark="${key}"]`;
503
+ }
504
+ function useTableGridNavigation(rows, columns, allRows = rows) {
505
+ let tableRef = useRef2(null), activeCell = useRef2(void 0), activeToggle = useRef2(!1), pending = useRef2(void 0), [focus, setFocus] = useState2(
506
+ () => initialTableGridFocus(rows, columns)
507
+ ), current = retainTableGridFocus(focus, rows, columns, allRows);
508
+ (current?.rowId !== focus?.rowId || current?.colId !== focus?.colId) && setFocus(current);
509
+ let onKeyDown = useCallback(
510
+ (event) => {
511
+ let control = event.ctrlKey || event.metaKey;
512
+ if (event.defaultPrevented || event.altKey || event.shiftKey || control && event.key !== "Home" && event.key !== "End" || !isTableGridKey(event.key) || current === void 0) return;
513
+ let from = event.target;
514
+ if (from instanceof Element && from.closest("[data-bp-row][data-bp-column]") === null) return;
515
+ let pageRows = 1;
516
+ if (event.key.startsWith("Page") && from instanceof Element) {
517
+ let scroller = from.closest(".bp-scroll"), view = from.ownerDocument.defaultView, top = 0, bottom = view.innerHeight;
518
+ for (let ancestor = scroller; ancestor; ancestor = ancestor.parentElement) {
519
+ let overflow = view.getComputedStyle(ancestor).overflowY;
520
+ if (ancestor.clientHeight <= 0 || ancestor !== scroller && (!overflow || overflow === "visible")) continue;
521
+ let box = ancestor.getBoundingClientRect(), scale = ancestor.offsetHeight > 0 ? box.height / ancestor.offsetHeight : 1, edge = box.top + ancestor.clientTop * scale;
522
+ top = Math.max(top, edge), bottom = Math.min(bottom, edge + ancestor.clientHeight * scale);
523
+ }
524
+ let rowHeight = from.closest('[role="row"]')?.getBoundingClientRect().height ?? 0, head = tableRef.current?.querySelector('[data-bp-rowgroup="head"]')?.getBoundingClientRect(), headHeight = head === void 0 ? 0 : Math.max(0, Math.min(bottom, head.bottom) - Math.max(top, head.top));
525
+ pageRows = Math.max(1, Math.floor((bottom - top - headHeight) / (rowHeight || 1)));
526
+ }
527
+ let next = stepTableGridFocus(current, rows, columns, event.key, pageRows, control), fromHeader = from instanceof Element && from.closest('[role="rowheader"]') !== null;
528
+ if (event.key === "ArrowRight" && fromHeader) {
529
+ let child = rows.find((row) => row.parentId === current.rowId);
530
+ child !== void 0 && (next = { rowId: child.id, colId: columnsForRow(child, columns)[0].id });
531
+ }
532
+ if (event.key === "ArrowLeft" && (next === current || fromHeader)) {
533
+ let parentId = rows.find((row) => row.id === current.rowId)?.parentId, parent = rows.find((row) => row.id === parentId);
534
+ parent !== void 0 && (next = { rowId: parent.id, colId: fromHeader ? current.colId : columnsForRow(parent, columns)[0].id });
535
+ }
536
+ event.preventDefault(), setFocus(next);
537
+ let node = tableRef.current?.querySelector(cellSelector(next));
538
+ node instanceof HTMLElement ? node.focus() : pending.current = next;
539
+ },
540
+ [columns, current, rows]
541
+ );
542
+ useIsomorphicLayoutEffect(() => {
543
+ let queued = pending.current, active = activeCell.current, folded = queued === void 0 && active !== void 0 && current !== void 0 && active.getAttribute("data-bp-row") !== current.rowId && (active.isConnected ? active.contains(document.activeElement) : document.activeElement === document.body) && !rows.some((row) => row.id === active.getAttribute("data-bp-row")), next = queued ?? (folded || active !== void 0 && !active.isConnected && document.activeElement === document.body ? current : void 0);
544
+ if (next === void 0) return;
545
+ pending.current = void 0;
546
+ let node = tableRef.current?.querySelector(cellSelector(next)), target = (folded && activeToggle.current ? node?.querySelector("[data-bp-toggle-row]") : null) ?? node;
547
+ target instanceof HTMLElement && target.focus({ preventScroll: queued === void 0 && !folded });
548
+ });
549
+ let onFocusCapture = useCallback((event) => {
550
+ activeCell.current = void 0;
551
+ let target = event.target;
552
+ if (!(target instanceof Element)) return;
553
+ let cell = target.closest("[data-bp-row][data-bp-column]"), rowId = cell?.getAttribute("data-bp-row"), colId = cell?.getAttribute("data-bp-column");
554
+ rowId == null || colId === null || colId === void 0 || (activeCell.current = cell ?? void 0, activeToggle.current = target.closest("[data-bp-toggle-row]") !== null, setFocus(
555
+ (prev) => prev?.rowId === rowId && prev.colId === colId ? prev : { rowId, colId }
556
+ ));
557
+ }, []), onBlurCapture = useCallback((event) => {
558
+ (!(event.relatedTarget instanceof Node) || !event.currentTarget.contains(event.relatedTarget)) && (activeCell.current = void 0);
559
+ }, []);
560
+ return { focus: current, tableRef, onKeyDown, onFocusCapture, onBlurCapture };
561
+ }
562
+
563
+ // src/react/TableChart.tsx
564
+ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
565
+ var WINDOW_COLUMNS = 40, WINDOW_BLOCK = 8, ROW_PAGE = 64, LITE_BLOCK = 32;
566
+ function isColumnSort(value) {
567
+ return typeof value == "object" && value !== null && "column" in value;
568
+ }
569
+ function eventColumn(event) {
570
+ let cell = event.target instanceof Element ? event.target.closest("[data-bp-column]") : null;
571
+ return cell !== null && event.currentTarget.contains(cell) ? cell.getAttribute("data-bp-column") ?? void 0 : void 0;
572
+ }
573
+ var styleRegistry = /* @__PURE__ */ new WeakMap(), SAFE_HREF = /^(?:https?:\/\/|mailto:|#)/i;
574
+ function encodeStructuralIds(ids) {
575
+ return `${ids.length}:${ids.map((id) => `${id.length}:${id}`).join("")}`;
576
+ }
577
+ var TableFloorRequestContext = createContext(void 0), measureContext, measuredWidths = /* @__PURE__ */ new Map(), measuredDigits = /* @__PURE__ */ new Map(), noSubscription = () => () => {
578
+ };
579
+ function canvasTextWidth() {
580
+ if (typeof document > "u" || typeof HTMLCanvasElement > "u" || document.fonts === void 0) return;
581
+ try {
582
+ measureContext ??= document.createElement("canvas").getContext("2d") ?? void 0;
583
+ } catch {
584
+ return;
585
+ }
586
+ let context = measureContext;
587
+ if (context === void 0 || typeof context.measureText != "function") return;
588
+ let cache = measuredWidths, digits = measuredDigits;
589
+ return cache.size > 5e4 && cache.clear(), (text, font) => {
590
+ let face = `${font.weight ?? 400} ${font.size}px ${font.family ?? "sans-serif"}`, key = `${face}\0${font.letterSpacing ?? 0}\0${font.tabular === !0}\0${text}`, hit = cache.get(key);
591
+ if (hit !== void 0) return hit;
592
+ context.font = face;
593
+ let width = context.measureText(text).width + (font.letterSpacing ?? 0) * Math.max(0, text.length - 1);
594
+ if (font.tabular === !0 && /[0-9]/.test(text)) {
595
+ let advances = digits.get(face);
596
+ advances === void 0 && (advances = [..."0123456789"].map((digit) => context.measureText(digit).width), digits.set(face, advances));
597
+ let widest = Math.max(...advances);
598
+ for (let character of text)
599
+ character >= "0" && character <= "9" && (width += widest - advances[character.charCodeAt(0) - 48]);
600
+ }
601
+ return cache.set(key, width), width;
602
+ };
603
+ }
604
+ function canvasWidthsMoved() {
605
+ let context = measureContext;
606
+ if (context === void 0 || measuredWidths.size === 0) return !0;
607
+ let step = Math.max(1, Math.floor(measuredWidths.size / 64)), index = 0;
608
+ for (let [key, width] of measuredWidths) {
609
+ if (index++ % step !== 0) continue;
610
+ let [face, spacing, tabular, text] = key.split("\0");
611
+ context.font = face;
612
+ let fresh = context.measureText(text).width + Number(spacing) * Math.max(0, text.length - 1);
613
+ if (tabular === "true" && /[0-9]/.test(text)) {
614
+ let advances = [..."0123456789"].map((digit) => context.measureText(digit).width), widest = Math.max(...advances);
615
+ for (let character of text) character >= "0" && character <= "9" && (fresh += widest - advances[character.charCodeAt(0) - 48]);
616
+ }
617
+ if (Math.abs(fresh - width) > 0.01) return !0;
618
+ }
619
+ return !1;
620
+ }
621
+ function useWidthMeasure(base, enabled) {
622
+ let [swap, setSwap] = useState3(0), hydrated = useSyncExternalStore(noSubscription, () => !0, () => !1);
623
+ return useEffect2(() => {
624
+ if (!enabled) return;
625
+ let fonts = document.fonts;
626
+ if (fonts?.ready === void 0) return;
627
+ let active = !0, remeasure = () => {
628
+ !active || !canvasWidthsMoved() || (measuredWidths.clear(), measuredDigits.clear(), setSwap((previous) => previous + 1));
629
+ };
630
+ return fonts.ready.then(remeasure), fonts.addEventListener?.("loadingdone", remeasure), () => {
631
+ active = !1, fonts.removeEventListener?.("loadingdone", remeasure);
632
+ };
633
+ }, [enabled]), useMemo2(() => {
634
+ let browser = enabled && hydrated ? canvasTextWidth() : void 0;
635
+ return browser === void 0 ? { measure: base, browser: !1 } : {
636
+ browser: !0,
637
+ measure: (text, font) => {
638
+ let metric = base(text, font), drawn = browser(text, font);
639
+ return drawn > metric.width ? { ...metric, width: drawn } : metric;
640
+ }
641
+ };
642
+ }, [base, enabled, hydrated, swap]);
643
+ }
644
+ function columnVisibilityDefaults(table, authored) {
645
+ return {
646
+ ...Object.fromEntries(table.columnToggles.map((toggle) => [toggle.id, toggle.visible])),
647
+ ...authored
648
+ };
649
+ }
650
+ function createTableChart(checkKeys, linked) {
651
+ function TableChart3(props) {
652
+ let { rows, columns, onRowsReading, ...table } = props, gate = useRowsGate({ type: "table", data: table.data }, { rows, columns, onRowsReading }, table);
653
+ return gate.element ?? /* @__PURE__ */ jsx3(DrawnTable, { table: { ...table, data: gate.data }, checkKeys, linked });
654
+ }
655
+ return TableChart3.displayName = "TableChart", TableChart3.chartType = "table", rebindable(TableChart3, (relinked) => createTableChart(checkKeys, relinked)), TableChart3;
656
+ }
657
+ var TableChart = createTableChart();
658
+ function DrawnTable({ table: props, checkKeys, linked }) {
659
+ let compiledRequest = useContext(TableFloorRequestContext), originalFloorRequest = compiledRequest?.request, {
660
+ data,
661
+ collapsed: controlledCollapsed,
662
+ defaultCollapsed,
663
+ onCollapsedChange,
664
+ onExpansionChange,
665
+ columnVisibility: controlledColumnVisibility,
666
+ defaultColumnVisibility,
667
+ onColumnVisibilityChange,
668
+ inlineVisibility: controlledInlineVisibility,
669
+ defaultInlineVisibility,
670
+ onInlineVisibilityChange,
671
+ sortable: authoredSortable = !1,
672
+ sort: controlledSort,
673
+ defaultSort,
674
+ onSortChange,
675
+ rootsHidden: controlledRootsHidden,
676
+ measureWidths = "browser",
677
+ stickyLabels = !1,
678
+ toolbar = !0,
679
+ target,
680
+ onWarnings,
681
+ size,
682
+ fit = "content",
683
+ fallbackSize,
684
+ prepared,
685
+ scope,
686
+ fontMetrics,
687
+ styleNonce,
688
+ idPrefix,
689
+ onRefused,
690
+ renderRefused,
691
+ hover,
692
+ onScrollChange,
693
+ handleRef,
694
+ onContentWidth,
695
+ fillHeight = !1,
696
+ rowLabelLead,
697
+ portalContainer,
698
+ onRowSelect: authoredRowSelect,
699
+ interactions = !0,
700
+ foldOn,
701
+ onFormatsFit,
702
+ onEmpty,
703
+ isRowSelectable,
704
+ exporter,
705
+ ...options
706
+ } = props, widthOptions = compiledRequest?.options ?? options, softLabelCap = widthOptions[SOFT_LABEL_CAP] === !0, labelWrapFloor = widthOptions[LABEL_WRAP_FLOOR] === !0, onRowSelect = interactions ? authoredRowSelect : void 0, sortable = interactions ? authoredSortable : !1, flags = hoverFlags(hover), container = useContainerSize({ size, target, fit, fallbackSize, needsHeight: fillHeight }), [scrollWidth, setScrollWidth] = useState3(), resolvedSize = size === "container" ? container.size : size, stableSize = useStableValue(typeof resolvedSize == "object" ? resolvedSize : {}), authoredTableOptions = {
707
+ ...options,
708
+ // An authored sibling order goes back into the options the core resolves;
709
+ // a column sort is reader state and never reaches resolveTable.
710
+ ...controlledSort == null || isColumnSort(controlledSort) ? {} : { sort: controlledSort },
711
+ ...resolvedSize === void 0 ? {} : { size: typeof resolvedSize == "object" ? stableSize : resolvedSize },
712
+ ...controlledColumnVisibility === void 0 ? {} : { columnVisibility: controlledColumnVisibility },
713
+ ...controlledInlineVisibility === void 0 ? {} : { inlineVisibility: controlledInlineVisibility }
714
+ }, stableOptions = useStableValue(
715
+ authoredTableOptions
716
+ ), { request, layoutRequest: fullLayoutRequest, provider, deferred } = useResolvedChartRequest({ type: "table", data, target, options: stableOptions, scope, fontMetrics }, {}, prepared, linked), { inlineVisibility: _inlineVisibility, ...valueOptions } = fullLayoutRequest?.options ?? {}, valueContext = useStableValue(fullLayoutRequest === void 0 ? void 0 : { ...fullLayoutRequest, data: void 0, options: valueOptions }), layoutRequest = useMemo2(() => valueContext === void 0 ? void 0 : { ...valueContext, data: fullLayoutRequest.data }, [valueContext, fullLayoutRequest?.data]), refusedProps = optionRefusals(stableOptions, "table", checkKeys, provider?.strings), failure = useDeferredModule(deferred), tableOptions = layoutRequest?.options, initialPrepared = usePrepared(prepared, fullLayoutRequest, "table", size === "container" ? fit : void 0), { size: _resolveSize, ...sizeFreeOptions } = tableOptions ?? {}, resolveKey = useStableValue(tableOptions === void 0 ? void 0 : sizeFreeOptions), resolved = useMemo2(() => !layoutRequest || !tableOptions ? void 0 : initialPrepared ? { table: { ...initialPrepared.table, provenance: {} }, warnings: initialPrepared.warnings ?? [] } : resolveTable(layoutRequest.data, tableOptions), [layoutRequest?.data, resolveKey, initialPrepared]), rootsHidden = controlledRootsHidden ?? (resolved === void 0 ? !1 : expansionRootsHidden(resolved.table, tableOptions?.expansion)), colorblindSafe = tableOptions?.colorblindSafe === !0, [freshMount] = useState3(useSyncExternalStore(noSubscription, () => !0, () => !1)), waitsForWidth = container.waiting, theme = useStableValue(useMemo2(
717
+ () => request && !waitsForWidth ? tableRenderTheme(request) : void 0,
718
+ [request?.theme, request?.target, request?.size.width, tableOptions, waitsForWidth]
719
+ )), colorblindWarnings = useMemo2(() => colorblindSafe && layoutRequest && tableOptions ? tableCore.layout(layoutRequest.data, tableOptions).warnings.filter((warning) => warning.code === "table-colorblind-safe-unused") : [], [layoutRequest, colorblindSafe]), metricMeasure = request?.fontMetrics ?? defaultMeasurer, width = useWidthMeasure(metricMeasure, measureWidths === "browser"), statement = resolved?.table.rows.some((row) => row.sign === -1 || row.operator !== void 0 || row.kind === "subtotal" || row.kind === "result" || row.kind === "driver") ?? !1, cohort = tableOptions?.density?.startsWith("cohort") ?? !1, stylesheet = useMemo2(() => theme && tableStylesheet(theme, request?.target, statement, cohort, typeof stickyLabels == "object", textScaleOf(request?.options), tableOptions?.palette), [theme, request?.target, request?.options.textScale, request?.options.textSize, statement, cohort, typeof stickyLabels == "object", tableOptions?.palette]), themeScope = stylesheet === void 0 ? "" : stylesheetHash(stylesheet), floorRevision = useDeferredRevision(), floorAttempt = useMemo2(() => !fullLayoutRequest || !belowTableViewportFloor(fullLayoutRequest.options.size) ? {} : floorRevision === 0 ? asFirstFrame(linked ?? [], attemptFloor) : attemptFloor(), [fullLayoutRequest, originalFloorRequest, provider, scope, fontMetrics, floorRevision, size, container.pinnedHeight, data, target, stableOptions, linked]);
720
+ function attemptFloor() {
721
+ if (!fullLayoutRequest) return {};
722
+ try {
723
+ let openHeight = size === "container" && !container.pinnedHeight, floorRequest = originalFloorRequest === void 0 && !openHeight ? fullLayoutRequest : (provider?.resolve ?? resolveChartRequest)({
724
+ ...originalFloorRequest ?? { type: "table", data, target, options: stableOptions },
725
+ size: openHeight ? { width: fullLayoutRequest.size.width } : fullLayoutRequest.options.size,
726
+ scope,
727
+ fontMetrics
728
+ }, provider ?? {});
729
+ return { result: measureResolvedRequest(floorRequest).refused };
730
+ } catch (error) {
731
+ if (!(error instanceof DeferredCoreError)) throw error;
732
+ return { deferred: error.module };
733
+ }
734
+ }
735
+ let sized = floorAttempt.result, settling = useRefusalSettle(
736
+ size === "container" && sized !== void 0 && chartRefusals(sized.warnings).every(isSizeDependentRefusal),
737
+ container.client,
738
+ `${container.size.width}x${container.size.height ?? ""}`,
739
+ sized
740
+ ), floorFailure = useDeferredModule(floorAttempt.deferred), initialCollapsed = () => defaultCollapsed ?? (resolved ? [...collapsedByDefault(resolved.table)] : []), initialColumnVisibility = () => resolved ? columnVisibilityDefaults(resolved.table, defaultColumnVisibility) : {}, initialInlineVisibility = () => ({
741
+ ...options.inlineVisibility,
742
+ ...defaultInlineVisibility
743
+ }), isSortControlled = controlledSort === null || isColumnSort(controlledSort), [uncontrolledCollapsed, setUncontrolledCollapsed] = useState3(initialCollapsed), [uncontrolledColumnVisibility, setUncontrolledColumnVisibility] = useState3(initialColumnVisibility), [uncontrolledInlineVisibility, setUncontrolledInlineVisibility] = useState3(initialInlineVisibility), inlineVisibility = controlledInlineVisibility !== void 0 ? controlledInlineVisibility : uncontrolledInlineVisibility, [uncontrolledSort, setUncontrolledSort] = useState3(defaultSort ?? null), structureKey = useMemo2(
744
+ () => resolved === void 0 ? "" : encodeStructuralIds(resolved.table.rows.map((row) => row.id)) + encodeStructuralIds(resolved.table.columns.map((column) => column.id)) + encodeStructuralIds(resolved.table.columnToggles.map((toggle) => toggle.id)),
745
+ [resolved?.table]
746
+ ), expansionKey = resolved === void 0 ? void 0 : JSON.stringify(tableOptions?.expansion ?? null), [seenExpansionKey, setSeenExpansionKey] = useState3(expansionKey);
747
+ expansionKey !== void 0 && seenExpansionKey !== expansionKey && (setSeenExpansionKey(expansionKey), seenExpansionKey !== void 0 && setUncontrolledCollapsed([...collapsedByDefault(resolved.table)]));
748
+ let [seenStructureKey, setSeenStructureKey] = useState3(structureKey);
749
+ seenStructureKey !== structureKey && (setSeenStructureKey(structureKey), setUncontrolledCollapsed(initialCollapsed()), setUncontrolledColumnVisibility(initialColumnVisibility()), setUncontrolledInlineVisibility(initialInlineVisibility()), setUncontrolledSort(defaultSort ?? null));
750
+ let isColumnVisibilityControlled = controlledColumnVisibility !== void 0, currentColumnVisibility = isColumnVisibilityControlled ? controlledColumnVisibility : uncontrolledColumnVisibility, columnVisibility = useMemo2(
751
+ () => Object.fromEntries(
752
+ (resolved?.table.columnToggles ?? []).map((toggle) => [
753
+ toggle.id,
754
+ currentColumnVisibility[toggle.id] ?? toggle.visible
755
+ ])
756
+ ),
757
+ [currentColumnVisibility, resolved?.table.columnToggles]
758
+ ), fitResult = useMemo2(() => {
759
+ if (resolved === void 0 || layoutRequest === void 0 || theme === void 0 || tableOptions?.fitFormats !== !0) return;
760
+ let ladder = levelLadder(theme, tableOptions.density ?? "regular", request?.target, textScaleOf(request?.options)), fonts = tableFonts(theme, ladder), rowById = new Map(resolved.table.rows.map((row) => [row.id, row])), fitChanges = new Set(resolved.table.rows.filter((row) => visibleInlineRows(row, inlineVisibility).length > 0).map((row) => row.id)), drawnColumns = (candidate) => visibleColumns(candidate, columnVisibility);
761
+ return fitTableFormats(layoutRequest.data, tableOptions, resolved, drawnColumns, {
762
+ measure: width.measure,
763
+ padX: tableOptions.cellPadX ?? cellPadX(drawnColumns(resolved.table).length),
764
+ cellFont: (cell) => {
765
+ let row = rowById.get(cell.rowId);
766
+ return kindFont(rowFont(theme, ladder, fonts, cell.role, row?.step ?? cell.level, row?.hasChildren === !0, fitChanges.has(cell.rowId)), row?.kind, cell.kind === "rowLabel", theme);
767
+ },
768
+ ...width.browser ? {} : { slack: browserSlack },
769
+ figures: (column, text) => cellDrawsTabular(theme, column.kind, text),
770
+ lineFont: (parent, line, text, tabular) => changeLineFitFont(theme, ladder, parent.step, line.polarity !== void 0, text, width.measure, tabular, width.browser ? void 0 : browserSlack),
771
+ ...tableOptions.locale?.decimal === void 0 ? {} : { decimal: tableOptions.locale.decimal }
772
+ });
773
+ }, [resolved, layoutRequest?.data, theme, resolveKey, columnVisibility, inlineVisibility, width]), fitted = useMemo2(
774
+ () => fitResult === void 0 || resolved === void 0 ? resolved : { table: { ...fitResult.resolved.table, provenance: resolved.table.provenance } },
775
+ [fitResult, resolved]
776
+ ), formatChanges = fitResult?.changes, formatsListener = useRef3(onFormatsFit);
777
+ formatsListener.current = onFormatsFit;
778
+ let formatsKey = useRef3(void 0);
779
+ useEffect2(() => {
780
+ let key = JSON.stringify(formatChanges ?? []);
781
+ if (formatsKey.current === key) return;
782
+ let first = formatsKey.current === void 0;
783
+ formatsKey.current = key, !(first && (formatChanges?.length ?? 0) === 0) && formatsListener.current?.(formatChanges ?? []);
784
+ }, [formatChanges]);
785
+ let fittedNote = useMemo2(() => formatsFittedWarning(formatChanges ?? []), [formatChanges]), sort = isSortControlled ? isColumnSort(controlledSort) ? controlledSort : null : uncontrolledSort, sortedTable = useMemo2(() => {
786
+ if (fitted === void 0) return;
787
+ let sorted = sortRows(fitted.table, sort, request?.locale?.language);
788
+ return sorted === fitted.table.rows ? fitted.table : { ...fitted.table, rows: sorted };
789
+ }, [fitted?.table, sort, request?.locale?.language]), isEmpty = sortedTable !== void 0 && hasNoDataRows(sortedTable), emptyText = provider?.strings?.emptyMessage ?? DEFAULT_EMPTY_MESSAGE, table = useMemo2(
790
+ () => sortedTable !== void 0 && isEmpty ? { ...sortedTable, rows: [...sortedTable.rows, emptyMessageRow(sortedTable, emptyText)] } : sortedTable,
791
+ [sortedTable, isEmpty, emptyText]
792
+ ), emptyListener = useRef3(onEmpty);
793
+ emptyListener.current = onEmpty;
794
+ let emptyNotified = useRef3(!1);
795
+ useEffect2(() => {
796
+ if (!isEmpty) {
797
+ emptyNotified.current = !1;
798
+ return;
799
+ }
800
+ emptyNotified.current || (emptyNotified.current = !0, emptyListener.current?.());
801
+ }, [isEmpty]);
802
+ let sortableIds = useMemo2(
803
+ () => table ? sortableColumnIds(table, sortable) : /* @__PURE__ */ new Set(),
804
+ [table, sortable]
805
+ ), isCollapsedControlled = controlledCollapsed !== void 0, readOnlyTree = isCollapsedControlled && onCollapsedChange === void 0 || !interactions, collapsed = isCollapsedControlled ? controlledCollapsed : uncontrolledCollapsed, collapsedSet = useMemo2(() => {
806
+ let fixed = new Set((table?.rows ?? []).filter((row) => row.foldable === !1).map((row) => row.id));
807
+ return new Set(collapsed.filter((id) => !fixed.has(id)));
808
+ }, [collapsed, table]), rows = useMemo2(
809
+ () => table ? visibleRows(table, collapsedSet, rootsHidden) : [],
810
+ [table, collapsedSet, rootsHidden]
811
+ ), closers = useMemo2(() => finalClosers(rows), [rows]), columns = useMemo2(
812
+ () => table ? visibleColumns(table, columnVisibility) : [],
813
+ [table, columnVisibility]
814
+ ), spans = useMemo2(
815
+ () => table ? groupSpans(table, columns) : [],
816
+ [table, columns]
817
+ ), groupMarks = useMemo2(() => {
818
+ let banded = /* @__PURE__ */ new Set(), groupStart = /* @__PURE__ */ new Set(), groundsOnly = new Set(
819
+ printsFigures(tableOptions?.figures, columns) ? [] : columns.filter(heatColumn).map((column) => column.id)
820
+ ), divided = !1, groupEnd = /* @__PURE__ */ new Set(), groupRowStart = /* @__PURE__ */ new Set();
821
+ if (!table) return { banded, groupStart, groupEnd, groupRowStart, groundsOnly, divided };
822
+ let drawn = new Set(columns.map((column) => column.id));
823
+ table.columnGroups.forEach((group, index) => {
824
+ let visible = group.columnIds.filter((columnId) => drawn.has(columnId));
825
+ if (visible.length !== 0) {
826
+ if (group.band === !0) for (let columnId of visible) banded.add(columnId);
827
+ index > 0 && columns[0]?.id !== visible[0] && (groupStart.add(visible[0]), (group.spacer ?? 0) <= 0 && (divided = !0));
828
+ }
829
+ }), columns.forEach((column, index) => {
830
+ column.band === !0 && (banded.add(column.id), index > 0 && columns[index - 1]?.band !== !0 && (groupStart.add(column.id), divided = !0));
831
+ });
832
+ let blocks = [];
833
+ for (let group of table.columnGroups) {
834
+ if (group.band !== !0) continue;
835
+ let lastIndex = columns.reduce((last, column, index) => group.columnIds.includes(column.id) ? index : last, -1);
836
+ lastIndex >= 0 && blocks.push({ lastIndex, group: !0 });
837
+ }
838
+ columns.forEach((column, index) => {
839
+ column.band === !0 && columns[index + 1]?.band !== !0 && blocks.push({ lastIndex: index, group: !1 });
840
+ });
841
+ for (let { lastIndex, group } of blocks) {
842
+ let next = columns[lastIndex + 1];
843
+ if (next === void 0) {
844
+ tableOptions?.rowExtent === "frame" && (groupEnd.add(columns[lastIndex].id), divided = !0);
845
+ continue;
846
+ }
847
+ let nextGroup = table.columnGroups.find((candidate) => candidate.columnIds.includes(next.id));
848
+ nextGroup && (nextGroup.spacer ?? 0) > 0 && nextGroup.columnIds.find((id) => columns.some((column) => column.id === id)) === next.id || (groupStart.add(next.id), group && next.groupId === void 0 && groupRowStart.add(next.id), divided = !0);
849
+ }
850
+ return { banded, groupStart, groupEnd, groupRowStart, groundsOnly, divided };
851
+ }, [table, columns, tableOptions?.figures, tableOptions?.rowExtent]), density = tableOptions?.density ?? "regular", sticky = stickySettings(stickyLabels), stickyCount = sticky.columns, pageHead = sticky.head === "page", figures = printsFigures(tableOptions?.figures, columns), grid = useTableGridNavigation(rows, columns, table?.rows), summaryId = `bp-table-summary-${useScopedId(checkedIdPrefix(idPrefix))}`, allColumns = table?.columns ?? [], windowed = allColumns.length > WINDOW_COLUMNS, rowWindowed = useMemo2(
852
+ () => freshMount && typeof IntersectionObserver < "u" && !windowed && !sticky.sections && rowLabelLead === void 0 && rows.length > 500 && allColumns.every((column) => (column.kind === "rowLabel" || column.kind === "value" || column.kind === "computed") && !column.wrap && !(column.kind === "rowLabel" && tableOptions?.rowLabelLines !== 1 && (column.width !== void 0 || column.maxWidth !== void 0 || column.maxTextWidth !== void 0)) && (column.cellEncoding === void 0 || column.cellEncoding.type === "inCellBar")) && rows.every((row) => !row.hasChildren && !row.inlineRows?.length && row.role === "data" && row.unitAffix === void 0 && row.operator === void 0 && Object.values(row.cells).every((cell) => cell.note === void 0 && cell.href === void 0)),
853
+ [freshMount, windowed, sticky.sections, rowLabelLead, rows, allColumns, tableOptions?.rowLabelLines]
854
+ ), containRowPages = useMemo2(
855
+ () => rowWindowed && figures && rows.every((row) => row.step === 0 && row.kind === void 0 && row.spacer === void 0 && !row.divider && allColumns.some((column) => column.kind === "rowLabel" && row.cells[column.id]?.displayed !== "")),
856
+ [rowWindowed, figures, rows, allColumns]
857
+ );
858
+ useIsomorphicLayoutEffect(() => {
859
+ if (!containRowPages) return;
860
+ let body = grid.tableRef.current?.querySelector('[data-bp-rowgroup="body"]'), sample = body?.querySelectorAll('[data-bp-row-page="0"] [role="row"]')[1];
861
+ if (!body || !sample) return;
862
+ let measure = () => {
863
+ let height = parseFloat(getComputedStyle(sample).height);
864
+ if (!(height > 0)) return;
865
+ let second = body.querySelector('[data-bp-row-page="1"]');
866
+ if (second !== null && Math.abs(parseFloat(getComputedStyle(second).blockSize) - height * ROW_PAGE) < 0.01) return;
867
+ let pitch = `${height}px`;
868
+ body.style.getPropertyValue("--bp-row-pitch") !== pitch && body.style.setProperty("--bp-row-pitch", pitch);
869
+ };
870
+ measure();
871
+ let observer = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(measure);
872
+ return observer?.observe(sample), () => observer?.disconnect();
873
+ }, [containRowPages, grid.tableRef, rows]);
874
+ let hiddenColumns = useMemo2(() => {
875
+ let drawn = new Set(columns.map((column) => column.id));
876
+ return new Set(allColumns.filter((column) => !drawn.has(column.id)).map((column) => column.id));
877
+ }, [allColumns, columns]), margin = tableOptions === void 0 ? void 0 : resolveCanvasOptions(tableOptions).margin, marginLeft = margin?.left ?? 0, marginRight = margin?.right ?? 0, frameReach = tableOptions?.rowExtent === "frame" ? Math.max(0, marginRight) : 0, frameStart = tableOptions?.rowExtent === "frame" ? Math.max(0, marginLeft) : 0, rowToFrame = (tableOptions?.rowExtent ?? "frame") === "frame", available = useMemo2(() => {
878
+ if (size === "container") return container.size === void 0 ? void 0 : container.size.width - marginLeft - marginRight;
879
+ if (size === void 0 || theme === void 0) return;
880
+ let frameWidth = resolveSize(size).width, sides = { ...canvasMargin(theme, frameWidth), ...margin };
881
+ return frameWidth - sides.left - sides.right;
882
+ }, [size, container.size?.width, theme, margin, marginLeft, marginRight]), measured = useMemo2(() => table && theme ? tableWidths(table, theme, width.measure, {
883
+ ...tableOptions,
884
+ density,
885
+ target: request?.target,
886
+ inlineVisibility,
887
+ [SOFT_LABEL_CAP]: softLabelCap,
888
+ [LABEL_WRAP_FLOOR]: labelWrapFloor
889
+ }, {
890
+ columns,
891
+ allColumns,
892
+ rows,
893
+ available,
894
+ frameStart,
895
+ scroll: !0,
896
+ withMarks: !readOnlyTree || tableOptions?.outlineMarks === !0,
897
+ sortable: sortableIds,
898
+ leadWidth: rowLabelLead?.width,
899
+ trailingTracking: !0,
900
+ groupStart: groupMarks.groupStart,
901
+ groupEnd: groupMarks.groupEnd,
902
+ slack: width.browser ? void 0 : browserSlack,
903
+ fit: size === "container" ? fit : void 0
904
+ }) : void 0, [
905
+ table,
906
+ theme,
907
+ width,
908
+ tableOptions,
909
+ density,
910
+ request?.target,
911
+ inlineVisibility,
912
+ softLabelCap,
913
+ labelWrapFloor,
914
+ columns,
915
+ allColumns,
916
+ rows,
917
+ available,
918
+ frameStart,
919
+ readOnlyTree,
920
+ sortableIds,
921
+ rowLabelLead?.width,
922
+ groupMarks,
923
+ size,
924
+ fit
925
+ ]), padX = measured?.cellPadX ?? 12, indents = measured?.indents ?? { base: 0, step: 16 }, operatorSlot = measured?.operatorSlot ?? 0, tracks = measured?.tracks ?? [], spacerWidths = measured?.spacerBefore ?? /* @__PURE__ */ new Map(), labelsWrap = measured?.labelsWrap ?? !1, diagnostics = useMemo2(() => layoutRequest && resolved ? {
926
+ warnings: [...resolved.warnings, ...layoutRequest.inputWarnings ?? [], ...fittedNote === void 0 ? [] : [fittedNote], ...colorblindWarnings, ...measured?.warnings ?? [], ...sized?.warnings ?? []],
927
+ presentation: initialPrepared?.presentation ?? tablePresentation(layoutRequest, resolved.table),
928
+ refused: sized?.refused
929
+ } : void 0, [layoutRequest, resolved, initialPrepared, sized, colorblindWarnings, fittedNote, measured?.warnings]), displayRef = useDisplayWarnings(settling ? void 0 : diagnostics, onWarnings, null), headFonts = measured?.fonts, frameRoom = !rowToFrame || tableOptions?.frameFill === "none" || available === void 0 ? void 0 : available - (measured?.spacerTotal ?? 0), reachFrame = rowToFrame && !(tableOptions?.rowExtent === void 0 && frameRoom !== void 0 && Math.floor(frameRoom - trackTotal(tracks)) >= 1), gridTracks = measured?.gridTracks ?? [], trackColumn = useMemo2(() => {
930
+ if (spacerWidths.size === 0 && !windowed) return;
931
+ let index = /* @__PURE__ */ new Map();
932
+ return gridTracks.forEach((track, position) => {
933
+ track.id.startsWith("bp-spacer:") || index.set(track.id, position + 1);
934
+ }), index;
935
+ }, [gridTracks, spacerWidths, windowed]), pinned = useMemo2(() => pinnedColumns(
936
+ allColumns.filter((column) => !hiddenColumns.has(column.id)),
937
+ gridTracks,
938
+ stickyCount,
939
+ scrollWidth ?? (container.ready ? container.size.width : void 0)
940
+ ), [stickyCount, gridTracks, allColumns, hiddenColumns, scrollWidth, container.ready, container.size.width]), pinEnd = useMemo2(() => {
941
+ let widths = new Map(gridTracks.map((track) => [track.id, track.width])), end = 0;
942
+ for (let [id, pin] of pinned) pin.last && (end = pin.left + (widths.get(`bp-spacer:${id}`) ?? 0) + (widths.get(id) ?? 0));
943
+ return end;
944
+ }, [pinned, gridTracks]), wideGroups = useMemo2(() => {
945
+ let wide = /* @__PURE__ */ new Set(), box = scrollWidth ?? (container.ready ? container.size.width : void 0), room = box === void 0 ? void 0 : box - pinEnd;
946
+ if (room === void 0 || room <= 0) return wide;
947
+ let widths = new Map(gridTracks.map((track) => [track.id, track.width])), groupWidths = /* @__PURE__ */ new Map();
948
+ for (let column of allColumns) {
949
+ if (column.groupId === void 0 || hiddenColumns.has(column.id)) continue;
950
+ let before = groupWidths.get(column.groupId);
951
+ groupWidths.set(column.groupId, (before ?? 0) + (widths.get(column.id) ?? 0) + (before === void 0 ? 0 : widths.get(`bp-spacer:${column.id}`) ?? 0));
952
+ }
953
+ for (let [id, width2] of groupWidths) width2 > room + 0.5 && wide.add(id);
954
+ return wide;
955
+ }, [allColumns, gridTracks, hiddenColumns, scrollWidth, container.ready, container.size.width, pinEnd]), columnEdges = useMemo2(() => {
956
+ let width2 = new Map(gridTracks.map((track) => [track.id, track.width])), left = /* @__PURE__ */ new Map(), x = 0;
957
+ for (let column of allColumns)
958
+ hiddenColumns.has(column.id) || (x += width2.get(`bp-spacer:${column.id}`) ?? 0, left.set(column.id, x), x += width2.get(column.id) ?? 0);
959
+ return { left, groupStart: [...groupMarks.groupStart].filter((id) => left.has(id) && !((width2.get(`bp-spacer:${id}`) ?? 0) > 0)) };
960
+ }, [gridTracks, allColumns, hiddenColumns, groupMarks]), gridStyle = useMemo2(() => ({
961
+ // Under 'frame' the empty track is at least the right margin wide.
962
+ // The scroll box reaches through the margin, so a grid whose
963
+ // natural width left the margin out gave a card that sizes itself to
964
+ // its content (`width: max-content`) no room for it: the card shrank by
965
+ // the margin and the last column met its edge.
966
+ "--bp-cols": reachFrame ? `${trackTemplate(gridTracks)} minmax(${frameReach > 0 ? `${frameReach}px` : 0},1fr)` : trackTemplate(gridTracks),
967
+ // The table is exactly as wide as the columns it draws; room a capped
968
+ // fill did not use stays to the right of it.
969
+ "--bp-table-width": reachFrame ? `max(${Math.round((trackTotal(gridTracks) + frameReach) * 10) / 10}px, 100%)` : `${trackTotal(gridTracks)}px`,
970
+ // Print has no animation to protect, so the tracks may be proportional
971
+ // and the table takes the page width.
972
+ "--bp-cols-print": `${gridTracks.map((track) => track.width === 0 ? "0px" : `${track.natural}fr`).join(" ")}${reachFrame ? " 0px" : ""}`,
973
+ "--bp-cell-pad-x": `${padX}px`,
974
+ ...frameStart > 0 ? { "--bp-reach-pad-x": `${padX + frameStart}px`, "--bp-pad-x-base": `${padX}px` } : {},
975
+ // Use the same label ladder for track measurement and CSS padding.
976
+ "--bp-indent-base": `${indents.base}px`,
977
+ "--bp-indent-step": `${indents.step}px`,
978
+ ...headFonts === void 0 ? {} : headVars(headFonts)
979
+ }), [gridTracks, padX, headFonts, reachFrame, frameReach, frameStart, indents]), reachEnd = reachFrame && marginRight > 0 ? marginRight : 0, scrollStyle = frameStart + reachEnd > 0 ? {
980
+ ...frameStart > 0 ? { marginInlineStart: -frameStart } : {},
981
+ ...reachEnd > 0 ? { marginInlineEnd: -reachEnd } : {},
982
+ maxWidth: `calc(100% + ${frameStart + reachEnd}px)`
983
+ } : void 0, filler = useMemo2(() => reachFrame ? trackColumn === void 0 ? {} : { gridColumn: gridTracks.length + 1 } : void 0, [reachFrame, trackColumn, gridTracks.length]), [scroller, setScroller] = useState3(null), [headBox, setHeadBox] = useState3(null), [floatClip, setFloatClip] = useState3(null), [floatInner, setFloatInner] = useState3(null), [floatId, setFloatId] = useState3(void 0), gridWidth = trackTotal(gridTracks), printing = usePrinting(), [printBox, setPrintBox] = useState3();
984
+ useEffect2(() => size !== "container" ? void 0 : watchPrint((phase) => {
985
+ let box = phase === "print" ? grid.tableRef.current?.parentElement?.clientWidth : void 0;
986
+ return () => setPrintBox(box);
987
+ }), [size, grid.tableRef]);
988
+ let printFit = useMemo2(() => printing && printBox !== void 0 && printBox > 0 && gridWidth > printBox + 0.5 ? { zoom: printBox / gridWidth, width: gridWidth, "--bp-cols-print": "var(--bp-cols)" } : void 0, [printing, printBox, gridWidth]), [scrolled, setScrolled] = useState3(!1), scrollListener = useRef3(onScrollChange);
989
+ scrollListener.current = onScrollChange;
990
+ let scrollLabel = useRef3("");
991
+ useEffect2(() => {
992
+ if (scroller === null) return;
993
+ let report = () => {
994
+ scroller.clientWidth > 0 && setScrollWidth((before) => (before ?? container.size.width) === scroller.clientWidth ? before : scroller.clientWidth), setScrolled(scroller.scrollLeft > 0), markScrollRegion(scroller, scrollLabel.current), headBox !== null && headBox.scrollLeft !== scroller.scrollLeft && (headBox.scrollLeft = scroller.scrollLeft), scrollListener.current?.(scrollStateOf(scroller));
995
+ }, follow = () => {
996
+ headBox !== null && scroller.scrollLeft !== headBox.scrollLeft && (scroller.scrollLeft = headBox.scrollLeft);
997
+ };
998
+ report(), scroller.addEventListener("scroll", report, { passive: !0 }), headBox?.addEventListener("scroll", follow, { passive: !0 });
999
+ let resize = typeof ResizeObserver < "u" ? new ResizeObserver(report) : void 0;
1000
+ return resize?.observe(scroller), () => {
1001
+ scroller.removeEventListener("scroll", report), headBox?.removeEventListener("scroll", follow), resize?.disconnect();
1002
+ };
1003
+ }, [scroller, headBox, gridWidth, container.size?.width, fillHeight, rows, theme, density]);
1004
+ let trackSpans = useMemo2(() => {
1005
+ if (!windowed) return [];
1006
+ let left = 0;
1007
+ return gridTracks.map((track) => {
1008
+ let span = { id: track.id, start: left, end: left + track.width };
1009
+ return left += track.width, span;
1010
+ });
1011
+ }, [windowed, gridTracks]), fallbackViewport = container.size?.width ?? (typeof size == "object" ? resolveSize(size).width : typeof window > "u" ? 1024 : window.innerWidth), viewRange = useCallback2((left, width2) => {
1012
+ let view = width2 > 0 ? width2 : fallbackViewport, from = left - view / 2, to = left + view * 1.5, inside = trackSpans.filter((span) => span.end >= from && span.start <= to);
1013
+ return inside.length === 0 ? "" : `${inside[0].id}\0${inside[inside.length - 1].id}`;
1014
+ }, [trackSpans, fallbackViewport]), [viewKey, setViewKey] = useState3(void 0);
1015
+ useEffect2(() => {
1016
+ if (!windowed || scroller === null) return;
1017
+ let frame2 = 0, update = () => {
1018
+ frame2 = 0;
1019
+ let left = getComputedStyle(scroller).direction === "rtl" ? Math.abs(scroller.scrollLeft) : scroller.scrollLeft, next = viewRange(left, scroller.clientWidth);
1020
+ setViewKey((before) => before === next ? before : next);
1021
+ }, schedule = () => {
1022
+ frame2 === 0 && (frame2 = typeof requestAnimationFrame > "u" ? (update(), 0) : requestAnimationFrame(update));
1023
+ };
1024
+ update(), scroller.addEventListener("scroll", schedule, { passive: !0 });
1025
+ let resize = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(schedule);
1026
+ return resize?.observe(scroller), () => {
1027
+ frame2 !== 0 && typeof cancelAnimationFrame < "u" && cancelAnimationFrame(frame2), scroller.removeEventListener("scroll", schedule), resize?.disconnect();
1028
+ };
1029
+ }, [windowed, scroller, viewRange]);
1030
+ let liteSlots = useMemo2(() => new Map(trackSpans.map((span) => [span.id, { start: span.start, width: span.end - span.start }])), [trackSpans]), [rowPagesInView, setRowPagesInView] = useState3(() => /* @__PURE__ */ new Set([0]));
1031
+ useEffect2(() => {
1032
+ if (!rowWindowed || scroller === null) return;
1033
+ let observer = new IntersectionObserver((entries) => {
1034
+ setRowPagesInView((before) => {
1035
+ let next = new Set(before);
1036
+ for (let entry of entries) {
1037
+ let page = Number(entry.target.dataset.bpRowPage);
1038
+ entry.isIntersecting ? next.add(page) : next.delete(page);
1039
+ }
1040
+ return next.size === before.size && [...next].every((page) => before.has(page)) ? before : next;
1041
+ });
1042
+ }, { root: fillHeight ? scroller : null, rootMargin: "100% 0px" });
1043
+ return scroller.querySelectorAll("[data-bp-row-page]").forEach((page) => observer.observe(page)), () => observer.disconnect();
1044
+ }, [rowWindowed, scroller, fillHeight, rows]);
1045
+ let focusColumn = grid.focus?.colId, windowRef = useRef3(void 0), windowIds = useMemo2(() => {
1046
+ if (!windowed || printing) return;
1047
+ let key = viewKey ?? viewRange(0, 0), [first, last] = key.split("\0"), ids = /* @__PURE__ */ new Set([...pinned.keys()]);
1048
+ focusColumn !== void 0 && ids.add(focusColumn);
1049
+ let inside = !1;
1050
+ for (let span of trackSpans)
1051
+ span.id === first && (inside = !0), inside && ids.add(span.id), span.id === last && (inside = !1);
1052
+ let blocks = /* @__PURE__ */ new Set();
1053
+ allColumns.forEach((column, index) => {
1054
+ ids.has(column.id) && !pinned.has(column.id) && blocks.add(Math.floor(index / WINDOW_BLOCK));
1055
+ }), allColumns.forEach((column, index) => {
1056
+ blocks.has(Math.floor(index / WINDOW_BLOCK)) && ids.add(column.id);
1057
+ });
1058
+ let before = windowRef.current;
1059
+ return before !== void 0 && before.size === ids.size && [...ids].every((id) => before.has(id)) ? before : windowRef.current = ids;
1060
+ }, [windowed, printing, viewKey, viewRange, pinned, focusColumn, trackSpans, allColumns]), columnPlan = useMemo2(() => {
1061
+ if (windowIds === void 0) return;
1062
+ let plan = [], run;
1063
+ return allColumns.forEach((column, index) => {
1064
+ if (windowIds.has(column.id)) {
1065
+ plan.push(index), run = void 0;
1066
+ return;
1067
+ }
1068
+ if (hiddenColumns.has(column.id)) {
1069
+ run = void 0;
1070
+ return;
1071
+ }
1072
+ if (run !== void 0 && Math.floor(run.to / LITE_BLOCK) === Math.floor(index / LITE_BLOCK)) {
1073
+ run.to = index;
1074
+ return;
1075
+ }
1076
+ plan.push(run = { from: index, to: index });
1077
+ }), plan;
1078
+ }, [windowIds, allColumns, hiddenColumns]), stickySections = sticky.sections, stickyHeadMode = sticky.head, tableReady = table !== void 0;
1079
+ useEffect2(() => {
1080
+ let element = grid.tableRef.current, head = element?.querySelector('[data-bp-rowgroup="head"]');
1081
+ if (!stickySections || !element || !head) return;
1082
+ let apply = () => element.style.setProperty("--bp-head-h", `${stickyHeadMode === !1 ? 0 : head.offsetHeight}px`);
1083
+ apply();
1084
+ let watch = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(apply);
1085
+ return watch?.observe(head), () => watch?.disconnect();
1086
+ }, [stickySections, stickyHeadMode, tableReady, gridWidth]), useEffect2(() => {
1087
+ let element = grid.tableRef.current;
1088
+ if (!pageHead || !stickySections || !element || headBox === null || scroller === null || floatClip === null || floatInner === null) return;
1089
+ let frame2 = 0, update = () => {
1090
+ frame2 = 0;
1091
+ let body = element.querySelector('[data-bp-rowgroup="body"]');
1092
+ if (body === null) return;
1093
+ let headBottom = headBox.getBoundingClientRect().bottom, headings = Array.from(body.querySelectorAll('[role="row"][data-role="section"]')).map((row) => ({ id: row.getAttribute("data-row-id") ?? void 0, box: row.getBoundingClientRect() })), active = -1;
1094
+ headings.forEach((heading, index) => {
1095
+ heading.box.top < headBottom - 0.5 && (active = index);
1096
+ });
1097
+ let current = headings[active];
1098
+ if (current === void 0) floatClip.style.visibility = "hidden";
1099
+ else {
1100
+ let limit = headings[active + 1]?.box.top ?? body.getBoundingClientRect().bottom, height = floatInner.firstElementChild === null ? current.box.height : floatInner.getBoundingClientRect().height;
1101
+ floatClip.style.height = `${height}px`, floatClip.style.visibility = "visible", floatInner.style.transform = `translateY(${Math.min(0, limit - (headBottom + height))}px)`, floatClip.scrollLeft = scroller.scrollLeft;
1102
+ }
1103
+ setFloatId((before) => before === current?.id ? before : current?.id);
1104
+ }, schedule = () => {
1105
+ frame2 === 0 && (frame2 = requestAnimationFrame(update));
1106
+ };
1107
+ update(), document.addEventListener("scroll", schedule, { capture: !0, passive: !0 }), window.addEventListener("resize", schedule);
1108
+ let watch = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(schedule);
1109
+ return watch?.observe(element), () => {
1110
+ frame2 !== 0 && cancelAnimationFrame(frame2), document.removeEventListener("scroll", schedule, { capture: !0 }), window.removeEventListener("resize", schedule), watch?.disconnect();
1111
+ };
1112
+ }, [pageHead, stickySections, headBox, scroller, floatClip, floatInner, floatId, tableReady, gridWidth]), useImperativeHandle(handleRef, () => ({
1113
+ scrollState: () => scrollStateOf(scroller),
1114
+ scrollToColumn: (columnId, behavior) => {
1115
+ if (scroller === null) return;
1116
+ let offset = 0;
1117
+ for (let track of gridTracks) {
1118
+ if (track.id === columnId) break;
1119
+ offset += track.width;
1120
+ }
1121
+ let pinnedWidth = 0;
1122
+ for (let [id, pin] of pinned)
1123
+ pin.last && (pinnedWidth = pin.left + (gridTracks.find((track) => track.id === id)?.width ?? 0));
1124
+ scrollBoxTo(scroller, Math.max(0, offset - pinnedWidth), behavior);
1125
+ },
1126
+ scrollTo: (left, behavior) => {
1127
+ scroller !== null && scrollBoxTo(scroller, left, behavior);
1128
+ }
1129
+ }), [scroller, gridTracks, pinned]);
1130
+ let contentWidth = tracks.length === 0 ? void 0 : Math.ceil(marginLeft - frameStart + trackTotal(gridTracks) + Math.max(0, marginRight)), contentListener = useRef3(onContentWidth);
1131
+ contentListener.current = onContentWidth, useEffect2(() => {
1132
+ contentWidth !== void 0 && contentListener.current?.(contentWidth);
1133
+ }, [contentWidth]);
1134
+ let toggleRow = useCallback2(
1135
+ (rowId) => {
1136
+ let next = collapsedSet.has(rowId) ? collapsed.filter((candidate) => candidate !== rowId) : [...collapsed, rowId];
1137
+ isCollapsedControlled || setUncontrolledCollapsed(next), onCollapsedChange?.(next), onExpansionChange !== void 0 && resolved !== void 0 && onExpansionChange(expansionForFolds(resolved.table, tableOptions?.expansion, new Set(next)));
1138
+ },
1139
+ [collapsed, collapsedSet, isCollapsedControlled, onCollapsedChange, onExpansionChange, resolved, tableOptions?.expansion]
1140
+ ), toggleColumns = useCallback2(
1141
+ (toggleId) => {
1142
+ let next = {
1143
+ ...columnVisibility,
1144
+ [toggleId]: !(columnVisibility[toggleId] ?? !0)
1145
+ };
1146
+ isColumnVisibilityControlled || setUncontrolledColumnVisibility(next), onColumnVisibilityChange?.(next);
1147
+ },
1148
+ [
1149
+ columnVisibility,
1150
+ isColumnVisibilityControlled,
1151
+ onColumnVisibilityChange
1152
+ ]
1153
+ ), rowSelectListener = useRef3(onRowSelect);
1154
+ rowSelectListener.current = onRowSelect;
1155
+ let hasRowSelect = onRowSelect !== void 0, selectRow = useMemo2(
1156
+ () => hasRowSelect ? (row, event, columnId) => rowSelectListener.current?.(row.id, { row, event, ...columnId === void 0 ? {} : { columnId } }) : void 0,
1157
+ [hasRowSelect]
1158
+ ), toggleSort = useCallback2(
1159
+ (column) => {
1160
+ let next = nextSort(sort, column);
1161
+ isSortControlled || setUncontrolledSort(next), onSortChange?.(next);
1162
+ },
1163
+ [sort, isSortControlled, onSortChange]
1164
+ ), barMaxima = useMemo2(
1165
+ () => table && inCellBarMaxima(rows, columns),
1166
+ [table, rows, columns]
1167
+ ), sparkDomains = useMemo2(
1168
+ () => table ? sparklineDomains(columns, rows) : /* @__PURE__ */ new Map(),
1169
+ [table, columns, rows]
1170
+ ), heatLanes = useMemo2(
1171
+ () => table ? heatRanges(columns, rows) : /* @__PURE__ */ new Map(),
1172
+ [table, columns, rows]
1173
+ ), grounds = useMemo2(
1174
+ () => table && presetLanguage(tableOptions?.variant).groupBand ? rowGrounds(table) : /* @__PURE__ */ new Map(),
1175
+ [table, tableOptions?.variant]
1176
+ ), sparkWidths = useMemo2(
1177
+ () => new Map(tracks.filter((track) => track.width > 0).map((track) => [track.id, track.width])),
1178
+ [tracks]
1179
+ ), childCounts = useMemo2(
1180
+ () => table ? treeChildCounts(table) : /* @__PURE__ */ new Map(),
1181
+ [table]
1182
+ ), rowTree = useMemo2(() => tableRowTree(table?.rows ?? [], rootsHidden), [table, rootsHidden]), rowPages = useMemo2(() => rowWindowed ? Array.from({ length: Math.ceil(rowTree.length / ROW_PAGE) }, (_, index) => rowTree.slice(index * ROW_PAGE, (index + 1) * ROW_PAGE)) : [], [rowWindowed, rowTree]), engineNotes = options[ENGINE_NOTES], frameMemo = useMemo2(
1183
+ () => table === void 0 || tableOptions === void 0 ? void 0 : tableFrame(table, engineNotes ? { ...tableOptions, [ENGINE_NOTES]: engineNotes } : tableOptions, rows, columns),
1184
+ [table, tableOptions, engineNotes, rows, columns]
1185
+ ), headRowCount = (table?.columnGroups ?? []).some((group) => group.heading !== !1) ? 2 : 1, isTree = (table?.rows ?? []).some((row) => row.hasChildren), rowIndices = useMemo2(() => new Map(rows.map((row, index) => [row.id, index + headRowCount + 1])), [rows, headRowCount]), columnIndices = useMemo2(() => new Map(columns.map((column, index) => [column.id, index + 1])), [columns]), wrap = (content) => {
1186
+ let body = size === "container" ? /* @__PURE__ */ jsxs2("div", { ref: container.wrapperRef, "data-bp-container": fit, style: fillHeight ? { height: "100%" } : void 0, children: [
1187
+ container.probed && /* @__PURE__ */ jsx3("div", { "data-bp-probe": "", "aria-hidden": "true", style: PROBE_STYLE }),
1188
+ content
1189
+ ] }) : content;
1190
+ return idPrefix === void 0 ? body : /* @__PURE__ */ jsx3(IdPrefixContext.Provider, { value: checkedIdPrefix(idPrefix), children: body });
1191
+ }, refusedOptions = [
1192
+ ...refusedProps,
1193
+ ...heatEncodingRefusals(stableOptions.encodings),
1194
+ ...refusalFindings(colorblindWarnings),
1195
+ // The table is the vertical scroll owner under fillHeight, so it cannot also pin its head to the page.
1196
+ ...pageHead && fillHeight ? [{
1197
+ code: "invalid-options",
1198
+ message: "stickyLabels.head 'page' cannot be used with fillHeight: fillHeight makes the table the vertical scroll box, so the head cannot follow the page scroll",
1199
+ path: "options.stickyLabels.head",
1200
+ suggest: "Set stickyLabels.head to 'table' so the head pins inside the table's scroll box, or remove fillHeight to pin it to the page.",
1201
+ fix: [{ op: "replace", path: "/options/stickyLabels/head", value: "table" }]
1202
+ }] : []
1203
+ ], drew = refusedOptions.length === 0 && !floorAttempt.deferred && !!resolved && !!table && !!theme && !!tableOptions && stylesheet !== void 0 && !sized?.refused && !settling, exported = useMemo2(() => exporter && drew && request ? {
1204
+ request: { ...request, options: {
1205
+ ...request.options,
1206
+ expansion: { depth: "all", collapsed: [...collapsedSet], expanded: openParents(table, collapsedSet), rootsHidden },
1207
+ columnVisibility,
1208
+ inlineVisibility
1209
+ } },
1210
+ data,
1211
+ frame: { width: Math.max(request.size.width, contentWidth ?? 0) },
1212
+ pinnedHeight: !1,
1213
+ // A DimSwitch's document is its own spec at the view on screen: the compiled table is internal.
1214
+ ...originalFloorRequest === void 0 ? {} : { source: {
1215
+ type: originalFloorRequest.type,
1216
+ data: originalFloorRequest.data,
1217
+ options: Object.fromEntries(Object.entries({
1218
+ ...originalFloorRequest.options,
1219
+ expansion: { expanded: openParents(table, collapsedSet), collapsed: [...collapsedSet] },
1220
+ columnVisibility,
1221
+ inlineVisibility
1222
+ }).filter(([, value]) => value !== void 0))
1223
+ } }
1224
+ } : void 0, [exporter, drew, request, data, table, collapsedSet, rootsHidden, columnVisibility, inlineVisibility, contentWidth, originalFloorRequest]);
1225
+ if (useExportLink(exporter, exported), refusedOptions.length && request?.theme) return wrap(/* @__PURE__ */ jsx3(LayoutRefusal, { refusals: refusedOptions, theme: request.theme, options: request.options, size: request.size }));
1226
+ if (floorAttempt.deferred || !resolved || !table || !theme || !tableOptions || stylesheet === void 0)
1227
+ return wrap(/* @__PURE__ */ jsx3(LoadingPlaceholder, { theme: stableOptions.theme, failure: failure ?? floorFailure, options: { ...stableOptions, target } }));
1228
+ let frame = frameMemo, figureStyle = {
1229
+ ...frame.padding === void 0 ? {} : { padding: frame.padding },
1230
+ "--bp-note-indent": `${padX}px`
1231
+ }, withInteraction = (content) => flags ? /* @__PURE__ */ jsx3(
1232
+ TableHoverFrame,
1233
+ {
1234
+ flags,
1235
+ styleNonce,
1236
+ table,
1237
+ rows,
1238
+ columns,
1239
+ request,
1240
+ theme,
1241
+ initialPrepared,
1242
+ refused: sized?.refused,
1243
+ portal: portalContainer,
1244
+ inlineVisibility,
1245
+ children: content
1246
+ }
1247
+ ) : content;
1248
+ if (sized?.refused) return wrap(settling ? /* @__PURE__ */ jsx3(LoadingPlaceholder, { theme, size: sized.size, options: tableOptions }) : withInteraction(
1249
+ /* @__PURE__ */ jsx3(SizePlaceholder, { result: sized, theme, options: tableOptions, onRefused, renderRefused })
1250
+ ));
1251
+ let stickyObject = typeof stickyLabels == "object" && stickyLabels !== null, stickyVars = stickyObject ? {
1252
+ ...pageHead ? { "--bp-sticky-top": `${sticky.top}px` } : {},
1253
+ ...sticky.sections ? { "--bp-sections-top": sticky.head === "page" ? `calc(${sticky.top}px + var(--bp-head-h,0px))` : sticky.head === "table" ? "var(--bp-head-h,0px)" : "0px" } : {}
1254
+ } : void 0;
1255
+ scrollLabel.current = frame.title || (typeof tableOptions.title == "string" ? tableOptions.title : "Table");
1256
+ let gridProps = {
1257
+ role: isTree ? "treegrid" : "grid",
1258
+ "aria-label": scrollLabel.current,
1259
+ className: "bp-table bp-table-grid",
1260
+ "aria-describedby": summaryId,
1261
+ "aria-rowcount": rows.length + headRowCount,
1262
+ "aria-colcount": columns.length,
1263
+ "data-bp-table-theme": themeScope,
1264
+ "data-bp-variant": tableOptions.variant ?? "hierarchy",
1265
+ "data-bp-tree": isTree ? "" : void 0,
1266
+ "data-bp-operators": operatorSlot > 0 ? "" : void 0,
1267
+ "data-bp-reach": frameStart > 0 ? "" : void 0,
1268
+ "data-bp-readonly": isTree && readOnlyTree ? "" : void 0,
1269
+ "data-bp-sticky": sticky.on ? "" : void 0,
1270
+ // Only the object form writes these: a `true` or a number draws the 0.27 markup.
1271
+ "data-bp-sticky-head": stickyObject && sticky.on ? sticky.head === !1 ? "off" : sticky.head : void 0,
1272
+ "data-bp-sticky-sections": stickyObject && sticky.sections ? "" : void 0,
1273
+ "data-bp-scrolled": scrolled ? "" : void 0,
1274
+ "data-bp-group-rule": (tableOptions.groupRule ?? "span") === "span" ? "span" : void 0,
1275
+ "data-bp-group-align": tableOptions.groupAlign === "left" || tableOptions.groupAlign === "right" ? tableOptions.groupAlign : void 0,
1276
+ // The right end: every row closes on a hairline in the group
1277
+ // divider's ink, or the head rule's where no group opens with a
1278
+ // divider. A cohort grid keeps its open matrix edge, as in the SVG,
1279
+ // and so does a theme with `table.endRule: 'none'`.
1280
+ "data-bp-mark-style": theme?.table?.mark ?? (tableOptions.variant === "steering" ? "boxed" : "bare"),
1281
+ "data-bp-end": void 0,
1282
+ "data-bp-density": density,
1283
+ // A row label takes two lines before its cut (`rowLabelLines`), as on the SVG.
1284
+ "data-bp-label-lines": tableOptions.rowLabelLines === 1 ? "1" : void 0,
1285
+ // 'sorted' keeps the chevron on the sorted header alone; the other
1286
+ // sortable headers keep its reserve, so no track moves.
1287
+ "data-bp-sort-indicator": tableOptions.sortIndicator === "sorted" ? "sorted" : void 0,
1288
+ "data-bp-figures": figures ? void 0 : "off",
1289
+ "data-bp-wired": "",
1290
+ onKeyDown: grid.onKeyDown,
1291
+ onFocusCapture: grid.onFocusCapture,
1292
+ onBlurCapture: grid.onBlurCapture
1293
+ }, headGroup = /* @__PURE__ */ jsx3(
1294
+ TableHead,
1295
+ {
1296
+ table,
1297
+ columnIndices,
1298
+ columns: allColumns,
1299
+ hiddenColumns,
1300
+ spans,
1301
+ groupMarks,
1302
+ sortableIds,
1303
+ sort,
1304
+ onToggleSort: toggleSort,
1305
+ pinned,
1306
+ trackColumn,
1307
+ theme,
1308
+ windowIds,
1309
+ wideGroups
1310
+ }
1311
+ ), rowShared = {
1312
+ palette: tableOptions.palette,
1313
+ rowIndices,
1314
+ columnIndices,
1315
+ isTree,
1316
+ columns: allColumns,
1317
+ hiddenColumns,
1318
+ collapsedSet,
1319
+ closers,
1320
+ mountCollapsed: tableOptions.mountCollapsed !== !1,
1321
+ anchorWash: tableOptions.anchorWash === !0,
1322
+ barMaxima,
1323
+ grounds,
1324
+ groundMode: tableOptions.groupGround ?? theme.table?.groupGround ?? "expanded",
1325
+ heatLanes,
1326
+ sparkDomains,
1327
+ sparkWidths,
1328
+ theme,
1329
+ measure: request?.fontMetrics ?? defaultMeasurer,
1330
+ groupMarks,
1331
+ levelNouns: table.levelNouns,
1332
+ childCounts,
1333
+ inlineVisibility,
1334
+ onToggleRow: toggleRow,
1335
+ readOnly: readOnlyTree,
1336
+ staticMarks: readOnlyTree && tableOptions.outlineMarks === !0,
1337
+ onSelect: selectRow,
1338
+ selectable: isRowSelectable,
1339
+ labelLead: rowLabelLead,
1340
+ filler,
1341
+ focus: grid.focus,
1342
+ pinned,
1343
+ trackColumn,
1344
+ columnEdges,
1345
+ figures,
1346
+ foldOn,
1347
+ liteSlots,
1348
+ columnPlan
1349
+ }, rowGroup = (node) => /* @__PURE__ */ jsx3(TableRowGroup, { node, hidden: !1, ...rowShared }, node.row.id), floatHeading = floatId === void 0 ? void 0 : table.rows.find((row) => row.id === floatId), bodyGroup = /* @__PURE__ */ jsx3("div", { role: "rowgroup", "data-bp-rowgroup": "body", children: rowWindowed ? rowPages.map((nodes, index) => /* @__PURE__ */ jsx3(
1350
+ TableRowPage,
1351
+ {
1352
+ ...rowShared,
1353
+ nodes,
1354
+ index,
1355
+ contain: containRowPages && !labelsWrap && !printing,
1356
+ filler: frameReach === 0 && gridWidth >= container.size.width ? void 0 : filler,
1357
+ light: !printing && !rowPagesInView.has(index) && !nodes.some((node) => node.row.id === grid.focus?.rowId)
1358
+ },
1359
+ index
1360
+ )) : sticky.sections && !pageHead ? sectionScopes(rowTree).map((item) => "scope" in item ? /* @__PURE__ */ jsx3("div", { className: "bp-section-scope", children: item.nodes.map(rowGroup) }, `scope:${item.scope}`) : rowGroup(item)) : rowTree.map(rowGroup) }), figure = /* @__PURE__ */ jsxs2("figure", { ref: displayRef, className: "bp-table", "data-bp-chart": "table", "data-bp-table-theme": themeScope, "data-bp-motion": provider?.motion, "data-bp-mount": tableOptions.mountCollapsed === !1 ? "open" : void 0, "data-bp-density": density, "data-bp-mode": frame.mode === "compact" ? "compact" : void 0, "data-bp-fill-height": fillHeight ? "" : void 0, style: figureStyle, children: [
1361
+ /* @__PURE__ */ jsx3(TableThemeStyle, { stylesheet, scope: themeScope, nonce: styleNonce }),
1362
+ /* @__PURE__ */ jsx3(
1363
+ TableCaption,
1364
+ {
1365
+ frame,
1366
+ theme,
1367
+ keyEntries: tableOptions.legend === "none" ? [] : heatKey(columns, heatLanes, theme, tableOptions.strings, tableOptions.locale?.language),
1368
+ arrowEntries: tableOptions.legend === "none" ? [] : arrowKey(columns, rows)
1369
+ }
1370
+ ),
1371
+ /* @__PURE__ */ jsx3("p", { id: summaryId, className: "bp-summary", children: frame.summary }),
1372
+ /* @__PURE__ */ jsx3(TableColumnToggles, { toggles: toolbar ? table.columnToggles : [], visibility: columnVisibility, onToggle: toggleColumns }),
1373
+ pageHead ? (
1374
+ // Page mode (`stickyLabels.head: 'page'`): the live head sits OUTSIDE the box that scrolls sideways, so the page
1375
+ // scroll can pin it; an overflow ancestor would capture `position: sticky`. The head box follows the body's
1376
+ // sideways scroll (see the scroll effect), and the table stays one grid.
1377
+ /* @__PURE__ */ jsxs2("div", { ref: grid.tableRef, ...gridProps, style: { ...gridStyle, ...scrollStyle, ...stickyVars, ...printFit, "--bp-pin-end": `${pinEnd}px` }, children: [
1378
+ /* @__PURE__ */ jsx3("div", { ref: setHeadBox, className: "bp-page-head", children: headGroup }),
1379
+ sticky.sections ? /* @__PURE__ */ jsx3("div", { className: "bp-section-float", "aria-hidden": "true", children: /* @__PURE__ */ jsx3("div", { ref: setFloatClip, className: "bp-section-float-clip", style: { visibility: "hidden" }, children: /* @__PURE__ */ jsx3("div", { ref: setFloatInner, className: "bp-section-float-inner", children: floatHeading === void 0 ? null : /* @__PURE__ */ jsx3(TableGridRow, { row: floatHeading, collapsed: !1, hidden: !1, floating: !0, ...rowShared, readOnly: !0, staticMarks: tableOptions.outlineMarks === !0, onSelect: void 0, selectable: void 0, focus: void 0 }) }) }) }) : null,
1380
+ /* @__PURE__ */ jsx3("div", { ref: setScroller, className: "bp-scroll", children: bodyGroup })
1381
+ ] })
1382
+ ) : /* @__PURE__ */ jsx3("div", { ref: setScroller, className: "bp-scroll", style: scrollStyle, children: /* @__PURE__ */ jsxs2("div", { ref: grid.tableRef, ...gridProps, style: { ...gridStyle, ...stickyVars, ...printFit, "--bp-pin-end": `${pinEnd}px` }, children: [
1383
+ headGroup,
1384
+ bodyGroup
1385
+ ] }) }),
1386
+ frame.footnotes.length > 0 ? /* @__PURE__ */ jsx3("ul", { className: "bp-footnotes", children: frame.footnotes.map((footnote, index) => /* @__PURE__ */ jsx3("li", { children: footnote }, `${index}:${footnote}`)) }) : null,
1387
+ frame.pointer ? (
1388
+ // The author's notes the placement keeps out of the frame (footer rule), behind a native disclosure.
1389
+ // Print shows the list open in place of the disclosure, as ChartFooter's panel does: a closed
1390
+ // <details> keeps its content out of print in browsers without ::details-content.
1391
+ /* @__PURE__ */ jsxs2(Fragment, { children: [
1392
+ /* @__PURE__ */ jsxs2("details", { className: "bp-notes", children: [
1393
+ /* @__PURE__ */ jsx3("summary", { children: frame.pointer }),
1394
+ /* @__PURE__ */ jsx3("ul", { className: "bp-footnotes", children: frame.listed.map((note, index) => /* @__PURE__ */ jsx3("li", { children: note }, `${index}:${note}`)) })
1395
+ ] }),
1396
+ /* @__PURE__ */ jsx3("div", { className: "bp-notes-print", children: /* @__PURE__ */ jsx3("ul", { className: "bp-footnotes", children: frame.listed.map((note, index) => /* @__PURE__ */ jsx3("li", { children: note }, `${index}:${note}`)) }) })
1397
+ ] })
1398
+ ) : null,
1399
+ frame.source ? /* @__PURE__ */ jsx3("p", { className: "bp-source", children: frame.source }) : null
1400
+ ] });
1401
+ return wrap(withInteraction(figure));
1402
+ }
1403
+ function scrollBoxTo(box, left, behavior) {
1404
+ typeof box.scrollTo == "function" ? box.scrollTo({ left, ...behavior === void 0 ? {} : { behavior } }) : box.scrollLeft = left;
1405
+ }
1406
+ function TableColumnToggles({ toggles, visibility, onToggle }) {
1407
+ return toggles.length ? /* @__PURE__ */ jsx3("div", { className: "bp-col-toolbar", role: "group", "aria-label": "Column groups", children: toggles.map((toggle) => /* @__PURE__ */ jsx3(
1408
+ "button",
1409
+ {
1410
+ type: "button",
1411
+ className: "bp-col-toggle",
1412
+ "data-bp-toggle-cols": toggle.id,
1413
+ "data-bp-default-visible": String(toggle.visible),
1414
+ "aria-pressed": visibility[toggle.id] ?? toggle.visible,
1415
+ onClick: () => onToggle(toggle.id),
1416
+ children: toggle.label
1417
+ },
1418
+ toggle.id
1419
+ )) }) : null;
1420
+ }
1421
+ function TableCaption({ frame, keyEntries, arrowEntries, theme }) {
1422
+ let keyed = keyEntries.length + arrowEntries.length > 0;
1423
+ return !frame.title && !frame.subtitle && !keyed ? null : /* @__PURE__ */ jsxs2("figcaption", { children: [
1424
+ frame.title ? /* @__PURE__ */ jsxs2("span", { className: "bp-title", children: [
1425
+ frame.title,
1426
+ frame.markerNotes ? /* @__PURE__ */ jsx3("sup", { className: "bp-footnote-marker", "aria-label": frame.markerNotes, children: "1" }) : null
1427
+ ] }) : null,
1428
+ frame.title && frame.subtitle ? " " : null,
1429
+ frame.subtitle ? /* @__PURE__ */ jsx3("span", { className: "bp-subtitle", children: frame.subtitle }) : null,
1430
+ keyed ? /* @__PURE__ */ jsxs2("span", { className: "bp-key", role: "list", "aria-label": "Key", children: [
1431
+ keyEntries.map((entry) => /* @__PURE__ */ jsxs2("span", { role: "listitem", children: [
1432
+ /* @__PURE__ */ jsx3("i", { "aria-hidden": "true", style: { background: resolvePaint(entry.fill, theme) } }),
1433
+ entry.label
1434
+ ] }, entry.id)),
1435
+ arrowEntries.map((entry) => /* @__PURE__ */ jsxs2("span", { role: "listitem", children: [
1436
+ /* @__PURE__ */ jsx3("b", { className: "bp-key-glyph", children: entry.glyph }),
1437
+ entry.label
1438
+ ] }, entry.id))
1439
+ ] }) : null
1440
+ ] });
1441
+ }
1442
+ function openParents(table, collapsed) {
1443
+ let rows = table?.rows ?? [], foldable = new Set(rows.filter((row) => row.foldable !== !1).map((row) => row.id));
1444
+ return [...new Set(rows.map((row) => row.parentId))].filter((id) => id !== void 0 && foldable.has(id) && !collapsed.has(id));
1445
+ }
1446
+ function tableRowTree(rows, rootsHidden = !1) {
1447
+ let nodes = /* @__PURE__ */ new Map(), roots = [];
1448
+ for (let row of rows)
1449
+ row.inline !== !0 && nodes.set(row.id, { row, children: [] });
1450
+ for (let row of rows) {
1451
+ let node = nodes.get(row.id);
1452
+ if (node === void 0) continue;
1453
+ let parent = row.parentId === void 0 ? void 0 : nodes.get(row.parentId);
1454
+ rootsHidden && row.role === "data" && row.foldable !== !1 && (parent === void 0 || parent.row.role === "section" && parent.row.foldable !== !1) || (parent === void 0 ? roots.push(node) : parent.children.push(node));
1455
+ }
1456
+ return roots;
1457
+ }
1458
+ function sectionScopes(nodes) {
1459
+ let items = [], open;
1460
+ for (let node of nodes)
1461
+ node.row.role === "section" ? (open = { scope: node.row.id, nodes: [node] }, items.push(open)) : open !== void 0 && node.row.role !== "total" ? open.nodes.push(node) : (open = void 0, items.push(node));
1462
+ return items;
1463
+ }
1464
+ function firstSortDirection(column) {
1465
+ return column.kind === "value" || column.kind === "computed" ? "desc" : "asc";
1466
+ }
1467
+ function SortChevron({ direction }) {
1468
+ return /* @__PURE__ */ jsx3("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx3(
1469
+ "path",
1470
+ {
1471
+ d: direction === "asc" ? "M1 5l3-3 3 3" : "M1 3l3 3 3-3",
1472
+ stroke: "currentColor",
1473
+ strokeWidth: "var(--bp-stroke-mark)",
1474
+ strokeLinecap: "round",
1475
+ strokeLinejoin: "round",
1476
+ fill: "none"
1477
+ }
1478
+ ) });
1479
+ }
1480
+ function nextSort(current, column) {
1481
+ let first = firstSortDirection(column);
1482
+ return !current || current.column !== column.id ? { column: column.id, direction: first } : current.direction === first ? { column: column.id, direction: first === "desc" ? "asc" : "desc" } : null;
1483
+ }
1484
+ function groupColIndex(ids, indices) {
1485
+ let first;
1486
+ for (let id of ids) {
1487
+ let index = indices.get(id);
1488
+ index !== void 0 && (first === void 0 || index < first) && (first = index);
1489
+ }
1490
+ return first;
1491
+ }
1492
+ function TableHead({
1493
+ columnIndices,
1494
+ table,
1495
+ columns,
1496
+ hiddenColumns,
1497
+ spans,
1498
+ groupMarks,
1499
+ sortableIds,
1500
+ sort,
1501
+ onToggleSort,
1502
+ pinned,
1503
+ trackColumn,
1504
+ theme,
1505
+ windowIds,
1506
+ wideGroups
1507
+ }) {
1508
+ let hasSubLabels = columns.some((column) => column.subLabel !== void 0), groupById = new Map(table.columnGroups.map((group) => [group.id, group])), spanById = new Map(spans.map((span) => [span.id, span])), collapsedVisibility = Object.fromEntries(
1509
+ table.columnToggles.map((toggle) => [toggle.id, !1])
1510
+ ), collapsedSpanById = new Map(
1511
+ groupSpans(table, visibleColumns(table, collapsedVisibility)).map((span) => [
1512
+ span.id,
1513
+ span.span
1514
+ ])
1515
+ ), togglesByGroup = /* @__PURE__ */ new Map();
1516
+ for (let toggle of table.columnToggles) {
1517
+ let groupId = table.columns.find(
1518
+ (column) => toggle.columnIds.includes(column.id)
1519
+ )?.groupId;
1520
+ if (groupId === void 0) continue;
1521
+ let toggles = togglesByGroup.get(groupId) ?? [];
1522
+ toggles.push(toggle), togglesByGroup.set(groupId, toggles);
1523
+ }
1524
+ let headRef = useRef3(null), lastHidden = useRef3(hiddenColumns);
1525
+ useIsomorphicLayoutEffect(() => {
1526
+ let was = lastHidden.current;
1527
+ lastHidden.current = hiddenColumns;
1528
+ let head = headRef.current, row = head?.querySelector('[role="row"]');
1529
+ if (!head || !row || was === hiddenColumns) return;
1530
+ let ms = parseFloat(getComputedStyle(row).transitionDuration) * 1e3;
1531
+ if (!(ms > 0)) return;
1532
+ let opened = (ids) => ids.every((id) => was.has(id)) && ids.some((id) => !hiddenColumns.has(id)), cells = [...head.querySelectorAll("[data-col-id],[data-group-id]")].filter((cell) => cell.dataset.colId !== void 0 ? opened([cell.dataset.colId]) : opened(groupById.get(cell.dataset.groupId)?.columnIds ?? []));
1533
+ cells.forEach((cell) => cell.setAttribute("data-bp-opening", ""));
1534
+ let done = () => cells.forEach((cell) => cell.removeAttribute("data-bp-opening")), timer = setTimeout(done, ms);
1535
+ return () => {
1536
+ clearTimeout(timer), done();
1537
+ };
1538
+ }, [hiddenColumns]);
1539
+ let renderedGroups = /* @__PURE__ */ new Set(), groupCells = [];
1540
+ for (let column of columns) {
1541
+ if (column.groupId === void 0) {
1542
+ if (windowIds !== void 0 && !windowIds.has(column.id)) continue;
1543
+ groupCells.push(
1544
+ /* @__PURE__ */ jsx3(
1545
+ "div",
1546
+ {
1547
+ role: "columnheader",
1548
+ "aria-hidden": "true",
1549
+ "data-bp-hidden": hiddenColumns.has(column.id) ? "" : void 0,
1550
+ "data-bp-group-start": groupMarks.groupRowStart.has(column.id) ? "" : void 0,
1551
+ "data-bp-pin": pinned.has(column.id) ? "" : void 0,
1552
+ style: headCellStyle(pinned.get(column.id), trackColumn?.get(column.id))
1553
+ },
1554
+ `ungrouped:${column.id}`
1555
+ )
1556
+ );
1557
+ continue;
1558
+ }
1559
+ if (renderedGroups.has(column.groupId)) continue;
1560
+ renderedGroups.add(column.groupId);
1561
+ let group = groupById.get(column.groupId), span = spanById.get(column.groupId);
1562
+ if (group === void 0 || span === void 0) continue;
1563
+ let toggles = togglesByGroup.get(group.id) ?? [];
1564
+ groupCells.push(
1565
+ /* @__PURE__ */ jsx3(
1566
+ "div",
1567
+ {
1568
+ role: "columnheader",
1569
+ "aria-colspan": span.span > 0 ? span.span : void 0,
1570
+ "aria-colindex": groupColIndex(group.columnIds, columnIndices),
1571
+ "aria-hidden": span.span === 0 ? "true" : void 0,
1572
+ style: {
1573
+ gridColumn: trackColumn === void 0 ? `span ${span.fullSpan}` : `${trackColumn.get(column.id) ?? 1} / span ${span.fullSpan}`
1574
+ },
1575
+ "data-group-id": group.id,
1576
+ "data-colspan-full": toggles.length > 0 ? span.fullSpan : void 0,
1577
+ "data-colspan-visible": toggles.length > 0 ? collapsedSpanById.get(group.id) : void 0,
1578
+ "data-bp-hidden": span.span === 0 ? "" : void 0,
1579
+ "data-bp-band": group.band === !0 ? "" : void 0,
1580
+ "data-bp-group-wide": wideGroups.has(group.id) ? "" : void 0,
1581
+ "data-bp-group-start": groupMarks.groupStart.has(column.id) ? "" : void 0,
1582
+ "data-bp-group-end": group.columnIds.some((id) => groupMarks.groupEnd.has(id)) ? "" : void 0,
1583
+ "aria-label": group.heading === !1 ? group.label : void 0,
1584
+ children: group.heading === !1 ? null : /* @__PURE__ */ jsxs2("span", { children: [
1585
+ group.label,
1586
+ group.note === void 0 ? null : /* @__PURE__ */ jsxs2("span", { className: "bp-group-note", children: [
1587
+ " \xB7 ",
1588
+ group.note
1589
+ ] })
1590
+ ] })
1591
+ },
1592
+ group.id
1593
+ )
1594
+ );
1595
+ }
1596
+ return /* @__PURE__ */ jsxs2("div", { ref: headRef, role: "rowgroup", "data-bp-rowgroup": "head", children: [
1597
+ table.columnGroups.some((group) => group.heading !== !1) ? /* @__PURE__ */ jsx3("div", { className: "bp-groups", role: "row", "aria-rowindex": 1, children: groupCells }) : null,
1598
+ /* @__PURE__ */ jsx3("div", { className: "bp-columns", role: "row", "aria-rowindex": table.columnGroups.some((group) => group.heading !== !1) ? 2 : 1, children: columns.map((column) => {
1599
+ if (windowIds !== void 0 && !windowIds.has(column.id))
1600
+ return hiddenColumns.has(column.id) ? null : /* @__PURE__ */ jsx3("div", { role: "columnheader", "aria-colindex": columnIndices.get(column.id), "data-bp-lite": "", style: liteStyle(trackColumn?.get(column.id)), children: headText(column, theme) }, column.id);
1601
+ let sortable = sortableIds.has(column.id), active = sortable && sort?.column === column.id ? sort.direction : void 0, text = headText(column, theme);
1602
+ return /* @__PURE__ */ jsxs2(
1603
+ "div",
1604
+ {
1605
+ role: "columnheader",
1606
+ "aria-colindex": columnIndices.get(column.id),
1607
+ "data-col-id": column.id,
1608
+ "data-bp-column": column.id,
1609
+ "data-bp-detail": column.toggleGroup,
1610
+ "data-bp-hidden": hiddenColumns.has(column.id) ? "" : void 0,
1611
+ "aria-hidden": hiddenColumns.has(column.id) ? "true" : void 0,
1612
+ "aria-sort": sortable ? active === "asc" ? "ascending" : active === "desc" ? "descending" : "none" : void 0,
1613
+ "data-bp-band": groupMarks.banded.has(column.id) ? "" : void 0,
1614
+ "data-bp-group-start": groupMarks.groupStart.has(column.id) ? "" : void 0,
1615
+ "data-bp-group-end": groupMarks.groupEnd.has(column.id) ? "" : void 0,
1616
+ "data-bp-grounds-only": groupMarks.groundsOnly.has(column.id) ? "" : void 0,
1617
+ "data-emphasis": column.emphasis,
1618
+ "data-bp-pin": pinned.has(column.id) ? "" : void 0,
1619
+ "data-bp-pin-last": pinned.get(column.id)?.last === !0 ? "" : void 0,
1620
+ style: headCellStyle(pinned.get(column.id), trackColumn?.get(column.id)),
1621
+ className: alignmentClass(column),
1622
+ children: [
1623
+ sortable ? /* @__PURE__ */ jsxs2(
1624
+ "button",
1625
+ {
1626
+ type: "button",
1627
+ className: "bp-sort",
1628
+ "data-bp-sort": column.id,
1629
+ "data-bp-sort-direction": active,
1630
+ onClick: () => onToggleSort(column),
1631
+ children: [
1632
+ /* @__PURE__ */ jsx3("span", { className: "bp-head-label", children: text }),
1633
+ /* @__PURE__ */ jsx3(SortChevron, { direction: active ?? firstSortDirection(column) })
1634
+ ]
1635
+ }
1636
+ ) : /* @__PURE__ */ jsx3("span", { className: "bp-head-label", children: text }),
1637
+ hasSubLabels ? column.subLabel === void 0 ? /* @__PURE__ */ jsx3("span", { className: "bp-head-sub bp-head-sub-spacer", "aria-hidden": "true" }) : /* @__PURE__ */ jsx3("span", { className: "bp-head-sub", children: column.subLabel }) : null
1638
+ ]
1639
+ },
1640
+ column.id
1641
+ );
1642
+ }) })
1643
+ ] });
1644
+ }
1645
+ function headText(column, theme) {
1646
+ return `${columnHeadLabel(column.label, theme ?? {})}${columnHeaderAffix(column)}`;
1647
+ }
1648
+ function headCellStyle(pin, gridColumn) {
1649
+ if (!(pin === void 0 && gridColumn === void 0))
1650
+ return {
1651
+ ...pin === void 0 ? {} : { "--bp-pin-left": `${pin.left}px` },
1652
+ ...gridColumn === void 0 ? {} : { gridColumn }
1653
+ };
1654
+ }
1655
+ function TableRowGroup({ node, hidden, ...shared }) {
1656
+ let collapsed = shared.collapsedSet.has(node.row.id), [closing, setClosing] = useState3(!1), [seenCollapsed, setSeenCollapsed] = useState3(collapsed);
1657
+ seenCollapsed !== collapsed && (setSeenCollapsed(collapsed), setClosing(collapsed && !shared.mountCollapsed));
1658
+ let closed = useCallback2(() => setClosing(!1), []);
1659
+ return /* @__PURE__ */ jsxs2(
1660
+ "div",
1661
+ {
1662
+ className: "bp-rowwrap",
1663
+ "data-bp-row-wrap": node.row.id,
1664
+ "data-bp-defer-row": !shared.mountCollapsed && node.children.length === 0 ? "" : void 0,
1665
+ style: !shared.mountCollapsed && node.children.length === 0 ? { "--bp-defer-lines": visibleInlineRows(node.row, shared.inlineVisibility).length } : void 0,
1666
+ children: [
1667
+ /* @__PURE__ */ jsx3(TableGridRow, { row: node.row, collapsed, hidden, ...shared }),
1668
+ node.children.length > 0 && (shared.mountCollapsed || !collapsed || closing) ? /* @__PURE__ */ jsx3(TableChildren, { rowId: node.row.id, collapsed, onClosed: closing ? closed : void 0, children: node.children.map((child) => /* @__PURE__ */ jsx3(TableRowGroup, { node: child, hidden: hidden || collapsed, ...shared }, child.row.id)) }) : null
1669
+ ]
1670
+ }
1671
+ );
1672
+ }
1673
+ var TableRowPage = memo(function({ nodes, index, contain, ...shared }) {
1674
+ return /* @__PURE__ */ jsx3(
1675
+ "div",
1676
+ {
1677
+ "data-bp-row-page": index,
1678
+ style: index > 0 && contain ? { contentVisibility: "auto", blockSize: `calc(var(--bp-row-pitch, calc(round(up, calc((var(--bp-label-size) + var(--bp-size-step)) * var(--bp-line-ratio)), 1px) + 2 * var(--bp-pad-anchor) + var(--bp-stroke-hair))) * ${nodes.length})` } : void 0,
1679
+ children: nodes.map((node) => /* @__PURE__ */ jsx3(TableRowGroup, { node, hidden: !1, ...shared }, node.row.id))
1680
+ }
1681
+ );
1682
+ });
1683
+ function TableChildren({ rowId, collapsed, onClosed, children }) {
1684
+ let element = useRef3(null), previous = useRef3(collapsed), closedRef = useRef3(onClosed);
1685
+ return closedRef.current = onClosed, useIsomorphicLayoutEffect(() => {
1686
+ let node = element.current;
1687
+ if (node === null || previous.current === collapsed) return;
1688
+ previous.current = collapsed, collapsed && node.style.maxHeight === "" && (node.style.maxHeight = "none");
1689
+ let natural = node.scrollHeight;
1690
+ node.style.maxHeight = collapsed ? `${natural}px` : "0px", node.offsetHeight, node.style.maxHeight = collapsed ? "0px" : `${natural}px`;
1691
+ let still = () => getComputedStyle(node).transitionDuration.split(",").every((duration) => parseFloat(duration) === 0);
1692
+ !collapsed && still() && (node.style.maxHeight = ""), collapsed && closedRef.current !== void 0 && (natural === 0 || still()) && closedRef.current();
1693
+ }, [collapsed]), /* @__PURE__ */ jsx3(
1694
+ "div",
1695
+ {
1696
+ ref: element,
1697
+ className: "bp-children",
1698
+ "data-bp-children": rowId,
1699
+ "data-bp-collapsed": collapsed ? "" : void 0,
1700
+ "aria-hidden": collapsed ? "true" : void 0,
1701
+ onTransitionEnd: (event) => {
1702
+ event.target !== event.currentTarget || event.propertyName !== "max-height" || (!collapsed && element.current && (element.current.style.maxHeight = ""), collapsed && closedRef.current?.());
1703
+ },
1704
+ children
1705
+ }
1706
+ );
1707
+ }
1708
+ function TableGridRow({
1709
+ palette,
1710
+ row,
1711
+ rowIndices,
1712
+ columnIndices,
1713
+ isTree,
1714
+ light,
1715
+ floating = !1,
1716
+ closers,
1717
+ columns,
1718
+ hiddenColumns,
1719
+ collapsed,
1720
+ hidden,
1721
+ anchorWash,
1722
+ barMaxima,
1723
+ grounds,
1724
+ groundMode,
1725
+ heatLanes,
1726
+ sparkDomains,
1727
+ sparkWidths,
1728
+ theme,
1729
+ measure,
1730
+ groupMarks,
1731
+ levelNouns,
1732
+ childCounts,
1733
+ inlineVisibility,
1734
+ onToggleRow,
1735
+ readOnly,
1736
+ staticMarks,
1737
+ onSelect,
1738
+ selectable,
1739
+ labelLead,
1740
+ filler,
1741
+ focus,
1742
+ pinned,
1743
+ trackColumn,
1744
+ columnEdges,
1745
+ figures,
1746
+ foldOn,
1747
+ liteSlots,
1748
+ columnPlan
1749
+ }) {
1750
+ let foldable = row.hasChildren && row.foldable !== !1, toggles = foldable && !readOnly, mark = toggles ? /* @__PURE__ */ jsx3(TreeToggle, { row, collapsed, hidden, onToggleRow }) : foldable && staticMarks ? /* @__PURE__ */ jsx3(OutlineMark, { collapsed }) : null, rowLabel = columns.find((column) => column.kind === "rowLabel"), childCount = childCounts.get(row.id) ?? 0, labelNote = row.cells[rowLabel.id]?.note !== void 0, selects = onSelect !== void 0 && row.role !== "section" && selectable?.(row, { collapsed }) !== !1, foldsOnRow = toggles && (foldOn ?? (selects ? "toggle" : "row")) === "row", handleRowClick = (event) => {
1751
+ let target = event.target;
1752
+ target instanceof Element && target.closest("a,button") || (foldsOnRow && onToggleRow(row.id), selects && onSelect(row, event, eventColumn(event)));
1753
+ }, handleRowKey = (event) => {
1754
+ if (event.defaultPrevented || event.key !== "Enter" && event.key !== " ") return;
1755
+ let target = event.target;
1756
+ !(target instanceof Element) || target.closest('[role="gridcell"],[role="rowheader"]') !== target || (event.preventDefault(), foldsOnRow && target.getAttribute("role") === "rowheader" && onToggleRow(row.id), onSelect(row, event, eventColumn(event)));
1757
+ }, step = Math.min(3, row.step), style = {
1758
+ "--bp-level": row.step,
1759
+ ...row.spacer === void 0 ? {} : { "--bp-row-spacer": `${row.spacer}px` }
1760
+ }, sectionCell = row.role === "section" ? cellAttributes(row.cells[rowLabel.id], rowLabel, focus, groupMarks, hiddenColumns, hidden) : void 0;
1761
+ if (floating && sectionCell !== void 0) for (let key of ["data-col-id", "data-bp-row", "data-bp-column", "data-bp-label", "data-bp-mark"]) delete sectionCell[key];
1762
+ let sectionPin = row.role === "section" && alignmentClass(rowLabel) === void 0 ? pinned.get(rowLabel.id) : void 0, pinnedSpan = row.role === "section" && theme.table?.blockRule === "rule" && trackColumn === void 0 && pinned.size > 0 ? columns.findIndex((column) => !pinned.has(column.id)) : -1, restStart = pinnedSpan > 0 ? columnEdges.left.get(columns[pinnedSpan].id) ?? 0 : 0, sectionRules = (inPinned, start) => row.role !== "section" ? null : columnEdges.groupStart.filter((id) => pinnedSpan > 0 ? pinned.has(id) === inPinned : !pinned.has(id)).map((id) => /* @__PURE__ */ jsx3("span", { "aria-hidden": "true", className: "bp-section-rule", style: { insetInlineStart: `${columnEdges.left.get(id) - start}px` } }, id));
1763
+ return /* @__PURE__ */ jsxs2(
1764
+ "div",
1765
+ {
1766
+ role: "row",
1767
+ className: row.role === "total" && row.kind !== "result" && row.kind !== "driver" ? "bp-total" : void 0,
1768
+ "aria-rowindex": hidden || floating ? void 0 : rowIndices.get(row.id),
1769
+ "aria-level": isTree && !floating ? row.level + 1 : void 0,
1770
+ "aria-expanded": isTree && foldable && !floating ? !collapsed : void 0,
1771
+ "data-row-id": floating ? void 0 : row.id,
1772
+ "data-bp-row": floating ? void 0 : row.id,
1773
+ "data-bp-floating": floating ? "" : void 0,
1774
+ "data-parent-id": row.parentId,
1775
+ "data-has-children": row.hasChildren ? "true" : void 0,
1776
+ "data-bp-kind": row.kind,
1777
+ "data-bp-driver-tone": row.driverTone ? "" : void 0,
1778
+ "data-bp-final": closers.has(row.id) ? "" : void 0,
1779
+ "data-bp-divider": row.divider ? "" : void 0,
1780
+ "data-bp-member-open": row.kind === "member" && row.hasChildren && !collapsed ? "" : void 0,
1781
+ "data-bp-ground": row.kind === "member" ? row.hasChildren && !collapsed && groundMode !== "none" ? "band" : void 0 : row.kind === "measure" || row.kind === "detail" || row.kind === "split" || row.kind === "subtotal" || row.kind === "result" || row.kind === "driver" ? void 0 : row.role === "total" ? "emphasis" : (groundMode === "always" || groundMode === "expanded" && row.hasChildren && !collapsed) && grounds.has(row.id) ? "band" : void 0,
1782
+ "data-anchor": anchorWash && row.step === 0 && row.hasChildren ? "" : void 0,
1783
+ "data-level": row.level,
1784
+ "data-bp-step": step,
1785
+ "data-role": row.role,
1786
+ "data-relation": row.relation,
1787
+ "data-highlight-tone": row.highlightTone,
1788
+ "data-bp-spacer": row.spacer === void 0 ? void 0 : "",
1789
+ "data-bp-selectable": selects ? "" : void 0,
1790
+ style,
1791
+ onClick: foldsOnRow || selects ? handleRowClick : void 0,
1792
+ onKeyDown: selects ? handleRowKey : void 0,
1793
+ children: [
1794
+ row.role === "section" ? /* @__PURE__ */ jsxs2(
1795
+ "div",
1796
+ {
1797
+ role: "rowheader",
1798
+ "aria-colindex": 1,
1799
+ "aria-colspan": columnIndices.size,
1800
+ ...sectionCell,
1801
+ ...toggles ? expandableCellProps(row, collapsed, onToggleRow, foldsOnRow && !selects) : {},
1802
+ "data-bp-section-pin": sectionPin === void 0 || pinnedSpan > 0 ? void 0 : "",
1803
+ "data-bp-pin": pinnedSpan > 0 ? "" : void 0,
1804
+ "data-bp-pin-last": pinnedSpan > 0 ? "" : void 0,
1805
+ style: {
1806
+ ...sectionCell?.style,
1807
+ ...sectionPin === void 0 ? {} : { "--bp-pin-left": `${sectionPin.left}px` },
1808
+ gridColumn: pinnedSpan > 0 ? `1 / ${pinnedSpan + 1}` : "1 / -1"
1809
+ },
1810
+ children: [
1811
+ sectionRules(!0, 0),
1812
+ row.badge === void 0 ? /* @__PURE__ */ jsx3(
1813
+ CellContent,
1814
+ {
1815
+ cell: row.cells[rowLabel.id],
1816
+ column: rowLabel,
1817
+ row,
1818
+ mark,
1819
+ after: /* @__PURE__ */ jsx3(CollapsedHint, { row, collapsed, count: childCount, levelNouns })
1820
+ }
1821
+ ) : (
1822
+ // The heading's text gives way, the chip never does. Its
1823
+ // paints are chipPaints, the SVG's, through the chip variables.
1824
+ // The line carries the mark too, so mark, heading and chip share one centre.
1825
+ /* @__PURE__ */ jsxs2("span", { className: "bp-section-line", children: [
1826
+ mark,
1827
+ /* @__PURE__ */ jsx3(CellContent, { cell: row.cells[rowLabel.id], column: rowLabel, row }),
1828
+ /* @__PURE__ */ jsx3("span", { className: "bp-section-badge", "data-tone": row.badge.tone === "neutral" ? void 0 : row.badge.tone, children: /* @__PURE__ */ jsx3("span", { className: "bp-chip", children: row.badge.text }) }),
1829
+ /* @__PURE__ */ jsx3(CollapsedHint, { row, collapsed, count: childCount, levelNouns })
1830
+ ] })
1831
+ )
1832
+ ]
1833
+ }
1834
+ ) : null,
1835
+ pinnedSpan > 0 ? /* @__PURE__ */ jsx3("div", { "aria-hidden": "true", "data-bp-section-rest": "", style: { gridColumn: `${pinnedSpan + 1} / -1` }, children: sectionRules(!1, restStart) }) : null,
1836
+ row.role === "section" ? null : (columnPlan ?? columns.map((_, index) => index)).map((entry) => {
1837
+ if (typeof entry == "object") return /* @__PURE__ */ jsx3(LiteRun, { row, columns, columnIndices, from: entry.from, to: entry.to, trackColumn, slots: liteSlots, inlineVisibility }, `lite:${entry.from}`);
1838
+ let index = entry, column = columns[index], cell = row.cells[column.id], isLabel = column.kind === "rowLabel";
1839
+ return light ? /* @__PURE__ */ jsx3(
1840
+ "div",
1841
+ {
1842
+ role: isLabel ? "rowheader" : "gridcell",
1843
+ "aria-colindex": columnIndices.get(column.id),
1844
+ ...cellAttributes(
1845
+ cell,
1846
+ column,
1847
+ focus,
1848
+ groupMarks,
1849
+ hiddenColumns,
1850
+ hidden,
1851
+ void 0,
1852
+ { pin: pinned.get(column.id), gridColumn: trackColumn?.get(column.id) }
1853
+ ),
1854
+ children: isLabel ? /* @__PURE__ */ jsx3("span", { className: "bp-value", children: cell.displayed }) : cell.displayed
1855
+ },
1856
+ column.id
1857
+ ) : isLabel ? /* @__PURE__ */ jsxs2(
1858
+ "div",
1859
+ {
1860
+ role: "rowheader",
1861
+ "aria-colindex": columnIndices.get(column.id),
1862
+ title: cellTitle(void 0, cell),
1863
+ ...cellAttributes(
1864
+ cell,
1865
+ column,
1866
+ focus,
1867
+ groupMarks,
1868
+ hiddenColumns,
1869
+ hidden,
1870
+ heatStyle(cell, column, heatLanes.get(column.id), theme, measure, figures),
1871
+ {
1872
+ ...pinned.get(column.id) === void 0 ? {} : { pin: pinned.get(column.id) },
1873
+ ...trackColumn?.get(column.id) === void 0 ? {} : { gridColumn: trackColumn.get(column.id) }
1874
+ }
1875
+ ),
1876
+ ...toggles ? expandableCellProps(row, collapsed, onToggleRow, foldsOnRow && !selects) : {},
1877
+ children: [
1878
+ /* @__PURE__ */ jsx3(
1879
+ CellContent,
1880
+ {
1881
+ cell,
1882
+ column,
1883
+ row,
1884
+ mark,
1885
+ before: labelLead === void 0 ? void 0 : leadBox(labelLead, row),
1886
+ barMaximum: barMaxima.get(column.id),
1887
+ spark: {
1888
+ domain: sparkDomains.get(column.id),
1889
+ width: sparkWidths.get(column.id),
1890
+ theme,
1891
+ measure
1892
+ },
1893
+ after: /* @__PURE__ */ jsx3(CollapsedHint, { row, collapsed, count: childCount, levelNouns })
1894
+ }
1895
+ ),
1896
+ /* @__PURE__ */ jsx3(
1897
+ InlineLines,
1898
+ {
1899
+ row,
1900
+ column,
1901
+ visibility: inlineVisibility
1902
+ }
1903
+ )
1904
+ ]
1905
+ },
1906
+ column.id
1907
+ ) : /* @__PURE__ */ jsx3(
1908
+ GridValueCell,
1909
+ {
1910
+ row,
1911
+ column,
1912
+ colIndex: columnIndices.get(column.id),
1913
+ focus: focus?.rowId === cell.rowId && focus.colId === column.id ? focus : void 0,
1914
+ groupMarks,
1915
+ hiddenColumns,
1916
+ hidden,
1917
+ palette,
1918
+ heatLane: heatLanes.get(column.id),
1919
+ theme,
1920
+ measure,
1921
+ figures,
1922
+ pin: pinned.get(column.id),
1923
+ gridColumn: trackColumn?.get(column.id),
1924
+ labelNote,
1925
+ barMaximum: barMaxima.get(column.id),
1926
+ sparkDomain: sparkDomains.get(column.id),
1927
+ sparkWidth: sparkWidths.get(column.id),
1928
+ inlineVisibility
1929
+ },
1930
+ column.id
1931
+ );
1932
+ }),
1933
+ filler === void 0 || row.role === "section" ? null : /* @__PURE__ */ jsx3("div", { "aria-hidden": "true", "data-bp-filler": "", style: filler.gridColumn === void 0 ? void 0 : { gridColumn: filler.gridColumn } })
1934
+ ]
1935
+ }
1936
+ );
1937
+ }
1938
+ var LiteRun = memo(function({ row, columns, columnIndices, from, to, trackColumn, slots, inlineVisibility }) {
1939
+ let first = columns[from], last = columns[to], startLine = trackColumn?.get(first.id), endLine = trackColumn?.get(last.id), spans = [];
1940
+ for (let index = from; index <= to; index++) {
1941
+ let column = columns[index], slot = slots.get(column.id), next = index < to ? slots.get(columns[index + 1].id) : void 0;
1942
+ if (!columnIndices.has(column.id)) continue;
1943
+ let width = slot === void 0 ? 0 : next === void 0 ? slot.width : next.start - slot.start;
1944
+ spans.push(/* @__PURE__ */ jsx3("span", { role: "gridcell", "aria-colindex": columnIndices.get(column.id), style: { flex: `0 0 ${width}px`, overflow: "hidden" }, children: liteText(row, column, inlineVisibility) }, column.id));
1945
+ }
1946
+ return /* @__PURE__ */ jsx3("div", { "data-bp-lite": "", style: { ...startLine === void 0 || endLine === void 0 ? {} : { gridColumn: `${startLine} / ${endLine + 1}` }, display: "flex", flexDirection: "row", overflow: "hidden", whiteSpace: "nowrap", minWidth: 0, contentVisibility: "auto", containIntrinsicSize: "auto 1px auto 1em" }, children: spans });
1947
+ });
1948
+ function liteText(row, column, inlineVisibility) {
1949
+ let lines = row.role === "data" ? row.inlineRows ?? [] : [], text = row.cells[column.id]?.displayed ?? "";
1950
+ for (let line of lines) {
1951
+ if (inlineVisibility[line.inlineGroup ?? line.id] === !1) continue;
1952
+ let part = line.cells[column.id]?.displayed ?? "";
1953
+ part !== "" && (text = text === "" ? part : `${text} ${part}`);
1954
+ }
1955
+ return text;
1956
+ }
1957
+ var liteStyle = (gridColumn) => ({ ...gridColumn === void 0 ? {} : { gridColumn }, overflow: "hidden", whiteSpace: "nowrap" }), GridValueCell = memo(function({ palette, row, column, colIndex, focus, groupMarks, hiddenColumns, hidden, heatLane, theme, measure, figures, pin, gridColumn, labelNote, barMaximum, sparkDomain, sparkWidth, inlineVisibility }) {
1958
+ let cell = row.cells[column.id];
1959
+ return /* @__PURE__ */ jsxs2(
1960
+ "div",
1961
+ {
1962
+ role: "gridcell",
1963
+ "aria-colindex": colIndex,
1964
+ title: cellTitle(inlineTitle(row, column.id), cell),
1965
+ ...cellAttributes(
1966
+ cell,
1967
+ column,
1968
+ focus,
1969
+ groupMarks,
1970
+ hiddenColumns,
1971
+ hidden,
1972
+ heatStyle(cell, column, heatLane, theme, measure, figures),
1973
+ { ...pin === void 0 ? {} : { pin }, ...gridColumn === void 0 ? {} : { gridColumn } }
1974
+ ),
1975
+ children: [
1976
+ /* @__PURE__ */ jsx3(CellContent, { cell, column, row, barMaximum, spark: { domain: sparkDomain, width: sparkWidth, theme, measure, palette } }),
1977
+ labelNote ? /* @__PURE__ */ jsx3("span", { className: "bp-note-spacer", "aria-hidden": "true" }) : null,
1978
+ /* @__PURE__ */ jsx3(InlineLines, { row, column, visibility: inlineVisibility, noteLine: column.noteLine === !0 ? cell.note : void 0 })
1979
+ ]
1980
+ }
1981
+ );
1982
+ });
1983
+ function InlineLines({ row, column, visibility, noteLine }) {
1984
+ let lines = row.inlineRows;
1985
+ if (column.kind !== "rowLabel" && column.kind !== "value" && column.kind !== "computed") return null;
1986
+ if (lines === void 0 || row.role !== "data")
1987
+ return noteLine === void 0 ? null : /* @__PURE__ */ jsx3("span", { className: "bp-note-line", children: noteLine });
1988
+ let notePlaced = noteLine === void 0;
1989
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
1990
+ lines.map((line) => {
1991
+ let group = line.inlineGroup ?? line.id, cell = line.cells[column.id], signed = line.polarity !== void 0 && column.kind !== "rowLabel", toned = column.kind !== "rowLabel" && cell?.state === "value" && cell.tone !== "neutral", text = column.kind === "rowLabel" ? line.label : cell?.displayed ?? "", holdsValue = cell !== void 0 && cell.state === "value" && cell.displayed !== "", takesNote = !notePlaced && !holdsValue && visibility[group] !== !1;
1992
+ return takesNote && (notePlaced = !0), /* @__PURE__ */ jsx3(
1993
+ "span",
1994
+ {
1995
+ className: takesNote ? "bp-line bp-note-line" : visibility[group] === !1 ? "bp-line bp-line-off" : "bp-line",
1996
+ "data-bp-inline": takesNote ? void 0 : group,
1997
+ "data-bp-line": takesNote ? void 0 : line.id,
1998
+ "data-bp-kind": line.kind,
1999
+ "data-bp-driver-tone": line.driverTone ? "" : void 0,
2000
+ "data-bp-signed": signed && !takesNote ? "" : void 0,
2001
+ "data-tone": toned ? cell.tone : void 0,
2002
+ "data-bp-strong": toned && cell.strong ? "" : void 0,
2003
+ "data-state": !takesNote && column.kind !== "rowLabel" && cell !== void 0 && cell.state !== "value" ? cell.state : void 0,
2004
+ children: takesNote ? noteLine : text
2005
+ },
2006
+ line.id
2007
+ );
2008
+ }),
2009
+ notePlaced ? null : /* @__PURE__ */ jsx3("span", { className: "bp-note-line", children: noteLine })
2010
+ ] });
2011
+ }
2012
+ function cellTitle(lineTitle, cell) {
2013
+ let parts = [lineTitle, cell.band?.label].filter((part) => part !== void 0 && part !== "");
2014
+ return parts.length === 0 ? void 0 : parts.join(" \xB7 ");
2015
+ }
2016
+ function inlineTitle(row, columnId) {
2017
+ let parts = (row.inlineRows ?? []).flatMap((line) => {
2018
+ let cell = line.cells[columnId];
2019
+ return cell === void 0 || cell.displayed === "" ? [] : [`${line.label} ${cell.displayed}`.trim()];
2020
+ });
2021
+ return parts.length === 0 ? void 0 : parts.join(" \xB7 ");
2022
+ }
2023
+ function cellAttributes(cell, column, focus, groupMarks, hiddenColumns, rowHidden, heat, placement = {}) {
2024
+ let classes = [], alignment = alignmentClass(column);
2025
+ alignment !== void 0 && classes.push(alignment), numericCell(cell) && classes.push("bp-figures"), cell.deEmphasized && classes.push("bp-muted");
2026
+ let key = `${encodeURIComponent(cell.rowId)}:${encodeURIComponent(column.id)}`, hidden = hiddenColumns.has(column.id) || rowHidden;
2027
+ return {
2028
+ "data-col-id": column.id,
2029
+ "data-bp-row": cell.rowId,
2030
+ "data-bp-column": column.id,
2031
+ ...column.kind === "rowLabel" ? { "data-bp-label": key } : { "data-bp-mark": key },
2032
+ "data-bp-detail": column.toggleGroup,
2033
+ "data-bp-wrap": column.wrap === !0 ? "" : void 0,
2034
+ "data-bp-hidden": hiddenColumns.has(column.id) ? "" : void 0,
2035
+ "aria-hidden": hiddenColumns.has(column.id) ? "true" : void 0,
2036
+ "data-bp-band": groupMarks.banded.has(column.id) ? "" : void 0,
2037
+ "data-bp-group-start": groupMarks.groupStart.has(column.id) ? "" : void 0,
2038
+ "data-bp-group-end": groupMarks.groupEnd.has(column.id) ? "" : void 0,
2039
+ "data-bp-grounds-only": groupMarks.groundsOnly.has(column.id) ? "" : void 0,
2040
+ "data-emphasis": column.emphasis,
2041
+ "data-state": cell.state,
2042
+ "data-bp-figure": isFigureCell(cell, column) ? "" : void 0,
2043
+ tabIndex: !hidden && focus?.rowId === cell.rowId && focus.colId === column.id ? 0 : -1,
2044
+ "data-tone": cell.tone === "neutral" ? void 0 : cell.tone,
2045
+ "data-bp-strong": cell.strong ? "" : void 0,
2046
+ "data-bp-bar": cell.bar === void 0 || cell.state !== "value" ? void 0 : "",
2047
+ "data-bp-zero": cell.zero ? "" : void 0,
2048
+ "data-encoding": column.kind === "encoding" ? column.encoding?.type ?? "sparkline" : column.cellEncoding?.type === "inCellBar" ? "inCellBar" : column.cellEncoding?.type === "heat" && heat !== void 0 ? "heat" : void 0,
2049
+ "data-bp-pin": placement.pin === void 0 ? void 0 : "",
2050
+ "data-bp-pin-last": placement.pin?.last === !0 ? "" : void 0,
2051
+ // The heat lane is paint, and the cell's own background is where it
2052
+ // belongs: a rule in the stylesheet could not know the value.
2053
+ style: heat === void 0 && placement.pin === void 0 && placement.gridColumn === void 0 && cell.bar === void 0 ? void 0 : {
2054
+ ...cell.bar === void 0 ? {} : { "--bp-bar": String(cell.bar) },
2055
+ ...heat === void 0 ? {} : {
2056
+ ...heat.tint,
2057
+ ...heat.color === void 0 ? {} : { color: heat.color },
2058
+ ...heat.fontWeight === void 0 ? {} : { fontWeight: heat.fontWeight }
2059
+ },
2060
+ ...placement.pin === void 0 ? {} : { "--bp-pin-left": `${placement.pin.left}px` },
2061
+ ...placement.gridColumn === void 0 ? {} : { gridColumn: placement.gridColumn }
2062
+ },
2063
+ className: classes.length > 0 ? classes.join(" ") : void 0
2064
+ };
2065
+ }
2066
+ function heatStyle(cell, column, lane, theme, measure, figures = !0) {
2067
+ let encoding = column.cellEncoding;
2068
+ if (encoding?.type !== "heat" || lane === void 0) return;
2069
+ let { fill, ink, weight } = heatPaint({ cell, theme, measure }, lane, encoding), plain = { token: "ink" };
2070
+ if (!(fill === void 0 && weight === void 0 && figures && JSON.stringify(ink) === JSON.stringify(plain)))
2071
+ return {
2072
+ // No ground where the band has none: an unshaded cell must not paint
2073
+ // over the row's own band.
2074
+ ...fill === void 0 ? {} : { tint: { ...insetTint(resolvePaint(fill, theme)), ...tableGroundTextStyle(theme, fill) } },
2075
+ ...!figures && cell.role !== "total" ? { color: "transparent" } : JSON.stringify(ink) === JSON.stringify(plain) ? {} : { color: resolvePaint(ink, theme) },
2076
+ ...weight === void 0 ? {} : { fontWeight: weight }
2077
+ };
2078
+ }
2079
+ function groupHeadingFace(fonts) {
2080
+ let group = fonts.group;
2081
+ return { ...group, letterSpacing: Math.round((group.letterSpacing ?? 0) * 1e3) / 1e3 };
2082
+ }
2083
+ function headVars(fonts) {
2084
+ let face = groupHeadingFace(fonts);
2085
+ return {
2086
+ "--bp-header-size": `${fonts.header.size}px`,
2087
+ "--bp-header-tracking": `${Math.round((fonts.header.letterSpacing ?? 0) * 1e3) / 1e3}px`,
2088
+ "--bp-group-head-size": `${face.size}px`,
2089
+ "--bp-group-head-tracking": `${face.letterSpacing}px`
2090
+ };
2091
+ }
2092
+ function alignmentClass(column) {
2093
+ return column.align === "right" ? "bp-num" : column.align === "center" ? "bp-center" : void 0;
2094
+ }
2095
+ function expandableCellProps(row, collapsed, onToggleRow, foldsOnKey) {
2096
+ return !row.hasChildren || row.foldable === !1 ? {} : {
2097
+ "aria-expanded": !collapsed,
2098
+ onKeyDown: (event) => {
2099
+ event.target !== event.currentTarget || !(event.key === "ArrowRight" && collapsed || event.key === "ArrowLeft" && !collapsed) && (!foldsOnKey || event.key !== "Enter" && event.key !== " ") || event.ctrlKey || event.metaKey || event.altKey || (event.preventDefault(), onToggleRow(row.id));
2100
+ }
2101
+ };
2102
+ }
2103
+ function TreeToggle({ row, collapsed, hidden, onToggleRow }) {
2104
+ return /* @__PURE__ */ jsx3(
2105
+ "button",
2106
+ {
2107
+ type: "button",
2108
+ className: "bp-tree-toggle",
2109
+ "data-bp-toggle-row": "",
2110
+ "aria-expanded": !collapsed,
2111
+ "aria-label": `${collapsed ? "Expand" : "Collapse"} ${row.label}`,
2112
+ tabIndex: hidden ? -1 : void 0,
2113
+ onClick: (event) => {
2114
+ event.stopPropagation(), onToggleRow(row.id);
2115
+ },
2116
+ children: /* @__PURE__ */ jsx3("svg", { width: "8", height: "8", viewBox: "0 0 8 8", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsx3(
2117
+ "path",
2118
+ {
2119
+ d: collapsed ? "M1 4h6M4 1v6" : "M1 4h6",
2120
+ stroke: "currentColor",
2121
+ strokeWidth: "var(--bp-stroke-mark)",
2122
+ strokeLinecap: "round",
2123
+ fill: "none"
2124
+ }
2125
+ ) })
2126
+ }
2127
+ );
2128
+ }
2129
+ function leadBox(lead, row) {
2130
+ let glyph = lead.render(row);
2131
+ if (!(glyph == null || glyph === !1))
2132
+ return /* @__PURE__ */ jsx3("span", { className: "bp-label-lead", style: { width: lead.width }, children: glyph });
2133
+ }
2134
+ function OutlineMark({ collapsed }) {
2135
+ return /* @__PURE__ */ jsx3("span", { className: "bp-tree-mark", "data-bp-outline-mark": collapsed ? "closed" : "open", "aria-hidden": "true", children: /* @__PURE__ */ jsx3("svg", { width: "8", height: "8", viewBox: "0 0 8 8", focusable: "false", children: /* @__PURE__ */ jsx3("path", { d: collapsed ? "M1 4h6M4 1v6" : "M1 4h6", stroke: "currentColor", strokeWidth: "var(--bp-stroke-mark)", strokeLinecap: "round", fill: "none" }) }) });
2136
+ }
2137
+ function CollapsedHint({ row, collapsed, count, levelNouns }) {
2138
+ if (!collapsed || !row.hasChildren || count === 0) return null;
2139
+ let noun = levelNouns?.[row.level + 1];
2140
+ return noun === void 0 ? null : /* @__PURE__ */ jsx3("span", { className: "bp-hint", children: `\xB7 ${count} ${count === 1 ? noun.one : noun.other}` });
2141
+ }
2142
+ var SPARK_CELL_HEIGHT = 28;
2143
+ function SparklineCell({ cell, column, row, spark }) {
2144
+ let encoding = column.encoding, width = spark.width;
2145
+ if (encoding?.type !== "sparkline" || width === void 0 || row.role === "section")
2146
+ return /* @__PURE__ */ jsx3("span", { className: "bp-muted", children: "\u2014" });
2147
+ let values = sparklineSourceValues(row, encoding.sourceColumns), last = lastObservedIndex(values), lastSource = last === void 0 ? void 0 : encoding.sourceColumns[last], nodes = emitSparkline(
2148
+ {
2149
+ cell,
2150
+ box: { x: 0, y: 0, w: width, h: SPARK_CELL_HEIGHT },
2151
+ theme: spark.theme,
2152
+ measure: spark.measure,
2153
+ nodeId: (suffix) => tableCellNodeId(suffix, row.id, column.id),
2154
+ owner: { rowId: row.id, colId: column.id }
2155
+ },
2156
+ values,
2157
+ {
2158
+ kind: encoding.kind ?? "line",
2159
+ domain: spark.domain ?? { min: 0, max: 0 },
2160
+ lastText: lastSource === void 0 ? void 0 : row.cells[lastSource]?.displayed
2161
+ }
2162
+ );
2163
+ return /* @__PURE__ */ jsxs2(Fragment, { children: [
2164
+ /* @__PURE__ */ jsx3(
2165
+ "svg",
2166
+ {
2167
+ className: "bp-spark",
2168
+ width,
2169
+ height: SPARK_CELL_HEIGHT,
2170
+ viewBox: `0 0 ${width} ${SPARK_CELL_HEIGHT}`,
2171
+ "aria-hidden": "true",
2172
+ focusable: "false",
2173
+ children: nodes.map((node) => sparkNode(node, spark.theme))
2174
+ }
2175
+ ),
2176
+ /* @__PURE__ */ jsx3("span", { className: "bp-spark-text", children: sparklineSummary(row, encoding.sourceColumns, spark.theme.table?.glyphs?.missing ?? "\u2014") })
2177
+ ] });
2178
+ }
2179
+ function sparklineSummary(row, sourceColumns, missing) {
2180
+ let drawn = sourceColumns.map((id) => row.cells[id]).filter((candidate) => candidate?.state === "value");
2181
+ return drawn.length === 0 ? missing : drawn.length === 1 ? drawn[0].displayed : `${drawn[0].displayed} \u2192 ${drawn[drawn.length - 1].displayed}`;
2182
+ }
2183
+ function sparkNode(node, theme) {
2184
+ let common = { key: node.id, ...sceneAttributes(node) };
2185
+ switch (node.t) {
2186
+ case "path":
2187
+ return /* @__PURE__ */ jsx3(
2188
+ "path",
2189
+ {
2190
+ ...common,
2191
+ d: node.d,
2192
+ fill: node.fill === void 0 ? "none" : resolvePaint(node.fill, theme),
2193
+ stroke: node.stroke === void 0 ? void 0 : resolvePaint(node.stroke, theme),
2194
+ strokeWidth: node.width,
2195
+ strokeLinecap: "round",
2196
+ strokeLinejoin: "round"
2197
+ }
2198
+ );
2199
+ case "rect":
2200
+ return /* @__PURE__ */ jsx3(
2201
+ "rect",
2202
+ {
2203
+ ...common,
2204
+ x: node.rect.x,
2205
+ y: node.rect.y,
2206
+ width: node.rect.w,
2207
+ height: node.rect.h,
2208
+ fill: node.fill === void 0 ? "none" : resolvePaint(node.fill, theme)
2209
+ }
2210
+ );
2211
+ case "circle":
2212
+ return /* @__PURE__ */ jsx3(
2213
+ "circle",
2214
+ {
2215
+ ...common,
2216
+ cx: node.cx,
2217
+ cy: node.cy,
2218
+ r: node.r,
2219
+ fill: node.fill === void 0 ? "none" : resolvePaint(node.fill, theme)
2220
+ }
2221
+ );
2222
+ case "text":
2223
+ return /* @__PURE__ */ jsx3(
2224
+ "text",
2225
+ {
2226
+ ...common,
2227
+ x: node.x,
2228
+ y: node.y + node.font.size * SPARK_TEXT_ASCENT,
2229
+ textAnchor: node.align === "end" ? "end" : node.align === "middle" ? "middle" : "start",
2230
+ fontFamily: node.font.family,
2231
+ fontSize: node.font.size,
2232
+ fontWeight: node.font.weight,
2233
+ fill: resolvePaint(node.ink, theme),
2234
+ children: node.lines.join(" ")
2235
+ }
2236
+ );
2237
+ default:
2238
+ return null;
2239
+ }
2240
+ }
2241
+ var SPARK_TEXT_ASCENT = 0.88;
2242
+ function CellContent({
2243
+ cell,
2244
+ column,
2245
+ row,
2246
+ barMaximum = 0,
2247
+ spark,
2248
+ after,
2249
+ before,
2250
+ mark
2251
+ }) {
2252
+ let main;
2253
+ if (column.kind === "encoding" && row !== void 0 && spark !== void 0)
2254
+ main = /* @__PURE__ */ jsx3(SparklineCell, { cell, column, row, spark });
2255
+ else if (hasPolarityBadge(cell, column) && spark !== void 0 && row !== void 0)
2256
+ main = /* @__PURE__ */ jsx3("span", { className: "bp-chip bp-polarity-badge", style: { color: resolvePaint(polarityBadgeInk(spark.theme, cell, column, row, spark.palette), spark.theme) }, children: cell.displayed });
2257
+ else if (cell.kind === "status" && cell.state === "value" && column.statusMark === "square")
2258
+ main = /* @__PURE__ */ jsxs2("span", { className: "bp-status-mark", "data-status": typeof cell.raw == "string" ? cell.raw : cell.displayed, children: [
2259
+ /* @__PURE__ */ jsx3("span", { className: "bp-status-square", "aria-hidden": "true" }),
2260
+ /* @__PURE__ */ jsx3("span", { className: "bp-status-text", children: cell.displayed })
2261
+ ] });
2262
+ else if (cell.kind === "status" && cell.state === "value")
2263
+ main = /* @__PURE__ */ jsx3(
2264
+ "span",
2265
+ {
2266
+ className: "bp-chip",
2267
+ "data-status": typeof cell.raw == "string" ? cell.raw : cell.displayed,
2268
+ children: cell.displayed
2269
+ }
2270
+ );
2271
+ else if (column.cellEncoding?.type === "inCellBar" && cell.state === "value" && typeof cell.raw == "number") {
2272
+ let scale = barMaximum > 0 ? Math.min(100, 100 * Math.abs(cell.raw) / barMaximum) : 0;
2273
+ main = /* @__PURE__ */ jsxs2("span", { className: "bp-in-cell-bar", "data-bar-sign": cell.raw !== 0 && badSide(cell.raw < 0, cell.polarity) ? "negative" : "positive", children: [
2274
+ /* @__PURE__ */ jsx3("span", { className: "bp-in-cell-track", "aria-hidden": "true", children: /* @__PURE__ */ jsx3("span", { className: "bp-in-cell-fill", style: { width: `${scale}%` } }) }),
2275
+ /* @__PURE__ */ jsx3("span", { className: "bp-in-cell-value", children: cell.displayed })
2276
+ ] });
2277
+ } else column.cellEncoding?.type === "arrow" && column.kind === "computed" && column.polarity !== void 0 && cell.state === "value" && typeof cell.raw == "number" ? main = /* @__PURE__ */ jsxs2(Fragment, { children: [
2278
+ /* @__PURE__ */ jsx3("span", { className: "bp-arrow", "aria-hidden": "true", children: arrowGlyph(cell.raw, barMaximum, column.cellEncoding.scale) }),
2279
+ cell.displayed
2280
+ ] }) : column.kind === "rowLabel" ? main = splitNameBreaks(cell.displayed).flatMap((piece, index) => index === 0 ? [piece] : [/* @__PURE__ */ jsx3("wbr", {}, index), piece]) : main = cell.displayed;
2281
+ let underLabel = column.kind === "rowLabel" && cell.note !== void 0, onItsOwnLine = underLabel || column.noteLine === !0, unit = column.kind === "rowLabel" ? row?.unitAffix : void 0, content = /* @__PURE__ */ jsxs2(Fragment, { children: [
2282
+ before,
2283
+ column.kind === "rowLabel" && row?.operator !== void 0 ? /* @__PURE__ */ jsx3("span", { className: "bp-operator", "aria-hidden": "true", children: row.operator }) : null,
2284
+ main,
2285
+ unit === void 0 ? null : /* @__PURE__ */ jsx3("span", { className: "bp-unit-affix", children: unit }),
2286
+ cell.note === void 0 || onItsOwnLine ? null : /* @__PURE__ */ jsx3("span", { className: "bp-note", children: cell.note })
2287
+ ] }), href = safeHref(cell.href), drawn = /* @__PURE__ */ jsxs2("span", { className: "bp-value", title: column.kind === "rowLabel" ? cell.displayed : void 0, children: [
2288
+ href === void 0 ? content : /* @__PURE__ */ jsx3("a", { href, rel: "noopener", children: content }),
2289
+ after
2290
+ ] }), value = mark == null ? drawn : /* @__PURE__ */ jsxs2("span", { className: "bp-label-line", children: [
2291
+ mark,
2292
+ drawn
2293
+ ] });
2294
+ return underLabel ? /* @__PURE__ */ jsxs2(Fragment, { children: [
2295
+ value,
2296
+ /* @__PURE__ */ jsx3("span", { className: "bp-note-line", children: cell.note })
2297
+ ] }) : value;
2298
+ }
2299
+ function safeHref(href) {
2300
+ if (href === void 0) return;
2301
+ let trimmed = href.trim();
2302
+ return SAFE_HREF.test(trimmed) ? trimmed : void 0;
2303
+ }
2304
+ function TableThemeStyle({ stylesheet, scope, nonce }) {
2305
+ let [attached, setAttached] = useState3(!1), inline = useRef3(null), root = useRef3(void 0), key = `${nonce ?? ""}\0${stylesheet}`, css = useMemo2(() => stylesheetBody(stylesheet).replace(
2306
+ /([^{}]+)([{}])/g,
2307
+ (match, selector, brace) => brace === "}" ? match : `${selector.replace(/\.bp-table(-grid)?(?![\w-])/g, (_hit, grid) => `.bp-table${grid ?? ""}[data-bp-table-theme="${scope}"]`)}{`
2308
+ ) + `
2309
+ .bp-table[data-bp-motion="reduce"] .bp-tree-toggle,.bp-table[data-bp-motion="reduce"] [role="row"],.bp-table[data-bp-motion="reduce"] [role="row"]>*,.bp-table[data-bp-motion="reduce"] .bp-line,.bp-table[data-bp-motion="reduce"] .bp-children{transition:none;animation:none}
2310
+ @media(prefers-reduced-motion:reduce){.bp-table:not([data-bp-motion="full"]) .bp-tree-toggle,.bp-table:not([data-bp-motion="full"]) [role="row"],.bp-table:not([data-bp-motion="full"]) [role="row"]>*,.bp-table:not([data-bp-motion="full"]) .bp-line,.bp-table:not([data-bp-motion="full"]) .bp-children{transition:none;animation:none}}`, [stylesheet, scope]);
2311
+ return useIsomorphicLayoutEffect(() => {
2312
+ root.current ??= inline.current?.getRootNode();
2313
+ let found = root.current, owner = found?.nodeType === Node.DOCUMENT_NODE || found?.nodeType === Node.DOCUMENT_FRAGMENT_NODE && "host" in found ? found : document, doc = owner.ownerDocument ?? owner, styles = styleRegistry.get(owner);
2314
+ styles === void 0 && (styles = /* @__PURE__ */ new Map(), styleRegistry.set(owner, styles));
2315
+ let entry = styles.get(key);
2316
+ if (entry !== void 0 && !entry.element.isConnected && (styles.delete(key), entry = void 0), entry === void 0) {
2317
+ let element = doc.createElement("style");
2318
+ element.dataset.bpTableTheme = scope, nonce !== void 0 && (element.nonce = nonce), element.textContent = css, (owner === doc ? doc.head : owner).append(element), entry = { count: 0, element }, styles.set(key, entry);
2319
+ }
2320
+ entry.count += 1;
2321
+ let registered = styles;
2322
+ return () => {
2323
+ let current = registered.get(key);
2324
+ current !== void 0 && (current.count -= 1, current.count === 0 && (current.element.remove(), registered.delete(key)));
2325
+ };
2326
+ }, [key, css, scope, nonce]), useEffect2(() => setAttached(!0), []), attached ? null : /* @__PURE__ */ jsx3("style", { ref: inline, "data-bp-table-theme": scope, nonce, dangerouslySetInnerHTML: { __html: css } });
2327
+ }
2328
+ function stylesheetBody(stylesheet) {
2329
+ let open = "<style>", close = "</style>";
2330
+ if (!stylesheet.startsWith(open) || !stylesheet.endsWith(close))
2331
+ throw new Error("tableStylesheet(theme) must return one <style> element");
2332
+ let body = stylesheet.slice(open.length, -close.length);
2333
+ if (/<\/?style/i.test(body))
2334
+ throw new Error("tableStylesheet(theme) body carries a <style> boundary \u2014 refusing to mount");
2335
+ return body;
2336
+ }
2337
+ function stylesheetHash(value) {
2338
+ let hash = 2166136261;
2339
+ for (let index = 0; index < value.length; index += 1)
2340
+ hash ^= value.charCodeAt(index), hash = Math.imul(hash, 16777619);
2341
+ return (hash >>> 0).toString(36);
2342
+ }
2343
+ registeredType(tableCore);
2344
+ publishTableChart(TableChart);
2345
+
2346
+ // src/react/charts/table.ts
2347
+ var checkOptionKeys = optionKeyCheck({ tree: { target: 0, textScale: 0, textSize: 0, a11y: { title: 0, table: 0 }, mode: 0, belowMinimum: 0, size: { width: 0, height: 0, unit: 0 }, embed: { width: 0 }, margin: { top: 0, right: 0, bottom: 0, left: 0 }, canvas: { margin: { top: 0, right: 0, bottom: 0, left: 0 } }, title: 0, subtitle: { company: 0, measure: 0, period: 0, scenarios: 0 }, unit: 0, unitShown: 0, source: 0, footnotes: 0, notes: { maxListed: 0, placement: 0, maxLines: 0, show: 0, pointer: 0 }, theme: { preset: 0, overrides: 0 }, locale: { language: 0, decimal: 0, thousands: 0, minusGlyph: 0, weekStartsOn: 0 }, strings: sharedKeys10, format: 0, smallValues: 0, palette: 0, labelDensity: 0, labelPlacements: 0, legend: { position: 0, order: 0 }, scaleGroup: { y: 0, id: 0 }, sort: { categories: 0, segments: 0 }, topN: { n: 0, rest: 0, restLabel: 0, showRestCount: 0, threshold: 0 }, highlight: 0, focus: sharedKeys5, colorblindSafe: 0, interactive: 0, annotations: sharedKeys9, mountCollapsed: 0, signs: 0, driverTones: 0, judgements: 0, variant: 0, encodings: sharedKeys7, totalPosition: 0, density: 0, nulls: 0, figures: 0, expansion: { depth: 0, collapsed: 0, expanded: 0, rootsHidden: 0 }, columnVisibility: 0, inlineVisibility: 0, magnitude: 0, foldOn: 0, groupGround: 0, anchorWash: 0, stickyLabels: { head: 0, columns: 0, top: 0, sections: 0 }, frameFill: 0, rowLabelLines: 0, lastTrackFlex: 0, rowExtent: 0, sortIndicator: 0, levelOffset: 0, cellPadX: 0, groupRule: 0, groupAlign: 0, fitFormats: 0, maxGrowth: 0, labelIndent: { base: 0, step: 0 }, outlineMarks: 0 } }), TableChart2 = withRegistered(createTableChart(checkOptionKeys), registeredType(tableCore));
2348
+
2349
+ export {
2350
+ useRowsGate,
2351
+ TableFloorRequestContext,
2352
+ TableChart2 as TableChart
2353
+ };